|
|
@@ -30,6 +30,11 @@
|
|
|
:data="tableData"
|
|
|
size="small"
|
|
|
border>
|
|
|
+ <el-table-column
|
|
|
+ prop="billno"
|
|
|
+ :label="$t(`发货单号`)"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="itemno"
|
|
|
:label="$t(`产品编码`)"
|
|
|
@@ -77,7 +82,7 @@
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
<el-col :span="24 - setcol">
|
|
|
- <logisticsCanUseProduct ref="logislist" :sa_logistics_boxid="0" @onConfirm="onConfirm">
|
|
|
+ <logisticsCanUseProduct ref="logislist" :sa_logistics_boxid="this.data.sa_logistics_boxid" @onConfirm="onConfirm" :addList="delList" type="edit">
|
|
|
<el-button class="inline-16" slot="allBtn" type="primary" size="small" @click="handlePullData">{{$t(`一键全选`)}}</el-button>
|
|
|
</logisticsCanUseProduct>
|
|
|
</el-col>
|
|
|
@@ -100,7 +105,8 @@ export default {
|
|
|
drawer:false,
|
|
|
form:{},
|
|
|
setcol:24,
|
|
|
- tableData:[]
|
|
|
+ tableData:[],
|
|
|
+ delList:[]
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
@@ -109,9 +115,23 @@ export default {
|
|
|
methods:{
|
|
|
onShow () {
|
|
|
this.form = Object.assign({},this.form,this.data)
|
|
|
+ console.log(this.data,'data22222')
|
|
|
+ this.delList = []
|
|
|
this.listData()
|
|
|
},
|
|
|
async onSubmit (){
|
|
|
+ let delID = []
|
|
|
+ delID = this.delList.map(item=>item.sa_logistics_boxmxid)
|
|
|
+ const res1 = await this.$api.requested({
|
|
|
+ "id": "20230109155504",
|
|
|
+ "content": {
|
|
|
+ "sa_logisticsid":this.data.sa_logisticsid,
|
|
|
+ "sa_logistics_boxmxids":delID
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res1.code == 0){
|
|
|
+ this.tool.showMessage(res,()=>{})
|
|
|
+ }
|
|
|
const res = await this.$api.requested({
|
|
|
"id": "20230109155104",
|
|
|
"content": {
|
|
|
@@ -139,21 +159,19 @@ export default {
|
|
|
},
|
|
|
onConfirm (val) {
|
|
|
this.tableData = [...val,...this.tableData]
|
|
|
- const res = new Map();
|
|
|
- this.tableData = this.tableData.filter((item) => !res.has(item['itemno']) && res.set(item['itemno'], 1));
|
|
|
+ // const res = new Map();
|
|
|
+ // this.tableData = this.tableData.filter((item) => !res.has(item['itemno']) && res.set(item['itemno'], 1));
|
|
|
},
|
|
|
async deleteRow (row) {
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": "20230109155504",
|
|
|
- "content": {
|
|
|
- "sa_logisticsid":this.data.sa_logisticsid,
|
|
|
- "sa_logistics_boxmxids":[row.sa_logistics_boxmxid]
|
|
|
- }
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.$emit('onSuccess')
|
|
|
- this.listData()
|
|
|
+ this.tableData = this.tableData.filter(e=>{
|
|
|
+ if (e.sa_dispatch_itemsid !== row.sa_dispatch_itemsid)
|
|
|
+ return e
|
|
|
})
|
|
|
+ console.log(row,'row删除')
|
|
|
+ let delNew = []
|
|
|
+ delNew[0] = row
|
|
|
+ this.delList = [...this.delList,...delNew]
|
|
|
+ this.$refs.logislist.listData()
|
|
|
},
|
|
|
async handlePullData () {
|
|
|
let res = await this.$api.requested({
|
|
|
@@ -169,9 +187,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
if(res.data.length) {
|
|
|
- this.tableData.push(...res.data)
|
|
|
- const res2 = new Map();
|
|
|
- this.tableData = this.tableData.filter((item) => !res2.has(item['itemno']) && res2.set(item['itemno'], 1));
|
|
|
+ this.tableData = res.data
|
|
|
+ // this.tableData.push(...res.data)
|
|
|
+ // const res2 = new Map();
|
|
|
+ // this.tableData = this.tableData.filter((item) => !res2.has(item['itemno']) && res2.set(item['itemno'], 1));
|
|
|
this.$refs.logislist.tableData = []
|
|
|
}
|
|
|
},
|