专业点检标准、专业点检方案增加自动生成编码,项目性维修上传附件功能
已修改8个文件
178 ■■■■■ 文件已修改
src/views/eam/ProjectMaintenanceOrderList.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/SerialNumberList.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/SpecialtyInspectionPlanList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/SpecialtyInspectionStandardList.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/projectMaintenanceOrder/ProjectMaintenanceOrderForm.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/specialtyInspectionPlan/SpecialtyInspectionPlanModal.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/specialtyInspectionStandard/SpecialtylnspectionStandardModal.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePart/SparePartModel.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ProjectMaintenanceOrderList.vue
@@ -132,22 +132,21 @@
        @change='handleTableChange'
      >
        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" -->
        <template
          slot='imgSlot'
          slot-scope='text,record'
        >
          <span
            v-if='!text'
            style='font-size: 12px;font-style: italic;'
          >无图片</span>
          <img
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!record.path" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(record.path)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :src='getImgView(text)'
            :preview='record.id'
            height='25px'
            alt=''
            style='max-width:80px;font-size: 12px;font-style: italic;'
          />
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
        <span
@@ -324,11 +323,17 @@
          // }
        },
        {
          title: '附件',
          align: "center",
          dataIndex: 'annex',
          scopedSlots: { customRender: 'imgSlot' }
        },
            title:'附件',
            align:"center",
            dataIndex: 'annex',
            scopedSlots: {customRender: 'fileSlot'}
          },
          // {
          //   title:'图片预览',
          //   align:"center",
          //   dataIndex: 'annex',
          //   scopedSlots: {customRender: 'imgSlot'}
          // },
        // {
        //   title:'变动方式',
        //   align:"center",
