王震
2024-01-18 8b88172ca8801bf26a083098a09d637b11da9f01
src/views/quality/packageinspect/packageInspect-form.vue
@@ -66,7 +66,7 @@
        <el-row :gutter="10" style="width:100%;z-index: 10;height:30px;">
            <el-col :span="12">检验项目</el-col>
            <el-col :span="12" style="text-align: right;">
                <el-dropdown @command="handleCommand" v-if="!isShow && resultVal==null">
                <el-dropdown @command="handleCommand" v-if="isShow">
                    <el-button size="mini" style="margin-right: 10px;" type="primary" >
                        切换检验项模板<i class="el-icon-arrow-down el-icon--right"></i>
                    </el-button>
@@ -92,7 +92,10 @@
                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 type="index" prop="parentIndex" label="序号" width="60">
                    <template scope="scope">
                        <span v-if="scope.row.isIndex">{{scope.row.parentIndex}}</span>
                    </template>
                  </el-table-column>
                  <el-table-column prop="name" label="项目" width="160">
                    <template slot-scope="scope">
@@ -195,7 +198,6 @@
  getCustomer,
} from '@/api/quality/packageInspect'
import {getAllTemplateByEnable} from '@/api/quality/packageInspectTemp'
import {inspect1,inspect2} from '@/const/defaultPackageInspect'
export default {
    computed:{
    },
@@ -204,7 +206,7 @@
    data(){
        return{
            inspectMoulds: [],
            isShow: false,
            isShow: true,
            submitData: {
              id:null,
              result: null,
@@ -257,7 +259,6 @@
      }
      this.getAllInspect()
      this.init()
      this.checkShowState()
    },
    watch:{
@@ -274,7 +275,7 @@
            if(ele.children){
                ele.children.forEach(c=>{
                    if(c.pid){
                        num++
                        num+=1
                    }
                })
            }
@@ -368,6 +369,8 @@
      clickAddLine() {
          this.list.push({
            name: '',
            isIndex : true,
            parentIndex : this.list.length + 1,
            randomId: Math.random(),
            isEdit: true,
            children: [{
@@ -458,10 +461,12 @@
            let userNameList = []
            if(dataList){
                let tempList = []
                dataList.forEach(ele=>{
                dataList.forEach((ele,index)=>{
                    let obj = {
                        randomId: Math.random(),
                        name: ele.inspectName,
                        isIndex: true,
                        parentIndex: index+1,
                        children: []
                    }
                    if(ele.children){
@@ -479,9 +484,11 @@
                })
                _than.list = tempList
            }
            data.packageInsProductS.forEach(item => {
            data.packageInsProductS.forEach((item,index) => {
              if (item.children) {
                    let ele = {
                      isIndex: true,
                      parentIndex: index+1,
                      isEdit: true,
                      randomId: Math.random(),
                      name: null,
@@ -506,9 +513,7 @@
                    _than.list.push(ele)
                }
              })
            //   let find1 = this.list.find(ele=>ele.name===inspect1[0].name&&ele.isEdit) !=undefined;
            //   let find2 = this.list.find(ele=>ele.name===inspect2[0].name&&ele.isEdit) !=undefined;
            //   this.isShow = find1||find2
              _than.conclusionTable = [{
                packageNo: data.packageNo,
                userName: Array.from(new Set(userNameList)).join(','),
@@ -517,6 +522,7 @@
              _than.$nextTick(()=>{
                if(_than.list.length>0){
                    _than.changeResult()
                    _than.checkShowState()
                }
              })
          }).catch(error=>{