850f4e8dfa24ab04f7ca0aa6372ae178408378fc.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <el-main id="dxdcListMainsk" style="padding:5px 20px;">
  5. <h3 style="text-align: center;margin: 10px 0 20px;">{{title}}</h3>
  6. <div class="flex_wrapper">
  7. <div>
  8. <el-card class="box-card">
  9. <div slot="header" class="clearfix">
  10. <span>工程信息</span>
  11. <!-- <el-select v-model="typeOfProject">
  12. <el-option label="水利工程建设" value="2"></el-option>
  13. <el-option label="水利工程运行" value="1"></el-option>
  14. </el-select> -->
  15. <!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button> -->
  16. <el-button style="float: right; padding: 3px 0" type="text" @click="batchImport" v-if="ownPriv('manage')">批量导入</el-button>
  17. <!-- 水利工程基础信息批量导入弹窗 -->
  18. <slgc-tian-bao-pl v-if="showGongChengTianBaoPl" @closePlDialog="closePlDialog"></slgc-tian-bao-pl>
  19. </div>
  20. <el-table
  21. :data="dataList"
  22. border
  23. stripe
  24. highlight-current-row
  25. @current-change="handleCurrentChange"
  26. :height="tableHeight"
  27. style="width: 100%">
  28. <el-table-column prop="nm" label="工程名称" min-width="150" show-overflow-tooltip></el-table-column>
  29. <el-table-column prop="ptype" label="工程类型" min-width="100" show-overflow-tooltip>
  30. <template slot-scope="scope">
  31. <span>{{scope.row.etype | pType}}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="stwktm" label="开工年份" min-width="80"></el-table-column>
  35. <el-table-column prop="plantm" label="计划工期(月)" min-width="100"></el-table-column>
  36. <el-table-column prop="estapp" label="总投资(亿元)" min-width="100"></el-table-column>
  37. <el-table-column fixed="right" label="操作" min-width="70" v-if="ownPriv('manage')">
  38. <template slot-scope="scope">
  39. <el-button @click="toCorrect(scope.row)" icon="el-icon-edit" type="text"></el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <el-pagination :pager-count="5" :current-page="pageIndex"
  44. :page-size="pageSize" layout="total, prev, pager, next" :total="total"
  45. @current-change="pageIndexChange" @size-change="handleSizeChange"
  46. ></el-pagination>
  47. </el-card>
  48. </div>
  49. <project-build :currentRow="currentRow"></project-build>
  50. </div>
  51. </el-main>
  52. </el-container>
  53. <!-- 工程纠错 -->
  54. <el-dialog :title="'基本信息纠错'" :visible.sync="correct_Dialog">
  55. <el-form label-width="130px">
  56. <el-form-item label="工程名称">
  57. <el-input v-model="project.nm" clearable readonly></el-input>
  58. </el-form-item>
  59. <el-form-item label="工程类型">
  60. <el-input v-model="projectType" clearable readonly></el-input>
  61. </el-form-item>
  62. <el-form-item label="开工时间" required>
  63. <el-date-picker
  64. v-model="project.stwktm"
  65. align="right"
  66. type="year"
  67. value-format="yyyy"
  68. placeholder="选择年"
  69. ></el-date-picker>
  70. </el-form-item>
  71. <el-form-item label="计划工期" required>
  72. <el-input v-model="project.plantm" clearable>
  73. <template slot="append">月</template>
  74. </el-input>
  75. </el-form-item>
  76. <el-form-item label="概算批复总投资" required>
  77. <el-input v-model="project.estapp" clearable>
  78. <template slot="append">亿元</template>
  79. </el-input>
  80. </el-form-item>
  81. </el-form>
  82. <div slot="footer" class="dialog-footer">
  83. <el-button @click="correct_Dialog = false">取 消</el-button>
  84. <el-button type="primary" @click="saveCorrect">确 定</el-button>
  85. </div>
  86. </el-dialog>
  87. <!-- 添加/编辑一级管理单位 -->
  88. <el-dialog :title="dialogType + '一级管理单位'" :visible.sync="unitOne_Dialog">
  89. <el-form label-width="120px">
  90. <el-form-item label="一级单位名称" required>
  91. <el-input v-model="unitOne.nm" clearable></el-input>
  92. </el-form-item>
  93. </el-form>
  94. <div slot="footer" class="dialog-footer">
  95. <el-button @click="unitOne_Dialog = false">取 消</el-button>
  96. <el-button type="primary" @click="addUnitOne">确 定</el-button>
  97. </div>
  98. </el-dialog>
  99. <!-- 工程问题清单 -->
  100. <project-problem @dialogClose="showProblemDialog = false" v-if="showProblemDialog"></project-problem>
  101. </div>
  102. </template>
  103. <script>
  104. import request from "../../utils/gw_ajax_request.js";
  105. import { dateFormat } from "../../utils/gw_date.js";
  106. import provTreeList from "../../widgets/provTreeList.vue";
  107. import projectProblem from "./project/projectProblem.vue";
  108. import projectBuild from './project/jianshe.vue';
  109. import projectOperate from './project/yunxing.vue';
  110. import slgcTianBaoPl from './slgcTianBao_piliang.vue';
  111. export default {
  112. components: {
  113. provTreeList: provTreeList,
  114. projectProblem: projectProblem,
  115. projectOperate: projectOperate,
  116. projectBuild: projectBuild,
  117. slgcTianBaoPl: slgcTianBaoPl
  118. },
  119. props: [],
  120. data() {
  121. return {
  122. tableHeight: window.innerHeight - 290,
  123. treeData: [],
  124. dataList: [],
  125. searchObj:{
  126. "engScal": '2'
  127. },
  128. project: {
  129. nm: "",
  130. ptype: "",
  131. stwktm: "",
  132. plantm: "",
  133. estapp: ""
  134. },
  135. unitOne: {
  136. nm: ""
  137. },
  138. currentRow: {},
  139. pageIndex: 1,
  140. pageSize: 20,
  141. total: 0,
  142. dialogType: "添加",
  143. unitOne_Dialog: false,
  144. correct_Dialog: false,
  145. showProblemDialog: false,
  146. typeOfProject: '2',
  147. title: '水利工程建设情况检查填报',
  148. showGongChengTianBaoPl: false,
  149. };
  150. },
  151. computed: {
  152. persId() {
  153. return localStorage.getItem("userid")
  154. ? localStorage.getItem("userid")
  155. : "1098101939614724096";
  156. },
  157. projectType() {
  158. let val = this.project.ptype;
  159. if (val != "0" && !val) {
  160. return "";
  161. }
  162. if (val == "0") {
  163. return "重大农业节水工程";
  164. } else if (val == "1") {
  165. return "重大引调水工程";
  166. } else if (val == "2") {
  167. return "重点水源工程";
  168. } else if (val == "3") {
  169. return "江河湖泊治理骨干工程";
  170. } else if (val == "4") {
  171. return "新建大型灌区工程";
  172. } else if (val == "5") {
  173. return "非水利部下达投资计划";
  174. } else if (val == "6") {
  175. return "全部由地方投资";
  176. } else if (val == "7") {
  177. return "其他项目";
  178. } else {
  179. return "未知项目";
  180. }
  181. }
  182. },
  183. mounted() {
  184. this.getDataList();
  185. },
  186. activated() {
  187. this.getDataList();
  188. },
  189. watch: {
  190. },
  191. methods: {
  192. //获取工程列表信息
  193. getDataList() {
  194. let paramObj = {
  195. type: "empwt",
  196. presId: this.persId,
  197. pageSize: this.pageSize,
  198. pageNum: this.pageIndex
  199. }
  200. Object.assign(this.searchObj,paramObj)
  201. request
  202. .post(`/dc/insp/rsvrRgstr/list/type`, this.searchObj)
  203. .then(res => {
  204. if (res.success) {
  205. this.dataList = res.data.list;
  206. this.total = res.data.total;
  207. if (this.dataList.length) {
  208. this.currentRow = this.dataList[0];
  209. this.addRegister()
  210. }
  211. }
  212. });
  213. },
  214. // 工程信息纠错
  215. toCorrect(row) {
  216. request.get(`/bis/insp/empwtprj/base/${row.code}`).then(res => {
  217. if (res.success) {
  218. this.project = res.data;
  219. this.project.stwktm = this.project.stwktm.toString();
  220. }
  221. });
  222. this.correct_Dialog = true;
  223. },
  224. saveCorrect() {
  225. this.project.persId = this.persId;
  226. //校验计划工期和概算批复总投资,实际应根据实际业务进行校验
  227. if(this.project.plantm < 0 || this.project.plantm > 1200){
  228. this.$message.error('计划工期的范围应在0-1200之间,请重新填写!');
  229. this.project.plantm = '';
  230. return;
  231. };
  232. if(this.project.estapp < 0 || this.project.estapp > 9999 ){
  233. this.$message.error('概算批复总投资的范围应在0-9999之间,请重新填写!');
  234. this.project.estapp = '';
  235. return;
  236. };
  237. request
  238. .post(`/bis/insp/empwtprj/base/update`, this.project)
  239. .then(res => {
  240. if (res.success) {
  241. this.$message.success("修改成功");
  242. this.correct_Dialog = false;
  243. this.getDataList();
  244. } else {
  245. this.$message.error(res.message);
  246. }
  247. })
  248. .catch(error => {
  249. this.$message.error(res.message);
  250. });
  251. },
  252. // 添加一级管理单位
  253. toAddUnitOne(row) {
  254. this.dialogType = "添加";
  255. this.unitOne = {
  256. nm: ""
  257. };
  258. this.unitOne.regId = row.id;
  259. this.unitOne_Dialog = true;
  260. },
  261. addUnitOne() {
  262. this.unitOne.lev = "1";
  263. this.unitOne.pid = "0";
  264. this.unitOne.persId = this.persId;
  265. request
  266. .post(`/bis/insp/mampu/info/add`, this.unitOne)
  267. .then(res => {
  268. if (res.success) {
  269. this.$message.success(this.dialogType + "成功");
  270. this.unitOne_Dialog = false;
  271. this.getDataList();
  272. } else {
  273. this.$message.error(res.message);
  274. }
  275. })
  276. .catch(error => {
  277. this.$message.error(res.message);
  278. });
  279. },
  280. //表格选中行操作
  281. setCurrent() {
  282. this.$refs.singleTable.setCurrentRow(this.dataList[0]);
  283. },
  284. handleCurrentChange(val) {
  285. this.currentRow = val;
  286. this.addRegister()
  287. },
  288. addRegister(){
  289. let paramObj = {
  290. "code": this.currentRow.code,
  291. "objId": this.currentRow.objId,
  292. "nodeId": this.currentRow.nodeId,
  293. "recPersId": this.persId,
  294. "id": this.currentRow.id
  295. }
  296. request
  297. .post(`/bis/insp/key/register/add`, paramObj)
  298. .then(res => {
  299. if (res.success && res.data) {
  300. this.currentRow.id = res.data.id
  301. } else {
  302. this.$message.error(res.message);
  303. }
  304. })
  305. .catch(error => {
  306. this.$message.error(res.message);
  307. });
  308. },
  309. formatDate(row, column) {
  310. if (row.uptm) {
  311. return dateFormat(row.uptm, "yyyy-MM-dd");
  312. }
  313. },
  314. pageIndexChange(val) {
  315. this.pageIndex = val;
  316. this.getDataList();
  317. },
  318. handleSizeChange(val) {
  319. this.pageSize = val;
  320. this.getDataList();
  321. },
  322. batchImport(){
  323. this.showGongChengTianBaoPl = true
  324. },
  325. closePlDialog(){
  326. this.showGongChengTianBaoPl = false
  327. }
  328. },
  329. watch:{
  330. typeOfProject(val){
  331. this.title = val == '2' ? '水利工程建设情况检查填报' : '水利工程运行情况检查填报'
  332. this.searchObj.engScal = val
  333. this.getDataList()
  334. }
  335. },
  336. filters: {
  337. pType(val) {
  338. if (val != "0" && !val) {
  339. return "";
  340. }
  341. if (val == "0") {
  342. return "重大农业节水工程";
  343. } else if (val == "1") {
  344. return "重大引调水工程";
  345. } else if (val == "2") {
  346. return "重点水源工程";
  347. } else if (val == "3") {
  348. return "江河湖泊治理骨干工程";
  349. } else if (val == "4") {
  350. return "新建大型灌区工程";
  351. } else if (val == "5") {
  352. return "非水利部下达投资计划";
  353. } else if (val == "6") {
  354. return "全部由地方投资";
  355. } else if (val == "7") {
  356. return "其他项目";
  357. } else {
  358. return "未知项目";
  359. }
  360. },
  361. nature(val) {
  362. if (val != "0" && !val) {
  363. return "";
  364. }
  365. if (val == "1") {
  366. return "项目法人(建设单位)";
  367. } else if (val == "2") {
  368. return "勘察设计单位";
  369. } else if (val == "3") {
  370. return "监理单位";
  371. } else if (val == "4") {
  372. return "施工单位";
  373. } else if (val == "5") {
  374. return "金属结构及机电设备安装单位";
  375. } else if (val == "6") {
  376. return "安全监测单位";
  377. } else if (val == "7") {
  378. return "质量检测单位";
  379. } else {
  380. return "其它";
  381. }
  382. },
  383. government(val) {
  384. if (val != "0" && !val) {
  385. return "";
  386. }
  387. if (val == "1") {
  388. return "直管";
  389. } else if (val == "2") {
  390. return "代建";
  391. }
  392. }
  393. }
  394. };
  395. </script>
  396. <style lang="scss">
  397. #dcdxHeader {
  398. padding: 15px 20px;
  399. }
  400. #dxdcFooter {
  401. text-align: center;
  402. }
  403. #dxdcAside {
  404. border: 1px solid #d5d5ff;
  405. }
  406. .el-table .warning-row {
  407. background: oldlace;
  408. }
  409. .el-table .success-row {
  410. background: #f0f9eb;
  411. }
  412. .flex_wrapper{
  413. display: flex;
  414. justify-content: space-between;
  415. >div:first-child{
  416. width: 40%;
  417. margin-right: 0.6%;
  418. }
  419. }
  420. </style>