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
ee955bab
Commit
ee955bab
authored
Aug 21, 2022
by
赵永成
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec
parent
670c4d03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
10 deletions
+102
-10
src/views/goods/goods/components/SpecSetting.vue
+2
-0
src/views/goods/goods/components/Specification.vue
+92
-3
src/views/goods/goods/index.vue
+8
-7
No files found.
src/views/goods/goods/components/SpecSetting.vue
View file @
ee955bab
...
@@ -114,6 +114,8 @@ export default {
...
@@ -114,6 +114,8 @@ export default {
t_skuList
.
push
(
skuObj
);
t_skuList
.
push
(
skuObj
);
}
}
this
.
skuList
=
t_skuList
;
this
.
skuList
=
t_skuList
;
}).
catch
((
res
)
=>
{
console
.
log
(
"getSkuByGoodsId 123"
,
res
);
});
});
console
.
log
(
"333 "
);
console
.
log
(
"333 "
);
console
.
log
(
"this.skuList "
,
this
.
skuList
);
console
.
log
(
"this.skuList "
,
this
.
skuList
);
...
...
src/views/goods/goods/components/Specification.vue
View file @
ee955bab
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
v-if=
"spec_ShowBtn('set_sku',scope.row)"
@
click=
"specal_set(scope.
$index,scope.row,'view_step'
)"
type=
"text"
size=
"small"
>
配置制作步骤
</el-button>
<el-button
v-if=
"spec_ShowBtn('set_sku',scope.row)"
@
click=
"specal_set(scope.
row
)"
type=
"text"
size=
"small"
>
配置制作步骤
</el-button>
<el-button
v-if=
"spec_ShowBtn('del_sku',scope.row)"
@
click
.
native
.
prevent=
"sku_del(scope.row)"
type=
"text"
size=
"small"
>
删除当前sku
</el-button>
<el-button
v-if=
"spec_ShowBtn('del_sku',scope.row)"
@
click
.
native
.
prevent=
"sku_del(scope.row)"
type=
"text"
size=
"small"
>
删除当前sku
</el-button>
<el-button
v-if=
"spec_ShowBtn('rec_sku',scope.row)"
@
click
.
native
.
prevent=
"sku_rec(scope.row)"
type=
"text"
size=
"small"
>
恢复当前sku
</el-button>
<el-button
v-if=
"spec_ShowBtn('rec_sku',scope.row)"
@
click
.
native
.
prevent=
"sku_rec(scope.row)"
type=
"text"
size=
"small"
>
恢复当前sku
</el-button>
</
template
>
</
template
>
...
@@ -36,12 +36,15 @@
...
@@ -36,12 +36,15 @@
<el-button
type=
"primary"
@
click=
"closeSpecial('confim');"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"closeSpecial('confim');"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<SpecSetting
ref=
"SpecSetting"
></SpecSetting>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
list_machine_model
,
list_step
,
add_spec_step
,
list_data_spec_step
,
del_spec_step
,
list_sku_byGoodsId
,
del_sku_bySkuId
,
rec_sku_bySkuId
}
from
"@/api/system/specification.js"
;
import
{
list_machine_model
,
list_step
,
add_spec_step
,
list_data_spec_step
,
del_spec_step
,
list_sku_byGoodsId
,
del_sku_bySkuId
,
rec_sku_bySkuId
}
from
"@/api/system/specification.js"
;
import
{
stringify
}
from
"querystring"
;
import
SpecSetting
from
'./SpecSetting.vue'
;
export
default
{
export
default
{
components
:
{
SpecSetting
},
props
:
{
props
:
{
},
},
data
()
{
data
()
{
...
@@ -154,6 +157,86 @@ export default {
...
@@ -154,6 +157,86 @@ export default {
t_special_tb_data
.
push
(
sku_spec_model
);
t_special_tb_data
.
push
(
sku_spec_model
);
}
}
}
}
this
.
special_tb_data
=
t_special_tb_data
;
console
.
log
(
"this.special_tb_data "
,
this
.
special_tb_data
);
console
.
log
(
"666 "
);
//回显历史数据
//this.get_step_data();
//显示窗体
this
.
open
=
isShow
},
/**打开规格详情配置,并初始化显示内容 */
async
showSpecial_bak
(
isShow
,
p_goods
){
console
.
log
(
"111 "
);
/** 根据商品获取sku list; 按原型组装数据*/
await
this
.
getSkuByGoodsId
(
this
.
goods
.
id
).
then
((
res
)
=>
{
console
.
log
(
"getSkuByGoodsId response 123"
,
res
);
let
t_skuList
=
[];
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
){
let
sku
=
res
.
data
[
i
];
//现在的sku状态字段为isDeleted 有两个值:0-未删除 1-已删除,2-手动删除
//如果状态是(1-已删除)的这里暂不显示
if
(
sku
.
isDeleted
==
1
)
continue
;
let
skuObj_ary
=
[];
let
ruleList
=
JSON
.
parse
(
sku
.
ruleList
);
for
(
let
j
=
0
;
j
<
ruleList
.
length
;
j
++
){
let
sku_spec_Obj
=
{};
let
rule
=
ruleList
[
j
];
let
specName
=
this
.
findSpecNameById
(
rule
.
specId
);
let
spec_RuleName
=
rule
.
name
;
sku_spec_Obj
.
specName
=
specName
;
sku_spec_Obj
.
spec_RuleName
=
spec_RuleName
;
skuObj_ary
.
push
(
sku_spec_Obj
);
}
let
skuObj
=
{};
skuObj
.
sku_id
=
sku
.
id
;
skuObj
.
isDeleted
=
sku
.
isDeleted
;
skuObj
.
skuAry
=
skuObj_ary
;
t_skuList
.
push
(
skuObj
);
}
this
.
skuList
=
t_skuList
;
});
console
.
log
(
"333 "
);
console
.
log
(
"this.skuList "
,
this
.
skuList
);
console
.
log
(
"mach_model_list "
,
this
.
mach_model_list
);
// sku,和机器型号可能的数据放到一个数组里,后续只循环一个数组即可,也为方法抽取提供条件;
let
t_special_tb_data
=
[]
for
(
let
i
=
0
;
i
<
this
.
skuList
.
length
;
i
++
){
let
skuObj
=
this
.
skuList
[
i
];
for
(
let
j
=
0
;
j
<
this
.
mach_model_list
.
length
;
j
++
){
let
mach_mode
=
this
.
mach_model_list
[
j
];
let
tb_data_item
=
{};
tb_data_item
.
mach_mode
=
mach_mode
;
tb_data_item
.
sku
=
skuObj
;
let
strName
=
this
.
buildSkuSpecName
(
skuObj
.
skuAry
);
let
sku_spec_model
=
{
"goods_code"
:
p_goods
.
code
,
"goods_name"
:
p_goods
.
name
,
"sku_id"
:
skuObj
.
sku_id
,
"sku_spec_name"
:
strName
,
"model_name"
:
mach_mode
.
model_name
,
"model_id"
:
mach_mode
.
id
,
"sku_isDeleted"
:
skuObj
.
isDeleted
,
"tb_steps"
:[{
"step_lab"
:
"步骤1"
,
"step_akv"
:[]
}],
"step_opts"
:[]
}
sku_spec_model
.
mach_mode
=
mach_mode
;
sku_spec_model
.
sku
=
skuObj
;
t_special_tb_data
.
push
(
sku_spec_model
);
}
}
...
@@ -433,7 +516,13 @@ export default {
...
@@ -433,7 +516,13 @@ export default {
return
cat
return
cat
})
})
},
},
specal_set
(){
specal_set
(
skuRow
){
console
.
log
(
"specal_set skuRow"
,
skuRow
);
this
.
$refs
.
SpecSetting
.
setSpecGoods
(
this
.
goods
);
this
.
$refs
[
'SpecSetting'
].
showSpecial
(
true
,
this
.
goods
);
//this.$parent.setGoodsConfig_skuStep(this.goods);
},
},
/**删除sku*/
/**删除sku*/
...
...
src/views/goods/goods/index.vue
View file @
ee955bab
...
@@ -89,6 +89,7 @@
...
@@ -89,6 +89,7 @@
@
pagination=
"getList"
/>
@
pagination=
"getList"
/>
<Form
ref=
"Form"
:getList=
"getList"
/>
<Form
ref=
"Form"
:getList=
"getList"
/>
<Specification
ref=
"Specification"
></Specification>
<Specification
ref=
"Specification"
></Specification>
<!-- <SpecSetting ref="SpecSetting"></SpecSetting> -->
</div>
</div>
</template>
</template>
...
@@ -99,9 +100,11 @@ import Form from "./components/Form.vue";
...
@@ -99,9 +100,11 @@ import Form from "./components/Form.vue";
import
SelectCategory
from
"@/components/SelectCategory"
;
import
SelectCategory
from
"@/components/SelectCategory"
;
import
SpecsSelect
from
'../spec/SpecsSelect.vue'
;
import
SpecsSelect
from
'../spec/SpecsSelect.vue'
;
import
Specification
from
'./components/Specification.vue'
;
import
Specification
from
'./components/Specification.vue'
;
import
SpecSetting
from
'./components/SpecSetting.vue'
;
export
default
{
export
default
{
name
:
"Spu"
,
name
:
"Spu"
,
components
:
{
Form
,
PutShopOffShop
,
SelectCategory
,
SpecsSelect
,
Specification
},
components
:
{
Form
,
PutShopOffShop
,
SelectCategory
,
SpecsSelect
,
Specification
},
// components: { Form, PutShopOffShop ,SelectCategory, SpecsSelect,Specification,SpecSetting},
data
()
{
data
()
{
return
{
return
{
// 遮罩层
// 遮罩层
...
@@ -250,15 +253,13 @@ export default {
...
@@ -250,15 +253,13 @@ export default {
})
})
},
},
setGoodsConfig
(
prow
){
setGoodsConfig
(
prow
){
this
.
$refs
.
Specification
.
setSpecGoods
(
prow
);
this
.
$refs
.
Specification
.
setSpecGoods
(
prow
);
this
.
$refs
.
Specification
.
showSpecial
(
true
,
prow
)
this
.
$refs
.
Specification
.
showSpecial
(
true
,
prow
)
},
// setGoodsConfig_skuStep(skuRow){
// this.$refs.SpecSetting.setSpecGoods(skuRow);
}
// this.$refs['SpecSetting'].showSpecial(true,skuRow);
// }
},
},
};
};
</
script
>
</
script
>
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