jf 5 yıl önce
ebeveyn
işleme
0ae5423a75

+ 4 - 3
ghsApp/src/admin/billing/priceChange.vue

@@ -7,12 +7,13 @@
     <view class="scroll-middle_bx">
       <!--<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId"></scroll-view>-->
         <!--内容部分 start -->
-        <block v-if="!$util.isEmpty(filterProductInfo)">
+        <block v-if="!$util.isEmpty(filterProductInfoContrapose)">
 									<view style="width:100%;padding: 30rpx">
-										<template v-for="(productItem, productIndex) in filterProductInfo">
+										<template v-for="(productItem, productIndex) in filterProductInfoContrapose">
 										<Commondity :type="COMMODITY_TYPE.CHANGE"
 																						:key="productIndex"
 																						:info="productItem"
+																						:autoPrice="productItem.priceLabel=='2'?productItem.price:null"
 																						@changePrice="changePriceEvent"
 																						@remove="removeChangePriceEvent"></Commondity>
 									</template>
@@ -21,7 +22,7 @@
 									</view>
         </block>
         <block v-else>
-          <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfo)" />
+          <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfoContrapose)" />
         </block>
         <!--内容部分 end -->
 

+ 30 - 7
ghsApp/src/components/module/app-commodity.vue

@@ -22,14 +22,23 @@
 					<i class="iconfont iconzeng" @click="addEvent"></i>
 				</view>
 				<view class="open-bx" v-else-if="type == COMMODITY_TYPE.CHANGE">
+<!--					<input v-if="info.priceLabel==2"-->
+<!--						class="change-input"-->
+<!--						:value="info.price"-->
+<!--						type="digit"-->
+<!--						placeholder="自动调价"-->
+<!--						@focus="changeAutoPrice=''"-->
+<!--						@change="changeAutoPriceEvent"-->
+<!--					/>-->
 					<input
-						class="change-input"
-						v-model="changeAutoPrice"
-						type="digit"
-						placeholder="自动调价"
+												class="change-input"
+												v-model="changeAutoPrice"
+												type="digit"
+												placeholder="自动调价"
+												@focus="changeAutoPrice=''"
 					/>
 					<!--@change="changePriceEvent"-->
-					<i class="iconfont iconjihuo" v-if="isShowSucceed"></i>
+					<i :class="isShowSucceed?'position iconfont iconjihuo':'position'" ></i>
 					<view class="btn-box" v-if="changeAutoPrice==''" @click="removeEvent">确定</view>
 					<view class="btn-box" v-else @click="changePriceEvent">确定</view>
 					<!--<i class="iconfont iconcachu edit" v-if="info.priceLabel==2" @click="removeEvent"></i>-->
@@ -44,11 +53,13 @@
 import { COMMODITY_TYPE } from "@/utils/declare";
 import AppImg from "@/components/app-img";
 import { autoPriceByIdApi, changePriceByIdApi } from '@/api/product/index'
