Răsfoiți Sursa

库存(明细还没处理完)

jf 5 ani în urmă
părinte
comite
31a652bdd3

+ 28 - 5
ghsApp/src/pagesStorehouse/components/CommodityStock.vue

@@ -3,21 +3,22 @@
 		<view class="img_bx">
 			<app-img :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />
 		</view>
-		<view class="cmd-info_bx">
+		<navigator :url="type == STOCK_TYPE.WARN?'':`/pagesStorehouse/stockWarn/detailed?id=${info.itemId}`" class="cmd-info_bx" :class="type == STOCK_TYPE.WARN?'':'active'">
 			<view class="tit">{{ info.itemName || "" }}</view>
 			<view class="kc">{{ info.rank || "" }}级</view>
 			<view class="num-open_bx">
-				<view class="price">¥{{ info.price }}</view>
+				<view class="price" v-if="isPrice">¥{{ info.price }}</view>
 				<template v-if="isEdit">
 					<view class="open-bx warn" v-if="type == STOCK_TYPE.WARN">
-						{{ info.stock }}
+						库存 <text style="color: #FF2842;margin-left: 10rpx"> {{ info.stock }}</text>
 					</view>
 					<view class="open-bx" v-else-if="type == STOCK_TYPE.MANAGE">
-						库存{{ info.stock }}
+						库存 <text style="margin-left: 10rpx">{{ info.stock }}</text>
 					</view>
 				</template>
 			</view>
-		</view>
+		</navigator>
+
 	</view>
 </template>
 
@@ -34,6 +35,10 @@ export default {
 			type: String,
 			default: STOCK_TYPE.WARN
 		},
