From ef313b9399734bdd02b21754b19ed0856f4c3d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Tue, 7 May 2024 19:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E4=BF=9D?= =?UTF-8?q?=E5=85=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 85 +++++--- components/calendar/index.vue | 108 +++++++++- components/pickerSelect/index.vue | 25 ++- components/upload/uploadImg.vue | 245 ++++++++++++++++++++++ main.js | 18 +- pages.json | 11 +- pages/deviceRepair/RepairReport.vue | 193 +++++++++++------ pages/deviceRepair/deviceDetail.vue | 117 +++++++++++ pages/deviceRepair/deviceRepair.vue | 194 ++++++++++++----- pages/deviceRepair/repairOrder.vue | 140 ++++++++----- pages/equipmentManage/equipmentManage.vue | 11 +- pages/schedul/list.vue | 3 - static/css/app.css | 28 ++- static/iconfont/iconfont.css | 10 +- uni.scss | 3 +- utils/api.js | 39 +++- utils/envConfig.js | 2 + utils/public.js | 141 ++++++++++++- 18 files changed, 1116 insertions(+), 257 deletions(-) create mode 100644 components/upload/uploadImg.vue create mode 100644 pages/deviceRepair/deviceDetail.vue diff --git a/App.vue b/App.vue index 5b7d92c..f28c166 100644 --- a/App.vue +++ b/App.vue @@ -95,39 +95,39 @@ } .list_content{padding:12px;position: relative;} .list_content .card_right{position: absolute;top: 12px;right: 12px;} - - .card_right{ - display: flex; - flex-direction: column; - .status{ - background: $uni-bg-color-success-dark; - color: $uni-text-color-success; - padding: 3px 10px; - border-radius: 4px; - font-size: 12px; - } - .success{ - background: $uni-bg-color-success-dark; - color: $uni-text-color-success; - padding: 3px 10px; - border-radius: 4px; - font-size: 12px; - } - .warning{ - background: $uni-bg-color-warning-dark; - color: $uni-text-color-warning; - padding: 3px 10px; - border-radius: 4px; - font-size: 12px; - } - .error{ - background: $uni-bg-color-error-dark; - color: $uni-text-color-danger; - padding: 3px 10px; - border-radius: 4px; - font-size: 12px; - } - } + } + + .page_list .card_right, .detail_list .card_right{ + display: flex; + flex-direction: column; + .status{ + background: $uni-bg-color-success-dark; + color: $uni-text-color-success; + padding: 3px 10px; + border-radius: 4px; + font-size: 12px; + } + .success{ + background: $uni-bg-color-success-dark; + color: $uni-text-color-success; + padding: 3px 10px; + border-radius: 4px; + font-size: 12px; + } + .warning{ + background: $uni-bg-color-warning-dark; + color: $uni-text-color-warning; + padding: 3px 10px; + border-radius: 4px; + font-size: 12px; + } + .error{ + background: $uni-bg-color-error-dark; + color: $uni-text-color-danger; + padding: 3px 10px; + border-radius: 4px; + font-size: 12px; + } } .flexBox .detail_list:first-child{ margin-top: 2px; @@ -140,7 +140,8 @@ .bottom_but{ width: 100%; position: fixed; - bottom: 0px; + bottom: 0px; + z-index: 90; background-color: #060B26; border-top: 1px solid #2E3249; height: 80px; @@ -205,4 +206,20 @@ border-radius: 50%; background-image: conic-gradient($uni-color-primary 0%, $uni-color-primary var(--progress), transparent 0); } + + // 选择日期时间颜色的配置 + .input_date .uni-date-x .uni-date__x-input{ + color: $uni-text-color-tip; + } + .haveTime .uni-date-x .uni-date__x-input{ + color: $uni-text-color-inverse; + } + + // 修改 日期时间选择组件 + .input_date ::v-deep .uni-date-changed .uni-datetime-picker--btn{ + background: $uni-color-primary !important; + } + .input_date ::v-deep .uni-calendar-item--checked{ + background: $uni-color-primary !important; + } diff --git a/components/calendar/index.vue b/components/calendar/index.vue index ba0b3b1..eb3fa8a 100644 --- a/components/calendar/index.vue +++ b/components/calendar/index.vue @@ -8,9 +8,10 @@ - + {{item.name}} {{item.text}} + @@ -25,8 +26,11 @@ - {{em.text}} - {{em.name}} + + {{em.text}} + {{em.name}} + + @@ -113,9 +117,16 @@ setTitle(){ if(this.params.date == 'day'){ let list = this.$wf.getDatesOfWeek(); + let todoay = this.$wf.getToday(); list.forEach(item=>{ + if(item.date == todoay){ + item.todoay = true; + } item.text = item.date.split('-')[2]; }) + if(this.curIndex >= list.length){ + this.curIndex = list.length - 1; + } this.titleList = list; } if(this.params.date == 'week'){ @@ -124,8 +135,12 @@ arr.forEach((item,index)=>{ let date = item.find(em=> em!==null && em!==undefined); + let todoay = this.$wf.getToday(); item.forEach(em=>{ if(em){ + if(em.date == todoay){ + em.todoay = true; + } em.text = em.date.split('-')[2]; em.name = '星期'+em.name; } @@ -136,11 +151,32 @@ data:item.filter(em=> em!==null), }) }) - console.log(list,233) + if(this.curIndex >= list.length){ + this.curIndex = list.length - 1; + } this.titleList = list; } if(this.params.date == 'month'){ - + let list = []; + let arr = this.$wf.getCurrentYearData(); + arr.forEach((item,index)=>{ + let weeks = []; + item.weeks.forEach((em,ind)=>{ + let dateList = em.filter(em=> em!==null); + weeks.push({ + data:dateList, + text:dateList[0].date.split('-')[2], + name:'第'+Number(ind+1)+'周', + date:dateList[0].date, + }) + }) + list.push({ + name:this.$wf.numberToChineseLower(Number(item.month))+'月', + date:weeks[0].date, + data:weeks, + }) + }) + this.titleList = list; } this.getScrollW(); @@ -198,6 +234,30 @@ }) this.titleList = list; } + if(this.params.date == 'month'){ + // 获取本年的选中周日期 + let date = this.titleList[this.curIndex]; + let list = []; + let arr = this.$wf.getPreviousYearData(String(date.date)); + arr.forEach((item,index)=>{ + let weeks = []; + item.weeks.forEach((em,ind)=>{ + let dateList = em.filter(em=> em!==null); + weeks.push({ + data:dateList, + text:dateList[0].date.split('-')[2], + name:'第'+Number(ind+1)+'周', + date:dateList[0].date, + }) + }) + list.push({ + name:this.$wf.numberToChineseLower(Number(item.month))+'月', + date:weeks[0].date, + data:weeks, + }) + }) + this.titleList = list; + } this.getScrollW(); this.changeDate(); @@ -241,6 +301,30 @@ }) this.titleList = list; } + // 获取下一年的日期 + if(this.params.date == 'month'){ + let date = this.titleList[this.curIndex]; + let list = []; + let arr = this.$wf.getNextYearData(String(date.date)); + arr.forEach((item,index)=>{ + let weeks = []; + item.weeks.forEach((em,ind)=>{ + let dateList = em.filter(em=> em!==null); + weeks.push({ + data:dateList, + text:dateList[0].date.split('-')[2], + name:'第'+Number(ind+1)+'周', + date:dateList[0].date, + }) + }) + list.push({ + name:this.$wf.numberToChineseLower(Number(item.month))+'月', + date:weeks[0].date, + data:weeks, + }) + }) + this.titleList = list; + } this.getScrollW(); this.changeDate(); @@ -281,6 +365,7 @@ .scroll-view {height: 50px;white-space: nowrap; .scroll-item {height: 100%;padding: 0 5px;display: inline-block;text-align: center;box-sizing: border-box; .viewItem{ + position: relative; font-size: 14px;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center; border: 1px solid $uni-color-primary;box-sizing: border-box;border-radius: 8px; } @@ -291,16 +376,25 @@ .active { background: $uni-color-primary; } + .todoay{ + display: flex;align-items: center;justify-content: center;background: $uni-bg-color-success; + position: absolute;top: 2px;right: 2px;z-index: 20; + border-radius: 2px;width: 12px;height: 12px;font-size: 8px; + } } } - .monthScroll{height: 28px;} + .monthScroll{height: 27px;} } .content-right{flex-basis: 30px;text-align: center;} } .swiper-box-list{height: 240px;padding:0 12px; .swiper-item{display: flex;flex-direction: row;flex-wrap: wrap;} - .device_row{display: flex;flex-direction: column;width: 33%;justify-content: center;align-items: center;margin-bottom: 12px;padding: 12px 0;height: 70px;box-sizing: border-box; + .device_row{display: flex;flex-direction: column;width: 33%;justify-content: center;align-items: center;margin-bottom: 12px;height: 70px;box-sizing: border-box;padding: 0 8px;position: relative; .name{margin-bottom: 6px;} + .rowView{display: flex;flex-direction: column;justify-content: center;align-items: center;height: 100%;width: 100%;padding: 12px 0;box-sizing: border-box;position: relative;} + .todoayView{padding: 0 8px; background: $uni-bg-color-default-dark; box-sizing: border-box;border-radius: 8px;} + .active{background: $uni-bg-color-info;border-radius: 8px;} + .todoay{position: absolute;top: -5px;right: -5px;z-index: 20;display: flex;align-items: center;justify-content: center;background: $uni-bg-color-success;width: 16px;height: 16px;border-radius: 3px;font-size: 10px;} } } \ No newline at end of file diff --git a/components/pickerSelect/index.vue b/components/pickerSelect/index.vue index 78f5858..a53264b 100644 --- a/components/pickerSelect/index.vue +++ b/components/pickerSelect/index.vue @@ -2,7 +2,7 @@ - + @@ -37,13 +37,19 @@ watch:{ id:{ handler(val){ - this.array.forEach((item,index)=>{ - if(item.value == val){ - this.value = index; - this.text = item.name; - this.id = val; - } - }) + if(val){ + this.array.forEach((item,index)=>{ + if(item.value == val){ + this.value = index; + this.text = item.name; + this.id = val; + } + }) + }else{ + this.value = ''; + this.text = ''; + this.id = ''; + } }, immediate:true, deep:true @@ -91,6 +97,9 @@ } .pickerBom{ width: 100%; + .input{ + width: 100%; + } } .selectOpen{ animation: rotate 0.6s; diff --git a/components/upload/uploadImg.vue b/components/upload/uploadImg.vue new file mode 100644 index 0000000..a235494 --- /dev/null +++ b/components/upload/uploadImg.vue @@ -0,0 +1,245 @@ + + + + + \ No newline at end of file diff --git a/main.js b/main.js index 39fa54e..96cad4f 100644 --- a/main.js +++ b/main.js @@ -8,18 +8,19 @@ import searchView from './components/searchView/index' import loadMore from './components/loadMore/index' import progressBar from './components/progressBar' import pickerSelect from './components/pickerSelect/index' -import calendar from './components/calendar/index' - +import calendar from './components/calendar/index' +import uploadImg from './components/upload/uploadImg' // #ifndef VUE3 import Vue from 'vue' import App from './App' import svg from './static/iconfont/svg.js' -Vue.component('search-view',searchView); -Vue.component('load-more',loadMore); -Vue.component('progress-bar',progressBar); -Vue.component('picker-select',pickerSelect); -Vue.component('calendar',calendar); +Vue.component('search-view', searchView); +Vue.component('load-more', loadMore); +Vue.component('progress-bar', progressBar); +Vue.component('picker-select', pickerSelect); +Vue.component('calendar', calendar); +Vue.component('upload-img', uploadImg); Vue.use(svg); @@ -47,7 +48,8 @@ export function createApp() { app.component('loadMore', loadMore); app.component('progressBar', progressBar); app.component('pickerSelect', pickerSelect); - app.component('calendar',calendar); + app.component('calendar', calendar); + app.component('uploadImg', uploadImg); app.config.globalProperties.$api = request; app.config.globalProperties.$wf = publicMethods; diff --git a/pages.json b/pages.json index 89211b7..2183e18 100644 --- a/pages.json +++ b/pages.json @@ -111,16 +111,23 @@ "style" : { "navigationBarTitleText" : "硬件设备报修", - "enablePullDownRefresh" : false + "enablePullDownRefresh" : true } }, { - "path" : "pages/deviceRepair/RepairReport", + "path" : "pages/deviceRepair/repairReport", "style" : { "navigationBarTitleText" : "设备报修", "enablePullDownRefresh" : false } + }, + { + "path":"pages/deviceRepair/deviceDetail", + "style" :{ + "navigationBarTitleText" : "设备报修详情", + "enablePullDownRefresh" : false + } }, { "path" : "pages/deviceStatus/deviceStatus", diff --git a/pages/deviceRepair/RepairReport.vue b/pages/deviceRepair/RepairReport.vue index 8dc4475..c44d337 100644 --- a/pages/deviceRepair/RepairReport.vue +++ b/pages/deviceRepair/RepairReport.vue @@ -3,72 +3,51 @@ - 值班工程师 + 值班工程师 - - - + - - 故障时间 + 故障时间 - - + + - - 报修时间 - - - + 报修时间 + + + - - 报修人 - - - - + 报修人 + + - - 报修设备 - - - - + 报修设备 + + - - 故障描述 -