gjy 3 tahun lalu
induk
melakukan
178f1d5d89

+ 29 - 14
components/upload.vue

@@ -41,6 +41,9 @@
 			}" class="u-add-tips">{{ options.text }}</view>
 			</view>
 		</view>
+		<view @click='imgShow=false' v-if="imgShow" class="shade">
+			<image style='position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;' :src="url" mode=""></image>
+		</view>
 		<!-- <view class="custom-style" v-if="custom"
 					:style="{backgroundImage: 'url(' + options.bgc + ')', backgroundSize:'100% 100%'}">
 
@@ -279,7 +282,9 @@
 				lists: [],
 				isInCount: true,
 				uploading: false,
-				isSelectFile: false
+				isSelectFile: false,
+				imgShow:false,
+				url:''
 			};
 		},
 		watch: {
@@ -530,19 +535,22 @@
 				console.log(this.lists,url,index)
 				if (!this.previewFullImage) return;
 				const images = this.lists.map(item => item.url || item.path);
-				uni.previewImage({
-					urls: images,
-					current: url,
-					success: () => {
-						this.$emit('on-preview', url, this.lists);
-					},
-					fail: () => {
-						uni.showToast({
-							title: '预览图片失败',
-							icon: 'none'
-						});
-					}
-				});
+				this.url=url
+				this.imgShow=true
+				// 图片预览调用onShow清空数据
+				// uni.previewImage({
+				// 	urls: images,
+				// 	current: url,
+				// 	success: () => {
+				// 		this.$emit('on-preview', url, this.lists);
+				// 	},
+				// 	fail: () => {
+				// 		uni.showToast({
+				// 			title: '预览图片失败',
+				// 			icon: 'none'
+				// 		});
+				// 	}
+				// });
 			},
 			// 判断是否json字符串
 			checkIsJSON(str) {
@@ -771,4 +779,11 @@
 			border:1px dashed #AFB3BF;
 		}
 	}
+	.shade{
+		background:#000;
+		position:fixed;
+		top:0;left:0;
+	   width:100%;height:100%;
+	   z-index:10000;
+	}
 </style>

+ 57 - 20
pages/erp/deliveryfeedback/details.vue

@@ -162,7 +162,8 @@
 						<view v-else>暂无图片</view>
 					</view>
 					<view v-else>
-						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+						<image v-if="item.loadPoundImg"  @click='shadeshow(item.loadPoundImg)' style='width:100px;height:100px;' :src="item.loadPoundImg" mode=""></image>
+						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 							:size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 							@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 					</view>
@@ -222,7 +223,7 @@
 						<image style='width:100px;height:100px;' @click='shadeshow(item.loadPoundImg)' :src="item.loadPoundImg" mode=""></image>
 					</view>
 					<view v-else>
-						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 							:size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 							@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 					</view>
@@ -298,16 +299,17 @@
 						</u-picker>
 					</view>
 				</view>
-				<view style='text-align:right;' v-if="item.status == '已装车' || item.status == '已送达'">{{item.status}}</view>
+				<view style='text-align:right;' v-if="item.status == '已装车'">未装船</view>
+				<view style='text-align:right;' v-else-if="item.status == '已送达'">已装船</view>
 				<u-button v-else @click='submit(index,3)' type="success">保存</u-button>
 			</view>
 			<view class="row">
 				<view style='margin-left:10px;' class="left">运单</view>
 				<view v-if="pictureTotal.length>0">
-					<image  v-for='item in pictureTotal' @click='shadeshow(item)' style='width:100px;height:100px;' :src="item" mode=""></image>
+					<image  v-for='item in pictureTotal' @click='shadeshow(item)' style='width:100px;height:100px;margin:5px;' :src="item" mode=""></image>
 				</view>
-				<view v-else>
-					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+				<view >
+					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 						:size-type="['compressed']"  @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
 						@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 				</view>
@@ -403,6 +405,14 @@
 				this.freightspace[this.index].show2=true
 				this.$forceUpdate();
 			},
