123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <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="xmmc">
- <a-input v-model="model.xmmc"placeholder="请输入项目名称" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="所在水系" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="szsx">
- <j-dict-select-tag type="list" v-model="model.szsx" dictCode="szsx" placeholder="请选择所在水系" />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
- <a-input v-model="model.xzqh"placeholder="请输入行政区划" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="县级区划代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xjqhdm">
- <a-input v-model="model.xjqhdm"placeholder="请输入县级区划代码" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="横坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hzb">
- <a-input v-model="model.hzb"placeholder="请输入横坐标" style="width: 100%" />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="纵坐标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zzb">
- <a-input v-model="model.zzb"placeholder="请输入纵坐标" style="width: 100%" />
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="项目负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmfzr">
- <a-input v-model="model.xmfzr"placeholder="请输入项目负责人" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dh">
- <a-input v-model="model.dh"placeholder="请输入电话" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="立项情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lxqk">
- <a-input v-model="model.lxqk"placeholder="请输入立项情况" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="防洪标准" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fhbz">
- <a-input v-model="model.fhbz"placeholder="请输入防洪标准" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="总体布置简述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ztbzjs">
- <a-input v-model="model.ztbzjs"placeholder="请输入总体布置简述" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="其他" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qt">
- <a-input v-model="model.qt"placeholder="请输入其他" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="24">
- <a-form-model-item label="建设状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jszt">
- <j-dict-select-tag type="list" v-model="model.jszt" dictCode="gcjsqk" placeholder="请选择建设状态" />
- </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: "RmAxxmxxModal",
- 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.axgh.axzyxm/rmAxzyxmb/addRmAxxmxx",
- edit: "/hzz.axgh.axzyxm/rmAxzyxmb/editRmAxxmxx",
- }
- }
- },
- 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 = '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>
|