-
zhangwei
2025-03-14 6e961fafc0f921d575772a3c89f2c5cad28c270d
src/pages/delivergoods/arrange.vue
@@ -25,12 +25,12 @@
                     <view class="chuany-width15">
                        {{$util.formatDate(item.deliverTime,'riqi')}}
                     </view>
                     <view :class="item.deliveredstatus == 'Delivered'?'chuany-width67':'chuany-width79'"
                     <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>
                     <template v-if="item.deliveredstatus == 'Delivered'">
                     <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>
@@ -52,7 +52,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"
@@ -60,8 +60,8 @@
               <!-- <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>
                  disabled disabledColor='#FFF' mode="date" placeholder="点击选择工作日期"
                  :minDate='Number(new Date(minDate))' @cancel='() => shougHuoshow = false'></up-datetime-picker>
            </up-form-item>
            <up-form-item label="排序" prop="sort" required :borderBottom='false' ref="item1">
               <up-input v-model="arrangeInfo.sort" placeholder="请输入排序" border="none" type="number">
@@ -73,12 +73,20 @@
                  placeholder="请选择司机"></up-input>
            </up-form-item>
            <up-form-item label="收货单位" prop="companyName" labelPosition='top' required :borderBottom='false'
               ref="item1">
               <up-input v-model="arrangeInfo.companyName" placeholder="请选择收货单位" border="none">
               ref="item1" v-if='show7'>
               <!-- <tem-selects-fan placeholder="请选择收货单位" :data="customerList" :clearable='true'
                  :value="arrangeInfo.companyName" :value-type="valueType" :filterable='true' :searchType='1'
                  @input='selectChange'></tem-selects-fan> -->
               <!-- <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>
               <!-- <up-input v-model="arrangeInfo.companyName" placeholder="请选择收货单位" border="none">
                  <template #suffix>
                     <up-button @tap="clickAction" text="点击选择" type="primary" size="mini"></up-button>
                  </template>
               </up-input>
               </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>
@@ -111,6 +119,10 @@
   export default {
      data() {
         return {
            valueType: {
               label: 'companyName',
               value: 'keyid'
            },
            datePickerShow: false,
            shougHuoshow: false,
            workTime: this.$util.formatDate(new Date()),
@@ -140,7 +152,6 @@
               dizhi: '',
               companyName: '',
               driverName: '',
               deliverTixingId: '',
               sort: '1'
            },
            rules: {
@@ -159,7 +170,7 @@
               'companyName': {
                  type: 'string',
                  required: true,
                  message: '请填写公司',
                  message: '请选择或填写送货单位',
                  trigger: ['blur', 'change']
               },
               'dianhua': {
@@ -181,7 +192,7 @@
                  trigger: ['blur', 'change']
               },
               'sort': {
                  type: 'string',
                  type: 'number',
                  required: true,
                  message: '请输入排序',
                  trigger: ['blur', 'change']
@@ -248,7 +259,7 @@
         },
         confirmDate(val) {
            console.log(val);
            this.arrangeInfo.deliverTime = val
            this.arrangeInfo.deliverTime = this.$util.formatDate(val.value)
            this.shougHuoshow = false
         },
         getCustomer() {
@@ -257,13 +268,15 @@
                  this.customerList = res.data
                  this.customerList.forEach(item => {
                     item.name = item.companyName
                     item.title = item.companyName
                     item.id = item.keyid
                  })
               }
            })
         },
         selectItem(item) {
            if (this.selectAc == 'driver') {
               this.driverName = item.name
               this.arrangeInfo.driverName = item.name
               this.arrangeInfo.driverId = item.keyid
            } else if (this.selectAc == 'driver7') {
               this.deliverKeyID = item.keyid
@@ -278,6 +291,19 @@
               this.arrangeInfo.companyName = item.companyName
            }
            this.selectAc = ''
         },
         selectChange(item) {
            console.log(item,'hhhhh');
            if (typeof item == 'object') {
               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.arrangeInfo.companyName = item.companyName
            } else {
               this.arrangeInfo.companyName = item
            }
         },
         getFirstDayOfMonth() {
            var currentDate = new Date();
@@ -318,7 +344,8 @@
               dizhi: item.dizhi,
               keyid: item.keyid,
               companyName: item.companyName,
               sort: item.sort
               sort: item.sort,
               driverName: item.driver.name || ''
            }
            this.show7 = true
            this.driverName = item.driver && item.driver.name
@@ -391,12 +418,12 @@
            this.getList()
         },
         confirmSave() {
            if (!this.arrangeInfo.driverId) {
               this.$refs.modalArrange.loading = false
               return this.$util.showToast({
                  title: '请选择司机!'
               })
            }
            // 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) {