shish 5 лет назад
Родитель
Сommit
62ab8b1e0b
4 измененных файлов с 42 добавлено и 12 удалено
  1. 1 1
      pt/src/config/env.js
  2. 1 1
      pt/src/saas/shop/list.vue
  3. 1 1
      pt/src/views/ad/list.vue
  4. 39 9
      pt/src/views/item/list.vue

+ 1 - 1
pt/src/config/env.js

@@ -5,7 +5,7 @@ import { getUrlParam, getFirstHost } from '@/cool/utils';
 const routerMode = 'hash';
 
 // 图片host
-const imgHostUrl = `${window.location.protocol}//img.${getFirstHost()}`;
+const imgHostUrl = `${window.location.protocol}//img.${getFirstHost()}/`;
 
 // 请求地址
 const baseUrl = (function() {

+ 1 - 1
pt/src/saas/shop/list.vue

@@ -17,7 +17,7 @@
 			</template>
 
 			<!-- 平台帐号激活 -->
-			<template #slot-activation="{scope}">
+			<template #slot-activation>
 				<div v-if="firstHost == 'huaml.com' || firstHost == 'huahb.com' ">
 				<el-button type="primary" size="mini" @click="bindJump(`/wx-open/begin-auth?id=hd&authType=1`)">花店公众号激活</el-button>
 				<el-button type="primary" size="mini" @click="bindJump(`/wx-open/begin-auth?id=hd&authType=2`)">花店小程序激活</el-button>

+ 1 - 1
pt/src/views/ad/list.vue

@@ -53,7 +53,7 @@
 			</template>
 
 			<!-- 添加 -->
-			<template #slot-add-ad-btn="{scope}">
+			<template #slot-add-ad-btn>
 				<el-button type="primary" size="mini" @click="addBtnFn">添加</el-button>
 			</template>
 		</x-crud>

+ 39 - 9
pt/src/views/item/list.vue

@@ -18,11 +18,11 @@
 				</el-tabs>
 			</template>
 
-			<template #table-column-avatarUrl="{ scope }">
+			<template #table-column-cover="{ scope }">
 				<cl-avatar
 					shape="square"
 					:size="32"
-					:src="scope.row.smallImgList[0]"
+					:src="scope.row.cover"
 					:style="{ margin: 'auto' }"
 				></cl-avatar>
 			</template>
@@ -248,7 +248,6 @@ export default {
 				weight:'',
 				ratio:''
 			},
-			addOrModify: 1,
 			replaceFormRules: {
 				name: {
 					required: true,
@@ -262,11 +261,11 @@ export default {
 					required: true,
 					message: '请选择分类',
 				},
-				bigUnit: {
+				bigUnitId: {
 					required: true,
 					message: '请选择大单位',
 				},
-				smallUnit: {
+				smallUnitId: {
 					required: true,
 					message: '请选择小单位',
 				},
@@ -305,11 +304,11 @@ export default {
 		},
 		selBigUnitFn(val) {
 			let index = this.unitList.findIndex((e) => e.name == val);
-			this.replaceForm.bigUnit = this.unitList[index].id;
+			this.replaceForm.bigUnitId = this.unitList[index].id;
 		},
 		selSmallUnitFn(val) {
 			let index = this.unitList.findIndex((e) => e.name == val);
-			this.replaceForm.smallUnit = this.unitList[index].id;
+			this.replaceForm.smallUnitId = this.unitList[index].id;
 		},
 		getAllClass() {
 			if (!this.$util.isEmpty(this.itemClassList)) {
@@ -339,6 +338,7 @@ export default {
 				this.replaceForm = {
 					name: '',
 					alias: '',
+					classId:'',
 					cover: '',
 					bigUnitId: '',
 					bigUnit: '',
@@ -347,12 +347,30 @@ export default {
 					stockWarning:'',
 					cost:'',
 					addPrice:'',
+					className:'',
 					weight:'',
 					ratio:''
 				}
 			}else{
 				this.$service.item.getDetail({id:id}).then(async res => {
-					this.replaceForm = res
+					
+					let index = this.itemClassList.findIndex((e) => e.id == res.classId)
+					this.replaceForm.name = res.name
+					this.replaceForm.alias = res.alias
+					this.replaceForm.cover = res.cover
+					this.replaceForm.bigUnitId = res.bigUnitId
+					this.replaceForm.bigUnit = res.bigUnit
+					this.replaceForm.smallUnitId = res.smallUnitId
+					this.replaceForm.smallUnit = res.smallUnit
+					this.replaceForm.stockWarning = res.stockWarning
+					this.replaceForm.cost = res.cost
+					this.replaceForm.addPrice = res.addPrice
+					this.replaceForm.weight = res.weight
+					this.replaceForm.ratio = res.ratio
+					this.replaceForm.classId = res.classId
+					this.replaceForm.className = this.itemClassList[index].name
+					this.$forceUpdate()
+					
 				});
 			}
 		},
@@ -387,6 +405,18 @@ export default {
 							align: 'center',
 							'min-width': 180,
 						},
+						{
+							prop: 'cover',
+							label: '封面',
+							align: 'center',
+							'min-width': 100,
+						},
+						{
+							prop: 'classId',
+							label: '分类',
+							align: 'center',
+							'min-width': 100,
+						},
 						{
 							prop: 'stockWarning',
 							label: '库存预警',
@@ -510,7 +540,7 @@ export default {
 					} else {
 						host = () => {
 							return this.$service.item.update({
-								id: this.modifyData.id,
+								id: this.currentItemId,
 								...form,
 							})
 						}