shish 2 years ago
parent
commit
5d29d6d4d3
1 changed files with 36 additions and 10 deletions
  1. 36 10
      pt/src/views/item/list.vue

+ 36 - 10
pt/src/views/item/list.vue

@@ -27,6 +27,12 @@
 				</el-input>
 				</el-input>
 			</template>
 			</template>
 
 
+			<template #table-column-cpName="{ scope }">
+				<div v-for="(item, index) in scope.row.cpList" :key="index">
+					{{item.name}}
+				</div>
+			</template>
+
 			<template #slot-modify="{ scope }">
 			<template #slot-modify="{ scope }">
 				<el-button type="text" @click.native.stop="replaceBtnFn(scope.row.id)" >修改</el-button >
 				<el-button type="text" @click.native.stop="replaceBtnFn(scope.row.id)" >修改</el-button >
 			</template>
 			</template>
@@ -69,14 +75,14 @@
 				<el-dropdown-menu slot="dropdown">
 				<el-dropdown-menu slot="dropdown">
 					<el-dropdown-item command="toAuth">申请认证</el-dropdown-item>
 					<el-dropdown-item command="toAuth">申请认证</el-dropdown-item>
 					<el-dropdown-item command="cancelAuth">取消认证</el-dropdown-item>
 					<el-dropdown-item command="cancelAuth">取消认证</el-dropdown-item>
-					<el-dropdown-item command="delCpRelate">删除产品</el-dropdown-item>
+					<el-dropdown-item command="delCpRelate">删除花材</el-dropdown-item>
 				</el-dropdown-menu>
 				</el-dropdown-menu>
 				</el-dropdown>
 				</el-dropdown>
 			</template>
 			</template>
 
 
 			<template #slot-select-cp="{scope}">
 			<template #slot-select-cp="{scope}">
 				<el-select @change="searchSelectCp" v-model="selectCpName" filterable remote reserve-keyword placeholder="请搜索产品" :remote-method="searchCpInfo" :loading="loading" style="width:200px;margin-left:20px;" size="medium">
 				<el-select @change="searchSelectCp" v-model="selectCpName" filterable remote reserve-keyword placeholder="请搜索产品" :remote-method="searchCpInfo" :loading="loading" style="width:200px;margin-left:20px;" size="medium">
-    				<el-option v-for="item in cpInfoList" :key="item.id" :label="`${item.id} ${item.name}(${item.auth == 1 ?'认证':'未认证'})`" :value="item.id"> </el-option>
+    				<el-option v-for="item in cpInfoList" :key="item.id" :label="`${item.name}(${item.auth == 1 ?'认证':'未认证'})${item.id} ${item.delStatus==1?' 已删除': ''}`" :value="item.id"> </el-option>
   				</el-select>
   				</el-select>
 			</template>
 			</template>
 
 
@@ -277,6 +283,7 @@ export default {
 			}
 			}
 		},
 		},
 		installCp(){
 		installCp(){
+			let that = this
 			if (this.$util.isEmpty(this.selectedIds)) {
 			if (this.$util.isEmpty(this.selectedIds)) {
 				this.$message.error('请选花材')
 				this.$message.error('请选花材')
 				return false
 				return false
@@ -285,8 +292,14 @@ export default {
 				this.$message.error('请选产品')
 				this.$message.error('请选产品')
 				return false
 				return false
 			}
 			}
-			this.$service.ptCpItem.setCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId}).then((res) => {
-
+			this.$confirm('确认设置?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+				this.$service.ptCpItem.setCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId}).then((res) => {
+					that.$message.success('操作成功')
+					that.selectCpId = 0
+					that.selectCpName =''
+					that.cpInfoList = []
+					that.app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
+				})
 			})
 			})
 		},
 		},
 		doMore(cmd){
 		doMore(cmd){
@@ -301,8 +314,14 @@ export default {
 					this.$message.error('请选产品')
 					this.$message.error('请选产品')
 					return false
 					return false
 				}
 				}
-				this.$service.ptCpItem.delCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId}).then((res) => {
-
+				this.$confirm('确认删除?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+					this.$service.ptCpItem.delCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId}).then((res) => {
+						that.$message.success('操作成功')
+						that.selectCpId = 0
+						that.selectCpName =''
+						that.cpInfoList = []
+						that.app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
+					})
 				})
 				})
 			}
 			}
 			//申请认证
 			//申请认证
@@ -474,12 +493,13 @@ export default {
 							prop: 'id',
 							prop: 'id',
 							label: 'ID',
 							label: 'ID',
 							align: 'center',
 							align: 'center',
+							'min-width':50
 						},
 						},
 						{
 						{
 							prop: 'cover',
 							prop: 'cover',
 							label: '封面',
 							label: '封面',
 							align: 'center',
 							align: 'center',
-							'min-width': 100,
+							'min-width':60,
 						},
 						},
 						{
 						{
 							prop: 'name',
 							prop: 'name',
@@ -493,6 +513,12 @@ export default {
 							align: 'center',
 							align: 'center',
 							'min-width':90,
 							'min-width':90,
 						},
 						},
+						{
+							prop: 'cpName',
+							label: '产品',
+							align: 'center',
+							'min-width':90,
+						},
 						{
 						{
 							prop: 'stockWarning',
 							prop: 'stockWarning',
 							label: '预警值',
 							label: '预警值',
@@ -515,13 +541,13 @@ export default {
 							prop: 'inTurn',
 							prop: 'inTurn',
 							label: '排序',
 							label: '排序',
 							align: 'center',
 							align: 'center',
-							minWidth: 100,
+							minWidth: 90,
 						},
 						},
 						{
 						{
 							prop: 'addTime',
 							prop: 'addTime',
 							label: '创建时间',
 							label: '创建时间',
 							align: 'center',
 							align: 'center',
-							minWidth: 180,
+							minWidth: 120,
 						},
 						},
 					],
 					],
 					on: {
 					on: {
@@ -532,7 +558,7 @@ export default {
 					op: {
 					op: {
 						visible: true,
 						visible: true,
 						props: {
 						props: {
-							width: 250,
+							width: 200,
 							align: 'center',
 							align: 'center',
 							fixed: 'right',
 							fixed: 'right',
 							label: '操作',
 							label: '操作',