Browse Source

制品子件报废申请-更改bom数量功能

hella_online_20241226
王宇飞 3 months ago
parent
commit
985e5ceb4e
  1. 4
      src/api/wms/bomDismantle/index.ts
  2. 6
      src/api/wms/productscrapRequestMain/index.ts
  3. 92
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue
  4. 94
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

4
src/api/wms/bomDismantle/index.ts

@ -41,6 +41,10 @@ export const getProductscrapBomRecordPageBatch = async (params1) => {
}
}
export const getChangeBomQtyPage = async (params) => {
return await request.get({ url: `/wms/productscrap-request-main/pageBom`, params })
}
// 查询制品报废申请子列表
export const getProductscrapBomDismantleRecordPage = async (params) => {
return await request.get({ url: `/wms/productscrap-record-main/bomPage`, params })

6
src/api/wms/productscrapRequestMain/index.ts

@ -103,6 +103,12 @@ export const updateProductscrapDetailRequestBom = async (id, data) => {
return await request.post({ url: `/wms/productscrap-request-main/updateBom?id=`+id, data })
}
// 修改制品报废BOM数据
export const updateChangeBomRequest = async (data) => {
return await request.post({ url: `/wms/productscrap-request-main/updateBomQty`, data })
}
// 编辑
export const editReturnNew = async (params) => {
return await request.get({ url: `/wms/productscrap-request-main/editReturnNew`, params })

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

@ -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{

94
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

@ -1689,3 +1689,97 @@ export const ProdcutscrapBomScrap = useCrudSchemas(reactive<CrudSchema[]>([
export const ProdcutscrapBomScrapRules = reactive({
})
/**
* @returns {Array} bom
*/
export const ChangeBomQty = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '行标记',
// field: 'rowId',
// isTableForm: false,
// isForm: false,
// tableForm:{
// disabled: true
// },
// table: {
// show: false
// }
// },
{
label: '父物料代码',
field: 'parentItemCode',
tableForm:{
disabled: true
}
},
{
label: '父物料数量',
field: 'parentQty',
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '子物料代码',
field: 'childItemCode',
tableForm:{
disabled: true
}
},
{
label: 'Bom数量',
field: 'bomQty',
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '子物料数量',
field: 'qty',
tableForm: {
disabled: false,
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: 'Bom版本',
field: 'bomVersion',
tableForm:{
disabled: true
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true,
// isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择批次',
searchField: 'batch',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
}
}
]))
//表单校验
export const ChangeBomQtyRules = reactive({
qty:[
{ validator:validateQty, message: '数量必须大于0', trigger: 'change'}
],
})

Loading…
Cancel
Save