XiaoRuby
2023-09-08 253b9c48b02d995540b84c1831e54e6baf8a1000
Merge remote-tracking branch 'origin/master'

# Conflicts:
# src/main.js
已修改12个文件
已添加3个文件
20712 ■■■■ 文件已修改
package-lock.json 17395 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/Technicalindex.vue 649 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/equipmentmaintain.vue 518 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/laboratoryManagement.vue 306 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/mbom.vue 172 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/record-content.vue 216 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/routinginspection.vue 307 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/self-inspection.vue 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard.vue 547 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/technical.vue 308 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/technology.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
ÎļþÌ«´ó
src/App.vue
@@ -26,7 +26,7 @@
</script>
<style>
/* @import url("../static/img/alifont/iconfont.css"); */
@import url("//at.alicdn.com/t/c/font_4179845_pixkgb97c4p.css");
@import url("//at.alicdn.com/t/c/font_4179845_jbljsur8ub.css");
* {
  margin: 0;
src/assets/api/controller.js
@@ -2,11 +2,17 @@
const standard = {
    // æŠ€æœ¯ç®¡ç†-标准Bom
    selectTreeByMaterial: "material/selectTreeByMaterial", //查询物料的树
    selectVersion:"/material/selectVersion",//右侧版本
    selectProductByMaterial: "product/selectTreeByMaterial", //根据物料查询项目表格
    selectTechnologyByMaterial: "technology/select",
    selectAll:"/material/selectAll",//右侧数据
    // æŠ€æœ¯ç®¡ç†-技术文件
    selectAllOrder: "/orders/selectAllOrder", //查询所有订单列表
    selectOrderById: "/orders/selectOrderById", //根据订单id查询订单详情
    //订单BOM
    delDevice:"/device/delDeviceById",//订单Bom
}
// åŽŸææ–™æ£€éªŒ
const raw = {
@@ -45,6 +51,10 @@
// 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",// æ–°å¢žä»ªå™¨è®¾å¤‡ï¼šä¿ç®¡äººä¸‹æ‹‰æ¡†
@@ -77,14 +87,37 @@
    delTechById:"/technologyTemplate/delTechById",//新增工艺路线==>删除
    selecTechById:"/technologyTemplate/selecTechById",//新增工艺路线--》编辑
    delAllTech:"/technologyTemplate/delAllTech",//批量删除
    addTechMode:"/technicalModel/addTechMode",//技术指标---》新增
    delTechBy:"/technicalModel/delTechById",//技术--.删除
    selectAllleft:"/technicalModel/selectAllTechTem",//技术指标-->左边
    selectAllright:"/technicalModel/selectAllTechNam",//技术指标--》右边
    chooseProFath:"/technicalModel/chooseProFath",//技术指标---》父类选择
    chooseTechFath:    "/technicalModel/chooseTechFath",// æŠ€æœ¯--->工序工艺
    selecTech:"/technicalModel/selecTechById",//技术--->编辑
    selectAllMbom:"/mbomModel/selectAllMbom",//物料维护--》右边
    addMbom:"/mbomModel/addMbom",//物料--->新增
    material:"/mbomModel/delMbomById",//物料清单删除
    selectAllTeque:"/techniqueModel/selectAllTeque",//生产工艺维护---。右边
    selectAllSelf:"/selfcheckModel/selectAllSelf",//自建维护-----》右边
    selectjilu:"/techniqueModel/selectAllTeque",//生产记录维护---》右边
    addSelfcheck:"/selfcheckModel/addSelfcheck",//自检  ------》新增
    delSelfcheck:"/selfcheckModel/delSelfcheckById",//自检----.删除
    delAll:"selfcheckModel/delAllTech",//批量删除---.自检
    selectjilu:"/recordModel/selectAllRecord",//生产记录维护---》右边
    selecRecord:"/recordModel/selecRecordById",//生产记录----.编辑
    delQueById:"/recordModel/delQueById",//删除---.记录内容
    delAllRecord:"/recordModel/delAllRecord",//删除批量--->记录
    addRecord:"/recordModel/addRecord",//生产记录-------.新增
    choosePro:"/techniqueModel/choosePro",//新增生产工艺维护---》选择父类
    chooseDeiv:"/techniqueModel/chooseDeiv",//新增----->设备
    addQeMode:"/techniqueModel/addQeMode",//新增----》传参
    delQueById:"/techniqueModel/delQueById",//删除
    delAllQue:"/techniqueModel/delAllQue",//批量删除
}
const url = {
    enter: "user/enter", //登录
src/components/view/Technicalindex.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,649 @@
<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="event">新增</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>
            <!-- ç¼–辑弹窗 -->
            <div>
            <el-dialog
            title="技术指标编辑"
            :visible.sync="modifyevent"
            width="40%"
            :before-close="handleClose">
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
                    <template>
                        <el-select v-model="value" placeholder="请选择类型" style="width: 560px;">
                            <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-row>
                    <el-col :span="11">
                        <el-form-item label="工序">
                            <el-input v-model="form.name"  placeholder="请输入或选择工序"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="工艺">
                            <el-input v-model="form.name"  placeholder="请输入或选择工艺"></el-input>
                        </el-form-item>
                     </el-col>
                </el-row>
                <el-row>
                    <el-col :span="11">
                        <el-form-item label="上级">
                            <el-input v-model="form.name"  placeholder="请选择上级"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="项目">
                            <el-input v-model="form.name"  placeholder="请输入项目"></el-input>
                        </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>
                </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="modifyevent = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="modifyevent = false">ç¡® å®š</el-button>
            </span>
            </el-dialog>
            </div>
            <!-- æ–°å¢žå¼¹çª— -->
        <div>
            <el-dialog
            title="技术指标新增"
            :visible.sync="dialogVisible"
            width="40%"
            :before-close="handleClose">
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
                    <template>
                        <el-select v-model="form.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>
                        </template>
                    </el-form-item>
                <el-row>
                    <el-col :span="11">
                        <el-form-item label="工序">
                            <template>
                                <el-select v-model="form.work"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                @change="workevent"
                                >
                                    <el-option
                                    v-for="(item,index) in process"
                                    :key="item.name"
                                    :label="item.name"
                                    :value="item.name">
                                    </el-option>
                                </el-select>
                                </template>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="工艺">
                            <template>
                                <el-select v-model="form.name"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                >
                                    <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-col>
                </el-row>
                <el-row>
                    <el-col :span="11">
                        <el-form-item label="上级">
                            <template>
                                <el-select v-model="form.father"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                >
                                    <el-option
                                    v-for="item in higherlevel"
                                    :key="item"
                                    :label="item"
                                    :value="item">
                                    </el-option>
                                </el-select>
                                </template>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="项目">
                            <el-input v-model="form.project"  placeholder="请输入项目"></el-input>
                        </el-form-item>
                     </el-col>
                </el-row>
                <el-form-item label="单位">
                    <el-input v-model="form.unit"  placeholder="请输入单位" style="width: 220px;"></el-input>
                </el-form-item>
                </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="add">ç¡® å®š</el-button>
            </span>
            </el-dialog>
            </div>
        </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>
            </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"
                suffix-icon="el-icon-search"
                placeholder="请输入搜索内容"
                size="small"
                clearable @input="query" ></el-input>
                    <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'father'}" node-key="id" default-expand-all
                    @node-click="handleNodeClick"
                        >
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${data.code != '[3]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                            {{data.father}} {{ 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%;margin-bottom: 20px;"
                    row-key="name"
                    border
                    @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">
                    </el-table-column>
                    <el-table-column
                    prop="name"
                    label="项目"
                    sortable
                    width="300px">
                        <template slot-scope="scope">
                        <el-tag>
                            <div class="firstDiv" :style="`color: ${scope.row.children? '#16a7ff' : '#58c173'}`">
                            {{ scope.row.children ? "01" : "02" }}
                            </div>
                        </el-tag>
                        <span style="color: black">{{ scope.row.name }}</span>
                        </template>
                        </el-table-column>
                        <el-table-column
                        prop="unit"
                        label="单位">
                        </el-table-column>
                        <el-table-column
                        prop="address"
                        label="操作"
                        width="200px">
                        <template slot-scope="scope" style="text-align: center;">
                        <el-button type="text" size="mini" @click="childrenClick(scope)">编辑</el-button>
                        <el-button type="text" size="mini" @click="deleteRow(scope.$index, scope.row)">删除</el-button>
                        </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="form.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>
                        </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="form.work"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                @change="workevent"
                                >
                                    <el-option
                                    v-for="(item,index) 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="form.name"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                >
                                    <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;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">项目名称:</el-col>
                    <el-col :span="16" :offset="1">
                        <el-input v-model="upData.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>
                    </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>
            </div>
        </div>
    </div>
</template>
<script>
export default {
        data() {
            return {
              search:{
                type:'',
                technology:'',
              },
            //   handleClose:[],
                checkTreeNode :{
                    id:2,
                },
                higherlevel:[],
                value:{},
                options:[],
                process:[],
                filterNode:[],
                list: [],
                form:{
                    father:'',
                    work:'',
                    name:'',
                    unit:'',
                    project:'',
                },
                children:[],
                modifyevent:false,
                dialogVisible:false,
                tableData: [],
                typeselect:0,
                upData:{},
                upDia:false,
                craftapi:[],
                edit:{
                }
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectAllright()
        },
        methods:{
            //编辑
            selecTech() {
                this.$axios.get(this.$api.url.selecTech,{
                    params:{
                        id:this.upData.id
                    }
                }).then(res => {
                    this.edit = res.data[0]
                    console.log(this.edit);
                })
            },
            childrenClick() {
                this.selecTech()
                this.upDia = true
            },
            submitUpData() {//确定
            },
            //删除
            delTechBy() {
                console.log(this.$api.url.delTechBy,this.upData.id);
                this.$axios.post(this.$api.url.delTechBy,{
                        id:this.upData.id
                }).then(res =>{
                    this.selectAllright()
                    this.$message.success('删除完成')
                })
            },
            deleteRow(index, rows) {
                this.tableData.splice(index,1)
                this.upData = rows
                this.upData.id = rows.id
                this.delTechBy()
            },
            add() {
                this.dialogVisible = false
                this.addTechMode()
            },
            addTechMode() {
                this.$axios.post(this.$api.url.addTechMode,{
                    father:this.form.father,
                    name:this.form.project,
                    techTemId:this.form.name,
                    unit:this.form.unit,
                }, {
                    headers: {
                        "Content-Type": "application/json"
                      }
                }).then(res =>{
                    this.$message.success('新增完成')
                    this.selectAllright()
                })
            },
            handleClose() {
            },
            TYpe(val) {
                this.typeselect = val
                console.log(this.typeselect);
                this.selectAllleft()
            },
            //主体左
            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);
            })
            },
            //
            //查询
            query(val) {
                this.selectAllleft()
            },
            selectAllright() {
            this.$axios.get(this.$api.url.selectAllright,{
                params:{id:this.checkTreeNode.id}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            });
            },
            //上级
            chooseProFath() {
                console.log(this.checkTreeNode.id);
            this.$axios.get(this.$api.url.chooseProFath,{
                params:{techTemId:this.checkTreeNode.id}
            }).then(res => {
                this.higherlevel = res.data;
                console.log(this.higherlevel);
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            })
            },
            //工序工艺
            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"
                      }
            })
            },
            workevent(val){
                console.log(val);
                let idx = this.process.findIndex(el => el.name === val)
                this.craftapi = this.process[idx].children
            },
            handleNodeClick(data){
                this.checkTreeNode = data
                console.log(this.checkTreeNode.id);
                this.selectAllright()
            },
            event(){
                this.dialogVisible = true
                this.chooseProFath()
                this.chooseTechFath()
            },
            modify(){
                this.modifyevent = true
            },
            // deleteRow(index, rows) {
                // console.log();
                // rows.splice(index, 1);
            // },
            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--
                        }
                    }
                })
                this.$message.success('删除完成')
            },
        }
    }
