jf 5 лет назад
Родитель
Сommit
0780f8de20

+ 47 - 30
ghsApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -42,12 +42,7 @@
 							</t-th>
 							</t-th>
 						</t-tr>
 						</t-tr>
 						<t-tr v-for="(item, index) in selectList" :key="index">
 						<t-tr v-for="(item, index) in selectList" :key="index">
-							<t-td
-								v-for="(column, colIndex) in columns"
-								:key="colIndex"
-								:align="column.align"
-								:color="column.color"
-							>
+							<t-td v-for="(column, colIndex) in columns" :key="colIndex" :align="column.align" :color="column.color">
 								<view v-if="column.custom == 'icon'" class="list-icon">
 								<view v-if="column.custom == 'icon'" class="list-icon">
 									<image class="icon-image" :src="item.cover" alt="商品图" />
 									<image class="icon-image" :src="item.cover" alt="商品图" />
 									<view class="icon-info">
 									<view class="icon-info">
@@ -71,14 +66,14 @@
 						</t-tr>
 						</t-tr>
 					</t-table>
 					</t-table>
 				</block>
 				</block>
-				<view v-else class="btn-bar">
+				<view class="btn-bar">
 					<button class="admin-button-com big blue" @click="gotoSelectPage">
 					<button class="admin-button-com big blue" @click="gotoSelectPage">
 						选择商品
 						选择商品
 					</button>
 					</button>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="bar-view">
+		<view class="bar-view" v-if="!$util.isEmpty(selectList)">
 			<view class="btn-view">
 			<view class="btn-view">
 				<button class="admin-button-com middle" @click="createStockOutOrder">
 				<button class="admin-button-com middle" @click="createStockOutOrder">
 					直接出库
 					直接出库
@@ -99,6 +94,7 @@ import AppDatePicker from "@/components/app-date-picker";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import { selectShop } from "@/mixins";
 import { selectShop } from "@/mixins";
 import { createStockOutOrderApi } from "@/api/storehouse/stock";
 import { createStockOutOrderApi } from "@/api/storehouse/stock";
+import {mapActions} from "vuex";
 const formUtil = require("@/utils/formValidation.js");
 const formUtil = require("@/utils/formValidation.js");
 
 
 export default {
 export default {
@@ -137,9 +133,16 @@ export default {
 		};
 		};
 	},
 	},
 	onShow() {
 	onShow() {
-		console.log(6666, this.selectList);
+		console.log('拿到选择商品列表', this.selectList);
 	},
 	},
 	methods: {
 	methods: {
+		...mapActions(["resetSelectInfoByType"]),
+		/**
+			* 清楚页面选中的商品列表  姜枫 2021.03.27
+			* */
+		clearSelectList(){
+			this.resetSelectInfoByType(this.pageType)
+		},
 		async init() {
 		async init() {
 			this.form.inShopId = this.userInfo.id;
 			this.form.inShopId = this.userInfo.id;
 		},
 		},
@@ -155,7 +158,7 @@ export default {
 		selectSussess(val) {
 		selectSussess(val) {
 			this.form.inShopId = val.selectItem.id;
 			this.form.inShopId = val.selectItem.id;
 		},
 		},
-		async createStockOutOrder() {
+		createStockOutOrder() {
 			try {
 			try {
 				let rules = [
 				let rules = [
 					{
 					{
@@ -167,11 +170,6 @@ export default {
 						name: "inShopId",
 						name: "inShopId",
 						rule: ["required"],
 						rule: ["required"],
 						msg: ["请选择门店"]
 						msg: ["请选择门店"]
-					},
-					{
-						name: "remark",
-						rule: ["required"],
-						msg: ["请输入说明"]
 					}
 					}
 				];
 				];
 				let formData = this.form;
 				let formData = this.form;
@@ -189,17 +187,29 @@ export default {
 				let checkRes = formUtil.validation(formData, rules);
 				let checkRes = formUtil.validation(formData, rules);
 				// 验证通过!
 				// 验证通过!
 				if (!checkRes) {
 				if (!checkRes) {
-					await createStockOutOrderApi(formData);
-					this.$msg("出库成功");
-					uni.navigateBack({
-						delta: 1
+					let self = this;
+					uni.showModal({
+						title: '提示',
+						content: '确定直接出库?',
+						success: function (res) {
+							if (res.confirm) {
+								self.confirmStockOut(formData)
+							}
+						}
 					});
 					});
+					// await createStockOutOrderApi(formData);
+					// self.$msg("出库成功");
+					// self.clearSelectList();
+					// uni.navigateBack({
+					// 	delta: 1
+					// });
+
 				} else {
 				} else {
 					this.$msg(checkRes);
 					this.$msg(checkRes);
 				}
 				}
 			} catch (error) {}
 			} catch (error) {}
 		},
 		},
-		async confirmStockOutOrder() {
+		confirmStockOutOrder() {
 			try {
 			try {
 				let rules = [
 				let rules = [
 					{
 					{
@@ -211,11 +221,6 @@ export default {
 						name: "inShopId",
 						name: "inShopId",
 						rule: ["required"],
 						rule: ["required"],
 						msg: ["请选择门店"]
 						msg: ["请选择门店"]
-					},
-					{
-						name: "remark",
-						rule: ["required"],
-						msg: ["请输入说明"]
 					}
 					}
 				];
 				];
 				let formData = this.form;
 				let formData = this.form;
@@ -233,16 +238,28 @@ export default {
 				let checkRes = formUtil.validation(formData, rules);
 				let checkRes = formUtil.validation(formData, rules);
 				// 验证通过!
 				// 验证通过!
 				if (!checkRes) {
 				if (!checkRes) {
-					await createStockOutOrderApi(formData);
-					this.$msg("确认成功");
-					uni.navigateBack({
-						delta: 1
+					let self = this;
+					uni.showModal({
+						title: '提示',
+						content: '确定出库?',
+						success: function (res) {
+							if (res.confirm) {
+								self.confirmStockOut(formData)
+							}
+						}
 					});
 					});
+
 				} else {
 				} else {
 					this.$msg(checkRes);
 					this.$msg(checkRes);
 				}
 				}
 			} catch (error) {}
 			} catch (error) {}
-		}
+		},
+		async confirmStockOut(formData){
+			await createStockOutOrderApi(formData);
+			this.$msg("确认成功");
+			this.clearSelectList();
+			uni.navigateBack({delta: 1});
+		},
 	}
 	}
 };
 };
 </script>
 </script>

+ 13 - 1
ghsApp/src/pagesStorehouse/allot/exDetails.vue

@@ -98,7 +98,7 @@
 				<button
 				<button
 					v-if="outData.status == OUT_STATUS.CONFIRM"
 					v-if="outData.status == OUT_STATUS.CONFIRM"
 					class="admin-button-com middle"
 					class="admin-button-com middle"
-					@click="confirmEvent"
+					@click="confirmEventPop"
 				>
 				>
 					确认
 					确认
 				</button>
 				</button>
@@ -195,6 +195,18 @@ export default {
 				});
 				});
 			} catch (error) {}
 			} catch (error) {}
 		},
 		},
