ca78bd5c9cb7f253dd6defd6a4e396411b4944b0.svn-base 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. switchFullscreen
  8. @ok="handleOk"
  9. @cancel="handleCancel"
  10. cancelText="关闭">
  11. <a-spin :spinning="confirmLoading">
  12. <a-form-model ref="form" :model="model" :rules="validatorRules">
  13. <a-row>
  14. <a-col :span="24">
  15. <a-form-model-item label="问题序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wtxh">
  16. <a-input v-model="model.wtxh"placeholder="请输入问题序号" ></a-input>
  17. </a-form-model-item>
  18. </a-col>
  19. <a-col :span="24">
  20. <a-form-model-item label="问题类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wtlb">
  21. <j-dict-select-tag type="list" v-model="model.wtlb" dictCode="wtlb" placeholder="请选择问题类别" />
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :span="24">
  25. <a-form-model-item label="主要问题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zywt">
  26. <a-input v-model="model.zywt"placeholder="请输入主要问题" ></a-input>
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :span="24">
  30. <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
  31. <a-input v-model="model.xzqh"placeholder="请输入行政区划" ></a-input>
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :span="24">
  35. <a-form-model-item label="岸别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ab">
  36. <a-input v-model="model.ab"placeholder="请输入岸别" ></a-input>
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :span="24">
  40. <a-form-model-item label="所在位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="szwz">
  41. <a-input v-model="model.szwz"placeholder="请输入所在位置" ></a-input>
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :span="24">
  45. <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jd">
  46. <a-input v-model="model.jd"placeholder="请输入经度" style="width: 100%" />
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :span="24">
  50. <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wd">
  51. <a-input v-model="model.wd"placeholder="请输入纬度" style="width: 100%" />
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :span="24">
  55. <a-form-model-item label="问题照片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wtzp">
  56. <j-image-upload isMultiple v-model="model.wtzp"></j-image-upload>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :span="24">
  60. <a-form-model-item label="成因简析" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cyjx">
  61. <a-input v-model="model.cyjx"placeholder="请输入成因简析" ></a-input>
  62. </a-form-model-item>
  63. </a-col>
  64. <a-col :span="24">
  65. <a-form-model-item label="意见/备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yjbz">
  66. <a-input v-model="model.yjbz"placeholder="请输入意见/备注" ></a-input>
  67. </a-form-model-item>
  68. </a-col>
  69. </a-row>
  70. </a-form-model>
  71. </a-spin>
  72. </j-modal>
  73. </template>
  74. <script>
  75. import { httpAction } from '@/api/manage'
  76. import { validateDuplicateValue } from '@/utils/util'
  77. export default {
  78. name: "RmWtqdModal",
  79. components: {
  80. },
  81. props:{
  82. mainId:{
  83. type:String,
  84. required:false,
  85. default:''
  86. }
  87. },
  88. data () {
  89. return {
  90. title:"操作",
  91. width:800,
  92. visible: false,
  93. model:{
  94. },
  95. labelCol: {
  96. xs: { span: 24 },
  97. sm: { span: 5 },
  98. },
  99. wrapperCol: {
  100. xs: { span: 24 },
  101. sm: { span: 16 },
  102. },
  103. confirmLoading: false,
  104. validatorRules: {
  105. },
  106. url: {
  107. add: "/hzz.yhyc/rmJbxx/addRmWtqd",
  108. edit: "/hzz.yhyc/rmJbxx/editRmWtqd",
  109. }
  110. }
  111. },
  112. created () {
  113. //备份model原始值
  114. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  115. },
  116. methods: {
  117. add () {
  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. that.confirmLoading = true;
  135. let httpurl = '';
  136. let method = '';
  137. if(!this.model.id){
  138. httpurl+=this.url.add;
  139. method = 'post';
  140. }else{
  141. httpurl+=this.url.edit;
  142. //method = 'put';
  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. }
  166. }
  167. </script>