Browse Source

订货业务,订货订单新增一键发货

qymljy 11 months ago
parent
commit
71f0d702e4

+ 27 - 1
src/SDrpManagement/agentOrder/details/index.vue

@@ -202,6 +202,7 @@
         <product-list
           :data="mainData"
           ref="prod"
+          @select="select"
           @qtyChange="queryMainData"
           @onSuccess="queryMainData"
         >
@@ -218,6 +219,7 @@
               @clearUrl="errorUrl = null"
               @onSuccess="bindImportOrder"
             ></importFile>
+            <el-button class="inline-16" :disabled="mainData.status !== '审核' || selection.length === 0"  size="small" type="primary"  @click="adddispatch">{{$t(`一键发货`)}}</el-button>
           </div>
         </product-list>
       </div>
@@ -292,7 +294,8 @@ export default {
       isusedrebate: "",
       checked: 0,
       rebateamount: "",
-      typeNew:''
+      typeNew:'',
+      selection:[]
     };
   },
   provide() {
@@ -665,6 +668,29 @@ export default {
       }
       this.queryMainData();
     },
+    select (data) {
+      this.selection = data
+    },
+    async adddispatch () {
+      const res = await this.$api.requested({
+        "id": "20230220100604",
+        "content": {
+          "sa_orderid":this.mainData.sa_orderid,
+          "sa_orderitemsids": this.selection.map(e=>{
+            return e.sa_orderitemsid
+          })
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        let route = this.$route
+
+        this.oldRoute = {path:route.path,query:route.query}
+
+        this.$store.dispatch('setHistoryRouter',this.oldRoute)
+
+        this.$router.replace({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
+      })
+    },
   },
   mounted() {
     this.queryMainData(this.$route.query.id);

+ 4 - 0
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -62,6 +62,7 @@
         fixedName="rowno itemname itemno erpitemno model"
         redirect="left"
         :headerOptions="['needdate']"
+        @selectionChange="selectionChange"
       >
         <template v-slot:header="scope">
           <div v-if="scope.column.columnname == 'needdate'">
@@ -565,6 +566,9 @@ export default {
       };
       this.$emit("onSuccess");
     },
+    selectionChange (selection) {
+      this.$emit('select',selection)
+    },
   },
   mounted() {
     this.flag = 0;

+ 27 - 1
src/SDrpManagement/salerOrder/details/index.vue

@@ -203,6 +203,7 @@
       <div slot="slot0">
         <product-list
           :data="mainData"
+          @select="select"
           @onSuccess="queryMainData($route.query.id)"
           ref="prod"
         >
@@ -219,6 +220,7 @@
               @clearUrl="errorUrl = null"
               @onSuccess="bindImportOrder"
             ></importFile>
+            <el-button class="inline-16" :disabled="mainData.status !== '审核' || selection.length === 0"  size="small" type="primary"  @click="adddispatch">{{$t(`一键发货`)}}</el-button>
           </div>
         </product-list>
       </div>
@@ -299,7 +301,8 @@ export default {
       checked: 0,
       rebateamount: "",
       typeNew:'',
-      fullscreenLoading:false
+      fullscreenLoading:false,
+      selection:[]
     };
   },
   provide() {
@@ -730,6 +733,29 @@ export default {
           });
         });
     },
+    select (data) {
+      this.selection = data
+    },
+    async adddispatch () {
+      const res = await this.$api.requested({
+        "id": "20230220100604",
+        "content": {
+          "sa_orderid":this.mainData.sa_orderid,
+          "sa_orderitemsids": this.selection.map(e=>{
+            return e.sa_orderitemsid
+          })
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        let route = this.$route
+
+        this.oldRoute = {path:route.path,query:route.query}
+
+        this.$store.dispatch('setHistoryRouter',this.oldRoute)
+
+        this.$router.replace({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
+      })
+    },
   },
   mounted() {
     this.queryMainData(this.$route.query.id);

+ 4 - 0
src/SDrpManagement/salerOrder/modules/productlist.vue

@@ -62,6 +62,7 @@
         fixedName="rowno itemname itemno erpitemno model"
         redirect="left"
         :headerOptions="['needdate']"
+        @selectionChange="selectionChange"
       >
         <template v-slot:header="scope">
           <div v-if="scope.column.columnname == 'needdate'">
@@ -806,6 +807,9 @@ export default {
       };
       this.$emit("onSuccess");
     },
+    selectionChange (selection) {
+      this.$emit('select',selection)
+    },
   },
   mounted() {
     this.flag = 0;