|
|
|
@ -228,6 +228,7 @@ |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button> |
|
|
|
<el-button type="primary" :loading="alternativeLoading" @click="batchSaveComponentModal" style="margin-left: 7px">批量新增</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button> |
|
|
|
<el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
@ -784,68 +785,183 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 批量新增子明细物料模态框 --> |
|
|
|
<el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="batchComponentPartModelFlag" width="1060px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="batchComponentPartData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
<el-input v-model="batchComponentPartData.partNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'物料名称'"> |
|
|
|
<el-input v-model="batchComponentPartData.partDesc" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="queryBatchComponentPartList">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'损耗率%'" style="margin-left: 545px"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" max="100" v-model="batchComponentPartData.shrinkageFactor" style="width: 80px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="400" |
|
|
|
:data="batchComponentPartList" |
|
|
|
ref="batchSaveTable" |
|
|
|
@row-click="batchSaveClickRow" |
|
|
|
@selection-change="selectionSaveComponent" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in componentPartColumnList" :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> |
|
|
|
<!-- 分页插件 --> |
|
|
|
<el-pagination |
|
|
|
@size-change="sizeChangeHandle5" |
|
|
|
@current-change="currentChangeHandle5" |
|
|
|
:current-page="pageIndex5" |
|
|
|
:page-sizes="[20, 50, 100, 200, 500]" |
|
|
|
:page-size="pageSize5" |
|
|
|
:total="totalPage5" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
</el-pagination> |
|
|
|
<el-footer style="height:35px;margin-top:10px;text-align:center"> |
|
|
|
<!-- <!– 批量新增子明细物料模态框 –>--> |
|
|
|
<!-- <el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="batchComponentPartModelFlag" width="1060px">--> |
|
|
|
<!-- <el-form :inline="true" label-position="top" :model="batchComponentPartData">--> |
|
|
|
<!-- <el-form-item :label="'物料编码'">--> |
|
|
|
<!-- <el-input v-model="batchComponentPartData.partNo" clearable style="width: 120px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="'物料名称'">--> |
|
|
|
<!-- <el-input v-model="batchComponentPartData.partDesc" clearable style="width: 120px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="' '">--> |
|
|
|
<!-- <el-button type="primary" @click="queryBatchComponentPartList">查询</el-button>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="'损耗率%'" style="margin-left: 545px">--> |
|
|
|
<!-- <el-input-number :controls="false" :step="0" min="0" max="100" v-model="batchComponentPartData.shrinkageFactor" style="width: 80px"></el-input-number>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-form>--> |
|
|
|
<!-- <el-table--> |
|
|
|
<!-- :height="400"--> |
|
|
|
<!-- :data="batchComponentPartList"--> |
|
|
|
<!-- ref="batchSaveTable"--> |
|
|
|
<!-- @row-click="batchSaveClickRow"--> |
|
|
|
<!-- @selection-change="selectionSaveComponent"--> |
|
|
|
<!-- border--> |
|
|
|
<!-- style="width: 100%;">--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- type="selection"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="50">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- v-for="(item,index) in componentPartColumnList" :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>--> |
|
|
|
<!-- <!– 分页插件 –>--> |
|
|
|
<!-- <el-pagination--> |
|
|
|
<!-- @size-change="sizeChangeHandle5"--> |
|
|
|
<!-- @current-change="currentChangeHandle5"--> |
|
|
|
<!-- :current-page="pageIndex5"--> |
|
|
|
<!-- :page-sizes="[20, 50, 100, 200, 500]"--> |
|
|
|
<!-- :page-size="pageSize5"--> |
|
|
|
<!-- :total="totalPage5"--> |
|
|
|
<!-- layout="total, sizes, prev, pager, next, jumper">--> |
|
|
|
<!-- </el-pagination>--> |
|
|
|
<!-- <el-footer style="height:35px;margin-top:10px;text-align:center">--> |
|
|
|
<!-- <el-button type="primary" @click="batchComponentDataSave">保存</el-button>--> |
|
|
|
<!-- <el-button type="primary" @click="batchComponentPartModelFlag = false">关闭</el-button>--> |
|
|
|
<!-- </el-footer>--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 默认库位-> 快速新增 --> |
|
|
|
<el-dialog title="新增" :close-on-click-modal="false" v-drag :visible.sync="batchComponentPartModelFlag" width="1170px"> |
|
|
|
<div style="font-size: 12px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="batchComponentPartData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
<el-input v-model="batchComponentPartData.partNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'物料名称'"> |
|
|
|
<el-input v-model="batchComponentPartData.partDesc" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="queryBatchComponentPartList">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'损耗率%'" style="margin-left: 725px"> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" max="100" v-model="batchComponentPartData.shrinkageFactor" style="width: 80px"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<el-container> |
|
|
|
<el-main style="width: 770px; padding: 1px"> |
|
|
|
<span style="font-size: 12px" >可选物料</span> |
|
|
|
<el-table |
|
|
|
height="400px" |
|
|
|
:data="batchComponentPartList" |
|
|
|
border |
|
|
|
ref="batchSaveTable" |
|
|
|
@row-click="batchSaveClickRow" |
|
|
|
@selection-change="selectionSaveComponent" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in componentPartColumnList" :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> |
|
|
|
<!-- 分页插件 --> |
|
|
|
<el-pagination |
|
|
|
@size-change="sizeChangeHandle5" |
|
|
|
@current-change="currentChangeHandle5" |
|
|
|
:current-page="pageIndex5" |
|
|
|
:page-sizes="[20, 50, 100, 200, 500]" |
|
|
|
:page-size="pageSize5" |
|
|
|
:total="totalPage5" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
</el-pagination> |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 111px;padding: -1px"> |
|
|
|
<div style="margin-top: 182px;margin-left: 5px"> |
|
|
|
<el-button type="primary" @click="batchAddPart">添加>></el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 15px;margin-left: 5px"> |
|
|
|
<el-button type="primary" @click="batchDeletePart">删除<<</el-button> |
|
|
|
</div> |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 400px;padding: 1px"> |
|
|
|
<span style="font-size: 12px" >已选物料</span> |
|
|
|
<el-table |
|
|
|
height="400px" |
|
|
|
:data="choosePartList" |
|
|
|
border |
|
|
|
ref="batchSaveTable2" |
|
|
|
@row-click="batchSaveClickRow2" |
|
|
|
@selection-change="selectionSaveComponent2" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="物料编码"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partDesc" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="190" |
|
|
|
label="物料名称"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-main> |
|
|
|
</el-container> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="batchComponentDataSave">保存</el-button> |
|
|
|
<el-button type="primary" @click="batchComponentPartModelFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload> |
|
|
|
|
|
|
|
<!-- chooseList模态框 --> |
|
|
|
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> |
|
|
|
</div> |
|
|
|
@ -882,10 +998,12 @@ import { |
|
|
|
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import ChooseList from '@/views/modules/common/Chooselist_eam' |
|
|
|
import BomComponentUpload from "./bom_component_upload.vue"; |
|
|
|
|
|
|
|
export default { |
|
|
|
// 组件 |
|
|
|
components: { |
|
|
|
BomComponentUpload, |
|
|
|
ChooseList |
|
|
|
}, |
|
|
|
// 监听 |
|
|
|
@ -1152,6 +1270,7 @@ export default { |
|
|
|
checkedDetail: [], |
|
|
|
checkedByProduct: [], |
|
|
|
operationList: [], |
|
|
|
choosePartList: [], |
|
|
|
// ======== 列表表头 ======== |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
@ -1452,7 +1571,7 @@ export default { |
|
|
|
{ |
|
|
|
columnProp: 'partNo', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '物料编码', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -1907,6 +2026,7 @@ export default { |
|
|
|
// ======== 复选数据集 ======== |
|
|
|
bomSelections: [], |
|
|
|
batchComponentSelections: [], |
|
|
|
batchComponentSelections2: [], |
|
|
|
// ======== 模态框开关控制 ======== |
|
|
|
authSearch: false, |
|
|
|
authSave: false, |
|
|
|
@ -2156,6 +2276,16 @@ export default { |
|
|
|
this.batchComponentSelections = val |
|
|
|
}, |
|
|
|
|
|
|
|
// 点击行选中复选框 |
|
|
|
batchSaveClickRow2 (row) { |
|
|
|
this.$refs.batchSaveTable2.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
|
|
|
|
// 复选子物料信息 |
|
|
|
selectionSaveComponent2 (val) { |
|
|
|
this.batchComponentSelections2 = val |
|
|
|
}, |
|
|
|
|
|
|
|
// ======== 新增/编辑模态框 ======== |
|
|
|
/** |
|
|
|
* bom新增模态框 |
|
|
|
@ -2398,6 +2528,10 @@ export default { |
|
|
|
|
|
|
|
// 批量新增子物料模态框 |
|
|
|
batchSaveComponentModal () { |
|
|
|
this.pageSize5 = 20 |
|
|
|
this.pageIndex5 = 1 |
|
|
|
this.batchComponentPartData.partNo = '' |
|
|
|
this.batchComponentPartData.partDesc = '' |
|
|
|
this.batchComponentPartData.limit = this.pageSize5 |
|
|
|
this.batchComponentPartData.page = this.pageIndex5 |
|
|
|
this.batchComponentPartData.site = this.modalData.site |
|
|
|
@ -2414,6 +2548,25 @@ export default { |
|
|
|
this.batchComponentPartList = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
this.batchComponentPartData.shrinkageFactor = 0 |
|
|
|
this.choosePartList = [] |
|
|
|
}, |
|
|
|
|
|
|
|
// 子物料批量导入 |
|
|
|
bomComponentUpload () { |
|
|
|
let currentData = { |
|
|
|
site: this.detailData.site, |
|
|
|
buNo: this.detailData.buNo, |
|
|
|
partNo: this.detailData.partNo, |
|
|
|
engChgLevel: this.detailData.engChgLevel, |
|
|
|
bomType: this.detailData.bomType, |
|
|
|
alternativeNo: this.detailData.alternativeNo, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
//打开组件 去做新增业务 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.BomComponentUpload.init(currentData) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -2837,7 +2990,7 @@ export default { |
|
|
|
this.componentPartData.limit = this.pageSize3 |
|
|
|
this.componentPartData.page = this.pageIndex3 |
|
|
|
// 查询所有物料 |
|
|
|
queryPartList(this.componentPartData).then(({data}) => { |
|
|
|
queryPartListAll(this.componentPartData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.componentPartList = data.page.list |
|
|
|
this.pageIndex3 = data.page.currPage |
|
|
|
@ -2856,7 +3009,7 @@ export default { |
|
|
|
this.batchComponentPartData.limit = this.pageSize5 |
|
|
|
this.batchComponentPartData.page = this.pageIndex5 |
|
|
|
// 查询所有物料 |
|
|
|
queryPartList(this.batchComponentPartData).then(({data}) => { |
|
|
|
queryPartListAll(this.batchComponentPartData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.batchComponentPartList = data.page.list |
|
|
|
this.pageIndex5 = data.page.currPage |
|
|
|
@ -3018,13 +3171,13 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 子物料 |
|
|
|
* @param row |
|
|
|
*/ |
|
|
|
componentClickRow (row) { |
|
|
|
this.$refs.componentTable.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
// /** |
|
|
|
// * 子物料 |
|
|
|
// * @param row |
|
|
|
// */ |
|
|
|
// componentClickRow (row) { |
|
|
|
// this.$refs.componentTable.toggleRowSelection(row) |
|
|
|
// }, |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增子明细方法 |
|
|
|
@ -3121,7 +3274,7 @@ export default { |
|
|
|
|
|
|
|
// 批量新增子件 |
|
|
|
batchComponentDataSave () { |
|
|
|
this.$confirm("是否确认添加该"+ this.batchComponentSelections.length +"条子件记录?", "提示", { |
|
|
|
this.$confirm("是否确认添加该"+ this.choosePartList.length +"条子件记录?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
@ -3147,7 +3300,7 @@ export default { |
|
|
|
lineSequence: '', |
|
|
|
issueType: 'Reserve And Backflush', |
|
|
|
productFlag: 'component', |
|
|
|
batchSaveList: this.batchComponentSelections |
|
|
|
batchSaveList: this.choosePartList |
|
|
|
} |
|
|
|
batchSaveBomComponent(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -3177,6 +3330,33 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
batchAddPart () { |
|
|
|
if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) { |
|
|
|
this.$message.warning('请选择可选物料!') |
|
|
|
return |
|
|
|
} |
|
|
|
// 创建一个 Set 来存储已选择的元素 |
|
|
|
const chosenSet = new Set(this.choosePartList.map(item => `${item.site}-${item.partNo}`)) |
|
|
|
// 检查是否有重复元素 |
|
|
|
const hasDuplicates = this.batchComponentSelections.some(item => chosenSet.has(`${item.site}-${item.partNo}`)) |
|
|
|
if (hasDuplicates) { |
|
|
|
this.$message.warning('所选物料中包含已存在的物料,请重新选择!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.choosePartList = [...this.choosePartList, ...this.batchComponentSelections] |
|
|
|
}, |
|
|
|
|
|
|
|
batchDeletePart () { |
|
|
|
if (this.batchComponentSelections2 == null || this.batchComponentSelections2.length === 0) { |
|
|
|
this.$message.warning('请选择已选物料!') |
|
|
|
return |
|
|
|
} |
|
|
|
// 创建一个 Set 来存储 batchComponentSelections 中的键值对 |
|
|
|
const set = new Set(this.batchComponentSelections2.map(item => `${item.site}-${item.partNo}`)) |
|
|
|
// 过滤 choosePartList,移除与 batchComponentSelections 匹配的元素 |
|
|
|
this.choosePartList = this.choosePartList.filter(item => !set.has(`${item.site}-${item.partNo}`)) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 回车事件 |
|
|
|
*/ |
|
|
|
|