|
@@ -2,8 +2,15 @@
|
|
|
<div id="spec">
|
|
|
<template v-if="view === 'list'">
|
|
|
<el-row>
|
|
|
- <el-col :span="24" style="padding: 10px">
|
|
|
- <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-button size="mini" type="primary" @click="toBack()">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
+ <el-breadcrumb-item v-for="(item, index) in data" :key="index">{{ item.name }}</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<data-search :fields="searchFields" v-model="searchInfo" @query="search">
|
|
@@ -44,6 +51,7 @@ const _ = require('lodash');
|
|
|
import methodUtil from '@/util/opera';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions } = createNamespacedHelpers('goodsSpec');
|
|
|
+const { mapActions: goods } = createNamespacedHelpers('goods');
|
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
|
export default {
|
|
|
name: 'spec',
|
|
@@ -106,6 +114,8 @@ export default {
|
|
|
statusList: [],
|
|
|
// 是否可以团购
|
|
|
tfList: [],
|
|
|
+
|
|
|
+ data: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -118,16 +128,27 @@ export default {
|
|
|
this.defaultSearch.goods = this.goods;
|
|
|
this.searchOthers();
|
|
|
this.search();
|
|
|
+ this.toData();
|
|
|
},
|
|
|
methods: {
|
|
|
...dictData({ getDict: 'query' }),
|
|
|
...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
|
|
|
+ ...goods({ goodsFetch: 'fetch' }),
|
|
|
...methodUtil,
|
|
|
// 添加自定义
|
|
|
initAddData() {
|
|
|
const obj = { goods: this.goods, status: '0', can_group: '1', freight: 0 };
|
|
|
this.$set(this, 'form', obj);
|
|
|
},
|
|
|
+ async toData(row) {
|
|
|
+ let data = this.data;
|
|
|
+ let res = await this.goodsFetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ data.push(res.data);
|
|
|
+ console.log(data);
|
|
|
+ }
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
// 复制
|
|
|
async toCopy({ data }) {
|
|
|
this.$confirm('是否确认复制该商品?', '提示', {
|
|
@@ -180,6 +201,7 @@ export default {
|
|
|
},
|
|
|
// 返回
|
|
|
toBack() {
|
|
|
+ this.data.pop();
|
|
|
window.history.go('-1');
|
|
|
},
|
|
|
// 返回列表
|
|
@@ -200,7 +222,20 @@ export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.btn {
|
|
|
+ margin: 10px 10px 20px 10px;
|
|
|
+ .el-breadcrumb {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|