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

企业微信前端

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