shish 2 лет назад
Родитель
Сommit
1ac40c836b

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

@@ -45,12 +45,14 @@ 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';
+import ptItemCatRelate from '@/service/pt-item-cat-relate/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		ptItemCatRelate,
 		ptItem,
 		ptCpItem,
 		ptCp,

+ 15 - 0
pt/src/service/pt-item-cat-relate/index.js

@@ -0,0 +1,15 @@
+import { BaseService, Service } from '@/cool';
+
+@Service('pt-item-cat-relate')
+export class PtItemCatRelateService extends BaseService {
+
+	batchSet(data) {
+		return this.request({
+			url: '/batch-set',
+			method: 'POST',
+			data: data
+		});
+	}
+
+}
+export default new PtItemCatRelateService();

+ 12 - 2
pt/src/views/item/list.vue

@@ -307,7 +307,7 @@ export default {
 			let that = this
 			if (query !== '') {
 				this.loading = true;
-				this.$service.ptCp.list({search:query}).then(res=>{
+				this.$service.ptCp.list({search:query,delStatus:0}).then(res=>{
 					that.loading = false
 					that.cpInfoList = res.list	
 				})
@@ -376,7 +376,17 @@ export default {
 				})
 			}
 			if(cmd == 'setSuggestItem'){
-				
+				if (this.$util.isEmpty(this.selectedIds)) {
+					this.$message.error('请选花材')
+					return false
+				}
+				if(this.suggestClassId == 0){
+					that.$message.error('请选择分类')
+					return false
+				}
+				this.$service.ptItemCatRelate.batchSet({ids:JSON.stringify(this.selectedIds),classId:this.suggestClassId}).then(res=>{
+					that.$message.success('操作成功')
+				})
 			}
 		},
     	changeCpClassStyle(e){