Explorar o código

Merge branch 'develop_yh13' of jianguan-web/qpls-md-app into pre-release

李磊 %!s(int64=2) %!d(string=hai) anos
pai
achega
49e4009dbc

+ 8 - 0
api/shelf.js

@@ -28,6 +28,14 @@ export const shelfProductList = (params) => {
     method: 'post'
   })
 }
+// 禁用货架产品 
+export const shelfProductEnable = (params) => {
+  return axios.request({
+    url: `shelfProduct/updateEnableFlag`,
+    data: params,
+    method: 'post'
+  })
+}
 //  货架  详情
 export const shelfDetail = (params) => {
   return axios.request({

+ 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.2.111:8503/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 4 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "iSCM智慧供应链",
     "appid" : "__UNI__5B57B68",
     "description" : "iSCM智慧供应链系统",
-    "versionName" : "1.2.6",
-    "versionCode" : 126,
+    "versionName" : "1.3.1",
+    "versionCode" : 131,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -56,7 +56,8 @@
         "modules" : {
             "Bluetooth" : {},
             "Share" : {},
-            "Push" : {}
+            "Push" : {},
+            "Barcode" : {}
         },
         /* 应用发布信息 */
         "distribute" : {

+ 4 - 6
pages.json

@@ -576,12 +576,10 @@
         }
         ,{
             "path" : "pages/shelfSetting/editShelfHw",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "编辑货位",
-                "enablePullDownRefresh": false
-            }
-            
+			"style": {
+						"navigationStyle": "custom" ,// 隐藏系统导航栏
+						"navigationBarTextStyle": "black" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一
+					}   
         }
         ,{
             "path" : "pages/shelfSetting/addShelfHw",

+ 13 - 3
pages/batchShelves/scanProduct.vue

@@ -28,7 +28,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="product-nums">
+				<view class="product-nums" v-if="!isDisable">
 					<view>本次上架数量<text>(左右滑动选择)</text></view>
 					<view class="numsBox flex align_center justify_between">
 						<view class="a-left" @click="numsBoxScroll(0)"><u-icon name="arrow-left"></u-icon></view>
@@ -42,7 +42,8 @@
 						<view class="a-right" @click="numsBoxScroll(1)"><u-icon name="arrow-right"></u-icon></view>
 					</view>
 				</view>
-				<view class="infoTits" v-if="productInfo.shelfCartApi">产品已录入,请确认数量</view>
+				<view class="infoTits" v-if="!isDisable&&productInfo.shelfCartApi">产品已录入,请确认数量</view>
+				<view class="infoTits" v-if="isDisable">此产品已被禁用,不可添加!</view>
 			</view>
 			<view class="noData" v-else>
 				暂无扫描结果
@@ -81,7 +82,8 @@
 				scleft: 0,
 				fromPage: null,
 				qrCode: '',
-				numsWidth: 52
+				numsWidth: 52,
+				isDisable: false
 			}
 		},
 		onReady() {
@@ -146,6 +148,7 @@
 					if(res.status == 200&&res.data&&res.data.productList&&res.data.productList.length){
 						const ret = res.data.productList[0]
 						 this.productInfo = ret
+						 this.isDisable = ret.shelfProductApi&&ret.shelfProductApi.enableFlag==0
 						 this.shelfPlaceCode = res.data.shelfPlaceCode
 						 // 数量区域宽度
 						 const query = uni.createSelectorQuery().in(_this);
@@ -190,6 +193,13 @@
 					shelfCartSn: item?item.shelfCartSn:undefined
 				}
 				console.log(params)
+				if(this.isDisable){
+					uni.showToast({
+						icon:'none',
+						title: '此产品已被禁用,不可添加!'
+					})
+					return false
+				}
 				shelfCartSave(params).then(res => {
 					console.log(res)
 					if(res.status == 200){

+ 8 - 1
pages/batchShelves/searchProduct.vue

@@ -32,7 +32,7 @@
 						</view>
 						<view class="ptxt flex justify_between">
 							<text style="word-break: break-all;">{{item.code}}</text>
-							<view v-if="item.shelfProductApi">
+							<view v-if="item.shelfProductApi&&item.shelfProductApi.enableFlag==1">
 								可用库存:<text>{{item.shelfProductApi.qty}}</text>{{item.unit}}
 							</view>
 						</view>
@@ -155,6 +155,13 @@
 			},
 			// 新增
 			addItem(item){
+				if(item.shelfProductApi&&item.shelfProductApi.enableFlag==0){
+					uni.showToast({
+						icon:'none',
+						title: '此产品已被禁用,不可添加!'
+					})
+					return false
+				}
 				this.saveData(item,1)
 			},
 			// 修改数量

+ 54 - 4
pages/shelfSetting/editShelfHw.vue

@@ -1,5 +1,13 @@
 <template>
 	<view class="content flex flex_column">
+		<u-navbar back-text="编辑货位" :border-bottom="false">
+			<view slot='right' 
+			style="padding: 0 30upx;" 
+			@click="enableShelfProduct" 
+			v-if="type=='edit'&&nowData&&nowData.shelfProductApiEntity&&(!nowData.shelfProductApiEntity.qty||(nowData.shelfProductApiEntity.enableFlag==0&&nowData.shelfProductApiEntity.qty))">
+				<text :style="{color:nowData&&nowData.shelfProductApiEntity.enableFlag==1?$config('errorColor'):$config('primaryColor')}">{{nowData&&nowData.shelfProductApiEntity.enableFlag==1?'禁用':'启用'}}</text>
+			</view>
+		</u-navbar>
 		<view class="form-body">
 			<u-form :model="form" label-width="180rpx" :error-type="['toast']" ref="uForm">
 				<u-form-item label="货位号">
@@ -17,10 +25,13 @@
 							<view class="pinfo flex_1">
 								<view class="ptxt flex align_center justify_between">
 									<text>{{productEntity.code}}</text>
-									<text class="pcode" @click="toBindProduct">
+									<text class="pcode" @click="toBindProduct" v-if="type=='bind'||(type=='edit'&&nowData&&nowData.shelfProductApiEntity&&nowData.shelfProductApiEntity.enableFlag==1)">
 										<u-icon name='reload'></u-icon>
 										更换产品
 									</text>
+									<text v-else class="pcode" style="color: #999;">
+										(已禁用)
+									</text>
 								</view>
 								<view class="pname">
 									{{productEntity.name}}
@@ -51,14 +62,14 @@
 		</view>
 		<view class="flex footer-btn">
 			<u-button v-if="type=='bind'" class="delbtn" :loading='loading' @click="handleDel" type='primary' shape="circle" size="medium">删除货位</u-button>
-			<u-button :style="{width:type=='bind'?'45%':'100%'}" class="newbtn" :loading='loading' @click="formSubmit" type='primary' shape="circle" size="medium">保存</u-button>
+			<u-button :disabled="type=='edit'&&nowData&&nowData.shelfProductApiEntity&&nowData.shelfProductApiEntity.enableFlag==0" :style="{width:type=='bind'?'45%':'100%'}" class="newbtn" :loading='loading' @click="formSubmit" type='primary' shape="circle" size="medium">保存</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
 	import { clzConfirm, numberToFixed } from '@/libs/tools';
-	import { shelfProductSave, shelfProductDetail, delShelfPlaceSn } from '@/api/shelf'
+	import { shelfProductSave, shelfProductDetail, delShelfPlaceSn, shelfProductEnable } from '@/api/shelf'
 	export default {
 		data() {
 			return {
@@ -92,6 +103,7 @@
 		onLoad(opts) {
 			const _this = this
 			this.nowData = this.$store.state.vuex_tempData;
+			console.log(this.nowData)
 			this.customerSn = this.nowData.customerSn
 			this.shelfSn = this.nowData.shelfSn
 			this.type = opts.type
@@ -174,7 +186,9 @@
 					  name: res.data.productName,
 					  productMsg: res.data.productImageUrl,
 					  currQty: res.data.qty,
-					  unit: res.data.productEntity.unit
+					  unit: res.data.productEntity.unit,
+					  enabledFlag: res.data.productEntity.enabledFlag,
+					  shelfProductSn: res.data.shelfProductSn
 				  }
 			      this.form.productSn = res.data.productSn
 				  this.bakProductSn = res.data.productSn
@@ -190,6 +204,42 @@
 			    }
 			  })
 			},
+			// 禁用货位产品
+			enableShelfProduct(){
+				const _this = this
+				const isEnable = this.nowData&&this.nowData.shelfProductApiEntity&&this.nowData.shelfProductApiEntity.enableFlag==1
+				if(isEnable){
+					clzConfirm({
+					  title: '提示',
+					  content: '禁用后不参于盘点和补货,但是可以退货、调回,确认禁用吗?',
+					  success (ret) {
+							if (ret.confirm || ret.index == 0) {
+								_this.enableFun(isEnable)
+							}
+					  }
+					})
+				}else{
+					_this.enableFun(isEnable)
+				}
+				
+			},
+			enableFun(isEnable){
+			  const _this = this
+			  const shelfProductSn = this.nowData.shelfProductApiEntity.shelfProductSn
+			  _this.spinning = true
+			  shelfProductEnable({ shelfSn: this.nowData.shelfSn, shelfProductSn: shelfProductSn, enableFlag: isEnable ? 0 : 1 }).then(res => {
+				if (res.status == 200) {
+				   uni.showToast({
+				   	icon: "none",
+				   	title: res.message
+				   })
+				   this.nowData.shelfProductApiEntity.enableFlag = isEnable ? 0 : 1
+				   // 获取产品信息
+				   this.getProductInfo()
+				}
+				_this.spinning = false
+			  })
+			},
 			// 删除货位
 			handleDel (row) {
 			  const _this = this

+ 1 - 1
pages/shelfSetting/searchShelfHw.vue

@@ -114,7 +114,7 @@
 			//编辑货位
 			toEdit(item){
 				const type = 'edit'
-				const params = Object.assign({shelfSn: this.shelfSn,shelfName: this.shelfName},item)
+				const params = Object.assign({shelfSn: this.shelfSn,shelfName: this.shelfName, shelfProductApiEntity: item},item)
 				this.$store.state.vuex_tempData = params
 				uni.navigateTo({
 					url: "/pages/shelfSetting/editShelfHw?type=" + type

+ 131 - 102
pages/shelfSetting/shelfSet.vue

@@ -7,6 +7,7 @@
 				<u-badge v-if="showDot" :is-dot="true" size="mini" type="error"></u-badge>
 			</view>
 		</u-navbar>
+	<view class="body-content flex flex_column">
 		<view class="card-box" v-if="detailData">
 			<view class="card-row flex align_center justify_between">
 				<view class="label">货架名称</view>
@@ -39,7 +40,7 @@
 			<u-action-sheet :list="actionList" @click="clickAction" v-model="updateShowPrice"></u-action-sheet>
 		</view>
 		<!-- 货位信息 -->
-		<view class="shelfPlace" v-if="shelfPlaceList">
+		<view class="shelfPlace" :style="{height: scrollH+'px'}" v-if="shelfPlaceList">
 			<view class="flex align_center shelfPlaceHead">
 				<view class="lt"><text>□</text>表示没有绑定产品</view>
 				<view class="search-btn flex align_center" @click="toSearchHw">
@@ -65,7 +66,7 @@
 				</view>
 			</view>
 		</view>
-		<view v-else>
+		<view style="width: 100%;" v-else>
 			<view class="nodata" v-if="!loading">
 				<view>
 					<u-image :src="`../../static/${$config('themePath')}/def_no_data@3x.png`" width="180" height="180" border-radius="10"></u-image>
@@ -83,6 +84,8 @@
 			</view>
 		</view>
 	</view>
+		
+	</view>
 </template>
 
 <script>
@@ -99,6 +102,7 @@
 				detailData: null,
 				switchVal: false,
 				showMenus:false,
+				scrollH: 400,
 				popData:[{title:'快速补货',val:'0'},{title:'打印贴签',val:'1'}],
 				pleft:0,
 				ptop:0,
@@ -123,6 +127,11 @@
 				]
 			}
 		},
+		watch:{
+			showMore(a,b){
+				this.getScrollHeight(a)
+			},
+		},
 		onLoad(option) {
 			this.shelfSn = option.shelfSn
 			// 获取货架详情
@@ -131,7 +140,7 @@
 			// 获取货物
 			this.getShelfPlace()
 			this.isLoad = true
-			this.webView = this.$mp.page.$getAppWebview(); 
+			// this.webView = this.$mp.page.$getAppWebview(); 
 			uni.$on("editCustome",(data)=>{
 				this.isLoad = true
 				this.saveShelf(data,0)
@@ -141,10 +150,10 @@
 				this.saveShelf(data,1)
 			})
 			
-			const win = uni.getWindowInfo()
-			this.pleft = Math.floor(win.windowWidth * 0.3)
-			this.ptop = Math.floor(win.windowHeight - 70)
-			
+			// const win = uni.getWindowInfo()
+			// this.pleft = Math.floor(win.windowWidth * 0.3)
+			// this.ptop = Math.floor(win.windowHeight - 70)
+			this.getScrollHeight(this.showMore)
 			console.log(this.shelfSn)
 		},
 		onUnload() {
@@ -157,6 +166,19 @@
 			}
 		},
 		methods: {
+			getScrollHeight(a){
+				const sys = uni.getSystemInfoSync()
+				const h = a? 290 : 250
+				if(sys.platform == 'android'){
+					this.scrollH = sys.windowHeight - h
+				}else{
+					if(sys.safeArea.top){
+						this.scrollH = sys.windowHeight - h + sys.statusBarHeight - 34
+					}else{
+						this.scrollH = sys.windowHeight - h - 14
+					}
+				}
+			},
 			// 刷新货位
 			updateHw(){
 				this.placeTab = []
@@ -189,7 +211,7 @@
 				}
 				// 快速补货
 				if(e == 2){
-					createShelfReplenishBill({shelfSn: this.shelfSn}).then(res => {
+					createShelfReplenishBill({shelfSn: this.shelfSn, enableFlag: 1}).then(res => {
 						console.log(res.data)
 						if(res.data&&res.data.length){
 							const params = Object.assign(this.detailData,{list:res.data})
@@ -411,121 +433,128 @@
 			}
 		}
 	}
-	.moreSeting{
-		text-align: center;
-		color: #999;
-		padding: 20upx;
-		> text{
-			margin-right: 10rpx;
-		}
-	}
-}
-.card-box{
-	background-color: #fff;
-	border-radius: 0.5rem;
-	box-shadow: 0.1rem 0.2rem 0.3rem #eee;
-	padding: 0 1rem;
-	margin: 0.5rem;
-	.card-row{
-		border-bottom: 1rpx solid #eee;
-		padding: 20rpx 0;
-		min-height: 90rpx;
-		&:last-child{
-			border-bottom: 0;
-		}
-		.label{
-			flex: 1;
-			width: 20%;
-		}
-		.text{
-			width: 80%;
-			color: #666;
-		}
-	}
-}
-.shelfPlace{
-	.shelfPlaceHead{
-		padding: 0.2rem 0.5rem 0.5rem;
-		justify-content: space-between;
-		.lt{
-			font-size: 0.9rem;
-			color: #999;
-			text{
-				color: #ff5500;
-				font-size: 1rem;
+	.body-content{
+		width: 100%;
+     }
+	.card-box{
+		background-color: #fff;
+		border-radius: 0.5rem;
+		box-shadow: 0.1rem 0.2rem 0.3rem #eee;
+		padding: 0 1rem;
+		margin: 0.5rem;
+		.card-row{
+			border-bottom: 1rpx solid #eee;
+			padding: 20rpx 0;
+			min-height: 90rpx;
+			&:last-child{
+				border-bottom: 0;
+			}
+			.label{
+				flex: 1;
+				width: 20%;
+			}
+			.text{
+				width: 80%;
+				color: #666;
 			}
 		}
-		.search-btn{
-			border:1rpx solid #eee;
-			border-radius: 50rpx;
-			width: 50%;
-			justify-content: space-between;
-			padding:0.3rem 0.5rem;
+		.moreSeting{
+			text-align: center;
 			color: #999;
-			background-color: #fff;
-			font-size: 0.9rem;
-			&:active{
-				opacity: 0.6;
+			padding: 20upx;
+			> text{
+				margin-right: 10rpx;
 			}
 		}
 	}
-	.shelfTabs{
-		height: calc(100vh - 150rpx);
-		.leftTabs{
-			width: 20%;
-			overflow: auto;
-			> view{
-				padding: 0.8rem 0.5rem;
-				border-left: 0.2rem solid #f8f8f8;
-				text-align: center;
+	
+	.shelfPlace{
+		height: calc(100% - 300rpx);
+		.shelfPlaceHead{
+			padding: 0.2rem 0.5rem 0.5rem;
+			justify-content: space-between;
+			.lt{
+				font-size: 0.9rem;
+				color: #999;
+				text{
+					color: #ff5500;
+					font-size: 1rem;
+				}
 			}
-			.active{
-				border-color: rgb(47, 126, 209);
+			.search-btn{
+				border:1rpx solid #eee;
+				border-radius: 50rpx;
+				width: 50%;
+				justify-content: space-between;
+				padding:0.3rem 0.5rem;
+				color: #999;
 				background-color: #fff;
+				font-size: 0.9rem;
+				&:active{
+					opacity: 0.6;
+				}
 			}
 		}
-		.rightCons{
-			width: 80%;
-			background-color: #fff;
-			position: relative;
-			.hwList{
+		.shelfTabs{
+			height: calc(100% - 85rpx);
+			.leftTabs{
+				width: 20%;
 				overflow: auto;
-				padding: 0.5rem;
-				padding-bottom: 105rpx;
-				> text{
-					border: 1rpx solid #eee;
-					padding: 0.2rem 0.8rem;
-					border-radius: 0.3rem;
-					margin: 0.5rem 2%;
-					float: left;
-					width: 20%;
+				> view{
+					padding: 0.8rem 0.5rem;
+					border-left: 0.2rem solid #f8f8f8;
 					text-align: center;
 				}
-				.red{
-					border-color: #ff5500;
-				}
-				.add{
-					border-style: dashed;
-					border-color: #999;
-					color: #999;
+				.active{
+					border-color: rgb(47, 126, 209);
+					background-color: #fff;
 				}
 			}
-			.hwAction{
-				padding: 0.5rem;
-				position: fixed;
-				bottom: 0;
-				right: 0;
+			.rightCons{
 				width: 80%;
 				background-color: #fff;
-				button{
-					width: 240rpx;
+				position: relative;
+				.hwList{
+					overflow: auto;
+					padding: 0.5rem;
+					padding-bottom: 105rpx;
+					> text{
+						border: 1rpx solid #eee;
+						padding: 0.2rem 0.8rem;
+						border-radius: 0.3rem;
+						margin: 0.5rem 2%;
+						float: left;
+						width: 20%;
+						text-align: center;
+					}
+					.red{
+						border-color: #ff5500;
+					}
+					.add{
+						border-style: dashed;
+						border-color: #999;
+						color: #999;
+					}
 				}
-				.newbtn{
-					background-color: rgb(51, 95, 182);
-					color: #fff;
+				.hwAction{
+					padding: 0.5rem;
+					position: fixed;
+					bottom: 0;
+					right: 0;
+					width: 80%;
+					background-color: #fff;
+					button{
+						width: 240rpx;
+					}
+					.newbtn{
+						background-color: rgb(51, 95, 182);
+						color: #fff;
+					}
 				}
 			}
 		}
 	}
 }
+
+
 </style>

+ 1 - 1
pages/shuntBackManage/cancellingStocks.vue

@@ -27,7 +27,7 @@
 			<u-button @click="submit" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">确定退库</u-button>
 		</view>
 		<!-- 确认弹框 -->
-		<common-modal :openModal="confirmModal" content="调回产品将退回至经销商仓库,确认退库吗?" confirmText="确认退库" @confirm="modalConfirm" @close="confirmModal=false" />
+		<common-modal :openModal="confirmModal" content="此操作将会扣减数字货架的库存,确认退库吗?" confirmText="确认退库" @confirm="modalConfirm" @close="confirmModal=false" />
 		<!-- 生成销售退货单弹窗 -->
 		<common-modal :showTitle="false" :openModal="refundModal" @confirm="refundModalConfirm" @close="refundModal=false">
 			<view style="font-size: 28upx;">

+ 2 - 1
pages/soldOut/chooseProduct.vue

@@ -313,7 +313,8 @@
 				let params = {
 					shelfSn: this.nowData.shelfSn,
 					queryWord: this.queryWord,
-					stockStateList: this.stockStateList
+					stockStateList: this.stockStateList,
+					enableFlag: 1
 				}
 				uni.showLoading({
 					mask:true,

+ 0 - 1
pages/soldOut/creatOrder.vue

@@ -107,7 +107,6 @@
 </template>
 
 <script>
-	import { queryProductListForReplenish } from '@/api/shelf'
 	import { saveMainAndDetail } from '@/api/shelfReplenish'
 	import { clzConfirm } from '@/libs/tools'
 	export default {

+ 1 - 0
pages/stockCheck/startCheck.vue

@@ -486,6 +486,7 @@
 					shelfPlaceCodeHead: this.curTab,
 					currQtyFlag: this.curType=='available' ? 1 : '',
 					freezeQtyFlag: this.curType=='blocked' ? 1 : '',
+					enableFlag: 1
 				}
 				_this.status = 'loading'
 				getShelfProductList(params).then(res => {

+ 7 - 7
pages/userCenter/index.vue

@@ -26,10 +26,10 @@
 				<u-cell-item  index="1" @click="toPage(4)" title="系统参数" v-if="$hasPermissions('M_ARStatement_mobile')">
 					<u-icon slot="icon" name="xitongcanshu-05" custom-prefix="iscm-icon" size="42" color="#00aaff"></u-icon>
 				</u-cell-item>
-				<u-cell-item icon="man-delete" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="closeAccount" title="注销账户"></u-cell-item>
 				<u-cell-item icon="reload" icon-size="35" :icon-style="{color:'#00aaff'}" index="1" @click="resetPrint" title="重置打印机"></u-cell-item>
 			</u-cell-group>
 			<u-cell-group>
+				<u-cell-item icon="man-delete" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="closeAccount" title="注销账户"></u-cell-item>
 				<!-- <u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#00aaff'}" index="1" @click="toPage" title="关于我们"></u-cell-item> -->
 				<u-cell-item icon="level" icon-size="34" :icon-style="{color:'#00aaff'}" index="2" @click="toPage(2)" :value="curVer.version" title="版本检查"></u-cell-item>
 				<u-cell-item icon="file-text" icon-size="36" :icon-style="{color:'#00aaff'}" index="0" @click="toPage(0)" title="服务协议及隐私政策"></u-cell-item>
@@ -181,14 +181,14 @@
 				const _this = this;
 				clzConfirm({
 					title: '提示',
-					content: '如果您选择注销账户,您的账户信息将被全部清除,将无法使用iSCM系统。如果您确认注销,可提供注册账号,发送邮件到car_octopus@sina.com。1-3个工作日即可完成注销。',
+					content: '账户注销后将不能再使用iSCM系统,且您的所有相关数据将被删除,确定注销吗?',
 					success: function(res) {
 						if (res.confirm || res.index == 0) {
-							// logoff().then(ret => {
-							// 	if(ret.status == 200){
-							// 		_this.toLogin()
-							// 	}
-							// })
+							logoff().then(ret => {
+								if(ret.status == 200){
+									_this.toLogin()
+								}
+							})
 						}
 					}
 				});