| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- <template>
- <div style="height:100%;width:100%;" class="tb_wrapper">
- <el-container style="height:100%;width:100%;">
- <el-aside width="320px" style="float:left"
- :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
- <tb-left-tree orgType="029" :isAll="viewPriv" @treeNodeClickHandler="treeNodeClickHandler"
- @organList="getOrganList"
- @changeYear="changeYear"></tb-left-tree>
- </el-aside>
- <!-- 主要窗口 -->
- <el-main id="dxdcListMaindf">
- <el-row class="search_item_wrapper">
- <el-col :span="24">
- <el-form :inline="true" size="mini" class="demo-form-inline" label-width="96px" label-position="right">
- <el-form-item label="督查状态">
- <el-select v-model="dcType" clearable placeholder="督查状态">
- <el-option label="未督查" value="0"></el-option>
- <el-option label="督查中" value="1"></el-option>
- <el-option label="已督查" value="2"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="所在位置">
- <el-input v-model="adName" clearable placeholder="所在位置"></el-input>
- </el-form-item>
- <el-form-item label="险工险段名称">
- <el-input v-model="rsvrName" placeholder="险工险段名称"></el-input>
- </el-form-item>
- <el-form-item label="所在组">
- <el-autocomplete v-model="groupName" clearable value-key='nm'
- :fetch-suggestions="querySearchAsync" placeholder="请输入内容"
- @select="handleSelect"></el-autocomplete>
- </el-form-item>
- <el-form-item label="督查时间">
- <div style="display: flex;">
- <el-date-picker
- v-model="dateRange"
- type="daterange"
- value-format="yyyy-MM-dd"
- style="width:100%"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </div>
- </el-form-item>
- <el-form-item style="float: right">
- <div class="tb_btn_wrapper">
- <el-button type="primary" @click="onSubmit">查询</el-button>
- <el-button type="success" @click="reSet">重置</el-button>
- </div>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <div class="table_wrapper">
- <!-- <div class="table_operate">-->
- <!-- <el-button type="success" style="float:right;margin-left:5px"-->
- <!-- @click="showPlDialog"-->
- <!-- icon="el-icon-upload2"-->
- <!-- :disabled="disabled"-->
- <!-- >批量填报-->
- <!-- </el-button>-->
- <!-- <el-button type="success" style="float:right;"-->
- <!-- @click="downloadTemplate"-->
- <!-- :icon="downIcon"-->
- <!-- >下载模版-->
- <!-- </el-button>-->
- <!-- </div>-->
- <el-table
- ref="table"
- border
- stripe
- :height="tableHeight"
- :data="dfDataList"
- style="width: 100%"
- v-loading="expLoading">
- <el-table-column type="index" label="序号" width="60" align="center" fixed="left">
- <template slot-scope="scope">
- <span>{{(pageIndex - 1) * pageSize + (scope.$index + 1)}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="nm" label="险工险段名称" min-width="130" align="center"
- fixed="left"></el-table-column>
- <el-table-column
- prop="location"
- min-width="200"
- label="险工险段所在位置">
- </el-table-column>
- <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150"
- align="center"></el-table-column>
- <el-table-column prop="intm" label="督查时间" show-overflow-tooltip min-width="200"
- align="center"></el-table-column>
- <el-table-column
- prop="state"
- label="督查状态"
- align="center"
- min-width="130">
- <template slot-scope="scope">
- <span
- style="color: #ED2B2F;"
- v-if="scope.row.state == 0"
- >未督查</span>
- <span
- style="color:#F88D2E"
- v-if="scope.row.state == 1"
- >督查中</span>
- <span
- style="color:#00BE6D"
- v-if="scope.row.state == 2"
- >已督查</span>
- </template>
- </el-table-column>
- <el-table-column
- v-for="(column,index) in fillTableData"
- :key="index"
- :prop="column.prop"
- :label='column.label'
- align="center"
- min-width="130">
- <template slot-scope="scope">
- <p style="cursor:pointer;color:#F56C6C;"
- v-if="scope.row[column.prop] == 0 || !scope.row[column.prop]">待填报</p>
- <p style="cursor:pointer;color:#fbb56d" v-if="scope.row[column.prop] == 1">未完成</p>
- <p style="cursor:pointer;color:#67C23A" v-if="scope.row[column.prop] == 2">已完成</p>
- <p style="cursor:pointer;color:#67C23A"
- v-if="column.prop == 'viewStat' && scope.row[column.prop] != 0">已填报</p>
- <p style="cursor:pointer;color:#F56C6C;"
- v-if="column.prop == 'viewStat' && scope.row[column.prop] == 0">未填报</p>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" min-width="220" fixed="right" v-if="hasPriv">
- <template slot-scope="scope">
- <!-- scope.row.state != 3 已填报的暂时不显示查看 后期改为scope.row.state != 2 -->
- <div v-if="scope.row.state != 2">
- <el-button size="mini" type="warning" v-if="!scope.row.rgstrId"
- @click="toAddMember('填报',scope.row)"><i class="el-icon-edit"></i> 填报
- </el-button>
- <el-button size="mini" type="warning" v-if="scope.row.rgstrId"
- @click="toAddMember('编辑',scope.row)"><i class="el-icon-edit"></i> 编辑
- </el-button>
- <el-button size="mini" type="danger" @click="deleteMember(scope.row)"><i class="el-icon-delete"></i>
- 删除
- </el-button>
- <el-button size="mini" type="primary" @click="submitHandler(scope.row)"><i
- class="el-icon-success"></i> 提交
- </el-button>
- </div>
- <div v-else>
- <el-button size="mini" type="primary" @click="toView(scope.row)">查看</el-button>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" min-width="120" fixed="right" v-if="viewPriv">
- <template slot-scope="scope">
- <el-button size="mini" type="primary"
- @click="toView(scope.row)">查看
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination background :pager-count="5" :current-page="pageIndex"
- :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
- layout="total, sizes, prev, pager, next" :total="total"
- @current-change="pageIndexChange" @size-change="handleSizeChange"
- ></el-pagination>
- </div>
- </el-main>
- <!-- </el-container> -->
- <diFangTianBao v-if="showShuiKuTianBao" :rowData="rowData" :currentObjectRgstrId="currentObjectRgstrId"
- :currentResCode="currentResCode" :currentObjectId="currentObjectId"
- :currentObjectName="currentResName"
- @cancelHandler="cancelHandler" @addShuiKuSuccess="addShuiKuSuccess" pType="29">
- </diFangTianBao>
- <!-- 督查信息查看 -->
- <difangView v-if="dfInfoDialog"
- :currentDuchaTpe="true"
- :rowData="rowData"
- :currentObjectId="currentObjectId"
- :currentObjectRgstrId="currentObjectRgstrId"
- :currentResCode="currentResCode"
- :currentObjectName="currentResName"
- @cancelHandler="dfCancelHandler"></difangView>
- </el-container>
- <!-- 添加/编辑人员弹窗 -->
- <!-- 上传模板弹窗 -->
- <tianBaoPiLiangCom v-if="showtianBaoPiLiangCom"
- :showtianBaoPiLiangCom="showtianBaoPiLiangCom"
- :id="currentNodeId"
- :preUrl="'/bis/insp/waga/sap/rgstr'"
- :dialogTitle="'堤防险工险段批量填报'"
- @closePlDialog="closePlDialog"></tianBaoPiLiangCom>
- </div>
- </template>
- <script>
- import request from '../../utils/gw_ajax_request.js'
- import {dateFormat} from '../../utils/gw_date.js'
- import {downloadTemplateSet} from '@util/gw_exportModel.js'
- import {getList_df} from "../../api/duChaTianBao.js";
- import provTreeList from "../../widgets/provTreeList.vue";
- import diFangTianBao from "../duChaTianBao/diFangTianbao.vue"
- import tianBaoPiLiangCom from "../duChaTianBao/tianBaoPiLiangCom.vue"
- import addvSearch from "../../widgets/addvSearch.vue"
- import tbLeftTree from "./dctb_lefttree.vue"
- export default {
- components: {
- provTreeList: provTreeList,
- diFangTianBao: diFangTianBao,
- tianBaoPiLiangCom: tianBaoPiLiangCom,
- addvSearch,
- tbLeftTree,
- difangView: resolve => {
- require(["../zongHeXinXiOl/components/popupWindow/dfxgxd/main.vue"], resolve);
- }, //查看弹窗
- },
- props: [],
- data() {
- return {
- dateRange: [],
- tableHeight: 50,
- lyjg: [],
- engScales: [
- {id: '4', name: '小(1)型'},
- {id: '5', name: '小(2)型'},
- ],
- engScale: '',
- orgName: '',
- groupName: '',
- groupId: '',
- groups: [],
- // sttm:'',
- // ettm:'',
- adName: '',
- treeData: [],
- dxdcMainHeight: window.innerHeight - 304,
- testHeight: window.innerHeight - 90,
- dfDataList: [],
- pageIndex: 1,
- pageSize: 20,
- total: 0,
- currentResCode: '',
- currentResName: '',
- currentObjectId: '',
- currentObjectRgstrId: '',
- currentObjectInfoObject: null,
- showShuiKuTianBao: false,
- currentAdCode: '',
- currentNodeId: '',
- rsvrName: '',
- dcType: '',
- rowData: '',
- disabled: true,
- showtianBaoPiLiangCom: false,
- downIcon: 'el-icon-download',
- expLoading: false,
- $el: '',
- fillTableData: [
- // {
- // label: '管理责任体系',
- // prop: "mrsCiStat"
- // },
- // {
- // label: '安全管理',
- // prop: "safeStat"
- // },
- // {
- // label: "日常管理与维护",
- // prop: "dmamStat"
- // },
- // {
- // label: "工程实体检查",
- // prop: "proenStat"
- // }
- {
- label: "基本情况表",
- prop: "baseInfoState"
- }
- ],
- newYear: "",
- dfInfoDialog: false
- };
- },
- computed: {
- persId() {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- isAdmin() {
- return localStorage.getItem("isAdmin") ? localStorage.getItem("isAdmin") : ''
- },
- hasPriv() {
- return this.ownPriv('manage')
- },
- viewPriv() {
- return this.ownPriv('view')
- }
- },
- mounted() {
- this.$nextTick(function () {
- this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
- let _self = this;
- window.onresize = function () {
- _self.tableHeight = window.innerHeight - _self.$refs.table.$el.offsetTop - 50
- }
- })
- // this.getDfDataList();
- this.getAllGroup();
- },
- activated() {
- },
- watch: {
- currentNodeId(n, o) {
- if (n) {
- this.getDfDataList();
- }
- },
- groupName(n, o) {
- if (n == '') {
- this.groupId = '';
- }
- },
- },
- methods: {
- changeYear(val) {
- this.newYear = val;
- this.currentNodeId = '';
- this.getDfDataList();
- },
- reSet() {
- this.groupName = "";
- this.rsvrName = "";
- this.dcType = "";
- this.adName = "";
- this.dateRange = [];
- },
- //获取所有的组
- getAllGroup() {
- var _self = this;
- request.get('/dc/user/getGroupByPersid', {
- params: {
- 'persid': this.persId,
- 'ptype': '29'
- }
- }).then((res) => {
- if (res.success) {
- _self.groups = res.data;
- }
- })
- },
- querySearchAsync(queryString, cb) {
- var restaurants = this.groups;
- var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
- clearTimeout(this.timeout);
- this.timeout = setTimeout(() => {
- cb(results);
- }, 1500 * Math.random());
- },
- createStateFilter(queryString) {
- return (state) => {
- return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
- };
- },
- handleSelect(item) {
- console.log(item);
- this.groupId = item.id;
- },
- getOrganList(data) {
- this.lyjg = data
- },
- treeNodeClickHandler(data) {
- this.currentNodeId = data.id;
- },
- provTreeSelectChangeHandler: function (params) {
- this.currentAdCode = params.likeCode;
- this.getDfDataList();
- },
- formatDate(row, column) {
- if (row.uptm) {
- return (dateFormat(row.uptm, 'yyyy-MM-dd'));
- }
- },
- formatEngScal(row, column) {
- let engScal = row.engScal;
- let _engScal = '其他';
- switch (engScal) {
- case '1' :
- _engScal = '大(1)型';
- break;
- case '2' :
- _engScal = '大(2)型';
- break;
- case '3' :
- _engScal = '中型';
- break;
- case '4' :
- _engScal = '小(1)型';
- break;
- case '5' :
- _engScal = '小(2)型';
- break;
- case '9' :
- _engScal = '其他';
- break;
- }
- return _engScal;
- },
- getDfDataList: function () {
- let paramStartDate = '';
- let paramEndDate = '';
- if (this.dateRange && this.dateRange.length > 1 && this.dateRange[0] != '' && this.dateRange[1] != '') {
- paramStartDate = this.dateRange[0];
- paramEndDate = this.dateRange[1];
- }
- let data = {
- 'presId': this.persId,
- "pType": "29",
- "pageSize": this.pageSize,
- 'pageNum': this.pageIndex,
- 'plnaId': this.currentNodeId,
- 'rsName': this.rsvrName,
- 'state': this.dcType,
- 'adName': this.adName,
- 'sttm': paramStartDate,
- 'entm': paramEndDate,
- 'riverId': this.orgName,
- 'engScal': this.engScale,
- 'groupId': this.groupId,
- 'year': this.newYear
- }
- if (this.viewPriv) data['isAll'] = 1
- getList_df(data).then(
- (res) => {
- console.log(res);
- res.data.list.forEach((item) => {
- if (item.intm) {
- item.intm = item.intm.substr(0, 16);
- }
- if (item.uptm) {
- item.uptm = item.uptm.substr(0, 16);
- }
- })
- this.dfDataList = res.data.list;
- this.total = res.data.total;
- }
- );
- },
- onSubmit() {
- this.getDfDataList();
- },
- toAddMember(type, rowData) {
- var _self = this;
- this.rowData = rowData;
- console.log(rowData);
- _self.currentResCode = this.rowData.code;
- _self.currentObjectId = this.rowData.objId;
- _self.currentObjectRgstrId = this.rowData.rgstrId;
- _self.currentResName = this.rowData.nm;
- _self.showShuiKuTianBao = true;
- },
- cancelHandler() {
- this.showShuiKuTianBao = false;
- },
- addShuiKuSuccess() {
- this.getDfDataList();
- },
- deleteMember(obj) {
- console.log(obj);
- var _self = this;
- this.$confirm('此操作将督查对象从列表中删除,确认删除该险工险段吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request.get(`/supervision/plan/cleanObjDataByObjId?objType=29&objId=${obj.objId}`).then((res) => {
- if (res.success) {
- _self.pageIndexChange();
- _self.$message.success('删除成功')
- } else {
- _self.$message.error(res.message)
- }
- });
- }).catch(() => {
- });
- },
- submitHandler(rowData) {
- console.log(rowData)
- var _self = this;
- if (rowData.baseInfoState != '2') {
- this.$message({
- message: '基本情况表未完成!',
- type: 'warning'
- });
- return
- }
- // } else if (rowData.safeStat != '2') {
- // this.$message({
- // message: '安全管理填报未完成!',
- // type: 'warning'
- // });
- // return
- // } else if (rowData.dmamStat != '2') {
- // this.$message({
- // message: '日常管理与维护填报未完成',
- // type: 'warning'
- // });
- // return
- // } else if (rowData.proenStat != '2') {
- // this.$message({
- // message: '工程实体检查填报未完成',
- // type: 'warning'
- // });
- // return
- // }
- this.$confirm('请确认所有信息填报完毕?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let formObj = {
- "persId": this.persId,
- "id": rowData.rgstrId,
- "objId": rowData.objId,
- "state": "2"
- }
- request.post('/bis/insp/waga/sap/rgstr', formObj).then((res) => {
- if (res.success) {
- _self.addShuiKuSuccess();
- _self.$message.success("提交成功");
- } else {
- _self.cancelHandler();
- }
- });
- }).catch(() => {
- });
- },
- pageIndexChange(val) {
- console.log(val);
- this.pageIndex = val;
- this.getDfDataList();
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.getDfDataList();
- },
- // 下载填报模板
- downloadTemplate() {
- let href = '/padApi/bis/insp/waga/sap/rgstr/downTemplate?plnaId=' + this.currentNodeId + '&presId=' + this.persId + '&pType=29';
- downloadTemplateSet(href, '堤防险工险段填报模板.xls');
- this.disabled = false;
- },
- showPlDialog() {
- this.showtianBaoPiLiangCom = true
- },
- closePlDialog(val) {
- this.showtianBaoPiLiangCom = false
- },
- toView(rowData) {
- this.rowData = rowData;
- this.currentResCode = this.rowData.code;
- this.currentObjectId = this.rowData.objId;
- this.currentObjectRgstrId = this.rowData.rgstrId;
- this.currentResName = this.rowData.nm;
- this.dfInfoDialog = true;
- },
- dfCancelHandler() {
- this.dfInfoDialog = false;
- },
- },
- };
- </script>
- <style lang="scss">
- @import "../../assets/sass/tbPublicCss.scss";
- .el-table .warning-row {
- background: oldlace;
- }
- .el-table .success-row {
- background: #f0f9eb;
- }
- #dxdcListMaindf {
- overflow-y: hidden;
- }
- </style>
|