f8c0b36cf3199d3fcf08385e9f480c87a05ef967.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. <span :style="{ color: scope.row.groupName.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  34. {{ scope.row.groupName.replace('$E$','') }}
  35. </span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column
  39. prop="rsCode"
  40. label="水库编码"
  41. width="150"
  42. align="center"
  43. show-overflow-tooltip
  44. >
  45. <template slot-scope="scope">
  46. <span :style="{ color: scope.row.rsCode.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  47. {{ scope.row.rsCode.replace('$E$','') }}
  48. </span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="rsName" label="水库名称" width="150" align="center" show-overflow-tooltip></el-table-column>
  52. <el-table-column
  53. prop="inspPblmCode"
  54. label="问题序号"
  55. width="150"
  56. align="center"
  57. show-overflow-tooltip
  58. >
  59. <template slot-scope="scope">
  60. <span :style="{ color: scope.row.inspPblmCode.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  61. {{ scope.row.inspPblmCode.replace('$E$','') }}
  62. </span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="inspPblmDesc" label="问题详情" width="150" align="center" show-overflow-tooltip></el-table-column>
  66. <el-table-column
  67. prop="inspPblmCate"
  68. label="问题严重程度"
  69. width="150"
  70. align="center"
  71. show-overflow-tooltip
  72. >
  73. <template slot-scope="scope">
  74. <span :style="{ color: scope.row.inspPblmCate.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  75. {{ scope.row.inspPblmCate.replace('$E$','') }}
  76. </span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. prop="ifCasePblm"
  81. label="是否典型"
  82. width="150"
  83. align="center"
  84. show-overflow-tooltip
  85. >
  86. <template slot-scope="scope">
  87. <span :style="{ color: scope.row.ifCasePblm.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  88. {{ scope.row.ifCasePblm.replace('$E$','') }}
  89. </span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. prop="path"
  94. label="路径"
  95. width="150"
  96. align="center"
  97. show-overflow-tooltip
  98. >
  99. <template slot-scope="scope">
  100. <span :style="{ color: scope.row.path.indexOf('$E$')>0 ? '#ED3F14' : '' }">
  101. {{ scope.row.path.replace('$E$','') }}
  102. </span>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. <template>
  107. <lable v-show="confirmUploadState">
  108. <el-radio v-model="updateState" label="1">新增</el-radio>
  109. <el-radio v-model="updateState" label="0">覆盖</el-radio>
  110. </lable>
  111. </template>
  112. <el-button type="warning" v-show="reUploadState" @click="handleClose" >重新上传</el-button>
  113. <el-button type="primary" v-show="confirmUploadState" @click="confirmUpload"
  114. :loading="uploadLoading"
  115. :disabled="buttonState"
  116. >确定填报</el-button>
  117. </div>
  118. </el-dialog>
  119. </template>
  120. <script>
  121. import request from "../../utils/gw_ajax_request.js";
  122. export default {
  123. props: ['tableData','cacheId'],
  124. components: {},
  125. data() {
  126. return {
  127. dialogVisible: true,
  128. reUploadState:false,
  129. confirmUploadState:true,
  130. rDisabled:false,
  131. cDisabled:false,
  132. title:'小水库问题批量导入验证页面(验证通过√)',
  133. uploadLoading: false,
  134. buttonState: false,
  135. updateState: '1',
  136. };
  137. },
  138. mounted: function() {},
  139. computed: {
  140. persId() {
  141. return localStorage.getItem("userid")
  142. ? localStorage.getItem("userid")
  143. : "1098101939614724096";
  144. }
  145. },
  146. methods: {
  147. handleClose(done) {
  148. this.reUploadState = false;
  149. this.$emit("closePlVerDialog");
  150. },
  151. getIndex(index) {
  152. return index + 4;
  153. },
  154. tableRowClassName({ row, rowIndex }) {
  155. let values = "";
  156. for(let key in row){
  157. values += row[key];
  158. }
  159. if (values.indexOf('$E$') > 0) {
  160. this.reUploadState = true;
  161. this.confirmUploadState = false;
  162. this.title = '小水库问题批量导入验证页面(验证未通过×)';
  163. return 'warning-row';
  164. }
  165. return "";
  166. },
  167. confirmUpload(){
  168. this.upload();
  169. },
  170. upload(){
  171. this.uploadLoading = true;
  172. this.buttonState = true;
  173. request.get(`/dc/imp/skpblm/insert?cacheId=${this.cacheId}&userId=${this.persId}&updateState=${this.updateState}`).then(res => {
  174. console.log(res)
  175. if(res.data.key == true){
  176. this.$alert('填报成功!', '提示', {
  177. confirmButtonText: '确定',
  178. type: 'success',
  179. callback: action => {
  180. this.uploadLoading = false;
  181. this.buttonState = true;
  182. this.handleClose();
  183. }
  184. });
  185. }else {
  186. this.$alert('填报失败!', '提示', {
  187. confirmButtonText: '确定',
  188. callback: action => {
  189. this.$message({
  190. type: 'info',
  191. message: `请不要重复提交!`
  192. });
  193. }
  194. });
  195. this.uploadLoading = false;
  196. this.buttonState = true;
  197. }
  198. });
  199. }
  200. },
  201. watch: {
  202. reUploadState(n,o){
  203. if(n){
  204. this.confirmUploadState = false;
  205. }else {
  206. this.confirmUploadState = true;
  207. }
  208. }
  209. }
  210. };
  211. </script>
  212. <style>
  213. .title {
  214. font-size: 16px;
  215. }
  216. .el-icon-edit {
  217. margin-right: 10px;
  218. }
  219. .verify_dialog .el-dialog {
  220. width: 80% !important;
  221. }
  222. .verify_dialog .el-dialog__body {
  223. padding: 30px 20px;
  224. color: #606266;
  225. font-size: 14px;
  226. height: 500px;
  227. overflow: auto;
  228. }
  229. .verify_div {
  230. text-align: center;
  231. }
  232. .verify_div .el-table th > .cell {
  233. font-family: MicrosoftYaHei-Bold;
  234. font-weight: bold;
  235. color: rgba(51, 51, 51, 1);
  236. }
  237. .verify_div .el-table--border th,
  238. .el-table__fixed-right-patch {
  239. background: rgba(240, 240, 240, 1);
  240. box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1),
  241. 0px 1px 0px 0px rgba(0, 0, 0, 0.1), -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
  242. }
  243. .verify_div .el-table td.is-hidden > *,
  244. .nysgc .el-table th.is-hidden > *,
  245. .el-table--hidden {
  246. visibility: visible;
  247. }
  248. </style>