</script>
<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 {
        margin-bottom: 10px;
        padding: 0 20px;
    }
    .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 * {
        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;
    }
    .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;
    }
    .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;
    }
    .node_i {
        color: orange;
    }
    .el-icon-delete {
        display: none;
        color: #004EA2;
    }
    .custom-tree-node:hover .el-icon-delete {
        display: inline;
    }
    .thing .right {
        width: calc(100% - 305px);
        height: calc(100% - 25px);
        overflow: hidden;
        padding: 10px;
    }
    .table_do {
        color: #004ea0;
        cursor: pointer;
    }
.firstDiv {
  /* float: left;
  width: 20px;
  height: 20px;
  border-radius: 60px;
  /* background-color: #eff5ff;
  margin-top: 5px;
  justify-content: center;
  display: flex;
  align-items: center;
  margin-right: 8px; */
  /* border-radius: 60px; */
}
.el-tag{
    border-radius: 50%;
}
</style>
<style>
    .record_content .title .el-button * {
        font-size: 14px;
    }
    .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 .el-tree-node__content {
        height: 30px;
        border-radius: 2px;
    }
</style>
src/components/view/equipmentmaintain.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,518 @@
<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="event">新增</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>
            <!-- ç¼–辑弹窗 -->
            <div>
            <el-dialog
            title="技术指标编辑"
            :visible.sync="modifyevent"
            width="40%"
            :before-close="handleClose">
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
                    <template>
                        <el-select v-model="form.type" placeholder="请选择类型" >
                            <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-row>
                    <el-col :span="11">
                        <el-form-item label="工序">
                            <template>
                        <el-select v-model="form.work"
                        placeholder="请选择类型" >
                            <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-col>
                </el-row>
                <el-row>
                    <el-col :span="11">
                        <el-form-item label="设备">
                            <el-input v-model="form.father"  placeholder="请选择上级"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="项目">
                            <el-input v-model="form.name"  placeholder="请输入项目"></el-input>
                        </el-form-item>
                     </el-col>
                </el-row>
                <el-form-item label="单位">
                    <el-input v-model="form.unit"  placeholder="请输入单位" style="width: 220px;"></el-input>
                </el-form-item>
                </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="modifyevent = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="modifyevent = false">ç¡® å®š</el-button>
            </span>
            </el-dialog>
            </div>
            <!-- æ–°å¢žå¼¹çª— -->
        <div>
            <el-dialog
            title="技术指标新增"
            :visible.sync="dialogVisible"
            width="40%"
            :before-close="handleClose">
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
                    <template>
                        <el-select v-model="form.type" placeholder="请选择类型" style="width: 480px;">
                            <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-row>
                    <el-col :span="11">
                        <el-form-item label="工序">
                            <template>
                        <el-select v-model="form.father"
                        placeholder="请选择类型" >
                            <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-col>
                </el-row>
                <el-row>
                    <el-col :span="11">
                        <el-form-item label="设备">
                            <template>
                        <el-select v-model="form.work" placeholder="请选择类型" >
                            <el-option
                            v-for="item in higherlevel"
                            :key="item.name"
                            :label="item.name"
                            :value="item.name">
                            </el-option>
                        </el-select>
                        </template>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <el-form-item label="项目">
                            <el-input v-model="form.name"  placeholder="请输入项目"></el-input>
                        </el-form-item>
                     </el-col>
                </el-row>
                <el-form-item label="单位">
                    <el-input v-model="form.unit"  placeholder="请输入单位" style="width: 220px;"></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
                <el-button type="primary" @click="add">ç¡® å®š</el-button>
            </span>
            </el-dialog>
            </div>
        </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>
            <!-- <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"
                suffix-icon="el-icon-search"
                placeholder="请输入搜索内容"
                size="small" clearable ></el-input>
                    <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
                        highlight-current  :filter-node-method="filterNode"
                        @node-click="handleNodeClick"
                        >
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${data.code != '[3]'?'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%;margin-bottom: 20px;"
                    row-key="name"
                    border
                    @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">
                    </el-table-column>
                    <el-table-column
                    label="设备名称"
                    sortable
                    width="300px">
                        <template slot-scope="scope">
                        <el-tag>
                            <div class="firstDiv" :style="`color: ${scope.row.children ? '#16a7ff' : '#58c173'}`">
                            {{ scope.row.children  ? "01" : "02" }}
                            </div>
                        </el-tag>
                        <span style="children: black">{{ scope.row.name }}</span>
                        </template>
                        </el-table-column>
                    <el-table-column
                    label="项目"
                    sortable
                    width="300px">
                        <template slot-scope="scope">
                        <el-tag>
                            <div class="firstDiv" :style="`color: ${scope.row.children ? '#16a7ff' : '#58c173'}`">
                            {{ scope.row.children ? "01" : "02" }}
                            </div>
                        </el-tag>
                        <span style="color: black">{{ scope.row.name }}</span>
                        </template>
                        </el-table-column>
                        <el-table-column
                        prop="unit"
                        label="单位">
                        </el-table-column>
                        <el-table-column
                        prop="address"
                        label="指标">
                        </el-table-column>
                        <el-table-column
                        prop="address"
                        label="操作"
                        width="200px">
                        <template slot-scope="scope" style="text-align: center;">
                        <el-button type="text" size="mini" @click="childrenClick(scope)">编辑</el-button>
                        <el-button type="text" size="mini" @click="deleteRow(scope.$index, tableData)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</template>
<script>
export default {
        data() {
            return {
              search:{},
              value:{},
              typeselect:0,
              options:[],
              process:[],
              list: [],
              TYpe:'',
              selects:'',
              process:{},
              options:{},
              checkTreeNode:{
                id:2,
              },
                form:{
                    type:'',
                    father:'',
                    work:'',
                    name:'',
                    unit:'',
                },
                modifyevent:false,
                dialogVisible:false,
                tableData: [],
                higherlevel:{},
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectAllTeque()
        },
        methods:{
            elForm() {},
            //新增
            choosePro() {//工序
            this.$axios.get(this.$api.url.choosePro,{
                params:{techTemId:this.checkTreeNode.id}
            }).then(res => {
                this.process = res.data;
                console.log(this.process);
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            })
            },
            chooseDeiv() {//设备
            this.$axios.get(this.$api.url.chooseDeiv,{
                params:{techTemId:this.checkTreeNode.id}
            }).then(res => {
                this.higherlevel = res.data;
                console.log(this.process);
            }, {
                headers: {
                        "Content-Type": "application/json"
                      }
            })
            },
             //新增
             event(){
                this.dialogVisible = true
                this.choosePro()
                this.chooseDeiv()
            },
            //确认
            add() {
                this.dialogVisible = false
            },
            addQeMode(){
                this.$axios.get(this.$api.url.addQeMode,{
                    devId:this.form.xxx,
                    techTemId:this.form.xxx,
                    technicalModelId:this.form.xxx,
                })
            },
            //编辑
            childrenClick() {
                this.modifyevent=true
                this.chooseTechFath()
            },
            TYpe() {
                this.typeselect = val
                this.selectAllleft()
            },
            handleNodeClick(data){
                this.checkTreeNode = data
                console.log(this.checkTreeNode.id);
                this.selectAllTeque()
            },
             //主体左
             selectAllleft() {
            this.$axios.get(this.$api.url.selectAllleft,{
                params:{type:this.typeselect}
            }).then(res => {
                this.list = res.data;
                console.log(this.list);
            })
            },
            //主体右
            selectAllTeque() {
            this.$axios.get(this.$api.url.selectAllTeque,{
                params:{id:this.checkTreeNode.id}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            })
            },
            modify(){
                this.modifyevent = true
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            },
            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--
                        }
                    }
                })
                this.$message.success('删除完成')
            },
            handleClose(){
                        this.$confirm('确认关闭?')
                .then(_ => {
                    done();
                })
                .catch(_ => {})
            },
            filterNode(){
            },
        }
    }