+			getImgUrl1(res1,res2,res3,res4){
+				console.log(res1,res2,res3,res4)
+				if (this.freightspace[0].loadPoundImg) {
+					this.freightspace[0].loadPoundImg += ',' + res1
+				} else {
+					this.freightspace[0].loadPoundImg = res1
+				}
+			},
 			submit(index,status){
 				var that = this
 				if(this.detailData.tranType=='火运'){
@@ -551,11 +561,13 @@
 			},
 			finishedgoods(){
 				var that = this
+				
 				if(this.detailData.tranType=='火运'){
 					uni.showModal({
 						content: "完货操作后,装车信息不可修改,是否确定完货?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								that.tranCarInfoList = that.freightspace
 								that.tranCarInfoList.driver = that.detailData.driver
 								that.tranCarInfoList.driverPhone = that.detailData.driverPhone
@@ -581,10 +593,13 @@
 								tranProcessInfo.tranCarInfoList = that.tranCarInfoList
 								that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
-										that.$api.msg('提交成功')
+										uni.hideLoading()
+										that.$api.msg('完货成功')
 										that.detailData = {}
 										that.freightspace = {}
-										uni.navigateBack({})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
 									}
 								})
 							}
@@ -595,14 +610,18 @@
 						content: "完货操作后,装船信息不可修改,是否确定完货?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								var tranProcessInfo = {}
 								tranProcessInfo.id = that.detailData.id
 								that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
-										that.$api.msg('提交成功')
+										uni.hideLoading()
+										that.$api.msg('完货成功')
 										that.detailData = {}
 										that.freightspace = {}
-										uni.navigateBack({})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
 									}
 								})
 							}
@@ -613,14 +632,19 @@
 						content: "完货操作后,装车信息不可修改,是否确定完货?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								var tranProcessInfo = {}
 								tranProcessInfo.id = that.detailData.id
 								that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
-										that.$api.msg('提交成功')
+										uni.hideLoading()
+										that.$api.msg('完货成功')
 										that.detailData = {}
 										that.freightspace = {}
 										uni.navigateBack({})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
 									}
 								})
 							}
@@ -629,6 +653,7 @@
 				}
 			},
 			pass(){
+				
 				var that = this
 				if(this.detailData.tranType=='火运'){
 					for(var i=0;i<this.freightspace.length;i++){
@@ -652,6 +677,7 @@
 						content: "提交成功后提醒司机及时签订运输合同,确定提交装车信息?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								that.tranCarInfoList = that.freightspace
 								that.tranCarInfoList.driver = that.detailData.driver
 								that.tranCarInfoList.driverPhone = that.detailData.driverPhone
@@ -677,12 +703,13 @@
 								tranProcessInfo.tranCarInfoList = that.tranCarInfoList
 								that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
+										uni.hideLoading()
 										that.$api.msg('提交成功')
 										that.detailData = {}
 										that.freightspace = {}
-										uni.navigateBack({
-											
-										})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
 									}
 								})
 							}
@@ -699,6 +726,7 @@
 						content: "提交成功后装船信息不可修改,是否确定提交?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								that.tranCarInfoList = that.freightspace
 								that.tranCarInfoList[0].sendDateStart = that.detailData.sendDateStart
 								for (var i = 0; i < that.tranCarInfoList.length; i++) {
@@ -711,12 +739,16 @@
 								tranProcessInfo.tranCarInfoList = that.tranCarInfoList
 								that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
+										uni.hideLoading()
 										that.$api.msg('提交成功')
 										that.detailData = {}
 										that.freightspace = {}
-										uni.navigateBack({
-											
-										})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
+									}else{
+										uni.hideLoading()
+										that.$api.msg('系统异常,请联系管理员')
 									}
 								})
 							}
@@ -727,6 +759,7 @@
 						content: "提交成功后提醒司机及时签订运输合同,确定提交装车信息?",
 						success(res) {
 							if (res.confirm) {
+								uni.showLoading({title: '加载中'});
 								that.tranCarInfoList = that.freightspace
 								that.tranCarInfoList.driver = that.detailData.driver
 								that.tranCarInfoList.driverPhone = that.detailData.driverPhone
@@ -751,12 +784,16 @@
 								tranProcessInfo.tranCarInfoList = that.tranCarInfoList
 								that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
 									if (res.data.code == 200) {
+										uni.hideLoading()
 										that.$api.msg('提交成功')
 										that.detailData = {}
 										that.freightspace = {}
-										uni.navigateBack({
-											
-										})
+										setTimeout(function() {
+										         uni.navigateBack({})
+										     }, 1000);
+									}else{
+										uni.hideLoading()
+										that.$api.msg('系统异常,请联系管理员')
 									}
 								})
 							}

+ 3 - 3
pages/erp/receivingfeedback/details.vue

@@ -166,7 +166,7 @@
 						<view v-else>暂无图片</view>
 					</view>
 					<view v-else>
-						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 							:size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 							@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 					</view>
@@ -231,7 +231,7 @@
 						<view v-else>暂无图片</view>
 					</view>
 					<view v-else>
-						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+						<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 							:size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
 							@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 					</view>
@@ -320,7 +320,7 @@
 					<image v-for='item in pictureTotal'  @click='shadeshow(item)' style='width:100px;height:100px;' :src="item" mode=""></image>
 				</view>
 				<view v-else>
-					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
+					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9" :file-list="imgUrl"
 						:size-type="['compressed']"  @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
 						@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 				</view>