diff --git a/pages.json b/pages.json index 2cb74fa..5d0d8e9 100644 --- a/pages.json +++ b/pages.json @@ -164,14 +164,14 @@ { "path": "pages/roadTransport/transportData/list", "style": { - "navigationBarTitleText": "道路运输", + "navigationBarTitleText": "道路运输数据", "enablePullDownRefresh": true } }, { "path": "pages/roadTransport/transportData/form", "style": { - "navigationBarTitleText": "道路运输编辑" + "navigationBarTitleText": "道路运输数据报送" } }, { diff --git a/pages/roadTransport/transportData/detail-copy.vue b/pages/roadTransport/transportData/detail-copy.vue deleted file mode 100644 index a2607fd..0000000 --- a/pages/roadTransport/transportData/detail-copy.vue +++ /dev/null @@ -1,383 +0,0 @@ - - - - - diff --git a/pages/roadTransport/transportData/form.vue b/pages/roadTransport/transportData/form.vue index a280b19..2da5104 100644 --- a/pages/roadTransport/transportData/form.vue +++ b/pages/roadTransport/transportData/form.vue @@ -38,7 +38,7 @@ -

{{timeName ? timeName : '请选择统计时段'}}

+

{{timeName ? timeName : '请选择'}}

@@ -501,13 +501,12 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. if(options.type == 'edit'){ const item = JSON.parse(options.item); this.pageType = 'edit' - this.getDetail(item.id); + this.getDetail(item.reportPhase, item.reportUnit, item.statisticalDate); }else if(options.type == 'add'){ this.pageType = 'add'; - this.getDept() - let now = new Date(); this.roadData.statisticalDate = getDateStr(now, -1);//默认前一天 + this.getDept(); } }, @@ -590,7 +589,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. // this.$request(getApp().globalData.baseUrl + '/api/user/getByDeptId/' + this.unitId,{},"GET").then(res =>{ console.log('人员列表 ===>',res) res.data.list.map(item =>{ - this.peopleList.push({id:item.id,people:item.username + (item.mobile ? ',' + item.mobile : '')}) + this.peopleList.push({id:item.id,people:(item.nickname ? item.nickname : item.username) + (item.mobile ? ',' + item.mobile : '')}) }) if(this.pageType == 'edit'){ console.log('deptNameList ===>',this.peopleList) @@ -616,7 +615,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. this.roadData.reportingUnitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : ''; this.roadData.reportingUnitIdIndex = this.deptNameList.length > 0 ? 0 : ''; this.selectId1 = this.unitId; - this.getRoadTime() + this.getRoadTime() this.getPeople() }else if(this.pageType == 'edit'){ console.log('reportingUnitId===>',this.roadData.reportingUnitId) @@ -628,8 +627,8 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. } }) }, - getDetail(id){ - this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/find/' + id,{},"GET").then(res =>{ + getDetail(reportPhase,reportUnit,statisticalDate){ + this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/getDataByTime?reportPhase=' + reportPhase + '&reportUnit=' + reportUnit + '&statisticalDate=' + statisticalDate,{},"GET").then(res =>{ this.roadData = res.data; this.getRoadTime(); this.getDept(); @@ -712,7 +711,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. }else{ uni.showModal({ title:"提示", - content:params.id == undefined ? "您确认提交该条报送数据?" : "您确认将该条数据进行修改?", + content: !checkNotEmpty(params.id) ? "您确认提交该条报送数据?" : "您确认将该条数据进行修改?", success:(res) =>{ if(res.confirm){ params.isPassengerCountConvert = 0; @@ -781,6 +780,13 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. this.index = this.roadTime.findIndex(item => item.dictValue == "03") this.timeName = this.roadTime.find(item => item.dictValue == "03").dictLabel } + //报送阶段 - 初始化查询当前账户下级报送汇总数据 + this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/getDetail?reportPhase=' + this.roadData.reportPhase + '&reportUnit=' + this.roadData.reportingUnitId + '&statisticalDate=' + this.roadData.statisticalDate,{},"GET").then(res =>{ + res.data.reportPhase = this.roadData.reportPhase; + res.data.reportingUnitId = this.roadData.reportingUnitId; + res.data.statisticalDate = this.roadData.statisticalDate; + this.roadData = res.data; + }) this.getRatio() } diff --git a/pages/roadTransport/transportData/list.vue b/pages/roadTransport/transportData/list.vue index 9c097d7..a70c21c 100644 --- a/pages/roadTransport/transportData/list.vue +++ b/pages/roadTransport/transportData/list.vue @@ -6,15 +6,14 @@ 报送时间 - {{item.statisticalDate || ''}}{{item.reportPhaseValue || ''}} + {{item.statisticalDate || ''}}{{renderTime(item.reportPhase)}} - {{item.reportingUnitId}} - {{item.reportingUnitId}} + {{item2}}
@@ -135,6 +134,11 @@ this.timeArray = res.data; }) }, + //时段文本转换 + renderTime(reportPhase) { + let idx = this.timeArray.findIndex(item => item.dictValue == reportPhase); + return idx > -1 ? this.timeArray[idx].dictLabel : ''; + }, // 点击筛选按钮 handleSearch(){ this.$refs.popup.open('bottom') @@ -202,7 +206,7 @@ ...this.query, } console.log('params ===>',params) - this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/list',params,"GET").then(res =>{ + this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/getTimeList',params,"GET").then(res =>{ console.log(res) if(res.code == 200){ res.data.list.map(item =>{ @@ -252,11 +256,15 @@ }) }, // 点击编辑按钮 - editItem(row){ - console.log(row) + editItem(row,reportUnit){ + let param = { + statisticalDate: row.statisticalDate, + reportUnit: reportUnit, + reportPhase: row.reportPhase + } uni.navigateTo({ // url:'pages/roadTransport/transportData/detail?item=' + JSON.stringify(row) - url:"/pages/roadTransport/transportData/form?item=" + JSON.stringify(row) + '&type=edit' + url:"/pages/roadTransport/transportData/form?item=" + JSON.stringify(param) + '&type=edit' }) }, // 点击查看详情按钮