123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <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="12">
- <a-form-model-item label="河道名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdmc">
- <a-input v-model="model.hdmc" placeholder="请输入河名称" disabled></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="河道编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdbm">
- <a-input v-model="model.hdbm" placeholder="请输入河道编码" disabled></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="流域面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lymj">
- <a-input v-model="model.lymj" placeholder="请输入流域面积" style="width: 100%"
- disabled/>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="数据与横断面信息中比降" :labelCol="labelCol" :wrapperCol="wrapperCol"
- prop="sjyhdmxxzbj">
- <a-input v-model="model.sjyhdmxxzbj" placeholder="请输入数据与横断面信息中比降"></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="河底高程" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdgc">
- <a-input v-model="model.hdgc" placeholder="请输入河底高程" style="width: 100%"/>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="堤顶高程" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ddgc">
- <a-input v-model="model.ddgc" placeholder="请输入堤顶高程" style="width: 100%"/>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bz">
- <a-input v-model="model.bz" placeholder="请输入备注"></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="河底纵断面" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hdzdm">
- <j-image-upload isMultiple v-model="model.hdzdm"></j-image-upload>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="堤防(河岸)纵断面" :labelCol="labelCol" :wrapperCol="wrapperCol"
- prop="dfzdm">
- <j-image-upload isMultiple v-model="model.dfzdm"></j-image-upload>
- </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: "RmZdmxxglModal",
- components: {},
- props: {
- mainId: {
- type: String,
- required: false,
- default: ''
- },
- hlmxInfo: {
- type: Object,
- required: false,
- default: {}
- }
- },
- data() {
- return {
- title: "操作",
- width: 1200,
- visible: false,
- model: {},
- labelCol: {
- xs: {span: 24},
- sm: {span: 5},
- },
- wrapperCol: {
- xs: {span: 24},
- sm: {span: 16},
- },
- disableSubmit: false,
- confirmLoading: false,
- validatorRules: {},
- url: {
- add: "/hzz.xxgl.hdmx/rmHdmxb/addRmZdmxxgl",
- edit: "/hzz.xxgl.hdmx/rmHdmxb/editRmZdmxxgl",
- }
- }
- },
- created() {
- //备份model原始值
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
- },
- methods: {
- add() {
- Object.assign(this.modelDefault, this.hlmxInfo);
- 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) {
- debugger
- 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['rvid'] = 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>
|