| | |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="工艺"> |
| | | <template> |
| | | <el-select v-model="form.name" placeholder="请选择" allow-create filterable> |
| | | <el-select v-model="form.name" placeholder="请选择" @change="craftrow" allow-create filterable> |
| | | <el-option v-for="item in craftapi" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | modifyevent:false, |
| | | dialogVisible:false, |
| | | tableData: [], |
| | | crafval:'', |
| | | typeselect:0, |
| | | upData:{}, |
| | | upDia:false, |
| | |
| | | })[0] |
| | | console.log(one); |
| | | let name = one.children[0].id |
| | | this.checkTreeNode.id = name |
| | | console.log(name); |
| | | this.selectAllrightStart(name) |
| | | this.selectDataList(); |
| | |
| | | console.log(this.tableData); |
| | | }); |
| | | }, |
| | | craftrow(val){ |
| | | this.crafval = val |
| | | this.chooseProFath() |
| | | }, |
| | | //上级 |
| | | chooseProFath() { |
| | | console.log(this.checkTreeNode.id); |
| | | this.$axios.get(this.$api.url.chooseProFath, { |
| | | params: { |
| | | techTemId: this.checkTreeNode.id |
| | | techTemId:this.crafval |
| | | } |
| | | }).then(res => { |
| | | this.higherlevel = res.data; |
| | |
| | | <!-- 新增弹窗 --> |
| | | <div> |
| | | <el-dialog |
| | | title="技术指标新增" |
| | | title="生产工艺新增" |
| | | :visible.sync="dialogVisible" |
| | | width="40%"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="工艺名称"> |
| | | <template> |
| | | <el-select v-model="form.craft" placeholder="请选择" > |
| | | <el-select v-model="form.craft" @change="carftapi" placeholder="请选择" > |
| | | <el-option |
| | | v-for="item in craftapi" |
| | | :key="item.id" |
| | |
| | | tableData: [], |
| | | higherlevel:{}, |
| | | quota:{}, |
| | | carftrow:"", |
| | | unitrow:'', |
| | | } |
| | | |
| | |
| | | // //新增 |
| | | choosePro() {//项目 |
| | | this.$axios.get(this.$api.url.choosePro,{ |
| | | params:{techTemId:this.checkTreeNode.id} |
| | | params:{techTemId:this.carftrow} |
| | | }).then(res => { |
| | | this.project = res.data; |
| | | console.log(this.process); |
| | | }, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | carftapi(val) { |
| | | console.log(val); |
| | | this.carftrow = val |
| | | this.chooseDeiv() |
| | | this.choosePro() |
| | | }, |
| | | chooseDeiv() {//设备 |
| | | this.$axios.get(this.$api.url.chooseDeiv,{ |
| | | params:{techTemId:this.checkTreeNode.id} |
| | | params:{techTemId:this.carftrow} |
| | | }).then(res => { |
| | | this.higherlevel = res.data; |
| | | console.log(this.process); |
| | | }, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | //新增 |
| | | edittype(val) { |
| | |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // 默认选中节点第一个 |
| | | }) |
| | | let one=this.list.filter(item=>{ |
| | | return item.children.length>0 |
| | | })[0] |
| | | console.log(one); |
| | | let name=one.children[0].id |
| | | console.log(name); |
| | | this.checkTreeNode.id = name |
| | | this.selectAllTequeStart(name) |
| | | this.selectDataList(); |
| | | }) |
| | | }, |
| | | |
| | | selectAllTequeStart(name) { |
| | | this.$axios.get(this.$api.url.selectAllTeque,{ |
| | | params:{id:this.checkTreeNode.id} |
| | | }).then(res => { |
| | | this.tableData = res.data; |
| | | console.log(this.tableData); |
| | | this.formatData(res.data) |
| | | }) |
| | | }, |
| | | //主体右 |
| | | selectAllTeque() { |
| | | this.$axios.get(this.$api.url.selectAllTeque,{ |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 新增弹窗 --> |
| | | <el-dialog title="生产记录新增" :visible.sync="dialogVisible" width="35%"> |
| | | <el-dialog title="生产记录新增" :visible.sync="dialogVisible" ref="ruleForm" width="35%"> |
| | | <div> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-form-item label="类型"> |
| | | <template> |
| | | <el-select v-model="form.type" @change="edittype" placeholder="请选择" style="width: 480px;"> |
| | | <el-select v-model="form.type" :rules="Rules" |
| | | @change="edittype" 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-form> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="add">确 定</el-button> |
| | | <el-button type="primary" @click="add(form)">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | record:'', |
| | | remarks:'', |
| | | unit:'', |
| | | }, |
| | | Rules:{ |
| | | type:{required:true,message:'类型不能为空',trigger:'change'}, |
| | | work:{required:true,message:'工序不能为空',trigger:'change'}, |
| | | name:{required:true,message:'工艺不能为空',trigger:'change'}, |
| | | record:{required:true,message:'记录不能为空',trigger:'blur'}, |
| | | unit:{required:true,message:'单位不能为空',trigger:'blur'}, |
| | | }, |
| | | modifyVisible:false, |
| | | dialogVisible:false, |
| | |
| | | }) |
| | | }, |
| | | add() { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | alert('submit!'); |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | this.dialogVisible = false |
| | | this.addRecord() |
| | | this.form = {}; |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | query() { |
| | | this.selectAllleft() |
| | | }, |
| | |
| | | : 'el-icon-tickets' |
| | | }`" |
| | | ></i> |
| | | {{data.code}}{{ data.name }}</span |
| | | {{ data.father }}</span |
| | | > |
| | | <!-- <el-button type="text" size="mini" @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="工艺名称"> </el-table-column> |
| | | <el-table-column prop="device_group" label="设备组"> |
| | | </el-table-column> |
| | | <el-table-column label="元件"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="info" style="margin-right: 10px;" v-for="(a, index) in JSON.parse(scope.row.element)" :key="index">{{ a }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="130"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="元件"> |
| | | <template> |
| | | <el-select |
| | | <el-input v-model="form.elementId" placeholder="请输入元件名称" style="width: 200px"></el-input> |
| | | <!-- <el-select |
| | | v-model="form.elementId" |
| | | multiple |
| | | placeholder="请选择" |
| | |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-select> --> |
| | | </template> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | type: "", |
| | | }, |
| | | upIndex: 0, |
| | | treeList:[] |
| | | treeList:[], |
| | | elerow:{}, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.selectAllTechTem(); |
| | | this.chooseTech(); |
| | | this.chooseDevGroup(); |
| | | this.chooseElement(); |
| | | |
| | | this.selectAllTechNam(); |
| | | console.log(this.treeList); |
| | | |
| | | }, |
| | | methods: { |
| | | selectDataList() { |
| | |
| | | this.form = {}; |
| | | }, |
| | | addTechTemp() { |
| | | // console.log(this.$api.url.addTechTemp); |
| | | console.log(this.form.elementId.split(',')); |
| | | |
| | | this.$axios |
| | | .post( |
| | | this.$api.url.addTechTemp, |
| | | |
| | | { |
| | | deviceGroup: this.form.deviceGroup, |
| | | elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""), |
| | | // elementId: JSON.stringify(this.form.elementId).replace("[","").replace("]",""), |
| | | // element:this.form.elementId.split(','), |
| | | element:JSON.stringify(this.form.elementId.split(',')), |
| | | father: this.form.father, |
| | | name: this.form.name, |
| | | type: this.form.type, |
| | |
| | | }, |
| | | |
| | | //元件 |
| | | chooseElement() { |
| | | this.$axios.get(this.$api.url.chooseElement).then((res) => { |
| | | this.element = res.data; |
| | | console.log(this.element); |
| | | }); |
| | | }, |
| | | // chooseElement() { |
| | | // this.$axios.get(this.$api.url.chooseElement).then((res) => { |
| | | // this.element = res.data; |
| | | // console.log(this.element); |
| | | // }); |
| | | // }, |
| | | //设备 |
| | | chooseDevGroup() { |
| | | this.$axios.get(this.$api.url.chooseDevGroup).then((res) => { |
| | |
| | | this.towTree = res.data; |
| | | console.log(this.towTree); |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.towTree[0].children[0].name) // 默认选中节点第一个 |
| | | this.$refs.tree.setCurrentKey(this.towTree[0].father) // 默认选中节点第一个 |
| | | }) |
| | | let one=this.towTree.filter(item=>{ |
| | | return item.children.length>0 |
| | | })[0] |
| | | let name=one.children[0].name |
| | | this.checkTreeNode.name=name |
| | | this.selectAllTechNamStart(name) |
| | | this.selectDataList(); |
| | | // let one=this.towTree.filter(item=>{ |
| | | // return item.children.length>0 |
| | | // })[0] |
| | | // let name=one.children[0].name |
| | | // this.checkTreeNode.name=name |
| | | // this.selectAllTechNamStart(name) |
| | | // this.selectDataList(); |
| | | let one=this.towTree[0] |
| | | let name =one.father |
| | | this.checkTreeNode.father = name |
| | | console.log(name); |
| | | this.selectAllTechNamStart(name) |
| | | }); |
| | | }, |
| | | handleNodeClick(data, node) { |
| | | console.log(data); |
| | | this.checkTreeNode = data; |
| | | this.treetrunk = node; |
| | | console.log(this.treetrunk); |
| | | console.log(this.checkTreeNode); |
| | | // this.treetrunk = node; |
| | | // console.log(this.treetrunk); |
| | | // console.log(this.checkTreeNode); |
| | | this.selectAllTechNam(); |
| | | |
| | | }, |
| | | selectAllTechNam() { |
| | | this.$axios |
| | | .get(this.$api.url.selectAllTechNam, { |
| | | params: { father: this.checkTreeNode.name }, |
| | | params: { father: this.checkTreeNode.father }, |
| | | }) |
| | | .then((res) => { |
| | | this.tableData = res.data; |
| | | |
| | | let kk =this.tableData.map(el =>{ |
| | | console.log(el); |
| | | return el.element |
| | | })[0] |
| | | // console.log(kk.replace('[','').replace(']','') ); |
| | | // console.log(kk.split(',')); |
| | | this.elerow = kk |
| | | |
| | | }); |
| | | }, |
| | | selectAllTechNamStart(name) { |
| | |
| | | }, |
| | | addend() { |
| | | this.dialogVisible = true; |
| | | this.chooseTech(); |
| | | this.chooseDevGroup(); |
| | | // this.chooseElement(); |
| | | }, |
| | | modify() { |
| | | this.modifyevent = true; |