Showing
15 changed files
with
756 additions
and
139 deletions
1 | +<template> | ||
2 | + <Select v-model="_fieldModel" @on-change="selectChange" clearable> | ||
3 | + <Option :value="-1">全部</Option> | ||
4 | + <Option v-for="option in optionList" :value="option.brandId" :key="option.brandId"> | ||
5 | + {{option.brandName}} | ||
6 | + </Option> | ||
7 | + </Select> | ||
8 | +</template> | ||
9 | + | ||
10 | +<script> | ||
11 | + import _ from 'lodash'; | ||
12 | + import service from 'finance-service'; | ||
13 | + | ||
14 | + export default { | ||
15 | + name: 'SelectBrand', | ||
16 | + props: { | ||
17 | + fieldLabel: { | ||
18 | + type: String | ||
19 | + }, | ||
20 | + | ||
21 | + fieldModel: { | ||
22 | + type: [String, Number] | ||
23 | + }, | ||
24 | + | ||
25 | + labelSpan: { | ||
26 | + type: [String, Number], | ||
27 | + default: 6 | ||
28 | + }, | ||
29 | + | ||
30 | + fieldSpan: { | ||
31 | + type: [String, Number], | ||
32 | + default: 18 | ||
33 | + } | ||
34 | + }, | ||
35 | + data() { | ||
36 | + return { | ||
37 | + optionList: [] | ||
38 | + }; | ||
39 | + }, | ||
40 | + computed: { | ||
41 | + _fieldModel() { | ||
42 | + return this.fieldModel; | ||
43 | + } | ||
44 | + }, | ||
45 | + created() { | ||
46 | + const err_msg = '获取品牌列表失败。'; | ||
47 | + | ||
48 | + service.getBrand().then((res) => { | ||
49 | + let code = _.get(res, 'data.code'); | ||
50 | + | ||
51 | + if (code === 200) { | ||
52 | + this.optionList = res.data.data; | ||
53 | + } | ||
54 | + | ||
55 | + return this.$Message.error(err_msg); | ||
56 | + }, (error) => { | ||
57 | + this.$Message.error(error.message); | ||
58 | + }); | ||
59 | + }, | ||
60 | + methods: { | ||
61 | + selectChange(val) { | ||
62 | + this.$emit('on-change', val); | ||
63 | + } | ||
64 | + } | ||
65 | + }; | ||
66 | +</script> | ||
67 | + | ||
68 | +<style lang="scss" scoped> | ||
69 | + .field-label { | ||
70 | + line-height: 32px; | ||
71 | + } | ||
72 | +</style> |
1 | +<template> | ||
2 | + <div> | ||
3 | + <Cascader :value="value" :data="categoryList" change-on-select @on-change="selectChange"></Cascader> | ||
4 | + <slot></slot> | ||
5 | + </div> | ||
6 | +</template> | ||
7 | + | ||
8 | +<script> | ||
9 | + import _ from 'lodash'; | ||
10 | + import service from 'product-service'; | ||
11 | + | ||
12 | + export default { | ||
13 | + name: 'SelcetCategory', | ||
14 | + props: { | ||
15 | + value: { | ||
16 | + type: Array | ||
17 | + } | ||
18 | + }, | ||
19 | + data() { | ||
20 | + return { | ||
21 | + categoryList: [] | ||
22 | + }; | ||
23 | + }, | ||
24 | + created() { | ||
25 | + this.getSortInfo(1); | ||
26 | + }, | ||
27 | + methods: { | ||
28 | + getSortInfo(level, sortId) { | ||
29 | + const params = { | ||
30 | + level, | ||
31 | + sortId | ||
32 | + }; | ||
33 | + | ||
34 | + service.getAllSort(params) | ||
35 | + .then((res) => { | ||
36 | + if (res.code === 200) { | ||
37 | + _.each(res.data, item => { | ||
38 | + this.categoryList.push({ | ||
39 | + value: item.sortId, | ||
40 | + label: item.sortName, | ||
41 | + children: [{ | ||
42 | + value: -1, | ||
43 | + label: '' | ||
44 | + }] | ||
45 | + }); | ||
46 | + }); | ||
47 | + } | ||
48 | + }); | ||
49 | + }, | ||
50 | + selectChange(val) { | ||
51 | + const len = val.length; | ||
52 | + const max = val[0] || ''; | ||
53 | + const mid = val[1] || ''; | ||
54 | + const min = val[2] || ''; | ||
55 | + | ||
56 | + switch (len) { | ||
57 | + case 1: | ||
58 | + _.each(this.categoryList, item => { | ||
59 | + | ||
60 | + if (item.value !== max) { | ||
61 | + return; | ||
62 | + } | ||
63 | + | ||
64 | + this.getChildren(2, max) | ||
65 | + .then(res => { | ||
66 | + item.children.shift(); | ||
67 | + _.each(res, i => { | ||
68 | + item.children.push({ | ||
69 | + value: i.value, | ||
70 | + label: i.label, | ||
71 | + children: [{ | ||
72 | + value: -1, | ||
73 | + label: '' | ||
74 | + }] | ||
75 | + }); | ||
76 | + }); | ||
77 | + | ||
78 | + }); | ||
79 | + }); | ||
80 | + | ||
81 | + break; | ||
82 | + | ||
83 | + case 2: | ||
84 | + _.each(this.categoryList, maxItem => { | ||
85 | + if (maxItem.value !== max) { | ||
86 | + return; | ||
87 | + } | ||
88 | + | ||
89 | + _.each(maxItem.children, midItem => { | ||
90 | + if (midItem.value !== mid) { | ||
91 | + return; | ||
92 | + } | ||
93 | + | ||
94 | + this.getChildren(3, mid) | ||
95 | + .then(res => { | ||
96 | + midItem.children.shift(); | ||
97 | + _.each(res, i => { | ||
98 | + midItem.children.push({ | ||
99 | + value: i.value, | ||
100 | + label: i.label | ||
101 | + }); | ||
102 | + }); | ||
103 | + }); | ||
104 | + }); | ||
105 | + }); | ||
106 | + | ||
107 | + break; | ||
108 | + } | ||
109 | + | ||
110 | + this.$emit('select-change', { | ||
111 | + max, | ||
112 | + mid, | ||
113 | + min | ||
114 | + }); | ||
115 | + }, | ||
116 | + getChildren(level, sortId) { | ||
117 | + const params = { | ||
118 | + level, | ||
119 | + sortId | ||
120 | + }; | ||
121 | + | ||
122 | + return service.getAllSort(params) | ||
123 | + .then((res) => { | ||
124 | + let children = []; | ||
125 | + | ||
126 | + if (res.code === 200) { | ||
127 | + _.each(res.data, item => { | ||
128 | + children.push({ | ||
129 | + value: item.sortId, | ||
130 | + label: item.sortName | ||
131 | + }); | ||
132 | + }); | ||
133 | + } | ||
134 | + | ||
135 | + return children; | ||
136 | + }); | ||
137 | + } | ||
138 | + } | ||
139 | + }; | ||
140 | +</script> | ||
141 | + | ||
142 | +<style lang="scss" scoped> | ||
143 | +</style> |
1 | <template> | 1 | <template> |
2 | - 结算页 | 2 | + <LayoutBody> |
3 | + <LayoutFilter> | ||
4 | + <FilterItem label="对帐单号"> | ||
5 | + <!--<Input v-model.trim.trim=""--> | ||
6 | + <!--:placeholder=""--> | ||
7 | + <!--></Input>--> | ||
8 | + </FilterItem> | ||
9 | + <FilterItem label="供应商"> | ||
10 | + <!--<SelectBrand>--> | ||
11 | + <!--</SelectBrand>--> | ||
12 | + </FilterItem> | ||
13 | + <FilterItem label="品牌"> | ||
14 | + </FilterItem> | ||
3 | 15 | ||
4 | -</template> | 16 | + <FilterItem label="日期"> |
17 | + <Date-picker type="date" placeholder="选择日期" style="width: 180px"></Date-picker> | ||
18 | + </FilterItem> | ||
5 | 19 | ||
6 | -<script> | 20 | + <FilterItem label=""> |
21 | + <Date-picker type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 180px"></Date-picker> | ||
22 | + </FilterItem> | ||
23 | + | ||
24 | + <FilterItem> | ||
25 | + <Button type="primary" @click="filterSearch">筛选</Button> | ||
26 | + <Button @click="">导出</Button> | ||
27 | + </FilterItem> | ||
28 | + </LayoutFilter> | ||
7 | 29 | ||
8 | - import service from 'balance-service'; | 30 | + <LayoutList> |
31 | + <Table border :context="self" :columns="tableCols" :data="tableData"></Table> | ||
32 | + <!--<Page :total="" :current=""--> | ||
33 | + <!--@on-change="" :page-size="20" show-total></Page>--> | ||
34 | + </LayoutList> | ||
9 | 35 | ||
10 | - const _ = require('lodash'); | 36 | + </LayoutBody> |
37 | + | ||
38 | +</template> | ||
39 | + | ||
40 | +<script> | ||
41 | + import Vue from 'vue'; | ||
42 | + import service from 'finance-service'; | ||
43 | + import {SelectBrand, SelectCategory} from 'finance/filter-select'; | ||
44 | + import {filterFields, initialFields, tableCols, tableData} from './detail'; | ||
11 | 45 | ||
12 | export default { | 46 | export default { |
13 | - created() { | ||
14 | - }, | ||
15 | data() { | 47 | data() { |
16 | return { | 48 | return { |
17 | - | 49 | + self: this, |
50 | + tableCols, | ||
51 | + tableData, | ||
52 | + filters: '', | ||
18 | }; | 53 | }; |
19 | }, | 54 | }, |
55 | + created() { | ||
56 | + this.filters = JSON.parse(initialFields); | ||
57 | + }, | ||
20 | methods: { | 58 | methods: { |
59 | + filterParams() { | ||
60 | +// const fts = this.filters; | ||
61 | + const data = { | ||
62 | + | ||
63 | + }; | ||
64 | + | ||
65 | + return data; | ||
66 | + }, | ||
67 | + filterSearch() { | ||
68 | + const params = this.filterParams(); | ||
21 | 69 | ||
70 | + this.useFilterSign = true; | ||
71 | + this.productList(params); | ||
72 | + this.pageData.current = 1; | ||
73 | + | ||
74 | + }, | ||
75 | + productList(params) { | ||
76 | + | ||
77 | + if (_.isObject(params) && | ||
78 | + params.productSkn !== undefined && | ||
79 | + !_.isFinite(+params.productSkn)) { | ||
80 | + this.$Message.error('SKN编码只能是数字', 3); | ||
81 | + return; | ||
82 | + }; | ||
83 | + | ||
84 | + service.productList( | ||
85 | + _.merge(params || {}, { | ||
86 | + shelfStatus: 1, | ||
87 | + size: 20 | ||
88 | + })) | ||
89 | + .then(res => { | ||
90 | + if (res.code === 200) { | ||
91 | + this.updateStore(res.data); | ||
92 | + } | ||
93 | + }); | ||
94 | + } | ||
95 | + }, | ||
96 | + components: { | ||
97 | + SelectBrand, | ||
98 | + SelectCategory, | ||
22 | } | 99 | } |
23 | }; | 100 | }; |
24 | </script> | 101 | </script> |
app/pages/finance/balance/detail/index.js
0 → 100644
1 | +let filterFields = { | ||
2 | + sknCode: { | ||
3 | + label: 'SKN编码', | ||
4 | + labelSpan: 6, | ||
5 | + model: '', | ||
6 | + holder: '', | ||
7 | + fieldSpan: 18 | ||
8 | + }, | ||
9 | + prodCode: { | ||
10 | + label: '商家编码', | ||
11 | + labelSpan: 6, | ||
12 | + model: '', | ||
13 | + holder: '', | ||
14 | + fieldSpan: 18 | ||
15 | + }, | ||
16 | + prodName: { | ||
17 | + label: '商品名称', | ||
18 | + labelSpan: 6, | ||
19 | + model: '', | ||
20 | + holder: '', | ||
21 | + fieldSpan: 18 | ||
22 | + }, | ||
23 | + prodBarCode: { | ||
24 | + label: '商品条码', | ||
25 | + labelSpan: 6, | ||
26 | + model: '', | ||
27 | + holder: '', | ||
28 | + fieldSpan: 18 | ||
29 | + }, | ||
30 | + sort: { | ||
31 | + first: { | ||
32 | + label: '选择类目', | ||
33 | + holder: '选择一级类目', | ||
34 | + labelSpan: 6, | ||
35 | + fieldSpan: 18, | ||
36 | + model: '' | ||
37 | + }, | ||
38 | + second: { | ||
39 | + label: '二级类目', | ||
40 | + holder: '选择二级类目', | ||
41 | + labelSpan: 6, | ||
42 | + fieldSpan: 18, | ||
43 | + model: '' | ||
44 | + }, | ||
45 | + third: { | ||
46 | + label: '三级类目', | ||
47 | + holder: '选择三级类目', | ||
48 | + labelSpan: 6, | ||
49 | + fieldSpan: 18, | ||
50 | + model: '' | ||
51 | + } | ||
52 | + }, | ||
53 | + brand: { | ||
54 | + label: '选择品牌', | ||
55 | + labelSpan: 6, | ||
56 | + fieldSpan: 18, | ||
57 | + model: -1 | ||
58 | + }, | ||
59 | + verifyStatus: { | ||
60 | + label: '审核状态', | ||
61 | + labelSpan: 6, | ||
62 | + fieldSpan: 18, | ||
63 | + model: -1, | ||
64 | + options: [ | ||
65 | + { | ||
66 | + value: -1, | ||
67 | + label: '全部' | ||
68 | + }, | ||
69 | + { | ||
70 | + value: 1, | ||
71 | + label: '下架待审核' | ||
72 | + }, | ||
73 | + { | ||
74 | + value: 2, | ||
75 | + label: '下架驳回' | ||
76 | + } | ||
77 | + ] | ||
78 | + }, | ||
79 | + stockStatus: { | ||
80 | + label: '库存情况', | ||
81 | + labelSpan: 6, | ||
82 | + fieldSpan: 18, | ||
83 | + model: -1, | ||
84 | + options: [ | ||
85 | + { | ||
86 | + value: -1, | ||
87 | + label: '全部' | ||
88 | + }, | ||
89 | + { | ||
90 | + value: 1, | ||
91 | + label: '有库存' | ||
92 | + }, | ||
93 | + { | ||
94 | + value: 0, | ||
95 | + label: '无库存' | ||
96 | + } | ||
97 | + ] | ||
98 | + } | ||
99 | +}; | ||
100 | + | ||
101 | +let initialFields = JSON.stringify(filterFields); | ||
102 | + | ||
103 | +let tableCols = [ | ||
104 | + { | ||
105 | + title: '对账单号', | ||
106 | + key: 'image', | ||
107 | + width: 120, | ||
108 | + align: 'center', | ||
109 | + render (row, column, index) { | ||
110 | + return '<cell-image :image-src="row.picImgUrl" :product-url="row.productUrl"></cell-image>'; | ||
111 | + } | ||
112 | + }, | ||
113 | + { | ||
114 | + title: '生成日期', | ||
115 | + key: 'info', | ||
116 | + align: 'center', | ||
117 | + render(row, column, index) { | ||
118 | + return `<cell-info | ||
119 | + :skn="row.productSkn" | ||
120 | + :product-name="row.productName" | ||
121 | + :brand-name="row.brandName" | ||
122 | + :max-name="row.maxSortName" | ||
123 | + :middle-name="row.middleSortName" | ||
124 | + :small-name="row.smallSortName"> | ||
125 | + </cell-info>`; | ||
126 | + } | ||
127 | + }, | ||
128 | + { | ||
129 | + title: '结算周期', | ||
130 | + key: 'price', | ||
131 | + align: 'center', | ||
132 | + render(row, column, index) { | ||
133 | + row.lineIndex = index; | ||
134 | + return `<cell-price | ||
135 | + @click-change="editPrice(row)" | ||
136 | + @click-save="updatePrice" | ||
137 | + :can-change="true" | ||
138 | + :current-row="row" | ||
139 | + :show-change="row.changePrice" | ||
140 | + :retail-price="row.retailPrice" | ||
141 | + :sales-price="row.salesPrice"> | ||
142 | + </cell-price>`; | ||
143 | + } | ||
144 | + }, | ||
145 | + { | ||
146 | + title: '品牌', | ||
147 | + key: 'stock', | ||
148 | + width: 100, | ||
149 | + align: 'center', | ||
150 | + }, | ||
151 | + { | ||
152 | + title: '供应商', | ||
153 | + key: 'shelveTime', | ||
154 | + width: 150, | ||
155 | + align: 'center' | ||
156 | + }, | ||
157 | + { | ||
158 | + title: '结算金额', | ||
159 | + key: 'verify', | ||
160 | + align: 'center', | ||
161 | + render(row, column, index) { | ||
162 | + return `${auditStatus[row.auditStatus]}` | ||
163 | + } | ||
164 | + }, | ||
165 | + { | ||
166 | + title: '操作', | ||
167 | + key: 'action', | ||
168 | + width: 180, | ||
169 | + align: 'center', | ||
170 | + render: function(row, column, index) { | ||
171 | + return `<div class="action-btn-row"> | ||
172 | + <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button> | ||
173 | + <i-button v-if="row._disabled" type="primary" size="small" | ||
174 | + @click="editProduct(${row.productSkn})" disabled>内容编辑</i-button> | ||
175 | + <i-button v-else type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button> | ||
176 | + </div> | ||
177 | + <div class="btn-row-space"> | ||
178 | + <i-button v-if="row._disabled" type="error" size="small" | ||
179 | + @click="setOffSale(${row.productSkn})" disabled>下架</i-button> | ||
180 | + <i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button> | ||
181 | + </div>`; | ||
182 | + } | ||
183 | + } | ||
184 | +]; | ||
185 | + | ||
186 | +let tableData = []; | ||
187 | + | ||
188 | +export { | ||
189 | + filterFields, | ||
190 | + initialFields, | ||
191 | + tableCols, | ||
192 | + tableData | ||
193 | +}; |
1 | -import info from './balance'; | 1 | +import balance from './balance'; |
2 | +import store from './store'; | ||
2 | 3 | ||
3 | -let routers = [info]; | 4 | +let routers = [balance, store]; |
4 | 5 | ||
5 | routers.forEach(router => { | 6 | routers.forEach(router => { |
6 | - router.path = `/balance${router.path}`; | ||
7 | - router.name = `balance.${router.name}`; | 7 | + router.path = `/finance${router.path}`; |
8 | + router.name = `finance.${router.name}`; | ||
8 | }); | 9 | }); |
9 | 10 | ||
10 | -export default routers; | ||
11 | +export default routers; |
app/pages/finance/store/index.js
0 → 100644
app/pages/finance/store/store.vue
0 → 100644
1 | +<template> | ||
2 | + <LayoutBody> | ||
3 | + <LayoutFilter> | ||
4 | + <FilterItem label="公司"> | ||
5 | + </FilterItem> | ||
6 | + <!--<FilterItem label="品牌">--> | ||
7 | + <!--<SelectBrand>--> | ||
8 | + <!--</SelectBrand>--> | ||
9 | + <!--</FilterItem>--> | ||
10 | + | ||
11 | + <FilterItem label="日期"> | ||
12 | + <Date-picker type="date" placeholder="选择日期" style="width: 180px"></Date-picker> | ||
13 | + </FilterItem> | ||
14 | + | ||
15 | + <FilterItem label=""> | ||
16 | + <Date-picker type="date" placement="bottom-end" placeholder="选择日期" style="width: 180px"></Date-picker> | ||
17 | + </FilterItem> | ||
18 | + | ||
19 | + <FilterItem> | ||
20 | + <Button type="primary" @click="">筛选</Button> | ||
21 | + <Button @click="">打印</Button> | ||
22 | + </FilterItem> | ||
23 | + </LayoutFilter> | ||
24 | + | ||
25 | + <LayoutList> | ||
26 | + <!--<Table :columns="" :data=""></Table>--> | ||
27 | + <!--<Page :total="" :current=""--> | ||
28 | + <!--@on-change="" :page-size="20" show-total></Page>--> | ||
29 | + </LayoutList> | ||
30 | + | ||
31 | + </LayoutBody> | ||
32 | + | ||
33 | +</template> | ||
34 | + | ||
35 | +<script> | ||
36 | + import Vue from 'vue'; | ||
37 | + import service from 'finance-service'; | ||
38 | + | ||
39 | + export default { | ||
40 | + data() { | ||
41 | + return { | ||
42 | + | ||
43 | + }; | ||
44 | + }, | ||
45 | + created() { | ||
46 | + }, | ||
47 | + methods: { | ||
48 | + } | ||
49 | + }; | ||
50 | +</script> | ||
51 | + | ||
52 | +<style lang="scss" scoped> | ||
53 | + | ||
54 | + | ||
55 | +</style> |
@@ -4,8 +4,9 @@ import product from './product'; | @@ -4,8 +4,9 @@ import product from './product'; | ||
4 | import shop from './shop'; | 4 | import shop from './shop'; |
5 | import repository from './repository'; | 5 | import repository from './repository'; |
6 | import statistics from './statistics'; | 6 | import statistics from './statistics'; |
7 | +import finance from './finance'; | ||
7 | 8 | ||
8 | -let routers = [product, home, shop, repository, statistics]; | 9 | +let routers = [product, home, shop, repository, statistics, finance]; |
9 | 10 | ||
10 | let childrenRoutes = [].concat(...routers); | 11 | let childrenRoutes = [].concat(...routers); |
11 | 12 |
1 | <template> | 1 | <template> |
2 | - <Form :label-width="100"> | ||
3 | - <Form-item label="店铺名称:"> | ||
4 | - <span>{{}}</span> | ||
5 | - </Form-item> | ||
6 | - <Form-item label="店铺类型:"> | ||
7 | - <span>{{}}</span> | ||
8 | - </Form-item> | ||
9 | - <Form-item label="店铺域名:"> | ||
10 | - <span>{{}}</span> | ||
11 | - </Form-item> | ||
12 | - <Form-item label="店铺LOGO:"> | ||
13 | - <div class="upload-item"> | ||
14 | - <div class="upload-item-img"> | ||
15 | - <drag-file-upload | ||
16 | - :id="{goodIndex:1, imageIndex: 1}" | ||
17 | - @on-success="uploadImageSuccess" | ||
18 | - @on-remove="uploadImageRemove"> | ||
19 | - </drag-file-upload> | 2 | + <LayoutBody> |
3 | + <Form :label-width="100"> | ||
4 | + <Form-item label="店铺名称:"> | ||
5 | + <span>{{shopData.shopName}}</span> | ||
6 | + </Form-item> | ||
7 | + <Form-item label="店铺类型:"> | ||
8 | + <span>{{SHOPNATURE[shopData.shopNature]}}</span> | ||
9 | + </Form-item> | ||
10 | + <Form-item label="店铺域名:"> | ||
11 | + <span>{{shopData.shopDomain}}</span> | ||
12 | + </Form-item> | ||
13 | + <Form-item label="店铺LOGO:"> | ||
14 | + <div class="upload-item"> | ||
15 | + <div class="upload-item-img"> | ||
16 | + <drag-file-upload | ||
17 | + :default-file="shopData.shopLogo" | ||
18 | + :id="{goodIndex:1, imageIndex: 1}" | ||
19 | + @on-success="uploadImageSuccess" | ||
20 | + @on-remove="uploadImageRemove"> | ||
21 | + </drag-file-upload> | ||
22 | + </div> | ||
20 | </div> | 23 | </div> |
21 | - </div> | ||
22 | - <em class="upload-img-tip">尺寸要求150px*150px 不大于500KB</em> | ||
23 | - </Form-item> | ||
24 | - <Form-item label="店铺简介:"> | ||
25 | - <editor :content="content" @change="updateData"></editor> | ||
26 | - </Form-item> | ||
27 | - <Form-item label="品牌-供应商:"> | ||
28 | - <Table :columns="columns1" :data="data1"></Table> | ||
29 | - </Form-item> | ||
30 | - <Form-item> | ||
31 | - <Button type="primary" @click="submit">提交</Button> | ||
32 | - </Form-item> | ||
33 | - </Form> | ||
34 | - | 24 | + <em class="upload-img-tip">尺寸要求150px*150px 不大于500KB</em> |
25 | + </Form-item> | ||
26 | + <Form-item label="店铺简介:"> | ||
27 | + <editor :content="shopData.shopIntro" @change="updateData"></editor> | ||
28 | + </Form-item> | ||
29 | + <Form-item label="品牌-供应商:"> | ||
30 | + <Table :columns="tableCols" :data="tableData"></Table> | ||
31 | + </Form-item> | ||
32 | + <Form-item> | ||
33 | + <Button type="primary" @click="submit">提交</Button> | ||
34 | + </Form-item> | ||
35 | + </Form> | ||
36 | + </LayoutBody> | ||
35 | </template> | 37 | </template> |
36 | 38 | ||
37 | <script> | 39 | <script> |
38 | 40 | ||
39 | -import service from 'shop-service'; | 41 | + import service from 'shop-service'; |
40 | 42 | ||
41 | -const _ = require('lodash'); | 43 | + const _ = require('lodash'); |
42 | 44 | ||
43 | -const makeSubmitShop = () => { | ||
44 | - return { | 45 | + const SHOPNATURE = { |
46 | + 1: '旗舰店', | ||
47 | + 2: '专卖店', | ||
48 | + 3: '初始状态(异常情况)' | ||
45 | }; | 49 | }; |
46 | -}; | ||
47 | - | ||
48 | -export default { | ||
49 | - created() { | ||
50 | - }, | ||
51 | - data() { | ||
52 | - return { | ||
53 | - //店铺简介 | ||
54 | - content: '', | ||
55 | - | ||
56 | - //供应商 | ||
57 | - columns1: [ | ||
58 | - { | ||
59 | - title: '品牌', | ||
60 | - key: 'coupon' | ||
61 | - }, | ||
62 | - { | ||
63 | - title: '供应商', | ||
64 | - key: 'supplier' | ||
65 | - } | ||
66 | - ], | ||
67 | - data1: [ | ||
68 | - { | ||
69 | - coupon: 'hahahah', | ||
70 | - supplier: 'hhhhhhhh' | ||
71 | - } | ||
72 | - ] | ||
73 | - }; | ||
74 | - }, | ||
75 | - methods: { | ||
76 | - updateData(c) { | ||
77 | - this.content = c; | ||
78 | - }, | ||
79 | 50 | ||
80 | - //上传图片 | ||
81 | - uploadImageSuccess: function(attach, file) { | ||
82 | - let colorIndex = attach.goodIndex; | ||
83 | - let imageIndex = attach.imageIndex; | 51 | + export default { |
52 | + created() { | ||
53 | + service.getShop().then((res) => { | ||
84 | 54 | ||
85 | - this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = file.url; | ||
86 | - }, | ||
87 | - uploadImageRemove: function(attach) { | ||
88 | - let colorIndex = attach.goodIndex; | ||
89 | - let imageIndex = attach.imageIndex; | 55 | + this.shopData = res.data; |
56 | + this.tableData = JSON.parse(res.data.shopRelationList); | ||
90 | 57 | ||
91 | - this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = ''; | 58 | +// console.log(res); |
59 | + console.log(res.data.shopLogo); | ||
60 | + }, (error) => { | ||
61 | + this.$Message.error(error.message); | ||
62 | + }); | ||
63 | + }, | ||
64 | + data() { | ||
65 | + return { | ||
66 | + SHOPNATURE, | ||
67 | + shopData: {}, | ||
68 | + tableCols: [ | ||
69 | + { | ||
70 | + title: '品牌', | ||
71 | + key: 'brandName', | ||
72 | + align: 'center', | ||
73 | + }, | ||
74 | + { | ||
75 | + title: '供应商', | ||
76 | + key: 'supplierName', | ||
77 | + width: 300, | ||
78 | + align: 'center' | ||
79 | + } | ||
80 | + ], | ||
81 | + tableData: [] | ||
82 | + }; | ||
92 | }, | 83 | }, |
84 | + methods: { | ||
85 | + updateData(c) { | ||
86 | + this.content = c; | ||
87 | + }, | ||
93 | 88 | ||
94 | - //提交 | ||
95 | - beforeSubmit: function() { | ||
96 | - let newShop = makeSubmitShop(); | 89 | + //上传图片 |
90 | + uploadImageSuccess: function (attach, file) { | ||
91 | + let colorIndex = attach.goodIndex; | ||
92 | + let imageIndex = attach.imageIndex; | ||
93 | + | ||
94 | + this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = file.url; | ||
95 | + }, | ||
96 | + uploadImageRemove: function (attach) { | ||
97 | + let colorIndex = attach.goodIndex; | ||
98 | + let imageIndex = attach.imageIndex; | ||
99 | + | ||
100 | + this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = ''; | ||
101 | + }, | ||
102 | + | ||
103 | + //提交 | ||
104 | + beforeSubmit: function () { | ||
97 | 105 | ||
98 | // newShop.expectSaleTimeStr = this.product.expectSaleTimeStr; | 106 | // newShop.expectSaleTimeStr = this.product.expectSaleTimeStr; |
99 | // | 107 | // |
100 | // newShop.sellerGoodsInfoStr = JSON.stringify(this.handleColor()); | 108 | // newShop.sellerGoodsInfoStr = JSON.stringify(this.handleColor()); |
101 | 109 | ||
102 | - return newShop; | ||
103 | - }, | ||
104 | - submit: function() { | ||
105 | - let newShop = this.beforeSubmit(); | ||
106 | - | ||
107 | - this.$Loading.start(); | ||
108 | - service.saveBaseShopInfo(newShop).then((result) => { | ||
109 | - this.$Loading.finish(); | ||
110 | - | ||
111 | - if (result.code === 200) { | ||
112 | - this.$Notice.success({ | ||
113 | - title: '修改成功', | ||
114 | - desc: '该店铺保存成功!' | ||
115 | - }); | ||
116 | - | ||
117 | - this.$router.push({name: 'shop'}); | ||
118 | - } else { | ||
119 | - this.$Notice.error({ | ||
120 | - title: '保存错误', | ||
121 | - desc: result.message | ||
122 | - }); | ||
123 | - | ||
124 | - } | ||
125 | - }); | ||
126 | - } | 110 | + }, |
111 | + submit: function () { | ||
112 | + let newShop = this.beforeSubmit(); | ||
127 | 113 | ||
128 | - } | ||
129 | -}; | 114 | + this.$Loading.start(); |
115 | + service.saveBaseShopInfo(newShop).then((result) => { | ||
116 | + this.$Loading.finish(); | ||
117 | + | ||
118 | + if (result.code === 200) { | ||
119 | + this.$Notice.success({ | ||
120 | + title: '修改成功', | ||
121 | + desc: '该店铺保存成功!' | ||
122 | + }); | ||
123 | + | ||
124 | + this.$router.push({name: 'shop'}); | ||
125 | + } else { | ||
126 | + this.$Notice.error({ | ||
127 | + title: '保存错误', | ||
128 | + desc: result.message | ||
129 | + }); | ||
130 | + | ||
131 | + } | ||
132 | + }); | ||
133 | + } | ||
134 | + | ||
135 | + } | ||
136 | + }; | ||
130 | </script> | 137 | </script> |
131 | 138 | ||
132 | -<style lang="scss" scoped> | 139 | +<style lang="scss"> |
133 | 140 | ||
134 | .upload-item { | 141 | .upload-item { |
135 | float: left; | 142 | float: left; |
@@ -87,5 +87,27 @@ export default [ | @@ -87,5 +87,27 @@ export default [ | ||
87 | menu_id: 'statistics', | 87 | menu_id: 'statistics', |
88 | status: 1, | 88 | status: 1, |
89 | id: 4 | 89 | id: 4 |
90 | + }, | ||
91 | + { | ||
92 | + sub: [ | ||
93 | + { | ||
94 | + menu_name: '查看明细', | ||
95 | + menu_url: '/finance/balance.html', | ||
96 | + menu_id: 'finance.balance', | ||
97 | + status: 1, | ||
98 | + id: 51 | ||
99 | + }, | ||
100 | + { | ||
101 | + menu_name: '库存', | ||
102 | + menu_url: '/finance/store.html', | ||
103 | + menu_id: 'finance.store', | ||
104 | + status: 1, | ||
105 | + id: 52 | ||
106 | + } | ||
107 | + ], | ||
108 | + menu_name: '财务管理', | ||
109 | + menu_id: 'finance', | ||
110 | + status: 1, | ||
111 | + id: 5 | ||
90 | } | 112 | } |
91 | ]; | 113 | ]; |
app/services/balance-service.js
deleted
100644 → 0
app/services/finance-service.js
0 → 100644
1 | +// import _ from 'lodash'; | ||
2 | +import axios from 'axios'; | ||
3 | + | ||
4 | +const apiUrl = { | ||
5 | + productList: '/platform/querySellerProductList' | ||
6 | +}; | ||
7 | + | ||
8 | +const balanceService = { | ||
9 | + productList(params) { | ||
10 | + return axios.get(apiUrl.productList, { | ||
11 | + params | ||
12 | + }) | ||
13 | + .then(res => { | ||
14 | + if (res.status === 200) { | ||
15 | + return res.data; | ||
16 | + } | ||
17 | + | ||
18 | + return {}; | ||
19 | + }); | ||
20 | + } | ||
21 | +}; | ||
22 | + | ||
23 | +export default balanceService; |
1 | -import _ from 'lodash'; | 1 | +// import _ from 'lodash'; |
2 | import axios from 'axios'; | 2 | import axios from 'axios'; |
3 | 3 | ||
4 | -const apiUrl = { | ||
5 | - shop: 'shop/info/detail', | ||
6 | -}; | ||
7 | - | ||
8 | const shopService = { | 4 | const shopService = { |
5 | + | ||
6 | + getShop(params) { | ||
7 | + return axios.get('/platform/getShopDetailById', { | ||
8 | + params | ||
9 | + }) | ||
10 | + .then(res => { | ||
11 | + if (res.status === 200) { | ||
12 | + return res.data; | ||
13 | + } | ||
14 | + | ||
15 | + return {}; | ||
16 | + }); | ||
17 | + }, | ||
18 | + | ||
9 | /** | 19 | /** |
10 | * 保存店铺基本信息 | 20 | * 保存店铺基本信息 |
11 | * @param shop | 21 | * @param shop |
12 | */ | 22 | */ |
13 | saveBaseShopInfo(shop) { | 23 | saveBaseShopInfo(shop) { |
14 | - return axios.post(apiUrl.shop, shop) | 24 | + return axios.post('/platform/getShopDetailById', shop) |
15 | .then(result => result.data); | 25 | .then(result => result.data); |
26 | + | ||
16 | } | 27 | } |
28 | + | ||
17 | }; | 29 | }; |
18 | 30 | ||
19 | export default shopService; | 31 | export default shopService; |
@@ -26,7 +26,8 @@ let domainApis = { | @@ -26,7 +26,8 @@ let domainApis = { | ||
26 | exportSellerProductList: '/SellerProductController/exportSellerProductList', | 26 | exportSellerProductList: '/SellerProductController/exportSellerProductList', |
27 | updateSellerPrice: '/SellerPriceController/updateSellerPrice', | 27 | updateSellerPrice: '/SellerPriceController/updateSellerPrice', |
28 | updateProduct: '/SellerProductController/updateProduct', | 28 | updateProduct: '/SellerProductController/updateProduct', |
29 | - getProduct: '/SellerProductController/getProduct' | 29 | + getProduct: '/SellerProductController/getProduct', |
30 | + getShopDetailById: '/SellerShopController/getShopDetailById' | ||
30 | }, | 31 | }, |
31 | shop: { | 32 | shop: { |
32 | login: '/login' | 33 | login: '/login' |
-
Please register or login to post a comment