Fixiaobai
2023-09-24 49f3321fa839e0ff5fb4d2de75756096a6db7b92
Merge branch 'master' of http://114.132.189.42:9002/r/mom-before
已修改20个文件
25846 ■■■■ 文件已修改
index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 16106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js 201 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/Technicalindex.vue 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/finishedProductInspection.vue 863 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/finishedProductInspectionUp.vue 1380 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/laboratoryManagement.vue 1755 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/mbom.vue 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/processInspection.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/processInspectionUpdate.vue 1339 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/raw-ins.vue 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/rawInsBox.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/rawInsDetail.vue 1212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/record-content.vue 528 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/sale.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/technology.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/technology.vue 1413 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
index.html
@@ -6,7 +6,7 @@
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    <title>中天海洋MOM</title>
    <title>中天海洋MES</title>
    <link rel="icon" type="image/x-icon" href="./static/img/logo.png">
  </head>
  <body>
package-lock.json
ÎļþÌ«´ó
src/assets/api/controller.js
@@ -2,42 +2,42 @@
const standard = {
    // æŠ€æœ¯ç®¡ç†-标准Bom
    selectTreeByMaterial: "material/selectTreeByMaterial", //查询物料的树
    selectVersion:"/material/selectVersion",//右侧版本
    selectVersion: "/material/selectVersion", //右侧版本
    selectProductByMaterial: "product/selectTreeByMaterial", //根据物料查询项目表格
    selectTechnologyByMaterial: "technology/select",
    selectAll:"/material/selectAll",//右侧数据
    technologyWrite:"/technology/write",//工艺路线,移开保存生产定额
    writeDevice:"/technology/writeDevice",//工艺路线,选择设备组,移开保存
    productWrite:"/product/write",//技术指标,移开保存内控值和标准值
    chooseFather: "/technology/chooseFather",//获取工序列表
    chooseDevice: "/technology/chooseDevice",//获取设备组列表
    addTechnology: "/technology/add",//添加工艺路线
    leftAddOneTwo: "/material/add",//左侧新增1,2级
    leftAddThree: "/standard/add",//左侧三级新增
    leftAddFour: "/specifications/add",//左侧四级新增
    chooseTechByStandard:"/product/chooseTech",//右上角新增-->技术指标-->选择工序,工艺
    chooseFatherByStandard:"/product/chooseFather",//右上角新增-->技术指标-->选择项目父类
    addProductByStandard:"/product/add",//右上角新增-->技术指标
    addMBomByStandard:"/mbom/add",//右上角新增-->物料清单
    chooseTechByMBom:"/mbom/chooseTech",//右上角新增-->物料清单-->选择工序,工艺
    mBomWrite:"/mbom/write",//物料清单-->数量,移开保存
    chooseTechByProduct:"/technique/chooseTech",//右上角新增-->生产工艺-->选择工序,工艺
    addTechniqueByStandard:"/technique/add",//右上角新增-->生产工艺
    chooseProByProduct:"/technique/choosePro",//右上角新增-->生产工艺-->选择项目(父子),单位
    chooseDevByProduct:"/technique/chooseDev",//右上角新增-->生产工艺-->选择设备
    addVersion:"/material/addVersion",//添加同一个型号工艺路线,技术指标,物料清单,生产工艺的版本
    delAllByTechnology:"/technology/delAllTech",//工艺路线-批量删除
    delAllByTarget:"/product/delAllPro",//技术指标-批量删除
    delAllByMBom:"/mbom/delAllMbom",//物料清单-批量删除
    delAllByProduct:"/technique/delAllTeq",//生产工艺-批量删除
    selectAll: "/material/selectAll", //右侧数据
    technologyWrite: "/technology/write", //工艺路线,移开保存生产定额
    writeDevice: "/technology/writeDevice", //工艺路线,选择设备组,移开保存
    productWrite: "/product/write", //技术指标,移开保存内控值和标准值
    chooseFather: "/technology/chooseFather", //获取工序列表
    chooseDevice: "/technology/chooseDevice", //获取设备组列表
    addTechnology: "/technology/add", //添加工艺路线
    leftAddOneTwo: "/material/add", //左侧新增1,2级
    leftAddThree: "/standard/add", //左侧三级新增
    leftAddFour: "/specifications/add", //左侧四级新增
    chooseTechByStandard: "/product/chooseTech", //右上角新增-->技术指标-->选择工序,工艺
    chooseFatherByStandard: "/product/chooseFather", //右上角新增-->技术指标-->选择项目父类
    addProductByStandard: "/product/add", //右上角新增-->技术指标
    addMBomByStandard: "/mbom/add", //右上角新增-->物料清单
    chooseTechByMBom: "/mbom/chooseTech", //右上角新增-->物料清单-->选择工序,工艺
    mBomWrite: "/mbom/write", //物料清单-->数量,移开保存
    chooseTechByProduct: "/technique/chooseTech", //右上角新增-->生产工艺-->选择工序,工艺
    addTechniqueByStandard: "/technique/add", //右上角新增-->生产工艺
    chooseProByProduct: "/technique/choosePro", //右上角新增-->生产工艺-->选择项目(父子),单位
    chooseDevByProduct: "/technique/chooseDev", //右上角新增-->生产工艺-->选择设备
    addVersion: "/material/addVersion", //添加同一个型号工艺路线,技术指标,物料清单,生产工艺的版本
    delAllByTechnology: "/technology/delAllTech", //工艺路线-批量删除
    delAllByTarget: "/product/delAllPro", //技术指标-批量删除
    delAllByMBom: "/mbom/delAllMbom", //物料清单-批量删除
    delAllByProduct: "/technique/delAllTeq", //生产工艺-批量删除
    // æŠ€æœ¯ç®¡ç†-技术文件
    selectAllOrder: "/orders/selectAllOrder", //查询所有订单列表
    selectOrderById: "/orders/selectOrderById", //根据订单id查询订单详情
    //订单BOM
    delDevice:"/device/delDeviceById",//订单Bom
    compile:"/orders/compile",//编制
    delDevice: "/device/delDeviceById", //订单Bom
    compile: "/orders/compile", //编制
}
// åŽŸææ–™æ£€éªŒ
const raw = {
@@ -50,17 +50,17 @@
    updateDevByRpId: "/rawInsProduct/updateDevByRpId", // æ›´æ”¹è®¾å¤‡
}
//不合格原材料
const unqualifiedaa ={
const unqualifiedaa = {
    selectUnRawInspectsList: "/inspectUnaccepted/selectURawMaterials", // æŸ¥è¯¢åŽŸææ–™ä¸åˆæ ¼å“æ£€éªŒå•åˆ—è¡¨
    evaluatePassOrNo: "/inspectUnaccepted/evaluatePassOrNo" // è¯„审
}
// æŸ¥è¯¢æˆå“ä¸åˆæ ¼å“ç®¡ç†
const unRawInspects ={
const unRawInspects = {
    inspectUnaccepted: "/inspectUnaccepted/selectUnRawInspectsList"
}
//不合格品处置
const dispose = {
    getTable: "/inspectUnaccepted/selectDisposal", // ä¸åˆæ ¼å“åˆ†é¡µåˆ—表
    getTable: "/inspectUnaccepted/selectDisposal", // ä¸åˆæ ¼å“åˆ†é¡µåˆ—表
    descriptionUpdate: "/inspectUnaccepted/descriptionUpdate", // å¤±ç„¦æ›´æ–°çŽ°åƒæè¿°
    viewEditorial: "/inspectUnaccepted/viewEditorial", // æŸ¥çœ‹ç¼–辑意见
    clickEditing: "/inspectUnaccepted/clickEditing", // ç‚¹å‡»ç¼–辑意见触发查询
@@ -72,38 +72,38 @@
    // listMaterial:"/finished-inspect/list_material",//添加检验单时的项目列表
    finishedInspectUser: "/finished-inspect/page_user", //获取所有主机工
    projectListByfinishId: "/inspection-item/list_user", //根据id查询所有项目
    processInspectAddProcess: "/processInspect/addProcess",//新增检验
    inspectionItemListUser: "/inspection-item/list_user",//查询所有检验项目
    finishedInspectChooseMater: "/finished-inspect/chooseMater",//根据订单号得到信息
    processInspectAddProcess: "/processInspect/addProcess", //新增检验
    inspectionItemListUser: "/inspection-item/list_user", //查询所有检验项目
    finishedInspectChooseMater: "/finished-inspect/chooseMater", //根据订单号得到信息
    finishedInspectAddFinish: "/finished-inspect/addFinish", //新增成品检验
    finishedInspectUpdateFinishInspectsById: "/finished-inspect/updateFinishInspectsById",//上报
    finishedInspectUpdateFinishInspectsById: "/finished-inspect/updateFinishInspectsById", //上报
    finishedInspectSelectFinishInspectsListById: "/finished-inspect/selectFinishInspectsListById"
}
// è¿‡ç¨‹æ£€éªŒ
const processInspection = {
    selectProcessInspectsList: "/processInspect/selectProcessInspectsList", // åˆ†é¡µæŸ¥è¯¢è¿‡ç¨‹æ£€éªŒå•列表
    chooseMaterProcessInspect: "/processInspect/chooseMater",//根据订单号选择产品和工艺
    inspectionItemUpdateDevByInsId: "/inspection-item/updateDevByInsId",//更改设备
    inspectionItemlose_focus_update: "/inspection-item/lose_focus_update",//检验值
    processInspectUpdateProcessInspectsById: "/processInspect/updateProcessInspectsById",//上报
    chooseMaterProcessInspect: "/processInspect/chooseMater", //根据订单号选择产品和工艺
    inspectionItemUpdateDevByInsId: "/inspection-item/updateDevByInsId", //更改设备
    inspectionItemlose_focus_update: "/inspection-item/lose_focus_update", //检验值
    processInspectUpdateProcessInspectsById: "/processInspect/updateProcessInspectsById", //上报
    inspectionItemChooseDev: "/inspection-item/chooseDev",
    processInspectSelectProcessInspectsListById: "/processInspect/selectProcessInspectsListById"
    processInspectSelectProcessInspectsListById: "/processInspect/selectProcessInspectsListById"
}
// QMS实验室管理
const laboratory = {
  delDeviceById:"/device/delDeviceById",//删除
  addApi:"/device/add",//新增
  listgroup:"/device/list_group",
  selectDevice:"/device/selectDevice",//右边展示
  addDeviceInspectDownBox: "/device/listInspect", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæ£€éªŒé¡¹ç›®ä¸‹æ‹‰æ¡†
  selectDeviceInspectMessage: "/device/inspectId", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæ ¹æ®æ£€éªŒé¡¹ç›®ID查询数据
  addDeviceKeeper: "/device/list_user",// æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šä¿ç®¡äººä¸‹æ‹‰æ¡†
  addDeviceParentClassification: "/device/parent_classification", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæŸ¥è¯¢çˆ¶çº§åˆ†ç±»
  addDeviceInstrument: "/device/add", // æ–°å¢žä»ªå™¨è®¾å¤‡
  towTree: "/device/two_tree", //二级树
  tableDeviceList: "/device/table_list", // å®žéªŒå®¤æ¨¡å—表格数据
  deleteDevice: "/device/delete", // åˆ é™¤å®žéªŒå®¤è®¾å¤‡
  deleteIdorFather: "/device/deleteIdorFather" // åˆ é™¤æ ‘模块数据
    delDeviceById: "/device/delDeviceById", //删除
    addApi: "/device/add", //新增
    listgroup: "/device/list_group",
    selectDevice: "/device/selectDevice", //右边展示
    addDeviceInspectDownBox: "/device/listInspect", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæ£€éªŒé¡¹ç›®ä¸‹æ‹‰æ¡†
    selectDeviceInspectMessage: "/device/inspectId", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæ ¹æ®æ£€éªŒé¡¹ç›®ID查询数据
    addDeviceKeeper: "/device/list_user", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šä¿ç®¡äººä¸‹æ‹‰æ¡†
    addDeviceParentClassification: "/device/parent_classification", // æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šæŸ¥è¯¢çˆ¶çº§åˆ†ç±»
    addDeviceInstrument: "/device/add", // æ–°å¢žä»ªå™¨è®¾å¤‡
    towTree: "/device/two_tree", //二级树
    tableDeviceList: "/device/table_list", // å®žéªŒå®¤æ¨¡å—表格数据
    deleteDevice: "/device/delete", // åˆ é™¤å®žéªŒå®¤è®¾å¤‡
    deleteIdorFather: "/device/deleteIdorFather" // åˆ é™¤æ ‘模块数据
}
//search_class:codeNameModel
@@ -117,62 +117,62 @@
    meteringPlanDevicePlan: "/meteringPlan/add_plan", // è®¡é‡è®¡åˆ’-->新增按钮
}
//基础数据
const Basicdata ={
    selectAllTechNam:"/technologyTemplate/selectAllTechNam",//工艺路线-->右边
    selectAllTechTem:"/technologyTemplate/selectAllTechTem",//工艺路线-->左边
    chooseDevGroup:"/technologyTemplate/chooseDevGroup",//新增工艺路线--》选择设备组
    chooseElement:"/technologyTemplate/chooseElement",//新增工艺路线-->选择元件
    addTechTemp:"/technologyTemplate/addTechTemp",//新增工艺路线==>新增
    chooseTech:"/technologyTemplate/chooseTech",//新增工艺路线--》选则工序
    writeTechById:"/technologyTemplate/writeTechById",//新增工艺路线-->编辑传参
    delTechById:"/technologyTemplate/delTechById",//新增工艺路线==>删除
    selecTechById:"/technologyTemplate/selecTechById",//新增工艺路线--》编辑
    delAllTech:"/technologyTemplate/delAllTech",//批量删除
const Basicdata = {
    selectAllTechNam: "/technologyTemplate/selectAllTechNam", //工艺路线-->右边
    selectAllTechTem: "/technologyTemplate/selectAllTechTem", //工艺路线-->左边
    chooseDevGroup: "/technologyTemplate/chooseDevGroup", //新增工艺路线--》选择设备组
    chooseElement: "/technologyTemplate/chooseElement", //新增工艺路线-->选择元件
    addTechTemp: "/technologyTemplate/addTechTemp", //新增工艺路线==>新增
    chooseTech: "/technologyTemplate/chooseTech", //新增工艺路线--》选则工序
    writeTechById: "/technologyTemplate/writeTechById", //新增工艺路线-->编辑传参
    delTechById: "/technologyTemplate/delTechById", //新增工艺路线==>删除
    selecTechById: "/technologyTemplate/selecTechById", //新增工艺路线--》编辑
    delAllTech: "/technologyTemplate/delAllTech", //批量删除
    addTechMode:"/technicalModel/addTechMode",//技术指标---》新增
    delTechBy:"/technicalModel/delTechById",//技术--.删除
    delAllTechskill:"/technicalModel/delAllTech",//批量删除
    selectAllleft:"/technicalModel/selectAllTechTem",//技术指标-->左边
    selectAllright:"/technicalModel/selectAllTechNam",//技术指标--》右边
    chooseProFath:"/technicalModel/chooseProFath",//技术指标---》父类选择
    chooseTechFath:    "/technicalModel/chooseTechFath",// æŠ€æœ¯--->工序工艺
    selecTech:"/technicalModel/selecTechById",//技术--->编辑
    writeTechByIdskill:"/technicalModel/writeTechById",//编辑传
    addTechMode: "/technicalModel/addTechMode", //技术指标---》新增
    delTechBy: "/technicalModel/delTechById", //技术--.删除
    delAllTechskill: "/technicalModel/delAllTech", //批量删除
    selectAllleft: "/technicalModel/selectAllTechTem", //技术指标-->左边
    selectAllright: "/technicalModel/selectAllTechNam", //技术指标--》右边
    chooseProFath: "/technicalModel/chooseProFath", //技术指标---》父类选择
    chooseTechFath: "/technicalModel/chooseTechFath", // æŠ€æœ¯--->工序工艺
    selecTech: "/technicalModel/selecTechById", //技术--->编辑
    writeTechByIdskill: "/technicalModel/writeTechById", //编辑传
    selectAllMbom:"/mbomModel/selectAllMbom",//物料维护--》右边
    addMbom:"/mbomModel/addMbom",//物料--->新增
    material:"/mbomModel/delMbomById",//物料清单删除
    delAllMbom:"/mbomModel/delAllMbom",//批量删除
    selectAllMbom: "/mbomModel/selectAllMbom", //物料维护--》右边
    addMbom: "/mbomModel/addMbom", //物料--->新增
    material: "/mbomModel/delMbomById", //物料清单删除
    delAllMbom: "/mbomModel/delAllMbom", //批量删除
    selectAllTeque:"/techniqueModel/selectAllTeque",//生产工艺维护---。右边
    selectAllTeque: "/techniqueModel/selectAllTeque", //生产工艺维护---。右边
    selectAllSelf:"/selfcheckModel/selectAllSelf",//自建维护-----》右边
    addSelfcheck:"/selfcheckModel/addSelfcheck",//自检  ------》新增
    delSelfcheck:"/selfcheckModel/delSelfcheckById",//自检----.删除
    delAll:"selfcheckModel/delAllTech",//批量删除---.自检
    selectAllSelf: "/selfcheckModel/selectAllSelf", //自建维护-----》右边
    addSelfcheck: "/selfcheckModel/addSelfcheck", //自检  ------》新增
    delSelfcheck: "/selfcheckModel/delSelfcheckById", //自检----.删除
    delAll: "selfcheckModel/delAllTech", //批量删除---.自检
    selectjilu:"/recordModel/selectAllRecord",//生产记录维护---》右边
    selecRecord:"/recordModel/selecRecordById",//生产记录----.新增
    writeRecordById:"/recordModel/writeRecordById",//编辑
    delQueByIdapi:"/recordModel/delQueById",//删除---.记录内容
    delAllRecord:"/recordModel/delAllRecord",//删除批量--->记录
    addRecord:"/recordModel/addRecord",//生产记录-------.新增
    selectjilu: "/recordModel/selectAllRecord", //生产记录维护---》右边
    selecRecord: "/recordModel/selecRecordById", //生产记录----.新增
    writeRecordById: "/recordModel/writeRecordById", //编辑
    delQueByIdapi: "/recordModel/delQueById", //删除---.记录内容
    choosePro:"/techniqueModel/choosePro",//新增生产工艺维护---》选择父类
    chooseDeiv:"/techniqueModel/chooseDeiv",//新增----->设备
    addQeMode:"/techniqueModel/addQeMode",//新增----》传参
    delQueById:"/techniqueModel/delQueById",//删除
    delAllQue:"/techniqueModel/delAllQue",//批量删除
    selecQueById:"/techniqueModel/selecQueById",//编辑
    writeQueById:"/techniqueModel/writeQueById",//编辑传参
    delAllRecord: "/recordModel/delAllRecord", //删除批量--->记录
    addRecord: "/recordModel/addRecord", //生产记录-------.新增
    choosePro: "/techniqueModel/choosePro", //新增生产工艺维护---》选择父类
    chooseDeiv: "/techniqueModel/chooseDeiv", //新增----->设备
    addQeMode: "/techniqueModel/addQeMode", //新增----》传参
    delQueById: "/techniqueModel/delQueById", //删除
    delAllQue: "/techniqueModel/delAllQue", //批量删除
    selecQueById: "/techniqueModel/selecQueById", //编辑
    writeQueById: "/techniqueModel/writeQueById", //编辑传参
}
const url = {
    enter: "user/enter", //登录
    ...standard,
    ...raw,
      ...laboratory,
    ...laboratory,
    ...measure,
    ...finishedIns,
    ...unqualifiedaa,
@@ -185,10 +185,11 @@
    selectSaleDatilById: "sale/selectSaleDatilById", //根据销售单id查看详情,
    addSale: "sale/addSale", //新增销售单
    saleCheck: "sale/check", //审核销售单
    synchronization: "sale/synchronization",//同步
    synchronization: "sale/synchronization", //同步
    updateSaleById: "sale/updateSaleById", //根据销售单id修改详情信息
    delSale: "sale/delSale", //根据销售单id删除
    delAllSale: "sale/delAllSale", //批量删除销售单
    delAllSale: "sale/delAllSale", //批量删除销售单,
    chooseType: "technologyTemplate/chooseType", //查询类型
}
@@ -197,4 +198,4 @@
    Vue.prototype.$api = {
        url
    }
}
}
src/components/view/Technicalindex.vue
@@ -35,7 +35,6 @@
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="11">
                                <el-form-item label="项目组">
@@ -48,7 +47,6 @@
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-form-item label="单位">
                            <el-input v-model="form.name" placeholder="请输入单位" style="width: 220px;"></el-input>
                        </el-form-item>
@@ -63,17 +61,8 @@
                <span>类型:</span>
                <el-select v-model="search.type" size="small" placeholder="请选择" @change="TYpe"
                    style="width: 224px;margin-right: 30px;">
                    <el-option label="橡胶连接器" :value="0"></el-option>
                    <el-option label="金属连接器" :value="1"></el-option>
                    <el-option label="湿插拔电连接器" :value="2"></el-option>
                    <el-option label="分支组件" :value="3"></el-option>
                    <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                </el-select>
                <!-- <span>工序:</span>
            <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
            </el-select>
            <el-button size="mini"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" style="background: #004EA2;"><span>查询</span></el-button> -->
            </div>
            <div class="thing">
                <!-- ä¸»ä½“å·¦ -->
@@ -85,21 +74,15 @@
                        <div class="custom-tree-node" slot-scope="{ node, data }">
                            <span><i :class="`node_i ${data.code != '[2]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                                {{data.code}} {{ data.name }}</span>
                            <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)">
                            <i class="el-icon-delete"></i>
                        </el-button> -->
                        </div>
                    </el-tree>
                </div>
                <!-- ä¸»ä½“右 -->
                <div class="right">
                    <el-table :data="tableData" style="width: 100%;overflow-y: auto;min-height: 100%"
                        max-height="100%" row-key="name" border
                        @select-all="selectAll"
                        @select="selectTr"
                        ref="multipleTable"
                        @selection-change="handleSelectionChange"
                        default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                    <el-table :data="tableData" style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%"
                        row-key="name" border @select-all="selectAll" @select="selectTr" ref="multipleTable"
                        @selection-change="handleSelectionChange" default-expand-all
                        :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                        <el-table-column type="selection" width="55">
                        </el-table-column>
                        <el-table-column type="index" width="50">
@@ -129,17 +112,13 @@
                <div>
                    <el-dialog title="编辑技术内容" :visible.sync="upDia" width="500px">
                        <div class="body">
                            <el-row style="line-height: 46px;">
                                <el-col :span="4" style="font-size: 14px;text-align: right;">类型:</el-col>
                                <el-col :span="16" :offset="1">
                                    <template>
                                        <el-select v-model="edit.type" disabled placeholder="请选择" @change="TYpe"
                                            style="width: 306px;margin-right: 30px;">
                                            <el-option label="橡胶连接器" :value="0"></el-option>
                                            <el-option label="金属连接器" :value="1"></el-option>
                                            <el-option label="湿插拔电连接器" :value="2"></el-option>
                                            <el-option label="分支组件" :value="3"></el-option>
                                            <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                                        </el-select>
                                    </template>
                                </el-col>
@@ -201,10 +180,7 @@
                                <template>
                                    <el-select v-model="form.type" size="small" placeholder="请选择" @change="edittype"
                                        style="width: 98%;margin-right: 30px;">
                                        <el-option label="橡胶连接器" :value="0"></el-option>
                                        <el-option label="金属连接器" :value="1"></el-option>
                                        <el-option label="湿插拔电连接器" :value="2"></el-option>
                                        <el-option label="分支组件" :value="3"></el-option>
                                        <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                                    </el-select>
                                </template>
                            </el-form-item>
@@ -212,7 +188,7 @@
                                <el-col :span="11">
                                    <el-form-item label="工序">
                                        <template>
                                            <el-select v-model="form.work" placeholder="请选择" allow-create filterable @change="workevent">
                                            <el-select v-model="form.work" placeholder="请选择" @change="workevent">
                                                <el-option v-for="(item,index) in process" :key="item.name" :label="item.name"
                                                    :value="item.name">
                                                </el-option>
@@ -223,7 +199,7 @@
                                <el-col :span="11" :offset="2">
                                    <el-form-item label="工艺">
                                        <template>
                                            <el-select v-model="form.name" style="width: 95%;" placeholder="请选择" @change="craftrow" allow-create filterable>
                                            <el-select v-model="form.name" style="width: 95%;" placeholder="请选择" @change="craftrow">
                                                <el-option v-for="item in craftapi" :key="item.id" :label="item.name" :value="item.id">
                                                </el-option>
                                            </el-select>
@@ -231,7 +207,6 @@
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="11">
                                    <el-form-item label="项目组">
@@ -240,23 +215,6 @@
                                                <el-option v-for="item in higherlevel" :key="item" :label="item" :value="item">
                                                </el-option>
                                            </el-select>
                                            <!-- <el-autocomplete
                                popper-class="my-autocomplete"
                                v-model="form.father"
                                :fetch-suggestions="higherlevel"
                                placeholder="请输入内容"
                                @select="electadd">
                                <i
                                    class="el-icon-edit el-input__icon"
                                    slot="suffix"
                                    @click="handleIconClick">
                                </i>
                                <template slot-scope="{ item }">
                                    <div class="name">{{ item }}</div>
                                    <span class="addr">{{ item}}</span>
                                </template>
                                </el-autocomplete> -->
                                        </template>
                                    </el-form-item>
                                </el-col>
@@ -266,7 +224,6 @@
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-form-item label="单位">
                                <el-input v-model="form.unit" placeholder="请输入单位" style="width: 35.95%;"></el-input>
                            </el-form-item>