+		confirmEventPop(){
+			let self = this;
+			uni.showModal({
+				title: '提示',
+				content: '确定出库?',
+				success: function (res) {
+					if (res.confirm) {
+						self.confirmEvent();
+					}
+				}
+			});
+		},
 		async confirmEvent() {
 		async confirmEvent() {
 			try {
 			try {
 				await confirmStockOutOrderApi(this.orderSn);
 				await confirmStockOutOrderApi(this.orderSn);

+ 6 - 1
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -260,9 +260,14 @@ export default {
 				this.cancelEvent();
 				this.cancelEvent();
 			}
 			}
 		},
 		},
+
+
 		confirmSelectEvent() {
 		confirmSelectEvent() {
 			if (this.selectList.length > 0) {
 			if (this.selectList.length > 0) {
-				this.showSubmitModel = true;
+				uni.navigateBack({
+					delta: 1
+				});
+				// this.showSubmitModel = true;
 			}
 			}
 		},
 		},
 		change(e) {
 		change(e) {

+ 13 - 1
ghsApp/src/pagesStorehouse/allot/putDetails.vue

@@ -88,7 +88,7 @@
 		<view class="bar-view">
 		<view class="bar-view">
 			<view class="info-view"> 入库数量:{{ sumCount }} </view>
 			<view class="info-view"> 入库数量:{{ sumCount }} </view>
 			<view class="btn-view" v-if="putData.status == PUT_STATUS.CONFIRM">
 			<view class="btn-view" v-if="putData.status == PUT_STATUS.CONFIRM">
-				<button class="admin-button-com middle" @click="putEvent">
+				<button class="admin-button-com middle" @click="confirmPutEvent">
 					入库
 					入库
 				</button>
 				</button>
 			</view>
 			</view>
@@ -174,6 +174,18 @@ export default {
 			}
 			}
 			return name;
 			return name;
 		},
 		},
+		confirmPutEvent(){
+			let self = this;
+			uni.showModal({
+				title: '提示',
+				content: '确定入库',
+				success: function (res) {
+					if (res.confirm) {
+						self.putEvent();
+					}
+				}
+			});
+		},
 		async putEvent() {
 		async putEvent() {
 			try {
 			try {
 				await confirmOrderApi(this.orderSn);
 				await confirmOrderApi(this.orderSn);