123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <j-modal
- :title="title"
- :width="width"
- :visible="visible"
- :confirmLoading="confirmLoading"
- switchFullscreen
- @ok="handleOk"
- :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
- @cancel="handleCancel"
- cancelText="关闭">
- <a-spin :spinning="confirmLoading">
- <j-form-container :disabled="disableSubmit">
- <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
- <a-row>
- <a-col :span="24">
- <a-form-model-item label="工程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmmc">
- <j-popup placeholder="请选择涉河部分工程信息中的工程名称!"
- v-model="model.xmmc"
- field="xmmc"
- org-fields="gcmc"
- dest-fields="xmmc"
- code="shlx"
- :multi="true"
- :param="tempParam"
- @input="popupCallback"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="影响情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxcs">
- <!-- <a-input v-model="model.yxcs"placeholder="请输入影响情况" ></a-input>-->
- <a-textarea v-model="model.yxcs" placeholder="请输入存在问题及处理情况" rows="10" cols="94" />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="措施" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cs">
- <!-- <a-input v-model="model.cs"placeholder="请输入措施" ></a-input>-->
- <a-textarea v-model="model.cs" placeholder="请输入措施" rows="10" cols="94" />
- </a-form-model-item>
- </a-col>
- </a-row>
- </a-form-model>
- </j-form-container>
- </a-spin>
- </j-modal>
- </template>
- <script>
- import { httpAction } from '@/api/manage'
- import { validateDuplicateValue } from '@/utils/util'
- export default {
- name: "RmYxqkModal",
- components: {
- },
- props:{
- mainId:{
- type:String,
- required:false,
- default:''
- },
- },
- data () {
- return {
- title:"操作",
- width:800,
- visible: false,
- model:{
- },
- tempParam:{},
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 },
- },
- disableSubmit:false,
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- confirmLoading: false,
- validatorRules: {
- },
- url: {
- add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmYxqk",
- edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmYxqk",
- }
- }
- },
- created () {
- //备份model原始值
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
- // this.modelDefault.xmmc = this.xmmc;
- },
- methods: {
- add () {
- this.tempParam={main_id:this.mainId}
- this.edit(this.modelDefault);
- },
- edit (record) {
- this.tempParam={main_id:this.mainId}
- this.model = Object.assign({}, record);
- this.visible = true;
- },
- close () {
- this.$emit('close');
- this.visible = false;
- this.$refs.form.clearValidate();
- },
- handleOk () {
- const that = this;
- // 触发表单验证
- this.$refs.form.validate(valid => {
- if (valid) {
- that.confirmLoading = true;
- let httpurl = '';
- let method = '';
- if(!this.model.id){
- httpurl+=this.url.add;
- method = 'post';
- }else{
- httpurl+=this.url.edit;
- method = 'post';
- }
- this.model['mainId'] = this.mainId
- httpAction(httpurl,this.model,method).then((res)=>{
- if(res.success){
- that.$message.success(res.message);
- that.$emit('ok');
- }else{
- that.$message.warning(res.message);
- }
- }).finally(() => {
- that.confirmLoading = false;
- that.close();
- })
- }else{
- return false
- }
- })
- },
- handleCancel () {
- this.close()
- },
- popupCallback(value,row){
- this.model = Object.assign(this.model, row);
- },
- }
- }
- </script>
|