|
@@ -231,13 +231,15 @@
|
|
|
label="仓库"
|
|
|
width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.stockid" size="mini" placeholder="请选择">
|
|
|
+ <el-select v-model="scope.row.stockid" size="mini" @visible-change="queryStock(scope.row)" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in stockOptions"
|
|
|
- :key="item.stockid"
|
|
|
- :label="item.stockname"
|
|
|
- :value="item.stockid"
|
|
|
- @click.native="rowChange(scope.row,scope.$index)">
|
|
|
+ :key="item.stockno"
|
|
|
+ :label="item.WAREHOUSE"
|
|
|
+ :value="item.stockno"
|
|
|
+ @click.native="stockChange(item,scope.row,scope.$index)">
|
|
|
+ <span>{{ item.WAREHOUSE }}</span>
|
|
|
+ <div style="float: right; color: #8492a6; font-size: 13px">数量:{{item.qty}}仓位:{{ item.LOCATION }}/批号:{{ item.LOT }}</div>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -248,7 +250,7 @@
|
|
|
label="仓位"
|
|
|
width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input size="mini" v-model="scope.row.position" @input="rowChange(scope.row,scope.$index)" placeholder="输入仓位"></el-input>
|
|
|
+ <el-input size="mini" readonly v-model="scope.row.position" @input="rowChange(scope.row,scope.$index)" placeholder="输入仓位"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -257,7 +259,7 @@
|
|
|
label="批号"
|
|
|
width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input size="mini" v-model="scope.row.batchno" @input="rowChange(scope.row,scope.$index)" placeholder="输入批号"></el-input>
|
|
|
+ <el-input size="mini" readonly v-model="scope.row.batchno" @input="rowChange(scope.row,scope.$index)" placeholder="输入批号"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -390,31 +392,31 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
+ stockChange (item,row,index) {
|
|
|
+ row.position = item.LOCATION
|
|
|
+ row.batchno = item.LOT
|
|
|
+ this.$set(this.tableData,index,row)
|
|
|
+ that.updateOrder({
|
|
|
+ "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
+ "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
+ "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
+ "type": this.data.type, //订单类型
|
|
|
+ "items": this.tableData
|
|
|
+ })
|
|
|
+ },
|
|
|
rowChange (val,index) {
|
|
|
let that = this
|
|
|
if(this.time !== null){
|
|
|
clearTimeout(this.time);
|
|
|
}
|
|
|
this.time = setTimeout(() => {
|
|
|
+ this.$set(this.tableData,index,val)
|
|
|
that.updateOrder({
|
|
|
"sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
"sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
"sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
"type": this.data.type, //订单类型
|
|
|
- "items": [{
|
|
|
- "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
|
|
|
- "itemid": val.itemid, //商品ID
|
|
|
- "qty": val.qty, //数量
|
|
|
- "needdate": val.needdate,//可以不传,修改交期
|
|
|
- "price":val.price,
|
|
|
- "remarks":val.remarks,
|
|
|
- "defaultprice":val.defaultprice,
|
|
|
- "stockid":val.stockid,
|
|
|
- "position":val.position,
|
|
|
- "batchno":val.batchno
|
|
|
- }]
|
|
|
- },()=>{
|
|
|
- this.$set(this.tableData,index,val)
|
|
|
+ "items": this.tableData
|
|
|
})
|
|
|
},500)
|
|
|
},
|
|
@@ -425,12 +427,7 @@ export default {
|
|
|
"sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
"sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
"type": this.data.type, //订单类型
|
|
|
- "items": [{
|
|
|
- "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
|
|
|
- "itemid": val.itemid, //商品ID
|
|
|
- "qty": val.qty, //数量
|
|
|
- "deliverydate": val.deliverydate//可以不传,修改交期
|
|
|
- }]
|
|
|
+ "items": this.tableData
|
|
|
})
|
|
|
},
|
|
|
async updateOrder (val,fn) {
|
|
@@ -440,7 +437,6 @@ export default {
|
|
|
})
|
|
|
this.$emit('onSuccess')
|
|
|
this.listData()
|
|
|
- res.code === 1?fn():""
|
|
|
},
|
|
|
async dateChangeNeed(val){
|
|
|
const res = await this.$api.requested({
|
|
@@ -515,14 +511,22 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
- async queryStock () {
|
|
|
- const res = await this.$store.dispatch('optiontypeselect','stockselect')
|
|
|
+ async queryStock (val) {
|
|
|
+ console.log(val)
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20230228193201,
|
|
|
+ "content": {
|
|
|
+ "itemid": val.itemid,
|
|
|
+ "qty": val.qty
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
this.stockOptions = res.data
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
this.listData()
|
|
|
- this.queryStock()
|
|
|
+ // this.queryStock()
|
|
|
this.columnTitle = []
|
|
|
this.$refs.multipleTable.$children.forEach(obj => {
|
|
|
|