0fb4683c47e5b52de7a803ca4a3f7cab5952e4cd.svn-base 23 KB

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