+		isPrice: {
+			type: Boolean,
+			default: true
+		},
 		isEdit: {
 			type: Boolean,
 			default: true
@@ -76,7 +81,25 @@ export default {
 		top: 0px;
 	}
 	.cmd-info_bx {
+		position: relative;
 		padding-left: 177px;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22rpx;
+				width: 22rpx;
+				border-width: 2rpx 2rpx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12rpx;
+				right: 30rpx;
+			}
+		}
+
 		& .tit {
 			font-size: 28px;
 			font-weight: 400;

+ 83 - 12
ghsApp/src/pagesStorehouse/stockWarn/detailed.vue

@@ -1,7 +1,19 @@
 <template>
 	<view class="ex-page">
 		<view class="top-bar">
-			<SelectList :list="selectListData" @search="searchSelectEvent" />
+<!--			<SelectList :list="selectListData" @search="searchSelectEvent" />-->
+
+				<DorpdownSelect
+					:menuObj="menuTimeObj"
+					:selectItemId.sync="selectTimeId"
+					:typeSelect="1" top="0px"
+					@selectSussess="selectSussess" />
+
+			<DorpdownSelect
+				:menuObj.sync="menuObj"
+				:selectItemId.sync="shopId"
+				top="0"
+				@selectSussess="selectShopSussess" />
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 			<view class="space-view ex-table">
@@ -13,12 +25,7 @@
 							</t-th>
 						</t-tr>
 						<t-tr v-for="(item, index) in list.data" :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 == 'change'">
 									{{ `${item.smallNumOrder}/${item.bigNumOrder}` }}
 								</view>
@@ -47,20 +54,42 @@
 				</block>
 			</view>
 		</scroll-view>
+
+		<!--		时间段选择-->
+		<rangeDatePick
+			:show="isShow"
+			start="2000-01-01"
+			end="2200-12-01"
+			:value="customizationTime"
+			@change="timeChange"
+			@cancel="timeCancel"
+			themeColor="#4C83D6" fields="day"></rangeDatePick>
 	</view>
 </template>
 <script>
+const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
+const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 
 import SelectList from "@/components/plugin/selectList";
 import { getStockDetailApi } from "@/api/storehouse/stock";
 import { list } from "@/mixins";
-
+import DorpdownSelect from "@/components/module/dorpdownSelect";
+import rangeDatePick from '@/components/pyh-rdtpicker/pyh-rdtpicker.vue';
+import {mapActions, mapGetters} from "vuex";
 export default {
-	components: { SelectList, AppWrapperEmpty },
+	components: { SelectList, AppWrapperEmpty,DorpdownSelect,rangeDatePick },
 	mixins: [list],
+	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
 	data() {
 		return {
+			isShow:false,
+			customizationTime:'',
+			menuTimeObj:'',//时间分类-类型
+			menuShopObj:'',//门店分类-类型
+			selectTimeId:'',//选择时间id
+			shopId:'',//选择分店id
+			itemId:'',
 			selectListData: [
 				{
 					title: "时间",
@@ -128,19 +157,61 @@ export default {
 			uni.stopPullDownRefresh();
 		});
 	},
-	onLoad() {
+	onLoad(e) {
+		this.itemId = e.id
+
+		let dateDefaultOption = [];
+		let list = this.getDictionariesInfo.dateDefaultOption;
+		for (let i=0;i<list.length;i++){
+			dateDefaultOption.push({name:list[i].name,id:list[i].value})
+		}
+		this.menuTimeObj = {title:'时间',titleChild:'时间',list: dateDefaultOption};
+
+		this.shopId = this.getLoginInfo.shopId;
+		console.log(' this.selectShopId',this.shopId)
+		console.log(' this.getLoginInfo.shopId',this.getLoginInfo.shopId)
+		// console.log('userShopAll',this.setUserShopAll())
+
 		this.init();
 	},
 	methods: {
+		...mapActions(['setUserShopAll']),
+		// 选择分店
+		selectShopSussess(val){
+			console.log(val)
+		},
+		//选择时间
+		selectSussess(val) {
+			if(val.select=='自定义'){
+				this.selectTime();
+			}else{
+				console.log(val)
+				console.log('同步组件selectTimeId',this.selectTimeId)
+			}
+
+		},
+		//选择时间-自定义时间
+		selectTime(type){
+			this.customizationTime = [time,time],
+				this.isShow = true;
+		},
+		//选择自定义时间确定
+		timeChange(e){
+			this.isShow = false;
+			console.log('e',e)
+			console.log('selectTimeId',this.selectTimeId)
+		},
+		//选择自定义时间取消
+		timeCancel(e){this.isShow = false;},
 		searchSelectEvent(params) {
-			console.log(3333, pramrs);
+			console.log(3333, params);
 		},
 		async init() {
 			this._list();
 		},
 		_list() {
 			let params = {
-				itemId: 1,
+				itemId: this.itemId,
 				start_date: "",
 				end_date: ""
 			};

+ 5 - 5
ghsApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -7,7 +7,7 @@
 			itemWidth="50%"
 		/>
 		<view class="input-wrap">
-			<!-- <view 
+			<!-- <view
 				v-if=" == 1"
 				class="city-select text-line">
 				瑞经典<text class="iconfont iconsanjiao_xia"></text>
@@ -16,7 +16,7 @@
 				<DorpdownSelect
 					:menuObj.sync="menuObj"
 					:selectItemId.sync="shopId"
-					top="40px"
+					top="0"
 					@selectSussess="selectSussess"
 				>
 				</DorpdownSelect>
@@ -62,11 +62,11 @@
 						:key="classIndex"
 						:id="`class_${classItem.classId}`"
 					>
-						<view class="item_list_title">
-							{{ classItem.className }}
-						</view>
+						<view class="item_list_title" v-if="!$util.isEmpty(classItem.child)"> {{ classItem.className }}</view>
+						<text v-else>当前库存充足</text>
 						<template v-for="(productItem, productIndex) in classItem.child">
 							<CommodityStock
+								:isPrice="false"
 								:type="tabs[tabIndex].key"
 								:key="productIndex"
 								:info="productItem"