c72952b01bfc2e69daba1c499b80c3968c98082b.svn-base 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  8. switchFullscreen
  9. @ok="handleOk"
  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="24">
  17. <a-form-model-item label="工程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gcmc">
  18. <!-- <a-input v-model="model.gcmc"placeholder="请输入工程名称" ></a-input>-->
  19. <j-popup placeholder="请选择涉河部分工程信息中的工程名称!"
  20. v-model="model.gcmc"
  21. field="gcmc"
  22. org-fields="gcmc,shlx"
  23. dest-fields="gcmc,shlx"
  24. code="shlx"
  25. :multi="true"
  26. :param="tempParam"
  27. @input="popupCallback"
  28. />
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :span="24">
  32. <a-form-model-item label="工况序列" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gkxl">
  33. <a-input v-model="model.gkxl" placeholder="请输入工况序列"></a-input>
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :span="24">
  37. <a-form-model-item label="阻水比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zsb">
  38. <a-input v-model="model.zsb" placeholder="请输入阻水比"></a-input>
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :span="24">
  42. <a-form-model-item label="壅水高度及范围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ysgdjfw">
  43. <a-input-number v-model="model.ysgdjfw" placeholder="请输入壅水高度及范围" style="width: 100%"/>
  44. </a-form-model-item>
  45. </a-col>
  46. <a-col :span="24">
  47. <a-form-model-item label="冲淤情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cyqk">
  48. <a-textarea v-model="model.cyqk" placeholder="请输入冲淤情况" rows="4"></a-textarea>
  49. </a-form-model-item>
  50. </a-col>
  51. <a-col :span="24">
  52. <a-form-model-item label="影响情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxqk">
  53. <!-- <a-input v-model="model.yxqk" placeholder="请输入影响情况"></a-input>-->
  54. <a-textarea v-model="model.yxqk" placeholder="请输入影响情况" rows="4"></a-textarea>
  55. </a-form-model-item>
  56. </a-col>
  57. <a-col :span="24">
  58. <a-form-model-item label="措施" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cs">
  59. <a-textarea v-model="model.cs" placeholder="请输入措施" rows="4"></a-textarea>
  60. </a-form-model-item>
  61. </a-col>
  62. <a-col :span="24">
  63. <a-form-model-item label="其他" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qt">
  64. <a-textarea v-model="model.qt" placeholder="请输入其他" rows="4"></a-textarea>
  65. </a-form-model-item>
  66. </a-col>
  67. </a-row>
  68. </a-form-model>
  69. </j-form-container>
  70. </a-spin>
  71. </j-modal>
  72. </template>
  73. <script>
  74. import {httpAction} from '@/api/manage'
  75. import {validateDuplicateValue} from '@/utils/util'
  76. export default {
  77. name: "RmAxfxjszycgbModal",
  78. components: {},
  79. props: {
  80. mainId: {
  81. type: String,
  82. required: false,
  83. default: ''
  84. }
  85. },
  86. data() {
  87. return {
  88. title: "操作",
  89. width: 800,
  90. visible: false,
  91. model: {},
  92. labelCol: {
  93. xs: {span: 24},
  94. sm: {span: 5},
  95. },
  96. wrapperCol: {
  97. xs: {span: 24},
  98. sm: {span: 16},
  99. },
  100. main_id: '',
  101. disableSubmit:false,
  102. confirmLoading: false,
  103. validatorRules: {},
  104. url: {
  105. add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmAxfxjszycgb",
  106. edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmAxfxjszycgb",
  107. },
  108. tempParam: {},
  109. }
  110. },
  111. created() {
  112. //备份model原始值
  113. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  114. },
  115. methods: {
  116. add() {
  117. this.tempParam = {main_id: this.mainId}
  118. this.edit(this.modelDefault);
  119. },
  120. edit(record) {
  121. this.tempParam = {main_id: this.mainId}
  122. this.model = Object.assign({}, record);
  123. this.visible = true;
  124. },
  125. close() {
  126. this.$emit('close');
  127. this.visible = false;
  128. this.$refs.form.clearValidate();
  129. },
  130. handleOk() {
  131. const that = this;
  132. // 触发表单验证
  133. this.$refs.form.validate(valid => {
  134. if (valid) {
  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['mainId'] = 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>