| | |
| | | </view> |
| | | <view class="coreshop-ff content c-p-10 chuany-flex chuany-justify-between"> |
| | | <view class="chuany-width82"> |
| | | <up-search placeholder="请点击选择司机" @click='clickIcon' @clear='PostMyDakaListPage' disabled |
| | | action-text="查询" v-model="wordDate" search-icon="calendar" @search='PostMyDakaListPage' |
| | | @custom='PostMyDakaListPage'></up-search> |
| | | <up-search placeholder="请点击选择司机" @click="clickAction('driver7')" @clear='init' disabled |
| | | @change='init' action-text="查询" v-model="deliverKeyName" @search='init' |
| | | @custom='init'></up-search> |
| | | </view> |
| | | <up-text align="right" text='送货安排' size='14' @click="arrange('Yes')"></up-text> |
| | | <up-text align="right" text='送货安排' size='14' @click="() => show7 = true"></up-text> |
| | | </view> |
| | | </view> |
| | | </up-sticky> |
| | |
| | | <view class="coreshop-ff chuany-bradius20"> |
| | | <view class="chuany-font26"> |
| | | <view class="chuany-flex chuany-justify-between"> |
| | | <text class="chuany-width5">{{index+1}}</text> |
| | | <text class="chuany-width7">{{index+1}}</text> |
| | | <view class="chuany-width15"> |
| | | {{$util.formatDate(item.createTime,'riqi')}} |
| | | </view> |
| | | <view class="chuany-width65"> |
| | | <view class="chuany-width73"> |
| | | <u-text size='14' :text="item.remark" lines="1"> |
| | | </u-text> |
| | | </view> |
| | | <view class="chuany-width11 chuany-flex chuany-justify-between"> |
| | | <view class="chuany-width5"> |
| | | <up-icon name="edit-pen" @click='editOrder(item)'></up-icon> |
| | | <up-icon name="trash" @click='delOrder(item)'></up-icon> |
| | | </view> |
| | | </view> |
| | | <view class="c-p-t-8"> |
| | | <u--text :lines="1" :text="item.planContent"></u--text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <up-empty text='暂无' icon="/static/order.png"> |
| | | </up-empty> |
| | | </view> |
| | | <up-modal title="送货安排" :show="show7" showCancelButton @confirm="() => show7 = false"> |
| | | <up-form labelPosition="left" :model="model1" :rules="rules" ref="form1"> |
| | | <up-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"> |
| | | <up-input v-model="model1.userInfo.name" border="none"></up-input> |
| | | <up-modal title="送货安排" :show="show7" showCancelButton @confirm="confirmSave" @cancel='cancelModal' |
| | | :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"> |
| | | <!-- <up-input v-model="arrangeInfo.deliverTime" readonly border="none" |
| | | placeholder="点击选择工作日期"></up-input> --> |
| | | <up-datetime-picker hasInput @confirm='confirmDate' :show="shougHuoshow" v-model="deliverTime" |
| | | mode="date" placeholder="点击选择工作日期" :minDate='Number(new Date(minDate))' |
| | | @cancel='() => shougHuoshow = false'></up-datetime-picker> |
| | | </up-form-item> |
| | | <up-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"> |
| | | <up-input v-model="model1.userInfo.name" border="none"></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"> |
| | | <up-input v-model="model1.userInfo.name" border="none"></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"> |
| | | <up-input v-model="model1.userInfo.name" border="none"></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"> |
| | | <up-input v-model="model1.userInfo.name" border="none"></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="性别" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()" |
| | | <up-form-item label="司机" prop="driverId" required :borderBottom='false' @click="clickAction('driver')" |
| | | ref="item1"> |
| | | <up-input v-model="model1.userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择性别" |
| | | border="none"></up-input> |
| | | <template #right> |
| | | <up-icon name="arrow-right"></up-icon> |
| | | </template> |
| | | <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"> |
| | | <template #suffix> |
| | | <up-button @tap="clickAction" text="点击选择" type="primary" size="mini"></up-button> |
| | | </template> |
| | | </up-input> |
| | | </up-form-item> |
| | | <up-form-item label="联系人" prop="lianxiren" :borderBottom='false' ref="item1"> |
| | | <up-input v-model="arrangeInfo.lianxiren" border="none" placeholder="请输入联系人"></up-input> |
| | | </up-form-item> |
| | | <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-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> |
| | | </up-form> |
| | | </up-modal> |
| | | <fui-date-picker range :show="datePickerShow" :value="getFirstDayOfMonth()" type="3" @change="changePicker" :minDate='minDate' :maxDate='maxDate' |
| | | @cancel="clickTime"></fui-date-picker> |
| | | <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"> |
| | | </up-action-sheet> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | datePickerShow:false, |
| | | workTime:'', |
| | | datePickerShow: false, |
| | | shougHuoshow: false, |
| | | workTime: '', |
| | | orderList: [], |
| | | loadStatus: 'loadmore', |
| | | pageIndex: 1, |
| | | pageSize: 20, |
| | | contentVal: '', |
| | | options2: [{ |
| | | text: '编辑', |
| | | style: { |
| | | backgroundColor: '#3c9cff' |
| | | } |
| | | }, { |
| | | text: '删除', |
| | | style: { |
| | | backgroundColor: '#f56c6c' |
| | | } |
| | | }], |
| | | customerList: [], |
| | | isEdit: false, |
| | | editItem: {}, |
| | | isLoading: false, |
| | | show7: false, |
| | | showSex: false, |
| | | model1: { |
| | | userInfo: { |
| | | name: 'uview-plus UI', |
| | | sex: '', |
| | | }, |
| | | showActions: false, |
| | | driverName: '', |
| | | actions: [], |
| | | selectAc: '', |
| | | minDate: this.$util.formatDate(new Date(), null, -7), |
| | | maxDate: this.$util.formatDate(new Date(), null, 7), |
| | | deliverTime: Number(new Date(this.$util.formatDate(new Date(), null, 1))), |
| | | arrangeInfo: { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | buyerId: '', |
| | | dianhua: '', |
| | | remark: '', |
| | | lianxiren: '', |
| | | dizhi: '', |
| | | }, |
| | | actions: [{ |
| | | name: '男', |
| | | }, |
| | | { |
| | | name: '女', |
| | | }, |
| | | { |
| | | name: '保密', |
| | | }, |
| | | ], |
| | | rules: { |
| | | 'userInfo.name': { |
| | | 'deliverTime': { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请填写姓名', |
| | | message: '请选择日期', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'userInfo.sex': { |
| | | 'arrangeInfo.driverId': { |
| | | type: 'string', |
| | | max: 1, |
| | | required: true, |
| | | message: '请选择男或女', |
| | | message: '请选择司机', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'arrangeInfo.dianhua': { |
| | | type: 'string', |
| | | max: 1, |
| | | required: true, |
| | | message: '请输入联系电话', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'arrangeInfo.dizhi': { |
| | | type: 'string', |
| | | max: 1, |
| | | required: true, |
| | | message: '请输入送货地址', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'arrangeInfo.remark': { |
| | | type: 'string', |
| | | max: 1, |
| | | required: true, |
| | | message: '请输入送货事由', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | }, |
| | | radio: '', |
| | | switchVal: false |
| | | switchVal: false, |
| | | driverList: [], |
| | | buyerName: '', |
| | | timeStart: '', |
| | | timeEnd: '', |
| | | sevenDaysDriver: [], |
| | | deliverKeyID: '', |
| | | deliverKeyName: '' |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.init() |
| | | }, |
| | | onReady() { |
| | | this.$refs.formRef.setRules(this.rules); |
| | | }, |
| | | onLoad() { |
| | | this.Getdrivers() |
| | | this.getCustomer() |
| | | this.GetDriversOfWithin7days() |
| | | }, |
| | | onReachBottom() { |
| | | if (this.loadStatus != 'nomore') { |
| | | this.getList() |
| | | } |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.startDate = '' |
| | | this.endDate = '' |
| | | this.workTime = '' |
| | | this.deliverKeyName = '' |
| | | this.init() |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | methods: { |
| | | getFirstDayOfMonth () { |
| | | GetDriversOfWithin7days() { |
| | | this.$api.GetDriversOfWithin7days().then(res => { |
| | | if (res.code == 1) { |
| | | this.sevenDaysDriver = res.data |
| | | } |
| | | }) |
| | | }, |
| | | 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() |
| | | }, |
| | | confirmDate(val) { |
| | | console.log(val); |
| | | this.arrangeInfo.deliverTime = val |
| | | this.shougHuoshow = false |
| | | }, |
| | | getCustomer() { |
| | | this.$api.GeCorporateClients().then(res => { |
| | | if (res.code == 1) { |
| | | this.customerList = res.data |
| | | this.customerList.forEach(item => { |
| | | item.name = item.companyName |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | selectItem(item) { |
| | | if (this.selectAc == 'driver') { |
| | | this.driverName = item.name |
| | | this.arrangeInfo.driverId = item.keyid |
| | | } else if (this.selectAc == 'driver7') { |
| | | this.deliverKeyID = item.keyid |
| | | this.deliverKeyName = item.name |
| | | this.init() |
| | | } else { |
| | | this.buyerName = item.name |
| | | this.arrangeInfo.buyerId = item.keyid |
| | | this.arrangeInfo.dizhi = item.adder |
| | | this.arrangeInfo.dianhua = item.companyPhone |
| | | this.arrangeInfo.lianxiren = item.businessManagers |
| | | } |
| | | this.selectAc = '' |
| | | }, |
| | | getFirstDayOfMonth() { |
| | | var currentDate = new Date(); |
| | | // currentDate.setDate(1); // 将日期设为1 |
| | | return this.$util.formatDate(currentDate); |
| | | }, |
| | | clickTime () { |
| | | clickTime() { |
| | | this.datePickerShow = !this.datePickerShow |
| | | }, |
| | | clickShouTime() { |
| | | this.shougHuoshow = !this.shougHuoshow |
| | | }, |
| | | clickAction(val) { |
| | | switch (val) { |
| | | case 'driver': |
| | | this.actions = this.driverList |
| | | break |
| | | case 'driver7': |
| | | this.actions = this.sevenDaysDriver |
| | | break |
| | | default: |
| | | this.actions = this.customerList |
| | | break |
| | | } |
| | | this.selectAc = val |
| | | this.showActions = true |
| | | uni.hideKeyboard() |
| | | }, |
| | | editOrder(item) { |
| | | this.isEdit = true |
| | | this.contentVal = item.remark |
| | | this.editItem = item |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: item.driverId, |
| | | buyerId: item.buyerId, |
| | | dianhua: item.dianhua, |
| | | remark: item.remark, |
| | | lianxiren: item.lianxiren, |
| | | dizhi: item.dizhi, |
| | | keyid: item.keyid |
| | | } |
| | | this.show7 = true |
| | | this.driverName = item.driver.name |
| | | let obj = this.customerList.find(ite => { |
| | | return ite.keyid == item.buyerId |
| | | }) |
| | | this.buyerName = obj.companyName |
| | | }, |
| | | delOrder(item) { |
| | | let that = this |
| | |
| | | this.contentVal = '' |
| | | this.getList() |
| | | }, |
| | | reservation() { |
| | | this.show7 = true |
| | | if (!this.contentVal) { |
| | | return this.$util.showToast({ |
| | | title: '请先输入内容!' |
| | | }) |
| | | } |
| | | this.isLoading = true |
| | | if (this.isEdit) { |
| | | let obj = { |
| | | keyid: this.editItem.keyid, |
| | | remark: this.contentVal |
| | | confirmSave() { |
| | | this.$refs.formRef.validate().then(res => { |
| | | if (this.isEdit) { |
| | | this.$api.UpDataDeliverPlans(this.arrangeInfo).then(res => { |
| | | if (res.code == 1) { |
| | | this.isEdit = false |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | buyerId: '', |
| | | dianhua: '', |
| | | remark: '', |
| | | lianxiren: '', |
| | | dizhi: '', |
| | | } |
| | | this.show7 = false |
| | | this.driverName = '' |
| | | this.buyerName = '' |
| | | this.init() |
| | | } else { |
| | | this.$util.showToast({ |
| | | title: res.error |
| | | }) |
| | | } |
| | | this.isLoading = false |
| | | }) |
| | | return |
| | | } |
| | | this.$api.UpDataAppointmentDeliver(obj).then(res => { |
| | | this.$api.CreatDeliverPlan(this.arrangeInfo).then(res => { |
| | | if (res.code == 1) { |
| | | this.isEdit = false |
| | | this.editItem = {} |
| | | this.contentVal = '' |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | buyerId: '', |
| | | dianhua: '', |
| | | remark: '', |
| | | lianxiren: '', |
| | | dizhi: '', |
| | | } |
| | | this.show7 = false |
| | | this.driverName = '' |
| | | this.buyerName = '' |
| | | this.init() |
| | | } else { |
| | | this.$util.showToast({ |
| | |
| | | } |
| | | this.isLoading = false |
| | | }) |
| | | return |
| | | }) |
| | | |
| | | }, |
| | | cancelModal() { |
| | | this.arrangeInfo = { |
| | | deliverTime: this.$util.formatDate(new Date(), null, 1), |
| | | driverId: '', |
| | | buyerId: '', |
| | | dianhua: '', |
| | | remark: '', |
| | | lianxiren: '', |
| | | dizhi: '', |
| | | } |
| | | this.$api.CreatAppointmentDeliver({ |
| | | remark: this.contentVal |
| | | }).then(res => { |
| | | this.show7 = false |
| | | this.driverName = '' |
| | | this.buyerName = '' |
| | | }, |
| | | Getdrivers() { |
| | | this.$api.Getdrivers().then(res => { |
| | | if (res.code == 1) { |
| | | this.contentVal = '' |
| | | this.init() |
| | | } else { |
| | | this.$util.showToast({ |
| | | title: res.error |
| | | }) |
| | | this.driverList = res.data |
| | | } |
| | | this.isLoading = false |
| | | }) |
| | | }, |
| | | getList() { |
| | | this.deliverKeyName == '' ? this.deliverKeyID = '' : null |
| | | let data = { |
| | | deliverState: 0, |
| | | page: { |
| | | pageIndex: this.pageIndex, |
| | | pageSize: this.pageSize, |
| | | } |
| | | } |
| | | this.$api.GetListAppointmentDeliverList(data).then(res => { |
| | | console.log(res, res.code, '-----------123’'); |
| | | if (this.timeStart) { |
| | | data.timeStart = this.timeStart |
| | | } |
| | | if (this.timeEnd) { |
| | | data.timeEnd = this.timeEnd |
| | | } |
| | | if (this.deliverKeyID) { |
| | | data.deliverKeyID = this.deliverKeyID |
| | | } |
| | | this.$api.GetDeliverPlans(data).then(res => { |
| | | if (res.code == 1) { |
| | | if (this.pageIndex == 1) { |
| | | this.orderList = res.data.data |
| | |
| | | </script> |
| | | |
| | | <style> |
| | | .u-textarea { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .u-form-item__body { |
| | | padding: 5px 0 !important; |
| | | } |
| | | </style> |