Bladeren bron

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 2 jaren geleden
bovenliggende
commit
da4a151adb

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "易粮易运",
     "appid" : "__UNI__7297DA2",
     "description" : "易粮易运——为天下粮食人服务的App",
-    "versionName" : "2.1.132",
-    "versionCode" : 21132,
+    "versionName" : "2.1.135",
+    "versionCode" : 21135,
     "transformPx" : false,
     /* SDK配置 */
     "quickapp" : {},

+ 6 - 1
pages/clock/supp_clock.vue

@@ -54,12 +54,16 @@
 				border: true,
 				height: 150,
 				autoHeight: true,
-				id: ""
+				id: "",
+				suppDay:'',
 			}
 		},
 
 		onLoad(options) {
 			this.id = options.id
+			let _day = new Date();
+			_day.setTime(_day.getTime());
+			this.suppDay = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
 		},
 		// #ifndef MP
 		onNavigationBarButtonTap(e) {
@@ -157,6 +161,7 @@
 							that.detailData.compId = uni.getStorageSync('pcUserInfo').compId
 							that.detailData.commonId = uni.getStorageSync('pcUserInfo').userId
 							that.detailData.supplementClockType = that.typevalue
+							that.detailData.suppDay = that.suppDay
 							that.$api.doRequest('post', '/clockInfo/api/suppClock', that.detailData)
 								.then(res => {
 									if (res.data.code == 200) {

+ 3 - 0
pages/clock/the_clock.vue

@@ -126,6 +126,7 @@
 				clockDistance: "",
 				warehouseType: '1',
 				warehouseBaseInfoList: [],
+				clockDay:'',
 
 			}
 		},
@@ -151,6 +152,7 @@
 			let _day = new Date();
 			_day.setTime(_day.getTime());
 			this.createDate = _day.getFullYear() + "-" + (_day.getMonth() + 1);
+			this.clockDay = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
 		},
 		methods: {
 			supp(item) {
@@ -251,6 +253,7 @@
 							that.detailData.phone = uni.getStorageSync('pcUserInfo').userMobilePhone
 							that.detailData.empName = uni.getStorageSync('userInfo').userName
 							that.detailData.clockType = that.typevalue
+							that.detailData.clockDay = that.clockDay
 							if (that.clockDistance.indexOf("km") > -1) {
 								that.detailData.clockDistance = that.clockDistance.replace("km", "") * 1000
 							} else {

+ 41 - 31
pages/erpbusiness/add_quality_testing.vue

@@ -252,6 +252,30 @@
 				</view>
 				<view  v-show="edit" class="con-list">{{gridList.type?gridList.type:'请选择类型'}}</view>
 			</view>
+			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
+				<view class="title">箱号-1</view>
+				<view class="con-list">
+					<input v-model='gridList.boxNo' placeholder="请输入箱号" name="input" type="digit"></input>
+				</view>
+			</view>
+			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
+				<view class="title">封号-1</view>
+				<view class="con-list">
+					<input v-model='gridList.titleNo' placeholder="请输入封号" name="input" type="digit"></input>
+				</view>
+			</view>
+			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
+				<view class="title">箱号-2</view>
+				<view class="con-list">
+					<input v-model='gridList.boxNoOther' placeholder="请输入箱号" name="input" type="digit"></input>
+				</view>
+			</view>
+			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
+				<view class="title">封号-2</view>
+				<view class="con-list">
+					<input v-model='gridList.titleNoOther' placeholder="请输入封号" name="input" type="digit"></input>
+				</view>
+			</view>
 			<view v-show="gridList.type == '潮粮'&&utils.getCurrectRoles('acquisitionQuality.initial')&&typevalue==3"
 				class="c-row">
 				<view class="title">净重单价(元/公斤)</view>
@@ -328,30 +352,7 @@
 						placeholder="请输入干粮单价" name="input" type="digit"></input>
 				</view>
 			</view>
-			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
-				<view class="title">箱号-1</view>
-				<view class="con-list">
-					<input v-model='gridList.boxNo' placeholder="请输入箱号" name="input" type="digit"></input>
-				</view>
-			</view>
-			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
-				<view class="title">封号-1</view>
-				<view class="con-list">
-					<input v-model='gridList.titleNo' placeholder="请输入封号" name="input" type="digit"></input>
-				</view>
-			</view>
-			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
-				<view class="title">箱号-2</view>
-				<view class="con-list">
-					<input v-model='gridList.boxNoOther' placeholder="请输入箱号" name="input" type="digit"></input>
-				</view>
-			</view>
-			<view v-show="typevalue==3&&utils.getCurrectRoles('acquisitionQuality.qview')" class="c-row">
-				<view class="title">封号-2</view>
-				<view class="con-list">
-					<input v-model='gridList.titleNoOther' placeholder="请输入封号" name="input" type="digit"></input>
-				</view>
-			</view>
+			
 		</view>
 		<view v-show="utils.getCurrectRoles('acquisitionQuality.initial')" style='padding-bottom:300rpx;'>
 			<view class='wrap'>
@@ -506,6 +507,8 @@
 				username: "请更改昵称",
 				contractFlag: 10,
 				gridList: {
+					
+					outType: '汽运',
 					natureOfGrainPurchase: '贸易粮',
 					type: '',
 					tidalGrainPrice: '',
@@ -553,7 +556,7 @@
 					grossWeight: 0,
 					tare: 0,
 					grade: '',
-					// inOutDate: new Date().toISOString().slice(0, 10),
+					inOutDate: new Date().toISOString().slice(0, 10),
 					netWeight: 0,
 					pureWeight: 0,
 					deductionWeight: 0,
@@ -732,6 +735,8 @@
 			}
 		},
 		onLoad(options) {
+			console.log( this.cangid)
+			debugger
 			this.commonWarehouseNo = options.commonWarehouseNo
 			this.warehouseCount = Number(options.warehouseCount) + 1
 			this.warehouseTradeCount = Number(options.warehouseTradeCount) + 1
@@ -740,6 +745,12 @@
 			this.gridList.warehouseName = options.warehouseName
 			// this.gridList.qualityNo = 'SGRK' + this.getdate() + this.commonWarehouseNo + number
 			this.cangid = options.cangid
+			this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+				id: this.cangid
+			}).then(res => {
+				console.log(res)
+				this.warehouseList = res.data.data.warehousePositionInfoList
+			})
 			this.gridList.compName = uni.getStorageSync('compName1')
 			this.gridList.person = options.personCharge
 			this.gridList.personPhone = options.personPhone
@@ -774,11 +785,7 @@
 			// }
 			this.gridList.grade = this.gradeList[0].value
 			this.gridList.gradeKey = this.gradeList[0].key
-			this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-				id: this.cangid
-			}).then(res => {
-				this.warehouseList = res.data.data.warehousePositionInfoList
-			})
+			
 			this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
 				warehouseId: this.cangid
 			}).then(res => {
@@ -1250,7 +1257,7 @@
 						}
 					}
 				}
