| | |
| | | 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 = { |
| | |
| | | |
| | | // 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",// 新增仪器设备:保管人下拉框 |
| | |
| | | </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> |
| | |
| | | </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 |
| | |
| | | </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> |
| | |
| | | <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" |
| | |
| | | }` |
| | | " |
| | | ></i> |
| | | {{ 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="仪器设备名称" 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" |
| | | > |
| | |
| | | :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 |
| | |
| | | staue_value: "", // 主页表格上方的状态选择 |
| | | // BOM树数据结构 |
| | | towTree: [], |
| | | equipment: '', |
| | | equip:'', |
| | | ruleForm: { |
| | | // 新增仪器表单 |
| | | code: "", |
| | |
| | | keeper: "", |
| | | name: "", |
| | | rawInsProductId: "", |
| | | type: "" |
| | | type: "", |
| | | treedata:{ |
| | | father:'设备组1', |
| | | }, |
| | | equr:1, |
| | | }, |
| | | delete:{}, |
| | | equip:[], |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: "请输入仪器设备编号", trigger: "blur" }, |
| | |
| | | }; |
| | | }, |
| | | 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; |
| | |
| | | } |
| | | }, |
| | | 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("确认关闭?") |
| | |
| | | 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"; |
| | |
| | | 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 = []; |
| | |
| | | }); |
| | | } |
| | | }, |
| | | 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("此操作将永久删除该设备, 是否继续?", "提示", { |
| | |
| | | this.twoTreeApi(); |
| | | // 初始化调用表格数据 |
| | | this.tableDataApi(); |
| | | this.selectDevice()//右边 |
| | | }, |
| | | watch: { |
| | | "ruleForm.rawInsProductId": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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 = []; |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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> |
| | | |
| | |
| | | |
| | | <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"> |
| | |
| | | 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 |
| | |
| | | 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:{ |
| | |
| | | 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 |
| | | }, |
| | |
| | | }, |
| | | } |
| | | </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> |
| | | |
| | |
| | | Vue.use(api); |
| | | |
| | | // const javaApi = 'http://127.0.0.1:8001/' |
| | | const javaApi = 'http://192.168.218.251:8001/' |
| | | const javaApi = 'http://192.168.218.249:8001/' |
| | | |
| | | |
| | | |