Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lxyl-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
lxyl-vue
Commits
371b7af9
Commit
371b7af9
authored
Dec 26, 2023
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
c6fc5899
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
58 deletions
+57
-58
tzqd.vue
src/views/ccgl/ckgl/jhd/tzqd.vue
+57
-58
No files found.
src/views/ccgl/ckgl/jhd/tzqd.vue
View file @
371b7af9
...
...
@@ -22,8 +22,8 @@
<template
slot=
"tabCustom2"
>
<el-table-column
label=
"操作"
width=
"90"
header-align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
style=
"text-align: center;color: cornflowerblue;width: 100%;"
@
click
.
native
.
prevent=
"cz(scope.$index,scope,scope.row)"
type=
"text"
size=
"small"
>
<el-button
style=
"text-align: center;color: cornflowerblue;width: 100%;"
@
click
.
native
.
prevent=
"cz(scope.$index,scope,scope.row)"
type=
"text"
size=
"small"
>
<i
class=
"el-icon-edit"
></i>
操作
</el-button>
...
...
@@ -107,14 +107,13 @@
},
data
()
{
return
{
original
:[],
original
:
[],
/* 数量记录*/
sljl
:
{
},
editTableConfig
:
{
editTableTitle
:
[
{
editTableTitle
:
[{
label
:
'拣货数量'
,
prop
:
'jhsl'
,
allowEdit
:
true
,
...
...
@@ -215,7 +214,7 @@
field
:
"packCode"
,
width
:
140
},
{
title
:
"维护人"
,
field
:
"whr"
...
...
@@ -237,57 +236,57 @@
}
},
methods
:
{
save
(){
save
()
{
/* 源数据*/
let
originalMap
=
{}
let
originalList
=
this
.
original
.
map
(
item
=>
{
originalMap
[
item
.
packid
]
=
item
.
jhsl
return
item
.
packid
})
/* 现有数据*/
let
nowList
=
this
.
editTableConfig
.
editTableData
.
map
(
item
=>
item
.
packid
)
/* 遍历删除的数据*/
let
delArr
=
this
.
original
.
filter
(
item
=>
{
if
(
!
nowList
.
includes
(
item
.
packid
))
{
item
.
flag
=
'D'
return
true
let
originalMap
=
{}
let
originalList
=
this
.
original
.
map
(
item
=>
{
originalMap
[
item
.
packid
]
=
item
.
jhsl
return
item
.
packid
})
/* 现有数据*/
let
nowList
=
this
.
editTableConfig
.
editTableData
.
map
(
item
=>
item
.
packid
)
/* 遍历删除的数据*/
let
delArr
=
this
.
original
.
filter
(
item
=>
{
if
(
!
nowList
.
includes
(
item
.
packid
))
{
item
.
flag
=
'D'
return
true
/* 存在*/
}
else
{
return
false
}
})
/* 新增的数据*/
let
addArr
=
[]
/* 修改的数据*/
let
editArr
=
[]
/* 未修改的数据*/
let
noeditArr
=
[]
this
.
editTableConfig
.
editTableData
.
forEach
(
item
=>
{
if
(
originalList
.
includes
(
item
.
packid
)){
/* 如果新数据在源数据也有*/
if
(
item
.
jhsl
==
originalMap
[
item
.
packid
]){
noeditArr
.
push
(
item
)
}
else
{
item
.
flag
=
'U'
editArr
.
push
(
item
)
}
else
{
return
false
}
}
else
{
/* 如果没有那么就是新增数据*/
item
.
flag
=
'I'
addArr
.
push
(
item
)
}
})
let
finList
=
[...
delArr
,...
editArr
,...
addArr
,...
noeditArr
]
/* 开始保存*/
this
.
$post
(
'wms/ckgl/jhtz/jhtzqd/save'
,{
id
:
this
.
app
.
singleItem
.
$id
,
datas
:
finList
}).
then
(
res
=>
{
if
(
res
.
success
){
this
.
$success
(
'操作成功'
)
this
.
app
.
showDialog
=
false
}
})
})
/* 新增的数据*/
let
addArr
=
[]
/* 修改的数据*/
let
editArr
=
[]
/* 未修改的数据*/
let
noeditArr
=
[]
this
.
editTableConfig
.
editTableData
.
forEach
(
item
=>
{
if
(
originalList
.
includes
(
item
.
packid
))
{
/* 如果新数据在源数据也有*/
if
(
item
.
jhsl
==
originalMap
[
item
.
packid
])
{
noeditArr
.
push
(
item
)
}
else
{
item
.
flag
=
'U'
editArr
.
push
(
item
)
}
}
else
{
/* 如果没有那么就是新增数据*/
item
.
flag
=
'I'
addArr
.
push
(
item
)
}
})
let
finList
=
[...
delArr
,
...
editArr
,
...
addArr
,
...
noeditArr
]
/* 开始保存*/
this
.
$post
(
'wms/ckgl/jhtz/jhtzqd/save'
,
{
id
:
this
.
app
.
singleItem
.
$id
,
datas
:
finList
}).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$success
(
'操作成功'
)
this
.
app
.
showDialog
=
false
}
})
},
/* 计算保存
n为新值
...
...
@@ -332,7 +331,7 @@
this
.
$warning
(
'已存在该数据'
)
}
else
{
this
.
editTableConfig
.
editTableData
.
push
(
_
.
cloneDeep
({
zlh
:
row
.
zlh
,
zlh
:
row
.
zlh
,
packid
:
row
.
packid
,
packCode
:
row
.
packCode
,
wlph
:
row
.
wlph
,
...
...
@@ -341,8 +340,8 @@
wlxxName
:
row
.
wlxxName
,
kwid
:
row
.
kwid
,
kwName
:
row
.
kwName
,
rqCode
:
row
.
rqCode
,
rqid
:
row
.
rqid
,
rqCode
:
row
.
rqCode
,
rqid
:
row
.
rqid
,
jhsl
:
0
}))
this
.
sljl
[
row
.
packid
]
=
0
...
...
@@ -369,4 +368,4 @@
padding-left
:
5px
;
padding-right
:
5px
;
}
</
style
>
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment