Procházet zdrojové kódy

【修改】发货汇总退货按钮跳转

howie před 2 roky
rodič
revize
cdbd73a47a
1 změnil soubory, kde provedl 226 přidání a 229 odebrání
  1. 226 229
      src/views/supply/deliver/sum_list.vue

+ 226 - 229
src/views/supply/deliver/sum_list.vue

@@ -214,15 +214,8 @@
                   filterable
                   style="width: 100%"
                 >
-                  <el-option
-                    label="是"
-                    :value="1"
-                  />
-                  <el-option
-                    label="否"
-                    :value="0"
-                  />
-
+                  <el-option label="是" :value="1" />
+                  <el-option label="否" :value="0" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -235,15 +228,8 @@
                   filterable
                   style="width: 100%"
                 >
-                  <el-option
-                    label="广州"
-                    value="GZ"
-                  />
-                  <el-option
-                    label="佛山"
-                    value="FS"
-                  />
-
+                  <el-option label="广州" value="GZ" />
+                  <el-option label="佛山" value="FS" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -257,16 +243,18 @@
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="制单人" prop="createBy">
-                <el-input v-model="screenForm.createBy" placeholder="请输入制单人" />
+                <el-input
+                  v-model="screenForm.createBy"
+                  placeholder="请输入制单人"
+                />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="24" :lg="24" class="tr">
               <el-form-item label="">
                 <el-button @click="resetScreenForm">清空</el-button>
-                <el-button
-                  type="primary"
-                  @click="submitScreenForm"
-                >搜索</el-button>
+                <el-button type="primary" @click="submitScreenForm"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
@@ -281,7 +269,7 @@
               size="mini"
               :disabled="tableSelection.length < 1"
               @click="toPrint"
-            >打印发货单
+              >打印发货单
             </el-button>
             <div v-if="totalNum" class="num">
               当前列表总发货数量:{{ totalNum }}
@@ -295,16 +283,18 @@
               type="primary"
               style="margin-right: 10px"
               icon="el-icon-plus"
-              @click="$router.push('/supply/deliver/apply_list?isShow=true')"
-            >零售退货申请</el-button>
+              @click="$router.push('/supply/deliver/new_apply?isShow=true')"
+              >零售退货申请</el-button
+            >
             <el-button
               v-if="$checkBtnRole('refund', $route.meta.roles)"
               size="mini"
               type="primary"
               style="margin-right: 10px"
               icon="el-icon-plus"
-              @click="$router.push('/supply/deliver/engin_list?isShow=true')"
-            >工程退货申请</el-button>
+              @click="$router.push('/supply/deliver/new_engin?isShow=true')"
+              >工程退货申请</el-button
+            >
             <!-- <el-button   size="mini"
               type="primary"
               icon="el-icon-download"
@@ -334,11 +324,7 @@
             @select="handleSelect"
             @select-all="handleSelectAll"
           >
-            <el-table-column
-              align="center"
-              type="selection"
-              width="55"
-            />
+            <el-table-column align="center" type="selection" width="55" />
             <el-table-column
               align="right"
               label="打印次数"
@@ -409,14 +395,14 @@
                 <CopyButton
                   :copy-text="
                     scope.row.enginOrderType == 'HOME' ||
-                      scope.row.enginOrderType == 'TRADE'
+                    scope.row.enginOrderType == 'TRADE'
                       ? scope.row.enginOrderNo
                       : scope.row.mainOrderId
                   "
                 />
                 <span>{{
                   scope.row.enginOrderType == "HOME" ||
-                    scope.row.enginOrderType == "TRADE"
+                  scope.row.enginOrderType == "TRADE"
                     ? scope.row.enginOrderNo
                     : scope.row.mainOrderId
                 }}</span>
@@ -756,7 +742,13 @@
               min-width="100"
               show-overflow-tooltip
             />
-            <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="制单人"
+              prop="createBy"
+              min-width="100"
+              show-overflow-tooltip
+            />
 
             <el-table-column
               align="left"
@@ -847,55 +839,60 @@
       </div>
     </el-dialog>
 
-    <el-dialog
-      title="导出项"
-      :visible.sync="dialogVisible"
-      width="50%"
-    >
-      <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
-      <div style="margin: 15px 0;" />
+    <el-dialog title="导出项" :visible.sync="dialogVisible" width="50%">
+      <el-checkbox
+        v-model="checkAll"
+        :indeterminate="isIndeterminate"
+        @change="handleCheckAllChange"
+        >全选</el-checkbox
+      >
+      <div style="margin: 15px 0" />
       <el-checkbox-group v-model="check" @change="handleCheckedCitiesChange">
-        <el-checkbox v-for="item in excelData" :label="item.value">{{ item.name }}</el-checkbox>
+        <el-checkbox v-for="item in excelData" :label="item.value">{{
+          item.name
+        }}</el-checkbox>
       </el-checkbox-group>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        <el-button type="primary" @click="dialogVisible = false"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { getSumList } from '@/api/supply/deliver'
-import print from '@/mixin/print'
-import { checkPassword, getListInvoiceNumber } from '@/api/supply/pickup'
-import { getCategoryList, getSalesmanList } from '@/api/common'
-import SumPrint from '@/views/supply/deliver/components/sum_print'
-import { getWarehouseList } from '@/api/supply/apply'
-import printPreview from './components/design/preview.vue'
+import { getSumList } from "@/api/supply/deliver";
+import print from "@/mixin/print";
+import { checkPassword, getListInvoiceNumber } from "@/api/supply/pickup";
+import { getCategoryList, getSalesmanList } from "@/api/common";
+import SumPrint from "@/views/supply/deliver/components/sum_print";
+import { getWarehouseList } from "@/api/supply/apply";
+import printPreview from "./components/design/preview.vue";
 export default {
   components: {
     SumPrint,
-    printPreview
+    printPreview,
   },
   filters: {
     orderTypeFilter(val) {
       const MAP = {
-        HOME: '家用单',
-        TRADE: '商用单',
-        RETAIL: '零售单',
-        RETAIL_POLICY: '销售政策单',
-        PERMU_HOME: '置换家用单',
-        PERMU_TRADE: '置换商用单',
-        PERMU_RETAIL: '置换零售单',
-        PERMU_RETAIL_POLICY: '置换销售政策单',
-        REQUISITION_HOME: '调拨家用单',
-        REQUISITION_TRADE: '调拨商用单',
-        REQUISITION_RETAIL: '调拨零售单',
-        REQUISITION_RETAIL_POLICY: '调拨销售政策单'
-      }
-      return MAP[val]
-    }
+        HOME: "家用单",
+        TRADE: "商用单",
+        RETAIL: "零售单",
+        RETAIL_POLICY: "销售政策单",
+        PERMU_HOME: "置换家用单",
+        PERMU_TRADE: "置换商用单",
+        PERMU_RETAIL: "置换零售单",
+        PERMU_RETAIL_POLICY: "置换销售政策单",
+        REQUISITION_HOME: "调拨家用单",
+        REQUISITION_TRADE: "调拨商用单",
+        REQUISITION_RETAIL: "调拨零售单",
+        REQUISITION_RETAIL_POLICY: "调拨销售政策单",
+      };
+      return MAP[val];
+    },
   },
   mixins: [print],
   data() {
@@ -907,40 +904,40 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: {
         // 筛选表单数据
-        goodsName: '',
-        goodsCode: '',
-        goodsOldCode: '',
-        model: '',
-        createDate: '',
-        deliverDate: '',
+        goodsName: "",
+        goodsCode: "",
+        goodsOldCode: "",
+        model: "",
+        createDate: "",
+        deliverDate: "",
         correspondId: [],
-        jxsNum: '',
-        jxsName: '',
-        orderNum: '',
-        type: '',
-        salesMan: '',
-        k3ServiceId: '',
-        mainOrderId: '',
-        approvaTime: '',
-        types: '',
-        printStatus: '',
-        discriminate: '',
-        refEnginRecordNo: '',
-        createBy: ''
+        jxsNum: "",
+        jxsName: "",
+        orderNum: "",
+        type: "",
+        salesMan: "",
+        k3ServiceId: "",
+        mainOrderId: "",
+        approvaTime: "",
+        types: "",
+        printStatus: "",
+        discriminate: "",
+        refEnginRecordNo: "",
+        createBy: "",
       },
       invoiceList: [
         {
           value: 1,
-          label: '申请发货单'
+          label: "申请发货单",
         },
         {
           value: 2,
-          label: '退货单'
+          label: "退货单",
         },
         {
           value: 3,
-          label: '直调发货单'
-        }
+          label: "直调发货单",
+        },
       ],
       categoryList: [],
       salesmanList: [],
