|
|
@ -2,7 +2,10 @@ |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search |
|
|
|
:schema="[...PurchasereturnRequestMain.allSchemas.searchSchema,...PurchasereturnRequestDetail.allSchemas.searchSchema]" |
|
|
|
:schema="[ |
|
|
|
...PurchasereturnRequestMain.allSchemas.searchSchema, |
|
|
|
...PurchasereturnRequestDetail.allSchemas.searchSchema |
|
|
|
]" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
@ -21,7 +24,8 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table |
|
|
|
v-clientTable |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -37,9 +41,9 @@ |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<template #action="{ row, $index }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row,$index)" |
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
@ -87,8 +91,8 @@ |
|
|
|
:detailValidate="detailValidate" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
|
<BasicForm |
|
|
|
<!-- 创建标签 --> |
|
|
|
<BasicForm |
|
|
|
ref="formLabelRef" |
|
|
|
@success="getList" |
|
|
|
:tableAllSchemas="PurchasereReturnRequestDetailLabel.allSchemas" |
|
|
@ -101,7 +105,7 @@ |
|
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
|
/> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" /> |
|
|
|
<SearchTable style="width: 905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" /> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
@ -129,9 +133,7 @@ import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMa |
|
|
|
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' |
|
|
|
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import { SupplierdeliverRequestPackage } from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import * as BalanceApi from '@/api/wms/balance' |
|
|
@ -142,11 +144,14 @@ defineOptions({ name: 'PurchasereturnRequestMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
const genLabelId = ref(); //主表ID |
|
|
|
const genLabelId = ref() //主表ID |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref([...PurchasereturnRequestMain.allSchemas.tableColumns,...PurchasereturnRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
const tableColumns = ref([ |
|
|
|
...PurchasereturnRequestMain.allSchemas.tableColumns, |
|
|
|
...PurchasereturnRequestDetail.allSchemas.tableMainColumns |
|
|
|
]) |
|
|
|
|
|
|
|
const isShowButton = ref(true) |
|
|
|
|
|
|
@ -154,16 +159,25 @@ const isShowButton = ref(true) |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
const onEnter = async (field,value)=>{ |
|
|
|
console.log(field,value) |
|
|
|
if('supplierCode'==field){ |
|
|
|
const onEnter = async (field, value) => { |
|
|
|
console.log(field, value) |
|
|
|
if ('supplierCode' == field) { |
|
|
|
//供应商代码 |
|
|
|
formRef.value.opensearchTable('purchaseReceiptRecordNumber', 'number', '采购收货记录', PurchasereceiptRecordMain1.allSchemas, PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,[{ |
|
|
|
formRef.value.opensearchTable( |
|
|
|
'purchaseReceiptRecordNumber', |
|
|
|
'number', |
|
|
|
'采购收货记录', |
|
|
|
PurchasereceiptRecordMain1.allSchemas, |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn, |
|
|
|
[ |
|
|
|
{ |
|
|
|
key: 'supplierCode', |
|
|
|
value: 'supplierCode', |
|
|
|
isMainValue: true |
|
|
|
}]) |
|
|
|
}else if('purchaseReceiptRecordNumber' == field){ |
|
|
|
} |
|
|
|
] |
|
|
|
) |
|
|
|
} else if ('purchaseReceiptRecordNumber' == field) { |
|
|
|
//采购收货记录 |
|
|
|
} |
|
|
|
} |
|
|
@ -171,22 +185,22 @@ const onEnter = async (field,value)=>{ |
|
|
|
// 生成标签 |
|
|
|
const isCreateLabel = ref(false) |
|
|
|
const formLabelRef = ref() |
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ |
|
|
|
getListApi: PurchasereturnRequestDetailApi.getPurchasereturnRequestDetailPage |
|
|
|
}) |
|
|
|
const { getList:getDetailList } = detatableMethods |
|
|
|
const { getList: getDetailList } = detatableMethods |
|
|
|
|
|
|
|
// 生成标签按钮操作 |
|
|
|
const submitFormLabel = async (formType, submitData) => { |
|
|
|
let data = {...submitData} |
|
|
|
if(data.masterId){ |
|
|
|
let data = { ...submitData } |
|
|
|
if (data.masterId) { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
try { |
|
|
|
console.log("formType==",formType) |
|
|
|
console.log("data==",data) |
|
|
|
console.log('formType==', formType) |
|
|
|
console.log('data==', data) |
|
|
|
data.subList = detatableData.tableList |
|
|
|
console.log("detatableData",detatableData) |
|
|
|
console.log('detatableData', detatableData) |
|
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
|
await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value |
|
|
|
isCreateLabel.value = true |
|
|
@ -207,21 +221,20 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
|
row['packUnit'] = val[0]['packUnit'] |
|
|
|
row['packQty'] = val[0]['packQty'] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = async(formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
|
|
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) |
|
|
|
console.log('searchTableSuccess123',val) |
|
|
|
nextTick( async () => { |
|
|
|
|
|
|
|
const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) |
|
|
|
console.log('searchTableSuccess123', val) |
|
|
|
nextTick(async () => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
if(formField=='purchaseReceiptRecordNumber'){//搜索记录单号--回显数据 |
|
|
|
if (formField == 'purchaseReceiptRecordNumber') { |
|
|
|
//搜索记录单号--回显数据 |
|
|
|
row['supplierCode'] = val[0]['supplierCode'] |
|
|
|
row['poNumber'] = val[0]['poNumber'] |
|
|
|
row['poLine'] = val[0]['poLine'] |
|
|
@ -257,14 +270,14 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
row['singlePrice'] = val[0]['singlePrice'] |
|
|
|
row['amount'] = val[0]['amount'] |
|
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
|
}else if(formField == 'itemCode'){ |
|
|
|
} else if (formField == 'itemCode') { |
|
|
|
row['batch'] = val[0]['toBatch'] |
|
|
|
row['containerNumber'] = val[0]['toContainerNumber'] |
|
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
// row['fromLocationCode'] = val[0]['fromLocationCode'] |
|
|
|
row['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
}else if(formField=='fromLocationCode'){ |
|
|
|
} else if (formField == 'fromLocationCode') { |
|
|
|
// let params = { |
|
|
|
// itemCode: row.itemCode, |
|
|
|
// batch: row.batch, |
|
|
@ -273,12 +286,12 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
// let aa = await BalanceApi.getSumByConditions(params); |
|
|
|
// console.log('23423423',aa); |
|
|
|
// row['inventoryBalance'] = aa//库存余额 |
|
|
|
}else if(formField=='packingNumber'){ |
|
|
|
row['inventoryBalance'] = val[0]['qty']//库存余额 |
|
|
|
} else if (formField == 'packingNumber') { |
|
|
|
row['inventoryBalance'] = val[0]['qty'] //库存余额 |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
|
if (formField == 'purchaseReceiptRecordNumber') { |
|
|
|
// isShowButton.value = false |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
@ -287,9 +300,10 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
// PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({ |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({ |
|
|
|
masterId: val[0]['masterId'] |
|
|
|
}).then((res) => { |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res) tableData.value = res |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
item.batch = item.toBatch |
|
|
@ -307,7 +321,7 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
|
}) |
|
|
|
originTableData.value = JSON.parse(JSON.stringify(tableData.value)) |
|
|
|
|
|
|
|
|
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
@ -331,11 +345,12 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
if(formField == 'supplierCode'){ |
|
|
|
if (formField == 'supplierCode') { |
|
|
|
// isShowButton.value = true |
|
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
// setV['purchaseReceiptRecordNumber'] = '' |
|
|
@ -349,7 +364,7 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
if(formField == 'poLine' || formField == 'itemCode'){ |
|
|
|
if (formField == 'poLine' || formField == 'itemCode') { |
|
|
|
console.log(val) |
|
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
|
setV['poNumber'] = val[0]['poNumber'] |
|
|
@ -387,7 +402,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
setV['amount'] = val[0]['amount'] |
|
|
|
setV['projectCode'] = val[0]['projectCode'] |
|
|
|
|
|
|
|
if(formField == 'itemCode'){ |
|
|
|
if (formField == 'itemCode') { |
|
|
|
setV['batch'] = val[0]['toBatch'] |
|
|
|
setV['containerNumber'] = val[0]['toContainerNumber'] |
|
|
|
setV['containerNumber'] = val[0]['containerNumber'] |
|
|
@ -395,7 +410,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
// setV['fromLocationCode'] = val[0]['fromLocationCode'] |
|
|
|
// setV['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
@ -439,7 +454,7 @@ const buttonBaseClick = (val, item) => { |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
|
searchFormClick({ |
|
|
|
filters: tableObject.params.filters |
|
|
|
}) |
|
|
@ -464,9 +479,11 @@ const isShowMainButton = (row, val) => { |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row,$index) => { |
|
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
|
const butttondata = (row, $index) => { |
|
|
|
const findIndex = row['masterId'] |
|
|
|
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|
|
|
: -1 |
|
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
@ -497,7 +514,7 @@ const butttondata = (row,$index) => { |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:purchasereceipt-request-main:update' |
|
|
|
}), // 编辑 |
|
|
|
}) // 编辑 |
|
|
|
// { |
|
|
|
// label: '生成标签', |
|
|
|
// name: 'ssbq', |
|
|
@ -535,18 +552,18 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if(val == 'ssbq'){ |
|
|
|
// 生成标签 |
|
|
|
detatableData.params = { |
|
|
|
masterId:row.masterId |
|
|
|
} |
|
|
|
} else if (val == 'ssbq') { |
|
|
|
// 生成标签 |
|
|
|
detatableData.params = { |
|
|
|
masterId: row.masterId |
|
|
|
} |
|
|
|
genLabelId.value = row.masterId |
|
|
|
await getDetailList() |
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
|
} else if (val == 'point') { |
|
|
|
// 标签打印 |
|
|
|
labelPrint(row) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
@ -555,25 +572,25 @@ const openForm = async (type: string, row?: number) => { |
|
|
|
originTableData.value = [] // 重置明细数据 |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
isShowButton.value = true |
|
|
|
if(type == 'create'){ |
|
|
|
if (type == 'create') { |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
} |
|
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
|
if (item.field == 'purchaseReceiptRecordNumber') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if(type == 'update'){ |
|
|
|
if (type == 'update') { |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
} |
|
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
|
if (item.field == 'purchaseReceiptRecordNumber') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
} |
|
|
@ -588,11 +605,16 @@ const { wsCache } = useCache() |
|
|
|
const detailRef = ref() |
|
|
|
const purchaseReceiptRecordNumberRef = ref() |
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber; |
|
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
|
purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber |
|
|
|
const departmentCode = wsCache |
|
|
|
.get(CACHE_KEY.DEPT) |
|
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableColumns = PurchasereturnRequestDetail.allSchemas.tableColumns.filter(item=>item.field!='inventoryBalance') |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue,'requestPurchasereturnMain') |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableColumns = |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableColumns.filter( |
|
|
|
(item) => item.field != 'inventoryBalance' |
|
|
|
) |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'requestPurchasereturnMain') |
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
@ -603,7 +625,8 @@ const handleClose = async (id: number) => { |
|
|
|
await PurchasereturnRequestMainApi.closePurchasereturnRequestMain(id) |
|
|
|
message.success(t('common.closeSuccess')) |
|
|
|
await getList() |
|
|
|
} catch {}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -616,7 +639,8 @@ const handleReAdd = async (id: number) => { |
|
|
|
await PurchasereturnRequestMainApi.reAddPurchasereturnRequestMain(id) |
|
|
|
message.success(t('common.reAddSuccess')) |
|
|
|
await getList() |
|
|
|
} catch {}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -629,7 +653,8 @@ const handleAgree = async (id: number) => { |
|
|
|
await PurchasereturnRequestMainApi.agreePurchasereturnRequestMain(id) |
|
|
|
message.success(t('common.agreeSuccess')) |
|
|
|
await getList() |
|
|
|
} catch {}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -642,7 +667,8 @@ const handleRefused = async (id: number) => { |
|
|
|
await PurchasereturnRequestMainApi.refusedPurchasereturnRequestMain(id) |
|
|
|
message.success(t('common.refusedSuccess')) |
|
|
|
await getList() |
|
|
|
} catch {}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -655,7 +681,8 @@ const handleHandle = async (id: number) => { |
|
|
|
await PurchasereturnRequestMainApi.handlePurchasereturnRequestMain(id) |
|
|
|
message.success(t('common.handleSuccess')) |
|
|
|
await getList() |
|
|
|
} catch {}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -680,7 +707,9 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain(tableObject.params) |
|
|
|
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain( |
|
|
|
tableObject.params |
|
|
|
) |
|
|
|
download.excel(data, '采购退货申请主.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
@ -698,15 +727,15 @@ PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
const tableData = ref([]) |
|
|
|
const originTableData = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
|
|
|
|
|
const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id)) |
|
|
|
if(subTableDFata.length==0){ |
|
|
|
const subTableDFata = originTableData.value.filter( |
|
|
|
(item) => !tableData.value.find((item1) => item1.id == item.id) |
|
|
|
) |
|
|
|
if (subTableDFata.length == 0) { |
|
|
|
message.warning('暂无可选择数据!') |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const tableObject = { |
|
|
@ -718,7 +747,7 @@ const handleAddTable = () => { |
|
|
|
loading: false, |
|
|
|
// 页数 |
|
|
|
pageSize: subTableDFata.length, |
|
|
|
params:null, |
|
|
|
params: null, |
|
|
|
// 排序 |
|
|
|
sort: { |
|
|
|
order: '', // 排序规则 |
|
|
@ -728,7 +757,7 @@ const handleAddTable = () => { |
|
|
|
total: subTableDFata.length, |
|
|
|
// 表格数据 |
|
|
|
tableList: subTableDFata, |
|
|
|
currentRow:null |
|
|
|
currentRow: null |
|
|
|
} |
|
|
|
|
|
|
|
const tableColumns = PurchasereturnRequestDetail.allSchemas.tableFormColumns |
|
|
@ -736,7 +765,7 @@ const handleAddTable = () => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
|
|
|
|
searchTableRef.value.openData("采购收货记录单号",tableObject,{tableColumns},true) |
|
|
|
searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true) |
|
|
|
// searchTableRef.value.open( |
|
|
|
// ('供应商信息', |
|
|
|
// // _searchTableAllSchemas, |
|
|
@ -750,7 +779,6 @@ const handleAddTable = () => { |
|
|
|
// ) |
|
|
|
// ) |
|
|
|
|
|
|
|
|
|
|
|
// console.log(subTableDFata) |
|
|
|
// const {tableObject, tableMethods } = useTable({ |
|
|
|
// getListApi: getPage.value // 分页接口 |
|
|
@ -799,12 +827,12 @@ const handleAddTable = () => { |
|
|
|
} |
|
|
|
const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log(val) |
|
|
|
tableData.value = [...tableData.value,...val] |
|
|
|
tableData.value = [...tableData.value, ...val] |
|
|
|
} |
|
|
|
// 删除明细 |
|
|
|
const handleDeleteTable = (item, index, formRef) => { |
|
|
|
let itemIndex = tableData.value.indexOf(item) |
|
|
|
if(itemIndex>-1){ |
|
|
|
if (itemIndex > -1) { |
|
|
|
tableData.value.splice(itemIndex, 1) |
|
|
|
} |
|
|
|
if (tableData.value.length == 0) { |
|
|
@ -814,11 +842,10 @@ const handleDeleteTable = (item, index, formRef) => { |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
const tableSelectionDelete = (selection) => { |
|
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
|
tableData.value = tableData.value.filter((item) => !selection.includes(item)) |
|
|
|
if (tableData.value.length == 0) { |
|
|
|
isShowButton.value = true |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
@ -837,31 +864,31 @@ const tableSelectionDelete = (selection) => { |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
|
let data = {...submitData} |
|
|
|
if(data.masterId){ |
|
|
|
let data = { ...submitData } |
|
|
|
if (data.masterId) { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
console.log('submitForm',tableData.value) |
|
|
|
console.log('submitForm', tableData.value) |
|
|
|
// if(tableData.value.find(item=>Number(item.returnedQty)>Number(item.receiptQty))){ |
|
|
|
// message.warning("退货数量不能大于收获数量") |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if(tableData.value.find(item=>Number(item.qty)>Number(item.inventoryBalance))){ |
|
|
|
message.warning("退货数量不能大于库存余额") |
|
|
|
return; |
|
|
|
if (tableData.value.find((item) => Number(item.qty) > Number(item.inventoryBalance))) { |
|
|
|
message.warning('退货数量不能大于库存余额') |
|
|
|
return |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
let flag = false; |
|
|
|
let flag = false |
|
|
|
data.subList.forEach((item) => { |
|
|
|
if(item.qty == 0){ |
|
|
|
message.warning("数量不能为0") |
|
|
|
flag = true; |
|
|
|
return; |
|
|
|
} |
|
|
|
if (item.qty == 0) { |
|
|
|
message.warning('数量不能为0') |
|
|
|
flag = true |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
if(flag){ |
|
|
|
if (flag) { |
|
|
|
formRef.value.formLoading = false |
|
|
|
return |
|
|
|
} |
|
|
@ -881,14 +908,14 @@ const submitForm = async (formType, submitData) => { |
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
|
const detailValidate = (data) => { |
|
|
|
let tag = false; |
|
|
|
if(data.qty <= 0){ |
|
|
|
let tag = false |
|
|
|
if (data.qty <= 0) { |
|
|
|
message.warning('数量必须大于0') |
|
|
|
tag = false; |
|
|
|
return tag; |
|
|
|
}else { |
|
|
|
tag = true; |
|
|
|
return tag; |
|
|
|
tag = false |
|
|
|
return tag |
|
|
|
} else { |
|
|
|
tag = true |
|
|
|
return tag |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -918,26 +945,26 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
const detailOpenForm = (type, row) =>{ |
|
|
|
console.log("type",type); |
|
|
|
console.log("row",row); |
|
|
|
console.log("AAAAAA",purchaseReceiptRecordNumberRef.value); |
|
|
|
const detailOpenForm = (type, row) => { |
|
|
|
console.log('type', type) |
|
|
|
console.log('row', row) |
|
|
|
console.log('AAAAAA', purchaseReceiptRecordNumberRef.value) |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
if(purchaseReceiptRecordNumberRef.value == ''){ |
|
|
|
if (purchaseReceiptRecordNumberRef.value == '') { |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.form.componentProps.disabled = true |
|
|
|
item.form.componentProps.isSearchList = true |
|
|
|
} |
|
|
|
if(item.field == 'poLine'){ |
|
|
|
if (item.field == 'poLine') { |
|
|
|
item.form.componentProps.disabled = true |
|
|
|
item.form.componentProps.isSearchList = false |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.form.componentProps.disabled = true |
|
|
|
item.form.componentProps.isSearchList = false |
|
|
|
} |
|
|
|
if(item.field == 'poLine'){ |
|
|
|
if (item.field == 'poLine') { |
|
|
|
item.form.componentProps.disabled = true |
|
|
|
item.form.componentProps.isSearchList = true |
|
|
|
} |
|
|
@ -945,7 +972,6 @@ const detailOpenForm = (type, row) =>{ |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
|
@ -953,38 +979,40 @@ const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAcces |
|
|
|
const showLabelRef = ref() |
|
|
|
const labelPrint = async (row) => { |
|
|
|
tableObject.loading = true |
|
|
|
const defaultParams = {'moduleName':'purchasereturn','recordNumber':row.number} |
|
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
|
const defaultParams = { moduleName: 'purchasereturn', recordNumber: row.number } |
|
|
|
const { tableObject: tableObjectPrint, tableMethods } = useTable({ |
|
|
|
defaultParams, |
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList:getListPrint } = tableMethods |
|
|
|
const { getList: getListPrint } = tableMethods |
|
|
|
getListPrint() |
|
|
|
tableObject.loading = false |
|
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
|
tableColumns.forEach((item) => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
showLabelRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true) |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印---采购收货申请 |
|
|
|
const showLabelSuccess = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log('批量打印',val) |
|
|
|
|
|
|
|
if(val.length == 0){ |
|
|
|
message.warning("请先选择要打印的数据!") |
|
|
|
console.log('批量打印', val) |
|
|
|
|
|
|
|
if (val.length == 0) { |
|
|
|
message.warning('请先选择要打印的数据!') |
|
|
|
return |
|
|
|
} |
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
|
await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(',')) |
|
|
|
.then((res) => { |
|
|
|
console.log(res) |
|
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|