522bfcde44a23f3c8b0d4bcd707c0fe2840c38f1.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. switchFullscreen
  8. @ok="handleOk"
  9. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  10. @cancel="handleCancel"
  11. cancelText="关闭">
  12. <a-spin :spinning="confirmLoading">
  13. <j-form-container :disabled="disableSubmit">
  14. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  15. <a-row>
  16. <a-col :span="24">
  17. <a-form-model-item label="工程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmmc">
  18. <j-popup placeholder="请选择涉河部分工程信息中的工程名称!"
  19. v-model="model.xmmc"
  20. field="xmmc"
  21. org-fields="gcmc"
  22. dest-fields="xmmc"
  23. code="shlx"
  24. :multi="true"
  25. :param="tempParam"
  26. @input="popupCallback"
  27. />
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :span="24">
  31. <a-form-model-item label="影响情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxcs">
  32. <!-- <a-input v-model="model.yxcs"placeholder="请输入影响情况" ></a-input>-->
  33. <a-textarea v-model="model.yxcs" placeholder="请输入存在问题及处理情况" rows="10" cols="94" />
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :span="24">
  37. <a-form-model-item label="措施" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cs">
  38. <!-- <a-input v-model="model.cs"placeholder="请输入措施" ></a-input>-->
  39. <a-textarea v-model="model.cs" placeholder="请输入措施" rows="10" cols="94" />
  40. </a-form-model-item>
  41. </a-col>
  42. </a-row>
  43. </a-form-model>
  44. </j-form-container>
  45. </a-spin>
  46. </j-modal>
  47. </template>
  48. <script>
  49. import { httpAction } from '@/api/manage'
  50. import { validateDuplicateValue } from '@/utils/util'
  51. export default {
  52. name: "RmYxqkModal",
  53. components: {
  54. },
  55. props:{
  56. mainId:{
  57. type:String,
  58. required:false,
  59. default:''
  60. },
  61. },
  62. data () {
  63. return {
  64. title:"操作",
  65. width:800,
  66. visible: false,
  67. model:{
  68. },
  69. tempParam:{},
  70. labelCol: {
  71. xs: { span: 24 },
  72. sm: { span: 5 },
  73. },
  74. disableSubmit:false,
  75. wrapperCol: {
  76. xs: { span: 24 },
  77. sm: { span: 16 },
  78. },
  79. confirmLoading: false,
  80. validatorRules: {
  81. },
  82. url: {
  83. add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmYxqk",
  84. edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmYxqk",
  85. }
  86. }
  87. },
  88. created () {
  89. //备份model原始值
  90. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  91. // this.modelDefault.xmmc = this.xmmc;
  92. },
  93. methods: {
  94. add () {
  95. this.tempParam={main_id:this.mainId}
  96. this.edit(this.modelDefault);
  97. },
  98. edit (record) {
  99. this.tempParam={main_id:this.mainId}
  100. this.model = Object.assign({}, record);
  101. this.visible = true;
  102. },
  103. close () {
  104. this.$emit('close');
  105. this.visible = false;
  106. this.$refs.form.clearValidate();
  107. },
  108. handleOk () {
  109. const that = this;
  110. // 触发表单验证
  111. this.$refs.form.validate(valid => {
  112. if (valid) {
  113. that.confirmLoading = true;
  114. let httpurl = '';
  115. let method = '';
  116. if(!this.model.id){
  117. httpurl+=this.url.add;
  118. method = 'post';
  119. }else{
  120. httpurl+=this.url.edit;
  121. method = 'post';
  122. }
  123. this.model['mainId'] = this.mainId
  124. httpAction(httpurl,this.model,method).then((res)=>{
  125. if(res.success){
  126. that.$message.success(res.message);
  127. that.$emit('ok');
  128. }else{
  129. that.$message.warning(res.message);
  130. }
  131. }).finally(() => {
  132. that.confirmLoading = false;
  133. that.close();
  134. })
  135. }else{
  136. return false
  137. }
  138. })
  139. },
  140. handleCancel () {
  141. this.close()
  142. },
  143. popupCallback(value,row){
  144. this.model = Object.assign(this.model, row);
  145. },
  146. }
  147. }
  148. </script>