shish hace 2 años
padre
commit
4d905fb2dc
Se han modificado 2 ficheros con 29 adiciones y 5 borrados
  1. 27 3
      pt/src/views/item/list.vue
  2. 2 2
      pt/vue.config.js

+ 27 - 3
pt/src/views/item/list.vue

@@ -91,9 +91,10 @@
 			</template>
 
 			<template #slot-more-do-btn>
-				<el-dropdown size="medium" split-button type="primary" @click="installCp" @command="doMore">
-				设置产品
+				<el-dropdown size="medium" split-button type="primary" @click="setCpSetAuth" @command="doMore">
+				关联产品并加V
 				<el-dropdown-menu slot="dropdown">
+					<el-dropdown-item command="relateCp">关联产品</el-dropdown-item>
 					<el-dropdown-item command="toAuth">加V认证</el-dropdown-item>
 					<el-dropdown-item command="cancelAuth">取消加V</el-dropdown-item>
 					<el-dropdown-item command="delCpRelate">删除产品关联</el-dropdown-item>
@@ -326,6 +327,26 @@ export default {
 				this.cpInfoList = []
 			}
 		},
+		setCpSetAuth(){
+			let that = this
+			if (this.$util.isEmpty(this.selectedIds)) {
+				this.$message.error('请选花材')
+				return false
+			}
+			if(this.selectCpId == 0){
+				this.$message.error('请选产品')
+				return false
+			}
+			this.$confirm('确认设置?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+				this.$service.ptCpItem.setCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId,auth:1}).then((res) => {
+					that.$message.success('操作成功')
+					that.selectCpId = 0
+					that.selectCpName =''
+					that.cpInfoList = []
+					that.app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
+				})
+			})
+		},
 		installCp(){
 			let that = this
 			if (this.$util.isEmpty(this.selectedIds)) {
@@ -337,7 +358,7 @@ export default {
 				return false
 			}
 			this.$confirm('确认设置?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
-				this.$service.ptCpItem.setCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId}).then((res) => {
+				this.$service.ptCpItem.setCpRelate({ids:JSON.stringify(this.selectedIds),cpId:this.selectCpId,auth:0}).then((res) => {
 					that.$message.success('操作成功')
 					that.selectCpId = 0
 					that.selectCpName =''
@@ -368,6 +389,9 @@ export default {
 					})
 				})
 			}
+			if(cmd == 'relateCp'){
+				that.installCp()
+			}
 			//申请认证
 			if(cmd == 'toAuth'){
 				this.$confirm('确认申请?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {

+ 2 - 2
pt/vue.config.js

@@ -3,13 +3,13 @@ const path = require('path');
 const isProduction = process.env.NODE_ENV === 'production';
 
 //http和https切换请修改这里,修改后需要重新运行 npm run serve 即可 shish 2021.4.12
-const proxyTarget = 'https://api.pt.wixhb.com';
+const proxyTarget = 'http://api.pt.huaml.com';
 
 function resolve(dir) {
 	return path.join(__dirname, dir);
 }
 
-let hostUrl = 'https://img.wixhb.com/';
+let hostUrl = 'http://img.hzghd.com/';
 
 const cdn = {
 	dev: {