</script>
<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 {
        margin-bottom: 10px;
        padding: 0 20px;
    }
    .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 * {
        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;
    }
    .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;
    }
    .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;
    }
    .node_i {
        color: orange;
    }
    .el-icon-delete {
        display: none;
        color: #004EA2;
    }
    .custom-tree-node:hover .el-icon-delete {
        display: inline;
    }
    .thing .right {
        width: calc(100% - 305px);
        height: calc(100% - 25px);
        overflow: hidden;
        padding: 10px;
    }
    .table_do {
        color: #004ea0;
        cursor: pointer;
    }
.firstDiv {
  /* float: left;
  width: 20px;
  height: 20px;
  border-radius: 60px; */
  /* background-color: #eff5ff;
  margin-top: 5px;
  justify-content: center;
  display: flex;
  align-items: center;
  margin-right: 8px; */
}
</style>
<style>
    .record_content .title .el-button * {
        font-size: 14px;
    }
    .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 .el-tree-node__content {
        height: 30px;
        border-radius: 2px;
    }
</style>
src/components/view/laboratoryManagement.vue
@@ -49,19 +49,16 @@
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="父级分类">
                <el-form-item label="设备组" prop="name">
                  <el-select
                    v-model="value"
                    @blur="productSelect"
                    filterable
                    allow-create
                    placeholder="请选择父级分类"
                    v-model="ruleForm.equr"
                    placeholder="请选择设备组"
                  >
                    <el-option
                      v-for="list in parentClassificationList"
                      :key="list.index"
                      :label="list.father"
                      :value="list.father"
                      v-for="list in equip"
                      :key="list"
                      :label="list"
                      :value="list"
                    >
                    </el-option>
                  </el-select>
@@ -153,38 +150,7 @@
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="检测项目" prop="rawInsProductId" required>
                  <el-select
                    v-model="ruleForm.rawInsProductId"
                    placeholder="请选择检测项目"
                  >
                    <el-option
                      v-for="item in inspectionList"
                      :key="item.index"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="检测样品" required>
                  <el-form-item>
                    <el-input
                      placeholder="检测样品"
                      :disabled="true"
                      style="width: 206px"
                      v-model="showCodeNameModel.name"
                    >
                    </el-input>
                  </el-form-item>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
            <!-- <el-row>
              <el-col :span="12">
                <el-form-item label="规格型号">
                  <el-input
@@ -196,18 +162,8 @@
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="检测人">
                  <el-input
                    placeholder="检测人"
                    :disabled="true"
                    style="width: 206px"
                    v-model="showCodeNameModel.user_name"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            </el-row> -->
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
@@ -228,14 +184,11 @@
        <el-radio-group
          class="ai-tab-change"
          style="width: 270px; margin-top: 5px"
          v-model="radio1"
          v-model="equipment"
          @input="RadioChange"
        >
          <el-radio-button size="small" label="true">
            <div>生产设备</div>
          </el-radio-button>
          <el-radio-button size="small" label="false">
            <div>检测设备</div>
          </el-radio-button>
        <el-radio-button  label="1">生产设备</el-radio-button>
        <el-radio-button  label="2">检验设备</el-radio-button>
        </el-radio-group>
        <el-input
          class="frame_input"
