Commit 1b80516b authored by 刘杰's avatar 刘杰

企业微信前端

parent 10e13acc
......@@ -9,6 +9,24 @@ import {
} from "../publicConfig/config";
export function createNewOrderRelease(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.createNewOrderRelease`, data)
}
export function getOptionEnumMd(type) {
return Request(`/api/query/choice.${type}/action/auto_choice`)
}
export function getOptionEnumThing(data) {
return Request(`/api/query/biz.md.Product.md_product_d001_auto/auto`,data)
}
export function queryCustomerAll(data) {
return Request(`/api/query/biz.md.Customer.md_customer_enable_search1/paging`, data)
}
export function queryDailyReport(data) {
return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_boss_search/paging`, data)
}
export function searchBossCard(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCard`, data)
......@@ -33,6 +51,9 @@ export function BindCompany(data) {
export function selectDailyReport(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.selectDailyReport`, data)
}
export function queryByStaffCode(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.queryByStaffCode`, data)
}
export function selectDailyReportList(data) {
return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_search/paging`, data)
}
......@@ -413,14 +434,14 @@ export function GetBindCompanyInfo(data) {
export function queryOriginalAddress(data) {
return Request(
`/api/entry/{mini}/m-action/biz.md.Address.md_address_m_search.paging`,
`/api/entry/{mini}/m-action/biz.md.Address.md_address_admin_search.paging`,
data
);
}
export function queryDestinationAddress(data) {
return Request(
`/api/entry/{mini}/m-action/biz.md.Address.md_address_search.paging`,
`/api/entry/{mini}/m-action/biz.md.Address.md_address_admin_search.paging`,
data
);
}
......
......@@ -2,7 +2,8 @@
<view class="uploade-file">
<view class="uploade-title" v-if="uploadTitle">
<text style="color: #f56c6c;position: absolute;left: 18rpx;" v-if="required">*</text>
<text>{{uploadTitle}}{{fileList.length}}/6)</text>
<!-- <text>{{uploadTitle}}{{fileList.length}}/6)</text> -->
<text class="label"><text class="label-line"></text>{{uploadTitle}}{{fileList.length}}/6)</text>
</view>
<view class="fileList flex flex_wrap">
<view class="previewImages" v-for="(item,index) in fileDetailList" :key="index">
......@@ -107,6 +108,23 @@
font-size: 28rpx;
color: #8C8C8C;
margin-bottom: 24rpx;
.label {
display: flex;
align-items: center;
font-size: 14px;
color: #333;
margin-bottom: 8px;
.label-line {
display: inline-block;
width: 3px;
height: 14px;
background-color: #2E75E6;
margin-right: 8px;
border-radius: 2px;
}
}
}
.fileList {
......
......@@ -4,7 +4,7 @@
<u-checkbox name="userAuth" shape="circle" size="44" iconSize='44' @change="onChange" />
</u-checkbox-group>
<text>请您详细阅读并授权</text>
<text class="special-text" @click="onVisible(true)">运匠用户协议</text>
<text class="special-text" @click="onVisible(true)">兆驰用户协议</text>
<text></text>
<text class="special-text" @click="onVisible(true)">隐私政策</text>
......
......@@ -64,16 +64,16 @@
<!-- 右侧数据统计 -->
<view class="statistics">
<view class="stat-row" v-if="staffKind==='simulatedBoss'">
<view class="stat-row" v-if="staffKind==='simulatedBoss'||staffKind==='Leader'">
<view class="stat-item">
<view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.shippingCount}}</text>
<text class="number">{{currentSearchData.overview.stats.shippingCount||0}}</text>
<text class="rate">运输中</text>
</view>
</view>
<view class="stat-item">
<view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.positionCount}}</text>
<text class="number">{{currentSearchData.overview.stats.positionCount||0}}</text>
<text class="rate">开启定位</text>
</view>
</view>
......@@ -163,10 +163,6 @@
<!-- 应付模块 -->
<view class="finance-block">
<view class="finance-item payable">
<!-- 左侧图标 -->
<!-- <view class="left-section">
<view class="icon"></view>
</view> -->
<view class="left-section">
<view class="icon">
<img src="../../static/img/boss/zhichu.png" alt="图标" />
......@@ -217,7 +213,7 @@
</view>
<!-- 模拟老板对比图表区域 -->
<view class="chart-container" v-if="staffKind==='boss'">
<view class="chart-container" v-if="isBoss">
<view class="chart-header">
<text class="chart-title">模拟老板对比</text>
<view class="sort-buttons">
......@@ -293,10 +289,11 @@
</view>
<view class="table-body">
<view class="table-row" v-for="(item, index) in currentData.tableData" :key="index">
<view v-if="staffKind==='boss'" class="table-cell fixed-column" @click="clickSimulatedBoss(item.boss)">
<view v-if="isBoss" class="table-cell fixed-column"
@click="clickSimulatedBoss(item.boss)">
<a :class="{'active': isActive(item.boss)}">{{ item.boss }}</a>
</view>
<view v-if="staffKind!=='boss'" class="table-cell fixed-column">
<view v-if="!isBoss" class="table-cell fixed-column">
{{ item.boss }}
</view>
<view class="table-cell">{{ item.receivable }}</view>
......@@ -314,7 +311,7 @@
</view>
<!-- 模拟老板项目运营表格 -->
<view class="table-container" v-if="staffKind==='boss' && activeBoss !=='' ">
<view class="table-container" v-if="isBoss && activeBoss !=='' ">
<text class="table-title">模拟老板项目运营情况</text>
<scroll-view scroll-x class="table-scroll" @touchmove.stop>
<view class="table">
......@@ -393,7 +390,8 @@
showOrderEvent: false,
tableName: "",
bossProject: [],
activeBoss: ''
activeBoss: '',
isBoss: false
}
},
computed: {
......@@ -426,14 +424,19 @@
}
},
async mounted() {
await this.initData()
this.staffKind = uni.getStorageSync(`uc_staff_kind`);
if (this.staffKind === 'boss') {
this.initLeaderChart()
if (this.staffKind === 'President' || this.staffKind === 'VicePresident' ||
this.staffKind === 'PresidentHelp' || this.staffKind === 'Leader') {
this.tableName = '模拟老板'
this.isBoss = true
} else {
this.tableName = '项目'
}
await this.initData()
if (this.isBoss) {
this.initLeaderChart()
}
this.initProjectChart()
// 在 Vue 的下一个 DOM 更新循环中执行
......@@ -444,7 +447,7 @@
this.loading = false
}
// 对领导图表进行排序,按应收数据排序
if (this.staffKind === 'boss') {
if (this.isBoss) {
this.sortChart('receivable', 'myLeaderChart')
}
// 对项目图表进行排序,按应收数据排序
......@@ -466,7 +469,7 @@
console.log("name" + name);
this.activeBoss = name;
this.staffKind = uni.getStorageSync('uc_staff_kind');
if (this.staffKind === 'boss') {
if (this.isBoss) {
this.bossProject = []
const data = {
"aux": {
......@@ -836,7 +839,7 @@
// 更新图表数据
this.updateChartSeries()
if (this.staffKind === 'boss') {
if (this.isBoss) {
this.sortChart('receivable', 'myLeaderChart')
}
// 对项目图表进行排序,按应收数据排序
......@@ -986,7 +989,7 @@
}
},
updateChartSeries() {
if (this.staffKind === 'boss') {
if (this.isBoss) {
this.myLeaderChart.setOption({
series: [{
data: this.currentData.leaderChartData.receivable
......@@ -1793,7 +1796,7 @@
}
.chart-wrapper {
height: 220px;
height: 250px;
width: 100%;
padding: 0 0 5px 0;
min-width: 100%;
......
......@@ -5,19 +5,18 @@
<view class="report-card" v-for="(report, index) in dailyReportList" :key="index">
<view class="card-header">
<view class="left">
<text class="name">汇报对象:{{ report.reporterTo__name }}</text>
<!-- <text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status==='submitted' ? '已提交' : '未提交' }}
</text> -->
<text v-if="staffKind==='staff'" class="name">汇报对象:{{ report.reporterTo__name }}</text>
<text v-if="staffKind!=='staff'" class="name">汇报对象:老板</text>
</view>
<text class="time">{{ report.date || '-' }}</text>
<text class="time">{{ report.date_str || '-' }}</text>
</view>
<view class="card-content">
<view class="work-item">
<view class="work-header">
<text class="work-title">今日重点工作</text>
<text class="work-title">是否超时</text>
</view>
<view class="work-content">{{ report.today_work }}</view>
<view class="work-content">{{ report.is_over_time }}</view>
</view>
<view class="work-item">
<view class="work-header">
......@@ -25,6 +24,12 @@
</view>
<view class="work-content">{{ report.week_work }}</view>
</view>
<view class="work-item">
<view class="work-header">
<text class="work-title">今日重点工作</text>
</view>
<view class="work-content">{{ report.today_work }}</view>
</view>
<view class="work-item">
<view class="work-header">
<text class="work-title">是否请假</text>
......@@ -147,7 +152,7 @@
uni.stopPullDownRefresh();
const data = res.data.data.datas;
data.map(item => { //格式化时间
item.date = formatGMT(item.date, 'T')
item.insert_date = formatGMT(item.insert_date, 'T')
})
......@@ -184,21 +189,20 @@
.add-button {
position: fixed;
bottom: 10px;
bottom: 20px;
left: 0;
right: 0;
background-color: #2E75E6;
background-color: #3278e9;
color: white;
border: none;
border-radius: 48rpx;
border-radius: 24px;
padding: 8px;
font-size: 16px;
font-weight: bolder;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
cursor: pointer;
z-index: 1000;
width: 90%;
width: 40%;
}
.add-button:hover {
......
<template>
<view class="orderInsert">
<u-toast ref="uToast" />
<u--form :model="formData" :rules="rules" ref="myForm" errorType='none'>
<!-- 基本信息 -->
<view class="module-title flex">
<text class="font_bolder">基本信息</text>
</view>
<view class="basicInfo">
<u-form-item prop="customerOrderNo" label="客户单号" labelWidth="25%" borderBottom>
<u-input border="none" placeholder="请输入" v-model="formData.customerOrderNo" />
</u-form-item>
<u-form-item prop="project.name" label="项目" labelWidth="25%" borderBottom
@click="onVisible('project.name')">
<view>
<u-input border="none" placeholder="请选择" :value="formData['project.name']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="project.name" />
</u-form-item>
<u-form-item prop="transportMode.name" label="运输方式" labelWidth="25%" borderBottom
@click="onVisible('transportMode.name')">
<view>
<u-input border="none" placeholder="请选择" :value="formData['transportMode.name']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="transportMode.name" />
</u-form-item>
<u-form-item prop="transportProduct.name" label="运输产品" labelWidth="25%"
@click="onVisible('transportProduct.name')">
<view>
<u-input border="none" placeholder="请选择" :value="viewEnums[formData.transportProduct]" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="transportProduct.name" />
<view class="orderInsert">
<u-toast ref="uToast" />
<u--form :model="formData" :rules="rules" ref="form" errorType='none'>
<!-- 基本信息 -->
<view class="module-title flex">
<text class="font_bolder">基本信息</text>
</view>
<view class="basicInfo">
<u-form-item prop="customerOrderNo" label="客户单号" labelWidth="25%" borderBottom>
<u-input border="none" placeholder="请输入" v-model="formData.customerOrderNo" />
</u-form-item>
<u-form-item required label="部门" @click="openDepartmentPopup" labelWidth="25%" borderBottom>
<text v-if="formData.uc_department">{{departmentMethodFilter(formData.uc_department)}}</text>
<text v-else class="input-tip">请选择部门</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item required="formData.uc_department==='D003'" v-if="formData.uc_department==='D003'"
label="VIN" labelWidth="25%" borderBottom>
<u-input v-model="formData.vin" border="none" placeholder="请输入VIN"
placeholderStyle="font-size:28rpx;color:#BFBFBF" />
</u-form-item>
<u-form-item required label="客户" labelWidth="25%" @click="openCustomerPopup" borderBottom>
<text v-if="formData.customer">{{formData.customerName}}</text>
<text v-else class="input-tip">请选客户</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item label="接单日期" labelWidth="25%" prop="orderDate" borderBottom @click="showOrderDate = true"
required>
<bs-dateTimePicker2 v-model="formData.orderDate" type="date" placeholder="请选择接单日期">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item>
<u-form-item prop="transportMode" label="运输方式" labelWidth="25%" @click="openTransportMethodPopup"
borderBottom required>
<text v-if="formData.transportMode">{{transportMethodFilter(formData.transportMode)}}</text>
<text v-else class="input-tip">请选择运输方式</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="urgentGrade" label="紧急程度" labelWidth="25%" @click="openUrgentGradeMethodPopup"
borderBottom required>
<text v-if="formData.urgentGrade">{{urgentGradeMethodFilter(formData.urgentGrade)}}</text>
<text v-else class="input-tip">请选择紧急程度</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="uc_transport_type" label="运输类型" labelWidth="25%"
@click="openTransportTypeMethodPopup" borderBottom required>
<text
v-if="formData.uc_transport_type">{{transportTypeMethodFilter(formData.uc_transport_type)}}</text>
<text v-else class="input-tip">请选择运输类型</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="goodsType" label="货物类型" labelWidth="25%" @click="openGoodsTypeMethodPopup"
borderBottom required>
<text v-if="formData.goodsType">{{goodsTypeMethodFilter(formData.goodsType)}}</text>
<text v-else class="input-tip">请选择货物类型</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="uc_settlementtype" label="结算方式" labelWidth="25%"
@click="openSettlementtypeMethodPopup" borderBottom required>
<text
v-if="formData.uc_settlementtype">{{settlementtypeMethodFilter(formData.uc_settlementtype)}}</text>
<text v-else class="input-tip">请选择结算方式</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item label="提货时间" labelWidth="25%" borderBottom>
<bs-dateTimePicker2 v-model="formData.earliestPickUpTime" placeholder="请选择提货时间">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item>
<u-form-item label="送货时间" labelWidth="25%">
<bs-dateTimePicker2 v-model="formData.latestArrivalTime" placeholder="请选择送货时间">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item>
</view>
<!-- 订单任务 -->
<view class="module-title flex">
<text class="font_bolder">发货地</text>
</view>
<view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px">
<u-form-item prop="originalAddress.fullName" label="发货地" labelWidth="25%" borderBottom
@click="onVisible('originalAddress.fullName')">
<view>
<u-input border="none" placeholder="请选择发货地" :value="formData['originalAddress.fullName']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="originalAddress.fullName" />
</u-form-item>
</view>
<view class="module-title flex">
<text class="font_bolder">目的地</text>
</view>
<view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px">
<u-form-item prop="destinationAddress.fullName" label="目的地" labelWidth="25%" borderBottom
@click="onVisible('destinationAddress.fullName')">
<view>
<u-input border="none" placeholder="请选择目的地" :value="formData['destinationAddress.fullName']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="destinationAddress.fullName" />
</u-form-item>
</view>
<!-- 订单任务 -->
<view class="module-title flex">
<text class="font_bolder">订单任务</text>
</view>
<view class="orderTask" v-for="(item, index) in formData.tasks" :key="index"
style="padding-bottom: 12px; margin-bottom:12px">
<view class="order_title">
订单任务明细{{ toChineseNumber(index + 1) }}
</view>
<u-form-item prop="original.name" label="发货地址" labelWidth="25%" borderBottom
@click="onVisible(index + '.original.name')">
<view>
<u-input border="none" placeholder="请选择" :value="item['original.name']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" :index="index + '.original.name'" />
</u-form-item>
<u-form-item prop="destination.name" label="收货地址" labelWidth="25%" borderBottom
@click="onVisible(index + '.destination.name')">
<view>
<u-input border="none" placeholder="请选择" :value="item['destination.name']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" :index="index + '.destination.name'" />
</u-form-item>
<u-form-item prop="earliestPickUpTime" label="提货时间" labelWidth="25%" borderBottom
@click="onVisibleDate(index + '.earliestPickUpTime')">
<view>
<u-input border="none" placeholder="请选择"
:value="convertTime(formData.tasks[index].earliestPickUpTime)" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisibleDate"
:index="index + '.earliestPickUpTime'" />
</u-form-item>
<u-form-item prop="earliestArrivalTime" label="到达时间" labelWidth="25%"
@click="onVisibleDate(index + '.earliestArrivalTime')">
<view>
<u-input border="none" placeholder="请选择"
:value="convertTime(formData.tasks[index].earliestArrivalTime)" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisibleDate"
:index="index + '.earliestArrivalTime'" />
</u-form-item>
<view v-for="(line, lineIndex) in item.lines" :key="lineIndex">
<view class=" order_title">
货物明细{{ toChineseNumber(lineIndex + 1) }}
</view>
<u-form-item prop="thing.code" label="货物代码" labelWidth="25%" borderBottom
@click="onVisible(index + '.' + lineIndex + '.thing.code')">
<view>
<u-input border="none" placeholder="请选择" :value="line['thing.code']" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible"
:index="index + '.' + lineIndex + '.thing.code'" />
</u-form-item>
<u-form-item prop="thing.name" label="货物名称" labelWidth="25%" borderBottom>
<view>
<u-input border="none" readonly :value="line['thing.name']" />
</view>
</u-form-item>
<u-form-item prop="qty" label="数量(件)" labelWidth="25%" borderBottom>
<view>
<u-input border="none" placeholder="请输入" v-model="line.qty" />
</view>
</u-form-item>
<u-form-item prop="weight" label="重量(kg)" labelWidth="25%" borderBottom>
<view>
<u-input border="none" placeholder="请输入" v-model="line.weight" />
</view>
</u-form-item>
<u-form-item prop="volume" label="体积(m³)" labelWidth="25%">
<view>
<u-input border="none" placeholder="请输入" v-model="line.volume" />
</view>
</u-form-item>
</view>
<button class="add_button" @click="addLine(index)">新增货物</button>
</view>
<button class="add_button" @click="addTask">新增订单任务</button>
</u--form>
<!-- 底部按钮 -->
<view class="operation-btn flex_sb">
<button class="backBtn common_btn" @click="onNavBack">返回</button>
<button class="submitBtn common_btn" @click="onSubmitForm">{{ isEdit ? '确认' : '保存' }} </button>
</view>
<!-- 类型选择动作面板 -->
<qwSelectPicker ref="mySelectPicker" :pickerEnums="optionEnums" :visible="visible" @onVisible="onVisible"
:visibleType="visibleType" @onConfirm="onConfirmPicker" :keyWord="keyWord" @changeKeyWord="changeKeyWord" />
<!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
@onSelsectDate="onSelsectDate" />
</view>
</view>
<view class="module-title flex" v-if="formData.uc_department==='D001'||formData.uc_department==='D002'">
<text class="font_bolder">订单明细</text>
</view>
<view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px"
v-if="formData.uc_department==='D001'||formData.uc_department==='D002'">
<view v-for="(line, lineIndex) in formItems" :key="lineIndex">
<view class=" order_title">
货物明细{{ toChineseNumber(lineIndex + 1) }}
</view>
<u-form-item prop="goodsName" label="零件名称" labelWidth="25%" borderBottom
@click="onVisible(lineIndex + '.thing.code')">
<view>
<u-input border="none" placeholder="请选择" :value="line.goodsName" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" :index="lineIndex + '.thing.code'" />
</u-form-item>
<u-form-item prop="name" label="货物名称" labelWidth="25%" borderBottom>
<view>
<u-input border="none" readonly v-model="line.name" />
</view>
</u-form-item>
<u-form-item prop="qty" label="数量(件)" labelWidth="25%" borderBottom>
<view>
<u-input border="none" type="number" placeholder="请输入" v-model="line.qty" />
</view>
</u-form-item>
<u-form-item prop="weight" label="重量(kg)" labelWidth="25%" borderBottom>
<view>
<u-input border="none" type="number" placeholder="请输入" v-model="line.weight" />
</view>
</u-form-item>
<u-form-item prop="volume" label="体积(m³)" labelWidth="25%">
<view>
<u-input border="none" type="number" placeholder="请输入" v-model="line.volume" />
</view>
</u-form-item>
<button class="add_button" @click="removeLine(index)">移除货物</button>
</view>
<button class="add_button" @click="addLine(index)">新增货物</button>
</view>
<!-- <button class="add_button" @click="addTask">新增订单任务</button> -->
</u--form>
<!-- 底部按钮 -->
<view class="operation-btn flex_sb">
<button class="backBtn common_btn" @click="onNavBack">返回</button>
<button class="submitBtn common_btn" @click="onSubmitForm">{{ isEdit ? '确认' : '保存' }} </button>
</view>
<!-- 类型选择动作面板 -->
<qwSelectPicker ref="mySelectPicker" :pickerEnums="optionEnums" :visible="visible" @onVisible="onVisible"
:visibleType="visibleType" @onConfirm="onConfirmPicker" :keyWord="keyWord" @changeKeyWord="changeKeyWord" />
<!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
@onSelsectDate="onSelsectDate" />
<!-- 运输方式弹窗 -->
<popupRadio :radioShow="showTransportMethodPopup" :closeable="true" :radioList="transportMethodOption"
title="运输方式" :currentSelect="formData.transportMode" @cancel="showTransportMethodPopup = false"
@onChange="transportMethodChange">
</popupRadio>
<!-- 紧急程度弹窗 -->
<popupRadio :radioShow="showUrgentGradeMethodPopup" :closeable="true" :radioList="urgentGradeMethodOption"
title="紧急程度" :currentSelect="formData.urgentGrade" @cancel="showUrgentGradeMethodPopup = false"
@onChange="urgentGradeMethodChange">
</popupRadio>
<!-- 部门弹窗 -->
<popupRadio :radioShow="showDepartmentPopup" :closeable="true" :radioList="departmentOption" title="部门"
:currentSelect="formData.uc_department" @cancel="showDepartmentPopup = false" @onChange="departmentChange">
</popupRadio>
<!-- 运输类型 -->
<popupRadio :radioShow="showTransportTypeMethodPopup" :closeable="true" :radioList="transportTypeMethodOption"
title="运输类型" :currentSelect="formData.uc_transport_type" @cancel="showTransportTypeMethodPopup = false"
@onChange="transportTypeMethodChange">
</popupRadio>
<!-- 货物 -->
<popupRadio :radioShow="showGoodsTypeMethodPopup" :closeable="true" :radioList="goodsTypeMethodOption"
title="货物类型" :currentSelect="formData.goodsType" @cancel="showGoodsTypeMethodPopup = false"
@onChange="goodsTypeChange">
</popupRadio>
<!-- 结算方式 -->
<popupRadio :radioShow="showSettlementtypeMethodPopup" :closeable="true" :radioList="settlementtypeMethodOption"
title="结算方式" :currentSelect="formData.uc_settlementtype" @cancel="showSettlementtypeMethodPopup = false"
@onChange="settlementTypeMethodChange">
</popupRadio>
<!-- 客户弹窗 -->
<popupRadio :radioShow="showCustomerPopup" :closeable="true" :radioList="customerOption" title="客户"
:currentSelect="formData.customer" @cancel="showCustomerPopup = false" @onChange="customerChange">
</popupRadio>
</view>
</template>
<script>
import { orderInsert, queryThing, queryObject, queryOriginalAddress, queryDestinationAddress, queryTransportMode,queryTransportProduct } from '../../api/apiList'
export default {
options: { styleIsolation: 'shared' },
props: {
isEdit: {
type: Boolean,
default: false
},
orderEditId: {
type: String,
default: ''
}
},
onShow() {
},
data() {
return {
formData: {
"orderNo": null,
"customerOrderNo": null,
"extCustomerNo": null,
"orderDate": "",
"billType": "Logistics",
"orderType.name": null,
"project.name": null,
"customer.name": "",
"organization.name": null,
"qty": null,
"weight": null,
"volume": null,
"orderStatus": "",
"carrier.name": null,
"truck.name": null,
"driver.name": null,
"driver.tel": null,
"line.name": null,
"line.id": null,
"transportMode": null,
"transportMode.name": null,
"transportProduct":null,
"transportProduct.name":null,
"consignor.name": null,
"consignee.name": null,
"originalContact.name": null,
"destinationContact.name": null,
"advanceAmount": null,
"advanceOil": null,
"arrivalAmount": null,
"arrivalOil": null,
"podAmount": null,
"buyFixedAmount": null,
"sellFixedAmount": null,
"project": null,
"carrier": null,
"tasks": [
{
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": [{
"thing.name": "",
"height": 0,
"weight": 0,
"volume": 0,
"qty": 0,
"thing.code": "",
"thing": "",
}]
}
],
"customer": "",
},
rules: {
'name': { required: true },
'tel': { required: true },
},
visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举
genderViewEnums: [],//性别枚举
viewEnums: [], //视图枚举
visible: false, //类型选择
showPopup: false, //时间选择
carrierList: [],
carrierViewEnums: [],
keyWord: '',
visibleType: ''
}
},
onShow() {
},
methods: {
initData(formData) {
console.log(formData);
this.formData = formData;
this.formData.transportMode.name=this.formData.transportMode
console.log(this.formData.transportMode.name);
},
toChineseNumber(n) {
if (!Number.isInteger(n) && n < 0) {
throw Error('请输入自然数');
}
const digits = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const positions = ['', '十', '百', '千', '万', '十万', '百万', '千万', '亿', '十亿', '百亿', '千亿'];
const charArray = String(n).split('');
let result = '';
let prevIsZero = false;
//处理0 deal zero
for (let i = 0; i < charArray.length; i++) {
const ch = charArray[i];
if (ch !== '0' && !prevIsZero) {
result += digits[parseInt(ch)] + positions[charArray.length - i - 1];
} else if (ch === '0') {
prevIsZero = true;
} else if (ch !== '0' && prevIsZero) {
result += '零' + digits[parseInt(ch)] + positions[charArray.length - i - 1];
}
}
//处理十 deal ten
if (n < 100) {
result = result.replace('一十', '十');
}
return result;
},
addLine(index) {
this.formData.tasks[index].lines.push({
"thing.name": "",
"height": 0,
"weight": 0,
"volume": 0,
"qty": 0,
"thing.code": "",
"thing": "",
})
},
addTask() {
this.formData.tasks.push({
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": []
})
},
async changeKeyWord(keyWord) {
this.keyWord = keyWord
let type = this.visibleType
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destination.name')) {
const res = await queryDestinationAddress(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('original.name')) {
const res = await queryOriginalAddress(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id, ...item
}
})
} else if (type.includes('project.name')) {
const res = await queryObject(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id, ...item
}
})
} else if (type.includes('transportMode.name')) {
const res = await queryTransportMode(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value, ...item
}
})
}else if (type.includes('transportProduct.name')) {
const res = await queryTransportProduct(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value, ...item
}
})
} else if (type.includes('thing.code')) {
const res = await queryThing(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.code,
value: item.id,
name: item.name,
...item
}
})
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
},
//返回上一级页面
onNavBack() {
if (this.isEdit) {
this.$emit('close')
} else {
uni.navigateBack()
}
},
// 提交表单数据
onSubmitForm() {
orderInsert({
aux: {
selectedRows: [this.formData]
}
}).then(result => {
if (this.isEdit) {
this.$emit('close')
} else {
this.formData = {
"orderNo": null,
"customerOrderNo": null,
"extCustomerNo": null,
"orderDate": "",
"billType": "Logistics",
"orderType.name": null,
"project.name": null,
"customer.name": "",
"organization.name": null,
"qty": null,
"weight": null,
"volume": null,
"orderStatus": "",
"carrier.name": null,
"truck.name": null,
"driver.name": null,
"driver.tel": null,
"line.name": null,
"transportProduct": null,
"transportProduct.name":null,
"line.id": null,
"transportMode": null,
"transportMode.name": null,
"consignor.name": null,
"consignee.name": null,
"originalContact.name": null,
"destinationContact.name": null,
"advanceAmount": null,
"advanceOil": null,
"arrivalAmount": null,
"arrivalOil": null,
"podAmount": null,
"buyFixedAmount": null,
"sellFixedAmount": null,
"project": null,
"carrier": null,
"tasks": [
{
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": [{
"thing.name": "",
"height": 0,
"weight": 0,
"volume": 0,
"qty": 0,
"thing.code": "",
"thing": "",
}]
}
],
"customer": "",
}
}
uni.showToast({
icon: 'success',
title: '操作成功'
})
})
},
//类型选择
async onVisible(type) {
this.visibleType = type
if (this.visible) {
this.keyWord = ''
this.visible = false
} else {
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destination.name')) {
const res = await queryDestinationAddress(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('original.name')) {
const res = await queryOriginalAddress(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id, ...item
}
})
} else if (type.includes('project.name')) {
const res = await queryObject(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id, ...item
}
})
} else if (type.includes('transportMode.name')) {
const res = await queryTransportMode(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value, ...item
}
})
} else if (type.includes('transportProduct.name')) {
const res = await queryTransportProduct(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value, ...item
}
})
} else if (type.includes('thing.code')) {
const res = await queryThing(
{
"args": {
pageNum: 1,
pageSize: 10000,
restrictions: [{
"field": "name",
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.code,
value: item.id,
name: item.name,
...item
}
})
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
this.visibleKey = type
this.visible = true
}
},
//设置显示枚举
setViewEnums(optionEnums, key) {
let viewEnums = {}
optionEnums.map(item => {
viewEnums[item.value] = item.label
})
this[key] = viewEnums
},
//确认选择
onConfirmPicker(value) {
this.setFormData(value)
this.visible = false
},
// 时间选择
onSelsectDate(dateInfo) {
const { timestamp } = dateInfo
this.setFormData(new Date(timestamp).toISOString())
this.showPopup = false
},
//设置formData
setFormData(value) {
const key = this.visibleKey
if (key.includes('.')) {
const keys = key.split('.');
if (key.includes('transportMode')) {
this.formData[key] = this.viewEnums[value]
this.formData['transportMode'] = this.viewEnums[value]
}
if (key.includes('transportProduct')) {
this.formData[key] = this.viewEnums[value]
this.formData['transportProduct'] = this.viewEnums[value]
}
if (!isNaN(parseInt(keys[0])) && !key.includes('thing.code')) {
this.formData.tasks[keys[0]][keys.slice(1).join('.')] = this.viewEnums[value]
this.formData.tasks[keys[0]][keys.slice(1)[0]] = value
} else if (!isNaN(parseInt(keys[0])) && key.includes('thing.code')) {
this.formData.tasks[keys[0]].lines[keys[1]]['thing.code'] = this.viewEnums[value]
this.formData.tasks[keys[0]].lines[keys[1]]['thing'] = value
this.optionEnums.map(item => {
if (item.value == value) {
this.formData.tasks[keys[0]].lines[keys[1]]['thing.name'] = item.name
}
})
} else {
this.formData[key] = this.viewEnums[value]
this.formData[keys[0]] = value
}
} else {
this.formData[key] = value
}
},
//关闭时间选择框
onVisibleDate(type) {
if (type) {
this.visibleKey = type
}
this.showPopup = !this.showPopup
},
//页面展示时间戳转换为日期
convertTime(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${month}-${date}`
},
}
}
import {
queryCustomerAll,
getOptionEnumMd,
getOptionEnumThing,
orderInsert,
queryThing,
queryObject,
queryOriginalAddress,
queryDestinationAddress,
queryTransportMode,
queryTransportProduct,
createNewOrderRelease
} from '../../api/apiList'
import {
formatTime
} from '../../utils/util'
export default {
options: {
styleIsolation: 'shared'
},
props: {
isEdit: {
type: Boolean,
default: false
},
orderEditId: {
type: String,
default: ''
}
},
onShow() {
},
data() {
return {
formData: {
uc_department: "",
urgentGrade: "",
customerOrderNo: "",
vin: "",
customer: "",
customerName: "",
transportMode: "",
originalAddress: "", //发货地址id
uc_source_prov_tmp: "",
uc_source_city_tmp: "",
uc_source_dist_tmp: "",
uc_source_name_tmp: "",
uc_source_contact_tmp: "",
uc_source_detail_tmp: "",
uc_source_tel_tmp: "",
destinationAddress: "", //收货地址id
uc_dest_prov_tmp: "",
uc_dest_city_tmp: "",
uc_dest_dist_tmp: "",
uc_dest_name_tmp: "",
uc_dest_contact_tmp: "",
uc_dest_detail_tmp: "",
uc_dest_tel_tmp: "",
latestArrivalTime: "",
earliestPickUpTime: "",
orderDate: "",
uc_transport_type: "",
uc_settlementtype: "",
"originalAddress.fullName": "",
"destinationAddress.fullName": ""
},
rules: {
transportMode: [{
required: true
}]
},
formItems: [],
visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举
genderViewEnums: [], //性别枚举
viewEnums: [], //视图枚举
visible: false, //类型选择
showPopup: false, //时间选择
carrierList: [],
carrierViewEnums: [],
keyWord: '',
visibleType: '',
showTransportMethodPopup: false,
showUrgentGradeMethodPopup: false,
showTransportTypeMethodPopup: false,
showSettlementtypeMethodPopup: false,
showGoodsTypeMethodPopup: false,
transportMethodOption: [],
urgentGradeMethodOption: [],
goodsTypeMethodOption: [],
transportTypeMethodOption: [{
"label": "单程",
"value": "T001"
},
{
"label": "往返",
"value": "T002"
}
],
settlementtypeMethodOption: [{
"label": "现结",
"value": "ST001"
},
{
"label": "月结",
"value": "ST002"
}
],
goodsTypeListOption: [],
customerOption: [],
departmentOption: [{
"label": "零部件物流",
"value": "D001"
},
{
"label": "综合物流",
"value": "D002"
},
{
"label": "整车物流",
"value": "D003"
}
],
goodsList: [],
showCustomerPopup: false,
showDepartmentPopup: false,
}
},
onShow() {
},
async mounted() {
await this.initData();
},
methods: {
async initData(formData) {
let res = await getOptionEnumMd('md.TransportMode');
this.transportMethodOption = res.data.data.datas;
let res2 = await getOptionEnumMd('md.UrgentGrade');
this.urgentGradeMethodOption = res2.data.data.datas;
let res3 = await getOptionEnumMd('md.GoodsType');
this.goodsTypeMethodOption = res3.data.data.datas;
this.addLine()
},
openUrgentGradeMethodPopup() {
this.showUrgentGradeMethodPopup = true;
},
openTransportMethodPopup() {
this.showTransportMethodPopup = true;
},
openGoodsTypeMethodPopup() {
this.showGoodsTypeMethodPopup = true;
},
openTransportTypeMethodPopup() {
this.showTransportTypeMethodPopup = true;
},
openSettlementtypeMethodPopup() {
this.showSettlementtypeMethodPopup = true;
},
transportMethodChange(value) {
this.showTransportMethodPopup = false;
this.formData.transportMode = value;
},
urgentGradeMethodChange(value) {
this.showUrgentGradeMethodPopup = false;
this.formData.urgentGrade = value;
},
goodsTypeChange(value) {
this.showGoodsTypeMethodPopup = false;
this.formData.goodsType = value;
},
transportTypeMethodChange(value) {
this.showTransportTypeMethodPopup = false;
this.formData.uc_transport_type = value;
},
settlementTypeMethodChange(value) {
this.showSettlementtypeMethodPopup = false;
this.formData.uc_settlementtype = value;
},
customerChange(value) {
this.showCustomerPopup = false;
this.formData.customer = value;
this.formData.customerName = this.customerOption.find(item => item.value == value).label;
},
openDepartmentPopup() {
this.showDepartmentPopup = true;
},
departmentChange(value) {
this.showDepartmentPopup = false;
this.formData.uc_department = value;
this.getCustomerOption();
},
departmentMethodFilter(value) {
return this.departmentOption.find(item => item.value == value).label
},
goodsTypeMethodFilter(value) {
return this.goodsTypeMethodOption.find(item => item.value == value).label
},
transportTypeMethodFilter(value) {
return this.transportTypeMethodOption.find(item => item.value == value).label
},
transportMethodFilter(value) {
return this.transportMethodOption.find(item => item.value == value).label
},
urgentGradeMethodFilter(value) {
return this.urgentGradeMethodOption.find(item => item.value == value).label
},
settlementtypeMethodFilter(value) {
return this.settlementtypeMethodOption.find(item => item.value == value).label
},
async getCustomerOption() {
let params = {
"getTotalBy": "count",
"fields": [],
"keyword": {
"value": "",
"fields": ["code", "refer_code", "name"],
"exact": false,
"partialMatchMode": "contain",
"caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 0
}]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
}
let res = await queryCustomerAll(params)
this.customerOption = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id
}
});
},
openCustomerPopup() {
if (this.formData.uc_department === '') {
this.$refs.uToast.show({
message: '请先选择部门'
})
return
} else {
this.showCustomerPopup = true;
}
},
toChineseNumber(n) {
if (!Number.isInteger(n) && n < 0) {
throw Error('请输入自然数');
}
const digits = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const positions = ['', '十', '百', '千', '万', '十万', '百万', '千万', '亿', '十亿', '百亿', '千亿'];
const charArray = String(n).split('');
let result = '';
let prevIsZero = false;
//处理0 deal zero
for (let i = 0; i < charArray.length; i++) {
const ch = charArray[i];
if (ch !== '0' && !prevIsZero) {
result += digits[parseInt(ch)] + positions[charArray.length - i - 1];
} else if (ch === '0') {
prevIsZero = true;
} else if (ch !== '0' && prevIsZero) {
result += '零' + digits[parseInt(ch)] + positions[charArray.length - i - 1];
}
}
//处理十 deal ten
if (n < 100) {
result = result.replace('一十', '十');
}
return result;
},
async addLine(index) {
this.formItems.push({
"goodsName": "",
"goodsId": "",
"name": "",
// "weight": 0,
// "volume": 0,
// "qty": 0,
})
},
removeLine(index) {
this.formItems.splice(index, 1);
},
async changeKeyWord(keyWord) {
this.keyWord = keyWord
let type = this.visibleType
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destinationAddress.fullName')) {
const res = await queryDestinationAddress({
"args": {
pageNum: 1,
pageSize: 20,
restrictions: [{
"field": "fullName",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('originalAddress.fullName')) {
const res = await queryOriginalAddress({
"args": {
pageNum: 1,
pageSize: 10,
restrictions: [{
"field": "fullName",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('customer.name')) {
let params = {
"getTotalBy": "count",
"fields": [],
"keyword": {
"value": "",
"fields": ["code", "refer_code", "name"],
"exact": false,
"partialMatchMode": "contain",
"caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "name",
"label": "名称",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "name",
"restriction": "like",
"value": this.keyWord,
"num": 0
}, {
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 1
}]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
}
let res = await queryCustomerAll(params)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('transportMode.name')) {
const res = await queryTransportMode(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value,
...item
}
})
} else if (type.includes('transportProduct.name')) {
const res = await queryTransportProduct(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value,
...item
}
})
} else if (type.includes('thing.code')) {
const res = await getOptionEnumThing({
"partialMatchMode": "contain",
"size": 10,
"valueField": "id",
"pageNum": 0,
"caseSensitive": true
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.code,
value: item.id,
name: item.name,
...item
}
})
} else if (type === 'uc_department.name') {
optionEnums.push({
'label': "零部件物流",
'value': "D001",
'enabled': true
})
optionEnums.push({
'label': "综合物流",
'value': "D002",
'enabled': true
})
optionEnums.push({
'label': "整车物流",
'value': "D003",
'enabled': true
})
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
},
//返回上一级页面
onNavBack() {
if (this.isEdit) {
this.$emit('close')
} else {
uni.navigateBack()
}
},
// 提交表单数据
onSubmitForm() {
if (this.formItems.length == 0 && this.formData.uc_department != 'D003') {
this.$refs.uToast.show({
message: '请完善必填信息'
})
return
}
if (!this.formData.destinationAddress || !this.formData.originalAddress) {
this.$refs.uToast.show({
message: '请完善地址信息'
})
return
}
this.$refs.form.validate().then(res => {
let headerData = {
...this.formData
}
if (this.formData.earliestPickUpTime) {
headerData.earliestPickUpTime = formatTime(this.formData.earliestPickUpTime)
}
if (this.formData.earliestPickUpTime) {
headerData.latestArrivalTime = formatTime(this.formData.latestArrivalTime)
}
headerData.orderDate = formatTime(this.formData.orderDate)
let data = {
aux: {
"uc_department": headerData.uc_department,
"urgentGrade": headerData.urgentGrade,
"customerOrderNo": headerData.customerOrderNo,
"uc_vin": headerData.vin,
"customer": headerData.customer,
"transportMode": headerData.transportMode,
"originalAddress": headerData.originalAddress,
"uc_source_prov_tmp": this.formData.uc_source_prov_tmp,
"uc_source_city_tmp": this.formData.uc_source_city_tmp,
"uc_source_dist_tmp": this.formData.uc_source_dist_tmp,
"uc_source_name_tmp": this.formData.uc_source_name_tmp,
"uc_source_contact_tmp": this.formData.uc_source_contact_tmp,
"uc_source_detail_tmp": this.formData.uc_source_detail_tmp,
"uc_source_tel_tmp": this.formData.uc_source_tel_tmp,
"destinationAddress": headerData.destinationAddress,
"uc_dest_prov_tmp": this.formData.uc_dest_prov_tmp,
"uc_dest_city_tmp": this.formData.uc_dest_city_tmp,
"uc_dest_dist_tmp": this.formData.uc_dest_dist_tmp,
"uc_dest_name_tmp": this.formData.uc_dest_name_tmp,
"uc_dest_contact_tmp": this.formData.uc_dest_contact_tmp,
"uc_dest_detail_tmp": this.formData.uc_dest_detail_tmp,
"uc_dest_tel_tmp": this.formData.uc_dest_tel_tmp,
"latestArrivalTime": headerData.latestArrivalTime,
"earliestPickUpTime": headerData.earliestPickUpTime,
"orderDate": headerData.orderDate,
"uc_transport_type": headerData.uc_transport_type,
"uc_settlementtype": headerData.uc_settlementtype,
"goodsType": headerData.goodsType,
"lines": this.formItems
}
}
// let data = {"aux":{"uc_department":"D001","urgentGrade":"NORMAL","customerOrderNo":"123","uc_vin":"","customer":"797668003956129792","transportMode":"LTL","originalAddress":"811197013654765568","uc_source_prov_tmp":"","uc_source_city_tmp":"","uc_source_dist_tmp":"","uc_source_name_tmp":"","uc_source_contact_tmp":"","uc_source_detail_tmp":"","uc_source_tel_tmp":"","destinationAddress":"811197015739334656","uc_dest_prov_tmp":"","uc_dest_city_tmp":"","uc_dest_dist_tmp":"","uc_dest_name_tmp":"","uc_dest_contact_tmp":"","uc_dest_detail_tmp":"","uc_dest_tel_tmp":"","latestArrivalTime":"2025-03-19T18:00:18+08:00","earliestPickUpTime":"2025-03-19T18:00:18+08:00","orderDate":"2025-03-19T00:00:00+08:00","uc_transport_type":"T001","uc_settlementtype":"ST001","goodsType":"HEAVY","lines":[{"goodsName":"TEST001","goodsId":"807192134724616192","name":"测试分类","qty":"11","weight":"1","volume":"1"}]}}
console.log(JSON.stringify(data))
createNewOrderRelease(data).then(res => {
this.$refs.uToast.show({
message: res.data.data,
duration: 6000
})
setTimeout(() => {
uni.navigateBack()
}, 6000)
})
}).catch(err => {
console.log(err)
this.$refs.uToast.show({
message: '请完善必填信息'
})
})
},
//类型选择
async onVisible(type) {
console.log("type:" + type)
this.visibleType = type
if (this.visible) {
this.keyWord = ''
this.visible = false
} else {
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destinationAddress.fullName')) {
const res = await queryDestinationAddress({
"args": {
pageNum: 1,
pageSize: 20,
restrictions: [{
"field": "fullName",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('originalAddress.fullName')) {
const res = await queryOriginalAddress({
"args": {
pageNum: 1,
pageSize: 10,
restrictions: [{
"field": "fullName",
"type": "LK",
"value": this.keyWord
}]
}
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('customer.name')) {
let params = {
"getTotalBy": "count",
"fields": [],
"keyword": {
"value": "",
"fields": ["code", "refer_code", "name"],
"exact": false,
"partialMatchMode": "contain",
"caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "name",
"label": "名称",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "name",
"restriction": "like",
"value": this.keyWord,
"num": 0
}, {
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 1
}]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
}
let res = await queryCustomerAll(params)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
...item
}
})
} else if (type.includes('transportMode.name')) {
const res = await queryTransportMode(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value,
...item
}
})
} else if (type.includes('transportProduct.name')) {
const res = await queryTransportProduct(
)
optionEnums = res.data.data.datas.map(item => {
return {
label: item.label,
value: item.value,
...item
}
})
} else if (type.includes('thing.code')) {
const res = await getOptionEnumThing({
"partialMatchMode": "contain",
"size": 10,
"valueField": "id",
"pageNum": 0,
"caseSensitive": true
})
optionEnums = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id,
name: item.name,
...item
}
})
} else if (type === 'uc_department.name') {
optionEnums.push({
'label': "零部件物流",
'value': "D001",
'enabled': true
})
optionEnums.push({
'label': "综合物流",
'value': "D002",
'enabled': true
})
optionEnums.push({
'label': "整车物流",
'value': "D003",
'enabled': true
})
}
console.log("optionEnums" + JSON.stringify(optionEnums))
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
this.visibleKey = type
this.visible = true
}
},
//设置显示枚举
setViewEnums(optionEnums, key) {
let viewEnums = {}
optionEnums.map(item => {
viewEnums[item.value] = item.label
})
this[key] = viewEnums
},
//确认选择
onConfirmPicker(value) {
this.setFormData(value)
this.visible = false
},
// 时间选择
onSelsectDate(dateInfo) {
const {
timestamp
} = dateInfo
this.setFormData(new Date(timestamp).toISOString())
this.showPopup = false
},
//设置formData
setFormData(value) {
const key = this.visibleKey
if (key.includes('.')) {
const keys = key.split('.');
if (key.includes('transportMode')) {
this.formData[key] = this.viewEnums[value]
this.formData['transportMode'] = this.viewEnums[value]
}
if (key.includes('transportProduct')) {
this.formData[key] = this.viewEnums[value]
this.formData['transportProduct'] = this.viewEnums[value]
}
if (key.includes('uc_department')) {
this.formData[key] = this.viewEnums[value]
this.formData['uc_department'] = this.viewEnums[value]
}
console.log("keys" + JSON.stringify(this.optionEnums))
console.log("keys" + JSON.stringify(this.viewEnums))
if (!isNaN(parseInt(keys[0])) && !key.includes('thing.code')) {
this.formData[key] = this.viewEnums[value]
this.formData[keys[0]] = value
} else if (!isNaN(parseInt(keys[0])) && key.includes('thing.code')) {
this.formItems[keys[0]].goodsName = this.viewEnums[value]
this.formItems[keys[0]].goodsId = value
console.log("formItems:" + JSON.stringify(this.formItems[keys[0]]))
this.optionEnums.map(item => {
if (item.value == value) {
this.formItems[keys[0]].name = item.category__name
}
})
} else {
this.formData[key] = this.viewEnums[value]
this.formData[keys[0]] = value
}
} else {
this.formData[key] = value
}
},
//关闭时间选择框
onVisibleDate(type) {
if (type) {
this.visibleKey = type
}
this.showPopup = !this.showPopup
},
//页面展示时间戳转换为日期
convertTime(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${month}-${date}`
},
}
}
</script>
<style lang="scss">
.orderInsert {
padding: 0 12px;
.orderInsert {
padding: 0 12px;
padding-top: 45px;
.module-title {
padding: 32px 32px 16px;
.module-title {
padding: 32px 32px 16px;
.font_bolder {
font-size: 14px;
}
.font_bolder {
font-size: 14px;
}
.vertical-separate {
height: 40px;
border-left: 7px solid #797979;
margin-right: 20px;
}
}
.vertical-separate {
height: 40px;
border-left: 7px solid #797979;
margin-right: 20px;
}
}
.add_button {
height: 40px;
line-height: 40px;
border-radius: 6px;
box-shadow: 1px 3px 12px 0 #0000001A;
font-size: 16px;
font-weight: bolder;
margin-top: 12px;
}
.add_button {
height: 40px;
line-height: 40px;
border-radius: 6px;
box-shadow: 1px 3px 12px 0 #0000001A;
font-size: 16px;
font-weight: bolder;
margin-top: 12px;
}
/deep/.basicInfo,
/deep/.orderTask,
/deep/.driverJobCertificate {
/deep/.basicInfo,
/deep/.orderTask,
/deep/.driverJobCertificate {
.order_title {
font-size: 14px;
font-weight: bolder;
padding-top: 24px;
}
box-shadow: 1px 3px 12px 0 #0000001A;
border-radius: 12px;
padding: 0 40px;
background-color: #ffffff;
.input-tip {
font-size: 14px;
color: #BFBFBF;
}
.u-form-item__body__left__content__required {
font-size: 14px !important;
}
.u-form-item__body__left__content__label {
color: #8C8C8C;
font-size: 14px;
}
.u-form-item__body {
padding: 18px 0;
}
.u-icon {
margin-left: 20px;
}
.u-icon__icon {
font-size: 14px !important;
}
.u-input__content__field-wrapper__field {
font-size: 14px !important;
}
}
.orderDetailInfo-item-content {
.orderDetailInfo-item-content-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0;
border-bottom: 1px solid #F0F0F0FF;
}
.orderDetailInfo-item-content-left {
font-size: 14px;
color: #8C8C8CFF;
}
.orderDetailInfo-item-content-right {
font-size: 14px;
color: #434343FF;
}
.orderDetailInfo-item-content-row:last-child {
margin-bottom: 0;
}
.orderDetailInfo-item-content-bottom-item {
width: 30%;
font-size: 14px;
.orderDetailInfo-item-content-bottom-item-top {
color: #8C8C8CFF;
}
.orderDetailInfo-item-content-bottom-item-bottom {
color: #434343FF;
font-weight: bold;
}
}
.orderDetailInfo-item-content-top {
height: 44px;
border-bottom: 1px solid #F0F0F0FF;
position: absolute;
top: 0;
left: 0;
width: 100%;
.orderDetailInfo-item-content-top-left {
height: 44px;
border-right: 1px solid #F0F0F0FF;
position: absolute;
top: 0;
left: 0;
width: 35%;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
color: #434343FF;
}
.orderDetailInfo-item-content-top-right {
height: 44px;
position: absolute;
top: 0;
right: 0;
width: 65%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
color: #434343FF;
img {
height: 20px;
width: 20px;
margin-right: 8px;
}
}
}
.orderDetailInfo-item-content-bottom {
height: 67px;
position: absolute;
bottom: 0;
left: 5%;
display: flex;
align-items: center;
width: 95%
}
}
}
</style>
.order_title {
font-size: 14px;
font-weight: bolder;
padding-top: 24px;
}
box-shadow: 1px 3px 12px 0 #0000001A;
border-radius: 12px;
padding: 0 40px;
background-color: #ffffff;
.input-tip {
font-size: 14px;
color: #BFBFBF;
}
.u-form-item__body__left__content__required {
font-size: 14px !important;
}
.u-form-item__body__left__content__label {
color: #8C8C8C;
font-size: 14px;
}
.u-form-item__body {
padding: 18px 0;
}
.u-icon {
margin-left: 20px;
}
.u-icon__icon {
font-size: 14px !important;
}
.u-input__content__field-wrapper__field {
font-size: 14px !important;
}
}
.orderDetailInfo-item-content {
.orderDetailInfo-item-content-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0;
border-bottom: 1px solid #F0F0F0FF;
}
.orderDetailInfo-item-content-left {
font-size: 14px;
color: #8C8C8CFF;
}
.orderDetailInfo-item-content-right {
font-size: 14px;
color: #434343FF;
}
.orderDetailInfo-item-content-row:last-child {
margin-bottom: 0;
}
.orderDetailInfo-item-content-bottom-item {
width: 30%;
font-size: 14px;
.orderDetailInfo-item-content-bottom-item-top {
color: #8C8C8CFF;
}
.orderDetailInfo-item-content-bottom-item-bottom {
color: #434343FF;
font-weight: bold;
}
}
.orderDetailInfo-item-content-top {
height: 44px;
border-bottom: 1px solid #F0F0F0FF;
position: absolute;
top: 0;
left: 0;
width: 100%;
.orderDetailInfo-item-content-top-left {
height: 44px;
border-right: 1px solid #F0F0F0FF;
position: absolute;
top: 0;
left: 0;
width: 35%;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
color: #434343FF;
}
.orderDetailInfo-item-content-top-right {
height: 44px;
position: absolute;
top: 0;
right: 0;
width: 65%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
color: #434343FF;
img {
height: 20px;
width: 20px;
margin-right: 8px;
}
}
}
.orderDetailInfo-item-content-bottom {
height: 67px;
position: absolute;
bottom: 0;
left: 5%;
display: flex;
align-items: center;
width: 95%
}
}
}
</style>
\ No newline at end of file
<template>
<view>
<view class="queueSubscribeTitle">
<u--input placeholder="请输入客户单号" border="surround" prefixIcon="search" shape="circle" color="#BFBFBFFF"
placeholderStyle="color:#BFBFBFFF" @blur="change" v-model="searchText"
customStyle="border: 1px solid #BFBFBFFF; font-size: 16px"></u--input>
<view class="flex expense_list_filter flex_cen flex_center" @click="showPop = true">
<image src="../../static/img/fliter.png" style="height: 24px; width: 24px;">
</image>
</view>
</view>
<scroll-view scroll-y="true" style="height: calc(100vh - 125px);">
<orderQueryCard v-for="item in orderList" :key="item.id" :orderInfo="item" @orderChoice="orderChoice"
@orderEdit="orderEdit" @orderShipment="orderShipment" @orderRelease="orderRelease" />
</scroll-view>
<orderDetailInfo :orderId="orderDetailId" v-if="orderDetailInfoShow" @close='orderDetailInfoShow = false'>
</orderDetailInfo>
<u-popup :show="showPop" mode="right" @close="close" customStyle="width:650px">
<view class="expense_list_pop_content">
<view style="margin-top: 48px;">
<!-- <text>项目</text>
<view>
<view class="queueSubscribeTitle">
<u--input placeholder="请输入客户单号" border="surround" prefixIcon="search" shape="circle" color="#BFBFBFFF"
placeholderStyle="color:#BFBFBFFF" @blur="change" v-model="searchText"
customStyle="border: 1px solid #BFBFBFFF; font-size: 16px"></u--input>
<view class="flex expense_list_filter flex_cen flex_center" @click="showPop = true">
<image src="../../static/img/fliter.png" style="height: 24px; width: 24px;">
</image>
</view>
</view>
<scroll-view scroll-y="true" style="height: calc(100vh - 125px);">
<orderQueryCard v-for="item in orderList" :key="item.id" :orderInfo="item" @orderChoice="orderChoice"
@orderEdit="orderEdit" @orderShipment="orderShipment" @orderRelease="orderRelease" />
</scroll-view>
<orderDetailInfo :orderId="orderDetailId" v-if="orderDetailInfoShow" @close='orderDetailInfoShow = false'>
</orderDetailInfo>
<u-popup :show="showPop" mode="right" @close="close" customStyle="width:650px">
<view class="expense_list_pop_content">
<view style="margin-top: 48px;">
<!-- <text>项目</text>
<uni-data-select v-model="value" :localdata="range" @change="change"></uni-data-select> -->
<text>预约单状态</text>
<view class="expense_list_pop_content_type">
<view class="expense_list_pop_content_type_label" @click="choiceType(filterLabel.value)"
v-for=" (filterLabel, index) in filterLabelArr"
:style="choiceSubscribeType.includes(filterLabel.value) ? 'background-color:rgba(46, 117, 230, .1);color:rgba(46, 117, 230, 1);' : ''">
{{ filterLabel.label }}
</view>
</view>
</view>
<text>预约单状态</text>
<view class="expense_list_pop_content_type">
<view class="expense_list_pop_content_type_label" @click="choiceType(filterLabel.value)"
v-for=" (filterLabel, index) in filterLabelArr"
:style="choiceSubscribeType.includes(filterLabel.value) ? 'background-color:rgba(46, 117, 230, .1);color:rgba(46, 117, 230, 1);' : ''">
{{ filterLabel.label }}
</view>
</view>
</view>
</view>
<view class="flex_cen flex_center expense_list_pop_foot">
<button @click="resetFliter">重置</button>
<button @click="confirmFliter"
style="background-color: #2E75E6; color: #FFFFFF; border: none;">确定</button>
</view>
</view>
<view class="flex_cen flex_center expense_list_pop_foot">
<button @click="resetFliter">重置</button>
<button @click="confirmFliter"
style="background-color: #2E75E6; color: #FFFFFF; border: none;">确定</button>
</view>
</u-popup>
</u-popup>
<u-popup :show="showEdit" mode="bottom">
<scroll-view scroll-y="true" class="scroll-Y">
<u-popup :show="showEdit" mode="bottom">
<scroll-view scroll-y="true" class="scroll-Y">
<orderInsertContent ref="orderInsertContent" :isEdit="showEdit" @close="orderEditClose">
</orderInsertContent>
</scroll-view>
<orderInsertContent ref="orderInsertContent" :isEdit="showEdit" @close="orderEditClose">
</orderInsertContent>
</scroll-view>
</u-popup>
</u-popup>
<u-popup :show="showShipment" mode="bottom">
<u-popup :show="showShipment" mode="bottom">
<popShipmentContent ref="orderInsertContent" :orderId="showShipmentId" @close="orderEditClose">
</popShipmentContent>
<popShipmentContent ref="orderInsertContent" :orderId="showShipmentId" @close="orderEditClose">
</popShipmentContent>
</u-popup>
<u-popup :show="showOrderRelease" mode="bottom">
</u-popup>
<u-popup :show="showOrderRelease" mode="bottom">
<popReleaseContent v-if="showOrderRelease" :orderId="showOrderReleaseId" @close="orderEditClose">
</popReleaseContent>
<popReleaseContent v-if="showOrderRelease" :orderId="showOrderReleaseId" @close="orderEditClose">
</popReleaseContent>
</u-popup>
</u-popup>
</view>
</view>
</template>
<script>
import { OrderQuery, getOptionEnum, GetOrderDetailInfo } from '../../api/apiList'
export default {
data() {
return {
orderList: [],
orderDetailInfoShow: false,
orderDetailId: '',
searchText: '',
showPop: false,
filterLabelArr: [],
choiceSubscribeType: [],
range: [
{ value: 0, text: "篮球" },
{ value: 1, text: "足球" },
{ value: 2, text: "游泳" },
],
value: 0,
filterEnums: {
project: ''
},
showEdit: false,
showShipment: false,
showOrderRelease: false,
showOrderReleaseId: '',
showShipmentId: ''
}
},
mounted() {
this.orderQuery()
// this.getOptionEnumInit()
},
methods: {
getOrderDetailInfo(id) {
const that = this
GetOrderDetailInfo({ "aux": { "_ID": id } }).then(res => {
that.$refs.orderInsertContent.initData(res.data.data)
})
},
orderEdit(id) {
this.showEdit = true
this.getOrderDetailInfo(id)
},
orderShipment(id) {
this.showShipment = true
this.showShipmentId = id
},
orderRelease(id) {
this.showOrderRelease = true
this.showOrderReleaseId = id
},
orderEditClose() {
this.showEdit = false
this.showShipment = false
this.showOrderRelease = false
},
confirmFliter() {
this.showPop = false
this.orderList = []
this.orderQuery()
},
resetFliter() {
this.showPop = false
this.choiceSubscribeType = []
},
choiceType(val) {
this.choiceSubscribeType.includes(val) ? this.choiceSubscribeType.splice(this.choiceSubscribeType.indexOf(
val), 1) : this
.choiceSubscribeType.push(val)
},
getOptionEnumInit() {
getOptionEnum('OrderStatus').then(res => {
this.filterLabelArr = res.data.data.datas
})
},
change(value) {
this.searchText = value
this.orderList = []
if (value) {
this.orderQuery()
}
},
orderChoice(id) {
this.orderDetailId = id
this.orderDetailInfoShow = true
},
orderQuery() {
const that = this
const restrictions = [{
"field": "orderNo",
"type": "LK",
"value": that.searchText
}]
if (this.choiceSubscribeType.length > 0) {
restrictions.push({
"field": "orderStatus",
"type": "IN",
"value": this.choiceSubscribeType
})
}
OrderQuery({
"args": {
pageNum: 1,
pageSize: 10,
restrictions
}
}).then(res => {
res.data.data.datas.map(order => {
this.orderList.push({
id: order.id,
orderNo: order.orderNo,
shipper: order.shipper,
shipperPhone: order.shipperPhone,
consigneeAddress: order['original.name'],
shipperAddress: order['destination.name'],
weight: order.weight,
volume: order.volume,
quantity: order.qty,
orderState: order.orderStatusLabel,
orderTime: order['insertDate'],
pickupTime: order.earliestPickUpTime,
arrivalTime: order.earliestArrivalTime,
uc_source_name_tmp: order.uc_source_name_tmp,
uc_dest_name_tmp: order.uc_dest_name_tmp,
})
})
})
},
}
}
import {
OrderQuery,
getOptionEnum,
GetOrderDetailInfo
} from '../../api/apiList'
export default {
data() {
return {
orderList: [],
orderDetailInfoShow: false,
orderDetailId: '',
searchText: '',
showPop: false,
filterLabelArr: [],
choiceSubscribeType: [],
range: [{
value: 0,
text: "篮球"
},
{
value: 1,
text: "足球"
},
{
value: 2,
text: "游泳"
},
],
value: 0,
filterEnums: {
project: ''
},
showEdit: false,
showShipment: false,
showOrderRelease: false,
showOrderReleaseId: '',
showShipmentId: ''
}
},
mounted() {
this.orderQuery()
// this.getOptionEnumInit()
},
methods: {
getOrderDetailInfo(id) {
const that = this
GetOrderDetailInfo({
"aux": {
"_ID": id
}
}).then(res => {
that.$refs.orderInsertContent.initData(res.data.data)
})
},
orderEdit(id) {
this.showEdit = true
this.getOrderDetailInfo(id)
},
orderShipment(id) {
this.showShipment = true
this.showShipmentId = id
},
orderRelease(id) {
this.showOrderRelease = true
this.showOrderReleaseId = id
},
orderEditClose() {
this.showEdit = false
this.showShipment = false
this.showOrderRelease = false
},
confirmFliter() {
this.showPop = false
this.orderList = []
this.orderQuery()
},
resetFliter() {
this.showPop = false
this.choiceSubscribeType = []
},
choiceType(val) {
this.choiceSubscribeType.includes(val) ? this.choiceSubscribeType.splice(this.choiceSubscribeType.indexOf(
val), 1) : this
.choiceSubscribeType.push(val)
},
getOptionEnumInit() {
getOptionEnum('OrderStatus').then(res => {
this.filterLabelArr = res.data.data.datas
})
},
change(value) {
this.searchText = value
this.orderList = []
if (value) {
this.orderQuery()
}
},
orderChoice(id) {
this.orderDetailId = id
this.orderDetailInfoShow = true
},
orderQuery() {
const that = this
const restrictions = [{
"field": "orderNo",
"type": "LK",
"value": that.searchText
}]
if (this.choiceSubscribeType.length > 0) {
restrictions.push({
"field": "orderStatus",
"type": "IN",
"value": this.choiceSubscribeType
})
}
OrderQuery({
"args": {
pageNum: 1,
pageSize: 10,
restrictions
}
}).then(res => {
res.data.data.datas.map(order => {
this.orderList.push({
id: order.id,
orderNo: order.orderNo,
shipper: order.shipper,
shipperPhone: order.shipperPhone,
consigneeAddress: order['original.name'],
shipperAddress: order['destination.name'],
weight: order.weight,
volume: order.volume,
quantity: order.qty,
orderState: order.orderStatusLabel,
orderTime: order['insertDate'],
pickupTime: order.earliestPickUpTime,
arrivalTime: order.earliestArrivalTime,
uc_source_name_tmp: order.uc_source_name_tmp,
uc_dest_name_tmp: order.uc_dest_name_tmp,
})
})
})
},
}
}
</script>
<style lang="scss">
.queueSubscribeTitle {
width: 100%;
display: flex;
align-items: center;
background-color: #FFFFFF;
.u-input {
height: 32px;
border: none;
}
/deep/.uni-input-wrapper {
font-size: 16px !important;
}
/deep/.u-icon__icon {
font-size: 16px !important;
color: #FFFFFF !important;
}
}
.scroll-Y {
height: 100vh;
}
.expense_list_filter {
color: #434343;
padding-right: 24px;
margin-left: 24px;
}
.expense_list_pop_content {
margin: 24px;
height: calc(100vh - 144px);
}
.expense_list_pop_foot {
height: 144px;
position: absolute;
bottom: 0;
width: 100%;
border-top: 2px solid #F0F0F0;
button {
height: 88px;
width: 284px;
border-radius: 44px;
background-color: #FFFFFF;
border: 3px solid #E5E5E5;
font-size: 24px;
color: #434343;
line-height: 88px;
}
}
.expense_list_pop_content_type {
display: flex;
flex-wrap: wrap;
.expense_list_pop_content_type_label {
height: 64px;
width: 150px;
line-height: 64px;
text-align: center;
background-color: #F0F0F0;
border-radius: 8px;
font-size: 24px;
margin: 24px;
color: #323233;
}
}
.expense_list_pop_content_connect {
margin: 0 16px;
height: 0;
width: 39px;
border: 2px solid #BFBFBF;
}
.queueSubscribeTitle {
width: 100%;
display: flex;
align-items: center;
background-color: #FFFFFF;
padding-top: 45px;
.u-input {
height: 32px;
border: none;
}
/deep/.uni-input-wrapper {
font-size: 16px !important;
}
/deep/.u-icon__icon {
font-size: 16px !important;
color: #FFFFFF !important;
}
}
.scroll-Y {
height: 100vh;
}
.expense_list_filter {
color: #434343;
padding-right: 24px;
margin-left: 24px;
}
.expense_list_pop_content {
margin: 24px;
height: calc(100vh - 144px);
}
.expense_list_pop_foot {
height: 144px;
position: absolute;
bottom: 0;
width: 100%;
border-top: 2px solid #F0F0F0;
button {
height: 88px;
width: 284px;
border-radius: 44px;
background-color: #FFFFFF;
border: 3px solid #E5E5E5;
font-size: 24px;
color: #434343;
line-height: 88px;
}
}
.expense_list_pop_content_type {
display: flex;
flex-wrap: wrap;
.expense_list_pop_content_type_label {
height: 64px;
width: 150px;
line-height: 64px;
text-align: center;
background-color: #F0F0F0;
border-radius: 8px;
font-size: 24px;
margin: 24px;
color: #323233;
}
}
.expense_list_pop_content_connect {
margin: 0 16px;
height: 0;
width: 39px;
border: 2px solid #BFBFBF;
}
</style>></style>
\ No newline at end of file
<template>
<view :class="[(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' )? '' : 'selectPicker']" @touchmove.stop.prevent="moveHandle">
<u-picker v-if="(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' )" ref="uPicker" keyName="label" immediateChange
confirmText="确定" :show="visible" :title="PanelTitle" :closeOnClickOverlay="true" :itemHeight="68"
:columns="[pickerEnums]" :singleIndex="singleIndex" :visibleItemCount="visibleNum" @cancel="onCancel"
@confirm="onConfirm" @close="onCancel" />
<view
:class="[(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' || visibleType ==='uc_department.name' )? '' : 'selectPicker']"
@touchmove.stop.prevent="moveHandle">
<u-picker
v-if="(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name'|| visibleType ==='uc_department.name' )"
ref="uPicker" keyName="label" immediateChange confirmText="确定" :show="visible" :title="PanelTitle"
:closeOnClickOverlay="true" :itemHeight="68" :columns="[pickerEnums]" :singleIndex="singleIndex"
:visibleItemCount="visibleNum" @cancel="onCancel" @confirm="onConfirm" @close="onCancel" />
<u-popup v-else :show="visible" @close="onCancel" closeable>
<u-search placeholder="请输入关键字" :value="keyWord" @change="changeKeyWord" :showAction="false"></u-search>
<!-- <scroll-view scroll-y class="select-list">
......@@ -11,7 +14,8 @@
{{ item.label }}
</view>
</scroll-view> -->
<divTable @scrollBottom='scrollBottom' @getTextColor='getRedText' @getEdit='editTable'
<!-- @getTextColor='getRedText' -->
<divTable @scrollBottom='scrollBottom' @getEdit='editTable'
@getDelete='deleteTable' @rowData='getRow' :data2='pickerEnums' :head='dataProcess()'
:tableHeight='"calc(60vh-30px)"'>
</divTable>
......@@ -21,130 +25,150 @@
</template>
<script>
export default {
options: { styleIsolation: 'shared' },
data() {
return {
singleIndex: 0 //默认选中项
,
};
},
props: {
visible: {
type: Boolean,
default: false
export default {
options: {
styleIsolation: 'shared'
},
pickerEnums: { //选择项枚举
type: Array,
default: []
},
PanelTitle: { //面板标题
type: String,
default: ""
},
visibleNum: {
type: Number,
default: 3
},
visibleType: {
type: String,
default: ''
},
keyWord: {
type: String,
default: ''
}
},
methods: {
moveHandle() {
},
//确定
onConfirm(value) {
if ((this.visibleType === 'transportMode.name' || this.visibleType ==='transportProduct.name' )){
this.$emit('onConfirm', value.value[0].value)
}else{
this.$emit('onConfirm', value)
}
data() {
return {
singleIndex: 0 //默认选中项
,
};
},
getRow(row) {
this.onConfirm(row.value)
},
//设置默认值
setDefaultValue(index) {
this.singleIndex = index
},
//取消
onCancel() {
this.$emit('onVisible')
},
changeKeyWord(keyWord) {
this.$emit('changeKeyWord', keyWord)
props: {
visible: {
type: Boolean,
default: false
},
pickerEnums: { //选择项枚举
type: Array,
default: []
},
PanelTitle: { //面板标题
type: String,
default: ""
},
visibleNum: {
type: Number,
default: 3
},
visibleType: {
type: String,
default: ''
},
keyWord: {
type: String,
default: ''
}
},
dataProcess() {
let type = this.visibleType
if (type.includes('destination.name')) {
return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' }
]
} else if (type.includes('original.name')) {
return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' }
]
} else if (type.includes('project.name')) {
return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' },
{ name: '外部代码', key: 'referCode' },
{
name: '所属组织', key: 'organization.secondParty.name'
},
{
name: '所属组织代码', key: 'organization.secondParty.code'
},
]
} else if (type.includes('thing.code')) {
return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' },
{ name: '外部代码', key: 'referCode' },
{
name: '价格', key: 'price'
},
]
methods: {
moveHandle() {
},
//确定
onConfirm(value) {
if ((this.visibleType === 'transportMode.name' ||
this.visibleType === 'transportProduct.name' ||
this.visibleType === 'uc_department.name'
)) {
this.$emit('onConfirm', value.value[0].value)
} else {
this.$emit('onConfirm', value)
}
},
getRow(row) {
this.onConfirm(row.value)
},
//设置默认值
setDefaultValue(index) {
this.singleIndex = index
},
//取消
onCancel() {
this.$emit('onVisible')
},
scrollBottom(){
console.log("scrollBottom")
},
changeKeyWord(keyWord) {
this.$emit('changeKeyWord', keyWord)
},
dataProcess() {
let type = this.visibleType
if (type.includes('destinationAddress.fullName')) {
return [{
name: '系统代码',
key: 'code'
},
{
name: '名称',
key: 'fullName'
}
]
} else if (type.includes('originalAddress.fullName')) {
return [{
name: '系统代码',
key: 'code'
},
{
name: '名称',
key: 'fullName'
}
]
} else if (type.includes('customer.name')) {
return [{
name: '系统代码',
key: 'code'
},
{
name: '名称',
key: 'name'
}
]
} else if (type.includes('thing.code')) {
return [
{
name: '名称',
key: 'name'
},
{
name: '货物名称',
key: 'category__name'
},
]
}
}
}
}
}
</script>
<style lang="scss">
.selectPicker {
.selectPicker {
/deep/.u-transition {
height: 60vh;
}
/deep/.u-transition {
height: 60vh;
}
.select-list {
height: calc(60vh - 30px);
}
.select-list {
height: calc(60vh - 30px);
}
/deep/.u-search {
margin-top: 30rpx !important;
/deep/.u-search {
margin-top: 30rpx !important;
}
}
}
</style>
</style>
\ No newline at end of file
......@@ -6,9 +6,9 @@ import Vue from "vue";
// 引入uView并配置
import uView from "uview-ui";
Vue.use(uView);
import VConsole from "vconsole";
// import VConsole from "vconsole";
// 只有在开发环境下才加载vconsole
new VConsole();
// new VConsole();
// 修改uView内置配置方案: 需要在Vue.use(uView)之后执行,目前只建议修改config、props属性, 除非您清楚知道自己的修改所带来的影响。
uni.$u.setConfig({
// 修改$u.config对象的属性
......
......@@ -53,12 +53,20 @@
"disableScroll": true
}
},
{
"path": "pages/dailyReport/dailyReportHistory",
"style": {
"navigationBarTitleText": "查看日报",
"enablePullDownRefresh": false,
"disableScroll": false
}
},
{
"path": "pages/dailyReportCreate/dailyReportCreate",
"style": {
"navigationBarTitleText": "填写日报",
"enablePullDownRefresh": false,
"disableScroll": true
"disableScroll": false
}
}
],
......@@ -68,7 +76,7 @@
}],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "运匠运输管理平台",
"navigationBarTitleText": "兆驰运输管理平台",
"navigationBarBackgroundColor": "#2E75E6",
"backgroundColor": "#fff",
"app-plus": {
......
......@@ -31,8 +31,14 @@
<view class="card-header">
<view class="left">
<text class="name">{{ report.reporter }}</text>
<text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status==='submitted' ? '已提交' : '未提交' }}
<text v-if="report.status==='submitted'" class="status"
:class="report.isOverTime==='准时' ? 'submitted' : 'unSubmitted'">
{{ report.isOverTime}}
</text>
<text v-if="report.status!=='submitted'" class="status"
:class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status==='submitted' ? '': '未提交' }}
</text>
</view>
<text class="time">{{ report.date || '-' }}</text>
......@@ -40,21 +46,22 @@
<view class="card-content" v-if="report.status==='submitted'">
<view class="work-item">
<view class="work-header">
<text class="work-title">今日重点工作</text>
<text class="work-title">本周重点工作</text>
</view>
<view class="work-content">{{ report.todayWork }}</view>
<view class="work-content">{{ report.weekWork }}</view>
</view>
<view class="work-item">
<view class="work-header">
<text class="work-title">本周重点工作</text>
<text class="work-title">今日重点工作</text>
</view>
<view class="work-content">{{ report.weekWork }}</view>
<view class="work-content">{{ report.todayWork }}</view>
</view>
</view>
</view>
<view style="height: 10vh;"></view>
<view class="search-more" @click="selectHistory()"><text class="search-more-text"> 查看更多</text></view>
</scroll-view>
</view>
</template>
......@@ -85,19 +92,23 @@
this.onReload()
},
methods: {
selectHistory() {
uni.navigateTo({
url: '/pages/dailyReport/dailyReportHistory'
});
},
selectReport(status) {
this.searchStatus = status
this.dailyReportList = []
this.initData()
},
initData() {
this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind');
this.commonName = uni.getStorageSync('commonName');
console.log("this.staffCode"+this.staffCode)
console.log("this.staffKind"+this.staffKind)
console.log("this.commonName"+this.commonName)
console.log("this.staffCode" + this.staffCode)
console.log("this.staffKind" + this.staffKind)
console.log("this.commonName" + this.commonName)
console.log('获取到的commonName:', this.commonName);
......@@ -145,11 +156,39 @@
</script>
<style lang="scss">
html, body {
height: 100%; /* 确保 html 和 body 高度为 100% */
margin: 0; /* 去掉默认的 margin */
overflow: hidden; /* 禁用滚动条 */
html,
body {
height: 100%;
/* 确保 html 和 body 高度为 100% */
margin: 0;
/* 去掉默认的 margin */
overflow: hidden;
/* 禁用滚动条 */
}
.search-more {
height: 10vh;
display: flex;
justify-content: center;
align-items: center;
// &:hover {
// background: #e6f7ff;
// /* 鼠标悬停时的背景色 */
// transform: scale(1.05);
// /* 鼠标悬停时的放大效果 */
// }
}
.search-more-text{
color: #5500ff;
&:hover {
/* 鼠标悬停时的背景色 */
transform: scale(1.05);
/* 鼠标悬停时的放大效果 */
}
}
.daily-report {
padding: 15px;
background: #f5f7fa;
......
......@@ -7,7 +7,7 @@
<view class="form-container">
<!-- 报告人 -->
<view class="form-item">
<view class="form-item" v-if="staffKind==='staff'">
<text class="label"><text class="label-line"></text>汇报人</text>
<picker mode="selector" :range="reporterValues" @change="onReporterChange" class="picker">
<view class="picker-text">{{ selectedReporterValue || '请选择汇报人' }}</view>
......@@ -17,21 +17,23 @@
<!-- 日期 -->
<view class="form-item">
<text class="label"><text class="label-line"></text>日期</text>
<picker mode="date" :value="formData.date" @change="dateChange" class="picker">
<picker mode="selector" :value="formData.date" @change="dateChange" class="picker" :range="dateRange">
<view class="picker-text">{{ formData.date || '请选择日期' }}</view>
</picker>
</view>
<!-- 今日重点工作 -->
<!-- 本周重点工作 -->
<view class="form-item">
<text class="label"><text class="label-line"></text>本日重点工作</text>
<textarea v-model="formData.todayWork" placeholder="请输入本日重点工作内容" class="textarea" />
<text class="label"><text class="label-line"></text>本周重点工作</text>
<u--textarea autoHeight v-model="formData.weekWork" placeholder="请输入本周重点工作内容" count
:maxlength="2000"></u--textarea>
</view>
<!-- 本周重点工作 -->
<!-- 今日重点工作 -->
<view class="form-item">
<text class="label"><text class="label-line"></text>本周重点工作</text>
<textarea v-model="formData.weekWork" placeholder="请输入本周重点工作内容" class="textarea" />
<text class="label"><text class="label-line"></text>本日重点工作</text>
<u--textarea autoHeight v-model="formData.todayWork" placeholder="请输入本日重点工作内容" count
:maxlength="2000"></u--textarea>
</view>
<!-- 是否请假 -->
......@@ -45,15 +47,23 @@
<!-- 请假原因 -->
<view class="form-item">
<text class="label"><text class="label-line"></text>请假原因</text>
<textarea v-model="formData.leaveReason" placeholder="请输入请假原因" class="textarea"
<u--textarea autoHeight v-model="formData.leaveReason" placeholder="请输入请假原因"
:disabled="formData.isLeave !== '是'"
:style="formData.isLeave !== '是' ? 'background-color: #f5f5f5;' : ''" />
:style="formData.isLeave !== '是' ? 'background-color: #f5f5f5;' : ''" count
:maxlength="2000"></u--textarea>
</view>
<view class="form-item">
<!-- <text class="label"><text class="label-line"></text>附件上传</text> -->
<view class="uploader-img">
<bs-uploader ref="myUploadImg" uploadTitle="上传图片" />
</view>
</view>
<!-- 按钮组 -->
<view class="button-group">
<button class="back-btn" @click="goBack">返回</button>
<button class="submit-btn" @click="submitReport">提交日报</button>
<button class="submit-btn" :disabled="isSubmit" @click="submitReport">提交日报</button>
</view>
</view>
</view>
......@@ -62,25 +72,26 @@
<script>
import {
dailyReportSave,
selectReporter
selectReporter,
queryByStaffCode
} from '../../api/apiList'
export default {
data() {
// 获取当前日期和时间并格式化
const today = new Date()
const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, '0')
const day = String(today.getDate()).padStart(2, '0')
const hours = String(today.getHours()).padStart(2, '0')
const minutes = String(today.getMinutes()).padStart(2, '0')
const seconds = String(today.getSeconds()).padStart(2, '0')
const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
// const today = new Date()
// const year = today.getFullYear()
// const month = String(today.getMonth() + 1).padStart(2, '0')
// const day = String(today.getDate()).padStart(2, '0')
// const hours = String(today.getHours()).padStart(2, '0')
// const minutes = String(today.getMinutes()).padStart(2, '0')
// const seconds = String(today.getSeconds()).padStart(2, '0')
// const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
return {
formData: {
reporterTo: '',
reporter: '',
date: formattedDate, // 使用带时间的日期格式
date: this.getTodayDate(), // 默认值为今天,
todayWork: '',
weekWork: '',
isLeave: '否',
......@@ -88,24 +99,82 @@
},
staffCode: "",
staffKind: "",
reporterToName: "",
reporterToId: "",
leaveOptions: ['是', '否'],
reporterMap: {}, // key:value 形式的 map 数据
reporterValues: [], // 用于 picker 的显示值
selectedReporterValue: '' // 选中的报告人显示值
selectedReporterValue: '', // 选中的报告人显示值
dateRange: [], // 日期范围
isSubmit: false
}
},
created() {
this.setDateRange(); // 设置日期范围
this.queryDailyReport();
this.staffKind = uni.getStorageSync('uc_staff_kind');
if (this.staffKind === 'staff') {
this.reporterToId = uni.getStorageSync('reporterToId');
this.reporterToName = uni.getStorageSync('reporterToName');
this.selectedReporterValue = this.reporterToName; // 显示的值
// 获取对应的 key
this.formData.reporterTo = this.reporterToId
}
this.initReporter(); // 在组件创建时初始化报告人
},
mounted() {
// 如果 created 中没有获取到,在 mounted 中再次尝试
if (!this.formData.reporter) {
this.getCommonName();
}
},
methods: {
queryDailyReport() {
this.staffCode = uni.getStorageSync(`staffCode`);
const data = {
"aux": {
staffCode: this.staffCode
}
}
queryByStaffCode(data).then(res => {
const data = res.data.data; // 假设返回的数据在这个路径
if (data) {
this.formData.weekWork = data.weekWork
// this.formData.todayWork = data.todayWork
}
}).catch(err => {
console.error('获取报告人失败:', err);
});
},
getTodayDate() {
const today = new Date();
return this.formatDate(today);
},
getYesterdayDate() {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
return this.formatDate(yesterday);
},
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`; // 格式化为 YYYY-MM-DD
},
setDateRange() {
this.dateRange = [this.getYesterdayDate(), this.getTodayDate()]; // 设置为昨天和今天
console.log(JSON.stringify(this.dateRange))
},
dateChange(e) {
// const selectedDate = e.detail.value;
// const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
// this.formData.date = `${selectedDate} ${currentTime}`;
this.formData.date = this.dateRange[e.detail.value]; // 更新选择的日期
},
initReporter() {
this.staffKind = uni.getStorageSync('uc_staff_kind');
const data = {
"aux": {
staffKind: this.staffKind
......@@ -141,11 +210,11 @@
// 获取对应的 key
this.formData.reporterTo = Object.keys(this.reporterMap)[selectedIndex]; // 存储的值为 key
},
dateChange(e) {
const selectedDate = e.detail.value;
const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
this.formData.date = `${selectedDate} ${currentTime}`;
},
// dateChange(e) {
// const selectedDate = e.detail.value;
// const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
// this.formData.date = `${selectedDate} ${currentTime}`;
// },
leaveChange(e) {
this.formData.isLeave = this.leaveOptions[e.detail.value]
if (this.formData.isLeave === '否') {
......@@ -168,37 +237,77 @@
})
return
}
console.log("this.formData.date:" + this.formData.date)
if (this.formData.date === undefined || this.formData.date === '' || this.formData.date === null) {
uni.showToast({
title: '请选择日期',
icon: 'none'
})
return
}
this.staffCode = uni.getStorageSync(`staffCode`);
const data = {
"aux": {
reporter: this.formData.reporter,
reporterTo: this.formData.reporterTo,
date: this.formData.date,
todayWork: this.formData.todayWork,
weekWork: this.formData.weekWork,
isLeave: this.formData.isLeave,
leaveReason: this.formData.leaveReason,
staffCode: this.staffCode
const yesterdayDate = this.getYesterdayDate();
var isOverTime
if (yesterdayDate === this.formData.date) {
// 获取当前日期和时间并格式化
const today = new Date()
const hours = String(today.getHours()).padStart(2, '0')
if (hours >= 9) {
isOverTime = "超时";
}
} else {
isOverTime = "准时";
}
console.log('提交的日报数据:', data)
dailyReportSave(data).then(res => {
console.log('提交的日报数据:', res.data)
if (res.data.messageType === "success") {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000,
success: () => {
setTimeout(() => {
uni.$emit('executeChoiceItem', 'dailyReportList');
uni.navigateTo({
url: '/pages/index/index'
});
}, 1500) // 等待提示显示 1.5 秒后返回
const imgInstance = this.$refs.myUploadImg
uni.showModal({
title: "提示",
content: "是否提交日报?",
showCancel: true,
cancelText: '取消',
confirmText: '确定',
success: res => {
this.isSubmit = true
imgInstance.uploadImage(images => {
console.log("上传图片" + images)
const data = {
"aux": {
reporter: this.formData.reporter,
reporterTo: this.formData.reporterTo,
date: this.formData.date,
todayWork: this.formData.todayWork,
weekWork: this.formData.weekWork,
isLeave: this.formData.isLeave,
leaveReason: this.formData.leaveReason,
staffCode: this.staffCode,
isOverTime: isOverTime,
files: images
}
}
console.log('提交的日报数据:', data)
dailyReportSave(data).then(res => {
console.log('提交的日报数据:', res.data)
if (res.data.messageType === "success") {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000,
mask:true,
success: () => {
setTimeout(() => {
// uni.$emit(
// 'executeChoiceItem',
// 'dailyReport');
uni.navigateTo({
url: "/pages/index/index?currentShow='dailyReport'"
});
}, 1000) // 等待提示显示 1.5 秒后返回
}
})
}
})
this.isSubmit=false
})
}
})
......@@ -206,7 +315,7 @@
goBack() {
uni.$emit('executeChoiceItem', 'dailyReport');
uni.navigateTo({
url: '/pages/index/index'
url: "/pages/index/index?currentShow='dailyReport'"
});
}
}
......
......@@ -9,15 +9,23 @@
</view>
</view>
<view class="content">
<view v-if="currentShow === 'orderQuery'">
<orderQueryContent></orderQueryContent>
</view>
<view v-if="currentShow === 'orderCreate'">
<scroll-view scroll-y="true" style="height: calc(100vh - 50px);">
<orderInsertContent></orderInsertContent>
</scroll-view>
</view>
<view v-if="currentShow === 'bossCard' && uc_staff_kind!==''">
<view v-if=" currentShow==='bossCard' && uc_staff_kind!==''">
<bossCard></bossCard>
</view>
<!-- <view v-if="currentShow === 'dailyReportCreate' && uc_staff_kind!=='boss'">
<!-- <view v-if=" currentShow==='dailyReportCreate' && uc_staff_kind!=='boss'">
<dailyReportCreate></dailyReportCreate>
</view> -->
<view v-if="currentShow === 'dailyReport'">
<view v-if=" currentShow==='dailyReport'">
<dailyReportList></dailyReportList>
</view>
</view>
......@@ -50,23 +58,24 @@
topUserList: [],
}
},
onLoad() {
onLoad(o) {
this.uc_staff_kind = uni.getStorageSync(`uc_staff_kind`);
this.updateTopUserList()
},
onShow() {
uni.$on('executeChoiceItem', (component) => {
console.log('收到切换组件事件:', component); // 调试日志
this.choiceItem(component);
});
},
onUnload() {
uni.$off('executeChoiceItem');
this.updateTopUserList(o.currentShow)
},
//onShow() {
// uni.$on('executeChoiceItem', (component)=> {
// console.log('收到切换组件事件:', component); // 调试日志
// this.choiceItem(component);
// });
// },
// onUnload() {
// uni.$off('executeChoiceItem');
// },
methods: {
updateTopUserList() {
updateTopUserList(o) {
if (this.uc_staff_kind === 'boss') {
if (this.uc_staff_kind === 'President' || this.uc_staff_kind === 'VicePresident' ||
this.uc_staff_kind === 'PresidentHelp' || this.uc_staff_kind === 'Leader') {
this.currentShow = 'bossCard'
this.topUserList = [{
name: '运营监控',
......@@ -74,15 +83,20 @@
url: '/pages/index/index'
},
];
} else if (this.uc_staff_kind === 'simulatedBoss') {
this.currentShow = 'dailyReport'
if (o) {
this.currentShow = 'dailyReport'
} else {
this.currentShow = 'bossCard'
}
this.topUserList = [{
name: '运营监控',
key: 'bossCard',
url: '/pages/index/index'
}, {
name: '查看日报',
name: '个人日报',
key: 'dailyReport',
url: '/pages/index/index'
},
......@@ -91,10 +105,20 @@
} else {
this.currentShow = 'dailyReport'
this.topUserList = [{
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
}, ]
name: '个人日报',
key: 'dailyReport',
url: '/pages/index/index'
},
{
name: '订单查询',
key: 'orderQuery',
url: '/pages/index/index'
}, {
name: '订单创建',
key: 'orderCreate',
url: '/pages/index/index'
},
]
}
},
......@@ -173,7 +197,7 @@
});
// if (this.isCarrier) {
// this.currentShow = "waybillQuery"
// this.currentShow = "waybillQuery"
// }
})
},
......@@ -208,11 +232,13 @@
userId: item.userId
}
}).then(res => {
console.log('7777777', item, item.userId)
console.log('7777777', item, item
.userId)
if (res.data.data.isCarrier) {
this.isCarrier = true;
this.currentShow = "wayBillQuery";
uni.setStorageSync("companyId", res.data
uni.setStorageSync("companyId", res
.data
.data.company)
}
})
......
<template>
<view class="content_box flex_col" :style="{ backgroundImage: `url(${loginBg})` }">
<view class="primary-description">
<!-- <view class="container-title flex_cen">TMS运输管理系统</view>
<view class="container-subTitle flex_cen">兆驰供应链</view>
-->
</view>
<!-- 用户信息录入 -->
<view class="user-info flex_center">
<u-form :model="formData" ref="myForm" errorType='tost'>
<template>
<u-form-item prop="userName">
<u-input type="text" v-model="formData.userName" placeholder="请输入账号" />
......@@ -26,7 +20,7 @@
<u-checkbox-group placement="column" @change="onChanges">
<u-checkbox :checked="isChecked" iconSize="30rpx" shape="square" size="20spx" />
</u-checkbox-group>
<text style="color: #d5d5d6;font-size: 18px;">记住密码</text>
<text style="color: black;font-size: 18px;">记住密码</text>
</view>
</view>
......@@ -90,11 +84,11 @@
if (isMobile) {
console.log("当前设备为手机或平板");
// 在这里执行手机端的逻辑
this.loginBg = 'static/img/bg/souye-bg.jpg'
this.loginBg = 'static/img/bg/top.png'
} else {
console.log("当前设备为电脑");
// 在这里执行电脑端的逻辑
this.loginBg = 'static/img/bg/loginBg.png'
this.loginBg = 'static/img/bg/top.png'
}
this.projectMini = getApp().globalData.projectMini
......@@ -258,6 +252,8 @@
let data2 = res.data.data
uni.setStorageSync(`staffCode`, data2.staffCode);
uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
uni.setStorageSync(`reporterToName`, data2.reporterToName);
uni.setStorageSync(`reporterToId`, data2.reporterToId);
uni.redirectTo({
url: "/pages/index/index",
})
......@@ -298,9 +294,9 @@
height: 100vh;
color: #FFFFFF;
letter-spacing: 6rpx;
background-size: 100% 100%;
background-size: 100%;
background-repeat: no-repeat;
padding: 0 32rpx;
padding: 140px 16px;
justify-content: space-between;
......@@ -336,13 +332,13 @@
margin-top: 212rpx;
/* #endif */
/* #ifdef H5 || APP-PLUS*/
margin-top: 160rpx;
margin-top: 30px;
/* #endif */
color: #FFFFFF;
color: black;
font-size: 32rpx;
font-weight: bolder;
border-radius: 48rpx;
background: linear-gradient(90deg, #2E75E6 0%, #5E58EE 100%);
// border-radius: 48rpx;
background: linear-gradient(90deg, #FCC800 0%, #FCC800 100%);
border: none !important;
margin-bottom: 20px;
......
......@@ -4,11 +4,6 @@
2. 打包生产模式: 小程序切换url; H5切换ENV_MODEL
*/
let BASEURL = {
// url: "https://miniapp.logwirecloud.com", //TMS
// url: 'http://122.9.90.247:8092' //YMS
// url: 'http://192.168.1.199:7080' //唐浩然
// url: 'http://192.168.0.230:8080' // xiaohan
// url: "https://botms-demo.logwirecloud.com",
// url: "http://localhost:8083", //开发
// url: "http://122.112.220.204:8089", //开发
url: "https://stms.bjzc-scs.com", //生产
......
......@@ -89,10 +89,20 @@ function deepCopy(obj) {
return obj;
}
}
const dateTransformYMDhms = (date)=>{
const Y = date.getFullYear()
const M = date.getMonth() + 1
const D = date.getDate()
const h = date.getHours()
const m = date.getMinutes()
const s = date.getSeconds()
return {Y,M,D,h,m,s}
}
module.exports = {
formatTime,
getImgBase64,
formatGMT,
deepCopy
deepCopy,
dateTransformYMDhms
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment