Browse Source

销售开票功能

intex
yufei_wang 2 weeks ago
parent
commit
d515d569cb
  1. 11
      src/api/wms/customerSaleInvoiceDetail/index.ts
  2. 22
      src/api/wms/customerSaleInvoiceMain/index.ts
  3. 4
      src/utils/dict.ts
  4. 108
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts
  5. 28
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue
  6. 120
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts
  7. 128
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

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

@ -27,6 +27,17 @@ export const getCustomerSaleInvoiceDetailPage = async (params) => {
return await request.get({ url: `/wms/customer-sale-invoice-detail/page`, params }) return await request.get({ url: `/wms/customer-sale-invoice-detail/page`, params })
} }
} }
// 查询客户销售开票子信息表(WMS)列表
export const getCustomerSaleInvoiceRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-sale-invoice-record-detail/page`, params })
}
}
// 查询客户销售开票子信息表(WMS)详情 // 查询客户销售开票子信息表(WMS)详情
export const getCustomerSaleInvoiceDetail = async (id: number) => { export const getCustomerSaleInvoiceDetail = async (id: number) => {

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

@ -57,6 +57,15 @@ export const exportCustomerSaleInvoiceMain = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params }) return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
} }
} }
// 导出销售开票记录 Excel
export const exportCustomerSaleInvoiceRecordMain = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-record-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-record-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' })
@ -66,8 +75,8 @@ export const importTemplate = () => {
export const getCustomerSaleInvoiceRecodeMainPage = async (params) => { export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
// const data = {...params} const data = {...params}
// return await request.post({ url: '/wms/customer-sale-invoice-main/senior', data }) return await request.post({ url: '/wms/customer-sale-invoice-record-main/senior', data })
} 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 })
} }
@ -81,3 +90,12 @@ export const publish = async (id: number) => {
export const nodeAbrogate = async (id: number) => { export const nodeAbrogate = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/nodeAbrogate?id=` + id}) return await request.get({ url: `/wms/customer-sale-invoice-main/nodeAbrogate?id=` + id})
} }
// 从客户对账单中获取客户代码 -- 销售申请
export const getCustomerList = async () => {
return await request.get({ url: `/wms/customer-statement-main/getCustomerList`})
}
// 从客户对账单中获取客户代码 -- 销售记录
export const getRecordCustomerList = async () => {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/getCustomerList`})
}

4
src/utils/dict.ts

@ -410,5 +410,7 @@ export enum DICT_TYPE {
RECEIVE_STATUS = 'receive_status', // 收货确认状态 RECEIVE_STATUS = 'receive_status', // 收货确认状态
LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典) LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典)
CUSTOMER_STATEMENT_TYPE = 'customer_statement_type', // wms客户对账单 模具分摊状态 CUSTOMER_STATEMENT_TYPE = 'customer_statement_type', // wms客户对账单 模具分摊状态
DELIVER_METHOD = 'deliver_method' DELIVER_METHOD = 'deliver_method',
CUSTOMER_SALE_INVOICE_TYPE = 'customer_saleInvoice_type' // 销售开票
} }

108
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts

@ -4,7 +4,23 @@ import {
CustomerStatementMain, CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data' } from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
let custormList = []
try {
custormList = await CustomerSaleInvoiceMainApi.getRecordCustomerList()
if(custormList.length>0){
custormList.unshift({
customerCode:'ALL',
customerName:t('ts.全选'),
})
}
console.log('custormList11',custormList)
} catch (error) {
}
// 表单校验 // 表单校验
export const CustomerSaleInvoiceMainRules = reactive({ export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required], customerStatementNumber: [required],
@ -25,12 +41,13 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
}, },
{ {
label: '状态', label: '申请单号',
field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, field: 'requestNumber',
// 0:新增1:已发布2已作废 table:{
width:150
}
}, },
{ {
label: '客户对账单', label: '客户对账单',
@ -52,6 +69,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false isMainValue: false
}] }]
} }
},
table:{
width:180
} }
}, },
{ {
@ -63,6 +83,25 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled:true disabled:true
} }
},
search:{
component:'Select',
value:custormList.length>1?[custormList[0]['customerCode']]:[],
componentProps: {
showAll:true,// 备用做全选
multiple:true,
// emptyValues:[null, undefined],
valueOnClear:null,
options:custormList.length>0?custormList.map(item=>({
label:item.customerName,
value:item.customerCode
})):[]
}
},
table:{
width:150
} }
}, },
{ {
@ -73,6 +112,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
@ -83,6 +125,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
@ -114,12 +159,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '金税票号', label: '金税票号',
field: 'goldenTaxInvoiceNumber', field: 'goldenTaxInvoiceNumber',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '开票日期', label: '开票日期',
@ -141,6 +192,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table:{
width:180
}
}, },
{ {
@ -148,21 +202,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
}, },
{ // {
label: '创建时间', // label: '创建时间',
field: 'createTime', // field: 'createTime',
sort: 'custom', // sort: 'custom',
formatter: dateFormatter, // formatter: dateFormatter,
search: { // search: {
component: 'DatePicker', // component: 'DatePicker',
componentProps: { // componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', // valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange', // type: 'daterange',
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')]
} // }
}, // },
isForm: false, // isForm: false,
}, // },
])) ]))
// 表单校验 // 表单校验
export const CustomerSaleInvoiceDetailRules = reactive({ export const CustomerSaleInvoiceDetailRules = reactive({
@ -237,22 +291,6 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,

28
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -45,7 +45,7 @@
:detailAllSchemasRules="CustomerSaleInvoiceDetailRules" :detailAllSchemasRules="CustomerSaleInvoiceDetailRules"
:apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail" :apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail"
:apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail" :apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage" :apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceRecordDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail" :apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
@ -149,7 +149,7 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params) const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {
} finally { } finally {
@ -182,7 +182,27 @@ const searchFormClick = (searchData) => {
} }
getList() // getList() //
} }
const seachRef = ref()
const onSearchChange = (field, value)=>{
if(field=='customerCode'){
if(value.length>0){
if(value[value.length-1]=='ALL'){
//
seachRef.value.setFormValues({
customerCode:['ALL']
})
}else{
seachRef.value.setFormValues({
customerCode:value.filter(item=>item!='ALL')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL')})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -4,16 +4,31 @@ import {
CustomerStatementMain, CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data' } from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
let custormList = []
try {
custormList = await CustomerSaleInvoiceMainApi.getCustomerList()
if(custormList.length>0){
custormList.unshift({
customerCode:'ALL',
customerName:t('ts.全选'),
})
}
console.log('custormList11',custormList)
} catch (error) {
}
// 表单校验 // 表单校验
export const CustomerSaleInvoiceMainRules = reactive({ export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required], customerStatementNumber: [required],
customerCode: [required], customerCode: [required],
customerName: [required], customerName: [required],
mainBeforeTaxAmount: [required], beforeTaxAmount: [required],
taxRate: [required], taxRate: [required],
mainTaxAmount: [required], taxAmount: [required],
mainAdTaxAmount: [required], adTaxAmount: [required],
}) })
export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -23,6 +38,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table:{
width:180
}
}, },
{ {
label: '状态', label: '状态',
@ -31,6 +49,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
isForm:false, isForm:false,
// 0:新增1:已发布2已作废 // 0:新增1:已发布2已作废
dictType: DICT_TYPE.CUSTOMER_SALE_INVOICE_TYPE,
dictClass: 'string',
table:{
width:120
}
}, },
{ {
label: '客户对账单', label: '客户对账单',
@ -46,12 +69,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '客户对账单信息', // 查询弹窗标题 searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类 searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法 searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [
{
key: 'status',
value: [5],
isMainValue: false
},
{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }]
} }
},
table:{
width:180
} }
}, },
{ {
@ -63,6 +95,25 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled:true disabled:true
} }
},
search:{
component:'Select',
value:custormList.length>1?[custormList[0]['customerCode']]:[],
componentProps: {
showAll:true,// 备用做全选
multiple:true,
// emptyValues:[null, undefined],
valueOnClear:null,
options:custormList.length>0?custormList.map(item=>({
label:item.customerName,
value:item.customerCode
})):[]
}
},
table:{
width:150
} }
}, },
{ {
@ -73,16 +124,22 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '未税金额', label: '未税金额',
field: 'mainBeforeTaxAmount', field: 'beforeTaxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
@ -98,28 +155,37 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '税额', label: '税额',
field: 'mainTaxAmount', field: 'taxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '价税合计金额', label: '价税合计金额',
field: 'mainAdTaxAmount', field: 'adTaxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '金税票号', label: '金税票号',
field: 'goldenTaxInvoiceNumber', field: 'goldenTaxInvoiceNumber',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '开票日期', label: '开票日期',
@ -141,12 +207,17 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table:{
width:180
}
}, },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '创建时间', label: '创建时间',
@ -162,6 +233,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
isForm: false, isForm: false,
table:{
width:180
}
}, },
{ {
label: '操作', label: '操作',
@ -248,23 +322,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
form: { form: {
componentProps: { componentProps: {
enterSearch: true, type: 'InputNumber',
isSearchList: true, // 开启查询弹窗 precision: 2,
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本 disabled: true
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,
disabled: true
} }
}, },
{ {
@ -274,11 +340,13 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
form: { form: {
componentProps: { componentProps: {
type: 'InputNumber',
disabled: true disabled: true
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
disabled: true
} }
}, },
{ {
@ -325,12 +393,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
type: 'InputNumber',
precision: 2,
disabled: true disabled: true
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,
disabled: true
} }
}, },
{ {
@ -348,5 +419,14 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber', type: 'InputNumber',
} }
}, },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])) ]))

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

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -41,8 +41,9 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true" :isShowButton="false"
fieldTableColumn="itemCode" :isShowReduceButton="false"
:isShowReduceButtonSelection="false"
:rules="CustomerSaleInvoiceMainRules" :rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas" :formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas" :tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
@ -53,7 +54,6 @@
:isBusiness="true" :isBusiness="true"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete" @tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@ -72,11 +72,11 @@
let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2)) let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2))
const sumObject = { const sumObject = {
// //
mainBeforeTaxAmount, beforeTaxAmount:mainBeforeTaxAmount,
// //
mainTaxAmount, taxAmount:mainTaxAmount,
// mainAdTaxAmount =+ // mainAdTaxAmount =+
mainAdTaxAmount:mainBeforeTaxAmount+mainTaxAmount adTaxAmount:mainBeforeTaxAmount+mainTaxAmount
} }
formRef.value.setValues(sumObject) formRef.value.setValues(sumObject)
} }
@ -95,6 +95,9 @@
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage" :apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail" :apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo" :Echo="Echo"
:detailButtonIsShowAddStatusArray="['0']"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -284,71 +287,17 @@ const butttondata = (row,$index) => {
// defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:submit`}), // // 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.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.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.mainListPlanPubBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), //
// defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:customer-sale-invoice-request-main:resetting`}), // // 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.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), //
defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['5']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), // defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['0']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { // if (val == 'mainPlanPub') { //
tableObject.loading = true
CustomerSaleInvoiceMainApi.open(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.close(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanSub') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.submit(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.reject(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanApp') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?') await message.confirm('确认要发布吗?')
tableObject.loading = true tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.id).then(() => { CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
@ -360,11 +309,11 @@ const buttonTableClick = async (val, row) => {
console.log(err) console.log(err)
}) })
} else if (val == 'cancel') { // } else if (val == 'cancel') { //
tableObject.loading = true
try { try {
await message.confirm('确认要作废吗?') await message.confirm('确认要作废吗?')
tableObject.loading = true
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id) await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id)
await message.success(t('ts.作废成功')) message.success(t('common.updateSuccess'))
// //
//exportLoading.value = true //exportLoading.value = true
} catch { } catch {
@ -372,27 +321,22 @@ const buttonTableClick = async (val, row) => {
// //
buttonBaseClick('refresh',null) buttonBaseClick('refresh',null)
} }
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.resetting(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: any) => {
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'customerStatementNumber'){
item.componentProps.disabled = type=='update'
item.componentProps.isSearchList = type!='update'
item.componentProps.enterSearch = type!='update'
}
})
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
} }
@ -577,7 +521,27 @@ const searchFormClick = (searchData) => {
} }
getList() // getList() //
} }
const seachRef = ref()
const onSearchChange = (field, value)=>{
if(field=='customerCode'){
if(value.length>0){
if(value[value.length-1]=='ALL'){
//
seachRef.value.setFormValues({
customerCode:['ALL']
})
}else{
seachRef.value.setFormValues({
customerCode:value.filter(item=>item!='ALL')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL')})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save