zhangqiOMG před 2 roky
rodič
revize
c9b7c7f742

+ 1 - 1
src/HDrpManagement/dispatch/modules/productlist.vue

@@ -156,7 +156,7 @@ export default {
         "content": {
           "sa_orderid": 0,
           "pageNumber": 1,
-          "pageSize": 20,
+          "pageSize": 100,
           "where": {
               "condition": ""
           }

+ 61 - 25
src/HDrpManagement/orderManage/details/tabs/changeOrderMx.vue

@@ -38,6 +38,23 @@
           <template slot-scope="scope">
             <p><span>{{scope.row.spec}}</span></p>
           </template>
+         
+        </el-table-column>
+         <el-table-column
+          prop="qty"
+          label="原数量"
+          width="180">
+          <template slot-scope="scope">
+            <span>{{scope.row.undeliqty}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="deliedqty"
+          label="已发数量"
+          width="180">
+          <template slot-scope="scope">
+            <span>{{scope.row.deliedqty}}</span>
+          </template>
         </el-table-column>
         <el-table-column
           prop="undeliqty"
@@ -90,40 +107,59 @@ export default {
         e.newvalue = 0
         return e
       })
-      console.log(this.listData)
       this.dialogVisible = true
       
     },
     onInput(row,index) {
-      if (row.newvalue > row.undeliqty) {
-        this.$message({
-          message:"变更数量不能大于未发数量",
-          type:"error"
-        })
-        row.newvalue = row.undeliqty
-      } 
       this.$set(this.listData,index,row)
     },
-    async submit () {
-      const res = await this.$api.requested({
-        "id": 20221110145302,
-        "content": {
-          "sa_orderid":this.data.sa_orderid,//订单ID
-          "type":"数量",//调整类型,目前只支持数量
-          "remarks":this.data.remarks,
-          "itemifnos":this.listData.map(e=>{
-            return {
-              sa_orderitemsid:e.sa_orderitemsid,
-              itemid:e.itemid,
-              newvalue:e.newvalue
-            }
+    checkRowData () {
+      let valid = true
+      let arr = this.listData.filter((row,index)=>{
+        if (row.newvalue >= row.qty) {
+          this.$message({
+            message:row.itemname+"变更数量不能大于原数量",
+            type:"error",
+            offset:index * 60
+          })
+          return row
+        } else if (row.newvalue  <= row.deliedqty) {
+          this.$message({
+            message:row.itemname+"变更数量不能小于已发货数量",
+            type:"error",
+            offset:index * 60
           })
+          return row
         }
       })
-      this.tool.showMessage(res,()=>{
-        this.dialogVisible = false
-        this.$emit('onSuccess')
-      })
+      if (arr.length > 0) {
+        return false
+      } else {
+        return true
+      }
+    },
+    async submit () {
+      if (this.checkRowData()) {
+        const res = await this.$api.requested({
+          "id": 20221110145302,
+          "content": {
+            "sa_orderid":this.data.sa_orderid,//订单ID
+            "type":"数量",//调整类型,目前只支持数量
+            "remarks":this.data.remarks,
+            "itemifnos":this.listData.map(e=>{
+              return {
+                sa_orderitemsid:e.sa_orderitemsid,
+                itemid:e.itemid,
+                newvalue:e.newvalue
+              }
+            })
+          }
+        })
+        this.tool.showMessage(res,()=>{
+          this.dialogVisible = false
+          this.$emit('onSuccess')
+        })
+      }
     }
   }
 }

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

@@ -18,7 +18,9 @@
           <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
           <el-button :disabled="mainData.status !== '交期待确认'"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
           <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'reback')" :disabled="mainData.status !== '提交'" type="primary" size="mini" @click="reback">撤 回</el-button>
           <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button>
+          
       </div>
       <div slot="slot1">
         <default-info :mainData="mainData"></default-info>
@@ -26,7 +28,7 @@
       <div slot="slot0">
         <product-list :data="mainData" ref="prod" @qtyChange="queryMainData" @onSuccess="queryMainData">
           <div slot="operation">
-            <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" @onSuccess="bindImportOrder"></importFile>
+            <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile>
           </div>
         </product-list>
       </div>
@@ -322,6 +324,29 @@ export default {
         this.queryMainData(this.$route.query.id)
         })
     },
+    reback () {
+      this.$confirm('确定撤回订单吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": 20230301190202,
+          "content": {
+              "sa_orderid": this.$route.query.id
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.mainData()
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });          
+      });
+      
+    },
     async bindImportOrder (id) {
       console.log(id)
       const res = await this.$api.requested({

+ 26 - 2
src/SDrpManagement/salerOrder/details/index.vue

@@ -18,6 +18,7 @@
           <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
           <el-button :disabled="mainData.status !== '交期待确认'"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
           <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'reback')" :disabled="mainData.status !== '提交'" type="primary" size="mini" @click="reback">撤 回</el-button>
           <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button>
       </div>
       <div slot="slot1">
@@ -26,7 +27,7 @@
       <div slot="slot0">
         <product-list :data="mainData" @onSuccess="queryMainData($route.query.id)" ref="prod">
           <div slot="operation">
-            <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile> -->
+            <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile>
           </div>
         </product-list>
       </div>
@@ -389,7 +390,30 @@ export default {
       if (res.data !== '成功') {
         this.errorUrl = res.data
       }
-    }
+    },
+    reback () {
+      this.$confirm('确定撤回订单吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": 20230301190202,
+          "content": {
+              "sa_orderid": this.$route.query.id
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.mainData()
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });          
+      });
+      
+    },
   },
   mounted () {
     this.queryMainData(this.$route.query.id)

+ 1 - 0
src/template/disCanUseProduct/index.vue

@@ -78,6 +78,7 @@ export default {
         "id": 20221114170003,
         "version":1,
         "content": {
+          "pageSize":9999,
           "sa_orderid":0 ,
           "where":{
             "condition":""

+ 1 - 0
src/template/invoiceCanUseProduct/index.vue

@@ -104,6 +104,7 @@ export default {
       params:{
         "id": 20221114170003,
         "content": {
+          "pageSize":9999,
           "sa_orderid":0 ,
           "where":{
             "condition":""