lilei 11 месяцев назад
Родитель
Сommit
4956ec316b

+ 2 - 3
src/views/salesManagement/waitDispatchNew/detailProductList.vue

@@ -75,10 +75,9 @@ export default {
           }
         }
       },
+      // 可拖曳调整列宽
       columnWidthResizeOption: {
-        // default false
         enable: true,
-        // column resize min width
         minWidth: 50
       },
       cellSpanOption: {
@@ -145,7 +144,7 @@ export default {
           return (
             <div>
               <a-input-number
-                id={'dispatch-cancelNums-' + record.productSn}
+                id={'dispatch-qty-' + record.productSn}
                 size="small"
                 value={record.qty}
                 onChange={e => record.qty = e}

+ 28 - 26
src/views/salesManagement/waitDispatchNew/dsModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="dealerAccountEdit-modal"
+    class="dsModal-modal"
     :footer="null"
     :maskClosable="false"
     :title="title"
@@ -12,7 +12,7 @@
     <div>
       <a-spin :spinning="spinning" tip="Loading...">
         <a-form-model
-          id="dealerAccountEdit-form"
+          id="dsModal-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -24,12 +24,12 @@
           </a-form-model-item>
           <div v-if="!receiverDisabled">
             <a-form-model-item label="收货客户名称" extra="如果收货客户和下单客户相同,则不需要选择收货客户名称">
-              <dealerSubareaScopeList ref="dealerSubareaScopeList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
+              <dealerSubareaScopeList id="dsModal-receiverSn" ref="dealerSubareaScopeList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
             </a-form-model-item>
             <a-form-model-item label="收货地址" prop="dealerRecevieAddressSn" v-if="form.receiverSn">
               <div style="display:flex;padding-top:6px;">
                 <div style="width:80%;flex-grow:1;line-height: 24px;">{{ chooseAddr }}</div>
-                <a-button size="small" type="link" @click="openAddrModal = true">{{ addressVal }} >></a-button>
+                <a-button id="dsModal-addressVal" size="small" type="link" @click="openAddrModal = true">{{ addressVal }} >></a-button>
               </div>
             </a-form-model-item>
           </div>
@@ -46,7 +46,7 @@
           </div>
           <a-form-model-item label="发货编号" prop="sendNo">
             <a-input
-              id="dealerAccountEdit-phone"
+              id="dsModal-sendNo"
               :maxLength="10"
               v-model.trim="form.sendNo"
               placeholder="请输入发货编号"
@@ -57,7 +57,7 @@
           </a-form-model-item>
           <a-form-model-item label="发货说明">
             <a-input
-              id="dealerAccountEdit-explainInfo"
+              id="dsModal-explainInfo"
               type="textarea"
               :maxLength="100"
               v-model.trim="form.explainInfo"
@@ -65,22 +65,22 @@
               allowClear />
           </a-form-model-item>
           <a-form-model-item label="备货打印" prop="printStatus">
-            <a-radio-group v-model="form.printStatus">
-              <a-radio value="NO_PRINT">
+            <a-radio-group v-model="form.printStatus" id="dsModal-printStatus">
+              <a-radio value="NO_PRINT" id="dsModal-printStatus-1">
                 允许打印
               </a-radio>
-              <a-radio value="UNABLE_PRINT">
+              <a-radio value="UNABLE_PRINT" id="dsModal-printStatus-2">
                 暂不打印
               </a-radio>
-              <a-radio value="CANCEL_PRINT">
+              <a-radio value="CANCEL_PRINT" id="dsModal-printStatus-3">
                 取消打印
               </a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button id="dealerAccountEdit-back" @click="isShow = false">取消下推</a-button>
-          <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave" style="margin-left: 15px;">确定下推</a-button>
+          <a-button id="dsModal-back" @click="isShow = false">取消下推</a-button>
+          <a-button type="primary" id="dsModal-save" @click="handleSave" style="margin-left: 15px;">确定下推</a-button>
         </div>
       </a-spin>
       <!-- 选择地址 -->
@@ -103,7 +103,7 @@ export default {
       type: Boolean,
       default: false
     },
-    title: {
+    title: { // 弹框标题
       type: String,
       default: '下推销售单'
     }
@@ -117,13 +117,13 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        sendNo: '',
-        printStatus: undefined,
-        buyerName: '',
-        receiverSn: '',
-        receiverName: '',
+        sendNo: '', // 发货编号
+        printStatus: undefined, // 备货打印
+        buyerName: '', // 客户名称
+        receiverSn: '', // 收货客户sn
+        receiverName: '', // 收货客户名称
         dealerRecevieAddressSn: '', // 地址sn
-        explainInfo: ''
+        explainInfo: '' // 备注
       },
       rules: {
         sendNo: [{ required: true, message: '请输入发货编号', trigger: 'change' }],
@@ -134,21 +134,23 @@ export default {
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
       openAddrModal: false, // 选择地址弹框是否显示
-      addressId: undefined,
-      receiverDisabled: false
+      addressId: undefined, // 地址id
+      receiverDisabled: false // 是否选择收货客户名称
     }
   },
   methods: {
+    // 设置发货编号
     setSendNo (i) {
       this.form.sendNo = i
       this.$refs.ruleForm.validateField('sendNo')
     },
-    // 客户 change
+    // 选择收货客户名称
     custChange (val) {
       if (val && val.key) {
         this.form.receiverSn = val.key || undefined
         this.form.receiverName = val.name || ''
         this.$refs.ruleForm.clearValidate()
+        // 获取默认地址
         this.getDefaultAddress()
       } else {
         this.form.receiverSn = undefined
@@ -170,6 +172,7 @@ export default {
         }
       })
     },
+    // 选择地址
     verifyFun (id) {
       if (id == this.addressId) {
         this.chooseAddr = ''
@@ -177,7 +180,7 @@ export default {
         this.form.dealerRecevieAddressSn = ''
       }
     },
-    //  保存
+    //  确定下推
     handleSave () {
       const _this = this
       _this.$refs.ruleForm.validate(valid => {
@@ -191,9 +194,8 @@ export default {
         }
       })
     },
-    //  地址保存
+    // 保存地址
     handleOk (data) {
-      console.log(data, 'chooseAddr')
       this.chooseAddr = (data.consigneeName || '') + '(' + (data.consigneeTel || '-') + ')' + ' ' + (data.address || '')
       this.addressVal = '更换地址'
       this.form.dealerRecevieAddressSn = data.dealerRecevieAddressSn || ''
@@ -251,7 +253,7 @@ export default {
 </script>
 
 <style lang="less">
-  .dealerAccountEdit-modal{
+  .dsModal-modal{
     .ant-modal-body {
       padding: 40px 40px 24px;
     }

+ 27 - 35
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -15,8 +15,8 @@
           ref="partQuery"
           :newLoading="isInster"
           @cancelProduct="cancelProduct"
-          @cancelAll = "cancelAll"
-          @convertPromoGifts = "convertPromoGifts"
+          @cancelAll="cancelAll"
+          @convertPromoGifts="convertPromoGifts"
           @addProduct="insterProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="waitDispatch-cont">
@@ -28,6 +28,7 @@
 
         <!-- 已选配件列表 -->
         <detailProductList ref="waitProduct" @refashTable="refashTable">
+          <!-- 统计数据 -->
           <template slot="total">
             本次下推款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
             本次下推数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
@@ -44,7 +45,7 @@
         class="button-primary"
         @click="handleDispatch()"
         :loading="loading"
-        id="productInfoList-handleSubmit">下推</a-button>
+        id="waitDispatch-handleSubmit">下推</a-button>
     </div>
     <!-- 下推 -->
     <dsModal ref="dsModal" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
@@ -57,6 +58,7 @@ import { VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import detailProductList from './detailProductList.vue'
 import dsModal from './dsModal.vue'
+// 接口
 import { salesDetailBySn } from '@/api/salesNew'
 import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty, salesDetailCancleOfAll, batchTransferOfPurchaseAmount } from '@/api/salesDetailNew'
 import { pushDown } from '@/api/waitDispatchDetail'
@@ -68,7 +70,7 @@ export default {
   components: { detailProductList, VSelect, queryPart, dsModal },
   data () {
     return {
-      showDsModal: false,
+      showDsModal: false, // 下推弹框
       spinning: false,
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
@@ -77,12 +79,16 @@ export default {
       loading: false, // 是否下推中
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       productForm: {
-        dispatchBillSn: ''
+        dispatchBillSn: '' // 下推单sn
       },
-      totalData: null
+      totalData: null // 统计数据
     }
   },
   methods: {
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
+    },
     // 统计查询
     getTotalData (flag) {
       findBySalesBillSn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
@@ -91,9 +97,9 @@ export default {
           if (res.data && Object.keys(res.data).length > 0) {
             this.productForm.dispatchBillSn = res.data.dispatchBillSn
             const _this = this
-            if(flag){
+            if (flag) {
               _this.$refs.waitProduct.pageInit(this.productForm, this.detailData, this.$refs.partQuery.activeList)
-            }else{
+            } else {
               _this.$refs.waitProduct.resetSearchForm()
             }
           }
@@ -102,10 +108,6 @@ export default {
         }
       })
     },
-    //  返回
-    handleBack () {
-      this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
-    },
     // 添加产品
     insterProduct (list) {
       // 防止多次添加产品
@@ -133,16 +135,16 @@ export default {
       })
     },
     // 整单取消
-    cancelAll(){
-      salesDetailCancleOfAll({salesBillSn: this.salesBillSn}).then(res=>{
-        if(res.status == 200){
+    cancelAll () {
+      salesDetailCancleOfAll({ salesBillSn: this.salesBillSn }).then(res => {
+        if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
         }
       })
     },
     // 批量转采购额
-    convertPromoGifts(list){
+    convertPromoGifts (list) {
       this.$message.loading('正在批量转采购额...', 1)
       this.isInster = true
       this.spinning = true
@@ -180,9 +182,10 @@ export default {
         this.isInster = false
       })
     },
-    refashTable(flag){
+    // 刷新表格
+    refashTable (flag) {
       this.getTotalData()
-      if(flag){
+      if (flag) {
         this.getOrderDetail(false)
       }
     },
@@ -191,9 +194,11 @@ export default {
       salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
-          if(flag){
+          if (flag) {
+            // 初始化表格
             this.$refs.partQuery.pageInit(this.salesBillSn, this.detailData)
-          }else{
+          } else {
+            // 刷新表格
             this.$refs.partQuery.resetSearchForm(this.detailData)
           }
         }
@@ -203,6 +208,7 @@ export default {
     handleDispatch () {
       const dataSource = this.$refs.waitProduct.dataSource
       if (dataSource.length) {
+        // 打开下推弹框
         this.showDsModal = true
         this.detailData.dispatchBillCount = this.totalData.dispatchBillCount
         this.detailData.receiverName = this.totalData.receiverName ? this.totalData.receiverName : ''
@@ -230,21 +236,7 @@ export default {
         this.spinning = false
       })
     },
-    // 一键下推
-    oneDispatch () {
-      this.isInster = true
-      this.spinning = true
-      salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
-          this.$refs.partQuery.resetCurForm()
-          this.spinning = false
-        } else {
-          this.spinning = false
-        }
-        this.isInster = false
-      })
-    },
+    // 页面初始化
     pageInit () {
       this.$refs.partQuery.clearSelectTable()
       this.salesBillSn = this.$route.params.salesBillSn

+ 6 - 4
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -150,13 +150,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { salesPromoQueryList } from '@/api/salesNew'
+import { STable, VSelect } from '@/components'
+import { Empty } from 'ant-design-vue'
 import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
 import toPurchaseModal from './toPurchaseModal'
-import { Empty } from 'ant-design-vue'
-import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
-import { STable, VSelect } from '@/components'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
+// 接口
+import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
+import { salesPromoQueryList } from '@/api/salesNew'
+
 export default {
   name: 'QueryPart',
   mixins: [commonMixin],