From 98494fda33f6dd116ef3ce641b32937b7d83b4c1 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期三, 12 三月 2025 17:15:07 +0800
Subject: [PATCH] -

---
 src/pages/delivergoods/arrange.vue |  138 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 102 insertions(+), 36 deletions(-)

diff --git a/src/pages/delivergoods/arrange.vue b/src/pages/delivergoods/arrange.vue
index 9242dea..e51504a 100644
--- a/src/pages/delivergoods/arrange.vue
+++ b/src/pages/delivergoods/arrange.vue
@@ -17,22 +17,31 @@
 	</up-sticky>
 	<view class="c-p-b-100">
 		<view class="c-p-l-20 c-p-r-20" v-if="orderList&&orderList.length>0">
-			<view class="listrecord c-p-t-20" v-for="(item,index) in orderList" :key="item.keyid"
-				@click='goDetail(item)'>
+			<view class="listrecord c-p-t-20" v-for="(item,index) in orderList" :key="item.keyid">
 				<view class="coreshop-ff chuany-bradius20">
 					<view class="chuany-font26">
 						<view class="chuany-flex chuany-justify-between">
-							<text class="chuany-width7">{{index+1}}</text>
+							<text class="chuany-width6">{{index+1}}</text>
 							<view class="chuany-width15">
-								{{$util.formatDate(item.createTime,'riqi')}}
+								{{$util.formatDate(item.deliverTime,'riqi')}}
 							</view>
-							<view class="chuany-width73">
-								<u-text size='14' :text="item.remark" lines="1">
+							<view :class="item.deliveredstatus == 'Delivered'?'chuany-width67':'chuany-width79'"
+								@click='goDetail(item)'>
+								<u-text size='14' :text="item.remark||item.companyName" lines="1">
 								</u-text>
 							</view>
-							<view class="chuany-width5" @tap.stop='editOrder(item)'>
-								<up-icon name="edit-pen"></up-icon>
-							</view>
+							<template v-if="item.deliveredstatus == 'Delivered'">
+								<view class="chuany-width6 chuany-paddingright-10" @tap.stop='editOrder(item)'>
+									<up-icon name="edit-pen" size='18'></up-icon>
+								</view>
+								<view class="chuany-width6" @tap.stop='UndoDeliverPlans(item)'>
+									<up-icon name="reload" size='19'></up-icon>
+								</view>
+							</template>
+							<!-- <view class="chuany-width6" v-else>
+								<u-text size='14' type="" text="" lines="1">
+								</u-text>
+							</view> -->
 						</view>
 					</view>
 				</view>
@@ -54,12 +63,17 @@
 						mode="date" placeholder="鐐瑰嚮閫夋嫨宸ヤ綔鏃ユ湡" :minDate='Number(new Date(minDate))'
 						@cancel='() => shougHuoshow = false'></up-datetime-picker>
 				</up-form-item>
-				<up-form-item label="鍙告満" prop="driverId" required :borderBottom='false' @click="clickAction('driver')"
+				<up-form-item label="鎺掑簭" prop="sort" required :borderBottom='false' ref="item1">
+					<up-input v-model="arrangeInfo.sort" placeholder="璇疯緭鍏ユ帓搴�" border="none" type="number">
+					</up-input>
+				</up-form-item>
+				<up-form-item label="鍙告満" prop="driverName" required :borderBottom='false' @click="clickAction('driver')"
 					ref="item1">
-					<up-input v-model="driverName" disabled border="none" disabledColor="#ffffff"
+					<up-input v-model="arrangeInfo.driverName" disabled border="none" disabledColor="#ffffff"
 						placeholder="璇烽�夋嫨鍙告満"></up-input>
 				</up-form-item>
-				<up-form-item label="鏀惰揣鍗曚綅" prop="companyName" required :borderBottom='false' ref="item1">
+				<up-form-item label="鏀惰揣鍗曚綅" prop="companyName" labelPosition='top' required :borderBottom='false'
+					ref="item1">
 					<up-input v-model="arrangeInfo.companyName" placeholder="璇烽�夋嫨鏀惰揣鍗曚綅" border="none">
 						<template #suffix>
 							<up-button @tap="clickAction" text="鐐瑰嚮閫夋嫨" type="primary" size="mini"></up-button>
