chenrui 3 anni fa
parent
commit
2d980c0cf6

+ 11 - 0
api/dealerProductBrand.js

@@ -0,0 +1,11 @@
+import axios from '@/libs/axios.js'
+
+//  产品品牌列表  无分页
+export const dealerProductBrandQuery = (params) => {
+  const url = `dealerProductBrand/queryList`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 21 - 0
api/stock.js

@@ -0,0 +1,21 @@
+import axios from '@/libs/axios.js'
+
+//  库存列表  分页
+export const stockList = (params) => {
+  const url = `stock/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存 列表 合计
+export const stockCount = (params) => {
+  return axios.request({
+    url: 'stock/queryCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
libs/axios.js

@@ -46,7 +46,7 @@ const request = (opts, hasToken) => {
 				if(ret.status == '200'){
 					resolve(ret)
 				}else{
-					if(ret.status == '401'){  //  未登录或登录过期
+					if(ret.status == '401' || ret.status == '1099'){  //  未登录或登录过期
 					    // 除过查询未完成订单的请求
 						// if(opts.url.indexOf("order/unFinishedOrderRunStatus")<0){
 							uni.showToast({

+ 160 - 0
pages/common/productBrand.vue

@@ -0,0 +1,160 @@
+<template>
+	<u-popup v-model="isShow" class="brand-picker" @close="isShow=false" mode="bottom">
+		<view class="brand-header flex justify_between align_center">
+			<text class="brand-picker-btn" @click="onClean">清空</text>
+			<text>产品品牌</text>
+			<text class="brand-picker-btn color-blue" @click="isShow=false">X</text>
+		</view>
+		<view class="search-box">
+			<u-search
+				placeholder="请输入品牌名称搜索" 
+				v-model="queryWord" 
+				:show-action="isGobleSearch"
+				@focus="isGobleSearch=true"
+				@blur="isGobleSearch=false"
+				@custom="searchBrand"
+				@search="searchBrand"
+				@clear="clearSearch"
+				:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': $config('primaryColor'), 'border-radius': '6upx', 'padding': '12upx 0'}">
+			</u-search>
+		</view>
+		<scroll-view class="picker-content" scroll-y>
+			<view class="picker-main">
+				<view class="picker-main-item" v-for="(item, index) in listData" :key="item.brandSn" @click="chooseItem(index)">
+					<view class="item-name">{{item.brandName}}</view>
+					<u-icon v-show="item.brandSn==brandSn" class="item-icon" name="checkbox-mark" :color="$config('primaryColor')" size="28"></u-icon>
+				</view>
+				<view v-if="listData && listData.length == 0">
+					<u-empty text="数据为空" mode="list" :img-width="200" :margin-top="-60"></u-empty>
+				</view>
+			</view>
+		</scroll-view>
+	</u-popup>
+</template>
+
+<script>
+	import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+	export default {
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			},
+			itemSn: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+				listData: [],
+				queryWord: '',
+				isGobleSearch: false,
+				brandList: [],
+				brandSn: this.itemSn || null
+			}
+		},
+		mounted() {
+			this.clearSearch()
+		},
+		methods: {
+			// 搜索品牌
+			searchBrand(){
+				if(this.queryWord != ''){
+					this.getBrandList()
+				}
+			},
+			clearSearch(){
+				this.queryWord = ''
+				this.listData = []
+				this.getBrandList()
+			},
+			getBrandList(){
+				dealerProductBrandQuery({ brandName: this.queryWord }).then(res => {
+					if(res.status == 200 && res.data){
+						this.listData = res.data
+					}else{
+						this.listData = []
+					}
+				})
+			},
+			//  选择
+			chooseItem(ind){
+				this.brandSn = this.listData[ind].brandSn
+				this.$emit('choose', this.listData[ind])
+				this.isShow = false
+			},
+			// 清空
+			onClean(){
+				this.brandSn = null
+				this.$emit('clean')
+				this.isShow = false
+			}
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+			  if (!newValue) {
+			    this.$emit('close')
+			  }
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.brand-picker{
+		.brand-header{
+			padding: 20upx 30upx;
+			position: relative;
+			.brand-picker-btn{
+				color: rgb(96, 98, 102);
+			}
+		}
+		.brand-header:after{
+			content: "";
+			position: absolute;
+			border-bottom: 1px solid #eaeef1;
+			-webkit-transform: scaleY(.5);
+			transform: scaleY(.5);
+			bottom: 0;
+			right: 0;
+			left: 0;
+		}
+		.search-box{
+			padding: 10upx 20upx;
+		}
+		.picker-content{
+			height: 300upx;
+			padding: 6upx 0 20upx;
+			position: relative;
+			.picker-main{
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%,-50%);
+				width: 100%;
+				max-height: 300upx;
+				.picker-main-item{
+					position: relative;
+					padding: 0 30upx;
+					.item-name{
+						padding: 14upx 0;
+						text-align: center;
+						// border-bottom: 1upx dashed #efefef;
+					}
+					.item-icon{
+						position: absolute;
+						right: 100upx;
+						top: 19upx;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 2 - 3
pages/index/index.vue

@@ -97,11 +97,10 @@
 					count: 0,
 					auth: true
 				}
-			];
-			this.queryByTypeSum()
+			]
 		},
 		onShow() {
-			
+			this.queryByTypeSum()
 		},
 		methods:{
 			toPage(url){

+ 1 - 1
pages/replenishmentManage/chooseTypeModal.vue

@@ -8,7 +8,7 @@
 					<u-radio name="2">快递到店</u-radio>
 				</u-radio-group>
 				<view style="padding: 20upx 0 16upx;">备注</view>
-				<u-input v-model="form.remarks" placeholder="请输入出库备注(最多500字符)" type="textarea" :maxlength="500" :border="true" />
+				<u-input v-model="form.remarks" placeholder="请输入出库备注(最多500字符)" type="textarea" :maxlength="500" :border="true" :auto-height="false" :custom-style="{height: '100upx'}" />
 			</view>
 			<view class="modal-footer">
 				<view class="button-cancel" @click="isShow=false">取消</view>

+ 3 - 1
pages/replenishmentManage/replenishmentList.vue

@@ -20,7 +20,9 @@
 						</view>
 						<view class="check-col">
 							<view>补货单号:{{item.replenishBillNo}}</view>
-							<view>应发数量:{{item.totalQty}}</view>
+							<view v-if="item.billState=='WAIT_CONFIRM' || item.billState=='CANCEL'">应发数量:{{item.totalQty}}</view>
+							<view v-if="item.billState=='WAIT_OUT_STOCK' || item.billState=='WAIT_CHECK'">实发数量:{{item.totalConfirmQty}}</view>
+							<view v-if="item.billState=='FINISH'">入库数量:{{item.totalPutQty}}</view>
 							<view>{{item.createDate}}</view>
 						</view>
 					 </view>

+ 5 - 8
pages/shuntBackManage/shuntBackList.vue

@@ -49,8 +49,7 @@
 				tabList: [
 					{
 						dispName: '全部',
-						status: 'ALL',
-						count: 0
+						status: 'ALL'
 					},
 					{
 						dispName: '待退库',
@@ -59,13 +58,11 @@
 					},
 					{
 						dispName: '已完成',
-						status: 'FINISH',
-						count: 0
+						status: 'FINISH'
 					},
 					{
 						dispName: '已取消',
-						status: 'CANCEL',
-						count: 0
+						status: 'CANCEL'
 					}
 				],
 				current: 0,
@@ -92,6 +89,8 @@
 			}
 			// 监听整改完成后刷新事件
 			uni.$on('refreshBL', this.pageInit)
+		},
+		onShow() {
 			this.pageInit()
 		},
 		onUnload() {
@@ -102,8 +101,6 @@
 				queryStateCount({}).then(res =>{
 					if(res.status==200 && res.data){
 						this.tabList[1].count = res.data.WAIT_CONFIRM || 0
-						this.tabList[2].count = res.data.FINISH || 0
-						this.tabList[3].count = res.data.CANCEL || 0
 						this.getRow(1)
 					}else{
 						this.getRow(1)

+ 37 - 8
pages/stock/index.vue

@@ -3,11 +3,11 @@
 		<!-- 统计 -->
 		<view class="panel-box">
 			<view class="item-box">
-				<u-count-to :end-val="1542" separator=","></u-count-to>
+				<u-count-to :end-val="totalData&&totalData.totalCurrentStockQty ? totalData.totalCurrentStockQty : 0" separator=","></u-count-to>
 				<view>库存总数量(个)</view>
 			</view>
 			<view class="item-box">
-				<u-count-to :end-val="1542" separator=","></u-count-to>
+				<u-count-to :end-val="totalData&&totalData.totalCurrentStockCost ? totalData.totalCurrentStockCost : 0" separator="," :decimals="2"></u-count-to>
 				<view>库存总成本(¥)</view>
 			</view>
 		</view>
@@ -17,18 +17,23 @@
 				<view class="u-line"></view>库存查询
 			</view>
 			<u-form :model="form" ref="uForm" label-width="180">
-				<u-form-item label="产品编码"><u-input v-model="form.productCode" placeholder="请输入产品编码" style="text-align: right;" /></u-form-item>
-				<u-form-item label="原厂编码"><u-input v-model="form.productOrigCode" placeholder="请输入原厂编码" style="text-align: right;" /></u-form-item>
-				<u-form-item label="产品名称"><u-input v-model="form.productName" placeholder="请输入产品名称" style="text-align: right;" /></u-form-item>
-				<u-form-item label="产品品牌"><view></view></u-form-item>
+				<u-form-item label="产品编码"><u-input v-model.trim="form.productCode" placeholder="请输入产品编码" input-align="right" /></u-form-item>
+				<u-form-item label="原厂编码"><u-input v-model.trim="form.productOrigCode" placeholder="请输入原厂编码" input-align="right" /></u-form-item>
+				<u-form-item label="产品名称"><u-input v-model.trim="form.productName" placeholder="请输入产品名称" input-align="right" /></u-form-item>
+				<u-form-item label="产品品牌"><u-input v-model="brandName" @click="brandModal=true" disabled placeholder="请选择产品品牌" input-align="right" /></u-form-item>
 				<u-form-item label="只查看有库存"><u-switch slot="right" v-model="form.zeroQtyFlag"></u-switch></u-form-item>
 			</u-form>
 		</view>
+		<!-- 产品品牌 -->
+		<productBrand :openModal="brandModal" :itemSn="form.productBrandSn" @choose="brandChoose" @clean="brandClean" @close="brandModal=false" />
 	</view>
 </template>
 
 <script>
+	import productBrand from '@/pages/common/productBrand.vue'
+	import { stockCount } from '@/api/stock'
 	export default{
+		components: { productBrand },
 		data(){
 			return {
 				form: {
@@ -40,11 +45,35 @@
 					productTypeSn2: '', //  产品分类2
 					productTypeSn3: '', //  产品分类3
 					zeroQtyFlag: false //  库存情况
-				}
+				},
+				totalData: null,
+				brandModal: false,
+				brandName: ''
 			}
 		},
+		onLoad() {
+			this.getTotal()
+		},
 		methods: {
-			
+			// 合计
+			getTotal () {
+				stockCount({}).then(res => {
+					if (res.status == 200 && res.data) {
+						this.totalData = res.data
+					} else {
+						this.totalData = null
+					}
+				})
+			},
+			brandChoose(data){
+				this.brandName = data.brandName
+				this.form.productBrandSn = data.brandSn
+			},
+			// 清空品牌
+			brandClean(){
+				this.brandName = ''
+				this.form.productBrandSn = undefined
+			}
 		}
 	}
 </script>