@@ -285,111 +242,117 @@
    export default {
        data() {
            return {
              search:{
                type:0,
                technology:null,
              },
            //   handleClose:[],
                checkTreeNode :{
                    id:'',
                },
                higherlevel:[],
                value:{},
                options:[],
                process:[],
                filterNode:[],
                list: [],
                form:{
                    father:'',
                    work:'',
                    name:'',
                    unit:'',
                    project:'',
                },
                children:[],
                modifyevent:false,
                dialogVisible:false,
                tableData: [],
                crafval:'',
                typeselect:0,
                upData:{},
                upDia:false,
                craftapi:[],
                edit:{
                    techFather:'',
                    techName:'',
                    father:'',
                    name:'',
                    unit:'',
                    id:'',
                },
                isAllSelect:false,
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectAllright()
                search: {
                    type: 0,
                    technology: null,
                },
                checkTreeNode: {
                    id: '',
                },
                higherlevel: [],
                value: {},
                options: [],
                process: [],
                filterNode: [],
                list: [],
                form: {
                    father: '',
                    work: '',
                    name: '',
                    unit: '',
                    project: '',
                },
                children: [],
                modifyevent: false,
                dialogVisible: false,
                tableData: [],
                crafval: '',
                typeselect: 0,
                upData: {},
                upDia: false,
                craftapi: [],
                edit: {
                    techFather: '',
                    techName: '',
                    father: '',
                    name: '',
                    unit: '',
                    id: '',
                },
                isAllSelect: false,
                bigType: []
            }
        },
        methods:{
        mounted() {
            this.chooseType()
        },
        methods: {
            chooseType() {
                this.$axios.get(this.$api.url.chooseType).then(res => {
                    this.bigType = res.data
                    this.typeselect = res.data[0]
                    this.search.type = res.data[0]
                    this.selectAllleft()
                    this.selectAllright()
                })
            },
            handleSelectionChange(val) {
                this.selects = val;
                this.deleteList = [];
                val.forEach((v) => {
                if (v.id !== undefined) {
                    this.deleteList.push(v.id);
                }
                });
                val.forEach((v) => {
                    if (v.id !== undefined) {
                        this.deleteList.push(v.id);
                    }
                });
            },
            // å…¨é€‰/取消选操作
            selectAll(val) {
                this.isAllSelect = !this.isAllSelect;
                let data = this.tableData;
                this.toggleSelect(data, this.isAllSelect, "all");
            },
             //选择某行
            selectTr(selection, row) {
                this.$set(row, "isChecked", !row.isChecked);
                this.$nextTick(() => {
                    this.isAllSelect = row.isChecked;
                    this.toggleSelect(row, row.isChecked, "tr");
                });
            },
            // å…¨é€‰/取消选操作
            selectAll(val) {
                this.isAllSelect = !this.isAllSelect;
                let data = this.tableData;
                this.toggleSelect(data, this.isAllSelect, "all");
            },
            //选择某行
            selectTr(selection, row) {
                this.$set(row, "isChecked", !row.isChecked);
                this.$nextTick(() => {
                    this.isAllSelect = row.isChecked;
                    this.toggleSelect(row, row.isChecked, "tr");
                });
            },
            toggleSelection(row, flag) {
                this.$set(row, "isChecked", flag);
                this.$nextTick(() => {
                if (flag) {
                    this.$refs.multipleTable.toggleRowSelection(row, flag);
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
                    if (flag) {
                        this.$refs.multipleTable.toggleRowSelection(row, flag);
                    } else {
                        this.$refs.multipleTable.clearSelection();
                    }
                });
            },
             //递归子级
            toggleSelect(data, flag, type) {
            //递归子级
            toggleSelect(data, flag, type) {
                // console.log('222');
                if (type === "all") {
                    if (data.length > 0) {
                        data.forEach((item) => {
                        this.toggleSelection(item, flag);
                        if (item.children && item.children.length > 0) {
                            this.toggleSelect(item.children, flag, type);
                        }
                        });
                    }
                } else {
                    if (data.children && data.children.length > 0) {
                        data.children.forEach((item) => {
                        item.isChecked = !item.isChecked;
                        this.$refs.multipleTable.toggleRowSelection(item, flag);
                        this.toggleSelect(item, flag, type);
                        });
                    }
                }
            },
//---------------------------------------------------------------------------------------------------------------------------------------
            handleClose(){},
                if (type === "all") {
                    if (data.length > 0) {
                        data.forEach((item) => {
                            this.toggleSelection(item, flag);
                            if (item.children && item.children.length > 0) {
                                this.toggleSelect(item.children, flag, type);
                            }
                        });
                    }
                } else {
                    if (data.children && data.children.length > 0) {
                        data.children.forEach((item) => {
                            item.isChecked = !item.isChecked;
                            this.$refs.multipleTable.toggleRowSelection(item, flag);
                            this.toggleSelect(item, flag, type);
                        });
                    }
                }
            },
            //---------------------------------------------------------------------------------------------------------------------------------------
            handleClose() {},
            selectDataList() {
                this.list.forEach(a => {
                    a.code = '[1]'
@@ -435,7 +398,7 @@
                    }
                }).then(res => {
                    /* this.selectAllright() */
                    this.$parent.removeAllTab()
                    this.$parent.removeAllTab()
                })
            },
            submitUpData() { //确定
@@ -450,7 +413,7 @@
                }).then(res => {
                    /* this.selectAllright() */
                    this.$message.success('删除完成')
                    this.$parent.removeAllTab()
                    this.$parent.removeAllTab()
                })
            },
            deleteRow(index, rows) {
@@ -465,20 +428,20 @@
                    ids: this.delete
                }).then(res => {
                    /* this.selectAllright() */
                    this.$parent.removeAllTab()
                    this.$parent.removeAllTab()
                })
            },
            dels() {
                let ee = []
                console.log(this.selects);
                this.selects.forEach(el =>{
                    if(el.children){
                        el.children.forEach(ele =>{
                            ee.push(ele.id)
                        })
                    }
                })
                console.log(this.selects);
                this.selects.forEach(el => {
                    if (el.children) {
                        el.children.forEach(ele => {
                            ee.push(ele.id)
                        })
                    }
                })
                // cc.splice(0,1)
                this.delete = ee.join(',')
                console.log(this.delete);
@@ -571,7 +534,7 @@
                    console.log(this.tableData);
                });
            },
            craftrow(val){
            craftrow(val) {
                this.crafval = val
                this.chooseProFath()
            },
@@ -580,7 +543,7 @@
                console.log(this.checkTreeNode.id);
                this.$axios.get(this.$api.url.chooseProFath, {
                    params: {
                        techTemId:this.crafval
                        techTemId: this.crafval
                    }
                }).then(res => {
                    this.higherlevel = res.data;
@@ -756,4 +719,4 @@
        height: 30px;
        border-radius: 2px;
    }
</style>
</style>
src/components/view/finishedProductInspection.vue
@@ -1,453 +1,444 @@
<template>
  <div class="content-main">
    <div v-if="!showAdd&&!showLook&&!showUp" class="rawPage">
        <div class="title">
      <el-row>
        <el-col :span="12">成品检验</el-col>
        <el-col :span="12" style="text-align: right;">
          <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>
    <div class="nav">
        <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="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="showAddPage">
        <!-- æ–°å¢žé¡µé¢ -->
            <div class="addInspection">
                <el-row class="header">
                    <el-col :span="12">新增成品检验单</el-col>
                    <el-col :span="12" style="text-align: right;">
                        <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                    <el-button @click="()=>{showAddPage = false;showDetail = false}" type="primary" size="mini" icon="el-icon-back" style="background: #004EA2; ">返回</el-button>
                    </el-col>
                </el-row>
                <el-form :model="addInspectionform" ref="addInspectionform" class="addInspectionform" label-position="right" label-width="100px" size="mini" >
                    <div class="formwrapper">
                        <el-row>
                        <el-col  :span="7">
                        <el-form-item label="订单号:">
                            <el-input v-show="showDetail == false"  style="width: 180px;" v-model="addInspectionform.number" placeholder="请输入订单号" autocomplete="off" />
                            <el-input v-show="showDetail !== false"  style="width: 180px;" v-model="finishedInsInfo.order_number" placeholder="请输入订单号1" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="客户名称:">
                            <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.username" placeholder="请输入客户名称" autocomplete="off" />
                            <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.customer_name" placeholder="请输入客户名称" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="工程名称:">
                            <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.projectname" placeholder="请输入工程名称" autocomplete="off" />
                            <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.project_name" placeholder="请输入工程名称" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row >
                        <el-col  :span="7">
                        <el-form-item label="质量追溯号:" >
                            <el-input  v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.tracenumber" placeholder="请输入追溯号" autocomplete="off" />
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.quality_traceability" placeholder="请输入追溯号" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="产品编码:">
                            <el-input  v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.material_code" placeholder="请输入产品编码" autocomplete="off" />
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.material_code" placeholder="请输入产品编码" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="产品名称:">
                            <el-select v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.class" size="small" placeholder="请选择产品名称">
                                <el-option value="选项1"></el-option>
                                <el-option value="选项2"></el-option>
                            </el-select>
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.material" placeholder="请输入产品编码" autocomplete="off" />
    <div class="content-main">
        <div v-if="!showAdd&&!showLook&&!showUp" class="rawPage">
            <div class="title">
                <el-row>
                    <el-col :span="12">产品检验</el-col>
                    <el-col :span="12" style="text-align: right;">
                        <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>
            <div class="nav">
                <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="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="showAddPage">
            <!-- æ–°å¢žé¡µé¢ -->
            <div class="addInspection">
                <el-row class="header">
                    <el-col :span="12">新增成品检验单</el-col>
                    <el-col :span="12" style="text-align: right;">
                        <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                        <el-button @click="()=>{showAddPage = false;showDetail = false}" type="primary" size="mini"
                            icon="el-icon-back" style="background: #004EA2; ">返回</el-button>
                    </el-col>
                </el-row>
                <el-form :model="addInspectionform" ref="addInspectionform" class="addInspectionform" label-position="right"
                    label-width="100px" size="mini">
                    <div class="formwrapper">
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="订单号:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.number"
                                        placeholder="请输入订单号" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.order_number"
                                        placeholder="请输入订单号1" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="客户名称:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.username"
                                        placeholder="请输入客户名称" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.customer_name"
                                        placeholder="请输入客户名称" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="工程名称:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.projectname"
                                        placeholder="请输入工程名称" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.project_name"
                                        placeholder="请输入工程名称" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="质量追溯号:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.tracenumber"
                                        placeholder="请输入追溯号" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;"
                                        v-model="finishedInsInfo.quality_traceability" placeholder="请输入追溯号" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="产品编码:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.material_code"
                                        placeholder="请输入产品编码" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.material_code"
                                        placeholder="请输入产品编码" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="产品名称:">
                                    <el-select v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.class"
                                        size="small" placeholder="请选择产品名称">
                                        <el-option value="选项1"></el-option>
                                        <el-option value="选项2"></el-option>
                                    </el-select>
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.material"
                                        placeholder="请输入产品编码" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row >
                        <el-col  :span="7">
                        <el-form-item label="规格型号:" >
                            <el-select v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.specificationmodel" size="small" placeholder="请选择规格型号">
                                <el-option value="选项1"></el-option>
                                <el-option value="选项2"></el-option>
                            </el-select>
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.specifications_model" placeholder="请输入产品编码" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="单位:" >
                            <el-select v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.unit" size="small" placeholder="请选择单位">
                                <el-option value="选项1"></el-option>
                                <el-option value="选项2"></el-option>
                            </el-select>
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.specifications_model" placeholder="请输入产品编码" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                        <el-col  :span="7">
                        <el-form-item label="数量:">
                            <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.quantity" placeholder="请输入数量" autocomplete="off" />
                            <el-input  v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.quantity" placeholder="请输入产品编码" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="规格型号:">
                                    <el-select v-show="showDetail == false" style="width: 180px;"
                                        v-model="addInspectionform.specificationmodel" size="small" placeholder="请选择规格型号">
                                        <el-option value="选项1"></el-option>
                                        <el-option value="选项2"></el-option>
                                    </el-select>
                                    <el-input v-show="showDetail !== false" style="width: 180px;"
                                        v-model="finishedInsInfo.specifications_model" placeholder="请输入产品编码" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="单位:">
                                    <el-select v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.unit"
                                        size="small" placeholder="请选择单位">
                                        <el-option value="选项1"></el-option>
                                        <el-option value="选项2"></el-option>
                                    </el-select>
                                    <el-input v-show="showDetail !== false" style="width: 180px;"
                                        v-model="finishedInsInfo.specifications_model" placeholder="请输入产品编码" autocomplete="off" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="7">
                                <el-form-item label="数量:">
                                    <el-input v-show="showDetail == false" style="width: 180px;" v-model="addInspectionform.quantity"
                                        placeholder="请输入数量" autocomplete="off" />
                                    <el-input v-show="showDetail !== false" style="width: 180px;" v-model="finishedInsInfo.quantity"
                                        placeholder="请输入产品编码" autocomplete="off" />
                        </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row >
                        <el-col  v-show="showDetail !== false" :span="7">
                            <el-form-item  label="主机工:" >
                               <el-input  style="width: 180px;" v-model="finishedInsInfo.name" placeholder="请输入产品编码" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    </div>
                </el-form>
            </div>
            <div class="inspectionProject">
                <span>检验项目</span>
                <el-table :data="inspectionItems">
                    <el-table-column type="index" label="序号" width="60"></el-table-column>
                    <el-table-column prop="project" label="项目"></el-table-column>
                    <el-table-column prop="unit" label="单位"></el-table-column>
                    <el-table-column prop="standardVal" label="标准值"></el-table-column>
                    <el-table-column prop="controlVal" label="内测值"></el-table-column>
                    <el-table-column prop="detectionVal" label="检验值"></el-table-column>
                    <el-table-column label="试验设备">
                        <template slot-scope="scope">
                        {{ scope.row.device }}
                        <el-select v-model="scope.row.device" size="small" slot="append" style="width: 100px;">
                            <el-option value="选项1"></el-option>
                            <el-option value="选项2"></el-option>
                        </el-select>
                    </template>
                    </el-table-column>
                    <el-table-column prop="conclusion" label="结论">
                        <template slot-scope="scope">
                            <span style="color: #34BD66;" v-if="scope.row.insState==1">合格</span>
                            <span style="color: #E84738;" v-else-if="scope.row.insState==0">不合格</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <div class="inspectionResult">
                <span>检测结果</span>
                <el-table :data="inspectionResultForm">
                    <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>
                    <el-table-column prop="conclusion" label="检验结论"></el-table-column>
                    <el-table-column prop="operation" label="上报"></el-table-column>
                </el-table>
            </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>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col v-show="showDetail !== false" :span="7">
                                <el-form-item label="主机工:">
                                    <el-input style="width: 180px;" v-model="finishedInsInfo.name" placeholder="请输入产品编码"
                                        autocomplete="off" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                </el-form>
            </div>
            <div class="inspectionProject">
                <span>检验项目</span>
                <el-table :data="inspectionItems">
                    <el-table-column type="index" label="序号" width="60"></el-table-column>
                    <el-table-column prop="project" label="项目"></el-table-column>
                    <el-table-column prop="unit" label="单位"></el-table-column>
                    <el-table-column prop="standardVal" label="标准值"></el-table-column>
                    <el-table-column prop="controlVal" label="内测值"></el-table-column>
                    <el-table-column prop="detectionVal" label="检验值"></el-table-column>
                    <el-table-column label="试验设备">
                        <template slot-scope="scope">
                            {{ scope.row.device }}
                            <el-select v-model="scope.row.device" size="small" slot="append" style="width: 100px;">
                                <el-option value="选项1"></el-option>
                                <el-option value="选项2"></el-option>
                            </el-select>
                        </template>
                    </el-table-column>
                    <el-table-column prop="conclusion" label="结论">
                        <template slot-scope="scope">
                            <span style="color: #34BD66;" v-if="scope.row.insState==1">合格</span>
                            <span style="color: #E84738;" v-else-if="scope.row.insState==0">不合格</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <div class="inspectionResult">
                <span>检测结果</span>
                <el-table :data="inspectionResultForm">
                    <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>
                    <el-table-column prop="conclusion" label="检验结论"></el-table-column>
                    <el-table-column prop="operation" label="上报"></el-table-column>
                </el-table>
            </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>
<script>
import finishedProductInspectionAdd from '@/components/view/finishedProductInspectionAdd'
import finishedProductInspectionUp from '@/components/view/finishedProductInspectionUp'
import finishedProductInspectionLook from '@/components/view/finishedProductInspectionLook'
export default {
    components: { finishedProductInspectionAdd,finishedProductInspectionUp, finishedProductInspectionLook},
    data(){
        return {
            searchData:{
                result: '',
                material: '',
            },
            // ä¸»æœºå·¥ä¸‹æ‹‰æ¡†
            usernameOptions:[],
            inspectionTable:[
            ],
            rowInfo:{},
            pageParams:{
              countSize: 10, //每页数量
              pageSize: 1, // å½“前页码
              total:0
            },
            showAddPage: false,
            showAdd: false,
            showLook: false,
            showUp: false,
            showDetail:false,
            addInspectionform: [{
                number: '',
                username: '',
                projectname: '',
                tracenumber: '',
                code: '',
                class: '',
                specificationmodel: '',
                unit: '',
                quantity: '',
                group: '',
                worker: '',
                machine: ''
            }],
            inspectionItems:[{
                project:'布隆迪',
                unit:'吨',
                standardVal: '8219384314',
                controlVal:'9823401',
                detectionVal:'11111',
                device:'',
                conclusion:'合格'
            }],
            inspectionResultForm:[{
                id:'274024',
                name:'111',
                inspecter:'111',
                conclusion:'',
                operation:''
            }],
            finishedInsInfo:{}
        }
    },
    created() {
        this.init()
        this.getInspectionTableData()
    },
    methods:{
        // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
        handleSizeChange(val) {
        console.log(`每页 ${val} æ¡`)
        this.currentPage = 1
        this.pageSize = val
        },
        // å½“前页改变时触发 è·³è½¬å…¶ä»–页
        handleCurrentChange(val) {
        console.log(`当前页: ${val}`)
        this.currentPage = val
        },
        handleAddNew(){
            this.showAdd=true
        },
        async getInspectionTableData() {
            const {data:{row,total}} = await this.$axios.get(this.$api.url.finishedInsListPage,{params:{...this.pageParams,...this.searchData}})
            this.inspectionTable = row
            this.pageParams.total = total
        },
        goToDetail(row) {
            this.rowInfo = row
            this.showLook=true
        },
        goUp(row){
            this.rowInfo = row
            this.showUp=true
        },
        async init() {
            // const {data} = await this.$axios.get(this.$api.url.finishedInspectUser)
            // this.usernameOptions = data
    import finishedProductInspectionAdd from '@/components/view/finishedProductInspectionAdd'
    import finishedProductInspectionUp from '@/components/view/finishedProductInspectionUp'
    import finishedProductInspectionLook from '@/components/view/finishedProductInspectionLook'
    export default {
        components: {
            finishedProductInspectionAdd,
            finishedProductInspectionUp,
            finishedProductInspectionLook
        },
        data() {
            return {
                searchData: {
                    result: '',
                    material: '',
                },
                // ä¸»æœºå·¥ä¸‹æ‹‰æ¡†
                usernameOptions: [],
                inspectionTable: [],
                rowInfo: {},
                pageParams: {
                    countSize: 10, //每页数量
                    pageSize: 1, // å½“前页码
                    total: 0
                },
                showAddPage: false,
                showAdd: false,
                showLook: false,
                showUp: false,
                showDetail: false,
                addInspectionform: [{
                    number: '',
                    username: '',
                    projectname: '',
                    tracenumber: '',
                    code: '',
                    class: '',
                    specificationmodel: '',
                    unit: '',
                    quantity: '',
                    group: '',
                    worker: '',
                    machine: ''
                }],
                inspectionItems: [{
                    project: '布隆迪',
                    unit: '吨',
                    standardVal: '8219384314',
                    controlVal: '9823401',
                    detectionVal: '11111',
                    device: '',
                    conclusion: '合格'
                }],
                inspectionResultForm: [{
                    id: '274024',
                    name: '111',
                    inspecter: '111',
                    conclusion: '',
                    operation: ''
                }],
                finishedInsInfo: {}
            }
        },
        created() {
            this.init()
            this.getInspectionTableData()
        },
        methods: {
            // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
            handleSizeChange(val) {
                console.log(`每页 ${val} æ¡`)
                this.currentPage = 1
                this.pageSize = val
            },
            // å½“前页改变时触发 è·³è½¬å…¶ä»–页
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`)
                this.currentPage = val
            },
            handleAddNew() {
                this.showAdd = true
            },
            async getInspectionTableData() {
                const {
                    data: {
                        row,
                        total
                    }
                } = await this.$axios.get(this.$api.url.finishedInsListPage, {
                    params: {
                        ...this.pageParams,
                        ...this.searchData
                    }
                })
                this.inspectionTable = row
                this.pageParams.total = total
            },
            goToDetail(row) {
                this.rowInfo = row
                this.showLook = true
            },
            goUp(row) {
                this.rowInfo = row
                this.showUp = true
            },
            async init() {
                // const {data} = await this.$axios.get(this.$api.url.finishedInspectUser)
                // this.usernameOptions = data
        },
        comBackMain(val){
        this.showAdd=false
        this.showLook=false
        this.showUp=false
        this.init()
        this.getInspectionTableData()
        if(val){
            this.$parent.removeAllTab()
        }
        }
    }
            },
            comBackMain(val) {
                this.showAdd = false
                this.showLook = false
                this.showUp = false
                this.init()
                this.getInspectionTableData()
                if (val) {
                    this.$parent.removeAllTab()
                }
            }
        }
}
    }
</script>
<style>
.title{
    padding: 12px;
    .title {
        padding: 12px;
}
.nav{
    display: flex;
    padding: 20px 20px;
    align-items: center;
    background-color: #fff;
}
.nav *{
    font-size: 14px;
}
.content-body {
    background-color: #fff;
    overflow: hidden;
    margin-top: 12px;
}
.inspectionTable{
    padding: 20px 20px;
}
.pagination{
    float: right;
    margin-right: 20px;
}
.newPage{
    overflow: hidden;
}
.header{
    padding: 12px;
}
.addInspectionform{
    background-color: #fff;
}
.addInspectionform .formwrapper{
    padding: 20px 0px;
    margin-left: 100px;
}
.inspectionProject span{
    display: block;
    padding: 5px 0px;
}
.inspectionProject .el-table{
    background-color: #fff;
    padding: 10px 12px;
}
.inspectionResult span{
    display: block;
    padding: 5px 0px;
}
.inspectionResult .el-table{
    background-color: #fff;
    padding: 10px 12px;
}
.rawPage{
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
}
.rawPage .content-body{
    flex: 1;
}
/* .inspectionTable{
    }
    .nav {
        display: flex;
        padding: 20px 20px;
        align-items: center;
        background-color: #fff;
    }
    .nav * {
        font-size: 14px;
    }
    .content-body {
        background-color: #fff;
        overflow: hidden;
        margin-top: 12px;
    }
    .inspectionTable {
        padding: 20px 20px;
    }
    .pagination {
        float: right;
        margin-right: 20px;
    }
    .newPage {
        overflow: hidden;
    }
    .header {
        padding: 12px;
    }
    .addInspectionform {
        background-color: #fff;
    }
    .addInspectionform .formwrapper {
        padding: 20px 0px;
        margin-left: 100px;
    }
    .inspectionProject span {
        display: block;
        padding: 5px 0px;
    }
    .inspectionProject .el-table {
        background-color: #fff;
        padding: 10px 12px;
    }
    .inspectionResult span {
        display: block;
        padding: 5px 0px;
    }
    .inspectionResult .el-table {
        background-color: #fff;
        padding: 10px 12px;
    }
    .rawPage {
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow-y: scroll;
    }
    .rawPage .content-body {
        flex: 1;
    }
    /* .inspectionTable{
    flex: 1;
    overflow-y: scroll;
} */
</style>
src/components/view/finishedProductInspectionUp.vue
@@ -1,712 +1,708 @@
<template>
    <div>
        <!-- æ–°å¢žé¡µé¢ -->
        <div class="addInspection">
            <el-row class="header">
                <el-col :span="12">新增产品检验单</el-col>
                <el-col :span="12" style="text-align: right;">
                    <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                    <!-- <el-button type="primary" size="mini" style="background: #004EA2; "
    <div>
        <!-- æ–°å¢žé¡µé¢ -->
        <div class="addInspection">
            <el-row class="header">
                <el-col :span="12">新增产品检验单</el-col>
                <el-col :span="12" style="text-align: right;">
                    <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                    <!-- <el-button type="primary" size="mini" style="background: #004EA2; "
                        icon="el-icon-circle-plus-outline">新增</el-button> -->
                    <el-button @click="comBack" type="primary" size="mini" icon="el-icon-back"
                        style="background: #004EA2; ">返回</el-button>
                </el-col>
            </el-row>
            <el-form :model="processInspectVo" ref="addInspectionform" class="addInspectionform" label-position="right"
                label-width="120px" size="small">
                <div class="formwrapper">
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="订单号:">
                                <el-input disabled @blur="selectInfoByOrderId" style="width: 180px;"
                                    v-model="processInspectVo.orderNumber" placeholder="请输入订单号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="客户名称:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.prname"
                                    placeholder="请输入客户名称" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工程名称:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.sname"
                                    placeholder="请输入工程名称" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="产品名称:">
                                <el-select disabled @change="changeOptionsSamplename" style="width: 180px;"
                                    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>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="质量追溯号:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.qualityTraceability"
                                    placeholder="请输入追溯号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品编码:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.mcode"
                                    placeholder="请输入产品编码" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="规格型号:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.specificationsModel"
                                    placeholder="请输入产品编码" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="单位:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.unit"
                                    placeholder="请输入产品编码" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="数量:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.quantity"
                                    placeholder="请输入数量" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="3" style="display: flex;justify-content: end;">
                            <!-- <el-button type="primary" :disabled="isAddProject" @click="addTestProjevt">生成检验项目</el-button> -->
                        </el-col>
                    </el-row>
                </div>
            </el-form>
        </div>
        <div class="inspectionProject">
            <el-row>
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col v-if="!isUpBtn" :span="12" class="inspectionProject_span"
                    style="display: flex;justify-content: end;">
                    <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <el-button style="margin-right: 30px;" size="mini"
                        @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <!-- <el-button
                    <el-button @click="comBack" type="primary" size="mini" icon="el-icon-back"
                        style="background: #004EA2; ">返回</el-button>
                </el-col>
            </el-row>
            <el-form :model="processInspectVo" ref="addInspectionform" class="addInspectionform" label-position="right"
                label-width="120px" size="small">
                <div class="formwrapper">
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="订单号:">
                                <el-input disabled @blur="selectInfoByOrderId" style="width: 180px;"
                                    v-model="processInspectVo.orderNumber" placeholder="请输入订单号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="客户名称:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.prname" placeholder="请输入客户名称"
                                    autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工程名称:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.sname" placeholder="请输入工程名称"
                                    autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="产品名称:">
                                <el-select disabled @change="changeOptionsSamplename" style="width: 180px;"
                                    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>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="质量追溯号:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.qualityTraceability"
                                    placeholder="请输入追溯号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品编码:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.mcode" placeholder="请输入产品编码"
                                    autocomplete="off" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="7">
                            <el-form-item label="规格型号:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.specificationsModel"
                                    placeholder="请输入产品编码" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="单位:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.unit" placeholder="请输入产品编码"
                                    autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="数量:">
                                <el-input disabled style="width: 180px;" v-model="processInspectVo.quantity" placeholder="请输入数量"
                                    autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="3" style="display: flex;justify-content: end;">
                            <!-- <el-button type="primary" :disabled="isAddProject" @click="addTestProjevt">生成检验项目</el-button> -->
                        </el-col>
                    </el-row>
                </div>
            </el-form>
        </div>
        <div class="inspectionProject">
            <el-row>
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col v-if="!isUpBtn" :span="12" class="inspectionProject_span" style="display: flex;justify-content: end;">
                    <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <el-button style="margin-right: 30px;" size="mini" @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <!-- <el-button
              size="mini"
              style="margin-right: 30px;"
              @click="clickAddLine()"
              >添加检验行</el-button
            > -->
                </el-col>
            </el-row>
            <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
                style="width: 100%">
                <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="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-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="dname" label="试验设备" min-width="100">
                    <template slot-scope="scope">
                        <el-button v-if="!scope.row.isSelectDevice" type="text" @click="clickTableSelect(scope)">{{
                </el-col>
            </el-row>
            <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
                style="width: 100%">
                <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="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-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="dname" label="试验设备" min-width="100">
                    <template slot-scope="scope">
                        <el-button type="text" @click="clickTableSelect(scope)">{{
                            scope.row.dname == null ? "请选择" : scope.row.dname
                        }}</el-button>
                        <el-select v-if="scope.row.isSelectDevice" style="width: 100%;" @change="clickNodeSure(scope.row)"  v-model="filterText" placeholder="请选择">
                            <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id">
                            </el-option>
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column label="结论">
                    <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-show="scope.row.result === null">暂未结论</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column v-if="detailId == null" label="操作" width="100">
                    </template>
                </el-table-column>
                <el-table-column label="结论">
                    <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-show="scope.row.result === null">暂未结论</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column v-if="detailId == null" label="操作" width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="clickDeleteline(scope)">删除</el-button>
            </template>
          </el-table-column> -->
            </el-table>
        </div>
        <div class="inspectionResult">
            <span>检测结果</span>
            <el-table :data="inspectionResultForm">
                <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>
                <el-table-column prop="conclusion" label="检验结论">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.conclusion === 1">合格</span>
                        <span style="color: #E84738;" v-else-if="scope.row.conclusion === 0">不合格</span>
                        <span v-else-if="scope.row.conclusion === null || scope.row.conclusion === undefined">暂未结论</span>
                    </template>
                </el-table-column>
                <el-table-column prop="operation" label="上报">
                    <template slot-scope="scope">
                        <el-button v-if="scope.row.conclusion === null || scope.row.conclusion === undefined" type="primary"
                            @click="escalation" size="small">上报</el-button>
                        <el-button v-else type="success" size="small">已上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
            <div class="div_device_dialog">
                <el-select style="width: 100%;" @change="clickNodeSure()" v-model="filterText" placeholder="请选择">
                    <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id">
                    </el-option>
                </el-select>
            </div>
        </el-dialog>
    </div>
            </el-table>
        </div>
        <div class="inspectionResult">
            <span>检测结果</span>
            <el-table :data="inspectionResultForm">
                <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>
                <el-table-column prop="conclusion" label="检验结论">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.conclusion === 1">合格</span>
                        <span style="color: #E84738;" v-else-if="scope.row.conclusion === 0">不合格</span>
                        <span v-else-if="scope.row.conclusion === null || scope.row.conclusion === undefined">暂未结论</span>
                    </template>
                </el-table-column>
                <el-table-column prop="operation" label="上报">
                    <template slot-scope="scope">
                        <el-button v-if="scope.row.conclusion === null || scope.row.conclusion === undefined" type="primary"
                            @click="escalation" size="small">上报</el-button>
                        <el-button v-else type="success" size="small">已上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
            <div class="div_device_dialog">
                <el-input placeholder="输入关键字进行过滤" v-model="filterText" style="margin-bottom: 6px;">
                </el-input>
                <el-tree class="filter-tree" :data="materialOptions" :props="defaultProps" default-expand-all highlight-current
                    @node-click="nodeClick" :filter-node-method="filterNode" ref="tree">
                    <div class="custom-tree-node" slot-scope="{ data }">
                        <span><i
                                :class="`node_i ${data.children ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>{{ data.name }}</span>
                    </div>
                </el-tree>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="centerDialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="clickNodeSure()">ç¡® å®š</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    props: ['rowInfo'],
    data() {
        return {
            isUpBtn: false,
            showUp: false,
            isAddProject: false,
            showLook: false,
            detailId: 0,
            rowInfp: {},
            search: {
                countSize: 10,
                pageSize: 1,
                result: "", // æ£€æµ‹çŠ¶æ€
                name: "", // äº§å“åç§°
                techfather: "" // å·¥åº
            },
            optionsSamplename: [],
            inspectionTable: [],
            tableColumn: [],
            optionSoptionSprocesses: [],
            optionTechnology: [],
            inspectionTableTotal: 0,
            pageSize: 10,
            currentPage: 1,
            treeProject: [],
            // æ·»åŠ åˆ—
            empiricalValueAdd: 1,
            // ç¼–辑时存储最长的列数字,做删除判断
            empiricalValueAddMaxNumber: 0,
            showAddPage: false,
            processInspectVo: {
                id: null,
                material: null,
                mcode: null,
                prname: null,
                sname: null,
                orderNumber: "D-001",
                qualityTraceability: null,
                quantity: null,
                specificationsModel: null,
                unit: null,
                technologyId: null
            },
            InspectioniD: null,
            addInspectionform: [
                {
                    number: "",
                    username: "",
                    projectname: "",
                    tracenumber: "",
                    code: "",
                    class: "",
                    specificationmodel: "",
                    unit: "",
                    quantity: "",
                    group: "",
                    worker: "",
                    machine: ""
                }]
            ,
            inspectionItems: [], // æ–°å¢žæ£€éªŒé¡¹ç›®è¡¨æ ¼
            inspectionResultForm: [
                {
                    id: "",
                    name: "",
                    inspecter: "",
                    conclusion: "",
                    operation: ""
                }
            ],
            options: [],
            value: "",
            rowList: [],
            spanArr: [],
            position: 0,
            // è®¾å¤‡é€‰æ‹©æ ‘显示
            centerDialogVisible: false,
            filterText: "",
            materialOptions: [],
            defaultProps: {
                // è®¾å¤‡æ ‘数据设置
                children: "children",
                label: "name"
            },
            nodeData: {
                id: 0,
                name: null
            }, // node点击保存当前点击数据
            clickSelectDevice: {
                index: null, // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                rpId: null // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
            }
        };
    },
    watch: {
        // filterText(val) {
        //     this.$refs.tree.filter(val);
        // }
    },
    mounted() {
        if (this.rowInfo.result != null && this.rowInfo.result != '') {
            this.isUpBtn = true
        }
        this.processInspectVo.material = this.rowInfo.material
        this.processInspectVo.mcode = this.rowInfo.material_code
        this.processInspectVo.orderNumber = this.rowInfo.order_number
        this.processInspectVo.qualityTraceability = this.rowInfo.quality_traceability
        this.processInspectVo.specificationsModel = this.rowInfo.specifications_model
        this.processInspectVo.unit = this.rowInfo.unit
        this.processInspectVo.quantity = this.rowInfo.quantity
        this.processInspectVo.prname = this.rowInfo.customer_name
        this.processInspectVo.sname = this.rowInfo.project_name
        this.inspectionResultForm[0].id = this.rowInfo.material_code
        this.inspectionResultForm[0].name = this.rowInfo.material
        this.inspectionResultForm[0].conclusion = this.rowInfo.result
        this.detailId = this.rowInfo.id
        this.getTableData()
        // this.getOptions();
    },
    methods: {
        // blurNode(row){
        //     console.log(11);
        //     row.isSelectDevice=false
        // },
        escalation() {
            let arr = this.inspectionItems
            let bl = false
            for (let index = 0; index < arr.length; index++) {
                const element = arr[index];
                if (element.dname != null && element.empiricalValueAddss[0] != '') {
                    bl = true
                    break
                } else {
                    bl = false
                }
            }
            if (bl != true) {
                this.$message({
                    message: '请先检测一项项目!',
                    type: 'warning'
                });
                return
            }
            this.$axios.post(this.$api.url.finishedInspectUpdateFinishInspectsById, {
                id: this.detailId
            }).then(res => {
                if (res.code == 200) {
                    if (res.message === '项目未检验完!') {
                        this.$message({
                            message: res.message,
                            type: 'warning'
                        });
                        return
                    }
                    this.$message({
                        message: '上报成功',
                        type: 'success'
                    });
                    this.$parent.comBackMain(true)
                } else {
                    this.$message({
                        message: res.message,
                        type: 'warning'
                    });
                }
            })
    export default {
        props: ['rowInfo'],
        data() {
            return {
                isUpBtn: false,
                showUp: false,
                isAddProject: false,
                showLook: false,
                detailId: 0,
                rowInfp: {},
                search: {
                    countSize: 10,
                    pageSize: 1,
                    result: "", // æ£€æµ‹çŠ¶æ€
                    name: "", // äº§å“åç§°
                    techfather: "" // å·¥åº
                },
                optionsSamplename: [],
                inspectionTable: [],
                tableColumn: [],
                optionSoptionSprocesses: [],
                optionTechnology: [],
                inspectionTableTotal: 0,
                pageSize: 10,
                currentPage: 1,
                treeProject: [],
                // æ·»åŠ åˆ—
                empiricalValueAdd: 1,
                // ç¼–辑时存储最长的列数字,做删除判断
                empiricalValueAddMaxNumber: 0,
                showAddPage: false,
                processInspectVo: {
                    id: null,
                    material: null,
                    mcode: null,
                    prname: null,
                    sname: null,
                    orderNumber: "D-001",
                    qualityTraceability: null,
                    quantity: null,
                    specificationsModel: null,
                    unit: null,
                    technologyId: null
                },
                InspectioniD: null,
                addInspectionform: [{
                    number: "",
                    username: "",
                    projectname: "",
                    tracenumber: "",
                    code: "",
                    class: "",
                    specificationmodel: "",
                    unit: "",
                    quantity: "",
                    group: "",
                    worker: "",
                    machine: ""
                }],
                inspectionItems: [], // æ–°å¢žæ£€éªŒé¡¹ç›®è¡¨æ ¼
                inspectionResultForm: [{
                    id: "",
                    name: "",
                    inspecter: "",
                    conclusion: "",
                    operation: ""
                }],
                options: [],
                value: "",
                rowList: [],
                spanArr: [],
                position: 0,
                // è®¾å¤‡é€‰æ‹©æ ‘显示
                centerDialogVisible: false,
                filterText: "",
                materialOptions: [],
                defaultProps: {
                    // è®¾å¤‡æ ‘数据设置
                    children: "children",
                    label: "name"
                },
                nodeData: {
                    id: 0,
                    name: null
                }, // node点击保存当前点击数据
                clickSelectDevice: {
                    index: null, // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                    rpId: null // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
                }
            };
        },
        watch: {
            // filterText(val) {
            //     this.$refs.tree.filter(val);
            // }
        },
        mounted() {
            if (this.rowInfo.result != null && this.rowInfo.result != '') {
                this.isUpBtn = true
            }
            this.processInspectVo.material = this.rowInfo.material
            this.processInspectVo.mcode = this.rowInfo.material_code
            this.processInspectVo.orderNumber = this.rowInfo.order_number
            this.processInspectVo.qualityTraceability = this.rowInfo.quality_traceability
            this.processInspectVo.specificationsModel = this.rowInfo.specifications_model
            this.processInspectVo.unit = this.rowInfo.unit
            this.processInspectVo.quantity = this.rowInfo.quantity
            this.processInspectVo.prname = this.rowInfo.customer_name
            this.processInspectVo.sname = this.rowInfo.project_name
            this.inspectionResultForm[0].id = this.rowInfo.material_code
            this.inspectionResultForm[0].name = this.rowInfo.material
            this.inspectionResultForm[0].conclusion = this.rowInfo.result
            this.detailId = this.rowInfo.id
            this.getTableData()
            // this.getOptions();
        },
        methods: {
            // blurNode(row){
            //     console.log(11);
            //     row.isSelectDevice=false
            // },
            escalation() {
                let arr = this.inspectionItems
                let bl = false
                for (let index = 0; index < arr.length; index++) {
                    const element = arr[index];
                    if (element.dname != null && element.empiricalValueAddss[0] != '') {
                        bl = true
                        break
                    } else {
                        bl = false
                    }
                }
                if (bl != true) {
                    this.$message({
                        message: '请先检测一项项目!',
                        type: 'warning'
                    });
                    return
                }
                this.$axios.post(this.$api.url.finishedInspectUpdateFinishInspectsById, {
                    id: this.detailId
                }).then(res => {
                    if (res.code == 200) {
                        if (res.message === '项目未检验完!') {
                            this.$message({
                                message: res.message,
                                type: 'warning'
                            });
                            return
                        }
                        this.$message({
                            message: '上报成功',
                            type: 'success'
                        });
                        this.$parent.comBackMain(true)
                    } else {
                        this.$message({
                            message: res.message,
                            type: 'warning'
                        });
                    }
                })
        },
        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
        },
        comBack() {
            this.$parent.comBackMain()
        },
        handleClick(row) {
            this.rowInfp = row
            this.showLook = true
        },
        updateInsInfo(row) {
            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;
                if(this.materialOptions.length===1&&row.did!=null){
                    this.$message({
                    message: '该项目下只有一个试验设备,无需选择!',
                    type: 'warning'
                });
                    return
                }
                row.isSelectDevice = true
                this.filterText = row.did
            });
        },
        // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
        clickTableSelect(scope) {
            if(this.clickSelectDevice.index!=null){
                this.$set(this.inspectionItems[this.clickSelectDevice.index],'isSelectDevice',false)
            }
            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 != '') {
                // let val = row.empiricalValueAddss.filter(item => {
                //     return item != '' && item != null
                // })
                // let eq = val.filter(item => {
                //     return /^[^><=]/.test(item)
                // })
                // if (eq.length > 0) {
                //     this.$message({
                //         message: "检测值[" + eq + "]格式首位应包含>,<或者=",
                //         type: 'warning'
                //     });
                //     return
                // }
                let str = ""
                row.empiricalValueAddss.forEach(e => {
                    str += e + ","
                })
                if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) {
                    return
                }
                this.$axios.post(this.$api.url.inspectionItemlose_focus_update, {
                    deviceId: row.did,
                    inspectionItemId: row.id,
                    inspectionValue: str.slice(0, -1)
                }, {
                    headers: { "Content-Type": "application/json" }
                }).then(res => {
                    row.result = res.data.result
                    row.username = res.data.username
                })
            } else {
                this.$message({
                    message: '请选择择设备!',
                    type: 'warning'
                });
            }
        },
        // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
        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
                }
            }
            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() {
            console.log(this.rowInfo);
            this.$axios.get(this.$api.url.finishedInspectSelectFinishInspectsListById, {
                params: {
                    id: this.rowInfo.id
                }
            }).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)
                    })
                })
                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)
            })
        },
        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: {
                    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
                } else {
                    this.$message({
                        message: '没有该订单号!',
                        type: 'warning'
                    });
                }
            })
        },
        // å½“前页改变时触发 è·³è½¬å…¶ä»–页
        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;
                });
        },
        // æ·»åŠ è¡Œ
        clickAddLine() {
            let obj = {
                material: "",
                materialCode: "",
                orderNumber: "",
                quantity: 0,
                specificationsModel: "",
                techfather: "",
                techname: "",
                technologyId: 0,
                unit: ""
            };
            this.inspectionItems.push(obj);
        },
        // åˆ é™¤è¡Œ
        clickDeleteline(scope) {
            this.inspectionItems.splice(scope.$index, 1);
        },
        // åˆ é™¤æ£€éªŒå€¼åˆ—
        clickDeleteInspectionColumn() {
            if (this.empiricalValueAdd - 1 === 0) {
            } else {
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    this.inspectionItems.forEach(i => {
                        i.testValueList.splice(this.empiricalValueAdd, 1);
                    });
                }
            }
        },
        // æ·»åŠ æ£€éªŒå€¼åˆ—
        clickAddInspectionColumn() {
            this.empiricalValueAdd = this.empiricalValueAdd + 1;
        }
    },
    created() {
        this.defaultInitializationTable(); // åˆå§‹åŒ–表格数据
    }
}
            },
            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
            },
            comBack() {
                this.$parent.comBackMain()
            },
            handleClick(row) {
                this.rowInfp = row
                this.showLook = true
            },
            updateInsInfo(row) {
                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;
                    if (this.materialOptions.length === 1 && row.did != null) {
                        this.$message({
                            message: '该项目下只有一个试验设备,无需选择!',
                            type: 'warning'
                        });
                        return
                    }
                    row.isSelectDevice = true
                });
            },
            // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
            clickTableSelect(scope) {
                this.centerDialogVisible = true;
                this.clickSelectDevice.index = scope.$index;
                this.clickSelectDevice.rpId = scope.row.id;
                this.getOptions(scope.row);
            },
            // ç‚¹å‡»æ ‘里面的确定
            clickNodeSure(row) {
                if (this.detailId == null) {
                    this.projectTable[this.clickSelectDevice.index].deviceId = this.nodeData.id;
                    this.projectTable[this.clickSelectDevice.index].deviceName = this.nodeData.name;
                    this.centerDialogVisible = false;
                } else {
                    this.$axios.post(this.$api.url.inspectionItemUpdateDevByInsId, {
                        id: this.clickSelectDevice.rpId,
                        devId: this.nodeData.id,
                        type: 2
                    }).then(res => {
                        this.centerDialogVisible = false;
                        this.inspectionItems.forEach(a=>{
                            if(a.id == this.clickSelectDevice.rpId){
                                a.dname = this.nodeData.name
                            }
                        })
                    });
                }
            },
            changeState(row, index) {
                if (row.did != null && row.did != '') {
                    // let val = row.empiricalValueAddss.filter(item => {
                    //     return item != '' && item != null
                    // })
                    // let eq = val.filter(item => {
                    //     return /^[^><=]/.test(item)
                    // })
                    // if (eq.length > 0) {
                    //     this.$message({
                    //         message: "检测值[" + eq + "]格式首位应包含>,<或者=",
                    //         type: 'warning'
                    //     });
                    //     return
                    // }
                    let str = ""
                    row.empiricalValueAddss.forEach(e => {
                        str += e + ","
                    })
                    if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) {
                        return
                    }
                    this.$axios.post(this.$api.url.inspectionItemlose_focus_update, {
                        deviceId: row.did,
                        inspectionItemId: row.id,
                        inspectionValue: str.slice(0, -1)
                    }, {
                        headers: {
                            "Content-Type": "application/json"
                        }
                    }).then(res => {
                        row.result = res.data.result
                        row.username = res.data.username
                    })
                } else {
                    this.$message({
                        message: '请选择择设备!',
                        type: 'warning'
                    });
                }
            },
            // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
            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
                    }
                }
                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() {
                console.log(this.rowInfo);
                this.$axios.get(this.$api.url.finishedInspectSelectFinishInspectsListById, {
                    params: {
                        id: this.rowInfo.id
                    }
                }).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)
                        })
                    })
                    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)
                })
            },
            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: {
                        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
                    } else {
                        this.$message({
                            message: '没有该订单号!',
                            type: 'warning'
                        });
                    }
                })
            },
            // å½“前页改变时触发 è·³è½¬å…¶ä»–页
            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;
                    });
            },
            // æ·»åŠ è¡Œ
            clickAddLine() {
                let obj = {
                    material: "",
                    materialCode: "",
                    orderNumber: "",
                    quantity: 0,
                    specificationsModel: "",
                    techfather: "",
                    techname: "",
                    technologyId: 0,
                    unit: ""
                };
                this.inspectionItems.push(obj);
            },
            // åˆ é™¤è¡Œ
            clickDeleteline(scope) {
                this.inspectionItems.splice(scope.$index, 1);
            },
            // åˆ é™¤æ£€éªŒå€¼åˆ—
            clickDeleteInspectionColumn() {
                if (this.empiricalValueAdd - 1 === 0) {} else {
                    if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                        this.empiricalValueAdd = this.empiricalValueAdd - 1;
                        this.inspectionItems.forEach(i => {
                            i.testValueList.splice(this.empiricalValueAdd, 1);
                        });
                    }
                }
            },
            // æ·»åŠ æ£€éªŒå€¼åˆ—
            clickAddInspectionColumn() {
                this.empiricalValueAdd = this.empiricalValueAdd + 1;
            }
        },
        created() {
            this.defaultInitializationTable(); // åˆå§‹åŒ–表格数据
        }
    }
