bc08313bf4a5f1b94aaad5def514bd3a5f4006ad.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="nd">
  16. <a-input v-model="model.nd"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="cslb">
  21. <j-dict-select-tag type="list" v-model="model.cslb" dictCode="lb" 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="csnr">
  26. <a-input v-model="model.csnr"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="qtbm">
  31. <a-input v-model="model.qtbm"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="qtsx">
  36. <a-input v-model="model.qtsx"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="phbm">
  41. <a-input v-model="model.phbm"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="phsx">
  46. <a-input v-model="model.phsx"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="jdbm">
  51. <a-input v-model="model.jdbm"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="jdbmzrsx">
  56. <a-input v-model="model.jdbmzrsx"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="yjbz">
  61. <a-input v-model="model.yjbz"placeholder="请输入意见/备注" ></a-input>
  62. </a-form-model-item>
  63. </a-col>
  64. </a-row>
  65. </a-form-model>
  66. </a-spin>
  67. </j-modal>
  68. </template>
  69. <script>
  70. import { httpAction } from '@/api/manage'
  71. import { validateDuplicateValue } from '@/utils/util'
  72. export default {
  73. name: "RmZrycsqdModal",
  74. components: {
  75. },
  76. props:{
  77. mainId:{
  78. type:String,
  79. required:false,
  80. default:''
  81. }
  82. },
  83. data () {
  84. return {
  85. title:"操作",
  86. width:800,
  87. visible: false,
  88. model:{
  89. },
  90. labelCol: {
  91. xs: { span: 24 },
  92. sm: { span: 5 },
  93. },
  94. wrapperCol: {
  95. xs: { span: 24 },
  96. sm: { span: 16 },
  97. },
  98. confirmLoading: false,
  99. validatorRules: {
  100. },
  101. url: {
  102. add: "/hzz.yhyc/rmJbxx/addRmZrycsqd",
  103. edit: "/hzz.yhyc/rmJbxx/editRmZrycsqd",
  104. }
  105. }
  106. },
  107. created () {
  108. //备份model原始值
  109. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  110. },
  111. methods: {
  112. add () {
  113. this.edit(this.modelDefault);
  114. },
  115. edit (record) {
  116. this.model = Object.assign({}, record);
  117. this.visible = true;
  118. },
  119. close () {
  120. this.$emit('close');
  121. this.visible = false;
  122. this.$refs.form.clearValidate();
  123. },
  124. handleOk () {
  125. const that = this;
  126. // 触发表单验证
  127. this.$refs.form.validate(valid => {
  128. if (valid) {
  129. that.confirmLoading = true;
  130. let httpurl = '';
  131. let method = '';
  132. if(!this.model.id){
  133. httpurl+=this.url.add;
  134. method = 'post';
  135. }else{
  136. httpurl+=this.url.edit;
  137. //method = 'put';
  138. method = 'post';
  139. }
  140. this.model['mainId'] = this.mainId
  141. httpAction(httpurl,this.model,method).then((res)=>{
  142. if(res.success){
  143. that.$message.success(res.message);
  144. that.$emit('ok');
  145. }else{
  146. that.$message.warning(res.message);
  147. }
  148. }).finally(() => {
  149. that.confirmLoading = false;
  150. that.close();
  151. })
  152. }else{
  153. return false
  154. }
  155. })
  156. },
  157. handleCancel () {
  158. this.close()
  159. },
  160. }
  161. }
  162. </script>