3eaa646dd99bef3268f2f299a8bd9bf5bfb62e18.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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="objCode"
  52. label="水闸编码"
  53. width="150"
  54. align="center"
  55. show-overflow-tooltip
  56. >
  57. <template slot-scope="scope">
  58. <span :style="{ color: scope.row.objCode.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  59. {{ scope.row.objCode.replace(/\$E\$/g,'') }}
  60. </span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="gateName" label="水闸名称" width="150" align="center" show-overflow-tooltip></el-table-column>
  64. <el-table-column prop="inspPblmsName" label="问题类别" width="150" align="center" show-overflow-tooltip></el-table-column>
  65. <el-table-column
  66. prop="attachSheet"
  67. label="问题标准附件编号"
  68. width="150"
  69. align="center"
  70. show-overflow-tooltip
  71. >
  72. <template slot-scope="scope">
  73. <div v-if="scope.row.attachSheet.indexOf('$W$')>0">
  74. <el-popover trigger="hover" placement="top">
  75. <p>请检查"问题标准附件编号"与"问题标准序号"、"严重程度"是否匹配;选择继续填报,此条数据将不会入库.</p>
  76. <div slot="reference" class="name-wrapper">
  77. <span :style="{ color: scope.row.attachSheet.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachSheet.indexOf('$W$')>0 ? '#E7E708' : '' }">
  78. {{ scope.row.attachSheet.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  79. </span>
  80. </div>
  81. </el-popover>
  82. </div>
  83. <div v-else>
  84. <span :style="{ color: scope.row.attachSheet.indexOf('$E$')>0 ? '#ED3F14' : scope.row.attachSheet.indexOf('$W$')>0 ? '#E7E708' : '' }">
  85. {{ scope.row.attachSheet.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  86. </span>
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column
  91. prop="inspPblmCode"
  92. label="问题标准序号"
  93. width="150"
  94. align="center"
  95. show-overflow-tooltip
  96. >
  97. <template slot-scope="scope">
  98. <div v-if="scope.row.inspPblmCode.indexOf('$W$')>0">
  99. <el-popover trigger="hover" placement="top">
  100. <p>请检查"问题标准序号"与"问题标准附件编号"、"严重程度"是否匹配;选择继续填报,此条数据将不会入库.</p>
  101. <div slot="reference" class="name-wrapper">
  102. <span :style="{ color: scope.row.inspPblmCode.indexOf('$E$')>0 ? '#ED3F14' : scope.row.inspPblmCode.indexOf('$W$')>0 ? '#E7E708' : '' }">
  103. {{ scope.row.inspPblmCode.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  104. </span>
  105. </div>
  106. </el-popover>
  107. </div>
  108. <div v-else>
  109. <span :style="{ color: scope.row.inspPblmCode.indexOf('$E$')>0 ? '#ED3F14' : scope.row.inspPblmCode.indexOf('$W$')>0 ? '#E7E708' : '' }">
  110. {{ scope.row.inspPblmCode.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  111. </span>
  112. </div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="inspPblmDesc" label="问题详情" width="150" align="center" show-overflow-tooltip></el-table-column>
  116. <el-table-column
  117. prop="inspPblmCate"
  118. label="问题严重程度"
  119. width="150"
  120. align="center"
  121. show-overflow-tooltip
  122. >
  123. <template slot-scope="scope">
  124. <div v-if="scope.row.inspPblmCate.indexOf('$W$')>0">
  125. <el-popover trigger="hover" placement="top">
  126. <p>请检查"严重程度"与"问题标准序号"、"问题标准附件编号"是否匹配;选择继续填报,此条数据将不会入库.</p>
  127. <div slot="reference" class="name-wrapper">
  128. <span :style="{ color: scope.row.inspPblmCate.indexOf('$E$')>0 ? '#ED3F14' : scope.row.inspPblmCate.indexOf('$W$')>0 ? '#E7E708' : '' }">
  129. {{ scope.row.inspPblmCate.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  130. </span>
  131. </div>
  132. </el-popover>
  133. </div>
  134. <div v-else>
  135. <span :style="{ color: scope.row.inspPblmCate.indexOf('$E$')>0 ? '#ED3F14' : scope.row.inspPblmCate.indexOf('$W$')>0 ? '#E7E708' : '' }">
  136. {{ scope.row.inspPblmCate.replace(/\$E\$/g,'').replace(/\$W\$/g,'') }}
  137. </span>
  138. </div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column
  142. prop="ifCasePblm"
  143. label="是否典型"
  144. width="150"
  145. align="center"
  146. show-overflow-tooltip
  147. >
  148. <template slot-scope="scope">
  149. <span :style="{ color: scope.row.ifCasePblm.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  150. {{ scope.row.ifCasePblm.replace(/\$E\$/g,'') }}
  151. </span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column
  155. prop="path"
  156. label="路径"
  157. width="150"
  158. align="center"
  159. show-overflow-tooltip
  160. >
  161. <template slot-scope="scope">
  162. <span :style="{ color: scope.row.path.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  163. {{ scope.row.path.replace(/\$E\$/g,'') }}
  164. </span>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. <template>
  169. <lable v-show="confirmUploadState">
  170. <el-radio v-model="updateState" label="1">新增</el-radio>
  171. <el-radio v-model="updateState" label="0">覆盖</el-radio>
  172. </lable>
  173. </template>
  174. <el-button type="warning" v-show="reUploadState" @click="handleClose" >重新上传</el-button>
  175. <el-button type="primary" v-show="confirmUploadState" @click="confirmUpload"
  176. :loading="uploadLoading"
  177. :disabled="buttonState"
  178. >确定填报</el-button>
  179. </div>
  180. </el-dialog>
  181. </template>
  182. <script>
  183. import request from "@util/gw_ajax_request.js";
  184. export default {
  185. props: ['tableData','cacheId','uploadButtonState'],
  186. components: {},
  187. data() {
  188. return {
  189. dialogVisible: true,
  190. reUploadState:false,
  191. confirmUploadState:true,
  192. rDisabled:false,
  193. cDisabled:false,
  194. title:'水闸问题批量导入验证页面(验证通过√)',
  195. uploadLoading: false,
  196. buttonState: false,
  197. updateState: '1',
  198. };
  199. },
  200. mounted(){
  201. if(this.uploadButtonState != undefined){
  202. this.buttonState = this.uploadButtonState;
  203. }
  204. },
  205. computed: {
  206. persId() {
  207. return localStorage.getItem("userid")
  208. ? localStorage.getItem("userid")
  209. : "1098101939614724096";
  210. }
  211. },
  212. methods: {
  213. handleClose(done) {
  214. this.reUploadState = false;
  215. this.$emit("closePlVerDialog");
  216. },
  217. getIndex(index) {
  218. return index + 4;
  219. },
  220. tableRowClassName({ row, rowIndex }) {
  221. let values = "";
  222. for(let key in row){
  223. values += row[key];
  224. }
  225. if (values.indexOf('$E$') > 0) {
  226. this.reUploadState = true;
  227. this.confirmUploadState = false;
  228. this.title = '水闸问题批量导入验证页面(验证未通过×)';
  229. return 'warning-row';
  230. }
  231. return "";
  232. },
  233. confirmUpload(){
  234. this.upload();
  235. },
  236. upload(){
  237. this.uploadLoading = true;
  238. this.buttonState = true;
  239. request.get(`/dc/imp/pblm/insert/info?cacheId=${this.cacheId}&userId=${this.persId}&updateState=${this.updateState}&orgType=006`).then(res => {
  240. console.log(res)
  241. this.$alert(res.data.key, '信息', {
  242. dangerouslyUseHTMLString: true,
  243. callback: action => {
  244. this.uploadLoading = false;
  245. this.buttonState = true;
  246. this.handleClose();
  247. }
  248. });
  249. // if(res.data.key == true){
  250. // this.$alert('填报成功!', '提示', {
  251. // confirmButtonText: '确定',
  252. // type: 'success',
  253. // callback: action => {
  254. // this.uploadLoading = false;
  255. // this.buttonState = true;
  256. // this.handleClose();
  257. // }
  258. // });
  259. // }else {
  260. // this.$alert('填报失败!', '提示', {
  261. // confirmButtonText: '确定',
  262. // callback: action => {
  263. // this.$message({
  264. // type: 'info',
  265. // message: `请不要重复提交!`
  266. // });
  267. // }
  268. // });
  269. // this.uploadLoading = false;
  270. // this.buttonState = true;
  271. // }
  272. });
  273. }
  274. },
  275. watch: {
  276. reUploadState(n,o){
  277. if(n){
  278. this.confirmUploadState = false;
  279. }else {
  280. this.confirmUploadState = true;
  281. }
  282. }
  283. }
  284. };
  285. </script>
  286. <style>
  287. .title {
  288. font-size: 16px;
  289. }
  290. .el-icon-edit {
  291. margin-right: 10px;
  292. }
  293. .verify_dialog .el-dialog {
  294. width: 80% !important;
  295. }
  296. .verify_dialog .el-dialog__body {
  297. padding: 30px 20px;
  298. color: #606266;
  299. font-size: 14px;
  300. height: 500px;
  301. overflow: auto;
  302. }
  303. .verify_div {
  304. text-align: center;
  305. }
  306. .verify_div .el-table th > .cell {
  307. font-family: MicrosoftYaHei-Bold;
  308. font-weight: bold;
  309. color: rgba(51, 51, 51, 1);
  310. }
  311. .verify_div .el-table--border th,
  312. .el-table__fixed-right-patch {
  313. background: rgba(240, 240, 240, 1);
  314. box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1),
  315. 0px 1px 0px 0px rgba(0, 0, 0, 0.1), -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
  316. }
  317. .verify_div .el-table td.is-hidden > *,
  318. .nysgc .el-table th.is-hidden > *,
  319. .el-table--hidden {
  320. visibility: visible;
  321. }
  322. .el-table .warning-row {
  323. background: oldlace;
  324. }
  325. .el-table .success-row {
  326. background: #f0f9eb;
  327. }
  328. </style>