</script>
<style></style>
src/components/view/laboratoryManagement.vue
@@ -1,1053 +1,756 @@
<template>
  <div class="laboratoryMangement">
    <el-row>
      <el-col :span="12" class="top_left_name">设备维护</el-col>
      <el-col :span="12" style="text-align: right;" class="title">
        <el-button
          @click="testItem()"
          type="primary"
          size="mini"
          icon="el-icon-plus"
          style="background: #004EA2; "
          >新增仪器设备</el-button
        >
        <el-dialog
          title="新增仪器设备"
          :visible.sync="dialogVisible"
          width="750px"
          :before-close="handleClose"
        >
          <el-form
            :model="ruleForm"
            :rules="rules"
            ref="ruleForm"
            label-width="130px"
            class="demo-ruleForm"
          >
            <el-row>
              <el-col :span="12">
                <el-form-item label="设备名称" prop="name">
                  <el-input
                    placeholder="请输入仪器设备编号"
                    style="width: 206px"
                    clearable
                    v-model="ruleForm.name"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="设备用途" prop="type">
                  <el-select
                    v-model="ruleForm.type"
                    @change="selectinstall"
                    placeholder="请选择设备用途"
                  >
                    <el-option label="生产设备" value="1"></el-option>
                    <el-option label="检测设备" value="2"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="设备组" prop="name">
                  <el-select
                    v-model="ruleForm.equr"
                    allow-create
                    filterable
                    @create=""
                    placeholder="请选择设备组"
                  >
                    <el-option
                      v-for="list in equaip"
                      :key="list"
                      :label="list"
                      :value="list"
                    >
                    </el-option>
                  </el-select>
                <!-- <el-autocomplete
                class="inline-input"
                v-model="ruleForm.equr"
                :fetch-suggestions="querySearch"
                 placeholder="请输入内容"
    ></el-autocomplete> -->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="仪器设备编号" prop="name">
                  <el-input
                    placeholder="请输入仪器设备编号"
                    style="width: 206px"
                    clearable
                    v-model="ruleForm.code"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="保管人" prop="keeper">
                  <el-select
                    v-model="ruleForm.keeper"
                    placeholder="请选择保管人"
                  >
                    <el-option
                      v-for="list in keeperList"
                      :key="list.index"
                      :label="list.name"
                      :value="list.id"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="计量截至有效期" prop="endMeasure">
                  <el-date-picker
                    style="width: 206px"
                    type="date"
                    placeholder="请选择计量截至有效期"
                    v-model="ruleForm.endMeasure"
                    :picker-options="pickerOptions"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="设备状态" prop="deviceStatus" required>
                  <el-select
                    v-model="ruleForm.deviceStatus"
                    placeholder="请选择设备状态"
                  >
                    <el-option
                      label="运行"
                      style="color: #66c03b"
                      value="1"
                    ></el-option>
                    <el-option
                      label="报废"
                      style="color: #ac9299"
                      value="2"
                    ></el-option>
                    <el-option
                      label="检修"
                      style="color: #52d6c0"
                      value="3"
                    ></el-option>
                    <el-option
                      label="故障"
                      style="color: #f36b6c"
                      value="4"
                    ></el-option>
                    <el-option
                      label="空闲"
                      style="color: #fcb642"
                      value="5"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="厂家" prop="factory" required>
                  <el-input
                    style="width: 206px"
                    placeholder="请输入厂家"
                    clearable
                    v-model="ruleForm.factory"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- <el-row>
              <el-col :span="12">
                <el-form-item label="规格型号">
                  <el-input
                    placeholder="规格型号"
                    :disabled="true"
                    style="width: 206px"
                    v-model="showCodeNameModel.specifications"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row> -->
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
            <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
          </span>
        </el-dialog>
      </el-col>
    </el-row>
    <el-row class="left_row">
      <div
        :style="
    <div class="laboratoryMangement">
        <el-row>
            <el-col :span="12" class="top_left_name">设备维护</el-col>
            <el-col :span="12" style="text-align: right;" class="title">
                <el-button @click="testItem()" type="primary" size="mini" icon="el-icon-plus"
                    style="background: #004EA2; ">新增仪器设备</el-button>
                <el-dialog title="新增仪器设备" :visible.sync="dialogVisible" width="750px" :before-close="handleClose">
                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="设备名称" prop="name">
                                    <el-input placeholder="请输入仪器设备编号" style="width: 206px" clearable v-model="ruleForm.name"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="设备用途" prop="type">
                                    <el-select v-model="ruleForm.type" @change="selectinstall" placeholder="请选择设备用途">
                                        <el-option label="生产设备" value="1"></el-option>
                                        <el-option label="检测设备" value="2"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="设备组" prop="name">
                                    <el-select v-model="ruleForm.equr" allow-create filterable @create="" placeholder="请选择设备组">
                                        <el-option v-for="list in equaip" :key="list" :label="list" :value="list">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="仪器设备编号" prop="name">
                                    <el-input placeholder="请输入仪器设备编号" style="width: 206px" clearable v-model="ruleForm.code"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="保管人" prop="keeper">
                                    <el-select v-model="ruleForm.keeper" placeholder="请选择保管人">
                                        <el-option v-for="list in keeperList" :key="list.index" :label="list.name" :value="list.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="计量截至有效期" prop="endMeasure">
                                    <el-date-picker style="width: 206px" type="date" placeholder="请选择计量截至有效期"
                                        v-model="ruleForm.endMeasure" :picker-options="pickerOptions"></el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="设备状态" prop="deviceStatus" required>
                                    <el-select v-model="ruleForm.deviceStatus" placeholder="请选择设备状态">
                                        <el-option label="运行" style="color: #66c03b" value="1"></el-option>
                                        <el-option label="报废" style="color: #ac9299" value="2"></el-option>
                                        <el-option label="检修" style="color: #52d6c0" value="3"></el-option>
                                        <el-option label="故障" style="color: #f36b6c" value="4"></el-option>
                                        <el-option label="空闲" style="color: #fcb642" value="5"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="厂家" prop="factory" required>
                                    <el-input style="width: 206px" placeholder="请输入厂家" clearable v-model="ruleForm.factory"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <span slot="footer" class="dialog-footer">
                        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
                        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
                    </span>
                </el-dialog>
            </el-col>
        </el-row>
        <el-row class="left_row">
            <div :style="
          `width: ${isCollapse ? 300 : 0}px;transition: 1s;opacity: ${
            isCollapse ? 1 : 0
          };`
        "
        class="class_sidebar"
      >
        <el-radio-group
          class="ai-tab-change"
          style="width: 270px; margin-top: 5px"
          v-model="equipment"
          @input="RadioChange"
        >
        <el-radio-button  label="1">生产设备</el-radio-button>
        <el-radio-button  label="2">检验设备</el-radio-button>
        </el-radio-group>
        <!-- <el-input
          class="frame_input"
          v-model="search_class"
          placeholder="请输入分类名称"
          size="small"
        >
          <i
            slot="suffix"
            class="el-icon-search"
            style="font-size: 23px; padding: 5px 0;cursor:pointer;"
            @click="handlerDeptList"
          ></i>
        </el-input> -->
        <el-tree
          :data="towTree"
          ref="tree"
          :props="{ children: 'children', label: 'father' }"
          node-key="father"
          default-expand-all
          highlight-current
          style="margin-top: 20px;"
          @node-click="handleNodeClick"
        >
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <span
              ><i
                :class="
        " class="class_sidebar">
                <el-radio-group class="ai-tab-change" style="width: 270px; margin-top: 5px" v-model="equipment"
                    @input="RadioChange">
                    <el-radio-button label="1">生产设备</el-radio-button>
                    <el-radio-button label="2">检验设备</el-radio-button>
                </el-radio-group>
                <el-tree :data="towTree" ref="tree" :props="{ children: 'children', label: 'father' }" node-key="father"
                    default-expand-all highlight-current style="margin-top: 20px;" @node-click="handleNodeClick">
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="
                  `node_i ${
                    data.code != '[4]'
                      ? 'el-icon-folder-opened'
                      : 'el-icon-tickets'
                  }`
                "
              ></i>
              {{ data.father }}</span
            >
           <!--  <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
            </el-button> -->
          </div>
        </el-tree>
      </div>
      <div
        class="table_div"
        :style="`width: calc(100vw - ${isCollapse ? '475' : '170'}px);`"
      >
        <div
          :title="isCollapse ? '点击展开' : '点击收起'"
          class="box_bgd"
          @click="isC"
        >
          <div class="upper_triangle"></div>
          <div class="corner">
            <!-- ç‚¹å‡»å±•开收起导航和切换对应图标 -->
            <i
              :class="
                "></i>
                            {{ data.father }}</span>
                    </div>
                </el-tree>
            </div>
            <div class="table_div" :style="`width: calc(100vw - ${isCollapse ? '475' : '170'}px);`">
                <div :title="isCollapse ? '点击展开' : '点击收起'" class="box_bgd" @click="isC">
                    <div class="upper_triangle"></div>
                    <div class="corner">
                        <!-- ç‚¹å‡»å±•开收起导航和切换对应图标 -->
                        <i :class="
                !isCollapse ? 'el-icon-arrow-left' : 'el-icon-arrow-right'
              "
            ></i>
          </div>
          <div class="under_triangle"></div>
        </div>
        <div class="main_table_div">
          <div class="table_top_div">
            <el-input
              class="table_top_input"
              size="small"
              v-model="codeNameModel"
              prefix-icon="el-icon-search"
              placeholder="请输入编号/设备名称/型号规格"
              clearable
            >
            </el-input>
            <el-button size="mini" @click="reset"><span>重 ç½®</span></el-button>
            <el-button
              size="mini"
              type="primary"
              @click="selectSearch"
              style="background: #004EA2;"
              ><span>查 è¯¢</span></el-button
            >
            <el-select
              @change="staueValueChange"
              v-model="staue_value"
              size="small"
              placeholder="请选择设备状态"
              class="table_top"
            >
              <el-option
                label="运行"
                style="color: #66c03b"
                value="1"
              ></el-option>
              <el-option
                label="报废"
                style="color: #ac9299"
                value="2"
              ></el-option>
              <el-option
                label="检修"
                style="color: #52d6c0"
                value="3"
              ></el-option>
              <el-option
                label="故障"
                style="color: #f36b6c"
                value="4"
              ></el-option>
              <el-option
                label="空闲"
                style="color: #fcb642"
                value="5"
              ></el-option>
            </el-select>
          </div>
          <el-table
            :data="tableData"
            border
            height="calc(100vh - 220px)"
            style="padding: 10px;"
          >
            <el-table-column prop="date" label="序号" width="60">
              <template v-slot="scope">
                {{ scope.$index + 1 }}
              </template>
            </el-table-column>
            <el-table-column prop="code" label="仪器设备编号" width="125">
            </el-table-column>
            <el-table-column prop="name" label="仪器设备名称" width="125">
            </el-table-column>
            <el-table-column prop="userName" label="保管人"> </el-table-column>
            <el-table-column
              prop="DATE_FORMAT(end_measure, '%Y-%m-%d')"
              label="计量截至有效期"
              width="147"
            >
            </el-table-column>
            <el-table-column prop="device_status" label="使用状态">
              <template slot-scope="scope">
                <el-tag
                  v-if="scope.row.device_status == 1"
                  disable-transitions
                  type="success"
                  >运行</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 2"
                  disable-transitions
                  type="info"
                  >报废</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 3"
                  style="color: #52d6c0"
                  disable-transitions
                  type="info"
                  >检修</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 4"
                  disable-transitions
                  type="danger"
                  >故障</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 5"
                  style="color: #fcb642"
                  disable-transitions
                  type="info"
                  >空闲</el-tag
                >
              </template>
            </el-table-column>
            <el-table-column
              prop="factory"
              label="厂家"
              :show-overflow-tooltip="true"
            >
            </el-table-column>
            <!-- <el-table-column prop="inspectProject" label="检测项目">
            </el-table-column>
            <el-table-column prop="testSample" label="检验样品">
            </el-table-column>
            <el-table-column prop="user_name" label="检测人"> </el-table-column> -->
            <el-table-column prop="name" label="操作">
              <template v-slot="scope">
                <el-button
                  @click="handleClick(scope.row)"
                  type="text"
                  size="small"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </el-row>
  </div>
              "></i>
                    </div>
                    <div class="under_triangle"></div>
                </div>
                <div class="main_table_div">
                    <div class="table_top_div">
                        <el-input class="table_top_input" size="small" v-model="codeNameModel" prefix-icon="el-icon-search"
                            placeholder="请输入编号/设备名称/型号规格" clearable>
                        </el-input>
                        <el-button size="mini" @click="reset"><span>重 ç½®</span></el-button>
                        <el-button size="mini" type="primary" @click="selectSearch" style="background: #004EA2;"><span>查
                                è¯¢</span></el-button>
                        <el-select @change="staueValueChange" v-model="staue_value" size="small" placeholder="请选择设备状态"
                            class="table_top">
                            <el-option label="运行" style="color: #66c03b" value="1"></el-option>
                            <el-option label="报废" style="color: #ac9299" value="2"></el-option>
                            <el-option label="检修" style="color: #52d6c0" value="3"></el-option>
                            <el-option label="故障" style="color: #f36b6c" value="4"></el-option>
                            <el-option label="空闲" style="color: #fcb642" value="5"></el-option>
                        </el-select>
                    </div>
                    <el-table :data="tableData" border height="calc(100vh - 220px)" style="padding: 10px;">
                        <el-table-column prop="date" label="序号" width="60">
                            <template v-slot="scope">
                                {{ scope.$index + 1 }}
                            </template>
                        </el-table-column>
                        <el-table-column prop="code" label="仪器设备编号" width="125">
                        </el-table-column>
                        <el-table-column prop="name" label="仪器设备名称" width="125">
                        </el-table-column>
                        <el-table-column prop="userName" label="保管人"> </el-table-column>
                        <el-table-column prop="DATE_FORMAT(end_measure, '%Y-%m-%d')" label="计量截至有效期" width="147">
                        </el-table-column>
                        <el-table-column prop="device_status" label="使用状态">
                            <template slot-scope="scope">
                                <el-tag v-if="scope.row.device_status == 1" disable-transitions type="success">运行</el-tag>
                                <el-tag v-else-if="scope.row.device_status == 2" disable-transitions type="info">报废</el-tag>
                                <el-tag v-else-if="scope.row.device_status == 3" style="color: #52d6c0" disable-transitions
                                    type="info">检修</el-tag>
                                <el-tag v-else-if="scope.row.device_status == 4" disable-transitions type="danger">故障</el-tag>
                                <el-tag v-else-if="scope.row.device_status == 5" style="color: #fcb642" disable-transitions
                                    type="info">空闲</el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column prop="factory" label="厂家" :show-overflow-tooltip="true">
                        </el-table-column>
                        <el-table-column prop="name" label="操作">
                            <template v-slot="scope">
                                <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </div>
        </el-row>
    </div>
