Просмотр исходного кода

花材状态停用的,在添加花材列表会有"启用"按钮来实现恢复启用

shizhongqi 4 лет назад
Родитель
Сommit
7a6e30aa01
2 измененных файлов с 18 добавлено и 2 удалено
  1. 2 1
      ghsApp/src/admin/ptItem/components/Item.vue
  2. 16 1
      ghsApp/src/admin/ptItem/itemList.vue

+ 2 - 1
ghsApp/src/admin/ptItem/components/Item.vue

@@ -6,7 +6,8 @@
 		<view class="cmd-info_bx">
 			<view class="tit">{{ info.name || "" }}</view>
 			<view class="kc">{{info.className}}
-				<text v-if="info.select == 2" style="color:#1f1cc0;float:right;margin-right:80upx;">已导入</text>
+				<text v-if="info.select == 2 && info.is_delete == 1" style="color:#1f1cc0;float:right;margin-right:80upx;">启用</text>
+				<text v-else-if="info.select == 2" style="color:#1f1cc0;float:right;margin-right:80upx;">已导入</text>
 				<text v-else style="color:green;float:right;margin-right:80upx;">选择</text>
 			</view>
 			<view class="num-open_bx">

+ 16 - 1
ghsApp/src/admin/ptItem/itemList.vue

@@ -42,6 +42,7 @@ import productMins from "@/mixins/product";
 import productContraposeMins from "@/mixins/ptProductContrapose";
 import { mapGetters } from "vuex";
 import { getAllItemClass } from "@/api/item-class";
+import { updateProduct } from "@/api/product";
 export default {
 	name: "ptItemList",
 	components: {
@@ -56,7 +57,11 @@ export default {
 			selectJobType: "getPtItem",
 			tabIndex: 0,
 			modifyStock:{},
-			allClass:[]
+			allClass:[],
+			form: {
+        id:0,
+        delStatus:0,
+      },
 		};
 	},
 	computed:{
@@ -87,6 +92,16 @@ export default {
 			});
 		},
 		selectItem(item){
+			if(item.select == 2 && item.is_delete == 1){
+				let form = JSON.parse(JSON.stringify(this.form))
+				updateProduct({...form,id: item.ghsItmeId, delStatus: 0}).then(res => {
+					uni.hideLoading()
+					if(res.code == 1){
+						this.$msg("操作成功!");
+					}
+				});
+				return
+			}
 			if(item.select == 2){
 				this.$msg("已导入")
 				return