shish 2 years ago
parent
commit
707a20eb95
3 changed files with 52 additions and 5 deletions
  1. 2 0
      pt/src/cool/request/index.js
  2. 8 0
      pt/src/service/pt-item/index.js
  3. 42 5
      pt/src/views/item/list.vue

+ 2 - 0
pt/src/cool/request/index.js

@@ -44,12 +44,14 @@ import shopYeChange from '@/service/shop-ye-change/index';
 import ptCp from '@/service/pt-cp/index';
 import ptCpClass from '@/service/pt-cp-class/index';
 import ptCpItem from '@/service/pt-cp-item/index';
+import ptItem from '@/service/pt-item/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		ptItem,
 		ptCpItem,
 		ptCp,
 		ptCpClass,

+ 8 - 0
pt/src/service/pt-item/index.js

@@ -3,5 +3,13 @@ import { BaseService, Service } from '@/cool';
 @Service('pt-item')
 export class PtItemService extends BaseService {
 
+	batchAuth(data) {
+		return this.request({
+			url: '/batch-auth',
+			method: 'POST',
+			data: data
+		});
+	}
+
 }
 export default new PtItemService();

+ 42 - 5
pt/src/views/item/list.vue

@@ -29,7 +29,28 @@
 
 			<template #table-column-cpName="{ scope }">
 				<div v-for="(item, index) in scope.row.cpList" :key="index">
-					{{item.name}}
+					<i class="el-icon-success" size="medium" v-if="item.auth == 1" style="margin-right:2px;"></i>{{item.name}}
+				</div>
+			</template>
+
+			<template #table-column-delStatus="{scope}">
+				<div v-if="scope.row.delStatus==0">
+					<div v-if="scope.row.auth == 1" style="color:green;font-weight:bold;"><i class="el-icon-success" size="medium" style="margin-right:2px;"></i>已认证</div>
+				</div>
+				<div v-else style="color:red;font-weight:bold;"><i class="el-icon-delete-solid" size="medium"></i>已删除</div>
+			</template>
+
+			<template #table-column-name="{scope}">
+				<div v-if="scope.row.delStatus==0">
+					<div v-if="scope.row.auth==1" style="color:green;font-weight:bold;">
+						{{scope.row.name}}
+					</div>
+					<div v-else>
+						{{scope.row.name}}
+					</div>
+				</div>
+				<div v-else style="color:#CCCCCC;">
+					{{scope.row.name}}
 				</div>
 			</template>
 
@@ -69,7 +90,7 @@
 				<el-dropdown-menu slot="dropdown">
 					<el-dropdown-item command="toAuth">申请认证</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>
 			</template>
@@ -328,11 +349,21 @@ export default {
 			}
 			//申请认证
 			if(cmd == 'toAuth'){
-
+				this.$confirm('确认申请?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+					this.$service.ptItem.batchAuth({ids:JSON.stringify(this.selectedIds),auth:1}).then((res) => {
+						that.$message.success('操作成功')
+						that.app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
+					})
+				})
 			}
-			//申请认证
+			//取消认证
 			if(cmd == 'cancelAuth'){
-
+				this.$confirm('确认取消?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+					this.$service.ptItem.batchAuth({ids:JSON.stringify(this.selectedIds),auth:0}).then((res) => {
+						that.$message.success('操作成功')
+						that.app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
+					})
+				})
 			}
 		},
     	changeCpClassStyle(e){
@@ -539,6 +570,12 @@ export default {
 							align: 'center',
 							minWidth: 100,
 						},
+						{
+							prop: 'delStatus',
+							label: '状态',
+							align: 'center',
+							minWidth: 90,
+						},
 						{
 							prop: 'inTurn',
 							label: '排序',