</template>
<script>
export default {
  name: "LaboratoryManagement",
  data() {
    return {
      value: "",
      dialogVisible: false,
      checkTreeNode:{},
      isCollapse: true, //默认为展开
      radio1: "true", // åˆ†ç±»åˆ‡æ¢
      tableData: [], // ä¸»é¡µè¡¨æ ¼æ•°æ®
      inspectionList: [], //检验项目下拉框列表
      showCodeNameModel: {}, // æ–°å¢žä»ªå™¨å±•示禁止框
      keeperList: [], // æ–°å¢žè®¾å¤‡ä¿ç®¡äººä¸‹æ‹‰æ¡†
      parentClassificationList: [], // æ–°å¢žè®¾å¤‡çˆ¶çº§åˆ†ç±»ä¸‹æ‹‰æ¡†
      search_class: "", // åˆ†ç±»æœç´¢æ¡†å†…容
      codeNameModel: "", // ç¼–码名称型号模糊查询
      staue_value: "", // ä¸»é¡µè¡¨æ ¼ä¸Šæ–¹çš„状态选择
      // BOM树数据结构
      towTree: [],
      equipment: '1',
      equaip:[],
      ruleForm: {
        // æ–°å¢žä»ªå™¨è¡¨å•
        code: "",
        father: "",
        deviceStatus: "",
        endMeasure: "",
        factory: "",
        keeper: "",
        name: "",
        rawInsProductId: "",
        type: "",
        // treedata:{
        //     father:'设备组1',
        // },
        equr:'',
      },
      delete:{},
      equip:1,
      rules: {
        name: [
          { required: true, message: "请输入仪器设备编号", trigger: "blur" },
          { min: 2, max: 25, message: "长度在 2 åˆ° 25 ä¸ªå­—符", trigger: "blur" }
        ],
        keeper: [
          { required: true, message: "请选择保管人", trigger: "change" }
        ],
        endMeasure: [
          {
            type: "date",
            required: true,
            message: "请选择计量截至有效期",
            trigger: "change"
          }
        ],
        deviceStatus: [
          { required: true, message: "请选择设备状态", trigger: "change" }
        ],
        factory: [
          { required: true, message: "请输入厂家", trigger: "blur" },
          { min: 2, max: 25, message: "长度在 2 åˆ° 50 ä¸ªå­—符", trigger: "blur" }
        ],
        rawInsProductId: [
          { required: true, message: "请选择检测项目", trigger: "change" }
        ],
        type: [{ required: true, message: "请选择设备用途", trigger: "change" }]
      },
      pickerOptions: {
        //禁用当前日期之前的日期
        disabledDate(time) {
          //Date.now()是javascript中的内置函数,它返回自1970å¹´1月1日00:00:00 UTC以来经过的毫秒数。
          return time.getTime() < Date.now() - 8.64e7;
        }
      }
    };
  },
  mounted() {
    // åˆå§‹åŒ–调用二级树
    this.twoTreeApi();
    // åˆå§‹åŒ–调用表格数据
    // this.tableDataApi();
    // this.selectDevice()
  },
  methods: {
    handleNodeClick(val) {
      this.checkTreeNode = val
      console.log(this.checkTreeNode);
        this.selectDevice()
    },
    selectInput(){
    },
    // querySearch(queryString, cb) {
    //   console.log(this.equaip);
    //     var restaurants = this.equaip;
    //     var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
    //     // è°ƒç”¨ callback è¿”回建议列表的数据
    //     cb(results);
    //   },
    //   createFilter(queryString) {
    //     return (restaurant) => {
    //       return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
    //     };
    //   },
    staueValueChange() {
      this.selectDevice()
      // this.tableData = [];
      // let val = 1;
      // if (this.radio1 === "false") {
      //   val = 2;
      // }
      // this.$axios
      //   .get(this.$api.url.tableDeviceList, {
      //     params: { type: val, deviceStatue: this.staue_value }
      //   })
      //   .then(res => {
      //     this.tableData = res.data;
      //   });
    },
    // åŠ¨æ€æŽ§åˆ¶å±•å¼€ä¸Žæ”¶èµ·å’Œåˆ‡æ¢å¯¹åº”å›¾æ ‡
    isC() {
      this.isCollapse = !this.isCollapse;
    },
    productSelect(e) {
      let value = e.target.value; // è¾“入框值
      if (value) {
        // ä½ è¾“入才有这个值 ä¸ä¸ºç©ºï¼Œå¦‚果你下拉框选择的话 è¿™ä¸ªå€¼ä¸ºç©º
        this.value = value;
      }
    },
    submitForm() {
      // this.$refs.ruleForm.validate(valid => {
      //   if (valid) {
      //     this.ruleForm.father = this.value;
      //     this.$axios
      //       .post(this.$api.url.addDeviceInstrument, this.ruleForm, {
      //         headers: {
      //           "Content-Type": "application/json"
      //         }
      //       })
      //       .then(res => {
      //         this.keeperList = res.data;
      //         // æˆåŠŸå…³é—­æ–°å¢žå¼¹å‡ºæ¡†
      //         this.dialogVisible = false;
      //       });
      //   } else {
      //     console.log("error submit!!");
      //     return false;
      //   }
      // });
      this.addApi()
      this.dialogVisible = false;
    },
    handleClose(done) {
      this.$confirm("确认关闭?")
        .then(_ => {
          done();
        })
        .catch(_ => {});
    },
    testItem() {
      this.dialogVisible = true;
      this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
        this.keeperList = res.data;
      });
    },
    selectinstall(val) {
      this.equip = val
      this.listgroup()
    },
    listgroup() {
        this.$axios.get(this.$api.url.listgroup,{
            params:{
              type:this.equip
            }
        })
        .then(res =>{
          this.equaip = res.data
          // res.data.forEach(item=>{
          //   let obj={
          //     id: item,
          //     value: item
          //   }
          //   this.equaip.push(obj)
            console.log(this.equaip);
          // })
        })
    },
    RadioChange(val){
      console.log(val);
        this.equip = val
        this.twoTreeApi()
    },
    twoTreeApi() {
      this.$axios.get(this.$api.url.towTree,{
        params:{
            type:this.equip,
        }
      }).then(res => {
        // let list = res.data;
        // list.forEach(i => {
        //   if (i.name === undefined) {
        //     i.name = i.children[0].name;
        //     i.id = i.children[0].id;
        //     i.children = undefined;
        //   }
        // });
        this.towTree = res.data;
        this.$nextTick(() => {
                this.$refs.tree.setCurrentKey(this.towTree[0].father) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
            })
      console.log(this.towTree);
        let one=this.towTree[0]
        console.log(one);
        let name =one.father
        this.checkTreeNode.father = name
              console.log(name);
        this.selectDeviceStart(name)
        });
    },
    selectDeviceStart(name,) {//右边数据
      this.$axios.get(this.$api.url.selectDevice,{
        params:{
          father:name,
          type:this.equip,
          deviceStatus:this.staue_value,
          message:this.codeNameModel,
        }
      }).then(res =>{
        console.log(res);
        this.tableData = res.data
      }, {
                headers: {
                        "Content-Type": "application/json"
                      }
      })
    },
    selectDevice() {//右边数据
      this.$axios.get(this.$api.url.selectDevice,{
        params:{
          father:this.checkTreeNode.father,
          type:this.equip,
          deviceStatus:this.staue_value,
          message:this.codeNameModel,
        }
      }).then(res =>{
        console.log(res);
        this.tableData = res.data
      }, {
                headers: {
                        "Content-Type": "application/json"
                      }
      })
    },
    addApi() {
      this.$axios.post(this.$api.url.addApi,{
        code:this.ruleForm.code,
        deviceStatus:this.ruleForm.deviceStatus,
        endMeasure:this.ruleForm.endMeasure,
        factory:this.ruleForm.factory,
        father:this.ruleForm.equr,
        keeper:this.ruleForm.keeper,
        name:this.ruleForm.name,
        type:this.ruleForm.type,
      }, {headers: {"Content-Type": "application/json"}
    }).then(res =>{
      this.selectDevice()
      this.$message.success('新增成功')
      this.ruleForm = {}
    })
    },
    // tableDataApi() {
    //   this.$axios.get(this.$api.url.tableDeviceList).then(res => {
    //     this.tableData = res.data;
    //   });
    // },
    reset() {
      // this.tableDataApi();
      // this.radio1 = "true";
      // this.codeNameModel = "";
      // this.staue_value = "";
      this.staue_value = ""
      this.codeNameModel = ""
      this.selectDevice()
    },
    handlerDeptList() {
      this.towTree = [];
      let val = 1;
      if (this.radio1 === "false") {
        val = 2;
      }
      this.$axios
        .get(this.$api.url.towTree, {
          params: { type: val, search_class: this.search_class }
        })
        .then(res => {
          this.towTree = res.data;
        });
    },
    selectSearch() {
      this.selectDevice()
      // this.tableData = [];
      // if (this.radio1 === "false") {
      //   this.$axios
      //     .get(this.$api.url.tableDeviceList, {
      //       params: { type: 1, codeNameModel: this.codeNameModel }
      //     })
      //     .then(res => {
      //       this.tableData = res.data;
      //     });
      // } else if (this.radio1 === "true") {
      //   this.$axios
      //     .get(this.$api.url.tableDeviceList, {
      //       params: { type: 2, codeNameModel: this.codeNameModel }
      //     })
      //     .then(res => {
      //       this.tableData = res.data;
      //     });
      // }
    },
    delDeviceById() {
      this.$axios.post(this.$api.url.delDeviceById,{
          id:this.delete.id
      }).then(res=>{
        this.$parent.removeAllTab()
      });
    },
    handleClick(row) {
      console.log(row);
        this.delete = row
        this.delDeviceById()
        this.selectDevice()
      // this.$confirm("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
      //   confirmButtonText: "确定",
      //   cancelButtonText: "取消",
      //   type: "warning"
      // }).then(() => {
      //   this.$axios
      //     .delete(this.$api.url.deleteDevice, { params: { deviceId: row.id } })
      //     .then(res => {
      //       this.$message({
      //         message: res.message,
      //         type: "success"
      //       });
      //       datas.splice(index, 1);
      //     })
      //     .catch(err => {
      //       this.$message({
      //         message: err.message,
      //         type: "warning"
      //       });
      //     });
      // });
    },
    remove(node, data) {
      this.$confirm("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        console.log(`output->data`, data);
        let val = 1;
        if (this.radio1 === "false") {
          val = 2;
        }
        if (data.id === undefined) {
          console.log(`output->执行力`, "+++++++++++++++");
          this.$axios
            .delete(this.$api.url.deleteIdorFather, {
              params: { deviceFather: data.name, type: val }
            })
            .then(res => {
              if (res.code === 200) {
                this.$message({
                  message: res.message,
                  type: "success"
                });
                this.handlerDeptList();
                this.selectSearch();
              } else {
                this.$message({
                  message: res.message,
                  type: "warning"
                });
              }
            });
        } else if (data.id !== undefined) {
          console.log(`output->执行力`, "----------------");
          this.$axios
            .delete(this.$api.url.deleteIdorFather, { params: { id: data.id } })
            .then(res => {
              if (res.code === 200) {
                this.$message({
                  message: res.message,
                  type: "success"
                });
                this.handlerDeptList();
                this.selectSearch();
              } else {
                this.$message({
                  message: res.message,
                  type: "warning"
                });
              }
            });
        }
      });
    },
  },
  watch: {
    "ruleForm.rawInsProductId": {
      //监听ruleForm.rawInsProductId
      handler: function(newVal, oldVal) {
        if (newVal != null && newVal !== "") {
          this.$axios
            .get(this.$api.url.selectDeviceInspectMessage, {
              params: { inspectId: newVal }
            })
            .then(res => {
              this.showCodeNameModel = res.data;
            });
        }
      }
    },
    // dialogVisible: {
    //   handler: function(newVal, oldVal) {
    //     if (newVal) {
    //       // æˆåŠŸæ¸…ç©ºè¾“å…¥å†…å®¹
    //       this.ruleForm = {};
    //       this.value = "";
    //       this.showCodeNameModel = {};
    //       this.$refs.ruleForm.resetFields();
    //     }
    //   }
    // },
    radio1: {
      handler: function(newVal, oldVal) {
        this.towTree = [];
        this.tableData = [];
        if (newVal === "true") {
          this.twoTreeApi();
          this.tableDataApi();
        } else if (newVal === "false") {
          this.$axios
            .get(this.$api.url.towTree, { params: { type: 2 } })
            .then(res => {
              let list = res.data;
              list.forEach(i => {
                if (i.name === undefined) {
                  i.name = i.children[0].name;
                  i.id = i.children[0].id;
                  i.children = undefined;
                }
              });
              this.towTree = res.data;
            });
          this.$axios
            .get(this.$api.url.tableDeviceList, { params: { type: 2 } })
            .then(res => {
              this.tableData = res.data;
            });
        }
      }
    }
  }
};
    export default {
        name: "LaboratoryManagement",
        data() {
            return {
                value: "",
                dialogVisible: false,
                checkTreeNode: {},
                isCollapse: true, //默认为展开
                radio1: "true", // åˆ†ç±»åˆ‡æ¢
                tableData: [], // ä¸»é¡µè¡¨æ ¼æ•°æ®
                inspectionList: [], //检验项目下拉框列表
                showCodeNameModel: {}, // æ–°å¢žä»ªå™¨å±•示禁止框
                keeperList: [], // æ–°å¢žè®¾å¤‡ä¿ç®¡äººä¸‹æ‹‰æ¡†
                parentClassificationList: [], // æ–°å¢žè®¾å¤‡çˆ¶çº§åˆ†ç±»ä¸‹æ‹‰æ¡†
                search_class: "", // åˆ†ç±»æœç´¢æ¡†å†…容
                codeNameModel: "", // ç¼–码名称型号模糊查询
                staue_value: "", // ä¸»é¡µè¡¨æ ¼ä¸Šæ–¹çš„状态选择
                // BOM树数据结构
                towTree: [],
                equipment: '1',
                equaip: [],
                ruleForm: {
                    // æ–°å¢žä»ªå™¨è¡¨å•
                    code: "",
                    father: "",
                    deviceStatus: "",
                    endMeasure: "",
                    factory: "",
                    keeper: "",
                    name: "",
                    rawInsProductId: "",
                    type: "",
                    equr: '',
                },
                delete: {},
                equip: 1,
                rules: {
                    name: [{
                            required: true,
                            message: "请输入仪器设备编号",
                            trigger: "blur"
                        },
                        {
                            min: 2,
                            max: 25,
                            message: "长度在 2 åˆ° 25 ä¸ªå­—符",
                            trigger: "blur"
                        }
                    ],
                    keeper: [{
                        required: true,
                        message: "请选择保管人",
                        trigger: "change"
                    }],
                    endMeasure: [{
                        type: "date",
                        required: true,
                        message: "请选择计量截至有效期",
                        trigger: "change"
                    }],
                    deviceStatus: [{
                        required: true,
                        message: "请选择设备状态",
                        trigger: "change"
                    }],
                    factory: [{
                            required: true,
                            message: "请输入厂家",
                            trigger: "blur"
                        },
                        {
                            min: 2,
                            max: 25,
                            message: "长度在 2 åˆ° 50 ä¸ªå­—符",
                            trigger: "blur"
                        }
                    ],
                    rawInsProductId: [{
                        required: true,
                        message: "请选择检测项目",
                        trigger: "change"
                    }],
                    type: [{
                        required: true,
                        message: "请选择设备用途",
                        trigger: "change"
                    }]
                },
                pickerOptions: {
                    //禁用当前日期之前的日期
                    disabledDate(time) {
                        //Date.now()是javascript中的内置函数,它返回自1970å¹´1月1日00:00:00 UTC以来经过的毫秒数。
                        return time.getTime() < Date.now() - 8.64e7;
                    }
                },
            };
        },
        mounted() {
            this.twoTreeApi();
        },
        methods: {
            handleNodeClick(val) {
                this.checkTreeNode = val
                this.selectDevice()
            },
            staueValueChange() {
                this.selectDevice()
            },
            // åŠ¨æ€æŽ§åˆ¶å±•å¼€ä¸Žæ”¶èµ·å’Œåˆ‡æ¢å¯¹åº”å›¾æ ‡
            isC() {
                this.isCollapse = !this.isCollapse;
            },
            productSelect(e) {
                let value = e.target.value; // è¾“入框值
                if (value) {
                    // ä½ è¾“入才有这个值 ä¸ä¸ºç©ºï¼Œå¦‚果你下拉框选择的话 è¿™ä¸ªå€¼ä¸ºç©º
                    this.value = value;
                }
            },
            submitForm() {
                this.addApi()
                this.dialogVisible = false;
            },
            handleClose(done) {
                this.$confirm("确认关闭?")
                    .then(_ => {
                        done();
                    })
                    .catch(_ => {});
            },
            testItem() {
                this.dialogVisible = true;
                this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
                    this.keeperList = res.data;
                });
            },
            selectinstall(val) {
                this.equip = val
                this.listgroup()
            },
            listgroup() {
                this.$axios.get(this.$api.url.listgroup, {
                        params: {
                            type: this.equip
                        }
                    })
                    .then(res => {
                        this.equaip = res.data
                    })
            },
            RadioChange(val) {
                this.equip = val
                this.twoTreeApi()
            },
            twoTreeApi() {
                this.$axios.get(this.$api.url.towTree, {
                    params: {
                        type: this.equip,
                    }
                }).then(res => {
                    this.towTree = res.data;
                    this.$nextTick(() => {
                        this.$refs.tree.setCurrentKey(this.towTree[0].father) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
                    })
                    let one = this.towTree[0]
                    let name = one.father
                    this.checkTreeNode.father = name
                    this.selectDeviceStart(name)
                });
            },
            selectDeviceStart(name, ) { //右边数据
                this.$axios.get(this.$api.url.selectDevice, {
                    params: {
                        father: name,
                        type: this.equip,
                        deviceStatus: this.staue_value,
                        message: this.codeNameModel,
                    }
                }).then(res => {
                    this.tableData = res.data
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                })
            },
            selectDevice() { //右边数据
                this.$axios.get(this.$api.url.selectDevice, {
                    params: {
                        father: this.checkTreeNode.father,
                        type: this.equip,
                        deviceStatus: this.staue_value,
                        message: this.codeNameModel,
                    }
                }).then(res => {
                    this.tableData = res.data
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                })
            },
            addApi() {
                this.$axios.post(this.$api.url.addApi, {
                    code: this.ruleForm.code,
                    deviceStatus: this.ruleForm.deviceStatus,
                    endMeasure: this.ruleForm.endMeasure,
                    factory: this.ruleForm.factory,
                    father: this.ruleForm.equr,
                    keeper: this.ruleForm.keeper,
                    name: this.ruleForm.name,
                    type: this.ruleForm.type,
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                }).then(res => {
                    this.twoTreeApi();
                    this.$message.success('新增成功')
                    this.$refs.ruleForm.resetFields()
                })
            },
            reset() {
                this.staue_value = ""
                this.codeNameModel = ""
                this.selectDevice()
            },
            handlerDeptList() {
                this.towTree = [];
                let val = 1;
                if (this.radio1 === "false") {
                    val = 2;
                }
                this.$axios
                    .get(this.$api.url.towTree, {
                        params: {
                            type: val,
                            search_class: this.search_class
                        }
                    })
                    .then(res => {
                        this.towTree = res.data;
                    });
            },
            selectSearch() {
                this.selectDevice()
            },
            delDeviceById() {
                this.$axios.post(this.$api.url.delDeviceById, {
                    id: this.delete.id
                }).then(res => {
                    this.$parent.removeAllTab()
                });
            },
            handleClick(row) {
                this.delete = row
                this.delDeviceById()
                this.selectDevice()
            },
            remove(node, data) {
                this.$confirm("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning"
                }).then(() => {
                    let val = 1;
                    if (this.radio1 === "false") {
                        val = 2;
                    }
                    if (data.id === undefined) {
                        this.$axios
                            .delete(this.$api.url.deleteIdorFather, {
                                params: {
                                    deviceFather: data.name,
                                    type: val
                                }
                            })
                            .then(res => {
                                if (res.code === 200) {
                                    this.$message({
                                        message: res.message,
                                        type: "success"
                                    });
                                    this.handlerDeptList();
                                    this.selectSearch();
                                } else {
                                    this.$message({
                                        message: res.message,
                                        type: "warning"
                                    });
                                }
                            });
                    } else if (data.id !== undefined) {
                        this.$axios
                            .delete(this.$api.url.deleteIdorFather, {
                                params: {
                                    id: data.id
                                }
                            })
                            .then(res => {
                                if (res.code === 200) {
                                    this.$message({
                                        message: res.message,
                                        type: "success"
                                    });
                                    this.handlerDeptList();
                                    this.selectSearch();
                                } else {
                                    this.$message({
                                        message: res.message,
                                        type: "warning"
                                    });
                                }
                            });
                    }
                });
            },
        },
        watch: {
            "ruleForm.rawInsProductId": {
                //监听ruleForm.rawInsProductId
                handler: function(newVal, oldVal) {
                    if (newVal != null && newVal !== "") {
                        this.$axios
                            .get(this.$api.url.selectDeviceInspectMessage, {
                                params: {
                                    inspectId: newVal
                                }
                            })
                            .then(res => {
                                this.showCodeNameModel = res.data;
                            });
                    }
                }
            },
            radio1: {
                handler: function(newVal, oldVal) {
                    this.towTree = [];
                    this.tableData = [];
                    if (newVal === "true") {
                        this.twoTreeApi();
                        this.tableDataApi();
                    } else if (newVal === "false") {
                        this.$axios
                            .get(this.$api.url.towTree, {
                                params: {
                                    type: 2
                                }
                            })
                            .then(res => {
                                let list = res.data;
                                list.forEach(i => {
                                    if (i.name === undefined) {
                                        i.name = i.children[0].name;
                                        i.id = i.children[0].id;
                                        i.children = undefined;
                                    }
                                });
                                this.towTree = res.data;
                            });
                        this.$axios
                            .get(this.$api.url.tableDeviceList, {
                                params: {
                                    type: 2
                                }
                            })
                            .then(res => {
                                this.tableData = res.data;
                            });
                    }
                }
            }
        }
    };