@@ -269,7 +222,7 @@
                  }`
                "
              ></i>
              {{ data.name }}</span
              {{ data.father }}</span
            >
            <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
@@ -365,9 +318,9 @@
            </el-table-column>
            <el-table-column prop="name" label="仪器设备名称" width="125">
            </el-table-column>
            <el-table-column prop="keeper" label="保管人"> </el-table-column>
            <el-table-column prop="userName" label="保管人"> </el-table-column>
            <el-table-column
              prop="end_measure"
              prop="DATE_FORMAT(end_measure, '%Y-%m-%d')"
              label="计量截至有效期"
              width="147"
            >
@@ -414,15 +367,15 @@
              :show-overflow-tooltip="true"
            >
            </el-table-column>
            <el-table-column prop="inspectProject" label="检测项目">
            <!-- <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="user_name" label="检测人"> </el-table-column> -->
            <el-table-column prop="name" label="操作">
              <template v-slot="scope">
                <el-button
                  @click="handleClick(scope.$index, tableData, scope.row)"
                  @click="handleClick(scope.row)"
                  type="text"
                  size="small"
                  >删除</el-button
@@ -455,6 +408,8 @@
      staue_value: "", // ä¸»é¡µè¡¨æ ¼ä¸Šæ–¹çš„状态选择
      // BOM树数据结构
      towTree: [],
      equipment: '',
      equip:'',
      ruleForm: {
        // æ–°å¢žä»ªå™¨è¡¨å•
        code: "",
@@ -465,8 +420,14 @@
        keeper: "",
        name: "",
        rawInsProductId: "",
        type: ""
        type: "",
        treedata:{
            father:'设备组1',
        },
        equr:1,
      },
      delete:{},
      equip:[],
      rules: {
        name: [
          { required: true, message: "请输入仪器设备编号", trigger: "blur" },
@@ -505,6 +466,22 @@
    };
  },
  methods: {
    selectDevice() {//右边数据
      console.log(this.$api.url.selectDevice);
      this.$axios.get(this.$api.url.selectDevice,{
        params:{
          father:this.treedata.father,
          type:this.equip,
        }
      }).then(res =>{
        console.log(res);
        this.tableData = res.data
      }, {
                headers: {
                        "Content-Type": "application/json"
                      }
      })
    },
    // åŠ¨æ€æŽ§åˆ¶å±•å¼€ä¸Žæ”¶èµ·å’Œåˆ‡æ¢å¯¹åº”å›¾æ ‡
    isC() {
      this.isCollapse = !this.isCollapse;
@@ -517,25 +494,27 @@
      }
    },
    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.$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("确认关闭?")
@@ -549,31 +528,52 @@
      this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
        this.keeperList = res.data;
      });
      this.$axios.get(this.$api.url.addDeviceInspectDownBox).then(res => {
        this.inspectionList = res.data;
      });
      this.$axios.get(this.$api.url.addDeviceParentClassification).then(res => {
        this.parentClassificationList = res.data;
      });
      this.listgroup()
    },
    listgroup() {
        this.$axios.get(this.$api.url.listgroup).then(res =>{
            this.equip = res.data
        })
    },
    RadioChange(val){
      console.log(val);
        this.equip = val
        this.twoTreeApi()
    },
    twoTreeApi() {
      this.$axios.get(this.$api.url.towTree).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.$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;
      });
    },
    tableDataApi() {
      this.$axios.get(this.$api.url.tableDeviceList).then(res => {
        this.tableData = res.data;
      });
    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"}})
    },
    // tableDataApi() {
    //   this.$axios.get(this.$api.url.tableDeviceList).then(res => {
    //     this.tableData = res.data;
    //   });
    // },
    reset() {
      this.tableDataApi();
      this.radio1 = "true";
@@ -581,21 +581,9 @@
      this.staue_value = "";
    },
    handleNodeClick(data) {
      if (data.id === undefined) {
        this.$axios
          .get(this.$api.url.tableDeviceList, {
            params: { fatherName: data.name }
          })
          .then(res => {
            this.tableData = res.data;
          });
      } else if (data.id !== undefined) {
        this.$axios
          .get(this.$api.url.tableDeviceList, { params: { deviceId: data.id } })
          .then(res => {
            this.tableData = res.data;
          });
      }
      console.log(data);
        this.treedata = data
        this.selectDevice()
    },
    handlerDeptList() {
      this.towTree = [];
@@ -631,28 +619,37 @@
          });
      }
    },
    handleClick(index, datas, row) {
      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"
            });
          });
      });
    delDeviceById() {
      this.$axios.post(this.$api.url.delDeviceById,{
          id:this.delete.id
      })
    },
    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("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
@@ -728,6 +725,7 @@
    this.twoTreeApi();
    // åˆå§‹åŒ–调用表格数据
    this.tableDataApi();
    this.selectDevice()//右边
  },
  watch: {
    "ruleForm.rawInsProductId": {
@@ -744,17 +742,17 @@
        }
      }
    },
    dialogVisible: {
      handler: function(newVal, oldVal) {
        if (newVal) {
          // æˆåŠŸæ¸…ç©ºè¾“å…¥å†…å®¹
          this.ruleForm = {};
          this.value = "";
          this.showCodeNameModel = {};
          this.$refs.ruleForm.resetFields();
        }
      }
    },
    // dialogVisible: {
    //   handler: function(newVal, oldVal) {
    //     if (newVal) {
    //       // æˆåŠŸæ¸…ç©ºè¾“å…¥å†…å®¹
    //       this.ruleForm = {};
    //       this.value = "";
    //       this.showCodeNameModel = {};
    //       this.$refs.ruleForm.resetFields();
    //     }
    //   }
    // },
    radio1: {
      handler: function(newVal, oldVal) {
        this.towTree = [];
src/components/view/mbom.vue
@@ -29,22 +29,33 @@
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <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-select>
                </el-form-item>
                    <el-form-item label="工序">
                            <template>
                                <el-select v-model="search.work"
                                placeholder="请选择类型"
                                allow-create
                                filterable
                                @change="workevent"
                                >
                                    <el-option
                                    v-for="(item,index) in process"
                                    :key="item.name"
                                    :label="item.name"
                                    :value="item.name">
                                    </el-option>
                                </el-select>
                                </template>
                        </el-form-item>
                </el-col>
                <el-col :span="8">
                    <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-select v-model="search.craft" size="small" placeholder="请选择" style="width: 224px;margin-right: 30px;">
                        <el-option
                            v-for="item in craftapi"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                    </el-select>
                </el-form-item>
                </el-col>
@@ -56,7 +67,7 @@
                <template>
                    <el-table
                    border
                    :data="tableData"
                    :data="tableapi"
                    height="calc(80vh - 250px)"
                    style="width: 100%">
                    <el-table-column type="index" label="序号" width="70">
@@ -66,28 +77,37 @@
                        label="供应商名称"
                        width="180">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.input" placeholder="请输入内容" ></el-input>
                            <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>
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="name"
                        label="质量追溯号"
                        width="180">
                        label="原材料名称">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" ></el-input>
                            <el-input v-model="scope.row.name" placeholder="" ></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="address"
                        label="原材料名称">
                    </el-table-column>
                    <el-table-column
                        prop="address"
                        label="规格型号">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.specifications" placeholder="" ></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="address"
                        prop="unit"
                        label="单位">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.unit" placeholder="" ></el-input>
                        </template>
                    </el-table-column>
                    </el-table>
                </template>
@@ -143,7 +163,7 @@
                    <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, tableData)">删除</span>
                            <span class="table_do" @click="deleteRow(scope.$index, scope.row)">删除</span>
                        </template>
                    </el-table-column>
                </el-table>
@@ -163,22 +183,90 @@
            return {
              search:{},
              list:[],
                process:[],
                process:{},
                // handleClose:[],
                checkTreeNode:[],
                checkTreeNode:{
                    id:2,
                },
                tableData:[],
                search:{},
                tableapi:[{
                    supplier:'',
                    qualityTraceability:'',
                    name:'',
                    specifications:'',
                    unit:'',
                    }],
                search:{
                    type:'',
                    work:'',
                    craft:'',
                },
                addsearch:{},
                upData:{},
                form:{},
                dialogVisible:false,
                typeselect:0,
                tableData: [],
                input:''
                input:'',
                craftapi:[],
            }
        },
        mounted() {
            this.selectAllleft()
            this.selectAllleft()
            this.selectAllMbom()
        },
        methods:{
             workevent(val){
                console.log(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"
                      }
            })
            },
            addMbom(data) {
                this.$axios.post(this.$api.url.addMbom,data
                // {
                    // name:this.tableapi.name,
                    // qualityTraceability:this.tableapi.qualityTraceability,
                    // specifications:this.tableapi.specifications,
                    // supplier:this.tableapi.supplier,
                    // techTemId:this.craftapi.id,
                    // unit:this.tableapi.unit,
                // }
                , {
                    headers: {
                        "Content-Type": "application/json"
                      }
                }).then(res =>{
                    console.log(res);
                    this.$message.success('添加完成')
                    this.selectAllMbom()
                    this.tableapi = [{}]
                })
            },
            //删除
            material(index) {
                console.log(this.upData.id);
                this.$axios.post(this.$api.url.material,{
                    id:this.upData.id
                }).then(res =>{
                    this.$message.success(res.message)
                    this.tableData.splice(index,1)
                    // console.log(res);
                })
            },
            TYpe(val) {
                this.typeselect = val
                this.selectAllleft()
@@ -189,6 +277,7 @@
                params:{type:this.typeselect}
            }).then(res => {
                this.list = res.data;
                console.log(this.list);
            }, {
                headers: {
                        "Content-Type": "application/json"
@@ -201,6 +290,7 @@
                params:{id:this.checkTreeNode.id}
            }).then(res => {
                this.tableData = res.data;
                console.log(this.tableData);
            }, {
                headers: {
                        "Content-Type": "application/json"
@@ -221,19 +311,25 @@
            },
            event(){
                this.dialogVisible = true
                this.chooseTechFath()
            },
             Addrow() {
            if (this.tableData == undefined) {
                this.tableData = new Array();
            if (this.tableapi == undefined) {
                this.tableapi = new Array();
            }
            let obj = [];
            
            this.tableData.push(obj);
            this.tableapi.push(obj);
            },
            skipshow(){
                console.log('666');
                const data = this.tableData.at(-1)
                console.log(data);
                let data = this.tableapi.at(-1)
                // this.addMbom()
                data.techTemId = this.search.craft
                // console.log(this.search.craft);
                // console.log(data);
                this.addMbom(data)
                
                this.dialogVisible = false
            },
@@ -252,7 +348,11 @@
                this.selects = val;
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
                console.log(rows);
                // this.tableData.splice(index,1)
                this.upData.id = rows.id
                console.log(this.upData);
                this.material(index)
            },
        }
src/components/view/record-content.vue
@@ -142,7 +142,7 @@
                    @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" @node-collapse="nodeClose" :filter-node-method="filterNode"
                    :key="upIndex">
                    <div class="custom-tree-node" slot-scope="{ node, data }">
                        <span><i :class="`node_i ${data.code != '[3]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                        <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>
@@ -161,12 +161,12 @@
                    </el-table-column>
                    <el-table-column prop="unit" label="单位">
                    </el-table-column>
                    <el-table-column prop="thing" label="备注">
                    <el-table-column prop="note" 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, tableData)">删除</span>
                            <span class="table_do" @click="deleteRow(scope.$index, scope.row)">删除</span>
                        </template>
                    </el-table-column>
                </el-table>
@@ -174,6 +174,52 @@
        </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="请选择类型" 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">
                        <template>
                        <el-select v-model="edit.techFather"
                        placeholder="请选择类型"
                        @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" 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;">
                    <el-col :span="4" style="font-size: 14px;text-align: right;">名称:</el-col>
                    <el-col :span="16" :offset="1">
@@ -189,7 +235,7 @@
                <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.thing" size="small" clearable></el-input>
                        <el-input v-model="upData.note" size="small" clearable></el-input>
                    </el-col>
                </el-row>
            </div>
@@ -204,53 +250,53 @@
                <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 v-model="form.type" placeholder="请选择类型" style="width: 480px;">
                            <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-select v-model="form.work"
                        @change="workevent"
                        placeholder="请选择类型" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            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="工艺名称">
                    <template>
                        <el-select v-model="value" placeholder="请选择类型" style="width: 480px;">
                        <el-select v-model="form.craft" placeholder="请选择类型" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            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="记录">
                    <el-input v-model="form.name"></el-input>
                    <el-input v-model="form.record"></el-input>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="form.vvvv"></el-input>
                    <el-input v-model="form.remarks"></el-input>
                </el-form-item>
                <el-form-item label="单位">
                    <el-input v-model="form.aaaa"></el-input>
                    <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="dialogVisible = false">ç¡® å®š</el-button>
                <el-button type="primary" @click="add">ç¡® å®š</el-button>
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
@@ -296,13 +342,13 @@
                        </template>
                </el-form-item>
                <el-form-item label="记录">
                    <el-input v-model="form.name"></el-input>
                    <el-input v-model="form.record"></el-input>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="form.vvvv"></el-input>
                    <el-input v-model="form.remarks"></el-input>
                </el-form-item>
                <el-form-item label="单位">
                    <el-input v-model="form.aaaa"></el-input>
                    <el-input v-model="form.unit"></el-input>
                </el-form-item>
                </el-form>
            </div>
