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
0a9a8feb
Commit
0a9a8feb
authored
May 18, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改商品
parent
a9ccb075
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
21 deletions
+82
-21
src/components/SelectMaterial/index.vue
+16
-1
src/views/goods/material/index.vue
+15
-1
src/views/goods/spec/SpecsSelect.vue
+25
-4
src/views/goods/spec/index.vue
+25
-14
src/views/shop/shop/index.vue
+1
-1
No files found.
src/components/SelectMaterial/index.vue
View file @
0a9a8feb
...
...
@@ -14,7 +14,12 @@
<el-table-column
label=
"原料名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"原料数量"
align=
"center"
prop=
"quantity"
>
<template
slot-scope=
"scope"
>
<div
style=
"display: flex;align-items: center;"
>
<el-input
v-model=
"scope.row.quantity"
placeholder=
"请输入原料数量"
/>
<div
style=
"margin-left: 5px"
>
<span>
{{
scope
.
row
.
unit
}}
</span>
</div>
</div>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -91,9 +96,18 @@ export default {
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 提交按钮 */
submitForm
()
{
let
subTag
=
true
;
this
.
ids
.
map
((
item
)
=>
{
if
(
!
item
.
quantity
){
subTag
=
false
;
let
name
=
item
.
name
;
this
.
$modal
.
msgSuccess
(
''
+
name
+
"原料名称的原料数量为空"
);
return
;
}
});
if
(
subTag
){
this
.
$emit
(
"callback"
,
this
.
ids
.
map
((
item
)
=>
{
...
...
@@ -104,6 +118,7 @@ export default {
);
this
.
$refs
.
table
.
clearSelection
();
this
.
open
=
false
;
}
},
},
};
...
...
src/views/goods/material/index.vue
View file @
0a9a8feb
...
...
@@ -46,7 +46,11 @@
<!--
<el-table
v-loading=
"loading"
:data=
"materialList"
@
selection-change=
"handleSelectionChange"
>
-->
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
<el-table
v-loading=
"loading"
:data=
"materialList"
>
<el-table-column
label=
"原料名称"
width=
"150"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"原料名称"
width=
"150"
align=
"center"
prop=
"name"
>
<template
slot-scope=
"scope"
>
<a
@
click=
"handleUpdate(scope.row)"
style=
"color: blue"
>
{{
scope
.
row
.
name
}}
</a>
</
template
>
</el-table-column>
<el-table-column
label=
"编码"
width=
"150"
align=
"center"
prop=
"code"
/>
<el-table-column
label=
"计量单位"
width=
"150"
align=
"center"
prop=
"unit"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remarks"
/>
...
...
@@ -203,6 +207,16 @@ export default {
this
.
open
=
true
;
this
.
title
=
"添加原料"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
;
getMaterial
(
id
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改"
;
});
},
/** 启用、禁用按钮操作 */
handleStatus
(
row
,
tag
)
{
let
mess
=
""
;
...
...
src/views/goods/spec/SpecsSelect.vue
View file @
0a9a8feb
...
...
@@ -3,8 +3,8 @@
<el-table
:data=
"list"
:row-key=
"(row) => row.id"
>
<el-table-column
label=
"默认"
width=
"50"
align=
"center"
prop=
"isDefault"
>
<template
slot-scope=
"scope"
>
<el-checkbox
true-label=
"1"
false-label=
"0"
@
change=
"(e) => changeDefault(e, scope.$index)"
v-model=
"scope.row.isDefault"
></el-checkbox>
<el-checkbox
@
change=
"(e) => changeDefault(e, scope.$index)"
v-model=
"scope.row.isDefault"
:checked=
"scope.row.isDefault===1"
></el-checkbox>
</
template
>
</el-table-column>
<el-table-column
label=
"推荐"
width=
"50"
align=
"center"
prop=
"isRecommend"
>
...
...
@@ -29,8 +29,8 @@
scope.row.specRuleMaterials &&
scope.row.specRuleMaterials.length > 0
"
>
<span
v-for=
"item in scope.row.specRuleMaterials"
:key=
"item.id"
>
{{
item
.
n
ame
}}
*
{{
item
.
quantity
||
""
}}
<span
v-for=
"item in scope.row.specRuleMaterials"
:key=
"item.id"
style=
"color:blue"
>
{{
item
.
materialN
ame
}}
*
{{
item
.
quantity
||
""
}}
</span>
</div>
<el-button
v-else
type=
"primary"
@
click=
"addMaterial(scope.$index)"
size=
"mini"
>
添加原料
...
...
@@ -78,6 +78,14 @@ export default {
},
handleDelete
(
index
)
{
this
.
list
.
splice
(
index
,
1
);
if
(
this
.
list
.
length
>
1
){
for
(
let
i
=
0
;
i
<
this
.
list
.
length
;
i
++
){
if
(
i
==
0
){
this
.
list
[
i
].
isDefault
=
"1"
;
return
;
}
}
}
},
addMaterial
(
index
)
{
this
.
index
=
index
;
...
...
@@ -94,6 +102,19 @@ export default {
amount
:
""
,
specRuleMaterials
:
[],
});
let
p
=
0
;
for
(
let
i
=
0
;
i
<
this
.
list
.
length
;
i
++
){
if
(
this
.
list
[
i
].
isDefault
==
"1"
){
p
=
1
;
return
;
}
}
//没有选择默认项,默认第一条
if
(
p
==
0
){
console
.
log
(
"p2"
,
p
)
this
.
list
[
0
].
isDefault
=
"1"
}
},
clearMaterial
()
{
this
.
list
=
[];
...
...
src/views/goods/spec/index.vue
View file @
0a9a8feb
...
...
@@ -27,7 +27,11 @@
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"specsList"
>
<el-table-column
label=
"规格名称"
width=
"300"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"规格名称"
width=
"300"
align=
"center"
prop=
"name"
>
<template
slot-scope=
"scope"
>
<a
@
click=
"handleUpdate(scope.row)"
style=
"color: blue"
>
{{
scope
.
row
.
name
}}
</a>
</
template
>
</el-table-column>
<el-table-column
label=
"规格编码"
width=
"180"
align=
"center"
prop=
"code"
/>
<el-table-column
label=
"选项"
align=
"center"
prop=
"specRules"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -67,7 +71,7 @@
<el-switch
v-model=
"form.isNeccessary"
:active-value=
"2"
:inactive-value=
"1"
>
</el-switch>
</el-form-item>
<el-form-item
label=
"选项"
prop=
"spec
Code
"
>
<el-form-item
label=
"选项"
prop=
"spec
Rules
"
>
<SpecsSelect
:initData=
"form.specRules"
ref=
"specsSelect"
/>
</el-form-item>
</el-form>
...
...
@@ -92,6 +96,14 @@ export default {
name
:
"Specs"
,
components
:
{
SpecsSelect
},
data
()
{
var
validateSpecRules
=
(
rule
,
value
,
callback
)
=>
{
let
SpecRulesValue
=
this
.
form
.
specRules
;
if
(
SpecRulesValue
.
length
==
0
)
{
callback
(
new
Error
(
'请添加选项'
));
}
else
{
callback
();
}
};
return
{
// 遮罩层
loading
:
true
,
...
...
@@ -125,6 +137,7 @@ export default {
name
:
[
{
required
:
true
,
message
:
"规格名称不能为空"
,
trigger
:
"blur"
},
],
specRules
:[{
required
:
true
,
validator
:
validateSpecRules
,
trigger
:
'blur'
}],
},
options
:
[{
value
:
null
,
...
...
@@ -190,6 +203,16 @@ export default {
this
.
open
=
true
;
this
.
title
=
"添加规格"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
;
getSpecs
(
id
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改规格"
;
});
},
/** 启用、禁用按钮操作 */
handleStatus
(
row
,
tag
)
{
let
mess
=
""
;
...
...
@@ -212,18 +235,6 @@ export default {
})
.
catch
(()
=>
{
});
},
/** 修改按钮操作 */
// handleUpdate(row) {
// this.reset();
// const id = row.id || this.ids;
// getSpecs(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = "修改规格";
// });
// },
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
...
...
src/views/shop/shop/index.vue
View file @
0a9a8feb
...
...
@@ -43,7 +43,7 @@
<el-table
v-loading=
"loading"
:data=
"shopList"
>
<el-table-column
label=
"店铺名称"
align=
"center"
prop=
"name"
>
<template
slot-scope=
"scope"
>
<a
@
click=
"openSet(scope.row.id)"
>
{{
scope
.
row
.
name
}}
</a>
<a
@
click=
"openSet(scope.row.id)"
style=
"color: blue"
>
{{
scope
.
row
.
name
}}
</a>
</
template
>
</el-table-column>
<el-table-column
label=
"默认店铺"
align=
"center"
prop=
"isDefault"
>
...
...
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