</script>
<style scoped>
.el-tag.el-tag {
  border-color: transparent;
  background-color: transparent;
}
.el-tag.el-tag:hover {
  border-color: transparent;
  background-color: transparent;
}
.el-form-item >>> .el-form-item__error {
  color: #f56c6c;
  font-size: 12px;
  line-height: 1;
  padding-top: 6px;
  position: absolute;
  top: 100%;
  left: 18px;
}
/deep/ .el-icon-arrow-left {
  display: flex;
  line-height: 60px !important;
  justify-content: center;
}
/deep/ .el-icon-arrow-right {
  display: flex;
  line-height: 60px !important;
  justify-content: center;
}
.top_left_name {
  padding-left: 20px;
  line-height: 32px;
}
.left_row {
  height: calc(100vh - 165px);
  margin-top: 9px;
}
.frame_input {
  width: 90%;
  margin: 10px 0;
  transition: 1.5s;
}
.table_top_div {
  margin-left: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
}
.el-dialog__footer {
  padding: 0px 20px 20px;
  text-align: right;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.table_top {
  float: right;
  width: 224px;
  margin-right: 52px;
}
.main_table_div {
  background-color: #fbfbfd;
  height: 100%;
}
.dialog-footer {
  display: block;
  text-align: center;
}
.table_div {
  padding-left: 5px;
  transition: 1s;
  float: left;
  position: relative;
}
.table_top_input {
  width: 20%;
  margin-right: 24px;
}
.custom-tree-node {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding-right: 8px;
  width: 250px;
}
.el-tree {
  width: 280px;
  margin: 0 10px;
}
.custom-tree-node span {
  font-size: 14px !important;
}
.el-icon-delete {
  display: none;
  color: #004ea2;
}
.custom-tree-node:hover .el-icon-delete {
  display: inline;
}
.node_i {
  color: orange;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #f2f2f2;
  border: 0 !important;
  color: #696969;
  line-height: 14px;
  outline: none;
  box-shadow: none;
}
.class_sidebar {
  overflow: hidden;
  height: calc(100vh - 175px);
  text-align: center;
  padding: 8px;
  float: left;
  background-color: #fdfdfe;
}
.box_bgd {
  width: 12px;
  height: 60px;
  position: absolute;
  float: left;
  top: 40%;
  left: -10px;
}
.corner {
  height: 60px;
  background: #ebebec;
}
.upper_triangle {
  width: 0px; /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
  height: 0px;
  border: 6px solid #ebebec;
  border-left-color: transparent;
  border-top-color: transparent;
}
.under_triangle {
  width: 0px; /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
  height: 0px;
  border: 6px solid #ebebec;
  border-left-color: transparent;
  border-bottom-color: transparent;
}
.el-radio-button__inner {
  border: 1px solid #ececed;
  line-height: 14px;
}
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #fdfdfe;
  border: 1px solid #004da2;
  color: #004da2;
  line-height: 14px;
}
    .el-tag.el-tag {
        border-color: transparent;
        background-color: transparent;
    }
    .el-tag.el-tag:hover {
        border-color: transparent;
        background-color: transparent;
    }
    .el-form-item>>>.el-form-item__error {
        color: #f56c6c;
        font-size: 12px;
        line-height: 1;
        padding-top: 6px;
        position: absolute;
        top: 100%;
        left: 18px;
    }
    /deep/ .el-icon-arrow-left {
        display: flex;
        line-height: 60px !important;
        justify-content: center;
    }
    /deep/ .el-icon-arrow-right {
        display: flex;
        line-height: 60px !important;
        justify-content: center;
    }
    .top_left_name {
        padding-left: 20px;
        line-height: 32px;
    }
    .left_row {
        height: calc(100vh - 165px);
        margin-top: 9px;
    }
    .frame_input {
        width: 90%;
        margin: 10px 0;
        transition: 1.5s;
    }
    .table_top_div {
        margin-left: 20px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    .el-dialog__footer {
        padding: 0px 20px 20px;
        text-align: right;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
    .table_top {
        float: right;
        width: 224px;
        margin-right: 52px;
    }
    .main_table_div {
        background-color: #fbfbfd;
        height: 100%;
    }
    .dialog-footer {
        display: block;
        text-align: center;
    }
    .table_div {
        padding-left: 5px;
        transition: 1s;
        float: left;
        position: relative;
    }
    .table_top_input {
        width: 20%;
        margin-right: 24px;
    }
    .custom-tree-node {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        padding-right: 8px;
        width: 250px;
    }
    .el-tree {
        width: 280px;
        margin: 0 10px;
    }
    .custom-tree-node span {
        font-size: 14px !important;
    }
    .el-icon-delete {
        display: none;
        color: #004ea2;
    }
    .custom-tree-node:hover .el-icon-delete {
        display: inline;
    }
    .node_i {
        color: orange;
    }
    ::v-deep .el-radio-button__orig-radio:checked+.el-radio-button__inner {
        background: #f2f2f2;
        border: 0 !important;
        color: #696969;
        line-height: 14px;
        outline: none;
        box-shadow: none;
    }
    .class_sidebar {
        overflow: hidden;
        height: calc(100vh - 175px);
        text-align: center;
        padding: 8px;
        float: left;
        background-color: #fdfdfe;
    }
    .box_bgd {
        width: 12px;
        height: 60px;
        position: absolute;
        float: left;
        top: 40%;
        left: -10px;
    }
    .corner {
        height: 60px;
        background: #ebebec;
    }
    .upper_triangle {
        width: 0px;
        /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
        height: 0px;
        border: 6px solid #ebebec;
        border-left-color: transparent;
        border-top-color: transparent;
    }
    .under_triangle {
        width: 0px;
        /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
        height: 0px;
        border: 6px solid #ebebec;
        border-left-color: transparent;
        border-bottom-color: transparent;
    }
    .el-radio-button__inner {
        border: 1px solid #ececed;
        line-height: 14px;
    }
    .el-radio-button__orig-radio:checked+.el-radio-button__inner {
        background: #fdfdfe;
        border: 1px solid #004da2;
        color: #004da2;
        line-height: 14px;
    }
</style>
<style>
    .laboratoryMangement .title *{
    .laboratoryMangement .title * {
        font-size: 14px;
    }
    .laboratoryMangement .table_top_div *{
    .laboratoryMangement .table_top_div * {
        font-size: 14px;
    }
    .laboratoryMangement .title .el-button {
      height: 32px;
      border: 1px solid rgba(190, 190, 190, 0.44);
      box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
      padding: 0 12px;
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
    .laboratoryMangement .table_top_div .el-button {
      height: 32px;
      border: 1px solid rgba(190, 190, 190, 0.44);
      box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
      padding: 0 12px;
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
</style>
src/components/view/mbom.vue
@@ -18,10 +18,7 @@
                                <el-form-item label="类型:">
                                    <el-select v-model="search.type" size="small" placeholder="请选择"
                                        style="width: 224px;margin-right: 30px;">
                                        <el-option label="橡胶连接器" :value="0"></el-option>
                                        <el-option label="金属连接器" :value="1"></el-option>
                                        <el-option label="湿插拔电连接器" :value="2"></el-option>
                                        <el-option label="分支组件" :value="3"></el-option>
                                        <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
@@ -53,11 +50,6 @@
                        <el-table border :data="tableapi" height="calc(80vh - 250px)" style="width: 100%">
                            <el-table-column type="index" label="序号" width="70">
                            </el-table-column>
                            <!-- <el-table-column prop="date" label="供应商名称" width="180">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.supplier" placeholder=""></el-input>
                                </template>
                            </el-table-column> -->
                            <el-table-column prop="" label="质量追溯号" width="180">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.qualityTraceability" placeholder=""></el-input>
@@ -91,31 +83,19 @@
            <span>类型:</span>
            <el-select v-model="search.type" size="small" @change="TYpe" placeholder="请选择"
                style="width: 224px;margin-right: 30px;">
                <el-option label="橡胶连接器" :value="0"></el-option>
                <el-option label="金属连接器" :value="1"></el-option>
                <el-option label="湿插拔电连接器" :value="2"></el-option>
                <el-option label="分支组件" :value="3"></el-option>
                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
            </el-select>
            <!-- <span>原材料名称:</span>
            <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
            </el-select>
            <el-button size="mini"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" style="background: #004EA2;"><span>查询</span></el-button> -->
        </div>
        <div class="thing">
            <div class="left">
                <el-input v-model="search.technology" @input="query" suffix-icon="el-icon-search" placeholder="请输入搜索内容"
                    size="small" clearable></el-input>
                <el-tree :data="list" ref="tree" style="overflow-y: auto;" highlight-current
                <el-tree :data="list" ref="tree" style="overflow-y: auto;padding-top: 8px;" highlight-current
                    :props="{children: 'children',label: 'name'}" node-key="name" default-expand-all
                    @node-click="handleNodeClick">
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${data.code != '[2]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                            {{data.code}} {{ data.name }}</span>
                        <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)">
                            <i class="el-icon-delete"></i>
                        </el-button> -->
                    </div>
                </el-tree>
            </div>
@@ -132,19 +112,12 @@
                    </el-table-column>
                    <el-table-column label="操作" width="130">
                        <template slot-scope="scope">
                            <!-- <span class="table_do" @click="upContent(scope.row)">编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> -->
                            <span class="table_do" @click="deleteRow(scope.$index, scope.row)">删除</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
        <!-- <el-dialog title="编辑记录内容" :visible.sync="upDia" width="500px">
            <div class="body">
            </div>
        </el-dialog> -->
    </div>
</template>
<script>
@@ -158,8 +131,8 @@
                list: [],
                process: {},
                // handleClose:[],
                checkTreeNode:{
                    id:'',
                checkTreeNode: {
                    id: '',
                },
                tableData: [],
                tableapi: [{
@@ -173,16 +146,25 @@
                upData: {},
                form: {},
                dialogVisible: false,
                typeselect: 0,
                typeselect: '',
                input: '',
                craftapi: [],
                bigType: []
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectAllMbom()
            this.chooseType()
        },
        methods: {
            chooseType() {
                this.$axios.get(this.$api.url.chooseType).then(res => {
                    this.bigType = res.data
                    this.typeselect = res.data[0]
                    this.search.type = res.data[0]
                    this.selectAllleft()
                    this.selectAllMbom()
                })
            },
            selectDataList() {
                this.list.forEach(a => {
                    a.code = '[1]'
@@ -219,16 +201,16 @@
                    }
                })
            },
            addMbom(data,cc) {
                this.$axios.post(this.$api.url.addMbom,{
                        mbomModelDto2List:data,
                        techTemId:cc,
            addMbom(data, cc) {
                this.$axios.post(this.$api.url.addMbom, {
                    mbomModelDto2List: data,
                    techTemId: cc,
                }, {
                    headers: {
                        "Content-Type": "application/json"
                      }
                }).then(res =>{
                        "Content-Type": "application/json"
                    }
                }).then(res => {
                    // console.log(res);
                    this.$message.success('添加完成')
                    this.selectAllMbom()
@@ -256,43 +238,42 @@
            },
            //左边
            selectAllleft() {
            this.$axios.get(this.$api.url.selectAllleft,{
                params:{type:this.typeselect,
                        message:this.search.technology
                }
            }).then(res => {
                this.list = res.data;
                console.log(this.list);
                this.selectDataList()
                this.$nextTick(() => {
                this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
            })
                let one=this.list.filter(item=>{
                return item.children.length>0
                })[0]
                console.log(one);
                let name=one.children[0].id
                console.log(name);
                this.checkTreeNode.id = name
                this.selectAllMbomStart(name)
                this.selectDataList();
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            })
                this.$axios.get(this.$api.url.selectAllleft, {
                    params: {
                        type: this.typeselect,
                        message: this.search.technology
                    }
                }).then(res => {
                    this.list = res.data;
                    this.selectDataList()
                    this.$nextTick(() => {
                        this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
                    })
                    let one = this.list.filter(item => {
                        return item.children.length > 0
                    })[0]
                    let name = one.children[0].id
                    this.checkTreeNode.id = name
                    this.selectAllMbomStart(name)
                    this.selectDataList();
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                })
            },
            selectAllMbomStart(name) {
            this.$axios.get(this.$api.url.selectAllMbom,{
                params:{id:name}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            })
                this.$axios.get(this.$api.url.selectAllMbom, {
                    params: {
                        id: name
                    }
                }).then(res => {
                    this.tableData = res.data;
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                })
            },
            //右边
            selectAllMbom() {
@@ -302,17 +283,14 @@
                    }
                }).then(res => {
                    this.tableData = res.data;
                    console.log(this.tableData);
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                })
            },
            handleNodeClick(data){
                this.checkTreeNode = data
                console.log(data);
                console.log(this.checkTreeNode.id);
            handleNodeClick(data) {
                this.checkTreeNode = data
                this.selectAllMbom()
            },
            handleClose(done) {
@@ -323,23 +301,23 @@
                    .catch(_ => {});
            },
            //新增
            event(){
                this.dialogVisible = true
            event() {
                this.dialogVisible = true
                this.chooseTechFath()
            },
            },
            //添加行
             Addrow() {
            if (this.tableapi == undefined) {
                this.tableapi = new Array();
            }
            let obj = {};
            this.tableapi.push(obj);
            Addrow() {
                if (this.tableapi == undefined) {
                    this.tableapi = new Array();
                }
                let obj = {};
                this.tableapi.push(obj);
            },
            skipshow() {
                // let data = this.tableapi.at(-1)
                // console.log(this.tableapi);
                let cc = this.search.craft
                this.addMbom(this.tableapi,cc)
                this.addMbom(this.tableapi, cc)
                this.dialogVisible = false
            },
            //delAllMbom æ‰¹é‡åˆ é™¤
@@ -363,7 +341,6 @@
                    return el.id
                })
                this.delete = cc.join(',')
                console.log(this.delete);
                this.delAllMbom()
                this.$message.success('删除完成')
            },
@@ -371,10 +348,7 @@
                this.selects = val;
            },
            deleteRow(index, rows) {
                console.log(rows);
                // this.tableData.splice(index,1)
                this.upData.id = rows.id
                console.log(this.upData);
                this.material(index)
            },
@@ -497,4 +471,4 @@
        height: 30px;
        border-radius: 2px;
    }
</style>
</style>
src/components/view/processInspection.vue
@@ -248,7 +248,10 @@
import processInspectionUpdate from '../view/processInspectionUpdate.vue'
import processInspectionLook from '../view/processInspectionLook.vue'
export default {
  components: { processInspectionUpdate, processInspectionLook },
  components: {
    processInspectionUpdate,
    processInspectionLook
  },
  data() {
    return {
      showUp: false,
@@ -552,7 +555,6 @@
        techfather: val.techfather,
        techname: val.techname,
        techId: Number(val.technologyId),
        mtId: Number(val.technologyId),
        unit: val.unit
      }, {
        headers: { "Content-Type": "application/json" }
src/components/view/processInspectionUpdate.vue
@@ -1,701 +1,676 @@
<template>
    <div>
        <!-- ç¼–辑页面 -->
        <div class="addInspection">
            <el-row class="header">
                <el-col :span="12">编辑过程检验单</el-col>
                <el-col :span="12" style="text-align: right;">
                    <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                    <!-- <el-button type="primary" size="mini" style="background: #004EA2; "
              icon="el-icon-circle-plus-outline">新增</el-button> -->
                    <el-button @click="combackFather" type="primary" size="mini" icon="el-icon-back"
                        style="background: #004EA2; ">返回</el-button>
                </el-col>
            </el-row>
            <el-form :model="processInspectVo" ref="addInspectionform" class="addInspectionform" label-position="right"
                label-width="120px" size="small">
                <div class="formwrapper">
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="订单号:">
                                <el-input @blur="selectInfoByOrderId" disabled style="width: 210px;" size="small"
                                    v-model="processInspectVo.orderNumber" placeholder="请输入订单号" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品名称:">
                                <el-select style="width: 210px;" size="small" disabled @change="selectSample"
                                    v-model="processInspectVo.material" placeholder="请选择产品">
                                    <el-option v-for="item in optionsSamplename" :key="item.value" :label="item.name"
                                        :value="item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品编码:">
                                <el-input style="width: 210px;" size="small" disabled
                                    v-model="processInspectVo.materialCode" placeholder="请输入产品编码" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="规格型号:">
                                <el-input style="width: 210px;" size="small" disabled
                                    v-model="processInspectVo.specificationsModel" placeholder="请输入规格型号" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工序名称:">
                                <el-select @change="changeOptionSoptionSprocesses" disabled
                                    v-model="processInspectVo.techfather" placeholder="请选择" style="width: 210px;"
                                    size="small">
                                    <el-option v-for="item in optionSoptionSprocesses" :key="item.name" :label="item.name"
                                        :value="item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工艺名称:">
                                <el-select v-model="processInspectVo.techname" disabled placeholder="请选择"
                                    style="width: 210px;" size="small">
                                    <el-option v-for="item in optionTechnology" :key="item.id" :label="item.name"
                                        :value="item.id + '-' + item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="单位:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.unit"
                                    placeholder="请输入单位" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="数量:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.quantity"
                                    placeholder="请输入数量" />
                            </el-form-item>
                        </el-col>
                        <!-- <el-col :span="10" style="display: flex;justify-content: end;">
    <div>
        <!-- ç¼–辑页面 -->
        <div class="addInspection">
            <el-row class="header">
                <el-col :span="12">编辑过程检验单</el-col>
                <el-col :span="12" style="text-align: right;">
                    <!-- ç‚¹å‡»è¿”回,当前页面值为false -->
                    <el-button @click="combackFather" type="primary" size="mini" icon="el-icon-back"
                        style="background: #004EA2; ">返回</el-button>
                </el-col>
            </el-row>
            <el-form :model="processInspectVo" ref="addInspectionform" class="addInspectionform" label-position="right"
                label-width="120px" size="small">
                <div class="formwrapper">
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="订单号:">
                                <el-input @blur="selectInfoByOrderId" disabled style="width: 210px;" size="small"
                                    v-model="processInspectVo.orderNumber" placeholder="请输入订单号" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品名称:">
                                <el-select style="width: 210px;" size="small" disabled @change="selectSample"
                                    v-model="processInspectVo.material" placeholder="请选择产品">
                                    <el-option v-for="item in optionsSamplename" :key="item.value" :label="item.name" :value="item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="产品编码:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.materialCode"
                                    placeholder="请输入产品编码" />
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="规格型号:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.specificationsModel"
                                    placeholder="请输入规格型号" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工序名称:">
                                <el-select @change="changeOptionSoptionSprocesses" disabled v-model="processInspectVo.techfather"
                                    placeholder="请选择" style="width: 210px;" size="small">
                                    <el-option v-for="item in optionSoptionSprocesses" :key="item.name" :label="item.name"
                                        :value="item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="工艺名称:">
                                <el-select v-model="processInspectVo.techname" disabled placeholder="请选择" style="width: 210px;"
                                    size="small">
                                    <el-option v-for="item in optionTechnology" :key="item.id" :label="item.name"
                                        :value="item.id + '-' + item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="230">
                        <el-col :span="7">
                            <el-form-item label="单位:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.unit"
                                    placeholder="请输入单位" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="7">
                            <el-form-item label="数量:">
                                <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.quantity"
                                    placeholder="请输入数量" />
                            </el-form-item>
                        </el-col>
                        <!-- <el-col :span="10" style="display: flex;justify-content: end;">
                <el-button type="primary" :disabled="isAddProject"  @click="addTestProjevt">生成检验项目</el-button>
              </el-col> -->
                    </el-row>
                </div>
            </el-form>
        </div>
        <div class="inspectionProject">
            <el-row>
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col v-if="!isUpBtn" :span="12" class="inspectionProject_span">
                    <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <el-button style="margin-right: 30px;" size="mini"
                        @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <!-- <el-button
                    </el-row>
                </div>
            </el-form>
        </div>
        <div class="inspectionProject">
            <el-row>
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col v-if="!isUpBtn" :span="12" class="inspectionProject_span">
                    <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <el-button style="margin-right: 30px;" size="mini" @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <!-- <el-button
              size="mini"
              style="margin-right: 30px;"
              @click="clickAddLine()"
              >添加检验行</el-button
            > -->
                </el-col>
            </el-row>
            <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod"
                height="calc(100vh - 550px)" style="width: 100%">
                <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="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-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="dname" label="试验设备" min-width="100">
                    <template slot-scope="scope">
                        <el-col>
                            <el-button v-if="!scope.row.isSelectDevice" type="text" @click="clickTableSelect(scope)">{{
                                scope.row.dname == null ? "请选择" : scope.row.dname
                            }}</el-button>
                            <el-select @blur="blurNode(scope)" v-else-if="scope.row.isSelectDevice" style="width: 100%;"
                                @change="clickNodeSure(scope.row)" v-model="filterText" placeholder="请选择">
                                <el-option v-for="item in materialOptions" :key="item.id" :label="item.device"
                                    :value="item.id">
                                </el-option>
                            </el-select>
                        </el-col>
                    </template>
                </el-table-column>
                <el-table-column label="结论">
                    <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-show="scope.row.result === null">暂未结论</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column v-if="detailId == null" label="操作" width="100">
                </el-col>
            </el-row>
            <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod"
                height="calc(100vh - 550px)" style="width: 100%">
                <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="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-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="dname" label="试验设备" min-width="100">
                    <template slot-scope="scope">
                        <el-col>
                            <el-button type="text" @click="clickTableSelect(scope)">
                                {{scope.row.dname == null ? "请选择" : scope.row.dname}}
                            </el-button>
                        </el-col>
                    </template>
                </el-table-column>
                <el-table-column label="结论">
                    <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-show="scope.row.result === null">{{null}}</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column v-if="detailId == null" label="操作" width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="clickDeleteline(scope)">删除</el-button>
            </template>
          </el-table-column> -->
            </el-table>
        </div>
        <div class="inspectionResult">
            <span>检测结果</span>
            <el-table :data="inspectionResultForm">
                <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>
                <el-table-column prop="conclusion" label="检验结论">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.conclusion === 1">合格</span>
                        <span style="color: #E84738;" v-else-if="scope.row.conclusion === 0">不合格</span>
                        <span v-show="scope.row.conclusion === null || scope.row.conclusion === undefined">暂未结论</span>
                    </template>
                </el-table-column>
                <el-table-column prop="operation" label="上报">
                    <template slot-scope="scope">
                        <el-button v-if="scope.row.conclusion === null || scope.row.conclusion === undefined" type="primary"
                            @click="escalation" size="small">上报</el-button>
                        <el-button v-else type="success" size="small">已上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
            <div class="div_device_dialog">
                <!-- <el-select style="width: 100%;" @change="clickNodeSure()" v-model="filterText" placeholder="请选择">
                    <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id">
                    </el-option>
                </el-select> -->
            </div>
            <!-- <span slot="footer" class="dialog-footer">
                <el-button @click="centerDialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="clickNodeSure()">ç¡® å®š</el-button>
            </span> -->
        </el-dialog>
    </div>
            </el-table>
        </div>
        <div class="inspectionResult">
            <span>检测结果</span>
            <el-table :data="inspectionResultForm">
                <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>
                <el-table-column prop="conclusion" label="检验结论">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.conclusion === 1">合格</span>
                        <span style="color: #E84738;" v-else-if="scope.row.conclusion === 0">不合格</span>
                        <span v-show="scope.row.conclusion === null || scope.row.conclusion === undefined">暂未结论</span>
                    </template>
                </el-table-column>
                <el-table-column prop="operation" label="上报">
                    <template slot-scope="scope">
                        <el-button v-if="scope.row.conclusion === null || scope.row.conclusion === undefined" type="primary"
                            @click="escalation" size="small">上报</el-button>
                        <el-button v-else type="success" size="small">已上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
            <div class="div_device_dialog">
                <el-input placeholder="输入关键字进行过滤" v-model="filterText" style="margin-bottom: 6px;">
                </el-input>
                <el-tree class="filter-tree" :data="materialOptions" :props="defaultProps" default-expand-all highlight-current
                    @node-click="nodeClick" :filter-node-method="filterNode" ref="tree">
                    <div class="custom-tree-node" slot-scope="{ data }">
                        <span><i :class="`node_i ${data.children ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>{{ data.name }}</span>
                    </div>
                </el-tree>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="centerDialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="clickNodeSure()">ç¡® å®š</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    props: ['rowInfo'],
    data() {
        return {
            isUpBtn: false,
            showUp: false,
            isAddProject: false,
            detailId: 0,
            row: {},
            search: {
                countSize: 10,
                pageSize: 1,
                result: "", // æ£€æµ‹çŠ¶æ€
                name: "", // äº§å“åç§°
                techfather: "" // å·¥åº
            },
            optionsSamplename: [],
            inspectionTable: [],
            tableColumn: [],
            optionSoptionSprocesses: [],
            optionTechnology: [],
            inspectionTableTotal: "",
            treeProject: [],
            // æ·»åŠ åˆ—
            empiricalValueAdd: 1,
            // ç¼–辑时存储最长的列数字,做删除判断
            empiricalValueAddMaxNumber: 0,
            showAddPage: false,
            processInspectVo: {
                material: null,
                materialCode: null,
                orderNumber: "",
                quantity: null,
                specificationsModel: null,
                techfather: null,
                techname: null,
                technologyId: null,
                unit: null
            },
            InspectioniD: null,
            addInspectionform: [
                {
                    number: "",
                    username: "",
                    projectname: "",
                    tracenumber: "",
                    code: "",
                    class: "",
                    specificationmodel: "",
                    unit: "",
                    quantity: "",
                    group: "",
                    worker: "",
                    machine: ""
                }]
            ,
            inspectionItems: [], // æ–°å¢žæ£€éªŒé¡¹ç›®è¡¨æ ¼
            inspectionResultForm: [
                {
                    id: "",
                    name: "",
                    inspecter: "",
                    conclusion: "",
                    operation: ""
                }
            ],
            options: [],
            value: "",
            rowList: [],
            spanArr: [],
            position: 0,
            // è®¾å¤‡é€‰æ‹©æ ‘显示
            centerDialogVisible: false,
            filterText: "",
            materialOptions: [],
            defaultProps: {
                // è®¾å¤‡æ ‘数据设置
                children: "children",
                label: "name"
            },
            nodeData: {
                id: 0,
                name: null
            }, // node点击保存当前点击数据
            clickSelectDevice: {
                index: null, // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                rpId: null // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
            }
        };
    },
    watch: {
        // filterText(val) {
        //     this.$refs.tree.filter(val);
        // }
    },
    created() {
        if (this.rowInfo.result != null && this.rowInfo.result != '') {
            this.isUpBtn = true
        }
        this.processInspectVo.orderNumber = this.rowInfo.order_number
        this.processInspectVo.material = this.rowInfo.material
        this.processInspectVo.materialCode = this.rowInfo.material_code
        this.processInspectVo.specificationsModel = this.rowInfo.specifications_model
        this.processInspectVo.techfather = this.rowInfo.techfather
        this.processInspectVo.techname = this.rowInfo.techname
        this.processInspectVo.unit = this.rowInfo.unit
        this.processInspectVo.quantity = this.rowInfo.quantity
        this.detailId = this.rowInfo.id
        this.inspectionResultForm[0].id = this.rowInfo.material_code
        this.inspectionResultForm[0].name = this.rowInfo.material
        this.inspectionResultForm[0].conclusion = this.rowInfo.result
        // console.log(this.detailId);
    },
    mounted() {
        this.getTableData()
    },
    methods: {
        blurNode(scope) {
            // console.log(11);
            // this.$set(this.inspectionItems[scope.$index],'isSelectDevice',false)
        },
        escalation() {
            let arr = this.inspectionItems
            let bl = false
            for (let index = 0; index < arr.length; index++) {
                const element = arr[index];
                if (element.dname != null && element.empiricalValueAddss[0] != '') {
                    bl = true
                    break
                } else {
                    bl = false
                }
            }
            if (bl != true) {
                this.$message({
                    message: '请先检测一项项目!',
                    type: 'warning'
                });
                return
            }
            this.$axios.post(this.$api.url.processInspectUpdateProcessInspectsById, {
                id: this.detailId
            }).then(res => {
                if (res.code == 200) {
                    if (res.message === '项目未检验完!') {
                        this.$message({
                            message: res.message,
                            type: 'warning'
                        });
                        return
                    }
                    this.$message({
                        message: '上报成功',
                        type: 'success'
                    });
                    this.$parent.combackMain(true)
                } else {
                    this.$message({
                        message: res.message,
                        type: 'warning'
                    });
                }
    export default {
        props: ['rowInfo'],
        data() {
            return {
                isUpBtn: false,
                showUp: false,
                isAddProject: false,
                detailId: 0,
                row: {},
                search: {
                    countSize: 10,
                    pageSize: 1,
                    result: "", // æ£€æµ‹çŠ¶æ€
                    name: "", // äº§å“åç§°
                    techfather: "" // å·¥åº
                },
                optionsSamplename: [],
                inspectionTable: [],
                tableColumn: [],
                optionSoptionSprocesses: [],
                optionTechnology: [],
                inspectionTableTotal: "",
                treeProject: [],
                // æ·»åŠ åˆ—
                empiricalValueAdd: 1,
                // ç¼–辑时存储最长的列数字,做删除判断
                empiricalValueAddMaxNumber: 0,
                showAddPage: false,
                processInspectVo: {
                    material: null,
                    materialCode: null,
                    orderNumber: "",
                    quantity: null,
                    specificationsModel: null,
                    techfather: null,
                    techname: null,
                    technologyId: null,
                    unit: null
                },
                InspectioniD: null,
                addInspectionform: [{
                    number: "",
                    username: "",
                    projectname: "",
                    tracenumber: "",
                    code: "",
                    class: "",
                    specificationmodel: "",
                    unit: "",
                    quantity: "",
                    group: "",
                    worker: "",
                    machine: ""
                }],
                inspectionItems: [], // æ–°å¢žæ£€éªŒé¡¹ç›®è¡¨æ ¼
                inspectionResultForm: [{
                    id: "",
                    name: "",
                    inspecter: "",
                    conclusion: "",
                    operation: ""
                }],
                options: [],
                value: "",
                rowList: [],
                spanArr: [],
                position: 0,
                // è®¾å¤‡é€‰æ‹©æ ‘显示
                centerDialogVisible: false,
                filterText: "",
                materialOptions: [],
                defaultProps: {
                    // è®¾å¤‡æ ‘数据设置
                    children: "children",
                    label: "name"
                },
                nodeData: {
                    id: 0,
                    name: null
                }, // node点击保存当前点击数据
                clickSelectDevice: {
                    index: null, // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                    rpId: null // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
                }
            };
        },
        watch: {
            // filterText(val) {
            //     this.$refs.tree.filter(val);
            // }
        },
        created() {
            if (this.rowInfo.result != null && this.rowInfo.result != '') {
                this.isUpBtn = true
            }
            this.processInspectVo.orderNumber = this.rowInfo.order_number
            this.processInspectVo.material = this.rowInfo.material
            this.processInspectVo.materialCode = this.rowInfo.material_code
            this.processInspectVo.specificationsModel = this.rowInfo.specifications_model
            this.processInspectVo.techfather = this.rowInfo.techfather
            this.processInspectVo.techname = this.rowInfo.techname
            this.processInspectVo.unit = this.rowInfo.unit
            this.processInspectVo.quantity = this.rowInfo.quantity
            this.detailId = this.rowInfo.id
            this.inspectionResultForm[0].id = this.rowInfo.material_code
            this.inspectionResultForm[0].name = this.rowInfo.material
            this.inspectionResultForm[0].conclusion = this.rowInfo.result
            // console.log(this.detailId);
        },
        mounted() {
            this.getTableData()
        },
        methods: {
            blurNode(scope) {
                // console.log(11);
                // this.$set(this.inspectionItems[scope.$index],'isSelectDevice',false)
            },
            escalation() {
                let arr = this.inspectionItems
                let bl = false
                for (let index = 0; index < arr.length; index++) {
                    const element = arr[index];
                    if (element.dname != null && element.empiricalValueAddss[0] != '') {
                        bl = true
                        break
                    } else {
                        bl = false
                    }
                }
                if (bl != true) {
                    this.$message({
                        message: '请先检测一项项目!',
                        type: 'warning'
                    });
                    return
                }
                this.$axios.post(this.$api.url.processInspectUpdateProcessInspectsById, {
                    id: this.detailId
                }).then(res => {
                    if (res.code == 200) {
                        if (res.message === '项目未检验完!') {
                            this.$message({
                                message: res.message,
                                type: 'warning'
                            });
                            return
                        }
                        this.$message({
                            message: '上报成功',
                            type: 'success'
                        });
                        this.$parent.combackMain(true)
                    } else {
                        this.$message({
                            message: res.message,
                            type: 'warning'
                        });
                    }
            })
        },
        handleClick() { },
        updateInsInfo(row) {
            console.log(row);
            this.row = row
            this.showUp = true
        },
        // ç‚¹å‡»è®¾å¤‡æ ‘保存点击记录
        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.filterText = 0
            this.$axios.get(this.$api.url.inspectionItemChooseDev, {
                params: {
                    father: row.father,
                    name: row.name,
                    technologyId: this.processInspectVo.technologyId
                }
            }).then(res => {
                this.materialOptions = res.data;
                if (this.materialOptions.length === 1&&row.did!=null) {
                    this.$message({
                        message: '该项目下只有一个试验设备,无需选择!',
                        type: 'warning'
                    });
                    return
                }
                row.isSelectDevice = true
                this.filterText = row.did
            });
        },
        //返回
        combackFather() {
            this.$parent.combackMain()
        },
        // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
        clickTableSelect(scope) {
            // return scope;
            // this.centerDialogVisible = true;
            if (this.clickSelectDevice.index != null) {
                this.$set(this.inspectionItems[this.clickSelectDevice.index], 'isSelectDevice', false)
            }
            this.clickSelectDevice.index = scope.$index;
            this.clickSelectDevice.rpId = scope.row.id;
            this.getOptions(scope.row);
        },
        // ç‚¹å‡»æ ‘里面的确定
        clickNodeSure(row) {
            console.log(row);
            let select = this.materialOptions.filter(item => {
                return item.id === this.filterText
            })[0]
            this.nodeData.id = select.id
            this.nodeData.name = select.device
            this.$axios
                .post(this.$api.url.inspectionItemUpdateDevByInsId, {
                    id: this.clickSelectDevice.rpId,
                    type: 1,
                    devId: this.nodeData.id
                })
                .then(res => {
                    row.isSelectDevice = false
                    console.log("row", row);
                    this.filterText = 0
                    this.getTableData()
                    this.centerDialogVisible = false;
                });
        },
        changeState(row, index) {
            if (row.did != null && row.did != '') {
                // let val = row.empiricalValueAddss.filter(item => {
                //     return item != '' && item != null
                // })
                // let eq = val.filter(item => {
                //     return /^[^><=]/.test(item)
                // })
                // if (eq.length > 0) {
                //     this.$message({
                //         message: "检测值[" + eq + "]格式首位应包含>,<或者=",
                //         type: 'warning'
                //     });
                //     return
                // }
                let str = ""
                row.empiricalValueAddss.forEach(e => {
                    str += e + ","
                })
                if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) {
                    return
                }
                this.$axios.post(this.$api.url.inspectionItemlose_focus_update, {
                    deviceId: row.did,
                    inspectionItemId: row.id,
                    inspectionValue: str.slice(0, -1)
                }, {
                    headers: { "Content-Type": "application/json" }
                }).then(res => {
                    row.result = res.data.result
                    row.username = res.data.username
                })
            } else {
                this.$message({
                    message: '请选择择设备!',
                    type: 'warning'
                });
            }
        },
        // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
        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
                }
            }
            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.techname = this.processInspectVo.techname.split("-")[1]
            val.technologyId = this.processInspectVo.techname.split("-")[0]
            this.$axios.post(this.$api.url.processInspectAddProcess, {
                material: val.material,
                materialCode: val.materialCode,
                orderNumber: val.orderNumber,
                quantity: val.quantity,
                specificationsModel: val.specificationsModel,
                techfather: val.techfather,
                techname: val.techname,
                technologyId: val.technologyId,
                unit: val.unit
            }, {
                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 = res.data
                this.inspectionResultForm[0].name = val.material
                this.getTableData()
            })
        },
        getTableData() {
            this.$axios.get(this.$api.url.processInspectSelectProcessInspectsListById, {
                params: {
                    id: this.rowInfo.id
                }
            }).then(res => {
                // console.log(res.data);
                this.processInspectVo.technologyId = res.data[0].techId
                // console.log(this.processInspectVo);
            })
            this.$axios.get(this.$api.url.inspectionItemListUser, {
                params: {
                    id: this.detailId,
                    type: 1
                }
            }).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
                        this.filterText = 0
                        arr.push(c)
                    })
                })
                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)
            })
        },
        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.chooseMaterProcessInspect, {
                params: {
                    orderNumber: this.processInspectVo.orderNumber
                }
            }).then(res => {
                if (res.data.length > 0) {
                    console.log(res.data);
                    this.optionsSamplename = res.data
                } else {
                    this.$message({
                        message: '没有该订单号!',
                        type: 'warning'
                    });
                }
            })
        },
        // å½“前页改变时触发 è·³è½¬å…¶ä»–页
        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;
                });
        },
        // æ·»åŠ è¡Œ
        clickAddLine() {
            let obj = {
                material: "",
                materialCode: "",
                orderNumber: "",
                quantity: 0,
                specificationsModel: "",
                techfather: "",
                techname: "",
                technologyId: 0,
                unit: ""
            };
            this.inspectionItems.push(obj);
        },
        // åˆ é™¤è¡Œ
        clickDeleteline(scope) {
            this.inspectionItems.splice(scope.$index, 1);
        },
        // åˆ é™¤æ£€éªŒå€¼åˆ—
        clickDeleteInspectionColumn() {
            if (this.empiricalValueAdd - 1 === 0) {
            } else {
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    this.inspectionItems.forEach(i => {
                        i.testValueList.splice(this.empiricalValueAdd, 1);
                    });
                }
            }
        },
        // æ·»åŠ æ£€éªŒå€¼åˆ—
        clickAddInspectionColumn() {
            this.empiricalValueAdd = this.empiricalValueAdd + 1;
        }
    }
}
                })
            },
            handleClick() {},
            updateInsInfo(row) {
                this.row = row
                this.showUp = true
            },
            // ç‚¹å‡»è®¾å¤‡æ ‘保存点击记录
            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;
                    if (this.materialOptions.length === 1 && row.did != null) {
                        this.$message({
                            message: '该项目下只有一个试验设备,无需选择!',
                            type: 'warning'
                        });
                        return
                    }
                    row.isSelectDevice = true
                });
            },
            //返回
            combackFather() {
                this.$parent.combackMain()
            },
            // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
            clickTableSelect(scope) {
                this.centerDialogVisible = true;
                this.clickSelectDevice.index = scope.$index;
                this.clickSelectDevice.rpId = scope.row.id;
                this.getOptions(scope.row);
            },
            // ç‚¹å‡»æ ‘里面的确定
            clickNodeSure() {
                if (this.detailId == null) {
                    this.projectTable[this.clickSelectDevice.index].deviceId = this.nodeData.id;
                    this.projectTable[this.clickSelectDevice.index].deviceName = this.nodeData.name;
                    this.centerDialogVisible = false;
                } else {
                    this.$axios.post(this.$api.url.inspectionItemUpdateDevByInsId, {
                        id: this.clickSelectDevice.rpId,
                        devId: this.nodeData.id,
                        type: 1
                    }).then(res => {
                        this.centerDialogVisible = false;
                        this.inspectionItems.forEach(a=>{
                            if(a.id == this.clickSelectDevice.rpId){
                                a.dname = this.nodeData.name
                            }
                        })
                    });
                }
            },
            changeState(row, index) {
                if (row.did != null && row.did != '') {
                    let str = ""
                    row.empiricalValueAddss.forEach(e => {
                        str += e + ","
                    })
                    if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) {
                        return
                    }
                    this.$axios.post(this.$api.url.inspectionItemlose_focus_update, {
                        deviceId: row.did,
                        inspectionItemId: row.id,
                        inspectionValue: str.slice(0, -1)
                    }, {
                        headers: {
                            "Content-Type": "application/json"
                        }
                    }).then(res => {
                        row.result = res.data.result
                        row.username = res.data.username
                    })
                } else {
                    this.$message({
                        message: '请选择择设备!',
                        type: 'warning'
                    });
                }
            },
            // æ¯é¡µæ¡æ•°æ”¹å˜æ—¶è§¦å‘ é€‰æ‹©ä¸€é¡µæ˜¾ç¤ºå¤šå°‘行
            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
                    }
                }
                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.techname = this.processInspectVo.techname.split("-")[1]
                val.technologyId = this.processInspectVo.techname.split("-")[0]
                this.$axios.post(this.$api.url.processInspectAddProcess, {
                    material: val.material,
                    materialCode: val.materialCode,
                    orderNumber: val.orderNumber,
                    quantity: val.quantity,
                    specificationsModel: val.specificationsModel,
                    techfather: val.techfather,
                    techname: val.techname,
                    technologyId: val.technologyId,
                    unit: val.unit
                }, {
                    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 = res.data
                    this.inspectionResultForm[0].name = val.material
                    this.getTableData()
                })
            },
            getTableData() {
                this.$axios.get(this.$api.url.processInspectSelectProcessInspectsListById, {
                    params: {
                        id: this.rowInfo.id
                    }
                }).then(res => {
                    // console.log(res.data);
                    this.processInspectVo.technologyId = res.data[0].techId
                    // console.log(this.processInspectVo);
                })
                this.$axios.get(this.$api.url.inspectionItemListUser, {
                    params: {
                        id: this.detailId,
                        type: 1
                    }
                }).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)
                        })
                    })
                    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)
                })
            },
            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.chooseMaterProcessInspect, {
                    params: {
                        orderNumber: this.processInspectVo.orderNumber
                    }
                }).then(res => {
                    if (res.data.length > 0) {
                        console.log(res.data);
                        this.optionsSamplename = res.data
                    } else {
                        this.$message({
                            message: '没有该订单号!',
                            type: 'warning'
                        });
                    }
                })
            },
            // å½“前页改变时触发 è·³è½¬å…¶ä»–页
            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;
                    });
            },
            // æ·»åŠ è¡Œ
            clickAddLine() {
                let obj = {
                    material: "",
                    materialCode: "",
                    orderNumber: "",
                    quantity: 0,
                    specificationsModel: "",
                    techfather: "",
                    techname: "",
                    technologyId: 0,
                    unit: ""
                };
                this.inspectionItems.push(obj);
            },
            // åˆ é™¤è¡Œ
            clickDeleteline(scope) {
                this.inspectionItems.splice(scope.$index, 1);
            },
            // åˆ é™¤æ£€éªŒå€¼åˆ—
            clickDeleteInspectionColumn() {
                if (this.empiricalValueAdd - 1 === 0) {} else {
                    if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                        this.empiricalValueAdd = this.empiricalValueAdd - 1;
                        this.inspectionItems.forEach(i => {
                            i.testValueList.splice(this.empiricalValueAdd, 1);
                        });
                    }
                }
            },
            // æ·»åŠ æ£€éªŒå€¼åˆ—
            clickAddInspectionColumn() {
                this.empiricalValueAdd = this.empiricalValueAdd + 1;
            }
        }
    }
</script>
<style></style>
src/components/view/raw-ins.vue
@@ -1,273 +1,221 @@
<style scoped>
.raw_ins {
  height: 100%;
}
    .raw_ins {
        height: 100%;
    }
.raw_ins .title .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
    .raw_ins .title .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
.raw_ins .title {
  margin-bottom: 10px;
  padding: 0 20px;
}
    .raw_ins .title {
        margin-bottom: 10px;
        padding: 0 20px;
    }
.choose {
  padding: 21px 24px;
  display: flex;
  align-items: center;
  background-color: #fff;
  border-bottom: 3px solid rgb(245, 247, 251);
}
    .choose {
        padding: 21px 24px;
        display: flex;
        align-items: center;
        background-color: #fff;
        border-bottom: 3px solid rgb(245, 247, 251);
    }
.choose * {
  font-size: 14px;
}
    .choose * {
        font-size: 14px;
    }
.choose .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
    .choose .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
.thing {
  width: calc(100% - 44px);
  height: calc(100% - 42px - 82px - 66px);
  background-color: #fff;
  overflow: auto;
  padding: 33px 22px;
}
    .thing {
        width: calc(100% - 44px);
        height: calc(100% - 42px - 82px - 66px);
        background-color: #fff;
        overflow: auto;
        padding: 33px 22px;
    }
.table_do {
  color: #004ea0;
  cursor: pointer;
}
    .table_do {
        color: #004ea0;
        cursor: pointer;
    }
</style>
<style>
.raw_ins .thing * {
  font-size: 14px;
}
    .raw_ins .thing * {
        font-size: 14px;
    }
.raw_ins .has-gutter .el-table__cell {
  background-color: #f0f1f5 !important;
  color: #333;
}
    .raw_ins .has-gutter .el-table__cell {
        background-color: #f0f1f5 !important;
        color: #333;
    }
.raw_ins .has-gutter .el-table__cell .cell {
  font-size: 16px;
  font-weight: 500;
}
    .raw_ins .has-gutter .el-table__cell .cell {
        font-size: 16px;
        font-weight: 500;
    }
.raw_ins .cell {
  color: #333;
  padding-left: 17px !important;
}
    .raw_ins .cell {
        color: #333;
        padding-left: 17px !important;
    }
.raw_ins .el-table__body-wrapper {
  height: 100%;
}
    .raw_ins .el-table__body-wrapper {
        height: 100%;
    }
.raw_ins .el-table__body {
  height: 100%;
}
    .raw_ins .el-table__body {
        height: 100%;
    }
</style>
<template>
  <div class="raw_ins">
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px;">原材料检验</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button
            type="primary"
            icon="el-icon-plus"
            style="background: #004EA2;"
            @click="goDetail(null)"
            >新增</el-button
          >
          <el-button icon="el-icon-download">导出</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="choose">
      <span>来料日期:</span>
      <el-date-picker
        v-model="search.formTime"
        size="small"
        placeholder="请输入"
        style="width: 13vw;margin-right: 5px;"
        clearable
        value-format="yyyy-MM-dd"
      ></el-date-picker>
      <span>原材料编码:</span>
      <el-input
        v-model="search.code"
        placeholder="请输入"
        size="small"
        style="width: 13vw;margin-right: 5px;"
        clearable
      ></el-input>
      <span>检测状态:</span>
      <el-select
        v-model="search.insState"
        size="small"
        placeholder="请选择"
        style="width: 13vw;margin-right: 5px;"
      >
        <el-option label="全部" :value="2"></el-option>
        <el-option label="未检测" :value="0"></el-option>
        <el-option label="已检测" :value="1"></el-option>
      </el-select>
      <span>原材料名称:</span>
      <el-input
        v-model="search.name"
        size="small"
        placeholder="请输入"
        style="width: 13vw;margin-right: 5px;"
        clearable
      ></el-input>
      <el-button size="mini" @click="clean()"><span>重 ç½®</span></el-button>
      <el-button
        size="mini"
        type="primary"
        style="background: #004EA2;"
        @click="selectRawInspectsList()"
        ><span>查 è¯¢</span></el-button
      >
    </div>
    <div class="thing">
      <el-table
        :data="tableData"
        border
        style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
        max-height="calc(100% - 50px)"
        @selection-change="handleSelectionChange"
        default-expand-all
        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
        row-key="id"
      >
        <el-table-column type="selection" width="50"> </el-table-column>
        <el-table-column type="index" label="序号" width="70">
        </el-table-column>
        <el-table-column prop="formTime" label="来料日期"> </el-table-column>
        <el-table-column prop="code" label="原材料编码"> </el-table-column>
        <el-table-column prop="name" label="原材料名称"> </el-table-column>
        <el-table-column prop="specifications" label="规格型号">
        </el-table-column>
        <el-table-column prop="unit" label="单位"> </el-table-column>
        <el-table-column prop="number" label="数量"> </el-table-column>
        <el-table-column prop="createTime" label="报检日期"> </el-table-column>
        <el-table-column prop="user_name" label="报检人"> </el-table-column>
        <el-table-column prop="createTime" label="检验日期"> </el-table-column>
        <el-table-column prop="createTime" label="检测状态" width="100">
          <template slot-scope="scope">
            <span style="color: #34BD66;" v-if="scope.row.ins_state == 1"
              >已检测</span
            >
            <span style="color: #E84738;" v-else-if="scope.row.ins_state == 0"
              >未检测</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="judge_state" label="合格状态" width="100">
          <template slot-scope="scope">
            <span style="color: #34BD66;" v-if="scope.row.judge_state == 1"
              >合格</span
            >
            <span style="color: #E84738;" v-else-if="scope.row.judge_state == 0"
              >不合格</span
            >
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <span class="table_do" @click="changeShowDetail(scope.row)"
              >查看</span
            >
            <span class="table_do">打印</span>
          </template>
        </el-table-column>
      </el-table>
      <el-col
        style="height: 50px;display: flex;align-items: center;justify-content: right;"
      >
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="1"
          :page-sizes="[10, 15, 20, 30, 50]"
          :page-size="search.co"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </el-col>
    </div>
  </div>
    <div class="raw_ins">
        <div class="title">
            <el-row>
                <el-col :span="12" style="line-height: 32px;">原材料检验</el-col>
                <el-col :span="12" style="text-align: right;">
                    <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
                        @click="goDetail(null)">新增</el-button>
                    <el-button icon="el-icon-download">导出</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="choose">
            <span>来料日期:</span>
            <el-date-picker v-model="search.formTime" size="small" placeholder="请输入" style="width: 13vw;margin-right: 5px;"
                clearable value-format="yyyy-MM-dd"></el-date-picker>
            <span>原材料编码:</span>
            <el-input v-model="search.code" placeholder="请输入" size="small" style="width: 13vw;margin-right: 5px;"
                clearable></el-input>
            <span>检测状态:</span>
            <el-select v-model="search.insState" size="small" placeholder="请选择" style="width: 13vw;margin-right: 5px;">
                <el-option label="全部" :value="2"></el-option>
                <el-option label="未检测" :value="0"></el-option>
                <el-option label="已检测" :value="1"></el-option>
            </el-select>
            <span>原材料名称:</span>
            <el-input v-model="search.name" size="small" placeholder="请输入" style="width: 13vw;margin-right: 5px;"
                clearable></el-input>
            <el-button size="mini" @click="clean()"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectRawInspectsList()"><span>查
                    è¯¢</span></el-button>
        </div>
        <div class="thing">
            <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
                max-height="calc(100% - 50px)" @selection-change="handleSelectionChange" default-expand-all
                :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" row-key="id">
                <el-table-column type="selection" width="50"> </el-table-column>
                <el-table-column type="index" label="序号" width="70">
                </el-table-column>
                <el-table-column prop="formTime" label="来料日期"> </el-table-column>
                <el-table-column prop="code" label="原材料编码"> </el-table-column>
                <el-table-column prop="name" label="原材料名称"> </el-table-column>
                <el-table-column prop="specifications" label="规格型号">
                </el-table-column>
                <el-table-column prop="unit" label="单位"> </el-table-column>
                <el-table-column prop="number" label="数量"> </el-table-column>
                <el-table-column prop="createTime" label="报检日期"> </el-table-column>
                <el-table-column prop="user_name" label="报检人"> </el-table-column>
                <el-table-column prop="createTime" label="检验日期"> </el-table-column>
                <el-table-column prop="createTime" label="检测状态" width="100">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.ins_state == 1">已检测</span>
                        <span style="color: #E84738;" v-else-if="scope.row.ins_state == 0">未检测</span>
                    </template>
                </el-table-column>
                <el-table-column prop="judge_state" label="合格状态" width="100">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.judge_state == 1">合格</span>
                        <span style="color: #E84738;" v-else-if="scope.row.judge_state == 0">不合格</span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" width="100">
                    <template slot-scope="scope">
                        <span class="table_do" @click="changeShowDetail(scope.row)">查看</span>
                        <span class="table_do">打印</span>
                    </template>
                </el-table-column>
            </el-table>
            <el-col style="height: 50px;display: flex;align-items: center;justify-content: right;">
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1"
                    :page-sizes="[10, 15, 20, 30, 50]" :page-size="search.co" layout="total, sizes, prev, pager, next, jumper"
                    :total="total">
                </el-pagination>
            </el-col>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        formTime: "", // æ¥æ–™æ—¶é—´
        code: "", // åŽŸææ–™ç¼–ç 
        insState: "", // æ£€æµ‹çŠ¶æ€
        name: "", //
        countSize: 10, // æ¡æ•°/页
        pageSize: 1 // é¡µæ•°
      },
      total: 0,
      tableData: [],
      selects: []
    };
  },
  props: ["goDetail"],
  mounted() {
    this.selectRawInspectsList();
  },
  methods: {
    handleSelectionChange(val) {
      this.selects = val;
    },
    handleSizeChange(val) {
      this.search.countSize = val;
      this.selectRawInspectsList();
    },
    handleCurrentChange(val) {
      this.search.pageSize = val;
      this.selectRawInspectsList();
    },
    selectRawInspectsList() {
      this.$axios
        .get(this.$api.url.selectRawInspectsList, { params: this.search })
        .then(res => {
          this.tableData = res.data.row;
          this.total = res.data.total;
        });
    },
    clean() {
      this.search = {
        formTime: "", // æ¥æ–™æ—¶é—´
        code: "", // åŽŸææ–™ç¼–ç 
        insState: "", // æ£€æµ‹çŠ¶æ€
        name: "", //
        countSize: 10, // æ¡æ•°/页
        pageSize: 1 // é¡µæ•°
      };
      this.selectRawInspectsList();
    },
    changeShowDetail({ id }) {
      this.goDetail(id);
      // console.log(id)
      // const res = await this.$axios.post(this.$api.url.selectRawInspectsListById,{params:{id}})
      // console.log(res)
    }
  }
};
</script>
    export default {
        data() {
            return {
                search: {
                    formTime: "", // æ¥æ–™æ—¶é—´
                    code: "", // åŽŸææ–™ç¼–ç 
                    insState: "", // æ£€æµ‹çŠ¶æ€
                    name: "", //
                    countSize: 10, // æ¡æ•°/页
                    pageSize: 1 // é¡µæ•°
                },
                total: 0,
                tableData: [],
                selects: []
            };
        },
        props: ["goDetail"],
        mounted() {
            this.selectRawInspectsList();
        },
        methods: {
            handleSelectionChange(val) {
                this.selects = val;
            },
            handleSizeChange(val) {
                this.search.countSize = val;
                this.selectRawInspectsList();
            },
            handleCurrentChange(val) {
                this.search.pageSize = val;
                this.selectRawInspectsList();
            },
            selectRawInspectsList() {
                this.$axios
                    .get(this.$api.url.selectRawInspectsList, {
                        params: this.search
                    })
                    .then(res => {
                        this.tableData = res.data.row;
                        this.total = res.data.total;
                    });
            },
            clean() {
                this.search = {
                    formTime: "", // æ¥æ–™æ—¶é—´
                    code: "", // åŽŸææ–™ç¼–ç 
                    insState: "", // æ£€æµ‹çŠ¶æ€
                    name: "", //
                    countSize: 10, // æ¡æ•°/页
                    pageSize: 1 // é¡µæ•°
                };
                this.selectRawInspectsList();
            },
            changeShowDetail({
                id
            }) {
                this.goDetail(id);
                // console.log(id)
                // const res = await this.$axios.post(this.$api.url.selectRawInspectsListById,{params:{id}})
                // console.log(res)
            }
        }
    };