-				if(this.inType == "收购入库"){ //收购入库  价格取自合同
+				if(this.inType != "收购入库"){ //收购入库  价格取自合同
 					return
 				}
 				if (this.gridList.goodsName && this.cangid) {
@@ -1506,6 +1513,7 @@
 															count + '吨', )
 
 													} else {
+														that.gridList.inOutFlag = 2
 														that.$api.doRequest('post',
 																'/warehouseInOutInfo/InOutWarehouse',
 																that.gridList)
@@ -1563,6 +1571,8 @@
 										}
 									})
 							} else {
+								
+								that.gridList.inOutFlag = 2
 								that.$api.doRequest('post',
 										'/warehouseInOutInfo/InOutWarehouse',
 										that.gridList)

+ 127 - 9
pages/leave/the_leave.vue

@@ -38,8 +38,8 @@
 				</view>
 				<view style='position:relative;' class="wrap no-boder">
 					<u-input class='textarea' v-model="detailData.reasonForLeave" :type="type" :border="border"
-						:height="height" :auto-height="autoHeight" maxlength="100"/>
-					<view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;' >
+						:height="height" :auto-height="autoHeight" maxlength="100" />
+					<view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
 						{{detailData.reasonForLeave.length}}/100个字
 					</view>
 				</view>
@@ -143,6 +143,7 @@
 				show: false,
 				show1: false,
 				show2: false,
+				isFreeTime: true,
 				detailData: {
 					leaveType: '选择请假类型',
 					reasonForLeave: "",
@@ -172,7 +173,18 @@
 						leaveType: "病假"
 					},
 				],
