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 }) return await request.delete({ url: `/wms/customer-sale-invoice-main/delete?id=` + id })
} }
// 导出客户销售开票主信息表(WMS) Excel // 导出设备制造商 Excel
export const exportCustomerSaleInvoiceMain = async (params) => { 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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' }) return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
@ -67,4 +71,13 @@ export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
} else { } else {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/page`, params }) 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" @onChange="onChange"
:sumFormDataByTableCustom=" :sumFormDataByTableCustom="
(formRef, formModel, tableData) => { (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 = {} const setV = {}
if(formField == 'customerStatementNumber') { if(formField == 'customerStatementNumber') {
// //
setV['customer'] = val[0]['customerCode'] setV['customerCode'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName'] setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({ CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1, pageNo:1,
@ -170,6 +184,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item['sumPrice'] = item['price'] + item['allocationPrice'] item['sumPrice'] = item['price'] + item['allocationPrice']
// *2 // *2
item['beforeTaxAmount'] = item['sumPrice']*item['qty'] item['beforeTaxAmount'] = item['sumPrice']*item['qty']
// +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] // item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
// taxAmount */100,2 // taxAmount */100,2
@ -210,9 +225,9 @@ const Echo = []
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-main:create` }), // defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), // defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), // defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -264,14 +279,16 @@ const butttondata = (row,$index) => {
return [] return []
} }
return [ return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), // // 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:${routeName.value}:close`}), // // 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:${routeName.value}:submit`}), // // defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:submit`}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), // // defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:reject`}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), // // defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), // defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), // // defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:customer-sale-invoice-request-main:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), // 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') { // } else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?') await message.confirm('确认要发布吗?')
tableObject.loading = true tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => { CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
buttonBaseClick('refresh',null) buttonBaseClick('refresh',null)
@ -342,6 +359,19 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false tableObject.loading = false
console.log(err) 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') { // } else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?') await message.confirm('确认要重置吗?')
tableObject.loading = true tableObject.loading = true

Loading…
Cancel
Save