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