王震
2023-11-01 da2b21618e8cc71dc24f21d4d2c8b5661d72a08e
Merge remote-tracking branch 'origin/master'
已修改7个文件
已添加1个文件
910 ■■■■■ 文件已修改
src/api/quality/finishedProduct.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/rawMaterial.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/views/index.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/rawMaterial-part.vue 240 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/ztt-table.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue 387 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/index.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/finishedProduct.js
@@ -14,4 +14,19 @@
    method: 'get',
    params: query
  })
}
export function addFinish(obj) {
  return request({
    url: '/mes/qualityFinishedInspect/addFinish',
    method: 'post',
    data: obj
  })
}
export function queryById(obj) {
  return request({
    url: '/mes/qualityFinishedInspect/'+obj,
    method: 'get',
  })
}
src/api/quality/rawMaterial.js
@@ -61,3 +61,19 @@
  })
}
export function chooseIFS(data) {
  return request({
    url: '/mes/rawInspect/chooseIFS',
    method: 'post',
    params: data
  })
}
export function selectHisByCode(data) {
  return request({
    url: '/mes/rawInsProduct/seleHisByCode',
    method: 'get',
    params: data
  })
}
src/router/views/index.js
@@ -162,6 +162,23 @@
    ]
  },
  {
    path: '/quality/finishedProduct',
    component: Layout,
    children: [
      {
        path: 'finishedProduct-form',
        name: 'finishedProductForm',
        component: () =>
          import(/* webpackChunkName: "views" */ '@/views/quality/finishedProductInspection/finishedProductInspectionAdd'),
        meta: {
          keepAlive: false,
          isTab: false,
          isAuth: false
        }
      }
    ]
  },
  {
    path: '/quality/newReport',
    component: Layout,
    children: [
src/views/common/rawMaterial-part.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,240 @@
<template>
    <el-dialog
      v-diadrag
      width="60%"
      title="报检信息"
      top="5vh"
      :visible.sync="innerVisible"
      append-to-body
      @close="$emit('update:currshowlist', false)"
      :show="currshowlist"
      class="part-dialog"
      id="rawMaterial-part-dialog"
    >
      <ttable
        :table="table"
        @handleSelectionChange="handleSelectionChange"
        @currentChange="handleCurrentChange"
        :uploadInfo="uploadInfo"
        :prelang="prelang"
        :options="options"
        :bottomOffset="350"
        :ajaxFun="ajaxFun"
        :paramObj="paramObj"
        :isShowPagination="false"
        ref="rawPartTable"
      >
        <template #toolbar></template>
      </ttable>
      <div slot="footer" class="dialog-footer">
        <el-button @click="innerVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="saveSelectRow">ç¡® å®š</el-button>
      </div>
    </el-dialog>
  </template>
  <script>
  import ttable from '@/views/common/ztt-table'
  import { chooseIFS } from '@/api/quality/rawMaterial'
  export default {
    props: {
      currshowlist: {
        type: Boolean,
        default: false
      },
      paramObj: {
        type: Object,
        default: () => {
          return {}
        }
      },
      multiSelect: {
        type: Boolean,
        default: false
      },
      parentSelectedObj: {
        type: Object,
        default: null
      },
      parentSelectedIndex: {
        type: Number,
        default: null
      }
    },
    data() {
      return {
        ajaxFun: chooseIFS,
        innerVisible: false,
        listLoading: true,
        currentRow: null,
        multipleSelection: [],
        uploadInfo: {
          // æ˜¯å¦å±•示上传EXCEL以及对应的url
          isShow: false,
          url: ''
        },
        prelang: 'operation',
        options: {
          height: 300, // é»˜è®¤é«˜åº¦-为了表头固定
          stripe: true, // æ˜¯å¦ä¸ºæ–‘马纹 table
          highlightCurrentRow: false, // æ˜¯å¦è¦é«˜äº®å½“前行
          border: true, // æ˜¯å¦æœ‰çºµå‘边框
          lazy: false, // æ˜¯å¦éœ€è¦æ‡’加载
          fit: true, // åˆ—的宽度是否自撑开
          multiSelect: false, //
          seqNo: true,
          isGeneralSearch: false,
          isRefresh: false, // æ˜¯å¦æ˜¾ç¤ºåˆ·æ–°æŒ‰é’®
          isShowHide: false, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®
          isSearch: false, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
          defaultOrderBy: { column: 'formTime', direction: 'desc' }
        },
        table: {
          total: 0,
          currentPage: 1,
          pageSize: 20,
          data: [],
          // æ ‡é¢˜
          column: [
            {
              minWidth: '100',
              prop: 'message',
              label: 'message',
              isTrue: false,
            },
            {
              minWidth: '100',
              prop: 'code',
              label: '零件号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'name',
              label: '原材料名称',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'formTime',
              label: '来料日期',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'specs',
              label: '规格型号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'unit',
              label: '单位',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'supplier',
              label: '供应商',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '100',
              prop: 'number',
              label: '数量',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
          ],
        },
      }
    },
    components: {
      ttable
    },
    created(){
    },
    mounted() {
    },
    methods: {
      getData() {
        if (this.$refs.rawPartTable !== undefined) {
          this.$refs.rawPartTable.getDataList()
        }
      },
      saveSelectRow() {
        if (this.multiSelect) {
          this.$emit('handleSelectionChange', this.multipleSelection)
        } else {
          this.$emit(
            'listenToPartEvent',
            this.currentRow,
            this.parentSelectedObj,
            this.parentSelectedIndex
          )
        }
        this.innerVisible = false
      },
      handleCurrentChange(row) {
        this.currentRow = row
      },
      handleSelectionChange(val) {
        // å¤šè¡Œé€‰ä¸­
        this.multipleSelection = val
      },
    },
    watch: {
      currshowlist() {
        this.innerVisible = this.currshowlist
        if (this.currshowlist) {
          this.$nextTick(() => {
            this.getData()
          })
        }
      }
    },
  }
  </script>
  <style>
  .part-dialog .el-dialog__header {
    padding: 10px 20px 10px;
  }
  .part-dialog .el-dialog__header .el-dialog__headerbtn {
    top: 10px;
  }
  .part-dialog .el-dialog__body {
    padding: 5px 20px;
  }
  .part-dialog .el-dialog__footer {
    padding: 5px 20px 10px;
  }
  .part-dialog .el-dialog__body .avue-crud__pagination {
    margin-top: 0px;
    margin-bottom: 5px;
  }
  </style>
src/views/common/ztt-table.vue
@@ -967,7 +967,12 @@
        .apply(this, args)
        .then((response) => {
          var _this = this
          _this.tableData = response.data.data.records
          var resultData = response.data.data.records
          if(resultData == undefined){
            _this.tableData = response.data.data
          }else{
            _this.tableData = response.data.data.records
          }
          _this.pagination.total = response.data.data.total
          // ç½®ç©ºé€‰ä¸­
          this.$refs.lmesTable.setCurrentRow()
src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
@@ -7,7 +7,7 @@
            <h2>编辑-产品检验</h2>
        </div>
        <div class="btn-group header-right">
            <el-button @click="addTestProjevt">生成检验项目</el-button>
            <el-button @click="addTestProject">生成检验项目</el-button>
        </div>
    </div>
    <div class="page-main">
@@ -34,21 +34,21 @@
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="产品名称:">
                                <el-select style="width: 100%" @change="changeOptionsSamplename"
                                    v-model="processInspectVo.material" size="small" placeholder="请选择产品名称">
                                    <el-option v-for="item in optionsSamplename" :key="item.id" :label="item.name"
                                        :value="item.id + '-' + item.name">
                                    </el-option>
                                </el-select>
                            <el-form-item label="质量追溯号:">
                                <el-input disabled v-model="processInspectVo.qualityTraceability"
                                    placeholder="请输入质量追溯号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label="质量追溯号:">
                                <el-input disabled v-model="processInspectVo.qualityTraceability"
                                    placeholder="请输入追溯号" autocomplete="off" />
                            <el-form-item label="产品名称:">
                                <el-select style="width: 100%" @change="changeOptionsSamplename"
                                    v-model="processInspectVo.material" size="small" placeholder="请选择产品名称">
                                    <el-option v-for="(item,index) in optionsSamplename" :key="index" :label="item.material"
                                        :value="item.materialCode">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
@@ -60,13 +60,13 @@
                        <el-col :span="6">
                            <el-form-item label="规格型号:">
                                <el-input disabled v-model="processInspectVo.specificationsModel"
                                    placeholder="请输入产品编码" autocomplete="off" />
                                    placeholder="请输入规格型号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="单位:">
                                <el-input disabled v-model="processInspectVo.unit"
                                    placeholder="请输入产品编码" autocomplete="off" />
                                    placeholder="请输入单位" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
@@ -91,21 +91,22 @@
            </el-row>
            <el-row style="width:100%;">
                <el-col :span="24">
                    <el-table border :data="inspectionItems" max-height="400" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
                        style="width: 100%">
                    <el-table border :data="inspectionItems" max-height="400" height="calc(100vh - 550px)"
                        :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                        :cell-style="{textAlign:'center'}" row-key="iid"
                        style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                        <el-table-column type="index" label="序号" width="60"></el-table-column>
                        <el-table-column label="项目" prop="father"></el-table-column>
                        <el-table-column prop="name" label="指标"></el-table-column>
                        <el-table-column prop="unit" label="单位"></el-table-column>
                        <el-table-column prop="iname" label="指标"></el-table-column>
                        <el-table-column prop="iunit" label="单位"></el-table-column>
                        <el-table-column prop="required" label="标准值"></el-table-column>
                        <el-table-column prop="internal" label="内测值"></el-table-column>
                        <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="检测值"
                            min-width="100" style="text-align: center;">
                            <template slot-scope="scope">
                                <el-tooltip :disabled="scope.row.dname != null" class="item" effect="dark" content="请先选择设备!"
                                    placement="top-start">
                                    <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]"
                                        @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input>
                                    <!-- <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]"
                                        @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input> -->
                                </el-tooltip>
                            </template>
                        </el-table-column>
@@ -120,7 +121,15 @@
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="结论">
                        <el-table-column prop="deviceName" label="试验设备" min-width="260">
                            <template slot-scope="scope">
                            <el-select style="width:100%" v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row)">
                                <el-option v-for="(item,index) in deviceList"
                                :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option>
                            </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="结论" fixed="right" min-width="100">
                            <template slot-scope="scope">
                                <span style="color: #34BD66;" v-if="scope.row.result === 1">合格</span>
                                <span style="color: #E84738;" v-else-if="scope.row.result === 0">不合格</span>
@@ -137,7 +146,9 @@
            </el-row>
            <el-row style="width:100%;margin-top:-180px">
                <el-col :span="24">
                    <el-table border max-height="400" :data="inspectionResultForm">
                    <el-table border max-height="400" :data="inspectionResultForm"
                    :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                    :cell-style="{textAlign:'center'}">
                        <el-table-column prop="id" label="物料编号"></el-table-column>
                        <el-table-column prop="name" label="物料名称"></el-table-column>
                        <el-table-column prop="inspecter" label="检验员"></el-table-column>
@@ -160,9 +171,16 @@
</template>
<script>
import {
    chooseMater,
    addFinish,
    queryById, } from '@/api/quality/finishedProduct'
import { updateDeviceById,selectDevice } from '@/api/quality/rawMaterial'
export default {
    data() {
        return {
            deviceList: [],
            hasChildren: true,
            showUp: false,
            isAddProject: false,
            showLook: false,
@@ -195,7 +213,7 @@
                mcode: null,
                prname: null,
                sname: null,
                orderNumber: "",
                orderNumber: "ZTTIC20230001",
                qualityTraceability: null,
                quantity: null,
                specificationsModel: null,
@@ -254,27 +272,40 @@
        };
    },
    watch: {
        // filterText(val) {
        //     this.$refs.tree.filter(val);
        // }
    },
    beforeUpdate(){
      this.$nextTick(()=>{
        this.$refs.table.doLayout();
      })
    },
    created() {
    },
    mounted() {
        this.getTableData()
        // this.getOptions();
        this.getDeviceList()
    },
    methods: {
        changeOptionsSamplename() {
            let id = this.processInspectVo.material.split("-")[0]
            let sample = this.optionsSamplename.filter(o => {
                return o.id == id
            })[0]
            this.processInspectVo.qualityTraceability = sample.qualityTraceability
            this.processInspectVo.mcode = sample.mcode
            this.processInspectVo.specificationsModel = sample.specifications
            this.processInspectVo.unit = sample.unit
        getDeviceList(){
            selectDevice(null).then(res=>{
            this.deviceList = res.data.data
            })
        },
        comBack() {
            this.$parent.comBackMain()
        updateDevice(row){
            if(this.dataForm.id != null){
            updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
            }).catch(error=>{
                console.log(error)
            })
            }
        },
        changeOptionsSamplename(val) {
            let sample = this.optionsSamplename.filter(o => {
                return o.materialCode == val
            })[0]
            // this.processInspectVo.qualityTraceability = sample.qualityTraceability
            this.processInspectVo.mcode = sample.materialCode
            this.processInspectVo.material = sample.material
            this.processInspectVo.specificationsModel = sample.specs
            this.processInspectVo.unit = sample.unit
        },
        handleClick(row) {
            this.rowInfp = row
@@ -284,44 +315,10 @@
            this.rowInfp = row
            this.showUp = true
        },
        combackMain() {
            this.showUp = false
            this.showLook = false
        },
        searchPro() {
            this.search.countSize = this.pageSize
            this.search.pageSize = this.currentPage
            this.defaultInitializationTable()
        },
        // ç‚¹å‡»è®¾å¤‡æ ‘保存点击记录
        nodeClick(data) {
            if (data.id != undefined) this.nodeData = data;
        },
        // è®¾å¤‡æ ‘过滤搜索
        filterNode(value, data) {
            if (!value) return true;
            return data.name.indexOf(value) !== -1;
        },
        // èŽ·å–è®¾å¤‡æ ‘å†…å®¹
        getOptions(row) {
            this.$axios.get(this.$api.url.inspectionItemChooseDev, {
                params: {
                    father: row.father,
                    name: row.name,
                    technologyId: this.processInspectVo.technologyId
                }
            }).then(res => {
                this.materialOptions = res.data;
                this.filterText = row.did
                if(this.materialOptions.length===1){
                    this.$message({
                    message: '该项目下只有一个试验设备,无需选择!',
                    type: 'warning'
                });
                    return
                }
                row.isSelectDevice = true
            });
        },
        // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
        clickTableSelect(scope) {
@@ -331,35 +328,6 @@
            this.clickSelectDevice.index = scope.$index;
            this.clickSelectDevice.rpId = scope.row.id;
            this.getOptions(scope.row);
        },
        // ç‚¹å‡»æ ‘里面的确定
        clickNodeSure(row) {
            let select = this.materialOptions.filter(item => {
                return item.id === this.filterText
            })[0]
            this.nodeData.id = select.id
            this.nodeData.name = select.device
            if (this.detailId == null) {
                this.inspectionItems[
                    this.clickSelectDevice.index
                ].did = this.nodeData.id;
                this.inspectionItems[
                    this.clickSelectDevice.index
                ].dname = this.nodeData.name;
                this.centerDialogVisible = false;
            } else {
                this.$axios
                    .post(this.$api.url.inspectionItemUpdateDevByInsId, {
                        id: this.clickSelectDevice.rpId,
                        type: 2,
                        devId: this.nodeData.id
                    })
                    .then(res => {
                        this.getTableData()
                        this.centerDialogVisible = false;
                        row.isSelectDevice=false
                    });
            }
        },
        changeState(row, index) {
            if (row.did != null && row.did != '') {
@@ -400,187 +368,67 @@
                });
            }
        },
        // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
        handleSizeChange(val) {
            this.search.countSize = val;
            this.defaultInitializationTable();
        },
        handleSpanMethod({ row, column, rowIndex, columnIndex }) {
            if (columnIndex === 0) {
                const _row = this.spanArr[rowIndex];
                const _col = _row > 0 ? 1 : 0;
                return {
                    rowspan: _row,
                    colspan: _col
                }
        addTestProject() {
            let val = this.processInspectVo
            let data = {
                customerName: val.prname,
                material: val.material,
                materialCode: val.mcode,
                orderNumber: val.orderNumber,
                projectName: val.sname,
                quantity: val.quantity,
                specs: val.specificationsModel,
                unit: val.unit,
            }
            if (columnIndex === 1) {
                const _row = this.spanArr[rowIndex];
                const _col = _row > 0 ? 1 : 0;
                return {
                    rowspan: _row,
                    colspan: _col
                }
            }
        },
        // åˆå¹¶è¡¨æ ¼
        mergeTable() {
            this.rowList = []
            this.spanArr = []
            this.position = 0
            this.inspectionItems.forEach((item, index) => {
                if (index === 0) {
                    this.spanArr.push(1);
                    this.position = 0;
                } else {
                    if (this.inspectionItems[index].father === this.inspectionItems[index - 1].father) {
                        this.spanArr[this.position] += 1;
                        this.spanArr.push(0);
                    } else {
                        this.spanArr.push(1);
                        this.position = index;
                    }
                }
            })
        },
        changeOptionSoptionSprocesses() {
            this.optionTechnology = []
            let working = this.optionSoptionSprocesses.filter(item => {
                return item.name === this.processInspectVo.techfather
            })[0]
            this.optionTechnology = working.children
        },
        addTestProjevt() {
            // this.isAddProject = true
            let val = JSON.parse(JSON.stringify(this.processInspectVo))
            val.material = this.processInspectVo.material.split("-")[1]
            val.id = this.processInspectVo.material.split("-")[0]
            this.$axios.post(this.$api.url.finishedInspectAddFinish, val, {
                headers: { "Content-Type": "application/json" }
            }).then(res => {
                if (res.code == 201) {
                    this.$message({
                        message: res.message,
                        type: 'warning'
                    });
                    return
                }
                this.detailId = res.data
                this.inspectionResultForm[0].id = val.mcode
                this.inspectionResultForm[0].name = val.material
                this.getTableData()
            })
        },
        getTableData() {
            this.$axios.get(this.$api.url.finishedInspectSelectFinishInspectsListById, {
                params: {
                    id: this.detailId
                }
            }).then(res => {
                this.processInspectVo.technologyId = res.data[0].techId
            })
            this.$axios.get(this.$api.url.inspectionItemListUser, {
                params: {
                    id: this.detailId,
                    type: 2
                }
            }).then(res => {
                if (res.data.length < 1) {
                    return
                }
                this.inspectionItems = res.data
                let arr = []
                let val = JSON.parse(JSON.stringify(this.inspectionItems))
                const uName = []
                //转成一维数组
                val.forEach(l => {
                    let father = l.father
                    l.children.forEach(c => {
                        c.father = father
                        c.empiricalValueAddss = []
                        if (c.inspectionValue != '' && c.inspectionValue != null) {
                            c.empiricalValueAddss = c.inspectionValue.split(",");
                        } else {
                            c.empiricalValueAddss.push("")
                        }
                        uName.push(c['username'])
                        c.isSelectDevice = false
                        arr.push(c)
            addFinish(data).then(res=>{
                let id = res.data.data
                if(id != null){
                    queryById(id).then(response=>{
                        console.log(response.data.data.children)
                        let proList = response.data.data.children
                        proList.forEach(item=>{
                            item.iid = Math.random();
                        })
                        this.inspectionItems = proList
                    }).catch(error=>{
                        console.log(error);
                    })
                })
                this.inspectionItems = arr
                let arrSort = JSON.parse(JSON.stringify(arr))
                //根据集合对象数组长度排序
                arrSort.sort((a, b) => {
                    if (a.empiricalValueAddss.length < b.empiricalValueAddss.length) {
                        return -1; // a排在b前面
                    } else if (a.empiricalValueAddss.length > b.empiricalValueAddss.length) {
                        return 1; // a排在b后面
                    } else {
                        return 0; // ä¿æŒç›¸å¯¹é¡ºåºä¸å˜
                    }
                });
                // console.log(arrSort);
                console.log(uName);
                let name = [...new Set(uName)].filter(item => item !== null);
                let rname = ''
                name.forEach(m => {
                    rname += m + ","
                })
                this.inspectionResultForm[0].inspecter = rname.slice(0, -1)
                this.empiricalValueAdd = arrSort[arrSort.length - 1].empiricalValueAddss.length
                this.mergeTable(arr)
                }
            }).catch(error=>{
                console.log(error)
            })
        },
        selectSample() {
            let sample = this.optionsSamplename.filter(item => {
                return item.name === this.processInspectVo.material
            })[0]
            this.processInspectVo.techfather = null
            this.processInspectVo.techname = null
            this.processInspectVo.materialCode = sample.code
            this.processInspectVo.specificationsModel = sample.specifications
            this.processInspectVo.unit = sample.unit
            this.optionSoptionSprocesses = []
            this.optionSoptionSprocesses = sample.children
        },
        selectInfoByOrderId() {
            this.$axios.get(this.$api.url.finishedInspectChooseMater, {
                params: {
            chooseMater({
                    orderNumber: this.processInspectVo.orderNumber
                }
            }).then(res => {
                if (res.data.length > 0) {
                    console.log(res.data);
                    this.processInspectVo.sname = res.data[0].sname
                    this.processInspectVo.prname = res.data[0].prname
                    this.optionsSamplename = res.data[0].children
                }).then(res => {
                if (res.data.data != null) {
                    this.processInspectVo.sname = res.data.data.projectName
                    this.processInspectVo.prname = res.data.data.customerName
                    this.optionsSamplename = res.data.data.children
                } else {
                    this.$message({
                        message: '没有该订单号!',
                        type: 'warning'
                    });
                    this.processInspectVo.sname = null
                    this.processInspectVo.prname = null
                    this.optionsSamplename = []
                    this.processInspectVo.mcode = null
                    this.processInspectVo.material = null
                    this.processInspectVo.specificationsModel = null
                    this.processInspectVo.unit = null
                }
            })
        },
        // å½“前页改变时触发 è·³è½¬å…¶ä»–页
        handleCurrentChange(val) {
            this.search.pageSize = val;
            this.defaultInitializationTable();
        },
        // æ˜¾ç¤ºæ–°å¢žé¡µé¢
        handleAddNew() {
            this.showAddPage = true;
            // this.getTableData()
        },
        // è¡¨æ ¼åˆå§‹åŒ–接口
        defaultInitializationTable() {
            this.$axios
                .post(this.$api.url.selectProcessInspectsList, this.search)
                .then(res => {
                    this.inspectionTableTotal = res.data.total;
                    this.inspectionTable = res.data.row;
                });
            // this.$axios
            //     .post(this.$api.url.selectProcessInspectsList, this.search)
            //     .then(res => {
            //         this.inspectionTableTotal = res.data.total;
            //         this.inspectionTable = res.data.row;
            //     });
        },
        // æ·»åŠ è¡Œ
        clickAddLine() {
@@ -618,9 +466,6 @@
            this.empiricalValueAdd = this.empiricalValueAdd + 1;
        }
    },
    created() {
        this.defaultInitializationTable(); // åˆå§‹åŒ–表格数据
    }
}
</script>
@@ -639,7 +484,7 @@
.finishedProduct-basic {
  background-color: #fff;
  height: 150px;
  height: 155px;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 20px;
src/views/quality/finishedProductInspection/index.vue
@@ -1,31 +1,6 @@
<template>
    <div class="content-main">
        <div v-if="!showAdd&&!showLook&&!showUp" class="rawPage">
            <!-- <div class="nav"> -->
                <!-- <div class="title">
                    <el-row>
                        <el-col :span="12">产品检验</el-col>
                        <el-col :span="12">
                            <el-button @click="handleAddNew" type="primary" size="mini" icon="el-icon-plus"
                                style="background: #004EA2; ">新增</el-button>
                            <el-button icon="el-icon-delete" size="mini">删除</el-button>
                            <el-button icon="el-icon-download" size="mini">导出</el-button>
                        </el-col>
                    </el-row>
                </div> -->
                <!-- <span>检测结果:</span>
                <el-select v-model="searchData.result" size="small" placeholder="请选择" style="width: 224px;margin-right: 52px;">
                    <el-option :value="''" label="全部"></el-option>
                    <el-option :value="1" label="合格"></el-option>
                    <el-option :value="0" label="不合格"></el-option>
                </el-select>
                <span>产品名称:</span>
                <el-input v-model="searchData.material" size="small" placeholder="请输入产品名称"
                    style="width: 224px;margin-right: 52px;"></el-input>
                <el-button size="mini" @click="()=>{searchData={};getInspectionTableData()}"><span>重 ç½®</span></el-button>
                <el-button size="mini" type="primary" @click="getInspectionTableData" style="background: #004EA2;"><span>查
                        è¯¢</span></el-button> -->
            <!-- </div> -->
        <div class="rawPage">
            <basic-container>
                <ttable 
                :table="table"
@@ -37,56 +12,6 @@
                <template #toolbar></template>
                </ttable>
            </basic-container>
            <!-- <div class="content-body">
                <div class="inspectionTable">
                    <el-table ref="inspectionTable" height="620" :cell-style="{textAlign: 'center'}"
                        :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
                        :data="inspectionTable" style="width: 100%">
                        <el-table-column type="selection" width="50">
                        </el-table-column>
                        <el-table-column prop="order_number" label="订单号" min-width="100" />
                        <el-table-column prop="customer_name" label="客户名称" min-width="80" />
                        <el-table-column prop="project_name" label="工程名称" min-width="80" />
                        <el-table-column prop="quality_traceability" label="质量追溯号" min-width="108" />
                        <el-table-column prop="material_code" label="产品编码" min-width="100" />
                        <el-table-column prop="material" label="产品大类" min-width="72" />
                        <el-table-column prop="specifications_model" label="规格型号" min-width="110" />
                        <el-table-column prop="unit" label="单位" min-width="50" />
                        <el-table-column prop="quantity" label="数量" min-width="50" />
                        <el-table-column prop="detectionPeriod" label="检验日期" min-width="80" />
                        <el-table-column prop="result" label="检测结果" min-width="80">
                            <template slot-scope="scope">
                                <span style="color: #34BD66;" v-if="scope.row.result === 1">合格</span>
                                <span style="color: #E84738;" v-else-if="scope.row.result === 0">不合格</span>
                                <span v-else-if="scope.row.result === null || scope.row.result === undefined">暂未结论</span>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" min-width="80">
                            <template slot-scope="scope">
                                <el-button type="text" size="small" @click="goToDetail(scope.row)">查看</el-button>
                                <el-button type="text" size="small">打印</el-button>
                                <el-button v-if="scope.row.result == null" type="text" size="small"
                                    @click="goUp(scope.row)">编辑</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div> -->
                <!-- åˆ†é¡µå™¨ -->
                <!-- <div class="pagination">
                    <el-pagination :current-page="pageParams.pageSize" :page-sizes="[10, 50, 100, 200]"
                        :page-size="pageParams.countSize" layout="total, sizes, prev, pager, next, jumper" :total="pageParams.total"
                        @size-change="handleSizeChange" @current-change="handleCurrentChange" />
                </div> -->
            <!-- </div> -->
        </div>
        <div class="newPage" v-if="showAdd">
            <finishedProductInspectionAdd />
        </div>
        <div class="newPage" v-if="showLook">
            <finishedProductInspectionLook :rowInfo="rowInfo" />
        </div>
        <div class="newPage" v-if="showUp">
            <finishedProductInspectionUp :rowInfo="rowInfo" />
        </div>
    </div>
</template>
@@ -227,7 +152,7 @@
                    {
                        text: '新增',
                        type: 'primary',
                        fun: ()=>this.showAdd=true
                        fun: this.addOrUpdateHandle
                    },
                    {
                        text: '删除',
@@ -315,6 +240,13 @@
            // this.getInspectionTableData()
        },
        methods: {
            // æ–°å¢ž / ä¿®æ”¹
            addOrUpdateHandle(row) {
                this.$router.push({
                    name: 'finishedProductForm',
                    query: { id: row == null ? null : row.id }
                })
            },
            formatResult(row, column, cellValue){
                if(cellValue != undefined || cellValue != null){
                    if(cellValue == 0){
@@ -326,12 +258,6 @@
            },
            formatDateTime(row, column, cellValue) {
                return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
            },
            addOrUpdateHandle(row) {
                this.$router.push({
                    name: 'rawMaterialForm',
                    query: { id: row == null ? null : row.id }
                })
            },
            handleSelectionChange(){
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -11,14 +11,6 @@
    </div>
    <div class="page-main">
      <div class="rawMaterial-basic">
        <el-row style="width:100%;height:20px;margin-bottom:20px;" v-show="dataForm.id==null">
          <el-col :span="20">
            <span style="color:red;font-size:18px;padding: 0;margin: 0;">请扫描二维码获取数据</span>
          </el-col>
          <el-col :span="4" style="text-align: right;">
            <el-button>扫描二维码</el-button>
          </el-col>
        </el-row>
        <el-form
        :model="dataForm"
        :rules="dataRule"
@@ -27,15 +19,14 @@
        class="l-mes"
        label-width="110px">
            <el-row>
            <el-col :span="6">
                <el-form-item prop="formTime" label="来料日期">
                <el-date-picker
                    v-model="dataForm.formTime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    disabled>
                </el-date-picker>
              <el-col :span="6">
                <el-form-item label="零件号" prop="code">
                <el-input v-model="dataForm.code">
                  <el-button
                    slot="append"
                    icon="el-icon-search"
                    @click="queryCode()"></el-button>
                </el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
@@ -45,8 +36,14 @@
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="原材料编码" prop="code">
                <el-input v-model="dataForm.code" disabled></el-input>
                <el-form-item prop="formTime" label="来料日期">
                <el-date-picker
                    v-model="dataForm.formTime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    disabled>
                </el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="6">
@@ -102,12 +99,18 @@
        </el-row>
        <el-row style="width:100%;">
            <el-col :span="24">
                <el-table :data="list" border style="width: 100%;" height="320">
                <el-table :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                :cell-style="{textAlign:'center'}" ref="table"
                :data="list" border style="width: 100%;" height="320">
                  <el-table-column type="index" label="序号" width="60">
                  </el-table-column>
                  <el-table-column prop="name" label="项目" width="260">
                    <template slot-scope="scope">
                      <el-input :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
                      <el-select v-if="projectList.length > 0" :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
                      filterable allow-create placeholder="请输入或选择项目名称" style="width:100%" @change="changeName(scope.$index,scope.row)">
                        <el-option v-for="(item,index) in projectList" :key="index" :label="item.name" :value="item.name"/>
                    </el-select>
                      <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
                        placeholder="请输入项目名称"></el-input>
                    </template>
                  </el-table-column>
@@ -179,6 +182,7 @@
        </el-row>
      </div>
    </div>
    <rawMaterialPartDialog :paramObj="paramObj" :currshowlist.sync="showPart"  @listenToPartEvent="selectPart" />
  </div>
</template>
@@ -190,10 +194,21 @@
  getObj,
  updateRawInsProduct,
  updateRawInspectsById,
  chooseIFS,
  selectHisByCode,
  updateDeviceById, } from '@/api/quality/rawMaterial'
  import rawMaterialPartDialog from '@/views/common/rawMaterial-part'
export default {
    computed:{},
    components:{
      rawMaterialPartDialog
    },
    data(){
        return{
            projectList: [],
            paramObj: {},
            IFSData: [],
            showPart: false,
            // æ·»åŠ åˆ—
            empiricalValueAdd: 1,
            // ç¼–辑时存储最长的列数字,做删除判断
@@ -202,14 +217,14 @@
            dataForm:{
                id: null,
                judgeState: null,
                formTime: '2023-10-28 00:00:00',
                message: '-2050314,1,1,*,1002',
                name: 'name',
                code: 'code4',
                specs: 'specs',
                unit: 'mm',
                number: '111',
                supplier: 'supplier',
                formTime: '',
                message: '',
                name: '',
                code: '88.118.1/A0487643',
                specs: '',
                unit: '',
                number: '',
                supplier: '',
                rawInsProducts: [{
                  equipmentId: 0,
                  name: '',
@@ -234,6 +249,11 @@
            deviceList: [],
        }
    },
    beforeUpdate(){
      this.$nextTick(()=>{
        this.$refs.table.doLayout();
      })
    },
    mounted(){
      this.dataForm.id = this.$route.query.id
      this.init()
@@ -247,6 +267,34 @@
    },
    methods:{
      changeName(index,row){
        this.projectList.forEach(item=>{
          if(row.name == item.name){
            this.list[index].unit = item.unit
            this.list[index].required = item.required
          }
        })
      },
      // ç¡®è®¤å›žè°ƒ
      selectPart(param, nodePart, index) {
        if (typeof param !== 'undefined') {
          this.dataForm.code = param.code
          this.dataForm.name = param.name
          this.dataForm.formTime = param.formTime
          this.dataForm.unit = param.unit
          this.dataForm.specs = param.specs
          this.dataForm.supplier = param.supplier
          this.dataForm.number = param.number
          this.dataForm.message = param.message
          this.projectList = param.rawInsProducts
        }
      },
      queryCode(){
        this.paramObj = {
          code: this.dataForm.code
        }
        this.showPart = true
      },
      updateDevice(row){
        if(this.dataForm.id != null){
          updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
@@ -283,6 +331,19 @@
      },
      addTeatValueColumn(){
        this.empiricalValueAdd = this.empiricalValueAdd + 1;
      },
      // æ·»åŠ è¡Œ
      clickAddLine() {
        let obj = {
          equipmentId: null,
          name: "",
          required: "",
          testValue: "",
          unit: "",
          testState: null,
          testValueList: [],
        };
        this.list.push(obj);
      },
      // åˆ é™¤è¡Œ
      clickDeleteline(scope) {
@@ -381,27 +442,12 @@
          this.$message.error(error)
        })
      },
      // æ·»åŠ è¡Œ
      clickAddLine() {
        let obj = {
          equipmentId: null,
          name: "",
          required: "",
          testValue: "",
          unit: "",
          testState: null,
          testValueList: [],
        };
        this.list.push(obj);
      },
      getDeviceList(){
        selectDevice(null).then(res=>{
          this.deviceList = res.data.data
        })
      },
    },
    computed:{},
    components:{}
}
</script>
@@ -420,7 +466,7 @@
.rawMaterial-basic {
  background-color: #fff;
  height: 150px;
  height: 155px;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 20px;