shish 2 місяців тому
батько
коміт
a23f690628

+ 13 - 2
ghsApp/src/admin/changePrice/changeStock2.vue

@@ -30,7 +30,7 @@
 								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height:190upx" :key="productIndex">
 								<view style="height:190upx" :key="productIndex">
 									<ItemComponent :isPrice="false" :info="productItem" @saveStock="saveStock" :ref="`productRef${productItem.id}`" 
 									<ItemComponent :isPrice="false" :info="productItem" @saveStock="saveStock" :ref="`productRef${productItem.id}`" 
-									@hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn">
+									@hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn" @cancelLimitBuyFn="cancelLimitBuyFn">
 								</ItemComponent>
 								</ItemComponent>
 								</view>
 								</view>
 							</template>
 							</template>
@@ -77,7 +77,7 @@ import ItemComponent from "./components/changeStockItem2";
 import productMins from "@/mixins/product2";
 import productMins from "@/mixins/product2";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 import { checkOrderApi } from "@/api/inventory";
 import { checkOrderApi } from "@/api/inventory";
-import { changeFrontHide } from "@/api/item";
+import { changeFrontHide, cancelLimitBuy } from "@/api/item";
 import { cancelPreSell } from '@/api/product'
 import { cancelPreSell } from '@/api/product'
 export default {
 export default {
 	name: "item_list",
 	name: "item_list",
@@ -118,6 +118,17 @@ export default {
 				})
 				})
 			})
 			})
 		},
 		},
