4a0f953e8b326614111d4324ecb8918d3d01b585.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <template>
  2. <el-dialog
  3. class="verify_dialog"
  4. :title="title"
  5. :visible.sync="dialogVisible"
  6. :before-close="handleClose"
  7. append-to-body
  8. >
  9. <div class="verify_div">
  10. <el-table
  11. :data="tableData"
  12. style="width: 100%;overflow: auto;"
  13. :row-class-name="tableRowClassName"
  14. height="460px"
  15. empty-text="上传数据已全部验证通过!"
  16. >
  17. <el-table-column
  18. fixed
  19. type="index"
  20. :index="getIndex"
  21. width="90"
  22. label="模板行号"
  23. show-overflow-tooltip
  24. ></el-table-column>
  25. <el-table-column
  26. prop="groupName"
  27. label="组别(带上级名称)"
  28. width="150"
  29. align="center"
  30. show-overflow-tooltip
  31. >
  32. <template slot-scope="scope">
  33. <div v-if="scope.row.groupName.indexOf('$W$')>0">
  34. <el-popover trigger="hover" placement="bottom">
  35. <p>请检查"组别"是否不对;选择继续填报,此条数据可能不会入库.</p>
  36. <div slot="reference" class="name-wrapper">
  37. <span :style="{ color: scope.row.groupName.indexOf('$E$')>0 ? '#ED3F14' : scope.row.groupName.indexOf('$W$')>0 ? '#E7E708' : '' }">
  38. {{ scope.row.groupName.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  39. </span>
  40. </div>
  41. </el-popover>
  42. </div>
  43. <div v-else>
  44. <span :style="{ color: scope.row.groupName.indexOf('$E$')>0 ? '#ED3F14' : scope.row.groupName.indexOf('$W$')>0 ? '#E7E708' : '' }">
  45. {{ scope.row.groupName.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  46. </span>
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <!-- <el-table-column
  51. prop="code"
  52. label="水利工程运行编码"
  53. width="150"
  54. align="center"
  55. show-overflow-tooltip
  56. >
  57. <template slot-scope="scope">
  58. <span :style="{ color: scope.row.code.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  59. {{ scope.row.code.replace(/\$E\$/g,'') }}
  60. </span>
  61. </template>
  62. </el-table-column> -->
  63. <el-table-column prop="nm" label="工程名称" width="150" align="center" show-overflow-tooltip>
  64. <template slot-scope="scope">
  65. <div v-if="scope.row.nm.indexOf('$W$')>0">
  66. <el-popover trigger="hover" placement="bottom">
  67. <p>请检查"工程名称"与"单位名称"是否匹配;选择继续填报,此条数据可能不会入库.</p>
  68. <div slot="reference" class="name-wrapper">
  69. <span :style="{ color: scope.row.nm.indexOf('$E$')>0 ? '#ED3F14' : scope.row.nm.indexOf('$W$')>0 ? '#E7E708' : '' }">
  70. {{ scope.row.nm.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  71. </span>
  72. </div>
  73. </el-popover>
  74. </div>
  75. <div v-else>
  76. <span :style="{ color: scope.row.nm.indexOf('$E$')>0 ? '#ED3F14' : scope.row.nm.indexOf('$W$')>0 ? '#E7E708' : '' }">
  77. {{ scope.row.nm.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  78. </span>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="dwNm" label="单位名称" width="150" align="center" show-overflow-tooltip>
  83. <template slot-scope="scope">
  84. <div v-if="scope.row.dwNm.indexOf('$W$')>0">
  85. <el-popover trigger="hover" placement="bottom">
  86. <p>请检查"单位名称"与"工程名称"是否匹配;选择继续填报,此条数据可能不会入库.</p>
  87. <div slot="reference" class="name-wrapper">
  88. <span :style="{ color: scope.row.dwNm.indexOf('$E$')>0 ? '#ED3F14' : scope.row.dwNm.indexOf('$W$')>0 ? '#E7E708' : '' }">
  89. {{ scope.row.dwNm.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  90. </span>
  91. </div>
  92. </el-popover>
  93. </div>
  94. <div v-else>
  95. <span :style="{ color: scope.row.dwNm.indexOf('$E$')>0 ? '#ED3F14' : scope.row.dwNm.indexOf('$W$')>0 ? '#E7E708' : '' }">
  96. {{ scope.row.dwNm.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  97. </span>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column prop="inspPblmName" label="问题类别" width="150" align="center" show-overflow-tooltip></el-table-column>
  102. <!-- 违规行为 -->
  103. <el-table-column
  104. prop="attachWg"
  105. label="违规行为附件编号"
  106. width="150"
  107. align="center"
  108. show-overflow-tooltip
  109. >
  110. <template slot-scope="scope">
  111. <span :style="{ color: scope.row.attachWg.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachWg.indexOf('$W$')>0 ? '#E7E708' : '' }">
  112. {{ scope.row.attachWg.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  113. </span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. prop="attachWgSn"
  118. label="违规行为问题标准序号"
  119. width="160"
  120. align="center"
  121. show-overflow-tooltip
  122. >
  123. <template slot-scope="scope">
  124. <span :style="{ color: scope.row.attachWgSn.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachWgSn.indexOf('$W$')>0 ? '#E7E708' : '' }">
  125. {{ scope.row.attachWgSn.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  126. </span>
  127. </template>
  128. </el-table-column>
  129. <!-- 合同管理 -->
  130. <el-table-column
  131. prop="attachHetong"
  132. label="合同管理附件编号"
  133. width="150"
  134. align="center"
  135. show-overflow-tooltip
  136. >
  137. <template slot-scope="scope">
  138. <span :style="{ color: scope.row.attachHetong.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachHetong.indexOf('$W$')>0 ? '#E7E708' : '' }">
  139. {{ scope.row.attachHetong.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  140. </span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column
  144. prop="attachHetongSn"
  145. label="合同管理问题标准序号"
  146. width="160"
  147. align="center"
  148. show-overflow-tooltip
  149. >
  150. <template slot-scope="scope">
  151. <span :style="{ color: scope.row.attachHetongSn.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachHetongSn.indexOf('$W$')>0 ? '#E7E708' : '' }">
  152. {{ scope.row.attachHetongSn.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  153. </span>
  154. </template>
  155. </el-table-column>
  156. <!-- 缺陷管理 -->
  157. <el-table-column
  158. prop="attachDef"
  159. label="缺陷管理附件编号"
  160. width="150"
  161. align="center"
  162. show-overflow-tooltip
  163. >
  164. <template slot-scope="scope">
  165. <span :style="{ color: scope.row.attachDef.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachDef.indexOf('$W$')>0 ? '#E7E708' : '' }">
  166. {{ scope.row.attachDef.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  167. </span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. prop="attachDefSn"
  172. label="缺陷管理问题标准序号"
  173. width="160"
  174. align="center"
  175. show-overflow-tooltip
  176. >
  177. <template slot-scope="scope">
  178. <span :style="{ color: scope.row.attachDefSn.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachDefSn.indexOf('$W$')>0 ? '#E7E708' : '' }">
  179. {{ scope.row.attachDefSn.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  180. </span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column prop="inspPblmDesc" label="问题详情" width="150" align="center" show-overflow-tooltip></el-table-column>
  184. <el-table-column
  185. prop="inspPblmCate"
  186. label="问题严重程度"
  187. width="150"
  188. align="center"
  189. show-overflow-tooltip
  190. >
  191. <template slot-scope="scope">
  192. <span :style="{ color: scope.row.inspPblmCate.indexOf('$E$')>0 ? '#ED3F14' : scope.row.inspPblmCate.indexOf('$W$')>0 ? '#E7E708' : '' }">
  193. {{ scope.row.inspPblmCate.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  194. </span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column
  198. prop="ifCasePblm"
  199. label="是否典型"
  200. width="150"
  201. align="center"
  202. show-overflow-tooltip
  203. >
  204. <template slot-scope="scope">
  205. <span :style="{ color: scope.row.ifCasePblm.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  206. {{ scope.row.ifCasePblm.replace(/\$E\$/g,'') }}
  207. </span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column
  211. prop="path"
  212. label="路径"
  213. width="150"
  214. align="center"
  215. show-overflow-tooltip
  216. >
  217. <template slot-scope="scope">
  218. <span :style="{ color: scope.row.path.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  219. {{ scope.row.path.replace(/\$E\$/g,'') }}
  220. </span>
  221. </template>
  222. </el-table-column>
  223. </el-table>
  224. <template>
  225. <lable v-show="confirmUploadState">
  226. <el-radio v-model="updateState" label="1">新增</el-radio>
  227. <el-radio v-model="updateState" label="0">覆盖</el-radio>
  228. </lable>
  229. </template>
  230. <el-button type="warning" v-show="reUploadState" @click="handleClose" >重新上传</el-button>
  231. <el-button type="primary" v-show="confirmUploadState" @click="confirmUpload"
  232. :loading="uploadLoading"
  233. :disabled="buttonState"
  234. >确定填报</el-button>
  235. </div>
  236. </el-dialog>
  237. </template>
  238. <script>
  239. import request from "@util/gw_ajax_request.js";
  240. export default {
  241. props: ['tableData','cacheId','uploadButtonState'],
  242. components: {},
  243. data() {
  244. return {
  245. dialogVisible: true,
  246. reUploadState:false,
  247. confirmUploadState:true,
  248. rDisabled:false,
  249. cDisabled:false,
  250. title:'水利工程运行问题批量导入验证页面(验证通过√)',
  251. uploadLoading: false,
  252. buttonState: false,
  253. updateState: '1',
  254. };
  255. },
  256. mounted(){
  257. if(this.uploadButtonState != undefined){
  258. this.buttonState = this.uploadButtonState;
  259. }
  260. },
  261. computed: {
  262. persId() {
  263. return localStorage.getItem("userid")
  264. ? localStorage.getItem("userid")
  265. : "1098101939614724096";
  266. }
  267. },
  268. methods: {
  269. handleClose(done) {
  270. this.reUploadState = false;
  271. this.$emit("closePlVerDialog");
  272. },
  273. getIndex(index) {
  274. return index + 4;
  275. },
  276. tableRowClassName({ row, rowIndex }) {
  277. let values = "";
  278. for(let key in row){
  279. values += row[key];
  280. }
  281. if (values.indexOf('$E$') > 0) {
  282. this.reUploadState = true;
  283. this.confirmUploadState = false;
  284. this.title = '水利工程运行问题批量导入验证页面(验证未通过×)';
  285. return 'warning-row';
  286. }
  287. return "";
  288. },
  289. confirmUpload(){
  290. this.upload();
  291. },
  292. upload(){
  293. this.uploadLoading = true;
  294. this.buttonState = true;
  295. request.get(`/dc/imp/pblm/insert/info?cacheId=${this.cacheId}&userId=${this.persId}&updateState=${this.updateState}&orgType=007`).then(res => {
  296. console.log(res)
  297. this.$alert(res.data.key, '信息', {
  298. dangerouslyUseHTMLString: true,
  299. callback: action => {
  300. this.uploadLoading = false;
  301. this.buttonState = true;
  302. this.handleClose();
  303. }
  304. });
  305. // if(res.data.key == true){
  306. // this.$alert('填报成功!', '提示', {
  307. // confirmButtonText: '确定',
  308. // type: 'success',
  309. // callback: action => {
  310. // this.uploadLoading = false;
  311. // this.buttonState = true;
  312. // this.handleClose();
  313. // }
  314. // });
  315. // }else {
  316. // this.$alert('填报失败!', '提示', {
  317. // confirmButtonText: '确定',
  318. // callback: action => {
  319. // this.$message({
  320. // type: 'info',
  321. // message: `请不要重复提交!`
  322. // });
  323. // }
  324. // });
  325. // this.uploadLoading = false;
  326. // this.buttonState = true;
  327. // }
  328. });
  329. }
  330. },
  331. watch: {
  332. reUploadState(n,o){
  333. if(n){
  334. this.confirmUploadState = false;
  335. }else {
  336. this.confirmUploadState = true;
  337. }
  338. }
  339. }
  340. };
  341. </script>
  342. <style>
  343. .title {
  344. font-size: 16px;
  345. }
  346. .el-icon-edit {
  347. margin-right: 10px;
  348. }
  349. .verify_dialog .el-dialog {
  350. width: 80% !important;
  351. }
  352. .verify_dialog .el-dialog__body {
  353. padding: 30px 20px;
  354. color: #606266;
  355. font-size: 14px;
  356. height: 500px;
  357. overflow: auto;
  358. }
  359. .verify_div {
  360. text-align: center;
  361. }
  362. .verify_div .el-table th > .cell {
  363. font-family: MicrosoftYaHei-Bold;
  364. font-weight: bold;
  365. color: rgba(51, 51, 51, 1);
  366. }
  367. .verify_div .el-table--border th,
  368. .el-table__fixed-right-patch {
  369. background: rgba(240, 240, 240, 1);
  370. box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1),
  371. 0px 1px 0px 0px rgba(0, 0, 0, 0.1), -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
  372. }
  373. .verify_div .el-table td.is-hidden > *,
  374. .nysgc .el-table th.is-hidden > *,
  375. .el-table--hidden {
  376. visibility: visible;
  377. }
  378. .el-table .warning-row {
  379. background: oldlace;
  380. }
  381. .el-table .success-row {
  382. background: #f0f9eb;
  383. }
  384. </style>