|
|
@ -84,7 +84,7 @@ |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/deliver-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -107,10 +107,34 @@ routeName.value = route.name |
|
|
|
const tableColumns = ref([...DeliverRequestMain.allSchemas.tableColumns,...DeliverRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
|
const isShowButton = ref(true) |
|
|
|
|
|
|
|
const businessType = ref() |
|
|
|
const importFileName = ref() |
|
|
|
console.log(99 , routeName.value) |
|
|
|
//定义 展示子表数据时是否显示新增/修改/删除按钮 |
|
|
|
const trueFalse = ref(false) |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: DeliverRequestDetailApi.getDeliverRequestDetailPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 判断 路由名称 进行条件过滤 |
|
|
|
/** |
|
|
|
* DeliverRequestMain 成品发货申请 |
|
|
|
*/ |
|
|
|
if ( routeName.value == 'DeliverRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
businessType: 'Deliver' |
|
|
|
} |
|
|
|
businessType.value = 'Deliver' |
|
|
|
importFileName.value = '成品发货申请' |
|
|
|
} else if ( routeName.value == 'ZZBJDeliverRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
businessType: 'ZZBJDeliver' |
|
|
|
} |
|
|
|
businessType.value = 'ZZBJDeliver' |
|
|
|
importFileName.value = '自制备件发货申请' |
|
|
|
} |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -139,54 +163,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if(formField == 'deliverPlanNumber') { |
|
|
|
setV['deliverPlanNumber'] = val[0]['number'] |
|
|
|
// if(setV['deliverPlanNumber'] != null){ |
|
|
|
// isShowButton.value = false |
|
|
|
// } |
|
|
|
setV['customerCode'] = val[0]['customerCode'] |
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
// DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id']) |
|
|
|
// .then(res => { |
|
|
|
// res.forEach(item => { |
|
|
|
// item.qty = item.planQty |
|
|
|
// }) |
|
|
|
// if (res) tableData.value = res |
|
|
|
// // 修改 tableform 属性 |
|
|
|
// DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
// if(item.field == 'itemCode') { |
|
|
|
// item.isInpuFocusShow = false |
|
|
|
// item.tableForm.isInpuFocusShow = false |
|
|
|
// item.tableForm.disabled = true |
|
|
|
// } |
|
|
|
// if(item.field == 'uom') { |
|
|
|
// item.tableForm.disabled = true |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// // 修改 tableform 属性 |
|
|
|
// if(formField == 'customerCode'){ |
|
|
|
// console.log(1111,val); |
|
|
|
// customerCode.value = val[0]['code'] |
|
|
|
// console.log(11112,customerCode.value); |
|
|
|
// } |
|
|
|
// DeliverRequestMain.allSchemas.tableFormColumns.map(item => { |
|
|
|
// if(item.field == 'customerDockCode') { |
|
|
|
// item.tableForm.searchCondition = [ |
|
|
|
// { |
|
|
|
// key: 'customerCode', |
|
|
|
// value: customerCode.value , |
|
|
|
// isMainValue: true |
|
|
|
// }] |
|
|
|
// item.form.componentProps.searchCondition = [ |
|
|
|
// { |
|
|
|
// key: 'customerCode', |
|
|
|
// value: customerCode.value , |
|
|
|
// isMainValue: true |
|
|
|
// }]} |
|
|
|
// else { |
|
|
|
// delete item.tableForm.searchCondition |
|
|
|
// delete item.form.componentProps.searchCondition |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
if(formField == 'itemCode'){ |
|
|
|
console.log( val[0]); |
|
|
|
row['uom'] = val[0]['customerUom'] |
|
|
@ -212,10 +189,23 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: DeliverRequestDetailApi.getDeliverRequestDetailPage // 分页接口 |
|
|
|
// 修改 tableform 属性 |
|
|
|
DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'itemCode') { |
|
|
|
item.tableForm.searchCondition = [ |
|
|
|
{ |
|
|
|
key: 'businessType', |
|
|
|
value: businessType.value , |
|
|
|
isMainValue: false |
|
|
|
},] |
|
|
|
item.form.componentProps.searchCondition = [ |
|
|
|
{ |
|
|
|
key: 'businessType', |
|
|
|
value: businessType.value, |
|
|
|
isMainValue: false |
|
|
|
}] |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
@ -457,8 +447,13 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
if(routeName.value == 'DeliverRequestMain'){ |
|
|
|
const data = await DeliverRequestMainApi.exportDeliverRequestMain(tableObject.params) |
|
|
|
download.excel(data, '发货申请主.xlsx') |
|
|
|
}else{ |
|
|
|
const data = await DeliverRequestMainApi.exportZZBJDeliverRequestMain(tableObject.params) |
|
|
|
download.excel(data, '自制备件发货申请主.xlsx') |
|
|
|
} |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -496,6 +491,8 @@ const submitForm = async (formType, data) => { |
|
|
|
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) |
|
|
|
if(rs.length > 1) isExist = true |
|
|
|
}) |
|
|
|
data.businessType = businessType.value |
|
|
|
console.log(data); |
|
|
|
if (isExist) { |
|
|
|
formRef.value.formLoading = false |
|
|
|
return message.warning('物料代码重复') |
|
|
@ -542,7 +539,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '发货申请主导入模版.xlsx' |
|
|
|
templateTitle: importFileName.value + '.xlsx' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|