Browse Source

Merge branch 'develop_szhj07' of http://git.chelingzhu.com/jianguan-web/qpls-md-app into develop_szhj07

lilei 2 years ago
parent
commit
dd7972e497

+ 9 - 0
api/shelf.js

@@ -186,4 +186,13 @@ export const orderBillQueryCount = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 新增回调单
+export const insert = (params) => {
+  return axios.request({
+    url: `shelfRecall/insert`,
+    data: params,
+    method: 'post'
+  })
 }

+ 111 - 23
pages/shuntBackManage/addBackOrder.vue

@@ -23,7 +23,7 @@
 						:show-action="false"
 					></u-search>
 				</view>
-				<view class="searchBox_r" @click="handleScanCode"><u-icon color="#666666" size="40" name="saomiao" custom-prefix="iscm-icon"></u-icon></view>
+				<view class="searchBox_r" @click="handleScanCode"><u-icon name="scan"></u-icon></view>
 			</view>
 		</view>
 		<view class="backOrderCon">
@@ -31,18 +31,18 @@
 				<u-checkbox-group :wrap="true"  @change="checkGroupChange">
 					<view class="partList-list-box" v-for="(item,index) in recallBillList" :key="item.id">
 						<view class="product flex align_center">
-							<view class="checkbox"><u-checkbox v-model="item.isChecked" :name="item.id" size="40" shape="circle"></u-checkbox></view>
+							<u-checkbox class="checkbox" v-model="item.isChecked" :name="item.id" size="40" shape="circle">
 							<view class="flex align_center flex_1">
 								<view class="pimgs">
-									<u-image src="`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+									<u-image :src="item.productImageUrl?item.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 								</view>
 								<view class="pinfo">
-									<view class="pname">
+									<view class="pname item-name">
 										<text>{{item.shelfPlaceCode}}</text>
 										{{item.productCode}}
 									</view>
 									<view class="productName u-line-2">
-										{{item.productName}}
+										{{item.productName}}sasasasass的翻江倒海的结果和减肥感觉感觉
 									</view>
 									<view class="ptxt flex align_center">
 										<view>
@@ -60,6 +60,7 @@
 									</view>
 								</view>
 							</view>
+							</u-checkbox>
 						</view>
 						<view class="ptools flex align_center justify_between">
 							<view class="ptools_l u-flex">
@@ -84,7 +85,7 @@
 		</view>
 		<view class="backOrderFooter u-flex">
 			<view class="checkBox">
-				<u-checkbox-group><u-checkbox label-size="24" v-model="allChecked" shape="circle" @change="allCheckedChange">全选</u-checkbox></u-checkbox-group>
+				<u-checkbox-group><u-checkbox v-model="allChecked" shape="circle" @change="allCheckedChange">全选</u-checkbox></u-checkbox-group>
 			</view>
 			<view class="footerBox u-flex u-row-between">
 				<view class="footerBox_m u-flex">
@@ -100,7 +101,7 @@
 						<u-icon name="arrow-up" color="#999" size="28"></u-icon>
 					</view>
 				</view>
-				<view class="footerBox_r"><u-button type="primary" shape="circle">新增调回单</u-button></view>
+				<view class="footerBox_r"><u-button type="primary" shape="circle"  @click="addBackOrder">新增调回单</u-button></view>
 			</view>
 		</view>
 		<!-- 排序弹窗 -->
@@ -125,7 +126,7 @@
 
 <script>
 import { reportPage } from '@/api/vinLog';