@@ -325,18 +371,39 @@
                },
                options:[],
                value:{},
                form:{},
                craftapi:[],
                form:{
                    type:'',
                    work:'',
                    craft:'',
                    name:'',
                    record:'',
                    remarks:'',
                    unit:'',
                },
                modifyVisible:false,
                dialogVisible:false,
                process: [],
                process: {},
                list: [],
                checkTreeNode: {},
                tableData: [],
                upIndex: 0,
                selects: [],
                delete:[],
                typeselect:0,
                upDia: false,
                checkTreeNode:[],
                checkTreeNode:{
                    id:2,
                },
                upData:{},
                edit:{
                    name:'',
                    note:'',
                    techFather:'',
                    techName:'',
                    type:'',
                    unit:'',
                },
                upData: {
                    id: 0,
                    name: null,
@@ -347,8 +414,62 @@
        },
        mounted() {
            this.selectAllleft()
            this.selectjilu()
        },
        methods: {
            delQueById() {
                this.$axios.get(this.$api.url.delQueById,)
            },
            childrenClick() {},
            //新增
            workevent(val){
                console.log(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"
                      }
            })
            },
            addRecord() {
                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"
                      }
                }
                )
            },
            add() {
                this.dialogVisible = false
                this.addRecord()
                this.selectjilu()
                this.form = {};
            },
            //编辑    this.upData
            selecRecord() {
                this.$axios.get(this.$api.url.selecRecord,{
                    params:{
                        id:this.upData.id
                    }
                }).then(res => {
                    this.edit = res.data[0]
                    // console.log(this.edit);
                })
            },
            TYpe(val) {
                this.typeselect = val
                console.log(this.typeselect);
@@ -361,6 +482,7 @@
            }).then(res => {
                this.list = res.data;
                console.log(this.list);
                this.selectDataList()
            })
            },
            //selectjilu  checkTreeNode
@@ -377,6 +499,7 @@
            },
            addend(){
                this.dialogVisible = true
                this.chooseTechFath()
            },
            filterNode(value, data) {
              if (!value) return true;
@@ -433,13 +556,38 @@
                        }
                    }
                })
                let cc = this.selects.map(el => {
                    return el.id
                })
                this.delete = cc.join(',')
                console.log(this.delete);
                this.delAllRecord()
                this.$message.success('删除完成')
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            //批量删除
            delAllRecord() {
                this.$axios.post(this.$api.url.delAllRecord,{
                        ids:this.delete
                })
            },
            //删除
            delQueById() {
                this.$axios.post(this.$api.url.delQueById,{
                        id:this.upData.id
                })
            },
            deleteRow(index, rows) {
                this.tableData.splice(index,1)
                this.upData.id = rows.id
                this.delQueById()
            },
            upContent(ob) {
                this.upData = this.HaveJson(ob)
                this.upData = ob
                console.log(this.upData);
                this.selecRecord()
                this.chooseTechFath()
                this.upDia = true
            },
            submitUpData() {
src/components/view/routinginspection.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,307 @@
<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 {
        margin-bottom: 10px;
        padding: 0 20px;
    }
    .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 * {
        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;
    }
    .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;
    }
    .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;
    }
    .node_i {
        color: orange;
    }
    .el-icon-delete {
        display: none;
        color: #004EA2;
    }
    .custom-tree-node:hover .el-icon-delete {
        display: inline;
    }
    .thing .right {
        width: calc(100% - 305px);
        height: calc(100% - 25px);
        overflow: hidden;
        padding: 10px;
    }
    .table_do {
        color: #004ea0;
        cursor: pointer;
    }
</style>
<style>
    .record_content .title .el-button * {
        font-size: 14px;
    }
    .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 .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="event">新增</el-button>
                    <el-button icon="el-icon-edit-outline"  >修改</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="请选择" 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 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="(val)=>$refs.tree.filter(val)"></el-input>
                <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
                    @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" @node-collapse="nodeClose" :filter-node-method="filterNode"
                    :key="upIndex">
                    <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" 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="unit" label="单位" width="150">
                    </el-table-column>
                    <el-table-column prop="num" label="数量" width="300">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.num" size="medium" placeholder="请输入单位" clearable @change="(val)=>submitUpData(scope.row.id, val)"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" width="100">
                        <template slot-scope="scope">
                            <span class="table_do" @click="deleteRow(scope.$index, tableData)">删除</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                search: {
                    type: 0,
                    name: null
                },
                process: [],
                product: [],
                list: [{
                    id: 0,
                    name: "工艺",
                    children: [{
                        id: 5,
                        name: "工序"
                    }]
                }, {
                    id: 1,
                    name: "成品"
                }, {
                    id: 2,
                    name: "半成品"
                }],
                checkTreeNode: {},
                tableData: [{
                    id: 1,
                    name: "原材料名称",
                    unit: "单位",
                    num: "数量"
                }, {
                    id: 2,
                    name: "作业人员",
                    unit: "dajskda",
                    num: "12348"
                }, {
                    id: 3,
                    name: "规格",
                    unit: "dajskda",
                    num: "12348"
                }, {
                    id: 4,
                    name: "规格",
                    unit: "dajskda",
                    num: "12348"
                }, {
                    id: 5,
                    name: "规格",
                    unit: "dajskda",
                    num: "12348"
                }],
                upIndex: 0,
                selects: [],
                upData: {
                    id: 0,
                    num: null
                }
            }
        },
        mounted() {
            this.selectDataList()
        },
        methods: {
            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++
            },
            handleNodeClick(data) {
                this.checkTreeNode = data
                if (data.code == '[2]') {
                    console.log(data);
                }
            },
            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--
                        }
                    }
                })
                this.$message.success('删除完成')
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            },
            submitUpData(id,val) {
                this.tableData.forEach(a => {
                    if (a.id == id) {
                        a.num = val
                    }
                })
                this.$message.success('修改成功')
                this.upIndex++
            }
        }
    }
</script>
src/components/view/self-inspection.vue
@@ -113,7 +113,7 @@
                <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-edit-outline"  @click="modify">修改</el-button> -->
                    <el-button icon="el-icon-delete" @click="dels">删除</el-button>
                </el-col>
            </el-row>
@@ -126,8 +126,8 @@
                <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;">
            <!-- <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>
            <span>项目:</span>
@@ -136,7 +136,7 @@
            </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>
                    è¯¢</span></el-button> -->
        </div>
        <div class="thing">
            <div class="left">
@@ -170,14 +170,15 @@
                    </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, tableData)">删除</span>
                            <!-- <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">
        <!-- <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>
@@ -194,13 +195,13 @@
                <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.stand" size="small" clearable></el-input>
                        <el-input v-model="upData.required" 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.ask" size="small" clearable></el-input>
                        <el-input v-model="upData.internal" size="small" clearable></el-input>
                    </el-col>
                </el-row>
            </div>
@@ -208,31 +209,31 @@
                <el-button type="primary" @click="submitUpData">ç¡® å®š</el-button>
                <el-button @click="upDia = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
        </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="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 v-model="form.value" placeholder="请选择类型" style="width: 480px;">
                            <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-select v-model="form.procedure"
                        @change="workevent"
                        placeholder="请选择类型" style="width: 480px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            v-for="item in process"
                            :key="item.name"
                            :label="item.name"
                            :value="item.name">
                            </el-option>
                        </el-select>
                        </template>
@@ -241,48 +242,48 @@
                <el-col :span="10">
                <el-form-item label="工艺名称">
                    <template>
                        <el-select v-model="value" placeholder="请选择类型"  style="width: 180px;">
                        <el-select v-model="form.name" placeholder="请选择类型"  style="width: 180px;">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            v-for="item in craftapi"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                        </el-select>
                        </template>
                </el-form-item>
            </el-col>
                <el-col :span="10" :offset="3">
                <el-form-item label="自建项目">
                    <el-input v-model="form.name" style="width: 180px;"></el-input>
                <el-form-item label="自检项目">
                    <el-input v-model="form.project" style="width: 180px;"></el-input>
                </el-form-item>
            </el-col>
            </el-row>
            <el-row>
                <el-col :span="10">
                <el-form-item label="单位">
                    <el-input v-model="form.vvvv" style="width: 180px;"></el-input>
                    <el-input v-model="form.unit" style="width: 180px;"></el-input>
                </el-form-item>
                </el-col>
                <el-col :span="10" :offset="3">
                <el-form-item label="标准值">
                    <el-input v-model="form.aaaa" style="width: 180px;"></el-input>
                    <el-input v-model="form.standard" style="width: 180px;"></el-input>
                </el-form-item>
                </el-col>
            </el-row>
            <el-form-item label="内控值" >
                    <el-input v-model="form.aaaa" style="width: 180px;"></el-input>
                    <el-input v-model="form.control" style="width: 180px;"></el-input>
                </el-form-item>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="dialogVisible = false">ç¡® å®š</el-button>
                <el-button type="primary" @click="add">ç¡® å®š</el-button>
                <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
        <!-- ä¿®æ”¹å¼¹çª— -->
        <el-dialog title="工艺路线修改" :visible.sync="modifyVisible" width="35%">
        <!-- <el-dialog title="工艺路线修改" :visible.sync="modifyVisible" width="35%">
            <div>
                <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="类型">
@@ -351,7 +352,7 @@
                <el-button type="primary" @click="modifyVisible = false">ç¡® å®š</el-button>
                <el-button @click="modifyVisible = false">取 æ¶ˆ</el-button>
            </span>
        </el-dialog>
        </el-dialog> -->
    </div>
