0a71a2972fee0684987b17be123b56ab4e96f5c2.svn-base 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <!-- <h3 style="text-align: center;margin: 10px 0 20px;">{{title}}</h3> -->
  4. <el-container style="height:100%;width:100%;">
  5. <el-aside :height="asideHeight" style="padding-right: 10px;width:300px;">
  6. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  7. <el-card class="box-card" style="min-height: 99%;" id="headerBtn">
  8. <div slot="header" class="clearfix">
  9. <div style="width: 100%;text-align: center;">
  10. <el-button size="mini" :class="tabType==1 ? 'c_active' : 'c_normal'" @click="tabChange('1')">当前数据</el-button>
  11. <!-- <el-button size="mini" :class="tabType==2 ? 'c_active' : 'c_normal'" @click="tabChange('2')">历史数据</el-button>-->
  12. <el-button size="mini" :class="tabType==0 ? 'c_active' : 'c_normal'" @click="tabChange('0')">全部数据</el-button>
  13. </div>
  14. </div>
  15. <el-tree :data="groupTreeData" :props="defaultProps" :expand-on-click-node="false" @node-click="groupHandleNodeClick">
  16. </el-tree>
  17. </el-card>
  18. </div>
  19. </el-aside>
  20. <el-aside :height="asideHeight" style="width:350px;">
  21. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  22. <el-card class="box-card" style="min-height: 99%">
  23. <div slot="header" class="clearfix">
  24. <span>工程信息</span>
  25. <!-- <el-button style="float: right; padding: 3px 0" type="text" @click="batchImport" v-if="ownPriv('manage')">批量导入</el-button>-->
  26. <!-- 水利工程基础信息批量导入弹窗 -->
  27. <slgc-tian-bao-pl v-if="showGongChengTianBaoPl" @closePlDialog="closePlDialog"></slgc-tian-bao-pl>
  28. </div>
  29. <el-tree :data="treeData" :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick">
  30. <span class="custom-tree-node" slot-scope="{ node, data }">
  31. <span :title="node.label">{{ node.label?(node.label.length>12?(node.label.substring(0,12))+"...":node.label):""}}</span>
  32. <span>
  33. <el-button
  34. type="text"
  35. size="mini"
  36. v-if="false"
  37. @click="() => toCorrect(data,node)">
  38. 纠错
  39. </el-button>
  40. <el-button
  41. type="text"
  42. size="mini"
  43. v-if="node.level == 1 && isDateRange && data.state!='2' && ownPriv('manage')"
  44. @click="() => toAddJiBenQingKuang(data)">
  45. 基本情况
  46. </el-button>
  47. <el-button
  48. type="text"
  49. size="mini"
  50. v-if="node.level == 1 && isDateRange && data.state!='2' && ownPriv('manage')"
  51. @click="() => toAddBiaoDuan(data)">
  52. 添加标段
  53. </el-button>
  54. <el-button
  55. type="text"
  56. size="mini"
  57. v-if="node.level == 1 && isDateRange && data.state!='2' && ownPriv('manage')"
  58. @click="() => submitState(data,node,2)">
  59. 提交
  60. </el-button>
  61. <el-button
  62. type="text"
  63. size="mini"
  64. style="color:#ff5b5d";
  65. v-if="node.level == 1 && isDateRange && data.state=='2' && ownPriv('revoke')"
  66. @click="() => submitState(data,node,1)">
  67. 撤回
  68. </el-button>
  69. <el-button
  70. type="text"
  71. size="mini"
  72. v-if="node.level == 2 && isDateRange && data.state!='2' && ownPriv('manage')"
  73. @click="() => toEditBiaoDuan(data)">
  74. 编辑
  75. </el-button>
  76. <el-button
  77. type="text"
  78. size="mini"
  79. v-if="node.level == 2 && isDateRange && data.state!='2' && ownPriv('manage')"
  80. @click="() => delete_biaoDuan(data,node)">
  81. 删除
  82. </el-button>
  83. <el-button
  84. type="text"
  85. size="mini"
  86. v-if="node.level == 2 && isDateRange && data.state!='2' && ownPriv('manage')"
  87. @click="() => toAddUnit(data)">
  88. 添加单位
  89. </el-button>
  90. <el-button
  91. type="text"
  92. size="mini"
  93. v-if="node.level == 3 && isDateRange && data.state!='2' && ownPriv('manage')"
  94. @click="() => toEditUnit(data)">
  95. 编辑
  96. </el-button>
  97. <el-button
  98. type="text"
  99. size="mini"
  100. v-if="node.level == 3 && isDateRange && data.state!='2' && ownPriv('manage')"
  101. @click="() => delete_unit(data,node)">
  102. 删除
  103. </el-button>
  104. </span>
  105. </span>
  106. </el-tree>
  107. </el-card>
  108. </div>
  109. </el-aside>
  110. <el-main id="dxdcListMainsk" style="width: calc(100% - 650px);height:100%;padding:0px 0px 0px 10px;">
  111. <div class="flex_wrapper" :style="{'height': asideHeight-9 + 'px'}">
  112. <!-- 工程问题清单 -->
  113. <project-problem :villType="'8'" :currentRow="currentRow" :isSubmit="isSubmit" :unitProblemInfo="unitProblemInfo" :showAddBtn="showAddBtn" :tabType="tabType" :isDateRange="isDateRange"></project-problem>
  114. </div>
  115. </el-main>
  116. </el-container>
  117. <!-- 工程纠错 -->
  118. <el-dialog :title="'基本信息纠错'" :visible.sync="correct_Dialog">
  119. <div style="text-align: right; margin-bottom: 10px;">
  120. <el-button type="warning" @click="imageClick">影像</el-button>
  121. <el-button type="warning" @click="recentAppearance">近期面貌</el-button>
  122. </div>
  123. <el-form label-width="130px">
  124. <el-form-item label="工程名称">
  125. <el-input v-model="project.nm" clearable readonly></el-input>
  126. </el-form-item>
  127. <el-form-item label="工程类型">
  128. <el-input v-model="projectType" clearable readonly></el-input>
  129. </el-form-item>
  130. <el-form-item label="开工时间" required>
  131. <el-date-picker
  132. v-model="project.stwktm"
  133. align="right"
  134. type="year"
  135. value-format="yyyy"
  136. placeholder="选择年"
  137. ></el-date-picker>
  138. </el-form-item>
  139. <el-form-item label="计划工期" required>
  140. <el-input v-model="project.plantm" clearable>
  141. <template slot="append">月</template>
  142. </el-input>
  143. </el-form-item>
  144. <el-form-item label="概算批复总投资" required>
  145. <el-input v-model="project.estapp" clearable>
  146. <template slot="append">亿元</template>
  147. </el-input>
  148. </el-form-item>
  149. </el-form>
  150. <div slot="footer" class="dialog-footer">
  151. <el-button @click="correct_Dialog = false">取 消</el-button>
  152. <el-button type="primary" @click="saveCorrect">确 定</el-button>
  153. </div>
  154. </el-dialog>
  155. <!-- 添加/编辑基本情况 -->
  156. <el-dialog :title="dialogType + '基本情况'" :visible.sync="jiBenQingKuang_Dialog">
  157. <el-form label-width="120px">
  158. <el-form-item label="工程概况">
  159. <el-input
  160. type="textarea"
  161. :rows="5"
  162. v-model="jiBenQingKuang.engProfil">
  163. </el-input>
  164. </el-form-item>
  165. </el-form>
  166. <el-form label-width="120px">
  167. <el-form-item label="建设进展概况">
  168. <el-input
  169. type="textarea"
  170. :rows="5"
  171. v-model="jiBenQingKuang.engBuild">
  172. </el-input>
  173. </el-form-item>
  174. </el-form>
  175. <div slot="footer" class="dialog-footer">
  176. <el-button @click="jiBenQingKuang_Dialog = false">取 消</el-button>
  177. <el-button type="primary" @click="add_jiBenQingKuang">确 定</el-button>
  178. </div>
  179. </el-dialog>
  180. <!-- 添加/编辑标段 -->
  181. <el-dialog :title="dialogType + '标段'" :visible.sync="biaoduan_Dialog">
  182. <el-form label-width="120px">
  183. <el-form-item label="标段名称" required>
  184. <el-input v-model="biaoduan.nm" clearable></el-input>
  185. </el-form-item>
  186. <!-- <el-form-item label="所属省份" required>
  187. <el-select v-model="biaoduan.adCode" placeholder="请选择">
  188. <el-option :label="item.adName" :value="item.adCode" v-for="(item,index) in provList" :key="index"></el-option>
  189. </el-select>
  190. </el-form-item>
  191. <el-form-item label="所属流域" required>
  192. <el-select v-model="biaoduan.orgId" placeholder="请选择">
  193. <el-option :label="item.pnm" :value="item.id" v-for="(item,index) in waterShedList" :key="index"></el-option>
  194. </el-select>
  195. </el-form-item>-->
  196. <el-form-item label="经度">
  197. <el-input v-model="biaoduan.lgtd" clearable></el-input>
  198. </el-form-item>
  199. <el-form-item label="纬度">
  200. <el-input v-model="biaoduan.lttd" clearable></el-input>
  201. </el-form-item>
  202. </el-form>
  203. <div slot="footer" class="dialog-footer">
  204. <el-button @click="biaoduan_Dialog = false">取 消</el-button>
  205. <el-button type="primary" @click="add_biaoDuan">确 定</el-button>
  206. </div>
  207. </el-dialog>
  208. <!-- 添加/编辑责任单位 -->
  209. <el-dialog :title="dialogType + '责任单位'" :visible.sync="unit_Dialog">
  210. <el-form label-width="120px">
  211. <el-form-item label="单位名称" required>
  212. <el-input v-model="unit.nm" clearable></el-input>
  213. </el-form-item>
  214. <el-form-item label="单位性质" required>
  215. <el-select v-model="unit.nature" placeholder="请选择">
  216. <el-option :label="item.name" :value="item.value" v-for="(item,index) in natureList" :key="index"></el-option>
  217. </el-select>
  218. </el-form-item>
  219. <!-- <el-form-item label="建管模式" required>
  220. <el-select v-model="unit.government" placeholder="请选择">
  221. <el-option :label="item.name" :value="item.value" v-for="(item,index) in modeList" :key="index"></el-option>
  222. </el-select>
  223. </el-form-item> -->
  224. </el-form>
  225. <div slot="footer" class="dialog-footer">
  226. <el-button @click="unit_Dialog = false">取 消</el-button>
  227. <el-button type="primary" @click="add_unit">确 定</el-button>
  228. </div>
  229. </el-dialog>
  230. <!--近期面貌弹窗-->
  231. <theRecentAppearance v-if="jqmmShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="jqmmShow" :jqmmEngId="jqmmEngId" :dialogTitle="slgcjsName + '近期面貌'"></theRecentAppearance>
  232. <!--影像弹窗-->
  233. <el-dialog :title="slgcjsName + '影像'" :visible.sync="imageShow" append-to-body :close-on-click-modal="false" width="60%">
  234. <div style="height: 60vh;">
  235. <mapLocation ref="mapRef" v-if="imageShow" :gdX="centerX" :gdY="centerY"></mapLocation>
  236. </div>
  237. </el-dialog>
  238. </div>
  239. </template>
  240. <script>
  241. import request from "@util/gw_ajax_request.js";
  242. import { dateFormat } from "@util/gw_date.js";
  243. import { getTrees } from "@util/gw_formatTree.js";
  244. import provTreeList from "@widget/provTreeList.vue";
  245. import projectProblem from "./project/projectProblem1.vue";
  246. import projectBuild from './project/jianshe.vue';
  247. import projectOperate from './project/yunxing.vue';
  248. import slgcTianBaoPl from './slgcTianBao_piliang.vue';
  249. import theRecentAppearance from '../duChaDuiXiang/theRecentAppearance';
  250. import mapLocation from '../../views/duChaTianBao/mapLocation';
  251. export default {
  252. components: {
  253. provTreeList: provTreeList,
  254. projectProblem: projectProblem,
  255. projectOperate: projectOperate,
  256. projectBuild: projectBuild,
  257. slgcTianBaoPl: slgcTianBaoPl,
  258. theRecentAppearance: theRecentAppearance,
  259. mapLocation:mapLocation
  260. },
  261. props: [],
  262. data() {
  263. return {
  264. asideHeight: window.innerHeight - 106,
  265. tableHeight: window.innerHeight - 256,
  266. treeData: [],
  267. defaultProps: {
  268. children: 'children',
  269. label: 'pnm'
  270. },
  271. searchObj:{
  272. "engScal": '2'
  273. },
  274. project: {
  275. nm: "",
  276. ptype: "",
  277. stwktm: "",
  278. plantm: "",
  279. estapp: ""
  280. },
  281. currentRow: {},
  282. pageIndex: 1,
  283. pageSize: 20,
  284. total: 0,
  285. dialogType: "添加",
  286. correct_Dialog: false,
  287. showProblemDialog: false,
  288. typeOfProject: '2',
  289. title: '水利工程建设情况检查填报',
  290. showGongChengTianBaoPl: false,
  291. //
  292. waterShedList: [],
  293. provList: [],
  294. unitList: [],
  295. biaoduan:{
  296. nm: '',
  297. adCode: '',
  298. orgId: '',
  299. lgtd: '',
  300. lttd: ''
  301. },
  302. jiBenQingKuang:'',
  303. unit:{
  304. nm: '',
  305. nature: '',
  306. government: ''
  307. },
  308. natureList: [
  309. {name: '项目法人(建设单位)',value: '1'},
  310. {name: '勘察设计单位',value: '2'},
  311. {name: '监理单位',value: '3'},
  312. {name: '施工单位',value: '4'},
  313. {name: '金属结构及机电设备安装单位',value: '5'},
  314. {name: '安全监测单位',value: '6'},
  315. {name: '质量检测单位',value: '7'}
  316. ],
  317. modeList: [
  318. {name: '直管',value: '1'},
  319. {name: '代建',value: '2'}
  320. ],
  321. biaoduan_Dialog: false,
  322. unit_Dialog: false,
  323. isClicked: true,
  324. showProblemDialog: false,
  325. unitProblemInfo: {
  326. nature: '1',
  327. codes: '',
  328. secId: ''
  329. },
  330. jqmmShow: false,
  331. imageShow: false,
  332. jqmmEngId: '',
  333. slgcjsName: '',
  334. centerX: 0,
  335. centerY: 0,
  336. //
  337. groupTreeData: [],
  338. plnaId: '004', //督查组id
  339. showAddBtn: false,
  340. isSubmit: false,
  341. jiBenQingKuang_Dialog: false,
  342. jiBenflag: '0',
  343. tabType:"0",
  344. isDateRange:false,
  345. };
  346. },
  347. computed: {
  348. persId() {
  349. return localStorage.getItem("userid")
  350. ? localStorage.getItem("userid")
  351. : "1098101939614724096";
  352. },
  353. projectType() {
  354. let val = this.project.ptype;
  355. if (val != "0" && !val) {
  356. return "";
  357. }
  358. if (val == "0") {
  359. return "重大农业节水工程";
  360. } else if (val == "1") {
  361. return "重大引调水工程";
  362. } else if (val == "2") {
  363. return "重点水源工程";
  364. } else if (val == "3") {
  365. return "江河湖泊治理骨干工程";
  366. } else if (val == "4") {
  367. return "新建大型灌区工程";
  368. } else if (val == "5") {
  369. return "非水利部下达投资计划";
  370. } else if (val == "6") {
  371. return "全部由地方投资";
  372. } else if (val == "7") {
  373. return "其他项目";
  374. } else {
  375. return "未知项目";
  376. }
  377. }
  378. },
  379. mounted() {
  380. this.getGroupData();
  381. },
  382. activated() {
  383. this.getDataList();
  384. },
  385. watch: {
  386. },
  387. methods: {
  388. tabChange(tabType){
  389. this.tabType = tabType;
  390. this.plnaId='004';
  391. this.getGroupData();
  392. },
  393. //获取工程列表信息
  394. getDataList() {
  395. let paramObj = {
  396. type: "empwt",
  397. presId: this.persId,
  398. pageSize: this.pageSize,
  399. pageNum: this.pageIndex,
  400. plnaId: this.plnaId,
  401. tabType:this.tabType
  402. }
  403. Object.assign(this.searchObj,paramObj)
  404. request
  405. .post(`/dc/insp/rsvrRgstr/list/tree`, this.searchObj)
  406. .then(res => {
  407. if (res.success) {
  408. this.treeData = res.data;
  409. console.log(this.treeData,'132131231312313')
  410. if (this.treeData.length) {
  411. this.currentRow = this.treeData[0];
  412. // this.addRegister()
  413. }
  414. }
  415. });
  416. },
  417. // 工程信息纠错
  418. toCorrect(row,node) {
  419. this.currentRow = row
  420. request.get(`/bis/insp/empwtprj/base/${row.code}`).then(res => {
  421. if (res.success) {
  422. this.project = res.data;
  423. if(this.project.stwktm){
  424. this.project.stwktm = this.project.stwktm.toString();
  425. }else {
  426. this.project.stwktm = "";
  427. }
  428. this.slgcjsName = this.project.nm;
  429. this.jqmmEngId = this.currentRow.id;
  430. this.centerX = this.project.lgtdPc;
  431. this.centerY = this.project.lttdPc;
  432. }
  433. });
  434. this.correct_Dialog = true;
  435. },
  436. saveCorrect() {
  437. this.project.persId = this.persId;
  438. //校验计划工期和概算批复总投资,实际应根据实际业务进行校验
  439. if(this.project.plantm < 0 || this.project.plantm > 1200){
  440. this.$message.error('计划工期的范围应在0-1200之间,请重新填写!');
  441. this.project.plantm = '';
  442. return;
  443. };
  444. if(this.project.estapp < 0 || this.project.estapp > 9999 ){
  445. this.$message.error('概算批复总投资的范围应在0-9999之间,请重新填写!');
  446. this.project.estapp = '';
  447. return;
  448. };
  449. request
  450. .post(`/bis/insp/empwtprj/base/update`, this.project)
  451. .then(res => {
  452. if (res.success) {
  453. this.$message.success("修改成功");
  454. this.correct_Dialog = false;
  455. this.getDataList();
  456. } else {
  457. this.$message.error(res.message);
  458. }
  459. })
  460. .catch(error => {
  461. this.$message.error(res.message);
  462. });
  463. },
  464. addRegister(){
  465. let paramObj = {
  466. "code": this.currentRow.code,
  467. "objId": this.currentRow.objId,
  468. "nodeId": this.currentRow.nodeId,
  469. "recPersId": this.persId,
  470. "id": this.currentRow.id
  471. }
  472. request
  473. .post(`/bis/insp/key/register/add`, paramObj)
  474. .then(res => {
  475. if (res.success && res.data) {
  476. this.currentRow.id = res.data.id
  477. } else {
  478. this.$message.error(res.message);
  479. }
  480. })
  481. .catch(error => {
  482. this.$message.error(res.message);
  483. });
  484. },
  485. formatDate(row, column) {
  486. if (row.uptm) {
  487. return dateFormat(row.uptm, "yyyy-MM-dd");
  488. }
  489. },
  490. pageIndexChange(val) {
  491. this.pageIndex = val;
  492. this.getDataList();
  493. },
  494. handleSizeChange(val) {
  495. this.pageSize = val;
  496. this.getDataList();
  497. },
  498. batchImport(){
  499. this.showGongChengTianBaoPl = true
  500. },
  501. closePlDialog(){
  502. this.showGongChengTianBaoPl = false
  503. },
  504. //树节点点击事件
  505. handleNodeClick(data,node) {
  506. this.isSubmit = data.state=="2"?false:true;
  507. console.log(data);
  508. if(node.level == 3){
  509. this.showAddBtn = true
  510. request.get(`/bis/insp/key/reg/sec/unit/${data.id}`).then((res) => {
  511. if(res.success){
  512. let data = res.data
  513. data['codes'] = ''
  514. data['secId'] = ''
  515. this.unitProblemInfo = data
  516. }else{
  517. this.$message.error(res.message)
  518. }
  519. });
  520. console.log(node)
  521. this.currentRow = node.parent.parent.data
  522. }else if(node.level == 1){
  523. this.showAddBtn = false
  524. this.unitProblemInfo.codes = data.code
  525. this.unitProblemInfo.secId = ''
  526. this.unitProblemInfo.id = ''
  527. }else{
  528. this.showAddBtn = false
  529. this.unitProblemInfo.secId = data.id
  530. this.unitProblemInfo.codes = ''
  531. this.unitProblemInfo.id = ''
  532. }
  533. },
  534. submitState(row,node,state){
  535. this.$confirm('确定要提交吗?', '提示', {
  536. confirmButtonText: '确定',
  537. cancelButtonText: '取消',
  538. type: 'warning'
  539. }).then(() => {
  540. var param = {
  541. id:row.id,
  542. state:state
  543. }
  544. request.post(`/bis/insp/key/register/add`, param).then(res => {
  545. if (res.success && res.data) {
  546. this.getDataList()
  547. } else {
  548. this.$message.error(res.message);
  549. }
  550. })
  551. })
  552. },
  553. // 添加标段
  554. toAddBiaoDuan(row){
  555. this.dialogType = '添加'
  556. this.currentRow = row
  557. this.addRegister()
  558. this.getWatershedList()
  559. this.getprovList('000000000000')
  560. this.biaoduan = {
  561. nm: '',
  562. adCode: '',
  563. orgId: '',
  564. lgtd: '',
  565. lttd: ''
  566. }
  567. this.biaoduan_Dialog = true
  568. },
  569. // 修改基本情况
  570. add_jiBenQingKuang(){
  571. if(this.jiBenflag == 1){
  572. request
  573. .post(`/bis/insp/key/register/add`, this.jiBenQingKuang)
  574. .then(res => {
  575. console.log(res,'resrearaer')
  576. if (res.success) {
  577. this.$message.success('修改成功')
  578. this.jiBenQingKuang_Dialog = false;
  579. } else {
  580. this.$message.error(res.message);
  581. }
  582. })
  583. .catch(error => {
  584. this.$message.error(error);
  585. });
  586. }else if(this.jiBenflag != 1){
  587. request
  588. .post(`/bis/insp/key/register/add`, this.jiBenQingKuang)
  589. .then(res => {
  590. console.log(res,'resrearaer11111111111111111111111')
  591. if (res.success) {
  592. this.$message.success('保存成功')
  593. this.jiBenQingKuang_Dialog = false;
  594. } else {
  595. this.$message.error(res.message);
  596. }
  597. })
  598. .catch(error => {
  599. this.$message.error(error);
  600. });
  601. }
  602. },
  603. // 添加基本情况
  604. toAddJiBenQingKuang(row){
  605. console.log(row,'1111111111')
  606. let paramObj = {
  607. // "code": this.currentRow.code,
  608. // "objId": this.currentRow.objId,
  609. // "nodeId": this.currentRow.nodeId,
  610. "recPersId": this.persId,
  611. "id": row.id
  612. }
  613. request
  614. .post(`/bis/insp/key/register/add`, row)
  615. .then(res => {
  616. if (res.success && res.data) {
  617. // this.currentRow.id = res.data.id
  618. this.jiBenQingKuang = res.data;
  619. if(this.jiBenQingKuang.engBuild || this.jiBenQingKuang.engProfil){
  620. this.jiBenflag = 1;
  621. this.dialogType = '修改';
  622. }else{
  623. this.jiBenflag = 0;
  624. this.dialogType = '添加';
  625. }
  626. this.jiBenQingKuang_Dialog = true;
  627. } else {
  628. this.$message.error(res.message);
  629. }
  630. })
  631. .catch(error => {
  632. this.$message.error(res.message);
  633. });
  634. // console.log(row,'erere')
  635. // request.get(`/bis/insp/empwtprj/base/${row.code}`).then(res => {
  636. // if (res.success) {
  637. // this.jiBenQingKuang = res.data;
  638. // if(this.jiBenQingKuang.engBuild || this.jiBenQingKuang.engProfil){
  639. // this.jiBenflag = 1;
  640. // }else{
  641. // this.jiBenflag = 0;
  642. // }
  643. // this.dialogType = '';
  644. // this.jiBenQingKuang_Dialog = true;
  645. // }
  646. // });
  647. },
  648. toEditBiaoDuan(row){
  649. this.dialogType = '编辑'
  650. this.currentRow = row
  651. this.getWatershedList()
  652. this.getprovList('000000000000')
  653. request.get(`/bis/insp/key/register/section/${row.id}`).then((res) => {
  654. if(res.success){
  655. this.biaoduan = res.data;
  656. this.biaoduan_Dialog = true
  657. }else{
  658. this.$message.error(res.message)
  659. }
  660. });
  661. },
  662. add_biaoDuan(){
  663. if(!this.biaoduan.nm){
  664. this.$message.warning('请填写标段名称')
  665. return
  666. }
  667. // if(!this.biaoduan.adCode){
  668. // this.$message.warning('请选择所属省份')
  669. // return
  670. // }
  671. // if(!this.biaoduan.orgId){
  672. // this.$message.warning('请选择所属流域')
  673. // return
  674. // }
  675. if(this.isClicked){
  676. this.isClicked = false
  677. if(this.dialogType == '添加'){
  678. this.biaoduan.objId = this.currentRow.objId
  679. this.biaoduan.regId = this.currentRow.id
  680. this.biaoduan.persId = this.persId
  681. request.post(`/bis/insp/key/register/section/add`,this.biaoduan).then((res) => {
  682. if(res.success){
  683. this.$message.success(this.dialogType + '成功')
  684. //向树节点追加已添加的新标段
  685. const newChild = { id: res.data.id, objId: res.data.objId, pnm: res.data.nm, children: [] };
  686. if (!this.currentRow.children) {
  687. this.$set(this.currentRow, 'children', []);
  688. }
  689. this.currentRow.children.push(newChild);
  690. this.biaoduan_Dialog = false
  691. setTimeout(()=> {
  692. this.isClicked = true
  693. }, 1000);
  694. }else{
  695. this.$message.error(res.message)
  696. }
  697. }).catch(error=>{
  698. this.$message.error(error)
  699. });
  700. }else{
  701. request.post(`/bis/insp/key/register/section/update`,this.biaoduan).then((res) => {
  702. if(res.success){
  703. this.$message.success(this.dialogType + '成功')
  704. //编辑成功后改变树节点显示的标段名称
  705. this.currentRow.pnm = res.data.nm
  706. this.biaoduan_Dialog = false
  707. setTimeout(()=> {
  708. this.isClicked = true
  709. }, 1000);
  710. }else{
  711. this.$message.error(res.message)
  712. }
  713. }).catch(error=>{
  714. this.$message.error(error)
  715. });
  716. }
  717. }
  718. },
  719. delete_biaoDuan(row,node){
  720. this.$confirm('确认删除当前标段吗?', '提示', {
  721. confirmButtonText: '确定',
  722. cancelButtonText: '取消',
  723. type: 'warning'
  724. }).then(() => {
  725. request.post(`/bis/insp/key/register/section/delete/${row.id}`).then(res=>{
  726. if(res.success){
  727. this.$message.success('删除成功')
  728. const parent = node.parent;
  729. const children = parent.data.children || parent.data;
  730. const index = children.findIndex(d => d.id === row.id);
  731. children.splice(index, 1);
  732. }else{
  733. this.$message.error(res.message)
  734. }
  735. })
  736. }).catch(() => {
  737. });
  738. },
  739. // 添加责任单位
  740. toAddUnit(row){
  741. this.dialogType = '添加'
  742. this.currentBiaoDuanRow = row
  743. this.unit = {
  744. nm: '',
  745. nature: '',
  746. government: ''
  747. }
  748. this.unit_Dialog = true
  749. },
  750. toEditUnit(row){
  751. this.dialogType = '编辑'
  752. this.currentBiaoDuanRow = row
  753. request.get(`/bis/insp/key/reg/sec/unit/${row.id}`).then((res) => {
  754. if(res.success){
  755. this.unit = res.data;
  756. this.unit_Dialog = true
  757. }else{
  758. this.$message.error(res.message)
  759. }
  760. });
  761. },
  762. add_unit(){
  763. if(!this.unit.nm){
  764. this.$message.warning('请填写单位名称')
  765. return
  766. }
  767. if(!this.unit.nature){
  768. this.$message.warning('请选择单位性质')
  769. return
  770. }
  771. // if(!this.unit.government){
  772. // this.$message.warning('请选择建管模式')
  773. // return
  774. // }
  775. if(this.isClicked){
  776. this.isClicked = false
  777. if(this.dialogType == '添加'){
  778. this.unit.persId = this.persId
  779. this.unit.secId = this.currentBiaoDuanRow.id
  780. request.post(`/bis/insp/key/reg/sec/unit/add`,this.unit).then((res) => {
  781. if(res.success){
  782. this.$message.success(this.dialogType + '成功')
  783. //向树节点追加已添加的新单位
  784. const newChild = { id: res.data.id, objId: res.data.objId, pnm: res.data.nm, children: [] };
  785. if (!this.currentBiaoDuanRow.children) {
  786. this.$set(this.currentBiaoDuanRow, 'children', []);
  787. }
  788. this.currentBiaoDuanRow.children.push(newChild);
  789. this.unit_Dialog = false
  790. setTimeout(()=> {
  791. this.isClicked = true
  792. }, 1000);
  793. }else{
  794. this.$message.error(res.message)
  795. }
  796. }).catch(error=>{
  797. this.$message.error(res.message)
  798. });
  799. }else{
  800. request.post(`/bis/insp/key/reg/sec/unit/update`,this.unit).then((res) => {
  801. if(res.success){
  802. this.$message.success(this.dialogType + '成功')
  803. //编辑成功后改变树节点显示的标段名称
  804. this.currentBiaoDuanRow.pnm = res.data.nm
  805. this.unit_Dialog = false
  806. setTimeout(()=> {
  807. this.isClicked = true
  808. }, 1000);
  809. }else{
  810. this.$message.error(res.message)
  811. }
  812. }).catch(error=>{
  813. this.$message.error(res.message)
  814. });
  815. }
  816. }
  817. },
  818. delete_unit(row,node){
  819. this.$confirm('确认删除当前单位吗?', '提示', {
  820. confirmButtonText: '确定',
  821. cancelButtonText: '取消',
  822. type: 'warning'
  823. }).then(() => {
  824. request.post(`/bis/insp/key/reg/sec/unit/delete/${row.id}`).then(res=>{
  825. if(res.success){
  826. this.$message.success('删除成功')
  827. const parent = node.parent;
  828. const children = parent.data.children || parent.data;
  829. const index = children.findIndex(d => d.id === row.id);
  830. children.splice(index, 1);
  831. }else{
  832. this.$message.error(res.message)
  833. }
  834. })
  835. }).catch(() => {
  836. });
  837. },
  838. //获取流域信息
  839. getWatershedList(){
  840. request.get(`/dc/insp/base/getInspByPid?pid=''`).then((res) => {
  841. if(res.success){
  842. this.waterShedList = res.data;
  843. }
  844. }
  845. );
  846. },
  847. // 获取省份列表
  848. getprovList(adCode){
  849. request.get('/dc/ad/base/getAdData',{params:{'adCode': adCode}}).then(res=>{
  850. if(res.success){
  851. this.provList = res.data
  852. }else{
  853. this.$message.info(res.message)
  854. }
  855. })
  856. },
  857. // 近期面貌
  858. recentAppearance(){
  859. this.jqmmShow = true;
  860. // this.jqmmShow += 1;
  861. },
  862. jqmmDialog(){
  863. this.jqmmShow = false;
  864. },
  865. // 影像
  866. imageClick(){
  867. if(!this.centerX && !this.centerY){
  868. this.$message.warning('暂无经纬度信息!');
  869. return false;
  870. }
  871. this.imageShow = true;
  872. },
  873. // 点击督查组
  874. getGroupData(){
  875. let params = {
  876. userId: this.persId,
  877. orgType: '004',
  878. tabType:this.tabType
  879. }
  880. request.get(`/dc/organization/base/getAllNode`,{params:params}).then(res=>{
  881. if(res.success){
  882. let data = res.data;
  883. data = getTrees(data);
  884. // this.groupTreeData = data[0].children;
  885. this.groupTreeData = data;
  886. if(data[0] && data[0].id != '004'){
  887. this.plnaId = this.groupTreeData[0].id
  888. this.isDateRange = this.getBoolDate(data[0].sttm,data[0].entm);
  889. }
  890. this.getDataList();
  891. }else{
  892. this.$message.warning(res.message)
  893. }
  894. })
  895. },
  896. groupHandleNodeClick(data,node){
  897. this.plnaId = data.id
  898. this.isDateRange = this.getBoolDate(data.sttm,data.entm);
  899. this.getDataList()
  900. },
  901. getBoolDate(sttm,entm){
  902. if(sttm<new Date().getTime() && new Date().getTime()<entm){
  903. return true;
  904. }
  905. return false;
  906. }
  907. },
  908. watch:{
  909. typeOfProject(val){
  910. this.title = val == '2' ? '水利工程建设情况检查填报' : '水利工程运行情况检查填报'
  911. this.searchObj.engScal = val
  912. this.getDataList()
  913. }
  914. },
  915. filters: {
  916. pType(val) {
  917. if (val != "0" && !val) {
  918. return "";
  919. }
  920. if (val == "0") {
  921. return "重大农业节水工程";
  922. } else if (val == "1") {
  923. return "重大引调水工程";
  924. } else if (val == "2") {
  925. return "重点水源工程";
  926. } else if (val == "3") {
  927. return "江河湖泊治理骨干工程";
  928. } else if (val == "4") {
  929. return "新建大型灌区工程";
  930. } else if (val == "5") {
  931. return "非水利部下达投资计划";
  932. } else if (val == "6") {
  933. return "全部由地方投资";
  934. } else if (val == "7") {
  935. return "其他项目";
  936. } else {
  937. return "未知项目";
  938. }
  939. },
  940. nature(val) {
  941. if (val != "0" && !val) {
  942. return "";
  943. }
  944. if (val == "1") {
  945. return "项目法人(建设单位)";
  946. } else if (val == "2") {
  947. return "勘察设计单位";
  948. } else if (val == "3") {
  949. return "监理单位";
  950. } else if (val == "4") {
  951. return "施工单位";
  952. } else if (val == "5") {
  953. return "金属结构及机电设备安装单位";
  954. } else if (val == "6") {
  955. return "安全监测单位";
  956. } else if (val == "7") {
  957. return "质量检测单位";
  958. } else {
  959. return "其它";
  960. }
  961. },
  962. government(val) {
  963. if (val != "0" && !val) {
  964. return "";
  965. }
  966. if (val == "1") {
  967. return "直管";
  968. } else if (val == "2") {
  969. return "代建";
  970. }
  971. }
  972. }
  973. };
  974. </script>
  975. <style lang="scss">
  976. #dcdxHeader {
  977. padding: 15px 20px;
  978. }
  979. #dxdcFooter {
  980. text-align: center;
  981. }
  982. #dxdcAside {
  983. border: 1px solid #d5d5ff;
  984. }
  985. .el-table .warning-row {
  986. background: oldlace;
  987. }
  988. .el-table .success-row {
  989. background: #f0f9eb;
  990. }
  991. .left_tree .custom-tree-node {
  992. flex: 1;
  993. display: flex;
  994. align-items: center;
  995. justify-content: space-between;
  996. font-size: 14px;
  997. padding-right: 8px;
  998. }
  999. .c_active{
  1000. background: #3f8eff !important;
  1001. color:white !important;
  1002. padding: 7px 10px !important;
  1003. }
  1004. .c_normal{
  1005. background: white !important;
  1006. padding: 7px 10px !important;
  1007. }
  1008. #headerBtn div.el-card__header{
  1009. padding: 5px 3px !important;
  1010. }
  1011. </style>
  1012. 0