123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <template>
- <a-spin :spinning="confirmLoading">
- <j-form-container :disabled="formDisabled">
- <!-- 主表单区域 -->
- <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="xmmc">
- <a-input v-model="model.xmmc" placeholder="请输入项目名称" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="项目类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xmlx">
- <j-dict-select-tag type="list" v-model="model.xmlx" dictCode="xmlx" placeholder="请选择项目类型" />
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="所在河流" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="szhl">
- <a-input v-model="model.szhl" placeholder="所在河流" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
- <j-area-linkage type="cascader" v-model="model.xzqh" placeholder="请输入省市区" />
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <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="12" >
- <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="12" >
- <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dha">
- <a-input v-model="model.dha" placeholder="请输入电话" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <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="12" >
- <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="12" >
- <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-col :span="12" >
- <a-form-model-item label="审批状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spzt">
- <j-dict-select-tag type="list" v-model="model.spzt" dictCode="spzt" placeholder="请选择审批状态" />
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="批复年度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pfnd">
- <a-input v-model="model.pfnd" placeholder="请输入批复年度" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="开工年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kgny">
- <a-input v-model="model.kgny" placeholder="请输入开工年月" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="建成年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jcny">
- <a-input v-model="model.jcny" placeholder="请输入建成年月" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="工期计划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gqjh">
- <a-input v-model="model.gqjh" placeholder="请输入工期计划" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="是否为评估保留项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfwpgblxm">
- <j-dict-select-tag type="list" v-model="model.sfwpgblxm" dictCode="yn" placeholder="请选择是否为评估保留项目" />
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="管理单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gldw">
- <a-input v-model="model.gldw" placeholder="请输入管理单位" ></a-input>
- </a-form-model-item>
- </a-col>
- <a-col :span="12" >
- <a-form-model-item label="主管部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zgbm">
- <a-input v-model="model.zgbm" placeholder="请输入主管部门" ></a-input>
- </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-row>
- </a-form-model>
- </j-form-container>
- <!-- 子表单区域 -->
- <a-tabs v-model="activeKey" @change="handleChangeTabs">
- <a-tab-pane tab="监管记录" :key="refKeys[0]" :forceRender="true">
- <j-editable-table
- :ref="refKeys[0]"
- :loading="rmJgjlbTable.loading"
- :columns="rmJgjlbTable.columns"
- :dataSource="rmJgjlbTable.dataSource"
- :maxHeight="300"
- :disabled="formDisabled"
- :rowNumber="true"
- :rowSelection="true"
- :actionButton="true"/>
- </a-tab-pane>
- </a-tabs>
- </a-spin>
- </template>
- <script>
- import { getAction } from '@/api/manage'
- import { FormTypes,getRefPromise,VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
- import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
- import { validateDuplicateValue } from '@/utils/util'
- export default {
- name: 'RmShxmxxbForm',
- mixins: [JEditableTableModelMixin],
- components: {
- },
- data() {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 6 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- labelCol2: {
- xs: { span: 24 },
- sm: { span: 3 },
- },
- wrapperCol2: {
- xs: { span: 24 },
- sm: { span: 20 },
- },
- model:{
- },
- // 新增时子表默认添加几行空数据
- addDefaultRowNum: 1,
- validatorRules: {
- xmmc:[
- { required: true, message: '请输入项目名称!'},
- ],
- xmlx:[
- { required: true, message: '请输入项目类型!'},
- ],
- jszt:[{
- required: true, message: '请输入建设状态!'
- }]
- },
- refKeys: ['rmJgjlb', ],
- tableKeys:['rmJgjlb', ],
- activeKey: 'rmJgjlb',
- // 监管记录
- rmJgjlbTable: {
- loading: false,
- dataSource: [],
- columns: [
- {
- title: '建设项目名称',
- key: 'jsxmmc',
- type: FormTypes.input,
- width:"200px",
- placeholder: '请输入${title}',
- defaultValue:'',
- },
- {
- title: '建设项目所在地',
- key: 'jsxmszd',
- type: FormTypes.input,
- width:"200px",
- placeholder: '请输入${title}',
- defaultValue:'',
- },
- {
- title: '施工现场是否符合要求',
- key: 'sgxcsffhyq',
- type: FormTypes.input,
- dictCode:"yn",
- width:"200px",
- placeholder: '请输入${title}',
- defaultValue:'',
- },
- {
- title: '建设情况',
- key: 'jsqk',
- type: FormTypes.select,
- dictCode:"gcjsqk",
- width:"200px",
- placeholder: '请输入${title}',
- defaultValue:'',
- },
- {
- title: '存在问题及处理情况',
- key: 'czwtjclqk',
- type: FormTypes.input,
- width:"200px",
- placeholder: '请输入${title}',
- defaultValue:'',
- },
- ]
- },
- url: {
- add: "/hzz.shjsgc.shxmxx/rmShxmxxb/add",
- edit: "/hzz.shjsgc.shxmxx/rmShxmxxb/edit",
- queryById: "/hzz.shjsgc.shxmxx/rmShxmxxb/queryById",
- rmJgjlb: {
- list: '/hzz.shjsgc.shxmxx/rmShxmxxb/queryRmJgjlbByMainId'
- },
- }
- }
- },
- props: {
- //表单禁用
- disabled: {
- type: Boolean,
- default: false,
- required: false
- }
- },
- computed: {
- formDisabled(){
- return this.disabled
- },
- },
- created () {
- },
- methods: {
- addBefore(){
- this.rmJgjlbTable.dataSource=[]
- },
- getAllTable() {
- let values = this.tableKeys.map(key => getRefPromise(this, key))
- return Promise.all(values)
- },
- /** 调用完edit()方法之后会自动调用此方法 */
- editAfter() {
- this.$nextTick(() => {
- })
- // 加载子表数据
- if (this.model.id) {
- let params = { id: this.model.id }
- this.requestSubTableData(this.url.rmJgjlb.list, params, this.rmJgjlbTable)
- }
- },
- //校验所有一对一子表表单
- validateSubForm(allValues){
- return new Promise((resolve,reject)=>{
- Promise.all([
- ]).then(() => {
- resolve(allValues)
- }).catch(e => {
- if (e.error === VALIDATE_NO_PASSED) {
- // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
- this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
- } else {
- console.error(e)
- }
- })
- })
- },
- /** 整理成formData */
- classifyIntoFormData(allValues) {
- let main = Object.assign(this.model, allValues.formValue)
- return {
- ...main, // 展开
- rmJgjlbList: allValues.tablesValue[0].values,
- }
- },
- validateError(msg){
- this.$message.error(msg)
- },
- }
- }
- </script>
- <style scoped>
- </style>
|