Browse Source

处理出库明细中批次相关显示逻辑/解决订单新增时可能出现的重复点击问题/应收明细撤销登账时对于贴息和收款类型的特殊联动处理

lph 10 months ago
parent
commit
bec2960bdc

+ 11 - 14
zkqy-ui/src/views/orderMange/components/dialogForm/OutBound.vue

@@ -110,7 +110,7 @@
       <el-table-column label="金额" prop="productAmounts"></el-table-column>
       <el-table-column label="金额" prop="productAmounts"></el-table-column>
       <el-table-column label="批次状态" prop="batchState">
       <el-table-column label="批次状态" prop="batchState">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.row.batchState == 0 ? "正常" : "撤销登账" }}
+          {{ scope.row.batchState == 1 ? "撤销登账" : "正常" }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -139,7 +139,7 @@ export default {
         unitName: "",
         unitName: "",
         remark: "",
         remark: "",
         outStockDate: new Date(),
         outStockDate: new Date(),
-        batchNumber: "",
+        batchNumber: null,
       },
       },
       rules: {
       rules: {
         // unitName: [
         // unitName: [
@@ -183,7 +183,7 @@ export default {
     }),
     }),
     isCanRecordBatch() {
     isCanRecordBatch() {
       return (
       return (
-        (this.form.batchNumber != "" ||
+        (this.form.batchNumber !== null ||
           this.tableData.some((item) => item.batchState == "1")) &&
           this.tableData.some((item) => item.batchState == "1")) &&
         !this.tableData.length
         !this.tableData.length
       );
       );
@@ -242,7 +242,7 @@ export default {
       // if (val) {
       // if (val) {
       this.tableData = JSON.parse(
       this.tableData = JSON.parse(
         JSON.stringify(
         JSON.stringify(
-          this.allTableData.filter((v) => v.batchNumber == val) || []
+          this.allTableData.filter((v) => v.batchNumber === val) || []
         )
         )
       );
       );
       // }
       // }
@@ -262,8 +262,6 @@ export default {
     async getTableData(row, isRetail = true) {
     async getTableData(row, isRetail = true) {
       this.resetForm();
       this.resetForm();
       this.row = row;
       this.row = row;
-
-      console.log(row);
       try {
       try {
         let payload = {};
         let payload = {};
         if (isRetail) {
         if (isRetail) {
@@ -300,7 +298,7 @@ export default {
           this.tableData = res.data;
           this.tableData = res.data;
           this.allTableData = JSON.parse(JSON.stringify(res.data));
           this.allTableData = JSON.parse(JSON.stringify(res.data));
           this.getBatchOptions(res.data); //获取批号选项数据
           this.getBatchOptions(res.data); //获取批号选项数据
-          this.batchChangeHandler(""); //默认显示当前批次数据
+          this.batchChangeHandler(null); //默认显示当前批次数据
           this.isRetail = isRetail;
           this.isRetail = isRetail;
         }
         }
       } catch (error) {}
       } catch (error) {}
@@ -308,20 +306,19 @@ export default {
     // 获取批号选项数据
     // 获取批号选项数据
     getBatchOptions(rows) {
     getBatchOptions(rows) {
       let batchOptions = [];
       let batchOptions = [];
+      batchOptions.push({
+        value: null,
+        label: "当前批次",
+      });
       rows.forEach((row) => {
       rows.forEach((row) => {
-        if (
-          !batchOptions.find((item) => item.value == row.batchNumber)?.value
-        ) {
+        if (!batchOptions.find((item) => item.value === row.batchNumber)) {
           batchOptions.push({
           batchOptions.push({
             value: row.batchNumber,
             value: row.batchNumber,
             label: row.batchNumber,
             label: row.batchNumber,
           });
           });
         }
         }
       });
       });
-      batchOptions.push({
-        value: "",
-        label: "当前批次",
-      });
+
       this.batchOptions = batchOptions;
       this.batchOptions = batchOptions;
     },
     },
     // 获取打印数据
     // 获取打印数据

+ 16 - 11
zkqy-ui/src/views/orderMange/components/dialogForm/OutStockDetail.vue

@@ -109,7 +109,7 @@
       <el-table-column label="金额" prop="productAmounts"></el-table-column>
       <el-table-column label="金额" prop="productAmounts"></el-table-column>
       <el-table-column label="批次状态" prop="batchState">
       <el-table-column label="批次状态" prop="batchState">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.row.batchState == 0 ? "正常" : "撤销登账" }}
+          {{ scope.row.batchState == 1 ? "撤销登账" : "正常" }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
 
 
@@ -147,7 +147,7 @@ export default {
   components: {},
   components: {},
   data() {
   data() {
     return {
     return {
-      batchNumber: "",
+      batchNumber: null,
       allTableData: [], //所有表格数据
       allTableData: [], //所有表格数据
       batchOptions: [], //批号选项数据
       batchOptions: [], //批号选项数据
       oldInventoryState: 0,
       oldInventoryState: 0,
@@ -370,7 +370,13 @@ export default {
             };
             };
           });
           });
           this.allTableData = JSON.parse(JSON.stringify(this.tableData));
           this.allTableData = JSON.parse(JSON.stringify(this.tableData));
-          this.batchChangeHandler(""); //默认显示当前批次数据
+          this.batchChangeHandler(null); //默认显示当前批次数据
+          this.$nextTick(() => {
+            //关闭所有展开行
+            this.tableData.forEach((item) => {
+              this.$refs.tableRef.toggleRowExpansion(item, false);
+            });
+          });
         } else {
         } else {
           this.$message.error(res.msg);
           this.$message.error(res.msg);
         }
         }
@@ -382,27 +388,26 @@ export default {
     batchChangeHandler(val) {
     batchChangeHandler(val) {
       this.tableData = JSON.parse(
       this.tableData = JSON.parse(
         JSON.stringify(
         JSON.stringify(
-          this.allTableData.filter((v) => v.batchNumber == val) || []
+          this.allTableData.filter((v) => v.batchNumber === val) || []
         )
         )
       );
       );
     },
     },
     // 获取批号选项数据
     // 获取批号选项数据
     getBatchOptions(rows) {
     getBatchOptions(rows) {
       let batchOptions = [];
       let batchOptions = [];
+      batchOptions.push({
+        value: null,
+        label: "当前批次",
+      });
       rows.forEach((row) => {
       rows.forEach((row) => {
-        if (
-          !batchOptions.find((item) => item.value == row.batchNumber)?.value
-        ) {
+        if (!batchOptions.find((item) => item.value === row.batchNumber)) {
           batchOptions.push({
           batchOptions.push({
             value: row.batchNumber,
             value: row.batchNumber,
             label: row.batchNumber,
             label: row.batchNumber,
           });
           });
         }
         }
       });
       });
-      batchOptions.push({
-        value: "",
-        label: "当前批次",
-      });
+
       this.batchOptions = batchOptions;
       this.batchOptions = batchOptions;
     },
     },
   },
   },

+ 20 - 3
zkqy-ui/src/views/orderMange/index.vue

@@ -724,7 +724,13 @@
           </el-form>
           </el-form>
         </el-row>
         </el-row>
         <div slot="footer" class="dialog-footer">
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="editConfirm">确 定</el-button>
+          <el-button
+            type="primary"
+            @click="editConfirm"
+            :disabled="isAdding"
+            :loading="isAdding"
+            >确 定</el-button
+          >
           <el-button @click="cancel">取 消</el-button>
           <el-button @click="cancel">取 消</el-button>
         </div>
         </div>
       </el-dialog>
       </el-dialog>
@@ -800,7 +806,8 @@
       </el-dialog>
       </el-dialog>
       <!-- 出库明细 -->
       <!-- 出库明细 -->
       <el-dialog title="出库明细" :visible.sync="outStockShow" width="1200px">
       <el-dialog title="出库明细" :visible.sync="outStockShow" width="1200px">
-        <OutStock ref="outStockRef"></OutStock>
+        <!-- <OutStock ref="outStockRef"></OutStock> -->
+        <OutStockDetail ref="OutStockDetailRef"></OutStockDetail>
         <span slot="footer" class="dialog-footer">
         <span slot="footer" class="dialog-footer">
           <el-button @click="outStockShow = false">关 闭</el-button>
           <el-button @click="outStockShow = false">关 闭</el-button>
           <!-- <el-button type="primary" @click="btnComfirm">确 定</el-button> -->
           <!-- <el-button type="primary" @click="btnComfirm">确 定</el-button> -->
@@ -856,6 +863,7 @@ import outBoundPrint from "@/utils/print/outBoundPrint";
 import oldOutBoundPrint from "@/utils/print/oldOutBoundPrint";
 import oldOutBoundPrint from "@/utils/print/oldOutBoundPrint";
 import { listCustomer } from "@/api/system/customer";
 import { listCustomer } from "@/api/system/customer";
 import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
 import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
+import OutStockDetail from "@/views/orderMange/components/dialogForm/OutStockDetail.vue"; //拆分零售订单与普通订单
 import oldOutBound from "@/views/orderMange/components/dialogForm/oldOutBound.vue";
 import oldOutBound from "@/views/orderMange/components/dialogForm/oldOutBound.vue";
 import { numToCapital } from "@/utils/other";
 import { numToCapital } from "@/utils/other";
 
 
@@ -870,9 +878,11 @@ export default {
     OutBound,
     OutBound,
     OutStock,
     OutStock,
     oldOutBound,
     oldOutBound,
+    OutStockDetail,
   },
   },
   data() {
   data() {
     return {
     return {
+      isAdding: false,
       oldInventoryState: 0,
       oldInventoryState: 0,
       totalMoney: "", //总金额 小写
       totalMoney: "", //总金额 小写
       outStockShow: false, //出库详情
       outStockShow: false, //出库详情
@@ -1917,6 +1927,7 @@ export default {
       //   this.$message.warning(tableValidate.msg);
       //   this.$message.warning(tableValidate.msg);
       //   // return;
       //   // return;
       // }
       // }
+      this.isAdding = true;
       this.$refs.formDataRef.validate(async (valid) => {
       this.$refs.formDataRef.validate(async (valid) => {
         if (valid) {
         if (valid) {
           let {
           let {
@@ -2105,9 +2116,11 @@ export default {
               addProductRes?.code === 200
               addProductRes?.code === 200
             ) {
             ) {
               this.$message.success("修改成功");
               this.$message.success("修改成功");
+              this.isAdding = false;
               this.open = false;
               this.open = false;
               this.getList();
               this.getList();
             } else {
             } else {
+              this.isAdding = false;
               this.$message.error("修改失败");
               this.$message.error("修改失败");
             }
             }
           } else {
           } else {
@@ -2127,16 +2140,20 @@ export default {
               productRes.code === 200
               productRes.code === 200
             ) {
             ) {
               this.$message.success("添加成功");
               this.$message.success("添加成功");
+
               this.open = false;
               this.open = false;
+              this.isAdding = false;
               this.getList();
               this.getList();
             } else {
             } else {
               this.$message.error("添加失败");
               this.$message.error("添加失败");
+              this.isAdding = false;
             }
             }
           }
           }
           // Object.keys(saleValue).map((k) => {
           // Object.keys(saleValue).map((k) => {
           //   saleData.commMap[k] = saleValue[k];
           //   saleData.commMap[k] = saleValue[k];
           // });
           // });
         } else {
         } else {
+          this.isAdding = false;
           this.$message.error("请完善表单数据");
           this.$message.error("请完善表单数据");
         }
         }
       });
       });
@@ -3494,7 +3511,7 @@ export default {
     handleOutDetail(row) {
     handleOutDetail(row) {
       this.outStockShow = true;
       this.outStockShow = true;
       this.$nextTick(() => {
       this.$nextTick(() => {
-        this.$refs.outStockRef.getOutStockDetail(row, false);
+        this.$refs.OutStockDetailRef.getOutStockDetail(row, false);
       });
       });
     },
     },
     // 操作列回调
     // 操作列回调

+ 12 - 3
zkqy-ui/src/views/system/financialManage/receiveRecord.vue

@@ -220,7 +220,11 @@
             <el-dropdown-menu slot="dropdown">
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item
               <el-dropdown-item
                 ><el-button
                 ><el-button
-                  v-show="scope.row.status == 1 || scope.row.status == 3"
+                  v-show="
+                    scope.row.status == 1 ||
+                    scope.row.status == 3 ||
+                    scope.row.status == 5
+                  "
                   size="mini"
                   size="mini"
                   type="text"
                   type="text"
                   icon="el-icon-edit"
                   icon="el-icon-edit"
@@ -231,7 +235,11 @@
               >
               >
               <el-dropdown-item
               <el-dropdown-item
                 ><el-button
                 ><el-button
-                  v-show="scope.row.status == 1 || scope.row.status == 3"
+                  v-show="
+                    scope.row.status == 1 ||
+                    scope.row.status == 3 ||
+                    scope.row.status == 5
+                  "
                   size="mini"
                   size="mini"
                   type="text"
                   type="text"
                   icon="el-icon-circle-check"
                   icon="el-icon-circle-check"
@@ -245,7 +253,8 @@
                   v-show="
                   v-show="
                     scope.row.status == 1 ||
                     scope.row.status == 1 ||
                     scope.row.status == 3 ||
                     scope.row.status == 3 ||
-                    !scope.row.status
+                    !scope.row.status ||
+                    scope.row.status == 5
                   "
                   "
                   size="mini"
                   size="mini"
                   type="text"
                   type="text"