| | |
| | | <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'"> |
| | |
| | | <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" |
| | |
| | | <!-- <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> |
| | |
| | | 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: '', |
| | |
| | | deliverKeyName: '' |
| | | } |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | onShow() { |
| | | this.init() |
| | | }, |
| | |
| | | this.$refs.formRef.setRules(this.rules); |
| | | }, |
| | | onLoad() { |
| | | this.Getdrivers() |
| | | this.GetCarList() |
| | | this.getCustomer() |
| | | this.GetDriversOfWithin7days() |
| | | }, |
| | |
| | | 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}` |
| | |
| | | }, |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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, |
| | |
| | | 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 |
| | | // }) |
| | |
| | | this.isEdit = false |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | // driverId: '', |
| | | buyerId: null, |
| | | dianhua: '', |
| | | remark: '', |
| | |
| | | title: res.error |
| | | }) |
| | | } |
| | | this.deliverTime = Number(new Date(this.$util.formatDate(new Date(), null, 1))) |
| | | this.isLoading = false |
| | | }) |
| | | return |
| | |
| | | if (res.code == 1) { |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | // driverId: '', |
| | | buyerId: null, |
| | | dianhua: '', |
| | | remark: '', |
| | |
| | | title: res.error |
| | | }) |
| | | } |
| | | this.deliverTime = Number(new Date(this.$util.formatDate(new Date(), null, 1))) |
| | | this.isLoading = false |
| | | }) |
| | | }).catch(errors => { |
| | |
| | | cancelModal() { |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | // driverId: '', |
| | | buyerId: null, |
| | | dianhua: '', |
| | | remark: '', |
| | |
| | | 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 |
| | | }) |
| | | } |
| | | }) |
| | | }, |