@@ -950,29 +947,29 @@ export default {
       totalNum: 0,
       isShowDialog: false,
       dialogForm: {
-        password: '',
-        createMan: '',
-        createDate: ''
+        password: "",
+        createMan: "",
+        createDate: "",
       },
       warehouseList: [],
       dialogFormRules: {
-        password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
+        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
       },
       dialogVisible: false,
       excelData: [
         {
           value: 1,
-          name: '状态'
+          name: "状态",
         },
         {
           value: 2,
-          name: '打印时间'
-        }
+          name: "打印时间",
+        },
       ],
       check: [],
       checkAll: false,
-      isIndeterminate: false
-    }
+      isIndeterminate: false,
+    };
   },
   computed: {
     exParams() {
@@ -986,16 +983,16 @@ export default {
         createBy: this.screenForm.createBy,
         createStartTime: this.screenForm.createDate
           ? this.screenForm.createDate[0]
-          : '',
+          : "",
         createEndTime: this.screenForm.createDate
           ? this.screenForm.createDate[1]
-          : '',
+          : "",
         startTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[0]
-          : '',
+          : "",
         endTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[1]
-          : '',
+          : "",
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         id: this.screenForm.orderNum,
@@ -1006,27 +1003,27 @@ export default {
         printStatus: this.screenForm.printStatus,
         approvalEndTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[1]
-          : '',
+          : "",
         approvalStartTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[0]
-          : '',
-        correspondId: this.screenForm.correspondId.join(','),
-        type: this.screenForm.types
-      }
+          : "",
+        correspondId: this.screenForm.correspondId.join(","),
+        type: this.screenForm.types,
+      };
     },
     comRefundableQty() {
       return (type, status, row) => {
         if (type == 2) {
-          return ''
+          return "";
         } else {
-          if (status == 'OK') {
-            return 0
+          if (status == "OK") {
+            return 0;
           } else {
-            return row.refundableQty
+            return row.refundableQty;
           }
         }
-      }
-    }
+      };
+    },
   },
   watch: {
     dataList: {
@@ -1034,45 +1031,45 @@ export default {
         if (newValue && newValue.length) {
           newValue.forEach((item, index) => {
             this.dataList[index].compute_zkeAmount =
-              item.totalDiscAmount + item.payRebateAmount
+              item.totalDiscAmount + item.payRebateAmount;
             this.dataList[index].compute_wckNum = this.comRefundableQty(
               item.type,
               item.salesExamineStatus,
               item
-            )
-          })
+            );
+          });
         }
       },
       immediate: true,
