Browse Source

应收明细条件导出功能/成品打印添加空数据兼容

lph 11 months ago
parent
commit
fc3f861ebd

+ 9 - 0
zkqy-ui/src/api/system/SaleAccountsReceivableDetail.js

@@ -108,3 +108,12 @@ export function rejectHandler(data) {
   })
   })
 }
 }
 
 
+
+// 应收明细新导出
+export function dynamicExport(data) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/dynamicExport',
+    method: 'post',
+    data: data
+  })
+}

+ 26 - 26
zkqy-ui/src/utils/print/printUtils.js

@@ -43,13 +43,13 @@ function printEN(printRow) {
   } = printRow;
   } = printRow;
   let ENColor = removeChineseCharacters(productColor) || ''
   let ENColor = removeChineseCharacters(productColor) || ''
   let res = []
   let res = []
-  res.push({ key1: 'GRADE:', key2: productSpecifications, })
-  res.push({ key1: 'LOT NO:', key2: qrCode, })
-  res.push({ key1: 'COLOR NO:', key2: ENColor + '    ' + lotNum, })
-  res.push({ key1: 'CONE NO:', key2: canisterNum, })
-  res.push({ key1: 'NET WEIGHT:', key2: suttle, })
-  res.push({ key1: 'GROSS WEIGHT:', key2: grossWeight, })
-  res.push({ key1: 'CARTON NO:', key2: boxNum, })
+  res.push({ key1: 'GRADE:', key2: productSpecifications || '', })
+  res.push({ key1: 'LOT NO:', key2: qrCode || '', })
+  res.push({ key1: 'COLOR NO:', key2: ENColor || '' + '    ' + lotNum || '', })
+  res.push({ key1: 'CONE NO:', key2: canisterNum || '', })
+  res.push({ key1: 'NET WEIGHT:', key2: suttle || '', })
+  res.push({ key1: 'GROSS WEIGHT:', key2: grossWeight || '', })
+  res.push({ key1: 'CARTON NO:', key2: boxNum || '', })
   return res
   return res
 }
 }
 
 
@@ -71,7 +71,7 @@ function printCN_XSW(printRow) {
     printFormat, /*格式*/
     printFormat, /*格式*/
     productName, /*产品名*/
     productName, /*产品名*/
     productSpecifications, /*规格*/
     productSpecifications, /*规格*/
-    productColor, /*色泽*/
+    productColour, /*色泽*/
     lotNum, /*批次*/
     lotNum, /*批次*/
     levels,/*等级*/
     levels,/*等级*/
     directionOfTwist,/*捻向*/
     directionOfTwist,/*捻向*/
@@ -81,17 +81,17 @@ function printCN_XSW(printRow) {
     packaging
     packaging
   } = printRow;
   } = printRow;
   let res = [];
   let res = [];
