Browse Source

HL-6139制品子件报废申请中选择物料后再bom里面加一个搜索物料的功能

hella_online_20240927
yufei_wang 2 months ago
parent
commit
849ac8b15d
  1. 1
      src/components/BasicForm/src/BasicForm.vue
  2. 31
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

1
src/components/BasicForm/src/BasicForm.vue

@ -85,6 +85,7 @@
label: '汇总',
prop: 'CollectionTable'
}]" v-model="tabSheet" @change="tabChange"/>
<slot name="TableFormHead"></slot>
<div class="table" v-if="tableAllSchemas&&tableAllSchemas.tableFormColumns&& fromeWhere != 'countPlan'" v-show="(tabSheet=='TableForm'&&isBusiness && formType == 'create' && fromeWhere != 'countPlan')||(tabSheet=='TableForm'&&isBusiness && formType == 'update' && updateTypeEdiltSubList && fromeWhere != 'countPlan')">
<TableForm
ref="tableFormRef"

31
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -92,7 +92,7 @@
@success="getList"
:tableAllSchemas="ProdcutscrapBomScrap.allSchemas"
:tableFormRules="ProdcutscrapBomScrapRules"
:tableData="detatableDataBom.tableList"
:tableData="bomTableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
@ -105,8 +105,20 @@
:footButttondata="footButttondata"
@footButtonClick="buttonBaseClickBom"
@formSelectChange="formSelectChange"
>
<template #TableFormHead>
<el-form inline>
<!-- @input="row[headerItem.field] = row[headerItem.field].replace(/[^\d\.-]/g, '')" -->
<el-form-item label="物料代码">
<el-input v-model="bomSearchData" clearable placeholder="请输入物料代码"/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="bomSearchClick"><Icon class="mr-5px" icon="ep:search" />{{ t('common.query') }}</el-button>
</el-form-item>
</el-form>
/>
</template>
</BasicForm>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData"
@ -233,6 +245,18 @@ const buttonBaseClickBom = (val) => {
detailBomRef.value.dialogVisible = false
}
}
const bomTableList = ref<any[]>([])
const bomSearchData = ref('')
const bomSearchClick = ()=>{
if(!bomSearchData.value){
bomTableList.value = detatableDataBom.tableList
}else{
let itemCodes = bomSearchData.value.split(',')
console.log('itemCodes',itemCodes)
bomTableList.value = detatableDataBom.tableList.filter(item=>itemCodes.indexOf(item['itemCode'])>-1)
}
}
const banchBomPage = async (fromLocationCode,item) => {
const params = {
location_code:fromLocationCode,
@ -272,6 +296,7 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
detatableDataBom.params.fromLocationCode = row.fromLocationCode
await getDetailListBom()
bomTableList.value = detatableDataBom.tableList
console.log(row.fromLocationCode);
detatableDataBom.tableList.forEach(async (item) => {
console.log(333,item)
@ -330,6 +355,7 @@ const handleDeleteTableBom = (item, index) => {
if (itemIndex > -1) {
detatableDataBom.tableList.splice(itemIndex, 1)
}
bomSearchClick()
}
const tableSelectionDeleteBom = (selection) => {
@ -369,6 +395,7 @@ const tableFormButton = async (val , row) => {
detailQty.value = row.qty
detatableDataBom.params.isRecord = true
await getDetailListBom()
bomTableList.value = detatableDataBom.tableList
//
isShowFooterButtton.value = false
isShowReduceButtonSelection.value = false

Loading…
Cancel
Save