Browse Source

销售开票申请

intex
yufei_wang 4 days ago
parent
commit
02819b49b5
  1. 21
      src/api/wms/customerSaleInvoiceMain/index.ts
  2. 64
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

21
src/api/wms/customerSaleInvoiceMain/index.ts

@ -48,11 +48,15 @@ export const deleteCustomerSaleInvoiceMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-sale-invoice-main/delete?id=` + id })
}
// 导出客户销售开票主信息表(WMS) Excel
// 导出设备制造商 Excel
export const exportCustomerSaleInvoiceMain = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
@ -67,4 +71,13 @@ export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
} else {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/page`, params })
}
}
}
// 销售开票申请 发布功能
export const publish = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/publish?id=` + id})
}
// 销售开票申请 作废功能
export const nodeAbrogate = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/nodeAbrogate?id=` + id})
}

64
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

@ -61,12 +61,26 @@
@onChange="onChange"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
tableData.forEach(item=>{
})
const { taxRate = 0 } = formModel
// 1 mainBeforeTaxAmount :
let mainBeforeTaxAmount = tableData.reduce(
(prev, item) =>
prev + Number(item['beforeTaxAmount']),
0
)
// 2. mainTaxAmount = */100
let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2))
const sumObject = {
//
mainBeforeTaxAmount,
//
mainTaxAmount,
// mainAdTaxAmount =+
mainAdTaxAmount:mainBeforeTaxAmount+mainTaxAmount
}
formRef.value.setValues(sumObject)
}
"
/>
<!-- 详情 -->
@ -157,7 +171,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const setV = {}
if(formField == 'customerStatementNumber') {
//
setV['customer'] = val[0]['customerCode']
setV['customerCode'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1,
@ -170,6 +184,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item['sumPrice'] = item['price'] + item['allocationPrice']
// *2
item['beforeTaxAmount'] = item['sumPrice']*item['qty']
// +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
// taxAmount */100,2
@ -210,9 +225,9 @@ const Echo = []
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), //
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -264,14 +279,16 @@ const butttondata = (row,$index) => {
return []
}
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), //
// defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:customer-sale-invoice-request-main:open`}), //
// defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:customer-sale-invoice-request-main:close`}), //
// defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:submit`}), //
// defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:reject`}), //
// defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), //
// defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:customer-sale-invoice-request-main:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), //
defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['5']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //
]
}
@ -334,7 +351,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => {
CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
@ -342,6 +359,19 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'cancel') { //
tableObject.loading = true
try {
await message.confirm('确认要作废吗?')
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id)
await message.success(t('ts.作废成功'))
//
//exportLoading.value = true
} catch {
} finally {
//
buttonBaseClick('refresh',null)
}
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
tableObject.loading = true

Loading…
Cancel
Save