@@ -72,15 +86,15 @@
 				<up-form-item label="鑱旂郴鐢佃瘽" prop="dianhua" required :borderBottom='false' ref="item1">
 					<up-input v-model="arrangeInfo.dianhua" border="none" placeholder="璇疯緭鍏ヨ仈绯荤數璇�"></up-input>
 				</up-form-item>
-				<up-form-item label="閫佽揣鍦板潃" prop="dizhi" required :borderBottom='false' ref="item1">
+				<up-form-item label="閫佽揣鍦板潃" prop="dizhi" labelPosition='top' required :borderBottom='false' ref="item1">
 					<up-input v-model="arrangeInfo.dizhi" border="none" placeholder="璇疯緭鍏ラ�佽揣鍦板潃"></up-input>
 				</up-form-item>
-				<up-form-item label="閫佽揣浜嬬敱" prop="remark" required :borderBottom='false' ref="item1">
-					<up-textarea v-model="arrangeInfo.remark" border="none" placeholder="璇疯緭鍏ラ�佽揣浜嬬敱"></up-textarea>
+				<up-form-item label="閫佽揣浜嬬敱" prop="remark" labelPosition='top' required :borderBottom='false' ref="item1">
+					<up-input v-model="arrangeInfo.remark" border="none" placeholder="璇疯緭鍏ラ�佽揣浜嬬敱"></up-input>
 				</up-form-item>
 			</up-form>
 		</up-modal>
-		<fui-date-picker range :show="datePickerShow" :value="getFirstDayOfMonth()" type="3" zIndex="10000"
+		<fui-date-picker :show="datePickerShow" :value="getFirstDayOfMonth()" type="3" zIndex="10000"
 			@change="changePicker" :minDate='minDate' :maxDate='maxDate' @cancel="clickTime"></fui-date-picker>
 		<up-action-sheet :show="showActions" :actions="actions" title="璇烽�夋嫨" @close="showActions = false"
 			wrapMaxHeight='500px' @select="selectItem">
@@ -99,11 +113,11 @@
 			return {
 				datePickerShow: false,
 				shougHuoshow: false,
-				workTime: '',
+				workTime: this.$util.formatDate(new Date()),
 				orderList: [],
 				loadStatus: 'loadmore',
 				pageIndex: 1,
-				pageSize: 20,
+				pageSize: 30,
 				customerList: [],
 				isEdit: false,
 				editItem: {},
@@ -124,7 +138,10 @@
 					remark: '',
 					lianxiren: '',
 					dizhi: '',
-					companyName: ''
+					companyName: '',
+					driverName: '',
+					deliverTixingId: '',
+					sort: '1'
 				},
 				rules: {
 					'deliverTime': {
@@ -133,11 +150,12 @@
 						message: '璇烽�夋嫨鏃ユ湡',
 						trigger: ['blur', 'change']
 					},
-					// 'driverId': {
-					// 	required: true,
-					// 	message: '璇烽�夋嫨鍙告満',
-					// 	trigger: ['blur', 'change']
-					// },
+					'driverName': {
+						type: 'string',
+						required: true,
+						message: '璇烽�夋嫨鍙告満',
+						trigger: ['blur', 'change']
+					},
 					'companyName': {
 						type: 'string',
 						required: true,
@@ -162,13 +180,19 @@
 						message: '璇疯緭鍏ラ�佽揣浜嬬敱',
 						trigger: ['blur', 'change']
 					},
+					'sort': {
+						type: 'string',
+						required: true,
+						message: '璇疯緭鍏ユ帓搴�',
+						trigger: ['blur', 'change']
+					},
 				},
 				radio: '',
 				switchVal: false,
 				driverList: [],
 				buyerName: '',
