cuijian
2023-10-25 fa921a7f2a42a4215299b79a995aad18a6225f74
各模块编码自动生成功能
已修改26个文件
470 ■■■■■ 文件已修改
src/views/eam/modules/documentType/DocumentTypeModal.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentScrap/EquipmentScrapForm.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentUnseal/EquipmentUnsealForm.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/faultCause/FaultCauseModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/faultType/FaultTypeModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/maintenanceSpecialty/MaintenanceSpecialtyModal.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificate/OperationCertificateForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/precisionParameter/PrecisionParametersCategoryModel.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/precisionParameter/PrecisionParametersModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/precisionParametersTemplate/PrecisionParametersTemplateModel.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/processParameters/ProcessParametersCategoryModel.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/processParameters/ProcessParametersModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/processParametersTemplate/ProcessParametersTemplateModel.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/riskPrevention/RiskPreventionForm.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/riskPrevention/RiskPreventionModal.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/AreaModel.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/ProductionLineModel.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/SiteModel.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/transferMethod/TransferMethodModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePart/SparePartModel.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 });
            }
          })
        });
      }
    },
src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue
@@ -54,8 +54,8 @@
            >
              <a-input
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请输入设备分类编号'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -239,7 +239,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'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@@ -305,7 +305,8 @@
      url: {
        add: "/eam/equipmentCategory/add",
        edit: "/eam/equipmentCategory/edit",
        list: "/eam/equipmentCategory/getAllChildren"
        list: "/eam/equipmentCategory/getAllChildren",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      columns: [
        {
@@ -416,6 +417,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'EquipmentCategory', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/equipmentScrap/EquipmentScrapForm.vue
@@ -23,6 +23,7 @@
              <a-input
                v-model="model.num"
                placeholder="将由系统自动生成"
                disabled
              ></a-input>
            </a-form-model-item>
          </a-col>
@@ -455,17 +456,8 @@
    })
  },
  created() {
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'EquipmentScrap', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
    },
    //选择设备
    selectEquipmentList() {
@@ -530,6 +522,12 @@
      if (this.model.id) {
        let params = { equipmentChangeId: this.model.id }
        this.requestSubTableData(this.url.equipmentScrapDetail.list, params, this.equipmentScrapDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'EquipmentScrap', length: '4' }).then((res) => {
          if (res.success) {
            this.model.num = res.message
          }
        })
      }
    },
    //校验所有一对一子表表单
@@ -608,39 +606,39 @@
      target.removeRows(rowId)
    },
    // 重写add  方法 默认不增加一行
    add(num = 0, forceScrollToBottom = false) {
      if (num < 1) return
      // let timestamp = new Date().getTime()
      let rows = this.rows
      let row
      for (let i = 0; i < num; i++) {
        rows = this.push({}, false, rows)
        row = rows[rows.length - 1]
      }
      this.rows = rows
    // add(num = 0, forceScrollToBottom = false) {
    //   if (num < 1) return
    //   // let timestamp = new Date().getTime()
    //   let rows = this.rows
    //   let row
    //   for (let i = 0; i < num; i++) {
    //     rows = this.push({}, false, rows)
    //     row = rows[rows.length - 1]
    //   }
    //   this.rows = rows
      this.$nextTick(() => {
        this.updateFormValues()
      })
      // 触发add事件
      this.$emit('added', {
        row: (() => {
          let r = Object.assign({}, row)
          r.id = this.getCleanId(r.id)
          return r
        })(),
        target: this
      })
      // 设置滚动条位置
      let tbody = this.getElement('tbody')
      let offsetHeight = tbody.offsetHeight
      let realScrollTop = tbody.scrollTop + offsetHeight
      if (forceScrollToBottom) {
        this.$nextTick(() => {
          this.resetScrollTop(this.$refs.scrollView.scrollHeight)
        })
      }
    }
    //   this.$nextTick(() => {
    //     this.updateFormValues()
    //   })
    //   // 触发add事件
    //   this.$emit('added', {
    //     row: (() => {
    //       let r = Object.assign({}, row)
    //       r.id = this.getCleanId(r.id)
    //       return r
    //     })(),
    //     target: this
    //   })
    //   // 设置滚动条位置
    //   let tbody = this.getElement('tbody')
    //   let offsetHeight = tbody.offsetHeight
    //   let realScrollTop = tbody.scrollTop + offsetHeight
    //   if (forceScrollToBottom) {
    //     this.$nextTick(() => {
    //       this.resetScrollTop(this.$refs.scrollView.scrollHeight)
    //     })
    //   }
    // }
  }
}
src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue
@@ -19,6 +19,7 @@
              <a-input
                v-model="model.num"
                placeholder="将由系统自动生成"
                disabled
              ></a-input>
            </a-form-model-item>
          </a-col>
