zss
2023-12-01 e06313b6dba4774aef0924f342f13e8433f8d6f6
Merge remote-tracking branch 'origin/master'

# Conflicts:
# vue.config.js
已修改6个文件
已添加3个文件
1007 ■■■■■ 文件已修改
src/api/quality/packageInspect.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/views/index.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/productionschedul/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/Packaging_ledger/index.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/Packaging_ledger/pack-from.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/Packaging_ledger/pack-fromadd.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/packageinspect/index.vue 229 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/packageinspect/packageInspect-form.vue 610 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/packageInspect.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
import request from '@/router/axios'
export function fetchList(query) {
  return request({
    url: '/mes/packageInspect/page',
    method: 'get',
    params: query
  })
}
export function fetchListById(id) {
  return request({
    url: '/mes/packageInspect/'+id,
    method: 'get',
  })
}
export function deleteById(id) {
  return request({
    url: '/mes/packageInspect/'+id,
    method: 'delete',
  })
}
export function updatePackageInsProduct(data) {
  return request({
    url: '/mes/packageInsProduct/updatePackageInsProduct',
    method: 'post',
    data: data
  })
}
src/router/views/index.js
@@ -145,6 +145,23 @@
    ]
  },
  {
    path: '/quality/packageinspect',
    component: Layout,
    children: [
      {
        path: 'packageInspect-form',
        name: 'packageInspectForm',
        component: () =>
          import(/* webpackChunkName: "views" */ '@/views/quality/packageinspect/packageInspect-form'),
        meta: {
          keepAlive: false,
          isTab: false,
          isAuth: false
        }
      }
    ]
  },
  {
    path: '/quality/rawMaterial',
    component: Layout,
    children: [
src/views/plan/productionschedul/index.vue
@@ -23,7 +23,7 @@
                <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
              </div>
              <div style="height:70vh;overflow-y: scroll;">
                <el-timeline reverse>
                <el-timeline>
                    <el-timeline-item
                      placement="top"
                      v-for="(item, index) in scheduleList"
@@ -295,9 +295,9 @@
        this.tableData = res.data.data.records
        this.page.total = res.data.data.total
        this.page.currentPage = res.data.data.records.pages
        this.scheduleList = []
      })
      this.loading = false
    },
    handleCurrentChange(val) {
      this.multipleSelection = val
src/views/quality/Packaging_ledger/index.vue
@@ -9,7 +9,7 @@
            :prelang="prelang"
            :ajaxFun="ajaxFun"
            :options="options" 
            @handleSelectionChange="handleCurrentChange"
            @currentChange="handleCurrentChange"
            ref="processconfiguration"
            >
        <template #toolbar></template>
@@ -53,7 +53,7 @@
              :data="testStandardParams"
              id="testStandardParamTable"
              ref="testStandardParam"
              :default-sort="{ prop: 'index' }"
              highlight-current-row
              height="700"
              style="width: 100%"
@@ -62,7 +62,7 @@
              stripe
            >
              <el-table-column
                prop="index"
                type ="index"
                label="序号"
                align="center"
                width="50"
@@ -92,12 +92,12 @@
              </el-table-column>
              <el-table-column
                label="数量"
                prop="parameterFormat"
                prop="number"
                align="center"
                width="80"
              >
                <template slot-scope="scope">
                  <el-input v-model="scope.row.parameterFormat"></el-input>
                  <el-input v-model="scope.row.number"></el-input>
                </template>
              </el-table-column>
              <el-table-column label="单位" prop="unit" align="center" />
@@ -118,7 +118,7 @@
        <!-- æ–°å¢ž -->
        <packfrom
        :currshowlist.sync="addOrUpdateVisible"
        >
        @refreshDataList="getData">
        </packfrom>
        <packfromadd
        :currshowlist.sync="increase"
@@ -138,6 +138,7 @@
export default {
    data(){
        return {
          dataway:{},
          goid:'',
          testStandardParams: [],
          packageBoxId:{},
@@ -237,17 +238,17 @@
                ],
                operator: [
                    {
                      text: '删除',
                      icon: 'el-icon-delete',
                      type: 'text',
                      size: 'small',
                      fun: this.deleteHandle
                    },{
                      text: '检验',
                      icon: 'el-icon-delete',
                      type: 'text',
                      size: 'small',
                      fun: this.check
                    },{
                      text: '删除',
                      icon: 'el-icon-delete',
                      type: 'text',
                      size: 'small',
                      fun: this.deleteHandle
                    }
                  ],
                  operatorConfig: {
@@ -265,18 +266,15 @@
        packfromadd
        },
        watch: {
          // renovate() {
          //   if (this.innerVisible = false) {
          //     this.$nextTick(() => {
          //       this.getData()
          //     })
          //   }
          // }
      },
    methods: {
       // èŽ·å–æ•°æ®åˆ—è¡¨
      getData() {
        this.$refs.processconfiguration.refreshData()
      },
      wayRenovate(){
        this.getData()
      },
      //add
      addOrUpdateHandle(){
@@ -286,28 +284,33 @@
      deleteHandle(row){
        dropById({id:row.id}).then((res) =>{
          this.getData()
          this.$message.error('删除成功')
          this.$message.success('删除成功')
        })
      },
      handleCurrentChange(row){
        console.log(row,"id");
        console.log(row,"一行");
        this.dataway = row
        this.packageBoxId = {
          packageBoxId:row[0].id
          packageBoxId:row.id
        }
        this.goid = row[0].id
        list({packageBoxId:row[0].id}).then((res) =>{
        this.goid = row.id
        this.rightquery()
      },
      rightquery(){
        list({packageBoxId:this.goid}).then((res) =>{
          console.log(res,"nihaoa");
          this.testStandardParams = res.data.data
        })
      },
      //详情添加
      relateOperationParam(){
        this.increase = true
        if (this.dataway.state == "未报检") {
            this.increase = true
        }else{
          this.$message.error('请先选择包装项目')
        }
      },
      preserve(datalist){
        console.log(datalist);
        this.testStandardParams = datalist
      },
@@ -317,10 +320,10 @@
         this.testStandardParams.forEach(el => {
              el.packageBoxId =this.goid
         });
        console.log(this.testStandardParams,"niaho");
        saveList(this.testStandardParams).then((res) =>{
          console.log(res,"保存成功");
          this.$message.success('保存成功')
          this.testStandardParams
          this.rightquery()
        })
      },
      //删除
@@ -328,7 +331,7 @@
          console.log(row,"");
          deledata({id:row.id}).then((res)=>{
          this.$message.success('删除成功')
          this.testStandardParams
          this.rightquery()
          })
      },
      //审核
src/views/quality/Packaging_ledger/pack-from.vue
@@ -1,7 +1,7 @@
<template>
    <el-dialog
      width="60%"
      title="参数"
      title="新增"
      top="5vh"
      :visible.sync="innerVisible"
      :show="currshowlist"
@@ -11,7 +11,7 @@
    >
      <ttable
        :table="table"
        @handleSelectionChange="handleSelectionChange"
        @currentChange="Getdata"
        :prelang="prelang"
        :options="options"
        :ajaxFun="ajaxFun"
@@ -38,7 +38,7 @@
    },
    data() {
      return {
        datalistid:"",
        datalistid:{},
        ajaxFun: customerpage,
        currentRow: false,
        typeOptions: [],
@@ -145,27 +145,28 @@
    },
    methods: {
         // èŽ·å–æ•°æ®åˆ—è¡¨
        getData() {
        this.$refs.paramTable.getDataList()
        },
        handleSelectionChange(val){
            let data = val
            data.forEach(el => {
                this.datalistid = el
            });
            console.log(this.datalistid);
        // getData() {
        // this.$refs.paramTable.getDataList()
        // },
        Getdata(val){
            console.log(val);
            this.datalistid = val
        },
      saveSelectRow() {
        pagedataadd ({customerId:this.datalistid.id,contractNo:this.datalistid.contractNo}).then((res =>{
            console.log(res);
        let packageBox = {
            customerId:this.datalistid.id,
            contractNo:this.datalistid.contractNo
        }
        pagedataadd (packageBox).then((res =>{
            if (res.status === 200) {
                this.$message.success('新增成功')
                this.$emit('refreshDataList')
            }else{
                this.$message.error('创建失败')
            }
        }))
        this.innerVisible = false
          this.$emit('handleSelectionChange',this.innerVisible )
          this.$emit('wayapi',this.innerVisible )
      },
    }
  }
src/views/quality/Packaging_ledger/pack-fromadd.vue
@@ -146,14 +146,14 @@
        },
      saveSelectRow() {
        console.log(this.packageBoxIddata,"123");
        saveList ({customerId:this.datalistid.id,contractNo:this.datalistid.contractNo}).then((res =>{
            console.log(res);
            if (res.status === 200) {
                this.$message.success('新增成功')
            }else{
                this.$message.error('创建失败')
            }
        }))
        // saveList ({customerId:this.datalistid.id,contractNo:this.datalistid.contractNo}).then((res =>{
        //     console.log(res);
        //     if (res.status === 200) {
        //         this.$message.success('新增成功')
        //     }else{
        //         this.$message.error('创建失败')
        //     }
        // }))
        this.innerVisible = false
        //   this.$emit('handleSelectionChange',this.innerVisible )
      },
src/views/quality/packageinspect/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,229 @@
<!--
  -    Copyright (c) 2018-2025, ztt All rights reserved.
  -
  - Redistribution and use in source and binary forms, with or without
  - modification, are permitted provided that the following conditions are met:
  -
  - Redistributions of source code must retain the above copyright notice,
  - this list of conditions and the following disclaimer.
  - Redistributions in binary form must reproduce the above copyright
  - notice, this list of conditions and the following disclaimer in the
  - documentation and/or other materials provided with the distribution.
  - Neither the name of the pig4cloud.com developer nor the names of its
  - contributors may be used to endorse or promote products derived from
  - this software without specific prior written permission.
  - Author: ztt
  -->
  <template>
    <div class="mod-config">
        <basic-container>
            <ttable
            :table="table"
            :resultData="resultData"
            @handleSelectionChange="handleSelectionChange"
            :prelang="prelang"
            :options="options"
            :ajaxFun="ajaxFun"
            ref="packageInspectTable">
            <template #toolbar>
            </template>
            </ttable>
        </basic-container>
        <!-- å¼¹çª—, æ–°å¢ž / ä¿®æ”¹ -->
        <!-- <RawMaterialForm
            v-if="addOrUpdateVisible"
            ref="addOrUpdate"
            @refreshDataList="getData"
        ></RawMaterialForm> -->
    </div>
</template>
<script>
import ttable from '@/views/common/ztt-table.vue'
import { fetchList,deleteById } from '@/api/quality/packageInspect'
// import RawMaterialForm from './rawMaterial-form'
import * as fecha from 'element-ui/lib/utils/date'
import { mapGetters } from 'vuex'
  export default {
    data() {
        return {
            resultData:[],
            addOrUpdateVisible: false,
            type: [1],
            multipleSelection: [],
            prelang: 'packageInspect',
            ajaxFun: fetchList,
            options: {
                height: 300, // é»˜è®¤é«˜åº¦-为了表头固定
                stripe: true, // æ˜¯å¦ä¸ºæ–‘马纹 table
                highlightCurrentRow: false, // æ˜¯å¦è¦é«˜äº®å½“前行
                border: true, // æ˜¯å¦æœ‰çºµå‘边框
                lazy: false, // æ˜¯å¦éœ€è¦æ‡’加载
                fit: true, // åˆ—的宽度是否自撑开
                multiSelect: true, //
                seqNo: true,
                isRefresh: true, // æ˜¯å¦æ˜¾ç¤ºåˆ·æ–°æŒ‰é’®
                isShowHide: true, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®H
                isSearch: true, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
                defaultOrderBy: { column: 'createTime', direction: 'desc' },
            },
            table: {
                total: 0,
                currentPage: 1,
                pageSize: 20,
                data: [],
                // æ ‡é¢˜
                column: [
                    {
                        minWidth: '150',
                        prop: 'packInsNo',
                        label: '包装检验编号',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                        render: { fun: this.addOrUpdateHandle }
                    },
                    {
                        minWidth: '150',
                        prop: 'packageNo',
                        label: '包装编码',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text'
                    },
                    {
                        minWidth: '150',
                        prop: 'contractNo',
                        label: '合同号',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text'
                    },
                    {
                        minWidth: '150',
                        prop: 'projectName',
                        label: '项目名称',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text'
                    },
                    {
                        minWidth: '150',
                        prop: 'customerName',
                        label: '客户名称',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text'
                    },
                    {
                        minWidth: '150',
                        prop: 'createTime',
                        label: '报检日期',
                        isTrue: true,
                        sort: true,
                        isSearch: true,
                        searchInfoType: 'text',
                        formatter: this.formatDateTime,
                    },
                    {
                        minWidth: '150',
                        prop: 'createUser',
                        label: '报检人',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text'
                    },
                    {
                        minWidth: '150',
                        prop: 'result',
                        label: '结论',
                        isTrue: true,
                        isSearch: true,
                    },
                ],
                toolbar: [
                    // {
                    //     text: '新增',
                    //     type: 'primary',
                    //     fun: this.addOrUpdateHandle
                    // },
                ],
                operator: [
                {
                    text: '作废',
                    type: 'text',
                    size: 'small',
                    fun: this.deleteHandle
                }],
                operatorConfig: {
                fixed: 'right',
                label: '操作',
                width: 120,
                minWidth: 120
                },
            },
        }
    },
    components: {
        ttable,
    },
    created() { },
    computed: {
        ...mapGetters(['permissions'])
    },
    watch:{
    },
    methods:{
        // åˆ é™¤
        deleteHandle(row) {
            const _than = this
            this.$confirm('是否确认删除包装编号【' + row.packInsNo+'】的数据?' , '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                closeOnClickModal: false,
                type: 'warning'
            }).then(function() {
                deleteById(row.id).then((response)=>{
                    var data = response.data
                    if (data.code == 0) {
                        _than.$message.success('删除成功')
                    } else {
                        _than.$message.error('删除失败')
                    }
                    _than.getData()
                })
            }).catch((error) => {
                console.log(error);
            })
        },
        // æ–°å¢ž / ä¿®æ”¹
        addOrUpdateHandle(row) {
            this.$router.push({
                name: 'packageInspectForm',
                query: {
                    id: row == null ? null : row.id,
                 }
            })
        },
        formatResult(row, column, cellValue){
            if(cellValue != undefined || cellValue != null){
                if(cellValue == '不合格'){
                    return "<span style='color:#E84738;'>不合格</span>"
                }
                return "<span style='color:#34BD66;'>合格</span>"
            }
        },
        formatDateTime(row, column, cellValue) {
            return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
        },
        getData() {
            this.$refs.packageInspectTable.getDataList()
        },
        // table自带事件
        handleSelectionChange(val) {
            this.multipleSelection = val
        },
    }
  }
  </script>
src/views/quality/packageinspect/packageInspect-form.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,610 @@
<template>
    <div style="height: 100%">
    <div class="page-header">
      <div class="header-left">
        <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a>
        <h2>编辑-包装检验</h2>
      </div>
      <div class="btn-group header-right">
        <el-button @click="save()" type="primary">保存</el-button>
      </div>
    </div>
    <div class="page-main">
      <div class="packageInspect-basic">
        <el-form
        :model="dataForm"
        :rules="dataRule"
        ref="dataForm"
        style="width: 100%"
        class="l-mes"
        label-width="110px">
            <el-row>
              <el-col :span="6">
                <el-form-item label="包装检验编号" prop="packInsNo">
                <el-input v-model="dataForm.packInsNo" disabled>
                </el-input>
                </el-form-item>
            </el-col>
              <el-col :span="6">
                <el-form-item label="包装编号" prop="packageNo">
                <el-input v-model="dataForm.packageNo" disabled></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item  prop="projectName" label="项目名称" >
                  <el-tooltip :disabled="dataForm.projectName==null" :content="dataForm.projectName">
                    <el-input v-model="dataForm.projectName" disabled ></el-input>
                  </el-tooltip>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="客户名称" prop="customerName">
                    <el-input v-model="dataForm.customerName" disabled />
                </el-form-item>
            </el-col>
            </el-row>
            <el-row>
              <el-col :span="6">
                <el-form-item label="合同号" prop="contractNo">
                <el-input v-model="dataForm.contractNo" disabled></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                  <el-form-item label="报检日期" prop="createTime">
                      <el-input v-model="dataForm.createTime" disabled />
                  </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="报检人" prop="createUser">
                      <el-input v-model="dataForm.createUser" disabled />
                </el-form-item>
              </el-col>
            </el-row>
        </el-form>
      </div>
      <div class="packageInspect-detail">
        <el-row style="width:100%;z-index: 10;height:50px;">
            <el-col :span="22">检验项目</el-col>
            <el-col :span="2">
              <el-button style="width:100%" size="small" @click="clickAddLine()">添加检验项目</el-button>
            </el-col>
        </el-row>
        <el-row style="width:100%;">
            <el-col :span="24">
                <el-table
                :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
                :cell-style="{textAlign:'center'}"
                ref="table"
                :data="list"
                border
                style="width: 100%;"
                height="400"
                row-key="randomId" class="l-mes"
                default-expand-all
                :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                  <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 v-if="scope.row.children" class="inline-input" style="width:90%;" v-model="scope.row.name"
                          placeholder="请输入项目名称"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="required" label="要求" width="260">
                    <template slot-scope="scope">
                      <div>
                      <el-input v-model="scope.row.required"
                        placeholder="请输入要求"></el-input>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="note" label="检验描述" width="260" >
                    <template slot-scope="scope">
                      <div>
                        <el-input v-model="scope.row.note" placeholder="检验描述"></el-input>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column fixed="right" prop="testState" label="结论" min-width="150">
                    <template slot-scope="scope">
                        <el-select v-model="scope.row.result">
                            <el-option label="合格" value="合格"></el-option>
                            <el-option label="不合格" value="不合格"></el-option>
                        </el-select>
                    </template>
                  </el-table-column>
                  <el-table-column fixed="right" style="background-color: white;" label="操作" width="200">
                    <template slot-scope="scope">
                      <el-button icon="el-icon-circle-check" type="text" @click="savePackIns(scope.row,scope.$index)">保存</el-button>
                      <el-button v-if="scope.row.children" icon="el-icon-circle-plus-outline" type="text" @click="clickAddChildren(scope.row,scope.$index)">添加行</el-button>
                      <el-button v-if="!scope.row.children || scope.row.children.length==0"
                      icon="el-icon-circle-close" type="text"
                      @click="clickDelLine(scope.row,scope.$index,scope.row.children!=null)">取消</el-button>
                    </template>
                  </el-table-column>
                </el-table>
            </el-col>
        </el-row>
      </div>
      <div class="packageInspect-result">
        <el-row>
          <el-col :span="24">检验结论</el-col>
        </el-row>
        <el-row style="width:100%">
          <el-col :span="24">
            <el-table border height="90" :data="conclusionTable" ref="conclusion" v-model="conclusion"
            :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
            :cell-style="{textAlign:'center'}">
                <el-table-column prop="packageNo" label="包装编号"></el-table-column>
                <el-table-column prop="name" label="物料名称"></el-table-column>
                <el-table-column prop="userName" label="检验员"></el-table-column>
                <el-table-column prop="judgeState" label="检验结论">
                  <template slot-scope="scope">
                    <el-tag type="success" v-if="scope.row.testState == '1'">合格</el-tag>
                    <el-tag type="danger" v-else-if="scope.row.testState == '0'">不合格</el-tag>
                  </template>
                </el-table-column>
                <el-table-column  label="操作">
                    <template>
                        <el-button type="text" :disabled="resultVal!=null && dataForm.id!=null" @click="showDialog()" size="small">上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </div>
    </div>
    <el-dialog
      title="上报"
      :visible.sync="dialogVisible"
      width="30%" class="l-mes">
      <el-row>
        <el-col>
          <span>不合格数量:</span>
          <el-input type="number" v-model="unqualifiedNum" placeholder="请输入不合格数量"/>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="submitSave()">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  fetchListById,
  updatePackageInsProduct,
} from '@/api/quality/packageInspect'
export default {
    computed:{},
    components:{
    },
    data(){
        return{
            loading: false,
            unqualifiedNum: null,
            dialogVisible:false,
            resultVal: null,
            projectList: [],
            // æ·»åŠ åˆ—
            empiricalValueAdd: 1,
            // ç¼–辑时存储最长的列数字,做删除判断
            empiricalValueAddMaxNumber: 0,
            columnList: [],
            dataForm:{
                id: null,
                packInsNo: null,
                packageNo: '',
                contractNo: '',
                projectName: '',
                customerName: '',
                packageInsProductS: [{
                  deviceId: 0,
                  father:'',
                  name: '',
                  required: '',
                  testValue: '',
                  unit: '',
                  testValueList: []
                }]
            },
            form: null,
            list:[],
            conclusion: null,
            conclusionTable: [{
              packageNo: '',
              name: '',
              userName: '',
              testState: ''
            }],
            dataRule: {},
        }
    },
    beforeUpdate(){
      this.$nextTick(()=>{
        this.$refs.table.doLayout();
      })
    },
    created(){
      this.dataForm.id = this.$route.query.id
      this.init()
    },
    watch:{
      dialogVisible(newVal){
        if(newVal){
          this.unqualifiedNum = null
        }
      },
    },
    methods:{
      checkTestState(){
          let resultVal = '1'
          this.list.forEach(item=>{
              if(item.children){
                item.children.forEach(ele=>{
                  if(ele.testState == 0){
                      resultVal = '0'
                  }
                })
              }
          })
          this.resultVal = resultVal
          this.conclusionTable[0].testState = resultVal
          sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,resultVal)
      },
      showDialog(){
        let size = 0 //不合格项目数量
        this.list.forEach(item=>{
          if(item.children){
            let num = item.children.filter(e=>{
              return e.testState == 0
            }).length
            size+=num
          }
        })
        if (size > 0) {
          this.dialogVisible = true
        }else{
          this.submitSave()
        }
      },
      //上报
      submitSave(){
        let data = {
          id: this.dataForm.id,
          number: this.unqualifiedNum,
        }
        updateRawInspectsById(data).then(res => {
          if(res.data.code == 0 && (res.data.data=='1'|| res.data.data=='0')){
            sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,res.data.data)
            this.$message.success("上报成功");
          }else{
            this.$message.error("上报失败,",res.data.data);
          }
          this.dialogVisible = false
          this.checkTestState()
        });
      },
      // æ·»åŠ è¡Œ
      clickAddLine(row) {
          this.list.push({
            pId: '',
            name: '',
            note: '',
            required: '',
            result: '',
            randomId: Math.random(),
            children: []
          })
      },
      //添加子级
      clickAddChildren(row,index){
        console.log(row,index);
        row.children.push({
            note: '',
            required: '',
            result: '',
            randomId: Math.random(),
        })
      },
      // åˆ é™¤è¡Œ
      clickDelLine(row,index,isParent) {
        if(isParent){
          let parentIndex = this.list.findIndex(el =>{
            return el.randomId == row.randomId
          })
          this.list.splice(parentIndex,1)
        }else{
          let i = this.list.findIndex(el =>{
            return el.children.find(ele => ele.randomId == row.randomId)
          })
          let childrenIndex = this.list[i].children.findIndex(el =>{
            return el.randomId == row.randomId
          })
          this.list[i].children.splice(childrenIndex,1)
        }
      },
      //保存检查项
      savePackIns(row,index){
        if(row){
          let obj = {
            name: row.anme,
            note: row.note,
            packageInspectId: row.packageInspectId,
            required: row.required,
            result: row.result,
          }
          updatePackageInsProduct(obj).then(res=>{
            console.log(res);
          }).catch(error=>{
            console.log(error);
          })
        }
      },
      init(){
        if(this.dataForm.id){
          fetchListById(this.dataForm.id).then(res=>{
            let data = res.data.data
            this.dataForm.packInsNo = data.packInsNo
            this.dataForm.packageNo = data.packageNo
            this.dataForm.contractNo = data.contractNo
            this.dataForm.customerName = data.customerName
            this.dataForm.projectName = data.projectName
            this.dataForm.createTime = data.createTime
            this.dataForm.createUser = data.createUser
            this.list = data.packageInsProductS
          }).catch(error=>{
            this.$message.error("获取失败",error)
          })
        }else{
          this.conclusionTable = []
        }
      },
      changeState(row, index) {
          if (row.rpId != null && row.rpId != '') {
            let val = row.testValueList.join(",")
            if (val === undefined || val === '' || val === null) {
                return
            }
            let obj = {
              deviceId: row.deviceId,
              rpId: row.rpId,
              testValue: val,
              note: row.note
            }
            updateRawInsProduct(obj).then(res => {
                if (res.data.code == 0) {
                    this.$message.success("更新成功")
                } else {
                    this.$message.error("更新失败")
                }
                this.init()
            })
          }
      },
      save(){
        let data = this.dataForm
        this.list.forEach(item=>{
          item.children.forEach(c=>{
            c.testValue=c.testValueList.join(",")
          })
        })
        data.packageInsProductS = this.list
        addRawInspects(data).then(res=>{
            this.$message.success("保存成功")
            this.$router.go(-1)
        }).catch(error=>{
          this.$message.error(error)
        })
      },
    },
}
</script>
<style>
.packageInspect-detail {
  width: 100%;
  height: 490px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;
  background-color: #fff;
  margin-top: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.packageInspect-result {
  width: 100%;
  height: 150px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;
  background-color: #fff;
  margin-top: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.packageInspect-basic {
  background-color: #fff;
  height: 120px;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 20px;
  border: 1px solid #ddd;
  box-sizing: border-box;
}
.packageInspect-related-stock-part {
  background-color: #fff;
  width: 100%;
  height: 220px;
  border: 1px solid #ddd;
  padding: 10px 20px 0px 20px;
  box-sizing: border-box;
}
.packageInspect-bom {
  background-color: #fff;
  width: 100%;
  height: 499px;
  border: 1px solid #ddd;
  padding: 10px 20px;
  box-sizing: border-box;
}
.packageInspect-bom .el-card__header {
  padding: 1px 20px;
  border-bottom: 0px solid #ebeef5;
}
.packageInspect-bom .el-card__body {
  height: calc(100% - 22px);
}
.packageInspect-bom .el-card__body .el-collapse {
  height: 100%;
  overflow: auto;
}
.packageInspect-technology-params {
  background-color: #fff;
  width: calc(52% - 20px);
  float: left;
  height: 719px;
  border: 1px solid #ddd;
  padding: 10px 20px;
  margin-left: 20px;
}
.packageInspect-structure {
  background-color: #fff;
  width: 35%;
  float: left;
  height: 719px;
  border: 1px solid #ddd;
  padding: 10px 20px;
  box-sizing: border-box;
}
.packageInspect-flow {
  background-color: #fff;
  width: calc(65% - 20px);
  float: left;
  height: 719px;
  border: 1px solid #ddd;
  padding: 10px 20px;
  margin-left: 20px;
  box-sizing: border-box;
}
/*自定义disabled状态下checkbox的样式*/
.completeproductstructure-checkout
  .el-checkbox__input.is-disabled.is-checked
  .el-checkbox__inner {
  background-color: #006eff;
  border-color: #006eff;
}
.completeproductstructure-checkout
  .el-checkbox__input.is-disabled.is-checked
  + span.el-checkbox__label {
  color: #006eff;
  border-color: #006eff;
}
.completeproductstructure-checkout
  .el-checkbox__input.is-disabled
  .el-checkbox__inner {
  background-color: #ffffff;
  cursor: pointer;
}
.completeproductstructure-checkout
  .el-checkbox__input.is-disabled
  + span.el-checkbox__label {
  color: #606266;
  cursor: pointer;
}
.completeproductstructure-checkout .el-checkbox__inner::after {
  border: 1px solid #fff !important;
  border-left: 0 !important;
  border-top: 0 !important;
  cursor: pointer !important;
}
.packageInspect-bom-div {
  width: 100%;
  margin-bottom: 5px;
}
.packageInspect-technology-div {
  width: 100%;
  margin-bottom: 5px;
  margin-right: 10px;
}
.packageInspect-technology-div .el-collapse {
  border-top: 0px;
  border-bottom: 0px;
}
.structure-detail-table th.gutter {
  display: table-cell !important;
  width: 10px !important;
}
.structure-detail-table colgroup.gutter {
  display: table-cell !important;
  width: 10px !important;
}
.final-product-checkout .el-card__header {
  padding: 0px 20px;
  border-bottom: 0px;
}
.final-product-checkout .el-card__body {
  padding: 0px 20px 20px;
}
.orimaterial-quantity .el-card__header {
  padding: 0px 20px;
  border-bottom: 0px;
}
.orimaterial-quantity .el-card__body {
  padding: 0px 20px 20px;
}
.packageInspect-materialcost-table th.gutter {
  display: table-cell !important;
  width: 10px !important;
}
.packageInspect-materialcost-table colgroup.gutter {
  display: table-cell !important;
  width: 10px !important;
}
.GooFlow .ico .ico_start:before {
  color: red;
}
.highlight-tab-class {
  color: #006eff;
  background: #e4e7ed;
  border-top: 1px solid #006eff;
}
.unhighlight-tab-class {
  border: 1px solid #e4e7ed;
  border-bottom: none;
}
.avue-crud__menu{
  min-height: 0px;
}
</style>
vue.config.js
@@ -3,10 +3,11 @@
 * https://cli.vuejs.org/zh/config/
 */
// const url = 'http://192.168.2.7:9999'
const url = 'http://192.168.2.7:9999'
//const url = 'http://192.168.32.45:9999'
// const url = 'http://192.168.0.23:9999'
 const url = 'http://localhost:9999'
//  const url = 'http://localhost:9999'
// const url = 'http://ztt-gateway:9999'
const localUrl = 'http://localhost:8089'