|
@ -53,6 +53,7 @@ |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
/> |
|
|
/> |
|
@ -70,32 +71,28 @@ |
|
|
:apiDelete="ProductscrapRequestDetailApi.deleteProductscrapRequestDetail" |
|
|
:apiDelete="ProductscrapRequestDetailApi.deleteProductscrapRequestDetail" |
|
|
:Echo="Echo" |
|
|
:Echo="Echo" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
@detailBasicFormOnChange="qtyOnChange" |
|
|
:buttondataTable="buttondataTable" |
|
|
:buttondataTable="buttondataTable" |
|
|
@tableFormButton="tableFormButton" |
|
|
@tableFormButton="tableFormButton" |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- bom列表 --> |
|
|
<!-- BOM弹窗列表 --> |
|
|
<Dialog |
|
|
<BasicForm |
|
|
:title="DialogTitle" |
|
|
ref="detailBomRef" |
|
|
v-model="bomModelVisible" |
|
|
@success="getList" |
|
|
width="80%" |
|
|
:tableAllSchemas="ProdcutscrapBomScrap.allSchemas" |
|
|
:scroll="true" |
|
|
:tableFormRules="ProdcutscrapBomScrapRules" |
|
|
max-height="450px" |
|
|
:tableData="detatableDataBom.tableList" |
|
|
> |
|
|
:isBusiness="true" |
|
|
<TableForm |
|
|
:isShowButton="false" |
|
|
ref="tableFormRef" |
|
|
:isShowReduceButton="false" |
|
|
class="w-[100%]" |
|
|
:isShowFooterButtton="true" |
|
|
:tableFields="ProdcutscrapBomDismantle.allSchemas.tableColumns" |
|
|
:Butttondata="ButttondataBom" |
|
|
:tableData="detatableDataBom.tableList" |
|
|
@searchTableSuccess="searchTableBomSuccess" |
|
|
:isShowButton="false" |
|
|
:footButttondata="footButttondata" |
|
|
:isShowReduceButton="false" |
|
|
@footButtonClick="buttonBaseClickBom" |
|
|
/> |
|
|
/> |
|
|
<template #footer> |
|
|
|
|
|
<ButtonBase :Butttondata="ButttondataBom" @button-base-click="buttonBaseClickBom" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData" |
|
@ -109,9 +106,11 @@ import { ProductscrapRequestMain, |
|
|
ProductscrapRequestMainRules, |
|
|
ProductscrapRequestMainRules, |
|
|
ProductscrapRequestDetail, |
|
|
ProductscrapRequestDetail, |
|
|
ProductscrapRequestDetailRules, |
|
|
ProductscrapRequestDetailRules, |
|
|
ProdcutscrapBomDismantle } from './productscrapRequestMain.data' |
|
|
ProdcutscrapBomScrap, |
|
|
|
|
|
ProdcutscrapBomScrapRules } from './productscrapRequestMain.data' |
|
|
import * as ProductscrapRequestMainApi from '@/api/wms/productscrapRequestMain' |
|
|
import * as ProductscrapRequestMainApi from '@/api/wms/productscrapRequestMain' |
|
|
import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDetail' |
|
|
import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDetail' |
|
|
|
|
|
import * as StdcostpriceApi from '@/api/wms/stdcostprice' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle" |
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle" |
|
|
|
|
|
|
|
@ -139,12 +138,18 @@ const buttondataTable = ref([{ |
|
|
}]) |
|
|
}]) |
|
|
|
|
|
|
|
|
// Bom 窗口 |
|
|
// Bom 窗口 |
|
|
const DialogTitle = ref('Bom信息') |
|
|
|
|
|
const bomModelVisible = ref(false) |
|
|
const bomModelVisible = ref(false) |
|
|
const tableListBom = ref() |
|
|
const tableListBom = ref() |
|
|
const lsBomSave = ref() |
|
|
const lsBomSave = ref() |
|
|
const rowId = ref() |
|
|
const rowId = ref() |
|
|
const detailQty = ref() |
|
|
const detailQty = ref() |
|
|
|
|
|
const footButttondata = ref([ |
|
|
|
|
|
defaultButtons.formSaveBtn(null), // BOM保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
|
|
]) |
|
|
|
|
|
// 子包装数据 |
|
|
|
|
|
const detailBomRef = ref() |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
}) |
|
|
}) |
|
@ -176,6 +181,7 @@ const buttonBaseClickBom = (val) => { |
|
|
console.log("tableListBom",tableListBom.value) |
|
|
console.log("tableListBom",tableListBom.value) |
|
|
console.log("lsBomSave",lsBomSave.value) |
|
|
console.log("lsBomSave",lsBomSave.value) |
|
|
if (lsBomSave.value) { |
|
|
if (lsBomSave.value) { |
|
|
|
|
|
|
|
|
tableData.value.forEach((item, index) => { |
|
|
tableData.value.forEach((item, index) => { |
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
item.childList = tableListBom.value |
|
|
item.childList = tableListBom.value |
|
@ -192,11 +198,11 @@ const buttonBaseClickBom = (val) => { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
bomModelVisible.value = false |
|
|
detailBomRef.value.dialogVisible = false |
|
|
} |
|
|
} |
|
|
// 关闭 |
|
|
// 关闭 |
|
|
else if (val == 'close') { |
|
|
else if (val == 'close') { |
|
|
bomModelVisible.value = false |
|
|
detailBomRef.value.dialogVisible = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 新增 tableform 按钮 |
|
|
// 新增 tableform 按钮 |
|
@ -205,24 +211,35 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
message.warning('请选择物料代码!') |
|
|
message.warning('请选择物料代码!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if(row.qty <= 0){ |
|
|
|
|
|
message.warning('数量需要大于0!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
detatableDataBom.params.bomVersion = row.bomVersion |
|
|
detatableDataBom.params.bomVersion = row.bomVersion |
|
|
DialogTitle.value = '物料代码:【' + row.itemCode + '】 Bom 信息' |
|
|
|
|
|
detailQty.value = row.qty |
|
|
detailQty.value = row.qty |
|
|
bomModelVisible.value = true |
|
|
bomModelVisible.value = true |
|
|
await getDetailListBom() |
|
|
await getDetailListBom() |
|
|
|
|
|
console.log(row.fromLocationCode); |
|
|
detatableDataBom.tableList.forEach(item => { |
|
|
detatableDataBom.tableList.forEach(item => { |
|
|
// ProdcutscrapBomDismantle.allSchemas.tableFormColumns.forEach((bomItem) => { |
|
|
ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => { |
|
|
// if (bomItem.field == 'batch') { |
|
|
if (bomItem.field == 'batch') { |
|
|
// let condition = { |
|
|
let condition = [{ |
|
|
// 'key':'locationCode', |
|
|
key:'location_code', |
|
|
// 'value': row.fromLocationCode, |
|
|
action: '==', |
|
|
// 'isMainValue':'false' |
|
|
value: row.fromLocationCode, |
|
|
// } |
|
|
isSearch: true, |
|
|
// bomItem.searchCondition.push(condition) |
|
|
isMainValue:false |
|
|
// } |
|
|
},{ |
|
|
// }) |
|
|
key:'item_code', |
|
|
|
|
|
action: '==', |
|
|
|
|
|
value:item.itemCode, |
|
|
|
|
|
isSearch: true, |
|
|
|
|
|
isMainValue: false |
|
|
|
|
|
}] |
|
|
|
|
|
bomItem.tableForm.searchCondition = condition |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
item.rowId = index |
|
|
item.rowId = index |
|
|
if(tableData.value[index].childList.length > 0) { |
|
|
if(tableData.value[index].childList.length > 0) { |
|
|
tableData.value[index].childList.forEach(itemChild => { |
|
|
tableData.value[index].childList.forEach(itemChild => { |
|
@ -234,13 +251,26 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
item.qty = item.bomQty * row.qty |
|
|
item.qty = item.bomQty * row.qty |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
detailBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
|
|
const searchTableBomSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
if (type == 'tableForm') { |
|
|
|
|
|
// 明细查询页赋值 |
|
|
|
|
|
if (formField == 'batch') { |
|
|
|
|
|
row['batch'] = val[0]['batch'] |
|
|
|
|
|
row['packingNumber'] = val[0]['packingNumber'] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查看 Bom 按钮回调事件 |
|
|
// 查看 Bom 按钮回调事件 |
|
|
const tableFormButton = async (val , row) => { |
|
|
const tableFormButton = async (val , row) => { |
|
|
if (val == 'bom') { // 查看 bom |
|
|
if (val == 'bom') { // 查看 bom |
|
|
bomModelVisible.value = true |
|
|
bomModelVisible.value = true |
|
|
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息' |
|
|
|
|
|
detatableDataBom.params = { |
|
|
detatableDataBom.params = { |
|
|
itemCode: row.itemCode, |
|
|
itemCode: row.itemCode, |
|
|
bomVersion: row.bomVersion, |
|
|
bomVersion: row.bomVersion, |
|
@ -249,6 +279,7 @@ const tableFormButton = async (val , row) => { |
|
|
rowId.value = row.id |
|
|
rowId.value = row.id |
|
|
detailQty.value = row.qty |
|
|
detailQty.value = row.qty |
|
|
await getDetailListBom() |
|
|
await getDetailListBom() |
|
|
|
|
|
detailBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -273,6 +304,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
row['bomVersion'] = '' |
|
|
row['bomVersion'] = '' |
|
|
row['childList'] = [] |
|
|
row['childList'] = [] |
|
|
|
|
|
let param = {'itemCode':val[0]['itemCode'] as string} |
|
|
|
|
|
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
row['uom'] = res.uom |
|
|
|
|
|
row['singlePrice'] = res.price |
|
|
|
|
|
}) |
|
|
}else if(formField == 'bomVersion'){ |
|
|
}else if(formField == 'bomVersion'){ |
|
|
row['bomVersion'] = val[0]['version'] |
|
|
row['bomVersion'] = val[0]['version'] |
|
|
} |
|
|
} |
|
@ -300,6 +337,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
setV['bomVersion'] = '' |
|
|
setV['bomVersion'] = '' |
|
|
setV['childList'] = [] |
|
|
setV['childList'] = [] |
|
|
|
|
|
// |
|
|
|
|
|
let param = {'itemCode':val[0]['itemCode'] as string} |
|
|
|
|
|
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}else if(formField == 'bomVersion'){ |
|
|
}else if(formField == 'bomVersion'){ |
|
|
setV['bomVersion'] = val[0]['version'] |
|
|
setV['bomVersion'] = val[0]['version'] |
|
|
} |
|
|
} |
|
@ -650,6 +693,18 @@ const detailValidate = (data) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const inputNumberChange = (field, index, row, val) => { |
|
|
|
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
|
|
|
row.amount = row.qty * row.singlePrice |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const qtyOnChange = (field,val) =>{ |
|
|
|
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
|
|
|
detailRef.value.formRef.formRef.formModel.amount = detailRef.value.formRef.formRef.formModel.qty * detailRef.value.formRef.formRef.formModel.singlePrice |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
/** 导入 */ |
|
|
const importFormRef = ref() |
|
|
const importFormRef = ref() |
|
|
const handleImport = () => { |
|
|
const handleImport = () => { |
|
|