@@ -113,6 +114,7 @@
import { validateDuplicateValue } from '@/utils/util'
// import EquipmentSelection from '@/components/tools/EquipmentSelection.vue'
import EquipmentSelectModal from './EquipmentSelectModal.vue'
import { getAction, postAction, requestPut } from '@api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
@@ -378,7 +380,6 @@
    }
  },
  created() {
    this.initNum()
  },
  mounted() {
    this.$bus.$on('selectionRows', (data) => {
@@ -389,13 +390,6 @@
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'EquipmentSeal', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
    },
    handleChange(value, data) {
      this.$nextTick(() => {
        this.$set(data, 'maintenanceAfterUnseal', data.maintenanceAfterUnseal)
@@ -476,6 +470,12 @@
      if (this.model.id) {
        let params = { equipmentChangeId: this.model.id }
        this.requestSubTableData(this.url.equipmentSealDetail.list, params, this.equipmentSealDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'EquipmentSeal', length: '4' }).then((res) => {
          if (res.success) {
            this.model.num = res.message
          }
        })
      }
    },
    //校验所有一对一子表表单
src/views/eam/modules/equipmentUnseal/EquipmentUnsealForm.vue
@@ -19,6 +19,7 @@
              <a-input
                v-model="model.num"
                placeholder="将由系统自动生成"
                disabled
              ></a-input>
            </a-form-model-item>
          </a-col>
@@ -414,17 +415,9 @@
    })
  },
  created() {
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'EquipmentUnseal', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
    },
    //选择设备
    selectEquipmentList() {
      let ids = []
@@ -488,6 +481,12 @@
      if (this.model.id) {
        let params = { equipmentChangeId: this.model.id }
        this.requestSubTableData(this.url.equipmentUnsealDetail.list, params, this.equipmentUnsealDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'EquipmentUnseal', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
      }
    },
    //校验所有一对一子表表单
src/views/eam/modules/faultCause/FaultCauseModel.vue
@@ -53,9 +53,9 @@
              :wrapperCol="wrapperCol"
            >
              <a-input
                :disabled="disableSubmit"
                :disabled="true"
                allow-clear
                :placeholder="disableSubmit?'':'请输入故障原因编号'"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -124,7 +124,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 {
@@ -170,7 +170,8 @@
      },
      url: {
        add: "/eam/faultCause/add",
        edit: "/eam/faultCause/edit"
        edit: "/eam/faultCause/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
@@ -196,6 +197,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'FaultCause', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/faultType/FaultTypeModel.vue
@@ -54,8 +54,8 @@
            >
              <a-input
                allow-clear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入故障类型编号'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -124,7 +124,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 {
@@ -170,7 +170,8 @@
      },
      url: {
        add: "/eam/faultType/add",
        edit: "/eam/faultType/edit"
        edit: "/eam/faultType/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
@@ -196,6 +197,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'FaultType', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/maintenanceSpecialty/MaintenanceSpecialtyModal.vue
@@ -24,8 +24,9 @@
            >
              <a-input
                allow-clear
                :placeholder="'请输入维保专业编码'"
                :placeholder="'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
                disabled
              />
            </a-form-item>
          </a-col>
@@ -85,7 +86,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 {
@@ -132,7 +133,8 @@
      url: {
        add: '/maintenanceSpecialty/maintenanceSpecialty/add',
        edit: '/maintenanceSpecialty/maintenanceSpecialty/edit',
        queryById: '/maintenanceSpecialty/maintenanceSpecialty/queryById'
        queryById: '/maintenanceSpecialty/maintenanceSpecialty/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ''
@@ -154,10 +156,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: 'MaintenanceSpecialty', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/operationCertificate/OperationCertificateForm.vue
@@ -6,7 +6,7 @@
        <a-row>
          <a-col :span='12'>
            <a-form-model-item label='操作证编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'>
              <a-input v-model='model.num' placeholder='请输入操作证编号'></a-input>
              <a-input v-model='model.num' placeholder='请输入操作证编号' disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
@@ -6,7 +6,7 @@
        <a-row>
          <a-col :span='12'>
            <a-form-model-item label='申请单编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'>
              <a-input v-model='model.num' placeholder="将由系统生成"></a-input>
              <a-input v-model='model.num' placeholder="将由系统生成" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
@@ -238,17 +238,9 @@
    }
  },
  created() {
    this.initNum()
  },
  methods: {
    initNum(){
      getAction(this.url.getNum, { type: 'OperationCertificateApply', length: '4' }).then((res) => {
            if (res.success) {
              this.model.num = res.message
            }
          })
    },
    addBefore() {
      this.operationCertificateApplyDetailTable.dataSource = []
    },
@@ -264,6 +256,12 @@
      if (this.model.id) {
        let params = { id: this.model.id }
        this.requestSubTableData(this.url.operationCertificateApplyDetail.list, params, this.operationCertificateApplyDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'OperationCertificateApply', length: '4' }).then((res) => {
            if (res.success) {
              this.model.num = res.message
            }
          })
      }
    },
    //校验所有一对一子表表单
src/views/eam/modules/precisionParameter/PrecisionParametersCategoryModel.vue
@@ -46,8 +46,9 @@
            >
              <a-input
                allow-clear
                placeholder="请输入参数分类编号"
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
                disabled
              />
            </a-form-item>
          </a-col>
@@ -161,6 +162,7 @@
        add: "/eam/precisionParametersCategory/add",
        edit: "/eam/precisionParametersCategory/edit",
        loadPrecisionParametersCategoryTree: '/eam/precisionParametersCategory/loadTree',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      precisionParametersCategoryTree: [],
    }
