Prechádzať zdrojové kódy

应收明细导出添加列排序功能/添加撤销登记操作

lph 10 mesiacov pred
rodič
commit
5da5147d56

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

@@ -107,6 +107,14 @@ export function rejectHandler(data) {
     data: data
   })
 }
+// 撤销登账  
+export function cancelAccountEntry(data) {
+  return request({
+    url: 'system/SaleAccountsReceivableDetail/cancelAccountEntry',
+    method: 'post',
+    data: data
+  })
+}
 
 
 // 应收明细新导出

+ 21 - 14
zkqy-ui/src/views/orderMange/codeListManage/printIndex.vue

@@ -294,15 +294,7 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :span="8">
-                <el-form-item prop="foreignTradeNumber" label="外贸号">
-                  <el-input
-                    v-model="form.foreignTradeNumber"
-                    size="mini"
-                    clearable
-                  ></el-input>
-                </el-form-item>
-              </el-col>
+
               <el-col :span="8">
                 <el-form-item prop="canisterWeight" label="筒重">
                   <el-select
@@ -390,6 +382,20 @@
                   </el-select>
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item prop="foreignTradeNumber" label="外贸号">
+                  <el-input-number
+                    v-model="form.foreignTradeNumber"
+                    size="mini"
+                    label=""
+                    :min="1"
+                    :step="1"
+                    :controls="true"
+                    controls-position="both"
+                  >
+                  </el-input-number>
+                </el-form-item>
+              </el-col>
               <el-col :span="8">
                 <el-form-item prop="grossWeight" label="毛重">
                   <el-input
