Răsfoiți Sursa

修改订单

fubin 2 ani în urmă
părinte
comite
d68ac94af8

+ 2 - 0
src/config/index.js

@@ -694,6 +694,8 @@ export default {
     add: 'add',
     add: 'add',
     //新建其它
     //新建其它
     addTogether: 'addTogether',
     addTogether: 'addTogether',
+    // 新建其它
+    addOther: 'addOther',
     //编辑
     //编辑
     edit: 'edit',
     edit: 'edit',
     //复制
     //复制

+ 48 - 11
src/view/sale/order-out/formTogether.vue

@@ -99,6 +99,16 @@
             <DatePickerPop v-model="formData.outDate"
             <DatePickerPop v-model="formData.outDate"
                            :short-cut-flag="true"/>
                            :short-cut-flag="true"/>
           </DkFormItem>
           </DkFormItem>
+          <!--自动出库标识-->
+          <DkFormItem prop="autoOutFlag" v-show="showAutoFlag">
+            <template>
+              <i-switch v-model="formData.flgAutoHandle" @on-change="changeOutStatus"
+                        :disabled="type === $config.formMode.handle">
+                <span slot="open"></span>
+                <span slot="close"></span>
+              </i-switch>
+            </template>
+          </DkFormItem>
           <!--单据备注-->
           <!--单据备注-->
           <DkFormItem prop="remarks">
           <DkFormItem prop="remarks">
             <InputPop ref="remarks" v-model="formData.remarks"
             <InputPop ref="remarks" v-model="formData.remarks"
@@ -154,7 +164,8 @@ export default {
   data() {
   data() {
     let self = this
     let self = this
     return {
     return {
-      allCanNoEdit: false, //是否所有的都不允许编辑
+      showAutoFlag: true, //是否显示自动办理出库标识
+      showOutDate: true, //是否显示自动办理出库标识
       currentRow: null,// 表格中的当前行
       currentRow: null,// 表格中的当前行
       // 画面表单数据
       // 画面表单数据
       formData: {
       formData: {
@@ -555,15 +566,30 @@ export default {
       }
       }
     },
     },
     /**
     /**
+     * @desc   : 自动出库标识变更
+     * @author : 付斌
+     * @date   : 2024-04-11 14:47
+     */
+    changeOutStatus() {
+      if (this.type === this.$config.formMode.addTogether) {
+        if (this.formData.flgAutoHandle) {
+          this.formData.outDate = new Date().format("yyyy-MM-dd")
+          this.showOutDate = true
+        } else {
+          this.formData.outDate = null
+          this.showOutDate = false
+        }
+      } else {
+        this.formData.outDate = new Date().format("yyyy-MM-dd")
+      }
+    },
+    /**
      * @desc   : 通过id查询
      * @desc   : 通过id查询
      * @author : 付斌
      * @author : 付斌
      * @date   : 2022/03/04 13:17
      * @date   : 2022/03/04 13:17
      */
      */
     detail(id) {
     detail(id) {
-      //如果是新建用订单ID,编辑、办理用出库单ID
-      if (this.type === this.$config.formMode.add) {
-        return this.excuteNoParam(this.$service.orderService, this.$service.orderService.getOrderForOut, [id]);
-      } else if (this.type === this.$config.formMode.edit) {
+      if (this.type === this.$config.formMode.edit) {
         return this.excuteNoParam(this.$service.orderOutService, this.$service.orderOutService.getOutboundForUpdate, [id]);
         return this.excuteNoParam(this.$service.orderOutService, this.$service.orderOutService.getOutboundForUpdate, [id]);
       }
       }
     },
     },
@@ -577,9 +603,16 @@ export default {
         this.formData = data["data"];
         this.formData = data["data"];
         this.formData.itemList = data["dataItem"];
         this.formData.itemList = data["dataItem"];
 
 
-        if (this.type === this.$config.formMode.add) {
+        if (this.type === this.$config.formMode.addTogether) {
           this.goodsFootFormData.sumOutingQty = this.formData.sumQuantity;
           this.goodsFootFormData.sumOutingQty = this.formData.sumQuantity;
           this.goodsFootFormData.sumOutingAmt = this.formData.sumAmount;
           this.goodsFootFormData.sumOutingAmt = this.formData.sumAmount;
+
+          //系统自动办理出库
+          if (this.$store.state.user.setting[this.$config.settingCode.IVT001] == 1) {
+            this.formData.flgAutoHandle = true;
+          } else {
+            this.formData.flgAutoHandle = false;
+          }
         } else if (this.type === this.$config.formMode.edit) {
         } else if (this.type === this.$config.formMode.edit) {
           this.goodsFootFormData.sumOutingQty = this.formData.outingQty;
           this.goodsFootFormData.sumOutingQty = this.formData.outingQty;
           this.goodsFootFormData.sumOutingAmt = this.formData.outingAmt;
           this.goodsFootFormData.sumOutingAmt = this.formData.outingAmt;
@@ -624,10 +657,6 @@ export default {
      * @date   : 2023/6/25 14:31
      * @date   : 2023/6/25 14:31
      */
      */
     setParams(arg) {
     setParams(arg) {
-      if (this.type === this.$config.formMode.add) {
-        this.formData.fromId = this.formData.orderId;
-        this.formData.fromNo = this.formData.orderNo;
-      }
       this.formData.outingQty = this.goodsFootFormData.sumOutingQty;
       this.formData.outingQty = this.goodsFootFormData.sumOutingQty;
       this.formData.outingAmt = this.goodsFootFormData.sumOutingAmt;
       this.formData.outingAmt = this.goodsFootFormData.sumOutingAmt;
       let itemTable = this.$refs['goodsTable'].getTableDataFilter();
       let itemTable = this.$refs['goodsTable'].getTableDataFilter();
@@ -646,7 +675,7 @@ export default {
      * @date   : 2023/6/25 14:31
      * @date   : 2023/6/25 14:31
      */
      */
     saveData() {
     saveData() {
-      if (this.type === this.$config.formMode.add || this.type === this.$config.formMode.addTogether) {
+      if (this.type === this.$config.formMode.addTogether) {
         return this.excute(this.$service.orderOutService, this.$service.orderOutService.outboundInsert, this.params);
         return this.excute(this.$service.orderOutService, this.$service.orderOutService.outboundInsert, this.params);
       } else if (this.type === this.$config.formMode.edit) {
       } else if (this.type === this.$config.formMode.edit) {
         return this.excute(this.$service.orderOutService, this.$service.orderOutService.outboundUpdate, this.params);
         return this.excute(this.$service.orderOutService, this.$service.orderOutService.outboundUpdate, this.params);
@@ -672,6 +701,14 @@ export default {
   created() {
   created() {
     this.focusItem = 'outId';    // 给第一个组件赋值,可以在混入中自动去聚焦
     this.focusItem = 'outId';    // 给第一个组件赋值,可以在混入中自动去聚焦
     this.primaryKey = 'outId'  // 设置主键Id
     this.primaryKey = 'outId'  // 设置主键Id
+
+    //设置默认值
+    if (this.$route.params.id) {
+      // 出库办理
+      if (this.type === this.$config.formMode.handle) {
+        this.showAutoFlag = false;
+      }
+    }
   },
   },
 }
 }
 </script>
 </script>

+ 39 - 3
src/view/sale/order-return/form.vue

@@ -60,6 +60,16 @@
             <DatePickerPop v-model="formData.outDate"
             <DatePickerPop v-model="formData.outDate"
                            :short-cut-flag="true"/>
                            :short-cut-flag="true"/>
           </DkFormItem>
           </DkFormItem>
+          <!--自动出库标识-->
+          <DkFormItem prop="autoOutFlag" v-show="showAutoFlag">
+            <template>
+              <i-switch v-model="formData.flgAutoHandle" @on-change="changeOutStatus"
+                        :disabled="type === $config.formMode.handle">
+                <span slot="open"></span>
+                <span slot="close"></span>
+              </i-switch>
+            </template>
+          </DkFormItem>
           <!--单据备注-->
           <!--单据备注-->
           <DkFormItem prop="remarks">
           <DkFormItem prop="remarks">
             <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
             <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
@@ -115,8 +125,8 @@ export default {
   data() {
   data() {
     let self = this
     let self = this
     return {
     return {
-      loading: false,
-      allCanNoEdit: false, //是否所有的都不允许编辑
+      showAutoFlag: true, //是否显示自动办理出库标识
+      showOutDate: true, //是否显示自动办理出库标识
       // 画面表单数据
       // 画面表单数据
       formData: {
       formData: {
         cpId: this.$store.state.user.cpId,
         cpId: this.$store.state.user.cpId,
@@ -257,6 +267,24 @@ export default {
       }
       }
     },
     },
     /**
     /**
+     * @desc   : 自动出库标识变更
+     * @author : 付斌
+     * @date   : 2024-04-11 14:47
+     */
+    changeOutStatus() {
+      if (this.type === this.$config.formMode.add) {
+        if (this.formData.flgAutoHandle) {
+          this.formData.outDate = new Date().format("yyyy-MM-dd")
+          this.showOutDate = true
+        } else {
+          this.formData.outDate = null
+          this.showOutDate = false
+        }
+      } else {
+        this.formData.outDate = new Date().format("yyyy-MM-dd")
+      }
+    },
+    /**
      * @desc   : 通过id查询
      * @desc   : 通过id查询
      * @author : 付斌
      * @author : 付斌
      * @date   : 2022/03/04 13:17
      * @date   : 2022/03/04 13:17
@@ -303,7 +331,15 @@ export default {
 
 
         this.goodsFootFormData.sumQuantity = this.formData.outingQty;
         this.goodsFootFormData.sumQuantity = this.formData.outingQty;
         this.goodsFootFormData.sumAmount = this.formData.outingAmt;
         this.goodsFootFormData.sumAmount = this.formData.outingAmt;
-        this.formData.flgAutoHandle = true;
+
+        if (this.type != this.$config.formMode.edit) {
+          //系统自动办理出库
+          if (this.$store.state.user.setting[this.$config.settingCode.IVT001] == 1) {
+            this.formData.flgAutoHandle = true;
+          } else {
+            this.formData.flgAutoHandle = false;
+          }
+        }
       }
       }
     },
     },
     /**
     /**

+ 39 - 4
src/view/sale/order-return/formOther.vue

@@ -99,6 +99,16 @@
             <DatePickerPop v-model="formData.outDate"
             <DatePickerPop v-model="formData.outDate"
                            :short-cut-flag="true"/>
                            :short-cut-flag="true"/>
           </DkFormItem>
           </DkFormItem>
+          <!--自动出库标识-->
+          <DkFormItem prop="autoOutFlag" v-show="showAutoFlag">
+            <template>
+              <i-switch v-model="formData.flgAutoHandle" @on-change="changeOutStatus"
+                        :disabled="type === $config.formMode.handle">
+                <span slot="open"></span>
+                <span slot="close"></span>
+              </i-switch>
+            </template>
+          </DkFormItem>
           <!--单据备注-->
           <!--单据备注-->
           <DkFormItem prop="remarks">
           <DkFormItem prop="remarks">
             <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
             <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
@@ -153,8 +163,8 @@ export default {
   data() {
   data() {
     let self = this
     let self = this
     return {
     return {
-      loading: false,
-      allCanNoEdit: false, //是否所有的都不允许编辑
+      showAutoFlag: true, //是否显示自动办理出库标识
+      showOutDate: true, //是否显示自动办理出库标识
       // 画面表单数据
       // 画面表单数据
       formData: {
       formData: {
         cpId: this.$store.state.user.cpId,
         cpId: this.$store.state.user.cpId,
@@ -535,6 +545,24 @@ export default {
       }
       }
     },
     },
     /**
     /**
+     * @desc   : 自动出库标识变更
+     * @author : 付斌
+     * @date   : 2024-04-11 14:47
+     */
+    changeOutStatus() {
+      if (this.type === this.$config.formMode.addTogether) {
+        if (this.formData.flgAutoHandle) {
+          this.formData.outDate = new Date().format("yyyy-MM-dd")
+          this.showOutDate = true
+        } else {
+          this.formData.outDate = null
+          this.showOutDate = false
+        }
+      } else {
+        this.formData.outDate = new Date().format("yyyy-MM-dd")
+      }
+    },
+    /**
      * @desc   : 通过id查询
      * @desc   : 通过id查询
      * @author : 付斌
      * @author : 付斌
      * @date   : 2022/03/04 13:17
      * @date   : 2022/03/04 13:17
@@ -561,7 +589,6 @@ export default {
      * @date   : 2024-03-03 9:33
      * @date   : 2024-03-03 9:33
      */
      */
     setValuesByEdit(data) {
     setValuesByEdit(data) {
-      console.log("orderOutReturnService", data)
       if (data) {
       if (data) {
         this.formData = data["data"];
         this.formData = data["data"];
         this.formData.itemList = data["dataItem"];
         this.formData.itemList = data["dataItem"];
@@ -581,7 +608,15 @@ export default {
 
 
         this.goodsFootFormData.sumQuantity = this.formData.outingQty;
         this.goodsFootFormData.sumQuantity = this.formData.outingQty;
         this.goodsFootFormData.sumAmount = this.formData.outingAmt;
         this.goodsFootFormData.sumAmount = this.formData.outingAmt;
-        this.formData.flgAutoHandle = true;
+
+        if (this.type === this.$config.formMode.addOther) {
+          //系统自动办理出库
+          if (this.$store.state.user.setting[this.$config.settingCode.IVT001] == 1) {
+            this.formData.flgAutoHandle = true;
+          } else {
+            this.formData.flgAutoHandle = false;
+          }
+        }
       }
       }
     },
     },
     /**
     /**