@@ -198,6 +200,15 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'parentId', 'num', 'name', 'remark'));
      });
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'PrecisionParametersCategory', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    handleOk() {
src/views/eam/modules/precisionParameter/PrecisionParametersModel.vue
@@ -56,8 +56,8 @@
            >
              <a-input
                allow-clear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入精度参数编号'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -126,7 +126,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 {
@@ -177,7 +177,8 @@
      },
      url: {
        add: "/eam/precisionParameters/add",
        edit: "/eam/precisionParameters/edit"
        edit: "/eam/precisionParameters/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
@@ -203,6 +204,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'PrecisionParameters', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/precisionParametersTemplate/PrecisionParametersTemplateModel.vue
@@ -22,8 +22,8 @@
            >
              <a-input
                allowClear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入精度参数模板编码'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="[ 'num', validatorRules.num]"
              />
            </a-form-item>
@@ -214,6 +214,7 @@
        add: "/eam/precisionParametersTemplate/add",
        edit: "/eam/precisionParametersTemplate/edit",
        loadTree: "/eam/precisionParameters/loadTree",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      treeData: [],
      TemplateDetailDataSource: [],
@@ -275,6 +276,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'PrecisionParametersTemplate', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/processParameters/ProcessParametersCategoryModel.vue
@@ -46,8 +46,9 @@
            >
              <a-input
                allow-clear
                placeholder="请输入参数分类编号"
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
                disabled
              />
            </a-form-item>
          </a-col>
@@ -161,6 +162,7 @@
        add: "/eam/processParametersCategory/add",
        edit: "/eam/processParametersCategory/edit",
        loadProcessParametersCategoryTree: '/eam/processParametersCategory/loadTree',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      processParametersCategoryTree: [],
    }