</template>
@@ -366,19 +367,31 @@
                },
                options:[],
                value:{},
                form:{},
                form:{
                    value:'',
                    procedure:'',
                    name:'',
                    project:'',
                    unit:'',
                    standard:'',
                    control:'',
                },
                modifyVisible:false,
                dialogVisible:false,
                process: [],
                product: [],
                list: [],
                checkTreeNode: {},
                checkTreeNode: {
                    id:2,
                },
                tableData: [],
                upIndex: 0,
                selects: [],
                upDia: false,
                upDia: [],
                typeselect:0,
                checkTreeNode:[],
                process:[],
                craftapi:[],
                delete:{},
                upData: {
                    id: 0,
                    name: null,
@@ -390,8 +403,71 @@
        },
        mounted() {
            this.selectAllleft()
            this.selectAllSelf()
        },
        methods: {
            //删除
            delSelfcheck() {
                console.log(this.upData.id);
                this.$axios.post(this.$api.url.delSelfcheck,{
                    id:this.upData.id
                }
                )
            },
            deleteRow(index, row) {
                this.tableData.splice(index,1)
                this.upData.id = row.id
                this.delSelfcheck()
            },
            //批量删除
            delAll() {
                this.$axios.post(this.$api.url.delAll,{
                    ids:this.delete
                })
            },
            //新增
            add() {
                this.dialogVisible = false
                this.addSelfcheck()
            },
            addSelfcheck() {
                this.$axios.post(this.$api.url.addSelfcheck,{
                    internal:this.form.control,
                    name:this.form.project,
                    required:this.form.standard,
                    techTemId:this.form.name,
                    unit:this.form.unit,
                }, {
                    headers: {
                        "Content-Type": "application/json"
                      }
                }).then(res=>{
                    this.selectAllSelf()
                    this.form = {}
                })
            },
             //工序工艺
            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"
                      }
            })
            },
             workevent(val){
                console.log(val);
                let idx = this.process.findIndex(el => el.name === val)
                this.craftapi = this.process[idx].children
            },
            TYpe(val) {
                this.typeselect = val
                console.log(this.typeselect);
@@ -420,6 +496,7 @@
            },
            addend(){
                this.dialogVisible = true
                this.chooseTechFath()
            },
            filterNode(value, data) {
              if (!value) return true;
@@ -471,10 +548,13 @@
                        }
                    }
                })
                let cc = this.selects.map(el => {
                    return el.id
                })
                this.delete = cc.join(',')
                console.log(this.delete);
                this.delAll()
                this.$message.success('删除完成')
            },
            deleteRow(index, rows) {
                rows.splice(index, 1);
            },
            upContent(ob) {
                this.upData = this.HaveJson(ob)
src/components/view/standard.vue
@@ -1,117 +1,12 @@
<style scoped>
  .standard {}
  .standard .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;
  }
  .standard .title {
    margin-bottom: 10px;
    padding: 0 20px;
  }
  .standard .title *{
    font-size: 16px;
  }
  .thing {
    width: 100%;
    height: calc(100% - 48px);
    background-color: #fff;
    display: flex;
  }
  .thing .left {
    width: 295px;
    height: calc(100% - 32px);
    border-right: 3px solid rgb(245, 247, 251);
    padding: 16px;
  }
  .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;
  }
  .node_i {
    color: orange;
  }
  .el-icon-delete {
    display: none;
    color: #004EA2;
  }
  .custom-tree-node:hover .el-icon-delete {
    display: inline;
  }
  .thing .right {
    width: calc(100% - 295px);
    height: 100%;
    overflow: hidden;
  }
  .thing .right .choose {
    padding: 21px 24px;
    display: flex;
    align-items: center;
  }
  .thing .right .choose * {
    font-size: 14px;
  }
  .thing .right .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 .right .table{
    margin-right: 24px;
    height: calc(100% - 74px);
  }
</style>
<style>
  .standard .title .el-button * {
    font-size: 14px;
  }
  .standard .title .el-button--default{
    color: #004EA2;
  }
  .standard .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
    background: rgba(58, 124, 253, 0.3);
    color: #004EA2;
  }
  .el-tree-node__content {
    height: 30px;
    border-radius: 2px;
  }
</style>
<template>
  <div class="standard">
    <div class="title">
      <el-row>
        <el-col :span="12" style="line-height: 32px;">标准BOM</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;" @click="bomAddModelVisible= true">新增</el-button>
          <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
            @click="bomAddModelVisible = true">新增</el-button>
          <el-button icon="el-icon-plus">新增版本</el-button>
          <el-button icon="el-icon-edit-outline">修改</el-button>
          <el-button icon="el-icon-delete">删除</el-button>
        </el-col>
