|
|
@ -3,14 +3,28 @@
|
|
|
|
v-if="showFlag"
|
|
|
|
v-if="showFlag"
|
|
|
|
:visible.sync="showFlag"
|
|
|
|
:visible.sync="showFlag"
|
|
|
|
:modal= false
|
|
|
|
:modal= false
|
|
|
|
width="1100px"
|
|
|
|
width="1000px"
|
|
|
|
center
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
<!--分类数据-->
|
|
|
|
|
|
|
|
<!-- <el-col :span="4" :xs="24">
|
|
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
|
|
<el-tree
|
|
|
|
|
|
|
|
:data="treeData"
|
|
|
|
|
|
|
|
node-key="id"
|
|
|
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
|
|
|
ref="tree"
|
|
|
|
|
|
|
|
default-expand-all
|
|
|
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-col> -->
|
|
|
|
|
|
|
|
|
|
|
|
<!--BOM数据-->
|
|
|
|
<!--BOM数据-->
|
|
|
|
<el-col :span="24" :xs="24">
|
|
|
|
<el-col :span="24" :xs="24">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
|
|
|
|
<el-form-item label="BOM物料编码" prop="itemCode" style="width:350px">
|
|
|
|
<el-form-item label="BOM物料编码" prop="itemCode">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.itemCode"
|
|
|
|
v-model="queryParams.itemCode"
|
|
|
|
placeholder="请输入BOM物料编码"
|
|
|
|
placeholder="请输入BOM物料编码"
|
|
|
@ -19,7 +33,7 @@
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="BOM物料名称" prop="itemName" style="width:350px">
|
|
|
|
<el-form-item label="BOM物料名称" prop="itemName">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.itemName"
|
|
|
|
v-model="queryParams.itemName"
|
|
|
|
placeholder="请输入BOM物料名称"
|
|
|
|
placeholder="请输入BOM物料名称"
|
|
|
@ -33,7 +47,7 @@
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable">
|
|
|
|
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
|
|
|
|
<el-table-column width="50" align="center" type="selection">
|
|
|
|
<el-table-column width="50" align="center" type="selection">
|
|
|
|
<!-- <template v-slot="scope">
|
|
|
|
<!-- <template v-slot="scope">
|
|
|
|
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
|
|
|
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
|
|
@ -41,9 +55,9 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<!-- 序号 -->
|
|
|
|
<!-- 序号 -->
|
|
|
|
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
|
|
|
|
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
|
|
|
|
<el-table-column label="BOM物料编码" align="center" key="itemCode" prop="materialCode" v-if="columns[0].visible" >
|
|
|
|
<el-table-column label="BOM物料编码" align="center" key="itemCode" prop="bomCode" v-if="columns[0].visible" >
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="BOM物料名称" align="left" key="itemName" prop="materialDesc" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
|
<el-table-column label="BOM物料名称" align="left" key="itemName" prop="bomName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
<pagination
|
|
|
@ -56,9 +70,9 @@
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitBomForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="submitBomForm">确 定</el-button>
|
|
|
|
<el-button @click="showFlag=false">取 消</el-button>
|
|
|
|
<el-button @click="showFlag=false">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
@ -69,6 +83,27 @@ export default {
|
|
|
|
// components: { Treeselect },
|
|
|
|
// components: { Treeselect },
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
// treeData: [{
|
|
|
|
|
|
|
|
// id: '1',
|
|
|
|
|
|
|
|
// label: 'BOM物料类别',
|
|
|
|
|
|
|
|
// children: [{
|
|
|
|
|
|
|
|
// id: 'equ_type_lg',
|
|
|
|
|
|
|
|
// label: '料罐'
|
|
|
|
|
|
|
|
// }, {
|
|
|
|
|
|
|
|
// id: 'equ_type_cxj',
|
|
|
|
|
|
|
|
// label: '成型机'
|
|
|
|
|
|
|
|
// }, {
|
|
|
|
|
|
|
|
// id: 'equ_type_hf',
|
|
|
|
|
|
|
|
// label: '烘房'
|
|
|
|
|
|
|
|
// }, {
|
|
|
|
|
|
|
|
// id: 'equ_type_spj',
|
|
|
|
|
|
|
|
// label: '收坯机'
|
|
|
|
|
|
|
|
// }, {
|
|
|
|
|
|
|
|
// id: 'equ_type_bzx',
|
|
|
|
|
|
|
|
// label: '包装线'
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
// }],
|
|
|
|
showFlag:false,
|
|
|
|
showFlag:false,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
|
selectedItemId: undefined,
|
|
|
|
selectedItemId: undefined,
|
|
|
@ -86,7 +121,7 @@ export default {
|
|
|
|
// 树选项
|
|
|
|
// 树选项
|
|
|
|
itemTypeOptions: undefined,
|
|
|
|
itemTypeOptions: undefined,
|
|
|
|
//树名称
|
|
|
|
//树名称
|
|
|
|
materialCode: undefined,
|
|
|
|
bomCode: undefined,
|
|
|
|
defaultProps: {
|
|
|
|
defaultProps: {
|
|
|
|
id: "id",
|
|
|
|
id: "id",
|
|
|
|
label: "label"
|
|
|
|
label: "label"
|
|
|
@ -96,7 +131,7 @@ export default {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
itemName: undefined,
|
|
|
|
itemName: undefined,
|
|
|
|
materialCode: undefined,
|
|
|
|
bomCode: undefined,
|
|
|
|
itemTypeId: 0,
|
|
|
|
itemTypeId: 0,
|
|
|
|
itemCodeGet: '',
|
|
|
|
itemCodeGet: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -165,8 +200,8 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
// 节点单击事件
|
|
|
|
handleNodeClick(data) {
|
|
|
|
handleNodeClick(data) {
|
|
|
|
this.queryParams.materialCode = data.id;
|
|
|
|
this.queryParams.bomCode = data.id;
|
|
|
|
console.log(this.materialCode);
|
|
|
|
console.log(this.bomCode);
|
|
|
|
this.handleQuery();
|
|
|
|
this.handleQuery();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -198,7 +233,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
handleBomSelectionChange(selection) {
|
|
|
|
handleBomSelectionChange(selection) {
|
|
|
|
this.ids = selection.map(item => item.materialCode);
|
|
|
|
this.ids = selection.map(item => item.bomCode);
|
|
|
|
this.single = selection.length!==1;
|
|
|
|
this.single = selection.length!==1;
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
console.log("多选框",this.ids);
|
|
|
|
console.log("多选框",this.ids);
|
|
|
@ -229,13 +264,13 @@ export default {
|
|
|
|
submitBomForm() {
|
|
|
|
submitBomForm() {
|
|
|
|
const data = this.ids;
|
|
|
|
const data = this.ids;
|
|
|
|
console.log("数据",data);
|
|
|
|
console.log("数据",data);
|
|
|
|
const equipmentCode = data.toString();
|
|
|
|
const bomCode = data.toString();
|
|
|
|
console.log("拆分数据",materialCode);
|
|
|
|
console.log("拆分数据",bomCode);
|
|
|
|
console.log("原来的数据",this.queryParams.itemCodeGet);
|
|
|
|
console.log("原来的数据",this.queryParams.itemCodeGet);
|
|
|
|
if(this.queryParams.itemCodeGet == ""){
|
|
|
|
if(this.queryParams.itemCodeGet == ""){
|
|
|
|
this.queryParams.itemCodeGet = materialCode;
|
|
|
|
this.queryParams.itemCodeGet = bomCode;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ materialCode;
|
|
|
|
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ bomCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.selectedRows = this.queryParams.itemCodeGet;
|
|
|
|
this.selectedRows = this.queryParams.itemCodeGet;
|
|
|
|
this.$emit('onSelected', this.selectedRows);
|
|
|
|
this.$emit('onSelected', this.selectedRows);
|
|
|
|