Browse Source

销售开票问题

intex_online20241228
王宇飞 5 months ago
parent
commit
485efcda90
  1. 5
      src/api/wms/customerSaleInvoiceDetail/index.ts
  2. 8
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue
  3. 20
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts
  4. 42
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

5
src/api/wms/customerSaleInvoiceDetail/index.ts

@ -61,7 +61,12 @@ export const deleteCustomerSaleInvoiceDetail = async (id: number) => {
// 导出客户销售开票子信息表(WMS) Excel // 导出客户销售开票子信息表(WMS) Excel
export const exportCustomerSaleInvoiceDetail = async (params) => { export const exportCustomerSaleInvoiceDetail = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-detail/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params }) return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params })
}
} }
// 下载用户导入模板 // 下载用户导入模板

8
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue

@ -92,6 +92,9 @@ const inputNumberChange = (field, index, row, val) => {
// /- // /-
row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price'] row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price']
// taxAmount */100,2
row['taxAmount'] = (row['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //
} }
const flag = ref(false) const flag = ref(false)
@ -205,12 +208,13 @@ 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'] //
// taxAmount */100,2 // taxAmount */100,2
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 // item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //
// +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
}) })

20
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts

@ -53,7 +53,14 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string', dictClass: 'string',
table:{ table:{
width:120 width:120
},
search:{
component:'Select',
componentProps: {
multiple:true,
} }
},
}, },
{ {
label: '客户对账单', label: '客户对账单',
@ -200,6 +207,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -232,6 +242,16 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
}
},
isForm: false, isForm: false,
table:{ table:{
width:180 width:180

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

@ -56,6 +56,8 @@
:detailButtonIsShowAddStatusArray="['0']" :detailButtonIsShowAddStatusArray="['0']"
:detailButtonIsShowDelete="false" :detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -75,6 +77,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as AreabasicApi from '@/api/wms/areabasic' import * as AreabasicApi from '@/api/wms/areabasic'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { status } from 'nprogress'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'customerSaleInvoiceMain' }) defineOptions({ name: 'customerSaleInvoiceMain' })
@ -102,7 +105,28 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const detailButtonBaseClick = async (val, item,tableObject) => {
if (val == 'export') {
//
console.log('子表导出',val, tableObject)
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceDetail(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
}
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
@ -276,6 +300,22 @@ const searchFormClick = (searchData) => {
} }
const seachRef = ref() const seachRef = ref()
const onSearchChange = (field, value)=>{ const onSearchChange = (field, value)=>{
console.log('onSearchChange',field,value)
if(field=='status'){
//
if(value.length>0){
if(value[value.length-1]==''){
//
seachRef.value.setFormValues({
status:['']
})
}else{
seachRef.value.setFormValues({
status:value.filter(item=>item!='')
})
}
}
}
if(field=='customerCode'){ if(field=='customerCode'){
if(value.length>0){ if(value.length>0){
if(value[value.length-1]=='ALL'){ if(value[value.length-1]=='ALL'){
@ -293,7 +333,7 @@ const onSearchChange = (field, value)=>{
} }
const searchClick = async (data)=>{ const searchClick = async (data)=>{
console.log('查询',data) console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL')}) setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL'),status:data.status.filter(item=>item!='')})
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

Loading…
Cancel
Save