cuijian
2023-10-25 fa921a7f2a42a4215299b79a995aad18a6225f74
src/views/eam/modules/documentType/DocumentTypeModal.vue
@@ -18,7 +18,7 @@
        <a-row>
          <a-col :span='24'>
            <a-form-item label='文档类型编码' :labelCol='labelCol' :wrapperCol='wrapperCol'>
              <a-input placeholder='请输入文档类型编码' v-decorator="['num', validatorRules.num]"></a-input>
              <a-input placeholder='将由系统自动生成' v-decorator="['num', validatorRules.num]" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span='24'>
@@ -60,7 +60,7 @@
<script>
import pick from 'lodash.pick'
import { postAction, requestPut } from '@/api/manage'
import { getAction,postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
@@ -107,7 +107,8 @@
      url: {
        add: '/momEamDocumentType/add',
        edit: '/momEamDocumentType/edit',
        queryById: '/momEamDocumentType/queryById'
        queryById: '/momEamDocumentType/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ''
@@ -129,10 +130,17 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark'))
      })
      if (record.id) {
      if (this.model.id) {
        this.codeDisable = true
      } else {
        this.codeDisable = false
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'DocumentType', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },