Browse Source

feat: 水泵 -> 蒸汽发生器; 售后更换日期

Ritchie 1 year ago
parent
commit
ab302b8fea
2 changed files with 32 additions and 4 deletions
  1. 5 3
      pages/Insert/addMachine.vue
  2. 27 1
      pages/select/update.vue

+ 5 - 3
pages/Insert/addMachine.vue

@@ -472,7 +472,7 @@
 			<view class="line"></view>
 			<form @submit="shuibeng" @reset="shuibengReset">
 				<view class="modules">
-					<view class="title">水泵</view>
+					<view class="title">蒸汽发生器</view>
 					<view class="body">
 						<input class="input" style="display:none;" name="shuibengCoding" :value=shuibengCoding />
 						编码:<input class="input" v-model="shuibengCoding" />
@@ -530,6 +530,7 @@
 				</view>
 			</form>
 			
+			
 			<view class="">
 				<button type="primary" @click="jiancha()" class="button">
 					<p class="p1">检查</p>
@@ -601,6 +602,7 @@
 				shoudongdoorCoding:null,
 				shoudongdoorName: null,
 				shoudongdoorVersion: null,
+				
 				anzhuopingCoding:null,
 				anzhuopingName: null,
 				anzhuopingVersion: null,
@@ -790,7 +792,7 @@
 												that.lutouCoding = modulesList[i].coding;
 												that.lutouVersion = modulesList[i].coding.substring(8, 10);
 											}
-											//水泵
+											//水泵 -> 蒸汽发生器
 											if (coding.substring(5, 7) == '08') {
 												that.shuibengName = modulesList[i].name;
 												that.shuibengCoding = modulesList[i].coding;
@@ -933,7 +935,7 @@
 										that.lutouCoding = codes.coding;
 										that.lutouVersion = codes.code.substring(8, 10);
 									}
-									//水泵
+									//水泵 -> 蒸汽发生器
 									if (coding.substring(5, 7) == '08') {
 										that.shuibengName = codes.name;
 										that.shuibengCoding = codes.coding;

+ 27 - 1
pages/select/update.vue

@@ -22,6 +22,11 @@
 					<p class="p">扫码</p>
 				</button>
 			</view>
+			<timeSelector showType="date" @btnConfirm="btnConfirm0" @btnCancel="btnCancel0">
+				<view class="body">
+					更换日期:<input type="text" class="input" name="replateDate" :value="replateDate"/>
+				</view>
+			</timeSelector>
 			<view class="body">
 				更换原因:<textarea class="input-two" name="replaceReason" />
 				</view>
@@ -35,13 +40,19 @@
 </template>
 
 <script>
+	import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
+	
 	export default {
+		components: {
+			timeSelector
+		},
 		data() {
 			return {
 				machineCoding: '',
 				coding: '',
 				oldCoding: '',
-				replaceReason: ''
+				replaceReason: '',
+				replateDate: ''
 			}
 		},
 		onLoad: function(option) {
@@ -78,12 +89,26 @@
 					    }
 					});
 				},
+				btnConfirm0(e) {
+					console.log('确定时间为:', new Date(e.key));
+					this.replateDate = e.key;
+				},
+				btnCancel0() {
+					this.replateDate = '';
+				},
 				update(event) {
 					var serverUrl = this.serverurl;
 					const {
 						value: modules
 					} = event.detail;
 						var token = uni.getStorageSync("token");
+						var replateDateObject = new Date(this.replateDate);
+						var replateDateString = replateDateObject.getFullYear() + '-' +
+						                            (replateDateObject.getMonth() + 1).toString().padStart(2, '0') + '-' +
+						                            replateDateObject.getDate().toString().padStart(2, '0') + ' ' +
+						                            replateDateObject.getHours().toString().padStart(2, '0') + ':' +
+						                            replateDateObject.getMinutes().toString().padStart(2, '0') + ':' +
+						                            replateDateObject.getSeconds().toString().padStart(2, '0');
 						uni.request({
 							url: serverUrl + "/TModules/replace",
 							method: "POST",
@@ -91,6 +116,7 @@
 								"coding":modules.coding,
 								"machineCoding":modules.machineCoding,
 								"oldCoding":modules.oldCoding,
+								"replateDate":replateDateString,
 								"replaceReason":modules.replaceReason,
 								"replacePersonnel":uni.getStorageSync("name"),
 							},