|
@@ -47,8 +47,8 @@
|
|
|
<el-table-column
|
|
|
:label="$t(`数量`)">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="type === 'edit'" size="mini" v-model="scope.row.qty" :min="1" :step="scope.row.orderaddqty" :label="$t(`输入数量`)" @change="qtyChange(scope.row,scope.$index)"></el-input-number> -->
|
|
|
- <span>{{scope.row.qty}}</span>
|
|
|
+ <el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="type === 'edit' && tool.checkAuth($route.name,'update') && status == '新建'" size="mini" v-model="scope.row.qty" :min="1" :step="scope.row.orderaddqty" :label="$t(`输入数量`)" @change="qtyChange(scope.row,scope.$index)"></el-input-number>
|
|
|
+ <span v-else>{{scope.row.qty}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -89,14 +89,15 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props:['type'],
|
|
|
+ props:['type','status'],
|
|
|
data () {
|
|
|
return {
|
|
|
tableData:[],
|
|
|
param:{
|
|
|
- "id": 20221115104703,
|
|
|
+ "id": 2025070313223102,
|
|
|
"content": {
|
|
|
"sa_orderid": 0,
|
|
|
+ "sa_logistics_itemsid":'',
|
|
|
"pageNumber": 1,
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
@@ -111,8 +112,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- async listData (id) {
|
|
|
- this.param.content.sa_dispatchid = id
|
|
|
+ async listData (sa_orderid,sa_logistics_itemsid) {
|
|
|
+ this.param.content.sa_orderid = sa_orderid
|
|
|
+ this.param.content.sa_logistics_itemsid = sa_logistics_itemsid
|
|
|
const res = await this.$api.requested(this.param)
|
|
|
this.tableData = res.data
|
|
|
this.total = res.total
|
|
@@ -121,12 +123,12 @@ export default {
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|
|
|
this.param.content.pageSize = val
|
|
|
- this.listData(this.param.content.sa_dispatchid)
|
|
|
+ this.listData(this.param.content.sa_orderid,this.param.content.sa_logistics_itemsid)
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
this.param.content.pageNumber = val
|
|
|
- this.listData(this.param.content.sa_dispatchid)
|
|
|
+ this.listData(this.param.content.sa_orderid,this.param.content.sa_logistics_itemsid)
|
|
|
},
|
|
|
async deleteOrderProduct (row) {
|
|
|
const res = await this.$api.requested({
|
|
@@ -142,27 +144,28 @@ export default {
|
|
|
},
|
|
|
async updateOrderProduct (val) {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221110145302,
|
|
|
- "content": val
|
|
|
+ "id": 2025070313551202,
|
|
|
+ "content":{
|
|
|
+ "items":[val]
|
|
|
+ }
|
|
|
})
|
|
|
+ if (res.code == 0){
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
},
|
|
|
qtyChange (val,index) {
|
|
|
let that = this
|
|
|
this.$set(this.tableData,index,val)
|
|
|
- // console.log(val,this.tableData)
|
|
|
- // // 防抖
|
|
|
+ console.log(val,this.tableData)
|
|
|
+ // 防抖
|
|
|
if(this.time !== null){
|
|
|
clearTimeout(this.time);
|
|
|
}
|
|
|
this.time = setTimeout(() => {
|
|
|
that.updateOrderProduct({
|
|
|
- "sa_orderitemsid":val.sa_orderitemsid,
|
|
|
- "sa_orderid":this.$route.query.id,//订单ID
|
|
|
- "itemid":val.itemid,//商品ID
|
|
|
- "type":"数量",//调整类型,目前只支持数量
|
|
|
- "oldvalue":val.qty,//原值
|
|
|
- "newvalue":val.qty,//调整后值
|
|
|
- "remarks":val.remarks
|
|
|
+ "sa_dispatch_itemsid":val.sa_dispatch_itemsid,
|
|
|
+ "sa_logistics_items_mxid":val.sa_logistics_items_mxid,
|
|
|
+ "qty":val.qty
|
|
|
})
|
|
|
},500)
|
|
|
}
|