shish 2 лет назад
Родитель
Сommit
21f4e9e7ce

+ 12 - 0
ghsApp/src/admin/billing/index.vue

@@ -39,6 +39,7 @@
 										@showAddModelFn="showAddModelFn"
 										@replaceItemFn="replaceItemFn"
 										@goToSpecialVariety="goToSpecialVariety"
+										@delProduct="delProduct"
 									></Commondity>
 								</view>
 							</template>
@@ -124,6 +125,7 @@ import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
 import { getClassRemind,hasClassRemind } from "@/api/item-class";
+import { delStatusUpdate } from '@/api/product';
 import { mapGetters } from "vuex";
 export default {
 	name: "index",
@@ -204,6 +206,16 @@ export default {
 
 	},
 	methods: {
+		delProduct(info){
+			let that = this
+			that.$util.confirmModal({content:'确认删除?'},() => {
+				delStatusUpdate({id:info.id,delStatus:1}).then(res=>{
+					if(res.code == 1){
+						that.$msg('删除成功')
+					}
+				})
+			})
+		},
 		goSearchFn(){
 			let type = uni.getSystemInfoSync().platform
 			//8249

+ 4 - 0
ghsApp/src/components/module/app-commodity.vue

@@ -2,6 +2,7 @@
 	<view class="item-cmd_bx" @click="showAddModelFn()">
 		<view class="img_bx" style="background:#eeeeee">
 			<image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image>
+			<view style="width:30upx;height:30upx;top:0upx;left:0upx;position: absolute;" @click.stop="delProduct(info)"> </view>
 		</view>
 		<view class="cmd-info_bx">
 			<view class="tit" >
@@ -101,6 +102,9 @@ export default {
 		this.userPrice = this.info.userPrice
 	},
 	methods: {
+		delProduct(info){
+			this.$emit("delProduct", info)
+		},
 		addItemFn () {
 			if(this.info && this.info.variety == 1 && this.selectJobType == 'bill'){
 				//小菊多颜色选择页

+ 12 - 0
ghsApp/src/pagesPurchase/add.vue

@@ -36,6 +36,7 @@
 								:info="productItem"
 								@showAddModelFn="showAddModelFn"
 								@replaceItemFn="replaceItemFn"
+								@delProduct="delProduct"
 							></CommodityPurchase>
 							</view>
 						</template>
@@ -103,6 +104,7 @@ import ModalModule from "@/components/plugin/modal";
 import FooterCart from "@/components/module/app-footer-cart";
 import productMins from "@/mixins/product";
 import { mapGetters } from "vuex";
+import { delStatusUpdate } from '@/api/product';
 export default {
 	name: "purchase",
 	components: {
@@ -158,6 +160,16 @@ export default {
 		}
 	},
 	methods: {
+		delProduct(info){
+			let that = this
+			that.$util.confirmModal({content:'确认删除?'},() => {
+				delStatusUpdate({id:info.id,delStatus:1}).then(res=>{
+					if(res.code == 1){
+						that.$msg('删除成功')
+					}
+				})
+			})
+		},
 		goSearchFn(){
 			let type = uni.getSystemInfoSync().platform
 			//8249

+ 7 - 1
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -1,7 +1,10 @@
 <template>
   <view class="product">
     <view class="item-cmd_bx" @click="showAddModelFn">
-      <view class="img_bx" style="background:#eeeeee"> <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image> </view>
+      <view class="img_bx" style="background:#eeeeee">
+        <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image>
+        <view style="width:30upx;height:30upx;top:0upx;left:0upx;position: absolute;" @click.stop="delProduct(info)"> </view>
+      </view>
       <view class="cmd-info_bx">
         <view class="tit">
           <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
@@ -83,6 +86,9 @@ export default {
 		this.userPrice = this.info.userPrice
   },
   methods: {
+    delProduct(info){
+      this.$emit("delProduct", info)
+    },
 		doPrintLabel(item,type){
 			this.$msg('开发中')
 		},