zhangherong
2025-04-02 aed7d8163fe342aa1088b118c1ee820c7c2ea487
art: 设备管理-保养标准-升版
已修改2个文件
39 ■■■■ 文件已修改
src/views/eam/base/EamMaintenanceStandardList.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamMaintenanceStandardModal.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -94,13 +94,16 @@
          <a v-if="text && text !== ''" @click.stop="handlePreview(record)">预览</a>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click.stop="handleEdit(record)">编辑</a>
          <a v-if="record.standardStatus === 'NORMAL'" @click.stop="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.standardStatus === 'NORMAL'">
                <a @click.stop="handleUpgrade(record)">升版</a>
              </a-menu-item>
              <a-menu-item v-if="record.standardStatus === 'NORMAL'">
                <a-popconfirm title="确定作废吗?" @confirm="() => handleAbolish(record.id)">
                  <a>作废</a>
                </a-popconfirm>
@@ -224,7 +227,6 @@
        inspectionXlsDownloadUrl: '导入模板/点检标准导入模板_v1.0.xlsx',
        weekMaintenanceXlsDownloadUrl: '导入模板/周保标准导入模板_v1.0.xlsx',
        abolish: '/eam/maintenanceStandard/abolish',
      },
      fileUrl: '',
      standardId: '-1'
@@ -324,6 +326,12 @@
        }
      });
    },
    handleUpgrade(record) {
      //升版
      this.$refs.modalForm.upgrade(record);
      this.$refs.modalForm.title = "升版";
      this.$refs.modalForm.disableSubmit = false;
    },
  }
}
</script>
src/views/eam/base/modules/EamMaintenanceStandardModal.vue
@@ -116,6 +116,7 @@
        visible: false,
        model: {},
        editable: false,
        upgradeFlag: false,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
@@ -146,6 +147,7 @@
          add: "/eam/maintenanceStandard/add",
          edit: "/eam/maintenanceStandard/edit",
          detail: "/eam/eamMaintenanceStandardDetail/queryList",
          upgrade: '/eam/maintenanceStandard/upgrade',
        },
        detail: {
          loading: false,
@@ -215,11 +217,26 @@
        this.model = {};
        this.visible = true;
        this.editable = false;
        this.upgradeFlag = false;
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        this.editable = true;
        this.upgradeFlag = false;
        if(record && record.referenceFile) {
          let obj = JSON.parse(record.referenceFile);
          this.model.fileList = [obj];
        }else {
          this.model.fieldList = [];
        }
        this.loadDetail(record.id);
      },
      upgrade(record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        this.editable = true;
        this.upgradeFlag = true;
        if(record && record.referenceFile) {
          let obj = JSON.parse(record.referenceFile);
          this.model.fileList = [obj];
@@ -255,8 +272,12 @@
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
              if(this.upgradeFlag) {
                httpurl+=this.url.upgrade;
              }else {
                httpurl+=this.url.edit;
              }
              method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){