</script>
src/components/view/rawInsBox.vue
@@ -1,38 +1,37 @@
<style scoped>
</style>
<template>
  <div class="rawInsBox">
    <RawIns v-if="!showDetail" :goDetail="goDetail"></RawIns>
    <RawInsDetail v-if="showDetail" :goBack="goBack" :detailId="id"></RawInsDetail>
  </div>
    <div class="rawInsBox">
        <RawIns v-if="!showDetail" :goDetail="goDetail"></RawIns>
        <RawInsDetail v-if="showDetail" :goBack="goBack" :detailId="id"></RawInsDetail>
    </div>
</template>
<script>
import RawIns from './raw-ins.vue'
import RawInsDetail from './rawInsDetail.vue'
export default {
    components:{RawIns,RawInsDetail},
    data() {
        return {
            showDetail: false,
            id:0
        }
    },
    mounted(){
    },
    methods:{
        goDetail(id) {
            this.showDetail = true
            this.id = id
            console.log(this.id)
        },
        goBack() {
            this.$parent.removeAllTab()
            this.showDetail = false
        }
    }
}
</script>
    import RawIns from './raw-ins.vue'
    import RawInsDetail from './rawInsDetail.vue'
    export default {
        components: {
            RawIns,
            RawInsDetail
        },
        data() {
            return {
                showDetail: false,
                id: 0
            }
        },
        mounted() {},
        methods: {
            goDetail(id) {
                this.showDetail = true
                this.id = id
            },
            goBack() {
                this.showDetail = false
            }
        }
    }
</script>
src/components/view/rawInsDetail.vue
@@ -1,697 +1,557 @@
<template>
  <div class="rawInsBox">
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px;">原材料检验</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button
            icon="el-icon-circle-plus-outline"
            v-show="detailId === null"
            @click="addNewRawInspect"
            style="background-color: #004ea2; color: #ffffff;"
            >提 äº¤</el-button
          >
          <el-button
            icon="el-icon-back"
            @click="
    <div class="rawInsBox">
        <div class="title">
            <el-row>
                <el-col :span="12" style="line-height: 32px;">原材料检验</el-col>
                <el-col :span="12" style="text-align: right;">
                    <el-button icon="el-icon-circle-plus-outline" v-show="detailId === null" @click="addNewRawInspect"
                        style="background-color: #004ea2; color: #ffffff;">提 äº¤</el-button>
                    <el-button icon="el-icon-back" @click="
              () => {
                goBack();
              }
            "
            >返 å›ž</el-button
          >
        </el-col>
      </el-row>
    </div>
    <div
      class="raw-detail-info"
      :class="detailId === null ? 'raw-detail-info-edit' : ''"
    >
      <el-form v-model="detailInfo" label-position="right" label-width="120px">
        <el-row>
          <el-col :span="7">
            <el-form-item label="来料日期:">
              <el-input
                v-if="detailId !== null"
                :disabled="detailId !== null"
                v-model="detailInfo.formTime"
              ></el-input>
              <el-date-picker
                v-else
                type="date"
                value-format="yyyy-MM-dd"
                v-model="detailInfo.formTime"
                placeholder="选择日期"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="原材料名称:">
              <el-input
                v-if="detailId !== null"
                :disabled="detailId !== null"
                v-model="detailInfo.name"
              ></el-input>
              <el-input
                v-else
                v-model="detailInfo.name"
                placeholder="请输入原材料名称"
              ></el-input> </el-form-item
          ></el-col>
          <el-col :span="7">
            <el-form-item label="原材料编码:">
              <el-input
                v-if="detailId !== null"
                :disabled="detailId !== null"
                v-model="detailInfo.code"
              ></el-input>
              <el-input
                v-else
                v-model="detailInfo.code"
                placeholder="请输入原材料编码"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="7">
            <el-form-item label="规格型号:">
              <el-input
                v-if="detailId !== null"
                :disabled="detailId !== null"
                v-model="detailInfo.specifications"
              ></el-input>
              <el-input
                v-else
                v-model="detailInfo.specifications"
                placeholder="请输入规格型号"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="单位:">
              <el-input
                v-if="detailId !== null"
                :disabled="detailId !== null"
                v-model="detailInfo.runit"
              ></el-input>
              <el-input
                v-else
                placeholder="请输入检验单位"
                :disabled="detailId !== null"
                v-model="detailInfo.unit"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="数量:">
              <el-input
                :placeholder="detailId !== null ? '' : '请输入检验数量'"
                :disabled="detailId !== null"
                v-model="detailInfo.number"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="7">
            <el-form-item label="供应商名称:">
              <el-input
                :placeholder="detailId !== null ? '' : '请输入供应商名称'"
                :disabled="detailId !== null"
                v-model="detailInfo.supplier"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item v-show="detailId !== null" label="报检日期:">
              <el-input
                :disabled="detailId !== null"
                v-model="detailInfo.creatTime"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item v-show="detailId !== null" label="报检人:">
              <el-input
                :disabled="detailId !== null"
                v-model="detailInfo.userName"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px;">检验项目</el-col>
        <el-col :span="12" style="line-height: 32px; padding-top: 6px;">
          <el-button
            style="float: right;"
            @click="clickDeleteInspectionColumn()"
            >删除检验值列</el-button
          >
          <el-button
            style="float: right;margin-right: 30px;"
            @click="clickAddInspectionColumn()"
            >添加检验值列</el-button
          >
          <el-button
            v-if="detailId == null"
            style="float: right;margin-right: 30px;"
            @click="clickAddLine()"
            >添加检验行</el-button
          >
        </el-col>
      </el-row>
    </div>
    <div class="raw-project-table">
      <el-table :data="projectTable" style="width: 100%" height="320">
        <el-table-column type="index" label="序号" width="60">
        </el-table-column>
        <el-table-column prop="rpName" label="项目" width="212">
          <template slot-scope="scope">
            <el-input
              v-if="detailId == null"
              v-model="scope.row.name"
              placeholder="请输入项目名称"
            ></el-input>
            <el-input v-else v-model="scope.row.rpName" disabled></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="unit" label="单位" width="148">
          <template slot-scope="scope">
            <el-input
              v-if="detailId == null"
              v-model="scope.row.unit"
              placeholder="请输入单位"
            ></el-input>
            <el-input v-else v-model="scope.row.rpUnit" disabled></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="required" label="标准值" min-width="150">
          <template slot-scope="scope">
            <el-input
              :disabled="detailId != null"
              @blur="assertTest(scope.row)"
              v-model="scope.row.required"
              placeholder="请输入标准值"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="internal" label="内控值" min-width="150">
          <template slot-scope="scope">
            <el-input
              @blur="assertTest(scope.row)"
              :disabled="detailId != null"
              v-model="scope.row.internal"
              placeholder="请输入内控值"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column
          prop="testValue"
          label="检测值"
          min-width="150"
          v-for="(item, index) in empiricalValueAdd"
          :key="index"
        >
          <template slot-scope="scope">
            <el-tooltip
              :disabled="scope.row.deviceId != null"
              class="item"
              effect="dark"
              content="请先选择设备!"
              placement="top-start"
            >
              <el-input
                :disabled="scope.row.deviceId == null"
                v-model="scope.row.testValueList[index]"
                @blur="changeState(scope.row, index)"
                placeholder="请输入检测值"
              ></el-input>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column prop="deviceName" label="试验设备" min-width="100">
          <template slot-scope="scope">
            <el-button type="text" @click="clickTableSelect(scope)">{{
            ">返 å›ž</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="raw-detail-info" :class="detailId === null ? 'raw-detail-info-edit' : ''">
            <el-form v-model="detailInfo" label-position="right" label-width="120px">
                <el-row>
                    <el-col :span="7">
                        <el-form-item label="来料日期:">
                            <el-input v-if="detailId !== null" :disabled="detailId !== null" v-model="detailInfo.formTime"></el-input>
                            <el-date-picker v-else type="date" value-format="yyyy-MM-dd" v-model="detailInfo.formTime"
                                placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item label="原材料名称:">
                            <el-input v-if="detailId !== null" :disabled="detailId !== null" v-model="detailInfo.name"></el-input>
                            <el-input v-else v-model="detailInfo.name" placeholder="请输入原材料名称"></el-input> </el-form-item></el-col>
                    <el-col :span="7">
                        <el-form-item label="原材料编码:">
                            <el-input v-if="detailId !== null" :disabled="detailId !== null" v-model="detailInfo.code"></el-input>
                            <el-input v-else v-model="detailInfo.code" placeholder="请输入原材料编码"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="7">
                        <el-form-item label="规格型号:">
                            <el-input v-if="detailId !== null" :disabled="detailId !== null"
                                v-model="detailInfo.specifications"></el-input>
                            <el-input v-else v-model="detailInfo.specifications" placeholder="请输入规格型号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item label="单位:">
                            <el-input v-if="detailId !== null" :disabled="detailId !== null" v-model="detailInfo.runit"></el-input>
                            <el-input v-else placeholder="请输入检验单位" :disabled="detailId !== null" v-model="detailInfo.unit"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item label="数量:">
                            <el-input :placeholder="detailId !== null ? '' : '请输入检验数量'" :disabled="detailId !== null"
                                v-model="detailInfo.number"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="7">
                        <el-form-item label="供应商名称:">
                            <el-input :placeholder="detailId !== null ? '' : '请输入供应商名称'" :disabled="detailId !== null"
                                v-model="detailInfo.supplier"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item v-show="detailId !== null" label="报检日期:">
                            <el-input :disabled="detailId !== null" v-model="detailInfo.creatTime"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="7">
                        <el-form-item v-show="detailId !== null" label="报检人:">
                            <el-input :disabled="detailId !== null" v-model="detailInfo.userName"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
        <div class="title">
            <el-row>
                <el-col :span="12" style="line-height: 32px;">检验项目</el-col>
                <el-col :span="12" style="line-height: 32px; padding-top: 6px;">
                    <el-button style="float: right;" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <el-button style="float: right;margin-right: 30px;" @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <el-button v-if="detailId == null" style="float: right;margin-right: 30px;"
                        @click="clickAddLine()">添加检验行</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="raw-project-table">
            <el-table :data="projectTable" style="width: 100%" height="320">
                <el-table-column type="index" label="序号" width="60">
                </el-table-column>
                <el-table-column prop="rpName" label="项目" width="212">
                    <template slot-scope="scope">
                        <el-input v-if="detailId == null" v-model="scope.row.name" placeholder="请输入项目名称"></el-input>
                        <el-input v-else v-model="scope.row.rpName" disabled></el-input>
                    </template>
                </el-table-column>
                <el-table-column prop="unit" label="单位" width="148">
                    <template slot-scope="scope">
                        <el-input v-if="detailId == null" v-model="scope.row.unit" placeholder="请输入单位"></el-input>
                        <el-input v-else v-model="scope.row.rpUnit" disabled></el-input>
                    </template>
                </el-table-column>
                <el-table-column prop="required" label="标准值" min-width="150">
                    <template slot-scope="scope">
                        <el-input :disabled="detailId != null" @blur="assertTest(scope.row)" v-model="scope.row.required"
                            placeholder="请输入标准值"></el-input>
                    </template>
                </el-table-column>
                <el-table-column prop="internal" label="内控值" min-width="150">
                    <template slot-scope="scope">
                        <el-input @blur="assertTest(scope.row)" :disabled="detailId != null" v-model="scope.row.internal"
                            placeholder="请输入内控值"></el-input>
                    </template>
                </el-table-column>
                <el-table-column prop="testValue" label="检测值" min-width="150" v-for="(item, index) in empiricalValueAdd"
                    :key="index">
                    <template slot-scope="scope">
                        <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="请先选择设备!"
                            placement="top-start">
                            <el-input :disabled="scope.row.deviceId == null" v-model="scope.row.testValueList[index]"
                                @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input>
                        </el-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="deviceName" label="试验设备" min-width="100">
                    <template slot-scope="scope">
                        <el-button type="text" @click="clickTableSelect(scope)">{{
              scope.row.deviceId == null ? "请选择" : scope.row.deviceName
            }}</el-button>
          </template>
        </el-table-column>
        <el-table-column
          v-if="detailId !== null"
          prop="testState"
          label="结论"
          min-width="100"
        >
          <template slot-scope="scope">
            <span
              v-show="scope.row.testState != null"
              :style="{
                    </template>
                </el-table-column>
                <el-table-column v-if="detailId !== null" prop="testState" label="结论" min-width="100">
                    <template slot-scope="scope">
                        <span v-show="scope.row.testState != null" :style="{
                color: scope.row.testState === 1 ? '#67C23A' : '#F56C6C'
              }"
              >{{ scope.row.testState === 1 ? "合格" : "不合格" }}</span
            >
            <span v-show="scope.row.testState == null">暂未结论</span>
          </template>
        </el-table-column>
        <el-table-column v-if="detailId == null" label="操作" width="100">
          <template slot-scope="scope">
            <el-button type="text" @click="clickDeleteline(scope)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px;">检验结论</el-col>
      </el-row>
    </div>
    <div class="raw-conclusion-table">
      <el-table :data="conclusionTable" style="100%">
        <el-table-column prop="code" label="物料编号"> </el-table-column>
        <el-table-column prop="name" label="物料名称"> </el-table-column>
        <el-table-column v-if="detailId != null" prop="uName" label="检验员">
          <template slot-scope="scope">
            <span
              v-for="item in scope.row.uName"
              :key="item && item.uName"
              :style="{ marginRight: '8px' }"
              >{{ item }}</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="testState" label="检验结论">
          <template slot-scope="scope">
            <span
              v-show="scope.row.testState != null"
              :style="{
              }">{{ scope.row.testState === 1 ? "合格" : "不合格" }}</span>
                        <span v-show="scope.row.testState == null">暂未结论</span>
                    </template>
                </el-table-column>
                <el-table-column v-if="detailId == null" label="操作" width="100">
                    <template slot-scope="scope">
                        <el-button type="text" @click="clickDeleteline(scope)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div class="title">
            <el-row>
                <el-col :span="12" style="line-height: 32px;">检验结论</el-col>
            </el-row>
        </div>
        <div class="raw-conclusion-table">
            <el-table :data="conclusionTable" style="100%">
                <el-table-column prop="code" label="物料编号"> </el-table-column>
                <el-table-column prop="name" label="物料名称"> </el-table-column>
                <el-table-column v-if="detailId != null" prop="uName" label="检验员">
                    <template slot-scope="scope">
                        <span v-for="item in scope.row.uName" :key="item && item.uName"
                            :style="{ marginRight: '8px' }">{{ item }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="testState" label="检验结论">
                    <template slot-scope="scope">
                        <span v-show="scope.row.testState != null" :style="{
                color: scope.row.testState === 1 ? '#67C23A' : '#F56C6C'
              }"
              >{{ scope.row.testState === 1 ? "合格" : "不合格" }}</span
            >
            <span v-show="scope.row.testState == null">暂未结论</span>
          </template>
        </el-table-column>
        <el-table-column v-if="detailId !== null" label="操作" width="120">
          <template>
            <el-button type="text" size="small" @click.once="submitSave"
              >上报</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-dialog
      title="请选择设备"
      :visible.sync="centerDialogVisible"
      width="20%"
    >
      <div class="div_device_dialog">
        <el-input
          placeholder="输入关键字进行过滤"
          v-model="filterText"
          style="margin-bottom: 6px;"
        >
        </el-input>
        <el-tree
          class="filter-tree"
          :data="materialOptions"
          :props="defaultProps"
          default-expand-all
          highlight-current
          @node-click="nodeClick"
          :filter-node-method="filterNode"
          ref="tree"
        >
          <div class="custom-tree-node" slot-scope="{ data }">
            <span
              ><i
                :class="
              }">{{ scope.row.testState === 1 ? "合格" : "不合格" }}</span>
                        <span v-show="scope.row.testState != null">{{null}}</span>
                    </template>
                </el-table-column>
                <el-table-column v-if="detailId !== null" label="操作" width="120">
                    <template>
                        <el-button type="text" size="small" @click.once="submitSave">上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
            <div class="div_device_dialog">
                <el-input placeholder="输入关键字进行过滤" v-model="filterText" style="margin-bottom: 6px;">
                </el-input>
                <el-tree class="filter-tree" :data="materialOptions" :props="defaultProps" default-expand-all highlight-current
                    @node-click="nodeClick" :filter-node-method="filterNode" ref="tree">
                    <div class="custom-tree-node" slot-scope="{ data }">
                        <span><i :class="
                  `node_i ${
                    data.children ? 'el-icon-folder-opened' : 'el-icon-tickets'
                  }`
                "
              ></i>
              {{ data.name }}</span
            >
          </div>
        </el-tree>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="clickNodeSure()">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
                "></i>
                            {{ data.name }}</span>
                    </div>
                </el-tree>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="centerDialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="clickNodeSure()">ç¡® å®š</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
import { triggerRef } from "vue";
import RawIns from "./raw-ins.vue";
export default {
  components: { RawIns },
  props: ["goBack", "detailId"],
  created() {
    // æ¸…空
    this.detailInfo = {};
    if (this.detailId) {
      this.getDetailInfo();
    }
    this.getOptions();
  },
  mounted() {
    import {
        triggerRef
    } from "vue";
    import RawIns from "./raw-ins.vue";
    export default {
        components: {
            RawIns
        },
        props: ["goBack", "detailId"],
        created() {
            // æ¸…空
            this.detailInfo = {};
            if (this.detailId) {
                this.getDetailInfo();
            }
            this.getOptions();
        },
        mounted() {
  },
  computed: {
    conclusionTable() {
      const conclusion = {};
      conclusion.name = this.detailInfo.name;
      conclusion.code = this.detailInfo.code;
      conclusion.uName = [
        ...new Set(this.projectTable.map(item => item.uName))
      ];
      if (
        this.projectTable.filter(item => item.testState === undefined).length ===
        this.projectTable.length
      ) {
        conclusion.testState = null;
        return [conclusion];
      }
      if (this.projectTable.filter(item => item.testState === 0).length > 0) {
        conclusion.testState = 0;
      } else {
        conclusion.testState = 1;
      }
      console.log([conclusion]);
      return [conclusion];
    }
  },
  data() {
    return {
      // æ·»åŠ åˆ—
      empiricalValueAdd: 1,
      // ç¼–辑时存储最长的列数字,做删除判断
      empiricalValueAddMaxNumber: 0,
      // è®¾å¤‡é€‰æ‹©æ ‘显示
      centerDialogVisible: false,
      // è¯¦æƒ…页就是详情信息
      detailInfo: {},
      // è¡¨æ ¼
      projectTable: [],
      // æ–°å»ºæ£€éªŒå•参数对象
      rawInsParams: {},
      // é¡¹ç›®åç§°options
      specificationOptions: [],
      filterText: "",
      materialOptions: [], // æ ‘数据
      defaultProps: {
        // è®¾å¤‡æ ‘数据设置
        children: "children",
        label: "name"
      },
      nodeData: "", // node点击保存当前点击数据
      clickSelectDevice: {
        index: "", // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
        rpId: "" // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
      }
    };
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    }
  },
  methods: {
    assertTest(row){
      // let fuArr=['>', '<', '=']
      // if(!fuArr.includes(row.required[0])){
      //   this.$message({
      //               message: "标准值["+row.required+"]格式首位应包含>,<或者=",
      //               type: 'warning'
      //           });
      //           return
      // }
      // if(!fuArr.includes(row.internal[0])){
      //   this.$message({
      //               message: "内控值["+row.internal+"]格式首位应包含>,<或者=",
      //               type: 'warning'
      //           });
      //           return
      // }
    },
    // è®¾å¤‡æ ‘过滤搜索
    filterNode(value, data) {
      if (!value) return true;
      return data.name.indexOf(value) !== -1;
    },
        },
        computed: {
            conclusionTable() {
                const conclusion = {};
                conclusion.name = this.detailInfo.name;
                conclusion.code = this.detailInfo.code;
                conclusion.uName = [
                    ...new Set(this.projectTable.map(item => item.uName))
                ];
                return [conclusion];
            }
        },
        data() {
            return {
                // æ·»åŠ åˆ—
                empiricalValueAdd: 1,
                // ç¼–辑时存储最长的列数字,做删除判断
                empiricalValueAddMaxNumber: 0,
                // è®¾å¤‡é€‰æ‹©æ ‘显示
                centerDialogVisible: false,
                // è¯¦æƒ…页就是详情信息
                detailInfo: {},
                // è¡¨æ ¼
                projectTable: [],
                // æ–°å»ºæ£€éªŒå•参数对象
                rawInsParams: {},
                // é¡¹ç›®åç§°options
                specificationOptions: [],
                filterText: "",
                materialOptions: [], // æ ‘数据
                defaultProps: {
                    // è®¾å¤‡æ ‘数据设置
                    children: "children",
                    label: "name"
                },
                nodeData: "", // node点击保存当前点击数据
                clickSelectDevice: {
                    index: "", // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                    rpId: "" // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
                }
            };
        },
        watch: {
            filterText(val) {
                this.$refs.tree.filter(val);
            }
        },
        methods: {
            assertTest(row) {
                // let fuArr=['>', '<', '=']
                // if(!fuArr.includes(row.required[0])){
                //   this.$message({
                //               message: "标准值["+row.required+"]格式首位应包含>,<或者=",
                //               type: 'warning'
                //           });
                //           return
                // }
                // if(!fuArr.includes(row.internal[0])){
                //   this.$message({
                //               message: "内控值["+row.internal+"]格式首位应包含>,<或者=",
                //               type: 'warning'
                //           });
                //           return
                // }
            },
            // è®¾å¤‡æ ‘过滤搜索
            filterNode(value, data) {
                if (!value) return true;
                return data.name.indexOf(value) !== -1;
            },
    // èŽ·å–æŠ¥æ£€å•è¯¦æƒ…ä¿¡æ¯
    async getDetailInfo() {
      await this.$axios
        .get(this.$api.url.selectRawInspectsListById + `${this.detailId}`, {
          params: { id: this.detailId }
        })
        .then(res => {
          console.log(res);
          this.detailInfo = res.data;
          this.projectTable = res.data.children;
          this.projectTable.forEach(i => {
            // è§£å†³é‡æ–°èµ‹å€¼æ— æ³•编辑操作
            if (i.testValue == null) {
              this.$set(i, "testValueList", []);
            } else {
              this.$set(i, "testValueList", i.testValue.split(","));
            }
            // å–最长的列表数
            if (i.testValueList.length > this.empiricalValueAdd) {
              this.empiricalValueAdd = i.testValueList.length;
              this.empiricalValueAddMaxNumber = i.testValueList.length - 1;
            }
          });
        });
    },
    // æ–°å¢žæ£€éªŒå•
    async addNewRawInspect() {
      //TODO:
      console.log(this.projectTable);
      if(this.projectTable.length>0){
        let filterTable= this.projectTable.filter(item=>{
        return item.required===''||item.internal===''||
        item.required===null||item.internal===null||item.name===''
        })
        if(filterTable.length>0) {
          this.$message({
                    message: "项目名称,标准值和内控值不能为空!",
                    type: 'warning'
                });
          return
        }
      }
      this.projectTable.forEach(i => {
        // å°†åˆ—表转换为字符串
        i.testValue = i.testValueList.join(",");
      });
      this.detailInfo.rawInsProducts = this.projectTable;
      this.$axios.post(
        this.$api.url.addRawInspects,
        { ...this.detailInfo },
        { headers: { "Content-Type": "application/json" } }
      ).then(res=>{
        console.log(res);
        if(res.code=="201"){
          this.$message({
                    message: res.message,
                    type: 'warning'
                });
         return
        }else{
          // this.detailId = res.data;
          // this.getDetailInfo();
          // // this.$message.success(res.message);
          // this.goBack();
        }
      });
    },
            // èŽ·å–æŠ¥æ£€å•è¯¦æƒ…ä¿¡æ¯
            async getDetailInfo() {
                await this.$axios
                    .get(this.$api.url.selectRawInspectsListById + `${this.detailId}`, {
                        params: {
                            id: this.detailId
                        }
                    })
                    .then(res => {
                        console.log(res);
                        this.detailInfo = res.data;
                        this.projectTable = res.data.children;
                        this.projectTable.forEach(i => {
                            // è§£å†³é‡æ–°èµ‹å€¼æ— æ³•编辑操作
                            if (i.testValue == null) {
                                this.$set(i, "testValueList", []);
                            } else {
                                this.$set(i, "testValueList", i.testValue.split(","));
                            }
                            // å–最长的列表数
                            if (i.testValueList.length > this.empiricalValueAdd) {
                                this.empiricalValueAdd = i.testValueList.length;
                                this.empiricalValueAddMaxNumber = i.testValueList.length - 1;
                            }
                        });
                    });
            },
            // æ–°å¢žæ£€éªŒå•
            async addNewRawInspect() {
                //TODO:
                console.log(this.projectTable);
                if (this.projectTable.length > 0) {
                    let filterTable = this.projectTable.filter(item => {
                        return item.required === '' || item.internal === '' ||
                            item.required === null || item.internal === null || item.name === ''
                    })
                    if (filterTable.length > 0) {
                        this.$message({
                            message: "项目名称,标准值和内控值不能为空!",
                            type: 'warning'
                        });
                        return
                    }
                }
                this.projectTable.forEach(i => {
                    // å°†åˆ—表转换为字符串
                    i.testValue = i.testValueList.join(",");
                });
                this.detailInfo.rawInsProducts = this.projectTable;
                this.$axios.post(
                    this.$api.url.addRawInspects, {
                        ...this.detailInfo
                    }, {
                        headers: {
                            "Content-Type": "application/json"
                        }
                    }
                ).then(res => {
                    console.log(res);
                    if (res.code == "201") {
                        this.$message({
                            message: res.message,
                            type: 'warning'
                        });
                        return
                    } else {
                        // this.detailId = res.data;
                        // this.getDetailInfo();
                        // // this.$message.success(res.message);
                        // this.goBack();
                    }
                });
            },
    // ä¿®æ”¹é¡¹ç›®çš„æ£€æµ‹å€¼æ”¹å˜ç»“论
    async changeState(row, index) {
      if (this.detailId !== null) {
        const res = await this.$axios.post(this.$api.url.updaterawInsProduct, {
          DevId: row.deviceId,
          rpId: row.rpId,
          testValue: row.testValueList.join(",")
        });
        this.$message.success("提交成功");
        this.getDetailInfo(); //重新刷新信息数据
      }
    },
    async submitSave() {
      const res = await this.$axios.post(
        this.$api.url.updateRawInspectsById + `${this.detailId}`
      ).then(res=>{
        this.$message.success("提交成功");
        this.getDetailInfo();
        this.goBack()
  Â  Â  });
    },
    // èŽ·å–è®¾å¤‡æ ‘å†…å®¹
    getOptions() {
      this.$axios.get(this.$api.url.rawSelectDevice).then(res => {
        this.materialOptions = res.data;
      });
    },
    // æ·»åŠ è¡Œ
    clickAddLine() {
      let obj = {
        deviceId: null,
        deviceName: "",
        internal: "",
        name: "",
        required: "",
        textValue: "",
        testState:null,
        testValueList: [],
        unit: ""
      };
      this.projectTable.push(obj);
    },
    // åˆ é™¤è¡Œ
    clickDeleteline(scope) {
      this.projectTable.splice(scope.$index, 1);
    },
    // ç‚¹å‡»è®¾å¤‡æ ‘保存点击记录
    nodeClick(data) {
      if (data.id != undefined) this.nodeData = data;
    },
    // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
    clickTableSelect(scope) {
      this.centerDialogVisible = true;
      this.clickSelectDevice.index = scope.$index;
      this.clickSelectDevice.rpId = scope.row.rpId;
    },
    // ç‚¹å‡»æ ‘里面的确定
    clickNodeSure() {
      if (this.detailId == null) {
        this.projectTable[
          this.clickSelectDevice.index
        ].deviceId = this.nodeData.id;
        this.projectTable[
          this.clickSelectDevice.index
        ].deviceName = this.nodeData.name;
        this.centerDialogVisible = false;
      } else {
        this.$axios
          .post(this.$api.url.updateDevByRpId, {
            rpId: this.clickSelectDevice.rpId,
            devId: this.nodeData.id
          })
          .then(res => {
            this.getDetailInfo();
            this.centerDialogVisible = false;
          });
      }
    },
    // åˆ é™¤æ£€éªŒå€¼åˆ—
    clickDeleteInspectionColumn() {
      if (this.empiricalValueAdd - 1 === 0) {
      } else {
        if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
          this.empiricalValueAdd = this.empiricalValueAdd - 1;
          this.projectTable.forEach(i => {
            i.testValueList.splice(this.empiricalValueAdd, 1);
          });
        }
      }
    },
    // æ·»åŠ æ£€éªŒå€¼åˆ—
    clickAddInspectionColumn() {
      this.empiricalValueAdd = this.empiricalValueAdd + 1;
    }
  }
};
            // ä¿®æ”¹é¡¹ç›®çš„æ£€æµ‹å€¼æ”¹å˜ç»“论
            async changeState(row, index) {
                if (this.detailId !== null) {
                    const res = await this.$axios.post(this.$api.url.updaterawInsProduct, {
                        DevId: row.deviceId,
                        rpId: row.rpId,
                        testValue: row.testValueList.join(",")
                    });
                    this.$message.success("提交成功");
                    this.getDetailInfo(); //重新刷新信息数据
                }
            },
            async submitSave() {
                const res = await this.$axios.post(
                    this.$api.url.updateRawInspectsById + `${this.detailId}`
                ).then(res => {
                    this.$message.success("提交成功");
                    this.getDetailInfo();
                    this.goBack()
                });
            },
            // èŽ·å–è®¾å¤‡æ ‘å†…å®¹
            getOptions() {
                this.$axios.get(this.$api.url.rawSelectDevice).then(res => {
                    this.materialOptions = res.data;
                });
            },
            // æ·»åŠ è¡Œ
            clickAddLine() {
                let obj = {
                    deviceId: null,
                    deviceName: "",
                    internal: "",
                    name: "",
                    required: "",
                    textValue: "",
                    testState: null,
                    testValueList: [],
                    unit: ""
                };
                this.projectTable.push(obj);
            },
            // åˆ é™¤è¡Œ
            clickDeleteline(scope) {
                this.projectTable.splice(scope.$index, 1);
            },
            // ç‚¹å‡»è®¾å¤‡æ ‘保存点击记录
            nodeClick(data) {
                if (data.id != undefined) this.nodeData = data;
            },
            // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
            clickTableSelect(scope) {
                this.centerDialogVisible = true;
                this.clickSelectDevice.index = scope.$index;
                this.clickSelectDevice.rpId = scope.row.rpId;
            },
            // ç‚¹å‡»æ ‘里面的确定
            clickNodeSure() {
                if (this.detailId == null) {
                    this.projectTable[
                        this.clickSelectDevice.index
                    ].deviceId = this.nodeData.id;
                    this.projectTable[
                        this.clickSelectDevice.index
                    ].deviceName = this.nodeData.name;
                    this.centerDialogVisible = false;
                } else {
                    this.$axios
                        .post(this.$api.url.updateDevByRpId, {
                            rpId: this.clickSelectDevice.rpId,
                            devId: this.nodeData.id
                        })
                        .then(res => {
                            this.getDetailInfo();
                            this.centerDialogVisible = false;
                        });
                }
            },
            // åˆ é™¤æ£€éªŒå€¼åˆ—
            clickDeleteInspectionColumn() {
                if (this.empiricalValueAdd - 1 === 0) {} else {
                    if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                        this.empiricalValueAdd = this.empiricalValueAdd - 1;
                        this.projectTable.forEach(i => {
                            i.testValueList.splice(this.empiricalValueAdd, 1);
                        });
                    }
                }
            },
            // æ·»åŠ æ£€éªŒå€¼åˆ—
            clickAddInspectionColumn() {
                this.empiricalValueAdd = this.empiricalValueAdd + 1;
            }
        }
    };
