跨月查询

This commit is contained in:
mll
2026-05-11 09:16:29 +08:00
parent 1c05d2ba54
commit e0a52231ec

View File

@@ -83,16 +83,16 @@
</template> </template>
<template #stdGoodsName=scope> <template #stdGoodsName=scope>
<span v-if="reportCode=='ZHXSQK'" @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.stdGoodsName}}</span> <span v-if="reportCode=='ZHXS_KD' || reportCode=='ZHXSQK'" @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.stdGoodsName}}</span>
<span v-else> {{scope.row.stdGoodsName}}</span> <span v-else> {{scope.row.stdGoodsName}}</span>
</template> </template>
<template #customName=scope> <template #customName=scope>
<span v-if="reportCode=='ZHXSQK'" @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.customName}}</span> <span v-if="reportCode=='ZHXS_KD' || reportCode=='ZHXSQK'" @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.customName}}</span>
<span v-else> {{scope.row.customName}}</span> <span v-else> {{scope.row.customName}}</span>
</template> </template>
<template v-if="reportCode=='ZHXSQK'" #zoneName=scope> <template v-if="reportCode=='ZHXSQK'||reportCode=='ZHXS_KD'" #zoneName=scope>
<span @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.zoneName}}</span> <span @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.zoneName}}</span>
</template> </template>
<template #salerName=scope> <template #salerName=scope>
@@ -182,7 +182,7 @@
style="margin-top: 0;margin-bottom: 0; height: calc(100vh);" style="margin-top: 0;margin-bottom: 0; height: calc(100vh);"
class="report-sale-dialog" class="report-sale-dialog"
title="销售详情" title="销售详情"
v-if="reportCode=='ZHXSQK'" v-if="reportCode=='ZHXSQK'||reportCode=='ZHXS_KD'"
v-model="dialogSaleDetail" v-model="dialogSaleDetail"
width="100%" width="100%"
> >
@@ -650,7 +650,7 @@ const initTable = async () => {
_childConfigs: childFieldConfigs.get(item.fieldCode) || [] _childConfigs: childFieldConfigs.get(item.fieldCode) || []
} }
if(item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y') isSearch.value=true if(item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y') isSearch.value=true
if(!!item.searchDefaultValue){ if(!!item.searchDefaultValue&&config.search){
if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){ if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){
tableSearch.value[config.prop]=getCurrentDate().year.toString() tableSearch.value[config.prop]=getCurrentDate().year.toString()
}else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){ }else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){
@@ -676,13 +676,13 @@ const initTable = async () => {
if(item.fieldName.includes('年')){ if(item.fieldName.includes('年')){
config.searchType='year' config.searchType='year'
config.valueFormat = 'YYYY' config.valueFormat = 'YYYY'
if(props.reportCode=='ZHXSQK'){ if(props.reportCode=='ZHXSQK'||props.reportCode=='ZHXS_KD'){
config.searchSpan=5 config.searchSpan=5
config.searchLabel='年月' config.searchLabel='年月'
yearRange.value.push(item.fieldCode) yearRange.value.push(item.fieldCode)
} }
}else if(item.fieldName.includes('月')){ }else if(item.fieldName.includes('月')){
if(props.reportCode=='ZHXSQK'){ if(props.reportCode=='ZHXSQK'||props.reportCode=='ZHXS_KD'){
monthRange.value.push(item.fieldCode) monthRange.value.push(item.fieldCode)
config.searchSpan=4 config.searchSpan=4
config.search=false config.search=false
@@ -690,10 +690,14 @@ const initTable = async () => {
config.searchType='select' config.searchType='select'
config.dicData=[{label:'1月',value:'1'},{label:'2月',value:'2'},{label:'3月',value:'3'},{label:'4月',value:'4'},{label:'5月',value:'5'},{label:'6月',value:'6'},{label:'7月',value:'7'},{label:'8月',value:'8'},{label:'9月',value:'9'},{label:'10月',value:'10'},{label:'11月',value:'11'},{label:'12月',value:'12'}] config.dicData=[{label:'1月',value:'1'},{label:'2月',value:'2'},{label:'3月',value:'3'},{label:'4月',value:'4'},{label:'5月',value:'5'},{label:'6月',value:'6'},{label:'7月',value:'7'},{label:'8月',value:'8'},{label:'9月',value:'9'},{label:'10月',value:'10'},{label:'11月',value:'11'},{label:'12月',value:'12'}]
} }
if(props.reportCode=='ZHXSQK'&&item.isDimension=='Y'){ if((props.reportCode=='ZHXSQK'||props.reportCode=='ZHXS_KD')&&item.isDimension=='Y'){
tableSearch.value['Group by'].push(item.fieldCode) tableSearch.value['Group by'].push(item.fieldCode)
} }
if(!!item.searchDefaultValue&&props.reportCode=='ZHXSQK'){ if(props.reportCode=='zd_customer'||props.reportCode=='stgoodTop10'){
config.searchSpan=5
yearRange.value.push(item.fieldCode)
}
if(!!item.searchDefaultValue&&props.reportCode=='ZHXSQK' ||props.reportCode=='zd_customer'||props.reportCode=='stgoodTop10'|| props.reportCode=='ZHXS_KD'){
tableSearch.value[config.prop+'Start']=defualtSearch.value[config.prop] tableSearch.value[config.prop+'Start']=defualtSearch.value[config.prop]
tableSearch.value[config.prop+'End']=defualtSearch.value[config.prop] tableSearch.value[config.prop+'End']=defualtSearch.value[config.prop]
defualtSearch.value[config.prop+'Start']=defualtSearch.value[config.prop] defualtSearch.value[config.prop+'Start']=defualtSearch.value[config.prop]
@@ -864,6 +868,7 @@ const sortChange = ({ order, prop }) => {
} }
const getSearchData = () => { const getSearchData = () => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
console.log(tableSearch.value)
let searchObj: any = {} let searchObj: any = {}
// if (tableInfo.value.isPage) { // if (tableInfo.value.isPage) {
const { currentPage, pageSize } = tablePage.value const { currentPage, pageSize } = tablePage.value
@@ -1082,7 +1087,7 @@ const getTableData = async (isLoading = true) => {
if(!!keys.length&&!!tableData.value.length){ if(!!keys.length&&!!tableData.value.length){
let obj={isAmount:true} let obj={isAmount:true}
let value={...tableData.value[0]} let value={...tableData.value[0]}
if(tableInfo.value.reportCode==='ZHXSQK'){ if(tableInfo.value.reportCode==='ZHXSQK'||tableInfo.value.reportCode==='ZHXS_KD'){
value=(await ReportApi.getAggMonthTotalDetail(searchObj))[0] value=(await ReportApi.getAggMonthTotalDetail(searchObj))[0]
// searchObj['usemonth']?'':value.thisMonthSaMoney_s=value.thissamoney_s // searchObj['usemonth']?'':value.thisMonthSaMoney_s=value.thissamoney_s
} }
@@ -1136,6 +1141,7 @@ const getTableData = async (isLoading = true) => {
'InventoryRatio':['产品ID','货品ID','产品名称','产品规格',], 'InventoryRatio':['产品ID','货品ID','产品名称','产品规格',],
'PSI':['产品ID','货品ID','产品名称','产品规格','单位','每件数量'], 'PSI':['产品ID','货品ID','产品名称','产品规格','单位','每件数量'],
'ZHXSQK':['标准品名','客户名称'], 'ZHXSQK':['标准品名','客户名称'],
'ZHXS_KD':['标准品名','客户名称'],
'kcqmltj':['产品名称','规格','商品名','通用名'], 'kcqmltj':['产品名称','规格','商品名','通用名'],
'zd_customer':['客户名称','年月'], 'zd_customer':['客户名称','年月'],
'zhxs-hz':['板块'], 'zhxs-hz':['板块'],