890e6160a8603e2613f084e778a189a166518c07.svn-base 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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="xmmc">
  16. <a-input v-model="model.xmmc"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="szsx">
  21. <j-dict-select-tag type="list" v-model="model.szsx" dictCode="szsx" 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="xzqh">
  26. <a-input v-model="model.xzqh"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="xjqhdm">
  31. <a-input v-model="model.xjqhdm"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="hzb">
  36. <a-input v-model="model.hzb"placeholder="请输入横坐标" style="width: 100%" />
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :span="24">
  40. <a-form-model-item label="纵坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zzb">
  41. <a-input v-model="model.zzb"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="xmfzr">
  46. <a-input v-model="model.xmfzr"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="dh">
  51. <a-input v-model="model.dh"placeholder="请输入电话" ></a-input>
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :span="24">
  55. <a-form-model-item label="立项情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lxqk">
  56. <a-input v-model="model.lxqk"placeholder="请输入立项情况" ></a-input>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :span="24">
  60. <a-form-model-item label="防洪标准" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fhbz">
  61. <a-input v-model="model.fhbz"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="ztbzjs">
  66. <a-input v-model="model.ztbzjs"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="qt">
  71. <a-input v-model="model.qt"placeholder="请输入其他" ></a-input>
  72. </a-form-model-item>
  73. </a-col>
  74. <a-col :span="24">
  75. <a-form-model-item label="建设状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jszt">
  76. <j-dict-select-tag type="list" v-model="model.jszt" dictCode="gcjsqk" placeholder="请选择建设状态" />
  77. </a-form-model-item>
  78. </a-col>
  79. </a-row>
  80. </a-form-model>
  81. </a-spin>
  82. </j-modal>
  83. </template>
  84. <script>
  85. import { httpAction } from '@/api/manage'
  86. import { validateDuplicateValue } from '@/utils/util'
  87. export default {
  88. name: "RmAxxmxxModal",
  89. components: {
  90. },
  91. props:{
  92. mainId:{
  93. type:String,
  94. required:false,
  95. default:''
  96. }
  97. },
  98. data () {
  99. return {
  100. title:"操作",
  101. width:800,
  102. visible: false,
  103. model:{
  104. },
  105. labelCol: {
  106. xs: { span: 24 },
  107. sm: { span: 5 },
  108. },
  109. wrapperCol: {
  110. xs: { span: 24 },
  111. sm: { span: 16 },
  112. },
  113. confirmLoading: false,
  114. validatorRules: {
  115. },
  116. url: {
  117. add: "/hzz.axgh.axzyxm/rmAxzyxmb/addRmAxxmxx",
  118. edit: "/hzz.axgh.axzyxm/rmAxzyxmb/editRmAxxmxx",
  119. }
  120. }
  121. },
  122. created () {
  123. //备份model原始值
  124. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  125. },
  126. methods: {
  127. add () {
  128. this.edit(this.modelDefault);
  129. },
  130. edit (record) {
  131. this.model = Object.assign({}, record);
  132. this.visible = true;
  133. },
  134. close () {
  135. this.$emit('close');
  136. this.visible = false;
  137. this.$refs.form.clearValidate();
  138. },
  139. handleOk () {
  140. const that = this;
  141. // 触发表单验证
  142. this.$refs.form.validate(valid => {
  143. if (valid) {
  144. that.confirmLoading = true;
  145. let httpurl = '';
  146. let method = '';
  147. if(!this.model.id){
  148. httpurl+=this.url.add;
  149. method = 'post';
  150. }else{
  151. httpurl+=this.url.edit;
  152. method = 'post';
  153. }
  154. this.model['mainId'] = this.mainId
  155. httpAction(httpurl,this.model,method).then((res)=>{
  156. if(res.success){
  157. that.$message.success(res.message);
  158. that.$emit('ok');
  159. }else{
  160. that.$message.warning(res.message);
  161. }
  162. }).finally(() => {
  163. that.confirmLoading = false;
  164. that.close();
  165. })
  166. }else{
  167. return false
  168. }
  169. })
  170. },
  171. handleCancel () {
  172. this.close()
  173. },
  174. }
  175. }
  176. </script>