@@ -120,40 +15,83 @@
    <div class="thing">
      <div class="left">
        <el-input v-model="search" suffix-icon="el-icon-search" placeholder="请输入搜索内容" size="small" clearable></el-input>
        <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
          :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
          @node-collapse="nodeClose">
        <el-tree :data="list" ref="tree" :default-expand-all="false" :props="{ children: 'children', label: 'name' }"
          node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
          <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.code}}{{ data.name }}</span>
            <span><i :class="`node_i ${data.code != '[4]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
              {{ 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">
        <div class="choose">
          <span>类型:</span>
          <el-select v-model="tableType" size="small" placeholder="请选择" style="width: 224px;margin-right: 52px;">
            <el-option :value="0" label="工艺文件"></el-option>
          <el-select v-model="tableType" size="small" placeholder="请选择" @change="TYPE"
            style="width: 224px;margin-right: 52px;">
            <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-select>
          <span>{{tableType==1?'项目:':'工艺名称:'}}</span>
          <el-input v-model="searchName" size="small" placeholder="请输入" style="width: 224px;margin-right: 24px;" clearable></el-input>
          <el-button size="mini" @click="()=>{searchName='';selectProductTableData()}"><span>重 ç½®</span></el-button>
          <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>查 è¯¢</span></el-button>
          <span>{{ tableType == 1 ? '项目:' : '工艺名称:' }}</span>
          <el-input v-model="searchName" size="small" placeholder="请输入" style="width: 224px;margin-right: 24px;"
            clearable></el-input>
          <span>{{ tableType == 1 ? '版本:' : '工艺名称:' }}</span>
          <el-select v-model="VER" @change="verevent" style="width: 280px;" placeholder="请选择">
            <el-option v-for="item in version" :key="item" :label="item" :value="item">
            </el-option>
          </el-select>
          <el-button size="mini" @click="() => { searchName = ''; selectProductTableData() }"><span>重 ç½®</span></el-button>
          <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>查
              è¯¢</span></el-button>
        </div>
        <div>
          <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="name" border
            @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" label="序号">
            </el-table-column>
            <el-table-column prop="name" label="工序" sortable width="300px">
              <!-- <template slot-scope="scope">
                        <el-tag>
                            <div class="firstDiv" :style="`color: ${scope.row.children? '#16a7ff' : '#58c173'}`">
                            {{ scope.row.children ? "01" : "02" }}
                            </div>
                        </el-tag>
                        <span style="color: black">{{ scope.row.name }}</span>
                        </template> -->
            </el-table-column>
            <el-table-column prop="" sortable label="工艺名称">
            </el-table-column>
            <el-table-column prop="" label="指标名称">
            </el-table-column>
            <el-table-column prop="" label="单位">
            </el-table-column>
            <el-table-column prop="" label="内控值">
            </el-table-column>
            <el-table-column prop="unit" label="标准值">
            </el-table-column>
          </el-table>
        </div>
        <div class="table">
          <technology v-if="tableData.length!==0" :tableType="tableType" :tableData="tableData"></technology>
          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
        </div>
      </div>
    </div>
    <div class="bom-add-model">
      <el-dialog
        title="BOM新增"
        :visible.sync="bomAddModelVisible"
        width="30%">
      <el-dialog title="BOM新增" :visible.sync="bomAddModelVisible" width="30%">
        <el-form>
        </el-form>
@@ -167,111 +105,268 @@
</template>
<script>
  import technology from "./standard-table/technology.vue"
  export default {
    components: {technology},
    data() {
      return {
        // BOM树数据结构
        list: [{
          id: 0,
          name: "原材料",
          code: "[1]",
          children: []
        }, {
          id: 1,
          name: "成品",
          code: "[1]",
          children: []
        }, {
          id: 2,
          name: "半成品",
          code: "[1]",
          children: []
        }],
        search: null,
        // è¡¨æ ¼ç±»åž‹ 1:技术指标,0:工艺路线
        tableType: 1,
        // æŸ¥è¯¢æ¡ä»¶-名称
        searchName: "",
        // ç‚¹å‡»é€‰ä¸­æ ‘节点
        checkTreeNode: {},
        tableData:[],
        // æŽ§åˆ¶bom新增模态框是否显示
        bomAddModelVisible: false
      }
    },
    watch: {
      search(val) {
        this.$refs.tree.filter(val);
      },
      tableType(val){
        this.selectProductTableData()
      }
    },
    mounted() {
      this.selectMaterialTree()
    },
    methods: {
      handleNodeClick(data) {
        this.checkTreeNode = data
        // this.selectMaterialTree()
        this.selectProductTableData()
      },
      filterNode(value, data) {
        if (!value) return true;
        return data.label.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')
      },
      selectMaterialTree() {
        this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
          res.data.forEach(a => {
            this.list.forEach(b => {
              if (a.type == b.id) b.children = [a]
            })
          })
          this.$nextTick().then(() => {
          const firstNode = document.querySelector('.el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node')
          firstNode.click()
          })
        })
import technology from "./standard-table/technology.vue"
export default {
  components: { technology },
  data() {
    return {
      // BOM树数据结构
      list: [],
      search: null,
      tableType: 1, // è¡¨æ ¼ç±»åž‹ 1:技术指标,0:工艺路线
      searchName: "",// æŸ¥è¯¢æ¡ä»¶-名称
      checkTreeNode: {},// ç‚¹å‡»é€‰ä¸­æ ‘节点
      tableData: [],
      bomAddModelVisible: false,// æŽ§åˆ¶bom新增模态框是否显示
      list: [],
      typeselect: {},
      returntree: {},
      version: {},
      VER: {},
      verdata: {},
      character: '',
    }
  },
  // watch: {
  //   search(val) {
  //     this.$refs.tree.filter(val);
  //   },
  //   tableType(val){
  //     this.selectProductTableData()
  //   }
  // },
  mounted() {
    this.selectMaterialTree()
  },
  methods: {
    handleSelectionChange() {
      },
      async selectProductTableData() {
        switch (this.tableType) {
          case 0:
        const {data:technologyList} = await this.$axios.get(this.$api.url.selectTechnologyByMaterial,{params:{specificationId:this.checkTreeNode.id,technologyName:this.searchName}})
        this.tableData = technologyList
            break;
          case 1:
        const {data:productList} = await this.$axios.get(this.$api.url.selectProductByMaterial,{params:{specifications:this.checkTreeNode.id,project:this.searchName}})
        productList.forEach((item,index)=>{
          item.name = item.father
          item.index = index+1
          item.id = item.father
          if(item.children.length===1){
            productList[index] = {...item.children[0],index: index+1,name:item.father}
          }
        })
        this.tableData = productList
            break;
    },
    TYPE(val) {//类型.数据
      console.log(val);
      this.typeselect = val
      console.log(this.typeselect);
      this.selectVersion()
    },
    handleNodeClick(val) {//树的值
      console.log(val);
      this.returntree = val
    },
    selectVersion() {
      this.$axios.get(this.$api.url.selectVersion, {
        params: {
          specificationsId: this.returntree.id,
          type: this.typeselect,
        }
      }).then(res => {
        this.verdata = res.data
        this.version = this.verdata.map(el => {
          return el = `v${el}`
        })
        console.log(this.verdata);
      })
    },
    verevent(val) {
      console.log(val);
      let cc = val.replace('v', '')
      console.log(cc);
      this.character = cc
      this.selectAll()
      // const { v, ...newObj } = val;
      // delete newObj.v
      // console.log(newObj);
    },
    //右侧数据
    selectAll() {
      console.log(this.$axios.get(this.$api.url.selectAll));
      this.$axios.get(this.$api.url.selectAll, {
        params: {
          specificationsId: this.returntree.id,
          type: this.typeselect,
          version: this.character,
        }
      }).then(res => {
        this.tableData = res.data
      })
    },
    //五级树
    selectMaterialTree() {
      this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
        this.list = res.data
        this.list.forEach((el, idx, arr) => {
          if (idx == 0) {
            arr[idx].name = '成品'
          }
          if (idx == 1) {
            arr[idx].name = '半成品'
          }
          el.children.forEach((newEl, newIdx, newArr) => {
            if (newIdx == 0) {
              newArr[newIdx].name = '橡胶连接器'
            }
            if (newIdx == 1) {
              newArr[newIdx].name = '金属连接器'
            }
            if (newIdx == 2) {
              newArr[newIdx].name = '湿插拔电连接器'
            }
            if (newIdx == 3) {
              newArr[newIdx].name = '分支组件'
            }
          })
        })
        console.log(this.list);
      })
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.label.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')
    },
    async selectProductTableData() {
      switch (this.tableType) {
        case 0:
          const { data: technologyList } = await this.$axios.get(this.$api.url.selectTechnologyByMaterial, { params: { specificationId: this.checkTreeNode.id, technologyName: this.searchName } })
          this.tableData = technologyList
          break;
        case 1:
          const { data: productList } = await this.$axios.get(this.$api.url.selectProductByMaterial, { params: { specifications: this.checkTreeNode.id, project: this.searchName } })
          productList.forEach((item, index) => {
            item.name = item.father
            item.index = index + 1
            item.id = item.father
            if (item.children.length === 1) {
              productList[index] = { ...item.children[0], index: index + 1, name: item.father }
            }
          })
          this.tableData = productList
          break;
      }
    }
  }
}
</script>
<style scoped>
.standard {}
.standard .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;
}
.standard .title {
  margin-bottom: 10px;
  padding: 0 20px;
}
.standard .title * {
  font-size: 16px;
}
.thing {
  width: 100%;
  height: calc(100% - 48px);
  background-color: #fff;
  display: flex;
}
.thing .left {
  width: 295px;
  height: calc(100% - 32px);
  border-right: 3px solid rgb(245, 247, 251);
  padding: 16px;
}
.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;
}
.node_i {
  color: orange;
}
.el-icon-delete {
  display: none;
  color: #004EA2;
}
.custom-tree-node:hover .el-icon-delete {
  display: inline;
}
.thing .right {
  width: calc(100% - 295px);
  height: 100%;
  overflow: hidden;
}
.thing .right .choose {
  padding: 21px 24px;
  display: flex;
  align-items: center;
}
.thing .right .choose * {
  font-size: 14px;
}
.thing .right .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 .right .table {
  margin-right: 24px;
  height: calc(100% - 74px);
}
</style>
<style>
.standard .title .el-button * {
  font-size: 14px;
}
.standard .title .el-button--default {
  color: #004EA2;
}
.standard .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
  background: rgba(58, 124, 253, 0.3);
  color: #004EA2;
}
.el-tree-node__content {
  height: 30px;
  border-radius: 2px;
}
</style>
src/components/view/technical.vue
@@ -1,105 +1,3 @@
<style scoped>
  .technical{
    height: 100%;
    width: 100%;
  }
  .technical .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;
  }
  .technical .title {
    margin-bottom: 10px;
    padding: 0 20px;
  }
/* æœç´¢å¤´éƒ¨æ ·å¼ */
.search-header{
  background: #fff;
  padding: 24px 32px;
}
.search-header .el-form-item{
  margin: 0px;
  font-size: 14px;
}
.search-header .el-form-item:nth-child(1){
  margin-right: 48px;
}
.search-header .el-form-item:nth-child(2){
  margin-right: 24px;
}
/* é‡ç½®å’ŒæŸ¥è¯¢ä¸¤ä¸ªæŒ‰é’®æ ·å¼ */
.search-header .el-form-item .el-button{
width: 65px;
height: 32px;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
padding: 0;
font-size: 14px;
}
.search-header .el-form-item .el-button:nth-child(2){
/* Rectangle 77 */
background: rgb(0, 78, 162);
color: #fff;
}
/* è¾“入框的样式 */
.search-header .el-form-item .el-input >>>.el-input__inner{
width: 224px;
height: 32px ;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
}
/* æŠ€æœ¯æ–‡ä»¶è¡¨æ ¼æ ·å¼ */
.technical-table{
  margin-top: 11px;
  height: calc(100% - 140px);
  background: #fff;
  padding: 23px 21px ;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* .technical-table .el-table{
  overflow-y:scroll;
} */
.technical-table .table-box {
  flex: 1;
  overflow-y: scroll;
}
.technical-table .el-pagination{
  margin-top: 23px;
  display: flex;
  justify-content: end;
}
.formtitle{
  display: block;
  margin-bottom: 24px;
  font-size: 16px;
}
.detail-model >>>.el-form-item__label{
  color: rgb(51, 51, 51);
}
.detail-model >>>.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;
}
</style>
<template>
  <div class="technical">
    <div class="title">
@@ -140,65 +38,48 @@
          width="78">
        </el-table-column>
          <el-table-column
            prop="id"
            label="订单号"
            width="124">
            prop="order_number"
            label="订单号">
          </el-table-column>
          <el-table-column
            prop="saleman"
            label="业务员">
          </el-table-column>
          <el-table-column
            prop="proname"
            label="工程名称"
            width="160">
            label="客户名称">
          </el-table-column>
          <el-table-column
            prop="code"
            label="产品编码"
            width="168"
            >
          </el-table-column>
          <el-table-column
            prop="type"
            label="产品大类"
            width="128">
            prop="name"
            label="产品名称">
          </el-table-column>
          <el-table-column
            prop="specifications"
            label="规格型号"
            width="170">
            label="规格型号">
          </el-table-column>
          <el-table-column
            prop="unit"
            label="单位"
            width="100">
            label="单位">
          </el-table-column>
          <el-table-column
            prop="number"
            label="数量"
            width="118"
            >
            label="数量">
          </el-table-column>
          <el-table-column
            prop="username"
            label="下单人"
            width="114">
            prop="下单日期"
            label="下单日期">
          </el-table-column>
          <el-table-column
            prop="createTime"
            label="下单日期"
            width="153"
            >
            prop="交货日期"
            label="交货日期">
          </el-table-column>
          <el-table-column
            prop="deliveryTime"
            label="交货日期"
            width="137">
          </el-table-column>
          <el-table-column
            prop="state"
            prop="type"
            label="状态"
            width="85"
            >
            <template slot-scope="scope">
              {{scope.state==1?'待编制':'已编制'}}
              {{scope.state==0?'待编制':'已编制'}}
            </template>
          </el-table-column>
          <el-table-column
@@ -341,52 +222,7 @@
        id:'',
        date:''
       },
       technicalTable: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市'
          }
       ],
       technicalTable: [],
       showDetail: false,
       selectedRow: {},
       pageParams:{
@@ -407,7 +243,10 @@
        console.log(this.selectedRow)
      },
      async  getTechnicalTableData() {
        const res = await this.$axios.get(this.$api.url.selectAllOrder,{params:{pageSize:(this.pageParams.pageNo-1),countSize:this.pageParams.pageSize,...this.searchData}})
        const res = await this.$axios.get(this.$api.url.selectAllOrder,{
          params:{
            pageSize:(this.pageParams.pageNo-1),
            countSize:this.pageParams.pageSize,...this.searchData}})
        this.technicalTable = res.data.row
        this.pageParams.total = res.data.total
      },
@@ -430,3 +269,104 @@
    },
}
</script>
<style scoped>
  .technical{
    height: 100%;
    width: 100%;
  }
  .technical .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;
  }
  .technical .title {
    margin-bottom: 10px;
    padding: 0 20px;
  }
/* æœç´¢å¤´éƒ¨æ ·å¼ */
.search-header{
  background: #fff;
  padding: 24px 32px;
}
.search-header .el-form-item{
  margin: 0px;
  font-size: 14px;
}
.search-header .el-form-item:nth-child(1){
  margin-right: 48px;
}
.search-header .el-form-item:nth-child(2){
  margin-right: 24px;
}
/* é‡ç½®å’ŒæŸ¥è¯¢ä¸¤ä¸ªæŒ‰é’®æ ·å¼ */
.search-header .el-form-item .el-button{
width: 65px;
height: 32px;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
padding: 0;
font-size: 14px;
}
.search-header .el-form-item .el-button:nth-child(2){
/* Rectangle 77 */
background: rgb(0, 78, 162);
color: #fff;
}
/* è¾“入框的样式 */
.search-header .el-form-item .el-input >>>.el-input__inner{
width: 224px;
height: 32px ;
box-sizing: border-box;
background: rgb(255, 255, 255);
border: 1px solid rgb(217, 217, 217);
border-radius:2px;
}
/* æŠ€æœ¯æ–‡ä»¶è¡¨æ ¼æ ·å¼ */
.technical-table{
  margin-top: 11px;
  height: calc(100% - 140px);
  background: #fff;
  padding: 23px 21px ;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* .technical-table .el-table{
  overflow-y:scroll;
} */
.technical-table .table-box {
  flex: 1;
  overflow-y: scroll;
}
.technical-table .el-pagination{
  margin-top: 23px;
  display: flex;
  justify-content: end;
}
.formtitle{
  display: block;
  margin-bottom: 24px;
  font-size: 16px;
}
.detail-model >>>.el-form-item__label{
  color: rgb(51, 51, 51);
}
.detail-model >>>.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;
}
</style>
src/components/view/technology.vue
@@ -120,7 +120,7 @@
        </div>
        <div class="choose">
            <span>类型:</span>
            <el-select v-model="search.type" size="small" placeholder="请选择" @change="type" style="width: 224px;margin-right: 30px;">
            <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>
@@ -186,7 +186,7 @@
                    <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.type" placeholder="请选择类型" style="width: 310px;">
                        <el-select v-model="edit.type" 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>
@@ -198,7 +198,7 @@
                <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="upData.father"   style="width: 310px;" placeholder="请选择">
                        <el-select v-model="edit.father"   style="width: 310px;" placeholder="请选择">
                            <el-option
                            v-for="item in procedure"
                            :key="item"
@@ -211,10 +211,10 @@
                <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="upData.ele" style="width: 310px;" multiple placeholder="请选择">
                        <el-select v-model="AAA.id" style="width: 310px;" multiple placeholder="请选择">
                            <el-option
                            v-for="item in element"
                            :key="item.index"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
@@ -224,7 +224,7 @@
                <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.name" size="small" clearable></el-input>
                        <el-input v-model="edit.name" size="small" clearable></el-input>
                    </el-col>
                </el-row>
                <el-row style="line-height: 46px;">
@@ -396,22 +396,33 @@
                process: [],
                product: [],
                procedure:[],
                checkTreeNode:'下料',
                checkTreeNode:{
                    name:'下料'
                },
                towTree:[],
                value:"",
                modifyevent:false,
                dialogVisible:false,
                checkTreeNode: {},
                tableData: [],
                upIndex: 0,
                selects: [],
                upDia: false,
                element:[],
                equipment:[0],
                edit:[],
                AAA:[{
                    id:'',
                }],
                edit:{
                    deviceGroup:'',
                    elementId:'',
                    father:'',
                    name:'',
                    type:'',
                    // children:[],
                },
                upData: {
                    name:'',
                    device_group:'',
                    deviceGroup:'',
                    ele:'',
                    father:'',
                    type:'',
@@ -427,10 +438,12 @@
            this.chooseTech()
            this.chooseDevGroup()
            this.chooseElement()
            this.selectAllTechNam()
        },
        methods: {
            type(val){
                this.typeselect = val
                this.upData.type = val
                console.log(this.typeselect);
                this.selectAllTechTem()
            },
@@ -438,8 +451,8 @@
            Neworder() {
                this.dialogVisible = false
                this.addTechTemp()
                this.selectAllTechNam()
                // this.form = '';
            },
            Deleteapi() {
                this.dialogVisible = false
@@ -463,6 +476,8 @@
                }
                ).then(res=>{
                    console.log(res);
                    this.selectAllTechNam()
                    this.form = {}
                })
            },
@@ -509,10 +524,10 @@
                    id:this.upData.id,
                    technologyTemplateDto:{
                        deviceGroup:this.upData.device_group,
                        elementId:this.upData.ele[0],
                        father:this.upData.father,
                        name:this.upData.name,
                        type:this.upData.type
                        elementId:this.edit.elementId,
                        father:this.edit.father,
                        name:this.edit.name,
                        type:this.edit.type
                    }                    
                    // id:this.upData.id,
                }
@@ -520,6 +535,9 @@
                    headers: {
                        "Content-Type": "application/json"
                      }
                }).then(res =>{
                    console.log(res);
                })
            },
            
@@ -608,22 +626,15 @@
                        }
                    }
                })
                // console.log(this.selects);
                let cc = this.selects.map(el => {
                    // console.log(el.id);
                    return el.id
                })
                // console.log(this.delete);
                this.delete = cc.join(',')
                console.log(this.delete);
                this.delAllTech()
                // this.delete =
                // console.log('444');
                this.$message.success('删除完成')
            },
            deleteRow(index, rows) {
                // console.log(rows);
                // rows.splice(index, 1);
                this.tableData.splice(index,1)
                this.upData.id = rows.id
                this.delTechById()
@@ -633,21 +644,26 @@
                    params:{
                    id:this.upData.id,    
                    }                                
                }
                // , {
                //     headers: {
                //         "Content-Type": "application/json"
                  //     }
                // }
                ).then(res =>{
                    this.edit = res.data
                }).then(res =>{
                    this.edit = res.data[0]
                    this.AAA = res.data[0].children
                    console.log(this.edit);
                    console.log(this.AAA);
                    // this.edit.forEach(el => {
                    // // el.children.forEach(ele =>{
                    // //     this.AAA.push(ele)
                    // console.log(el);
                    // })
                    // console.log(this.AAA.id);
                // })
                    // console.log(this.edit);
                })
            },
            //编辑内容
            upContent(ob) {
                this.upData = ob
                this.selecTechById()
                this.selecTechById()
                console.log(this.upData);
                this.upDia = true
            },
src/main.js
@@ -23,7 +23,10 @@
Vue.use(qs);
Vue.use(api);
const javaApi = 'http://localhost:8001/'
// const javaApi = 'http://127.0.0.1:8001/'
const javaApi = 'http://127.0.0.1:8001/'
axios.defaults.baseURL = javaApi
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
src/view/index.vue
@@ -288,7 +288,7 @@
                    {
                        k: 1,
                        v: "技术管理",
                        i: "font icon-shouye",
                        i: "font icon-ic_form_set24px",
                        c: [{
                                k: 1,
                                v: "标准BOM",
@@ -306,7 +306,7 @@
                    {
                        k: 4,
                        v: "生产管理",
                        i: "font icon-shouye",
                        i: "font icon-shengchanguanli",
                        c: [{
                                k: 12,
                                v: "生产订单",
@@ -330,7 +330,7 @@
                    {
                        k: 5,
                        v: "WMS管理",
                        i: "font icon-shouye",
                        i: "font icon-a-Inventorydumprequest",
                        c: [{
                                k: 15,
                                v: "原材料库存",
@@ -372,7 +372,7 @@
                    {
                        k: 2,
                        v: "QMS管理",
                        i: "font icon-shouye",
                        i: "font icon-xunhuan",
                        c: [{
                                k: 3,
                                v: "原材料检验",
@@ -426,7 +426,7 @@
                    {
                        k: 6,
                        v: "核算管理",
                        i: "font icon-shouye",
                        i: "font icon-caiwuhesuanxitong",
                        c: [{
                                k: 21,
                                v: "产量工资",
@@ -444,7 +444,7 @@
                    {
                        k: 7,
                        v: "基础数据",
                        i: "font icon-shouye",
                        i: "font icon-a-ziyuan20",
                        c: [{
                                k: 23,
                                v: "生产记录维护",