Browse Source

2025/6/23

java8
Aoi_Tori 7 months ago
parent
commit
d7eb75dab7
  1. 23
      src/views/modules/part/part_create.vue
  2. 326
      src/views/modules/part/quicklyCreateBom.vue

23
src/views/modules/part/part_create.vue

@ -2221,6 +2221,7 @@ export default {
duration: 1500, duration: 1500,
onClose: () => {} onClose: () => {}
}) })
this.saveQuicklyCreate()
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -2254,8 +2255,6 @@ export default {
this.saveLoading = false this.saveLoading = false
}) })
} }
EventBus.$emit('refreshInquiryOneDetail1')
EventBus.$emit('refreshInquiryOneDetail2')
}, },
// //
@ -3226,6 +3225,26 @@ export default {
this.modalData.templateName = val.template_name this.modalData.templateName = val.template_name
} }
}, },
saveQuicklyCreate(){
let inData = {
id: this.initData.id,
testPartId: this.initData.testPartId,
testPartDesc: this.initData.partDesc,
partBomStatus: this.initData.partBomStatus,
updateBy: this.$store.state.user.name,
}
updateInquiryDetailStatusAndPart(inData).then(({data}) => {
if (data && data.code === 0) {
EventBus.$emit('refreshInquiryOneDetail1')
EventBus.$emit('refreshInquiryOneDetail2')
} else {
this.$alert('自动完成失败,请手动点击完成键', '错误', {
confirmButtonText: '确定'
})
}
})
}
} }
} }
</script> </script>

326
src/views/modules/part/quicklyCreateBom.vue