-				timeStart: '',
-				timeEnd: '',
+				timeStart: new Date(),
+				timeEnd: new Date(),
 				sevenDaysDriver: [],
 				deliverKeyID: '',
 				deliverKeyName: ''
@@ -194,9 +218,9 @@
 			}
 		},
 		onPullDownRefresh() {
-			this.timeStart = ''
-			this.timeEnd = ''
-			this.workTime = ''
+			this.timeStart = new Date()
+			this.timeEnd = new Date()
+			this.workTime = this.$util.formatDate(new Date())
 			this.deliverKeyName = ''
 			this.init()
 			uni.stopPullDownRefresh();
@@ -215,9 +239,10 @@
 				})
 			},
 			changePicker(val) {
-				this.workTime = val.startDate.result + '鑷�' + val.endDate.result
-				this.timeStart = new Date(val.startDate.result) //宸ヤ綔寮�濮嬫椂闂�
-				this.timeEnd = new Date(val.endDate.result)
+				console.log(val, '-=-=鈥�');
+				this.workTime = val.result
+				this.timeStart = new Date(val.result) //宸ヤ綔寮�濮嬫椂闂�
+				this.timeEnd = new Date(val.result)
 				this.datePickerShow = !this.datePickerShow
 				this.init()
 			},
@@ -292,14 +317,42 @@
 					lianxiren: item.lianxiren,
 					dizhi: item.dizhi,
 					keyid: item.keyid,
-					companyName: item.companyName
+					companyName: item.companyName,
+					sort: item.sort
 				}
 				this.show7 = true
-				this.driverName = item.driver.name
+				this.driverName = item.driver && item.driver.name
 				// let obj = this.customerList.find(ite => {
 				// 	return ite.keyid == item.buyerId
 				// })
 				// this.buyerName = obj.companyName
+			},
+			UndoDeliverPlans(item) {
+				let that = this
+				uni.showModal({
+					title: '鎻愮ず',
+					content: '纭鎾ら攢璇ヨ鍗曞悧锛�',
+					success: function(res) {
+						if (res.confirm) {
+							// 鎵ц纭鍚庣殑鎿嶄綔
+							that.$api.UndoDeliverPlans(item.keyid).then(res => {
+								if (res.code == 1) {
+									that.$util.showToast({
+										title: '鎾ら攢鎴愬姛锛�'
+									})
+									that.init()
+								} else {
+									that.$util.showToast({
+										title: res.error
+									})
+								}
+							})
+						} else {
+							// 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+						}
+					}
+				})
+
 			},
 			delOrder(item) {
 				let that = this
@@ -331,14 +384,20 @@
 			},
 			init() {
 				this.pageIndex = 1
-				this.pageSize = 20
+				this.pageSize = 30
 				this.loadStatus = 'loadmore'
 				this.orderList = []
 				console.log(this.orderList);
 				this.getList()
 			},
 			confirmSave() {
-				console.log(this.arrangeInfo.driverId);
+				if (!this.arrangeInfo.driverId) {
+					this.$refs.modalArrange.loading = false
+					return this.$util.showToast({
+						title: '璇烽�夋嫨鍙告満锛�'
+					})
+				}
+				console.log();
 				this.$refs.formRef.validate().then(res => {
 					if (this.isEdit) {
 						this.$api.UpDataDeliverPlans(this.arrangeInfo).then(res => {
@@ -352,6 +411,7 @@
 									remark: '',
 									lianxiren: '',
 									dizhi: '',
+									sort: '1'
 								}
 								this.show7 = false
 								this.driverName = ''
@@ -376,6 +436,9 @@
 								remark: '',
 								lianxiren: '',
 								dizhi: '',
+								companyName: '',
+								driverName: '',
+								sort: '1'
 							}
 							this.show7 = false
 							this.driverName = ''
@@ -402,6 +465,9 @@
 					remark: '',
 					lianxiren: '',
 					dizhi: '',
+					companyName: '',
+					driverName: '',
+					sort: '1'
 				}
 				this.show7 = false
 				this.driverName = ''

--
Gitblit v1.9.1