spring
2025-04-08 fcbba75febaa36d23c6c49473ab5bcee0e1a2c04
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue
@@ -22,7 +22,8 @@
          <el-form-item label="色标:" prop="colorCode">
            <el-input v-model="bindPartData.colorCode" size="small"></el-input>
          </el-form-item>
          <el-form-item label="进厂检验项:" prop="inspectionItem" v-if="currentObj.objectType == '原材料'" label-width="100px">
          <el-form-item label="进厂检验项:" prop="inspectionItem"
            v-if="currentObj.objectType == '原辅材' || currentObj.objectType == '包材'" label-width="100px">
            <!-- <el-input v-model="bindPartData.inspectionItem" disabled placeholder="选择检验项" size="small">
              <template slot="append">
                <el-button slot="append" icon="el-icon-search" @click="openItems"></el-button>
@@ -38,10 +39,10 @@
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeBindPartDialog">取 消</el-button>
        <el-button type="primary" @click="submitBind" :loading="bindLoad">确 认</el-button>
        <el-button type="primary" @click="submitBind">确 认</el-button>
      </span>
    </el-dialog>
    <el-dialog title="修改记录" :visible.sync="editItem" width="600px">
    <el-dialog title="修改记录" :visible.sync="editItem" width="900px">
      <div class="body" v-if="editItem">
        <lims-table :tableData="editList" :column="editColumn" height="460px" :tableLoading="tableLoading0" :key="2"
          :page="editPage" @pagination="editPagination"></lims-table>
@@ -54,9 +55,16 @@
import limsTable from "@/components/Table/lims-table.vue";
import {
  addProductPart,
  addTestObjectPart, deleteProductPart, deleteTestObjectPart,
  addTestObjectPart,
  deleteProductPart,
  deleteTestObjectPart,
  selectByProductId,
  selectByTestObjectId, updateProductPart, updateTestObjectPart, inspectionItems, productPartReview
  selectByTestObjectId,
  updateProductPart,
  updateTestObjectPart,
  inspectionItems,
  productPartReview,
  productPartLogList
} from "@/api/structural/structureTestObjectPart";
export default {
@@ -93,6 +101,7 @@
        { label: '零件号', prop: 'partNo' },
        { label: '颜色', prop: 'color' },
        { label: '色标', prop: 'colorCode' },
        { label: '进厂检验项', prop: 'inspectionItem' },
        {
          label: '状态', prop: 'review',
          dataType: "tag",
@@ -133,10 +142,10 @@
                  type: "warning",
                })
                  .then(() => {
                    productPartReview({ id: row.id }).then((res) => {
                    productPartReview({ id: row.id, type: this.type == 0 ? '对象' : '产品' }).then((res) => {
                      if (res.code == 200) {
                        this.$message.success("复核通过");
                        this.getList()();
                        this.getList();
                      }
                    });
                  })
@@ -192,7 +201,7 @@
        partNo: '', // 零件号
        color: '', // 颜色
        colorCode: '', // 色标
        inspectionItem: [],//原材料进厂检验对象列表
        inspectionItem: [],//原辅材进厂检验对象列表
      },
      bindPartDataRules: {
        partNo: [
@@ -203,16 +212,27 @@
      upIndex: 0,
      addBindLoad: false,
      itemList: [],//原材料进厂检验对象列表
      itemList: [],//原辅材进厂检验对象列表
      editItem: false,
      editList: [],
      editColumn: [
        { label: '零件号', prop: 'inspectionItem' },
        { label: '颜色', prop: 'inspectionItemSubclass' },
        { label: '色标', prop: 'ask' },
        { label: '进厂检验项', prop: 'askTell' },
        { label: '修改时间', prop: 'method' },
        { label: '修改人', prop: 'method' },
        { label: '零件号', prop: 'partNo' },
        { label: '颜色', prop: 'color' },
        { label: '色标', prop: 'colorCode' },
        { label: '进厂检验项', prop: 'inspectionItem' },
        {
          label: '状态', prop: 'review',
          dataType: "tag",
          formatType: (params) => {
            if (params == '待复核') {
              return 'danger'
            } else {
              return 'success'
            }
          },
        },
        { label: '修改时间', prop: 'operTime' },
        { label: '修改人', prop: 'operName' },
      ],
      editPage: {
        total: 0,
@@ -220,6 +240,7 @@
        current: 0,
      },
      tableLoading0: false,
      currentPart: {},//当前零件
      // mutilSelect: []
    }
  },
@@ -240,11 +261,21 @@
      })
    },
    // 修改记录
    lookList() {
    lookList(row) {
      this.currentPart = row;
      this.editItem = true;
      this.getEditList()
    },
    getEditList() { },
    getEditList() {
      this.tableLoading0 = true
      productPartLogList({ id: this.currentPart.id, type: this.type == 0 ? '对象' : '产品', ...this.editPage }).then(res => {
        this.tableLoading0 = false
        if (res.code == 200) {
          this.editList = res.data.records
          this.editPage.total = res.data.total
        }
      })
    },
    editPagination() {
      this.editPage.current = page;
      this.editPage.size = limit;
@@ -282,6 +313,8 @@
      if (type === 'edit') {
        this.bindPartData = this.HaveJson(row)
        this.bindPartData.inspectionItem = this.bindPartData.inspectionItem ? this.bindPartData.inspectionItem.split(',') : []
      } else {
        this.bindPartData = {}
      }
    },
    // 提交零件绑定
@@ -294,12 +327,14 @@
            color: this.bindPartData.color,
            colorCode: this.bindPartData.colorCode,
            partNo: this.bindPartData.partNo,
            id: this.bindPartData.id,
            inspectionItem: this.bindPartData.inspectionItem && this.bindPartData.inspectionItem.length > 0 ? this.bindPartData.inspectionItem.join(',') : ''
          } : {
            productId: this.currentRow.id,
            color: this.bindPartData.color,
            colorCode: this.bindPartData.colorCode,
            partNo: this.bindPartData.partNo,
            id: this.bindPartData.id,
            inspectionItem: this.bindPartData.inspectionItem && this.bindPartData.inspectionItem.length > 0 ? this.bindPartData.inspectionItem.join(',') : ''
          }
          this.bindLoad = true
@@ -319,6 +354,7 @@
              })
            } else {
              addProductPart(params).then(res => {
                this.bindLoad = false
                if (res.code === 200) {
                  this.resetForm('bindPartData')
                  this.addBindPartDialog = false