c3b82b27fd1761fa8882c9d84c824116af361233.svn-base 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. switchFullscreen
  8. @ok="handleOk"
  9. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  10. @cancel="handleCancel"
  11. cancelText="关闭">
  12. <a-spin :spinning="confirmLoading">
  13. <j-form-container :disabled="disableSubmit">
  14. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  15. <a-row>
  16. <a-col :span="12">
  17. <a-form-model-item label="河道名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdmc">
  18. <a-input v-model="model.hdmc" placeholder="请输入河名称" disabled></a-input>
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="12">
  22. <a-form-model-item label="河道编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdbm">
  23. <a-input v-model="model.hdbm" placeholder="请输入河道编码" disabled></a-input>
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :span="12">
  27. <a-form-model-item label="流域面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lymj">
  28. <a-input v-model="model.lymj" placeholder="请输入流域面积" style="width: 100%"
  29. disabled/>
  30. </a-form-model-item>
  31. </a-col>
  32. <a-col :span="12">
  33. <a-form-model-item label="数据与横断面信息中比降" :labelCol="labelCol" :wrapperCol="wrapperCol"
  34. prop="sjyhdmxxzbj">
  35. <a-input v-model="model.sjyhdmxxzbj" placeholder="请输入数据与横断面信息中比降"></a-input>
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :span="12">
  39. <a-form-model-item label="河底高程" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdgc">
  40. <a-input v-model="model.hdgc" placeholder="请输入河底高程" style="width: 100%"/>
  41. </a-form-model-item>
  42. </a-col>
  43. <a-col :span="12">
  44. <a-form-model-item label="堤顶高程" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ddgc">
  45. <a-input v-model="model.ddgc" placeholder="请输入堤顶高程" style="width: 100%"/>
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :span="12">
  49. <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bz">
  50. <a-input v-model="model.bz" placeholder="请输入备注"></a-input>
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :span="12">
  54. <a-form-model-item label="河底纵断面" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdzdm">
  55. <j-image-upload isMultiple v-model="model.hdzdm"></j-image-upload>
  56. </a-form-model-item>
  57. </a-col>
  58. <a-col :span="12">
  59. <a-form-model-item label="堤防(河岸)纵断面" :labelCol="labelCol" :wrapperCol="wrapperCol"
  60. prop="dfzdm">
  61. <j-image-upload isMultiple v-model="model.dfzdm"></j-image-upload>
  62. </a-form-model-item>
  63. </a-col>
  64. </a-row>
  65. </a-form-model>
  66. </j-form-container>
  67. </a-spin>
  68. </j-modal>
  69. </template>
  70. <script>
  71. import {httpAction} from '@/api/manage'
  72. import {validateDuplicateValue} from '@/utils/util'
  73. export default {
  74. name: "RmZdmxxglModal",
  75. components: {},
  76. props: {
  77. mainId: {
  78. type: String,
  79. required: false,
  80. default: ''
  81. },
  82. hlmxInfo: {
  83. type: Object,
  84. required: false,
  85. default: {}
  86. }
  87. },
  88. data() {
  89. return {
  90. title: "操作",
  91. width: 1200,
  92. visible: false,
  93. model: {},
  94. labelCol: {
  95. xs: {span: 24},
  96. sm: {span: 5},
  97. },
  98. wrapperCol: {
  99. xs: {span: 24},
  100. sm: {span: 16},
  101. },
  102. disableSubmit: false,
  103. confirmLoading: false,
  104. validatorRules: {},
  105. url: {
  106. add: "/hzz.xxgl.hdmx/rmHdmxb/addRmZdmxxgl",
  107. edit: "/hzz.xxgl.hdmx/rmHdmxb/editRmZdmxxgl",
  108. }
  109. }
  110. },
  111. created() {
  112. //备份model原始值
  113. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  114. },
  115. methods: {
  116. add() {
  117. Object.assign(this.modelDefault, this.hlmxInfo);
  118. this.edit(this.modelDefault);
  119. },
  120. edit(record) {
  121. this.model = Object.assign({}, record);
  122. this.visible = true;
  123. },
  124. close() {
  125. this.$emit('close');
  126. this.visible = false;
  127. this.$refs.form.clearValidate();
  128. },
  129. handleOk() {
  130. const that = this;
  131. // 触发表单验证
  132. this.$refs.form.validate(valid => {
  133. if (valid) {
  134. debugger
  135. that.confirmLoading = true;
  136. let httpurl = '';
  137. let method = '';
  138. if (!this.model.id) {
  139. httpurl += this.url.add;
  140. method = 'post';
  141. } else {
  142. httpurl += this.url.edit;
  143. method = 'post';
  144. }
  145. this.model['rvid'] = this.mainId;
  146. httpAction(httpurl, this.model, method).then((res) => {
  147. if (res.success) {
  148. that.$message.success(res.message);
  149. that.$emit('ok');
  150. } else {
  151. that.$message.warning(res.message);
  152. }
  153. }).finally(() => {
  154. that.confirmLoading = false;
  155. that.close();
  156. })
  157. } else {
  158. return false
  159. }
  160. })
  161. },
  162. handleCancel() {
  163. this.close()
  164. },
  165. popupCallback(value, row) {
  166. this.model = Object.assign(this.model, row);
  167. },
  168. }
  169. }
  170. </script>