Commit dfd98b05 authored by 李苏's avatar 李苏 💬

检验单调整

parent 1e63bf83
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
editTableTitle: [{ editTableTitle: [{
label: '唯一码', label: '唯一码',
prop: 'packCode', prop: 'packCode',
width: 100, width: 130,
}, },
{ {
label: '名称', label: '名称',
...@@ -230,9 +230,13 @@ ...@@ -230,9 +230,13 @@
methods: { methods: {
save(){ save(){
/* 源数据*/ /* 源数据*/
let originalList=this.original.map(item=>item.packid) let originalMap={}
let originalList=this.original.map(item=>{
originalMap[item.packid]=item.jhsl
return item.packid
})
/* 现有数据*/ /* 现有数据*/
let nowList=this.editTableConfig.editTableData.map(item=>item.id) let nowList=this.editTableConfig.editTableData.map(item=>item.packid)
/* 遍历删除的数据*/ /* 遍历删除的数据*/
let delArr=this.original.filter(item=>{ let delArr=this.original.filter(item=>{
if(!nowList.includes(item.packid)){ if(!nowList.includes(item.packid)){
...@@ -245,8 +249,27 @@ ...@@ -245,8 +249,27 @@
}) })
/* 新增的数据*/ /* 新增的数据*/
let addArr=[] let addArr=[]
/* 修改的数据*/
let editArr=[] let editArr=[]
this.editTableConfig.editTableData /* 未修改的数据*/
let noeditArr=[]
this.editTableConfig.editTableData.forEach(item=>{
if( originalList.includes(item.packid)){
/* 如果新数据在源数据也有*/
if(item.jhsl==originalMap.jhsl){
noeditArr.push(item)
}else{
item.flag='U'
editArr.push(item)
}
}else{
/* 如果没有那么就是新增数据*/
item.flag='I'
addArr.push(item)
}
})
let finList=[...delArr,...editArr,...addArr,...noeditArr]
console.log(finList)
}, },
/* 计算保存 /* 计算保存
n为新值 n为新值
......
...@@ -93,6 +93,31 @@ ...@@ -93,6 +93,31 @@
field: "packmxSl", field: "packmxSl",
width: 140 width: 140
}, },
{
title: "装托数量",
field: "ztsl",
width: 140
},
{
title: "容器状态",
field: "rqZt",
width: 140,
transform: {
"url": "wms/jcsj/rq/init/zt",
"label": "name",
"value": "id"
}
},
{
title: "包装状态",
field: "packZt",
width: 140,
transform: {
"url": "wms/jcsj/pack/init/zt",
"label": "name",
"value": "id"
}
},
{ {
title: "维护人", title: "维护人",
field: "whr" field: "whr"
...@@ -131,7 +156,9 @@ ...@@ -131,7 +156,9 @@
save(){ save(){
let list =this.$refs.basePage.$refs.TablePager.selectedList||[] let list =this.$refs.basePage.$refs.TablePager.selectedList||[]
if(list.length!=0){ if(list.length!=0){
this.$post('lxyl/zlgl/ukcjyd/add',list).then(res=>{ this.$post('lxyl/zlgl/ukcjyd/add',{
list
}).then(res=>{
if(res.success){ if(res.success){
this.app.showDialog=false this.app.showDialog=false
this.app.refresh() this.app.refresh()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment