| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- <!--
- * @Title:
- * @Description: 巡检上报列表
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view class="wrap">
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view class="nav-title">
- <text>{{title}}</text>
- </view>
- </uni-nav-bar>
- <view class="container">
- <uni-section title="巡检统计" titleFontSize="0.8rem" type="circle">
- <uni-group>
- <uni-row>
- <uni-col :span="12">
- <view class="list-item-block">
- <view class="line">
- <view class="text" style="color: gray;">巡检计划共有:<span
- style="margin-left: 10px;color: cornflowerblue;">{{countInfo.planCount}}</span>
- </view>
- </view>
- <view class="line">
- <view class="text" style="color: gray;">定期计划共有:<span
- style="margin-left: 10px;color: cornflowerblue;">{{countInfo.runPlanCount}}</span>
- </view>
- </view>
- </view>
- </uni-col>
- <uni-col :span="12">
- <view class="list-item-block">
- <view class="line">
- <view class="text" style="color: gray;">单次计划共有:<span
- style="margin-left: 10px;color: cornflowerblue;">{{countInfo.onlyOnePlanCount}}</span>
- </view>
- </view>
- <view class="line">
- <view class="text" style="color: gray;">预警计划共有:<span
- style="margin-left: 10px;color: cornflowerblue;">{{countInfo.planWarnCount}}</span>
- </view>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </uni-group>
- </uni-section>
- <uni-section title="查询条件" type="circle">
- <view class="search-block">
- <view style="margin-top: 10px;padding-left: 10px;padding-right: 10px;margin-bottom: 10px;">
- <view class="select-checkbox">
- <uni-data-checkbox v-model="planTypeOption" :localdata="planTypeItems">
- </uni-data-checkbox>
- </view>
- </view>
- <view class="submit-btn">
- <button type="default" @click="search">查 询</button>
- </view>
- </view>
- </uni-section>
- <uni-section title="巡检计划信息" type="circle">
- <uni-list>
- <uni-list-item v-for="item in list" :key="item.id" showArrow clickable @click="toDetail(item)">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="items-line">
- <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
- src="/static/images/list/inspection_item.png" mode="widthFix">
- </image>
- <text class="item-title-rtu-name">{{item.planTitle}}</text>
- </view>
- <view class="items-line">
- <text class="item-text-lable">计划内容:</text>
- <text class="item-text-content-ellipsis">{{item.planDesc}}</text>
- </view>
- <view v-if="item.planScheduledType ==1">
- <view class="items-line">
- <text class="item-text-lable">计划执行周期:</text>
- <text class="item-text-content-ellipsis">单次</text>
- </view>
- <view class="items-line">
- <text class="item-text-lable">完成时限:</text>
- <text class="item-text-content-ellipsis">{{item.inspectionCompleteTime}}</text>
- </view>
- </view>
- <view v-else-if="item.planScheduledType ==2">
- <view class="items-line">
- <text class="item-text-lable">计划执行周期:</text>
- <text class="item-text-content-ellipsis">定期</text>
- </view>
- <view class="items-line">
- <view v-if="item.timeType ==1">
- <text class="item-text-lable">周期设置:</text>
- <text class="item-text-content-ellipsis">按天</text>
- </view>
- <view v-else-if="item.timeType ==2">
- <text class="item-text-lable">周期设置:</text>
- <text class="item-text-content-ellipsis">按周</text>
- </view>
- <view v-else-if="item.timeType ==3">
- <text class="item-text-lable">周期设置:</text>
- <text class="item-text-content-ellipsis">按月</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </uni-section>
- <uni-group>
- <view class="pagination-block">
- <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
- @change="pageChange" />
- </view>
- </uni-group>
- </view>
- </view>
- </template>
- <script>
- import {
- role
- } from "@/api/role.js";
- import http from '@/http/api.js';
- export default {
- components: {
- },
- data() {
- return {
- title: '巡检保养管理',
- permission: {
- 'admin': false,
- 'orgAdmin': false,
- 'companyAdmin': false,
- 'companyServciePerson': false,
- },
- countInfo: {
- planCount: 0,
- onlyOnePlanCount: 0,
- runPlanCount: 0,
- planWarnCount: 0,
- },
- planTypeItems: [{
- 'value': 0,
- 'text': '全部'
- }, {
- 'value': 1,
- 'text': '单次'
- }, {
- 'value': 2,
- 'text': '定期'
- }],
- planTypeOption: 0,
- //planId: 0,
- //orgId: '',
- //projectId: '',
- list: [],
- pageSize: 10,
- // 当前页
- pageCurrent: 1,
- // 数据总量
- total: 0,
- regionTree: [],
- regionCode: '',
- selectedTreeNode: '',
- searchRtuNameVal: '',
- searchRtuCodeVal: '',
- query: {},
- inputStyles: {
- color: '#808080',
- borderColor: '#d3d3d3'
- }
- }
- },
- computed: {
- getIcon() {
- return path => {
- return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
- }
- },
- },
- onLoad(option) {
- // if (this.userInfo.role_name === role['admin']) {
- // this.permission.admin = true;
- // } else if (this.userInfo.role_name === role['orgAdmin']) {
- // this.permission.orgAdmin = true;
- // } else if (this.userInfo.role_name === role['companyAdmin']) {
- // this.permission.companyAdmin = true;
- // } else if (this.userInfo.role_name === role['companyServciePerson']) {
- // this.permission.companyServciePerson = true;
- // }
- // this.getRegionTree();
- this.getCountInfo();
- this.getPage();
- },
- onShow() {
- // this.pageCurrent = 1;
- // this.getPage()
- },
- methods: {
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- onBackPress() {
- // #ifdef APP-PLUS
- plus.key.hideSoftKeybord();
- // #endif
- },
- // 分页触发
- pageChange(e) {
- this.pageCurrent = e.current;
- this.getPage()
- },
- onTreeNodeClick(node) {
- console.log(JSON.stringify(node))
- },
- onTreePopupOpened(e) {
- console.log(JSON.stringify(e))
- },
- onTreePopupClosed(e) {
- console.log(JSON.stringify(e))
- },
- onTreeChange(e) {
- console.log(JSON.stringify(e))
- let nodes = e.detail.value;
- if (nodes.length > 0) {
- let node = nodes[nodes.length - 1];
- this.regionCode = node.value;
- this.query = {};
- this.query['adCode'] = this.regionCode;
- this.searchRtuNameVal = '';
- this.searchRtuCodeVal = '';
- this.pageCurrent = 1;
- this.getPage();
- //this.getCountInfo(this.regionCode);
- } else {
- this.regionCode = '';
- this.query = {};
- this.searchRtuNameVal = '';
- this.searchRtuCodeVal = '';
- this.pageCurrent = 1;
- this.getPage();
- //this.getCountInfo(this.regionCode);
- }
- },
- onDetailViewClick(rtuCode) {
- console.log("onDetailViewClick " + rtuCode)
- var url = '/pages/equipment-inspection/inspectionreportview?rtuCode=' + rtuCode;
- uni.navigateTo({
- url: url
- })
- },
- onReportClick(rtuCode) {
- console.log("onReportClick " + rtuCode)
- var url = '/pages/equipment-inspection/equipmentinspectionreport?rtuCode=' + rtuCode;
- uni.navigateTo({
- url: url
- })
- },
- onLocationClick(item) {
- if (item.lat && item.lat) {
- let lat = item.lat;
- let lng = item.lng;
- let name = item.rtuName;
- let add = '';
- if (item.locationDesc) {
- add = item.locationDesc;
- }
- uni.openLocation({
- latitude: Number(lat),
- longitude: Number(lng),
- name: name,
- address: "",
- success() {}
- })
- } else {
- uni.showModal({
- content: '经纬度为空,请确认!',
- showCancel: true,
- success(res) {
- if (res.confirm) {
- }
- }
- });
- }
- },
- onWarnInfoViewClick(rtuCode) {
- uni.navigateTo({
- url: '/pages/warning/rtuwarninglist?rtuCode=' + rtuCode
- })
- },
- onCheckOrderProcessClick(item) {
- var that = this;
- console.log("order id " + item.orderId)
- if (this.permission.admin || this.permission.orgAdmin) {
- let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
- uni.navigateTo({
- url: url
- })
- } else {
- if (item.orderConfirm == 0) {
- let url =
- '/pages/check-order/order-confirm?id=' + item.orderId;
- uni.navigateTo({
- url: url
- })
- } else {
- if (item.myOrder == 1) {
- uni.showModal({
- content: '确定继续进行维修任务填报?',
- showCancel: true,
- success(res) {
- if (res.confirm) {
- let url = '/pages/check-order/orderprocessreport?orderId=' + item.orderId;
- uni.navigateTo({
- url: url
- })
- }
- }
- });
- } else {
- let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
- uni.navigateTo({
- url: url
- })
- }
- }
- }
- },
- // onCheckOrderReportClick(item){
- // console.log("order id" + item.orderId)
- // var url = '/pages/check-order/orderprocessreport?orderId=' + item.orderId;
- // uni.navigateTo({
- // url: url
- // })
- // },
- // onViewCheckOrderInfoClick(item){
- // let url = '/pages/check-order/orderprocessreportdetail?orderId=' + item.orderId;
- // uni.navigateTo({
- // url: url
- // })
- // },
- //录入查询
- search() {
- this.pageCurrent = 1;
- // console.log(JSON.stringify(res))
- let params = {};
- if (this.searchRtuCodeVal.length > 0) {
- params['rtuCode'] = this.searchRtuCodeVal;
- }
- if (this.searchRtuNameVal.length > 0) {
- params['rtuName'] = this.searchRtuNameVal;
- }
- this.getPage(params);
- },
- searchRtuNameValClear(e) {
- if (e == null || e.length == 0) {
- this.searchRtuNameVal = '';
- if (this.searchRtuNameVal.length == 0) {
- let params = {};
- if (this.searchRtuCodeVal.length > 0) {
- params['rtuCode'] = this.searchRtuCodeVal;
- }
- this.getPage(params);
- }
- }
- },
- searchRtuCodeValClear(e) {
- if (e == null || e.length == 0) {
- this.searchRtuCodeVal = '';
- if (this.searchRtuCodeVal.length == 0) {
- let params = {};
- if (this.searchRtuNameVal.length > 0) {
- params['rtuName'] = this.searchRtuNameVal;
- }
- this.getPage(params);
- }
- }
- },
- getCountInfo() {
- let that = this;
- http.request({
- url: '/galaxy-business/equipment/inspection/plan/count',
- method: 'GET',
- }).then(res => {
- that.countInfo = res.data;
- })
- },
- toDetail(item) {
- let url = '/pages/equipment-inspection/inspection-list?planId=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- getRegionTree() {
- var that = this;
- http.request({
- url: '/galaxy-business/baseinfo/region/tree',
- method: 'GET',
- }).then(res => {
- if (res.data != null) {
- that.regionTree = res.data;
- that.selectedTreeNode = that.regionTree[0].value;
- that.regionCode = that.regionTree[0].value;
- that.query = {};
- that.query['adCode'] = that.regionCode;
- //that.orgId = that.projectTree[0].orgId;
- //that.projectId = that.projectTree[0].projectId;
- that.getPage();
- that.getCountInfo(that.regionCode);
- }
- }).catch(err => {
- console.log(err)
- })
- },
- getSiteKind(val) {
- let htmltext = '';
- if (val.isRain === 1) {
- htmltext = htmltext + "雨量站";
- }
- if (val.isRiver == 1 || val.isRes == 1) {
- if (htmltext.length > 0) {
- htmltext = htmltext + ' / ';
- }
- htmltext = htmltext + '水位站';
- }
- if (val.isGround == 1) {
- if (htmltext.length > 0) {
- htmltext = htmltext + ' / ';
- }
- htmltext = htmltext + '墒情站';
- }
- if (val.isVideo == 1) {
- if (htmltext.length > 0) {
- htmltext = htmltext + ' / ';
- }
- htmltext = htmltext + '视频站';
- }
- return htmltext;
- },
- getAreaName(item) {
- let htmltext = '';
- if (item.adCity) {
- htmltext = htmltext + item.adCity;
- }
- if (item.adDist) {
- if (htmltext.length > 0) {
- htmltext = htmltext + ' / ';
- }
- htmltext = htmltext + item.adDist;
- }
- return htmltext;
- },
- getPage(params = {}) {
- let that = this;
- const current = this.pageCurrent;
- const size = this.pageSize;
- params['planTypeOption'] = this.planTypeOption;
- let postData = Object.assign(params, this.query);
- http.request({
- url: '/galaxy-business/equipment/inspection/plan/page',
- method: 'GET',
- params: {
- current,
- size,
- },
- data: postData,
- }).then(res => {
- if (res.data != null) {
- //console.log(JSON.stringify(res.data))
- if (res.data.records != null) {
- that.list = res.data.records;
- }
- this.total = res.data.total;
- }
- }).catch(err => {
- console.log(err)
- })
- },
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- </style>
- <style lang="scss" scoped>
- .line {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- }
- .line .lineText {
- margin-left: 10px;
- margin-right: 0px;
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- }
- .line .lineText .inspectionCount {
- color: dodgerblue;
- font-size: 0.7rem;
- }
- .line .lineText .content {
- margin-left: 10px;
- color: gray;
- font-size: 0.7rem;
- }
- .line .lineText .beforeRainInspectionCount {
- color: darkorange;
- font-size: 0.7rem;
- }
- .line .lineText .rainFirstInspectionCount {
- color: lightcoral;
- font-size: 0.7rem;
- }
- .line .lineText .rainSencodInspectionCount {
- color: darkcyan;
- font-size: 0.7rem;
- }
- </style>
|