66d0c1fde94a47d64d8291c8bed86bf0848bef34.svn-base 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <a-spin :spinning="confirmLoading">
  3. <j-form-container :disabled="formDisabled">
  4. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5. <a-row>
  6. <a-col :span="24">
  7. <a-form-model-item label="河流名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hlmc">
  8. <j-popup
  9. v-model="model.hlmc"
  10. field="hlmc"
  11. org-fields="hlmc,hlbm"
  12. dest-fields="hlmc,hlbm"
  13. code="hllist"
  14. :multi="true"
  15. @input="popupCallback"
  16. />
  17. </a-form-model-item>
  18. </a-col>
  19. <a-col :span="24">
  20. <a-form-model-item label="河流编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hlbm">
  21. <a-input v-model="model.hlbm" placeholder="请输入河流编码" ></a-input>
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :span="24">
  25. <a-form-model-item label="绿化长度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lhcd">
  26. <a-input-number v-model="model.lhcd" placeholder="请输入绿化长度" style="width: 100%" />
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :span="24">
  30. <a-form-model-item label="绿化宽度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lhkd">
  31. <a-input-number v-model="model.lhkd" placeholder="请输入绿化宽度" style="width: 100%" />
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :span="24">
  35. <a-form-model-item label="岸线长度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="axcd">
  36. <a-input-number v-model="model.axcd" placeholder="请输入岸线长度" style="width: 100%" disabled/>
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :span="24">
  40. <a-form-model-item label="岸线宽度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="axkd">
  41. <a-input-number v-model="model.axkd" placeholder="请输入岸线宽度" style="width: 100%" />
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :span="24">
  45. <a-form-model-item label="岸线面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="axmj">
  46. <a-input-number v-model="model.axmj" 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="sctp">
  51. <j-image-upload isMultiple v-model="model.sctp" ></j-image-upload>
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :span="24">
  55. <a-form-model-item label="视频上传" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spsc">
  56. <j-upload v-model="model.spsc" ></j-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="cjsj">
  61. <j-date placeholder="请选择采集时间" v-model="model.cjsj" style="width: 100%" />
  62. </a-form-model-item>
  63. </a-col>
  64. <a-col :span="24">
  65. <a-form-model-item label="采集人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cjr">
  66. <a-input v-model="model.cjr" placeholder="请输入采集人" ></a-input>
  67. </a-form-model-item>
  68. </a-col>
  69. <a-col :span="24">
  70. <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bz">
  71. <a-textarea v-model="model.bz" rows="4" placeholder="请输入备注" />
  72. </a-form-model-item>
  73. </a-col>
  74. </a-row>
  75. </a-form-model>
  76. </j-form-container>
  77. </a-spin>
  78. </template>
  79. <script>
  80. import { httpAction, getAction } from '@/api/manage'
  81. import { validateDuplicateValue } from '@/utils/util'
  82. export default {
  83. name: 'RmAxxxcjForm',
  84. components: {
  85. },
  86. props: {
  87. //表单禁用
  88. disabled: {
  89. type: Boolean,
  90. default: false,
  91. required: false
  92. }
  93. },
  94. data () {
  95. return {
  96. model:{
  97. },
  98. labelCol: {
  99. xs: { span: 24 },
  100. sm: { span: 5 },
  101. },
  102. wrapperCol: {
  103. xs: { span: 24 },
  104. sm: { span: 16 },
  105. },
  106. confirmLoading: false,
  107. validatorRules: {
  108. },
  109. url: {
  110. add: "/hzz.sjcjrw.axxxcj/rmAxxxcj/add",
  111. edit: "/hzz.sjcjrw.axxxcj/rmAxxxcj/edit",
  112. queryById: "/hzz.sjcjrw.axxxcj/rmAxxxcj/queryById"
  113. }
  114. }
  115. },
  116. computed: {
  117. formDisabled(){
  118. return this.disabled
  119. },
  120. },
  121. created () {
  122. //备份model原始值
  123. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  124. },
  125. methods: {
  126. add () {
  127. this.edit(this.modelDefault);
  128. },
  129. edit (record) {
  130. this.model = Object.assign({}, record);
  131. this.visible = true;
  132. },
  133. submitForm () {
  134. const that = this;
  135. // 触发表单验证
  136. this.$refs.form.validate(valid => {
  137. if (valid) {
  138. that.confirmLoading = true;
  139. let httpurl = '';
  140. let method = '';
  141. if(!this.model.id){
  142. httpurl+=this.url.add;
  143. method = 'post';
  144. }else{
  145. httpurl+=this.url.edit;
  146. method = 'post';
  147. }
  148. httpAction(httpurl,this.model,method).then((res)=>{
  149. if(res.success){
  150. that.$message.success(res.message);
  151. that.$emit('ok');
  152. }else{
  153. that.$message.warning(res.message);
  154. }
  155. }).finally(() => {
  156. that.confirmLoading = false;
  157. })
  158. }
  159. })
  160. },
  161. popupCallback(value,row){
  162. this.model = Object.assign(this.model, row);
  163. },
  164. }
  165. }
  166. </script>