From 78dcc7cac9af0d960af1c50ab6a97c6ea92667f6 Mon Sep 17 00:00:00 2001 From: zhangdi <15053473693@163.com> Date: Tue, 19 Nov 2024 10:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=80=BB=E8=BE=91=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 78 ++-- .../betone_components/betone-input-picker.vue | 6 +- common/betone_components/betone-list.vue | 11 +- common/betone_components/betone-new-input.vue | 21 + pages.json | 101 +++-- pages/home/components/alarm.vue | 69 ++-- pages/home/components/eacharts.vue | 54 ++- pages/home/components/swiper.vue | 37 +- pages/home/index.vue | 18 +- .../inspection/components/detailsCollapse.vue | 252 ++++++++++++ pages/inspection/components/plan-list.vue | 372 ++++++++++++++++++ pages/inspection/plan.vue | 167 ++++++++ pages/inspection/quest.vue | 349 ++++++++++++++++ pages/inspection/questDetails.vue | 99 +++++ pages/inspection/records.vue | 291 +------------- pages/my/my.vue | 25 +- pages/my/records.vue | 148 ++++--- pages/order/location.vue | 97 +++++ pages/submission/components/subForm.vue | 2 +- pages/submission/recordsdetails.vue | 2 +- store/index.js | 110 +++--- .../jp-signature-popup/jp-signature-popup.vue | 2 +- utils/tabbar.js | 79 +++- 23 files changed, 1843 insertions(+), 547 deletions(-) create mode 100644 pages/inspection/components/detailsCollapse.vue create mode 100644 pages/inspection/components/plan-list.vue create mode 100644 pages/inspection/plan.vue create mode 100644 pages/inspection/quest.vue create mode 100644 pages/inspection/questDetails.vue create mode 100644 pages/order/location.vue diff --git a/api/api.js b/api/api.js index 5021fb2..fdadf20 100644 --- a/api/api.js +++ b/api/api.js @@ -5,9 +5,9 @@ const http = uni.$u.http const install = (Vue, vm) => { // 此处没有使用传入的params参数 let getTenantInfo = (params, config = {}) => http.get('/blade-system/tenant/info', params, config) - // 此处使用了传入的params参数,一切自定义即可 + // 此处使用了传入的params参数,一切自定义即可 let login = (params) => http.post('/blade-auth/oauth/token?' + params) - // 退出 + // 退出 let logout = () => http.get('/blade-auth/oauth/logout') let register = (params, config = {}) => http.post('/blade-auth/oauth/token', params, config) @@ -15,36 +15,39 @@ const install = (Vue, vm) => { let getworkbench = () => http.post('/blade-auth/oauth/token', params, config) // 登录记录 - let getLoginRecords = () => http.post('/blade-auth/oauth/token', params, config) - // 修改记录 - let getEditRecords = () => http.post('/blade-auth/oauth/token', params, config) - // 意见反馈提交 + let getLoginRecords = (params) => http.get('/blade-log/api/logOnList', params, { + authorization: false, + isparams: true + }) + // 修改记录 + let getEditRecords = () => http.get('/blade-auth/oauth/token', params, config) + // 意见反馈提交 let subEditRecords = (params) => http.post('/feedback/save', params) - // 获取意见反馈类型 + // 获取意见反馈类型 // 业务类型查询 - let getChildList = (params) => http.get('/blade-system/dict-biz/child-list', {...params }, { - authorization: false, - isparams: true - }) - // 获取设备列表 - let getDeviceList = (params) => http.get('/device/list', {...params }, { + let getChildList = (params) => http.get('/blade-system/dict-biz/child-list', { ...params }, { authorization: false, isparams: true }) - + // 获取设备列表 + let getDeviceList = (params) => http.get('/device/list', { ...params }, { + authorization: false, + isparams: true + }) + // 需求提报 提交接口 let workOrderSave = (params) => http.post('/workOrder/save', params, { authorization: false, isparams: false }) // 需求提报 列表 /lab/workOrder/list - let getWorkOrderRecords = (params) => http.get('/workOrder/list', {...params }, { + let getWorkOrderRecords = (params) => http.get('/workOrder/list', { ...params }, { authorization: false, isparams: false }) // 根据id查询故障详情 - let getBreakdownInfo = (params) => http.get('/workOrder/detail', {...params }, { + let getBreakdownInfo = (params) => http.get('/workOrder/detail', { ...params }, { authorization: false, isparams: false }) @@ -61,27 +64,58 @@ const install = (Vue, vm) => { }) // 获取维修人员 / - let getRepairPersons = (params) => http.get('/blade-system/user/repairPersons', {...params }, { + let getRepairPersons = (params) => http.get('/blade-system/user/repairPersons', { ...params }, { authorization: false, isparams: false }) - - // 客服派单接口 // 获取物料列表数据 goods/list - let getGoodsList = (params) => http.get('/goods/list', params , { + let getGoodsList = (params) => http.get('/goods/list', params, { authorization: false, isparams: false }) // 巡检计划列表 / - let getDictionaryList = (params) => http.get('/blade-system/dict/dictionary?code=flow', params , { + let getDictionaryList = (params) => http.get('/blade-system/dict/dictionary?code=flow', params, { authorization: false, isparams: false }) + + // 获取人员列表 + let getUserList = (params) => http.get('/blade-system/user/page', { ...params }, { + authorization: false, + isparams: true + }) + + // 工作台 + // 实验室巡检 /workBenches/workList + let workList = (params) => http.get('/workBenches/workList', { ...params }, { + authorization: false, + isparams: true + }) + // 设备报警 + let deviceList = (params) => http.get('/workBenches/deviceList', { ...params }, { + authorization: false, + isparams: true + }) + // 维修柱状图 + let upkeepStat = (params) => http.get('/workBenches/upkeepStat', { ...params }, { + authorization: false, + isparams: true + }) + // 故障现象分类 workBenches/pieStat + let pieStat = (params) => http.get('/workBenches/pieStat', { ...params }, { + authorization: false, + isparams: true + }) + // 获取用户信息 / + let getUserInfo = (params) => http.get('/blade-system/user/info', { ...params }, { + authorization: false, + isparams: true + }) // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 - vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList,workOrderSave,getWorkOrderRecords,getBreakdownInfo,workOrderupdate,evaluateSign,getRepairPersons,getGoodsList,getDictionaryList }; + vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList,upkeepStat,pieStat,getUserInfo }; } export default { diff --git a/common/betone_components/betone-input-picker.vue b/common/betone_components/betone-input-picker.vue index fdbcb21..f450b1a 100644 --- a/common/betone_components/betone-input-picker.vue +++ b/common/betone_components/betone-input-picker.vue @@ -2,7 +2,7 @@ 查看位置 + type="primary" @click="goPage(item,'location')">查看位置 + * {{ label }} + + @@ -38,6 +40,7 @@ :maxlength="maxlength" :disabled="disabled" > + + @@ -108,6 +112,10 @@ export default { type: Number, default: 100, }, + endIcon:{//输入框后面的icon + type: String, + default: "", + } }, data() { return { @@ -162,6 +170,19 @@ export default { ch(e) { this.$emit("changevalue", e); }, + // 扫一扫 方法 + scanCode(){ + uni.scanCode({ + success: (res) => { + console.log('扫码结果:' + res.result); + // 扫码成功后的操作,例如: + // this.handleScanResult(res.result); + }, + fail: (err) => { + console.error('扫码失败:' + err); + } + }); + } }, model: { prop: "value", diff --git a/pages.json b/pages.json index 91184d3..d01f362 100644 --- a/pages.json +++ b/pages.json @@ -2,7 +2,8 @@ "easycom": { "^betone-(.*)": "@/common/betone_components/betone-$1.vue" }, - "pages": [{ + "pages": [ + { "path": "pages/home/index", "style": { "navigationStyle": "custom", @@ -12,8 +13,8 @@ { "path": "pages/my/my", "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" + "navigationStyle": "custom", + "navigationBarTextStyle": "white" } }, { @@ -54,16 +55,16 @@ }, { "path": "pages/submission/records", - "style" : { - "navigationStyle" : "custom", - "navigationBarTitleText" : "", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "", "enablePullDownRefresh": true, - "h5" : { - "titleNView" : false + "h5": { + "titleNView": false }, - "app-plus" : { - "titleNView" : false, - "scrollIndicator" : "none" + "app-plus": { + "titleNView": false, + "scrollIndicator": "none" } } }, @@ -75,10 +76,8 @@ "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "rgba(248,248,248,1)", "app-plus": { - "titleNView": { - - } - } + "titleNView": {} + } } }, { @@ -88,53 +87,88 @@ "enablePullDownRefresh": false, "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "rgba(248,248,248,1)", - "app-plus": { - "titleNView": { - - } - } + "app-plus": { + "titleNView": {} + } } }, { "path": "pages/order/tasking", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarTextStyle": "white" } }, + { + "path": "pages/order/location", + "style": { + "navigationBarTitleText": "查看位置", + "enablePullDownRefresh": false, + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "rgba(248,248,248,1)", + "app-plus": { + "titleNView": {} + } + } + }, { "path": "pages/login/login", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarTextStyle": "white" } }, { "path": "pages/register/index", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarTextStyle": "white" } }, { "path": "pages/register/registerSuccess", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/inspection/quest", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } + }, + + { + "path": "pages/inspection/questDetails", + "style": { + "navigationBarTitleText": "巡检任务单", + "enablePullDownRefresh": false, + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "rgba(248,248,248,1)", + "app-plus": { + "titleNView": {} + } + } + }, + { + "path": "pages/inspection/plan", + "style": { + "navigationStyle": "custom", "navigationBarTextStyle": "white" } }, { "path": "pages/inspection/records", "style": { - "navigationBarTitleText": "巡检计划", + "navigationBarTitleText": "巡检计划", "enablePullDownRefresh": false, "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "rgba(248,248,248,1)", "app-plus": { - "titleNView": { - - } - } + "titleNView": {} + } } } ], @@ -146,7 +180,8 @@ "backgroundColor": "#fff" }, "tabBar": { - "list": [{ + "list": [ + { "pagePath": "pages/home/index" }, { @@ -157,6 +192,12 @@ }, { "pagePath": "pages/my/my" + }, + { + "pagePath": "pages/inspection/quest" + }, + { + "pagePath": "pages/inspection/plan" } ] } diff --git a/pages/home/components/alarm.vue b/pages/home/components/alarm.vue index 405438f..03cc0df 100644 --- a/pages/home/components/alarm.vue +++ b/pages/home/components/alarm.vue @@ -3,16 +3,16 @@ - {{ item.title5 }} - {{ item.title6 }} + {{ item.alarmName }} + {{ item.levelNanme }} - {{ item.title1 }} - 品牌:{{ item.title2 }} - 型号:{{ item.title3 }} - 报警时间:{{ item.title4 }} + {{ item.deviceName }} + 品牌:{{ item.brand }} + 型号:{{ item.model }} + 报警时间:{{ item.alarmTime }} 一键报送 @@ -28,25 +28,48 @@ export default { 严重: "rgba(233,157,66,1)", }, list: [ - { - title1: "通风柜", - title2: "德力西", - title3: "FSAJ", - title4: "2024-08-09", - title5: "一级", - title6: "特别严重", - }, - { - title1: "通风柜", - title2: "德力西", - title3: "FSAJ", - title4: "2024-08-09", - title5: "一级", - title6: "严重", - }, + // { + // title1: "通风柜", + // title2: "德力西", + // title3: "FSAJ", + // title4: "2024-08-09", + // title5: "一级", + // title6: "特别严重", + // }, + // { + // title1: "通风柜", + // title2: "德力西", + // title3: "FSAJ", + // title4: "2024-08-09", + // title5: "一级", + // title6: "严重", + // }, ], }; }, + mounted(){ + this.deviceList() + }, + methods:{ + deviceList(){ + this.$u.api.deviceList().then(res=>{ + if(res.code ==200){ + let data_ =res.data + data_.forEach(v => { + if(v.alarmLevel==1){ + v.alarmName = '一级' + v.levelNanme = '超级严重' + } + if(v.alarmLevel==2){ + v.alarmName = '二级' + v.levelNanme = '严重' + } + }); + this.list = res.data + } + }) + } + } }; \ No newline at end of file diff --git a/pages/inspection/components/plan-list.vue b/pages/inspection/components/plan-list.vue new file mode 100644 index 0000000..157b537 --- /dev/null +++ b/pages/inspection/components/plan-list.vue @@ -0,0 +1,372 @@ + + + + + \ No newline at end of file diff --git a/pages/inspection/plan.vue b/pages/inspection/plan.vue new file mode 100644 index 0000000..19f3834 --- /dev/null +++ b/pages/inspection/plan.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/pages/inspection/quest.vue b/pages/inspection/quest.vue new file mode 100644 index 0000000..7785fbd --- /dev/null +++ b/pages/inspection/quest.vue @@ -0,0 +1,349 @@ + + + + + \ No newline at end of file diff --git a/pages/inspection/questDetails.vue b/pages/inspection/questDetails.vue new file mode 100644 index 0000000..6598416 --- /dev/null +++ b/pages/inspection/questDetails.vue @@ -0,0 +1,99 @@ + + + \ No newline at end of file diff --git a/pages/inspection/records.vue b/pages/inspection/records.vue index d1a4c85..f8fe67e 100644 --- a/pages/inspection/records.vue +++ b/pages/inspection/records.vue @@ -1,40 +1,6 @@ \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index 3f00cea..6fe6375 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -19,7 +19,6 @@ 客户功能 - {{ item.title }} @@ -32,6 +31,12 @@ + + \ No newline at end of file diff --git a/pages/submission/components/subForm.vue b/pages/submission/components/subForm.vue index de4c745..1e422dd 100644 --- a/pages/submission/components/subForm.vue +++ b/pages/submission/components/subForm.vue @@ -8,7 +8,7 @@ + placeholder="请输入" endIcon="scan" /> diff --git a/pages/submission/recordsdetails.vue b/pages/submission/recordsdetails.vue index c2572d2..001bd92 100644 --- a/pages/submission/recordsdetails.vue +++ b/pages/submission/recordsdetails.vue @@ -550,7 +550,7 @@ export default { .item_left_txt { color: rgba(108, 108, 108, 1); - font-size: 14px; + font-size: 28rpx; text-align: left; font-family: SourceHanSansSC-regular; width: 210rpx; diff --git a/store/index.js b/store/index.js index 0ab902c..09f6bcb 100644 --- a/store/index.js +++ b/store/index.js @@ -4,62 +4,66 @@ Vue.use(Vuex) import tabBar from "@/utils/tabbar.js"; // 引入刚刚创建的tabBar.js const store = new Vuex.Store({ - state: { - dynamicTabbar: [], // 动态tabbar - tabBarList: [], - dataType:null,//数据标识权限 + state: { + dynamicTabbar: [], // 动态tabbar + tabBarList: [], + dataType: null,//数据标识权限 + }, + getters: {}, + actions: { + changeTabbar({ commit }, role_id) { + /* + admin 超管 1123598816738675201 + 客户 1846419477876510721 + 客服 1839536982874193922 + 维修负责人 1839537055389515777 + 维修人员 1839552581620793346 + */ + // console.log(66666666666,role_id) + if (role_id == "1123598816738675201" || role_id == "1846419477876510721") { + commit('updateDatatype', 1) //客户 + commit('updateTabbar', tabBar.member) + uni.reLaunch({ + url: "/pages/home/index", + }); + } + if (role_id == "1839536982874193922") { + commit('updateDatatype', 2) //客服 + commit('updateTabbar', tabBar.ordinary) + uni.reLaunch({ + url: "/pages/order/tasking", + }); + } + if (role_id == "1839537055389515777") { + commit('updateDatatype', 3) //维修负责人 + commit('updateTabbar', tabBar.manage) + uni.reLaunch({ + url: "/pages/order/tasking", + }); + } + if (role_id == "1839552581620793346") { + commit('updateDatatype', 4) //维修人员 + commit('updateTabbar', tabBar.repair) + uni.reLaunch({ + url: "/pages/order/tasking", + }); + } + }, - getters: {}, - actions: { - changeTabbar({ commit }, role_id) { - /* - admin 超管 1123598816738675201 - 客户 1846419477876510721 - 客服 1839536982874193922 - 维修负责人 1839537055389515777 - 维修人员 1839552581620793346 - */ - // console.log(66666666666,role_id) - if(role_id == "1123598816738675201"||role_id == "1846419477876510721"){ - commit('updateDatatype', 1) //客户 - } - if(role_id == "1839536982874193922"){ - commit('updateDatatype', 2) //客服 - } - if(role_id == "1839537055389515777"){ - commit('updateDatatype', 3) //维修负责人 - } - if(role_id == "1839552581620793346"){ - commit('updateDatatype', 4) //维修人员 - } - - if (role_id == "1123598816738675201" || role_id == '1846419477876510721' || role_id == '1839537055389515777') { - commit('updateTabbar', tabBar.member) - uni.switchTab({ - url: "/pages/home/index", - }); - } else { - commit('updateTabbar', tabBar.ordinary) - uni.switchTab({ - url: "/pages/order/tasking", - }); - } - - }, - changeDatatype({ commit }, type){ - commit('updateTabbar', payload) - } + changeDatatype({ commit }, type) { + commit('updateTabbar', payload) + } + }, + mutations: { + updateTabbar(state, list) { + uni.setStorageSync('tabBarList', list) // 根据登录时传过来的值,存储对应的tabbarlist + state.dynamicTabbar = list }, - mutations: { - updateTabbar(state, list) { - uni.setStorageSync('tabBarList', list) // 根据登录时传过来的值,存储对应的tabbarlist - state.dynamicTabbar = list - }, - updateDatatype(state, data){ - state.dataType = data - } - + updateDatatype(state, data) { + state.dataType = data } + + } }) export default store \ No newline at end of file diff --git a/uni_modules/jp-signature/components/jp-signature-popup/jp-signature-popup.vue b/uni_modules/jp-signature/components/jp-signature-popup/jp-signature-popup.vue index b38be6e..0933142 100644 --- a/uni_modules/jp-signature/components/jp-signature-popup/jp-signature-popup.vue +++ b/uni_modules/jp-signature/components/jp-signature-popup/jp-signature-popup.vue @@ -33,7 +33,7 @@
撤销
清除
-
全屏
+
撤销
diff --git a/utils/tabbar.js b/utils/tabbar.js index 41648fa..a8e5fa7 100644 --- a/utils/tabbar.js +++ b/utils/tabbar.js @@ -1,35 +1,76 @@ -// 工作台 +// 工作台 客服看到的菜单 const ordinary = [{ iconPath: "photo", selectedIconPath: "photo-fill", text: "接单记录", pagePath: "pages/order/tasking", +}, { + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "巡检计划", + pagePath: "pages/inspection/plan", }, { iconPath: "account", selectedIconPath: "account-fill", text: "我的", pagePath: "pages/my/my", }] - +// 客户看到的页面 const member = [{ - iconPath: "photo", - selectedIconPath: "photo-fill", - text: "工作台", - pagePath: "pages/home/index", - }, - { - iconPath: "https://cdn.uviewui.com/uview/common/min_button.png", - selectedIconPath: "https://cdn.uviewui.com/uview/common/min_button_select.png", - text: "一键报送", - pagePath: "pages/submission/index", - }, { - iconPath: "account", - selectedIconPath: "account-fill", - text: "我的", - pagePath: "pages/my/my", - }, + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "工作台", + pagePath: "pages/home/index", +}, +{ + iconPath: "https://cdn.uviewui.com/uview/common/min_button.png", + selectedIconPath: "https://cdn.uviewui.com/uview/common/min_button_select.png", + text: "一键报送", + pagePath: "pages/submission/index", +}, { + iconPath: "account", + selectedIconPath: "account-fill", + text: "我的", + pagePath: "pages/my/my", +}, ] +// 维修负责人看到的页面 +const manage = [{ + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "接单记录", + pagePath: "pages/order/tasking", +}, { + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "巡检计划", + pagePath: "pages/inspection/plan", +}, { + iconPath: "account", + selectedIconPath: "account-fill", + text: "我的", + pagePath: "pages/my/my", +}] +// 维修人员 看到的菜单 +const repair = [{ + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "接单记录", + pagePath: "pages/order/tasking", +}, { + iconPath: "photo", + selectedIconPath: "photo-fill", + text: "维修任务", + pagePath: "pages/inspection/quest", +}, { + iconPath: "account", + selectedIconPath: "account-fill", + text: "我的", + pagePath: "pages/my/my", +}] export default { ordinary, - member + member, + manage, + repair } \ No newline at end of file