@@ -1358,12 +1364,12 @@ export default {
             let msg = this.isEdit ? "编辑" : "新增";
             if (res.code == 200) {
               // 后端打印
-              await this.newPrintHandler();
+              // await this.newPrintHandler();
               // 前端打印
-              // codeListPrint(this.printTableData, "printDom");
-              // if (this.excuteType == 1) {
-              //   this.tableData.push(this.printTableData[0]);
-              // }
+              codeListPrint(this.printTableData, "printDom");
+              if (this.excuteType == 1) {
+                this.tableData.push(this.printTableData[0]);
+              }
             } else {
               this.$message.error(`${msg}箱单失败`);
             }
@@ -1535,6 +1541,7 @@ export default {
         // }
       }
       this.currentRow = val;
+      // this.continuePrintHandler(); //产品选择后,自动执行接续逻辑
     },
     // 获取码单号
     async getQrCodeHandle() {

+ 165 - 16
zkqy-ui/src/views/system/financialManage/saleAccountsReceivableDetail.vue

@@ -128,13 +128,38 @@
               clearable
               filterable
               multiple
+              @change="exportColumnsChange"
             >
               <el-option
-                v-for="item in exportColumnsOptions"
+                v-for="(item, index) in exportColumnsOptions"
                 :key="item.prop"
                 :label="item.label"
                 :value="item.prop"
               >
+                <span style="float: left">{{ item.label }}</span>
+                <span
+                  style="
+                    float: right;
+                    color: #8492a6;
+                    font-size: 16px;
+                    margin-left: 10px;
+                  "
+                >
+                  <el-button
+                    class="iconBtn"
+                    v-show="index < exportColumnsOptions.length - 1"
+                    @click="(e) => tempFun(e, item, 'bottom', index)"
+                    icon="el-icon-bottom"
+                    circle
+                  ></el-button>
+                  <el-button
+                    class="iconBtn"
+                    v-show="index > 0"
+                    @click="(e) => tempFun(e, item, 'top', index)"
+                    icon="el-icon-top"
+                    circle
+                  ></el-button>
+                </span>
               </el-option>
             </el-select>
           </el-form-item>
@@ -361,6 +386,8 @@
                   >回 单</el-button
                 ></el-dropdown-item
               > -->
+
+              <!-- v-show="scope.row.accountingType == 3" -->
               <el-dropdown-item v-show="scope.row.accountingType == 3"
                 ><el-button
                   size="mini"
@@ -369,6 +396,14 @@
                   >驳 回</el-button
                 ></el-dropdown-item
               >
+              <el-dropdown-item v-show="scope.row.accountingType != 3"
+                ><el-button
+                  size="mini"
+                  type="text"
+                  @click="handlerCancel(scope.row)"
+                  >撤销登账</el-button
+                ></el-dropdown-item
+              >
             </el-dropdown-menu>
           </el-dropdown>
         </template>
@@ -802,6 +837,7 @@ import {
   cancelBilling,
   rejectHandler,
   dynamicExport,
+  cancelAccountEntry,
 } from "@/api/system/SaleAccountsReceivableDetail";
 import {
   getCustomList,
@@ -824,8 +860,9 @@ export default {
   data() {
     return {
       selections: [], //勾选行数据
-      exportColumns: [], //导出列数据
+      exportColumns: ["allCol"], //导出列数据
       exportColumnsOptions: [
+        { label: "全部列", prop: "allCol" },
         { label: "账务类型", prop: "accountingType" },
         { label: "客户名称", prop: "customName" },
         { label: "日期", prop: "accountsReceivableDate" },
@@ -972,6 +1009,59 @@ export default {
     }),
   },
   methods: {
+    // 撤销登账
+    handlerCancel(row) {
+      this.$confirm("是否确认驳回?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          try {
+            let payload = {
+              status: 3,
+              id: row.id,
+              otherCollectionId: row.otherCollectionId,
+              customerId: row.customerId,
+              receivedAmount: row.receivedAmount,
+            };
+            let res = await cancelAccountEntry(payload);
+            if (res.code == 200) {
+              this.$message.success("撤销成功!");
+              this.getList();
+            } else {
+              throw new Error(res.msg);
+            }
+          } catch (error) {
+            this.$message.error(error);
+          }
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已中止撤销",
+          });
+        });
+    },
+    // 交换数组中两个元素位置回调
+    exchangeItemHandler(i, j, arr) {
+      let temp = arr[i];
+      arr[i] = arr[j];
+      arr[j] = temp;
+    },
+
+    // 移动列顺序回调
+    tempFun(e, item, type, index) {
+      console.log(e, 1111);
+      if (type == "top") {
+        this.exchangeItemHandler(index, index - 1, this.exportColumnsOptions);
+      } else {
+        this.exchangeItemHandler(index, index + 1, this.exportColumnsOptions);
+      }
+      this.$forceUpdate();
+      console.log(this.exportColumnsOptions);
+      e.stopPropagation();
+    },
     // 驳回回调
     handlerReturn(row) {
       this.$confirm("是否确认驳回?", "提示", {
@@ -1440,6 +1530,17 @@ export default {
         })
         .catch(() => {});
     },
+    //导出列改变回调
+    exportColumnsChange(val) {
+      if (val.includes("allCol")) {
+        if (this.exportColumns[this.exportColumns.length - 1] != "allCol") {
+          this.$message.error("已勾选全部列");
+        }
+        this.exportColumns = ["allCol"];
+      }
+    },
+    // 获取导出列数据
+    getExportColumns(selectColumns) {},
     /** 导出按钮操作 */
     async handleExport() {
       let payLoad = {
@@ -1459,23 +1560,47 @@ export default {
         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 tempDictTransform = {
+        accountingType: this.dict.type.accounting_type,
+        paymentMethod: this.dict.type.collection_registration_payment_method,
+        billingType: this.dict.type.accounts_receivable_billing_type,
+        returnReceipt: [
+          { value: "1", label: "已回单" },
+          { value: "0", label: "未回单" },
+        ],
       };
+      console.log(tempDictTransform);
+      payLoad.basicMap.dictTransform = JSON.stringify(tempDictTransform);
       // 导出列数据
-      let tempExelMap = {};
-      this.exportColumns.forEach((item) => {
-        tempExelMap[item] = this.exportColumnsOptions.find(
-          (i) => i.prop == item
-        )?.label;
-      });
+      let tempExelMap = [];
+      if (this.exportColumns[0] == "allCol") {
+        this.exportColumnsOptions.forEach((item, index) => {
+          // tempExelMap[item.prop] = item.label;
+          if (index != 0) {
+            let obj = {};
+            obj[item.prop] = item.label;
+            tempExelMap.push(obj);
+          }
+        });
+      } else {
+        // this.exportColumns.forEach((item) => {
+        //   tempExelMap[item] = this.exportColumnsOptions.find(
+        //     (i) => i.prop == item
+        //   )?.label;
+        // });
+        tempExelMap = this.exportColumnsOptions
+          .filter((item) => {
+            return this.exportColumns.includes(item.prop);
+          })
+          .map((item) => {
+            let obj = {};
+            obj[item.prop] = item.label;
+            return obj;
+          });
+      }
+
       payLoad.execlMap = JSON.stringify(tempExelMap);
+      console.log(payLoad);
 
       // let res = await dynamicExport(payLoad);
       this.download(
@@ -1489,3 +1614,27 @@ export default {
   },
 };
 </script>
+<style lang="scss" scoped>
+.iconBtn {
+  padding: 4px;
+}
+.sequenceIcon {
+  display: inline-block;
+  pointer-events: none;
+}
+.sequenceIcon.up {
+  position: absolute;
+  right: 35px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+.sequenceIcon.down {
+  position: absolute;
+  right: 50px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+.sequenceIcon:hover {
+  color: rgb(115, 195, 233);
+}
+</style>