gaoluyang
2025-02-15 cd3f4e1d1bc10a7b6f9622908aa21c9e058f36ba
能力范围-产品维护联调
已修改2个文件
43 ■■■■ 文件已修改
src/components/capability/bindPartDialog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/capabilityAndLaboratory/capability/index.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/capability/bindPartDialog.vue
@@ -1,10 +1,8 @@
<template>
  <div>
    <el-dialog title="零件绑定" :visible.sync="isShow" width="800px" @close="$emit('closeBindPartDialog')">
      <div class="body" v-if="isShow" style="height: 500px;overflow-y: auto;padding: 5px 0;">
        <lims-table :tableData="tableData" :column="column"
                    :page="page" :tableLoading="tableLoading"></lims-table>
      </div>
      <lims-table :tableData="tableData" :column="column" height="460"
                  :page="page" :tableLoading="tableLoading"></lims-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="$emit('closeBindPartDialog')">取 消</el-button>
        <el-button type="primary" @click="addBindPart('add')" :loading="addBindLoad">新 增</el-button>
@@ -156,7 +154,7 @@
      this.tableLoading = true
      // 根据类型判断是检验对象零件绑定还是产品维护零件绑定
      if (this.type === 0) {
        selectByTestObjectId({id: this.currentRow.id}).then(res => {
        selectByTestObjectId({testObjectId: this.currentRow.id}).then(res => {
          this.tableLoading = false
          if (res.code === 200) {
            this.tableData = res.data.records
@@ -166,7 +164,7 @@
          this.tableLoading = false
        })
      } else {
        selectByProductId({id: this.currentRow.id}).then(res => {
        selectByProductId({productId: this.currentRow.id}).then(res => {
          this.tableLoading = false
          if (res.code === 200) {
            this.tableData = res.data.records
@@ -182,7 +180,7 @@
      this.dialogTitle = type === 'add' ? '新增零件绑定' : '修改零件绑定'
      this.operationType = type
      if (type === 'edit') {
        this.bindPartData = row
        this.bindPartData = this.HaveJson(row)
      }
    },
    // 提交零件绑定
src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -55,11 +55,9 @@
      </div>
    </div>
    <!--产品维护弹框-->
    <el-dialog title="产品维护" :visible.sync="diaProduct" width="600px">
      <div class="body" v-if="diaProduct" style="height: 350px;overflow-y: auto;padding: 5px 0;">
        <lims-table :tableData="productData" :column="productColumn"
                    :page="productPage" :tableLoading="productableLoading"></lims-table>
      </div>
    <el-dialog title="产品维护" :visible.sync="diaProduct" width="900px">
      <lims-table :tableData="productData" :column="productColumn" height="460"
                  :page="productPage" :tableLoading="productableLoading"></lims-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="diaProduct = false">取 消</el-button>
        <el-button type="primary" @click="editProduct('add')" :loading="productLoad">新 增</el-button>
@@ -299,13 +297,11 @@
        {label: '产品名称EN', prop: 'nameEn'},
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              icon: 'el-icon-edit',
              clickFun: (row) => {
                this.editProduct('edit', row);
              },
@@ -313,7 +309,6 @@
            {
              name: '删除',
              type: 'text',
              icon: 'el-icon-delete',
              clickFun: (row) => {
                this.deleteProduct(row);
              },
@@ -530,12 +525,11 @@
    },
    getProductList () {
      const params = {
        id: this.objectId,
        objectId: this.objectId,
      }
      this.productableLoading = true
      selectProductListByObjectId({...params, ...this.productPage}).then(res => {
        this.productableLoading = false
        if (res.code === 200) return
        this.productData = res.data.records
        this.productPage.total = res.data.total
      }).catch(err => {
@@ -547,37 +541,44 @@
      this.productEditDia = true
      this.operationType = type
      if (type === 'edit') {
        this.productEditForm = row
        this.productEditForm = this.HaveJson(row)
      }
    },
    // 提交产品维护修改
    submitProduct () {
      this.$refs['productEditForm'].validate((valid) => {
        if (valid) {
          this.uploading = true
          this.productEditForm.objectId = this.objectId
          if (this.operationType === 'add') {
            addProduct(this.productEditForm).then(res => {
              this.uploading = false
              if (res.code === 200) {
                this.$message.success('新增成功')
                this.productEditDia = false
                this.closeProduct()
                this.getProductList();
              }
            }).catch(err => {
              this.uploading = false
            })
          } else {
            upProduct(this.productEditForm).then(res => {
              this.uploading = false
              if (res.code === 200) {
                this.$message.success('新增成功')
                this.productEditDia = false
                this.closeProduct()
                this.getProductList();
              }
            }).catch(err => {
              this.uploading = false
            })
          }
        }
      })
    },
    closeProduct() {
      this.productEditDia = false
      this.resetForm('productEditForm')
      this.productEditDia = false
    },
    // 产品维护-删除
    deleteProduct (row) {
@@ -589,7 +590,7 @@
        delProduct({id:row.id}).then(res => {
          if (res.code === 200) {
            this.$message.success('删除成功')
            this.refreshTable();
            this.getProductList();
          }
        })
      }).catch(() => {