Browse Source

功能优化

xiaohaizhao 2 months ago
parent
commit
ece490f3b3

+ 2 - 1
pages/generalServices/modules/handle.vue

@@ -163,12 +163,13 @@ function confirmAllot() {
                 uni.showToast({ title: res.code !== 1 ? res.msg : '工单分配成功', icon: 'none' });
                 if (res.code !== 1) return uModal2.value.loading = false;
                 allot.value = false;
-                activeUser2.value = null;
                 emit('callBack', {
                     status: 'alloted',
                     id: res.data == '成功' ? sa_workorderid.value : res.data,
                     isMy: activeUser.value.userid == uni.getStorageSync('userMsg').userid ? true : false
                 });
+                activeUser2.value = { userid: null };
+                activeUser.value = { userid: null };
                 sa_workorderid.value = null;
             })
         },

+ 15 - 12
pages/index/home.vue

@@ -88,12 +88,6 @@ onLoad(() => {
 			text: "服务登记汇总",
 			path: "/pages/generalServices/index",
 		}].concat(itemList.value);
-		/* , {
-			label: '待受理',
-			icon: '/static/image/djd.png',
-			text: "受理转派工单",
-			path: "/pages/generalServices/index?type=待受理",
-		} */
 		uploadNumber();
 	}
 	$Http.basic({
@@ -103,29 +97,38 @@ onLoad(() => {
 			nocache: true
 		}
 	}).then(res => {
+		console.log("广告图",res)
 		if (res.code !== 0 && res.data.length) {
 			uni.removeStorageSync('banner')
 			uni.setStorageSync('banner', res.data);
-			banner.value = res.data.find(v => v.location == "index_top").ads.map(v => {
+			try {
+				banner.value = res.data.find(v => v.location == "index_top").ads.map(v => {
 				v.imageUrl = v.attinfos[0].url;
 				return v
 			}) || [];
+			} catch (error) {
+				
+			}
 		} else {
 			const list = uni.getStorageSync('banner') || [];
-			if (list.length) banner.value = list.find(v => v.location == "index_top").ads.map(v => {
+			try {
+				if (list.length) banner.value = list.find(v => v.location == "index_top").ads.map(v => {
 				v.imageUrl = v.attinfos[0].url;
 				return v
 			}) || [];
+			} catch (error) {
+				
+			}
 		}
 		if (banner.value.length == 0) {
 			banner.value = [{
-				imageUrl: "/static/banners/2、390x115-1.png"
+				imageUrl: "/static/banners/1.png"
 			}, {
-				imageUrl: "/static/banners/2、390x115-2.png"
+				imageUrl: "/static/banners/2.png"
 			}, {
-				imageUrl: "/static/banners/2、390x115-3.png"
+				imageUrl: "/static/banners/3.png"
 			}, {
-				imageUrl: "/static/banners/2、390x115-4.png"
+				imageUrl: "/static/banners/4.png"
 			}];
 		}
 	})

+ 1 - 1
pages/workOrder/modules/vCode.vue

@@ -97,7 +97,7 @@ function getCode() {
             resolve(res.code == 1);
             if (res.code == 1 && res.data.msg.includes("手机验证码为")) {
                 uni.showToast({
-                    title: res.data.msg,
+                    title: '客户确认码已发送至客户手机',
                     icon: 'none'
                 });
                 code.value = res.data.msg.split(":")[1].trim();

+ 33 - 1
pages/workOrder/work.vue

@@ -69,7 +69,8 @@
                 </block>
             </view>
 
-            <up-form-item v-if="workpresetjson.confirm != 0" label="确认信息" prop="confirm"
+            <up-form-item v-if="workpresetjson.confirm != 0"
+                label="确认信息" prop="confirm"
                 :required="workpresetjson.confirm == 11">
                 <view class="options-box">
                     <view class="option" :class="form.confirm == item ? 'active' : ''"
@@ -201,7 +202,38 @@ function toAddItem(key = 'oldtitems') {
         data.newtitems = res.newtitems;
         data.oldtitems = res.oldtitems;
         form.newtitems = res.newtitems.length ? '1' : '';
+        try {
+            if (workpresetjson.confirm_options.length && workpresetjson.confirm_options.includes('大修')) {
+                let maxAttr = -1;
+                res.newtitems.forEach(item => {
+                    let attr = 0;
+                    if (item.repairattribute) {
+                        if (item.repairattribute.includes('大')) {
+                            attr = 3;
+                        } else if (item.repairattribute.includes('中')) {
+                            attr = 2;
+                        } else if (item.repairattribute.includes('小')) {
+                            attr = 1;
+                        }
+                    }
+                    if (attr > maxAttr) maxAttr = attr;
+                });
+                let confirmValue = '';
+                if (maxAttr == 3) {
+                    confirmValue = '大修';
+                } else if (maxAttr == 2) {
+                    confirmValue = '中修';
+                } else if (maxAttr == 1) {
+                    confirmValue = '小修';
+                }
+                if (confirmValue && workpresetjson.confirm_options.includes(confirmValue)) {
+                    form.confirm = confirmValue;
+                }
+            }
 
+        } catch (error) {
+            console.log("自动选择维修类型失败", error)
+        }
         uni.navigateBack();
         delete $Http.selectAcc
         delete $Http.basicsData

+ 0 - 0
static/banners/2、390x115-1.png → static/banners/1.png


+ 0 - 0
static/banners/2、390x115-2.png → static/banners/2.png


+ 0 - 0
static/banners/2、390x115-3.png → static/banners/3.png


+ 0 - 0
static/banners/2、390x115-4.png → static/banners/4.png


+ 1 - 1
utils/Http.js

@@ -140,7 +140,7 @@ class HTTP {
                 }
 
                 // 会话过期处理
-                if (res.data.msg === '登陆状态已过期,请重新登陆!') {
+                if (res.data.msg === '登录凭证已过期,请重新登录!' || res.data.msg == '身份令牌无效,请重新登陆!') {
                     // 清除过期会话ID
                     this.jsessionid = '';
                     uni.removeStorageSync('JSESSIONID');