Browse Source

前端 更新

zhongtianhaoyuan 3 years ago
parent
commit
4cb093a995

+ 3 - 1
pages/erpbusiness/acquisitionInspection/tareDetail.vue

@@ -61,12 +61,14 @@
 			return {
 				detailData: {
 					tare: 0,
-					buckleMiscellaneous: 0
+					buckleMiscellaneous: 0,
+					qualityInspectionManagement:{}
 				},
 				purchasePriceList: []
 			}
 		},
 		onShow() {
+			
 			this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
 				warehouseId: this.detailData.warehouseId
 			}).then(res => {

+ 1 - 3
pages/erpbusiness/edit_quality_testing.vue

@@ -70,7 +70,7 @@
 			<view class="c-row ">
 				<view class="title">货名</view>
 				<view class="con-list">
-					<view v-if="flag == '1'">
+					<view v-if="flag == '1'||flag == '0'">
 						{{gridList.goodsName}}
 					</view>
 					<view @click='goodsName = true' v-if="flag == '2'">{{gridList.goodsName}}</view>
@@ -109,8 +109,6 @@
 					<view class='title_b'>化验信息</view>
 					<u-switch v-if='flag!=1' v-model="value" @change="change"></u-switch>
 				</view>
-				
-
 				<view class="c-row ">
 					<view class="title">等级</view>
 					<view class="con-list">

+ 186 - 25
pages/erpbusiness/sm/sm.vue

@@ -27,16 +27,40 @@
 						</view>
 					</view>
 				</view>
-
 				<view class="nolist" v-if="grainMerchantList.length==0">
 					<image class="img" :src="img2" alt=""></image>
 					<view class="text">您还未认证个人粮商身份</view>
 				</view>
-				<button v-if="grainMerchantList.length>0" :class="flag?'':'custom-style'" @click="submit">{{btnVal}}</button>
-				<button v-if="grainMerchantList.length==0" class="custom-style" @click="toGrainMerchantCertification()">接受并去认证</button>
+				<button v-if="grainMerchantList.length>0" :class="flag?'':'custom-style'"
+					@click="submit">{{btnVal}}</button>
+				<button v-if="grainMerchantList.length==0" class="custom-style"
+					@click="toGrainMerchantCertification()">接受并去认证</button>
 			</div>
 		</u-popup>
+		<u-toast ref="warning" />
+		<u-popup v-model="show1" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
+			<view class="buns_item">
+				<view class="but_css" @click="skip(1)" v-if="getRoles('acquisitionQuality.initial') && status == '已初检'">
+					去初检
+				</view>
+				<view class="but_css" @click="skip(2)"
+					v-if="getRoles('acquisitionQuality.again') && (status == '已初检'|| status == '已复检')">去复检</view>
+				<view class="but_css" @click="skip(3)"
+					v-if="getRoles('acquisitionWeight.mao') && weightStatus != '已称皮重' && (weightStatus == '已质检'|| weightStatus == '已称毛重')">
+					去称毛重</view>
+				<view class="but_css" @click="skip(4)"
+					v-if="getRoles('acquisitionWeight.weight') && (weightStatus == '已称毛重' || weightStatus == '已称皮重')">
+					去称皮重
+				</view>
+				<view class="but_css" @click="skip(5)"
+					v-if="getRoles('acquisitionQuality.con') && confirm != '1' && status == '已复检'">
+					去确认质检
+				</view>
+				<view class="but_css" @click="close">返回</view>
+			</view>
+		</u-popup>
 	</view>
+
 </template>
 
 <script>
@@ -46,9 +70,10 @@
 	export default {
 		data() {
 			return {
-				img1:require("../../../static/img/select.png"),
-				img2:require("../../../static/img/nolist.png"),
-				show: true,
+				img1: require("../../../static/img/select.png"),
+				img2: require("../../../static/img/nolist.png"),
+				show: false,
+				show1: true,
 				identityAuthenticationInfo: {},
 				grainMerchantList: [],
 				selectID: "",
@@ -57,32 +82,155 @@
 					title: '',
 					companyId: ''
 				},
-				isAllselect:false,
-				flag : true
+				isAllselect: false,
+				flag: true,
+				cangid: "", //仓库id
+				managementType: 1,
+				warehouseName: "", //仓库名
+				status: "", //质检状态
+				weightStatus: "", //检斤状态
+				qualityNo: "",
+				confirm: "", //确认初检确认状态
+				detailData: {},
+				userName: "", //仓库负责人
+				companyId: "",
+				decide: false
 			}
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		onLoad(options) {
-			  //#ifdef APP-PLUS
-			  this.user.title = options.data.split(',')[2]
-			  this.user.companyId = options.data.split(',')[1]
-			  //#endif
+			//#ifdef APP-PLUS
+			this.user.title = options.data.split(',')[2]
+			this.user.companyId = options.data.split(',')[1]
+			this.compId = options.data.split(',')[1]
+			this.qualityNo = options.data.split(',')[2]
+			this.cangid = options.data.split(',')[3]
+			//#endif
 		},
 		onShow() {
-			this.getList()
+			// this.qualityNo = "SGRK202112140060004"
+			// this.cangid = "374a8a02ecfe40dc9abdcd902dd564f5"
+			// this.compId = "2710b21efc1e4393930c5dc800010dc4"
+			console.log(this.qualityNo,this.cangid,this.compId)
+			if (this.cangid) { //判断是在哪扫码进入的
+				this.show = false
+				this.show1 = true
+				this.companyId = uni.getStorageSync('pcUserInfo').compId
+				this.userName = uni.getStorageSync('userInfo').userName.split("-")[1]
+				if (this.companyId == this.compId) {
+					this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+						id: this.cangid
+					}).then(res => {
+						let cangList = res.data.data
+						let person = cangList.otherPersonCharge.split(",")
+						person.push(cangList.personCharge)
+						for (let i = 0; i < person.length; i++) {
+							if (person[i].indexOf(uni.getStorageSync('userInfo').userName.split("-")[1]) != -1) {
+								this.decide = true
+								this.getShow()
+								return
+							}
+						}
+						if (!this.decide) {
+							this.$refs.warning.show({
+								title: '当前身份不可操作',
+								type: "error",
+								icon: false
+							})
+						}
+					}).catch(res => {});
+				}
+			} else {//邀请客户
+				this.show = true
+				this.show1 = false
+				this.getList()
+			}
+			// this.getShow()
 		},
 		methods: {
+			//查看权限
+			getRoles: function(role) {
+				let _roles = uni.getStorageSync('rolesList')
+				for (let i = 0; i < _roles.length; i++) {
+					if (_roles[i] == role) {
+						return true
+					}
+				}
+				return false
+			},
+			getShow() {
+				let tmp = {
+					compId: this.compId,
+					number: this.qualityNo,
+					warehouseId: this.cangid
+				}
+				this.$api.doRequest('get', '/weighingManagement/getQRcode', tmp).then(res => {
+						this.detailData = res.data.data
+						this.status = this.detailData.qualityInspectionManagement.status
+						this.confirm = this.detailData.qualityInspectionManagement.confirm
+						this.weightStatus = this.detailData.status
+					})
+					.catch(res => {
+						if (res.message) {
+							uni.showToast({
+								title: res.message,
+								icon: 'none',
+								duration: 2000
+							})
+						} else {
+							uni.showToast({
+								title: "请稍后再试!",
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					});
+			},
+			//跳转
+			skip(val) {
+				if (val == 1) {
+					uni.navigateTo({
+						url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
+							.qualityInspectionManagement.id + '&managementType=' + this
+							.managementType + '&cangid=' + this.cangid + '&flag=' + '0'
+					})
+				} else if (val == 2) {
+					uni.navigateTo({
+						url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
+							.qualityInspectionManagement.id + '&managementType=' + this
+							.managementType + '&cangid=' + this.cangid + '&flag=' + '1'
+					})
+				} else if (val == 3) {
+					this.detailData.warehouseId = this.cangid
+					uni.navigateTo({
+						url: '/pages/erpbusiness/acquisitionInspection/grossWeightDetail?detailData=' +
+							JSON.stringify(this.detailData)
+					})
+				} else if (val == 4) {
+					this.detailData.warehouseId = this.cangid
+					uni.navigateTo({
+						url: '/pages/erpbusiness/acquisitionInspection/tareDetail??detailData=' + JSON
+							.stringify(this.detailData)
+					})
+				} else if (val == 5) {
+					uni.navigateTo({
+						url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
+							.qualityInspectionManagement.id + '&managementType=' + this
+							.managementType + '&cangid=' + this.cangid + '&flag=' + '2'
+					})
+				}
+			},
 			selectItem(item) {
-				if(item.authenticationStatus=="已接受") return
+				if (item.authenticationStatus == "已接受") return
 				for (let i = 0; i < this.grainMerchantList.length; i++) {
 					if (this.grainMerchantList[i].id == item.id) {
 						this.grainMerchantList[i].check = !this.grainMerchantList[i].check
 						if (this.grainMerchantList[i].check) {
 							this.selectID = this.grainMerchantList[i].id
 						}
-					} 
+					}
 				}
 			},
 			//查询粮商身份
@@ -90,14 +238,14 @@
 				//
 			},
 			//粮商认证
-			toGrainMerchantCertification(){
+			toGrainMerchantCertification() {
 				var that = this
 				// url: `/pageA/product/list?keywords=${key}&TabCur=${TabCur}`
 				uni.navigateTo({
-					url:`/pageD/identity/companyIdentity?status=1&compId=${that.user.companyId}&ids=${that.user.title}` ,
+					url: `/pageD/identity/companyIdentity?status=1&compId=${that.user.companyId}&ids=${that.user.title}`,
 				})
 			},
-			
+
 			getList() {
 				this.identityAuthenticationInfo.commonId = this.userInfo.id
 				this.grainMerchantList = []
@@ -105,7 +253,7 @@
 						pageSize: 100,
 						currentPage: 1,
 						commonId: this.userInfo.id,
-						compId:this.user.companyId,
+						compId: this.user.companyId,
 						flag: 3
 					}, 'application/json;charset=UTF-8').then(res => {
 						for (var i = 0; i < res.data.data.records.length; i++) {
@@ -116,8 +264,7 @@
 						}
 						var data = res.data.data.records
 						for (var i = 0; i < data.length; i++) {
-							if(data[i].authenticationStatus == "未通过")
-							{
+							if (data[i].authenticationStatus == "未通过") {
 								continue
 							}
 							if (data[i].customerTypeFlag == 2) {
@@ -130,12 +277,12 @@
 								this.isAllselect = true
 							} else {
 								data[i].check = false
-								this.isAllselect = false								
+								this.isAllselect = false
 								this.flag = false
 							}
 							this.grainMerchantList.push(data[i])
 						}
-						if(this.flag){
+						if (this.flag) {
 							this.btnVal = "已接受"
 						}
 					})
@@ -156,7 +303,7 @@
 					});
 			},
 			submit() {
-				if(this.flag) return
+				if (this.flag) return
 				let _isAllCheck = false
 				for (let i = 0; i < this.grainMerchantList.length; i++) {
 					if (this.grainMerchantList[i].check) {
@@ -172,7 +319,7 @@
 				}
 				this.$api.doRequest('get', '/identityAuthenticationInfo/saveCompanyIdentity', {
 						id: this.selectID,
-						compId:this.user.companyId,
+						compId: this.user.companyId,
 					}, 'application/json;charset=UTF-8').then(res => {
 						console.log(res);
 						if (res.data.code == 200) {
@@ -344,4 +491,18 @@
 			color: #8E93A3;
 		}
 	}
+
+	.but_css {
+		width: 200rpx;
+		height: 80rpx;
+		background-color: #22C572;
+		margin: 20rpx auto;
+		color: #FFFFFF;
+		line-height: 80rpx;
+		border-radius: 20rpx;
+		text-align: center;
+	}
+	.buns_item{
+		margin: 100rpx;
+	}
 </style>

+ 0 - 1
pages/user/user.vue

@@ -445,7 +445,6 @@
 						}
 					});
 				}
-
 			},
 			fankui() {
 				uni.navigateTo({