-      deep: true
-    }
+      deep: true,
+    },
   },
   created() {
-    this.getSalesmanList()
-    this.getCategoryList()
-    this.getList()
-    this.getWarehouseList()
+    this.getSalesmanList();
+    this.getCategoryList();
+    this.getList();
+    this.getWarehouseList();
   },
   mounted() {
-    this.initPrint()
+    this.initPrint();
   },
   methods: {
     handleFilterData() {
-      this.dialogVisible = true
+      this.dialogVisible = true;
     },
 
     handleCheckAllChange(val) {
-      const arr = []
+      const arr = [];
       if (val) {
         for (let i = 1; i <= this.excelData.length; i++) {
-          arr.push(i)
+          arr.push(i);
         }
       }
-      this.check = val ? arr : []
-      this.isIndeterminate = false
+      this.check = val ? arr : [];
+      this.isIndeterminate = false;
     },
     handleCheckedCitiesChange() {
-      console.log(this.checkAll)
+      console.log(this.checkAll);
     },
     // 获取业务员列表
     getSalesmanList() {
@@ -1080,33 +1077,33 @@ export default {
         pageNum: 1,
         pageSize: -1,
         isCustomer: 0,
-        status: true
+        status: true,
       }).then((res) => {
-        this.salesmanList = res.data.records
-      })
+        this.salesmanList = res.data.records;
+      });
     },
 
     // 获取存货类别列表
     getCategoryList() {
       getCategoryList({
         pageNum: 1,
-        pageSize: -1
+        pageSize: -1,
       }).then((res) => {
-        this.categoryList = res.data.records
-      })
+        this.categoryList = res.data.records;
+      });
     },
     // 获取仓库列表
     getWarehouseList() {
       getWarehouseList({
         pageNum: 1,
-        pageSize: -1
+        pageSize: -1,
       }).then((res) => {
-        this.warehouseList = res.data.records
-      })
+        this.warehouseList = res.data.records;
+      });
     },
     // 查询列表
     getList() {
-      this.listLoading = true
+      this.listLoading = true;
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
@@ -1122,16 +1119,16 @@ export default {
 
         createStartTime: this.screenForm.createDate
           ? this.screenForm.createDate[0]
-          : '',
+          : "",
         createEndTime: this.screenForm.createDate
           ? this.screenForm.createDate[1]
-          : '',
+          : "",
         startTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[0]
-          : '',
+          : "",
         endTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[1]
-          : '',
+          : "",
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         id: this.screenForm.orderNum,
@@ -1141,33 +1138,32 @@ export default {
         mainOrderId: this.screenForm.mainOrderId,
         approvalEndTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[1]
-          : '',
+          : "",
         approvalStartTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[0]
-          : '',
-        correspondId: this.screenForm.correspondId.join(','),
-        type: this.screenForm.types
-
-      }
+          : "",
+        correspondId: this.screenForm.correspondId.join(","),
+        type: this.screenForm.types,
+      };
 
       getSumList(params).then((res) => {
         res.data.records.forEach((item) => {
-          item.notOutNumber = item.salesStatus ? 0 : item.refundableQty
-          item.sums1 = ['refundableQty', 'compute_wckNum']
+          item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
+          item.sums1 = ["refundableQty", "compute_wckNum"];
           item.sums2 = [
-            'payAmount',
-            'payRebateAmount',
-            'discAmount',
-            'totalDiscAmount',
-            'singlePayPrice',
-            'compute_zkeAmount'
-          ]
-        })
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      this.getListInvoiceNumber()
+            "payAmount",
+            "payRebateAmount",
+            "discAmount",
+            "totalDiscAmount",
+            "singlePayPrice",
+            "compute_zkeAmount",
+          ];
+        });
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      });
+      this.getListInvoiceNumber();
     },
 
     getListInvoiceNumber() {
@@ -1180,16 +1176,16 @@ export default {
 
         createStartTime: this.screenForm.createDate
           ? this.screenForm.createDate[0]
-          : '',
+          : "",
         createEndTime: this.screenForm.createDate
           ? this.screenForm.createDate[1]
-          : '',
+          : "",
         startTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[0]
-          : '',
+          : "",
         endTime: this.screenForm.deliverDate
           ? this.screenForm.deliverDate[1]
-          : '',
+          : "",
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         id: this.screenForm.orderNum,
@@ -1199,82 +1195,81 @@ export default {
         mainOrderId: this.screenForm.mainOrderId,
         approvalEndTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[1]
-          : '',
+          : "",
         approvalStartTime: this.screenForm.approvaTime
           ? this.screenForm.approvaTime[0]
-          : '',
-        correspondId: this.screenForm.correspondId.join(','),
-        type: this.screenForm.types
-
-      }
+          : "",
+        correspondId: this.screenForm.correspondId.join(","),
+        type: this.screenForm.types,
+      };
       getListInvoiceNumber(params).then((res) => {
         // console.log(res,'ii');
-        this.totalNum = res.data
-      })
+        this.totalNum = res.data;
+      });
     },
     // 提交筛选表单
     submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+      this.currentPage = 1;
