186c34c1f302b5dc42cdf39ba294ff26239054ac.svn-base 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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="false"
  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="jzbh">
  21. <a-input v-model="model.jzbh" 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="hzb">
  26. <a-input-number v-model="model.hzb" placeholder="请输入横坐标" style="width: 100%" @blur="coordsChange"/>
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :span="24">
  30. <a-form-model-item label="纵坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zzb">
  31. <a-input-number v-model="model.zzb" placeholder="请输入纵坐标" style="width: 100%" @blur="coordsChange"/>
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :span="24">
  35. <a-form-model-item label="东经" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lng">
  36. <a-input-number v-model="this.lng" disabled="" placeholder="请输入纵坐标" style="width: 100%" @blur="coordsChange"/>
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :span="24">
  40. <a-form-model-item label="北纬" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lat">
  41. <a-input-number v-model="this.lat" disabled="" placeholder="请输入纵坐标" style="width: 100%" @blur="coordsChange"/>
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :span="24">
  45. <a-form-model-item label="是否移位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lat">
  46. <a-input v-model="model.sfyw" placeholder="请输入是否移位"></a-input>
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :span="24">
  50. <a-form-model-item label="移位横坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lat">
  51. <a-input-number v-model="model.ywhzb" placeholder="请输入移位横坐标" style="width: 100%" @blur="coordsChange"/>
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :span="24">
  55. <a-form-model-item label="移位纵坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lat">
  56. <a-input-number v-model="model.ywzzb" placeholder="请输入移位纵坐标" style="width: 100%" @blur="coordsChange"/>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :span="24">
  60. <a-form-model-item label="岸别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ab">
  61. <j-dict-select-tag type="list" v-model="model.ab" dictCode="ab" placeholder="请选择岸别"/>
  62. </a-form-model-item>
  63. </a-col>
  64. <a-col :span="24">
  65. <a-form-model-item label="高程" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gc">
  66. <a-input-number v-model="model.gc" placeholder="请输入高程" style="width: 100%"/>
  67. </a-form-model-item>
  68. </a-col>
  69. <a-col :span="24">
  70. <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
  71. <j-area-linkage type="cascader" v-model="model.xzqh" placeholder="请输入省市区"/>
  72. </a-form-model-item>
  73. </a-col>
  74. <a-col :span="24">
  75. <a-form-model-item label="所在位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dmdz">
  76. <a-input v-model="model.dmdz" placeholder="请输入所在位置"></a-input>
  77. </a-form-model-item>
  78. </a-col>
  79. <a-col :span="24">
  80. <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol2" prop="bz">
  81. <!-- <j-editor v-model="model.bz" />-->
  82. <a-textarea v-model="model.bz"></a-textarea>
  83. </a-form-model-item>
  84. </a-col>
  85. </a-row>
  86. </a-form-model>
  87. </j-form-container>
  88. </a-spin>
  89. </template>
  90. <script>
  91. import {httpAction, getAction} from '@/api/manage'
  92. import {validateDuplicateValue} from '@/utils/util'
  93. export default {
  94. name: 'RmBoundaryMarkerForm',
  95. components: {},
  96. props: {
  97. //表单禁用
  98. disabled: {
  99. type: Boolean,
  100. default: false,
  101. required: false
  102. },
  103. lng: {
  104. type: Number
  105. },
  106. lat: {
  107. type: Number
  108. }
  109. },
  110. data() {
  111. return {
  112. model: {},
  113. labelCol: {
  114. xs: {span: 24},
  115. sm: {span: 6},
  116. },
  117. wrapperCol: {
  118. xs: {span: 24},
  119. sm: {span: 16},
  120. },
  121. wrapperCol2: {
  122. xs: {span: 24},
  123. sm: {span: 16},
  124. },
  125. confirmLoading: false,
  126. validatorRules: {
  127. jzbh: {
  128. required: true,
  129. message: '请输入界桩编号!'
  130. }
  131. },
  132. url: {
  133. add: "/hzz.hhhj.jzd/rmBoundaryMarker/add",
  134. edit: "/hzz.hhhj.jzd/rmBoundaryMarker/edit",
  135. queryById: "/hzz.hhhj.jzd/rmBoundaryMarker/queryById"
  136. }
  137. }
  138. },
  139. computed: {
  140. formDisabled() {
  141. return this.disabled
  142. },
  143. },
  144. created() {
  145. //备份model原始值
  146. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  147. },
  148. methods: {
  149. add() {
  150. this.edit(this.modelDefault);
  151. },
  152. edit(record) {
  153. this.model = Object.assign({}, record);
  154. this.visible = true;
  155. },
  156. submitForm() {
  157. const that = this;
  158. // 触发表单验证
  159. this.$refs.form.validate(valid => {
  160. if (valid) {
  161. that.confirmLoading = true;
  162. let httpurl = '';
  163. let method = '';
  164. if (!this.model.id) {
  165. httpurl += this.url.add;
  166. method = 'post';
  167. } else {
  168. httpurl += this.url.edit;
  169. //method = 'put';
  170. method = 'post';
  171. }
  172. httpAction(httpurl, this.model, method).then((res) => {
  173. if (res.success) {
  174. that.$message.success(res.message);
  175. that.$emit('ok');
  176. } else {
  177. that.$message.warning(res.message);
  178. }
  179. }).finally(() => {
  180. that.confirmLoading = false;
  181. })
  182. }
  183. })
  184. },
  185. popupCallback(value, row) {
  186. this.model = Object.assign(this.model, row);
  187. },
  188. coordsChange() {
  189. this.$emit("coordsChange", this.model.hzb, this.model.zzb);
  190. }
  191. }
  192. }
  193. </script>