Browse Source

新编码

李天标 4 years ago
parent
commit
20e7846be9

+ 11 - 0
.hbuilderx/launch.json

@@ -0,0 +1,11 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+            "type": "uniCloud",
+            "default": {
+                "launchtype": "local"
+            }
+        }
+    ]
+}

+ 1 - 1
common/lang/zh.js

@@ -1,7 +1,7 @@
 export default {
 	lang: 'zh',
 	login: {
-		title: '物料源系统',
+		title: '物料源系统',
 		username:'请输入用户名',
 		password:'请输入密码',
 		login:'登录'

+ 2 - 2
configs/env.js

@@ -9,8 +9,8 @@ let configs = {
 if (process.env.NODE_ENV === 'development') {
 	// 测试环境
 	configs = Object.assign(configs, {
-		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
-		// baseUrl: 'http://127.0.0.1:8090',
+		// baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
+		baseUrl: 'http://127.0.0.1:8090',
 	});
 }
 

+ 2 - 2
main.js

@@ -22,8 +22,8 @@ const i18n = new VueI18n({
 
 App.mpType = 'app'
 
-// Vue.prototype.serverurl="http://127.0.0.1:8090";
-Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
+Vue.prototype.serverurl="http://127.0.0.1:8090";
+// Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
 Vue.prototype.$store = store;
 Vue.prototype._i18n = i18n;
 const app = new Vue({

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "申泽物料追踪源小程序",
+    "name" : "申泽物料追踪源小程序",
     "appid" : "__UNI__C9DE28D",
     "description" : "",
     "versionName" : "1.0.0",

+ 13 - 0
pages.json

@@ -189,6 +189,19 @@
 			"style": {
 				"navigationBarTitleText": "反馈更换"
 			}
+		}, {
+			"path": "pages/select/update",
+			"style": {
+				"navigationBarTitleText": "售后更换",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/User/delCode",
+			"style": {
+				"navigationBarTitleText": "删除编码",
+				"enablePullDownRefresh": false
+			}
+
 		}
 	],
 	"globalStyle": {

+ 239 - 75
pages/Insert/addMachine.vue

@@ -2,7 +2,7 @@
 	<view>
 		<form @submit="submit">
 			<form @submit="addMachine">
-				<view class="title">机器</view>
+				<view class="title"> 机器</view>
 				<view class="body">
 					<input class="input" style="display:none;" name="coding" :value=coding />
 					机器编码:<input class="input" v-model="coding" />
@@ -25,6 +25,12 @@
 						<p class="p">确认</p>
 					</button>
 				</view>
+				<view class="body">
+					设备编号:<input class="input" name="clientId" :value="clientId" />
+					<button type="primary" form-type="submit" class="button1">
+						<p class="p">确认</p>
+					</button>
+				</view>
 			</form>
 			<view class="line"></view>
 			<form @submit="jike" @reset="jikeReset">
@@ -117,30 +123,30 @@
 				</view>
 			</form>
 			<view class="line"></view>
-			<form @submit="shuibeng" @reset="shuibengReset">
+			<form @submit="jiareban" @reset="jiarebanReset">
 				<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" />
-						<button type="primary" @click="saoma('shuibengCoding')" class="button1">
+						<input class="input" style="display:none;" name="jiarebanCoding" :value=jiarebanCoding />
+						编码:<input class="input" v-model="jiarebanCoding" />
+						<button type="primary" @click="saoma('jiarebanCoding')" class="button1">
 							<p class="p">扫码</p>
 						</button>
-						<button type="primary" @click="getMessage(shuibengCoding)" class="button1">
+						<button type="primary" @click="getMessage(jiarebanCoding)" class="button1">
 							<p class="p">获取</p>
 						</button>
 					</view>
 					<view class="body">
-						名称:<input class="input" name="shuibengName" :value="shuibengName" />
+						名称:<input class="input" name="jiarebanName" :value="jiarebanName" />
 					</view>
 					<view class="body">
-						版本:<input class="input" name="shuibengVersion" :value="shuibengVersion" />
+						版本:<input class="input" name="jiarebanVersion" :value="jiarebanVersion" />
 					</view>
 					<view class="modulesButton">
 						<button type="primary" form-type="submit" class="button1">
 							<p class="p">确认</p>
 						</button>
-						<button type="primary" @click="updateModules(shuibengCoding,'shuibeng')" class="button1">
+						<button type="primary" @click="updateModules(jiarebanCoding,'jiareban')" class="button1">
 							<p class="p">更换</p>
 						</button>
 					</view>
@@ -207,60 +213,30 @@
 				</view>
 			</form>
 			<view class="line"></view>
-			<form @submit="zidongdoor" @reset="zidongdoorReset">
-				<view class="modules">
-					<view class="title">自动门</view>
-					<view class="body">
-						<input class="input" style="display:none;" name="zidongdoorCoding" :value=zidongdoorCoding />
-						编码:<input class="input" v-model="zidongdoorCoding" />
-						<button type="primary" @click="saoma('zidongdoorCoding')" class="button1">
-							<p class="p">扫码</p>
-						</button>
-						<button type="primary" @click="getMessage(zidongdoorCoding)" class="button1">
-							<p class="p">获取</p>
-						</button>
-					</view>
-					<view class="body">
-						名称:<input class="input" name="zidongdoorName" :value="zidongdoorName" />
-					</view>
-					<view class="body">
-						版本:<input class="input" name="zidongdoorVersion" :value="zidongdoorVersion" />
-					</view>
-					<view class="modulesButton">
-						<button type="primary" form-type="submit" class="button1">
-							<p class="p">确认</p>
-						</button>
-						<button type="primary" @click="updateModules(zidongdoorCoding,'zidongdoor')" class="button1">
-							<p class="p">更换</p>
-						</button>
-					</view>
-				</view>
-			</form>
-			<view class="line"></view>
-			<form @submit="shoudongdoor" @reset="shoudongdoorReset">
+			<form @submit="xiazai" @reset="xiazaiReset">
 				<view class="modules">
-					<view class="title">手动门</view>
+					<view class="title">远程下载模块</view>
 					<view class="body">
-						<input class="input" style="display:none;" name="shoudongdoorCoding" :value=shoudongdoorCoding />
-						编码:<input class="input" v-model="shoudongdoorCoding" />
-						<button type="primary" @click="saoma('shoudongdoorCoding')" class="button1">
+						<input class="input" style="display:none;" name="xiazaiCoding" :value=xiazaiCoding />
+						编码:<input class="input" v-model="xiazaiCoding" />
+						<button type="primary" @click="saoma('xiazaiCoding')" class="button1">
 							<p class="p">扫码</p>
 						</button>
-						<button type="primary" @click="getMessage(shoudongdoorCoding)" class="button1">
+						<button type="primary" @click="getMessage(xiazaiCoding)" class="button1">
 							<p class="p">获取</p>
 						</button>
 					</view>
 					<view class="body">
-						名称:<input class="input" name="shoudongdoorName" :value="shoudongdoorName" />
+						名称:<input class="input" name="xiazaiName" :value="xiazaiName" />
 					</view>
 					<view class="body">
-						版本:<input class="input" name="shoudongdoorVersion" :value="shoudongdoorVersion" />
+						版本:<input class="input" name="xiazaiVersion" :value="xiazaiVersion" />
 					</view>
 					<view class="modulesButton">
 						<button type="primary" form-type="submit" class="button1">
 							<p class="p">确认</p>
 						</button>
-						<button type="primary" @click="updateModules(shoudongdoorCoding,'shoudongdoor')" class="button1">
+						<button type="primary" @click="updateModules(xiazaiCoding,'xiazai')" class="button1">
 							<p class="p">更换</p>
 						</button>
 					</view>
@@ -373,9 +349,9 @@
 					<view class="body">
 						名称:<input class="input" name="anzhuopingName" :value="anzhuopingName" />
 					</view>
-					<view class="body">
+					<!-- <view class="body">
 						版本:<input class="input" name="anzhuopingVersion" :value="anzhuopingVersion" />
-					</view>
+					</view> -->
 					<view class="modulesButton">
 						<button type="primary" form-type="submit" class="button1">
 							<p class="p">确认</p>
@@ -386,6 +362,7 @@
 					</view>
 				</view>
 			</form>
+
 			<view class="line"></view>
 			<form @submit="qibeng" @reset="yaxingdaoReset">
 				<view class="modules">
@@ -403,9 +380,9 @@
 					<view class="body">
 						名称:<input class="input" name="qibengName" :value="qibengName" />
 					</view>
-					<view class="body">
+					<!-- <view class="body">
 						版本:<input class="input" name="qibengVersion" :value="qibengVersion" />
-					</view>
+					</view> -->
 					<view class="modulesButton">
 						<button type="primary" form-type="submit" class="button1">
 							<p class="p">确认</p>
@@ -416,6 +393,96 @@
 					</view>
 				</view>
 			</form>
+			<view class="line"></view>
+			<form @submit="zidongdoor" @reset="zidongdoorReset">
+				<view class="modules">
+					<view class="title">自动门</view>
+					<view class="body">
+						<input class="input" style="display:none;" name="zidongdoorCoding" :value=zidongdoorCoding />
+						编码:<input class="input" v-model="zidongdoorCoding" />
+						<button type="primary" @click="saoma('zidongdoorCoding')" class="button1">
+							<p class="p">扫码</p>
+						</button>
+						<button type="primary" @click="getMessage(zidongdoorCoding)" class="button1">
+							<p class="p">获取</p>
+						</button>
+					</view>
+					<view class="body">
+						名称:<input class="input" name="zidongdoorName" :value="zidongdoorName" />
+					</view>
+					<view class="body">
+						版本:<input class="input" name="zidongdoorVersion" :value="zidongdoorVersion" />
+					</view>
+					<view class="modulesButton">
+						<button type="primary" form-type="submit" class="button1">
+							<p class="p">确认</p>
+						</button>
+						<button type="primary" @click="updateModules(zidongdoorCoding,'zidongdoor')" class="button1">
+							<p class="p">更换</p>
+						</button>
+					</view>
+				</view>
+			</form>
+			<view class="line"></view>
+			<form @submit="shuibeng" @reset="shuibengReset">
+				<view class="modules">
+					<view class="title">水泵</view>
+					<view class="body">
+						<input class="input" style="display:none;" name="shuibengCoding" :value=shuibengCoding />
+						编码:<input class="input" v-model="shuibengCoding" />
+						<button type="primary" @click="saoma('shuibengCoding')" class="button1">
+							<p class="p">扫码</p>
+						</button>
+						<button type="primary" @click="getMessage(shuibengCoding)" class="button1">
+							<p class="p">获取</p>
+						</button>
+					</view>
+					<view class="body">
+						名称:<input class="input" name="shuibengName" :value="shuibengName" />
+					</view>
+					<view class="body">
+						版本:<input class="input" name="shuibengVersion" :value="shuibengVersion" />
+					</view>
+					<view class="modulesButton">
+						<button type="primary" form-type="submit" class="button1">
+							<p class="p">确认</p>
+						</button>
+						<button type="primary" @click="updateModules(shuibengCoding,'shuibeng')" class="button1">
+							<p class="p">更换</p>
+						</button>
+					</view>
+				</view>
+			</form>
+			<view class="line"></view>
+			<form @submit="shoudongdoor" @reset="shoudongdoorReset">
+				<view class="modules">
+					<view class="title">手动门</view>
+					<view class="body">
+						<input class="input" style="display:none;" name="shoudongdoorCoding" :value=shoudongdoorCoding />
+						编码:<input class="input" v-model="shoudongdoorCoding" />
+						<button type="primary" @click="saoma('shoudongdoorCoding')" class="button1">
+							<p class="p">扫码</p>
+						</button>
+						<button type="primary" @click="getMessage(shoudongdoorCoding)" class="button1">
+							<p class="p">获取</p>
+						</button>
+					</view>
+					<view class="body">
+						名称:<input class="input" name="shoudongdoorName" :value="shoudongdoorName" />
+					</view>
+					<view class="body">
+						版本:<input class="input" name="shoudongdoorVersion" :value="shoudongdoorVersion" />
+					</view>
+					<view class="modulesButton">
+						<button type="primary" form-type="submit" class="button1">
+							<p class="p">确认</p>
+						</button>
+						<button type="primary" @click="updateModules(shoudongdoorCoding,'shoudongdoor')" class="button1">
+							<p class="p">更换</p>
+						</button>
+					</view>
+				</view>
+			</form>
 			
 			<view class="">
 				<button type="primary" formType="submit" class="button">
@@ -448,6 +515,7 @@
 				jiashiqiName: null,
 				lutouName: null,
 				nameplate: null,
+				clientId:null,
 				producePersonnel: null,
 				jiashiqiVersion: null,
 				lutouVersion: null,
@@ -483,7 +551,14 @@
 				shoudongdoorVersion: null,
 				anzhuopingCoding:null,
 				anzhuopingName: null,
-				anzhuopingVersion: null
+				anzhuopingVersion: null,
+				jiarebanCoding:null,
+				jiarebanName: null,
+				jiarebanVersion: null,
+				xiazaiCoding:null,
+				xiazaiName: null,
+				xiazaiVersion: null,
+				
 			}
 		},
 		methods: {
@@ -540,18 +615,67 @@
 						if (cod == 'anzhuopingCoding') {
 							that.anzhuopingCoding = res.result;
 						}
+						if (cod == 'jiarebanCoding') {
+							that.jiarebanCoding = res.result;
+						}
 						if (cod == 'jikeCoding') {
 							that.jikeCoding = res.result;
 						}
-
+						if (cod == 'xiazaiCoding') {
+							that.xiazaiCoding = res.result;
+						}
 					}
 				});
 			},
 			//获取机器详细信息
 			getMachine(coding) {
-				// console.log("a");
-
 				var that = this;
+				that.jiashiqiName = null;
+				that.jiashiqiCoding = null;
+				that.jiashiqiVersion = null;
+				that.lutouName =null;
+				that.lutouCoding = null;
+				that.lutouVersion =null;
+				that.shuibengName = null;
+				that.shuibengCoding = null;
+				that.shuibengVersion = null;
+				that.chugunName = null;
+				that.chugunCoding = null;
+				that.chugunVersion = null;
+				that.dianguiName = null;
+				that.dianguiCoding = null;
+				that.dianguiVersion = null;
+				that.jikeName = null;
+				that.jikeCoding = null;
+				that.jikeVersion = null;
+				that.zidongdoorName = null;
+				that.zidongdoorCoding = null;
+				that.zidongdoorVersion = null;
+				that.shoudongdoorName = null;
+				that.shoudongdoorCoding = null;
+				that.shoudongdoorVersion = null;
+				that.jixieshouName = null;
+				that.jixieshouCoding = null;
+				that.jixieshouVersion = null;
+				that.yaxingdaoName = null;
+				that.yaxingdaoCoding = null;
+				that.yaxingdaoVersion = null;
+				that.songtangName = null;
+				that.songtangCoding = null;
+				that.songtangVersion = null;
+				that.songtangVersion = null;
+				that.qibengName = null;
+				that.qibengCoding = null;
+				that.qibengVersion = null;
+				that.anzhuopingName = null;
+				that.anzhuopingCoding = null;
+				that.anzhuopingVersion = null;
+				that.jiarebanName = null;
+				that.jiarebanCoding = null;
+				that.jiarebanVersion = null;
+				that.xiazaiName = null;
+				that.xiazaiCoding = null;
+				that.xiazaiVersion = null;
 				var serverUrl = that.serverurl;
 				var token = uni.getStorageSync("token");
 				uni.request({
@@ -561,7 +685,6 @@
 						'token': token
 					},
 					success: (Result) => {
-						console.log(Result);
 						var res = Result;
 						if (res.data.code == true) {
 							//当机器已录入时,会先把所有录入模块给列出来
@@ -569,6 +692,7 @@
 								var tmachine = res.data.data.tmachine;
 								that.name = tmachine.name;
 								that.nameplate = tmachine.nameplate;
+								that.clientId = tmachine.clientId;
 								// that.producePersonnel = uni.getStorageSync("name");
 								var modulesList = res.data.data.modulesList;
 								var modules;
@@ -581,7 +705,6 @@
 										if (coding.substring(0, 2) == '15') {
 											//"加湿器"
 											if (coding.substring(5, 7) == '07') {
-												that.lutouName = modulesList[i].name;
 												that.jiashiqiName = modulesList[i].name;
 												that.jiashiqiCoding = modulesList[i].coding;
 												that.jiashiqiVersion = modulesList[i].coding.substring(8, 10);
@@ -617,13 +740,13 @@
 												that.jikeVersion = modulesList[i].coding.substring(8, 10);
 											}
 											//自动门
-											if (coding.substring(5, 7) == '11') {
+											if (coding.substring(5, 7) == '12') {
 												that.zidongdoorName = modulesList[i].name;
 												that.zidongdoorCoding = modulesList[i].coding;
 												that.zidongdoorVersion = modulesList[i].coding.substring(8, 10);
 											}
 											//手动门
-											if (coding.substring(5, 7) == '12') {
+											if (coding.substring(5, 7) == '11') {
 												that.shoudongdoorName = modulesList[i].name;
 												that.shoudongdoorCoding = modulesList[i].coding;
 												that.shoudongdoorVersion = modulesList[i].coding.substring(8, 10);
@@ -646,28 +769,43 @@
 												that.songtangCoding = modulesList[i].coding;
 												that.songtangVersion = modulesList[i].coding.substring(8, 10);
 											}
-											
+											//远程下载模块
+											if (coding.substring(5, 7) == '13') {
+												that.xiazaiName = modulesList[i].name;
+												that.xiazaiCoding = modulesList[i].coding;
+												that.xiazaiVersion = modulesList[i].coding.substring(8, 10);
+											}
+											//加热板
+											if (coding.substring(5, 7) == '14') {
+												that.jiarebanName = modulesList[i].name;
+												// that.qibengCoding = modulesList[i].coding.substring(0, 10);
+												that.jiarebanCoding = modulesList[i].coding;
+												that.jiarebanVersion = modulesList[i].coding.substring(8, 10);
+											}
 
 										}
 									}else{
 										//气泵
 										if (coding.substring(8, 10) == '39') {
 											that.qibengName = modulesList[i].name;
-											that.qibengCoding = modulesList[i].coding.substring(0, 10);
+											// that.qibengCoding = modulesList[i].coding.substring(0, 10);
+											that.qibengCoding = modulesList[i].coding;
 											that.qibengVersion = modulesList[i].coding.substring(8, 10);
 										}
 										//安卓屏
-										if (coding.substring(8, 10) == '71'||coding.substring(8, 10) == '72') {
+										if (coding.substring(8, 10) == '71'||coding.substring(8, 10) == '72'||coding.substring(7, 10) == '138'||coding.substring(7, 10) == '139') {
 											that.anzhuopingName = modulesList[i].name;
-											that.anzhuopingCoding = modulesList[i].coding.substring(0, 10);
+											that.anzhuopingCoding = modulesList[i].coding;
 											that.anzhuopingVersion = modulesList[i].coding.substring(8, 10);
 										}
+										
 									}
 								}
 							} else {
 								var codes = res.data.data;
 								that.name = codes.name;
 								that.nameplate = codes.nameplate;
+								that.clientId = codes.clientId;
 								that.producePersonnel = uni.getStorageSync("name");
 							}
 
@@ -691,7 +829,6 @@
 						'token': token
 					},
 					success: (Result) => {
-						console.log("1");
 						var res = Result;
 						if (res.data.code == true) {
 							var codes = res.data.data;
@@ -702,7 +839,6 @@
 								if (coding.substring(0, 2) == '15') {
 									//"加湿器"
 									if (coding.substring(5, 7) == '07') {
-										that.lutouName = codes.name;
 										that.jiashiqiName = codes.name;
 										that.jiashiqiCoding = codes.coding;
 										that.jiashiqiVersion = codes.code.substring(8, 10);
@@ -738,13 +874,13 @@
 										that.jikeVersion = codes.code.substring(8, 10);
 									}
 									//自动门
-									if (coding.substring(5, 7) == '11') {
+									if (coding.substring(5, 7) == '12') {
 										that.zidongdoorName = codes.name;
 										that.zidongdoorCoding = codes.coding;
 										that.zidongdoorVersion = codes.code.substring(8, 10);
 									}
 									//手动门
-									if (coding.substring(5, 7) == '12') {
+									if (coding.substring(5, 7) == '11') {
 										that.shoudongdoorName = codes.name;
 										that.shoudongdoorCoding = codes.coding;
 										that.shoudongdoorVersion = codes.code.substring(8, 10);
@@ -767,13 +903,24 @@
 										that.songtangCoding = codes.coding;
 										that.songtangVersion = codes.code.substring(8, 10);
 									}
-									
+									//远程下载模块
+									if (coding.substring(5, 7) == '13') {
+										that.xiazaiName = codes.name;
+										that.xiazaiCoding = codes.coding;
+										that.xiazaiVersion = codes.code.substring(8, 10);
+									}
+									//加热板
+									if (coding.substring(5, 7) == '14') {
+										that.jiarebanName = codes.name;
+										that.jiarebanCoding = codes.coding;
+										that.jiarebanVersion =codes.code.substring(8, 10);
+									}
 
 								}
 							}else{
 								//安卓屏
-								if (coding.substring(8, 10) == '71'||coding.substring(8, 10) == '72') {
-									debugger;
+								if (coding.substring(8, 10) == '71'||coding.substring(8, 10) == '72'||coding.substring(7, 10) == '138'||coding.substring(7, 10) == '139') {
+									// debugger;
 									that.anzhuopingName = codes.name;
 									that.anzhuopingCoding = codes.coding;
 									that.anzhuopingVersion = codes.versions;
@@ -784,6 +931,7 @@
 									that.qibengCoding = codes.coding;
 									that.qibengVersion = codes.versions;
 								}
+								
 							}
 						} else {
 							uni.showModal({
@@ -810,6 +958,7 @@
 						"coding": modules.coding,
 						"name": modules.name,
 						"nameplate": modules.nameplate,
+						"clientId":modules.clientId,
 						"createPersonnel": createPersonnel
 					},
 					header: {
@@ -830,7 +979,7 @@
 				const {
 					value: modules
 				} = event.detail;
-				console.log(event.detail.value);
+				// console.log(event.detail.value);
 				
 				var token = uni.getStorageSync("token");
 				var createPersonnel = uni.getStorageSync("name");
@@ -898,9 +1047,15 @@
 			anzhuoping(event){
 				this.tijiao(event,"anzhuoping");
 			},
+			jiareban(event){
+				this.tijiao(event,"jiareban");
+			},
 			jike(event){
 				this.tijiao(event,"jike");
 			},
+			xiazai(event){
+				this.tijiao(event,"xiazai");
+			},
 			tijiao(event,sname){
 				var serverUrl = this.serverurl;
 				var machineCoding = this.coding;
@@ -912,7 +1067,7 @@
 				var mapValue = this.objToStrMap(eValue);
 				var coding = mapValue.get(sname+"Coding");
 				var name = mapValue.get(sname+"Name");
-				console.log(coding+"---"+name);
+				// console.log(coding+"---"+name);
 				var token = uni.getStorageSync("token");
 				var createPersonnel = uni.getStorageSync("name");
 				uni.request({
@@ -1011,11 +1166,21 @@
 								that.anzhuopingCoding = null;
 								that.anzhuopingVersion = null;
 							}
+							if (name == "jiareban") {
+								that.jiarebanName = null;
+								that.jiarebanCoding = null;
+								that.jiarebanVersion = null;
+							}
 							if (name == "jike") {
 								that.jikeName = null;
 								that.jikeCoding = null;
 								that.jikeVersion = null;
 							}
+							if (name == "xiazai") {
+								that.xiazaiName = null;
+								that.xiazaiCoding = null;
+								that.xiazaiVersion = null;
+							}
 						} else if (res.cancel) {}
 					}
 				});
@@ -1025,7 +1190,6 @@
 			submit(event){
 				var serverUrl = this.serverurl;
 				var machineCoding = this.coding;
-				console.log("3");
 				const {
 					value: modules
 				} = event.detail;

+ 0 - 2
pages/Insert/addModules.vue

@@ -91,7 +91,6 @@
 						'token': token
 					},
 					success: (Result) => {
-						console.log("1");
 						var res = Result;
 						if(res.data.code==true){
 							var codes = res.data.data;
@@ -113,7 +112,6 @@
 				const {
 					value: modules
 				} = event.detail;
-				console.log("2");
 					var token = uni.getStorageSync("token");
 					uni.request({
 						url: serverUrl + "/TModules/add",

+ 134 - 0
pages/User/delCode.vue

@@ -0,0 +1,134 @@
+<template>
+	<view>
+		<view class="tr">
+			<input class="input" style="display:none;" />
+			<text>编号:</text><input class="input" name="coding" v-model="coding" />
+			<button  type="primary" @click="select()" class="button1">
+				<p class="p">查询</p>
+			</button>
+			<button  type="primary" @click="del()" class="button1">
+				<p class="p">删除</p>
+			</button>
+		</view>
+		<view class="tr">
+			<input class="input" style="display:none;" />
+			<text>名称:</text><p class="">{{name}}</p>
+		</view>
+		<view class="tr">
+			<input class="input" style="display:none;" />
+			<text>添加时间:</text><p class="">{{createDate}}</p>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				coding:null,
+				name:'',
+				createDate:''
+			}
+		},
+		methods: {
+			select(){
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: this.serverurl + "/TCoding/select?coding=" + this.coding,
+					method: "POST",
+					header: {
+						'token': token
+					},
+					success: (Result) => {
+						// console.log(Result);
+						var res = Result;
+						if(!res.data.code){
+							uni.showModal({
+								title: '提示',
+								content: res.data.message,
+							});
+						}else{
+							var data = res.data.data;
+							this.name = data.name;
+							this.createDate = data.createDate;
+						}
+					}
+				});
+			},
+			del(){
+				uni.showModal({
+					title: '删除',
+					content: '确定执行操作?',
+					success: (res) => {
+						if (res.confirm) {
+							var that = this;
+							var serverUrl = that.serverurl;
+							var token = uni.getStorageSync("token");
+							uni.request({
+								url: serverUrl + "/TCoding/delete?coding=" + this.coding,
+								method: "POST",
+								header: {
+									'token': token
+								},
+								success: (Result) => {
+									// console.log(Result);
+									var res = Result;
+									uni.showModal({
+										title: '提示',
+										content: res.data.message,
+									});
+								}
+							});
+						}
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	.tr {
+		padding-left: 30upx;
+		padding-top: 13upx;
+		font-size: 30upx;
+		padding-bottom: 13upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	.button1 {
+		margin: auto;
+		width: 75upx;
+		height: 50upx;
+	}
+	.input {
+		/* padding: 10upx 20upx 10upx 0upx; */
+		padding-left: 20upx;
+		padding-top: 10upx;
+		background-color: #FFFFFF;
+		width: 400upx;
+		height: 50upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+	.p {
+		/* #ifdef H5 */
+		top: -13%;
+		/* #endif */
+		width: 50upx;
+		height: 30upx;
+		font-size: 25upx;
+		padding-right: 9upx;
+		padding-top: 6upx;
+		/* #ifndef H5 */
+		/* padding-top: 10upx; */
+		/* #endif */
+	
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+</style>

+ 8 - 0
pages/User/user.vue

@@ -28,6 +28,9 @@
 					<uni-list-item title="添加新编码" @click="addCode()" />
 				</view>
 				<view v-if="level>2">
+					<uni-list-item title="删除编码" @click="delCode()" />
+				</view>
+				<view v-if="level>2">
 					<uni-list-item title="添加用户" @click="addUser()" />
 				</view>
 				<view v-if="level>2">
@@ -124,6 +127,11 @@
 					url: 'addCode',
 				});
 			},
+			delCode(){
+				uni.navigateTo({
+					url: 'delCode',
+				});
+			},
 			deleteUser(){
 				uni.setStorageSync("flag","delete");
 				uni.navigateTo({

+ 21 - 8
pages/select/selectMachine.vue

@@ -20,6 +20,9 @@
 					机器铭牌:{{nameplate}}
 				</t-tr>
 				<t-tr class="tr">
+					设备编码:{{clientId}}
+				</t-tr>
+				<t-tr class="tr">
 					机器名称:{{name}}
 				</t-tr>
 				<t-tr class="tr">
@@ -38,7 +41,7 @@
 						名称:{{item.name}}
 					</t-tr>
 					<t-tr class="tr">
-						<t-td >编码:{{item.coding}}</t-td>
+						<t-td>编码:{{item.coding}}</t-td>
 						<t-td class="td">
 							<button type="primary" @click="tran(item.coding)" class="button1">
 								<p class="p">详情</p>
@@ -68,10 +71,14 @@
 				nameplate: '',
 				name: '',
 				startDate: '',
+				clientId: '',
 				endDate: '',
 				modulesList: []
 			}
 		},
+		onShow() {
+			
+		},
 		methods: {
 			saoma() {
 				var that = this;
@@ -82,6 +89,7 @@
 					}
 				});
 			},
+
 			getMessage(coding) {
 				var that = this;
 				var serverUrl = that.serverurl;
@@ -93,7 +101,7 @@
 						'token': token
 					},
 					success: (Result) => {
-						console.log(Result);
+						// console.log(Result);
 						var res = Result;
 						if (res.data.code == true) {
 							//当机器已录入时,会先把所有录入模块给列出来
@@ -101,6 +109,7 @@
 								var tmachine = res.data.data.tmachine;
 								that.name = tmachine.name;
 								that.nameplate = tmachine.nameplate;
+								that.clientId = tmachine.clientId;
 								that.coding = tmachine.coding;
 								that.startDate = tmachine.startDate;
 								that.endDate = tmachine.endDate;
@@ -109,6 +118,7 @@
 								var codes = res.data.data;
 								that.name = codes.name;
 								that.nameplate = codes.nameplate;
+								that.clientId = tmachine.clientId;
 								that.producePersonnel = uni.getStorageSync("name");
 							}
 
@@ -121,8 +131,8 @@
 					}
 				});
 			},
-			tran(coding){
-				uni.setStorageSync("selectCoding",coding);
+			tran(coding) {
+				uni.setStorageSync("selectCoding", coding);
 				uni.navigateTo({
 					url: 'selectModules',
 				});
@@ -140,17 +150,20 @@
 		flex-direction: row;
 		justify-content: flex-start;
 	}
-	.table{
+
+	.table {
 		padding-top: 30upx;
-		
+
 	}
+
 	.tr {
 		padding-left: 30upx;
 		padding-top: 13upx;
 		font-size: 30upx;
 		padding-bottom: 13upx;
 	}
-	.td{
+
+	.td {
 		padding-left: 280upx;
 
 	}
@@ -176,7 +189,7 @@
 		margin: auto;
 		width: 75upx;
 		height: 50upx;
-		text-align:right
+		text-align: right
 	}
 
 	.p {

+ 81 - 9
pages/select/selectModules.vue

@@ -53,11 +53,22 @@
 					</view>
 					<t-tr class="tr">
 						状态:{{status}}
+
+					</t-tr>
+					<t-tr class="ttr">
+						操作:
+						<button v-show="status!=''" type="primary" @click="change(coding,machineCoding)"
+							class="button1">
+							<p class="p">更换</p>
+						</button>
+						<button v-if="level>2" type="primary" @click="del(coding)" class="button1">
+							<p class="p">删除</p>
+						</button>
 					</t-tr>
 				</t-table>
 			</view>
 			<view class="title">配件</view>
-<!-- 			<view class="lis" v-for="item in desList">
+			<!-- 			<view class="lis" v-for="item in desList">
 				{{item}}
 			</view> -->
 			<view class="lis" v-for="(item,index) in desList" :key="index">
@@ -93,6 +104,7 @@
 				producePersonnel: '',
 				machineCoding: '',
 				status: '',
+				level: 0,
 				desList: {}
 			}
 		},
@@ -105,6 +117,8 @@
 					this.getMessage(coding);
 				}
 			}
+			var level = uni.getStorageSync("level");
+			this.level = level;
 
 		},
 		methods: {
@@ -117,6 +131,40 @@
 					}
 				});
 			},
+			del(coding) {
+				uni.showModal({
+					title: '删除',
+					content: '确定执行操作?',
+					success: (res) => {
+						if (res.confirm) {
+							var that = this;
+							var serverUrl = that.serverurl;
+							var token = uni.getStorageSync("token");
+							uni.request({
+								url: serverUrl + "/TModules/deleteModules?coding=" + coding,
+								method: "GET",
+								header: {
+									'token': token
+								},
+								success: (Result) => {
+									// console.log(Result);
+									var res = Result;
+									uni.showModal({
+										title: '提示',
+										content: res.data.message,
+									});
+								}
+							});
+						}
+					}
+				});
+
+			},
+			change(coding, machineCoding) {
+				uni.navigateTo({
+					url: '/pages/select/update?coding=' + coding + '&machineCoding=' + machineCoding,
+				});
+			},
 			getMessage(coding) {
 				var that = this;
 				var serverUrl = that.serverurl;
@@ -151,13 +199,27 @@
 								that.machineCoding = codes.machineCoding;
 							} else {
 								that.versions = co.substring(co.length - 3, co.length);
-								that.producePersonnel = "";
-								that.produceDate = "";
-								that.status = "";
-								that.machineCoding = "";
+								// that.producePersonnel = "";
+								// that.produceDate = "";
+								var sta = codes.status;
+								if (sta == '0') {
+									that.status = "未安装";
+								}
+								if (sta == '1') {
+									that.status = "已安装";
+								}
+								if (sta == '2') {
+									that.status = "已替换";
+								}
+								that.producePersonnel = codes.producePersonnel;
+								that.produceDate = codes.createDate;
+								if (codes.machineCoding != null) {
+									that.machineCoding = codes.machineCoding;
+								}
+
 							}
-							
-							if(codes.flagCode.length>1){
+
+							if (codes.flagCode.length > 1) {
 								that.desList = codes.flagCode.split(",");
 							}
 							that.installDate = codes.installDate;
@@ -167,10 +229,10 @@
 							that.replacePersonnel = codes.replacePersonnel;
 							if (co.substring(0, 4) != '1000') {
 								that.oldCoding = "";
-							}else{
+							} else {
 								that.oldCoding = "";
 							}
-							
+
 						} else {
 							uni.showModal({
 								content: res.data.message,
@@ -193,6 +255,16 @@
 		justify-content: flex-start;
 	}
 
+	.ttr {
+		padding-left: 30upx;
+		padding-top: 13upx;
+		font-size: 30upx;
+		padding-bottom: 13upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+
 	.tr {
 		padding-left: 30upx;
 		padding-top: 13upx;

+ 188 - 0
pages/select/update.vue

@@ -0,0 +1,188 @@
+<template>
+	<view>
+		<form @submit="update">
+			<view class="body">
+				<input class="input" style="display:none;" name="machineCoding" :value=machineCoding />
+				所属机器编码:<input class="input" v-model="machineCoding" />
+				<button type="primary" @click="saoma1()" class="button1">
+					<p class="p">扫码</p>
+				</button>
+			</view>
+			<view class="body">
+				<input class="input" style="display:none;" name="oldCoding" :value=oldCoding />
+				旧模块编码:<input class="input" v-model="oldCoding" />
+				<button type="primary" @click="saoma2()" class="button1">
+					<p class="p">扫码</p>
+				</button>
+			</view>
+			<view class="body">
+				<input class="input" style="display:none;" name="coding" :value=coding />
+				新模块编码:<input class="input" v-model="coding" />
+				<button type="primary" @click="saoma3()" class="button1">
+					<p class="p">扫码</p>
+				</button>
+			</view>
+			<view class="body">
+				更换原因:<textarea class="input-two" name="replaceReason" />
+				</view>
+			<view class="">
+				<button type="primary" formType="submit" class="button">
+					<p class="p1">提交</p>
+				</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				machineCoding: '',
+				coding: '',
+				oldCoding: '',
+				replaceReason: ''
+			}
+		},
+		onLoad: function(option) {
+			const coding = option.coding;
+			const machineCoding = option.machineCoding;
+			this.machineCoding = machineCoding;
+			this.oldCoding = coding;
+		},
+		methods: {
+				saoma1(){
+					var that = this;
+					// 允许从相机和相册扫码
+					uni.scanCode({
+					    success(res) {
+							that.machineCoding = res.result;
+					    }
+					});
+				},
+				saoma2(){
+					var that = this;
+					// 允许从相机和相册扫码
+					uni.scanCode({
+					    success(res) {
+							that.oldCoding = res.result;
+					    }
+					});
+				},
+				saoma3(){
+					var that = this;
+					// 允许从相机和相册扫码
+					uni.scanCode({
+					    success(res) {
+							that.coding = res.result;
+					    }
+					});
+				},
+				update(event) {
+					var serverUrl = this.serverurl;
+					const {
+						value: modules
+					} = event.detail;
+						var token = uni.getStorageSync("token");
+						uni.request({
+							url: serverUrl + "/TModules/replace",
+							method: "POST",
+							data:{
+								"coding":modules.coding,
+								"machineCoding":modules.machineCoding,
+								"oldCoding":modules.oldCoding,
+								"replaceReason":modules.replaceReason,
+								"replacePersonnel":uni.getStorageSync("name"),
+							},
+							header: {
+								'token': token
+							},
+							success: (Result) => {
+								var res = Result;
+								if(res.data.code==true){
+								}
+								uni.showModal({
+									title: '提示',
+									content: res.data.message,
+								});
+							}
+						});
+				},
+		}
+	}
+</script>
+
+<style>
+.body {
+		background-color: #FFFFFF;
+		padding: 20upx 20upx 20upx 20upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	
+	.input {
+		/* padding: 10upx 20upx 10upx 0upx; */
+		padding-left: 20upx;
+		padding-top: 10upx;
+		background-color: #FFFFFF;
+		width: 400upx;
+		height: 50upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+	.button1 {
+		margin: auto;
+		width: 75upx;
+		height: 50upx;
+	}
+	.p {
+		/* #ifdef H5 */
+		top: -13%;
+		/* #endif */
+		width: 50upx;
+		height: 30upx;
+		font-size: 25upx;
+		padding-right: 9upx;
+		padding-top: 6upx;
+		/* #ifndef H5 */
+		/* padding-top: 10upx; */
+		/* #endif */
+
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+	.input-two{
+		padding-left: 20upx;
+		width: 450upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+	.p1 {
+		/* #ifdef H5 */
+		top: -13%;
+		/* #endif */
+		width: 80upx;
+		height: 60upx;
+		font-size: 40upx;
+		padding-top: 6upx;
+		/* #ifndef H5 */
+		padding-top: 10upx;
+		/* #endif */
+	
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+</style>