Browse Source

BUG修改

master_hella_20240701
parent
commit
b7c654d15b
  1. 278
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  2. 2925
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

278
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

@ -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('创建标签失败')
})
} }
/** 初始化 **/ /** 初始化 **/

2925
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

File diff suppressed because it is too large
Loading…
Cancel
Save