</script>
<style scoped>
.node_i {
  color: orange;
}
.div_device_dialog {
  min-height: 400px;
  overflow: auto;
}
.rawInsBox {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
}
.el-table__fixed-body-wrapper {
  top: 48px;
}
.rawInsBox .title .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
.rawInsBox .title {
  margin-bottom: 10px;
  padding: 0 20px;
}
/* æ£€éªŒè¯¦æƒ… */
.raw-detail-info {
  background: #fff;
  padding: 26px 0px 11px 80px;
}
.raw-detail-info >>> .el-form-item__label {
  color: rgb(51, 51, 51);
  font-family: å¾®è½¯é›…黑;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0px;
}
.raw-detail-info .el-input {
  width: auto;
}
.raw-detail-info.raw-detail-info-edit >>> .el-input__inner {
  background: #fff;
}
.raw-detail-info >>> .el-input__inner {
  width: 224px;
  height: 32px;
  box-sizing: border-box;
  background: rgb(238, 238, 238);
  border: 1px solid rgb(221, 221, 221);
  border-radius: 4px;
}
.raw-detail-info .el-form-item {
  margin-bottom: 24px;
}
.raw-detail-info .el-form-item .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
    .node_i {
        color: orange;
    }
/* æ£€éªŒé¡¹ç›® */
.raw-project-table {
  padding: 24px 14px;
  background: #fff;
  flex: 1;
  /* max-height: 360px; */
  /* overflow-y: hidden; */
}
/* æ£€éªŒç»“论 */
.raw-conclusion-table {
  padding: 9px 14px;
  background: #fff;
}
</style>
    .div_device_dialog {
        min-height: 400px;
        overflow: auto;
    }
    .rawInsBox {
        height: 100%;
        width: 100%;
        overflow-y: scroll;
        display: flex;
        flex-direction: column;
    }
    .el-table__fixed-body-wrapper {
        top: 48px;
    }
    .rawInsBox .title .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
    .rawInsBox .title {
        margin-bottom: 10px;
        padding: 0 20px;
    }
    /* æ£€éªŒè¯¦æƒ… */
    .raw-detail-info {
        background: #fff;
        padding: 26px 0px 11px 80px;
    }
    .raw-detail-info>>>.el-form-item__label {
        color: rgb(51, 51, 51);
        font-family: å¾®è½¯é›…黑;
        font-size: 16px;
        font-weight: 400;
        letter-spacing: 0px;
    }
    .raw-detail-info .el-input {
        width: auto;
    }
    .raw-detail-info.raw-detail-info-edit>>>.el-input__inner {
        background: #fff;
    }
    .raw-detail-info>>>.el-input__inner {
        width: 224px;
        height: 32px;
        box-sizing: border-box;
        background: rgb(238, 238, 238);
        border: 1px solid rgb(221, 221, 221);
        border-radius: 4px;
    }
    .raw-detail-info .el-form-item {
        margin-bottom: 24px;
    }
    .raw-detail-info .el-form-item .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
    /* æ£€éªŒé¡¹ç›® */
    .raw-project-table {
        padding: 24px 14px;
        background: #fff;
        flex: 1;
        /* max-height: 360px; */
        /* overflow-y: hidden; */
    }
    /* æ£€éªŒç»“论 */
    .raw-conclusion-table {
        padding: 9px 14px;
        background: #fff;
    }
</style>
src/components/view/record-content.vue
@@ -5,42 +5,26 @@
                <el-col :span="12" style="line-height: 32px;">生产记录维护</el-col>
                <el-col :span="12" style="text-align: right;">
                    <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;" @click="addend">新增</el-button>
                    <!-- <el-button icon="el-icon-edit-outline" @click="modify">修改</el-button> -->
                    <el-button icon="el-icon-delete" @click="dels">删除</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="choose">
            <span>类型:</span>
            <el-select v-model="search.type" size="small" @change="TYpe" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option label="橡胶连接器" :value="0"></el-option>
                <el-option label="金属连接器" :value="1"></el-option>
                <el-option label="湿插拔电连接器" :value="2"></el-option>
                <el-option label="分支组件" :value="3"></el-option>
            <el-select v-model="search.type" size="small" @change="TYpe" placeholder="请选择"
                style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
            </el-select>
            <!-- <span>工序:</span>
            <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
            </el-select>
            <el-button size="mini" @click="clean()"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" style="background: #004EA2;"><span>查
                    è¯¢</span></el-button> -->
                <!-- :style="{height: scrollerHeight,overflow:'auto',display: 'flex'}" -->
        </div>
        <div class="thing">
            <div class="left">
                <el-input v-model="search.technology" suffix-icon="el-icon-search" placeholder="请输入搜索内容" size="small" clearable @input="query"></el-input>
                <el-tree :data="list" ref="tree"
                :props="{children: 'children',label: 'name'}" node-key="name" default-expand-all
                    @node-click="handleNodeClick" highlight-current
                    :key="upIndex">
                <el-input v-model="search.technology" suffix-icon="el-icon-search" placeholder="请输入搜索内容" size="small" clearable
                    @input="query"></el-input>
                <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="name"
                    default-expand-all @node-click="handleNodeClick" highlight-current :key="upIndex" style="padding-top: 8px;">
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${data.code != '[2]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                            {{ data.code }}{{ data.name }}</span>
                        <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)">
                            <i class="el-icon-delete"></i>
                        </el-button> -->
                    </div>
                </el-tree>
            </div>
@@ -72,47 +56,32 @@
                    <el-col :span="4" style="font-size: 14px;text-align: right;">类型:</el-col>
                    <el-col :span="16" :offset="1">
                        <template>
                        <el-select v-model="edit.type" disabled placeholder="请选择" style="width: 310px;">
                            <el-option label="橡胶连接器" :value="0"></el-option>
                            <el-option label="金属连接器" :value="1"></el-option>
                            <el-option label="湿插拔电连接器" :value="2"></el-option>
                            <el-option label="分支组件" :value="3"></el-option>
                        </el-select>
                        </template>
                            <el-select v-model="edit.type" disabled placeholder="请选择" style="width: 310px;">
                                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                            </el-select>
                        </template>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="4"  style="font-size: 14px;text-align: right;">工序:</el-col>
                    <el-col :span="4" style="font-size: 14px;text-align: right;">工序:</el-col>
                    <el-col :span="16" :offset="1">
                        <template>
                        <el-select v-model="edit.techFather"
                        placeholder="请选择"
                        disabled
                        @change="workevent"
                        style="width: 310px;">
                            <el-option
                            v-for="item in process"
                            :key="item.name"
                            :label="item.name"
                            :value="item.name">
                            </el-option>
                        </el-select>
                        </template>
                            <el-select v-model="edit.techFather" placeholder="请选择" disabled @change="workevent" style="width: 310px;">
                                <el-option v-for="item in process" :key="item.name" :label="item.name" :value="item.name">
                                </el-option>
                            </el-select>
                        </template>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px;">
                    <el-col :span="4" style="font-size:  14px;text-align: right;">工艺:</el-col>
                    <el-col :span="16" :offset="1">
                        <template>
                        <el-select v-model="edit.techName"  disabled placeholder="请选择" style="width: 310px;">
                            <el-option
                            v-for="item in craftapi"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                         </el-select>
                        </template>
                            <el-select v-model="edit.techName" disabled placeholder="请选择" style="width: 310px;">
                                <el-option v-for="item in craftapi" :key="item.id" :label="item.name" :value="item.id">
                                </el-option>
                            </el-select>
                        </template>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px;">
@@ -140,118 +109,46 @@
            </span>
        </el-dialog>
        <!-- æ–°å¢žå¼¹çª— -->
        <el-dialog title="生产记录新增" :visible.sync="dialogVisible" :rules="Rules"
        ref="ruleForm" width="35%">
        <el-dialog title="生产记录新增" :visible.sync="dialogVisible" :rules="Rules" ref="ruleForm" width="35%">
            <div>
                <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型" prop="type">
                    <template>
                        <el-select v-model="form.type"
                        @change="edittype" placeholder="请选择" style="width: 100%;">
                            <el-option label="橡胶连接器" :value="0"></el-option>
                            <el-option label="金属连接器" :value="1"></el-option>
                            <el-option label="湿插拔电连接器" :value="2"></el-option>
                            <el-option label="分支组件" :value="3"></el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="工序" prop="work">
                    <template>
                        <el-select v-model="form.work"
                        @change="workevent"
                        placeholder="请选择" style="width: 100%;">
                            <el-option
                            v-for="item in process"
                            :key="item.name"
                            :label="item.name"
                            :value="item.name">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="工艺名称" prop="name">
                    <template>
                        <el-select v-model="form.craft" placeholder="请选择" style="width: 100%;">
                            <el-option
                            v-for="item in craftapi"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="记录" prop="record">
                    <el-input v-model="form.record"></el-input>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="form.remarks"></el-input>
                </el-form-item>
                <el-form-item label="单位" prop="unit">
                    <el-input v-model="form.unit"></el-input>
                </el-form-item>
                    <el-form-item label="类型" prop="type">
                        <template>
                            <el-select v-model="form.type" @change="edittype" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-form-item label="工序" prop="work">
                        <template>
                            <el-select v-model="form.work" @change="workevent" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="item in process" :key="item.name" :label="item.name" :value="item.name">
                                </el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-form-item label="工艺名称" prop="name">
                        <template>
                            <el-select v-model="form.craft" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="item in craftapi" :key="item.id" :label="item.name" :value="item.id">
                                </el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-form-item label="记录" prop="record">
                        <el-input v-model="form.record"></el-input>
                    </el-form-item>
                    <el-form-item label="备注">
                        <el-input v-model="form.remarks"></el-input>
                    </el-form-item>
                    <el-form-item label="单位" prop="unit">
                        <el-input v-model="form.unit"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="add(form)">ç¡® å®š</el-button>
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
        <!-- ä¿®æ”¹å¼¹çª— -->
        <el-dialog title="工序编辑" :visible.sync="modifyVisible" width="35%">
            <div>
                <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
                    <template>
                        <el-select v-model="value" placeholder="请选择" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="工序">
                    <template>
                        <el-select v-model="value" placeholder="请选择" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="工艺名称">
                    <template>
                        <el-select v-model="value" placeholder="请选择" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
                <el-form-item label="记录">
                    <el-input v-model="form.record"></el-input>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="form.remarks"></el-input>
                </el-form-item>
                <el-form-item label="单位">
                    <el-input v-model="form.unit"></el-input>
                </el-form-item>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="modifyVisible = false">ç¡® å®š</el-button>
                <el-button @click="modifyVisible = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
    </div>
