Browse Source

完善功能

李天标 5 years ago
parent
commit
049494737d

+ 2 - 2
common/lang/zh.js

@@ -1,8 +1,8 @@
 export default {
 	lang: 'zh',
 	login: {
-		title: '管理后台',
-		username:'请输入用户名/手机号',
+		title: '物料索源系统',
+		username:'请输入用户名',
 		password:'请输入密码',
 		login:'登录'
 	},

+ 2 - 4
configs/env.js

@@ -9,7 +9,7 @@ let configs = {
 if (process.env.NODE_ENV === 'development') {
 	// 测试环境
 	configs = Object.assign(configs, {
-		baseUrl: 'https://app.sunzee.com.cn:9443/cleanMachineServer',
+		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
 		// baseUrl: 'http://127.0.0.1:8090',
 	});
 }
@@ -17,9 +17,7 @@ if (process.env.NODE_ENV === 'development') {
 if (process.env.NODE_ENV === 'production') {
     // 生产环境
 	configs = Object.assign(configs, {
-		// baseUrl: 'https://app.sunzee.com.cn/cleanMachineServer',
-		// baseUrl: 'http://app.sunzee.com.cn:8090/cleanMachineServer',
-		baseUrl: 'https://app.sunzee.com.cn:9443/cleanMachineServer',
+		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
 		// isProduction: true,
 	});
 }

+ 3 - 3
main.js

@@ -6,7 +6,7 @@ import store from './store';
 import env from '@/configs/env';
 import zh from '@/common/lang/zh';
 import en from '@/common/lang/en';
-import mainStatistics from '@/pages/Charts/mainStatistics';
+// import mainStatistics from '@/pages/Charts/mainStatistics';
 
 
 Vue.use(VueI18n)
@@ -23,7 +23,7 @@ const i18n = new VueI18n({
 App.mpType = 'app'
 
 // Vue.prototype.serverurl="http://127.0.0.1:8090";
-Vue.prototype.serverurl="https://app.sunzee.com.cn:9443/cleanMachineServer";
+Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
 Vue.prototype.$store = store;
 Vue.prototype._i18n = i18n;
 const app = new Vue({
@@ -37,4 +37,4 @@ Object.keys(apis).forEach(key => {
 	Vue.prototype[`$${key}`] = apis[key];
 });
 
-Vue.component('mainStatistics', mainStatistics);
+// Vue.component('mainStatistics', mainStatistics);

+ 4 - 3
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "智能洗手间",
+    "name" : "申泽物料追踪索源小程序",
     "appid" : "__UNI__C9DE28D",
     "description" : "",
     "versionName" : "1.0.0",
@@ -91,14 +91,15 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxfffa94218fe6667b",
+        "appid" : "wxee9bb82efa627f25",
         "setting" : {
             "urlCheck" : false,
             "es6" : true,
             "postcss" : true,
             "minified" : false
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+        "permission" : {}
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 2 - 2
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "shenzeeuniapp",
+  "name": "materialAppletApp",
   "version": "1.0.0",
   "description": "",
   "main": "main.js",
@@ -8,7 +8,7 @@
   },
   "repository": {
     "type": "git",
-    "url": "https://e.coding.net/sunzee/shenzeeUniApp.git"
+    "url": "http://app.sunzee.com.cn:3000/litianbiao/materialAppletApp.git"
   },
   "author": "",
   "license": "ISC",

+ 168 - 122
pages.json

@@ -1,159 +1,203 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-            "path" : "pages/Login/Login",
-            "style" : {
+			"path": "pages/Login/Login",
+			"style": {
 				"navigationStyle": "custom",
 				"disableScroll": true
 			}
-        },
+		},
 		{
-		    "path" : "pages/Login/loginWeixin",
-		    "style" : {
+			"path": "pages/Login/loginWeixin",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		},
+		// {
+		//     "path" : "pages/Charts/mainStatistics",
+		//     "style" : {
+		// 		"navigationBarTitleText":"首页"
+		// 		// "disableScroll": true
+		// 		// "enablePullDownRefresh": true
+		// 	}
+		// },
 		{
-		    "path" : "pages/Charts/mainStatistics",
-		    "style" : {
-				"navigationBarTitleText":"首页"
+			"path": "pages/select/select",
+			"style": {
+				"navigationBarTitleText": "查询"
 				// "disableScroll": true
 				// "enablePullDownRefresh": true
 			}
 		},
+		// {
+		//     "path" : "pages/Setting/Setting",
+		//     "style" : {
+		// 		"navigationBarTitleText":"机器设置",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/singleStatistics",
+		//     "style" : {
+		// 		"navigationBarTitleText":"单机统计",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/cleanRule",
+		//     "style" : {
+		// 		"navigationBarTitleText":"清洗规则",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/pay",
+		//     "style" : {
+		// 		"navigationBarTitleText":"支付",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/parameters",
+		//     "style" : {
+		// 		"navigationBarTitleText":"参数类型",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/generalParameters",
+		//     "style" : {
+		// 		"navigationBarTitleText":"通用参数",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/advancedParameters",
+		//     "style" : {
+		// 		"navigationBarTitleText":"进阶参数",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/dayPay",
+		//     "style" : {
+		// 		"navigationBarTitleText":"按日支付",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
+		// {
+		//     "path" : "pages/Setting/timesPay",
+		//     "style" : {
+		// 		"navigationBarTitleText":"按次数支付",
+		// 		// "disableScroll": true,
+		// 		"enablePullDownRefresh": true
+		// 	}
+		// },
 		{
-		    "path" : "pages/Setting/Setting",
-		    "style" : {
-				"navigationBarTitleText":"机器设置",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-		    "path" : "pages/Setting/singleStatistics",
-		    "style" : {
-				"navigationBarTitleText":"单机统计",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-		    "path" : "pages/Setting/cleanRule",
-		    "style" : {
-				"navigationBarTitleText":"清洗规则",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
+			"path": "pages/Insert/Insert",
+			"style": {
+				"navigationBarTitleText": "录入"
 			}
 		},
 		{
-		    "path" : "pages/Setting/pay",
-		    "style" : {
-				"navigationBarTitleText":"支付",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
+			"path": "pages/User/user",
+			"style": {
+				"navigationBarTitleText": "我的"
 			}
 		},
+
 		{
-		    "path" : "pages/Setting/parameters",
-		    "style" : {
-				"navigationBarTitleText":"参数类型",
-				// "disableScroll": true,
+			"path": "pages/WeixinSwicth/WeixinSwicth",
+			"style": {
+				// "navigationStyle": "custom",
+				"navigationBarTitleText": "微信绑定",
+				"menuSrc": "static/img/leftTriangle.png",
 				"enablePullDownRefresh": true
+				// "disableScroll": true
 			}
 		},
+		//      {
+		//          "path" : "pages/Setting/saoma",
+		//          "style" : {
+		// 	"navigationBarTitleText": "扫码"
+		// }
+		//      },
 		{
-		    "path" : "pages/Setting/generalParameters",
-		    "style" : {
-				"navigationBarTitleText":"通用参数",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
+			"path": "pages/User/updataPassword",
+			"style": {
+				"navigationBarTitleText": "修改信息"
 			}
 		},
 		{
-		    "path" : "pages/Setting/advancedParameters",
-		    "style" : {
-				"navigationBarTitleText":"进阶参数",
-				// "disableScroll": true,
-				"enablePullDownRefresh": true
+			"path": "pages/User/userList",
+			"style": {
+				"navigationBarTitleText": "用户列表"
 			}
 		},
 		{
-		    "path" : "pages/Setting/dayPay",
-		    "style" : {
-				"navigationBarTitleText":"按日支付",
-				// "disableScroll": true,
+			"path": "pages/User/userInfo",
+			"style": {
+				"navigationBarTitleText": "用户管理",
 				"enablePullDownRefresh": true
 			}
 		},
 		{
-		    "path" : "pages/Setting/timesPay",
-		    "style" : {
-				"navigationBarTitleText":"按次数支付",
-				// "disableScroll": true,
+			"path": "pages/User/addCode",
+			"style": {
+				"navigationBarTitleText": "添加编码",
 				"enablePullDownRefresh": true
 			}
-		},
-		{
-		    "path" : "pages/User/user",
-		    "style" : {
-				"navigationBarTitleText":"我的"
-			}
-		},
-		{
-		    "path" : "pages/User/promoCode",
-		    "style" : {
-				"navigationBarTitleText":"优惠码"
-			}
-		},
-		{
-		    "path" : "pages/User/buyPromo",
-		    "style" : {
-				"navigationBarTitleText":"购买优惠码"
-			}
-		},
-		{
-		    "path" : "pages/User/equipmentName",
-		    "style" : {
-				"navigationBarTitleText":"修改设备名称"
-			}
-		},
-		// {
-		// 	"path": "pages/Charts/elseStatistics",
-		// 	"style": {
-		// 		"navigationBarTitleText": "统计图表"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/Charts/equipmentStatistics",
-		// 	"style": {
-		// 		"navigationBarTitleText": "销售排行"
-		// 	}
-		// }
-        
-        {
-            "path" : "pages/WeixinSwicth/WeixinSwicth",
-            "style" : {
-				// "navigationStyle": "custom",
-				"navigationBarTitleText": "微信绑定",
-				"menuSrc":"static/img/leftTriangle.png",
-				 "enablePullDownRefresh": true
-				// "disableScroll": true
-			}
-        }
-        ,{
-            "path" : "pages/Setting/saoma",
-            "style" : {
-				"navigationBarTitleText": "扫码"
-			}
-        }
-    ],
+		}
+
+		, {
+			"path": "pages/Insert/addModules",
+			"style": {
+				"navigationBarTitleText": "添加模块"
+			}
+		}, {
+			"path": "pages/Insert/addMachine",
+			"style": {
+				"navigationBarTitleText": "添加机器"
+			}
+		}, {
+			"path": "pages/Insert/updateModules",
+			"style": {
+				"navigationBarTitleText": "更换模块"
+			}
+		}
+
+		, {
+			"path": "pages/select/selectModules",
+			"style": {
+				"navigationBarTitleText": "模块查询"
+			}
+		}, {
+			"path": "pages/select/selectMachine",
+			"style": {
+				"navigationBarTitleText": "机器查询"
+			}
+		}, {
+			"path": "pages/update/update",
+			"style": {
+				"navigationBarTitleText": "反馈更换"
+			}
+		}
+	],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",
 		"navigationBarTitleText": "",
 		"navigationBarBackgroundColor": "#206DC3",
 		"backgroundColor": "#F8F8F8",
-		"animationType":"slide-in-right",
-		"animationDuration":200
+		"animationType": "slide-in-right",
+		"animationDuration": 200
 	},
 	"tabBar": {
 		"color": "#7A7E83",
@@ -161,10 +205,10 @@
 		"borderStyle": "black",
 		"backgroundColor": "#F8F8F8",
 		"list": [{
-				"pagePath": "pages/Charts/mainStatistics",
+				"pagePath": "pages/select/select",
 				"iconPath": "static/img/home.png",
 				"selectedIconPath": "static/img/homeHL.png",
-				"text": "首页"
+				"text": "查询"
 			},
 			// {
 			// 	"pagePath": "pages/User/merchantList",
@@ -173,11 +217,7 @@
 			// 	"text": "机器销售"
 			// },
 			// {
-			// 	"pagePath": "pages/Charts/equipmentStatistics",
-			// 	"iconPath": "static/img/equipmentSratisticsList.png",
-			// 	"selectedIconPath": "static/img/equipmentSratisticsListHL.png",
-			// 	"text": "机器排行"
-			// },
+
 			// {
 			// 	"pagePath": "pages/User/equipmentStatusList",
 			// 	"iconPath": "static/img/equipment.png",
@@ -185,10 +225,16 @@
 			// 	"text": "机器状态"
 			// },
 			{
-				"pagePath": "pages/Setting/Setting",
+				"pagePath": "pages/Insert/Insert",
 				"iconPath": "static/img/equipment.png",
 				"selectedIconPath": "static/img/equipmentHL.png",
-				"text": "机器设置"
+				"text": "录入"
+			},
+			{
+				"pagePath": "pages/update/update",
+				"iconPath": "static/img/equipmentSratisticsList.png",
+				"selectedIconPath": "static/img/equipmentSratisticsListHL.png",
+				"text": "反馈"
 			},
 			{
 				"pagePath": "pages/User/user",

+ 0 - 985
pages/Charts/mainStatistics.vue

@@ -1,985 +0,0 @@
-<template>
-	<view>
-		<view class="head">
-			<view class="">
-				<image class="userFlagimg" src="../../static/img/userFlag.png" mode=""></image>
-			</view>
-			<view class="pname">
-				<font class="wenzi" style="color: #BDD6F3;font-size:28upx"> {{$t('mainStatistics.name')}}: {{pnameData}}</font>
-			</view>
-			<view class="company">
-				<font style="color: #BDD6F3;font-size:28upx">{{$t('mainStatistics.company')}}</font>
-			</view>
-		</view>
-		<view class="ri">
-			<view class="riShell">
-				<view class="riImg">
-					<image style="width: 64upx;height: 64upx;padding-top: 20upx;" :src="$t('mainStatistics.dayImg')"></image>
-				</view>
-				<view class="riTitle">
-					<view style="text-align:left;font-size:28upx;font-family:PingFang-SC-Medium">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.dayTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{dayRandomTimes}}</font>
-					</view>
-					<view style="text-align:left;font-size:28upx;font-family:PingFang-SC-Medium">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.dayTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{dayRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-			<view class="riqi">
-				<view style="text-align:right" class="tody">
-					<font style="color: #596D83;">{{today}}</font>
-				</view>
-				<view style="text-align:right" class="xingqi">
-					<font style="color: #596D83;">{{week}}</font>
-				</view>
-			</view>
-		</view>
-		<view class="fourTitle">
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.weekImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.weekTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{weekRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.weekTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{weekRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.monthImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.monthTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{monthRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.monthTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{monthRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.yearImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.yearTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{yearRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.yearTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{yearRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.allImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.machineTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{machineTotalNum}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.machineUseNum')}}:</font>
-						<font style="color: #ED341F;">{{machineUseNum}}</font>
-					</view>
-				</view>
-			</view>
-		</view>
-		
-		<!-- 机器详情表 -->
-		<view class="">
-			<view v-if="merchantList.length>1">
-				<uni-collapse :accordion="true">
-					<view class="titleFlag">
-						<image class="img" src="../../static/img/red.png"></image>
-						<font class="wenziT">红色代表机器报警</font>
-						<image class="img" src="../../static/img/green.png"></image>
-						<font class="wenziT">绿色代表机器正常</font>
-					</view>
-					<view class="titlelist" v-for="(merchant,index) in merchantList" :key="merchant.id">
-						<uni-collapse-item :title="getMerchantTitle(merchant)" :open="index===0">
-							<view style="padding: 20upx;background-color: aliceblue;">
-								<view v-if="merchant.equipmentList.length==0" style="text-align: center;">暂无数据</view>
-								<view v-if="merchant.equipmentList.length>0">
-									<uni-collapse :show-animation="true">
-										<view style="position: relative;" v-for="equipment in merchant.equipmentList" :key="equipment.id">
-											<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
-											<uni-collapse-item :title="getEquipmentTitle(equipment)">
-												<view style="padding: 20upx;background-color: #F8F8F8;">
-													<view class="swithBox" v-if="equipment.isSleep">
-														<view class="swichFont">睡眠状态:机器已睡眠</view>
-														<view class="switch">
-															<switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
-														</view>
-													</view>
-													<view class="swithBox" v-else>
-														<view class="swichFont">睡眠状态:未睡眠</view>
-														<view class="switch">
-															<switch style="transform:scale(0.65)" :checked="sleepChecked" @change="change(equipment.id,1)" />
-														</view>
-													</view>
-													<view class="line1"></view>
-													<view class="swithBox" v-if="equipment.eqeStatus==0">
-														<view class="swichFont">关机:已关机</view>
-														<view class="switch">
-															<switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
-														</view>
-													</view>
-													<view class="swithBox" v-else>
-														<view class="swichFont">关机:未关机</view>
-														<view class="switch">
-															<switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
-														</view>
-													</view>
-													<view class="line1"></view>
-													<view><span>机器唯一码:</span><span>{{equipment.clientId}}</span></view>
-													<!-- <view><span>所在地:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view> -->
-													<view><span>清洁剂余量:</span><span>{{equipment.cleaner?equipment.cleaner:''}}</span></view>
-													<view><span>消毒水余量:</span><span>{{equipment.disinfectant?equipment.disinfectant:''}}</span></view>
-													<view><span>机器到期时间:</span><span>{{equipment.overdueDate?equipment.overdueDate:''}}</span></view>
-													<view><span>机器剩余使用次数:</span><span>{{equipment.remaining?equipment.remaining:''}}</span></view>
-													<view><span>机器温度:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
-													<view><span>室内湿度:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
-													<view><span>室内温度:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
-													<view v-if="equipment.hasTodayAlarm">
-														<view><span>报警内容:</span></view>
-														<view v-for="(alarm,index) in equipment.alarmList" :key="index">
-															<view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
-														</view>
-													</view>
-													<view v-else>
-														<view><span>报警内容:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
-																{{equipment.alarmContent}}</span></view>
-													</view>
-												</view>
-											</uni-collapse-item>
-										</view>
-									</uni-collapse>
-								</view>
-							</view>
-						</uni-collapse-item>
-					</view>
-				</uni-collapse>
-			</view>
-			<view v-else>
-				<uni-collapse :show-animation="true">
-					<view class="titleFlag">
-						<image class="img" src="../../static/img/red.png"></image>
-						<font class="wenziT">{{$t('equipmentStatusList.red')}}</font>
-						<image class="img" src="../../static/img/green.png"></image>
-						<font class="wenziT">{{$t('equipmentStatusList.green')}}</font>
-					</view>
-					<view class="titlelist" style="position: relative;" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
-						<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
-						<uni-collapse-item :title="getEquipmentTitle(equipment)">
-							<!-- 睡眠 -->
-							<view style="padding: 20upx;background-color:#F8F8F8;">
-								<view class="swithBox" v-if="equipment.isSleep">
-									<view class="swichFont">{{$t('equipmentStatusList.sleep')}}</view>
-									<view class="switch">
-										<switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
-									</view>
-								</view>
-								<view class="swithBox" v-else>
-									<view class="swichFont">{{$t('equipmentStatusList.unsleep')}}</view>
-									<view class="switch">
-										<switch style="transform:scale(0.65)" :checked="sleepChecked" @change="change(equipment.id,1)" />
-									</view>
-								</view>
-								<view class="line1"></view>
-								<!-- 关机 -->
-								<view class="" v-if="globalUser.open==0">
-									<view class="swithBox" v-if="equipment.eqeStatus==0">
-										<view class="swichFont">{{$t('equipmentStatusList.off')}}</view>
-										<view class="switch">
-											<switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
-										</view>
-									</view>
-									<view class="swithBox" v-else>
-										<view class="swichFont">{{$t('equipmentStatusList.on')}}</view>
-										<view class="switch">
-											<switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
-										</view>
-									</view>
-								</view>
-			
-								<view class="line1"></view>
-								<!-- 远程开门 -->
-								<view class="opendoor"><span>{{$t('equipmentStatusList.door')}}:</span>
-									<view class="">
-										<button type="primary" @click="openDoor(equipment.id)" class="button">
-											<p class="p">{{$t('equipmentStatusList.open')}}</p>
-										</button>
-									</view>
-								</view>
-			
-								<view><span>{{$t('equipmentStatusList.equipmentNo')}}:</span><span>{{equipment.clientId}}</span></view>
-								<!-- <view><span>{{$t('equipmentStatusList.area')}}:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
-								 -->
-								 <view><span>清洁剂余量:</span><span>{{equipment.cleaner?equipment.cleaner:''}}</span></view>
-								 <view><span>消毒水余量:</span><span>{{equipment.disinfectant?equipment.disinfectant:''}}</span></view>
-								 <view><span>机器到期时间:</span><span>{{equipment.overdueDate?equipment.overdueDate:''}}</span></view>
-								 <view><span>机器剩余使用次数:</span><span>{{equipment.remaining?equipment.remaining:''}}</span></view>
-								<view><span>{{$t('equipmentStatusList.temperature')}}:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
-								<view><span>{{$t('equipmentStatusList.humidity')}}:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
-								<view><span>{{$t('equipmentStatusList.equipmentTemperature')}}:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
-								<view class="" v-if="equipment.hasTodayAlarm">
-									<view><span>{{$t('equipmentStatusList.alarm')}}:</span></view>
-									<view v-for="(alarm,index) in equipment.alarmList" :key="index">
-										<view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
-									</view>
-								</view>
-								<view class="" v-else>
-									<view><span>{{$t('equipmentStatusList.alarm')}}:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
-											{{equipment.alarmContent}}</span></view>
-								</view>
-							</view>
-						</uni-collapse-item>
-					</view>
-				</uni-collapse>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex';
-	// import uCharts from '@/components/u-charts/u-charts.js';
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import {
-		dateUtils
-	} from '@/common/util.js';
-	var _self;
-	export default {
-		name: 'mainStatistics',
-		props: {
-			equipmentId: '',
-			adminId: '',
-			pname: '',
-		},
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem,
-		},
-		data() {
-			return {
-				machineTotalNum: 0,
-				machineUseNum: 0,
-				dayRandomTimes: 0,
-				dayRegularTimes: 0,
-				weekRandomTimes: 0,
-				weekRegularTimes: 0,
-				monthRandomTimes: 0,
-				monthRegularTimes: 0,
-				yearRandomTimes: 0,
-				yearRegularTimes: 0,
-				today: '',
-				week: '',
-				
-				globalUser: {},
-				merchantList: [{
-					equipmentList: []
-				}],
-				extraIcon: {
-					color: '#4cd964',
-					size: '22',
-					type: 'spinner'
-				},
-				statusNormal: 'status-normal',
-				statusError: 'status-error',
-				sleepChecked: null,
-				onffChecked: null,
-				time: null,
-				timeAll: {
-				
-				},
-				// input: 0
-			}
-		},
-		
-		computed: {
-			...mapState(['loginUser']),
-			pnameData: {
-				get() {
-					return this.pname;
-				}
-			},
-		},
-		onShow() {
-			uni.setNavigationBarTitle({
-				title: this.$t('mainStatistics.title')
-			});
-			uni.setTabBarItem({
-				index: 0,
-				text: this.$t('tabs.tab1')
-			});
-			var token = uni.getStorageSync("token");
-			if (token.toString().length > 1) {
-				this.init();
-				
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-			// this.input = this.input + 1;
-			var test = uni.getStorageSync('test');
-			var globalUser = uni.getStorageSync("globalUser");
-			this.globalUser = globalUser;
-			if (globalUser.toString().length > 1) {
-				//判断是不是初次登陆
-				if (test == 2) {
-					this.init();
-				}
-			}
-			var id = this.adminId;
-
-			this.day();
-			// this.equipmentStatus();
-		},
-		mounted() {
-			var token = uni.getStorageSync("token");
-			if (token.toString().length > 1) {
-				this.init();
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-			// this.day();
-			this.equipmentStatus();
-		},
-		methods: {
-			...mapActions('chart', ['getStatistics', 'getMainStatistics', 'getMachineNum','getEquipmentListByUser']),
-			async init() {
-				if (!this.pname) {
-					this.pname = this.loginUser.name;
-				}
-				_self = this;
-				await this.getMainStatisticsData();
-				await this.getEquipmentListData();
-				//初次登陆跳转后,把test变成2
-				uni.setStorageSync('test', '2');
-
-			},
-			day() {
-				var date = new Date();
-				// var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
-				var daystr = dateUtils.formateDate(date, 'yyyy-MM-dd');
-				this.today = daystr;
-				// var str= '星期'+'日一二三四五六'.charAt(date.getDay());
-				this.week = this.$t('mainStatistics.week' + date.getDay());
-
-			},
-			equipmentStatus() {
-				var id = uni.getStorageSync("globalUser").id;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TEquipment/equipmentStatus',
-					data: {
-						"adminId": id
-					},
-					header: {
-						'token': token
-					},
-					method: "POST",
-					success: (res) => {
-
-					},
-				});
-			},
-			getMainStatisticsData() {
-				const param = {};
-				if (this.adminId) { // 子组件,则拿传过来的参
-					param['adminId'] = this.adminId;
-				} else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
-					param['adminId'] = this.loginUser['id'];
-				}
-				var globalUser = uni.getStorageSync("globalUser");
-				if (globalUser.id != 1) {
-					if (param.adminId == null || param.adminId == undefined) {
-						param['adminId'] = globalUser.id;
-					}
-				}
-				if (this.equipmentId) {
-					param['equipmentId'] = this.equipmentId;
-				}
-				// console.log('getMainStatisticsData:{}', param);
-				var adminId = param.adminId;
-				var equipmentId = this.equipmentId;
-				var serverurl = this.serverurl;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: serverurl + '/TEquipment/getMachineNum',
-					data: {
-						"adminId": adminId,
-						"equipmentId": equipmentId
-					},
-					method: "POST",
-					header: {
-						'token': token
-					},
-					success: (res) => {
-						var list = res.data.data;
-						this.machineTotalNum = list[0];
-						this.machineUseNum = list[1];
-					}
-				});
-				return this.getMainStatistics(param)
-					.then(data => {
-						for (let bean of data) {
-							if (bean['categorie'] === 'day') {
-								if(bean['randomTimes']!=null){
-									this.dayRandomTimes = bean['randomTimes'];
-								}
-								if(bean['regularTimes']!=null){
-									this.dayRegularTimes = bean['regularTimes'];
-								}
-								
-								
-							}
-							if (bean['categorie'] === 'week') {
-								if(bean['randomTimes']!=null){
-									this.weekRandomTimes = bean['randomTimes'];
-								}
-								if(bean['regularTimes']!=null){
-									this.weekRegularTimes = bean['regularTimes'];
-								}
-								
-								
-							}
-							if (bean['categorie'] === 'month') {
-								if(bean['randomTimes']!=null){
-									this.monthRandomTimes = bean['randomTimes'];
-								}
-								if(bean['regularTimes']!=null){
-									this.monthRegularTimes = bean['regularTimes'];
-								}
-								
-								
-							}
-							if (bean['categorie'] === 'year') {
-								if(bean['randomTimes']!=null){
-									this.yearRandomTimes = bean['randomTimes'];
-								}
-								if(bean['regularTimes']!=null){
-									this.yearRegularTimes = bean['regularTimes'];
-								}
-								
-								
-							}
-						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			// 属性方法
-			getMerchantTitle(merchant) {
-				return merchant.name ? merchant.name : merchant.username;
-			},
-			getEquipmentTitle(equipment) {
-				return equipment.name ? equipment.name : '暂无名称';
-			},
-			getEquipmentListData() {
-				this.getEquipmentListByUser(this.globalUser)
-					.then(data => {
-						this.merchantList = data;
-						var listName = data[0].equipmentList;
-						var times = new Map;
-						// if (this.input == 1) {
-						// 	for (var i = 0; i < listName.length; i++) {
-						// 		var k = listName[i].id;
-						// 		times.set(k, null);
-						// 	}
-						// 	this.timeAll = times;
-						// }
-						var listId = data[0].id;
-						if (listId != null && listId != '1') {
-							uni.setStorageSync("listName", listName);
-						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			OnOff(id, code) {
-				var that = this;
-				var ddd = this.timeAll.get(id);
-				if (that.timeAll.get(id) != null) {
-					var stamp = Date.parse(new Date());
-					var t = (stamp - that.timeAll.get(id)) / 1000;
-					if (t < 30) {
-						var s = 30 - t;
-						uni.showModal({
-							title: that.$t('equipmentStatusList.onoff'),
-							content: that.$t('equipmentStatusList.remainingtime') + s + "s",
-							success: function(res) {
-								that.getEquipmentListData();
-							}
-						});
-						return;
-					}
-				}
-				var code1 = code;
-				if (code1 == 0) {
-					uni.showModal({
-						title: that.$t('equipmentStatusList.tip'),
-						content: that.$t('equipmentStatusList.onoffTip'),
-						success: function(res) {
-							if (res.confirm) {
-								var serverurl = that.serverurl;
-								var code2 = code1;
-								var equipmentId = id;
-								var token = uni.getStorageSync("token");
-								uni.request({
-									url: serverurl + '/TEquipment/onOff',
-									data: {
-										"adminId": code2,
-										"equipmentId": equipmentId
-									},
-									method: "POST",
-									header:{
-										'token':token
-									},
-									success: (res) => {
-										var list = res.data.data;
-										// that.input = 2;
-										var timestamp = Date.parse(new Date());
-										that.timeAll.set(id, timestamp);
-										var oo = that.timeAll;
-										// that.time = timestamp;
-										that.getEquipmentListData();
-										if (list == 'SUCCESS') {
-											uni.showModal({
-												title: that.$t('equipmentStatusList.guanji'),
-												content: that.$t('equipmentStatusList.tishi'),
-												success: function(res) {
-													that.getEquipmentListData();
-													setTimeout(function () {
-													    that.network(id);
-													}, 7000);
-												}
-											})
-										} else {
-											uni.showModal({
-												title: that.$t('equipmentStatusList.error'),
-												content: that.$t('equipmentStatusList.guanjierror'),
-												success: function(res) {
-													that.onffChecked = true;
-													that.getEquipmentListData();
-												}
-											})
-										}
-			
-									}
-								});
-							} else if (res.cancel) {
-								that.onffChecked = false;
-								that.getEquipmentListData();
-							}
-						}
-					});
-				} else {
-					var serverurl = that.serverurl;
-					var code = code;
-					var equipmentId = id;
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: serverurl + '/TEquipment/onOff',
-						data: {
-							"adminId": code,
-							"equipmentId": equipmentId
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							// that.input = 2;
-							var list = res.data.data;
-							that.getEquipmentListData();
-							var timestamp = Date.parse(new Date());
-							that.timeAll.set(id, timestamp);
-							var oo = that.timeAll;
-							// that.time = timestamp;
-							if (list == "SUCCESS") {
-								uni.showModal({
-									title: that.$t('equipmentStatusList.kaiji'),
-									content: that.$t('equipmentStatusList.tishi'),
-									success: function(res) {
-										that.getEquipmentListData();
-										setTimeout(function () {
-										    that.network(id);
-										}, 7000);
-									}
-								})
-							} else {
-								uni.showModal({
-									title: that.$t('equipmentStatusList.error'),
-									content: that.$t('equipmentStatusList.kaijierror'),
-									success: function(res) {
-										that.onffChecked = false;
-										that.getEquipmentListData();
-									}
-								})
-							}
-			
-						}
-					});
-				}
-			},
-			network(id){
-				var token = uni.getStorageSync("token");
-				var equipmentId = id;
-				uni.request({
-					url: this.serverurl + '/TEquipment/checkStatus',
-					data: {
-						"equipmentId": id
-					},
-					method: "POST",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						var data = res.data.data;
-						if(data=='fail'){
-							uni.showToast({
-							    title: this.$t('equipmentStatusList.network'),
-								icon:'none',
-							    duration: 3000
-							});
-							this.getEquipmentListData();
-						}
-					}
-				});
-			},
-			openDoor(id) {
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TEquipment/openDoor',
-					data: {
-						"equipmentId": id
-					},
-					method: "POST",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						uni.showModal({
-							title: this.$t('equipmentStatusList.open'),
-							content: this.$t('equipmentStatusList.opensuccess'),
-							success: function(res) {
-			
-							}
-						})
-					}
-				});
-			},
-			change(id, code) {
-				var that = this;
-				var code1 = code;
-				if (code1 == 1) {
-					uni.showModal({
-						title: that.$t('equipmentStatusList.tip'),
-						content: that.$t('equipmentStatusList.sleepTip'),
-						success: function(res) {
-							if (res.confirm) {
-								var serverurl = that.serverurl;
-								var code2 = code1;
-								var equipmentId = id;
-								var token = uni.getStorageSync("token");
-								uni.request({
-									url: serverurl + '/TEquipment/sleep',
-									data: {
-										"adminId": code2,
-										"equipmentId": equipmentId
-									},
-									method: "POST",
-									header:{
-										'token':token
-									},
-									success: (res) => {
-										var list = res.data.data;
-										that.getEquipmentListData();
-									}
-								});
-							} else if (res.cancel) {
-								that.sleepChecked = false;
-								that.getEquipmentListData();
-							}
-						}
-					});
-				} else {
-					var serverurl = that.serverurl;
-					var code = code;
-					var equipmentId = id;
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: serverurl + '/TEquipment/sleep',
-						data: {
-							"adminId": code,
-							"equipmentId": equipmentId
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							var list = res.data.data;
-							that.getEquipmentListData();
-						}
-					});
-				}
-			},
-		}
-	}
-</script>
-<style>
-	page {
-		/* background: #F2F2F2; */
-		background: #FFFFFF;
-		width: 750upx;
-		overflow-x: hidden;
-	}
-
-	.head {
-		display: flex;
-		flex-direction: row;
-		background: #206DC3;
-		width: 750upx;
-		height: 180upx;
-	}
-
-	.company {
-		width: 48%;
-		text-align: right;
-	}
-
-	.pname {
-		display: flex;
-		flex-direction: row;
-		width: 40%;
-	}
-
-	.userFlagimg {
-		padding-left: 30upx;
-		padding-top: 10upx;
-		width: 26upx;
-		height: 28upx;
-	}
-
-	.wenzi {
-		padding-left: 5upx;
-		/* text-align:right; */
-		white-space: nowrap;
-		overflow: hidden;
-		/* text-overflow: ellipsis; */
-	}
-
-	.ri {
-		width: 690upx;
-		height: 180upx;
-		background: #FFFFFF;
-		border-radius: 15upx;
-		/* 上移 */
-		transform: translateY(-90upx);
-		text-align: center;
-		margin: auto;
-		display: flex;
-		flex-direction: row;
-		/* 阴影 */
-		box-shadow: 0upx -1upx 20upx #D3D3D3;
-		/* box-shadow:0px 0px  10px 5px #aaa; */
-	}
-
-	.riShell {
-		display: flex;
-		flex-direction: row;
-		margin: auto;
-	}
-
-	.riTitle {
-		display: flex;
-		flex-direction: column;
-		margin: auto;
-	}
-
-	.riqi {
-		display: flex;
-		flex-direction: column;
-		margin: auto;
-	}
-
-	.fourTitle {
-		width: 690upx;
-		height: 294upx;
-		display: flex;
-		flex-direction: row;
-		flex-wrap: wrap;
-		background: #FFFFFF;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		margin: auto;
-		border-radius: 15upx;
-		transform: translateY(-60upx);
-	}
-
-	.four {
-		display: flex;
-		flex-direction: row;
-		margin: auto;
-		width: 48%;
-	}
-
-	.fourImg {
-		width: 54upx;
-		height: 54upx;
-	}
-
-	.qiun-padding {
-		padding: 2%;
-		width: 96%;
-	}
-
-	.qiun-wrap {
-		display: flex;
-		flex-wrap: wrap;
-	}
-
-	.qiun-rows {
-		display: flex;
-		flex-direction: row !important;
-	}
-
-	.fontLeft {
-		margin-right: 6upx;
-	}
-	/* 参数表 */
-	.status-css {
-		position: absolute;
-		width: 30upx;
-		height: 30upx;
-		right: 86upx;
-		top: 30upx;
-		border-radius: 30upx;
-		color: "#596D83";
-		font-size: 12upx;
-	}
-	
-	.status-error {
-		background-color: #dd524d
-	}
-	
-	.status-normal {
-		background-color: #4cd964
-	}
-	
-	.baojing {
-		padding-left: 120upx;
-	}
-	
-	.titleFlag {
-		height: 56upx;
-		background-color: #F8F8F8;
-		color: #8C959F;
-		font-size: 22upx;
-		display: flex;
-		flex-direction: row;
-	}
-	
-	.opendoor {
-		/* #ifdef H5 */
-		
-		/* #endif */
-		padding-top: 10upx;
-		padding-bottom: 10upx;
-		/* text-align: center; */
-		display: flex;
-		flex-direction: row;
-	}
-	
-	.button {
-		/* #ifdef H5 */
-		text-align: center;
-		height: 50upx;
-		weight:20upx ;
-		/* #endif */
-		padding-left: 15upx;
-		/* padding-top: 2upx; */
-	}
-	
-	.p {
-		/* #ifdef H5 */
-		font-size: 28upx;
-		height: 50upx;
-		weight:20upx ;
-		transform: translateY(-14upx);
-		/* text-align: center; */
-		/* #endif */
-		/* padding-bottom: 50upx; */
-		text-align: center;
-		padding-left: 13upx;
-	}
-	
-	.img {
-		padding-top: 20upx;
-		padding-left: 30upx;
-		width: 15upx;
-		height: 15upx;
-	}
-	
-	.wenziT {
-		padding-top: 10upx;
-		padding-left: 10upx;
-	}
-	
-	.titlelist {
-		color: #363D44;
-		font-size: 16upx;
-		font-family: "PingFang-SC-Medium";
-	}
-	
-	.swithBox {
-		display: flex;
-		flex-direction: row;
-		padding-bottom: 15upx;
-		padding-top: 5upx;
-	}
-	
-	.switch {
-		width: 44upx;
-		height: 22upx;
-	}
-	
-	.swichFont {
-		width: 85%;
-		padding-top: 12upx;
-	}
-	
-	.line1 {
-		width: 100%;
-		height: 3upx;
-		background: #000000;
-	}
-</style>

+ 52 - 0
pages/Insert/Insert.vue

@@ -0,0 +1,52 @@
+<template>
+	<view>
+			<uni-list>
+				<uni-list-item title="整机录入"  @click="machine()" ></uni-list-item>
+				<uni-list-item title="模块录入"  @click="modules()" ></uni-list-item>
+			</uni-list>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
+	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
+	import uniList from '@/components/uni-list/uni-list.vue'
+	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
+	import {
+		dateUtils
+	} from '@/common/util.js';
+	export default {
+		components: {
+			uniCollapse,
+			uniCollapseItem,
+			uniList,
+			uniListItem,
+		},
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			machine(){
+				uni.navigateTo({
+					url: 'addMachine',
+				});
+			},
+			modules(){
+				uni.navigateTo({
+					url: 'addModules',
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

File diff suppressed because it is too large
+ 1167 - 0
pages/Insert/addMachine.vue


+ 228 - 0
pages/Insert/addModules.vue

@@ -0,0 +1,228 @@
+<template>
+	<view>
+		<form @submit="add">
+			<view class="body">
+				<input class="input" style="display:none;" name="coding" :value=coding />
+				编码:<input class="input" v-model="coding"  />
+				<button type="primary" @click="saoma()"  class="button1">
+					<p  class="p">扫码</p>
+				</button>
+				<button type="primary" @click="getMessage(coding)" class="button1">
+					<p  class="p">获取</p>
+				</button>
+			</view>
+			<view class="body">
+				名称:<input class="input" name="name" :value="name"   />
+			</view>
+			<view class="body">
+				版本号:<input class="input" name="versions" :value="versions"   />
+			</view>
+			<view  class="body">
+				生产人员:<input class="input" name="producePersonnel" :value="producePersonnel"  readonly="readonly"/>
+			</view>
+			<timeSelector showType="date" @btnConfirm="btnConfirm0" @btnCancel="btnCancel0">
+				<view class="body">
+					生产日期:<input type="text" class="input" name="produceDate" :value="produceDate"  />
+				</view>
+			</timeSelector>
+			<view class="title">配件</view>
+			<view class="lis" v-for="item in desList" >
+				{{item}}
+			</view>
+			
+			<view class="">
+				<button type="primary" formType="submit" class="button">
+					<p  class="p1">提交</p>
+				</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex';
+	import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
+	export default {
+		components: {
+			timeSelector
+		},
+		data() {
+			return {
+				produceDate:'',
+				coding:null,
+				name:null,
+				versions:null,
+				producePersonnel:null,
+				desList:{}
+			}
+		},
+		methods: {
+			btnConfirm0(e) {
+				// console.log('确定时间为:', e);
+				this.produceDate = e.key;
+			},
+			btnCancel0() {
+				this.produceDate = '';
+			},
+			saoma(){
+				var that = this;
+				// 允许从相机和相册扫码
+				uni.scanCode({
+				    success(res) {
+				        // console.log('条码类型:' + res.scanType);
+				        // console.log('条码内容:' + res.result);
+						that.coding = res.result;
+				    }
+				});
+			},
+			getMessage(coding){
+				console.log("a");
+				var that = this;
+				var serverUrl = that.serverurl;
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: serverUrl + "/TModules/getMessage?coding="+coding,
+					method: "GET",
+					header: {
+						'token': token
+					},
+					success: (Result) => {
+						console.log("1");
+						var res = Result;
+						if(res.data.code==true){
+							var codes = res.data.data;
+						that.name = codes.name;
+						that.versions = codes.versions
+						that.produceDate = codes.createDate;
+						that.producePersonnel = uni.getStorageSync("name");
+						that.desList = codes.flagCode.split(",");
+						}else{
+							uni.showModal({
+								content: res.data.message,
+							});
+						}
+					}
+				});
+			},
+			add(event) {
+				var serverUrl = this.serverurl;
+				const {
+					value: modules
+				} = event.detail;
+				console.log("2");
+					var token = uni.getStorageSync("token");
+					uni.request({
+						url: serverUrl + "/TModules/add",
+						method: "POST",
+						data:{
+							"coding":modules.coding,
+							"name":modules.name,
+							"producePersonnel":modules.producePersonnel
+						},
+						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%);
+	}
+	.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%);
+	}
+	.radio {
+		padding-top: 20upx;
+		padding-left: 30upx;
+	}
+	.lis{
+		padding-left: 90upx;
+		font-size: 30upx;
+		padding-top: 5upx;
+	}
+	.title {
+		padding-left: 20upx;
+		font-size: 35upx;
+	}
+</style>

+ 105 - 0
pages/Insert/updateModules.vue

@@ -0,0 +1,105 @@
+<template>
+	<view>
+		<form @submit="updata">
+			<view class="body">
+				更换原因:<textarea class="input-two" name="replaceReason" />
+				</view>
+		<view class="">
+			<button type="primary" formType="submit" class="button">
+				<p class="p">提交</p>
+			</button>
+		</view>
+	
+	</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			updata(event) {
+				var serverUrl = this.serverurl;
+				const {
+					value: modules
+				} = event.detail;
+				var token = uni.getStorageSync("token");
+				var coding = uni.getStorageSync("updateModules");
+				var machineCoding = uni.getStorageSync("updateMachineCode");
+				var personnel = uni.getStorageSync("name");
+				uni.request({
+					url: serverUrl + "/TModules/updateModules",
+					method: "POST",
+					data: {
+						"replaceReason": modules.replaceReason,
+						"coding": coding,
+						"machineCoding": machineCoding,
+						"replacePersonnel": personnel
+					},
+					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 25upx 20upx 20upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	.input-two{
+		padding-left: 20upx;
+		width: 450upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+	.p {
+		/* #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>

+ 5 - 4
pages/Login/Login.vue

@@ -6,7 +6,7 @@
 		</view>
 		<form @submit="loginSubmit">
 			<view class="section">
-				<input class="input-account" name="username" :placeholder="$t('login.username')" />
+				<input class="input-account" name="userName" :placeholder="$t('login.username')" />
 			</view>
 			<view class="section">
 				<input class="input-pwd" password name="password" :placeholder="$t('login.password')" />
@@ -75,7 +75,7 @@
 						//标记刚登录跳转
 						uni.setStorageSync('test', '1');
 						uni.reLaunch({
-							url: '/pages/Charts/mainStatistics',
+							url: '../select/select',
 						});
 					});
 			},
@@ -94,7 +94,7 @@
 						var code = loginResult.code;
 						var openid = "";
 						uni.request({
-							url: serverUrl+"/TWeixin/getOpenid?code="+code,
+							url: serverUrl+"/TUserWeixin/getOpenid?code="+code,
 							mothod: "GET",
 							success: (userResult) => {
 								openid = userResult.data.data;
@@ -133,9 +133,10 @@
 								// uni.setStorageSync("weixinInfo", weixinInfo);
 								uni.setStorageSync('test', '1');
 								uni.reLaunch({
-									url: '/pages/Charts/mainStatistics',
+									url: '../select/select',
 								});
 								uni.setStorageSync("globalUser", userInfo);
+								uni.setStorageSync("level", userInfo.level);
 							}
 						});
 				}

+ 6 - 5
pages/Login/loginWeixin.vue

@@ -6,7 +6,7 @@
 		</view>
 		<form @submit="loginwxSubmit">
 			<view class="section">
-				<input class="input-account" name="username" placeholder="请输入用户名" />
+				<input class="input-account" name="userName" placeholder="请输入用户名" />
 			</view>
 			<view class="section">
 				<input class="input-pwd" password name="password" placeholder="请输入密码" />
@@ -33,7 +33,7 @@
 				pname: '',
 				password: '',
 				parm: {
-					username: "",
+					userName: "",
 					password: "",
 					avatarUrl: "",
 					nickName: "",
@@ -59,11 +59,11 @@
 			loginwxSubmit(event) {
 				uni.hideKeyboard();
 				// const { value: loginForm } = event.detail;
-				var username = event.detail.value.username;
+				var userName = event.detail.value.userName;
 				var pass = event.detail.value.password;
 				var password = MD5(pass);
 				var serverUrl = this.serverurl;
-				this.parm['username'] = username;
+				this.parm['userName'] = userName;
 				this.parm['password'] = password;
 				this.parm['avatarUrl'] = this.avatarUrl;
 				this.parm['nickName'] = this.nickName;
@@ -76,9 +76,10 @@
 						var code = data.code;
 						uni.setStorageSync("token", data.token);
 						uni.setStorageSync("globalUser", weixinInfo);
+						uni.setStorageSync("level", weixinInfo.level);
 						if (code == true) {
 							uni.reLaunch({
-								url: '/pages/Charts/mainStatistics',
+								url: '../select/select',
 							});
 						}
 					}, _ => void uni.stopPullDownRefresh());

+ 0 - 146
pages/Setting/Setting.vue

@@ -1,146 +0,0 @@
-<template>
-	<view class="">
-		<uni-collapse :show-animation="true">
-			<view class="titlelist" style="position: relative;" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
-				<uni-collapse-item :title="getEquipmentTitle(equipment)">
-					<uni-list>
-						<uni-list-item title="使用统计" note="单台机器的使用次数统计" @click="useStatistics(equipment.id,equipment.name)" thumb="../../static/img/tongji.png"></uni-list-item>
-						<uni-list-item title="清洗规则" note="设定机器每天的清洗时间段(单台机器)" @click="rule(equipment.id,equipment.name,equipment.rule)" thumb="../../static/img/renwu.png"></uni-list-item>
-						<uni-list-item title="支付" note="按天数/次数支付(单台机器)" show-extra-icon="true" @click="pay(equipment.id,equipment.name)" thumb="../../static/img/pay.png"></uni-list-item>
-						<uni-list-item title="参数调整" thumb="../../static/img/canshu.png"  @click="paramters(equipment.id,equipment.name)"></uni-list-item>
-						<uni-list-item title="扫码测试" thumb="../../static/img/canshu.png"  @click="test()"></uni-list-item>
-					</uni-list>
-				</uni-collapse-item>
-			</view>
-		</uni-collapse>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import {
-		dateUtils
-	} from '@/common/util.js';
-	export default {
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem,
-		},
-		data() {
-			return {
-				globalUser: {},
-				merchantList: [{
-					equipmentList: []
-				}],
-				extraIcon: {
-					color: '#4cd964',
-					size: '22',
-					type: 'spinner'
-				},
-				statusNormal: 'status-normal',
-				statusError: 'status-error',
-				sleepChecked: null,
-				onffChecked: null,
-				time: null,
-				timeAll: {
-
-				},
-			}
-		},
-		computed: {
-			...mapState(['loginUser']),
-		},
-		onShow() {
-			this.globalUser = uni.getStorageSync("globalUser");
-			// uni.setNavigationBarTitle({
-			// 	title: this.$t('equipmentStatusList.title')
-			// });
-			// uni.setTabBarItem({
-			// 	index: 3,
-			// 	text: this.$t('tabs.tab4')
-			// });
-			var token = uni.getStorageSync("token");
-			if (token.length > 1) {
-				this.getEquipmentListData();
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-
-		},
-		methods: {
-			...mapActions('chart', ['getEquipmentListByUser']),
-			getEquipmentTitle(equipment) {
-				return equipment.name ? equipment.name : '暂无名称';
-			},
-			getEquipmentListData() {
-				this.getEquipmentListByUser(this.globalUser)
-					.then(data => {
-						this.merchantList = data;
-						var listName = data[0].equipmentList;
-						var listId = data[0].id;
-						if (listId != null && listId != '1') {
-							uni.setStorageSync("listName", listName);
-						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			useStatistics(equipmentId,equipmentName) {
-				uni.setStorageSync('nowEquipmentId', equipmentId);
-				uni.setStorageSync('nowEquipmentName', equipmentName);
-				uni.navigateTo({
-					url: 'singleStatistics',
-				});
-			},
-			rule(equipmentId,equipmentName,rule){
-				uni.setStorageSync('nowEquipmentId', equipmentId);
-				uni.setStorageSync('nowEquipmentName', equipmentName);
-				if(rule!=''){
-					uni.setStorageSync('nowEquipmentRule', rule);
-				}
-				
-				uni.navigateTo({
-					url: 'cleanRule',
-				});
-			},
-			pay(equipmentId,equipmentName){
-				uni.setStorageSync('nowEquipmentId', equipmentId);
-				uni.setStorageSync('nowEquipmentName', equipmentName);
-				uni.navigateTo({
-					url: 'pay',
-				});
-			},
-			paramters(equipmentId,equipmentName){
-				uni.setStorageSync('nowEquipmentId', equipmentId);
-				uni.setStorageSync('nowEquipmentName', equipmentName);
-				uni.navigateTo({
-					url: 'parameters',
-				});
-			},
-			test(){
-				uni.navigateTo({
-					url: 'saoma',
-				});
-			},
-		}
-	}
-</script>
-
-<style>
-	.titlelist {
-		color: #363D44;
-		font-size: 16upx;
-		font-family: "PingFang-SC-Medium";
-	}
-</style>

+ 0 - 248
pages/Setting/advancedParameters.vue

@@ -1,248 +0,0 @@
-<template>
-	<view class="">
-		<view class="line">
-
-		</view>
-		<!-- <view class="body">
-			<p class="p">X轴回零速度:</p>
-			<input class="input" type="text" v-model="D420" />
-			<button type="primary" class="button" @click="update('D-420',D420)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">X轴爬行速度:</p>
-			<input class="input" type="text" v-model="D421" />
-			<button type="primary" class="button" @click="update('D-421',D421)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">Y轴回零速度:</p>
-			<input class="input" type="text" v-model="D422" />
-			<button type="primary" class="button" @click="update('D-422',D422)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">Y轴爬行速度:</p>
-			<input class="input" type="text" v-model="D423" />
-			<button type="primary" class="button" @click="update('D-423',D423)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">E轴回零速度:</p>
-			<input class="input" type="text" v-model="D424" />
-			<button type="primary" class="button" @click="update('D-424',D424)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">E轴爬行速度:</p>
-			<input class="input" type="text" v-model="D425" />
-			<button type="primary" class="button" @click="update('D-425',D425)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view> -->
-		<view class="body">
-			<p class="p">X轴加速度:</p>
-			<input class="input" type="text" v-model="D426" />
-			<button type="primary" class="button" @click="update('D426',D426)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">X轴减速度:</p>
-			<input class="input" type="text" v-model="D427" />
-			<button type="primary" class="button" @click="update('D427',D427)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">Y轴加速度:</p>
-			<input class="input" type="text" v-model="D428" />
-			<button type="primary" class="button" @click="update('D428',D428)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">Y轴减速度:</p>
-			<input class="input" type="text" v-model="D429" />
-			<button type="primary" class="button" @click="update('D429',D429)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">E轴加速度:</p>
-			<input class="input" type="text" v-model="D430" />
-			<button type="primary" class="button" @click="update('D430',D430)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">E轴加速度:</p>
-			<input class="input" type="text" v-model="D431" />
-			<button type="primary" class="button" @click="update('D431',D431)">
-				<p class="p2">更新</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-	</view>
-</template>
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	export default {
-		data() {
-			return {
-				D420: 0,
-				D421: 0,
-				D422: 0,
-				D423: 0,
-				D424: 0,
-				D425: 0,
-				D426: 0,
-				D427: 0,
-				D428: 0,
-				D429: 0,
-				D430: 0,
-				D431: 0,
-			}
-		},
-		onShow() {
-			this.getParam();
-		},
-		methods: {
-			...mapActions('chart', ['getParameters', 'updateParameters']),
-			getParam() {
-				const param = {};
-				param['id'] = uni.getStorageSync("nowEquipmentId");
-				param['code'] = '1';
-				this.getParameters(param).then(data => {
-					var info = data;
-					if (info!=null||info!='') {
-						for (var i = 0; i < info.length; i++) {
-							if(info[i].name=='D-420'){
-								this.D420=info[i].val;
-							}
-							if(info[i].name=='D-421'){
-								this.D421=info[i].val;
-							}
-							if(info[i].name=='D-422'){
-								this.D422=info[i].val;
-							}
-							if(info[i].name=='D-423'){
-								this.D423=info[i].val;
-							}
-							if(info[i].name=='D-424'){
-								this.D424=info[i].val;
-							}
-							if(info[i].name=='D-425'){
-								this.D425=info[i].val;
-							}
-							if(info[i].name=='D-426'){
-								this.D426=info[i].val;
-							}
-							if(info[i].name=='D-427'){
-								this.D427=info[i].val;
-							}
-							if(info[i].name=='D-428'){
-								this.D428=info[i].val;
-							}
-							if(info[i].name=='D-429'){
-								this.D429=info[i].val;
-							}
-							if(info[i].name=='D-430'){
-								this.D430=info[i].val;
-							}
-							if(info[i].name=='D-431'){
-								this.D431=info[i].val;
-							}
-						}
-					}
-
-				}, _ => void uni.stopPullDownRefresh());
-			},
-			update(name, val) {
-				const param = {};
-				param['id'] = uni.getStorageSync("nowEquipmentId");
-				param['name'] = name;
-				param['val'] = val;
-				this.updateParameters(param).then(data => {
-					if (data == 'SUCCESS') {
-						uni.showToast({
-							title: '修改成功',
-							duration: 1000
-						});
-					}
-				}, _ => void uni.stopPullDownRefresh());
-			},
-		},
-	}
-</script>
-
-<style>
-	.line {
-		height: 50upx;
-	}
-
-	.line2 {
-		height: 10upx;
-	}
-
-	.body {
-		background-color: #FFFFFF;
-		width: 600upx;
-		padding: 10upx 10upx 10upx 10upx;
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		font-size: 32upx;
-	}
-
-	.p {
-		width: 200upx;
-		text-align: right;
-	}
-
-	.input {
-		width: 200upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-
-	.button {
-		width: 120upx;
-		height: 60upx;
-		text-align: left;
-		border-radius: 10upx;
-
-	}
-
-	.p2 {
-		font-size: 30upx;
-		/* #ifndef H5 */
-		padding-top: 3upx;
-		/* #endif */
-		position: absolute;
-		/* 水平居中 */
-		left: 50%;
-		-webkit-transform: translateX(-50%);
-		transform: translateX(-50%);
-	}
-</style>

+ 0 - 319
pages/Setting/cleanRule.vue

@@ -1,319 +0,0 @@
-<template>
-	<view class="content">
-		<view class="box-title">{{ title }}</view>
-		<timeSelector showType="time" @btnConfirm="btnConfirm0" @btnCancel="btnCancel0">
-			<view class="box-time">
-				<input type="text" class="input" :value="time0" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm1" @btnCancel="btnCancel1">
-			<view class="box-time">
-				<input type="text" class="input" :value="time1" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm2" @btnCancel="btnCancel2">
-			<view class="box-time">
-				<input type="text" class="input" :value="time2" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm3" @btnCancel="btnCancel3">
-			<view class="box-time">
-				<input type="text" class="input" :value="time3" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm4" @btnCancel="btnCancel4">
-			<view class="box-time">
-				<input type="text" class="input" :value="time4" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm5" @btnCancel="btnCancel5">
-			<view class="box-time">
-				<input type="text" class="input" :value="time5" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm6" @btnCancel="btnCancel6">
-			<view class="box-time">
-				<input type="text" class="input" :value="time6" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm7" @btnCancel="btnCancel7">
-			<view class="box-time">
-				<input type="text" class="input" :value="time7" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm8" @btnCancel="btnCancel8">
-			<view class="box-time">
-				<input type="text" class="input" :value="time8" />
-			</view>
-		</timeSelector>
-		<timeSelector showType="time" @btnConfirm="btnConfirm9" @btnCancel="btnCancel9">
-			<view class="box-time">
-				<input type="text" class="input" :value="time9" />
-			</view>
-		</timeSelector>
-
-		<view class="bu">
-			<button type="primary" @click="submit()" class="button">
-				<p class="p">提交</p>
-			</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex';
-	import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
-	export default {
-		components: {
-			timeSelector
-		},
-		data() {
-			return {
-				title: '当前定时清洗时间',
-				time0: '',
-				time1: '',
-				time2: '',
-				time3: '',
-				time4: '',
-				time5: '',
-				time6: '',
-				time7: '',
-				time8: '',
-				time9: ''
-			};
-		},
-		onLoad() {
-			var rule = uni.getStorageSync("nowEquipmentRule");
-			var rules = rule.split(",");
-			if(rules.length>0){
-				for(var i=0;i<rules.length;i++){
-					switch (i) {
-					    case 0:
-					        this.time0=rules[i];
-					        break;
-					    case 1:
-					        this.time1=rules[i];
-					         break;
-					    case 2:
-					        this.time2=rules[i];
-					         break;
-					    case 3:
-					        this.time3=rules[i];
-					         break;
-					    case 4:
-					        this.time4=rules[i];
-					         break;
-					    case 5:
-					        this.time5=rules[i];
-					         break;
-					    case 6:
-					        this.time6=rules[i];
-							break;
-						case 7:
-						    this.time7=rules[i];
-						    break;
-						case 8:
-						    this.time8=rules[i];
-						    break;
-						case 9:
-						    this.time9=rules[i];
-						    break;
-					} 
-				}
-			}
-		},
-		onShow() {
-			
-		},
-		methods: {
-			...mapActions('chart', ['updateRule']),
-			btnConfirm0(e) {
-				console.log('确定时间为:', e);
-				this.time0 = e.key;
-			},
-			btnCancel0() {
-				this.time0 = '';
-			},
-
-			btnConfirm1(e) {
-				this.time1 = e.key;
-			},
-			btnCancel1() {
-				this.time1 = '';
-			},
-
-			btnConfirm2(e) {
-				this.time2 = e.key;
-			},
-			btnCancel2() {
-				this.time2 = '';
-			},
-
-			btnConfirm3(e) {
-				this.time3 = e.key;
-			},
-			btnCancel3() {
-				this.time3 = '';
-			},
-
-			btnConfirm4(e) {
-				this.time4 = e.key;
-			},
-			btnCancel4() {
-				this.time4 = '';
-			},
-
-			btnConfirm5(e) {
-				this.time5 = e.key;
-			},
-			btnCancel5() {
-				this.time5 = '';
-			},
-
-			btnConfirm6(e) {
-				this.time6 = e.key;
-			},
-			btnCancel6() {
-				this.time6 = '';
-			},
-
-			btnConfirm7(e) {
-				this.time7 = e.key;
-			},
-			btnCancel7() {
-				this.time7 = '';
-			},
-
-			btnConfirm8(e) {
-				this.time8 = e.key;
-			},
-			btnCancel8() {
-				this.time8 = '';
-			},
-
-			btnConfirm9(e) {
-				this.time9 = e.key;
-			},
-			btnCancel9() {
-				this.time9 = '';
-			},
-			submit() {
-				var rules = [];
-				if (this.time0 != '') {
-					rules.push(this.time0);
-				}
-				if (this.time1 != '') {
-					rules.push(this.time1);
-				}
-				if (this.time2 != '') {
-					rules.push(this.time2);
-				}
-				if (this.time3 != '') {
-					rules.push(this.time3);
-				}
-				if (this.time4 != '') {
-					rules.push(this.time4);
-				}
-				if (this.time5 != '') {
-					rules.push(this.time5);
-				}
-				if (this.time6 != '') {
-					rules.push(this.time6);
-				}
-				if (this.time7 != '') {
-					rules.push(this.time7);
-				}
-				if (this.time8 != '') {
-					rules.push(this.time8);
-				}
-				if (this.time9 != '') {
-					rules.push(this.time9);
-				}
-				var rule;
-				if (rules.length > 0) {
-					rule = rules.join(",");
-				}
-
-				const param = {};
-				var equipmentId = uni.getStorageSync("nowEquipmentId");
-				if (equipmentId != '') {
-					param['equipmentId'] = equipmentId;
-				}
-				if (rule != '') {
-					param['rule'] = rule;
-				}
-				return this.updateRule(param)
-					.then(data => {
-						if (data == "SUCCESS") {
-							uni.showToast({
-								title: "修改成功",
-								icon: 'none',
-								duration: 1000
-							});
-						}
-						if (data == "ERROR") {
-							uni.showToast({
-								title: "修改失败",
-								icon: 'none',
-								duration: 1000
-							});
-						}
-						if (data == "") {
-							uni.showToast({
-								title: "修改异常",
-								icon: 'none',
-								duration: 1000
-							});
-						}
-					}, _ => void uni.stopPullDownRefresh());
-			},
-		}
-	};
-</script>
-
-<style>
-	.box-title {
-		margin: 24rpx;
-		font-size: 40rpx;
-		font-weight: bold;
-		color: #333333;
-		padding-left: 40upx;
-	}
-
-	.box-time {
-		margin: 24rpx;
-		font-size: 30rpx;
-		color: #3496fb;
-		padding-top: 10upx;
-		padding-left: 40upx;
-	}
-
-	.input {
-		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
-		background-color: #FFFFFF;
-		width: 600upx;
-		height: 50upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-
-	.bu {
-		font-size: 50upx
-	}
-
-	.button {
-		width: 220upx;
-		height: 100upx;
-	}
-
-	.p {
-		/* transform: translateY(-8upx); */
-		font-size: 50upx
-	}
-</style>

+ 0 - 171
pages/Setting/dayPay.vue

@@ -1,171 +0,0 @@
-<template>
-	<view class=" ">
-		<view class="font header">
-			价格:{{price}}元/天
-		</view>
-		<view class="font header">
-			<view class="font">
-				你要购买的数量:
-			</view>
-			<view class="input-two">
-				<input type="text" class="input" v-model="num" />
-			</view>
-			<view class="font3">
-				天
-			</view>
-		</view>
-		<view class="font2 header">
-			合计:{{num*price}}元
-		</view>
-		<view class="button">
-			<button type="primary" @click="buy()" class="button2">
-				<p class="p">购买</p>
-			</button>
-		</view>
-		<font class="font1">{{title}}</font>
-		<view class="" style="margin: auto;">
-			<!-- <font class="font1">{{title}}</font> -->
-			<image class="" :src=img mode=""></image>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	export default {
-		data() {
-			return {
-				price: '',
-				num: '10',
-				title: '',
-				img: null
-			}
-		},
-		onLoad() {},
-		onShow() {
-			this.findPrice();
-		},
-		methods: {
-			...mapActions('chart', ['getPrice', 'pay']),
-			findPrice() {
-				var name = "dayPay";
-				this.getPrice(name)
-					.then(data => {
-						this.price = data;
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			buy() {
-				var p = this.price;
-				var n = this.num;
-				var pri = p * n;
-				if (pri == 0) {
-					uni.showModal({
-						content: '请选择数量',
-						showCancel: false
-					});
-					return null;
-				}
-				const param = {};
-				param['price'] = pri;
-				param['type'] = "0";
-				param['equipmentId'] = uni.getStorageSync("nowEquipmentId");
-				param['adminId'] = uni.getStorageSync("globalUser").id;
-				this.pay(param).then(data => {
-					this.title = "请用微信扫码支付";
-					this.img = data;
-				}, _ => void uni.stopPullDownRefresh());
-			},
-		},
-
-	}
-</script>
-
-<style>
-	.header {
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		padding-left: 20upx;
-	}
-
-	.font {
-		padding-top: 20upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-
-	.font2 {
-		padding-top: 40upx;
-		padding-bottom: 30upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-
-	.font3 {
-		padding-left: 30upx;
-		padding-top: 23upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-
-	.input-two {
-		width: 80upx;
-		height: 30upx;
-		padding-top: 23upx;
-		padding-left: 30upx;
-	}
-
-	.input {
-		padding-left: 20upx;
-
-		background-color: #FFFFFF;
-		width: 80upx;
-		height: 30upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-
-	.button {
-		padding-top: 70upx;
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-
-	.button2 {
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-
-	.p {
-		padding-top: 2upx;
-		margin: 0 auto;
-		font-size: 45upx;
-		font-family: "PingFang-SC-Bold";
-	}
-
-	.font1 {
-		color: #F4AE1B;
-		padding-left: 300upx;
-		padding-top: 100upx;
-		font-size: 25upx;
-		font-family: "PingFang-SC-Bold";
-	}
-
-	.img {
-		height: 600upx;
-		weight: 600upx;
-		margin: auto;
-	}
-</style>

+ 0 - 247
pages/Setting/generalParameters.vue

@@ -1,247 +0,0 @@
-<template>
-	<view class="">
-		<view class="line">
-
-		</view>
-		<view class="body">
-			<p class="p">自测试模式</p>
-			<!-- <input class="input" type="text" v-model="M17" /> -->
-			<!-- <button type="primary" class="button" @click="update('M-17',M17)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M17','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M17','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">A轴正转</p>
-			<!-- <input class="input" type="text" v-model="M311" /> -->
-			<button type="primary" class="button" @click="update('M311','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M311','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">A轴反转</p>
-			<!-- <input class="input" type="text" v-model="M312" />
-			<button type="primary" class="button" @click="update('M-312',M312)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M312','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M312','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">喷水泵启动</p>
-			<!-- <input class="input" type="text" v-model="M313" />
-			<button type="primary" class="button" @click="update('M-313',M313)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M313','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M313','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">气泵启动</p>
-			<!-- <input class="input" type="text" v-model="M315" />
-			<button type="primary" class="button" @click="update('M-315',M315)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M315','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M315','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">清洁消毒喷水泵</p>
-			<!-- <input class="input" type="text" v-model="M316" />
-			<button type="primary" class="button" @click="update('M-316',M316)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M316','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M316','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">清洗洁厕灵+水</p>
-			<!-- <input class="input" type="text" v-model="M317" />
-			<button type="primary" class="button" @click="update('M-317',M317)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M317','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M317','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-		<view class="line2"></view>
-		<view class="body">
-			<p class="p">消毒液+水</p>
-			<!-- <input class="input" type="text" v-model="M318" /> -->
-			<!-- <button type="primary" class="button" @click="update('M-318',M318)">
-				<p class="p2">更新</P>
-			</button> -->
-			<button type="primary" class="button" @click="update('M318','0')">
-				<p class="p2">启动</P>
-			</button>
-			<button type="primary" class="button" @click="update('M318','1')">
-				<p class="p2">关闭</P>
-			</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	export default {
-		data() {
-			return {
-				M17: 0,
-				M311: 0,
-				M312: 0,
-				M313: 0,
-				M315: 0,
-				M316: 0,
-				M317: 0,
-				M318: 0,
-			}
-		},
-		onShow() {
-			this.getParam();
-		},
-		methods: {
-			...mapActions('chart', ['getParameters', 'updateParameters']),
-			getParam() {
-				const param = {};
-				param['id'] = uni.getStorageSync("nowEquipmentId");
-				param['code'] = '0';
-				this.getParameters(param).then(data => {
-					var info = data;
-					if (info!=null||info!='') {
-						for (var i = 0; i < info.length; i++) {
-							if(info[i].name=='M-17'){
-								this.M17=info[i].val;
-							}
-							if(info[i].name=='M-311'){
-								this.M311=info[i].val;
-							}
-							if(info[i].name=='M-312'){
-								this.M312=info[i].val;
-							}
-							if(info[i].name=='M-313'){
-								this.M313=info[i].val;
-							}
-							if(info[i].name=='M-315'){
-								this.M315=info[i].val;
-							}
-							if(info[i].name=='M-316'){
-								this.M316=info[i].val;
-							}
-							if(info[i].name=='M-317'){
-								this.M317=info[i].val;
-							}
-							if(info[i].name=='M-318'){
-								this.M318=info[i].val;
-							}
-						}
-					}
-			
-				}, _ => void uni.stopPullDownRefresh());
-			},
-			update(name, val) {
-				const param = {};
-				param['id'] = uni.getStorageSync("nowEquipmentId");
-				param['name'] = name;
-				param['val'] = val;
-				this.updateParameters(param).then(data => {
-					if (data == 'SUCCESS') {
-						uni.showToast({
-							title: '修改成功',
-							duration: 1000
-						});
-					}
-				}, _ => void uni.stopPullDownRefresh());
-			},
-		},
-	}
-</script>
-
-<style>
-	.line {
-		height: 50upx;
-	}
-
-	.line2 {
-		height: 10upx;
-	}
-
-	.body {
-		padding-top: 10upx;
-		background-color: #FFFFFF;
-		width: 550upx;
-		padding: 10upx 10upx 10upx 10upx;
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		font-size: 32upx;
-	}
-
-	.p {
-		width: 250upx;
-		padding-top: 3upx;
-		text-align: right;
-	}
-
-	.input {
-		width: 200upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-
-	.button {
-		width: 120upx;
-		height: 60upx;
-		text-align: left;
-		border-radius: 10upx;
-
-	}
-
-	.p2 {
-		font-size: 30upx;
-		/* #ifndef H5 */
-		padding-top: 3upx;
-		/* #endif */
-		position: absolute;
-		/* 水平居中 */
-		left: 50%;
-		-webkit-transform: translateX(-50%);
-		transform: translateX(-50%);
-	}
-</style>

+ 0 - 29
pages/Setting/parameters.vue

@@ -1,29 +0,0 @@
-<template>
-	<view class="">
-		<uni-list>
-			<uni-list-item title="通用参数"  @click="general()"></uni-list-item>
-			<uni-list-item title="进阶参数"  @click="advanced()"></uni-list-item>
-		</uni-list>
-	</view>
-</template>
-
-<script>
-	export default {
-		methods: {
-			general(){
-				uni.navigateTo({
-					url:'generalParameters',
-				});
-			},
-			advanced(){
-				uni.navigateTo({
-					url: 'advancedParameters',
-				});
-			},
-			
-		}
-	}
-</script>
-
-<style>
-</style>

+ 0 - 29
pages/Setting/pay.vue

@@ -1,29 +0,0 @@
-<template>
-	<view class="">
-		<uni-list>
-			<uni-list-item title="按天数购买"  @click="day()"></uni-list-item>
-			<uni-list-item title="按使用次数购买"  @click="times()"></uni-list-item>
-		</uni-list>
-	</view>
-</template>
-
-<script>
-	export default {
-		methods: {
-			day(){
-				uni.navigateTo({
-					url: 'dayPay',
-				});
-			},
-			times(){
-				uni.navigateTo({
-					url: 'timesPay',
-				});
-			},
-			
-		}
-	}
-</script>
-
-<style>
-</style>

+ 0 - 35
pages/Setting/saoma.vue

@@ -1,35 +0,0 @@
-
-<template>
-	<view>
-		<input class="input" type="text" v-model="date" />
-		<button type="primary" @click="tel()">扫描</button>
-	</view>
-</template>
- 
-<script>
-	export default {
-		data() {
-			return {
-				date: 0,
-			};
-		},		
-		methods:{
-			tel(){
-				var that = this;
-				// 允许从相机和相册扫码
-				uni.scanCode({
-				    success(res) {
-				        console.log('条码类型:' + res.scanType);
-				        console.log('条码内容:' + res.result);
-						that.date = res.result;
-				    }
-				});
-			},
-			
-		}
-	}
-</script>
- 
-<style>
- 
-</style>

+ 0 - 452
pages/Setting/singleStatistics.vue

@@ -1,452 +0,0 @@
-<template>
-	<view>
-		<view class="head">
-			<view class="">
-				<image class="userFlagimg" src="../../static/img/userFlag.png" mode=""></image>
-			</view>
-			<view class="pname">
-				<font class="wenzi" style="color: #BDD6F3;font-size:28upx"> {{$t('mainStatistics.name')}}: {{pnameData}}</font>
-			</view>
-			<view class="company">
-				<font style="color: #BDD6F3;font-size:28upx">{{$t('mainStatistics.company')}}</font>
-			</view>
-		</view>
-		<view class="ri">
-			<view class="riShell">
-				<view class="riImg">
-					<image style="width: 64upx;height: 64upx;padding-top: 20upx;" :src="$t('mainStatistics.dayImg')"></image>
-				</view>
-				<view class="riTitle">
-					<view style="text-align:left;font-size:28upx;font-family:PingFang-SC-Medium">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.dayTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{dayRandomTimes}}</font>
-					</view>
-					<view style="text-align:left;font-size:28upx;font-family:PingFang-SC-Medium">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.dayTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{dayRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-			<view class="riqi">
-				<view style="text-align:right" class="tody">
-					<font style="color: #596D83;">{{today}}</font>
-				</view>
-				<view style="text-align:right" class="xingqi">
-					<font style="color: #596D83;">{{week}}</font>
-				</view>
-			</view>
-		</view>
-		<view class="fourTitle">
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.weekImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.weekTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{weekRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.weekTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{weekRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.monthImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.monthTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{monthRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.monthTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{monthRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.yearImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.yearTotalMoney')}}:</font>
-						<font style="color: #ED341F;">{{yearRandomTimes}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.yearTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{yearRegularTimes}}</font>
-					</view>
-				</view>
-			</view>
-
-			<view class="four">
-				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.allImg')" mode=""></image>
-				</view>
-				<view class="fourShell">
-					<view class="one">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.machineTotalNum')}}:</font>
-						<font style="color: #ED341F;">{{machineTotalNum}}</font>
-					</view>
-					<view class="two">
-						<font class="fontLeft" style="color: #596D83;">{{$t('mainStatistics.machineUseNum')}}:</font>
-						<font style="color: #ED341F;">{{machineUseNum}}</font>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex';
-	// import uCharts from '@/components/u-charts/u-charts.js';
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import {
-		dateUtils
-	} from '@/common/util.js';
-	var _self;
-	export default {
-		name: 'mainStatistics',
-		props: {
-			equipmentId: '',
-			adminId: '',
-			pname: '',
-		},
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem,
-		},
-		data() {
-			return {
-				machineTotalNum: 0,
-				machineUseNum: 0,
-				dayRandomTimes: 0,
-				dayRegularTimes: 0,
-				weekRandomTimes: 0,
-				weekRegularTimes: 0,
-				monthRandomTimes: 0,
-				monthRegularTimes: 0,
-				yearRandomTimes: 0,
-				yearRegularTimes: 0,
-				today: '',
-				week: '',
-				pnameData:''
-			}
-		},
-
-		computed: {
-			...mapState(['loginUser']),
-			// pnameData: {
-			// 	get() {
-			// 		return this.pname;
-			// 	}
-			// },
-		},
-		onShow() {
-			
-			var equipmentId = uni.getStorageSync("nowEquipmentId");
-			if(equipmentId!=null||equipmentId!=''){
-				this.equipmentId=equipmentId;
-			}
-			var equipmentName = uni.getStorageSync("nowEquipmentName");
-			if(equipmentName!=null||equipmentName!=''){
-				this.pnameData=equipmentName;
-			}
-			var token = uni.getStorageSync("token");
-			if (token.toString().length > 1) {
-				this.init();
-
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-			// this.input = this.input + 1;
-			var test = uni.getStorageSync('test');
-			var globalUser = uni.getStorageSync("globalUser");
-			this.globalUser = globalUser;
-			if (globalUser.toString().length > 1) {
-				//判断是不是初次登陆
-				if (test == 2) {
-					this.init();
-				}
-			}
-			var id = this.adminId;
-
-			this.day();
-			// this.equipmentStatus();
-		},
-		mounted() {
-			var token = uni.getStorageSync("token");
-			if (token.toString().length > 1) {
-				this.init();
-			} else {
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-			// this.day();
-			this.equipmentStatus();
-		},
-		methods: {
-			...mapActions('chart', ['getStatistics', 'getMainStatistics', 'getMachineNum', 'getEquipmentListByUser']),
-			async init() {
-				if (!this.pname) {
-					this.pname = this.loginUser.name;
-				}
-				_self = this;
-				await this.getMainStatisticsData();
-				// await this.getEquipmentListData();
-				//初次登陆跳转后,把test变成2
-				uni.setStorageSync('test', '2');
-
-			},
-			day() {
-				var date = new Date();
-				// var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
-				var daystr = dateUtils.formateDate(date, 'yyyy-MM-dd');
-				this.today = daystr;
-				// var str= '星期'+'日一二三四五六'.charAt(date.getDay());
-				this.week = this.$t('mainStatistics.week' + date.getDay());
-
-			},
-			equipmentStatus() {
-				var id = uni.getStorageSync("globalUser").id;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TEquipment/equipmentStatus',
-					data: {
-						"adminId": id
-					},
-					header: {
-						'token': token
-					},
-					method: "POST",
-					success: (res) => {
-
-					},
-				});
-			},
-			getMainStatisticsData() {
-				const param = {};
-				if (this.adminId) { // 子组件,则拿传过来的参
-					param['adminId'] = this.adminId;
-				} else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
-					param['adminId'] = this.loginUser['id'];
-				}
-				var globalUser = uni.getStorageSync("globalUser");
-				if (globalUser.id != 1) {
-					if (param.adminId == null || param.adminId == undefined) {
-						param['adminId'] = globalUser.id;
-					}
-				}
-				if (this.equipmentId) {
-					param['equipmentId'] = this.equipmentId;
-				}
-				// console.log('getMainStatisticsData:{}', param);
-				var adminId = param.adminId;
-				var equipmentId = this.equipmentId;
-				var serverurl = this.serverurl;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: serverurl + '/TEquipment/getMachineNum',
-					data: {
-						"adminId": adminId,
-						"equipmentId": equipmentId
-					},
-					method: "POST",
-					header: {
-						'token': token
-					},
-					success: (res) => {
-						var list = res.data.data;
-						this.machineTotalNum = list[0];
-						this.machineUseNum = list[1];
-					}
-				});
-				return this.getMainStatistics(param)
-					.then(data => {
-						for (let bean of data) {
-							if (bean['categorie'] === 'day') {
-								if (bean['randomTimes'] != null) {
-									this.dayRandomTimes = bean['randomTimes'];
-								}
-								if (bean['regularTimes'] != null) {
-									this.dayRegularTimes = bean['regularTimes'];
-								}
-
-
-							}
-							if (bean['categorie'] === 'week') {
-								if (bean['randomTimes'] != null) {
-									this.weekRandomTimes = bean['randomTimes'];
-								}
-								if (bean['regularTimes'] != null) {
-									this.weekRegularTimes = bean['regularTimes'];
-								}
-
-
-							}
-							if (bean['categorie'] === 'month') {
-								if (bean['randomTimes'] != null) {
-									this.monthRandomTimes = bean['randomTimes'];
-								}
-								if (bean['regularTimes'] != null) {
-									this.monthRegularTimes = bean['regularTimes'];
-								}
-
-
-							}
-							if (bean['categorie'] === 'year') {
-								if (bean['randomTimes'] != null) {
-									this.yearRandomTimes = bean['randomTimes'];
-								}
-								if (bean['regularTimes'] != null) {
-									this.yearRegularTimes = bean['regularTimes'];
-								}
-
-
-							}
-						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
-			},
-		}
-	}
-</script>
-
-<style>
-	page {
-		/* background: #F2F2F2; */
-		background: #FFFFFF;
-		width: 750upx;
-		overflow-x: hidden;
-	}
-
-	.head {
-		display: flex;
-		flex-direction: row;
-		background: #206DC3;
-		width: 750upx;
-		height: 180upx;
-	}
-
-	.company {
-		width: 48%;
-		text-align: right;
-	}
-
-	.pname {
-		display: flex;
-		flex-direction: row;
-		width: 40%;
-	}
-
-	.userFlagimg {
-		padding-left: 30upx;
-		padding-top: 10upx;
-		width: 26upx;
-		height: 28upx;
-	}
-
-	.wenzi {
-		padding-left: 5upx;
-		/* text-align:right; */
-		white-space: nowrap;
-		overflow: hidden;
-		/* text-overflow: ellipsis; */
-	}
-
-	.ri {
-		width: 690upx;
-		height: 180upx;
-		background: #FFFFFF;
-		border-radius: 15upx;
-		/* 上移 */
-		transform: translateY(-90upx);
-		text-align: center;
-		margin: auto;
-		display: flex;
-		flex-direction: row;
-		/* 阴影 */
-		box-shadow: 0upx -1upx 20upx #D3D3D3;
-		/* box-shadow:0px 0px  10px 5px #aaa; */
-	}
-
-	.riShell {
-		display: flex;
-		flex-direction: row;
-		margin: auto;
-	}
-
-	.riTitle {
-		display: flex;
-		flex-direction: column;
-		margin: auto;
-	}
-
-	.riqi {
-		display: flex;
-		flex-direction: column;
-		margin: auto;
-	}
-
-	.fourTitle {
-		width: 690upx;
-		height: 294upx;
-		display: flex;
-		flex-direction: row;
-		flex-wrap: wrap;
-		background: #FFFFFF;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		margin: auto;
-		border-radius: 15upx;
-		transform: translateY(-60upx);
-	}
-
-	.four {
-		display: flex;
-		flex-direction: row;
-		margin: auto;
-		width: 48%;
-	}
-
-	.fourImg {
-		width: 54upx;
-		height: 54upx;
-	}
-
-	.qiun-padding {
-		padding: 2%;
-		width: 96%;
-	}
-
-	.qiun-wrap {
-		display: flex;
-		flex-wrap: wrap;
-	}
-
-	.qiun-rows {
-		display: flex;
-		flex-direction: row !important;
-	}
-
-	.fontLeft {
-		margin-right: 6upx;
-	}
-</style>

+ 0 - 162
pages/Setting/timesPay.vue

@@ -1,162 +0,0 @@
-<template>
-	<view class=" ">
-		<view class="font header">
-			价格:{{price}}元/次
-		</view>
-		<view class="font header">
-			<view class="font">
-				你要购买的数量:
-			</view>
-			<view class="input-two">
-				<input  type="text" class="input" v-model="num" />
-			</view>
-			<view class="font3">
-				次
-			</view>
-		</view>
-		<view class="font2 header">
-			合计:{{num*price}}元
-		</view>
-		<view class="button">
-			<button type="primary" @click="buy()" class="button2">
-				<p class="p">购买</p>
-			</button>
-		</view>
-		<font class="font1">{{title}}</font>
-		<view class="" style="margin: auto;">
-			<image class=""  :src=img mode=""></image>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	export default {
-		data() {
-			return {
-				price:'',
-				num:'10',
-				title:'',
-				img:null
-			}
-		},
-		onLoad() {
-		},
-		onShow() {
-			this.findPrice();
-		},
-		methods: {
-			...mapActions('chart', ['getPrice','pay']),
-			findPrice(){
-				var name = "timesPay";
-				this.getPrice(name)
-					.then(data => {
-						this.price = data;
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			buy(){
-				var p = this.price;
-				var n = this.num;
-				var pri = p*n;
-				if(pri==0){
-					uni.showModal({
-						content: '请选择数量',
-						showCancel: false
-					});
-					return null;
-				}
-				const param = {};
-				param['price'] = pri;
-				param['type'] = "1";
-				param['equipmentId'] = uni.getStorageSync("nowEquipmentId");
-				param['adminId'] = uni.getStorageSync("globalUser").id;
-				this.pay(param).then(data => {
-					this.title = "请用微信扫码支付";
-					this.img = data;
-				}, _ => void uni.stopPullDownRefresh());
-				
-			}
-		},
-
-	}
-</script>
-
-<style>
-	.header {
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		padding-left: 20upx;
-	}
-	.font{
-		padding-top: 20upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font2{
-		padding-top: 40upx;
-		padding-bottom: 30upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font3{
-		padding-left: 30upx;
-		padding-top: 23upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.input-two {
-		width: 80upx;
-		height: 30upx;
-		padding-top: 23upx;
-		padding-left: 30upx;
-	}
-	.input {
-		padding-left: 20upx;
-		
-		background-color: #FFFFFF;
-		width: 80upx;
-		height: 30upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-	.button{
-		padding-top: 70upx;
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-	.button2{
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-	.p{
-		padding-top: 2upx;
-		margin: 0 auto;
-		font-size: 45upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font1{
-		color: #F4AE1B;
-		padding-left: 300upx;
-		padding-top: 100upx;
-		font-size: 25upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.img{
-		height: 600upx;
-		weight:600upx;
-		margin: auto;
-	}
-</style>

+ 202 - 0
pages/User/addCode.vue

@@ -0,0 +1,202 @@
+<template>
+	<view class="">
+		<form @submit="addCode">
+			<view class="body">
+				名称:<input class="input" placeholder="如:炉头" name="name" :value=name />
+			</view>
+			<view class="body">
+				编码:<input class="input" name="code" />
+			</view>
+			<view class="title">配件</view>
+			<view class="body2">
+				<input class="input" name="flagCode1" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode2" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode3" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode4" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode5" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode6" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode7" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode8" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode9" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode10" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode11" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode12" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode13" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode14" />
+			</view>
+			<view class="body2">
+				<input class="input" name="flagCode15" />
+			</view>
+			<view class="body">
+				改动内容:<textarea class="input-two" name="remark" />
+				</view>
+			<view class="">
+				<button type="primary" formType="submit" class="button">
+					<p class="p">提交</p>
+				</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+
+	export default {
+
+		data() {
+			return {
+				name: '',
+				username: "",
+				parm: {
+					name: null,
+					id: null
+				},
+
+			};
+		},
+		onPullDownRefresh() {},
+		onShow() {
+			var token = uni.getStorageSync("token");
+			if (token.length > 1) {
+				var name = uni.getStorageSync("name");
+			} else {
+				uni.reLaunch({
+					url: '../Login/Login',
+				});
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			// ...mapActions('chart', ['updata']),
+			addCode(event) {
+				const {
+					value: code
+				} = event.detail;
+				    //首先获取到表单提交上来的值,此时input的name是不同的,为a0,a1,a2,a3...
+				    var eValue = event.detail.value;
+					let strMap = new Map();
+					  for (let k of Object.keys(eValue)) {
+					    strMap.set(k, eValue[k]);
+					  }
+				    //将value对象转为map
+				    var mapValue = strMap;
+				    //获取list,此处的目的为获取list的长度,并通过循环拼接需要取出的names列表
+					var aList = [];
+					for(var i = 1;i <=15;i++){
+						var ai = "flagCode" + i;
+						var a = mapValue.get(ai);
+						if(a!=""&&a!=null){
+							aList.push(a);
+						}
+					}
+					code.flagCode = aList.toString();
+			// console.log(aList);
+				this.$store.dispatch('addCode', code)
+					.then(_ => {
+						uni.showModal({
+							title: '提示',
+							content: _.message,
+						});
+
+					});
+
+			},
+		}
+	}
+</script>
+
+<style>
+	.body {
+		background-color: #FFFFFF;
+		padding: 20upx 25upx 20upx 20upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	.body2 {
+		background-color: #FFFFFF;
+		padding: 20upx 25upx 20upx 20upx;
+		padding-left: 100upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	.input {
+		/* padding: 10upx 20upx 10upx 0upx; */
+		padding-left: 20upx;
+		padding-top: 0upx;
+		background-color: #FFFFFF;
+		width: 500upx;
+		height: 50upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+	.input-two{
+		padding-left: 20upx;
+		width: 450upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+
+	.p {
+		/* #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%);
+	}
+	.title {
+		padding-left: 20upx;
+		font-size: 35upx;
+	}
+</style>

+ 0 - 183
pages/User/buyPromo.vue

@@ -1,183 +0,0 @@
-<template>
-	<view class=" ">
-		<view class="font header">
-			优惠码价格:{{price}}元/个
-		</view>
-		<view class="font header">
-			<view class="font">
-				你要购买的数量:
-			</view>
-			<view class="input-two">
-				<input  type="text" class="input" v-model="num" />
-			</view>
-			<view class="font3">
-				个
-			</view>
-		</view>
-		<view class="font2 header">
-			<view class="font">
-				有效期:
-			</view>
-			<view class="input-two">
-				<input  type="text" class="input" v-model="day" />
-			</view>
-			<view class="font3">
-				天.(最长90天)
-			</view>
-		</view>
-		<view class="font2 header">
-			合计:{{num*price}}元
-		</view>
-		<view class="button">
-			<button type="primary" @click="buy()" class="button2">
-				<p class="p">购买</p>
-			</button>
-		</view>
-		<view class="" style="margin: auto;">
-			<font class="font1">{{title}}</font>
-			<image class="img"  :src=img mode=""></image>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				price:null,
-				num:'10',
-				day:'30',
-				title:'',
-				img:null
-			}
-		},
-		onLoad() {
-		},
-		onShow() {
-			this.findPrice();
-		},
-		methods: {
-			findPrice(){
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TPromoCode/findPrice',
-					method: "GET",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						
-						this.price = res.data.data;
-					}
-				})
-			},
-			buy(){
-				if(this.day>90){
-					uni.showModal({
-						content: '有效期不能超过90天',
-						showCancel: false
-					});
-					return null;
-				}
-				var p = this.price;
-				var n = this.num;
-				var pri = p*n;
-				if(pri==0){
-					uni.showModal({
-						content: '价格为0',
-						showCancel: false
-					});
-					return null;
-				}
-				var globalUser = uni.getStorageSync("globalUser");
-				var id = globalUser.id;
-				uni.request({
-					url: this.serverurl + '/TPromoCode/buy?pri='+pri+'&adminId='+id+'&day='+this.day,
-					method: "GET",
-					success: (res) => {
-						var img = res.data.data;
-						this.title = "请用微信扫码支付";
-						this.img = img;
-					}
-				})
-			}
-		},
-
-	}
-</script>
-
-<style>
-	.header {
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		padding-left: 20upx;
-	}
-	.font{
-		padding-top: 20upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font2{
-		padding-top: 40upx;
-		padding-bottom: 30upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font3{
-		padding-left: 30upx;
-		padding-top: 23upx;
-		height: 70upx;
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.input-two {
-		width: 80upx;
-		height: 30upx;
-		padding-top: 23upx;
-		padding-left: 30upx;
-	}
-	.input {
-		padding-left: 20upx;
-		
-		background-color: #FFFFFF;
-		width: 80upx;
-		height: 30upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-	.button{
-		padding-top: 70upx;
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-	.button2{
-		margin: auto;
-		width: 80%;
-		height: 100upx;
-	}
-	.p{
-		padding-top: 2upx;
-		margin: 0 auto;
-		font-size: 45upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font1{
-		color: #F4AE1B;
-		padding-left: 300upx;
-		padding-top: 100upx;
-		font-size: 25upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.img{
-		height: 650upx;
-		weight:650upx;
-		margin: auto;
-	}
-</style>

+ 0 - 251
pages/User/equipmentName.vue

@@ -1,251 +0,0 @@
-<template>
-	<view class="">
-		<view class="xiugai">
-			{{$t('equipmentname.title')}}
-		</view>
-		<view v-for="(list,index) in listName" :key="index" class="body">
-			<view class="input-two">
-				<input :id=list.id type="text" class="input" @focus="setStyle()" @blur="setStyle2()" :value=list.name @input="getValue" />
-				<p id="p2" class="p2" :style="{display:showOrNo}">如:粤A张先生1</p>
-			</view>
-			<view class="button2">
-				<button type="primary" @click="updata1()" class="button">
-					<p class="p">{{$t('equipmentname.updata')}}</p>
-				</button>
-			</view>
-		
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	
-	export default {
-
-		data() {
-			return {
-				name: '',
-				show: false,
-				listName: [],
-				value: null,
-				id: null,
-				parm: {
-					name: null,
-					id: null
-				},
-				showOrNo: null,
-				avatarUrl: null,
-				weixinUp: false,
-				weixinDown: true
-			};
-		},
-		onPullDownRefresh() {
-			setTimeout(function() {
-				uni.stopPullDownRefresh();
-			}, 800);
-		},
-		onShow() {
-			uni.setNavigationBarTitle({title: this.$t('equipmentname.title')});
-			// uni.startPullDownRefresh();
-			var me = this;
-			var name = uni.getStorageSync("name");
-			me.name = name;
-			var listName = uni.getStorageSync("listName");
-			me.listName = listName;
-			if (listName != '' && listName != null) {
-				var adminId = listName[0].adminId;
-				if (adminId != '1' && adminId != null) {
-					me.show = true;
-				}
-			}
-			var newparm = uni.getStorageSync("newparm");
-			if (newparm.toString().length > 1) {
-				if (newparm.avatarUrl.length > 1) {
-					this.avatarUrl = newparm.avatarUrl;
-					this.weixinUp = true;
-					this.weixinDown = false;
-				}
-			}
-	
-		},
-		onLoad() {
-	
-		},
-		methods: {
-			setStyle() {
-				this.showOrNo = "block";
-			},
-			setStyle2() {
-				this.showOrNo = "none";
-			},
-			getValue: function(event) {
-				// 绕过v-model 获取input输入框的值  
-				var value = event.target.value;
-				var id = event.target.id;
-				this.value = value;
-				this.id = id;
-				this.parm.name = value;
-				this.parm.id = id;
-			},
-			...mapActions('chart', ['updata']),
-			updata1() {
-				if (this.parm.id != null) {
-					this.updata(this.parm)
-						.then(res => {
-							uni.showModal({
-								title: '提示',
-								content: '名称:' + this.parm.name + res.message,
-							});
-						}, _ => void uni.stopPullDownRefresh());
-				}
-	
-	
-			}
-		}
-	}
-</script>
-
-<style>
-
-
-	.settings {
-		width: 100upx;
-		height: 64upx;
-		border-radius: 10upx;
-		background: #D6101F;
-		/* padding-right: 50upx; */
-		/* padding-top: 5upx; */
-		text-align: center;
-		margin: 0 auto;
-	}
-	
-	.p3 {
-		/* #ifdef H5 */
-		top: -13%;
-		/* #endif */
-		font-size: 32upx;
-		color: #FFFFFF;
-		font-weight: bold;
-		width: 100upx;
-		height: 64upx;
-		/* #ifndef H5 */
-		padding-top: 3upx;
-		/* #endif */
-		position: absolute;
-		/* 水平居中 */
-		left: 50%;
-		-webkit-transform: translateX(-50%);
-		transform: translateX(-50%);
-	}
-	
-	.centerY {
-		position: absolute;
-		top: 50%;
-		-webkit-transform: translateY(-50%);
-		transform: translateY(-50%);
-	}
-	
-	.button2 {
-		padding-right: 60upx;
-		padding-top: 2upx;
-	}
-	
-	.button {
-		/* padding: 5upx 10upx 10upx 0upx; */
-		width: 120upx;
-		height: 60upx;
-		border-radius: 10upx;
-	}
-	
-	.p {
-		/* #ifdef H5 */
-		top: -13%;
-		/* #endif */
-		width: 80upx;
-		height: 60upx;
-		font-size: 30upx;
-		/* #ifndef H5 */
-		padding-top: 3upx;
-		/* #endif */
-	
-		position: absolute;
-		/* 水平居中 */
-		left: 50%;
-		-webkit-transform: translateX(-50%);
-		transform: translateX(-50%);
-	}
-	
-	.input {
-		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
-		background-color: #FFFFFF;
-		width: 500upx;
-		height: 50upx;
-		box-shadow: 0upx 0upx 20upx #D3D3D3;
-		border-radius: 5upx;
-	}
-	
-	.xiugai {
-		width: 92%;
-		border-left: 20upx;
-		border-left: 10upx solid #206DC3;
-		padding-left: 10upx;
-		height: 38upx;
-		padding-bottom: 20upx;
-		font-family: "PingFang-SC-Bold";
-		font-weight: bold;
-		margin: auto;
-		font-size: 32upx;
-		color: #363D44;
-	}
-	
-	.xiugai2 {
-		width: 100%;
-		height: 80upx;
-		font-family: "PingFang-SC-Bold";
-		font-weight: bold;
-		margin: auto;
-		font-size: 50upx;
-		color: #363D44;
-		position: fixed;
-		bottom: 0;
-	}
-	
-	.xiugai3 {
-		height: 80upx;
-		font-family: "PingFang-SC-Bold";
-		font-weight: bold;
-		margin: auto;
-		font-size: 40upx;
-		color: #363D44;
-	
-	}
-	
-	.body {
-		background-color: #FFFFFF;
-		padding: 10upx 10upx 10upx 10upx;
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-	}
-	
-	.input-two {
-		width: 600upx;
-		height: 100upx;
-		padding-left: 30upx;
-	}
-	
-	.p2 {
-		color: #DD524D;
-		display: none;
-		width: 600upx;
-		height: 50upx;
-		border: 1px;
-	}
-</style>

+ 0 - 98
pages/User/equipmentSratisticsList.vue

@@ -1,98 +0,0 @@
-<template>
-	<view v-if="merchantListSize>1">
-		<uni-collapse :accordion="true">
-			<uni-list>
-				<view  v-for="merchant in merchantList" :key="merchant.id">
-					<uni-list-item :title="getMerchantTitle(merchant)" @click="openEquipmentStatisticsByAdmin(merchant)"/>
-				</view>
-			</uni-list>
-		</uni-collapse>	
-	</view>
-	<view v-else>
-		<equipmentStatistics v-if="firstMerchantAdminId" :adminId="firstMerchantAdminId" style="padding: 20upx;"></equipmentStatistics>
-		<view v-else style="text-align: center;">暂无数据</view>
-	</view>
-</template>
-
-<script>
-    import {mapState,mapActions,mapMutations} from 'vuex'
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import {equipmentStatistics} from '@/pages/Charts/equipmentStatistics';
-    export default {
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem
-		},
-		data() {
-			return {
-				globalUser:{},
-				merchantList:[{equipmentList:[]}],
-				extraIcon: {
-					color: '#4cd964',
-					size: '22',
-					type: 'spinner'
-				}
-			}
-		},
-		computed: {
-			...mapState(['loginUser']),
-			firstMerchantAdminId:{
-				get(){
-					console.log('firstMerchantAdminId',this.merchantList[0].id)
-					return this.merchantList[0].id;
-				}
-			},
-			merchantListSize:{
-				get(){
-					console.log('merchantList1',this.merchantList.length)
-					return this.merchantList.length;
-				}
-			}
-		},
-		onShow(state){
-			this.globalUser = uni.getStorageSync("globalUser");
-			this.init();
-		},
-		onLoad(state){
-			// this.init();
-		},
-		onPullDownRefresh() {
-			this.init();
-		},
-		methods: {
-			...mapActions('chart', ['getEquipmentListByUser']),
-			async init(){
-				await this.getEquipmentListData();
-			},
-			openEquipmentStatisticsByAdmin(merchant){
-				const adminId = merchant.id;
-				const pname = merchant.name;
-				uni.navigateTo({
-					url: '/pages/Charts/equipmentStatistics?adminId=' + adminId+'&pname='+pname,
-				});
-			},
-			getMerchantTitle(merchant){
-				return merchant.name?merchant.name:merchant.username;
-			},
-			getEquipmentListData(){
-				// console.log('getEquipmentListData')
-				this.getEquipmentListByUser(this.globalUser)
-				.then(data => {
-					this.merchantList = data;
-					console.log('getEquipmentListData',this.merchantList)
-					uni.stopPullDownRefresh();
-				}
-				, _ => void uni.stopPullDownRefresh());
-			}
-		}
-    }
-</script>
-
-<style>
-	
-</style>

+ 0 - 583
pages/User/equipmentStatusList.vue

@@ -1,583 +0,0 @@
-<!-- 机器状态页面 -->
-<template>
-	<view v-if="merchantList.length>1">
-		<uni-collapse :accordion="true">
-			<view class="titleFlag">
-				<image class="img" src="../../static/img/red.png"></image>
-				<font class="wenziT">红色代表机器报警</font>
-				<image class="img" src="../../static/img/green.png"></image>
-				<font class="wenziT">绿色代表机器正常</font>
-			</view>
-			<view class="titlelist" v-for="(merchant,index) in merchantList" :key="merchant.id">
-				<uni-collapse-item :title="getMerchantTitle(merchant)" :open="index===0">
-					<view style="padding: 20upx;background-color: aliceblue;">
-						<view v-if="merchant.equipmentList.length==0" style="text-align: center;">暂无数据</view>
-						<view v-if="merchant.equipmentList.length>0">
-							<uni-collapse :show-animation="true">
-								<view style="position: relative;" v-for="equipment in merchant.equipmentList" :key="equipment.id">
-									<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
-									<uni-collapse-item :title="getEquipmentTitle(equipment)">
-										<view style="padding: 20upx;background-color: antiquewhite;">
-											<view class="swithBox" v-if="equipment.isSleep">
-												<view class="swichFont">睡眠状态:机器已睡眠</view>
-												<view class="switch">
-													<switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
-												</view>
-											</view>
-											<view class="swithBox" v-else>
-												<view class="swichFont">睡眠状态:未睡眠</view>
-												<view class="switch">
-													<switch style="transform:scale(0.65)" :checked="sleepChecked" @change="change(equipment.id,1)" />
-												</view>
-											</view>
-											<view class="line1"></view>
-											<view class="swithBox" v-if="equipment.eqeStatus==0">
-												<view class="swichFont">关机:已关机</view>
-												<view class="switch">
-													<switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
-												</view>
-											</view>
-											<view class="swithBox" v-else>
-												<view class="swichFont">关机:未关机</view>
-												<view class="switch">
-													<switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
-												</view>
-											</view>
-											<view class="line1"></view>
-											<view><span>机器唯一码:</span><span>{{equipment.clientId}}</span></view>
-											<view><span>所在地:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
-											<view><span>炉头温度:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
-											<view><span>柜内湿度:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
-											<view><span>柜内温度:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
-											<view v-if="equipment.hasTodayAlarm">
-												<view><span>报警内容:</span></view>
-												<view v-for="(alarm,index) in equipment.alarmList" :key="index">
-													<view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
-												</view>
-											</view>
-											<view v-else>
-												<view><span>报警内容:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
-														{{equipment.alarmContent}}</span></view>
-											</view>
-										</view>
-									</uni-collapse-item>
-								</view>
-							</uni-collapse>
-						</view>
-					</view>
-				</uni-collapse-item>
-			</view>
-		</uni-collapse>
-	</view>
-	<view v-else>
-		<uni-collapse :show-animation="true">
-			<view class="titleFlag">
-				<image class="img" src="../../static/img/red.png"></image>
-				<font class="wenziT">{{$t('equipmentStatusList.red')}}</font>
-				<image class="img" src="../../static/img/green.png"></image>
-				<font class="wenziT">{{$t('equipmentStatusList.green')}}</font>
-			</view>
-			<view class="titlelist" style="position: relative;" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
-				<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
-				<uni-collapse-item :title="getEquipmentTitle(equipment)">
-					<!-- 睡眠 -->
-					<view style="padding: 20upx;background-color: antiquewhite;">
-						<view class="swithBox" v-if="equipment.isSleep">
-							<view class="swichFont">{{$t('equipmentStatusList.sleep')}}</view>
-							<view class="switch">
-								<switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
-							</view>
-						</view>
-						<view class="swithBox" v-else>
-							<view class="swichFont">{{$t('equipmentStatusList.unsleep')}}</view>
-							<view class="switch">
-								<switch style="transform:scale(0.65)" :checked="sleepChecked" @change="change(equipment.id,1)" />
-							</view>
-						</view>
-						<view class="line1"></view>
-						<!-- 关机 -->
-						<view class="" v-if="globalUser.open==0">
-							<view class="swithBox" v-if="equipment.eqeStatus==0">
-								<view class="swichFont">{{$t('equipmentStatusList.off')}}</view>
-								<view class="switch">
-									<switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
-								</view>
-							</view>
-							<view class="swithBox" v-else>
-								<view class="swichFont">{{$t('equipmentStatusList.on')}}</view>
-								<view class="switch">
-									<switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
-								</view>
-							</view>
-						</view>
-
-						<view class="line1"></view>
-						<!-- 远程开门 -->
-						<view class="opendoor"><span>{{$t('equipmentStatusList.door')}}:</span>
-							<view class="">
-								<button type="primary" @click="openDoor(equipment.id)" class="button">
-									<p class="p">{{$t('equipmentStatusList.open')}}</p>
-								</button>
-							</view>
-						</view>
-
-						<view><span>{{$t('equipmentStatusList.equipmentNo')}}:</span><span>{{equipment.clientId}}</span></view>
-						<view><span>{{$t('equipmentStatusList.area')}}:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
-						<view><span>{{$t('equipmentStatusList.temperature')}}:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
-						<view><span>{{$t('equipmentStatusList.humidity')}}:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
-						<view><span>{{$t('equipmentStatusList.equipmentTemperature')}}:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
-						<view class="" v-if="equipment.hasTodayAlarm">
-							<view><span>{{$t('equipmentStatusList.alarm')}}:</span></view>
-							<view v-for="(alarm,index) in equipment.alarmList" :key="index">
-								<view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
-							</view>
-						</view>
-						<view class="" v-else>
-							<view><span>{{$t('equipmentStatusList.alarm')}}:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
-									{{equipment.alarmContent}}</span></view>
-						</view>
-					</view>
-				</uni-collapse-item>
-			</view>
-		</uni-collapse>
-	</view>
-
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import {
-		dateUtils
-	} from '@/common/util.js';
-	export default {
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem,
-		},
-		data() {
-			return {
-				globalUser: {},
-				merchantList: [{
-					equipmentList: []
-				}],
-				extraIcon: {
-					color: '#4cd964',
-					size: '22',
-					type: 'spinner'
-				},
-				statusNormal: 'status-normal',
-				statusError: 'status-error',
-				sleepChecked: null,
-				onffChecked: null,
-				time: null,
-				timeAll: {
-
-				},
-				input: 0,
-			}
-		},
-		computed: {
-			...mapState(['loginUser']),
-		},
-		onPullDownRefresh() {
-			this.getEquipmentListData();
-		},
-		onShow() {
-			this.input = this.input + 1;
-			this.globalUser = uni.getStorageSync("globalUser");
-			uni.setNavigationBarTitle({
-				title: this.$t('equipmentStatusList.title')
-			});
-			uni.setTabBarItem({
-				index: 3,
-				text: this.$t('tabs.tab4')
-			});
-			var token = uni.getStorageSync("token");
-			if (token.length>1) {
-				this.getEquipmentListData();
-			}else{
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-
-		},
-		methods: {
-			...mapActions('chart', ['getEquipmentListByUser']),
-			getMerchantTitle(merchant) {
-				return merchant.name ? merchant.name : merchant.username;
-			},
-			getEquipmentTitle(equipment) {
-				return equipment.name ? equipment.name : '暂无名称';
-			},
-			getEquipmentListData() {
-				this.getEquipmentListByUser(this.globalUser)
-					.then(data => {
-						this.merchantList = data;
-						var listName = data[0].equipmentList;
-						var times = new Map;
-						if (this.input == 1) {
-							for (var i = 0; i < listName.length; i++) {
-								var k = listName[i].id;
-								times.set(k, null);
-							}
-							this.timeAll = times;
-						}
-						var listId = data[0].id;
-						if (listId != null && listId != '1') {
-							uni.setStorageSync("listName", listName);
-						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
-			},
-			OnOff(id, code) {
-				var that = this;
-				var ddd = this.timeAll.get(id);
-				if (that.timeAll.get(id) != null) {
-					var stamp = Date.parse(new Date());
-					var t = (stamp - that.timeAll.get(id)) / 1000;
-					if (t < 30) {
-						var s = 30 - t;
-						uni.showModal({
-							title: that.$t('equipmentStatusList.onoff'),
-							content: that.$t('equipmentStatusList.remainingtime') + s + "s",
-							success: function(res) {
-								that.getEquipmentListData();
-							}
-						});
-						return;
-					}
-				}
-				var code1 = code;
-				if (code1 == 0) {
-					uni.showModal({
-						title: that.$t('equipmentStatusList.tip'),
-						content: that.$t('equipmentStatusList.onoffTip'),
-						success: function(res) {
-							if (res.confirm) {
-								var serverurl = that.serverurl;
-								var code2 = code1;
-								var equipmentId = id;
-								var token = uni.getStorageSync("token");
-								uni.request({
-									url: serverurl + '/TEquipment/onOff',
-									data: {
-										"adminId": code2,
-										"equipmentId": equipmentId
-									},
-									method: "POST",
-									header:{
-										'token':token
-									},
-									success: (res) => {
-										var list = res.data.data;
-										that.input = 2;
-										var timestamp = Date.parse(new Date());
-										that.timeAll.set(id, timestamp);
-										var oo = that.timeAll;
-										// that.time = timestamp;
-										that.getEquipmentListData();
-										if (list == 'SUCCESS') {
-											uni.showModal({
-												title: that.$t('equipmentStatusList.guanji'),
-												content: that.$t('equipmentStatusList.tishi'),
-												success: function(res) {
-													that.getEquipmentListData();
-													setTimeout(function () {
-													    that.network(id);
-													}, 7000);
-												}
-											})
-										} else {
-											uni.showModal({
-												title: that.$t('equipmentStatusList.error'),
-												content: that.$t('equipmentStatusList.guanjierror'),
-												success: function(res) {
-													that.onffChecked = true;
-													that.getEquipmentListData();
-												}
-											})
-										}
-
-									}
-								});
-							} else if (res.cancel) {
-								that.onffChecked = false;
-								that.getEquipmentListData();
-							}
-						}
-					});
-				} else {
-					var serverurl = that.serverurl;
-					var code = code;
-					var equipmentId = id;
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: serverurl + '/TEquipment/onOff',
-						data: {
-							"adminId": code,
-							"equipmentId": equipmentId
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							that.input = 2;
-							var list = res.data.data;
-							that.getEquipmentListData();
-							var timestamp = Date.parse(new Date());
-							that.timeAll.set(id, timestamp);
-							var oo = that.timeAll;
-							// that.time = timestamp;
-							if (list == "SUCCESS") {
-								uni.showModal({
-									title: that.$t('equipmentStatusList.kaiji'),
-									content: that.$t('equipmentStatusList.tishi'),
-									success: function(res) {
-										that.getEquipmentListData();
-										setTimeout(function () {
-										    that.network(id);
-										}, 7000);
-									}
-								})
-							} else {
-								uni.showModal({
-									title: that.$t('equipmentStatusList.error'),
-									content: that.$t('equipmentStatusList.kaijierror'),
-									success: function(res) {
-										that.onffChecked = false;
-										that.getEquipmentListData();
-									}
-								})
-							}
-
-						}
-					});
-				}
-			},
-			network(id){
-				var token = uni.getStorageSync("token");
-				var equipmentId = id;
-				uni.request({
-					url: this.serverurl + '/TEquipment/checkStatus',
-					data: {
-						"equipmentId": id
-					},
-					method: "POST",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						var data = res.data.data;
-						if(data=='fail'){
-							uni.showToast({
-							    title: this.$t('equipmentStatusList.network'),
-								icon:'none',
-							    duration: 3000
-							});
-							this.getEquipmentListData();
-						}
-					}
-				});
-			},
-			openDoor(id) {
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TEquipment/openDoor',
-					data: {
-						"equipmentId": id
-					},
-					method: "POST",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						uni.showModal({
-							title: this.$t('equipmentStatusList.open'),
-							content: this.$t('equipmentStatusList.opensuccess'),
-							success: function(res) {
-
-							}
-						})
-					}
-				});
-			},
-			change(id, code) {
-				var that = this;
-				var code1 = code;
-				if (code1 == 1) {
-					uni.showModal({
-						title: that.$t('equipmentStatusList.tip'),
-						content: that.$t('equipmentStatusList.sleepTip'),
-						success: function(res) {
-							if (res.confirm) {
-								var serverurl = that.serverurl;
-								var code2 = code1;
-								var equipmentId = id;
-								var token = uni.getStorageSync("token");
-								uni.request({
-									url: serverurl + '/TEquipment/sleep',
-									data: {
-										"adminId": code2,
-										"equipmentId": equipmentId
-									},
-									method: "POST",
-									header:{
-										'token':token
-									},
-									success: (res) => {
-										var list = res.data.data;
-										that.getEquipmentListData();
-									}
-								});
-							} else if (res.cancel) {
-								that.sleepChecked = false;
-								that.getEquipmentListData();
-							}
-						}
-					});
-				} else {
-					var serverurl = that.serverurl;
-					var code = code;
-					var equipmentId = id;
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: serverurl + '/TEquipment/sleep',
-						data: {
-							"adminId": code,
-							"equipmentId": equipmentId
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							var list = res.data.data;
-							that.getEquipmentListData();
-						}
-					});
-				}
-			},
-		}
-	}
-</script>
-
-<style>
-	.status-css {
-		position: absolute;
-		width: 30upx;
-		height: 30upx;
-		right: 86upx;
-		top: 30upx;
-		border-radius: 30upx;
-		color: "#596D83";
-		font-size: 12upx;
-	}
-
-	.status-error {
-		background-color: #dd524d
-	}
-
-	.status-normal {
-		background-color: #4cd964
-	}
-
-	.baojing {
-		padding-left: 120upx;
-	}
-
-	.titleFlag {
-		height: 56upx;
-		background-color: #F8F8F8;
-		color: #8C959F;
-		font-size: 22upx;
-		display: flex;
-		flex-direction: row;
-	}
-
-	.opendoor {
-		/* #ifdef H5 */
-		
-		/* #endif */
-		padding-top: 10upx;
-		padding-bottom: 10upx;
-		/* text-align: center; */
-		display: flex;
-		flex-direction: row;
-	}
-
-	.button {
-		/* #ifdef H5 */
-		text-align: center;
-		height: 50upx;
-		weight:20upx ;
-		/* #endif */
-		padding-left: 15upx;
-		/* padding-top: 2upx; */
-	}
-
-	.p {
-		/* #ifdef H5 */
-		font-size: 28upx;
-		height: 50upx;
-		weight:20upx ;
-		transform: translateY(-14upx);
-		/* text-align: center; */
-		/* #endif */
-		/* padding-bottom: 50upx; */
-		text-align: center;
-		padding-left: 13upx;
-	}
-
-	.img {
-		padding-top: 20upx;
-		padding-left: 30upx;
-		width: 15upx;
-		height: 15upx;
-	}
-
-	.wenziT {
-		padding-top: 10upx;
-		padding-left: 10upx;
-	}
-
-	.titlelist {
-		color: #363D44;
-		font-size: 16upx;
-		font-family: "PingFang-SC-Medium";
-	}
-
-	.swithBox {
-		display: flex;
-		flex-direction: row;
-		padding-bottom: 15upx;
-		padding-top: 5upx;
-	}
-
-	.switch {
-		width: 44upx;
-		height: 22upx;
-	}
-
-	.swichFont {
-		width: 85%;
-		padding-top: 12upx;
-	}
-
-	.line1 {
-		width: 100%;
-		height: 3upx;
-		background: #000000;
-	}
-</style>

+ 0 - 173
pages/User/merchantList.vue

@@ -1,173 +0,0 @@
-<!-- 机器销售列表页 -->
-<template>
-	<view class="">
-		<view v-if="id!=1">
-			<view v-if="merchantList[0].equipmentList.length>0">
-				<uni-collapse :accordion="true">
-					<uni-list>
-						<uni-list-item :title="$t('merchantList.total')" @click="openByAdmin(merchantList[0].name,merchantList[0].id)" />
-						<view class="titlelist" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
-							<uni-list-item :title="getEquipmentTitle(equipment)" @click="openByEquipment(merchantList[0].name,equipment.id)" />
-						</view>
-					</uni-list>
-				</uni-collapse>
-			</view>
-			<view v-else style="text-align: center;">{{$t('merchantList.data')}}</view>
-		</view>
-		<view class="">
-			<mix-tree :list="list" @treeItemClick="treeItemClick"></mix-tree>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapActions,
-		mapMutations
-	} from 'vuex'
-	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
-	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
-	import uniList from '@/components/uni-list/uni-list.vue'
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
-	import mixTree from '@/components/mix-tree/mix-tree'
-	export default {
-		components: {
-			uniCollapse,
-			uniCollapseItem,
-			uniList,
-			uniListItem,
-			mixTree
-		},
-		data() {
-			return {
-				globalUser:{},
-				merchantList: [{
-					equipmentList: []
-				}],
-				extraIcon: {
-					color: '#4cd964',
-					size: '22',
-					type: 'spinner'
-				},
-				id: null,
-				pname:null,
-				list: []
-			}
-		},
-		computed: {
-			...mapState(['loginUser']),
-		},
-		onShow() {
-			uni.setNavigationBarTitle({title: this.$t('merchantList.title')});
-			uni.setTabBarItem({ index: 1,text: this.$t('tabs.tab2')});
-			this.globalUser = uni.getStorageSync("globalUser");
-			this.id = this.globalUser.id;
-			var token = uni.getStorageSync("token");
-			if (token.length>1) {
-				this.getEquipmentListData();
-			}else{
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-		},
-		onPullDownRefresh() {
-			this.getEquipmentListData();
-		},
-		methods: {
-			...mapActions('chart', ['getEquipmentListByUser', 'getEquipmentListByProvince']),
-			openByAdmin(pname, adminId) {
-				uni.navigateTo({
-					url: '/pages/Charts/elseStatistics?adminId=' + adminId + '&pname=' + pname,
-				});
-			},
-			openByEquipment(pname, equipmentId) {
-				uni.navigateTo({
-					url: '/pages/Charts/elseStatistics?equipmentId=' + equipmentId + '&pname=' + pname,
-				});
-			},
-			//点击最后一级时触发该事件
-			treeItemClick(item) {
-				let {
-					id,
-					name,
-					parentId
-				} = item;
-				if(name=="总销售情况"){
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: this.serverurl + '/TAdmin/findById',
-						data: {
-							"id": id,
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							this.pname = res.data.data.name;
-							uni.navigateTo({
-								url: '/pages/Charts/elseStatistics?adminId=' + id + '&pname=' + this.pname,
-							});
-						}
-					})
-				}else{
-					var token = uni.getStorageSync("token");
-					uni.request({
-						url: this.serverurl + '/TEquipment/findByEquipment',
-						data: {
-							"id": id,
-						},
-						method: "POST",
-						header:{
-							'token':token
-						},
-						success: (res) => {
-							this.pname = res.data.data.name;
-							uni.navigateTo({
-								url: '/pages/Charts/elseStatistics?equipmentId=' + id + '&pname=' + this.pname,
-							});
-						}
-					})
-				}
-				console.log(item)
-			},
-			getMerchantTitle(merchant) {
-				return merchant.name ? merchant.name : merchant.username;
-			},
-			getEquipmentTitle(equipment) {
-				return equipment.name ? equipment.name : equipment.clientId;
-			},
-			getEquipmentListData() {
-				if(this.id==1){
-					this.getEquipmentListByProvince(this.globalUser)
-					.then(data => {
-						this.list = data;
-					}, _ => void uni.stopPullDownRefresh());
-				}else{
-					this.getEquipmentListByUser(this.globalUser)
-					.then(data => {
-						this.merchantList = data;
-						var listName = data[0].equipmentList;
-						var listId = data[0].id;
-						if(listId!=null && listId!='1'){
-							uni.setStorageSync("listName",listName);
-						}
-						uni.stopPullDownRefresh();
-					}
-					, _ => void uni.stopPullDownRefresh());
-				}
-				
-			}
-		}
-	}
-</script>
-
-<style>
-	.titlelist {
-		color: #363D44;
-		font-size: 16upx;
-		font-family: "PingFang-SC-Medium";
-	}
-</style>

+ 0 - 179
pages/User/promoCode.vue

@@ -1,179 +0,0 @@
-<template>
-	<view class="warp">
-		<view class="font">
-				<uni-list class="font">
-					<uni-list-item title="购买优惠码" @click="buy()" />
-				</uni-list>
-		</view>
-		<view class="box">
-			<view class="font">优惠码列表</view>
-			<view class="header">
-				<view class="nickname">
-					筛选条件:
-				</view>
-				<!-- <view class="header"> -->
-				<view class="nickname">
-					状态:
-				</view>
-				<view style="width: 20%; margin-bottom: 2px;padding-top: 2upx; ">
-					<xfl-select :list="list" :clearable="false" :showItemNum="4" :focusShowList="true" :isCanInput="false"
-					 :style_Container="'height: 18px;font-size: 13px;'" :placeholder="''" :initValue="'全部'" :selectHideType="'hideAll'"
-					 @change="change">
-					</xfl-select>
-				</view>
-				<!-- </view> -->
-			</view>
-
-			<t-table @change="change">
-				<t-tr>
-					<t-th>优惠码</t-th>
-					<t-th>到期时间</t-th>
-					<t-th>状态</t-th>
-					<t-th>使用时间</t-th>
-					<t-th>使用机器</t-th>
-				</t-tr>
-				<t-tr v-for="item in tableList" :key="item.id">
-					<t-td>{{ item.code}}</t-td>
-					<t-td>{{ item.lastUseDate}}</t-td>
-					<t-td>{{ item.isUse=='0'?'未使用':item.isUse=='1'?'已使用':item.isUse=='2'?'已过期':''}}</t-td>
-					<t-td>{{ item.useDate}}</t-td>
-					<t-td>{{ item.useBy}}</t-td>
-				</t-tr>
-			</t-table>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	import tTable from '@/components/t-table/t-table.vue';
-	import tTh from '@/components/t-table/t-th.vue';
-	import tTr from '@/components/t-table/t-tr.vue';
-	import tTd from '@/components/t-table/t-td.vue';
-	import xflSelect from '@/components/xfl-select/xfl-select.vue';
-	import uniList from '@/components/uni-list/uni-list.vue';
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-	export default {
-		components: {
-			uniList,
-			uniListItem,
-			tTable,
-			tTh,
-			tTr,
-			tTd,
-			xflSelect
-		},
-		data() {
-			return {
-				tableList: [],
-				list: [ //要展示的数据
-					'全部',
-					'未使用',
-					'使用',
-					'已过期',
-				],
-			};
-		},
-		onShow() {
-			var token = uni.getStorageSync("token");
-			if (token.length>1) {
-				this.init();
-			}else{
-				uni.reLaunch({
-					url: '../Login/Login',
-				});
-			}
-		},
-		methods: {
-			buy() {
-				uni.navigateTo({
-					url: 'buyPromo',
-				});
-			},
-			init() {
-				var globalUser = uni.getStorageSync("globalUser");
-				var id = globalUser.id;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TPromoCode/findList',
-					data: {
-						"adminId": id,
-					},
-					header:{
-						'token':token
-					},
-					method: "POST",
-					success: (res) => {
-						this.tableList = res.data.data;
-					}
-				})
-			},
-			change({
-				newVal,
-				oldVal,
-				index,
-				orignItem
-			}) {
-				this.tableList=null;
-				if(index==0){
-					var isUse = null;
-				}
-				if(index==1){
-					var isUse = 0;
-				}
-				if(index==2){
-					var isUse = 1;
-				}
-				if(index==3){
-					var isUse = 2;
-				}
-				var globalUser = uni.getStorageSync("globalUser");
-				var id = globalUser.id;
-				var token = uni.getStorageSync("token");
-				uni.request({
-					url: this.serverurl + '/TPromoCode/findList',
-					data: {
-						"adminId": id,
-						"isUse":isUse
-					},
-					method: "POST",
-					header:{
-						'token':token
-					},
-					success: (res) => {
-						this.tableList = res.data.data;
-						// if(res.statusCode==401){
-						// 	uni.reLaunch({
-						// 		url: '../Login/Login',
-						// 	});
-						// 	return;
-						// }
-					}
-				})
-			}
-
-		}
-	};
-</script>
-
-<style>
-	.header {
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-start;
-		padding-left: 10upx;
-	}
-
-	.nickname {
-		padding-left: 10upx;
-		height: 32upx;
-		color: #363D44;
-		font-size: 32upx;
-		font-family: "PingFang-SC-Bold";
-	}
-	.font{
-		color: #363D44;
-		font-size: 36upx;
-		font-family: "PingFang-SC-Bold";
-	}
-</style>

+ 141 - 0
pages/User/updataPassword.vue

@@ -0,0 +1,141 @@
+<template>
+	<view class="">
+		<view class="body">
+			归属人:{{name}}
+		</view>
+		<form @submit="updata">
+			<view class="body">
+				登录名:<input class="input" name="userName" :value=username />
+			</view>
+			<view class="body">
+				旧密码:<input class="input" password name="oldPassword" />
+			</view>
+			<view class="body">
+				新密码:<input class="input" password name="password" />
+			</view>
+			<view class="body">
+				确认密码:<input class="input" password name="password1" />
+			</view>
+			<view class="">
+				<button type="primary" formType="submit" class="button">
+					<p class="p">提交</p>
+				</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+
+	export default {
+
+		data() {
+			return {
+				name: '',
+				username: "",
+				parm: {
+					name: null,
+					id: null
+				},
+
+			};
+		},
+		onPullDownRefresh() {},
+		onShow() {
+			var token = uni.getStorageSync("token");
+			if (token.length > 1) {
+				var name = uni.getStorageSync("name");
+				this.name = name;
+				this.username = uni.getStorageSync("globalUser").userName;
+			} else {
+				uni.reLaunch({
+					url: '../Login/Login',
+				});
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			// ...mapActions('chart', ['updata']),
+			updata(event) {
+				const {
+					value: user
+				} = event.detail;
+				var password = user.password;
+				var password1 = user.password1;
+				if (password != password1) {
+					uni.showModal({
+						title: '提示',
+						content: '两次输入密码不一致',
+					});
+					return null;
+				}
+				this.$store.dispatch('updataPassword', user).then(_ => {
+						uni.showModal({
+							title: '提示',
+							content: _.message,
+							success: function(res) {
+								uni.navigateTo({
+									url: '/pages/Login/Login',
+								});
+							}
+						});
+
+					});
+
+			},
+		}
+	}
+</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: 500upx;
+		height: 50upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+
+	.p {
+		/* #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>

+ 39 - 35
pages/User/user.vue

@@ -21,21 +21,28 @@
 		</view>
 		<view class="">
 			<uni-list>
-				<!-- <view v-if="ifForeign">
-					<view v-if="gid">
-						<uni-list-item title="优惠码" @click="open()" />
-					</view>
-				</view> -->
-				<view v-if="show">
-					<uni-list-item :title="$t('user.equipmentname')" @click="updataName()" />
+				<view v-if="level>0">
+					<uni-list-item title="修改登录名/密码" @click="updataPassword()" />
+				</view>
+				<view v-if="level>1">
+					<uni-list-item title="添加新编码" @click="addCode()" />
+				</view>
+				<view v-if="level>2">
+					<uni-list-item title="添加用户" @click="addUser()" />
+				</view>
+				<view v-if="level>2">
+					<uni-list-item title="修改用户权限" @click="updateUser()" />
+				</view>
+				<view v-if="level>2">
+					<uni-list-item title="删除用户" @click="deleteUser()" />
 				</view>
 			</uni-list>
 		</view>
-		<view class="xiugai2">
+		<!-- <view class="xiugai2">
 			<button type="primary" @click="trant()" class="xiugai2">
 				<p class="xiugai3">解除微信绑定</p>
 			</button>
-		</view>
+		</view> -->
 	</view>
 
 </template>
@@ -57,12 +64,11 @@
 		data() {
 			return {
 				name: '',
-				show: false,
+				level:0,
 				ifForeign: false,
 				listName: [],
 				value: null,
 				id: null,
-				gid: false,
 				parm: {
 					name: null,
 					id: null
@@ -79,29 +85,14 @@
 			}, 800);
 		},
 		onShow() {
-			uni.setNavigationBarTitle({
-				title: this.$t('user.title')
-			});
-			uni.setTabBarItem({
-				index: 4,
-				text: this.$t('tabs.tab5')
-			});
-			// uni.startPullDownRefresh();
-			var globalUser = uni.getStorageSync("globalUser");
-			var gid = globalUser.id;
-			if (gid != 1) {
-				this.gid = true;
-			}
-			var ifForeign = globalUser.ifForeign;
-			if (ifForeign == 0) {
-				this.ifForeign = true;
-			}
 			var token = uni.getStorageSync("token");
 			if (token.length>1) {
 				var name = uni.getStorageSync("name");
 				this.name = name;
 				var listName = uni.getStorageSync("listName");
 				this.listName = listName;
+				var level = uni.getStorageSync("level");
+				this.level = level;
 			} else {
 				uni.reLaunch({
 					url: '../Login/Login',
@@ -128,19 +119,32 @@
 
 		},
 		methods: {
-			open() {
+			addCode(){
 				uni.navigateTo({
-					url: 'promoCode',
+					url: 'addCode',
 				});
 			},
-			updataName() {
+			deleteUser(){
+				uni.setStorageSync("flag","delete");
 				uni.navigateTo({
-					url: 'equipmentName',
+					url: 'userList',
 				});
 			},
-			trant() {
-				uni.reLaunch({
-					url: '../WeixinSwicth/WeixinSwicth',
+			updateUser(){
+				uni.setStorageSync("flag","update");
+				uni.navigateTo({
+					url: 'userList',
+				});
+			},
+			addUser(){
+				uni.setStorageSync("flag","add");
+				uni.navigateTo({
+					url: 'userInfo',
+				});
+			},
+			updataPassword() {
+				uni.navigateTo({
+					url: 'updataPassword',
 				});
 			},
 			bindLogout() {

+ 206 - 0
pages/User/userInfo.vue

@@ -0,0 +1,206 @@
+<template>
+	<view class="">
+		<form @submit="sub">
+			<view class="body">
+				<input class="input" style="display:none;" name="id" :value=id />
+				归属人:<input class="input" name="name" placeholder="员工姓名,如:李小明" :value=name />
+			</view>
+			<view class="body">
+				登录名:<input class="input" name="userName" placeholder="如:lxm" :value=username />
+			</view>
+			<view v-if="flag=='add'" class="body">
+				登录密码:<input class="input" password name="password" />
+			</view>
+			<view v-if="flag=='add'" class="body">
+				确认密码:<input class="input" password name="password1" />
+			</view>
+			<view class="uni-form-item uni-column">
+				<view class="title">权限选择</view>
+				<radio-group name="level">
+					<label class="radio">
+						<radio class="radio" value="1" :checked="1==level" /><text>录入</text>
+					</label>
+					</br>
+					<label class="radio">
+						<radio class="radio" value="2" :checked="2==level" /><text>录入,查询,修改</text>
+					</label>
+					</br>
+					<label class="radio">
+						<radio class="radio" value="3" :checked="3==level" /><text>添加用户,修改权限及包含1和2</text>
+					</label>
+				</radio-group>
+			</view>
+			<view class="">
+				<button type="primary" formType="submit" class="button">
+					<p v-if="flag=='add'" class="p">添加</p>
+					<p v-if="flag=='update'" class="p">提交</p>
+					<p v-if="flag=='delete'" class="p">删除</p>
+				</button>
+			</view>
+			<!-- <view v-if="flag=='update'" class="">
+				<button type="primary" formType="submit" class="button">
+					<p class="p">提交</p>
+				</button>
+			</view>
+			<view v-if="flag=='delete'" class="">
+				<button type="primary" formType="submit" class="button">
+					<p class="p">删除</p>
+				</button>
+			</view> -->
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+
+	export default {
+
+		data() {
+			return {
+				id: '',
+				name: '',
+				username: "",
+				flag: "",
+				flagUser: "",
+				level: '',
+				parm: {
+					name: null,
+					id: null
+				},
+
+			};
+		},
+		onPullDownRefresh() {},
+		onShow() {
+
+			var token = uni.getStorageSync("token");
+			if (token.length > 1) {
+				var name = uni.getStorageSync("name");
+				this.flag = uni.getStorageSync("flag");
+				if (this.flag != "add") {
+					var flagUser = uni.getStorageSync("flagUser");
+					this.flagUser = flagUser;
+					this.name = flagUser.name;
+					this.username = flagUser.userName;
+					this.level = flagUser.level;
+					this.id = flagUser.id;
+				}
+			} else {
+				uni.reLaunch({
+					url: '../Login/Login',
+				});
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			// ...mapActions('chart', ['updata']),
+			sub(event) {
+				var serverUrl = this.serverurl;
+				const {
+					value: user
+				} = event.detail;
+				var password = user.password;
+				var password1 = user.password1;
+				if (password != password1) {
+					uni.showModal({
+						title: '提示',
+						content: '两次输入密码不一致',
+					});
+					return null;
+				}
+				//url=add,delete....
+				var url = uni.getStorageSync("flag");
+				if (url == 'add') {
+					this.$store.dispatch(url, user).then(_ => {
+						uni.showModal({
+							title: '提示',
+							content: _.message,
+						});
+
+					});
+				} else {
+					var token = uni.getStorageSync("token");
+					uni.request({
+						url: serverUrl + "/TUser/"+url,
+						method: "POST",
+						data:{
+							"id":user.id,
+							"name":user.name,
+							"level":user.level
+						},
+						header: {
+							'token': token
+						},
+						success: (Result) => {
+							var res = Result;
+							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: 500upx;
+		height: 50upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+
+	.p {
+		/* #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%);
+	}
+
+	.radio {
+		padding-top: 20upx;
+		padding-left: 30upx;
+	}
+</style>

+ 84 - 0
pages/User/userList.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="">
+		<uni-collapse :accordion="true">
+			<uni-list>
+				<view  v-for="user in userList" :key="user.id">
+					<uni-list-item :title="getMerchantTitle(user)" @click="doing(user)"/>
+				</view>
+			</uni-list>
+		</uni-collapse>	
+	</view>
+</template>
+
+<script>
+	import {mapState,mapActions,mapMutations} from 'vuex'
+	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
+	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
+	import uniList from '@/components/uni-list/uni-list.vue'
+	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
+	export default {
+		components: {
+			uniCollapse,
+			uniCollapseItem,
+			uniList,
+			uniListItem
+		},
+		data() {
+			return {
+				userList:[],
+				globalUser:{},
+				merchantList:[{equipmentList:[]}],
+			}
+		},
+		onPullDownRefresh() {
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 800);
+			},
+			onShow() {
+				var token = uni.getStorageSync("token");
+				if (token.length>1) {
+					var name = uni.getStorageSync("name");
+					this.name = name;
+					var listName = uni.getStorageSync("listName");
+					this.listName = listName;
+					var level = uni.getStorageSync("level");
+					this.level = level;
+					this.getList();
+				} else {
+					uni.reLaunch({
+						url: '../Login/Login',
+					});
+				}
+			},
+			onLoad() {
+			},
+			methods: {
+				getList(){
+					var user  = uni.getStorageSync("globalUser");
+					this.$store.dispatch('list',user)
+						.then(_ => {
+							this.userList =_.data;
+						});
+				},
+				doing(user){
+					uni.setStorageSync("flagUser",user);
+					uni.navigateTo({
+						url: './userInfo'
+					});
+				},
+				getMerchantTitle(user){
+					return user.name?user.name:user.username;
+				},
+				updataPassword() {
+					uni.navigateTo({
+						url: 'updataPassword',
+					});
+				},
+			}
+		}
+</script>
+
+<style>
+	
+</style>

+ 55 - 0
pages/select/select.vue

@@ -0,0 +1,55 @@
+<template>
+	<view>
+			<uni-list>
+				<uni-list-item title="整机查询"  @click="machine()" ></uni-list-item>
+				<uni-list-item title="模块查询"  @click="modules()" ></uni-list-item>
+			</uni-list>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
+	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
+	import uniList from '@/components/uni-list/uni-list.vue'
+	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
+	import {
+		dateUtils
+	} from '@/common/util.js';
+	export default {
+		components: {
+			uniCollapse,
+			uniCollapseItem,
+			uniList,
+			uniListItem,
+		},
+		data() {
+			return {
+				
+			}
+		},
+		onShow() {
+			uni.setStorageSync("selectCoding","");
+		},
+		methods: {
+			machine(){
+				uni.navigateTo({
+					url: 'selectMachine',
+				});
+			},
+			modules(){
+				uni.navigateTo({
+					url: 'selectModules',
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 236 - 0
pages/select/selectMachine.vue

@@ -0,0 +1,236 @@
+<template>
+	<view>
+		<view class="body">
+			<input class="input" style="display:none;" name="code" :value=code />
+			编码:<input class="input" v-model="code" />
+			<button type="primary" @click="saoma()" class="button1">
+				<p class="p">扫码</p>
+			</button>
+			<button type="primary" @click="getMessage(code)" class="button1">
+				<p class="p">获取</p>
+			</button>
+		</view>
+
+		<view class="">
+			<t-table>
+				<t-tr class="tr">
+					机器编码:{{coding}}
+				</t-tr>
+				<t-tr class="tr">
+					机器铭牌:{{nameplate}}
+				</t-tr>
+				<t-tr class="tr">
+					机器名称:{{name}}
+				</t-tr>
+				<t-tr class="tr">
+					总装开始时间:{{startDate}}
+				</t-tr>
+				<t-tr class="tr">
+					总装结束时间:{{endDate}}
+				</t-tr>
+			</t-table>
+		</view>
+		<view class="">
+
+			<view v-for="(item,index) in modulesList" :key="index">
+				<t-table class="table">
+					<t-tr class="tr table">
+						名称:{{item.name}}
+					</t-tr>
+					<t-tr class="tr">
+						<t-td >编码:{{item.coding}}</t-td>
+						<t-td class="td">
+							<button type="primary" @click="tran(item.coding)" class="button1">
+								<p class="p">详情</p>
+							</button>
+						</t-td>
+					</t-tr>
+				</t-table>
+			</view>
+
+
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				code: '',
+				coding: '',
+				nameplate: '',
+				name: '',
+				startDate: '',
+				endDate: '',
+				modulesList: []
+			}
+		},
+		methods: {
+			saoma() {
+				var that = this;
+				// 允许从相机和相册扫码
+				uni.scanCode({
+					success(res) {
+						that.code = res.result;
+					}
+				});
+			},
+			getMessage(coding) {
+				var that = this;
+				var serverUrl = that.serverurl;
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: serverUrl + "/TMachine/selectMachine?coding=" + coding,
+					method: "GET",
+					header: {
+						'token': token
+					},
+					success: (Result) => {
+						console.log(Result);
+						var res = Result;
+						if (res.data.code == true) {
+							//当机器已录入时,会先把所有录入模块给列出来
+							if (res.data.message == 'all') {
+								var tmachine = res.data.data.tmachine;
+								that.name = tmachine.name;
+								that.nameplate = tmachine.nameplate;
+								that.coding = tmachine.coding;
+								that.startDate = tmachine.startDate;
+								that.endDate = tmachine.endDate;
+								that.modulesList = res.data.data.modulesList;
+							} else {
+								var codes = res.data.data;
+								that.name = codes.name;
+								that.nameplate = codes.nameplate;
+								that.producePersonnel = uni.getStorageSync("name");
+							}
+
+						} else {
+							uni.showModal({
+								title: '提示',
+								content: res.data.message,
+							});
+						}
+					}
+				});
+			},
+			tran(coding){
+				uni.setStorageSync("selectCoding",coding);
+				uni.navigateTo({
+					url: 'selectModules',
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	.body {
+		background-color: #FFFFFF;
+		padding: 20upx 20upx 20upx 20upx;
+		font-size: 30upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+	.table{
+		padding-top: 30upx;
+		
+	}
+	.tr {
+		padding-left: 30upx;
+		padding-top: 13upx;
+		font-size: 30upx;
+		padding-bottom: 13upx;
+	}
+	.td{
+		padding-left: 280upx;
+
+	}
+
+	.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;
+		text-align:right
+	}
+
+	.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%);
+	}
+
+	.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%);
+	}
+
+	.radio {
+		padding-top: 20upx;
+		padding-left: 30upx;
+	}
+
+	.lis {
+		padding-left: 90upx;
+		font-size: 30upx;
+		padding-top: 5upx;
+	}
+
+	.title {
+		padding-left: 20upx;
+		font-size: 35upx;
+	}
+</style>

+ 280 - 0
pages/select/selectModules.vue

@@ -0,0 +1,280 @@
+<template>
+	<view>
+		<form @submit="add">
+			<view class="body">
+				<input class="input" style="display:none;" name="coding" :value=coding />
+				编码:<input class="input" v-model="coding" />
+				<button type="primary" @click="saoma()" class="button1">
+					<p class="p">扫码</p>
+				</button>
+				<button type="primary" @click="getMessage(coding)" class="button1">
+					<p class="p">获取</p>
+				</button>
+			</view>
+			<view class="">
+				<t-table>
+					<t-tr class="tr">
+						名称:{{name}}
+					</t-tr>
+					<t-tr class="tr">
+						所属机器编码:{{machineCoding}}
+					</t-tr>
+					<t-tr class="tr">
+						版本号:{{versions}}
+					</t-tr>
+					<t-tr class="tr">
+						生产人员:{{producePersonnel}}
+					</t-tr>
+					<t-tr class="tr">
+						生产日期:{{produceDate}}
+					</t-tr>
+					<view class="" v-if="installPersonnel!=''&&installPersonnel!=null">
+						<t-tr class="tr">
+							装配人员:{{installPersonnel}}
+						</t-tr>
+						<t-tr class="tr">
+							装配日期:{{installDate}}
+						</t-tr>
+					</view>
+					<view class="" v-if="replacePersonnel!=''&&replacePersonnel!=null">
+						<t-tr class="tr">
+							更换人员:{{replacePersonnel}}
+						</t-tr>
+						<t-tr class="tr">
+							更换原因:{{replaceReason}}
+						</t-tr>
+						<t-tr class="tr">
+							原模板编号:{{oldCoding}}
+						</t-tr>
+						<t-tr class="tr">
+							更换日期:{{replateDate}}
+						</t-tr>
+
+					</view>
+					<t-tr class="tr">
+						状态:{{status}}
+					</t-tr>
+				</t-table>
+			</view>
+			<view class="title">配件</view>
+<!-- 			<view class="lis" v-for="item in desList">
+				{{item}}
+			</view> -->
+			<view class="lis" v-for="(item,index) in desList" :key="index">
+				{{item}}
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex';
+	import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
+	export default {
+		components: {
+			timeSelector
+		},
+		data() {
+			return {
+				oldCoding: '',
+				replateDate: '',
+				replaceReason: '',
+				replacePersonnel: '',
+				installDate: '',
+				installPersonnel: '',
+				produceDate: '',
+				coding: '',
+				name: '',
+				versions: '',
+				producePersonnel: '',
+				machineCoding: '',
+				status: '',
+				desList: {}
+			}
+		},
+		onShow() {
+			var token = uni.getStorageSync("token");
+			if (token.length > 2) {
+				var coding = uni.getStorageSync("selectCoding");
+				if (coding.length > 2) {
+					this.coding = coding;
+					this.getMessage(coding);
+				}
+			}
+
+		},
+		methods: {
+			saoma() {
+				var that = this;
+				// 允许从相机和相册扫码
+				uni.scanCode({
+					success(res) {
+						that.coding = res.result;
+					}
+				});
+			},
+			getMessage(coding) {
+				var that = this;
+				var serverUrl = that.serverurl;
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: serverUrl + "/TModules/getModules?coding=" + coding,
+					method: "GET",
+					header: {
+						'token': token
+					},
+					success: (Result) => {
+						console.log("1");
+						var res = Result;
+						if (res.data.code == true) {
+							var codes = res.data.data;
+							that.name = codes.name;
+							var co = codes.coding;
+							if (co.substring(0, 4) != '1000') {
+								that.versions = co.substring(8, 10);
+								that.producePersonnel = codes.producePersonnel;
+								that.produceDate = codes.createDate;
+								var sta = codes.status;
+								if (sta == '0') {
+									that.status = "未安装";
+								}
+								if (sta == '1') {
+									that.status = "已安装";
+								}
+								if (sta == '2') {
+									that.status = "已替换";
+								}
+								that.machineCoding = codes.machineCoding;
+							} else {
+								that.versions = co.substring(co.length - 3, co.length);
+								that.producePersonnel = "";
+								that.produceDate = "";
+								that.status = "";
+								that.machineCoding = "";
+							}
+							
+							if(codes.flagCode.length>1){
+								that.desList = codes.flagCode.split(",");
+							}
+							that.installDate = codes.installDate;
+							that.installPersonnel = codes.installPersonnel;
+							that.replateDate = codes.replateDate;
+							that.replaceReason = codes.replaceReason;
+							that.replacePersonnel = codes.replacePersonnel;
+							if (co.substring(0, 4) != '1000') {
+								that.oldCoding = "";
+							}else{
+								that.oldCoding = "";
+							}
+							
+						} else {
+							uni.showModal({
+								content: res.data.message,
+							});
+						}
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	.body {
+		background-color: #FFFFFF;
+		padding: 20upx 20upx 20upx 20upx;
+		font-size: 30upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+
+	.tr {
+		padding-left: 30upx;
+		padding-top: 13upx;
+		font-size: 30upx;
+		padding-bottom: 13upx;
+	}
+
+	.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%);
+	}
+
+	.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%);
+	}
+
+	.radio {
+		padding-top: 20upx;
+		padding-left: 30upx;
+	}
+
+	.lis {
+		padding-left: 90upx;
+		font-size: 30upx;
+		padding-top: 5upx;
+	}
+
+	.title {
+		padding-left: 20upx;
+		font-size: 35upx;
+	}
+</style>

+ 182 - 0
pages/update/update.vue

@@ -0,0 +1,182 @@
+<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: ''
+			}
+		},
+		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>

+ 66 - 5
store/index.js

@@ -30,12 +30,12 @@ const store = new Vuex.Store({
 		},
 	},
 	actions: {
-		login({ commit }, { username, password }) {
+		login({ commit }, { userName, password }) {
 			commit('setLoading', true);
 			// console.log(`login actions: `, arguments);
 			const encryptPwd = MD5(password);
-			const data = { username, password: encryptPwd };
-			return apis.sz.post('/TAdmin/userLogin', data)
+			const data = { userName, password: encryptPwd };
+			return apis.sz.post('/TUser/userLogin', data)
 				.then(res => {
 					// const { token, userObj } = res.data;
 					//用户名缓存
@@ -43,6 +43,7 @@ const store = new Vuex.Store({
 					const userObj = res.data;
 					uni.setStorageSync("globalUser", res.data);
 					uni.setStorageSync("token", res.token);
+					uni.setStorageSync("level", res.data.level);
 					// uni.setCookie(res.token);
 					// uni.setToken(res.token);
 					commit('setLoading', false);
@@ -55,7 +56,7 @@ const store = new Vuex.Store({
 		},
 		loginWXCZ({ commit },parm) {
 			commit('setLoading', true);
-			return apis.sz.post('/TWeixin/weiXinZhuce',parm)
+			return apis.sz.post('/TUserWeixin/weiXinZhuce',parm)
 				.then(res => {
 					//用户名缓存
 					uni.setStorageSync("name", res.data.name);
@@ -71,7 +72,7 @@ const store = new Vuex.Store({
 		},
 		loginWX({ commit },parm) {
 			commit('setLoading', true);
-			return apis.sz.post('/TWeixin/weiXinLogin',parm)
+			return apis.sz.post('/TUserWeixin/weiXinLogin',parm)
 				.then(res => {
 					//用户名缓存
 					uni.setStorageSync("name", res.data.name);
@@ -85,6 +86,66 @@ const store = new Vuex.Store({
 					commit('setLoading', false);
 					return Promise.reject();
 				});
+		},
+		updataPassword({ commit }, { userName,password,oldPassword}) {
+			commit('setLoading', true);
+			const encryptPwd = MD5(password);
+			const oldPwd = MD5(oldPassword);
+			var oldUserName = uni.getStorageSync("globalUser").userName;
+			const data = { userName,oldUserName,password:encryptPwd,oldPassword:oldPwd };
+			return apis.sz.post('/TUser/updataPassword', data)
+			.then(res => {
+					//用户名缓存
+					uni.setStorageSync("name", res.data.name);
+					const userObj = res.data;
+					uni.setStorageSync("globalUser", res.data);
+					uni.setStorageSync("token", res.token);
+					uni.setStorageSync("level", res.data.level);
+					commit('setLoading', false);
+					commit('setLoginUser', userObj);
+					return res;
+				}, _ => {
+					commit('setLoading', false);
+					// return Promise.reject();
+					return null;
+				});
+		},
+		
+		add({ commit }, { userName,password,name,level}) {
+			commit('setLoading', true);
+			const encryptPwd = MD5(password);
+			const data = { userName,name,level,password:encryptPwd };
+			return apis.sz.post('/TUser/add', data)
+				.then(res => {
+					return res;
+				}, _ => {
+					commit('setLoading', false);
+					// return Promise.reject();
+					return null;
+				});
+		},
+		list({ commit },{ userName,password,name,level}) {
+			commit('setLoading', true);
+			const encryptPwd = MD5(password);
+			const data = { userName,name,level,password:encryptPwd };
+			return apis.sz.post('/TUser/list',data)
+				.then(res => {
+					return res;
+				}, _ => {
+					commit('setLoading', false);
+					return null;
+				});
+		},
+		addCode({ commit },{ name,code,remark,flagCode}) {
+			commit('setLoading', true);
+			const coding = {name,code,remark,flagCode};
+			return apis.sz.post('/TCoding/add',coding)
+			.then(res => {
+					return res;
+				}, _ => {
+					commit('setLoading', false);
+					return null;
+				});
 		}
 	}
 });