shish 5 лет назад
Родитель
Сommit
8fbbd46b28
2 измененных файлов с 29 добавлено и 0 удалено
  1. 7 0
      ghs/src/service/product/index.js
  2. 22 0
      ghs/src/views/item/list.vue

+ 7 - 0
ghs/src/service/product/index.js

@@ -46,6 +46,13 @@ list(data) {
     });
     });
 	}
 	}
 
 
+  copy(data) {
+    return this.request({
+      url: '/copy',
+      params: data
+    });
+  }
+
 }
 }
   
   
 export default new ProductService();
 export default new ProductService();

+ 22 - 0
ghs/src/views/item/list.vue

@@ -82,6 +82,17 @@
       </template> 
       </template> 
 
 
       <template #slot-modify="{ scope }">
       <template #slot-modify="{ scope }">
+
+
+				<el-popover style="margin-right:10px;" placement="top" width="160" :ref="'popover-' + scope.row.id">
+					<p>确认复制生成花材?</p>
+					<div style="text-align: right; margin: 0">
+					<el-button size="mini" type="text" @click.stop="cancelCopyProduct(scope.row.id)">取消</el-button>
+					<el-button type="primary" size="mini" @click.stop="copyProduct(scope.row)">确定</el-button>
+					</div>
+					<el-button slot="reference" size="mini" type="text" plain @click.stop="">复制</el-button>
+				</el-popover>
+
 				<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>
 				<el-button type="text" v-if="scope.row.status==2" @click.native.stop="setStatusFun(scope.row.id,1)" >上架</el-button>
 				<el-button type="text" v-if="scope.row.status==2" @click.native.stop="setStatusFun(scope.row.id,1)" >上架</el-button>
 				<el-button type="text" v-if="scope.row.status==1" @click.native.stop="setStatusFun(scope.row.id,2)" >下架</el-button>
 				<el-button type="text" v-if="scope.row.status==1" @click.native.stop="setStatusFun(scope.row.id,2)" >下架</el-button>
@@ -292,6 +303,7 @@ export default {
     return {
     return {
 		app: null,
 		app: null,
 		sortLink: '',
 		sortLink: '',
+		showCopyProduct:false,
 		operateData: {},
 		operateData: {},
 		statusOption: [{
 		statusOption: [{
           value: '0',
           value: '0',
@@ -404,6 +416,16 @@ export default {
     this.init();
     this.init();
   },
   },
   methods: {
   methods: {
+	copyProduct(){
+		this.$service.product.copy({id:id}).then(res => {
+			this.$message.success('操作成功!')
+			this.app.refresh()
+		}).catch(err => {})
+	},
+    //取消复制
+	cancelCopyProduct(id) {
+		this.$refs[`popover-` + id].doClose();
+	},
 	  changedStatus(status){
 	  changedStatus(status){
 		this.status = status
 		this.status = status
 		this.app.refresh({ classId: this.classId,status:this.status,showPage: 1});
 		this.app.refresh({ classId: this.classId,status:this.status,showPage: 1});