cuijian
2023-11-16 e0cd695c11734348e1e01304bdff0696768c1fda
src/views/eam/modules/specialtyInspectionPlan/SpecialtyInspectionPlanModal.vue
@@ -29,13 +29,13 @@
          </a-col>
          <a-col :span="12">
            <a-form-item
              label="对象部门"
              label="使用部门"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <!-- <a-select
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请选择对象部门'"
                :placeholder="disableSubmit?'':'请选择使用部门'"
                :options="this.departs"
                style="width: 100%"
                v-decorator="['departId', validatorRules.departId]"
@@ -43,7 +43,7 @@
              /> -->
              <a-input-search
                :disabled="disableSubmit"
                placeholder="请选择对象部门"
                placeholder="请选择使用部门"
                enter-button
                @search="onDepartList()"
                :read-only="true"
@@ -107,14 +107,14 @@
        >
          <a-col :span="12">
            <a-form-item
              label="对象部门Id"
              label="使用部门Id"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入对象部门id'"
                :placeholder="disableSubmit?'':'请输入使用部门id'"
                v-decorator="['departId', validatorRules.departId ]"
              />
            </a-form-item>
@@ -298,7 +298,7 @@
          dataIndex: 'version',
        },
        {
          title: '设备编码',
          title: '统一编码',
          align: 'center',
          dataIndex: 'equipmentNum'
        },
@@ -340,11 +340,11 @@
      form: this.$form.createForm(this),
      headers: {},
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入点检计划编码!' },
          ]
        },
        // num: {
        //   rules: [
        //     { required: true, message: '请输入点检计划编码!' },
        //   ]
        // },
        inspectionCycleId: {
          rules: [
            { required: true, message: '请选择点检周期!' },
@@ -352,7 +352,7 @@
        },
        useDepartName: {
          rules: [
            { required: true, message: '请选择对象部门!' },
            { required: true, message: '请选择使用部门!' },
          ]
        },
        assignMode: {
@@ -384,6 +384,7 @@
        listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType",
        getInspectionCycle: "/eam/inspectionStandardDetail/getInspectionCycle",
        // getSysDeparts: "/eam/specialtyInspectionPlan/getSysDeparts",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      dataSource: [],
      //用于展示文件
@@ -419,7 +420,7 @@
    selectInspectionProjects: function () {
      let dataDepartId = this.form.getFieldsValue(['departId']);
      if (dataDepartId.departId == "" || dataDepartId.departId == null || dataDepartId.departId == undefined) {
        this.$message.warning("请选择对象部门!");
        this.$message.warning("请选择使用部门!");
        return
      }
      let data = this.form.getFieldsValue(['inspectionCycleId']);
@@ -522,7 +523,7 @@
    handleOk() {
      const that = this;
      // 触发表单验证
      that.form.validateFields((err, values) => {
      that.form.validateFields(async (err, values) => {
        if (JSON.stringify(that.fileObject.file) == '{}' && that.uploadId == '' && that.fileList.length == 0) {
          that.$message.warning("请上传文件");
          return false
@@ -543,7 +544,13 @@
            method = 'put';
          }
          let formData = Object.assign(that.model, values);
          if(!formData.num){
                await getAction(this.url.getNum, { type: 'SpecialtyInspectionPlan', length: '4' }).then((res) => {
                if (res.success) {
                  formData.num = res.message;
                }
              });
            }
          formData.type = "inspection_path_photo";
          formData.uploadId = that.uploadId;
          formData.fileType = "7";//文件类型  7:图片
@@ -583,7 +590,7 @@
    onDepartList() {
      this.$refs.DepartList.list();
      this.$refs.DepartList.title = "选择对象部门";
      this.$refs.DepartList.title = "选择使用部门";
    },
    sendDepartRecord(data) {
      this.dataSource = [];