-  res.push({ key1: '品种', key2: productName, key3: '规格', key4: productSpecifications })
-  res.push({ key1: '批号', key2: lotNum, key3: '色号', key4: productColor })
-  res.push({ key1: '等级', key2: levels, key3: '箱号', key4: qrCode, key5: boxNum })
-  res.push({ key1: '筒数', key2: canisterNum + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
+  res.push({ key1: '品种', key2: productName || '', key3: '规格', key4: productSpecifications || '' })
+  res.push({ key1: '批号', key2: lotNum || '', key3: '色号', key4: productColour || '' })
+  res.push({ key1: '等级', key2: levels || '', key3: '箱号', key4: qrCode || '', key5: boxNum || '' })
+  res.push({ key1: '筒数', key2: canisterNum || '' + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
   res.push({
   res.push({
     key1: '班次',
     key1: '班次',
-    key2: workShifts + '    ' + machineTool,
+    key2: workShifts || '' + '    ' + machineTool || '',
     key3: '日期',
     key3: '日期',
     key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
     key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
   })
   })
-  res.push({ key1: '毛重', key2: grossWeight, key3: '净重', key4: suttle })
+  res.push({ key1: '毛重', key2: grossWeight || '', key3: '净重', key4: suttle || '' })
   return res
   return res
 }
 }
 
 
@@ -123,17 +123,17 @@ function printCN_WJZ(printRow) {
     packaging
     packaging
   } = printRow;
   } = printRow;
   let res = [];
   let res = [];
-  res.push({ key1: '品种', key2: productName, key3: '规格', key4: productSpecifications })
-  res.push({ key1: '批号', key2: lotNum, key3: '色号', key4: productColor })
-  res.push({ key1: '等级', key2: levels, key3: '箱号', key4: qrCode, key5: boxNum })
-  res.push({ key1: '筒数', key2: canisterNum + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
+  res.push({ key1: '品种', key2: productName || '', key3: '规格', key4: productSpecifications || '' })
+  res.push({ key1: '批号', key2: lotNum || '', key3: '色号', key4: productColor || '' })
+  res.push({ key1: '等级', key2: levels || '', key3: '箱号', key4: qrCode || '', key5: boxNum || '' })
+  res.push({ key1: '筒数', key2: canisterNum || '' + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
   res.push({
   res.push({
     key1: '班次',
     key1: '班次',
-    key2: workShifts + '    ' + machineTool,
+    key2: workShifts || '' + '    ' + machineTool || '',
     key3: '日期',
     key3: '日期',
     key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
     key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
   })
   })
-  res.push({ key1: '毛重', key2: grossWeight, key3: '净重', key4: "   " })
+  res.push({ key1: '毛重', key2: grossWeight || '', key3: '净重', key4: "   " })
   return res
   return res
 }
 }
 
 
@@ -167,11 +167,11 @@ function printCN_ZMD(printRow) {
     boxSumNum, /* 箱总数 */
     boxSumNum, /* 箱总数 */
   } = printRow;
   } = printRow;
   let res = [];
   let res = [];
-  res.push({ key1: '品种', key2: productName, key3: '规格', key4: productSpecifications })
-  res.push({ key1: '色泽', key2: productColour, key3: '等级', key4: levels })
-  res.push({ key1: '批号', key2: lotNum, key3: '管色', key4: tubeColor })
-  res.push({ key1: '单号', key2: qrCode, key3: '日期', key4: moment(new Date(productionDate)).format('YYYY-MM-DD') })
-  res.push({ key1: '箱数', key2: boxSumNum + '', key3: '筒数', key4: canisterNum })
+  res.push({ key1: '品种', key2: productName || '', key3: '规格', key4: productSpecifications || '' })
+  res.push({ key1: '色泽', key2: productColour || '', key3: '等级', key4: levels || '' })
+  res.push({ key1: '批号', key2: lotNum || '', key3: '管色', key4: tubeColor || '' })
+  res.push({ key1: '单号', key2: qrCode || '', key3: '日期', key4: moment(new Date(productionDate)).format('YYYY-MM-DD') })
+  res.push({ key1: '箱数', key2: boxSumNum || '' + '', key3: '筒数', key4: canisterNum || '' })
   // res.push({ key1: '筒数', key2: canisterNum + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
   // res.push({ key1: '筒数', key2: canisterNum + '    ' + tubeColor, key3: '捻向', key4: directionOfTwistLabel || ' ', })
   // res.push({
   // res.push({
   //   key1: '班次',
   //   key1: '班次',
@@ -179,6 +179,6 @@ function printCN_ZMD(printRow) {
   //   key3: '日期',
   //   key3: '日期',
   //   key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
   //   key4: moment(new Date(productionDate)).format('YYYY-MM-DD')
   // })
   // })
-  res.push({ key1: '毛重', key2: grossWeight, key3: '净重', key4: suttle })
+  res.push({ key1: '毛重', key2: grossWeight || '', key3: '净重', key4: suttle || '' })
   return res
   return res
 }
 }

+ 13 - 5
zkqy-ui/src/views/orderMange/codeListManage/index.vue

@@ -151,7 +151,7 @@
                 操作<i class="el-icon-arrow-down el-icon--right"></i>
                 操作<i class="el-icon-arrow-down el-icon--right"></i>
               </el-button>
               </el-button>
               <el-dropdown-menu slot="dropdown">
               <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item v-show="scope.row.otherStates == 1">
+                <el-dropdown-item v-show="queryParams.otherStates == 1">
                   <el-button
                   <el-button
                     size="mini"
                     size="mini"
                     type="text"
                     type="text"
@@ -161,15 +161,15 @@
                     >修改/补码
                     >修改/补码
                   </el-button>
                   </el-button>
                 </el-dropdown-item>
                 </el-dropdown-item>
-                <!-- <el-dropdown-item>
+                <el-dropdown-item v-show="queryParams.otherStates == 0">
                   <el-button
                   <el-button
                     size="mini"
                     size="mini"
                     type="text"
                     type="text"
                     icon="el-icon-circle-plus-outline"
                     icon="el-icon-circle-plus-outline"
-                    @click="supplementCode(scope.row)"
+                    @click="supplementCodeNew(scope.row)"
                     >补码
                     >补码
                   </el-button>
                   </el-button>
-                </el-dropdown-item> -->
+                </el-dropdown-item>
                 <el-dropdown-item>
                 <el-dropdown-item>
                   <el-button
                   <el-button
                     size="mini"
                     size="mini"
@@ -1068,7 +1068,6 @@ export default {
     },
     },
     // 新的后端打印逻辑
     // 新的后端打印逻辑
     async newPrintHandler(row) {
     async newPrintHandler(row) {
-      console.log("newPrintHandler");
       let printRow = row;
       let printRow = row;
       let payload = {
       let payload = {
         qrCodeVal: "",
         qrCodeVal: "",
@@ -1782,6 +1781,15 @@ export default {
       //   this.printShow = true;
       //   this.printShow = true;
       // });
       // });
     },
     },
+    // 新  补码回调
+    supplementCodeNew(row) {
+      console.log("row", row);
+      row.directionOfTwistLabel =
+        this.dict.type.direction_of_twist.find(
+          (item) => item.value == row.directionOfTwist
+        )?.label || "";
+      this.newPrintHandler(row);
+    },
 
 
     // 初始化产品相关数据
     // 初始化产品相关数据
     initProductData() {
     initProductData() {

+ 87 - 3
zkqy-ui/src/views/system/financialManage/saleAccountsReceivableDetail.vue

@@ -120,6 +120,25 @@
             >
             >
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="导出列">
+            <el-select
+              collapse-tags
+              v-model="exportColumns"
+              clearable
+              filterable
+              multiple
+            >
+              <el-option
+                v-for="item in exportColumnsOptions"
+                :key="item.prop"
+                :label="item.label"
+                :value="item.prop"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-form>
       </el-form>
     </el-row>
     </el-row>
 
 
@@ -782,6 +801,7 @@ import {
   addBilling,
   addBilling,
   cancelBilling,
   cancelBilling,
   rejectHandler,
   rejectHandler,
+  dynamicExport,
 } from "@/api/system/SaleAccountsReceivableDetail";
 } from "@/api/system/SaleAccountsReceivableDetail";
 import {
 import {
   getCustomList,
   getCustomList,
@@ -803,6 +823,33 @@ export default {
   ],
   ],
   data() {
   data() {
     return {
     return {
+      selections: [], //勾选行数据
+      exportColumns: [], //导出列数据
+      exportColumnsOptions: [
+        { label: "账务类型", prop: "accountingType" },
+        { label: "客户名称", prop: "customName" },
+        { label: "日期", prop: "accountsReceivableDate" },
+        { label: "销售单号", prop: "saleNo" },
+        { label: "通知单号", prop: "noticeNumber" },
+        { label: "品名", prop: "productName" },
+        { label: "规格", prop: "productSpecifications" },
+        { label: "等级", prop: "productLevel" },
+        { label: "颜色", prop: "productColour" },
+        { label: "批号", prop: "lotNumber" },
+        { label: "箱数", prop: "boxNum" },
+        { label: "重量", prop: "weight" },
+        { label: "单价", prop: "productPrice" },
+        { label: "应收", prop: "amountReceivable" },
+        { label: "已收", prop: "receivedAmount" },
+        { label: "余额", prop: "amounts" },
+        { label: "付款方式", prop: "paymentMethod" },
+        { label: "开票类型", prop: "billingType" },
+        { label: "备注", prop: "accountsReceivableRemark" },
+        { label: "结算单位", prop: "settlementUnitName" },
+        { label: "回单状态", prop: "returnReceipt" },
+        { label: "回单日期", prop: "returnReceiptDate" },
+        { label: "回单备注", prop: "returnReceiptRemark" },
+      ], //列选项数据
       receiptIds: [], //回单ids
       receiptIds: [], //回单ids
       receiptShow: false, //回单弹窗
       receiptShow: false, //回单弹窗
       timeRange: [], //日期范围
       timeRange: [], //日期范围
@@ -1339,6 +1386,7 @@ export default {
     // 多选框选中数据
     // 多选框选中数据
     handleSelectionChange(selection) {
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.id);
       this.ids = selection.map((item) => item.id);
+      this.selections = selection;
       this.single = selection.length !== 1;
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
       this.multiple = !selection.length;
     },
     },
@@ -1393,11 +1441,47 @@ export default {
         .catch(() => {});
         .catch(() => {});
     },
     },
     /** 导出按钮操作 */
     /** 导出按钮操作 */
-    handleExport() {
+    async handleExport() {
+      let payLoad = {
+        queryMap: {
+          ...this.queryParams,
+        },
+        resultMap: {}, //导出行数据
+        execlMap: "", //导出的列
+        basicMap: {},
+      };
+      if (this.selections.length > 0) {
+        payLoad.basicMap.exportType = "checkOff";
+        payLoad.resultMap.exportRow = JSON.stringify(this.selections);
+      } else {
+        payLoad.basicMap.exportType = "condition";
+        payLoad.queryMap = { ...this.queryParams };
+        delete payLoad.queryMap.pageNum;
+        delete payLoad.queryMap.pageSize;
+      }
+      payLoad.dictTransform = {
+        accountingType: JSON.stringify(this.dict.type.accounting_type),
+        paymentMethod: JSON.stringify(
+          this.dict.type.collection_registration_payment_method
+        ),
+        billingType: JSON.stringify(
+          this.dict.type.accounts_receivable_billing_type
+        ),
+      };
+      // 导出列数据
+      let tempExelMap = {};
+      this.exportColumns.forEach((item) => {
+        tempExelMap[item] = this.exportColumnsOptions.find(
+          (i) => i.prop == item
+        )?.label;
+      });
+      payLoad.execlMap = JSON.stringify(tempExelMap);
+
+      // let res = await dynamicExport(payLoad);
       this.download(
       this.download(
-        "system/SaleAccountsReceivableDetail/export",
+        "system/SaleAccountsReceivableDetail/dynamicExport",
         {
         {
-          ...this.queryParams,
+          ...payLoad,
         },
         },
         `SaleAccountsReceivableDetail_${new Date().getTime()}.xlsx`
         `SaleAccountsReceivableDetail_${new Date().getTime()}.xlsx`
       );
       );