瀏覽代碼

限购问题

shish 2 月之前
父節點
當前提交
95cf66ecd8
共有 2 個文件被更改,包括 36 次插入0 次删除
  1. 14 0
      ghsApp/src/admin/billing/index2.vue
  2. 22 0
      ghsApp/src/components/module/app-commodity2.vue

+ 14 - 0
ghsApp/src/admin/billing/index2.vue

@@ -41,6 +41,7 @@
 										@goToSpecialVariety="goToSpecialVariety"
 										@goToSpecialVariety="goToSpecialVariety"
 										@goTree="goTree"
 										@goTree="goTree"
 										@delProduct="delProduct"
 										@delProduct="delProduct"
+										@cancelLimitBuyFn="cancelLimitBuyFn"
 									></Commondity>
 									></Commondity>
 								</view>
 								</view>
 							</template>
 							</template>
@@ -68,6 +69,7 @@
 						<text style="margin-left:14upx;">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</text>
 						<text style="margin-left:14upx;">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</text>
 						<!-- 花样年花门店和出车,要求不显示成本,其他批发商需要 -->
 						<!-- 花样年花门店和出车,要求不显示成本,其他批发商需要 -->
 						<text style="margin-left:14upx;" v-if="customData.mainId!=1553 && customData.mainId!=1563">成本 {{customData.avCost?parseFloat(customData.avCost):0}}</text>
 						<text style="margin-left:14upx;" v-if="customData.mainId!=1553 && customData.mainId!=1563">成本 {{customData.avCost?parseFloat(customData.avCost):0}}</text>
+						<text style="margin-left:14upx;color:red;font-weight:bold;" v-if="customData.limitBuy > 0">限购 {{ customData.limitBuy }}</text>
 					</view>
 					</view>
 					<view class="num_bx">
 					<view class="num_bx">
 						<input style="width:280upx" v-model="customData.userPrice" @focus="customData.userPrice = null" :class="[Number(customData.avCost) > Number(customData.userPrice) ? 'warning-price' : '']"
 						<input style="width:280upx" v-model="customData.userPrice" @focus="customData.userPrice = null" :class="[Number(customData.avCost) > Number(customData.userPrice) ? 'warning-price' : '']"
@@ -133,6 +135,7 @@ import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product2";
 import productMins from "@/mixins/product2";
 import { getClassRemind,hasClassRemind,getMenu } from "@/api/item-class";
 import { getClassRemind,hasClassRemind,getMenu } from "@/api/item-class";
 import { delStatusUpdate } from '@/api/product';
 import { delStatusUpdate } from '@/api/product';
+import { cancelLimitBuy } from "@/api/item";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 export default {
 export default {
 	name: "index",
 	name: "index",
@@ -290,6 +293,17 @@ export default {
 				this.$util.pageTo({url: "/admin/item/tree?stock="+info.stock+"&price="+price+"&customId="+this.option.customId+"&userPrice="+userPrice+"&productId="+info.id+"&ptItemId="+info.itemId+"&smallUnit="+smallUnit})
 				this.$util.pageTo({url: "/admin/item/tree?stock="+info.stock+"&price="+price+"&customId="+this.option.customId+"&userPrice="+userPrice+"&productId="+info.id+"&ptItemId="+info.itemId+"&smallUnit="+smallUnit})
 			}
 			}
 		},
 		},
+		cancelLimitBuyFn(item){
+			let that = this
+			this.$util.confirmModal({ content: '确认取消限购?' }, () => {
+				cancelLimitBuy({ id: item.id }).then(res => {
+					if (res.code == 1) {
+						item.limitBuy = 0
+						that.$msg(res.msg || '取消成功')
+					}
+				})
+			})
+		},
 		selectFlowerNumFn(){
 		selectFlowerNumFn(){
 			this.$refs.globalClassImgRef.open('top')
 			this.$refs.globalClassImgRef.open('top')
 		},
 		},

+ 22 - 0
ghsApp/src/components/module/app-commodity2.vue

@@ -1,6 +1,7 @@
 <template>
 <template>
 	<view class="item-cmd_bx" @click.stop="showAddModelFn()">
 	<view class="item-cmd_bx" @click.stop="showAddModelFn()">
 		<view class="img_bx" style="background:#eeeeee">
 		<view class="img_bx" style="background:#eeeeee">
+			<button v-if="Number(info.limitBuy) > 0" @click.stop="cancelLimitBuyFn(info)" class="admin-button-com mini-btn blue cancel-limit-buy-btn">取消限购</button>
 			<block v-if="info.frontHide == 1">
 			<block v-if="info.frontHide == 1">
 				<view class="sold-out">
 				<view class="sold-out">
 					<view class="hide">隐</view>
 					<view class="hide">隐</view>
@@ -15,6 +16,8 @@
 				v-if="info.frontHide && info.frontHide == 1">隐</text>
 				v-if="info.frontHide && info.frontHide == 1">隐</text>
 				<text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
 				<text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
 				v-if="info.presell == 1">预售</text>
 				v-if="info.presell == 1">预售</text>
+				<text style="font-size:22upx;border:1upx solid red;color:white;background-color:red;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
+				v-if="info.limitBuy > 0">限购{{ info.limitBuy }}份</text>
 				{{ info.name || "" }}
 				{{ info.name || "" }}
 				<block v-if="info.kind == 2">
 				<block v-if="info.kind == 2">
 					<text class="show-tree"></text>
 					<text class="show-tree"></text>
@@ -118,6 +121,9 @@ export default {
 		this.remark = this.info.remark||''
 		this.remark = this.info.remark||''
 	},
 	},
 	methods: {
 	methods: {
+		cancelLimitBuyFn(info){
+			this.$emit("cancelLimitBuyFn", info)
+		},
 		copyCreate(){
 		copyCreate(){
 			this.pageTo({url: '/admin/item/copy?id='+this.info.id})
 			this.pageTo({url: '/admin/item/copy?id='+this.info.id})
 		},
 		},
@@ -174,6 +180,22 @@ export default {
 		position: absolute;
 		position: absolute;
 		left: 0upx;
 		left: 0upx;
 		top: 0upx;
 		top: 0upx;
+		.cancel-limit-buy-btn{
+			position:absolute;
+			top:0;
+			left:0upx;
+			z-index:50;
+			font-size:20upx;
+			background-color:#ff4d4f;
+			border-color:#ff4d4f;
+			color: #fff;
+			padding: 0;
+			height: 38upx;
+			line-height: 38upx;
+			width: 140upx;
+			text-align: center;
+			border-radius: 0;
+		}
 		image{
 		image{
 			width: 100%;
 			width: 100%;
 			height: 100%;
 			height: 100%;