shish 4 лет назад
Родитель
Сommit
2cbea7cc01

+ 2 - 8
ghsApp/src/admin/breakage/confirm.vue

@@ -1,7 +1,6 @@
 <template>
   <view class="affirm-page">
     <view class="affirm-view overscroll">
-      <!-- 门店信息 -->
       <form>
         <view class="module-com">
           <view class="commodity-view">
@@ -215,22 +214,17 @@ export default {
           itemId: ele.itemId
         };
       });
-
       that.$util.confirmModal({content:'确认报损?'},() => {
-
           wastage({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
             //删除记忆
             that.removeFromSaveDirect()
             const {data: { id, orderSn },} = res;
-            let url = '/admin/breakage/result';
-            uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});
+            that.pageTo({url: '/admin/breakage/result',type:2})
           });
-
       })
-
     },
     gobackEvent () {
-      uni.navigateBack({delta: 1,})
+      this.pageTo({url: '/admin/breakage/index',type:2})
     },
   },
 };

+ 4 - 20
ghsApp/src/admin/breakage/index.vue

@@ -68,13 +68,7 @@
 		</modal-module>
 
 		<!-- 花材不足提示框 -->
-		<modal-module
-			:show="showSubmitModel"
-			:title="confirmContent"
-			color="#333"
-			:size="32"
-			padding="30upx 30upx"
-		>
+		<modal-module :show="showSubmitModel" title="确认下一步?" color="#333" :size="32" padding="30upx 30upx" >
 		</modal-module>
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" ></FooterCart>
 	</view>
@@ -103,10 +97,10 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			selectJobType: "wastage", //选择商品页面类别  用于区分不同功能的数据
+			selectJobType: "wastage", //选择商品页面类别
 			COMMODITY_TYPE,
 			isAddModel: false,
-			isSmallCount:false,//是否是小单位(支)
+			isSmallCount:false,
 			checkStock:true,
 			customData: {
 				bigCount: 0,
@@ -117,26 +111,16 @@ export default {
 		};
 	},
 	computed: {
-		confirmContent() {
-			let content = "确认下一步?";
-			if (this.hasNoStock) {
-				content = "有花材库存不足,确认下一步?";
-			}
-			return content;
-		}
 	},
-
 	onUnload() {
-		this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
 	},
-
 	methods: {
 		confirmToSave() {
 			if(this.$util.isEmpty(this.selectList)){
 				this.$msg('请选择花材')
 				return false
 			}
-			uni.navigateTo({url: "/admin/breakage/confirm"})
+			this.$util.pageTo({ url: "/admin/breakage/confirm",type:2})
 		}
 	}
 };

+ 62 - 23
ghsApp/src/admin/breakage/result.vue

@@ -1,31 +1,70 @@
 <template>
-  <appResult title="报损成功">
-	<button class="admin-button-com big" @click="goBack">返回首页</button>
-  </appResult>
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="top-view"> </view>
+			<view class="result-view">
+				<view class="iconfont iconchenggong"></view>
+				<view class="result-title">报损成功</view>
+				<button class="admin-button-com big blue" style="width:45vh;" @click="goBackHome">返回首页</button>
+			</view>
+		</view>
+	</view>
 </template>
+
 <script>
-import appResult from "@/components/app-result";
 export default {
-  name: "BillingResult",
-  components: {
-    appResult,
-  },
-  data() {
-    return {
-      detailInfo: {},
-    };
-  },
-  methods: {
-    goBack() {
-      this.$util.pageTo({ url: "/admin/home/workbench", type: 3, query: { tabIndex: 0 }})
-    }
-  }
+    name: "success",
+	methods: {
+		goBackHome() {
+			uni.navigateBack({})
+		}
+	}
 };
 </script>
-
 <style lang="scss" scoped>
-.admin-button-com {
-  margin-bottom: 20upx;
-  width: 100%;
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.billing_box_bg {
+	position: relative;
+	padding: 60upx 30upx;
+	display: flex;
+	background: white;
+	flex-direction: column;
+    background-color: #f5f5f5;
+	.top-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 299upx;
+		background: #3385ff;
+		border-radius: 0upx 0upx 83upx 83upx;
+	}
+	.result-view {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 70upx;
+		width: 100%;
+		background: #ffffff;
+		border-radius: 20upx;
+		z-index: 1;
+		.iconchenggong {
+			font-size: 170upx;
+			color: $mainColor1;
+		}
+		.result-title {
+			margin: 50upx 0 70upx;
+			font-size: 32upx;
+		}
+	}
 }
-</style>
+</style>

