123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <j-modal
- :title="title"
- :width="width"
- :visible="visible"
- :confirmLoading="confirmLoading"
- switchFullscreen
- @ok="handleOk"
- @cancel="handleCancel"
- cancelText="关闭">
- <a-spin :spinning="confirmLoading">
- <a-form-model ref="form" :model="model" :rules="validatorRules">
- <a-row>
- <a-col :span="24">
- <a-form-model-item label="年度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nd">
- <a-input v-model="model.nd"placeholder="请输入年度" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="措施类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cslb">
- <j-dict-select-tag type="list" v-model="model.cslb" dictCode="lb" placeholder="请选择措施类别" />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="措施内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="csnr">
- <a-input v-model="model.csnr"placeholder="请输入措施内容" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="牵头部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qtbm">
- <a-input v-model="model.qtbm"placeholder="请输入牵头部门" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="牵头事项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qtsx">
- <a-input v-model="model.qtsx"placeholder="请输入牵头事项" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="配合部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phbm">
- <a-input v-model="model.phbm"placeholder="请输入配合部门" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="配合事项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phsx">
- <a-input v-model="model.phsx"placeholder="请输入配合事项" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="监督部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdbm">
- <a-input v-model="model.jdbm"placeholder="请输入监督部门" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="监督部门责任事项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jdbmzrsx">
- <a-input v-model="model.jdbmzrsx"placeholder="请输入监督部门责任事项" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="意见/备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yjbz">
- <a-input v-model="model.yjbz"placeholder="请输入意见/备注" ></a-input>
- </a-form-model-item>
- </a-col>
- </a-row>
- </a-form-model>
- </a-spin>
- </j-modal>
- </template>
- <script>
- import { httpAction } from '@/api/manage'
- import { validateDuplicateValue } from '@/utils/util'
- export default {
- name: "RmZrycsqdModal",
- components: {
- },
- props:{
- mainId:{
- type:String,
- required:false,
- default:''
- }
- },
- data () {
- return {
- title:"操作",
- width:800,
- visible: false,
- model:{
- },
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- confirmLoading: false,
- validatorRules: {
- },
- url: {
- add: "/hzz.yhyc/rmJbxx/addRmZrycsqd",
- edit: "/hzz.yhyc/rmJbxx/editRmZrycsqd",
- }
- }
- },
- created () {
- //备份model原始值
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
- },
- methods: {
- add () {
- this.edit(this.modelDefault);
- },
- edit (record) {
- 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 = 'put';
- 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()
- },
- }
- }
- </script>
|