123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <j-modal
- :title="title"
- :width="width"
- :visible="visible"
- :confirmLoading="confirmLoading"
- :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
- switchFullscreen
- @ok="handleOk"
- @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="gcmc">
- <!-- <a-input v-model="model.gcmc"placeholder="请输入工程名称" ></a-input>-->
- <j-popup placeholder="请选择涉河部分工程信息中的工程名称!"
- v-model="model.gcmc"
- field="gcmc"
- org-fields="gcmc,shlx"
- dest-fields="gcmc,shlx"
- 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="gkxl">
- <a-input v-model="model.gkxl" placeholder="请输入工况序列"></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="阻水比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zsb">
- <a-input v-model="model.zsb" placeholder="请输入阻水比"></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="壅水高度及范围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ysgdjfw">
- <a-input-number v-model="model.ysgdjfw" placeholder="请输入壅水高度及范围" style="width: 100%"/>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="冲淤情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cyqk">
- <a-textarea v-model="model.cyqk" placeholder="请输入冲淤情况" rows="4"></a-textarea>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="影响情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxqk">
- <!-- <a-input v-model="model.yxqk" placeholder="请输入影响情况"></a-input>-->
- <a-textarea v-model="model.yxqk" placeholder="请输入影响情况" rows="4"></a-textarea>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="措施" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cs">
- <a-textarea v-model="model.cs" placeholder="请输入措施" rows="4"></a-textarea>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="其他" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qt">
- <a-textarea v-model="model.qt" placeholder="请输入其他" rows="4"></a-textarea>
- </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: "RmAxfxjszycgbModal",
- 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},
- },
- main_id: '',
- disableSubmit:false,
- confirmLoading: false,
- validatorRules: {},
- url: {
- add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmAxfxjszycgb",
- edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmAxfxjszycgb",
- },
- tempParam: {},
- }
- },
- created() {
- //备份model原始值
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
- },
- 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>
|