src/views/eam/SerialNumberList.vue
@@ -198,12 +198,12 @@
          dataIndex: 'beginSymbol',
          sorter: true,
        },
        {
          title: '企业代码',
          align: 'center',
          dataIndex: 'enterpriseCode',
          sorter: true,
        },
        // {
        //   title: '企业代码',
        //   align: 'center',
        //   dataIndex: 'enterpriseCode',
        //   sorter: true,
        // },
        {
          title: '类型',
          align: 'center',
src/views/eam/SpecialtyInspectionPlanList.vue
@@ -13,7 +13,7 @@
            :md="6"
            :sm="8"
          >
            <a-form-item label='点检计划编码'>
            <a-form-item label='点检方案编码'>
              <a-input
                placeholder='请输入设备编码'
                v-model='queryParam.num'
src/views/eam/SpecialtyInspectionStandardList.vue
@@ -154,6 +154,10 @@
          >升版</a>
          <a-divider type="vertical" />
          <a
            v-if="record.versionStatus == '2'"
            @click="handleCopy(record)"
          >复制</a>
          <a
            v-if="record.versionStatus == '1'"
            @click="handleTakeEffect(record)"
          >生效</a>
@@ -357,6 +361,14 @@
      this.$refs.modalForm.isRevise = true;
    },
    //复制
    handleCopy: function (record) {
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title = "专业点检标准复制";
      this.$refs.modalForm.disableSubmit = false;
      this.$refs.modalForm.isCopy = true;
    },
    //生效
    handleTakeEffect(record) {
      const that = this;
src/views/eam/modules/projectMaintenanceOrder/ProjectMaintenanceOrderForm.vue
@@ -97,10 +97,7 @@
              :wrapperCol='wrapperCol'
              prop='annex'
            >
              <j-image-upload
                :isMultiple="false"
                v-model="model.annex"
              ></j-image-upload>
            <j-upload :returnUrl= "false" :isMultiple="false"  v-model="model.file" ></j-upload>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
@@ -215,10 +212,10 @@
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import JFormContainer from '@/components/jeecg/JFormContainer'
import { getAction } from '@api/manage'
import { VALIDATE_FAILED, getRefPromise, validateFormAndTables,validateFormModelAndTables} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
export default {
  name: 'ProjectMaintenanceOrderForm',
@@ -543,6 +540,32 @@
  },
  methods: {
    handleOk() {
      this.model['annex'] = this.model.file[0].filePath;
      /** 触发表单验证 */
      this.getAllTable().then(tables => {
        /** 一次性验证主表和所有的次表 */
        return validateFormModelAndTables(this.$refs.form,this.model, tables)
      }).then(allValues => {
        /** 一次性验证一对一的所有子表 */
        return this.validateSubForm(allValues)
      }).then(allValues => {
        if (typeof this.classifyIntoFormData !== 'function') {
          throw this.throwNotFunction('classifyIntoFormData')
        }
        let formData = this.classifyIntoFormData(allValues)
        // 发起请求
        return this.request(formData)
      }).catch(e => {
        if (e.error === VALIDATE_FAILED) {
          // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
          this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
        } else {
          console.error(e)
        }
      })
    },
    getSuppler() {
      getAction(this.url.supplierVoList).then((res) => {
        if (res.success) {
src/views/eam/modules/specialtyInspectionPlan/SpecialtyInspectionPlanModal.vue
@@ -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: '请选择点检周期!' },
@@ -384,6 +384,7 @@
        listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType",
        getInspectionCycle: "/eam/inspectionStandardDetail/getInspectionCycle",
        // getSysDeparts: "/eam/specialtyInspectionPlan/getSysDeparts",
        getNum: '/eam/sysIdentity/getNumNew',
      },
      dataSource: [],
      //用于展示文件
@@ -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:图片
src/views/eam/modules/specialtyInspectionStandard/SpecialtylnspectionStandardModal.vue
@@ -22,7 +22,7 @@
              <a-input
                allow-clear
                :disabled="codeDisable"
                :placeholder="disableSubmit?'':'请输入点检标准编码'"
                :placeholder="disableSubmit?'':'请输入点检标准编码,不输入将由系统自动生成编码'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
@@ -291,6 +291,7 @@
      model: {},
      inspectionCycles: {},
      isRevise: false,
      isCopy:false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
@@ -302,11 +303,11 @@
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入点检标准编码!' },
          ]
        },
        // num: {
        //   rules: [
        //     { required: true, message: '请输入点检标准编码!' },
        //   ]
        // },
        equipmentName: {
          rules: [
            { required: true, message: '请选择设备!' },
@@ -330,6 +331,8 @@
        getInspectionCycle: "/eam/inspectionStandardDetail/getInspectionCycle",
        revise: '/eam/specialtyStandard/revise',
        getReviseVersion: "/eam/specialtyStandard/getReviseVersion",
        getNum: '/eam/sysIdentity/getNumNew',
        getCopy: "/eam/specialtyStandard/getCopy",
      },
      dataSource: [],
@@ -426,20 +429,29 @@
    handleOk() {
      const that = this;
      this.form.validateFields((err, values) => {
      this.form.validateFields(async (err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          formData.specialtyInspectionStandardDetaillist = that.dataSource;
          let obj;
          if (!this.model.id) {
            if(!formData.num){
                await getAction(this.url.getNum, { type: 'SpecialtyInspectionStandard', length: '4' }).then((res) => {
                if (res.success) {
                  formData.num = res.message;
                }
              });
            }
            formData.versionStatus = '1'
            obj = postAction(this.url.add, formData);
          } else {
            if (this.isRevise) {
              formData.versionStatus = '1'
              obj = postAction(this.url.revise, formData);
            } else {
            } else if(this.isCopy){
              obj = postAction(this.url.getCopy, formData);
            }else {
              obj = requestPut(this.url.edit, formData, { id: this.model.id });
            }
          }
src/views/spare/modules/sparePart/SparePartModel.vue
@@ -311,7 +311,7 @@
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入设备分类编号!' },
            // { required: true, message: '请输入设备分类编号!' },
            { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
            // { validator: this.validateNum },
          ]
@@ -378,13 +378,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,12 +396,19 @@
    handleOk() {
      const that = this;
      // 触发表单验证
      this.form.validateFields((err, values) => {
      this.form.validateFields(async (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;
                }
              });
            }
            formData.sparePartCategoryId = this.sparePartCategoryId
            obj = postAction(this.url.add, formData);
          } else {