commonTab.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div id="shuikutianbaoId">
  3. <a-modal :title="currentObjectName + '督查填报'" :footer="null" width="60%" :open="dialogFormVisible" @cancel="closeDialog">
  4. 督查对象id:{{rowData.objId}}
  5. <a-layout>
  6. <a-layout-content id="dxdcListMain" style="padding:5px 20px;">
  7. <a-tabs v-model="currentViewId" type="card" @tabClick="tabIndexChange">
  8. <a-tab-pane v-for="option in options" :key="option.label" :tab="option.label">
  9. <component
  10. :is="option.value"
  11. :currentObjectRgstrId="currentObjectRgstrId"
  12. :currentObjectName="currentObjectName"
  13. :currentResCode="currentResCode"
  14. :currentObjectId="currentObjectId"
  15. :activeLabel="activeLabel"
  16. :pType="pType"
  17. :rowData="currentRowData"
  18. :openType="openType"
  19. :labelList="signatureLabelList"
  20. @cancelHandler="cancelHandler"
  21. @addShuiKuSuccess="addShuiKuSuccess"
  22. :flag="flag"
  23. :isTongYong="isTongYong"></component>
  24. </a-tab-pane>
  25. </a-tabs>
  26. </a-layout-content>
  27. </a-layout>
  28. </a-modal>
  29. </div>
  30. </template>
  31. <script>
  32. import request from '../../utils/gw_ajax_request';
  33. import { Modal } from 'ant-design-vue';
  34. import jichuxinxi from './common/jichuxinxi';
  35. import problemList from './commonProblemList';
  36. export default {
  37. components: {
  38. jichuxinxi: jichuxinxi,
  39. problemList: problemList,
  40. },
  41. props: [
  42. 'rowData',
  43. 'currentObjectRgstrId',
  44. 'currentResCode',
  45. 'currentObjectId',
  46. 'currentObjectName',
  47. 'pType',
  48. 'openType',
  49. 'flag',
  50. 'isQuanFuGai',
  51. 'isTongYong',
  52. ],
  53. data() {
  54. return {
  55. currentRowData: {},
  56. options: [],
  57. value: '',
  58. dialogShow: false,
  59. currentViewId: '',
  60. dialogFormVisible: true,
  61. activeLabel: '',
  62. signatureLabelList: ['督查人员'],
  63. };
  64. },
  65. computed: {
  66. persId() {
  67. return localStorage.getItem('persId')
  68. ? localStorage.getItem('persId')
  69. : '1098101939614724096';
  70. },
  71. currentRlcode() {
  72. return localStorage.getItem('currentRlcode')
  73. ? localStorage.getItem('currentRlcode')
  74. : '';
  75. },
  76. },
  77. mounted() {
  78. this.currentRowData = this.rowData;
  79. // if (parseInt(this.$route.params.type) >= 615 && parseInt(this.$route.params.type) <= 630) {
  80. if (
  81. (parseInt(this.$route.path.substring(this.$route.path.length - 3)) >=
  82. 615 &&
  83. parseInt(this.$route.path.substring(this.$route.path.length - 3)) <=
  84. 630) ||
  85. this.isQuanFuGai
  86. ) {
  87. this.options = [
  88. {
  89. value: 'problemList',
  90. label: '问题清单',
  91. },
  92. ];
  93. this.currentViewId = '问题清单';
  94. } else {
  95. this.options = [
  96. {
  97. value: 'jichuxinxi',
  98. label: '基础信息',
  99. },
  100. {
  101. value: 'problemList',
  102. label: '问题清单',
  103. },
  104. ];
  105. this.currentViewId = '基础信息';
  106. }
  107. },
  108. created() {},
  109. methods: {
  110. submitHandler() {
  111. getRsByRgstrId(this.currentObjectRgstrId, this.pType).then((res) => {
  112. if (res.data.baseStat == '0') {
  113. this.$message.warning('请填写重点环节落实情况!');
  114. return;
  115. } else if (res.data.presStat == '0') {
  116. this.$message.warning('请填写责任人状态!');
  117. return;
  118. } else if (res.data.resRunStat == '0') {
  119. this.$message.warning('请填写水库工程实体和运行管理情况!');
  120. return;
  121. } else if (res.data.viewStat == '0') {
  122. this.$message.warning('走访用户状态!');
  123. return;
  124. }
  125. Modal.confirm({
  126. title: '提示',
  127. content: '请确认所有信息填报完毕?',
  128. okType: 'warning',
  129. onOk: () => {
  130. const formObj = {
  131. rgstrId: this.currentObjectRgstrId,
  132. state: '2',
  133. };
  134. let url = '/dc/insp/rsvrRgstr/update';
  135. if (this.pType == 22) {
  136. url = '/bis/insp/rsml/rgstr';
  137. }
  138. request.post(url, formObj).then((res) => {
  139. if (res.success) {
  140. this.$emit('addShuiKuSuccess');
  141. this.$message.success('提交成功');
  142. } else {
  143. this.$emit('cancelHandler');
  144. }
  145. });
  146. },
  147. });
  148. });
  149. },
  150. closeHandler() {
  151. this.dialogShow = false;
  152. this.$emit('addShuiKuSuccess');
  153. },
  154. appearDialog(type) {
  155. this.dialogShow = true;
  156. // this.problemSmallType = type
  157. },
  158. closePDialog() {
  159. this.dialogShow = false;
  160. },
  161. showDialog() {
  162. this.dialogFormVisible = true;
  163. },
  164. cancelHandler() {
  165. this.$emit('cancelHandler');
  166. },
  167. addShuiKuSuccess(obj) {
  168. if (obj && obj.type) {
  169. this.currentRowData.type = obj.type;
  170. }
  171. this.$emit('addShuiKuSuccess');
  172. },
  173. closeDialog() {
  174. Modal.confirm({
  175. title: '提示',
  176. content: '确认退出吗?',
  177. okType: 'warning',
  178. onOk: () => {
  179. this.$emit('cancelHandler');
  180. return Promise.resolve();
  181. },
  182. });
  183. },
  184. tabIndexChange(item) {
  185. if (item == '问题清单') {
  186. this.activeLabel = item;
  187. } else {
  188. this.activeLabel = '';
  189. }
  190. },
  191. },
  192. };
  193. </script>
  194. <style lang='less' scoped>
  195. </style>