+		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 || '取消限购成功')
+					}
+				})
+			})
+		},
 		hideChangeFn(item,status){
 		hideChangeFn(item,status){
 			let that = this
 			let that = this
 			changeFrontHide({id:item.id,status:status}).then(res=>{
 			changeFrontHide({id:item.id,status:status}).then(res=>{

+ 13 - 0
ghsApp/src/admin/changePrice/components/Item2.vue

@@ -8,6 +8,7 @@
 			style="position:absolute;bottom:0upx;font-size:24upx;left:10upx;z-index:40;">取消满减</button>
 			style="position:absolute;bottom:0upx;font-size:24upx;left:10upx;z-index:40;">取消满减</button>
 
 
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.id})">
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.id})">
+			<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>
@@ -149,6 +150,9 @@ export default {
 		cancelDiscountFn(item){
 		cancelDiscountFn(item){
 			this.$emit("cancelDiscountFn",item)
 			this.$emit("cancelDiscountFn",item)
 		},
 		},
+		cancelLimitBuyFn(item){
+			this.$emit("cancelLimitBuyFn", item)
+		},
 		savePrice() {
 		savePrice() {
 			if(Number(this.modifyPrice)>0 && Number(this.skModifyPrice) > 0 && Number(this.hjModifyPrice) > 0){
 			if(Number(this.modifyPrice)>0 && Number(this.skModifyPrice) > 0 && Number(this.hjModifyPrice) > 0){
 				this.$emit("savePrice",this.modifyPrice,this.skModifyPrice,this.hjModifyPrice,this.info.id,1)
 				this.$emit("savePrice",this.modifyPrice,this.skModifyPrice,this.hjModifyPrice,this.info.id,1)
@@ -181,6 +185,15 @@ export default {
 		position: absolute;
 		position: absolute;
 		left: 0upx;
 		left: 0upx;
 		top: 0upx;
 		top: 0upx;
+		.cancel-limit-buy-btn{
+			position:absolute;
+			top:0;
+			left:10upx;
+			z-index:50;
+			font-size:24upx;
+			background-color:#ff4d4f;
+			border-color:#ff4d4f;
+		}
 		.sold-out{
 		.sold-out{
 			z-index:10;
 			z-index:10;
 			width:160upx;
 			width:160upx;

+ 13 - 0
ghsApp/src/admin/changePrice/components/changeStockItem2.vue

@@ -2,6 +2,7 @@
 <view class="product">
 <view class="product">
 	<view class="item-cmd_bx">
 	<view class="item-cmd_bx">
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.id})">
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.id})">
+			<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.status == 2">
 			<block v-if="info.status == 2">
 				<view class="sold-out">
 				<view class="sold-out">
 					<view class="sold-out-xj">已下架</view>
 					<view class="sold-out-xj">已下架</view>
@@ -75,6 +76,9 @@ export default {
 		hideChangeFn(item,status){
 		hideChangeFn(item,status){
 			this.$emit("hideChangeFn",item,status)
 			this.$emit("hideChangeFn",item,status)
 		},
 		},
+		cancelLimitBuyFn(item){
+			this.$emit("cancelLimitBuyFn", item)
+		},
 		saveStock() {
 		saveStock() {
 			if(Number(this.modifyStock)>=0){
 			if(Number(this.modifyStock)>=0){
 				this.$emit("saveStock",this.modifyStock,this.info.id)
 				this.$emit("saveStock",this.modifyStock,this.info.id)
@@ -105,6 +109,15 @@ export default {
 		position: absolute;
 		position: absolute;
 		left: 0upx;
 		left: 0upx;
 		top: 0upx;
 		top: 0upx;
+		.cancel-limit-buy-btn{
+			position:absolute;
+			top:0;
+			left:10upx;
+			z-index:50;
+			font-size:24upx;
+			background-color:#ff4d4f;
+			border-color:#ff4d4f;
+		}
 		.sold-out{
 		.sold-out{
 			z-index:10;
 			z-index:10;
 			width:160upx;
 			width:160upx;

+ 13 - 2
ghsApp/src/admin/changePrice/list2.vue

@@ -35,7 +35,7 @@
 								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height:230upx" :key="productIndex">
 								<view style="height:230upx" :key="productIndex">
 									<ItemComponent :isPrice="false" :info="productItem" @hideChangeFn="hideChangeFn" :ref="`productRef${productItem.id}`"
 									<ItemComponent :isPrice="false" :info="productItem" @hideChangeFn="hideChangeFn" :ref="`productRef${productItem.id}`"
-									@savePrice="savePrice" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff" @cancelPreSellFn="cancelPreSellFn"></ItemComponent>
+									@savePrice="savePrice" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff" @cancelPreSellFn="cancelPreSellFn" @cancelLimitBuyFn="cancelLimitBuyFn"></ItemComponent>
 								</view>
 								</view>
 							</template>
 							</template>
 
 
@@ -81,7 +81,7 @@ import ItemComponent from "./components/Item2";
 import productMins from "@/mixins/product2";
 import productMins from "@/mixins/product2";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 import { batchChangePrice,generatePriceTable,cancelDiscountPrice,cancelFullOffFn,cancelPreSell } from '@/api/product'
 import { batchChangePrice,generatePriceTable,cancelDiscountPrice,cancelFullOffFn,cancelPreSell } from '@/api/product'
-import { changeFrontHide } from '@/api/item'
+import { changeFrontHide, cancelLimitBuy } from '@/api/item'
 export default {
 export default {
 	name: "list2",
 	name: "list2",
 	components: {
 	components: {
@@ -150,6 +150,17 @@ export default {
 				})
 				})
 			})
 			})
 		},
 		},
+		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 || '取消限购成功')
+					}
+				})
+			})
+		},
 		downloadTable(){
 		downloadTable(){
 			let level = 0
 			let level = 0
 			let levelList = ['零售价', '批发价']
 			let levelList = ['零售价', '批发价']

+ 14 - 0
ghsApp/src/admin/item/components/item2.vue

@@ -2,6 +2,8 @@
 <view class="product">
 <view class="product">
 	<view class="item-cmd_bx" >
 	<view class="item-cmd_bx" >
 
 
+		<button v-if="Number(info.limitBuy) > 0" @click.stop="cancelLimitBuyFn(info)" class="admin-button-com mini-btn blue cancel-limit-buy-btn">取消限购</button>
+
 		<button v-if="Number(info.discountPrice)>0" @click.stop="cancelDiscountFn(info)" class="admin-button-com mini-btn blue" 
 		<button v-if="Number(info.discountPrice)>0" @click.stop="cancelDiscountFn(info)" class="admin-button-com mini-btn blue" 
 			style="position:absolute;bottom:0upx;font-size:24upx;left:10upx;z-index:20;">取消特价</button>
 			style="position:absolute;bottom:0upx;font-size:24upx;left:10upx;z-index:20;">取消特价</button>
 
 
@@ -125,6 +127,9 @@ export default {
 		cancelFullOff(item){
 		cancelFullOff(item){
 			this.$emit("cancelFullOff",item)
 			this.$emit("cancelFullOff",item)
 		},
 		},
+		cancelLimitBuyFn(item){
+			this.$emit("cancelLimitBuyFn", item)
+		},
 		moreAction(item){
 		moreAction(item){
 			this.$emit('moreAction', item)
 			this.$emit('moreAction', item)
 		},
 		},
@@ -171,6 +176,15 @@ export default {
 	height:160upx;
 	height:160upx;
 	position: relative;
 	position: relative;
 	margin-bottom: 20upx;
 	margin-bottom: 20upx;
+	.cancel-limit-buy-btn{
+		position:absolute;
+		top:0;
+		left:10upx;
+		z-index:40;
+		font-size:24upx;
+		background-color:#ff4d4f;
+		border-color:#ff4d4f;
+	}
 	.official{
 	.official{
 		z-index:50;
 		z-index:50;
 		position:absolute;
 		position:absolute;

+ 13 - 1
ghsApp/src/admin/item/list2.vue

@@ -52,7 +52,7 @@
 										<ItemStock :info="productItem" @moreAction="moreAction" 
 										<ItemStock :info="productItem" @moreAction="moreAction" 
 										@doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
 										@doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
 										:ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" 
 										:ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" 
-										@cancelPreSellFn="cancelPreSellFn" @breakSingleItem="breakSingleItem">
+										@cancelPreSellFn="cancelPreSellFn" @cancelLimitBuyFn="cancelLimitBuyFn" @breakSingleItem="breakSingleItem">
 										</ItemStock>
 										</ItemStock>
 									</view>
 									</view>
 								</template>
 								</template>
@@ -228,6 +228,7 @@ import productMins from "@/mixins/product2";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 import { getWeixinId } from "@/api/invite";
 import { getWeixinId } from "@/api/invite";
 import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
 import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
+import { cancelLimitBuy } from '@/api/item';
 import { getHdPoster,getSkPoster,changeFrontHide,applyAuth,moveToLosing } from '@/api/item'
 import { getHdPoster,getSkPoster,changeFrontHide,applyAuth,moveToLosing } from '@/api/item'
 import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
 import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
 import ModalModule from "@/components/plugin/modal"
 import ModalModule from "@/components/plugin/modal"
@@ -462,6 +463,17 @@ export default {
 				})
 				})
 			})
 			})
 		},
 		},
+		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 || '取消成功')
+					}
+				})
+			})
+		},
 		closePoster(){
 		closePoster(){
 			this.$refs.posterShow.close()
 			this.$refs.posterShow.close()
 		},
 		},