@@ -198,6 +200,15 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'parentId', 'num', 'name', 'remark'));
      });
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'ProcessParametersCategory', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    handleOk() {
src/views/eam/modules/processParameters/ProcessParametersModel.vue
@@ -56,8 +56,8 @@
            >
              <a-input
                allow-clear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入工艺参数编号'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -126,7 +126,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 {
@@ -177,7 +177,8 @@
      },
      url: {
        add: "/eam/processParameters/add",
        edit: "/eam/processParameters/edit"
        edit: "/eam/processParameters/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
@@ -203,6 +204,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'ProcessParameters', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/processParametersTemplate/ProcessParametersTemplateModel.vue
@@ -22,8 +22,8 @@
            >
              <a-input
                allowClear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入工艺参数模板编码'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="[ 'num', validatorRules.num]"
              />
            </a-form-item>
@@ -211,6 +211,7 @@
        add: "/eam/processParametersTemplate/add",
        edit: "/eam/processParametersTemplate/edit",
        loadTree: "/eam/processParameters/loadTree",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      treeData: [],
      TemplateDetailDataSource: [],
@@ -268,6 +269,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'ProcessParametersTemplate', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/riskPrevention/RiskPreventionForm.vue
@@ -5,7 +5,7 @@
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="危险源编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
              <a-input v-model="model.num" placeholder="请输入危险源编码"  ></a-input>
              <a-input v-model="model.num" placeholder="将由系统自动生成"  disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
@@ -77,7 +77,8 @@
      url: {
        add: '/eam/riskPrevention/add',
        edit: '/eam/riskPrevention/edit',
        queryById: '/eam/riskPrevention/queryById'
        queryById: '/eam/riskPrevention/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
      }
    }
  },
