Browse Source

发票回转功能

hella_online_20240828
wangyufei 3 months ago
parent
commit
01f38ebcc9
  1. 6
      src/api/wms/supplierinvoiceRecordMain/index.ts
  2. 4
      src/locales/en-US.ts
  3. 4
      src/locales/zh-CN.ts
  4. 37
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue
  5. 11
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

6
src/api/wms/supplierinvoiceRecordMain/index.ts

@ -52,6 +52,12 @@ export const deleteSupplierinvoiceRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/supplierinvoice-record-main/delete?id=` + id }) return await request.delete({ url: `/wms/supplierinvoice-record-main/delete?id=` + id })
} }
// 发票回转
export const reverseSupplierinvoiceRecordMain = async (data: SupplierinvoiceRecordMainVO) => {
return await request.post({ url: `/wms/supplierinvoice-record-main/reverse`, data })
}
// 导出供应商发票记录主 Excel // 导出供应商发票记录主 Excel
export const exportSupplierinvoiceRecordMain = async (params) => { export const exportSupplierinvoiceRecordMain = async (params) => {
console.log(params) console.log(params)

4
src/locales/en-US.ts

@ -1283,7 +1283,9 @@ export default {
'确认撤销报工吗?': 'Are you sure to cancel the job application?', '确认撤销报工吗?': 'Are you sure to cancel the job application?',
'收货数量不可以大于订单数量!': 'The received quantity cannot exceed the order quantity', '收货数量不可以大于订单数量!': 'The received quantity cannot exceed the order quantity',
:'Revocation of work report successful', :'Revocation of work report successful',
:'The date of production cannot be less than' :'The date of production cannot be less than',
:'Return of invoice',
:'The invoice has been successfully forwarded'
}, },

4
src/locales/zh-CN.ts

@ -1279,7 +1279,9 @@ export default {
'确认撤销报工吗?': "确认撤销报工吗?", '确认撤销报工吗?': "确认撤销报工吗?",
'收货数量不可以大于订单数量!':'收货数量不可以大于订单数量', '收货数量不可以大于订单数量!':'收货数量不可以大于订单数量',
:'撤销报工成功', :'撤销报工成功',
:'生产日期不能小于' :'生产日期不能小于',
:'发票回转',
:'发票回转成功'
}, },
} }

37
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue

@ -51,7 +51,7 @@
@searchTableSuccess="searchTableSuccess" --> @searchTableSuccess="searchTableSuccess" -->
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="()=>{alert(1)}" @success="submitForm"
:rules="SupplierinvoiceRecordMainTransferRules" :rules="SupplierinvoiceRecordMainTransferRules"
:formAllSchemas="SupplierinvoiceRecordMainTransfer.allSchemas" :formAllSchemas="SupplierinvoiceRecordMainTransfer.allSchemas"
:isBusiness="false" :isBusiness="false"
@ -246,16 +246,16 @@ const butttondata = (row,$index) => {
hasPermi: '', hasPermi: '',
link: true, // link: true, //
}, },
// { {
// label: t('ts.'), label: t('ts.发票回转'),
// name: 'transfer', name: 'transfer',
// type: 'primary', type: 'primary',
// icon: '', icon: '',
// color: '', color: '',
// hasPermi: '', hasPermi: 'wms:supplierinvoice-record-main:reverse',
// hide:!(row['status']==5&&!!row['voucherNumber']), hide:!(row['status']==5&&!!row['voucherNumber']),
// link: true, // link: true, //
// } }
] ]
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -270,6 +270,21 @@ const buttonTableClick = async (val, row) => {
} }
} }
//
const submitForm = async (formType, data) => {
data.reverseInvoiceJournal = 'APINVCOR'
data.adjustmentJournal = 'APADJ'
console.log('发票回转',formType, data)
loadStart()
try{
await SupplierinvoiceRecordMainApi.reverseSupplierinvoiceRecordMain(data)
message.success(t('ts.发票回转成功'))
basicFormRef.value.dialogVisible = false
} finally {
loadDone()
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */

11
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import { accountantFormart } from '@/utils/formatter' import { accountantFormart } from '@/utils/formatter'
import dayjs from 'dayjs'
/** /**
* @returns {Array} * @returns {Array}
@ -1646,7 +1647,7 @@ export const SupplierinvoiceRecordMainTransfer = useCrudSchemas(reactive<CrudSch
field: 'adjustmentJournal', field: 'adjustmentJournal',
form: { form: {
componentProps: { componentProps: {
value:'APINVCOR', value:'APADJ',
disabled: true, disabled: true,
} }
}, },
@ -1666,6 +1667,7 @@ export const SupplierinvoiceRecordMainTransfer = useCrudSchemas(reactive<CrudSch
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
value:dayjs().valueOf(),
style: {width:'100%'}, style: {width:'100%'},
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
@ -1694,8 +1696,11 @@ export const SupplierinvoiceRecordMainTransfer = useCrudSchemas(reactive<CrudSch
//表单校验 //表单校验
export const SupplierinvoiceRecordMainTransferRules = reactive({ export const SupplierinvoiceRecordMainTransferRules = reactive({
requestNumber: [ reversepostingdate: [
{ required: true, message: '请选择申请单号', trigger: 'change' } { required: true, message: '请选择过账日期', trigger: 'change' }
],
tcCInvoiceRemark: [
{ required: true, message: '请填写说明', trigger: 'change' }
], ],
}) })

Loading…
Cancel
Save