ec8cd276dcdfe9344e011280fdf14c741faa9d9a.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div style="height:100%;width:100%;" class="tb_wrapper">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="320px" style="float:left" :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  5. <tb-left-tree orgType="073" :isAll="viewPriv" @treeNodeClickHandler="treeNodeClickHandler"
  6. @organList="getOrganList"></tb-left-tree>
  7. </el-aside>
  8. <!-- 主要窗口 -->
  9. <el-main id="dxdcListMaintdfj">
  10. <el-row class="search_item_wrapper">
  11. <el-col :span="24">
  12. <el-form :inline="true" size="mini" class="demo-form-inline" label-width="82px" label-position="right">
  13. <el-form-item label="督查状态">
  14. <el-select v-model="dcType" clearable placeholder="督查状态">
  15. <el-option label="未督查" value="0"></el-option>
  16. <el-option label="督查中" value="1"></el-option>
  17. <el-option label="已督查" value="2"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="行政区名称">
  21. <addvSearch
  22. v-model="adName"
  23. :maxHeight='300'
  24. :maxWidth='250'
  25. :rootAddCode='"000000000000"'
  26. :level='"3"'
  27. :nameOrCode="'name'"
  28. ></addvSearch>
  29. </el-form-item>
  30. <el-form-item label="项目名称">
  31. <el-input v-model="name" placeholder="项目名称" clearable></el-input>
  32. </el-form-item>
  33. <el-form-item label="所在组">
  34. <el-autocomplete v-model="groupName" clearable value-key='nm' :fetch-suggestions="querySearchAsync"
  35. placeholder="请输入内容"
  36. @select="handleSelect"></el-autocomplete>
  37. </el-form-item>
  38. <el-form-item label="督查时间">
  39. <div style="display: flex;">
  40. <el-date-picker
  41. v-model="dateRange"
  42. type="daterange"
  43. value-format="yyyy-MM-dd"
  44. style="width:100%"
  45. range-separator="至"
  46. start-placeholder="开始日期"
  47. end-placeholder="结束日期"
  48. ></el-date-picker>
  49. </div>
  50. </el-form-item>
  51. <el-form-item style="float: right">
  52. <div class="tb_btn_wrapper">
  53. <el-button type="primary" @click="onSubmit">查询</el-button>
  54. <el-button type="success" @click="reSet">重置</el-button>
  55. </div>
  56. </el-form-item>
  57. </el-form>
  58. </el-col>
  59. </el-row>
  60. <div class="table_wrapper">
  61. <el-table
  62. ref="table"
  63. border
  64. stripe
  65. :height="tableHeight"
  66. :data="tdfjDataList"
  67. style="width: 100%"
  68. v-loading="expLoading">
  69. <el-table-column type="index" label="序号" width="60" align="center" fixed="left">
  70. <template slot-scope="scope">
  71. <span>{{(pageIndex - 1) * pageSize + (scope.$index + 1)}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column prop="nm" label="项目名称" min-width="130" align="center" fixed="left"></el-table-column>
  75. <el-table-column prop="province" label="省" show-overflow-tooltip min-width="100"
  76. align="center"></el-table-column>
  77. <el-table-column prop="city" label="市" show-overflow-tooltip min-width="100"
  78. align="center"></el-table-column>
  79. <el-table-column prop="country" label="县" show-overflow-tooltip min-width="100"
  80. align="center"></el-table-column>
  81. <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150"
  82. align="center"></el-table-column>
  83. <el-table-column prop="intm" label="创建时间" show-overflow-tooltip min-width="100"
  84. align="center"></el-table-column>
  85. <el-table-column
  86. prop="uptm"
  87. label="更新时间"
  88. align="center"
  89. min-width="100">
  90. </el-table-column>
  91. <el-table-column
  92. label="督查状态"
  93. align="center"
  94. min-width="130">
  95. <template slot-scope="scope">
  96. <span
  97. style="color: #ED2B2F;"
  98. v-if="scope.row.state == '0' || !scope.row.state">未督查</span>
  99. <span
  100. style="color:#F88D2E"
  101. v-if="scope.row.state == '1'">督查中</span>
  102. <span
  103. style="color:#00BE6D"
  104. v-if="scope.row.state == '2'">已督查</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. prop="waterPriceIsMade"
  109. label="县级组织、管理情况表"
  110. align="center"
  111. min-width="170">
  112. <template slot-scope="scope">
  113. <p style="cursor:pointer;color:#F56C6C;"
  114. v-if="scope.row.coMngState == 0 || !scope.row.coMngState">待填报</p>
  115. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.coMngState == 1">未完成</p>
  116. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.coMngState == 2">已完成</p>
  117. </template>
  118. </el-table-column>
  119. <el-table-column align="center" label="操作" min-width="220" fixed="right" v-if="hasPriv">
  120. <template slot-scope="scope">
  121. <div v-if="scope.row.state != 2">
  122. <el-button size="mini" type="warning" v-if="!scope.row.rgstrId" @click="toAddMember('填报',scope.row)">
  123. <i class="el-icon-edit"></i> 填报
  124. </el-button>
  125. <el-button size="mini" type="warning" v-if="scope.row.rgstrId" @click="toAddMember('编辑',scope.row)"><i
  126. class="el-icon-edit"></i> 编辑
  127. </el-button>
  128. <el-button size="mini" type="danger" @click="deleteMember(scope.row)"><i class="el-icon-delete"></i>
  129. 删除
  130. </el-button>
  131. <el-button size="mini" type="primary" @click="submitHandler(scope.row)"><i
  132. class="el-icon-success"></i> 提交
  133. </el-button>
  134. </div>
  135. <div v-else>
  136. <el-button size="mini" type="primary" @click="toView(scope.row)">查看</el-button>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="center" label="操作" min-width="120" fixed="right" v-if="viewPriv">
  141. <template slot-scope="scope">
  142. <el-button size="mini" type="primary"
  143. @click="toView(scope.row)">查看
  144. </el-button>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <el-pagination background :pager-count="5" :current-page="pageIndex"
  149. :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
  150. layout="total, sizes, prev, pager, next" :total="total"
  151. @current-change="pageIndexChange" @size-change="handleSizeChange"
  152. ></el-pagination>
  153. </div>
  154. </el-main>
  155. <!-- </el-container> -->
  156. <xiaoShuiDianTianBao v-if="showxiaoShuiDianTianBao" :rowData="rowData"
  157. :currentObjectRgstrId="currentObjectRgstrId"
  158. :currentObjectId="currentObjectId"
  159. :currentObjectName="currentResName"
  160. @cancelHandler="cancelHandler"
  161. @addXiaoShuiDianSuccess="addXiaoShuiDianSuccess"
  162. :ifDisabled="ifDisabled"></xiaoShuiDianTianBao>
  163. </el-container>
  164. <!-- 添加/编辑人员弹窗 -->
  165. </div>
  166. </template>
  167. <script>
  168. import request from '@util/gw_ajax_request.js'
  169. import {dateFormat} from '@util/gw_date.js'
  170. import provTreeList from "@widget/provTreeList.vue";
  171. import xiaoShuiDianTianBao from "./xiaoshuidian/xiaoshuidianTianBao.vue"
  172. import addvSearch from "@widget/addvSearch.vue"
  173. import tbLeftTree from "./dctb_lefttree.vue"
  174. export default {
  175. components: {
  176. provTreeList: provTreeList,
  177. xiaoShuiDianTianBao: xiaoShuiDianTianBao,
  178. addvSearch,
  179. tbLeftTree,
  180. },
  181. props: [],
  182. data() {
  183. return {
  184. dateRange: [],
  185. lyjg: [],
  186. engScale: '',
  187. orgName: '',
  188. groupName: '',
  189. groupId: '',
  190. groups: [],
  191. // sttm:'',
  192. // ettm:'',
  193. adName: '',
  194. treeData: [],
  195. dxdcMainHeight: window.innerHeight - 304,
  196. testHeight: window.innerHeight - 111,
  197. tdfjDataList: [],
  198. pageIndex: 1,
  199. pageSize: 20,
  200. total: 0,
  201. tableHeight: 0,
  202. currentResCode: '',
  203. currentResName: '',
  204. currentObjectId: '',
  205. currentObjectRgstrId: '',
  206. currentObjectInfoObject: null,
  207. showxiaoShuiDianTianBao: false,
  208. currentAdCode: '',
  209. currentNodeId: '',
  210. rsvrName: '',
  211. dcType: '',
  212. sjState: '',
  213. rowData: '',
  214. disabled: true,
  215. showxiaoShuiDianTianBaoPl: false,
  216. downIcon: 'el-icon-download',
  217. expLoading: false,
  218. dataStat: '',
  219. name: '',
  220. state: '',
  221. ifDisabled: false,
  222. };
  223. },
  224. computed: {
  225. persId() {
  226. return localStorage.getItem("userid")
  227. ? localStorage.getItem("userid")
  228. : "1098101939614724096";
  229. },
  230. isAdmin: function () {
  231. return localStorage.getItem("isAdmin") ? localStorage.getItem("isAdmin") : ''
  232. },
  233. hasPriv() {
  234. return this.ownPriv('manage')
  235. },
  236. viewPriv() {
  237. return this.ownPriv('view')
  238. }
  239. },
  240. mounted() {
  241. this.$nextTick(function () {
  242. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
  243. let _self = this;
  244. window.onresize = function () {
  245. _self.tableHeight = window.innerHeight - _self.$refs.table.$el.offsetTop - 50
  246. }
  247. })
  248. this.getTdfjDataList();
  249. this.getAllGroup();
  250. },
  251. activated() {
  252. },
  253. watch: {
  254. currentNodeId(n, o) {
  255. this.getTdfjDataList();
  256. },
  257. groupName(n, o) {
  258. if (n == '') {
  259. this.groupId = '';
  260. }
  261. },
  262. },
  263. methods: {
  264. reSet() {
  265. this.groupName = "";
  266. this.name = "";
  267. this.dcType = "";
  268. this.adName = "";
  269. this.dateRange = [];
  270. },
  271. //获取所有的组
  272. getAllGroup() {
  273. var _self = this;
  274. request.get('/dc/user/getGroupByPersid', {params: {'persid': this.persId, 'ptype': '073'}}).then((res) => {
  275. if (res.success) {
  276. _self.groups = res.data;
  277. }
  278. })
  279. },
  280. querySearchAsync(queryString, cb) {
  281. var restaurants = this.groups;
  282. var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
  283. clearTimeout(this.timeout);
  284. this.timeout = setTimeout(() => {
  285. cb(results);
  286. }, 1500 * Math.random());
  287. },
  288. createStateFilter(queryString) {
  289. return (state) => {
  290. return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
  291. };
  292. },
  293. handleSelect(item) {
  294. console.log(item);
  295. this.groupId = item.id;
  296. },
  297. getOrganList(data) {
  298. this.lyjg = data
  299. },
  300. treeNodeClickHandler(data) {
  301. this.currentNodeId = data.id;
  302. },
  303. provTreeSelectChangeHandler: function (params) {
  304. this.currentAdCode = params.likeCode;
  305. this.getTdfjDataList();
  306. },
  307. formatDate(row, column) {
  308. if (row.uptm) {
  309. return (dateFormat(row.uptm, 'yyyy-MM-dd'));
  310. }
  311. },
  312. getTdfjDataList: function () {
  313. this.expLoading = true;
  314. let paramStartDate = '';
  315. let paramEndDate = '';
  316. if (this.dateRange && this.dateRange.length > 1 && this.dateRange[0] != '' && this.dateRange[1] != '') {
  317. paramStartDate = this.dateRange[0];
  318. paramEndDate = this.dateRange[1];
  319. }
  320. let params = {
  321. "sttm": paramStartDate,
  322. "entm": paramEndDate,
  323. "pageSize": this.pageSize,
  324. "pageNum": this.pageIndex,
  325. "groupId": this.groupId,
  326. "name": this.name,
  327. "state": this.dcType,
  328. "pType": 73,
  329. "adName": this.adName,
  330. "presId": this.persId,
  331. "plnaId": this.currentNodeId
  332. };
  333. if (this.viewPriv) params['isAll'] = 1
  334. request.post(`/bis/insp/hyst/rgstr/findHystPage`, params).then(res => {
  335. if (res.success) {
  336. this.expLoading = false;
  337. if (res.data.list) {
  338. res.data.list.forEach((item) => {
  339. if (item.intm && item.uptm) {
  340. item.intm = item.intm.substr(0, 10);
  341. item.uptm = item.uptm.substr(0, 10);
  342. }
  343. })
  344. }
  345. this.tdfjDataList = res.data.list;
  346. this.total = res.data.total;
  347. }
  348. })
  349. },
  350. onSubmit() {
  351. this.getTdfjDataList();
  352. },
  353. toAddMember(type, rowData) {
  354. var _self = this;
  355. this.rowData = rowData;
  356. _self.currentObjectId = this.rowData.objId;
  357. _self.currentObjectRgstrId = this.rowData.rgstrId;
  358. _self.currentResName = this.rowData.nm;
  359. _self.currentResCode = this.rowData.code;
  360. _self.ifDisabled = false;
  361. _self.showxiaoShuiDianTianBao = true;
  362. },
  363. toView(rowData) {
  364. var _self = this;
  365. this.rowData = rowData;
  366. _self.currentObjectId = this.rowData.objId;
  367. _self.currentObjectRgstrId = this.rowData.rgstrId;
  368. _self.currentResName = this.rowData.nm;
  369. _self.currentResCode = this.rowData.code;
  370. _self.ifDisabled = true;
  371. _self.showxiaoShuiDianTianBao = true;
  372. },
  373. cancelHandler() {
  374. this.showxiaoShuiDianTianBao = false;
  375. this.getTdfjDataList();
  376. },
  377. addXiaoShuiDianSuccess() {
  378. this.getTdfjDataList();
  379. },
  380. deleteMember(obj) {
  381. console.log(obj);
  382. var _self = this;
  383. this.$confirm('此操作将删除该条相关的所有已填报的信息和问题,确认删除该条数据吗?', '提示', {
  384. confirmButtonText: '确定',
  385. cancelButtonText: '取消',
  386. type: 'warning'
  387. }).then(() => {
  388. request.get(`/supervision/plan/cleanObjDataByObjId?objType=73&objId=${obj.objId}`).then((res) => {
  389. if (res.success) {
  390. _self.pageIndexChange();
  391. _self.$message.success('删除成功')
  392. } else {
  393. _self.$message.error(res.message)
  394. }
  395. });
  396. }).catch(() => {
  397. });
  398. },
  399. submitHandler(rowData) {
  400. var _self = this;
  401. if (rowData.coMngState != '2') {
  402. this.$message.warning('县级组织、管理情况未填报完成')
  403. return
  404. }
  405. this.$confirm('请确认所有信息填报完毕?', '提示', {
  406. confirmButtonText: '确定',
  407. cancelButtonText: '取消',
  408. type: 'warning'
  409. }).then(() => {
  410. let formObj = {
  411. "id": rowData.rgstrId,
  412. "state": "2"
  413. }
  414. request.post('/bis/insp/hyst/rgstr', formObj).then((res) => {
  415. if (res.success) {
  416. _self.addXiaoShuiDianSuccess();
  417. _self.$message.success("提交成功");
  418. } else {
  419. _self.cancelHandler();
  420. }
  421. });
  422. }).catch(() => {
  423. });
  424. },
  425. pageIndexChange(val) {
  426. console.log(val);
  427. this.pageIndex = val;
  428. this.getTdfjDataList();
  429. },
  430. handleSizeChange(val) {
  431. this.pageSize = val;
  432. this.getTdfjDataList();
  433. },
  434. // 下载填报模板
  435. downloadTemplate() {
  436. this.downloadTemplateSet();
  437. this.disabled = false;
  438. },
  439. downloadTemplateSet() {
  440. let paramStartDate = '';
  441. let paramEndDate = '';
  442. if (this.dateRange && this.dateRange.length > 1 && this.dateRange[0] != '' && this.dateRange[1] != '') {
  443. paramStartDate = this.dateRange[0];
  444. paramEndDate = this.dateRange[1];
  445. }
  446. let href = `/pdcApi/bis/insp/fsc/pblm/downTemplate?fileName=pblmFsc.xlsx&adName=${this.adName}&name=${this.name}&state=${this.dcType}&entm=${paramEndDate}sttm=${paramStartDate}&presId=${this.persId}&startRow=1`;
  447. const a = document.createElement('a'); // 创建a标签
  448. a.setAttribute('download', '特定飞检填报模板.xls');// download属性
  449. a.setAttribute('href', href);// href链接
  450. a.click();// 自执行点击事件
  451. },
  452. showPlDialog() {
  453. this.showxiaoShuiDianTianBaoPl = true
  454. },
  455. closePlDialog(val) {
  456. this.showxiaoShuiDianTianBaoPl = false
  457. },
  458. uploadSuccess() {
  459. this.showxiaoShuiDianTianBaoPl = false;
  460. this.getTdfjDataList();
  461. }
  462. },
  463. };
  464. </script>
  465. <style lang="scss">
  466. @import "../../assets/sass/tbPublicCss.scss";
  467. .el-table .warning-row {
  468. background: oldlace;
  469. }
  470. .el-table .success-row {
  471. background: #f0f9eb;
  472. }
  473. #dxdcListMaintdfj {
  474. overflow-y: hidden;
  475. }
  476. </style>