3c7e4e454a0a06044b26f005d5a29db030eb4a8e.svn-base 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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="sqdwmc">
  16. <a-input v-model="model.sqdwmc"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="frdb">
  21. <a-input v-model="model.frdb"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="tyshxydm">
  26. <a-input v-model="model.tyshxydm"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="sqdwtxdz">
  31. <a-input v-model="model.sqdwtxdz"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="lxr">
  36. <a-input v-model="model.lxr"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="yzbm">
  41. <a-input v-model="model.yzbm"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="bgdh">
  46. <a-input v-model="model.bgdh"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="sjh">
  51. <a-input v-model="model.sjh"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="cz">
  56. <a-input v-model="model.cz"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="dzyx">
  61. <a-input v-model="model.dzyx"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="zgbm">
  66. <a-input v-model="model.zgbm"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="txdz">
  71. <a-input v-model="model.txdz"placeholder="请输入通讯地址" ></a-input>
  72. </a-form-model-item>
  73. </a-col>
  74. </a-row>
  75. </a-form-model>
  76. </a-spin>
  77. </j-modal>
  78. </template>
  79. <script>
  80. import { httpAction } from '@/api/manage'
  81. import { validateDuplicateValue } from '@/utils/util'
  82. export default {
  83. name: "RmAxzyxmbModal",
  84. components: {
  85. },
  86. props:{
  87. mainId:{
  88. type:String,
  89. required:false,
  90. default:''
  91. }
  92. },
  93. data () {
  94. return {
  95. title:"操作",
  96. width:800,
  97. visible: false,
  98. model:{
  99. },
  100. labelCol: {
  101. xs: { span: 24 },
  102. sm: { span: 5 },
  103. },
  104. wrapperCol: {
  105. xs: { span: 24 },
  106. sm: { span: 16 },
  107. },
  108. confirmLoading: false,
  109. validatorRules: {
  110. },
  111. url: {
  112. add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmAxzyxmb",
  113. edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmAxzyxmb",
  114. }
  115. }
  116. },
  117. created () {
  118. //备份model原始值
  119. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  120. },
  121. methods: {
  122. add () {
  123. this.edit(this.modelDefault);
  124. },
  125. edit (record) {
  126. this.model = Object.assign({}, record);
  127. this.visible = true;
  128. },
  129. close () {
  130. this.$emit('close');
  131. this.visible = false;
  132. this.$refs.form.clearValidate();
  133. },
  134. handleOk () {
  135. const that = this;
  136. // 触发表单验证
  137. this.$refs.form.validate(valid => {
  138. if (valid) {
  139. that.confirmLoading = true;
  140. let httpurl = '';
  141. let method = '';
  142. if(!this.model.id){
  143. httpurl+=this.url.add;
  144. method = 'post';
  145. }else{
  146. httpurl+=this.url.edit;
  147. method = 'post';
  148. }
  149. this.model['mainId'] = this.mainId
  150. httpAction(httpurl,this.model,method).then((res)=>{
  151. if(res.success){
  152. that.$message.success(res.message);
  153. that.$emit('ok');
  154. }else{
  155. that.$message.warning(res.message);
  156. }
  157. }).finally(() => {
  158. that.confirmLoading = false;
  159. that.close();
  160. })
  161. }else{
  162. return false
  163. }
  164. })
  165. },
  166. handleCancel () {
  167. this.close()
  168. },
  169. }
  170. }
  171. </script>