@@ -261,187 +158,206 @@
    export default {
        data() {
            var checktype = (rule, value, callback) => {
                    if (!value) {
                  return callback(new Error('类型不能为空'));
                }else{
                if (!value) {
                    return callback(new Error('类型不能为空'));
                } else {
                    return callback
                }
            };
            return {
            return {
                search: {
                    type: 0,
                    technology: null
                },
                options:[],
                value:{},
                craftapi:[],
                form:{
                    type:'',
                    work:'',
                    craft:'',
                    name:'',
                    record:'',
                    remarks:'',
                    unit:'',
                options: [],
                value: {},
                craftapi: [],
                form: {
                    type: '',
                    work: '',
                    craft: '',
                    name: '',
                    record: '',
                    remarks: '',
                    unit: '',
                },
                Rules:{
                    type:{validator:checktype,required:true,message:'类型不能为空',trigger:'change'},
                    work:{required:true,message:'工序不能为空',trigger:'change'},
                    name:{required:true,message:'工艺不能为空',trigger:'change'},
                    record:{required:true,message:'记录不能为空',trigger:'blur'},
                    unit:{required:true,message:'单位不能为空',trigger:'blur'},
                Rules: {
                    type: {
                        validator: checktype,
                        required: true,
                        message: '类型不能为空',
                        trigger: 'change'
                    },
                    work: {
                        required: true,
                        message: '工序不能为空',
                        trigger: 'change'
                    },
                    name: {
                        required: true,
                        message: '工艺不能为空',
                        trigger: 'change'
                    },
                    record: {
                        required: true,
                        message: '记录不能为空',
                        trigger: 'blur'
                    },
                    unit: {
                        required: true,
                        message: '单位不能为空',
                        trigger: 'blur'
                    },
                },
                modifyVisible:false,
                dialogVisible:false,
                modifyVisible: false,
                dialogVisible: false,
                process: {},
                list: [],
                tableData: [],
                upIndex: 0,
                selects: [],
                delete:[],
                typeselect:0,
                delete: [],
                typeselect: 0,
                upDia: false,
                checkTreeNode:{
                    id:'',
                checkTreeNode: {
                    id: '',
                },
                upData:{
                    name:'',
                    unit:'',
                    note:'',
                upData: {
                    name: '',
                    unit: '',
                    note: '',
                },
                edit:{
                    name:'',
                    note:'',
                    techFather:'',
                    techName:'',
                    type:'',
                    unit:'',
                edit: {
                    name: '',
                    note: '',
                    techFather: '',
                    techName: '',
                    type: '',
                    unit: '',
                },
                bigType: []
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectjilu()
            this.chooseType()
        },
        methods: {
            chooseType() {
                this.$axios.get(this.$api.url.chooseType).then(res => {
                    this.bigType = res.data
                    this.typeselect = res.data[0]
                    this.search.type = res.data[0]
                    this.selectAllleft()
                    this.selectjilu()
                })
            },
            delQueById() {
                this.$axios.get(this.$api.url.delQueById,)
                this.$axios.get(this.$api.url.delQueById, )
            },
            childrenClick() {},
            TYpe(val) {
                this.typeselect = val
                console.log(this.typeselect);
                this.selectAllleft()
            },
                this.typeselect = val
                this.selectAllleft()
            },
            edittype(val) {
                this.typeselect = val
                this.chooseTechFath()
            },
            //新增
            workevent(val){
                console.log(val);
                let idx = this.process.findIndex(el => el.name === val)
                this.craftapi = this.process[idx].children
                console.log( this.craftapi);
            },
            workevent(val) {
                let idx = this.process.findIndex(el => el.name === val)
                this.craftapi = this.process[idx].children
            },
            chooseTechFath() {
            this.$axios.get(this.$api.url.chooseTechFath,{
                params:{type:this.typeselect}
            }).then(res => {
                this.process = res.data;
                console.log(this.process);
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            }).then(res =>{
                this.$axios.get(this.$api.url.chooseTechFath, {
                    params: {
                        type: this.typeselect
                    }
                }).then(res => {
                    this.process = res.data;
                }, {
                    headers: {
                        "Content-Type": "application/json"
                    }
                }).then(res => {
            })
                })
            },
            addRecord() {
                this.$axios.post(this.$api.url.addRecord,{
                    name:this.form.record,
                    note:this.form.remarks,
                    techTemId:this.form.craft,
                    unit:this.form.unit,
                }
                , {
                this.$axios.post(this.$api.url.addRecord, {
                    name: this.form.record,
                    note: this.form.remarks,
                    techTemId: this.form.craft,
                    unit: this.form.unit,
                }, {
                    headers: {
                        "Content-Type": "application/json"
                      }
                }
                ).then(res =>{
                        "Content-Type": "application/json"
                    }
                }).then(res => {
                    this.$message.success('添加成功')
                    this.selectjilu()
                })
            },
            add(formName) {
                this.dialogVisible = false
                this.addRecord()
                // this.$refs[formName].validate((valid) => {
                // if (valid) {
                //     alert('submit!');
                // } else {
                //     console.log('error submit!!');
                //     return false;
                // }
                // });
                this.form = {};
            },
            query() {
                this.selectAllleft()
            },
            //主体左
            selectAllleft() {
            this.$axios.get(this.$api.url.selectAllleft,{
                params:{type:this.typeselect,message:this.search.technology}
            }).then(res => {
                this.list = res.data;
                this.selectDataList()
                this.$nextTick(() => {
                this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
            })
            console.log("=======");
            console.log(this.list);
            let one=this.list.filter(item=>{
            return item.children.length>0
            })[0]
            console.log(one);
            let name=one.children[0].id
            console.log(name);
            this.checkTreeNode.id = name
            this.selectjiluStart(name)
            this.selectDataList();
            });
            //主体左
            selectAllleft() {
                this.$axios.get(this.$api.url.selectAllleft, {
                    params: {
                        type: this.typeselect,
                        message: this.search.technology
                    }
                }).then(res => {
                    this.list = res.data;
                    this.selectDataList()
                    this.$nextTick(() => {
                        this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
                    })
                    let one = this.list.filter(item => {
                        return item.children.length > 0
                    })[0]
                    let name = one.children[0].id
                    this.checkTreeNode.id = name
                    this.selectjiluStart(name)
                    this.selectDataList();
                });
            },
            //默认
            selectjiluStart(name) {
            this.$axios.get(this.$api.url.selectjilu,{
                params:{id:name}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            })
                this.$axios.get(this.$api.url.selectjilu, {
                    params: {
                        id: name
                    }
                }).then(res => {
                    this.tableData = res.data;
                })
            },
            //selectjilu  checkTreeNode
            selectjilu() {
                console.log(this.checkTreeNode.id);
            this.$axios.get(this.$api.url.selectjilu,{
                params:{id:this.checkTreeNode.id}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            })
                this.$axios.get(this.$api.url.selectjilu, {
                    params: {
                        id: this.checkTreeNode.id
                    }
                }).then(res => {
                    this.tableData = res.data;
                })
            },
            modify(){
                this.modifyVisible = true
            },
            addend(){
            modify() {
                this.modifyVisible = true
            },
            addend() {
                this.dialogVisible = true
                this.chooseTechFath()
            },
            filterNode(value, data) {
              if (!value) return true;
              return data.name.indexOf(value) !== -1;
                if (!value) return true;
                return data.name.indexOf(value) !== -1;
            },
            remove(node, data) {
                this.$confirm("是否删除", "警告", {
@@ -470,11 +386,9 @@
                this.upIndex++
            },
            handleNodeClick(data) {
                if(data.code != '[2]') return
                this.checkTreeNode = data
                this.selectjilu()
                if(data.code=='[3]'){
                    console.log(data);
                }
            },
            nodeOpen(data, node, el) {
                $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
@@ -498,57 +412,52 @@
                    return el.id
                })
                this.delete = cc.join(',')
                console.log(this.delete);
                this.delAllRecord()
                this.$message.success('删除完成')
            },
            //批量删除
            delAllRecord() {
                this.$axios.post(this.$api.url.delAllRecord,{
                        ids:this.delete
                this.$axios.post(this.$api.url.delAllRecord, {
                    ids: this.delete
                })
            },
            //删除
            delQueByIdapi() {
                this.$axios.post(this.$api.url.delQueByIdapi,{
                        id:this.upData.id
                this.$axios.post(this.$api.url.delQueByIdapi, {
                    id: this.upData.id
                })
            },
            deleteRow(index, rows) {
                this.tableData.splice(index,1)
                this.tableData.splice(index, 1)
                this.upData.id = rows.id
                this.delQueByIdapi()
                // this.selectjilu()
            },
            //编辑
            upContent(ob) {
                this.upData = ob
                // console.log(this.upData);
                this.selecRecord()
                // this.chooseTechFath()
                this.upDia = true
            },
            selecRecord() {
                this.$axios.get(this.$api.url.selecRecord,{
                    params:{
                        id:this.upData.id
                this.$axios.get(this.$api.url.selecRecord, {
                    params: {
                        id: this.upData.id
                    }
                }).then(res => {
                    this.edit = res.data[0]
                })
            },
            writeRecordById() {
                // console.log(this.upData.id);
                this.$axios.post(this.$api.url.writeRecordById + '?id=' + this.upData.id,{
                    name:this.upData.name,
                    note:this.upData.note,
                    techTemId:this.edit.id,
                    unit:this.upData.unit
                this.$axios.post(this.$api.url.writeRecordById + '?id=' + this.upData.id, {
                    name: this.upData.name,
                    note: this.upData.note,
                    techTemId: this.edit.id,
                    unit: this.upData.unit
                }, {
                    headers: {
                        "Content-Type": "application/json"
                      }
                        "Content-Type": "application/json"
                    }
                }).then(res => {
                    this.selectjilu()
                })
@@ -556,16 +465,7 @@
            submitUpData() {
                this.writeRecordById()
                this.$message.success('修改成功')
                this.upDia = false
                    // this.tableData.forEach(a => {
                //     if (a.id == this.upData.id) {
                //         a.name = this.upData.name
                //         a.unit = this.upData.unit
                //         a.thing = this.upData.thing
                //     }
                // })
                // console.log(this.upData);
            }
        }
    }
@@ -678,6 +578,4 @@
        height: 30px;
        border-radius: 2px;
    }
</style>
</style>
src/components/view/sale.vue
@@ -118,7 +118,6 @@
                    <el-button type="success" @click="syncOrder"
                        :icon="isSync ? 'el-icon-loading' : 'el-icon-refresh'">同步</el-button>
                    <el-button type="primary" icon="el-icon-plus" @click="openAddDia">新增</el-button>
                    <!-- <el-button icon="el-icon-edit-outline">修改</el-button> -->
                    <el-button icon="el-icon-delete" @click="delSales">删除</el-button>
                    <el-button icon="el-icon-download">导出</el-button>
                </el-col>
@@ -156,29 +155,34 @@
                </el-table-column>
                <el-table-column prop="order_number" label="订单编号" width="150">
                </el-table-column>
                <el-table-column label="订单类型" width="100">
                    <template slot-scope="scope">
                        <el-tag effect="dark" size="mini" style="font-size: 8px;">{{scope.row.order_type}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="code" label="合同编号" width="220">
                </el-table-column>
                <el-table-column prop="name" label="工程名称">
                <el-table-column prop="name" label="工程名称" width="120">
                </el-table-column>
                <el-table-column prop="proname" label="客户名称">
                <el-table-column prop="proname" label="客户名称" width="120">
                </el-table-column>
                <el-table-column prop="交货日期" label="交货日期" width="150">
                </el-table-column>
                <el-table-column prop="note" label="备注" width="150">
                <el-table-column prop="note" label="备注" width="150" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="type" label="状态" width="100">
                    <template slot-scope="scope">
                        <span style="color: #34BD66;" v-if="scope.row.type == 1">通过</span>
                        <span style="color: #E84738;" v-else-if="scope.row.type == 0">不通过</span>
                        <span v-else>未审核</span>
                        <span v-else>{{null}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" width="220">
                    <template slot-scope="scope">
                        <span class="table_do" @click="changeShowDetail(scope.row)">&nbsp;查看详情&nbsp;</span>
                        <span class="table_do" v-if="scope.row.type == null" @click="saleCheck(scope)">&nbsp;审核&nbsp;</span>
                        <span class="table_do" v-if="scope.row.type == 2" @click="saleCheck(scope)">&nbsp;审核&nbsp;</span>
                        <span class="table_do" v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <span class="table_do" v-if="scope.row.type == null"
                        <span class="table_do" v-if="scope.row.type == 2"
                            @click="openUpDia(scope.row.id)">&nbsp;编辑&nbsp;</span>
                        <span class="table_do" v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <span class="table_do" @click="delSale(scope.$index)">&nbsp;删除&nbsp;</span>
@@ -284,7 +288,7 @@
            </el-dialog>
        </div>
        <div class="select-model">
            <el-dialog :title="`销售${upDia == true ? '修改' : '新增'}`" :visible.sync="addDia" width="850px"
            <el-dialog :title="`销售${upDia == true ? '修改' : '新增'}`" :visible.sync="addDia" width="900px"
                @close="closeDialog">
                <div class="body">
                    <div class="head">基本信息</div>
@@ -304,6 +308,10 @@
                            <el-col :span="3">工程名称</el-col>
                            <el-col :span="8">
                                <el-input v-model="addData.name" size="small" placeholder="请输入工程名称" clearable></el-input>
                            </el-col>
                            <el-col :span="3" :offset="2">备注</el-col>
                            <el-col :span="8">
                                <el-input v-model="addData.note" size="small" placeholder="请输入备注" clearable></el-input>
                            </el-col>
                        </el-row>
                    </div>
@@ -349,35 +357,35 @@
                                        placeholder="请输入规格型号"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="unit" label="单位">
                            <el-table-column prop="unit" label="单位" width="100">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.unit" size="small" clearable placeholder="请输入"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="number" label="数量">
                            <el-table-column prop="number" label="数量" width="100">
                                <template slot-scope="scope">
                                    <el-input v-model.number="scope.row.number" size="small"
                                        @change="(val) => scope.row.number = isNaN(val) ? null : val" clearable
                                        placeholder="请输入"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="price" label="单价">
                            <el-table-column prop="price" label="单价" width="100">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.price" size="small" clearable placeholder="请输入"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="username" label="联系人">
                            <el-table-column prop="username" label="联系人" width="150">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.username" size="small" clearable
                                        placeholder="请输入"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="phone" label="电话">
                            <el-table-column prop="phone" label="电话" width="200">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.phone" size="small" clearable placeholder="请输入"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="address" label="地址">
                            <el-table-column prop="address" label="地址" width="200">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.address" size="small" clearable
                                        placeholder="请输入"></el-input>
@@ -424,6 +432,7 @@
                orderNumber: null,
                code: null,
                name: null,
                note: null,
                proname: null,
                adress: null,
                username: null,
@@ -446,6 +455,7 @@
                orderNumber: null,
                code: null,
                name: null,
                note: null,
                proname: null,
                adress: null,
                username: null,
@@ -627,7 +637,7 @@
                } else {
                    for (var c in this.addData.saleMaterialList[b]) {
                        if (this.addData.saleMaterialList[b][c] == null || this.addData.saleMaterialList[b][c] == '' || Object
                            .keys(this.addData.saleMaterialList[b]).length != 6) {
                            .keys(this.addData.saleMaterialList[b]).length != 9) {
                            this.$message.error('产品信息有必填项未填写')
                            return
                        }
src/components/view/standard-table/technology.vue
@@ -32,7 +32,7 @@
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="pq" label="生产定额(个/天)" :resizable="false">
            <el-table-column prop="pq" label="生产效率(个/天)" :resizable="false">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.pq" 
                  v-if="scope.row.dg != null" size="small"
src/components/view/standard.vue
@@ -48,7 +48,7 @@
            <el-option :value="0" label="工艺路线"></el-option>
            <el-option :value="1" label="技术指标"></el-option>
            <el-option :value="2" label="物料清单"></el-option>
            <el-option :value="3" label="生产工艺"></el-option>
            <!-- <el-option :value="3" label="生产工艺"></el-option> -->
          </el-select>
          <span>版本:</span>
          <el-select v-model="versionVal" @change="verevent" size="small" style="width: 13vw;margin-right: 15px;" placeholder="请选择">
src/components/view/technology.vue
@@ -1,919 +1,562 @@
<style scoped>
.title .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
    .title .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
.title {
  margin-bottom: 10px;
  padding: 0 20px;
}
    .title {
        margin-bottom: 10px;
        padding: 0 20px;
    }
.title * {
  font-size: 16px;
}
    .title * {
        font-size: 16px;
    }
.choose {
  padding: 21px 24px;
  display: flex;
  align-items: center;
  background-color: #fff;
  border-bottom: 3px solid rgb(245, 247, 251);
}
    .choose {
        padding: 21px 24px;
        display: flex;
        align-items: center;
        background-color: #fff;
        border-bottom: 3px solid rgb(245, 247, 251);
    }
.choose * {
  font-size: 14px;
}
    .choose * {
        font-size: 14px;
    }
.choose .el-button {
  height: 32px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 12px;
}
    .choose .el-button {
        height: 32px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 12px;
    }
.thing {
  width: 100%;
  height: calc(100% - 120px);
  background-color: #fff;
  display: flex;
}
    .thing {
        width: 100%;
        height: calc(100% - 120px);
        background-color: #fff;
        display: flex;
    }
.thing .left {
  width: 295px;
  height: calc(100% - 20px);
  border-right: 3px solid rgb(245, 247, 251);
  padding: 16px;
    overflow-y: auto;
}
    .thing .left {
        width: 295px;
        height: calc(100% - 20px);
        border-right: 3px solid rgb(245, 247, 251);
        padding: 16px;
        overflow-y: auto;
    }
.thing .left .custom-tree-node span {
  font-size: 14px;
}
    .thing .left .custom-tree-node span {
        font-size: 14px;
    }
.thing .left .custom-tree-node {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding-right: 8px;
}
    .thing .left .custom-tree-node {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        padding-right: 8px;
    }
.node_i {
  color: orange;
}
    .node_i {
        color: orange;
    }
.el-icon-delete {
  display: none;
  color: #004ea2;
}
    .el-icon-delete {
        display: none;
        color: #004ea2;
    }
.custom-tree-node:hover .el-icon-delete {
  display: inline;
}
    .custom-tree-node:hover .el-icon-delete {
        display: inline;
    }
.thing .right {
  width: calc(100% - 305px);
  height: calc(100% - 25px);
  overflow: hidden;
  padding: 10px;
}
    .thing .right {
        width: calc(100% - 305px);
        height: calc(100% - 25px);
        overflow: hidden;
        padding: 10px;
    }
.table_do {
  color: #004ea0;
  cursor: pointer;
}
    .table_do {
        color: #004ea0;
        cursor: pointer;
    }
</style>
<style>
.record_content .title .el-button * {
  font-size: 14px;
}
    .record_content .title .el-button * {
        font-size: 14px;
    }
.record_content .title .el-button--default {
  color: #004ea2;
}
    .record_content .title .el-button--default {
        color: #004ea2;
    }
.record_content
  .thing
  .left
  .el-tree--highlight-current
  .el-tree-node.is-current
  > .el-tree-node__content {
  background: rgba(58, 124, 253, 0.2);
  color: #004ea2;
}
    .record_content .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
        background: rgba(58, 124, 253, 0.2);
        color: #004ea2;
    }
.record_content .el-tree-node__content {
  height: 30px;
  border-radius: 2px;
}
    .record_content .el-tree-node__content {
        height: 30px;
        border-radius: 2px;
    }
</style>
<template>
  <div class="record_content">
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px">工艺路线维护</el-col>
        <el-col :span="12" style="text-align: right">
          <el-button
            type="primary"
            icon="el-icon-plus"
            style="background: #004ea2"
            @click="addend"
            >新增</el-button
          >
          <!-- <el-button icon="el-icon-edit-outline" @click="modify">修改</el-button> -->
          <el-button icon="el-icon-delete" @click="dels">删除</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="choose">
      <span>类型:</span>
      <el-select
        v-model="search.type"
        size="small"
        placeholder="请选择"
        @change="type"
        style="width: 224px; margin-right: 30px"
      >
        <el-option label="橡胶连接器" :value="0"></el-option>
        <el-option label="金属连接器" :value="1"></el-option>
        <el-option label="湿插拔电连接器" :value="2"></el-option>
        <el-option label="分支组件" :value="3"></el-option>
      </el-select>
      <!-- <span>工序:</span>
            <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
    <div class="record_content">
        <div class="title">
            <el-row>
                <el-col :span="12" style="line-height: 32px">工艺路线维护</el-col>
                <el-col :span="12" style="text-align: right">
                    <el-button type="primary" icon="el-icon-plus" style="background: #004ea2" @click="addend">新增</el-button>
                    <el-button icon="el-icon-delete" @click="dels">删除</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="choose">
            <span>类型:</span>
            <el-select v-model="search.type" size="small" placeholder="请选择" @change="type"
                style="width: 224px; margin-right: 30px">
                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
            </el-select>
            <span>设备组:</span>
            <el-select v-model="search.name" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                <el-option v-for="(a, ai) in product" key="ai" :label="a.name" :value="a.id"></el-option>
            </el-select> -->
      <!-- <el-button size="mini" @click="clean()"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" style="background: #004EA2;"><span>查
                    è¯¢</span></el-button> -->
    </div>
    <div class="thing">
      <div class="left">
        <el-input
          v-model="search.technology"
          suffix-icon="el-icon-search"
          placeholder="请输入搜索内容"
          size="small"
          clearable
          @input="query"
        >
          <!-- clearable @input="(val)=>$refs.tree.filter(val)"> -->
        </el-input>
        <el-tree
          :data="towTree"
          ref="tree"
          :props="{ children: 'children', label: 'father' }"
          node-key="father"
          default-expand-all
          @node-click="handleNodeClick"
          :key="upIndex"
          highlight-current
        >
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <span
              ><i
                :class="`node_i ${
        </div>
        <div class="thing">
            <div class="left">
                <el-input v-model="search.technology" suffix-icon="el-icon-search" placeholder="请输入搜索内容" size="small" clearable
                    @input="query">
                </el-input>
                <el-tree :data="towTree" ref="tree" :props="{ children: 'children', label: 'father' }" node-key="father"
                    default-expand-all @node-click="handleNodeClick" :key="upIndex" highlight-current style="padding-top: 8px;">
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${
                  data.code != '[2]'
                    ? 'el-icon-folder-opened'
                    : 'el-icon-tickets'
                }`"
              ></i>
              {{ data.father }}</span
            >
            <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)">
                            <i class="el-icon-delete"></i>
                        </el-button> -->
          </div>
        </el-tree>
      </div>
      <div class="right">
        <el-table
          :data="tableData"
          border
          style="width: 100%; overflow-y: auto; min-height: 100%"
          max-height="100%"
          @selection-change="handleSelectionChange"
          default-expand-all
        >
          <el-table-column type="selection" width="50"> </el-table-column>
          <el-table-column type="index" label="序号" width="70">
          </el-table-column>
          <el-table-column prop="name" label="工艺名称"> </el-table-column>
          <el-table-column prop="device_group" label="设备组">
          </el-table-column>
          <el-table-column label="元件">
            <template slot-scope="scope">
              <el-tag type="info" style="margin-right: 10px;" v-for="(a, index) in JSON.parse(scope.row.element)" :key="index">{{ a }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="130">
            <template slot-scope="scope">
              <span class="table_do" @click="upContent(scope.row)"
                >编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span
              >
              <span class="table_do" @click="deleteRow(scope.$index, scope.row)"
                >删除</span
              >
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <el-dialog title="编辑记录内容" :visible.sync="upDia" width="500px">
      <div class="body">
        <el-row style="line-height: 46px">
          <el-col :span="4" style="font-size: 14px; text-align: right"
            >类型:</el-col
          >
          <el-col :span="16" :offset="1">
            <template>
              <el-select
                v-model="edit.type"
                placeholder="请选择"
                disabled
                style="width: 310px"
              >
                <el-option label="橡胶连接器" :value="0"></el-option>
                <el-option label="金属连接器" :value="1"></el-option>
                <el-option label="湿插拔电连接器" :value="2"></el-option>
                <el-option label="分支组件" :value="3"></el-option>
              </el-select>
            </template>
          </el-col>
        </el-row>
        <el-row style="line-height: 46px">
          <el-col :span="4" style="font-size: 14px; text-align: right"
            >工序:</el-col
          >
          <el-col :span="16" :offset="1">
            <el-select
              v-model="edit.father"
              style="width: 310px"
              disabled
              placeholder="请选择"
            >
              <el-option
                v-for="item in procedure"
                :key="item"
                :label="item"
                disabled
                :value="item"
              >
              </el-option>
            </el-select>
          </el-col>
        </el-row>
        <el-row style="line-height: 46px">
          <el-col :span="4" style="font-size: 14px; text-align: right"
            >元件:</el-col
          >
          <el-col :span="16" :offset="1">
            <el-input v-model="cell"
             placeholder="请输入元件名称"
             style="width: 200px">
            </el-input>
            <!-- <el-select
              v-model="cell"
              style="width: 310px"
              disabled
              multiple
              placeholder="请选择"
            >
              <el-option
                v-for="item in element"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select> -->
          </el-col>
        </el-row>
        <el-row style="line-height: 46px">
          <el-col :span="4" style="font-size: 14px; text-align: right"
            >工艺名称:</el-col
          >
          <el-col :span="16" :offset="1">
            <el-input v-model="edit.name" size="small" clearable></el-input>
          </el-col>
        </el-row>
        <el-row style="line-height: 46px">
          <el-col :span="4" style="font-size: 14px; text-align: right"
            >设备组:</el-col
          >
          <el-col :span="16" :offset="1">
            <!-- <el-input
              v-model="upData.device_group"
              size="small"
              clearable
            ></el-input> -->
            <template>
              <el-select
                v-model="upData.device_group"
                placeholder="请选择"
                style="width: 306px"
              >
                <el-option
                  v-for="item in equipment"
                  :key="item.index"
                  :label="item.father"
                  :value="item.father"
                >
                </el-option>
              </el-select>
            </template>
          </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitUpData">ç¡® å®š</el-button>
        <el-button @click="upDia = false">取 æ¶ˆ</el-button>
      </span>
    </el-dialog>
    <!-- å·¥è‰ºè·¯çº¿æ–°å¢ž -->
    <el-dialog title="工艺路线新增" :visible.sync="dialogVisible" width="35%">
      <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="类型">
            <template>
              <el-select
                v-model="form.type"
                placeholder="请选择"
                style="width: 100%"
                @change="edittype"
              >
                <el-option label="橡胶连接器" :value="0"></el-option>
                <el-option label="金属连接器" :value="1"></el-option>
                <el-option label="湿插拔电连接器" :value="2"></el-option>
                <el-option label="分支组件" :value="3"></el-option>
              </el-select>
            </template>
          </el-form-item>
          <el-form-item label="工序">
            <template>
              <el-select
                v-model="form.father"
                allow-create
                filterable
                @create=""
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in procedure"
                  :key="item"
                  :label="item"
                  :value="item"
                >
                </el-option>
              </el-select>
            </template>
          </el-form-item>
          <el-form-item label="设备组">
            <template>
              <el-select
                v-model="form.deviceGroup"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in equipment"
                  :key="item.index"
                  :label="item.father"
                  :value="item.father"
                >
                </el-option>
              </el-select>
            </template>
          </el-form-item>
          <el-row>
            <el-col :span="12">
              <el-form-item label="元件">
                <template>
                  <el-input v-model="form.elementId" placeholder="请输入元件名称" style="width: 100%"></el-input>
                  <!-- <el-select
                    v-model="form.elementId"
                    multiple
                    placeholder="请选择"
                    style="width: 200px"
                  >
                    <el-option
                      v-for="item in element"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-select> -->
                </template>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="工艺名称">
                <el-input placeholder="请输入工艺名称" v-model="form.name" style="width: 100%"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="Neworder">ç¡® å®š</el-button>
        <el-button @click="Deleteapi">取 æ¶ˆ</el-button>
      </span>
    </el-dialog>
    <!-- å·¥è‰ºè·¯çº¿ä¿®æ”¹ -->
    <el-dialog title="工艺路线新增" :visible.sync="modifyevent" width="35%">
      <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="类型">
            <template>
              <el-select
                v-model="value"
                placeholder="请选择"
                style="width: 480px"
              >
                <!-- <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item."
                            :value="item.value">
                            </el-option> -->
                <el-option label="橡胶连接器" :value="0"></el-option>
                <el-option label="金属连接器" :value="1"></el-option>
                <el-option label="湿插拔电连接器" :value="2"></el-option>
                <el-option label="分支组件" :value="3"></el-option>
              </el-select>
            </template>
          </el-form-item>
          <el-form-item label="工序">
            <template>
              <el-select
                v-model="value"
                placeholder="请选择"
                style="width: 480px"
              >
                <el-option
                  v-for="item in procedure"
                  :key="item.value"
                  :label="item.j"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </template>
          </el-form-item>
          <el-row>
            <el-col :span="10">
              <el-form-item label="工艺名称">
                <template>
                  <el-select
                    v-model="value"
                    placeholder="请选择"
                    style="width: 200px"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </template>
              </el-form-item>
            </el-col>
            <el-col :span="10" :offset="2">
              <el-form-item label="元件">
                <el-input v-model="form.name" style="width: 200px"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="modifyevent = false">ç¡® å®š</el-button>
        <el-button @click="modifyevent = false">取 æ¶ˆ</el-button>
      </span>
    </el-dialog>
  </div>
                }`"></i>
                            {{ data.father }}</span>
                    </div>
                </el-tree>
            </div>
            <div class="right">
                <el-table :data="tableData" border style="width: 100%; overflow-y: auto; min-height: 100%" max-height="100%"
                    @selection-change="handleSelectionChange" default-expand-all>
                    <el-table-column type="selection" width="50"> </el-table-column>
                    <el-table-column type="index" label="序号" width="70">
                    </el-table-column>
                    <el-table-column prop="name" label="工艺名称"> </el-table-column>
                    <el-table-column prop="device_group" label="设备组">
                    </el-table-column>
                    <el-table-column label="操作" width="130">
                        <template slot-scope="scope">
                            <span class="table_do" @click="upContent(scope.row)">编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <span class="table_do" @click="deleteRow(scope.$index, scope.row)">删除</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
        <el-dialog title="编辑工艺信息" :visible.sync="upDia" width="500px">
            <div class="body">
                <el-row style="line-height: 46px">
                    <el-col :span="4" style="font-size: 14px; text-align: right">类型:</el-col>
                    <el-col :span="16" :offset="1">
                        <template>
                            <el-select v-model="edit.type" placeholder="请选择" disabled style="width: 310px">
                                <el-option v-for="(a, ai) in bigType" :key="ai" :value="a"></el-option>
                            </el-select>
                        </template>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px">
                    <el-col :span="4" style="font-size: 14px; text-align: right">工序:</el-col>
                    <el-col :span="16" :offset="1">
                        <el-select v-model="edit.father" style="width: 310px" disabled placeholder="请选择">
                            <el-option v-for="item in procedure" :key="item" :label="item" disabled :value="item">
                            </el-option>
                        </el-select>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px">
                    <el-col :span="4" style="font-size: 14px; text-align: right">工艺名称:</el-col>
                    <el-col :span="16" :offset="1">
                        <el-input v-model="edit.name" size="small" clearable></el-input>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px">
                    <el-col :span="4" style="font-size: 14px; text-align: right">设备组:</el-col>
                    <el-col :span="16" :offset="1">
                        <template>
                            <el-select v-model="upData.device_group" placeholder="请选择" style="width: 306px">
                                <el-option v-for="item in equipment" :key="item.index" :label="item.father" :value="item.father">
                                </el-option>
                            </el-select>
                        </template>
                    </el-col>
                </el-row>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitUpData">ç¡® å®š</el-button>
                <el-button @click="upDia = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
        <!-- å·¥è‰ºè·¯çº¿æ–°å¢ž -->
        <el-dialog title="工艺路线新增" :visible.sync="dialogVisible" width="35%">
            <div>
                <el-form ref="form" :model="form" label-width="80px">
                    <el-form-item label="类型">
                        <template>
                            <el-select v-model="form.type" allow-create filterable placeholder="请选择" style="width: 100%"
                                @change="edittype">
                                <el-option v-for="(a,ai) in bigType" :key="ai" :value="a">
                                </el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-form-item label="工序">
                        <template>
                            <el-select v-model="form.father" allow-create filterable @create="" placeholder="请选择" style="width: 100%">
                                <el-option v-for="item in procedure" :key="item" :label="item" :value="item">
                                </el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-form-item label="设备组">
                        <template>
                            <el-select v-model="form.deviceGroup" placeholder="请选择" style="width: 100%">
                                <el-option v-for="item in equipment" :key="item.index" :label="item.father" :value="item.father">
                                </el-option>
                            </el-select>
                        </template>
                    </el-form-item>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="工艺名称">
                                <el-input placeholder="请输入工艺名称" v-model="form.name" style="width: 100%"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="Neworder">ç¡® å®š</el-button>
                <el-button @click="Deleteapi">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
  data() {
    return {
      search: {
        type: 0,
        technology: null,
      },
      options: {},
      form: {
        type: "",
        father: "",
        name: "",
        elementId: "",
        deviceGroup: "",
      },
      // search: {
      //   type: "",
      // },
      delete: [],
      treetrunk: [],
      process: [],
      product: [],
      procedure: [],
      checkTreeNode: {
        name: "",
      },
      towTree: [],
      value: "",
      modifyevent: false,
      dialogVisible: false,
      tableData: [],
      upIndex: 0,
      selects: [],
      upDia: false,
      element: [],
      equipment: [0],
      cell:[],
      AAA: [
        {
          id: "",
        },
      ],
      edit: {
        deviceGroup: "",
        father: "",
        name: "",
        type: "",
        children:[],
      },
      upData: {
        name: "",
        deviceGroup: "",
        ele: "",
        father: "",
        type: "",
      },
      typeselect: 0,
      newdata: {
        type: "",
      },
      upIndex: 0,
      treeList:[],
    elerow:{},
    };
  },
  mounted() {
    this.selectAllTechTem();
    this.selectAllTechNam();
    console.log(this.treeList);
  },
  methods: {
    selectDataList() {
      this.towTree.forEach((a) => {
        a.code = "[1]";
        if (a.children != undefined) {
          a.children.forEach((b) => {
            b.code = "[2]";
          });
        }
      });
      this.upIndex++;
    },
    type(val) {
      this.typeselect = val;
      this.upData.type = val;
      console.log(this.typeselect);
      this.selectAllTechTem();
    },
    export default {
        data() {
            return {
                search: {
                    type: '',
                    technology: null,
                },
                options: {},
                form: {
                    type: "",
                    father: "",
                    name: "",
                    elementId: "",
                    deviceGroup: "",
                },
                delete: [],
                treetrunk: [],
                process: [],
                product: [],
                procedure: [],
                checkTreeNode: {
                    name: "",
                },
                towTree: [],
                value: "",
                modifyevent: false,
                dialogVisible: false,
                tableData: [],
                upIndex: 0,
                selects: [],
                upDia: false,
                element: [],
                equipment: [0],
                cell: [],
                AAA: [{
                    id: "",
                }, ],
                edit: {
                    deviceGroup: "",
                    father: "",
                    name: "",
                    type: "",
                    children: [],
                },
                upData: {
                    name: "",
                    deviceGroup: "",
                    ele: "",
                    father: "",
                    type: "",
                },
                typeselect: '',
                newdata: {
                    type: "",
                },
                upIndex: 0,
                treeList: [],
                elerow: {},
                bigType: []
            };
        },
        mounted() {
            this.chooseType()
        },
        methods: {
            chooseType() {
                this.$axios.get(this.$api.url.chooseType).then(res => {
                    this.bigType = res.data
                    this.typeselect = res.data[0]
                    this.search.type = res.data[0]
                    this.selectAllTechTem();
                    this.selectAllTechNam();
                })
            },
            selectDataList() {
                this.towTree.forEach((a) => {
                    a.code = "[1]";
                    if (a.children != undefined) {
                        a.children.forEach((b) => {
                            b.code = "[2]";
                        });
                    }
                });
                this.upIndex++;
            },
            type(val) {
                this.typeselect = val;
                this.upData.type = val;
                console.log(this.typeselect);
                this.selectAllTechTem();
            },
    Neworder() {
      this.dialogVisible = false;
      this.addTechTemp();
      this.form = {};
    },
    Deleteapi() {
      this.dialogVisible = false;
      this.form = {};
    },
    addTechTemp() {
      console.log(this.form.elementId.split(','));
      this.$axios
        .post(
          this.$api.url.addTechTemp,
          {
            deviceGroup: this.form.deviceGroup,
            // elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""),
            // element:this.form.elementId.split(','),
            element:JSON.stringify(this.form.elementId.split(',')),
            father: this.form.father,
            name: this.form.name,
            type: this.form.type,
          },
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
        .then((res) => {
          console.log(res);
          /* this.selectAllTechNam(); */
          this.form = {};
          this.$parent.removeAllTab()
        });
    },
    //元件
    // chooseElement() {
    //   this.$axios.get(this.$api.url.chooseElement).then((res) => {
    //     this.element = res.data;
    //     console.log(this.element);
    //   });
    // },
    //设备
    chooseDevGroup() {
      this.$axios.get(this.$api.url.chooseDevGroup).then((res) => {
        this.equipment = res.data;
        // console.log(this.equipment);
      });
    },
    // onTypeBlur(e) {
    // if (e.target.value) {
    // this.type = e.target.value;}},
    //工序
    chooseTech() {
      this.$axios.get(this.$api.url.chooseTech,{
          params:{
            type:this.typeselect
          }
      }).then(res =>{
        console.log(res);
        this.procedure = res.data
      })
    },
    edittype(val) {
            Neworder() {
                this.dialogVisible = false;
                this.addTechTemp();
                this.form = {};
            },
            Deleteapi() {
                this.dialogVisible = false;
                this.form = {};
            },
            addTechTemp() {
                this.$axios
                    .post(
                        this.$api.url.addTechTemp, {
                            deviceGroup: this.form.deviceGroup,
                            father: this.form.father,
                            name: this.form.name,
                            type: this.form.type,
                        }, {
                            headers: {
                                "Content-Type": "application/json",
                            },
                        }
                    )
                    .then((res) => {
                        console.log(res);
                        this.form = {};
                        this.$parent.removeAllTab()
                    });
            },
            //设备
            chooseDevGroup() {
                this.$axios.get(this.$api.url.chooseDevGroup).then((res) => {
                    this.equipment = res.data;
                });
            },
            //工序
            chooseTech() {
                this.$axios.get(this.$api.url.chooseTech, {
                    params: {
                        type: this.typeselect
                    }
                }).then(res => {
                    this.procedure = res.data
                })
            },
            edittype(val) {
                this.typeselect = val
                this.chooseTech()
            },
    //批量删除
    delAllTech() {
      console.log(this.delete);
      this.$axios.post(this.$api.url.delAllTech, {
        ids: this.delete,
      }).then(res=>{
        this.$parent.removeAllTab()
      });
    },
    //删除
    delTechById() {
      console.log(this.$api.url.delTechById, this.upData.id);
      this.$axios.post(this.$api.url.delTechById, {
        id: this.upData.id,
      }).then(res=>{
        this.$parent.removeAllTab()
      });
    },
    //编辑
    writeTechById() {
      // console.log(JSON.stringify(this.edit.children));
      // console.log(JSON.stringify(this.edit.children));
      // var str = ''
      // this.edit.children.forEach((a,ai)=>{
      //   str += a.id
      //   if(ai!=this.edit.children.length-1) str+=','
      // })
      this.$axios
        .post(
          this.$api.url.writeTechById + `?id=${this.upData.id}`,
            {
                deviceGroup: this.upData.device_group,
                element:JSON.stringify(this.cell.split(',')),
                // element:JSON.stringify(this.form.elementId.split(','))
                father: this.edit.father,
                name: this.edit.name,
                type: this.edit.type
          },
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
        .then((res) => {
          /* this.selectAllTechNam(), */
          this.$parent.removeAllTab()
        });
    },
    query(val) {
      this.selectAllTechTem();
    },
     selectAllTechTem() {
       this.$axios
        .get(this.$api.url.selectAllTechTem, {
          params: { type: this.typeselect, message: this.search.technology },
        })
        .then((res) => {
          this.towTree = res.data;
          console.log(this.towTree);
          this.$nextTick(() => {
                this.$refs.tree.setCurrentKey(this.towTree[0].father) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
            })
          // let one=this.towTree.filter(item=>{
            // return item.children.length>0
          // })[0]
          // let name=one.children[0].name
      // this.checkTreeNode.name=name
          // this.selectAllTechNamStart(name)
      //     this.selectDataList();
      let one=this.towTree[0]
        let name =one.father
        this.checkTreeNode.father = name
              console.log(name);
        this.selectAllTechNamStart(name)
        });
    },
    handleNodeClick(data, node) {
        console.log(data);
      this.checkTreeNode = data;
      // this.treetrunk = node;
      // console.log(this.treetrunk);
      // console.log(this.checkTreeNode);
      this.selectAllTechNam();
    },
    selectAllTechNam() {
      this.$axios
        .get(this.$api.url.selectAllTechNam, {
          params: { father: this.checkTreeNode.father },
        })
        .then((res) => {
          this.tableData = res.data;
          let kk =this.tableData.map(el =>{
            console.log(el);
            return el.element
                })[0]
            // console.log(kk.replace('[','').replace(']','') );
            // console.log(kk.split(','));
            this.elerow = kk
        });
    },
    selectAllTechNamStart(name) {
      this.$axios
        .get(this.$api.url.selectAllTechNam, {
          params: { father: name },
        })
        .then((res) => {
          this.tableData = res.data;
        });
    },
    addend() {
      this.dialogVisible = true;
      this.chooseTech();
      this.chooseDevGroup();
      // this.chooseElement();
    },
    modify() {
      this.modifyevent = true;
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.name.indexOf(value) !== -1;
    },
    remove(node, data) {
      this.$confirm("是否删除", "警告", {
        type: "warning",
      })
        .then((res) => {
          const parent = node.parent;
          const children = parent.data.children || parent.data;
          const index = children.findIndex((d) => d.id === data.id);
          children.splice(index, 1);
        })
        .catch((e) => {});
    },
    // selectDataList() {
    //     this.list.forEach(a => {
    //         a.code = '[1]'
    //         if (a.children != undefined) {
    //             a.children.forEach(b => {
    //                 b.code = '[2]'
    //             })
    //         }
    //     })
    //     this.upIndex++
    // },
    nodeOpen(data, node, el) {
      $($(el.$el).find(".node_i")[0]).attr(
        "class",
        "node_i el-icon-folder-opened"
      );
    },
    nodeClose(data, node, el) {
      $($(el.$el).find(".node_i")[0]).attr("class", "node_i el-icon-folder");
    },
    handleSelectionChange(val) {
      this.selects = val;
    },
    dels() {
      this.selects.forEach((a) => {
        for (var b = 0; b < this.tableData.length; b++) {
          if (this.tableData[b].id == a.id) {
            this.tableData.splice(b, 1);
            b--;
          }
        }
      });
      let cc = this.selects.map((el) => {
        return el.id;
      });
      this.delete = cc.join(",");
      console.log(this.delete);
      this.delAllTech();
      this.$message.success("删除完成");
    },
    deleteRow(index, rows) {
      this.tableData.splice(index, 1);
      this.upData.id = rows.id;
      this.delTechById();
    },
    selecTechById() {
      this.$axios
        .get(this.$api.url.selecTechById, {
          params: {
            id: this.upData.id,
          },
        })
        .then((res) => {
          this.edit = res.data[0];
          this.cell = this.edit.element
          console.log(this.cell);
          let cc = JSON.parse(this.cell).join(",")
          console.log(cc);
          this.cell = cc
          console.log(this.cell);
        //   this.cell = this.edit.children.map(el => {
                //     return el.id
                // })
        //   this.cell = this.cell.join(',')
        //   this.cell = nn
        //   console.log(this.cell);
          //  let cc = this.edit.element.join(", ")
          //  let str = cc.join(", ");
            // let cc = JSON.parse(this.edit.element)
            // console.log(cc);
            // console.log(gg);
            // console.log(json.parse(gg));
        });
    },
    //编辑内容
    upContent(ob) {
      this.upData = ob;
      this.chooseDevGroup();
      this.selecTechById()
      this.upDia = true;
    },
    submitUpData() {
      // this.tableData.forEach(a => {
      //     if (a.id == this.upData.id) {
      //         a.name = this.upData.name
      //         a.ask = this.upData.device_group
      //     }
      // })
      this.writeTechById();
      this.$message.success("修改成功");
      this.upIndex++;
      this.upDia = false;
    },
  },
};
</script>
            //批量删除
            delAllTech() {
                this.$axios.post(this.$api.url.delAllTech, {
                    ids: this.delete,
                }).then(res => {
                    this.$parent.removeAllTab()
                });
            },
            //删除
            delTechById() {
                this.$axios.post(this.$api.url.delTechById, {
                    id: this.upData.id,
                }).then(res => {
                    this.$parent.removeAllTab()
                });
            },
            //编辑
            writeTechById() {
                this.$axios
                    .post(
                        this.$api.url.writeTechById + `?id=${this.upData.id}`, {
                            deviceGroup: this.upData.device_group,
                            father: this.edit.father,
                            name: this.edit.name,
                            type: this.edit.type
                        }, {
                            headers: {
                                "Content-Type": "application/json",
                            },
                        }
                    )
                    .then((res) => {
                        this.$message.success("修改成功");
                        this.$parent.removeAllTab()
                    });
            },
            query(val) {
                this.selectAllTechTem();
            },
            selectAllTechTem() {
                this.$axios
                    .get(this.$api.url.selectAllTechTem, {
                        params: {
                            type: this.typeselect,
                            message: this.search.technology
                        },
                    })
                    .then((res) => {
                        this.towTree = res.data;
                        this.$nextTick(() => {
                            this.$refs.tree.setCurrentKey(this.towTree[0].father) // é»˜è®¤é€‰ä¸­èŠ‚ç‚¹ç¬¬ä¸€ä¸ª
                        })
                        let one = this.towTree[0]
                        let name = one.father
                        this.checkTreeNode.father = name
                        this.selectAllTechNamStart(name)
                    });
            },
            handleNodeClick(data, node) {
                this.checkTreeNode = data;
                this.selectAllTechNam();
            },
            selectAllTechNam() {
                this.$axios
                    .get(this.$api.url.selectAllTechNam, {
                        params: {
                            father: this.checkTreeNode.father
                        },
                    })
                    .then((res) => {
                        this.tableData = res.data;
                        let kk = this.tableData.map(el => {
                            return el.element
                        })[0]
                        this.elerow = kk
                    });
            },
            selectAllTechNamStart(name) {
                this.$axios
                    .get(this.$api.url.selectAllTechNam, {
                        params: {
                            father: name
                        },
                    })
                    .then((res) => {
                        this.tableData = res.data;
                    });
            },
            addend() {
                this.dialogVisible = true;
                this.chooseDevGroup();
            },
            filterNode(value, data) {
                if (!value) return true;
                return data.name.indexOf(value) !== -1;
            },
            remove(node, data) {
                this.$confirm("是否删除", "警告", {
                        type: "warning",
                    })
                    .then((res) => {
                        const parent = node.parent;
                        const children = parent.data.children || parent.data;
                        const index = children.findIndex((d) => d.id === data.id);
                        children.splice(index, 1);
                    })
                    .catch((e) => {});
            },
            nodeOpen(data, node, el) {
                $($(el.$el).find(".node_i")[0]).attr(
                    "class",
                    "node_i el-icon-folder-opened"
                );
            },
            nodeClose(data, node, el) {
                $($(el.$el).find(".node_i")[0]).attr("class", "node_i el-icon-folder");
            },
            handleSelectionChange(val) {
                this.selects = val;
            },
            dels() {
                this.selects.forEach((a) => {
                    for (var b = 0; b < this.tableData.length; b++) {
                        if (this.tableData[b].id == a.id) {
                            this.tableData.splice(b, 1);
                            b--;
                        }
                    }
                });
                let cc = this.selects.map((el) => {
                    return el.id;
                });
                this.delete = cc.join(",");
                console.log(this.delete);
                this.delAllTech();
                this.$message.success("删除完成");
            },
            deleteRow(index, rows) {
                this.tableData.splice(index, 1);
                this.upData.id = rows.id;
                this.delTechById();
            },
            selecTechById() {
                this.$axios
                    .get(this.$api.url.selecTechById, {
                        params: {
                            id: this.upData.id,
                        },
                    })
                    .then((res) => {
                        this.edit = res.data[0];
                    });
            },
            //编辑内容
            upContent(ob) {
                this.upData = ob;
                this.chooseDevGroup();
                this.selecTechById()
                this.upDia = true;
            },
            submitUpData() {
                this.writeTechById();
                this.upIndex++;
                this.upDia = false;
            }
        },
    };
</script>
src/main.js
@@ -23,8 +23,7 @@
Vue.use(qs);
Vue.use(api);
const javaApi = 'http://127.0.0.1:8001'
// localhost 127.0.0.1
const javaApi = 'http://192.168.14.249:8001'
// const javaApi = 'http://127.0.0.1:8001/'
src/view/index.vue
@@ -352,18 +352,6 @@
                        v: "WMS管理",
                        i: "font icon-a-Inventorydumprequest",
                        c: [{
                                k: 15,
                                v: "原材料库存",
                                i: "font icon-shouye",
                                u: ""
                            },
                            {
                                k: 16,
                                v: "回单管理",
                                i: "font icon-shouye",
                                u: ""
                            },
                            {
                                k: 17,
                                v: "半成品库存",
                                i: "font icon-shouye",
@@ -413,7 +401,7 @@
                            },
                            {
                                k: 6,
                                v: "成品检验",
                                v: "产品检验",
                                i: "font icon-shouye",
                                u: "finishedProductInspection"
                            },
@@ -472,12 +460,6 @@
                                u: "record-content"
                            },
                            {
                                k: 24,
                                v: "自检项目维护",
                                i: "font icon-shouye",
                                u: "self-inspection"
                            },
                            {
                                k: 25,
                                v: "技术指标维护",
                                i: "font icon-shouye",
@@ -500,12 +482,6 @@
                                v: "物料清单维护",
                                i: "font icon-shouye",
                                u: "mbom"
                            },
                            {
                                k: 30,
                                v: "生产工艺维护",
                                i: "font icon-shouye",
                                u: "equipmentmaintain"
                            }
                        ]
                    }
@@ -559,7 +535,7 @@
                    u: "index-index"
                }]
            },
            upTabActive(num) {
                this.tabActive = num;
                this.activeP = num;
@@ -577,7 +553,7 @@
                localStorage.removeItem("autoenter");
                this.$router.push("/enter");
            },
            removeAllTab(){
            removeAllTab() {
                this.upIndex++
                this.$message.warning('数据变动较大,页面自动更新!')
            }