From b934f9f9a59e84a1af40ff139418a7d30dd68402 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期五, 07 三月 2025 17:30:34 +0800
Subject: [PATCH] =
---
src/pages/delivergoods/arrange.vue | 102 +++++++++++++++++++++++++++++----------------------
1 files changed, 58 insertions(+), 44 deletions(-)
diff --git a/src/pages/delivergoods/arrange.vue b/src/pages/delivergoods/arrange.vue
index a17a80e..f6985fc 100644
--- a/src/pages/delivergoods/arrange.vue
+++ b/src/pages/delivergoods/arrange.vue
@@ -17,20 +17,21 @@
</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">
+ <view class="listrecord c-p-t-20" v-for="(item,index) in orderList" :key="item.keyid"
+ @click='goDetail(item)'>
<view class="coreshop-ff chuany-bradius20">
<view class="chuany-font26">
<view class="chuany-flex chuany-justify-between">
<text class="chuany-width7">{{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">
</u-text>
</view>
- <view class="chuany-width5">
- <up-icon name="edit-pen" @click='editOrder(item)'></up-icon>
+ <view class="chuany-width5" @tap.stop='editOrder(item)'>
+ <up-icon name="edit-pen"></up-icon>
</view>
</view>
</view>
@@ -43,7 +44,7 @@
</up-empty>
</view>
<up-modal title="閫佽揣瀹夋帓" :show="show7" showCancelButton @confirm="confirmSave" @cancel='cancelModal'
- :asyncClose="true">
+ 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"
@click="clickShouTime">
@@ -58,8 +59,8 @@
<up-input v-model="driverName" disabled border="none" disabledColor="#ffffff"
placeholder="璇烽�夋嫨鍙告満"></up-input>
</up-form-item>
- <up-form-item label="鏀惰揣鍗曚綅" prop="buyerId" required :borderBottom='false' ref="item1">
- <up-input v-model="buyerName" placeholder="璇烽�夋嫨鏀惰揣鍗曚綅" border="none">
+ <up-form-item label="鏀惰揣鍗曚綅" prop="companyName" 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>
</template>
@@ -82,7 +83,7 @@
<fui-date-picker range :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"
- @select="selectItem">
+ wrapMaxHeight='500px' @select="selectItem">
</up-action-sheet>
</view>
</template>
@@ -98,12 +99,11 @@
return {
datePickerShow: false,
shougHuoshow: false,
- workTime: '',
+ workTime: this.$util.formatDate(new Date()),
orderList: [],
loadStatus: 'loadmore',
pageIndex: 1,
- pageSize: 20,
- contentVal: '',
+ pageSize: 30,
customerList: [],
isEdit: false,
editItem: {},
@@ -119,11 +119,12 @@
arrangeInfo: {
deliverTime: this.$util.formatDate(new Date(), null, 1),
driverId: '',
- buyerId: '',
+ buyerId: null,
dianhua: '',
remark: '',
lianxiren: '',
dizhi: '',
+ companyName: ''
},
rules: {
'deliverTime': {
@@ -132,30 +133,31 @@
message: '璇烽�夋嫨鏃ユ湡',
trigger: ['blur', 'change']
},
- 'arrangeInfo.driverId': {
+ // 'driverId': {
+ // required: true,
+ // message: '璇烽�夋嫨鍙告満',
+ // trigger: ['blur', 'change']
+ // },
+ 'companyName': {
type: 'string',
- max: 1,
required: true,
- message: '璇烽�夋嫨鍙告満',
+ message: '璇峰~鍐欏叕鍙�',
trigger: ['blur', 'change']
},
- 'arrangeInfo.dianhua': {
+ 'dianhua': {
type: 'string',
- max: 1,
required: true,
message: '璇疯緭鍏ヨ仈绯荤數璇�',
trigger: ['blur', 'change']
},
- 'arrangeInfo.dizhi': {
+ 'dizhi': {
type: 'string',
- max: 1,
required: true,
message: '璇疯緭鍏ラ�佽揣鍦板潃',
trigger: ['blur', 'change']
},
- 'arrangeInfo.remark': {
+ 'remark': {
type: 'string',
- max: 1,
required: true,
message: '璇疯緭鍏ラ�佽揣浜嬬敱',
trigger: ['blur', 'change']
@@ -165,8 +167,8 @@
switchVal: false,
driverList: [],
buyerName: '',
- timeStart: '',
- timeEnd: '',
+ timeStart: new Date(),
+ timeEnd: new Date(),
sevenDaysDriver: [],
deliverKeyID: '',
deliverKeyName: ''
@@ -183,20 +185,28 @@
this.getCustomer()
this.GetDriversOfWithin7days()
},
+ onMounted() {
+ this.$refs.formRef.setRules(this.rules);
+ },
onReachBottom() {
if (this.loadStatus != 'nomore') {
this.getList()
}
},
onPullDownRefresh() {
- this.startDate = ''
- this.endDate = ''
+ this.timeStart = ''
+ this.timeEnd = ''
this.workTime = ''
this.deliverKeyName = ''
this.init()
uni.stopPullDownRefresh();
},
methods: {
+ goDetail(item) {
+ uni.navigateTo({
+ url: `/pages/delivergoods/arrangedetail?KeyId=${item.keyid}`
+ });
+ },
GetDriversOfWithin7days() {
this.$api.GetDriversOfWithin7days().then(res => {
if (res.code == 1) {
@@ -205,12 +215,11 @@
})
},
changePicker(val) {
- console.log(val);
this.workTime = val.startDate.result + '鑷�' + val.endDate.result
this.timeStart = new Date(val.startDate.result) //宸ヤ綔寮�濮嬫椂闂�
this.timeEnd = new Date(val.endDate.result)
this.datePickerShow = !this.datePickerShow
- this.getList()
+ this.init()
},
confirmDate(val) {
console.log(val);
@@ -241,6 +250,7 @@
this.arrangeInfo.dizhi = item.adder
this.arrangeInfo.dianhua = item.companyPhone
this.arrangeInfo.lianxiren = item.businessManagers
+ this.arrangeInfo.companyName = item.companyName
}
this.selectAc = ''
},
@@ -281,14 +291,15 @@
remark: item.remark,
lianxiren: item.lianxiren,
dizhi: item.dizhi,
- keyid: item.keyid
+ keyid: item.keyid,
+ companyName: item.companyName
}
this.show7 = true
- this.driverName = item.driver.name
- let obj = this.customerList.find(ite => {
- return ite.keyid == item.buyerId
- })
- this.buyerName = obj.companyName
+ this.driverName = item.driver && item.driver.name
+ // let obj = this.customerList.find(ite => {
+ // return ite.keyid == item.buyerId
+ // })
+ // this.buyerName = obj.companyName
},
delOrder(item) {
let that = this
@@ -320,13 +331,20 @@
},
init() {
this.pageIndex = 1
- this.pageSize = 20
+ this.pageSize = 30
this.loadStatus = 'loadmore'
this.orderList = []
- this.contentVal = ''
+ console.log(this.orderList);
this.getList()
},
confirmSave() {
+ 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 => {
@@ -335,7 +353,7 @@
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
driverId: '',
- buyerId: '',
+ buyerId: null,
dianhua: '',
remark: '',
lianxiren: '',
@@ -359,7 +377,7 @@
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
driverId: '',
- buyerId: '',
+ buyerId: null,
dianhua: '',
remark: '',
lianxiren: '',
@@ -376,6 +394,8 @@
}
this.isLoading = false
})
+ }).catch(errors => {
+ this.$refs.modalArrange.loading = false
})
},
@@ -383,7 +403,7 @@
this.arrangeInfo = {
deliverTime: this.$util.formatDate(new Date(), null, 1),
driverId: '',
- buyerId: '',
+ buyerId: null,
dianhua: '',
remark: '',
lianxiren: '',
@@ -464,12 +484,6 @@
}
}
})
- },
- actionClick(item, e) {
- console.log(e);
- if (e.index == 0) {
- this.contentVal = item.remark
- }
}
}
}
--
Gitblit v1.9.1