mao 1 gadu atpakaļ
vecāks
revīzija
cfaca99674

+ 12 - 10
components/dialog-confirm/dialog-confirm.vue

@@ -2,8 +2,8 @@
 	<dialog-base ref="baseDialog" title="提示">
 		<view class="msg uni-row">{{message}}</view>
 		<view class="btn-container uni-row">
-			<button type="primary"  class="btn" @click="handleConfirm">确认</button>
-			<button type="primary"  class="btn" @click="handleCancel">取消</button>
+			<button type="primary" class="btn" @click="handleConfirm">确认</button>
+			<button type="primary" class="btn" @click="handleCancel">取消</button>
 		</view>
 	</dialog-base>
 </template>
@@ -16,16 +16,15 @@
 	import {
 		saveUserequipment
 	} from '@/api/business/userEquipment/userEquipment.js'
-	import { defineProps } from 'vue'
+	import {
+		defineProps
+	} from 'vue'
 	const baseDialog = ref(null)
 	const message = ref('')
 	const reqParam = ref({})
-	const fatMethod = defineProps({
-	  init: Function
-	})
- 
+	const emit = defineEmits(['reflush'])
 
-	function open(msg,data) {
+	function open(msg, data) {
 		message.value = msg;
 		reqParam.value = data;
 		baseDialog.value.open();
@@ -33,15 +32,18 @@
 
 	function handleConfirm() {
 		saveUserequipment(reqParam.value).then(res => {
-			if(res.code === 200){
+			if (res.code === 200) {
 				uni.showToast({
 					icon: "success",
 					title: "设备绑定成功"
 				})
+				
 			}
+			
 		})
+		emit('reflush');
 		close();
-	} 
+	}
 
 	function handleCancel() {
 		close();

+ 5 - 0
components/dialog-end-work/dialog-end-work.vue

@@ -43,6 +43,7 @@
 		updateDayWorkItem,
 		saveDayWorkItem
 	} from "@/api/business/dayWorkItem.js"
+	import { timestampToTime } from '@/utils/common.js'
 	const baseDialog = ref(null)
 	const equiments = ref(['009-21', '009-22', '009-23', '009-24', '009-25', '009-26', '009-27', '009-28', '009-29',
 		'009-26', '009-27'
@@ -54,6 +55,7 @@
 		workInfo.value.id = data.id;
 		baseDialog.value.open()
 	}
+	const emit = defineEmits(['reset'])
 
 	function switchChange(event) {
 		if (event.detail.value) {
@@ -71,6 +73,8 @@
 		if(workInfo.value.status != 2) {
 			workInfo.value.status = '1';
 		}
+		workInfo.value.endTime = timestampToTime(new Date());
+		console.log(workInfo.value)
 		saveDayWorkItem(workInfo.value).then(res => {
 			if(res.code === 200){
 				uni.showToast({
@@ -78,6 +82,7 @@
 					title: '操作成功',
 					duration: 2000
 				});
+				emit('reset');
 				baseDialog.value.close();
 			}else{
 				uni.showToast({

+ 45 - 29
pages/addNewBatch/index.vue

@@ -40,8 +40,11 @@
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<view class="uni-row info">
 					<label for="HeatNo">炉号:</label>
+					<select id="incomingInfo" class="uni-input data-select" v-model="basicInfo.heatNo">
+						<option class="data-select-options" v-for="(item,index) in range">{{item.text}}</option>
+					</select>
 					<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
-					<text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text>
+					<!-- <text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text> -->
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class="uni-row info">
@@ -50,14 +53,17 @@
 					<text id="manufacturer" class="uni-input">{{basicInfo.manufacturer}}</text>
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
-				<view class="uni-row info"> 
-					<label for="incomingInfo">来料信息:</label>
-					<select id="incomingInfo" class="uni-input data-select">
-						<option class="data-select-options" v-for="(item,index) in range">{{item.text}}</option>
-					</select>
+				<view class="uni-row info">
+					<label for="incomingInfo">来料日期:</label>
 					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
-					<!-- <text id="incomingInfo" class="uni-input">{{basicInfo.incomingInfo}}</text> -->
-				</view> 
+					<text id="incomingInfo" class="uni-input">{{basicInfo.incomingInfo}}</text>
+				</view>
+				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
+				<view class="uni-row info">
+					<label for="incomingInfo">材质:</label>
+					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
+					<text id="incomingInfo" class="uni-input">{{basicInfo.materia}}</text>
+				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 			</view>
 		</view>
@@ -83,31 +89,34 @@
 
 	const batchNoCheck = ref(null) // 批次号是否选中
 	const batchNoList = ref([]) // 批次号列表
-	const vehicleList = ref([{ // 载具列表
-			carrierId: '1731475038666575873',
-			carrierCode: '000001'
-		},
-		{
-			carrierId: '1731467623237767169',
-			carrierCode: '000002'
-		}
-	])
+	const vehicleList = ref([])
 	const basicInfo = ref({ // 基础信息对象
 		heatNo: 'cs222',
 		manufacturer: 'DMS',
-		incomingInfo: 'L123456'
+		incomingInfo: 'L123456',
+		materia: 'dx1111'
 	})
 	const dayWork = ref({})
 	const curSubPlan = ref({})
-	const range	 = ref([
-          { value: 0, text: "篮球" },
-          { value: 1, text: "足球" },
-          { value: 2, text: "游泳" },
-        ])
+	const range = ref([{
+			value: 0,
+			text: "篮球"
+		},
+		{
+			value: 1,
+			text: "足球"
+		},
+		{
+			value: 2,
+			text: "游泳"
+		},
+	])
 
 	onLoad((options) => {
 		curSubPlan.value = JSON.parse(options.currentSubPlan);
-		console.log(curSubPlan.value)
+		dayWork.value.productionPlanDetailSubDetailId = curSubPlan.value.id;
+		dayWork.value.productionPlanDetailId = curSubPlan.value.productionPlanDetailId;
+		dayWork.value.productionPlanId = curSubPlan.value.productionDetailId;
 		init();
 	})
 
@@ -118,7 +127,6 @@
 			for (var i = 0; i < res.rows.length; i++) {
 				batchNoList.value.push(res.rows[i].lotCode)
 			}
-			console.log(batchNoList.value)
 		})
 	}
 
@@ -148,14 +156,14 @@
 						return;
 					}
 				}
-				vehicleList.value.push(JSON.parse(res.result));
-				console.log(vehicleObj);
+				vehicleList.value.push(vehicleObj);
 			}
 		});
 	}
 
 	function handleAdd() {
 		dayWork.value.dayworkCarriers = vehicleList.value;
+		console.log(dayWork.value)
 		saveDayWork(dayWork.value).then(res => {
 			if (res.code === 200) {
 				uni.showToast({
@@ -166,6 +174,11 @@
 				uni.navigateTo({
 					url: '/pages/batchReporting/index'
 				})
+				let pages = getCurrentPages(); //当前页面栈
+				if (pages.length > 1) {
+					let beforePage = pages[pages.length - 2]; //获取上一个页面实例对象
+					beforePage.$vm.init(curSubPlan.value.id); //触发上一个页面中的方法,并传过去当前的值
+				}
 			} else {
 				uni.showToast({
 					icon: 'error',
@@ -281,17 +294,19 @@
 		width: 100%;
 		justify-content: space-around;
 		align-items: center;
+
 		label {
 			flex: 1;
 			text-combine-upright: all;
 			margin: 0 30rpx;
 
 		}
- 
+
 		text {
 			flex: 3;
 			width: 80%;
-		} 
+		}
+
 		.data-select {
 			flex: 3;
 			width: 80%;
@@ -299,6 +314,7 @@
 			margin-right: 40rpx;
 			border-radius: 18rpx;
 			background-color: #FFF;
+
 			.data-select-options {
 				width: 200rpx;
 			}

+ 4 - 2
pages/batchReporting/index.vue

@@ -42,8 +42,8 @@
 				</view>
 				<view class="status-btn uni-row">
 					<view v-if="item['status'] == 1" class=" uni-row">
-						<!-- <button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button> -->
-						<button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button>
+						<button class="turnover-tag" size="mini" @click.stop="handleShowTurnoverApplication(null)">周转申请</button>
+						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
 					</view>
 					<view v-else-if="item['status'] == 2" class=" uni-row">
 						<button class="turnover-tag" size="mini">取消周转</button>
@@ -107,6 +107,8 @@
 		reqData.productionPlanDetailSubDetailId = id;
 		// console.log(reqData)
 		getDayWorkList(reqData).then(res => {
+			console.log(reqData)
+			console.log(res)
 			listData.value = res.rows;
 			uni.hideLoading();
 		})

+ 9 - 1
pages/equipmentList/index.vue

@@ -12,7 +12,7 @@
 			<button class="btn" @click="handleScanCode">扫码</button>
 		</view>
 	</view>
-	<dialog-confirm ref="confirm" :init="init"></dialog-confirm>
+	<dialog-confirm ref="confirm" @reflush="reflush"></dialog-confirm>
 </template>
 
 <script setup>
@@ -64,6 +64,14 @@
 			})
 		})
 	}
+	
+	/**
+	 * 刷新
+	 */
+	function reflush(){
+		console.log('111111111111111111111111111113')
+		init();
+	}
 
 	/**
 	 *  长按显示解绑按钮

+ 7 - 2
pages/reportingForWork/index.vue

@@ -48,7 +48,7 @@
 			<button class="bottom-btn left-btn" @click="HandleChangevehicle"><text class="label">更换载具</text></button>
 			<button class="bottom-btn right-btn" @click="handleStartProcessing"><text class="label">开始加工</text></button>
 		</view>
-		<dialog-end-work ref="endWorkDialog" @sendEquipment='getEquipment'/>
+		<dialog-end-work ref="endWorkDialog" @sendEquipment='getEquipment' @reset="reset"/>
 		<dialog-selectEquipment ref='selectEquipment'></dialog-selectEquipment>
 	</view>
 </template>
@@ -84,6 +84,10 @@
 		})
 	}
 	
+	function reset(){
+		init();
+	}
+	
 	function handleSelection(item){
 	   if (selectedItem.value === item) {
 	        selectedItem.value = null; 
@@ -97,7 +101,7 @@
 	}
 	
 	function HandleChangevehicle(){
-		uni.navigateTo({
+		uni.navigateTo({ 
 			url:"/pages/changeBox/index"
 		})
 	}
@@ -120,6 +124,7 @@
 					title: '操作成功',
 					duration: 2000
 				});
+				init();
 			}else{
 				uni.showToast({
 					icon: 'error',

+ 55 - 43
utils/common.js

@@ -1,54 +1,66 @@
 /**
-* 显示消息提示框
-* @param content 提示的标题
-*/
+ * 显示消息提示框
+ * @param content 提示的标题
+ */
 export function toast(content) {
-  uni.showToast({
-    icon: 'none',
-    title: content
-  })
+	uni.showToast({
+		icon: 'none',
+		title: content
+	})
 }
 
 /**
-* 显示模态弹窗
-* @param content 提示的标题
-*/
+ * 显示模态弹窗
+ * @param content 提示的标题
+ */
 export function showConfirm(content) {
-  return new Promise((resolve, reject) => {
-    uni.showModal({
-      title: '提示',
-      content: content,
-      cancelText: '取消',
-      confirmText: '确定',
-      success: function(res) {
-        resolve(res)
-      }
-    })
-  })
+	return new Promise((resolve, reject) => {
+		uni.showModal({
+			title: '提示',
+			content: content,
+			cancelText: '取消',
+			confirmText: '确定',
+			success: function(res) {
+				resolve(res)
+			}
+		})
+	})
 }
 
 /**
-* 参数处理
-* @param params 参数
-*/
+ * 参数处理
+ * @param params 参数
+ */
 export function tansParams(params) {
-  let result = ''
-  for (const propName of Object.keys(params)) {
-    const value = params[propName]
-    var part = encodeURIComponent(propName) + "="
-    if (value !== null && value !== "" && typeof (value) !== "undefined") {
-      if (typeof value === 'object') {
-        for (const key of Object.keys(value)) {
-          if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
-            let params = propName + '[' + key + ']'
-            var subPart = encodeURIComponent(params) + "="
-            result += subPart + encodeURIComponent(value[key]) + "&"
-          }
-        }
-      } else {
-        result += part + encodeURIComponent(value) + "&"
-      }
-    }
-  }
-  return result
+	let result = ''
+	for (const propName of Object.keys(params)) {
+		const value = params[propName]
+		var part = encodeURIComponent(propName) + "="
+		if (value !== null && value !== "" && typeof(value) !== "undefined") {
+			if (typeof value === 'object') {
+				for (const key of Object.keys(value)) {
+					if (value[key] !== null && value[key] !== "" && typeof(value[key]) !== 'undefined') {
+						let params = propName + '[' + key + ']'
+						var subPart = encodeURIComponent(params) + "="
+						result += subPart + encodeURIComponent(value[key]) + "&"
+					}
+				}
+			} else {
+				result += part + encodeURIComponent(value) + "&"
+			}
+		}
+	}
+	return result
+}
+
+// 时间戳转日期
+export function timestampToTime(timestamp) {
+	var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+	var Y = date.getFullYear() + '-';
+	var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+	var D = date.getDate() + ' ';
+	var h = date.getHours() + ':';
+	var m = date.getMinutes() + ':';
+	var s = date.getSeconds();
+	return Y + M + D + h + m + s;
 }