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. 33
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

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

@ -85,6 +85,7 @@
label: '汇总', label: '汇总',
prop: 'CollectionTable' prop: 'CollectionTable'
}]" v-model="tabSheet" @change="tabChange"/> }]" 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')"> <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 <TableForm
ref="tableFormRef" ref="tableFormRef"

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

@ -92,7 +92,7 @@
@success="getList" @success="getList"
:tableAllSchemas="ProdcutscrapBomScrap.allSchemas" :tableAllSchemas="ProdcutscrapBomScrap.allSchemas"
:tableFormRules="ProdcutscrapBomScrapRules" :tableFormRules="ProdcutscrapBomScrapRules"
:tableData="detatableDataBom.tableList" :tableData="bomTableList"
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="false"
:isShowReduceButton="false" :isShowReduceButton="false"
@ -105,8 +105,20 @@
:footButttondata="footButttondata" :footButttondata="footButttondata"
@footButtonClick="buttonBaseClickBom" @footButtonClick="buttonBaseClickBom"
@formSelectChange="formSelectChange" @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" <ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData"
@ -233,6 +245,18 @@ const buttonBaseClickBom = (val) => {
detailBomRef.value.dialogVisible = false 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 banchBomPage = async (fromLocationCode,item) => {
const params = { const params = {
location_code:fromLocationCode, location_code:fromLocationCode,
@ -272,6 +296,7 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
detatableDataBom.params.fromLocationCode = row.fromLocationCode detatableDataBom.params.fromLocationCode = row.fromLocationCode
await getDetailListBom() await getDetailListBom()
bomTableList.value = detatableDataBom.tableList
console.log(row.fromLocationCode); console.log(row.fromLocationCode);
detatableDataBom.tableList.forEach(async (item) => { detatableDataBom.tableList.forEach(async (item) => {
console.log(333,item) console.log(333,item)
@ -330,6 +355,7 @@ const handleDeleteTableBom = (item, index) => {
if (itemIndex > -1) { if (itemIndex > -1) {
detatableDataBom.tableList.splice(itemIndex, 1) detatableDataBom.tableList.splice(itemIndex, 1)
} }
bomSearchClick()
} }
const tableSelectionDeleteBom = (selection) => { const tableSelectionDeleteBom = (selection) => {
@ -369,6 +395,7 @@ const tableFormButton = async (val , row) => {
detailQty.value = row.qty detailQty.value = row.qty
detatableDataBom.params.isRecord = true detatableDataBom.params.isRecord = true
await getDetailListBom() await getDetailListBom()
bomTableList.value = detatableDataBom.tableList
// //
isShowFooterButtton.value = false isShowFooterButtton.value = false
isShowReduceButtonSelection.value = false isShowReduceButtonSelection.value = false

Loading…
Cancel
Save