|
|
@ -121,6 +121,40 @@ |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 更改BOM数量 --> |
|
|
|
<BasicForm |
|
|
|
ref="detailChangeBomRef" |
|
|
|
@success="getList" |
|
|
|
:tableAllSchemas="ChangeBomQty.allSchemas" |
|
|
|
:tableFormRules="ChangeBomQtyRules" |
|
|
|
:tableData="changeBomTableList" |
|
|
|
:isBusiness="true" |
|
|
|
:isShowButton="false" |
|
|
|
:isShowReduceButton="false" |
|
|
|
:isShowFooterButtton="true" |
|
|
|
:isShowReduceButtonSelection="false" |
|
|
|
@handleDeleteTable="handleDeleteTableBom" |
|
|
|
@tableSelectionDelete="tableSelectionDeleteBom" |
|
|
|
@searchTableSuccess="searchTableBomSuccess" |
|
|
|
:footButttondata="footButttondata" |
|
|
|
@footButtonClick="buttonBaseClickChangeBom" |
|
|
|
@formSelectChange="formSelectChange"> |
|
|
|
<template #TableFormHead> |
|
|
|
<el-form inline> |
|
|
|
<el-form-item label="父物料代码"> |
|
|
|
<el-input v-model="ChangeBomSearchData.parentItemCode" @input="ChangeBomSearchData.parentItemCode = ChangeBomSearchData.parentItemCode.replace(/,/g, ',')" clearable placeholder="请输入物料代码"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="子物料代码"> |
|
|
|
<el-input v-model="ChangeBomSearchData.childItemCode" @input="ChangeBomSearchData.childItemCode = ChangeBomSearchData.childItemCode.replace(/,/g, ',')" clearable placeholder="请输入物料代码"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="info" plain @click="changeBomSearchClick"><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" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
@ -134,7 +168,9 @@ import { ProductscrapRequestMain, |
|
|
|
ProductscrapRequestDetail, |
|
|
|
ProductscrapRequestDetailRules, |
|
|
|
ProdcutscrapBomScrap, |
|
|
|
ProdcutscrapBomScrapRules } from './productscrapRequestMain.data' |
|
|
|
ProdcutscrapBomScrapRules, |
|
|
|
ChangeBomQty, |
|
|
|
ChangeBomQtyRules } from './productscrapRequestMain.data' |
|
|
|
import * as ProductscrapRequestMainApi from '@/api/wms/productscrapRequestMain' |
|
|
|
import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDetail' |
|
|
|
import * as StdcostpriceApi from '@/api/wms/stdcostprice' |
|
|
@ -260,6 +296,8 @@ const bomSearchClick = ()=>{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const banchBomPage = async (fromLocationCode,item) => { |
|
|
|
const params = { |
|
|
|
location_code:fromLocationCode, |
|
|
@ -692,9 +730,61 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.masterId) |
|
|
|
}else if (val == 'updateBomQty'){ // 更改BOM数量 |
|
|
|
handleChangeBom(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 修改Bom数量 窗口 |
|
|
|
const changeBomTableList = ref<any[]>([]) |
|
|
|
const detailChangeBomRef =ref() |
|
|
|
const { tableObject: changeBomTableObject, tableMethods: changeBomTableMethods } =useTable({ |
|
|
|
getListApi: BomDismantleApi.getChangeBomQtyPage |
|
|
|
}) |
|
|
|
const { getList:getDetailListChangeBom } = changeBomTableMethods |
|
|
|
const handleChangeBom = async (row)=>{ |
|
|
|
changeBomTableObject.params = { |
|
|
|
number: row.number |
|
|
|
} |
|
|
|
await getDetailListChangeBom() |
|
|
|
changeBomTableList.value = changeBomTableObject.tableList |
|
|
|
detailChangeBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 |
|
|
|
} |
|
|
|
// 查询 |
|
|
|
const ChangeBomSearchData = ref({ |
|
|
|
parentItemCode:'', // 父物料代码 |
|
|
|
childItemCode:'' // 子物料代码 |
|
|
|
}) |
|
|
|
const changeBomSearchClick = ()=>{ |
|
|
|
ChangeBomSearchData.value.parentItemCode = ChangeBomSearchData.value.parentItemCode.trim() |
|
|
|
ChangeBomSearchData.value.childItemCode = ChangeBomSearchData.value.childItemCode.trim() |
|
|
|
let parentItemCodeList = ChangeBomSearchData.value.parentItemCode?ChangeBomSearchData.value.parentItemCode.split(','):[] |
|
|
|
let childItemCodeList = ChangeBomSearchData.value.childItemCode?ChangeBomSearchData.value.childItemCode.split(','):[] |
|
|
|
console.log('parentItemCodeList',parentItemCodeList) |
|
|
|
console.log('childItemCodeList',childItemCodeList) |
|
|
|
changeBomTableList.value = changeBomTableObject.tableList.filter(item=>{ |
|
|
|
console.log(parentItemCodeList.includes(item.parentItemCode)) |
|
|
|
console.log(childItemCodeList.includes(item.childItemCode)) |
|
|
|
if((parentItemCodeList.includes(item.parentItemCode)||parentItemCodeList.length==0)&&(childItemCodeList.includes(item.childItemCode)||childItemCodeList.length==0)){ |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// bom 列表 表单 按钮 |
|
|
|
const buttonBaseClickChangeBom = (val) => { |
|
|
|
// 保存 |
|
|
|
if (val == 'save') { |
|
|
|
ProductscrapRequestMainApi.updateChangeBomRequest(changeBomTableList.value) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
detailChangeBomRef.value.dialogVisible = false |
|
|
|
} |
|
|
|
// 关闭 |
|
|
|
else if (val == 'close') { |
|
|
|
detailChangeBomRef.value.dialogVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClose = async (id: number) => { |
|
|
|
try{ |
|
|
|