+      this.getList();
     },
 
     // 重置筛选表单
     resetScreenForm() {
-      this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
     },
 
     // 更改每页数量
     handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
     },
 
     // 更改当前页
     handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+      this.currentPage = val;
+      this.getList();
     },
 
     handleSelect(selection, row) {
-      this.$refs.table.toggleRowSelection(row)
+      this.$refs.table.toggleRowSelection(row);
       this.dataList.forEach((item) => {
         if (item.id === row.id) {
-          this.$refs.table.toggleRowSelection(item)
+          this.$refs.table.toggleRowSelection(item);
         }
-      })
-      this.tableSelection = this.$refs.table.selection
+      });
+      this.tableSelection = this.$refs.table.selection;
     },
 
     handleSelectAll(selection) {
-      this.tableSelection = this.$refs.table.selection
+      this.tableSelection = this.$refs.table.selection;
     },
 
     // 点击打印
     toPrint() {
-      this.queryItem = this.tableSelection
+      this.queryItem = this.tableSelection;
       if (!this.tableSelection[0].printNum) {
-        this.queryItem = this.tableSelection
-        this.getDateil(this.tableSelection, 'getDeliverDetail').then(res => {
-          this.$endLoading()
-          this.$refs.preView.show(this.hiprintTemplate, this.outputData)
-        })
+        this.queryItem = this.tableSelection;
+        this.getDateil(this.tableSelection, "getDeliverDetail").then((res) => {
+          this.$endLoading();
+          this.$refs.preView.show(this.hiprintTemplate, this.outputData);
+        });
       } else {
-        this.queryItem = this.tableSelection
+        this.queryItem = this.tableSelection;
         this.dialogForm.createMan = JSON.parse(
-          localStorage.getItem('supply_user')
-        ).nickName
-        this.dialogForm.createDate = this.getDate()
-        this.isShowDialog = true
+          localStorage.getItem("supply_user")
+        ).nickName;
+        this.dialogForm.createDate = this.getDate();
+        this.isShowDialog = true;
       }
     },
 
     // 关闭弹窗
     cancelDialogForm() {
-      this.isShowDialog = false
-      this.$refs.dialogForm.resetFields()
+      this.isShowDialog = false;
+      this.$refs.dialogForm.resetFields();
     },
 
     // 提交 弹窗
@@ -1283,41 +1278,43 @@ export default {
         if (valid) {
           const params = {
             shipId: this.queryItem[0].invoiceId,
-            password: this.dialogForm.password
-          }
+            password: this.dialogForm.password,
+          };
           checkPassword(params).then((res) => {
-            this.getDateil(this.tableSelection, 'getDeliverDetail').then(res => {
-              this.$endLoading()
-              this.$refs.preView.show(this.hiprintTemplate, this.outputData)
-            })
-            this.cancelDialogForm()
-          })
+            this.getDateil(this.tableSelection, "getDeliverDetail").then(
+              (res) => {
+                this.$endLoading();
+                this.$refs.preView.show(this.hiprintTemplate, this.outputData);
+              }
+            );
+            this.cancelDialogForm();
+          });
         }
-      })
+      });
     },
 
     getDate() {
-      var date = new Date()
-      var seperator1 = '-'
-      var year = date.getFullYear()
-      var month = date.getMonth() + 1
-      var strDate = date.getDate()
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
       if (month >= 1 && month <= 9) {
-        month = '0' + month
+        month = "0" + month;
       }
       if (strDate >= 0 && strDate <= 9) {
-        strDate = '0' + strDate
+        strDate = "0" + strDate;
       }
-      var currentdate = year + seperator1 + month + seperator1 + strDate
-      return currentdate
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
     },
 
     backList() {
-      this.queryItem = {}
-      this.isShowPrint = false
-    }
-  }
-}
+      this.queryItem = {};
+      this.isShowPrint = false;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>