@ -20,13 +20,45 @@
<el-button type="info" @click="updateInquiryDetailStatus()">完成</el-button> <el-button type="info" @click="updateInquiryDetailStatus()">完成</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table
:height="70"
:data="dataList.slice(0,1)"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="120"-->
<!-- label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>-->
<!-- <el-link style="cursor: pointer" @click="checkOutToRouting(scope.row.partNo)">切换Routing</el-link>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row :gutter="5"> <el-row :gutter="5">
<!-- 树形结构 --> <!-- 树形结构 -->
<el-col :span="7" :style="{height: this.height + 'px'}" style="display: block;overflow-y: scroll"> <el-col :span="7" :style="{height: this.height + 'px'}" style="display: block;overflow-y: scroll">
<el-card style="width: 99%"> <el-card style="width: 99%">
<div slot="header" style="height: 20px;margin-top: -10px;text-align: center"> <div slot="header" style="height: 20px;margin-top: -10px;text-align: center">
<!-- <el-button type="primary" style="margin-left: -5px" @click="addTree">添加</el-button>-->
<el-button size="mini" type="primary" round style="margin-left: -5px" @click="addTree">新增节点</el-button>
<el-button size="mini" type="info" round @click="getNodeTree">刷新</el-button> <el-button size="mini" type="info" round @click="getNodeTree">刷新</el-button>
<el-button size="mini" type="primary" round :loading="buildAllLoading" @click="batchBuild" style="margin-left: 10px">批量Build</el-button> <el-button size="mini" type="primary" round :loading="buildAllLoading" @click="batchBuild" style="margin-left: 10px">批量Build</el-button>
<!-- <el-button size="mini" type="primary" round :loading="resetAllLoading" @click="resetNodePart">重置物料</el-button>--> <!-- <el-button size="mini" type="primary" round :loading="resetAllLoading" @click="resetNodePart">重置物料</el-button>-->
@ -91,6 +123,35 @@
<el-form-item label="节点名称" prop="nodeName" :rules="nodeRules.nodeName"> <el-form-item label="节点名称" prop="nodeName" :rules="nodeRules.nodeName">
<el-input v-model="nodeData.nodeName" style="width: 230px"></el-input> <el-input v-model="nodeData.nodeName" style="width: 230px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="父节点" prop="pId" :rules="nodeRules.parentNodeName">
<el-popover
ref="nodeListPopover"
placement="bottom-start"
v-model="treeVisible"
onclick="treeVisible=true"
trigger="click">
<el-tree
id="my-tree"
node-key="nodeId"
class="tree-view structure-tree scroll-bar"
highlight-current
check-strictly
@current-change="nodeListTreeCurrentChangeHandle"
:data="treeData1"
:default-expand-all=true
:props="defaultProps"
:expand-on-click-node=false
:auto-expand-parent=false>
</el-tree>
</el-popover>
<el-input style="width: 140px;" v-model="nodeData.parentNodeName" v-popover:nodeListPopover :readonly="true" class="node-list__input"></el-input>
</el-form-item>
<el-form-item label="子节点" :rules="nodeRules.id">
<el-select v-model="nodeData.id" style="width: 100%;">
<el-option :label="item.nodeName" :value="item.id" v-for="item in childrenNodeList" :key="item.id"></el-option>
<el-option label="无" value="-1"></el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveNodeData()">保存</el-button> <el-button type="primary" @click="saveNodeData()">保存</el-button>
@ -178,6 +239,7 @@ import RoutingCreate from "./routing_create.vue";
import PartCreate from "./part_create.vue"; import PartCreate from "./part_create.vue";
import {updateInquiryDetailStatusAndPart} from "../../../api/inquiry/inquiryDetail"; import {updateInquiryDetailStatusAndPart} from "../../../api/inquiry/inquiryDetail";
import {EventBus} from "../../../main"; import {EventBus} from "../../../main";
import {getPartItem} from "../../../api/part/partInformation";
export default { export default {
components: { components: {
PartCreate, PartCreate,
@ -191,12 +253,38 @@ export default {
handler: function (newV, oldV) { handler: function (newV, oldV) {
this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase() this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase()
} }
},
'nodeData.pId': {
deep: true,
handler: function (newV, oldV) {
if (!newV || newV.trim().length === 0) {
this.childrenNodeList = [];
return;
}
const findNodeById = (nodes, targetId) => {
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (node.id === targetId) {
return node;
}
if (node.nodeList && node.nodeList.length > 0) {
const result = findNodeById(node.nodeList, targetId);
if (result) return result;
}
}
return null;
};
const foundNode = findNodeById(this.treeData1, newV);
this.childrenNodeList = foundNode ? foundNode.nodeList : [];
}
} }
}, },
data () { data () {
return { return {
activeTable: 'bom_info', activeTable: 'bom_info',
treeData: [], treeData: [],
treeData1: [],
childrenNodeList: [],
defaultProps: { defaultProps: {
children: "nodeList", children: "nodeList",
label: "nodeName", label: "nodeName",
@ -220,7 +308,8 @@ export default {
site: '', site: '',
buNo: '', buNo: '',
partNo: '', partNo: '',
partDesc: ''
partDesc: '',
codeNo: '',
}, },
nodeData: { nodeData: {
flag: '', flag: '',
@ -229,8 +318,10 @@ export default {
nodeName: '', nodeName: '',
id: '', id: '',
pId: '', pId: '',
parentNodeName: '',
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
mainPart: '',
}, },
partData: { partData: {
flag: '', flag: '',
@ -255,8 +346,148 @@ export default {
trigger: ['blur','change'] trigger: ['blur','change']
} }
], ],
parentNodeName:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
id:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
]
}, },
dataList: [
{
Family: '',
Orientation: '',
Lanes: '',
WebWidth: '',
PrintingLanes: null,
BodingPitch: null,
BondingLanes: null,
ConvertingUp: null,
}
],
currentNode: {}, currentNode: {},
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'Family',
headerAlign: 'left',
align: 'left',
columnLabel: 'Family',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'Orientation',
headerAlign: 'left',
align: 'left',
columnLabel: 'Orientation',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'Lanes',
headerAlign: 'left',
align: 'left',
columnLabel: 'Lanes',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'WebWidth',
headerAlign: 'left',
align: 'right',
columnLabel: 'Web width',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'PrintingLanes',
headerAlign: 'left',
align: 'right',
columnLabel: 'Printing lanes',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'BodingPitch',
headerAlign: 'left',
align: 'right',
columnLabel: 'Boding Pitch',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'BondingLanes',
headerAlign: 'left',
align: 'right',
columnLabel: 'Bonding lanes',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'ConvertingUp',
headerAlign: 'left',
align: 'right',
columnLabel: 'Converting up',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}
],
partColumnList: [ partColumnList: [
{ {
columnProp: 'partNo', columnProp: 'partNo',
@ -334,7 +565,8 @@ export default {
buildAllLoading: false, buildAllLoading: false,
resetAllLoading: false, resetAllLoading: false,
bomLoading: false, bomLoading: false,
routingLoading: false
routingLoading: false,
treeVisible: false
} }
}, },
created () { created () {
@ -360,7 +592,9 @@ export default {
if (this.$route.query.data) { if (this.$route.query.data) {
this.searchData = this.$route.query.data this.searchData = this.$route.query.data
this.searchData.partDesc = this.$route.query.data.testPartDesc this.searchData.partDesc = this.$route.query.data.testPartDesc
this.searchData.codeNo = this.$route.query.data.partCodeNo
this.getNodeTree(); this.getNodeTree();
this.getPartItem()
} }
}, },
methods: { methods: {
@ -391,7 +625,7 @@ export default {
}) })
}, },
//
//
addTree () { addTree () {
this.nodeData = { this.nodeData = {
flag: '1', flag: '1',
@ -401,25 +635,36 @@ export default {
pId: '0', pId: '0',
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
mainPart: this.searchData.partNo,
}
this.treeData1 = [
{
id: '0',
nodeName: '首节点',
nodeList: []
}
]
if (Array.isArray(this.treeData) && this.treeData.length > 0) {
this.treeData1[0].nodeList = [...this.treeData]
} }
this.nodeModalDisableFlag = false this.nodeModalDisableFlag = false
this.nodeModalFlag = true this.nodeModalFlag = true
}, },
// //
addTreeItem (data) {
this.nodeData = {
flag: '1',
site: this.$store.state.user.site,
nodeId: '',
nodeName: '',
pId: data.id,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
}
this.nodeModalDisableFlag = false
this.nodeModalFlag = true
},
// addTreeItem (data) {
// this.nodeData = {
// flag: '1',
// site: this.$store.state.user.site,
// nodeId: '',
// nodeName: '',
// pId: data.id,
// createBy: this.$store.state.user.name,
// updateBy: this.$store.state.user.name,
// }
// this.nodeModalDisableFlag = false
// this.nodeModalFlag = true
// },
// //
editTreeItem (data) { editTreeItem (data) {
@ -929,11 +1174,58 @@ export default {
this.authDelete = !deleteFlag this.authDelete = !deleteFlag
}, },
nodeListTreeCurrentChangeHandle (data, node) {
this.nodeData.pId = data.id
this.nodeData.parentNodeName = data.nodeName
this.treeVisible = false
},
getPartItem() {
let tempData = {
site: this.$store.state.user.site,
buNo: this.searchData.buNo,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
recordType: 'IP'
}
getPartItem(tempData).then(({data}) => {
if (data && data.code === 0) {
for (let i = 0; i < data.rows.length; i++) {
if (data.rows[i].itemDesc === 'Family1'){
this.dataList[0].Family = data.rows[i].textValue
} else if (data.rows[i].itemDesc === 'Family2'){
this.dataList[0].Orientation = data.rows[i].textValue
} else if (data.rows[i].itemDesc === 'Lanes0 web'){
this.dataList[0].Lanes = data.rows[i].textValue
} else if (data.rows[i].itemDesc === 'Lamination width'){
this.dataList[0].WebWidth = data.rows[i].textValue
} else if (data.rows[i].itemDesc === 'Printing lanes'){
this.dataList[0].PrintingLanes = data.rows[i].numValue
} else if (data.rows[i].itemDesc === 'Bonding Pitch'){
this.dataList[0].BodingPitch = data.rows[i].numValue
} else if (data.rows[i].itemDesc === '绑定列数'){
this.dataList[0].BondingLanes = data.rows[i].numValue
} else if (data.rows[i].itemDesc === 'CL60k-UP'){
this.dataList[0].ConvertingUp = data.rows[i].textValue
}
}
console.log(this.dataList[0])
} else {
this.dataList = []
}
})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ndoe-list__input {
> .el-input__inner {
cursor: pointer;
}
}
.white-body-view { .white-body-view {
width: 100%; width: 100%;
min-width: 320px; min-width: 320px;

Loading…
Cancel
Save