소스 검색

批发 电脑端 初始

shish 5 년 전
부모
커밋
529c1cd948
2개의 변경된 파일47개의 추가작업 그리고 314개의 파일을 삭제
  1. 35 299
      ghs/src/views/shop/list.vue
  2. 12 15
      ghs/src/views/staff/list.vue

+ 35 - 299
ghs/src/views/shop/list.vue

@@ -1,26 +1,22 @@
 <template>
 <template>
 	<div class="shop-list">
 	<div class="shop-list">
 		<x-crud @load="onLoad">
 		<x-crud @load="onLoad">
-			<template #slot-top-add>
-				<el-button size="mini" @click="shopAdd">添加门店</el-button>
-			</template>
 		</x-crud>
 		</x-crud>
 	</div>
 	</div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { imgHostUrl } from '@/config/env';
 import { mapGetters } from 'vuex';
 import { mapGetters } from 'vuex';
 
 
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
-			crud: null
+			crud: null,
 		};
 		};
 	},
 	},
 
 
 	computed: {
 	computed: {
-		...mapGetters(['shopInfo'])
+		...mapGetters(['shopInfo']),
 	},
 	},
 
 
 	methods: {
 	methods: {
@@ -28,39 +24,17 @@ export default {
 			this.crud = app;
 			this.crud = app;
 
 
 			ctx.service({
 			ctx.service({
-				page: params => {
-					return this.$service.shop.list(params).then(res => {
+				page: (params) => {
+					return this.$service.shop.list(params).then((res) => {
 						return {
 						return {
 							list: res.list,
 							list: res.list,
 							pagination: {
 							pagination: {
 								page: params.page,
 								page: params.page,
 								size: 20,
 								size: 20,
-								total: 0
-							}
+								total: 0,
+							},
 						};
 						};
 					});
 					});
-				},
-
-				add: params => {
-					return this.$service.shop.add({
-						...params,
-						openTime: params.openTime.join('-')
-					});
-				},
-
-				update: params => {
-					this.$message.error('开发中,请在手机端修改...');
-					return false;
-					return this.$service.shop.update({
-						...params,
-						openTime: params.openTime.join('-')
-					});
-				},
-
-				delete: params => {
-					return this.$service.shop.delete({
-						id: params.ids
-					});
 				}
 				}
 			})
 			})
 				.set('table', {
 				.set('table', {
@@ -68,307 +42,69 @@ export default {
 						{
 						{
 							label: 'ID',
 							label: 'ID',
 							prop: 'id',
 							prop: 'id',
-							align: 'center'
+							align: 'center',
 						},
 						},
 						{
 						{
 							label: '名称',
 							label: '名称',
 							prop: 'shopName',
 							prop: 'shopName',
-							align: 'center'
+							align: 'center',
 						},
 						},
 						{
 						{
 							label: '营业时间',
 							label: '营业时间',
 							prop: 'openTime',
 							prop: 'openTime',
-							align: 'center'
+							align: 'center',
 						},
 						},
 						{
 						{
 							label: '联系电话',
 							label: '联系电话',
 							prop: 'telephone',
 							prop: 'telephone',
-							align: 'center'
+							align: 'center',
 						},
 						},
 						{
 						{
 							label: '累计收入',
 							label: '累计收入',
 							prop: 'totalIncome',
 							prop: 'totalIncome',
-							align: 'center'
+							align: 'center',
 						},
 						},
 						{
 						{
 							label: '地址',
 							label: '地址',
 							prop: 'fullAddress',
 							prop: 'fullAddress',
-							align: 'center'
-						}
-					]
-				})
-				.set('upsert', {
-					items: [
-						{
-							label: '门店名称',
-							prop: 'shopName',
-							component: {
-								name: 'el-input'
-							},
-							rules: {
-								required: true,
-								message: '门店名称不能为空'
-							}
-						},
-						{
-							label: '营业时间',
-							prop: 'openTime',
-							value: ['08:00', '22:00'],
-							component: {
-								name: 'el-time-picker',
-								props: {
-									'is-range': true,
-									'arrow-control': true,
-									'value-format': 'HH:mm'
-								}
-							},
-							rules: {
-								required: true,
-								message: '营业时间不能为空'
-							}
-						},
-						{
-							label: '联系电话',
-							prop: 'telephone',
-							component: {
-								name: 'el-input',
-								attrs: {
-									placeholder: '联系电话'
-								}
-							},
-							rules: {
-								required: true,
-								message: '联系电话不能为空'
-							}
-						},
-						{
-							label: '所在城市',
-							prop: 'provinceCity',
-							component: {
-								name: 'shop-city',
-
-								attrs: {
-									options: []
-								},
-
-								props: {
-									value: null,
-									options: Array
-								},
-
-								data() {
-									return {
-										value2: this.value
-									};
-								},
-
-								watch: {
-									value(v) {
-										this.value2 = v;
-									}
-								},
-
-								methods: {
-									change([p, c, a]) {
-										app.setForm('province', p);
-										app.setForm('city', c);
-										app.setForm('lat', '');
-										app.setForm('long', '');
-										app.setForm('address', '');
-									}
-								},
-
-								render() {
-									return (
-										<el-cascader
-											v-model={this.value2}
-											on-change={this.change}
-											options={this.options}
-											{...{
-												props: {
-													props: {
-														label: 'name',
-														value: 'name',
-														children: 'children'
-													}
-												}
-											}}></el-cascader>
-									);
-								}
-							},
-							rules: {
-								required: true,
-								validator: (rule, value, callback) => {
-									const { province, city } = app.getForm();
-									if (!province || !city) {
-										return callback(new Error('所在城市不能为空'));
-									}
-
-									callback();
-								}
-							}
-						},
-						{
-							label: '地址',
-							prop: 'address',
-							component: {
-								name: 'shop-address',
-
-								props: {
-									value: null
-								},
-
-								data() {
-									return {
-										value2: this.value
-									};
-								},
-
-								watch: {
-									value(v) {
-										this.value2 = v;
-									}
-								},
-
-								methods: {
-									querySearchAsync(qs, cb) {
-										if (!app.getForm('city')) {
-											this.$message.error('请先选择城市');
-											cb([]);
-											return false;
-										}
-										if (!qs) {
-											cb([]);
-											return false;
-										}
-
-										this.$service.single
-											.mapSuggestion({
-												region: app.getForm('city'),
-												keyword: qs
-											})
-											.then(res => {
-												let newArr = res.data;
-												newArr = newArr.map(e => {
-													e.value = e.address;
-													return e;
-												});
-												cb(newArr);
-											});
-									},
-
-									select(item) {
-										app.setForm('lat', item.location.lat);
-										app.setForm('long', item.location.lng);
-
-										this.$emit('input', item.address);
-									}
-								},
-
-								render() {
-									return (
-										<el-autocomplete
-											v-model={this.value2}
-											fetch-suggestions={this.querySearchAsync}
-											on-select={this.select}></el-autocomplete>
-									);
-								}
-							},
-							rules: {
-								required: true,
-								message: '地址不能为空'
-							}
+							align: 'center',
 						},
 						},
-						{
-							label: '门牌号',
-							prop: 'floor',
-							component: {
-								name: 'el-input',
-								attrs: {
-									placeholder: '请填写楼号门牌号'
-								}
-							}
+					],
+					//操作列
+					op: {
+						visible: true, // 是否显示
+						props: {
+							width: 250,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
 						},
 						},
-						{
-							label: '简介',
-							prop: '',
-							component: {
-								name: 'el-input',
-								props: {
-									type: 'textarea'
-								},
-								attrs: {
-									rows: 4
-								}
-							}
-						}
-					]
+						layout: []
+					}
 				})
 				})
-				.set('layout', [['flex1', 'slot-top-add', 'refresh-btn'], ['data-table']])
+				.set('layout', [
+					[
+						'flex1',
+						//'slot-top-add',
+						'refresh-btn',
+					],
+					[
+						'data-table'
+						],
+				])
 				.on('info', (data, { done }) => {
 				.on('info', (data, { done }) => {
 					console.log(data);
 					console.log(data);
 					done({
 					done({
 						...data,
 						...data,
 						openTime: data.openTime.split('-'),
 						openTime: data.openTime.split('-'),
-						provinceCity: [data.province, data.city]
+						provinceCity: [data.province, data.city],
 					});
 					});
 				})
 				})
 				.done();
 				.done();
 
 
 			app.refresh();
 			app.refresh();
-			this.getCityData();
-		},
-
-		getCityData() {
-			this.$service.order.orderRelate().then(res => {
-				let region = res.region;
-
-				let newRegion = [];
-				if (region.length > 0) {
-					for (let i in region) {
-						newRegion.push({
-							id: region[i].id,
-							name: region[i].name,
-							children: []
-						});
-						if (region[i].children && region[i].children.length > 0) {
-							for (let j in region[i].children) {
-								newRegion[i].children.push({
-									id: region[i].children[j].id,
-									name: region[i].children[j].name
-								});
-							}
-						}
-					}
-				}
-
-				this.crud.setData(
-					'upsert.items[prop:provinceCity].component.attrs.options',
-					newRegion
-				);
-			});
-		},
-
-		download(key, id) {
-			let p = null;
-
-			if (key == 'gatheringCode') {
-				p = this.$service.shop.downloadGatheringCode(id);
-			} else if (key == 'applyMemberCode') {
-				p = this.$service.shop.downloadApplyMemberCode(id);
-			} else if(key == 'gatheringMiniCode'){
-				p = this.$service.shop.downloadGatheringMiniCode(id);
-			}
-
-			location.href = p;
-		},
-
-		shopAdd() {
-			this.$message.error('开发中...');
-			return false;
-			this.crud.add();
 		}
 		}
