From ec90cbd7680a6f927cb1cea43f33ab7df6d0864c Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期二, 11 十一月 2025 09:23:22 +0800
Subject: [PATCH] -
---
src/pages/delivergoods/arrange.vue | 70 ++++++++++++++++++++++++++--------
1 files changed, 53 insertions(+), 17 deletions(-)
diff --git a/src/pages/delivergoods/arrange.vue b/src/pages/delivergoods/arrange.vue
index 017afe0..ee16396 100644
--- a/src/pages/delivergoods/arrange.vue
+++ b/src/pages/delivergoods/arrange.vue
@@ -25,10 +25,15 @@
<view class="chuany-width15">
{{$util.formatDate(item.deliverTime,'riqi')}}
</view>
+ <view class="chuany-width15">
+ <u-text size='14' :text="carNumber(item.car&&item.car.carNumber)" lines="1">
+ <!-- <u-text size='14' :text="item.remark||item.companyName" lines="1"> -->
+ </u-text>
+ </view>
<view :class="item.deliveredstatus !== 'Delivered'?'chuany-width67':'chuany-width79'"
@click='goDetail(item)'>
<u-text size='14' :text="item.companyName" lines="1">
- <!-- <u-text size='14' :text="item.remark||item.companyName" lines="1"> -->
+ <!-- <u-text size='14' :text="item.remark||item.companyName" lines="1"> -->
</u-text>
</view>
<template v-if="item.deliveredstatus !== 'Delivered'">
@@ -53,7 +58,7 @@
<up-empty text='鏆傛棤' icon="/static/order.png">
</up-empty>
</view>
- <up-modal title="閫佽揣瀹夋帓" :show="show7" showCancelButton @confirm="confirmSave" @cancel='cancelModal'
+ <up-modal title="閫佽揣瀹夋帓" :show="show7" showCancelButton @confirm="confirmSave" @cancel='cancelModal'
ref='modalArrange' :asyncClose="true">
<up-form labelPosition="left" :model="arrangeInfo" ref="formRef" labelWidth='140rpx'>
<up-form-item label="閫佽揣鏃ユ湡" prop="deliverTime" required :borderBottom='false' ref="item1"
@@ -81,8 +86,9 @@
<!-- <form-select class="form_select" ref="formSelect1" :search="true" :icon="true"
:placeholder="optionPlaceholder" :selectedId="optionId" :localdata="optionModel"
@change="changeOption" @clear="clearOption"></form-select> -->
- <tem-select ref="formSelect" placeholder="璇烽�夋嫨鏀惰揣鍗曚綅" :selectedId="arrangeInfo.buyerId" :value='arrangeInfo.companyName' :search='true'
- :localdata="customerList" @change="selectChange"></tem-select>
+ <tem-select ref="formSelect" placeholder="璇烽�夋嫨鏀惰揣鍗曚綅" :selectedId="arrangeInfo.buyerId"
+ :value='arrangeInfo.companyName' :search='true' :localdata="customerList"
+ @change="selectChange"></tem-select>
<!-- <up-input v-model="arrangeInfo.companyName" placeholder="璇烽�夋嫨鏀惰揣鍗曚綅" border="none">
<template #suffix>
<up-button @tap="clickAction" text="鐐瑰嚮閫夋嫨" type="primary" size="mini"></up-button>
@@ -145,7 +151,7 @@
deliverTime: Number(new Date(this.$util.formatDate(new Date(), null, 1))),
arrangeInfo: {
deliverTime: this.$util.formatDate(new Date(), null, 1),
- driverId: '',
+ // driverId: '',
buyerId: null,
dianhua: '',
remark: '',
@@ -210,6 +216,9 @@
deliverKeyName: ''
}
},
+ computed: {
+
+ },
onShow() {
this.init()
},
@@ -217,7 +226,7 @@
this.$refs.formRef.setRules(this.rules);
},
onLoad() {
- this.Getdrivers()
+ this.GetCarList()
this.getCustomer()
this.GetDriversOfWithin7days()
},
@@ -238,6 +247,22 @@
uni.stopPullDownRefresh();
},
methods: {
+ carNumber(str) {
+ if (!str) {
+ return ''
+ }
+ // 妫�鏌ュ瓧绗︿覆鏄惁鍖呭惈鎷彿
+ const leftBracket = str.indexOf('(');
+ const rightBracket = str.lastIndexOf(')');
+
+ // 濡傛灉瀛樺湪宸﹀彸鎷彿涓斾綅缃纭紝鍒欒繑鍥炴嫭鍙峰唴鐨勫唴瀹�
+ if (leftBracket !== -1 && rightBracket !== -1 && leftBracket < rightBracket) {
+ return str.substring(leftBracket + 1, rightBracket);
+ }
+
+ // 鍚﹀垯杩斿洖鍘熷瓧绗︿覆
+ return str;
+ },
goDetail(item) {
uni.navigateTo({
url: `/pages/delivergoods/arrangedetail?KeyId=${item.keyid}`
@@ -277,8 +302,10 @@
},
selectItem(item) {
if (this.selectAc == 'driver') {
- this.arrangeInfo.driverName = item.name
- this.arrangeInfo.driverId = item.keyid
+ // this.arrangeInfo.driverName = item.driverName
+ this.arrangeInfo.driverName = item.carNumber
+ // this.arrangeInfo.driverId = item.keyid
+ this.arrangeInfo.carId = item.keyid
} else if (this.selectAc == 'driver7') {
this.deliverKeyID = item.keyid
this.deliverKeyName = item.name
@@ -294,7 +321,7 @@
this.selectAc = ''
},
selectChange(item) {
- console.log(item,'hhhhh');
+ console.log(item, 'hhhhh');
if (typeof item == 'object') {
this.buyerName = item.name
this.arrangeInfo.buyerId = item.keyid
@@ -337,7 +364,8 @@
this.isEdit = true
this.arrangeInfo = {
deliverTime: this.$util.formatDate(item.deliverTime),
- driverId: item.driverId,
+ // driverId: item.driverId,
+ carId: item.car.keyid || "",
buyerId: item.buyerId,
dianhua: item.dianhua,
remark: item.remark,
@@ -346,10 +374,11 @@
keyid: item.keyid,
companyName: item.companyName,
sort: item.sort,
- driverName: item.driver.name || ''
+ driverName: item.car.carNumber || ''
}
this.show7 = true
- this.driverName = item.driver && item.driver.name
+ this.driverName = item.car && item.car.carNumber
+ this.deliverTime = Number(new Date(this.$util.formatDate(item.deliverTime)))
// let obj = this.customerList.find(ite => {
// return ite.keyid == item.buyerId
// })
@@ -433,7 +462,7 @@
this.isEdit = false
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
- driverId: '',
+ // driverId: '',
buyerId: null,
dianhua: '',
remark: '',
@@ -452,6 +481,7 @@
title: res.error
})
}
+ this.deliverTime = Number(new Date(this.$util.formatDate(new Date(), null, 1)))
this.isLoading = false
})
return
@@ -460,7 +490,7 @@
if (res.code == 1) {
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
- driverId: '',
+ // driverId: '',
buyerId: null,
dianhua: '',
remark: '',
@@ -479,6 +509,7 @@
title: res.error
})
}
+ this.deliverTime = Number(new Date(this.$util.formatDate(new Date(), null, 1)))
this.isLoading = false
})
}).catch(errors => {
@@ -489,7 +520,7 @@
cancelModal() {
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
- driverId: '',
+ // driverId: '',
buyerId: null,
dianhua: '',
remark: '',
@@ -499,14 +530,19 @@
driverName: '',
sort: '1'
}
+ this.deliverTime = Number(new Date(this.$util.formatDate(new Date(), null, 1)))
this.show7 = false
this.driverName = ''
this.buyerName = ''
},
- Getdrivers() {
- this.$api.Getdrivers().then(res => {
+ GetCarList() {
+ this.$api.GetCarList().then(res => {
if (res.code == 1) {
this.driverList = res.data
+ this.driverList.forEach(item => {
+ item.driverName = item.name
+ item.name = item.carNumber
+ })
}
})
},
--
Gitblit v1.9.1