@@ -97,6 +98,15 @@
    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'RiskPrevention', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    submitForm() {
      const that = this
src/views/eam/modules/riskPrevention/RiskPreventionModal.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'>
@@ -70,7 +70,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 {
@@ -117,7 +117,8 @@
      url: {
        add: '/eam/riskPrevention/add',
        edit: '/eam/riskPrevention/edit',
        queryById: '/eam/riskPrevention/queryById'
        queryById: '/eam/riskPrevention/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ''
@@ -139,10 +140,17 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark','description','measure'))
      })
      if (record.id) {
      if (this.model.id) {
        this.codeDisable = true
      } else {
        this.codeDisable = false
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'RiskPrevention', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/eam/modules/site/AreaModel.vue
@@ -21,9 +21,9 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="disableSubmit"
                :readOnly="true"
                allow-clear
                placeholder="请输入工区编号"
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -105,7 +105,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 {
@@ -159,7 +159,8 @@
      },
      url: {
        add: "/base/area/add",
        edit: "/base/area/edit"
        edit: "/base/area/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
@@ -180,6 +181,15 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'teamId', 'deptId', 'remark'))
      });
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'Area', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    close() {
      this.$emit('close');
src/views/eam/modules/site/ProductionLineModel.vue
@@ -21,9 +21,9 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="disableSubmit"
                :readOnly="true"
                allow-clear
                placeholder="请输入工段编号"
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -89,7 +89,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 {
@@ -138,7 +138,8 @@
      },
      url: {
        add: "/base/productionLine/add",
        edit: "/base/productionLine/edit"
        edit: "/base/productionLine/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
@@ -159,6 +160,15 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'shiftCategoryId', 'remark'))
      });
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'ProductionLine', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    close() {
      this.$emit('close');
src/views/eam/modules/site/SiteModel.vue
@@ -21,9 +21,9 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="disableSubmit"
                :readOnly="true"
                allow-clear
                placeholder="请输入工厂编号"
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -71,7 +71,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 {
@@ -114,7 +114,8 @@
      },
      url: {
        add: "/base/site/add",
        edit: "/base/site/edit"
        edit: "/base/site/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
@@ -135,6 +136,15 @@
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark'))
      });
      if (!record.id) {
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'Site', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    close() {
      this.$emit('close');
src/views/eam/modules/transferMethod/TransferMethodModel.vue
@@ -40,8 +40,8 @@
            >
              <a-input
                allow-clear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入增减方式编号'"
                :disabled="true"
                :placeholder="disableSubmit?'':'将由系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -110,7 +110,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 {
@@ -156,7 +156,8 @@
      },
      url: {
        add: "/eam/transferMethod/add",
        edit: "/eam/transferMethod/edit"
        edit: "/eam/transferMethod/edit",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
@@ -182,6 +183,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'TransferMethod', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/spare/modules/sparePart/SparePartModel.vue
@@ -25,6 +25,7 @@
              <a-input
                placeholder="将由系统生成"
                v-decorator="['num', validatorRules.num]"
                disabled
              />
            </a-form-item>
          </a-col>
@@ -378,13 +379,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        // this.$nextTick(() => {
        //   getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
        //     if (res.success) {
        //       this.form.setFieldsValue({ num: res.message });
        //     }
        //   })
        // });
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
@@ -396,19 +397,19 @@
    handleOk() {
      const that = this;
      // 触发表单验证
      this.form.validateFields(async (err, values) => {
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          if (!this.model.id) {
            if(!formData.num){
                await getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
                if (res.success) {
                  formData.num = res.message;
                }
              });
            }
            // if(!formData.num){
            //     await getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            //     if (res.success) {
            //       formData.num = res.message;
            //     }
            //   });
            // }
            formData.sparePartCategoryId = this.sparePartCategoryId
            obj = postAction(this.url.add, formData);
          } else {
src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue
@@ -374,18 +374,8 @@
  },
  created() {
    this.initOptions();
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'SparePartReceive', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
          /* this.model.setFieldsValue({ num: res.message }); */
        }
      })
    },
    getSysDeparts() {
      getAction(this.url.getSysDeparts).then((res) => {
        if (res.success) {
@@ -468,6 +458,12 @@
      if (this.model.id) {
        let params = { id: this.model.id }
        this.requestSubTableData(this.url.sparesReceiveDetail.list, params, this.sparesReceiveDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'SparePartReceive', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
      }
    },
    //校验所有一对一子表表单
src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue
@@ -426,16 +426,8 @@
  },
  created() {
    this.initOptions()
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'SparePartScrap', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
    },
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
@@ -523,6 +515,12 @@
      if (this.model.id) {
        let params = { id: this.model.id }
        this.requestSubTableData(this.url.sparesScrapDetail.list, params, this.sparesScrapDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'SparePartScrap', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
      }
    },
    //校验所有一对一子表表单
src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
@@ -338,7 +338,6 @@
  },
  created() {
    this.initOptions()
    this.initNum()
  },
  methods: {
@@ -380,16 +379,6 @@
            });
          }
        }, */
    initNum() {
      getAction(this.url.getNum, { type: 'SparePartRequirement', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
          /* this.model.setFieldsValue({ num: res.message }); */
        }
      })
    },
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
@@ -471,6 +460,12 @@
      if (this.model.id) {
        let params = { id: this.model.id }
        this.requestSubTableData(this.url.sparesScrapRequirementDetail.list, params, this.sparesScrapRequirementDetailTable)
      }else{
        getAction(this.url.getNum, { type: 'SparePartRequirement', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
        }
      })
      }
    },
    //校验所有一对一子表表单