lilei 2 years ago
parent
commit
ae8d4a56e3

+ 26 - 0
api/shelfCart.js

@@ -56,4 +56,30 @@ export const shelfCartDelete = (params) => {
 		data: params,
 		method: 'post'
 	})
+}
+
+// 上架确认
+export const shelfCartConfirm = (params) => {
+	return axios.request({
+		url: `shelfCart/confirm`,
+		data: params,
+		method: 'post'
+	})
+}
+
+// 查询货架车上结算价为空的产品
+export const queryEmptyCostList = (params) => {
+	return axios.request({
+		url: `shelfCart/queryEmptyCostList/${params.shelfSn}`,
+		method: 'get'
+	})
+}
+
+// 查询货架车上结算价为空的产品
+export const updateBatchById = (params) => {
+	return axios.request({
+		url: `shelfCart/updateBatchById`,
+		data: params,
+		method: 'post'
+	})
 }

+ 1 - 1
config/index.js

@@ -6,7 +6,7 @@ const getConfig = (theme) => {
 			themePath: 'default',
 			pro_URL: 'https://iscm.360arrow.com/qpls-md/', // 生产地址
 			uat_URL: 'http://p.iscm.360arrow.com/qpls-md/', // 预发布地址
-			dev_URL: 'http://192.168.0.215:8503/qpls-md/', // 本地地址
+			dev_URL: 'http://192.168.0.182:8503/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 9 - 0
pages.json

@@ -589,6 +589,15 @@
                 "enablePullDownRefresh": false
             }
         }
+        ,{
+            "path" : "pages/batchShelves/setProductCost",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "结算价设置",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 67 - 4
pages/batchShelves/cartList.vue

@@ -80,16 +80,23 @@
 				 </view>
 			</view>
 		</u-popup>
+		<!-- 上架确认 -->
+		<choose-type-modal v-if="chooseModal" :totalKs="totalKs" :totalNums="totalNums" :openModal="chooseModal" @confirm="confirmPut" @close="chooseModal = false" />
 	</view>
 </template>
 
 <script>
 	import { clzConfirm, numberToFixed } from '@/libs/tools';
-	import {queryMapList, queryCountList, shelfCartSave, shelfCartDelete} from '@/api/shelfCart.js'
+	import {queryMapList, queryCountList, shelfCartSave, shelfCartDelete, queryEmptyCostList, shelfCartConfirm} from '@/api/shelfCart.js'
+	import chooseTypeModal from './chooseTypeModal'
 	export default {
+		components: {
+			chooseTypeModal
+		},
 		data() {
 			return {
 				showPop: false,
+				chooseModal: false,
 				shelfSn: '',
 				shelfName: '',
 				shelfPlaceList: null,
@@ -103,6 +110,9 @@
 				curLayer: ''
 			}
 		},
+		onShow() {
+			this.curLayer = ''
+		},
 		onLoad(opts) {
 			this.layerList = 'A、B、C、D、E、F、G、H、I、J、K、L、M、N、O、P、Q、R、S、T、U、V、W、X、Y、Z'.split('、');
 			this.shelfSn = opts.shelfSn
@@ -113,10 +123,25 @@
 			uni.$on("updateTempHw",()=>{
 				this.pageInit(true)
 			})
+			
+			uni.$on("setCostOk",()=>{
+				this.chooseModal = true
+			})
 		},
 		onUnload() {
 			uni.$off("updateTempHw")
 		},
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			// 上架入库
+			if(e.index == 0){
+				this.toPutaway()
+			}
+			// 打印贴签
+			if(e.index == 1){
+				
+			}
+		},
 		methods: {
 			pageInit(flag){
 				this.placeTab = []
@@ -127,18 +152,53 @@
 			},
 			scanProduct(){
 				this.showLayer = false
-				this.curLayer = ''
 				uni.navigateTo({
 					url: "/pages/batchShelves/scanProduct?shelfSn="+this.shelfSn+'&layer='+this.curLayer+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
 				})
 			},
 			searchProduct(){
 				this.showLayer = false
-				this.curLayer = ''
 				uni.navigateTo({
 					url: "/pages/batchShelves/searchProduct?shelfSn="+this.shelfSn+'&layer='+this.curLayer+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
 				})
 			},
+			// 上架入库
+			toPutaway(){
+				uni.showLoading({
+					title: '正在查询...',
+					mask: true
+				})
+				queryEmptyCostList({shelfSn: this.shelfSn}).then(res => {
+					console.log(res)
+					uni.hideLoading()
+					if(res.data&&res.data.length){
+						this.$store.state.vuex_tempData = res.data
+						// 去设置价格
+						uni.navigateTo({
+							url: "/pages/batchShelves/setProductCost?shelfSn="+this.shelfSn+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
+						})
+					}else{
+						this.chooseModal = true
+					}
+				})
+			},
+			//确认上架
+			confirmPut(data){
+				uni.showLoading({
+					mask: true,
+					title: '正在上架...'
+				})
+				shelfCartConfirm({
+					shelfSn: this.shelfSn,
+					...data
+				}).then(res => {
+					uni.hideLoading()
+					if(res.status == 200){
+						uni.$emit("updateHw")
+						uni.navigateBack()
+					}
+				})
+			},
 			// 编辑
 			editRow(item){
 				this.$store.state.vuex_tempData = item
@@ -149,6 +209,7 @@
 			// 获取产品列表
 			getList(flag){
 				uni.showLoading({
+					mask: true,
 					title: '正在加载...'
 				})
 				queryMapList({ shelfSn: this.shelfSn }).then(res => {
@@ -199,6 +260,7 @@
 				  success (ret) {
 						if (ret.confirm || ret.index == 0) {
 							uni.showLoading({
+								mask: true,
 								title: '正在删除...'
 							})
 							shelfCartDelete({ shelfCartSn: row.shelfCartSn }).then(res => {
@@ -227,13 +289,14 @@
 				}
 				// 继续修改数量
 				uni.showLoading({
+					mask: true,
 					title: '正在保存...'
 				})
 				const params = {
 					shelfSn: row.shelfSn,
 					shelfName: this.shelfName,
 					shelfTierCode: row.shelfTierCode,
-					shelfPlaceSn: row.shelfPlaceSn,
+					shelfPlaceSn: row.shelfPlaceSn||undefined,
 					shelfPlaceCode: row.shelfPlaceCode,
 					productSn: row.productSn,
 					productCode: row.productCode,

+ 118 - 0
pages/batchShelves/chooseTypeModal.vue

@@ -0,0 +1,118 @@
+<template>
+	<u-mask class="commonModal" :show="isShow" :mask-click-able="false">
+		<view class="modal-con">
+			<view class="modal-title">上架入库后,货架库存将会增加</view>
+			<view class="modal-main">
+				<view class="modal-p">本次共上架入库<text>{{totalKs}}</text>款产品,共<text>{{totalNums}}</text>件</view>
+				<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>
+				<view class="button-confirm" @click="handleConfirm">确认上架入库</view>
+			</view>
+		</view>
+	</u-mask>
+</template>
+
+<script>
+	export default {
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			},
+			totalKs: {
+				type: [String,Number],
+				default: '0'
+			},
+			totalNums: {
+				type: [String,Number],
+				default: '0'
+			}
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+				form: {
+				  dispatchType: undefined,
+				  remarks: ''
+				},
+				dispatchTypeList: []
+			}
+		},
+		methods: {
+			// 确认
+			handleConfirm(){
+				this.$emit('confirm', this.form, 0)
+			},
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+				if (!newValue) {
+					this.$emit('close')
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.commonModal{
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		left: 0;
+		top: 0;
+		z-index: 9999999;
+		.modal-con{
+			width: 78%;
+			margin: 50% auto;
+			background-color: #fff;
+			border-radius: 24upx;
+			padding-top: 30upx;
+			font-size: 30upx;
+			.modal-title{
+				text-align: center;
+				font-size: 26upx;
+				color: #666;
+			}
+			.modal-main{
+				margin: 10upx 30upx 30upx;
+				font-size: 30upx;
+				.modal-p{
+					color: #666;
+					text-align: center;
+					margin-bottom: 20upx;
+					font-size: 26upx;
+					text{
+						color: red;
+					}
+				}
+			}
+			.modal-footer{
+				font-size: 30upx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				text-align: center;
+				border-top: 1upx solid #E5E5E5;
+				.button-cancel{
+					color: #999;
+					border-right: 1upx solid #E5E5E5;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+				.button-confirm{
+					color: #2A86F4;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+			}
+		}
+	}
+</style>

+ 1 - 1
pages/batchShelves/editShelfHw.vue

@@ -177,7 +177,7 @@
 						 	shelfSn: this.shelfSn,
 						 	shelfName: this.shelfName,
 						 	shelfTierCode: row.shelfTierCode,
-						 	shelfPlaceSn: row.shelfPlaceSn,
+						 	shelfPlaceSn: row.shelfPlaceSn||undefined,
 						 	shelfPlaceCode: row.shelfPlaceCode,
 						 	productSn: row.productSn,
 						 	productCode: row.productCode,

+ 1 - 1
pages/batchShelves/scanProduct.vue

@@ -149,7 +149,7 @@
 					shelfSn: this.shelfSn,
 					shelfName: this.shelfName,
 					shelfTierCode: a ? a.shelfTierCode : this.layer,
-					shelfPlaceSn: a ? a.shelfPlaceSn : '',
+					shelfPlaceSn: a ? a.shelfPlaceSn : undefined,
 					shelfPlaceCode: a?a.shelfPlaceCode:this.shelfPlaceCode,
 					productSn: this.productInfo.productSn,
 					productCode: this.productInfo.code,

+ 4 - 4
pages/batchShelves/searchProduct.vue

@@ -45,8 +45,8 @@
 							<u-number-box :index="item.id" @blur="updateNums" @minus="updateNums" @plus="updateNums" color="#000" bg-color="#fff" v-model="item.shelfCartApi.qty" :min="1"></u-number-box>
 						</view>
 						<view v-else>
-							<u-button @click="addItem(item)" plain style="width: 40rpx;height: 40rpx;line-height: 40rpx;" size="mini" shape="circle">
-								<u-icon name="plus"></u-icon>
+							<u-button @click="addItem(item)" plain style="height: 50rpx;line-height: 50rpx;" size="mini" shape="circle">
+								<u-icon name="plus"></u-icon> 添加
 							</u-button>
 						</view>
 					</view>
@@ -160,14 +160,14 @@
 					shelfSn: this.shelfSn,
 					shelfName: this.shelfName,
 					shelfTierCode: item?item.shelfTierCode:this.layer,
-					shelfPlaceSn: item?item.shelfPlaceSn:'',
+					shelfPlaceSn: item?item.shelfPlaceSn:undefined,
 					shelfPlaceCode: item?item.shelfPlaceCode:this.shelfPlaceCode,
 					productSn: row.productSn,
 					productCode: row.code,
 					qty: nums,
 					price: row.price,
 					cost: row.cost,
-					shelfCartSn: item?item.shelfCartSn:''
+					shelfCartSn: item?item.shelfCartSn:undefined
 				}
 				console.log(params)
 				shelfCartSave(params).then(res => {

+ 151 - 0
pages/batchShelves/setProductCost.vue

@@ -0,0 +1,151 @@
+<template>
+	<view class="content flex flex_column">
+		<view class="uni-icon-error tits">以下产品需设置结算价(即修理厂的进货价),否则无法上架入库</view>
+		<view class="proudct-body">
+			<view class="partList-list-box" v-for="(item,index) in partList" :key="item.id">
+				<view class="product flex align_center">
+					<view class="flex align_center justify_between">
+						<view class="pimgs">
+							<u-image :src="item.product.images?item.product.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+						</view>
+						<view class="pinfo">
+							<view class="pname">
+								<text>{{item.shelfPlaceCode}}</text>
+								{{item.productCode}}
+							</view>
+							<view class="pname pname1">
+								{{item.product.productName}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="ptools flex align_center justify_between">
+					<view></view>
+					<view class="pcurnums flex align_center">
+						<text>结算价</text>
+						<view class="u-ninput">
+							<u-input trim border type="digit" clearable @blur="numberToFixed(item,2,999999)" v-model="item.cost" placeholder="请输入价格,最多两位小数"/>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer-bar">
+			<u-button type='primary' shape="circle" size="medium" @click="submitForm">设置完成</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { clzConfirm, numberToFixed } from '@/libs/tools';
+	import {updateBatchById, shelfCartConfirm} from '@/api/shelfCart.js'
+	export default {
+		data() {
+			return {
+				partList:[],
+			}
+		},
+		onLoad() {
+			this.partList = this.$store.state.vuex_tempData
+			this.partList.map(item => {
+				item.cost = ''
+			})
+		},
+		onUnload() {
+			this.$store.state.vuex_tempData = null
+		},
+		methods: {
+			// 小数点后两位
+			numberToFixed: function (item, num, max) {
+				let val = item.cost
+				let ret = numberToFixed(val, num, max)
+				this.$set(item,'cost',Number(ret <= 0 ? '' : ret))
+				this.partList = JSON.parse(JSON.stringify(this.partList))
+			},
+			submitForm(){
+				const hasEmpty = this.partList.filter(item => !item.cost)
+				console.log(hasEmpty)
+				if(hasEmpty.length){
+					this.toashMsg("请输入结算价")
+				}else{
+					uni.showLoading({
+						mask: true,
+						title: '正在设置价格...'
+					})
+					updateBatchById(this.partList).then(res => {
+						uni.hideLoading()
+						if(res.status == 200){
+							uni.$emit("setCostOk")
+							uni.navigateBack()
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+.content{
+	height: 100vh;
+	.tits{
+		padding: 20upx 30upx;
+		color: darkorange;
+		font-size: 24rpx;
+	}
+	.proudct-body{
+		width: 100%;
+		flex-grow: 1;
+		overflow: auto;
+		background-color: #fff;
+		padding: 0 20upx;
+	}
+	.partList-list-box{
+		padding: 10px 0;
+		border-bottom: 2rpx solid #f5f5f5;
+		.product{
+			flex-grow: 1;
+			.pinfo{
+				flex-grow: 1;
+				padding-left: 20rpx;
+				.pname{
+					color: #191919;
+					margin-bottom: 5rpx;
+					text{
+						font-weight: normal;
+						margin-right: 10rpx;
+						padding: 0 10rpx;
+						background: rgba(3, 54, 146, 0.15);
+						border-radius: 30rpx;
+						color: #033692;
+						font-size: 24rpx;
+					}
+				}
+			}
+		}
+		.ptxt{
+			font-size: 28rpx;
+			color: #999;
+			.pnums{
+				color: #222;
+				margin-right: 20upx;
+			}
+		}
+		.ptools{
+			.pcurnums{
+				color: #999;
+				> text{
+					margin-right: 20rpx;
+				}
+			}
+		}
+	}
+	.footer-bar{
+		padding: 20upx;
+		button{
+			width: 80%;
+		}
+		text-align: center;
+	}
+}
+</style>

+ 8 - 8
pages/replenishmentManage/chooseTypeModal.vue

@@ -1,11 +1,11 @@
 <template>
 	<u-mask class="commonModal" :show="isShow" :mask-click-able="false">
 		<view class="modal-con">
-			<view class="modal-title">选择配送方式</view>
+			<!-- <view class="modal-title">选择配送方式</view> -->
 			<view class="modal-main">
-				<u-radio-group v-model="form.dispatchType" width="50%" style="width: 100%;">
+				<!-- <u-radio-group v-model="form.dispatchType" width="50%" style="width: 100%;">
 					<u-radio v-for="(item, index) in dispatchTypeList" :key="index" :name="item.code">{{item.dispName}}</u-radio>
-				</u-radio-group>
+				</u-radio-group> -->
 				<view style="padding: 20upx 0 16upx;">备注</view>
 				<u-input v-model="form.remarks" placeholder="请输入出库备注(最多500字符)" type="textarea" :maxlength="500" :border="true" :auto-height="false" :custom-style="{height: '100upx'}" />
 			</view>
@@ -37,17 +37,17 @@
 			}
 		},
 		mounted() {
-			this.getLookUpItem()
+			// this.getLookUpItem()
 		},
 		methods: {
 			// 确认
 			handleConfirm(){
 				const _this = this;
 				//  表单校验
-				if (!_this.form.dispatchType) {
-					uni.showToast({ icon: 'none', title: '请选择配送方式' });
-					return;
-				}
+				// if (!_this.form.dispatchType) {
+				// 	uni.showToast({ icon: 'none', title: '请选择配送方式' });
+				// 	return;
+				// }
 				this.$emit('confirm', _this.form)
 			},
 			// 配送方式

+ 2 - 2
pages/replenishmentManage/detail.vue

@@ -16,10 +16,10 @@
 					<view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
 					<view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
 				</view>
-				<view v-if="pageType=='success'">
+				<!-- <view v-if="pageType=='success'">
 					<view class="label"><u-icon name="icon_delivery" custom-prefix="iscm-icon" size="32"></u-icon><text>配送方式</text></view>
 					<view class="info-txt">{{basicInfoData.dispatchTypeDictValue || '--'}}</view>
-				</view>
+				</view> -->
 				<view v-if="pageType=='success'">
 					<view class="label"><u-icon name="icon_remark" custom-prefix="iscm-icon" size="32"></u-icon><text>出库备注</text></view>
 					<view class="info-txt">{{basicInfoData.remarks || '--'}}</view>

+ 2 - 2
pages/replenishmentManage/signWarehousing.vue

@@ -8,10 +8,10 @@
 						<text>待签收</text>
 					</view>
 				</view>
-				<view>
+				<!-- <view>
 					<view class="label"><u-icon name="icon_delivery" custom-prefix="iscm-icon" size="32"></u-icon><text>配送方式</text></view>
 					<view class="info-txt">{{basicInfoData.dispatchTypeDictValue || '--'}}</view>
-				</view>
+				</view> -->
 				<view>
 					<view class="label"><u-icon name="icon_remark" custom-prefix="iscm-icon" size="32"></u-icon><text>出库备注</text></view>
 					<view class="info-txt">{{basicInfoData.remarks || '--'}}</view>

+ 3 - 3
pages/shelfSetting/chooseTypeModal.vue

@@ -3,10 +3,10 @@
 		<view class="modal-con">
 			<view class="modal-title">系统将按照补货数量,同步执行出库、签收操作</view>
 			<view class="modal-main">
-				<view class="modal-title">请选择配送方式</view>
-				<u-radio-group v-model="form.dispatchType" width="50%" style="width: 100%;margin-bottom: 20upx;">
+				<!-- <view class="modal-title">请选择配送方式</view> -->
+				<!-- <u-radio-group v-model="form.dispatchType" width="50%" style="width: 100%;margin-bottom: 20upx;">
 					<u-radio v-for="(item, index) in dispatchTypeList" :key="index" :name="item.code">{{item.dispName}}</u-radio>
-				</u-radio-group>
+				</u-radio-group> -->
 				<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">