+ 58 - 81
ghsApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -73,14 +73,12 @@
 				</block>
 				<view class="btn-bar">
 					<button class="admin-button-com big blue" @click="gotoSelectPage">选择花材</button>
-					<button v-if="!$util.isEmpty(selectList)" class="admin-button-com big blue" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
 				</view>
 			</view>
 		</view>
-		<view class="bar-view" v-if="!$util.isEmpty(selectList)">
-			<view class="btn-view">
-				<button class="admin-button-com middle" @click="createStockOutOrder" style="padding-left:30upx;padding-right:30upx">出库</button>
-			</view>
+		<view class="app-footer open_btn">
+			<button v-if="!$util.isEmpty(selectList)" class="admin-button-com middle default" @click="removeFromSave()">清空花材</button>
+			<button @click="stockOutFn()" class="admin-button-com middle blue">确认出库</button>
 		</view>
 	</view>
 </view>
@@ -94,54 +92,37 @@ import { selectShop } from "@/mixins";
 import { createStockOutOrderApi } from "@/api/storehouse/stock";
 import {mapActions, mapGetters} from "vuex";
 const formUtil = require("@/utils/formValidation.js");
-
 export default {
 	components: { TuiListCell, AppDatePicker, DorpdownSelect },
 	mixins: [productMins, selectShop],
-	computed: {		...mapGetters(["getLoginInfo"])	},
+	computed: {
+		...mapGetters(["getLoginInfo"])
+	},
 	data() {
 		return {
 			selectJobType: "allotEx",
-			autoLoad: false,
+			autoLoad:true,
 			form: {
 				date: "",
 				remark: "",
 				inShopId: ""
 			},
-			columns: [
-				{
-					name: "花材名称",
-					custom: "icon"
-				},
-				{
-					name: "库存",
-					dataIndex: "stock",
-					// color: "success",
-					width: 120,
-					align: "center"
-				},
-				{
-					name: "出库数量",
-					custom: "excount",
-					// color: "warn",
-					width: 120,
-					align: "center"
-				}
+			columns:[ 
+				{ name: "花材名称", custom: "icon" }, 
+				{ name: "库存", dataIndex: "stock", width: 120, align: "center" }, 
+				{ name: "出库数量", custom: "excount", width: 120, align: "center" }
 			],
-      shopPlaceholder: '请选择门店',
-      typeTimeShow: true,
-      isShowTit: true
+			shopPlaceholder: '请选择门店',
+			typeTimeShow: true,
+			isShowTit: true
 		};
 	},
 	onShow() {
-		console.log('拿到选择商品列表', this.selectList);
 	},
 	onLoad(){
 	},
 	methods: {
 		...mapActions(["reSetSelectInfo"]),
-		async init() {
-		},
 		gotoSelectPage() {
 			uni.navigateTo({ url: `/pagesStorehouse/allot/exSelect`, success: result => {}, fail: () => {}, complete: () => {} })
 		},
@@ -157,63 +138,59 @@ export default {
 			this.shopPlaceholder = ''
 			this.form.inShopId = val.selectItem.id;
 		},
-		createStockOutOrder() {
-			try {
-				let rules = [ { name: "inShopId", rule: ["required"], msg: ["请选择门店"] } ];
-				let formData = this.form;
-				const itemInfo = this.selectList.map(ele => {
-					return {
-						productId: ele.id,
-						bigNum: ele.bigCount,
-						smallNum: ele.smallCount
-					};
-				});
-				formData.itemInfo = JSON.stringify(itemInfo);
+		stockOutFn() {
+			let rules = [ { name: "inShopId", rule: ["required"], msg: ["请选择门店"] } ];
+			let formData = this.form;
+			const itemInfo = this.selectList.map(ele => {
+				return {
+					productId: ele.id,
+					bigNum: ele.bigCount,
+					smallNum: ele.smallCount
+				};
+			});
+			formData.itemInfo = JSON.stringify(itemInfo);
 
-				formData.action = "confirm";
+			formData.action = "confirm";
 
-				let checkRes = formUtil.validation(formData, rules);
-				// 验证通过!
-				if (!checkRes) {
-					let that = this;
-					that.$util.confirmModal({content:'确定出库?'},() => {
-						that.confirmStockOut(formData)
-					})
-				} else {
-					this.$msg(checkRes);
-				}
-			} catch (error) {}
+			let checkRes = formUtil.validation(formData, rules);
+			// 验证通过!
+			if (!checkRes) {
+				let that = this;
+				that.$util.confirmModal({content:'确定出库?'},() => {
+					that.confirmStockOut(formData)
+				})
+			} else {
+				this.$msg(checkRes);
+			}
 		},
 		confirmStockOutOrder() {
-			try {
-				let rules = [ { name: "inShopId", rule: ["required"], msg: ["请选择门店"] } ];
-				let formData = this.form;
-				const itemInfo = this.selectList.map(ele => {
-					return {
-						productId: ele.id,
-						bigNum: ele.bigCount,
-						smallNum: ele.smallCount
-					};
-				});
-				formData.itemInfo = JSON.stringify(itemInfo);
+			let rules = [ { name: "inShopId", rule: ["required"], msg: ["请选择门店"] } ];
+			let formData = this.form;
+			const itemInfo = this.selectList.map(ele => {
+				return {
+					productId: ele.id,
+					bigNum: ele.bigCount,
+					smallNum: ele.smallCount
+				};
+			});
+			formData.itemInfo = JSON.stringify(itemInfo);
 
-				formData.action = "wait";
+			formData.action = "wait";
 
-				let checkRes = formUtil.validation(formData, rules);
-				// 验证通过!
-				if (!checkRes) {
-					let self = this;
-					self.confirmStockOut(formData)
-				} else {
-					this.$msg(checkRes);
-				}
-			} catch (error) {}
+			let checkRes = formUtil.validation(formData, rules);
+			// 验证通过!
+			if (!checkRes) {
+				let self = this;
+				self.confirmStockOut(formData)
+			} else {
+				this.$msg(checkRes);
+			}
 		},
 		async confirmStockOut(formData){
-			let { data } = await createStockOutOrderApi(formData);
+			let { data } = await createStockOutOrderApi(formData)
 			this.$msg("确认成功")
 			this.removeFromSaveDirect()
-			this.pageTo({url:'/pagesStorehouse/allot/exDetails?orderSn=' + data.orderSn, type: 2});
+			this.pageTo({url:'/pagesStorehouse/allot/exDetails',query:{orderSn:data.orderSn}, type: 2})
 		},
 	}
 };
@@ -299,4 +276,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 14 - 52
ghsApp/src/pagesStorehouse/allot/exDetails.vue

@@ -17,15 +17,8 @@
 				</view>
 				<view class="info-cell">
 					<view class="cell-label"> 状态</view>
-					<view
-						:class="[
-							'cell-value',
-							{ warning: outData.status == OUT_STATUS.CONFIRM },
-							{ success: outData.status == OUT_STATUS.DONE }
-						]"
-					>
-						{{ getItemStatusName(outData.status) || "" }}</view
-					>
+					<view :class="[ 'cell-value', { warning: outData.status == OUT_STATUS.CONFIRM }, { success: outData.status == OUT_STATUS.DONE } ]" >
+						{{ getItemStatusName(outData.status) || "" }}</view>
 				</view>
 				<view class="info-cell">
 					<view class="cell-label"> 备注</view>
@@ -104,18 +97,12 @@
 				</button>
 			</view>
 		</view>
-    <!-- <kd-entrance></kd-entrance> -->
 	</view>
 </template>
 <script>
 import { OUT_STATUS } from "@/utils/declare";
-import {
-	getStockOutDetailApi,
-	confirmStockOutOrderApi,
-	cancelStockOutOrderApi
-} from "@/api/storehouse/stock";
+import { getStockOutDetailApi, confirmStockOutOrderApi, cancelStockOutOrderApi } from "@/api/storehouse/stock";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-
 export default {
 	components: { AppWrapperEmpty },
 	data() {
@@ -124,24 +111,9 @@ export default {
 			orderSn: "",
 			outData: {},
 			columns: [
-				{
-					name: "花材名称",
-					custom: "icon"
-				},
-				{
-					name: "库存",
-					custom: "stock",
-					// color: "success",
-					width: 120,
-					align: "center"
-				},
-				{
-					name: "出库数量",
-					custom: "put",
-					// color: "warn",
-					width: 120,
-					align: "center"
-				}
+				{ name: "花材名称", custom: "icon" },
+				{ name: "库存", custom: "stock", width: 120, align: "center" },
+				{ name: "出库数量", custom: "put", width: 120, align: "center" }
 			]
 		};
 	},
@@ -167,10 +139,8 @@ export default {
 	},
 	methods: {
 		async initData() {
-			try {
-				const { data } = await getStockOutDetailApi(this.orderSn);
-				this.outData = data;
-			} catch (error) {}
+			const { data } = await getStockOutDetailApi(this.orderSn);
+			this.outData = data;			
 		},
 		getItemStatusName(status) {
 			let name = "";
@@ -188,13 +158,9 @@ export default {
 			return name;
 		},
 		async cancelEvent() {
-			try {
-				await cancelStockOutOrderApi(this.orderSn);
-				await this.initData();
-				wx.showToast({
-					title: "取消成功"
-				});
-			} catch (error) {}
+			await cancelStockOutOrderApi(this.orderSn);
+			await this.initData();
+			uni.showToast({ title: "取消成功" })
 		},
 		confirmEventPop(){
 			let that = this;
@@ -203,13 +169,9 @@ export default {
 			})
 		},
 		async confirmEvent() {
-			try {
-				await confirmStockOutOrderApi(this.orderSn);
-				await this.initData();
-				wx.showToast({
-					title: "成功出库"
-				});
-			} catch (error) {}
+			await confirmStockOutOrderApi(this.orderSn)
+			await this.initData()
+			uni.showToast({ title: "成功出库" })
 		}
 	}
 };

+ 68 - 117
ghsApp/src/pagesStorehouse/inventory/update.vue

@@ -63,7 +63,7 @@
 		</view>
 		<view class="bar-view" v-if="selectList.length>0">
 			<view class="btn-view">
-				<button class="admin-button-com middle" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
+				<button class="admin-button-com middle default" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
 				<button :class="['admin-button-com', 'middle']" @click="gotoSelectPage"> 修改花材 </button>
 				<button v-if="!orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(1)"> 确认盘点 </button>
 				<button v-if="orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(2)"> 确认盘点 </button>
@@ -75,13 +75,7 @@
 import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/product";
 import { mapActions, mapGetters } from "vuex";
-import {
-	updateCheckOrderApi,
-	updateCheckOrderToDraftApi,
-	savaCheckOrderDraftApi,
-	getCheckOrderDetailApi,
-	checkOrderApi
-} from "@/api/inventory/index";
+import { updateCheckOrderApi, updateCheckOrderToDraftApi, savaCheckOrderDraftApi, getCheckOrderDetailApi, checkOrderApi } from "@/api/inventory/index";
 import {currentShop} from "@/api/shop/index";
 export default {
 	components: { TuiListCell },
@@ -90,29 +84,14 @@ export default {
 		return {
 			orderSn: null,
 			infoData: null,
-			autoLoad: false,
+			autoLoad: true,
 			shopInfo:{shopName:''},
 			remark: "",
 			selectJobType: "inventory",
 			columns: [
-				{
-					name: "名称",
-					custom: "icon"
-				},
-				{
-					name: "库存",
-					custom: "stock",
-					// color: "success",
-					width: 120,
-					align: "center"
-				},
-				{
-					name: "盘点数",
-					custom: "inventory",
-					color: "warn",
-					width: 120,
-					align: "center"
-				},
+				{ name: "名称", custom: "icon" },
+				{ name: "库存", custom: "stock", width: 120, align: "center" },
+				{ name: "盘点数", custom: "inventory", color: "warn", width: 120, align: "center" },
 				{
 					name: "盈亏数",
 					color: "success",
@@ -147,50 +126,32 @@ export default {
 	methods: {
 		...mapActions(["initMerchantInfo"]),
 		async initInfo() {
-			try {
-				const { data } = await getCheckOrderDetailApi(this.orderSn);
-				this.infoData = data;
-				const { remark, itemInfo } = data;
-				this.remark = remark;
-				this.setSelectInfo({
-					selectJobType: this.selectJobType,
-					info: itemInfo.map(ele => {
-						return { ...ele, bigNum: Number(ele.bigNumStock), smallNum: Number(ele.smallNumStock), bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) }
-					}),
-					selectJobId:this.selectJobId
-				});
-			} catch (error) {}
+			const { data } = await getCheckOrderDetailApi(this.orderSn);
+			this.infoData = data;
+			const { remark, itemInfo } = data;
+			this.remark = remark;
+			this.setSelectInfo({
+				selectJobType: this.selectJobType,
+				info: itemInfo.map(ele => {
+					return { ...ele, bigNum: Number(ele.bigNumStock), smallNum: Number(ele.smallNumStock), bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) }
+				}),
+				selectJobId:this.selectJobId
+			})
 		},
 		gotoSelectPage() {
-			uni.navigateTo({
-				url: "/pagesStorehouse/inventory/select",
-				success: result => {},
-				fail: () => {},
-				complete: () => {}
-			});
+			uni.navigateTo({ url: "/pagesStorehouse/inventory/select" })
 		},
 		getInfo(){
 			return currentShop().then(res => {
 				this.shopInfo = res.data
-					console.log('getInfo',res)
-				})
-				.catch(err => {});
+			})
 		},
-		/**
-		 * 获取当前选中商品总价
-		 */
+		//获取当前选中商品总价
 		getSelectItemProfitPrice(item) {
-			let price = 0;
-			const {
-				bigCount,
-				smallCount,
-				bigNum,
-				smallNum,
-				bigPrice,
-				smallPrice
-			} = item;
-			let bigNumProfitLoss = Number(bigCount) - Number(bigNum);
-			let smallNumProfitLoss = Number(smallCount) - Number(smallNum);
+			let price = 0
+			const { bigCount, smallCount, bigNum, smallNum, bigPrice, smallPrice } = item
+			let bigNumProfitLoss = Number(bigCount) - Number(bigNum)
+			let smallNumProfitLoss = Number(smallCount) - Number(smallNum)
 			// let sum = Number(bigCount) * Number(bigPrice) + Number(smallCount) * Number(smallPrice);
 			// price = Math.round(sum * 100) / 100;
 			// let stockSum = Number(bigNum) * Number(bigPrice) + Number(smallNum) * Number(smallPrice);
@@ -200,32 +161,28 @@ export default {
 			return diff;
 		},
 		async saveToDraft() {
-			try {
-				let api = savaCheckOrderDraftApi;
-				if (this.orderSn) {
-					api = updateCheckOrderToDraftApi;
-				}
-				let params = {
-					remark: this.remark
+			let api = savaCheckOrderDraftApi;
+			if (this.orderSn) {
+				api = updateCheckOrderToDraftApi;
+			}
+			let params = {
+				remark: this.remark
+			};
+			if (this.orderSn) {
+				params.orderSn = this.orderSn;
+			}
+			let formatList = this.selectList.map(ele => {
+				return {
+					bigNum: ele.bigCount,
+					smallNum: ele.smallCount,
+					productId: ele.id,classId:ele.classId,itemId:ele.itemId
 				};
-				if (this.orderSn) {
-					params.orderSn = this.orderSn;
-				}
-				let formatList = this.selectList.map(ele => {
-					return {
-						bigNum: ele.bigCount,
-						smallNum: ele.smallCount,
-						productId: ele.id,classId:ele.classId,itemId:ele.itemId
-					};
-				});
-				params.itemInfo = JSON.stringify(formatList);
-				const {
-					data: { orderSn }
-				} = await api(params);
-				this.orderSn = orderSn;
-				this.$msg("保存成功");
-				this.initInfo();
-			} catch (error) {}
+			});
+			params.itemInfo = JSON.stringify(formatList);
+			const { data: { orderSn } } = await api(params)
+			this.orderSn = orderSn
+			this.$msg("保存成功")
+			this.initInfo()
 		},
 		confirmPop(type) {
 			let that = this;
@@ -234,32 +191,29 @@ export default {
 			})
 		},
 		async saveCheckOrder(type) {
-			try {
-				console.log(type)
-				let params = {
-					remark: this.remark
+			let params = {
+				remark: this.remark
+			};
+			if (this.orderSn) {
+				params.orderSn = this.orderSn;
+			}
+			let formatList = this.selectList.map(ele => {
+				return {
+					bigNum: ele.bigCount,
+					smallNum: ele.smallCount,
+					productId: ele.id
 				};
-				if (this.orderSn) {
-					params.orderSn = this.orderSn;
-				}
-				let formatList = this.selectList.map(ele => {
-					return {
-						bigNum: ele.bigCount,
-						smallNum: ele.smallCount,
-						productId: ele.id
-					};
-				});
-				params.itemInfo = JSON.stringify(formatList);
-				//type 1直接确定 2保存草稿后在确定
-				if(type==1){
-					await checkOrderApi(params)
-				}else{
-					await updateCheckOrderApi(params)
-				}
-				this.$msg("盘点成功");
-				this.removeFromSaveDirect()
-				uni.navigateBack({delta: 1});
-			} catch (error) {}
+			});
+			params.itemInfo = JSON.stringify(formatList);
+			//type 1直接确定 2保存草稿后在确定
+			if(type==1){
+				await checkOrderApi(params)
+			}else{
+				await updateCheckOrderApi(params)
+			}
+			this.$msg("盘点成功");
+			this.removeFromSaveDirect()
+			uni.navigateBack({delta: 1})
 		},
 	}
 };
@@ -335,9 +289,7 @@ export default {
 		padding: 0 30upx;
 		width: 100%;
 		height: 100upx;
-
 		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
-
 		.btn-view {
 			display: flex;
 			.admin-button-com {
@@ -350,7 +302,6 @@ export default {
 	.table-header {
 		display: flex;
 		padding: 20upx 30upx;
-
 		box-shadow: 0upx 1upx 0upx 0upx #eeeeee;
 		color: #999999;
 		.table-th {
@@ -379,4 +330,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>