|
@@ -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')
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|