-	}
+	},
 };
 };
 </script>
 </script>
 
 

+ 12 - 15
ghs/src/views/staff/list.vue

@@ -25,8 +25,8 @@
 			<template #table-column-status="{scope}">
 			<template #table-column-status="{scope}">
 				<el-switch
 				<el-switch
 					v-model="scope.row.status"
 					v-model="scope.row.status"
-					active-value="1"
-					inactive-value="0"
+					active-value='1'
+					inactive-value='0'
 					@change="
 					@change="
 						v => {
 						v => {
 							changeStatus(scope.row.id, v);
 							changeStatus(scope.row.id, v);
@@ -182,7 +182,7 @@ export default {
 			this.roleShow = true;
 			this.roleShow = true;
 		},
 		},
 		modifyBtnFn(item) {
 		modifyBtnFn(item) {
-			this.$service.staff
+			this.$service.shopAdmin
 				.info({
 				.info({
 					id: item.id
 					id: item.id
 				})
 				})
@@ -205,7 +205,6 @@ export default {
 					data.endTime = this.$util.$formatDate(data.endTime);
 					data.endTime = this.$util.$formatDate(data.endTime);
 					if (this.$util.isEmpty(data)) return;
 					if (this.$util.isEmpty(data)) return;
 					Object.keys(this.adForm).forEach(i => {
 					Object.keys(this.adForm).forEach(i => {
-						// if (i == 'password') return false;
 						this.adForm[i] = data[i];
 						this.adForm[i] = data[i];
 					});
 					});
 
 
@@ -339,12 +338,6 @@ export default {
 							align: 'center',
 							align: 'center',
 							width: 150
 							width: 150
 						},
 						},
-						{
-							prop: 'userId',
-							label: '绑定小程序',
-							align: 'center',
-							width: 150
-						},
 						{
 						{
 							prop: 'incomeNotice',
 							prop: 'incomeNotice',
 							label: '收款通知',
 							label: '收款通知',
@@ -358,10 +351,10 @@ export default {
 							width: 150
 							width: 150
 						},
 						},
 						{
 						{
-							prop: 'addDate',
+							prop: 'addTime',
 							label: '添加时间',
 							label: '添加时间',
 							align: 'center',
 							align: 'center',
-							width: 150
+							width: 190
 						}
 						}
 					],
 					],
 					// 操作列
 					// 操作列
@@ -374,12 +367,16 @@ export default {
 							label: '操作'
 							label: '操作'
 						},
 						},
 						// 布局,请移步 `layout`
 						// 布局,请移步 `layout`
-						layout: ['slot-modify', 'slot-del']
+						layout: [
+							//'slot-modify', 'slot-del'
+							]
 					}
 					}
 				})
 				})
 				.set('layout', [
 				.set('layout', [
 					['slot-tabs'],
 					['slot-tabs'],
-					['flex1', 'slot-add-ad-btn', 'refresh-btn'],
+					['flex1', 
+					//'slot-add-ad-btn', 
+					'refresh-btn'],
 					['data-table'],
 					['data-table'],
 					['flex1', 'pagination']
 					['flex1', 'pagination']
 				])
 				])
@@ -412,4 +409,4 @@ export default {
 		}
 		}
 	}
 	}
 }
 }
-</style>
+</style>