Browse Source

销售开票功能

intex
yufei_wang 1 week 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 })
}
}
// 查询客户销售开票子信息表(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)详情
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 })
}
}
// 导出销售开票记录 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 = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
@ -66,8 +75,8 @@ export const importTemplate = () => {
export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/wms/customer-sale-invoice-main/senior', data })
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-record-main/senior', data })
} else {
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) => {
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', // 收货确认状态
LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典)
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,
} from '../moldAllocation/customerStatement/customerStatementMain.data'
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({
customerStatementNumber: [required],
@ -25,12 +41,13 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '状态',
field: 'status',
label: '申请单号',
sort: 'custom',
isSearch: true,
isForm:false,
// 0:新增1:已发布2已作废
field: 'requestNumber',
table:{
width:150
}
},
{
label: '客户对账单',
@ -52,6 +69,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false
}]
}
},
table:{
width:180
}
},
{
@ -63,6 +83,25 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
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: {
disabled: true
}
},
table:{
width:150
}
},
{
@ -83,6 +125,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
@ -114,12 +159,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
table:{
width:150
}
},
{
label: '开票日期',
@ -141,6 +192,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table:{
width:180
}
},
{
@ -148,21 +202,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
// {
// label: '创建时间',
// field: 'createTime',
// sort: 'custom',
// formatter: dateFormatter,
// search: {
// component: 'DatePicker',
// componentProps: {
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
// }
// },
// isForm: false,
// },
]))
// 表单校验
export const CustomerSaleInvoiceDetailRules = reactive({
@ -237,22 +291,6 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'qty',
sort: 'custom',
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: {
type: 'InputNumber',
precision: 2,

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

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap>
<!-- 列表头部 -->
@ -45,7 +45,7 @@
:detailAllSchemasRules="CustomerSaleInvoiceDetailRules"
:apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail"
:apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceRecordDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
@ -149,7 +149,7 @@ const handleExport = async () => {
//
loadStart()
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`)
} catch {
} finally {
@ -182,7 +182,27 @@ const searchFormClick = (searchData) => {
}
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 () => {
getList()

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

@ -4,16 +4,31 @@ import {
CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data'
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({
customerStatementNumber: [required],
customerCode: [required],
customerName: [required],
mainBeforeTaxAmount: [required],
beforeTaxAmount: [required],
taxRate: [required],
mainTaxAmount: [required],
mainAdTaxAmount: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -23,6 +38,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
isForm: false,
table:{
width:180
}
},
{
label: '状态',
@ -31,6 +49,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
isForm:false,
// 0:新增1:已发布2已作废
dictType: DICT_TYPE.CUSTOMER_SALE_INVOICE_TYPE,
dictClass: 'string',
table:{
width:120
}
},
{
label: '客户对账单',
@ -46,12 +69,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
searchCondition: [
{
key: 'status',
value: [5],
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
table:{
width:180
}
},
{
@ -63,6 +95,25 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
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: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '未税金额',
field: 'mainBeforeTaxAmount',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
@ -98,28 +155,37 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '税额',
field: 'mainTaxAmount',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '价税合计金额',
field: 'mainAdTaxAmount',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
table:{
width:150
}
},
{
label: '开票日期',
@ -141,12 +207,17 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table:{
width:180
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table:{
width:150
}
},
{
label: '创建时间',
@ -162,6 +233,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
isForm: false,
table:{
width:180
}
},
{
label: '操作',
@ -248,23 +322,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
type: 'InputNumber',
precision: 2,
disabled: true
}
},
tableForm: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
{
@ -274,11 +340,13 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
form: {
componentProps: {
type: 'InputNumber',
disabled: true
}
},
tableForm: {
type: 'InputNumber',
disabled: true
}
},
{
@ -325,12 +393,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
form: {
componentProps: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
tableForm: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
{
@ -348,5 +419,14 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
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>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap>
<!-- 列表头部 -->
@ -41,8 +41,9 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:isShowButton="false"
:isShowReduceButton="false"
:isShowReduceButtonSelection="false"
:rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
@ -53,7 +54,6 @@
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@ -72,11 +72,11 @@
let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2))
const sumObject = {
//
mainBeforeTaxAmount,
beforeTaxAmount:mainBeforeTaxAmount,
//
mainTaxAmount,
taxAmount:mainTaxAmount,
// mainAdTaxAmount =+
mainAdTaxAmount:mainBeforeTaxAmount+mainTaxAmount
adTaxAmount:mainBeforeTaxAmount+mainTaxAmount
}
formRef.value.setValues(sumObject)
}
@ -95,6 +95,9 @@
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo"
:detailButtonIsShowAddStatusArray="['0']"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
@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.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.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.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'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), //
defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['0']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
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') { //
if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
@ -360,11 +309,11 @@ const buttonTableClick = async (val, row) => {
console.log(err)
})
} else if (val == 'cancel') { //
tableObject.loading = true
try {
await message.confirm('确认要作废吗?')
tableObject.loading = true
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id)
await message.success(t('ts.作废成功'))
message.success(t('common.updateSuccess'))
//
//exportLoading.value = true
} catch {
@ -372,27 +321,22 @@ const buttonTableClick = async (val, row) => {
//
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') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
}
}
/** 添加/修改操作 */
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 = [] //
formRef.value.open(type, row)
}
@ -577,7 +521,27 @@ const searchFormClick = (searchData) => {
}
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 () => {
getList()

Loading…
Cancel
Save