zhengxin 5 лет назад
Родитель
Сommit
ad77e218ee

+ 41 - 28
ghs/src/mixins/product.js

@@ -9,7 +9,8 @@ export default {
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
-			autoLoad: true //自动获取商品信息
+			autoLoad: true, //自动获取商品信息
+			isLimit: true //选择数量不能大于库存限制
 		};
 	},
 	onLoad(options) {
@@ -203,20 +204,27 @@ export default {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
-					if (element.bigCount < item.bigNum) {
+					if (this.isLimit) {
+						if (element.bigCount < item.bigNum) {
+							list[index] = { ...element, bigCount: ++element.bigCount };
+						} else if (element.smallCount < item.smallNum) {
+							list[index] = { ...element, smallCount: ++element.smallCount };
+						}
+					} else {
 						list[index] = { ...element, bigCount: ++element.bigCount };
-					} else if (element.smallCount < item.smallNum) {
-						list[index] = { ...element, smallCount: ++element.smallCount };
 					}
-					const { bigCount, smallCount } = list[index];
-					//超过库存时 设置为库存最大值
-					const ratio = Number(item.ratio);
-					if (
-						Number(bigCount) * ratio + Number(smallCount) >
-						Number(item.bigNum) * ratio + Number(item.smallNum)
-					) {
-						list[index].bigCount = Number(item.bigNum);
-						list[index].smallCount = Number(item.smallNum);
+
+					if (this.isLimit) {
+						const { bigCount, smallCount } = list[index];
+						//超过库存时 设置为库存最大值
+						const ratio = Number(item.ratio);
+						if (
+							Number(bigCount) * ratio + Number(smallCount) >
+							Number(item.bigNum) * ratio + Number(item.smallNum)
+						) {
+							list[index].bigCount = Number(item.bigNum);
+							list[index].smallCount = Number(item.smallNum);
+						}
 					}
 
 					break;
@@ -258,21 +266,24 @@ export default {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
+
 					if (element.bigCount > 0) {
 						list[index] = { ...element, bigCount: --element.bigCount };
 					} else if (element.smallCount > 0) {
 						list[index] = { ...element, smallCount: --element.smallCount };
 					}
 
-					const { bigCount, smallCount } = list[index];
-					//超过库存时 设置为库存最大值
-					const ratio = Number(item.ratio);
-					if (
-						Number(bigCount) * ratio + Number(smallCount) >
-						Number(item.bigNum) * ratio + Number(item.smallNum)
-					) {
-						list[index].bigCount = Number(item.bigNum);
-						list[index].smallCount = Number(item.smallNum);
+					if (this.isLimit) {
+						const { bigCount, smallCount } = list[index];
+						//超过库存时 设置为库存最大值
+						const ratio = Number(item.ratio);
+						if (
+							Number(bigCount) * ratio + Number(smallCount) >
+							Number(item.bigNum) * ratio + Number(item.smallNum)
+						) {
+							list[index].bigCount = Number(item.bigNum);
+							list[index].smallCount = Number(item.smallNum);
+						}
 					}
 
 					break;
@@ -329,12 +340,14 @@ export default {
 					const { bigCount, smallCount } = list[index];
 					//超过库存时 设置为库存最大值
 					const ratio = Number(item.ratio);
-					if (
-						Number(bigCount) * ratio + Number(smallCount) >
-						Number(item.bigNum) * ratio + Number(item.smallNum)
-					) {
-						list[index].bigCount = Number(item.bigNum);
-						list[index].smallCount = Number(item.smallNum);
+					if (this.isLimit) {
+						if (
+							Number(bigCount) * ratio + Number(smallCount) >
+							Number(item.bigNum) * ratio + Number(item.smallNum)
+						) {
+							list[index].bigCount = Number(item.bigNum);
+							list[index].smallCount = Number(item.smallNum);
+						}
 					}
 
 					list[index] = {

+ 2 - 2
ghs/src/pagesStorehouse/inventory/details.vue

@@ -166,8 +166,8 @@ export default {
 			let small = 0;
 			if (this.dataInfo.itemInfo) {
 				for (const item of this.dataInfo.itemInfo) {
-					big += item.bigNumProfitLoss;
-					small += item.smallNumProfitLoss;
+					big += Number(item.bigNumProfitLoss);
+					small += Number(item.smallNumProfitLoss);
 				}
 			}
 			return `${big}/${small}`;

+ 12 - 1
ghs/src/pagesStorehouse/inventory/list.vue

@@ -63,6 +63,7 @@ export default {
 	mixins: [list],
 	data() {
 		return {
+			listLoading: false,
 			INVENTORY_STATUS,
 			tabIndex: 0,
 			tabs: [
@@ -81,6 +82,12 @@ export default {
 			]
 		};
 	},
+	onShow() {
+		if (!this.listLoading) {
+			this.resetList();
+			this.init();
+		}
+	},
 	onPullDownRefresh() {
 		this.resetList();
 		this._list().then(res => {
@@ -92,11 +99,15 @@ export default {
 			this._list();
 		},
 		_list() {
+			this.listLoading = true;
 			return getCheckOrderListApi(this.tabs[this.tabIndex].key)
 				.then(res => {
 					this.completes(res);
+					this.listLoading = false;
 				})
-				.catch(err => {});
+				.catch(err => {
+					this.listLoading = false;
+				});
 		},
 		changeTabEvent(info) {
 			const { index } = info;

+ 185 - 93
ghs/src/pagesStorehouse/inventory/select.vue

@@ -1,11 +1,14 @@
 <template>
 	<view class="billing_box_bg">
 		<view class="input-wrap">
-			<app-search-module
-				placeholder="输入商品名拼音首字母查询"
-				@search="searchFn"
-			/>
+			<app-search-module placeholder="请输入关键词搜索" @search="searchFn" />
 		</view>
+		<app-tabs
+			:tabs="tabs"
+			:currentTab="tabIndex"
+			@change="change"
+			itemWidth="50%"
+		/>
 		<view class="scroll-middle_bx">
 			<scroll-view
 				scroll-y
@@ -14,143 +17,244 @@
 				:scroll-top="scrollTop"
 			>
 				<div
-					v-for="(item, index) in tabbar"
+					v-for="(item, index) in productInfo"
 					:key="index"
 					class="tab-bar-item"
-					:class="[currentTab == index ? 'active' : '']"
+					:class="[classIndex == index ? 'active' : '']"
 					:data-current="index"
-					@tap.stop="swichNav($event, item)"
+					@tap.stop="swichClass"
 				>
-					<text>{{ item.categoryName || "暂无" }}</text>
-					<!-- <text class="tag">4/10</text> -->
+					<text>{{ item.className || "" }}</text>
+					<text
+						class="tag"
+						v-if="
+							getSelectClassById(item.classId).bigCount > 0 ||
+								getSelectClassById(item.classId).smallCount > 0
+						"
+					>
+						<text v-if="getSelectClassById(item.classId).bigCount > 0">
+							{{ `${getSelectClassById(item.classId).bigCount}/` }}
+						</text>
+						<text>{{ getSelectClassById(item.classId).smallCount }}</text>
+					</text>
 				</div>
 			</scroll-view>
-			<block v-for="(item, index) in tabbar" :key="index">
-				<scroll-view scroll-y class="right-box" v-if="currentTab == index">
-					<view class="item_list_bx">
-						<view class="item_list_title">{{ item.categoryName }}</view>
-						<Commondity @customNum="customNum"></Commondity>
-						<Commondity @customNum="customNum"></Commondity>
-					</view>
-
-					<!--内容部分 start -->
-					<!-- v-if="!$util.isEmpty(list.data)" -->
 
-					<!-- <block v-else>
-                    <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-                </block> -->
-					<!--内容部分 end -->
-				</scroll-view>
+			<scroll-view
+				scroll-y
+				class="right-box"
+				v-if="tabIndex == 0"
+				:scroll-into-view="scrollClassId"
+			>
+				<!--内容部分 start -->
+				<block v-if="!$util.isEmpty(productInfo)">
+					<view
+						class="item_list_bx"
+						v-for="(classItem, classIndex) in productInfo"
+						:key="classIndex"
+						:id="`class_${classItem.classId}`"
+					>
+						<view class="item_list_title">
+							{{ classItem.className }}
+						</view>
+						<template v-for="(productItem, productIndex) in classItem.child">
+							<Commondity
+								:key="productIndex"
+								:info="productItem"
+								:bigCount="
+									getSelectItemById(productItem.id, classItem.classId).bigCount
+								"
+								:smallCount="
+									getSelectItemById(productItem.id, classItem.classId).smallCount
+								"
+								@customNum="customNum"
+								@add="addEvent"
+								@del="delEvent"
+							></Commondity>
+						</template>
+					</view>
+				</block>
+				<block v-else>
+					<app-wrapper-empty
+						title="暂无数据"
+						:is-empty="$util.isEmpty(productInfo)"
+					/>
+				</block>
+				<!--内容部分 end -->
+			</scroll-view>
+			<block v-else>
+				<view style="width:100%">
+					<AppWrapperEmpty title="敬请期待" :is-empty="true" />
+				</view>
 			</block>
 		</view>
-		<view class="under-bar">
-			<button :class="['admin-button-com', 'middle', 'blue']" @click="">
-				选好了
-			</button>
-		</view>
 		<!-- :maskClosable="false" -->
 		<modal-module
 			:show="isModel"
 			@cancel="modalCancel"
 			@click="affirm"
-			title="花之物语 红色系"
+			:title="customData.itemName"
 			color="#333"
 			:size="32"
 			padding="30rpx 30rpx"
 		>
 			<template slot="customContent">
-				<view class="select-cmd_bx">
-					<view class="kc">
-						库存972
-					</view>
+				<view class="select-cmd_bx" v-if="customData">
+					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<input type="number" />扎
-						<input type="number" style="margin-left:24upx" />支
+						<input v-model="customData.bigCount" type="number" />扎
+						<input
+							v-model="customData.smallCount"
+							type="number"
+							style="margin-left:24upx"
+						/>支
 					</view>
 				</view>
 			</template>
 		</modal-module>
+		<modal-module
+			:show="showSubmitModel"
+			@cancel="cancelEvent"
+			@click="submitEvent"
+			:title="confirmContent"
+			color="#333"
+			:size="32"
+			padding="30rpx 30rpx"
+		>
+		</modal-module>
+		<FooterCart
+			:price="allPrice"
+			:count="allCount"
+			@confirm="confirmSelectEvent"
+		></FooterCart>
 	</view>
 </template>
 
 <script>
 import AppSearchModule from "@/components/module/app-search";
+import AppTabs from "@/components/plugin/tabs";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import Commondity from "../components/Commodity";
+import Commondity from "@/components/module/app-commodity";
+import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
-import { COMMODITY_TYPE } from "@/utils/declare";
+import productMins from "@/mixins/product";
 export default {
-	name: "select", // 盘点花材
+	name: "allotEx", // 开单
 	components: {
+		AppTabs,
 		AppSearchModule,
 		AppWrapperEmpty,
 		Commondity,
-		ModalModule
+		ModalModule,
+		FooterCart
 	},
+	mixins: [productMins],
 	data() {
 		return {
-			COMMODITY_TYPE,
-
-			tabbar: [
+			pageType: "inventory",
+			isLimit: false,
+			tabIndex: 0,
+			tabs: [
 				{
-					categoryName: "花束",
-					delStatus: "0",
-					description: "",
-					goodsNum: "0",
-					id: "95",
-					img: "https://img.huaml.com",
-					inTurn: "0",
-					merchantId: "12358",
-					parentId: "0",
-					sold: "0",
-					status: "1"
+					name: "花材"
 				},
 				{
-					categoryName: "花篮",
-					delStatus: "0",
-					description: "",
-					goodsNum: "0",
-					id: "96",
-					img: "https://img.huaml.com",
-					inTurn: "0",
-					merchantId: "12358",
-					parentId: "0",
-					sold: "0",
-					status: "1"
+					name: "成品"
 				}
+				// {
+				//     name: '课程'
+				// },
 			],
-			currentTab: 0,
-			isModel: false
+			isModel: false,
+			customData: {
+				bigCount: 0,
+				smallCount: 0
+			},
+			showSubmitModel: false
 		};
 	},
+	computed: {
+		confirmContent() {
+			let content = "确认下一步?";
+
+			return content;
+		}
+	},
+
 	methods: {
 		//自定义数量
-		customNum() {
+		customNum(info) {
 			this.isModel = true;
+			this.customData = info;
 		},
 		modalCancel() {
 			this.isModel = false;
+			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
 			if (val.index === 0) {
 				this.modalCancel();
 			} else {
+				const {
+					bigCount,
+					smallCount,
+					bigNum,
+					bigUnit,
+					smallNum,
+					smallUnit,
+					ratio
+				} = this.customData;
+				const ratioNum = Number(ratio);
+
+				//超过库存时 设置为库存最大值
+				if (
+					Number(bigCount) * ratioNum + Number(smallCount) >
+					Number(bigNum) * ratioNum + Number(smallNum)
+				) {
+					uni.showToast({
+						title: `库存只有${bigNum}${bigUnit}${smallNum}${smallUnit}`,
+						icon: "none"
+					});
+					this.customData.bigCount = bigNum;
+					this.customData.smallCount = smallNum;
+				} else {
+					this.updateItemEvent(this.customData);
+					this.modalCancel();
+				}
 			}
 		},
-		searchFn() {},
-		scrollTop() {},
-		swichNav(e) {
-			let cur = e.currentTarget.dataset.current;
-			if (this.currentTab == cur) {
+		cancelEvent() {
+			this.showSubmitModel = false;
+		},
+		submitEvent(val) {
+			if (val.index === 0) {
+				this.cancelEvent();
+			} else {
+				console.log(444, this.selectList);
+
+				uni.navigateBack({
+					delta: 1
+				});
+
+				this.cancelEvent();
+			}
+		},
+		confirmSelectEvent() {
+			if (this.selectList.length > 0) {
+				this.showSubmitModel = true;
+			}
+		},
+		change(e) {
+			if (this.tabIndex == e.index) {
 				return false;
 			} else {
-				this.currentTab = cur;
-				// this.form.categoryId = item.id;
-				// this.resetList();
-				// this._list();
-				// this.checkCor()
+				this.tabIndex = e.index;
 			}
-		}
+		},
+		searchFn() {
+			this.initData();
+		},
+		scrollTop() {}
 	}
 };
 </script>
@@ -165,28 +269,16 @@ export default {
 	}
 	.scroll-middle_bx {
 		flex: 1;
-		width: 100%;
-		height: 100%;
-		display: flex;
-        overflow: hidden;
-	}
-	.under-bar {
-		padding: 0 20upx;
 		display: flex;
-
-		flex-shrink: 0;
-		justify-content: flex-end;
-		align-items: center;
 		width: 100%;
-		height: 100upx;
-		background-color: #fff;
+		height: 100%;
+		overflow: hidden;
 	}
 	.tab-view {
 		height: 100%;
 		width: 170upx;
 		flex-shrink: 0;
 		background-color: #f0f2f6;
-
 		.tab-bar-item {
 			position: relative;
 			width: 170upx;

+ 293 - 70
ghs/src/pagesStorehouse/inventory/update.vue

@@ -4,31 +4,14 @@
 			<view class="space-view ex-info">
 				<form>
 					<view class="module-com input-line-wrap">
-						<TuiListCell
-							class="line-cell"
-							:hover="false"
-							:arrow="false"
-							@click="openAddres"
-						>
+						<TuiListCell class="line-cell" :hover="false" :arrow="false">
 							<view class="tui-title ">仓库</view>
-							<input
-								v-model="form.openTime"
-								placeholder-class="phcolor"
-								class="tui-input"
-								placeholder="请填写"
-								maxlength="50"
-								type="text"
-							/>
+							{{ getMerchantInfo.merchantName }}
 						</TuiListCell>
-						<TuiListCell
-							class="line-cell"
-							:hover="false"
-							:arrow="false"
-							@click="openAddres"
-						>
+						<TuiListCell class="line-cell" :hover="false" :arrow="false">
 							<view class="tui-title ">备注</view>
 							<input
-								v-model="form.openTime"
+								v-model="remark"
 								placeholder-class="phcolor"
 								class="tui-input"
 								placeholder="请填写"
@@ -40,28 +23,109 @@
 				</form>
 			</view>
 			<view class="space-view ex-table">
-				<Tabel :columns="columns" :dataList="dataList">
-					<template v-slot="{ row, column }">
-						<view v-if="column.custom == 'icon'" class="list-icon">
-							<image
-								class="icon-image"
-								src="https://img.huaml.com/uploads/12358/202005/29/de74c55596d304b85e79154958e8bf57_small.jpeg"
-								alt="商品图"
-							/>
-							<view class="icon-info">
-								<view class="info-name">
-									粉佳人
+				<block v-if="!$util.isEmpty(selectList)">
+					<!-- <Tabel
+						:dataList="selectList"
+						:columns="columns"
+						:parentData="{
+							getSelectItemProfitPrice: getSelectItemProfitPrice
+						}"
+					>
+						<template v-slot="{ row, column }">
+							<view v-if="column.custom == 'icon'" class="list-icon">
+								<image class="icon-image" :src="row.cover" alt="商品图" />
+								<view class="icon-info">
+									<view class="info-name">
+										{{ row.itemName }}
+									</view>
+									<view class="info-type">
+										B级
+									</view>
 								</view>
-								<view class="info-type">
-									B级
+							</view>
+							<view v-else-if="column.custom == 'stock'">
+								<text v-if="row.bigNum > 0">{{ `${row.bigNum}/` }}</text>
+								<text>{{ row.smallNum }}</text>
+							</view>
+							<view v-else-if="column.custom == 'inventory'">
+								<text v-if="row.bigCount > 0">{{ `${row.bigCount}/` }}</text>
+								<text>{{ row.smallCount }}</text>
+							</view>
+
+							<view v-else-if="column.custom == 'profit'">
+								<text>{{ getSelectItemProfitPrice }}</text>
+							</view>
+						</template>
+					</Tabel> -->
+
+					<view class="table-view">
+						<view
+							class="table-header"
+							:style="{ backgroundColor: headerBackgroundColor }"
+						>
+							<view
+								class="table-th"
+								v-for="(item, index) in columns"
+								:key="index"
+								:style="{
+									flex: item.width ? `0 0 ${item.width}rpx` : '1',
+									textAlign: item.align || 'left',
+									fontSzie: `${headerFontSize}rpx`,
+									margin: `0 ${gutter}rpx`
+								}"
+							>
+								<!-- <slot :name="item.dataIndex" > -->
+								{{ item.name || "" }}
+								<!-- </slot> -->
+							</view>
+						</view>
+						<view class="table-tr" v-for="(item, index) in selectList" :key="index">
+							<view
+								class="table-td"
+								v-for="(column, columnIndex) in columns"
+								:key="columnIndex"
+								:style="{
+									flex: column.width ? `0 0 ${column.width}rpx` : '1',
+									textAlign: column.align || 'left',
+									fontSzie: `${fontSize}rpx`,
+									margin: `0 ${gutter}rpx`
+								}"
+							>
+								<!-- {{ item[column.dataIndex] || "" }} -->
+
+								<view v-if="column.custom == 'icon'" class="list-icon">
+									<image class="icon-image" :src="item.cover" alt="商品图" />
+									<view class="icon-info">
+										<view class="info-name">
+											{{ item.itemName }}
+										</view>
+										<view class="info-type">
+											B级
+										</view>
+									</view>
+								</view>
+								<view v-else-if="column.custom == 'stock'">
+									<text v-if="item.bigNum > 0">{{ `${item.bigNum}/` }}</text>
+									<text>{{ item.smallNum }}</text>
+								</view>
+								<view v-else-if="column.custom == 'inventory'">
+									<text v-if="item.bigCount > 0">{{ `${item.bigCount}/` }}</text>
+									<text>{{ item.smallCount }}</text>
 								</view>
+
+								<view v-else-if="column.custom == 'profit'">
+									<text>{{ getSelectItemProfitPrice(item) }}</text>
+								</view>
+								<text v-else :class="[column.color || '']">
+									{{ (column.dataIndex && item[column.dataIndex]) || "" }}
+								</text>
 							</view>
 						</view>
-					</template>
-				</Tabel>
-				<template v-if="dataList.length == 0">
+					</view>
+				</block>
+				<template v-if="selectList.length == 0">
 					<view class="empty-view">
-						<button class="admin-button-com blue big" @click="">
+						<button class="admin-button-com blue big" @click="gotoSelectPage">
 							开始盘点
 						</button>
 					</view>
@@ -70,20 +134,29 @@
 		</view>
 		<view class="bar-view">
 			<view class="btn-view">
-				<button :class="['admin-button-com', 'middle', 'default']" @click="">
+				<button
+					:class="['admin-button-com', 'middle', 'default']"
+					@click="gotoSelectPage"
+				>
 					继续盘点
 				</button>
 				<button
-					:class="['admin-button-com', 'middle', 'default', 'disabled']"
-					disabled
-					@click=""
+					:class="[
+						'admin-button-com',
+						'middle',
+						'default',
+						{ disabled: allCount == 0 }
+					]"
+					:disabled="allCount == 0"
+					@click="saveToDraft"
 				>
-					保存导草稿
+					保存草稿
 				</button>
 				<button
-					:class="['admin-button-com', 'middle', 'disabled']"
-					disabled
-					@click=""
+					v-if="orderSn"
+					:class="['admin-button-com', 'middle', { disabled: allCount == 0 }]"
+					:disabled="allCount == 0"
+					@click="saveCheckOrder"
 				>
 					确认
 				</button>
@@ -92,13 +165,24 @@
 	</view>
 </template>
 <script>
-import Tabel from "../components/table";
 import TuiListCell from "@/components/plugin/list-cell";
+import productMins from "@/mixins/product";
+import { mapActions, mapGetters } from "vuex";
+import {
+	updateCheckOrderApi,
+	updateCheckOrderToDraftApi,
+	savaCheckOrderDraftApi,
+	getCheckOrderDetailApi
+} from "@/api/inventory/index";
 export default {
-	components: { TuiListCell, Tabel },
+	components: { TuiListCell },
+	mixins: [productMins],
 	data() {
 		return {
-			form: {},
+			orderSn: null,
+			infoData: null,
+			remark: "",
+			pageType: "inventory",
 			columns: [
 				{
 					name: "名称",
@@ -106,44 +190,150 @@ export default {
 				},
 				{
 					name: "库存",
-					dataIndex: "count",
+					custom: "stock",
 					// color: "success",
 					width: 120,
 					align: "center"
 				},
 				{
 					name: "盘点数",
-					dataIndex: "inventoryCount",
+					custom: "inventory",
 					color: "warn",
 					width: 120,
 					align: "center"
 				},
 				{
 					name: "盈亏数",
-					dataIndex: "profitCount",
 					color: "success",
+					custom: "profit",
 					width: 120,
-					align: "center"
+					align: "center",
+					render: (h, { row, index }) => {
+						return h("text", {}, () => {
+							return this.getSelectItemProfitPrice(row);
+						});
+					}
 				}
-			],
-			dataList: [
-				// {
-				// 	count: "1",
-				// 	inventoryCount: "2",
-				// 	profitCount: "3"
-				// },
-				// {
-				// 	count: "1",
-				// 	inventoryCount: "2",
-				// 	profitCount: "3"
-				// },
-				// {
-				// 	count: "1",
-				// 	inventoryCount: "2",
-				// 	profitCount: "3"
-				// }
 			]
 		};
+	},
+	onLoad(option) {
+		const { orderSn } = option;
+		if (orderSn) {
+			this.orderSn = orderSn;
+			this.initInfo();
+		}
+
+		if (!this.getMerchantInfo) {
+			this.initMerchantInfo();
+		}
+	},
+	computed: {
+		...mapGetters(["getMerchantInfo"])
+	},
+	methods: {
+		...mapActions(["initMerchantInfo"]),
+		async initInfo() {
+			try {
+				const { data } = await getCheckOrderDetailApi(this.orderSn);
+				this.infoData = data;
+				const { remark, itemInfo } = data;
+				this.remark = remark;
+				this.setSelectInfoByType({
+					type: this.pageType,
+					info: itemInfo.map(ele => {
+						return {
+							...ele,
+							bigNum: Number(ele.bigNumStock),
+							smallNum: Number(ele.smallNumStock),
+							bigCount: Number(ele.bigNum),
+							smallCount: Number(ele.smallNum)
+						};
+					})
+				});
+			} catch (error) {}
+		},
+		gotoSelectPage() {
+			uni.navigateTo({
+				url: "/pagesStorehouse/inventory/select",
+				success: result => {},
+				fail: () => {},
+				complete: () => {}
+			});
+		},
+		/**
+		 * 获取当前选中商品总价
+		 */
+		getSelectItemProfitPrice(item) {
+			let price = 0;
+			const {
+				bigCount,
+				smallCount,
+				bigNum,
+				smallNum,
+				bigPrice,
+				smallPrice
+			} = item;
+			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);
+			let stockPrice = Math.round(stockSum * 100) / 100;
+			let diff = stockPrice - price;
+			return Math.round(diff * 100) / 100;
+		},
+		async saveToDraft() {
+			try {
+				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
+					};
+				});
+				params.itemInfo = JSON.stringify(formatList);
+				const {
+					data: { orderSn }
+				} = await api(params);
+				this.orderSn = orderSn;
+				this.$msg("保存成功");
+			} catch (error) {}
+		},
+		async saveCheckOrder() {
+			try {
+				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
+					};
+				});
+				params.itemInfo = JSON.stringify(formatList);
+				await updateCheckOrderApi(params);
+				this.$msg("盘点成功");
+				uni.navigateBack({
+					delta: 1
+				});
+			} catch (error) {}
+		}
 	}
 };
 </script>
@@ -235,4 +425,37 @@ export default {
 		}
 	}
 }
+.table-view {
+	.table-header {
+		display: flex;
+		padding: 20upx 30upx;
+
+		box-shadow: 0px 1px 0px 0px #eeeeee;
+		color: #999999;
+		.table-th {
+			white-space: nowrap;
+		}
+	}
+	.table-tr {
+		display: flex;
+		align-items: center;
+		padding: 20upx 30upx;
+		border-bottom: 1px solid #eeeeee;
+		color: #999999;
+		.table-td {
+			.warn {
+				color: #ffaf1d;
+			}
+			.fail {
+				color: #f51608;
+			}
+			.success {
+				color: #09bb07;
+			}
+			.info {
+				color: #333;
+			}
+		}
+	}
+}
 </style>