-import { controlQueryList } from '@/api/shelf';
+import { controlQueryList,insert } from '@/api/shelf';
 import detailModal from './detailModal'
 export default {
 	components: {
@@ -289,8 +290,10 @@ export default {
 			this.loadData(this.queryParam);
 		},
 		handelFilter(){
-			this.queryParam.shelfSn = this.shelfSn;
-			this.loadData(this.queryParam);
+			if(this.checkValueRange()){
+				this.queryParam.shelfSn = this.shelfSn;
+				this.loadData(this.queryParam);
+			}	
 		},
 		// 搜索
 		getSearchCon() {
@@ -319,6 +322,91 @@ export default {
 				}
 			});
 			this.loadData(this.queryParam);
+		},
+		addBackOrder(){
+			const arr = []
+			const arrInd = []
+			if(this.chooseArr.length == 0){
+				uni.showToast({
+					title:'请先选择调回单',
+					icon:'none'
+				})
+				return;
+			}
+			this.chooseArr.forEach((item, index) => {
+			  if (item.confirmQty) {
+			    arr.push({
+			      shelfSn: item.shelfSn,
+			      shelfPlaceSn: item.shelfPlaceSn,
+			      shelfPlaceCode: item.shelfPlaceCode,
+			      productSn: item.productSn,
+			      productCode: item.productCode,
+			      productName: item.productName,
+			      qty: item.confirmQty
+			    })
+			  } else {
+			    arrInd.push(index + 1)
+			  }
+			})
+			if (arrInd.length > 0) {
+			  uni.showToast({
+			  	title:'调回数量不能为空或0,请移除后提交',
+				icon:'none'
+			  })
+			  return
+			}
+			uni.showLoading({
+				title: '保存中...'
+			});
+			const params = {
+			  shelfSn: this.shelfSn,
+			  detailList: arr
+			}
+			insert(params).then(res => {
+				uni.hideLoading()
+				if (res.status == 200) {
+					uni.showToast({
+						title:res.message
+					})
+				}
+				
+			});
+		},
+		// 校验滞销天数数值范围
+		checkValueRange () {
+		  const isONull = this.queryParam.unsalableDaysBegin === null || this.queryParam.unsalableDaysBegin === undefined
+		  const isOEmpty = this.queryParam.unsalableDaysBegin === ''
+		  const isOZero = this.queryParam.unsalableDaysBegin === 0
+		  const isTNull = this.queryParam.unsalableDaysEnd === null || this.queryParam.unsalableDaysEnd === undefined
+		  const isTEmpty = this.queryParam.unsalableDaysEnd === ''
+		  const isTZero = this.queryParam.unsalableDaysEnd === 0
+		  //  第一个为空(可为null可为空字符)第二个不为空
+		  //  第一个不为空第二个为空(可为null可为空字符)
+		  //  第一个大于第二个
+		  if ((isONull || isOEmpty) && (this.queryParam.unsalableDaysEnd || isTZero)) {
+		    uni.showToast({
+		    	title:'请输入正确的滞销天数查询范围!',
+				icon:'none'
+		    })
+		    return false
+		  }
+		  if ((this.queryParam.unsalableDaysBegin || isOZero) && (isTNull || isTEmpty)) {
+			uni.showToast({
+				title:'请输入正确的滞销天数查询范围!',
+				icon:'none'
+			})
+		    return false
+		  }
+		  if (this.queryParam.unsalableDaysBegin > this.queryParam.unsalableDaysEnd) {
+		    uni.showToast({
+		    	title:'请输入正确的滞销天数查询范围!',
+		    	icon:'none'
+		    })
+		    return false
+		  }
+		  this.queryParam.unsalableDaysBegin = this.queryParam.unsalableDaysBegin > 999999999 ? 999999999 : this.queryParam.unsalableDaysBegin
+		  this.queryParam.unsalableDaysEnd = this.queryParam.unsalableDaysEnd > 999999999 ? 999999999 : this.queryParam.unsalableDaysEnd
+		  return true
 		}
 	}
 };
@@ -366,13 +454,16 @@ export default {
 			align-items: center;
 			padding: 0 20rpx;
 			border: 1rpx solid #e0e0e0;
-			border-radius: 32rpx;
+			border-radius: 50rpx;
 			box-sizing: border-box;
 			.searchBox_l {
-				width: 93%;
+				width: 87%;
 			}
 			.searchBox_r {
-				width: 7%;
+				width: 13%;
+				text-align: right;
+				font-size: 46rpx;
+				color: #999;
 			}
 		}
 	}
@@ -398,25 +489,22 @@ export default {
 					flex-grow: 1;
 					padding-left: 20rpx;
 					.pname {
-						font-size: 32rpx;
-						color: #191919;
-						margin-bottom: 10rpx;
+						font-size: 26rpx;
+						color:#222;
 						text {
 							font-weight: normal;
-							margin-right: 6rpx;
+							margin-right: 10rpx;
 							padding: 0 10rpx;
 							background: rgba(3, 54, 146, 0.15);
-							border-radius: 100rpx;
+							border-radius: 30rpx;
 							color: #033692;
-							font-size: 28rpx;
+							font-size: 24rpx;
 						}
 					}
 					.productName{
 						width: 100%;
-						font-size: 32rpx;
-						color: #191919;
-						font-weight: bold;
-						margin:10rpx 0;
+						font-size: 26rpx;
+						margin:6rpx 0;
 					}
 					.pno {
 						background-color: rgba(3, 54, 146, 0.15);

+ 5 - 1
pages/shuntBackManage/detailModal.vue

@@ -12,7 +12,7 @@
 					</view>
 					<view class="checkboxRight flex align_center flex_1">
 						<view class="pimgs">
-							<u-image src="`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+							<u-image :src="con.productImageUrl?con.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 						</view>
 						<view class="pinfo">
 							<view class="pname">
@@ -83,10 +83,14 @@
 			clearList(id,i){
 				this.chooseData.splice(i,1);
 				 this.$emit("clearList",id)
+				 if(this.chooseData.length == 0){
+					  this.$emit('close')
+				 }
 			},
 			clearAllList(){
 				this.list = [];
 				 this.$emit("clearAllList")
+				 this.$emit('close')
 			},
 			minus(){
 				this.$emit("changeNumRecount")

+ 0 - 1
pages/shuntBackManage/shelfList.vue

@@ -74,7 +74,6 @@ export default {
 			this.pageNo = 1;
 			this.shelfName = '';
 			this.shelfList = [];
-			console.log('111:')
 			this.$nextTick(() => {
 				this.getShelfList();
 			});