-
+				startDate:"",
+				endDate:"",
+				beginTime:"",
+				endTime:"",
+				days:"",
+				hours:"",
+				date:"",
+				stWorkTime:"",
+				enWrokTime:"",
+				freeTimeMon:"",
+				freeTimeAft:"",
+				freeTime:"",
 			}
 		},
 		onReachBottom() { //上拉触底函数
@@ -247,18 +259,124 @@
 					this.detailData.leaveTypeKey = "3"
 				}
 			},
+			/**
+			 * 计算请假时长
+			 * beginTime    开始时间
+			 * endTime      结束时间
+			 * stWorkTime   上班时间
+			 * enWrokTime   下班时间
+			 * isFreeTime  是否要去除午休工作时长
+			 * freeTimeMon  午休开始时间
+			 * freeTimeAft  午休结束时间
+			 * 
+			 */
 			dateChange(e) {
 				this.detailData.startDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
-				// this.startDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
-				// + ":" + "00"
+			},
+			diffDay(earlyDate,lastDate){
+			    return (Date.parse(lastDate) - Date.parse(earlyDate))/1000/60/60/24 +1;
 			},
 			dateChange1(e) {
 				this.detailData.endDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
-				var endtime = new Date(this.detailData.endDate)
-				var starttime = new Date(this.detailData.startDate)
-				console.log(endtime - starttime)
-				this.detailData.leaveDuration = Math.floor((endtime - starttime) / (3600 * 1000))
+				var days;
+				var hours;
+				var date;
+				var freeTimeAft =13 ;
+				var freeTimeMon = 12;
+				var stWorkTime = 8;
+				var enWrokTime = 17;
+				var isFreeTime = true;
+				var freeTime = freeTimeAft - freeTimeMon;
+
+				var beginTime = (this.detailData.startDate).replace(/-/g, '/');
+				var beginArr = beginTime.split(" ");
+				var beginMonth = parseInt(beginArr[0].split("/")[1]);
+				var beginDay = parseInt(beginArr[0].split("/")[2]);
+				var beginHours = parseInt(beginArr[1].split(":")[0]);
+				var beginMin = parseInt(beginArr[1].split(":")[1]);
+				var beginHoursMin = beginHours + beginMin / 60;
+
+				var endTime = (this.detailData.endDate).replace(/-/g, '/');
+				var endArr = endTime.split(" ");
+				var endMonth = parseInt(endArr[0].split("/")[1]);
+				var endDay = parseInt(endArr[0].split("/")[2]);
+				var endHours = parseInt(endArr[1].split(":")[0]);
+				var endMin = parseInt(endArr[1].split(":")[1]);
+				var endHoursMin = endHours + endMin / 60;
+				//如果beginHoursMin时间小于上班时间都算上班时间
+				if (beginHoursMin <= stWorkTime) {
+					beginHoursMin = stWorkTime;
+				}
+				//如果endHoursMin时间大于上班时间都算下班时间
+				if (endHoursMin >= enWrokTime) {
+					endHoursMin = enWrokTime;
+				}
+				//如果开始时间在freeTimeMon和freeTimeAft之间都算freeTimeAft
+				if (isFreeTime == true) {
+					if (beginHoursMin >= freeTimeMon && beginHoursMin <= freeTimeAft) {
+						beginHoursMin = freeTimeAft;
+					}
+				}
+				//如果结束时间在freeTimeMon和freeTimeAft之间都算freeTimeMon
+				if (isFreeTime == true) {
+					if (endHoursMin >= freeTimeMon && endHoursMin <= freeTimeAft) {
+						endHoursMin = freeTimeMon;
+					}
+				}
+				//获取结束时间-开始时间的天数
+				var daysBetween = this.diffDay(beginTime.substring(0, 10), endTime.substring(0, 10));
+				if (daysBetween > 0) {
+					 var hour = enWrokTime - stWorkTime - freeTime;
+					if (daysBetween == 1) {
+						//同一天
+						if(beginHoursMin < freeTimeMon && endHoursMin > freeTimeAft){
+							hours = (endHoursMin) - (beginHoursMin) - freeTime;
+						}else{
+							hours = endHoursMin - beginHoursMin;
+						}
+					} else if (daysBetween == 2) {
+						//跨一天   
+						//第一天的时长
+						hours = enWrokTime - beginHoursMin;
+						//是否有午休         
+						if (beginHoursMin <= freeTimeMon)
+							hours = hours - freeTime;
+						//第二天的时长    
+						hours += endHoursMin - stWorkTime;
+						//是否有午休 
+						if (endHoursMin >= freeTimeAft)
+							hours = hours - freeTime;
+
+					} else {
+						//跨两天以上 
+						//第一天的时长
+						hours = enWrokTime - beginHoursMin;
+						//是否有午休             
+						if (beginHoursMin <= freeTimeMon)
+							hours = hours - freeTime;
+						//中间时长
+						hours += (daysBetween - 2) * (hour);
+						//最后一天时长
+						hours += endHoursMin - stWorkTime;
+						//是否有午休 
+						if (endHoursMin >= freeTimeAft)
+							hours = hours - freeTime;
+					}
+					days = Math.floor(hours / hour);
+					hours = hours % hour;
+					date = {
+						"days": days,
+						"hours": hours
+					};
+				}
+				this.detailData.leaveDuration = Math.round((date.days * 8 + date.hours) * 10) /10
+				return date;
+				// var endtime = new Date(this.detailData.endDate)
+				// var starttime = new Date(this.detailData.startDate)
+				// console.log(endtime - starttime)
+				// this.detailData.leaveDuration = Math.floor((endtime - starttime) / (3600 * 1000))
 				// this.endDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
+			
 			},
 			submit() {
 				if (!this.detailData.leaveType || this.detailData.leaveType == '选择请假类型') {

+ 6 - 2
pages/user/contractLook/inventoryCost.vue

@@ -83,10 +83,13 @@
 				// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
 				value: '入库记录',
 				costList: [],
-				isShowDetailBtn: false
+				isShowDetailBtn: false,
+				searchMonth:'2022-10-10'
 			}
 		},
 		onLoad: function(option) {
+			console.log(option)
+			this.searchMonth = option.searchMonth
 			this.init()
 		},
 		computed: {
@@ -168,7 +171,8 @@
 					})
 					this.$api.doRequest('get', '/costManagementInfo/selectCostManagementInfo', {
 						compId: uni.getStorageSync('pcUserInfo').compId,
-						warehouseType: 1
+						warehouseType: 1,
+						searchMoth:this.searchMonth
 					}).then(res => {
 						uni.hideLoading()
 						if (res.data.data) {

+ 1 - 1
pages/user/report.vue

@@ -436,7 +436,7 @@
 					return true
 				} else if (index == 5) {
 					uni.navigateTo({
-						url: '/pages/user/contractLook/inventoryCost'
+						url: '/pages/user/contractLook/inventoryCost?searchMonth=' + this.seachMoth
 					})
 					return true
 				}