Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
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
hooloo
web
soss
Commits
8073d4b1
Commit
8073d4b1
authored
2 years ago
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改规格
parent
fb33385c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
src/components/SelectMaterial/index.vue
+34
-11
No files found.
src/components/SelectMaterial/index.vue
View file @
8073d4b1
...
...
@@ -15,7 +15,7 @@
<el-table-column
label=
"原料数量"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;"
>
<el-input
v-model=
"scope.row.quantity"
placeholder=
"请输入原料数量"
/>
<el-input
v-model=
"scope.row.quantity"
placeholder=
"请输入原料数量"
@
change=
"((val)=>
{quanChange(val, scope.row)})"
/>
<div
style=
"margin-left: 5px"
>
<span>
{{
scope
.
row
.
unit
}}
</span>
</div>
...
...
@@ -127,7 +127,8 @@ export default {
});
},
openModal
()
{
this
.
getList
();
//this.getList();
this
.
handleQuery
();
this
.
open
=
true
;
},
// 取消按钮
...
...
@@ -139,31 +140,53 @@ export default {
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
listMaterial
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
materialList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
if
(
this
.
ids
.
length
>
0
){
for
(
let
j
=
0
;
j
<
response
.
rows
.
length
;
j
++
){
let
row
=
response
.
rows
[
j
];
row
.
quantity
=
""
;
if
(
this
.
ids
.
length
>
0
){
for
(
let
i
=
0
;
i
<
this
.
ids
.
length
;
i
++
){
for
(
let
j
=
0
;
j
<
this
.
materialList
.
length
;
j
++
){
if
(
this
.
ids
[
i
].
quantity
!=
""
){
if
(
this
.
ids
[
i
].
id
==
this
.
materialList
[
j
]
.
id
){
this
.
materialList
[
j
]
.
quantity
=
this
.
ids
[
i
].
quantity
if
(
this
.
ids
[
i
].
id
==
row
.
id
){
row
.
quantity
=
this
.
ids
[
i
].
quantity
}
}
}
}
}
}
this
.
materialList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
;
},
quanChange
(
val
,
row
){
for
(
let
i
=
0
;
i
<
this
.
ids
.
length
;
i
++
){
if
(
row
.
id
==
this
.
ids
[
i
].
id
){
row
.
quantity
=
val
;
this
.
ids
[
i
].
quantity
=
val
}
}
},
/** 提交按钮 */
submitForm
()
{
let
subTag
=
true
;
console
.
log
(
"this.ids"
,
this
.
ids
);
this
.
ids
.
map
((
item
)
=>
{
if
(
item
.
quantity
===
""
||
item
.
quantity
==
undefined
){
if
(
item
.
quantity
===
""
||
item
.
quantity
==
undefined
){
//selection 没有变化时,this.ids值还是上一次选择变化的值,将新的变化的值重新赋值
for
(
let
i
=
0
;
i
<
this
.
materialList
.
length
;
i
++
){
if
(
item
.
id
==
this
.
materialList
[
i
].
id
){
item
.
quantity
=
this
.
materialList
[
i
].
quantity
;
}
}
let
name
=
item
.
name
;
this
.
$message
.
error
(
''
+
name
+
"原料名称的原料数量不能为空!"
);
subTag
=
false
;
...
...
This diff is collapsed.
Click to expand it.
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