fc66da63f40b415d8c42d66050be40f712e64986.svn-base 18 KB

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