|
|
@ -38,7 +38,10 @@ |
|
|
|
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" |
|
|
|
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" |
|
|
|
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" /> |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" @detailSubmitForm='detailSubmitForm' |
|
|
|
:isShowAddBtn="isShowAddBtn" |
|
|
|
:detailButtonIsShow="detailButtonIsShow" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
|
|
@ -61,6 +64,8 @@ |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
const isShowAddBtn = ref(true) |
|
|
|
const detailButtonIsShow = ref(false) |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns) |
|
|
|
|
|
|
@ -76,6 +81,19 @@ |
|
|
|
console.log(formField); |
|
|
|
// 明细查询页赋值 |
|
|
|
if (formField == 'itemNumber') { |
|
|
|
let subList = tableData.value |
|
|
|
let flag = false; |
|
|
|
if (subList.length > 0) { |
|
|
|
subList.forEach((item) => { |
|
|
|
if (item.itemNumber == val[0]['itemNumber']) { |
|
|
|
flag = true; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
message.warning("物料编号已经存在"); |
|
|
|
return; |
|
|
|
} |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
row['itemNumber'] = val[0]['itemNumber'] |
|
|
|
row['isRadeIn'] = val[0]['isInAccount'] |
|
|
@ -96,14 +114,15 @@ |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(async () => { |
|
|
|
const setV = {} |
|
|
|
// if(formField == 'itemCode'){ |
|
|
|
// await ItembasicApi.getItembasicPage({ |
|
|
|
// code: setV['itemCode'] |
|
|
|
// }).then(res => { |
|
|
|
// setV['uom'] = res.list[0].uom |
|
|
|
// setV[formField] = val[0][searchField] |
|
|
|
// }) |
|
|
|
// } |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if (formField == 'itemNumber') { |
|
|
|
setV['itemNumber'] = val[0]['itemNumber'] |
|
|
|
setV['isRadeIn'] = val[0]['isInAccount'] |
|
|
|
setV['currentQty'] = val[0]['qty'] |
|
|
|
setV['available'] = val[0]['available'] |
|
|
|
} else if (formField == 'deviceNumber') { |
|
|
|
setV['deviceNumber'] = val[0]['number'] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
@ -122,8 +141,8 @@ |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn(null), // 新增 |
|
|
|
defaultButtons.defaultImportBtn(null), // 导入 |
|
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
// defaultButtons.defaultImportBtn(null), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -207,6 +226,13 @@ |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
const openDetail = (row : any, titleName : any, titleValue : any) => { |
|
|
|
if(row.status!='0'){ |
|
|
|
isShowAddBtn.value=false |
|
|
|
detailButtonIsShow.value=true |
|
|
|
}else{ |
|
|
|
isShowAddBtn.value=true |
|
|
|
detailButtonIsShow.value=false |
|
|
|
} |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain') |
|
|
|
} |
|
|
|
|
|
|
@ -307,6 +333,23 @@ |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
|
|
|
try {
if (formType === 'create') { |
|
|
|
await ItemApplyDetailApi.createItemApplyDetail(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
formRef.dialogVisible = false |
|
|
|
formRef.getList |
|
|
|
} else { |
|
|
|
await ItemApplyDetailApi.updateItemApplyDetail(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
formRef.dialogVisible = false |
|
|
|
formRef.getList |
|
|
|
}
}catch { |
|
|
|
} finally { |
|
|
|
formRef.formLoading = false |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|