From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 07 七月 2025 17:26:30 +0800 Subject: [PATCH] 企业微信 --- pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue | 153 ++- pages/spare/spare.vue | 30 pages/home/home.vue | 1 package-lock.json | 20 pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue | 207 +++- pages/baoZhou/baoZhouDetils/baoZhouDetils.vue | 197 +++- pages/maintenanceReport/maintenanceReport.vue | 145 -- pages/baoZhou/baoZhou.vue | 12 pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue | 29 store/index.js | 4 pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue | 61 pages/device/deviceWebDeils/deviceWebDeils.vue | 297 ++++++- pages/checkList/checkList.vue | 36 pages/ToDoList/ToDoListDeils/ToDoListDeils.vue | 4 pages/reportRepair/reportRepair.vue | 74 + pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue | 82 + common/service/config.service.js | 4 pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue | 155 ++- pages.json | 23 pages/TaskManager/TaskManagerList.vue | 8 pages/ToDoList/ToDoList.vue | 13 pages/login/loginOauth2.vue | 302 +++--- common/router/index.js | 15 pages/reportRepair/reportRepairList/reportRepairList.vue | 6 common/router/modules/routes.js | 24 manifest.json | 210 ++-- pages/checkList/checkListDetils/checkListDetils.vue | 88 - api/api.js | 4 pages/reportRepair/reportRepairDeils/reportRepairDeils.vue | 5 common/service/service.js | 24 common/util/work.js | 88 - pages/device/deviceDeils/deviceDeils.vue | 59 - 32 files changed, 1,386 insertions(+), 994 deletions(-) diff --git a/api/api.js b/api/api.js index 58e5981..e1f72f0 100644 --- a/api/api.js +++ b/api/api.js @@ -17,8 +17,8 @@ /** * 绗笁鏂圭櫥褰� */ - thirdLogin(token, thirdType,tenantId) { - return http.get(`/sys/thirdLogin/getLoginUser/${token}/${thirdType}/${tenantId}`); + thirdLogin(token, thirdType) { + return http.get(`/sys/thirdLogin/getLoginUser/${token}/${thirdType}`); }, /** * 閫�鍑� diff --git a/common/router/index.js b/common/router/index.js index 25e74d8..9b23857 100644 --- a/common/router/index.js +++ b/common/router/index.js @@ -27,11 +27,14 @@ let token = uni.getStorageSync(ACCESS_TOKEN); if (token) { if (to.path === '/pages/login/login' || to.path === '/pages/login/loginOauth2') { - if (from.path === '/pages/index/index') { - return; - } else { - next() - } + // if (from.path === '/pages/index/index') { + // return; + // } else { + // next() + // } + next({ + path: '/pages/index/index' + }) } next() } else { @@ -58,4 +61,4 @@ router.afterEach((to, from) => { console.log("afterEach") }); -export default router; \ No newline at end of file +export default router; diff --git a/common/router/modules/routes.js b/common/router/modules/routes.js index 860907f..d6e0abf 100644 --- a/common/router/modules/routes.js +++ b/common/router/modules/routes.js @@ -32,7 +32,6 @@ { //娉ㄦ剰锛歱ath蹇呴』璺焢ages.json涓殑鍦板潃瀵瑰簲锛屾渶鍓嶉潰鍒繕浜嗗姞'/'鍝� path: '/pages/device/device', - //aliasPath:'/', //瀵逛簬h5绔綘蹇呴』鍦ㄩ椤靛姞涓奱liasPath骞惰缃负/ name: 'device', meta: { title: '璁惧', @@ -43,7 +42,6 @@ { //娉ㄦ剰锛歱ath蹇呴』璺焢ages.json涓殑鍦板潃瀵瑰簲锛屾渶鍓嶉潰鍒繕浜嗗姞'/'鍝� path: '/pages/spare/spare', - //aliasPath:'/', //瀵逛簬h5绔綘蹇呴』鍦ㄩ椤靛姞涓奱liasPath骞惰缃负/ name: 'spare', meta: { title: '澶囦欢', @@ -184,6 +182,14 @@ }, }, { + path: '/pages/historicalInspection/historicalInspection', + name: 'historicalInspection', + meta: { + title: '鍘嗗彶鐐规', + }, + }, + + { path: '/pages/checkList/checkListDetils/checkListDetils', name: 'checkListDetils', meta: { @@ -195,6 +201,13 @@ name: 'baoZhou', meta: { title: '鍛ㄤ繚', + }, + }, + { + path: '/pages/historicalMaintenance/historicalMaintenance', + name: 'historicalMaintenance', + meta: { + title: '鍘嗗彶淇濆吇', }, }, { @@ -226,6 +239,13 @@ }, }, { + path: '/pages/historicalRepair/historicalRepair', + name: 'historicalRepair', + meta: { + title: '鍘嗗彶缁翠慨', + }, + }, + { path: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils', name: 'maintenanceReport', meta: { diff --git a/common/service/config.service.js b/common/service/config.service.js index 79aea71..fdbb5e3 100644 --- a/common/service/config.service.js +++ b/common/service/config.service.js @@ -1,4 +1,4 @@ -let BASE_URL = '/jeecg-boot' +let BASE_URL = '' if (process.env.NODE_ENV == 'development') { BASE_URL = '/jeecg-boot' // 寮�鍙戠幆澧� @@ -6,7 +6,7 @@ BASE_URL = '/jeecg-boot' // 鐢熶骇鐜 } let staticDomainURL ='/sys/common/static'; -let staticURL ='https://192.168.100.105:9999/jeecg-boot/sys/common/static'; +let staticURL ='http://125.76.225.53:8086/jeecg-boot/sys/common/static/'; const configService = { apiUrl: BASE_URL, staticDomainURL: staticDomainURL, diff --git a/common/service/service.js b/common/service/service.js index d23985a..a067093 100644 --- a/common/service/service.js +++ b/common/service/service.js @@ -97,6 +97,7 @@ case 504: break case 401: + uni.removeStorageSync(ACCESS_TOKEN); // 娓呴櫎 token uni.showModal({ title: '鎻愮ず', content: '鐧诲綍瓒呮椂锛岄渶瑕侀噸鏂扮櫥褰�!', @@ -104,12 +105,27 @@ success: (res) => { if (res.confirm) { uni.reLaunch({ - url: '/pages/login/login' - }) + url: '/pages/login/loginOauth2' + }); } } }); - break + break; + + // case 401: + // uni.showModal({ + // title: '鎻愮ず', + // content: '鐧诲綍瓒呮椂锛岄渶瑕侀噸鏂扮櫥褰�!', + // showCancel: false, + // success: (res) => { + // if (res.confirm) { + // uni.reLaunch({ + // url: '/pages/login/login' + // }) + // } + // } + // }); + // break default: tip.error({ duration: 0, @@ -124,4 +140,4 @@ export { http -} \ No newline at end of file +} diff --git a/common/util/work.js b/common/util/work.js index f2388ab..a3ff9af 100644 --- a/common/util/work.js +++ b/common/util/work.js @@ -8,14 +8,14 @@ data:[ { title:"寰呭姙", - icon:icon_prefix+"wait_work.png", + icon:icon_prefix+"todo.png", description:"寰呭姙浜嬮」", useCount:1000, page:'ToDoList' }, { title:"宸插姙", - icon:icon_prefix+"wait_work.png", + icon:icon_prefix+"todoManger.png", description:"宸插姙浜嬮」", useCount:1000, page:'TaskManagerList' @@ -27,63 +27,6 @@ useCount:10000, page:'spare' } - // ,{ - // title:"宸插姙", - // icon:icon_prefix+"yiban.png", - // description:"宸插姙浜嬮」", - // useCount:10000, - // page:'helloWorld' - // } - // { - // title:"鑰冨嫟", - // icon:icon_prefix+"kaoqin.png", - // description:"宸ヤ綔鑰冨嫟", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"鏃ョ▼", - // icon:icon_prefix+"richeng.png", - // description:"寤虹珛鍜屾煡鐪嬩釜浜哄伐浣滃畨鎺�", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"璇峰亣鐢宠", - // icon:icon_prefix+"qingjia1.png", - // description:"璇峰亣鐢宠", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"鍑哄樊鐢宠", - // icon:icon_prefix+"chuchai.png", - // description:"鍑哄樊鐢宠", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"鍏枃鍙戞枃", - // icon:icon_prefix+"gongwen.png", - // description:"鍏枃鍙戞枃", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"閫氱煡鍏憡", - // icon:icon_prefix+"tongzhi.png", - // description:"鏌ョ湅浼佷笟瀵瑰憳宸ヤ笅鍙戠殑閫氱煡鍏憡", - // useCount:10000, - // page:'annotationList' - // },{ - // title:"鍐呴儴閭欢", - // icon:icon_prefix+"youjian.png", - // description:"鏌ョ湅鍐呴儴娑堟伅", - // useCount:10000, - // dot:false, - // page:'helloWorld' - // },{ - // title:"閫氳褰�", - // icon:icon_prefix+"tongxun.png", - // description:"鏌ョ湅閮ㄩ棬锛岀粍鍛�", - // useCount:10000, - // page:'levelAddressBook' - // } ] } @@ -105,7 +48,20 @@ description:"璁惧鍛ㄤ繚", useCount:10000, page:'baoZhou' - } + }, + { + title:"鍘嗗彶鐐规", + icon:icon_prefix+"icon_historicalInspection.png", + description:"鍘嗗彶鐐规", + useCount:10000, + page:'historicalInspection' + },{ + title:"鍘嗗彶淇濆吇", + icon:icon_prefix+"icon_historicalMaintenance.png", + description:"鍘嗗彶淇濆吇", + useCount:10000, + page:'historicalMaintenance' + } ] } @@ -118,16 +74,22 @@ data:[ { title:"鎶ヤ慨", - icon:icon_prefix+"xinwen.png", + icon:icon_prefix+"baoxiu.png", description:"璁惧鎶ヤ慨", useCount:10000, - page:'reportRepairList' + page:'reportRepair' },{ title:"寰呯淮淇�", - icon:icon_prefix+"toupiao.png", + icon:icon_prefix+"repair.png", description:"璁惧缁翠慨", useCount:10000, page:'maintenanceReport' + },{ + title:"鍘嗗彶缁翠慨", + icon:icon_prefix+"historicalRepair.png", + description:"鍘嗗彶缁翠慨", + useCount:10000, + page:'historicalRepair' } ] } \ No newline at end of file diff --git a/manifest.json b/manifest.json index c1a40dc..38aed47 100644 --- a/manifest.json +++ b/manifest.json @@ -1,106 +1,108 @@ { - "name": "璁惧绠$悊", - "appid": "__UNI__561D9ED", - "description": "", - "versionName": "1.0", - "versionCode": 1, - "transformPx": false, - "app-plus": { - /* 5+App鐗规湁鐩稿叧 */ // - // "ssl": { - // "cert": "./cert.crt", - // "key": "./cert.key" - // }, - "modules": { - "Maps": {}, - "Push": {} - }, - /* 妯″潡閰嶇疆 */ - "distribute": { - /* 搴旂敤鍙戝竷淇℃伅 */ - "android": { - /* android鎵撳寘閰嶇疆 */ - "permissions": [ - "<uses-feature android:name=\"android.hardware.camera\"/>", - "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", - "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", - "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", - "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", - "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", - "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", - "<uses-permission android:name=\"android.permission.CAMERA\"/>", - "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", - "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", - "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", - "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", - "<uses-permission android:name=\"android.permission.INTERNET\"/>", - "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", - "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", - "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", - "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", - "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", - "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", - "<uses-permission android:name=\"android.permission.VIBRATE\"/>", - "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", - "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", - "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", - "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" - ] - }, - "ios": {}, - /* ios鎵撳寘閰嶇疆 */ - "sdkConfigs": { - "ad": {}, - "maps": { - "amap": { - "appkey_ios": "87f4d2a4a0c42e0c86cf312c8b8154e8", - "appkey_android": "87f4d2a4a0c42e0c86cf312c8b8154e8" - } - }, - "push": { - "unipush": {} - } - } - } - }, - /* SDK閰嶇疆 */ - "quickapp": {}, - /* 蹇簲鐢ㄧ壒鏈夌浉鍏� */ - "mp-weixin": { - "appid": "wx2ba5c5690b35d173", - "setting": { - "urlCheck": false, - "es6": true - }, - "permission": { - "scope.userLocation": { - "desc": "鏈夊畾浣嶅姛鑳介渶瑕佸鑸畾浣�" - } - } - }, - "h5": { - "title": "璁惧绠$悊", - "domain": "myhjdc.cn", - "router": { - "mode": "hash", - "base": "/h5" - }, - "devServer": { - "port": "8080", - "https": true, - "proxy": { - /**閰嶇疆鏈嶅姟鍣ㄨ矾寰�**/ - "/jeecg-boot": { - "target": "https://192.168.100.105:9999", // 鐩爣鏈嶅姟鍣� - "changeOrigin": true - } - } - }, - "optimization": { - "treeShaking": { - "enable": false - } - } - } + "name" : "璁惧绠$悊", + "appid" : "__UNI__561D9ED", + "description" : "", + "versionName" : "1.0", + "versionCode" : 1, + "transformPx" : false, + "app-plus" : { + /* 5+App鐗规湁鐩稿叧 */// + // "ssl": { + // "cert": "./cert.crt", + // "key": "./cert.key" + // }, + "modules" : { + "Maps" : {}, + "Push" : {} + }, + /* 妯″潡閰嶇疆 */ + "distribute" : { + /* 搴旂敤鍙戝竷淇℃伅 */ + "android" : { + /* android鎵撳寘閰嶇疆 */ + "permissions" : [ + "<uses-feature android:name=\"android.hardware.camera\"/>", + "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", + "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", + "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", + "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", + "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", + "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", + "<uses-permission android:name=\"android.permission.CAMERA\"/>", + "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", + "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", + "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", + "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", + "<uses-permission android:name=\"android.permission.INTERNET\"/>", + "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", + "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", + "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", + "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", + "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", + "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", + "<uses-permission android:name=\"android.permission.VIBRATE\"/>", + "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", + "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", + "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", + "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" + ] + }, + "ios" : {}, + /* ios鎵撳寘閰嶇疆 */ + "sdkConfigs" : { + "ad" : {}, + "maps" : { + "amap" : { + "appkey_ios" : "87f4d2a4a0c42e0c86cf312c8b8154e8", + "appkey_android" : "87f4d2a4a0c42e0c86cf312c8b8154e8" + } + }, + "push" : { + "unipush" : {} + } + } + } + }, + /* SDK閰嶇疆 */ + "quickapp" : {}, + /* 蹇簲鐢ㄧ壒鏈夌浉鍏� */ + "mp-weixin" : { + "appid" : "", + "setting" : { + "urlCheck" : false, + "es6" : true + }, + "permission" : { + "scope.userLocation" : { + "desc" : "鏈夊畾浣嶅姛鑳介渶瑕佸鑸畾浣�" + } + } + }, + "h5" : { + "title" : "璁惧绠$悊", + "domain" : "houjie.xalxzn.com", + "router" : { + "mode" : "hash", + "base" : "/h5/" + }, + "devServer" : { + "port" : "8866", + "https" : false, + "proxy" : { + /**閰嶇疆鏈嶅姟鍣ㄨ矾寰�**/ + "/jeecg-boot" : { + "target" : "http://houjie.xalxzn.com:8866", // 鐩爣鏈嶅姟鍣� + "changeOrigin" : true, + "secure": false + } + } + }, + "optimization" : { + "treeShaking" : { + "enable" : false + } + } + } } -/**閰嶇疆鏈嶅姟鍣ㄨ矾寰�**/ // 鐩爣鏈嶅姟鍣� \ No newline at end of file +/**閰嶇疆鏈嶅姟鍣ㄨ矾寰�**/// 鐩爣鏈嶅姟鍣� + diff --git a/package-lock.json b/package-lock.json index f6efbb6..7f7b3a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,21 @@ "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.7.tgz", "integrity": "sha512-DugxSIrQrze1FLdUOj9a+JEQ0bHGjnJTcGUK1mN/MivKg7nuKJBRWk5Ipa9sUdoBznX6ndz5h2e7Uao6x1CdCw==" }, + "@zxing/library": { + "version": "0.21.3", + "resolved": "https://registry.npmmirror.com/@zxing/library/-/library-0.21.3.tgz", + "integrity": "sha512-hZHqFe2JyH/ZxviJZosZjV+2s6EDSY0O24R+FQmlWZBZXP9IqMo7S3nb3+2LBWxodJQkSurdQGnqE7KXqrYgow==", + "requires": { + "@zxing/text-encoding": "~0.9.0", + "ts-custom-error": "^3.2.1" + } + }, + "@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmmirror.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "file-saver": { "version": "2.0.5", "resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz", @@ -16,6 +31,11 @@ "version": "2.3.8", "resolved": "https://registry.npmmirror.com/html5-qrcode/-/html5-qrcode-2.3.8.tgz", "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" + }, + "ts-custom-error": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/ts-custom-error/-/ts-custom-error-3.3.1.tgz", + "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==" } } } diff --git a/pages.json b/pages.json index a32bc70..50af30c 100644 --- a/pages.json +++ b/pages.json @@ -326,6 +326,27 @@ { "navigationBarTitleText" : "" } + }, + { + "path" : "pages/historicalInspection/historicalInspection", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/historicalMaintenance/historicalMaintenance", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/historicalRepair/historicalRepair", + "style" : + { + "navigationBarTitleText" : "" + } } @@ -337,7 +358,7 @@ "allowsBounceVertical": "NO" }, "navigationBarBackgroundColor": "#0081ff", - "navigationBarTitleText": "JEECG BOOT", + "navigationBarTitleText": "MDC", "navigationStyle": "custom", "navigationBarTextStyle": "white" }, diff --git a/pages/TaskManager/TaskManagerList.vue b/pages/TaskManager/TaskManagerList.vue index 4a81ef9..e8cbec6 100644 --- a/pages/TaskManager/TaskManagerList.vue +++ b/pages/TaskManager/TaskManagerList.vue @@ -48,6 +48,12 @@ <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" @click="onClickProductionTask(item)"> <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">娴佺▼鍒嗙被:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-bold text-blue radius text-right"> + {{item.category_dictText}} + </view> + </view> + <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">娴佺▼鍚嶇О:</view> <view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right"> {{item.procDefName}} @@ -220,7 +226,7 @@ } if (url) { - uni.navigateTo({ + uni.redirectTo({ url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}&flag=${flag}` }); diff --git a/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue index 1e9bc64..4e07235 100644 --- a/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue +++ b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue @@ -18,12 +18,20 @@ <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - + <uni-forms-item :label-width="80" required name="maintenanceStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.maintenanceStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="80" name="maintenanceDate" label="淇濆吇鏃ユ湡:"> <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="operator" label="淇濆吇浜�:"> <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="operatorPhone_dictText" label="淇濆吇浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" :disabled="true" /> @@ -33,15 +41,7 @@ :sourceType="sourceType" @select="select" @progress="progress" @success="success" @fail="fail" @delete="deletea" /> </uni-forms-item> - <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item name="outNum" required label="纭绫诲瀷:"> - <uni-data-select :localdata="formData.msListCategory" popup-title="璇烽�夋嫨" @change="changeType" - :clear="false"> - </uni-data-select> - </uni-forms-item> - <uni-forms-item name="outNum" required label="纭鎰忚:"> - <uni-easyinput type="textarea" v-model="formData.ttitle" placeholder="璇疯緭鍏ュ唴瀹�"></uni-easyinput> - </uni-forms-item> --> + </uni-group> </uni-forms> @@ -74,14 +74,7 @@ </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">瀛愪繚鍏婚」:</view> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.subItemName!=null && item.subItemName.length>10"> - {{(item.subItemName).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.subItemName}} - </view> --> <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.subItemName}} </view> @@ -95,7 +88,7 @@ </view> <view class="flex"> - <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规缁撴灉:</view> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇缁撴灉:</view> <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> <uni-data-select :localdata="item.restle" v-model="item.maintenanceResult" @change="handleCode($event, index)" /> @@ -261,8 +254,12 @@ return false; } } + + + + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { - if (this.partTakeAdviceDetailList[i].inspectionResult === "2") { + if (this.partTakeAdviceDetailList[i].maintenanceResult === "2") { if (this.partTakeAdviceDetailList[i].reportFlag === undefined || this .partTakeAdviceDetailList[i].reportFlag === null || this.partTakeAdviceDetailList[i] .reportFlag === '') { @@ -433,19 +430,9 @@ }, select(e) { const tempFilePaths = e.tempFilePaths; - - // if (!Array.isArray(tempFilePaths) || tempFilePaths.length === 0) { - // uni.showToast({ - // title: '璇烽�夋嫨鏂囦欢', - // icon: 'none' - // }); - // return; - // } - uni.showLoading({ title: '涓婁紶涓�...' }); - const uploadPromises = tempFilePaths.map((filePath, index) => { return new Promise((resolve, reject) => { this.$http.upload(this.url.upload, { @@ -499,12 +486,16 @@ console.log("url", res) //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { - this.formData.num = this.announcement1.equipmentId, - this.formData.orderNum = this.announcement1.orderNum, - this.formData.operator = this.announcement1.operator_dictText, - this.formData.maintenanceDate = this.announcement1.maintenanceDate, - this.formData.id = this.announcement1.id, - this.formData.remark = this.announcement1.remark + this.formData.num = this.announcement1.equipmentId + this.formData.orderNum = this.announcement1.orderNum + this.formData.operator = this.announcement1.operator_dictText + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.maintenanceStatus_dictText = this.announcement1.maintenanceStatus_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText + this.formData.maintenanceDate = this.announcement1.maintenanceDate + this.formData.id = this.announcement1.id + this.formData.remark = this.announcement1.remark this.hasInspectionDateArrived(); } }).catch(() => { diff --git a/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue b/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue index 6d6e422..9baefc1 100644 --- a/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue +++ b/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue @@ -14,16 +14,25 @@ <uni-forms-item :label-width="80" name="num" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" required name="num" label="璁惧缂栧彿:"> + <uni-forms-item :label-width="80" name="maintenanceStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.maintenanceStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="num" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> + <uni-forms-item :label-width="80" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="80" name="maintenanceDate" label="淇濆吇鏃ユ湡:"> <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="operator" label="淇濆吇浜�:"> <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="operator" label="淇濆吇浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" :disabled="true" /> @@ -60,33 +69,14 @@ <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.subItemName}} </view> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.subItemName!=null && item.subItemName.length>10"> - {{(item.subItemName).toString().substr(0,10)+'...'}} - </view> --> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.subItemName}} - </view> --> </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇瑕佹眰:</view> <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> - <!-- <zb-tooltip placement="left" ref="tooltip7" > - <view slot="content"> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> - {{item.itemDemand}} - </view> - </view> - <view > - <button size="mini">鏇村</button > - </view> - </zb-tooltip> --> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.itemDemand}} - </view> --> + </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鏄惁鎶ヤ慨:</view> @@ -114,16 +104,17 @@ </uni-collapse> - <uni-forms v-show="isShowSure" ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> + <uni-forms v-show="isShowSure" ref="form" :modelValue="ScanData" validate-trigger="bind" + err-show-type="undertext"> <uni-group top="1"> <view class="divider"><text>鐝粍闀跨‘璁や俊鎭�</text></view> <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂彮缁勯暱纭淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <uni-forms-item :label-width="80" required name="typeName" label="纭绫诲瀷:"> <uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType" - @change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="isShowSure" /> + @change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="isShowSureBtn" /> </uni-forms-item> <uni-forms-item :label-width="80" required name="handlingSuggestion" label="纭鎰忚:"> - <uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="isShowSure" /> + <uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="isShowSureBtn"/> </uni-forms-item> </uni-group> @@ -137,10 +128,10 @@ <uni-easyinput type="textarea" v-model="ScanData.initialAcceptanceComment" placeholder="璇疯緭鍏ユ剰瑙�" :disabled="isShowLast" /> </uni-forms-item> - <uni-forms-item :label-width="80" name="randomInspectionFlag" label="鎶芥鏍囪:"> + <uni-forms-item :label-width="80" name="randomInspectionFlag" label="鎶芥鏍囪:"> <uni-data-select v-model="ScanData.InspectionFlagName" :localdata="ScanData.randomInspectionFlagList" @change="changehandlingInspectionFlag" - placeholder="璇烽�夋嫨" :disabled="isShowLast"/> + placeholder="璇烽�夋嫨" :disabled="isShowLast" /> </uni-forms-item> <uni-forms-item :label-width="80" name="outNum" label="鍒濋獙鏀堕檮浠�:"> <uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles" @@ -157,7 +148,7 @@ <uni-easyinput type="textarea" v-model="ScanData.finalAcceptanceComment" placeholder="璇疯緭鍏ユ剰瑙�" :disabled="isfinal" /> </uni-forms-item> - <uni-forms-item :label-width="80" name="finalFlagName" label="鎶芥鏍囪:"> + <uni-forms-item :label-width="80" name="finalFlagName" label="鎶芥鏍囪:"> <uni-data-select v-model="ScanData.finalFlagName" :localdata="ScanData.finalInspectionFlagList" @change="changehandlingFinalFlag" placeholder="璇烽�夋嫨" :disabled="isfinal" /> </uni-forms-item> @@ -184,6 +175,7 @@ mixins: [MescrollMixin], // 浣跨敤mixin data() { return { + isShowSureBtn:false, readonly: false, readonlyFirstFanl: false, readonlyFirst: false, @@ -293,11 +285,13 @@ procInstId: '', values: '', flag: '', + from: '', imageFiles: '', imageObjectInIt: [], imageFilesList: [], imageObjectFinal: [], - imageFilesnitialAcceptList: [] + imageFilesnitialAcceptList: [], + todoName: '' } }, computed: { @@ -314,9 +308,19 @@ onLoad(options) { const annItem = JSON.parse(decodeURIComponent(options.item)); this.flag = options.flag - console.log(this.flag) + this.from = options.from + if (this.flag == 'task') { + this.todoName = annItem.taskName + } else { + this.todoName = annItem.name + } + if (this.from === 'detils') { + this.id = annItem.id; + console.log(annItem.id); + } else { + this.id = annItem.dataId; + } this.variables = annItem.variables - this.id = annItem.dataId this.taskId = annItem.id this.procInstId = annItem.procInstId this.assignee = annItem.assignee @@ -328,7 +332,7 @@ }, methods: { - + changehandlingFinalFlag(e) { this.ScanData.finalFlagName = e; }, @@ -430,6 +434,14 @@ // }) this.$Router.replaceAll({ name: 'ToDoList' + }) + } else { + + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, }) } }).catch(() => { @@ -671,16 +683,22 @@ //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { console.log("res", res.data.result.equipmentCode) + this.title = this.todoName ?? '璇︽儏' this.formData.num = this.announcement1.equipmentId this.formData.orderNum = this.announcement1.orderNum + this.formData.maintenanceStatus_dictText = this.announcement1.maintenanceStatus_dictText + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText this.formData.operator = this.announcement1.operator_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText this.formData.maintenanceDate = this.announcement1.maintenanceDate this.formData.remark = this.announcement1.remark this.ScanData.finalAcceptanceComment = this.announcement1.finalAcceptanceComment + if (this.announcement1.randomInspectionFlag != null) { this.ScanData.InspectionFlagName = this.announcement1.randomInspectionFlag } - + if (this.announcement1.finalRandomInspectionFlag != null) { this.ScanData.finalFlagName = this.announcement1.finalRandomInspectionFlag } @@ -692,18 +710,20 @@ */ case 'WAIT_INITIAL_ACCEPTANCE': if (this.flag == 'task') { - this.title = '璇︽儏' - this.readonly = true; - this.readonlyFirst = true; - this.isShowSure = true; - this.isHideFist = true; - this.isShowLast = true; - this.isShowBtn = false; - } else { - this.title = '鍒濇' + // this.title = '璇︽儏' this.readonly = true - this.isShowSure = true; - this.isHideFist = true; + this.isShowSureBtn=true + this.readonlyFirst = true + this.isShowSure = true + this.isHideFist = true + this.isShowLast = true + this.isShowBtn = false + } else { + // this.title = '鍒濇' + this.readonly = true + this.isShowSureBtn=true + this.isShowSure = true + this.isHideFist = true } break @@ -712,24 +732,26 @@ */ case 'WAIT_FINAL_ACCEPTANCE': if (this.flag == 'task') { - this.title = '璇︽儏' + // this.title = '璇︽儏' this.readonly = true this.readonlyFirst = true - this.isHideFist = true; - this.isShowLast = true; - this.isShowSure = true; - this.isHideLast = true; - this.isShowBtn = false; - this.isfinal = true; - this.readonlyFirstFanl = true; + this.isHideFist = true + this.isShowLast = true + this.isShowSure = true + this.isHideLast = true + this.isShowBtn = false + this.isfinal = true + this.isShowSureBtn=true + this.readonlyFirstFanl = true } else { - this.title = '璁捐兘閮ㄧ粓楠�' + // this.title = '璁捐兘閮ㄧ粓楠�' this.readonly = true + this.isShowSureBtn=true this.readonlyFirst = true - this.isHideFist = true; - this.isShowLast = true; - this.isShowSure = true; - this.isHideLast = true; + this.isHideFist = true + this.isShowLast = true + this.isShowSure = true + this.isHideLast = true } break @@ -739,19 +761,21 @@ case 'WAIT_CONFIRM': if (this.flag == 'task') { - this.title = '璇︽儏' + // this.title = '璇︽儏' this.readonly = true + this.isHideLast = false this.isHideFist = false this.isShowBtn = false this.isShowSure = true } else { - this.title = '鐝粍闀跨‘璁�' + // this.title = '鐝粍闀跨‘璁�' this.isHideLast = false this.readonly = true this.isHideFist = false this.isShowBtn = true - this.isShowSure = false + this.isShowSure = true + } break @@ -761,23 +785,26 @@ this.isHideFist = true this.isShowLast = true this.isfinal = true + this.isShowSureBtn=true this.readonlyFirst = true this.readonly = true this.readonlyFirstFanl = true this.isShowBtn = false - this.title = '璇︽儏' + // this.title = '璇︽儏' break - + case 'UNDER_MAINTENANCE': - this.isfinal = true this.readonlyFirst = true this.readonly = true this.readonlyFirstFanl = true this.isShowBtn = false - this.title = '璇︽儏' break - + case 'WAIT_MAINTENANCE': + if (this.flag == 'task') + this.readonly = true + this.isShowBtn = false + break } this.ScanData.initialAcceptanceComment = this.announcement1.initialAcceptanceComment this.ScanData.typeName = this.announcement1.confirmDealType diff --git a/pages/ToDoList/ToDoList.vue b/pages/ToDoList/ToDoList.vue index 30dfdc5..7ab14d5 100644 --- a/pages/ToDoList/ToDoList.vue +++ b/pages/ToDoList/ToDoList.vue @@ -50,6 +50,12 @@ <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" @click="onClickProductionTask(item)"> <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">娴佺▼鍒嗙被:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-bold text-blue radius text-right"> + {{item.category_dictText}} + </view> + </view> + <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">娴佺▼鍚嶇О:</view> <view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right"> {{item.flowName}} @@ -58,7 +64,7 @@ <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">涔嬪墠澶勭悊浜�:</view> - <view class="flex-sub bg-white padding-xs margin-xs text-blue radius text-right"> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.preNodeAssignee_dictText}} </view> </view> @@ -216,9 +222,10 @@ url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; break; case (name === '鐐规宸ュ崟' && type === '璁惧鐐规'): - url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils'; + url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils'; + break; - default: + default:ToDoCheckDetils console.warn(`No URL found for name: ${name} and type: ${type}`); return; } diff --git a/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue b/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue index f123279..c0ac52f 100644 --- a/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue +++ b/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue @@ -1,6 +1,6 @@ <template> <view class="container"> - <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <cu-custom :bgColor="NavBarColor" :isBack="true"> <block slot="backText">杩斿洖</block> <block slot="content">{{title}}</block> </cu-custom> @@ -12,7 +12,8 @@ <!-- 鍏抽棴鎸夐挳 --> <text class="close-btn" @tap.stop="showPreview = false">×</text> <!-- 鍥剧墖灞曠ず --> - <image :src="previewImageSrc" mode="aspectFit" class="preview-image" /> + <image :src="previewImageSrc" mode="aspectFit" class="preview-image" @error="handleImageError" + :show-menu-by-longpress="false" /> </view> </view> @@ -25,9 +26,16 @@ <uni-forms-item :label-width="80" name="num" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" required name="num" label="璁惧缂栧彿:"> + <uni-forms-item :label-width="80" name="inspectionStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item :label-width="80" name="num" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="鐐规鏃ユ湡:"> @@ -35,6 +43,12 @@ </uni-forms-item> <uni-forms-item :label-width="80" name="outNum" label="鐐规浜�:"> <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="operatorPhone_dictText" label="鐐规浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="formData.remark" label="澶囨敞:"> + <uni-easyinput v-model="formData.remark" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="outNum" label="鐐规鍥剧墖:"> @@ -72,15 +86,6 @@ <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> - - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.itemDemand!=null && item.itemDemand.length>10"> - {{(item.itemDemand).toString().substr(0,10)+'...'}} - </view> - - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.itemDemand}} - </view> --> </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规缁撴灉:</view> @@ -221,8 +226,10 @@ procInstId: '', values: '', flag: '', + from: '', standardId: '', - previewImageSrc: '' + previewImageSrc: '', + todoName: '' } @@ -241,8 +248,18 @@ onLoad(options) { const annItem = JSON.parse(decodeURIComponent(options.item)); this.flag = options.flag - console.log(this.flag) - this.id = annItem.dataId + if (this.flag == 'task') { + this.todoName = annItem.taskName + } else { + this.todoName = annItem.name + } + this.from = options.from + if (this.from === 'detils') { + this.id = annItem.id; + console.log(annItem.id); + } else { + this.id = annItem.dataId; + } this.taskId = annItem.id this.procInstId = annItem.procInstId this.values = annItem.values @@ -256,6 +273,10 @@ }, methods: { + handleImageError(e) { + const icon_prefix = "/static/"; + this.previewImageSrc = icon_prefix + "icn_erro.png" + }, changehandlingType(e) { this.ScanData.typeName = e; }, @@ -275,7 +296,8 @@ }); return false; } - if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || + if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == + null || this .ScanData.handlingSuggestion == '') { @@ -321,6 +343,13 @@ // }) this.$Router.replaceAll({ name: 'ToDoList' + }) + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, }) } }).catch(() => { @@ -466,19 +495,32 @@ console.log(this.announcement1.operator_dictText) this.formData.operator = this.announcement1.operator_dictText this.formData.num = this.announcement1.equipmentId + this.formData.remark = this.announcement1.remark + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.inspectionStatus_dictText = this.announcement1.inspectionStatus_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText this.formData.orderNum = this.announcement1.orderNum this.formData.inspectionDate = this.announcement1.inspectionDate this.formData.inspectionStatus = this.announcement1.inspectionStatus this.ScanData.typeName = this.announcement1.confirmDealType this.formData.confirmComment = this.announcement1.confirmDealType_dictText this.ScanData.handlingSuggestion = this.announcement1.confirmComment + this.title = this.todoName ?? '璇︽儏'; if (this.announcement1.standardId !== null) { this.standardId = this.announcement1.standardId this.getStandardFile() } + if (this.formData.inspectionStatus == 'WAIT_INSPECTION') { + if (this.flag == 'task') { + // this.title = '鐝粍闀跨‘璁�' + this.readonly = true + this.isShowBtn = false + } + } if (this.formData.inspectionStatus == 'COMPLETE') { if (this.flag == 'task') { - this.title = '鐝粍闀跨‘璁�' + // this.title = '鐝粍闀跨‘璁�' this.isTouch = true this.readonly = true this.isShowTeam = true @@ -486,13 +528,13 @@ } } else if (this.formData.inspectionStatus == 'WAIT_CONFIRM') { if (this.flag == 'task') { - this.title = '鐐规鎵ц'; + // this.title = '鐝粍闀跨‘璁�'; this.readonly = true this.isShowTeam = true this.isTouch = true this.isShowBtn = false } else { - this.title = '鐐规寮�濮�'; + // this.title = '鐐规寮�濮�'; this.isShowTeam = true this.isTouch = false this.readonly = true @@ -501,7 +543,7 @@ } else if (this.formData.inspectionStatus == 'UNDER_INSPECTION') { if (this.flag == 'task') { - this.title = '鐐规寮�濮�'; + // this.title = '鐐规寮�濮�'; this.isShowBtn = false; } diff --git a/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue b/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue index 29e1e15..e85293b 100644 --- a/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue +++ b/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue @@ -2,7 +2,7 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <block slot="content">鎵ц</block> + <block slot="content">鐐规鎵ц</block> </cu-custom> <view class="container"> <template> @@ -12,10 +12,10 @@ <!-- 鍏抽棴鎸夐挳 --> <text class="close-btn" @tap.stop="showPreview = false">×</text> <!-- 鍥剧墖灞曠ず --> - <image :src="previewImageSrc" mode="aspectFit" class="preview-image" /> + <image :src="previewImageSrc" mode="aspectFit" class="preview-image" @error="handleImageError" + :show-menu-by-longpress="false"/> </view> </view> - </template> <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> @@ -24,16 +24,24 @@ <uni-forms-item :label-width="80" name="orderNum" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" required name="num" label="璁惧缂栧彿:"> + <uni-forms-item :label-width="80" name="inspectionStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="num" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - + <uni-forms-item :label-width="80" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="鐐规鏃ユ湡:"> <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="outNum" label="鐐规浜�:"> <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="operatorPhone_dictText" label="鐐规浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="澶囨敞:"> <uni-easyinput type="textarea" v-model="formData.remark" :disabled="true" /> @@ -221,6 +229,10 @@ }, methods: { + handleImageError(e) { + const icon_prefix="/static/"; + this.previewImageSrc=icon_prefix+"icn_erro.png" + }, select(e) { const tempFilePaths = e.tempFilePaths; uni.showLoading({ @@ -522,7 +534,12 @@ this.formData.num = this.announcement1.equipmentId this.formData.remark = this.announcement1.remark this.formData.orderNum = this.announcement1.orderNum - this.formData.operator = this.announcement1.operator + this.formData.operator = this.announcement1.operator_dictText + this.formData.inspectionStatus_dictText = this.announcement1.inspectionStatus_dictText + + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText this.formData.inspectionDate = this.announcement1.inspectionDate this.hasInspectionDateArrived(); diff --git a/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue b/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue index 2b3eb10..660a6f0 100644 --- a/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue +++ b/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue @@ -13,6 +13,10 @@ <uni-forms-item name="num" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> </uni-forms-item> + <uni-forms-item name="inspectionStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item required name="num" label="璁惧缂栫爜:"> <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> </uni-forms-item> diff --git a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue index 951b926..82b9e97 100644 --- a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue +++ b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue @@ -11,19 +11,36 @@ <uni-group top="1"> <view class="divider"><text>鎶ヤ慨鍩烘湰淇℃伅</text></view> <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> - <uni-forms-item :label-width="100" name="num" label="宸ュ崟鍙�:"> + <uni-forms-item :label-width="100" name="repairCode" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.repairCode" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> + <uni-forms-item :label-width="100" name="repairStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.repairStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="num" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - + <uni-forms-item :label-width="100" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="faultName" label="鏁呴殰绠�绉�:"> + <uni-easyinput v-model="formData.faultName" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="100" name="remark" label="鏁呴殰寮�濮嬫椂闂�:"> <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="100" name="outNum" label="缁翠慨璐熻矗浜�:"> - <uni-easyinput v-model="formData.repairer" :disabled="true" /> + <uni-forms-item :label-width="100" name="reporter_dictText" label="鎶ヤ慨浜�:"> + <uni-easyinput v-model="formData.reporter_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="reporterPhone_dictText" label="鎶ヤ慨浜虹數璇�:"> + <uni-easyinput v-model="formData.reporterPhone_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="repairer_dictText" label="缁翠慨浜�:"> + <uni-easyinput v-model="formData.repairer_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="repairerPhone_dictText" label="缁翠慨浜虹數璇�:"> + <uni-easyinput v-model="formData.repairerPhone_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="100" name="remark" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" :disabled="true" /> @@ -31,8 +48,8 @@ <uni-forms-item :label-width="100" name="outNum" label="鎶ヤ慨鍥剧墖:"> <uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles" @select="select" - :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" @delete="deletea" - :readonly="readonly" /> + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonly" /> </uni-forms-item> <view class="divider"><text>鏄惁闇�瑕侀鐢ㄥ浠�</text></view> @@ -51,8 +68,8 @@ </uni-forms-item> <uni-forms-item v-show="isShow" :label-width="100" name="outNum" label="缁翠慨鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select" - :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" @delete="deletea" - :readonly="readonlyRepaier" /> + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonlyRepaier" /> </uni-forms-item> </uni-group> </uni-forms> @@ -63,7 +80,7 @@ <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂鐞嗗憳棰嗙敤澶囦欢鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <uni-forms-item :label-width="100" required name="sparePartDescription" label="澶囦欢鎻忚堪:"> <uni-easyinput type="textarea" v-model="ScanData.sparePartDescription" placeholder="璇疯緭鍏ュ浠舵弿杩�" - :disabled="isRuning"/> + :disabled="isRuning" /> </uni-forms-item> </uni-group> @@ -82,8 +99,8 @@ </uni-forms-item> <uni-forms-item :label-width="100" name="outNum" label="缁翠慨鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select" - :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" @delete="deletea" - :readonly="readonlyRepaier" /> + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonlyRepaier" /> </uni-forms-item> </uni-group> </uni-forms> @@ -192,7 +209,9 @@ procInstId: '', values: '', isShow: true, - flag: '' + flag: '', + from: '', + todoName: '' } }, @@ -210,12 +229,22 @@ onLoad(options) { const annItem = JSON.parse(decodeURIComponent(options.item)); this.flag = options.flag - console.log(this.flag) - this.id = annItem.dataId, - this.taskId = annItem.id, - this.procInstId = annItem.procInstId, - this.values = annItem.values, - this.assignee = annItem.assignee + this.from = options.from + if (this.flag == 'task') { + this.todoName = annItem.taskName + } else { + this.todoName = annItem.name + } + if (this.from === 'detils') { + this.id = annItem.id; + console.log(annItem.id); + } else { + this.id = annItem.dataId; + } + this.taskId = annItem.id + this.procInstId = annItem.procInstId + this.values = annItem.values + this.assignee = annItem.assignee }, created() { this.getEquipment(); @@ -277,40 +306,6 @@ console.log('鍒犻櫎鍥剧墖', e); }, ProductionTask() { - console.log(this.formData.isSpare) - if (this.formData.reportStatus == 'WAIT_SPARES' && this.formData.isSpare == 1 && this.flag !== 'task') { - if (this.ScanData.sparePartDescription == undefined || this.ScanData.sparePartDescription == null || - this - .ScanData.sparePartDescription == - '') { - - uni.showToast({ - icon: 'none', - title: '澶囦欢鎻忚堪涓嶈兘涓虹┖' - }); - return false; - } - } - - - - if (this.formData.reportStatus == 'UNDER_REPAIR' && this.flag !== 'task' && this.formData.isSpare == 0) { - if (this.formData.faultReason == undefined || this.formData.faultReason == null || this.formData.faultReason == '') { - uni.showToast({ - icon: 'none', - title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖' - }); - return false; - } - if (this.formData.repairDescription == undefined || this.formData.repairDescription == null || this.formData.repairDescription == '') { - uni.showToast({ - icon: 'none', - title: '缁翠慨缁撴灉涓嶈兘涓虹┖' - }); - return false; - } - } - if (this.formData.reportStatus == 'UNDER_REPAIR' && this.formData.isSpare == 1) { if (this.formData.isSpare == undefined || this.formData.isSpare == null || @@ -325,6 +320,49 @@ return false; } } + + + console.log(this.formData.isSpare) + if (this.formData.reportStatus === 'WAIT_SPARES' && this.formData.isSpare == 1 && this.flag !== 'task') { + if (this.ScanData.sparePartDescription == undefined || this.ScanData.sparePartDescription == null || + this + .ScanData.sparePartDescription == + '') { + + uni.showToast({ + icon: 'none', + title: '澶囦欢鎻忚堪涓嶈兘涓虹┖' + }); + return false; + } + } + + + + if ( + this.formData.reportStatus === 'UNDER_REPAIR' && + this.flag !== 'task' && + (this.formData.isSpare === 0 || this.ScanData.sparePartDescription?.trim()) + ) { + if (this.formData.faultReason == undefined || this.formData.faultReason == null || this.formData + .faultReason == '') { + uni.showToast({ + icon: 'none', + title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖' + }); + return false; + } + if (this.formData.repairDescription == undefined || this.formData.repairDescription == null || this + .formData.repairDescription == '') { + uni.showToast({ + icon: 'none', + title: '缁翠慨缁撴灉涓嶈兘涓虹┖' + }); + return false; + } + } + + uni.showLoading({ mask: true, title: "鍔犺浇涓�....", @@ -350,6 +388,14 @@ }); this.$Router.replaceAll({ name: 'ToDoList' + }) + } else { + + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, }) } }).catch(() => { @@ -416,36 +462,36 @@ //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { this.formData.reportStatus = this.announcement1.reportStatus - + this.title = this.todoName ?? '璇︽儏'; if (this.announcement1.reportStatus === 'WAIT_CONFIRM') { if (this.flag == 'task') { - this.title = '缁翠慨鎵ц'; + // this.title = '缁翠慨鎵ц'; this.isUNDERREPAIR = true this.readonly = true this.isRuning = true - this.isSHowBtn=false - this.readonlyRepaier=true + this.isSHowBtn = false + this.readonlyRepaier = true this.isShowRepari = false } else if (this.flag !== 'task') { - this.title = '鎿嶄綔宸ョ‘璁�'; + // this.title = '鎿嶄綔宸ョ‘璁�'; this.isUNDERREPAIR = true this.readonly = true this.isRuning = true - this.isSHowBtn=true - this.readonlyRepaier=true + this.isSHowBtn = true + this.readonlyRepaier = true this.isShowRepari = false } } else if (this.announcement1.reportStatus === 'WAIT_SPARES') { if (this.flag == 'task' && this.announcement1.isUseSpare == 1) { - this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'; + // this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'; this.isShowUNDEREPAIR = false; this.isUNDERREPAIR = true; this.readonly = true this.isSHowBtn = false; } else { - this.title = '绠$悊鍛橀鐢ㄥ浠�'; + // this.title = '绠$悊鍛橀鐢ㄥ浠�'; this.readonly = true this.isUNDERREPAIR = true; this.isShowUNDEREPAIR = true; @@ -454,7 +500,7 @@ } else if (this.announcement1.reportStatus === 'UNDER_REPAIR') { if (this.announcement1.isUseSpare == 1 && this.flag == 'task') { - this.title = '绠$悊鍛橀鐢ㄥ浠�'; + // this.title = '绠$悊鍛橀鐢ㄥ浠�'; this.isShowRepari = true; this.readonlyRepaier = true this.isShowUNDEREPAIR = true; @@ -465,21 +511,29 @@ this.isSHowBtn = false; } else if (this.announcement1.isUseSpare == 1 && this.flag !== 'task') { - this.title = '缁翠慨鎵ц' + // this.title = '缁翠慨鎵ц' this.isUNDERREPAIR = true this.readonly = true this.isShowUNDEREPAIR = true this.isRuning = true this.isShowRepari = true + } else if (this.announcement1.isUseSpare == 0 && this.flag == 'task') { + this.readonlyRepaier = true + this.isUNDERREPAIR = true; + this.isRuning = true; + this.isRepari = true; + this.readonly = true + this.isSHowBtn = false; + } else { - this.title = '鏄惁闇�瑕侀鐢ㄥ浠�' + // this.title = '鏄惁闇�瑕侀鐢ㄥ浠�' this.isSHowBtn = true this.readonly = true } } else if (this.announcement1.reportStatus === 'COMPLETE') { if (this.flag == 'task' && this.announcement1.isUseSpare == 0) { - this.title = '鎿嶄綔宸ョ‘璁�' + // this.title = '鎿嶄綔宸ョ‘璁�' this.isUNDERREPAIR = true this.isShowUNDEREPAIR = false this.readonly = true @@ -489,22 +543,22 @@ this.isRepari = false this.isSHowBtn = false } else if (this.flag == 'task' && this.announcement1.isUseSpare == 1) { - this.title = '鎿嶄綔宸ョ‘璁�' + // this.title = '鎿嶄綔宸ョ‘璁�' this.isUNDERREPAIR = true this.isShowUNDEREPAIR = true this.isRuning = true - this.readonlyRepaier=true + this.readonlyRepaier = true this.isShowRepari = true this.isRepari = true this.readonly = true this.isSHowBtn = false; - }else if (this.flag !== 'task' && this.announcement1.isUseSpare == 0){ - this.title = '缁翠慨鎵ц' + } else if (this.flag !== 'task' && this.announcement1.isUseSpare == 0) { + // this.title = '缁翠慨鎵ц' this.isUNDERREPAIR = true - this.readonlyRepaier=true + this.readonlyRepaier = true this.readonly = true this.isRuning = true - + } } @@ -531,8 +585,15 @@ } console.log(this.fileLists) this.formData.num = this.announcement1.equipmentId + this.formData.repairStatus_dictText = this.announcement1.repairStatus_dictText this.formData.repairCode = this.announcement1.repairCode - this.formData.repairer = this.announcement1.repairer + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.faultName = this.announcement1.faultName + this.formData.repairer_dictText = this.announcement1.repairer_dictText + this.formData.repairerPhone_dictText = this.announcement1.repairerPhone_dictText + this.formData.reporter_dictText = this.announcement1.reporter_dictText + this.formData.reporterPhone_dictText = this.announcement1.reporterPhone_dictText this.formData.faultStartTime = this.announcement1.faultStartTime this.formData.remark = this.announcement1.remark this.formData.repairDescription = this.announcement1.repairDescription diff --git a/pages/baoZhou/baoZhou.vue b/pages/baoZhou/baoZhou.vue index aa7e16b..a21122a 100644 --- a/pages/baoZhou/baoZhou.vue +++ b/pages/baoZhou/baoZhou.vue @@ -2,7 +2,7 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <block slot="content">鍛ㄤ繚</block> + <block slot="content">寰呭懆淇�</block> <block slot="right"> <view @click="search"> <image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" /> @@ -96,7 +96,9 @@ return { type: 'top', scrollLeft: 0, + formData: { + orderNum: '', InspectionFlagName: '', randomInspectionFlagList: [{ @@ -112,9 +114,9 @@ NavBarColor: this.NavBarColor, activeColor: '#5277A6', url: { - stallList: "/eam/weekMaintenanceOrder/list", collect: "eam/weekMaintenanceOrder/collect" + }, upOption: { @@ -166,8 +168,12 @@ decodeURIComponent(options.equipmentId) : ''; }, - created() {}, + created() { + + }, methods: { + + changehandlingInspectionFlag(e) { this.formData.InspectionFlagName = e; }, diff --git a/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue index b75aff7..e893d82 100644 --- a/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue +++ b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue @@ -17,19 +17,26 @@ <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> + + <uni-forms-item name="installationPosition_dictText" :label-width="80" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item name="maintenanceDate" :label-width="80" label="淇濆吇鏃ユ湡:"> <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="淇濆吇浜�:"> + <uni-forms-item name="operator_dictText" :label-width="80" label="淇濆吇浜�:"> <uni-easyinput v-model="formData.operator_dictText" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="澶囨敞"> + <uni-forms-item name="operatorPhone_dictText" :label-width="80" label="淇濆吇浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="remark" :label-width="80" label="澶囨敞"> <uni-easyinput type="textarea" v-model="formData.remark" :disabled="true" /> </uni-forms-item> <uni-forms-item name="outNum" :label-width="80" label="淇濆吇鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" @select="select" @progress="progress" @success="success" - @fail="fail" @delete="deletea" :readonly="true" /> + @fail="fail" @delete="deletea" :readonly="true" /> </uni-forms-item> </uni-group> </uni-forms> @@ -53,25 +60,11 @@ <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.subItemName}} </view> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.subItemName!=null && item.subItemName.length>10"> - {{(item.subItemName).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.subItemName}} - </view> --> </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇瑕佹眰:</view> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.itemDemand!=null && item.itemDemand.length>10"> - {{(item.itemDemand).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.itemDemand}} - </view> --> <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> @@ -119,7 +112,7 @@ height: 90, }, sourceType: ['album', 'camera'], - ipAndPort:configService.staticURL, + ipAndPort: configService.staticURL, scrollLeft: 0, searchValue: '', imgList: [], @@ -128,7 +121,7 @@ uploadUrl: "/sys/common/upload", formData: { num: '', - avatar:[], + avatar: [], remark: '', inspectionDate: '', }, @@ -137,7 +130,7 @@ url: { upload: "/eam/sysFiles/batch_upload", stallList: "/eam/weekMaintenanceOrder/queryById", - getEquipmentList:'eam/equipment/list', + getEquipmentList: 'eam/equipment/list', // getEquipmentList: "eam/equipment/asyncLoadEquipment", BaoList: '/eam/weekMaintenanceOrderDetail/queryList' }, @@ -194,31 +187,31 @@ handleCode(e) { this.inspectionResult = e; }, - getEquipment() { - this.$http.get(this.url.getEquipmentList, { - params: { - pageNo: 1, - pageSize: 9999, - order: 'desc', - column: 'createTime' - }, - - }).then(res => { - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - this.equipmentList = res.data.result.records - } else { - uni.showToast({ - icon: "error", - title: res.data.message, - duration: 2000 - }); - - } - }).catch(() => { - this.$tip.error("鑱旂綉澶辫触") - }) - }, + getEquipment() { + this.$http.get(this.url.getEquipmentList, { + params: { + pageNo: 1, + pageSize: 9999, + order: 'desc', + column: 'createTime' + }, + + }).then(res => { + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.equipmentList = res.data.result.records + } else { + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + + } + }).catch(() => { + this.$tip.error("鑱旂綉澶辫触") + }) + }, getList() { this.$http.get(this.url.BaoList, { params: { @@ -237,44 +230,102 @@ //鑱旂綉澶辫触, 缁撴潫鍔犺浇 }) }, - + + + // upCallback() { + // this.$http.get(this.url.stallList, { + // params: { + // id: this.id + // }, + // }).then(res => { + // this.announcement1 = res.data.result + // console.log("url", res) + // //璁剧疆鍒楄〃鏁版嵁 + // if (res.data.success) { + // console.log("res", res.data.result.equipmentCode) + // this.formData.num = this.announcement1.equipmentId + // this.formData.orderNum = this.announcement1.orderNum + // this.formData.operatorPhone_dictText=this.announcement1.operatorPhone_dictText + // this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText + // this.formData.maintenanceDate = this.announcement1.maintenanceDate + // this.formData.operator = this.announcement1.operator_dictText + // this.formData.remark = this.announcement1.remark + // this.formData.avatar = this.announcement1.imageFiles + // const imageObjects = JSON.parse(this.formData.avatar); + // // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + // this.imgList = imageObjects.map(imageObj => { + // return `${this.ipAndPort}${imageObj.filePath}`; + // }); + + // // 鏍规嵁 imgList 鏋勯�� fileLists + // this.fileLists = this.imgList.map(url => ({ + // url: url, + // extname: 'png', + // name: 'eam' + // })); + // } + // }).catch(() => { + // //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + // }) + // }, upCallback() { this.$http.get(this.url.stallList, { params: { id: this.id - }, + } }).then(res => { - this.announcement1 = res.data.result - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data.result.equipmentCode) - this.formData.num = this.announcement1.equipmentId, - this.formData.orderNum = this.announcement1.orderNum, - this.formData.maintenanceDate = this.announcement1.maintenanceDate, - this.formData.operator = this.announcement1.operator, - this.formData.remark = this.announcement1.remark, - this.formData.avatar = this.announcement1.imageFiles - const imageObjects = JSON.parse(this.formData.avatar); - // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� - this.imgList = imageObjects.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }); - - // 鏍规嵁 imgList 鏋勯�� fileLists - this.fileLists = this.imgList.map(url => ({ - url: url, - extname: 'png', - name: 'eam' - })); + this.announcement1 = res.data?.result || {}; + console.log("url", res); + + // 鍒ゆ柇鏄惁鎴愬姛鑾峰彇鏁版嵁 + if (res.data.success && this.announcement1) { + console.log("res", this.announcement1.equipmentCode); + + // 瀹氫箟瀛楁鏄犲皠鍏崇郴 + const fieldMapping = { + num: 'equipmentId', + orderNum: 'orderNum', + operatorPhone_dictText: 'operatorPhone_dictText', + installationPosition_dictText: 'installationPosition_dictText', + maintenanceDate: 'maintenanceDate', + operator_dictText: 'operator_dictText', + remark: 'remark', + avatar: 'imageFiles' + }; + Object.keys(fieldMapping).forEach(key => { + const sourceKey = fieldMapping[key]; + this.formData[key] = this.announcement1[sourceKey] ?? ''; + }); + + // 澶勭悊鍥剧墖鍒楄〃 + this.handleImageFiles(this.formData.avatar); } }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }) + // 鑱旂綉澶辫触, 缁撴潫鍔犺浇 + console.error('璇锋眰澶辫触'); + }); }, + // 鍗曠嫭澶勭悊鍥剧墖鏂囦欢鐨勬柟娉� + handleImageFiles(imageFiles) { + try { + const imageObjects = JSON.parse(imageFiles || '[]'); + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); - + // 鏋勯�� fileLists + this.fileLists = this.imgList.map(url => ({ + url: url, + extname: 'png', + name: 'eam' + })); + } catch (e) { + console.error('瑙f瀽 imageFiles 鍑洪敊:', e); + this.imgList = []; + this.fileLists = []; + } + }, /* 妫�绱� */ getSera(res) { diff --git a/pages/checkList/checkList.vue b/pages/checkList/checkList.vue index feebc11..88c2b17 100644 --- a/pages/checkList/checkList.vue +++ b/pages/checkList/checkList.vue @@ -2,7 +2,7 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <block slot="content">鐐规鍒楄〃</block> + <block slot="content">寰呯偣妫�</block> <block slot="right"> <view @click="search"> <image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" /> @@ -62,6 +62,18 @@ </view> </view> <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">璁惧鍚嶇О:</view> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> + {{item.equipmentName}} + </view> + </view> + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">瀹夎浣嶇疆:</view> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> + {{item.installationPosition}} + </view> + </view> + <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规鏃ユ湡:</view> <view class="flex-sub bg-white padding-xs margin-xs text-blue radius text-right"> {{item.inspectionDate}} @@ -69,7 +81,7 @@ </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规杩囨湡鏃ユ湡:</view> - <view class="flex-sub bg-white padding-xs margin-xs text-blue radius text-right"> + <view class="flex-sub bg-white padding-xs margin-xs text-red radius text-right"> {{item.expirationTime}} </view> </view> @@ -233,15 +245,21 @@ * @param {Object} item * 璇︽儏椤甸潰 */ - onClickProductionTask(item) { - + onClickProductionTask(item, flag = 'task', from = 'detils') { + let url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; uni.navigateTo({ - url: '/pages/checkList/checkListDetils/checkListDetils?item=' + - encodeURIComponent(JSON.stringify(item)) - - }) - + url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}&flag=${flag}&from=${from}` + }); }, + // onClickProductionTask(item) { + + // uni.navigateTo({ + // url: '/pages/checkList/checkListDetils/checkListDetils?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + + // }, search() { this.$refs.popup.open(); diff --git a/pages/checkList/checkListDetils/checkListDetils.vue b/pages/checkList/checkListDetils/checkListDetils.vue index ded0835..ee6752f 100644 --- a/pages/checkList/checkListDetils/checkListDetils.vue +++ b/pages/checkList/checkListDetils/checkListDetils.vue @@ -28,13 +28,20 @@ <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> + <uni-forms-item name="inspectionDate" :label-width="80" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item name="inspectionDate" :label-width="80" label="鐐规鏃ユ湡:"> <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="鐐规浜�:"> - <uni-easyinput v-model="formData.operator" :disabled="true" /> + <uni-forms-item name="operator_dictText" :label-width="80" label="鐐规浜�:"> + <uni-easyinput v-model="formData.operator_dictText" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="澶囨敞"> + <uni-forms-item name="operatorPhone_dictText" :label-width="80" label="鐐规浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item name="remark" :label-width="80" label="澶囨敞"> <uni-easyinput type="textarea" v-model="formData.remark" :disabled="true" /> </uni-forms-item> <uni-forms-item name="outNum" :label-width="80" label="鐐规鍥剧墖:"> @@ -67,14 +74,6 @@ <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> - <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.itemDemand!=null && item.itemDemand.length>10"> - {{(item.itemDemand).toString().substr(0,10)+'...'}} - </view> - - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.itemDemand}} - </view> --> </view> <view class="flex"> @@ -279,68 +278,7 @@ }, - // ChooseImage() { - // var that = this; - // uni.chooseImage({ - // count: 4, - // sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� - // sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 - // success: (res) => { - // // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� - // that.imgList = res.tempFilePaths; - // that.formData.avatar =[]; - // // 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍 - // const uploadPromises = res.tempFilePaths.map((filePath, index) => { - // return new Promise((resolve, reject) => { - // that.$http.upload(that.url.upload, { - // filePath: filePath, - // name: 'file' - // }) - // .then(uploadRes => { - // // 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰� - // const filePath = uploadRes.data.result[0]; - // // 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧 - // this.formData.avatar.push(filePath); - // resolve(filePath); - // }) - // .catch(err => { - // console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); - // reject(err); - // }); - // }); - // }); - - // // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� - // Promise.all(uploadPromises) - // .then((uploadedFilePaths) => { - // console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar); - // }) - // .catch((err) => { - // console.error('鍥剧墖涓婁紶澶辫触:', err); - // that.$tip.error('鍥剧墖涓婁紶澶辫触'); - // }); - // } - // }); - // }, - // ViewImage(e) { - // uni.previewImage({ - // urls: this.imgList, - // current: e.currentTarget.dataset.url - // }); - // }, - // DelImg(e) { - // uni.showModal({ - // title: '鎻愮ず', - // content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', - // cancelText: '鍐嶇湅鐪�', - // confirmText: '鍐嶈', - // success: res => { - // if (res.confirm) { - // this.imgList.splice(e.currentTarget.dataset.index, 1) - // } - // } - // }) - // }, + upCallback() { this.$http.get(this.url.stallList, { @@ -353,8 +291,10 @@ //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { this.formData.num = this.announcement1.equipmentId + this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText this.formData.orderNum = this.announcement1.orderNum - this.formData.operator = this.announcement1.operator + this.formData.operator_dictText = this.announcement1.operator_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText this.formData.remark = this.announcement1.remark this.formData.inspectionDate = this.announcement1.inspectionDate if (this.announcement1.standardId !== null) { diff --git a/pages/device/deviceDeils/deviceDeils.vue b/pages/device/deviceDeils/deviceDeils.vue index 3c86bb0..d335a69 100644 --- a/pages/device/deviceDeils/deviceDeils.vue +++ b/pages/device/deviceDeils/deviceDeils.vue @@ -72,19 +72,12 @@ <!-- 涓嬭浇鎸夐挳 --> <image v-show="showBtn" src="/static/icon_down.png" @click="downloadFile(file)" style="height: 25px; width: 25px; margin-right: 10px;"></image> - <!-- <button size="mini" @click="downloadFile(file)"> - <view class="icon-download">涓嬭浇</view> - </button> --> - <!-- 鍒犻櫎鎸夐挳 --> - <image v-show="showBtn" src="/static/icon_del.png" @click="deleteFile(index)" - style="height: 25px; width: 25px;"></image> - </button> </view> </view> </view> <view class="flex margin-bottom-xs"> - <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" - @click="goReportRepair()">鎶ヤ慨</button> + <button v-if="authIncludes('eam:reportRepair:add')" class="flex-sub cu-btn bg-blue margin-sm lg" + hover-class="is-hover" @click="goReportRepair()">鎶ヤ慨</button> <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @click="goCheck()">鐐规</button> <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @@ -155,7 +148,13 @@ msg1Title: "" } }, + mounted() { + console.log('浠� store 鑾峰彇鐨� auth:', this.$store.getters.getAuth) + }, computed: { + authList() { + return this.$store.getters.getAuth || [] + }, top() { return this.CustomBar * 2 + 160 }, @@ -181,6 +180,9 @@ this.getFileList() }, methods: { + authIncludes(code) { + return this.authList.some(auth => auth.action === code) + }, downloadFile(item) { uni.showModal({ title: '鎻愮ず', @@ -239,44 +241,6 @@ }); }); }, - - - - - // downFile(item) { - // this.$http.download(this.url.downloadFile, { - // params: { - // id:item.id - // }, - // }).then(res => { - // if (!res) { - // this.$message.warning('鏂囦欢涓嬭浇澶辫触') - // return - // } else { - // let fileName = item.fileName; - // if (typeof window.navigator.msSaveBlob !== 'undefined') { - // window.navigator.msSaveBlob(new Blob([res]), fileName); - // } else { - // let url = window.URL.createObjectURL(new Blob([res])); - // let link = document.createElement('a'); - // link.style.display = 'none'; - // link.href = url; - // link.setAttribute('download', fileName); - // document.body.appendChild(link); - // link.click() - // document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 - // window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 - // } - // } - // }).catch((err) => { - // uni.showToast({ - // title: '鑾峰彇鏂囦欢鍒楄〃澶辫触', - // icon: 'none' - // }); - // }); - // }, - - getFileList() { this.$http.get(this.url.fileList, { params: { @@ -410,6 +374,7 @@ uni.redirectTo({ url: `/pages/reportRepair/reportRepair?equipmentId=${encodeURIComponent(this.id)}` }); + }, /** * 鐐规 diff --git a/pages/device/deviceWebDeils/deviceWebDeils.vue b/pages/device/deviceWebDeils/deviceWebDeils.vue index f4502ee..dceca9c 100644 --- a/pages/device/deviceWebDeils/deviceWebDeils.vue +++ b/pages/device/deviceWebDeils/deviceWebDeils.vue @@ -14,46 +14,65 @@ <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - - <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> - <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> - </uni-forms-item> - - <uni-forms-item :label-width="100" name="remark" label="璁惧鍚嶇О:"> - <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> - </uni-forms-item> - <!-- <uni-forms-item :label-width="100" name="outNum" label="鍏抽敭璁惧鏍囪瘑:"> + + <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item :label-width="100" name="remark" label="璁惧鍚嶇О:"> + <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> + </uni-forms-item> + <!-- <uni-forms-item :label-width="100" name="outNum" label="鍏抽敭璁惧鏍囪瘑:"> <uni-easyinput v-model="formData.equipmentImportance" :disabled="true" /> </uni-forms-item> --> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item :label-width="100" name="taskCode" label="缁翠慨鐘舵��:"> - <uni-easyinput :disabled="true" v-model="formData.repairStatus_dictText" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="endLocation" label="淇濆吇鐘舵��:"> - <uni-easyinput :disabled="true" v-model="formData.maintenanceStatus_dictText" /> - - </uni-forms-item> - <uni-forms-item :label-width="100" name="endLocation" label="浣跨敤杞﹂棿:"> - <uni-easyinput :disabled="true" v-model="formData.orgId_dictText" /> - - </uni-forms-item> - - <uni-forms-item :label-width="100" name="endLocation" label="瀹夎浣嶇疆:"> - <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="endLocation" label="鎶�鏈姸鎬�:"> - <uni-easyinput :disabled="true" v-model="formData.technologyStatus_dictText" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="endLocation" label="璁惧绠$悊鍛�:"> - <uni-easyinput :disabled="true" v-model="formData.equipmentManager_dictText" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="endLocation" label="鍑哄巶鏃ユ湡:"> - <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> - </uni-forms-item> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="100" name="taskCode" label="缁翠慨鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.repairStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="淇濆吇鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.maintenanceStatus_dictText" /> + + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="浣跨敤杞﹂棿:"> + <uni-easyinput :disabled="true" v-model="formData.orgId_dictText" /> + + </uni-forms-item> + + <uni-forms-item :label-width="100" name="endLocation" label="瀹夎浣嶇疆:"> + <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鎶�鏈姸鎬�:"> + <uni-easyinput :disabled="true" v-model="formData.technologyStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="璁惧绠$悊鍛�:"> + <uni-easyinput :disabled="true" v-model="formData.equipmentManager_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鍑哄巶鏃ユ湡:"> + <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> + </uni-forms-item> </uni-group> </uni-forms> + <view class="file-list margin-sm"> + <view class="file-item" v-for="(file, index) in this.selectedFiles" :key="index"> + <view class="file-icon"> + <!-- 鏂囦欢鍥炬爣 --> + <image src="/static/icon_file.png" style="height: 25px; width: 25px; margin-right: 10px;" + mode='aspectFit' class="zai-logo "></image> + + </view> + <view class="file-name"> + <!-- 鏂囦欢鍚� --> + {{file.fileName}} + </view> + <view class="file-actions"> + <!-- 涓嬭浇鎸夐挳 --> + <image v-show="showBtn" src="/static/icon_down.png" @click="downloadFile(file)" + style="height: 25px; width: 25px; margin-right: 10px;"></image> + </view> + </view> + </view> <view class="flex margin-bottom-xs"> - <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + <button v-if="authIncludes('eam:reportRepair:add')" class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @click="goReportRepair()">鎶ヤ慨</button> <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @click="goCheck()">鐐规</button> @@ -71,15 +90,24 @@ stringify } from "querystring"; import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import { + saveAs + } from 'file-saver'; // 寮曞叆 file-saver 搴� export default { mixins: [MescrollMixin], // 浣跨敤mixin data() { return { - formData: {}, + formData: { + fileLists: [] + }, + fileLists: [], NavBarColor: this.NavBarColor, url: { - stallList: "/eam/equipment/queryById" + stallList: "/eam/equipment/queryById", + add: 'eam/equipmentAttachment/add', + upload: "/eam/sysFiles/batch_upload", + downloadFile: 'eam/equipmentAttachment/downloadFile' }, id: '', upOption: { @@ -105,7 +133,11 @@ msg1Title: "" } }, + computed: { + authList() { + return this.$store.getters.getAuth || [] + }, top() { return this.CustomBar * 2 + 160 }, @@ -120,11 +152,6 @@ onLoad(options) { const decodedEquipmentId = decodeURIComponent(options.equipmentId); this.id = decodedEquipmentId; - // const data = options.query; - // this.id = JSON.parse(data).equipmentId; - // console.log(data) - // this.id = options.equipmentId; - // console.log(options) console.log(this.id) if (!this.id) { uni.showModal({ @@ -157,7 +184,192 @@ }, created() {}, methods: { + authIncludes(code) { + return this.authList.some(auth => auth.action === code) + }, + downloadFile(item) { + uni.showModal({ + title: '鎻愮ず', + content: '纭瑕佷笅杞藉悧', + cancelText: '鍙栨秷', + confirmText: '纭', + success: res => { + if (res.confirm) { + this.downFile(item) + } + } + }) + }, + + + downFile(item) { + this.$http.download(this.url.downloadFile, { + params: { + id: item.id + }, + responseType: 'blob' // 纭繚鍝嶅簲绫诲瀷涓� blob + }).then(response => { + console.log('Response:', response); // 鏌ョ湅瀹屾暣鍝嶅簲缁撴瀯 + + // 鑾峰彇 tempFilePath锛圔lob URL锛� + const tempFilePath = response.tempFilePath; + + if (!tempFilePath) { + uni.showToast({ + title: '鏂囦欢涓嬭浇澶辫触', + icon: 'none' + }); + return; + } + + let fileName = item.fileName; + + // 鍒涘缓 <a> 鏍囩骞惰Е鍙戜笅杞� + const link = document.createElement('a'); + link.href = tempFilePath; + link.setAttribute('download', fileName); + link.style.display = 'none'; + + document.body.appendChild(link); + link.click(); + + // 娓呯悊璧勬簮 + document.body.removeChild(link); + + }).catch(err => { + console.error('Download error:', err); + uni.showToast({ + title: '鏂囦欢涓嬭浇澶辫触', + icon: 'none' + }); + }); + }, + getFileList() { + this.$http.get(this.url.fileList, { + params: { + equipmentId: this.id, + pageNo: 1, + pageSize: 999, + column: 'createTime', + order: 'desc' + }, + }).then(res => { + if (res.data.success) { + this.selectedFiles = res.data.result.records || []; + + } + }).catch(() => { + uni.showToast({ + title: '鑾峰彇鏂囦欢鍒楄〃澶辫触', + icon: 'none' + }); + }); + }, + uploadFail(e) { + console.log('涓婁紶澶辫触锛�', e) + }, + + + + onFileSelect(e) { + const tempFilePaths = e.tempFilePaths; + + uni.showLoading({ + title: '涓婁紶涓�...' + }); + + const uploadPromises = tempFilePaths.map((filePath, index) => { + return new Promise((resolve, reject) => { + this.$http.upload(this.url.upload, { + filePath: filePath, + name: 'file' + }) + .then(uploadRes => { + const serverFile = uploadRes.data.result[0]; + console.log(serverFile); + // 鎻愬彇fileSuffix骞舵嫾鎺� + if (serverFile.fileSuffix && serverFile.fileName && !serverFile + .fileName.includes('.')) { + serverFile.fileName += '.' + serverFile.fileSuffix; + } + this.fileLists = []; + // 闃叉閲嶅娣诲姞锛堟牴鎹� id 鎴� fileName 鍒ゆ柇锛� + if (!this.fileLists.some(file => file.id === serverFile.id)) { + this.fileLists.push(serverFile); + } + resolve(); + }) + .catch(err => { + console.error(`鏂囦欢 ${index + 1} 涓婁紶澶辫触`, err); + uni.showToast({ + title: `绗� ${index + 1} 涓枃浠朵笂浼犲け璐, + icon: 'none' + }); + reject(err); + }); + }); + }); + + Promise.all(uploadPromises) + .then(() => { + uni.hideLoading(); + uni.showToast({ + title: '鍏ㄩ儴涓婁紶鎴愬姛锛屾鍦ㄦ彁浜�...' + }); + this.submitFileList(); // 鑷姩鎻愪氦鎵�鏈夋枃浠� + }) + .catch(() => { + uni.hideLoading(); + uni.showToast({ + title: '閮ㄥ垎涓婁紶澶辫触', + icon: 'none' + }); + }); + }, + // 鏂囦欢鍒犻櫎鍥炶皟 + onFileDelete(e) { + console.log('鍒犻櫎鏂囦欢:', e.index); + }, + + // 鍒犻櫎鍗曚釜鏂囦欢 + deleteFile(index) { + this.fileLists.splice(index, 1); + }, + + + submitFileList() { + if (!this.fileLists.length) { + uni.showToast({ + title: '娌℃湁鍙彁浜ょ殑鏂囦欢', + icon: 'none' + }); + return; + } + console.log(this.fileLists) + this.$http.post(this.url.add, { + equipmentId: this.id, + fileList: this.fileLists + }).then(res => { + if (res.data.success) { + uni.showToast({ + title: '鎻愪氦鎴愬姛' + }); + this.getFileList(); + } else { + uni.showToast({ + title: '鎻愪氦澶辫触', + icon: 'none' + }); + } + }).catch(err => { + uni.showToast({ + title: '鎻愪氦寮傚父', + icon: 'none' + }); + console.error('鎻愪氦澶辫触:', err); + }); + }, goHome() { uni.reLaunch({ url: '/pages/index/index' @@ -167,7 +379,6 @@ * 鎶ヤ慨 */ goReportRepair() { - console.log('getSera 鏂规硶琚皟鐢�'); uni.redirectTo({ url: `/pages/reportRepair/reportRepair?equipmentId=${encodeURIComponent(this.id)}` }); diff --git a/pages/home/home.vue b/pages/home/home.vue index 5f4136a..2a927ef 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -203,7 +203,6 @@ taskCountBySelf() { let token = uni.getStorageSync(ACCESS_TOKEN) this.$http.get(this.url.countItem).then(res => { - console.log("res::taskCountBySelf>", res) this.toDomsgCount = res.data.result }) }, diff --git a/pages/login/loginOauth2.vue b/pages/login/loginOauth2.vue index 0e7665b..8df0d77 100644 --- a/pages/login/loginOauth2.vue +++ b/pages/login/loginOauth2.vue @@ -1,12 +1,12 @@ <template> - <view class="zai-box"> - <!-- 鐧诲綍鍔犺浇寮圭獥 --> - <view class="cu-load load-modal"> - <image src="https://static.jeecg.com/upload/test/login4_1595818039175.png" mode="aspectFit" - class="round"></image> - <view class="gray-text">姝e湪鐧诲綍涓�...</view> - </view> + <view class="zai-box"> + <!-- 鐧诲綍鍔犺浇寮圭獥 --> + <view class="cu-load load-modal"> + <image src="https://static.jeecg.com/upload/test/login4_1595818039175.png" mode="aspectFit" + class="round"></image> + <view class="gray-text">姝e湪鐧诲綍涓�...</view> </view> + </view> </template> @@ -17,184 +17,196 @@ import configService from '@/common/service/config.service.js'; export default { - data() { - return { - loading: false, - env: { - thirdType: '', - thirdApp: false, - wxWork: false, - dingtalk: false, - }, - redirectUrl: '' - }; + data() { + return { + loading: false, + env: { + thirdType: '', + thirdApp: false, + wxWork: false, + dingtalk: false, + }, + redirectUrl: '' + }; + }, + beforeCreate() { + // 濡傛灉褰撳墠 涓嶆槸 OAuth2APP鐜锛屽氨閲嶅畾鍚戝埌 /user/login 椤甸潰 + if (!isOAuth2AppEnv()) { + this.$Router.replace({name: 'login'}) + } + }, + created() { + this.checkEnv() + this.doOAuth2Login() + }, + methods: { + ...mapActions(['ThirdLogin']), + /** 妫�娴嬪綋鍓嶇殑鐜 */ + checkEnv() { + // 鍒ゆ柇褰撴椂鏄惁鏄紒涓氬井淇$幆澧� + if (/wxwork/i.test(navigator.userAgent)) { + this.env.thirdApp = true + this.env.wxWork = true + this.env.thirdType = 'wechat_enterprise' + } + // 鍒ゆ柇褰撴椂鏄惁鏄拤閽夌幆澧� + if (/dingtalk/i.test(navigator.userAgent)) { + this.env.thirdApp = true + this.env.dingtalk = true + //this.env.thirdType='dingtalk' + } }, - beforeCreate() { - // 濡傛灉褰撳墠 涓嶆槸 OAuth2APP鐜锛屽氨閲嶅畾鍚戝埌 /user/login 椤甸潰 - if (!isOAuth2AppEnv()) { - this.$Router.replace({name: 'login'}) + + /** 杩涜OAuth2鐧诲綍鎿嶄綔 */ + doOAuth2Login() { + if (this.env.thirdApp) { + // 鍒ゆ柇鏄惁鎼哄甫浜員oken锛屾槸灏辫鏄庣櫥褰曟垚鍔� + this.redirectUrl = '' + let search = window.location.search; + if (search.indexOf('hasToken') > 0) { + let obj = getUrlParams(search); + if (obj.params.redirect) { + this.redirectUrl = decodeURIComponent(decodeURIComponent(obj.params.redirect)); + this.goRedirectUrl(); + } else { + alert('hasToken鍙傛暟閿欒!') + } + } else if (search.indexOf('oauth2LoginToken') > 0) { + let obj = getUrlParams(search); + this.env.thirdType = obj.params.thirdType; + let token = obj.params.oauth2LoginToken; + if (obj.params.redirect) { + this.redirectUrl = decodeURIComponent(obj.params.redirect) + } + this.doThirdLogin(token) + } else if (this.env.wxWork) { + this.doWechatEnterpriseOAuth2Login() + } else if (this.env.dingtalk) { + this.doDingTalkOAuth2Login() } + } }, - created() { - this.checkEnv() - this.doOAuth2Login() + + // 鏍规嵁token鎵ц鐧诲綍 + doThirdLogin(token) { + this.ThirdLogin({token: token, thirdType: this.env.thirdType}).then(res => { + if (res.data.success) { + uni.showToast({ + title: '鐧诲綍', + icon: 'none', + duration: 3000, + content: res + }); + this.loginSuccess() + + } else { + this.requestFailed(res) + } + }).catch((e) => { + alert(e.message || e) + }) }, - methods: { - ...mapActions(['ThirdLogin']), - /** 妫�娴嬪綋鍓嶇殑鐜 */ - checkEnv() { - // 鍒ゆ柇褰撴椂鏄惁鏄紒涓氬井淇$幆澧� - if (/wxwork/i.test(navigator.userAgent)) { - this.env.thirdApp = true - this.env.wxWork = true - //this.env.thirdType='wechat_enterprise' - } - // 鍒ゆ柇褰撴椂鏄惁鏄拤閽夌幆澧� - if (/dingtalk/i.test(navigator.userAgent)) { - this.env.thirdApp = true - this.env.dingtalk = true - //this.env.thirdType='dingtalk' - } - }, + loginSuccess() { + this.$Router.replaceAll({name: 'index'}) + }, + requestFailed(err) { + uni.showToast({ + title: '鐧诲綍', + icon: 'none', + duration: 3000, + content: err + }); + }, + goRedirectUrl() { + let obj = getUrlParams(this.redirectUrl); + let path = obj.url; + let params = obj.params; + if (params.info) { + let temp = JSON.parse(params.info); + let query = { + instanceId: temp.procInsId, + taskId: temp.taskId, + taskDefKey: temp.taskDefKey + } + if (temp.claim == 1) { + query['claim'] = 1 + } + this.$Router.replaceAll({path, query}) + } else { + this.$Router.replaceAll({path}) + } + }, + /** 浼佷笟寰俊OAuth2鐧诲綍 */ + doWechatEnterpriseOAuth2Login() { + this.sysOAuth2Login('wechat_enterprise') + }, - /** 杩涜OAuth2鐧诲綍鎿嶄綔 */ - doOAuth2Login() { - if (this.env.thirdApp) { - // 鍒ゆ柇鏄惁鎼哄甫浜員oken锛屾槸灏辫鏄庣櫥褰曟垚鍔� - this.redirectUrl = '' - let search = window.location.search; - if (search.indexOf('hasToken') > 0) { - let obj = getUrlParams(search); - if (obj.params.redirect) { - this.redirectUrl = decodeURIComponent(decodeURIComponent(obj.params.redirect)); - this.goRedirectUrl(); - } else { - alert('hasToken鍙傛暟閿欒!') - } - } else if (search.indexOf('oauth2LoginToken') > 0) { - let obj = getUrlParams(search); - this.env.thirdType = obj.params.thirdType; - let token = obj.params.oauth2LoginToken; - if (obj.params.redirect) { - this.redirectUrl = decodeURIComponent(obj.params.redirect) - } - this.doThirdLogin(token) - } else if (this.env.wxWork) { - this.doWechatEnterpriseOAuth2Login() - } else if (this.env.dingtalk) { - this.doDingTalkOAuth2Login() - } - } - }, + /** 閽夐拤OAuth2鐧诲綍 */ + doDingTalkOAuth2Login() { + this.sysOAuth2Login('dingtalk') + }, - // 鏍规嵁token鎵ц鐧诲綍 - doThirdLogin(token) { - this.ThirdLogin({token: token, thirdType: this.env.thirdType}).then(res => { - if (res.data.success) { - this.loginSuccess() - } else { - this.requestFailed(res) - } - }).catch((e) => { - alert(e.message || e) - }) - }, - loginSuccess() { - this.$Router.replaceAll({name: 'index'}) - }, - requestFailed(err) { - this.$message.warning("鐧诲綍澶辫触") - }, - goRedirectUrl() { - let obj = getUrlParams(this.redirectUrl); - let path = obj.url; - let params = obj.params; - if (params.info) { - let temp = JSON.parse(params.info); - let query = { - instanceId: temp.procInsId, - taskId: temp.taskId, - taskDefKey: temp.taskDefKey - } - if (temp.claim == 1) { - query['claim'] = 1 - } - this.$Router.replaceAll({path, query}) - } else { - this.$Router.replaceAll({path}) - } - }, - /** 浼佷笟寰俊OAuth2鐧诲綍 */ - doWechatEnterpriseOAuth2Login() { - this.sysOAuth2Login('wechat_enterprise') - }, - - /** 閽夐拤OAuth2鐧诲綍 */ - doDingTalkOAuth2Login() { - this.sysOAuth2Login('dingtalk') - }, - - /** 鍚庡彴鏋勯�爋auth2鐧诲綍鍦板潃 */ - sysOAuth2Login(source) { + /** 鍚庡彴鏋勯�爋auth2鐧诲綍鍦板潃 */ + sysOAuth2Login(source) { let domainURL = configService.apiUrl; - let url = `${domainURL}/sys/thirdLogin/oauth2/${source}/login`; + let url = `http://houjie.xalxzn.com:8866/jeecg-boot/sys/thirdLogin/oauth2/${source}/login`; let state = window.location.origin + window.location.search url += `?state=${encodeURIComponent(state)}`; console.log('sysOAuth2Login====銆�', url) - window.location.href = url; - }, - } + window.location.href = url; + }, + } } </script> <style> .login-paddingtop { - padding-top: 100 upx; + padding-top: 100upx; } .zai-box { - padding: 0 20 upx; - padding-top: 100 upx; - position: relative; + padding: 0 20upx; + padding-top: 100upx; + position: relative; } .zai-logo { - width: 200 upx; - height: 150px; + width: 200upx; + height: 150px; } .zai-title { - font-size: 58 upx; - color: #000000; - text-align: center; + font-size: 58upx; + color: #000000; + text-align: center; } .input-placeholder, .zai-input { - color: #94afce; + color: #94afce; } .zai-label { - padding: 60 upx 0; - text-align: center; - font-size: 30 upx; - color: #a7b6d0; + padding: 60upx 0; + text-align: center; + font-size: 30upx; + color: #a7b6d0; } .zai-btn { - background: #ff65a3; - color: #fff; - border: 0; - border-radius: 100 upx; - font-size: 36 upx; + background: #ff65a3; + color: #fff; + border: 0; + border-radius: 100upx; + font-size: 36upx; } .zai-btn:after { - border: 0; + border: 0; } /*鎸夐挳鐐瑰嚮鏁堟灉*/ .zai-btn.button-hover { - transform: translate(1 upx, 1 upx); + transform: translate(1upx, 1upx); } </style> diff --git a/pages/maintenanceReport/maintenanceReport.vue b/pages/maintenanceReport/maintenanceReport.vue index 28d3333..997c486 100644 --- a/pages/maintenanceReport/maintenanceReport.vue +++ b/pages/maintenanceReport/maintenanceReport.vue @@ -1,9 +1,14 @@ <template> <view class="container"> - <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> - <block slot="backText">杩斿洖</block> - <block slot="content">缁翠慨</block> - </cu-custom> + <cu-custom :bgColor="NavBarColor" :isBack="true"> + <block slot="backText">杩斿洖</block> + <block slot="content">寰呯淮淇�</block> + <block slot="right"> + <view @click="search"> + <image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" /> + </view> + </block> + </cu-custom> <view style="width: 100%;"> <uni-popup ref="popup" background-color="#fff" :type="type"> @@ -11,11 +16,8 @@ <!-- 鍩虹琛ㄥ崟鏍¢獙 --> <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group title="" top="0"> - <uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:"> - <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" /> - </uni-forms-item> - <uni-forms-item name="name" label="棰嗘枡浜у搧:"> - <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + <uni-forms-item name="numbers" label="宸ュ崟缂栧彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ュ伐鍗曠紪鍙锋绱�" /> </uni-forms-item> </uni-group> </uni-forms> @@ -40,17 +42,29 @@ <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" @click="onClickProductionTask(item)"> - + <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">璁惧缂栧彿:</view> <view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right"> - {{item.equipmentId_dictText}} + {{item.equipmentCode}} </view> </view> <view class="flex"> - <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鏁呴殰绠�绉�:</view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> - {{item.faultName}} + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">璁惧鍚嶇О:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right"> + {{item.equipmentName}} + </view> + </view> + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">瀹夎浣嶇疆:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-blue radius text-right"> + {{item.installationPosition}} + </view> + </view> + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">缁翠慨鐘舵��:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-green radius text-right"> + {{item.reportStatus_dictText}} </view> </view> <view class="flex"> @@ -59,8 +73,7 @@ {{item.faultStartTime}} </view> </view> - - + <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鎿嶄綔:</view> <view v-if="authIncludes('eam:repair:collect')" @@ -204,11 +217,11 @@ */ onClickProductionTask(item) { - uni.navigateTo({ - url: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils?item=' + - encodeURIComponent(JSON.stringify(item)) + // uni.navigateTo({ + // url: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils?item=' + + // encodeURIComponent(JSON.stringify(item)) - }) + // }) }, search() { @@ -255,7 +268,6 @@ resetTask() { this.formData.num = '' - this.formData.partNumNameModel = '' this.$refs.popup.close(); this.mescroll.resetUpScroll() @@ -263,19 +275,17 @@ /* 妫�绱� */ getSera() { this.$refs.popup.close(); - let keyword = this.TabCur + this.msgList = []; - - if (keyword == 0) { this.$http.get(this.url.stallList, { params: { pageNo: 1, pageSize: 999, order: "desc", column: "createTime", - num: '*' + this.formData.num + '*', - partNumNameModel: '*' + this.formData.partNumNameModel + '*', - status: 'published' + repairCode:this.formData.num, + reportStatus: 'WAIT_REPAIR', + equipmentId: this.equipmentId || '' } }).then(res => { //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; @@ -301,87 +311,6 @@ //鑱旂綉澶辫触, 缁撴潫鍔犺浇 this.mescroll.endErr(); }) - - } else if (keyword == 1) { - this.$http.get(this.url.stallList, { - params: { - pageNo: 1, - pageSize: 999, - order: "desc", - column: "createTime", - status: 'training', - num: '*' + this.formData.num + '*', - partNumNameModel: '*' + this.formData.partNumNameModel + '*' - - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - - this.announcement1 = res.data.result.records - this.mescroll.endSuccess(this.announcement1.length); - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data) - this.msg1Count = res.data.result.total - this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; - for (let annItem of this.announcement1) { - this.msgList.push(annItem) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� - } - - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - }) - - } else if (keyword == 2) { - this.$http.get(this.url.stallList, { - params: { - pageNo: 1, - pageSize: 999, - order: "desc", - column: "createTime", - status: 'completed', - num: '*' + this.formData.num + '*', - partNumNameModel: '*' + this.formData.partNumNameModel + '*' - - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - - this.announcement1 = res.data.result.records - this.mescroll.endSuccess(this.announcement1.length); - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data) - this.msg3Count = res.data.result.total - this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; - for (let annItem of this.announcement1) { - this.msgList.push(annItem) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� - } - - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - }) - - } - - - - - }, diff --git a/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue b/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue index 8b4c096..ba3b5cb 100644 --- a/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue +++ b/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue @@ -9,17 +9,20 @@ <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <!-- <uni-forms-item name="num" :label-width="100" label="宸ュ崟鍙�:"> + <!-- <uni-forms-item name="num" :label-width="100" label="宸ュ崟缂栧彿:"> <uni-easyinput v-model="formData.repairCode" :disabled="true" /> </uni-forms-item> --> - <uni-forms-item required name="num" :label-width="100" label="璁惧缂栧彿:"> + <uni-forms-item name="num" :label-width="100" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="faultStartTime" :label-width="100" label="鏁呴殰寮�濮嬫椂闂�:"> - <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> + <uni-forms-item name="equipmentName" :label-width="100" label="璁惧鍚嶇О:"> + <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="reportStatus" :label-width="100" label="鎶ヤ慨鐘舵��:"> + <uni-forms-item name="installationPosition_dictText" :label-width="100" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="reportStatus" :label-width="100" label="缁翠慨鐘舵��:"> <uni-easyinput v-model="formData.reportStatus" :disabled="true" /> </uni-forms-item> <uni-forms-item name="faultName" :label-width="100" label="鏁呴殰绠�绉�"> @@ -28,14 +31,20 @@ <uni-forms-item name="outNum" :label-width="100" label="鏁呴殰鎻忚堪:"> <uni-easyinput v-model="formData.faultDescription" :disabled="true" /> </uni-forms-item> + <uni-forms-item name="faultStartTime" :label-width="100" label="鏁呴殰寮�濮嬫椂闂�:"> + <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="repairer_dictText" label="鏄惁鍋滄満:"> + <uni-easyinput v-model="formData.breakdownFlag_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item name="remark" :label-width="100" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="100" label="缁翠慨鍥剧墖:"> + <uni-forms-item name="outNum" :label-width="100" label="鎶ヤ慨鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" @select="select" @progress="progress" @success="success" - @fail="fail" @delete="deletea" :readonly="true" /> - + @fail="fail" @delete="deletea" :readonly="true" /> + </uni-forms-item> </uni-group> </uni-forms> @@ -69,7 +78,18 @@ uploadUrl: "/sys/common/upload", formData: { num: '', - avatar: [] + avatar: [], + equipmentName: '', + installationPosition: '', + breakdownFlag_dictText: '', + + reporter_dictText: '', + + faultStartTime: '', + reportStatus: '', + faultName: '', + faultDescription: '', + remark: '' }, NavBarColor: this.NavBarColor, url: { @@ -116,7 +136,43 @@ onLoad(options) { const annItem = JSON.parse(decodeURIComponent(options.item)); - this.id = annItem.id + + + this.formData.installationPosition_dictText = annItem.installationPosition + this.formData.num = annItem.equipmentId + this.formData.equipmentName = annItem.equipmentName + this.formData.breakdownFlag_dictText = annItem.breakdownFlag_dictText + this.formData.faultStartTime = annItem.faultStartTime + this.formData.reportStatus = annItem.reportStatus_dictText + this.formData.faultName = annItem.faultName + this.formData.faultDescription = annItem.faultDescription + this.formData.remark = annItem.remark + this.formData.avatar = annItem.imageFiles || '[]'; // 榛樿绌烘暟缁勫瓧绗︿覆 + try { + const imageObjects = JSON.parse(this.formData.avatar); + + // 纭繚 imageObjects 鏄暟缁勭被鍨� + if (Array.isArray(imageObjects)) { + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + + // 鏋勯�� fileLists + this.fileLists = this.imgList.map(url => ({ + url: url, + extname: 'png', + name: 'eam' + })); + } else { + console.warn('imageObjects is not an array:', imageObjects); + this.imgList = []; + this.fileLists = []; + } + } catch (e) { + console.error('Failed to parse avatar JSON:', e); + this.imgList = []; + this.fileLists = []; + } }, created() { this.getEquipment(); @@ -126,44 +182,49 @@ changeEquipmentList(e) { this.formData.num = e; }, - upCallback() { - this.$http.get(this.url.stallList, { - params: { - id: this.id - }, + // upCallback() { + // this.$http.get(this.url.stallList, { + // params: { + // id: this.id + // }, - }).then(res => { - this.announcement1 = res.data.result - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data.result) - this.formData.repairCode = this.announcement1.repairCode - this.formData.num = this.announcement1.equipmentId - this.formData.faultStartTime = this.announcement1.faultStartTime - this.formData.reportStatus = this.announcement1.reportStatus_dictText - this.formData.faultName = this.announcement1.faultName - this.formData.faultDescription = this.announcement1.faultDescription - this.formData.remark = this.announcement1.remark - this.formData.avatar = this.announcement1.imageFiles - this.imgList = JSON.parse(this.formData.avatar) - const imageObjects = JSON.parse(this.formData.avatar); - // 鍋囪 imgList 鏄凡鏈夌殑鍥剧墖鍦板潃鏁扮粍 - this.imgList = imageObjects.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }); + // }).then(res => { + // this.announcement1 = res.data.result + // console.log("url", res) + // //璁剧疆鍒楄〃鏁版嵁 + // if (res.data.success) { + // console.log("res", res.data.result) + // this.formData.repairCode = this.announcement1.repairCode + // this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText + // this.formData.num = this.announcement1.equipmentId + // this.formData.repairer_dictText = this.announcement1.repairer_dictText + // this.formData.repairerPhone_dictText = this.announcement1.repairerPhone_dictText + // this.formData.reporter_dictText = this.announcement1.reporter_dictText + // this.formData.reporterPhone_dictText = this.announcement1.reporterPhone_dictText + // this.formData.faultStartTime = this.announcement1.faultStartTime + // this.formData.reportStatus = this.announcement1.reportStatus_dictText + // this.formData.faultName = this.announcement1.faultName + // this.formData.faultDescription = this.announcement1.faultDescription + // this.formData.remark = this.announcement1.remark + // this.formData.avatar = this.announcement1.imageFiles + // this.imgList = JSON.parse(this.formData.avatar) + // const imageObjects = JSON.parse(this.formData.avatar); + // // 鍋囪 imgList 鏄凡鏈夌殑鍥剧墖鍦板潃鏁扮粍 + // this.imgList = imageObjects.map(imageObj => { + // return `${this.ipAndPort}${imageObj.filePath}`; + // }); - // 鏍规嵁 imgList 鏋勯�� fileLists - this.fileLists = this.imgList.map(url => ({ - url: url, - extname: 'png', - name: 'eam' - })); - } - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }) - }, + // // 鏍规嵁 imgList 鏋勯�� fileLists + // this.fileLists = this.imgList.map(url => ({ + // url: url, + // extname: 'png', + // name: 'eam' + // })); + // } + // }).catch(() => { + // //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + // }) + // }, getEquipment() { this.$http.get(this.url.getEquipmentList, { diff --git a/pages/reportRepair/reportRepair.vue b/pages/reportRepair/reportRepair.vue index 5c506e0..dff451c 100644 --- a/pages/reportRepair/reportRepair.vue +++ b/pages/reportRepair/reportRepair.vue @@ -1,5 +1,5 @@ <template> - <view class="container"> + <view v-if="authIncludes('eam:reportRepair:add')" class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> <block slot="content">鏂板-鎶ヤ慨</block> @@ -7,12 +7,9 @@ <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <!-- <uni-forms-item required name="num" label="璁惧缂栧彿:"> - <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" - placeholder="璇烽�夋嫨" /> - </uni-forms-item> --> + <uni-forms-item required :label-width="100" name="num" label="璁惧缂栧彿:"> - <uni-easyinput v-model=" formData.numSear" placeholder="璇烽�夋嫨" :disabled="true" suffixIcon="search" + <uni-easyinput v-model="formData.numSear" placeholder="璇烽�夋嫨" :disabled="true" suffixIcon="search" @iconClick="OnenterpriseId()" /> </uni-forms-item> <uni-forms-item required :label-width="100" name="name" label="鏁呴殰绠�绉�:"> @@ -23,7 +20,7 @@ <uni-easyinput v-model="formData.faultType" :disabled='true' /> </uni-forms-item> <uni-forms-item required :label-width="100" name="faultDescription" label="鏁呴殰鎻忚堪:"> - <uni-easyinput v-model="formData.faultDescription" :disabled='true' /> + <uni-easyinput v-model="formData.faultDescription" /> </uni-forms-item> <uni-forms-item required name="name" :label-width="100" label="鏄惁鍋滄満:"> <uni-data-select v-model="formData.breakdownFlag" :localdata="isTrueList" @change="changeisTrueList" @@ -46,10 +43,20 @@ <view class="padding flex flex-direction"> <view class="flex-sub bg-blue padding-sm margin-xl radius text-sm text-center text-white" - @click.stop="ProductionTask()" hover-class="is-hover">鎻愪氦</view> + @click.stop="ProductionTask()" hover-class="is-hover">鎻愪氦</view> </view> + </view> + <view v-else class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鏂板-鎶ヤ慨</block> + </cu-custom> + + <view class="padding flex flex-direction"> + 褰撳墠鐢ㄦ埛娌℃湁鎿嶄綔鏉冮檺 + </view> </view> </template> @@ -57,7 +64,7 @@ import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; export default { mixins: [MescrollMixin], // 浣跨敤mixin - + data() { return { // 鍥剧墖鍥炴樉 @@ -73,11 +80,11 @@ equipmentList: [], isTrueList: [{ text: "鏄�", - value: "0" + value: 0 }, { text: "鍚�", - value: "1" + value: 1 } ], type: 'top', @@ -91,7 +98,7 @@ faultNameList: [], faultName: '', faultType: '', - breakdownFlag: '1', + breakdownFlag: 1, loadTime: Date.now(), faultDescription: '' }, @@ -129,10 +136,16 @@ msg2Count: 0, msg1Title: "", equipmentId: '', - AuthLsit:[] + AuthLsit: [] } }, + mounted() { + console.log('浠� store 鑾峰彇鐨� auth:', this.$store.getters.getAuth) + }, computed: { + authList() { + return this.$store.getters.getAuth || [] + }, top() { return this.CustomBar * 2 + 130 }, @@ -167,10 +180,13 @@ this.getSera() }, created() { - + this.getfaultReasonList(); }, methods: { + authIncludes(code) { + return this.authList.some(auth => auth.action === code) + }, getSera() { //鑱旂綉鍔犺浇鏁版嵁 this.$http.get(this.url.part, { @@ -243,6 +259,7 @@ }, changeisTrueList(e) { + console.log(e) this.formData.breakdownFlag = e; }, select(e) { @@ -303,14 +320,19 @@ console.log('鍒犻櫎鍥剧墖', e); }, ProductionTask() { - if (this.formData.num == 0 || this.formData.num == undefined) { + console.log(this.formData.num) + + + if (this.formData.num === undefined || this.formData.num === null || this.formData.num === '') { uni.showToast({ icon: "none", title: '璁惧缂栧彿涓虹┖!', duration: 2000 }); - return false + return false; } + + if (this.formData.faultName == 0 || this.formData.faultName == undefined) { uni.showToast({ icon: "none", @@ -319,14 +341,24 @@ }); return false } - if (this.formData.breakdownFlag == 0 || this.formData.breakdownFlag == undefined) { + if (this.formData.faultDescription == 0 || this.formData.faultDescription == undefined) { + uni.showToast({ + icon: "none", + title: '鏁呴殰鎻忚堪涓虹┖!', + duration: 2000 + }); + return false + } + + if (this.formData.breakdownFlag === undefined || this.formData.breakdownFlag === null) { uni.showToast({ icon: "none", title: '鏄惁鍋滄満涓虹┖!', duration: 2000 }); - return false + return false; } + // 璇锋眰寮�濮� 澧炲姞閬僵灞� uni.showLoading({ mask: true, @@ -351,10 +383,12 @@ duration: 2000 }); console.log(this.equipmentId) + // uni.reLaunch({ + // url: `/pages/reportRepair/reportRepairList/reportRepairList?equipmentId=${this.equipmentId}` + // }) uni.reLaunch({ - url: `/pages/reportRepair/reportRepairList/reportRepairList?equipmentId=${this.equipmentId}` + url: '/pages/index/index' }) - } else { uni.showToast({ icon: "error", diff --git a/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue b/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue index 6049190..e5140d1 100644 --- a/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue +++ b/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue @@ -17,7 +17,7 @@ <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> </uni-forms-item> --> <uni-forms-item name="reportStatus_dictText" :label-width="80" label="鎶ヤ慨鐘舵��:"> - <uni-easyinput v-model="formData.reportStatus_dictText" :disabled="true" /> + <uni-easyinput v-model="formData.reportStatus_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item name="faultType" :label-width="80" label="鏁呴殰鍒嗙被:"> @@ -61,6 +61,7 @@ </template> <script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; import configService from '@/common/service/config.service.js' import { @@ -247,7 +248,7 @@ this.formData.breakdownFlag_dictText = this.announcement1.breakdownFlag_dictText this.formData.reportStatus_dictText=this.announcement1.reportStatus_dictText // this.formData.installationPosition=this.announcement1.installationPosition - this.formData.faultType=this.announcement1.faultType + this.formData.faultType=this.announcement1.faultType_dictText this.formData.avatar = this.announcement1.imageFiles const imageObjects = JSON.parse(this.formData.avatar); // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� diff --git a/pages/reportRepair/reportRepairList/reportRepairList.vue b/pages/reportRepair/reportRepairList/reportRepairList.vue index 090d5c3..eb16e9a 100644 --- a/pages/reportRepair/reportRepairList/reportRepairList.vue +++ b/pages/reportRepair/reportRepairList/reportRepairList.vue @@ -20,9 +20,6 @@ <uni-data-select v-model="formData.reportStatus" :localdata="reportStatusList" @change="changetypeList" placeholder="璇烽�夋嫨鎶ヤ慨鐘舵��" /> </uni-forms-item> - <uni-forms-item name="name" label="棰嗘枡浜у搧:"> - <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> - </uni-forms-item> </uni-group> </uni-forms> <view class="flex"> @@ -113,7 +110,6 @@ scrollLeft: 0, formData: { reportStatus: '' - }, reportStatusList: [], NavBarColor: this.NavBarColor, @@ -280,8 +276,6 @@ resetTask() { - this.formData.num = '' - this.formData.partNumNameModel = '' this.$refs.popup.close(); this.mescroll.resetUpScroll() diff --git a/pages/spare/spare.vue b/pages/spare/spare.vue index fb3ea79..083c2d0 100644 --- a/pages/spare/spare.vue +++ b/pages/spare/spare.vue @@ -25,37 +25,9 @@ hasNavigated: false // 鏍囪鏄惁宸茬粡璺宠浆 }; }, - // mounted() { - // window.addEventListener('hashchange', this.handleHashChange); - // // 鍒濆瑙f瀽 hash - // this.handleHashChange(); - // }, - // beforeDestroy() { - // window.removeEventListener('hashchange', this.handleHashChange); - // }, + methods: { - // handleHashChange() { - // if (this.hasNavigated) { - // console.log('Already navigated, skipping hash change handling'); - // return; - // } - - // const hash = window.location.hash; - // console.log('Hash changed:', hash); // 娣诲姞鏃ュ織 - // if (!hash || hash.length === 0) { - // console.warn('Hash is empty or undefined'); - // return; - // } - // const params = new URLSearchParams(hash.split('?')[1]); - // const equipmentId = params.get('equipmentId'); - // console.log('Parsed equipmentId:', equipmentId); // 娣诲姞鏃ュ織 - // if (equipmentId) { - // this.navigateToDeviceDetails(equipmentId); - // } else { - // console.warn('No equipmentId found in hash'); - // } - // }, navigateToDeviceDetails(equipmentId) { this.hasNavigated = true; // 鏍囪宸茬粡璺宠浆 uni.navigateTo({ diff --git a/store/index.js b/store/index.js index f17bbd6..f074e10 100644 --- a/store/index.js +++ b/store/index.js @@ -102,7 +102,7 @@ commit }, param) { return new Promise((resolve, reject) => { - api.thirdLogin(param.token, param.thirdType, param.tenantId).then(response => { + api.thirdLogin(param.token, param.thirdType).then(response => { if (response.data.code == '200') { const result = response.data.result const userInfo = result.userInfo @@ -170,4 +170,4 @@ return state.userid }, } -}) \ No newline at end of file +}) -- Gitblit v1.9.3