lilei 1 년 전
부모
커밋
85d9a44167
1개의 변경된 파일41개의 추가작업 그리고 42개의 파일을 삭제
  1. 41 42
      src/views/salesManagement/salesQueryNew/list.vue

+ 41 - 42
src/views/salesManagement/salesQueryNew/list.vue

@@ -195,12 +195,12 @@
           </template>
           <!-- 出库仓库 -->
           <template slot="warehouseBox" slot-scope="text, record">
-            <a-tooltip placement="right" v-if="record.newWarehouseNameSet && record.newWarehouseNameSet.length>0">
+            <a-tooltip placement="right" v-if="record.warehouseNameSet && record.warehouseNameSet.length>0">
               <template slot="title">
-                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+                <span>{{ record.warehouseNameSet.toString() }}</span>
               </template>
               <div class="warehouse_box">
-                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+                <span>{{ record.warehouseNameSet.toString() }}</span>
               </div>
             </a-tooltip>
             <div v-else>--</div>
@@ -374,18 +374,18 @@ export default {
       },
       // 统计数据
       totalData: {
-        totalAmount: 0,
-        totalCategory: 0,
-        totalQty: 0,
-        totalRecord: 0,
-        totalPushedQty: 0,
-        totalDispatchQty: 0,
-        totalCancelQty: 0,
-        totalUnpushedQty: 0,
-        totalPushedAmount: 0,
-        totalCancelAmount: 0,
-        totalUnpushedAmount: 0,
-        totalDispatchAmount: 0
+        totalCategory: 0, // 总款数
+        totalQty: 0, // 总数量
+        totalRecord: 0, // 总单数
+        totalPushedQty: 0, // 已下推数量
+        totalDispatchQty: 0, // 已发货数量
+        totalCancelQty: 0, // 已取消数量
+        totalUnpushedQty: 0, // 待下推数量
+        totalAmount: 0, // 总售价
+        totalPushedAmount: 0, // 已下推金额
+        totalCancelAmount: 0, // 已取消金额
+        totalUnpushedAmount: 0, // 待下推金额
+        totalDispatchAmount: 0 // 已发货金额
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -393,6 +393,8 @@ export default {
         this.spinning = true
         delete parameter.tableId
         delete parameter.index
+
+        // 如果按业务状态排序
         if (parameter.sortOrder) {
           parameter['sortAlias'] = 'sales_bill'
         } else {
@@ -402,22 +404,15 @@ export default {
         salesCount(Object.assign(parameter, this.queryParam)).then(res => {
           this.totalData = res.data || {}
         })
+        // 查询列表
         return salesList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算编号
             const no = (data.pageNo - 1) * data.pageSize
             data.list.forEach((con, i) => {
               con.no = no + i + 1
-              const newWarehouseName = []
-              if (con.warehouseNameSet) {
-                con.warehouseNameSet.forEach(item => {
-                  if (item) {
-                    newWarehouseName.push(item)
-                  }
-                })
-                con.newWarehouseNameSet = newWarehouseName
-              }
             })
             this.disabled = false
           }
@@ -425,10 +420,10 @@ export default {
           return data
         })
       },
+      // 允许备货打印弹框
       tipData: null, // 备货单信息
-      tempSalesBillSn: null,
-      // 允许备货打印
-      selectedRowKeys: [],
+      tempSalesBillSn: null, // 关联的下推单sn
+      selectedRowKeys: [], // 允许备货打印选项
       bhColumns: [
         {
           title: '备货单号',
@@ -443,7 +438,8 @@ export default {
           dataIndex: 'printStatusDictValue'
         }
       ],
-      showCols: [], // 列表显示列
+      // 列表列显示
+      showCols: [], // 已勾选的列
       colsArr: [
         {
           title: '已取消数量',
@@ -505,7 +501,7 @@ export default {
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
-
+      // 根据权限及勾选按固定顺序动态显示列
       arr.map(item => {
         if (this.$hasPermissions('M_salesQueryList_salesPrice')) {
           item.isShow = ['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex)
@@ -514,7 +510,6 @@ export default {
           item.isShow = this.showCols.includes(item.dataIndex)
         }
       })
-      console.log(arr)
       return arr.filter(item => !this.colsArr.find(k => k.value == item.dataIndex) || item.isShow)
     }
   },
@@ -532,22 +527,25 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 选择客户
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    // 所在区域
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
+    // 打开批量转费用单页面
     toWaitCostOrder () {
       this.$router.push({ name: 'waitCostOrder' })
     },
-    // 新增
+    // 新增销售单先打开选择客户弹框
     handleAdd () {
       this.openModal = true
     },
@@ -657,13 +655,14 @@ export default {
     changeDaOpt (e) {
       this.expenseOption = e.target.value
     },
-    // 转费用单
+    // 转费用单确定
     expenseSave (data) {
       if (data) {
         this.openBaseModal = true
         this.$refs.expenseModal.setDetail(data, 'sales')
       }
     },
+    // 转费用单成功
     expenseSaveOk (params) {
       expenseAccountSave(params).then(res => {
         if (res.status == 200) {
@@ -690,16 +689,18 @@ export default {
         this.showTipModal = true
       })
     },
+    // 关闭允许备货打印弹框
     canselModal () {
       this.tipData = null
       this.showTipModal = false
       this.tempSalesBillSn = null
       this.selectedRowKeys = []
     },
+    // 选择要备货打印的
     onSelectChange (selectedRowKeys) {
       this.selectedRowKeys = selectedRowKeys
     },
-    // 允许备货打印状态
+    // 确定允许备货打印
     updatePrintStatus () {
       const isOne = this.tipData.length
       if (isOne > 1 && this.selectedRowKeys.length == 0) {
@@ -710,7 +711,6 @@ export default {
       this.tipData.map(item => {
         dispatchBillSnList.push(item.dispatchBillSn)
       })
-
       const params = {
         'salesBillSn': this.tempSalesBillSn,
         'dispatchBillSnList': isOne > 1 ? this.selectedRowKeys : dispatchBillSnList,
@@ -724,7 +724,7 @@ export default {
         }
       })
     },
-    // 重置
+    // 重置列表
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
@@ -749,23 +749,22 @@ export default {
       }
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
-      const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
+        this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 260
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
+      this.pageInit()
     },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       console.log(newValue)