+import productMins from "@/mixins/productContrapose";
 export default {
 	name: "Commodity",
 	components: {
 		AppImg
 	},
+	mixins: [productMins],
 	props: {
 		info: {
 			required: true,
@@ -69,7 +80,7 @@ export default {
 			type: Number,
 			default: 0
 		},
-		// autoPrice: {}
+		autoPrice: {}
 	},
 	data() {
 		return {
@@ -79,6 +90,10 @@ export default {
 		};
 	},
 	created() {},
+	mounted() {
+		// console.log(getSelectItemById(this.info.id).autoPrice)
+		// this.autoPrice = getSelectItemById(this.info.id).autoPrice
+	},
 	methods: {
 		addEvent() {
 			this.$emit("add", this.info);
@@ -106,6 +121,9 @@ export default {
 			// } = event;
 			this.changeAutoPrice = event.detail.value
 		},
+		changeAutoPriceEvent(event){
+			this.changeAutoPrice = event.detail.value
+		},
 		async changePriceEvent(event) {
 			// const {
 			// 	detail: { value }
@@ -174,10 +192,15 @@ export default {
 				display: flex;
 				align-items: center;
 				& .iconfont {
-					margin-left: 15rpx;
+					//margin-left: 15rpx;
 					color: #3385ff;
 					font-size: 30px;
 				}
+				.position{
+					display: block;
+					width: 70rpx;
+					text-align: center;
+				}
 				.iconcachu {
 					margin: 0 6px 0 20px;
 					color: #ccc;

+ 3 - 3
ghsApp/src/mixins/productContrapose.js

@@ -22,13 +22,13 @@ export default {
 		}
 
 		if (this.autoLoad) {
-			this.initData();
+			this.initDataContrapose();
 		}
 	},
 	onUnload() {},
 	computed: {
 		...mapGetters(["getSelectInfo"]),
-		filterProductInfo() {
+		filterProductInfoContrapose() {
 			let list = copyObject(this.productInfo);
 			return list;
 		},
@@ -108,7 +108,7 @@ export default {
 		/**
 		 * 请求商品数据
 		 */
-		async initData(extendInfo) {
+		async initDataContrapose(extendInfo) {
 			//extendInfo调用时的扩展参数  如  shopId
 			try {
 				let params = {

+ 7 - 7
ghsApp/src/pagesOrder/shipInfo.vue

@@ -130,13 +130,13 @@ export default {
 		async formSubmit(e) {
 			try {
 				// 表单规则
-				let rules = [
-					{
-						name: "sendTime",
-						rule: ["required"],
-						msg: ["请输入具体时间"]
-					}
-				];
+				let rules = [];
+
+				// {
+				// 	name: "sendTime",
+				// 		rule: ["required"],
+				// 	msg: ["请输入具体时间"]
+				// }
 				// 进行表单检查
 				let formData = this.form;
 				if (formData.sendType == "1") {

+ 51 - 26
ghsApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -13,30 +13,35 @@
 				/>
 			</view>
 		</view>
-		<view class="scroll-middle_bx">
-			<scroll-view
-				scroll-y
-				scroll-with-animation
-				class="tab-view"
-				:scroll-top="scrollTop"
-			>
-				<div
-					v-for="(item, index) in filterProductInfo"
-					:key="index"
-					class="tab-bar-item"
-					:class="[classIndex == index ? 'active' : '']"
-					:data-current="index"
-					@tap.stop="swichClass"
-				>
+		<view v-if="tabs[tabIndex].name=='库存预警'" class="scroll-middle_bx">
+			<!--内容部分 start -->
+			<!--内容部分 start -->
+			<block v-if="!$util.isEmpty(filterProductInfoContrapose)">
+<!--				<view class="item_list_bx" v-for="(classItem, classIndex) in filterProductInfoContrapose" :key="classIndex" :id="`class_${classItem.classId}`">-->
+<!--				</view>-->
+					<!--					<text v-else>当前库存充足</text>-->
+				<view class="item_list_bx">
+					<template v-for="(productItem, productIndex) in filterProductInfoContrapose">
+						<CommodityStock
+							:isPrice="false"
+							:type="tabs[tabIndex].key"
+							:key="productIndex"
+							:info="productItem"
+						></CommodityStock>
+					</template>
+				</view>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfoContrapose)"/>
+			</block>
+		</view>
+		<view v-else class="scroll-middle_bx">
+			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
+				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass">
 					<text>{{ item.className || "" }}</text>
 				</div>
 			</scroll-view>
-			<scroll-view
-				scroll-y
-				class="right-box"
-				v-if="currentTab == index"
-				:scroll-into-view="scrollClassId"
-			>
+			<scroll-view scroll-y class="right-box" v-if="currentTab == index" :scroll-into-view="scrollClassId">
 				<!--内容部分 start -->
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
@@ -73,6 +78,7 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import CommodityStock from "../components/CommodityStock";
 import { STOCK_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
+import productContraposeMins from "@/mixins/productContrapose";
 import { selectShop } from "@/mixins";
 import { mapGetters } from "vuex";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
@@ -85,7 +91,7 @@ export default {
 		CommodityStock,
 		DorpdownSelect
 	},
-	mixins: [productMins, selectShop],
+	mixins: [productMins, selectShop,productContraposeMins],
 	data() {
 		return {
 			STOCK_TYPE,
@@ -108,7 +114,12 @@ export default {
 		let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 		// 当前门店
 		this.shopId = this.userInfo.id;
-		this.initData({ type, shopId: this.shopId });
+		if(type=="waring"){
+			this.initDataContrapose({ type, shopId: this.shopId });
+		}else{
+			this.initData({ type, shopId: this.shopId });
+		}
+
 	},
 
 	methods: {
@@ -128,14 +139,23 @@ export default {
 				this.tabIndex = e.index;
 				this.tabs[this.tabIndex].key;
 				let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
-				this.initData({ type, shopId: this.shopId });
+				if(type=="waring"){
+					this.initDataContrapose({ type, shopId: this.shopId });
+				}else{
+					this.initData({ type, shopId: this.shopId });
+				}
 			}
 		},
 		searchFn() {
 			uni.showLoading({
 				title: "加载中"
 			});
-			this.initData({ shopId: this.shopId });
+			if(type=="waring"){
+				this.initDataContrapose({ type, shopId: this.shopId });
+			}else{
+				this.initData({ type, shopId: this.shopId });
+			}
+			// this.initData({ shopId: this.shopId });
 		},
 		scrollTop() {},
 		selectSussess(val) {
@@ -144,7 +164,12 @@ export default {
 			});
 			let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 			this.shopId = val.selectItem.id;
-			this.initData({ type, shopId: this.shopId });
+			// this.initData({ type, shopId: this.shopId });
+			if(type=="waring"){
+				this.initDataContrapose({ type, shopId: this.shopId });
+			}else{
+				this.initData({ type, shopId: this.shopId });
+			}
 		}
 	}
 };