1 物料产品库存统计表,产品大类下拉选择,数据不显示问题2销售日报表,默认显示当月和上月,其他默认不显示,用户自己勾选显示。2综合销售情况表,客户名称添加下钻。
This commit is contained in:
@@ -86,6 +86,12 @@
|
||||
<span v-if="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>
|
||||
</template>
|
||||
|
||||
<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-else> {{scope.row.customName}}</span>
|
||||
</template>
|
||||
<template v-if="reportCode=='ZHXSQK'" #zoneName=scope>
|
||||
<span @click="openSaleDetail(scope.row)" style="color: rgb(64, 158, 255);cursor: pointer;">{{scope.row.zoneName}}</span>
|
||||
</template>
|
||||
@@ -148,8 +154,9 @@
|
||||
:column="scope.column"
|
||||
></InputTimeRange>
|
||||
</template>
|
||||
<template #header v-if="Object.keys(dimensionFields)?.length">
|
||||
<div style="display:flex;padding-top:10px;margin-bottom:10px;border-top:1px solid #eee;align-items:center;">
|
||||
<template #header v-if="Object.keys(dimensionFields)?.length||reportCode=='zhxs-hz'">
|
||||
<div v-if="Object.keys(dimensionFields)?.length">
|
||||
<div style="display:flex;padding-top:10px;margin-bottom:10px;border-top:1px solid #eee;align-items:center;">
|
||||
<span style="margin-right:10px;">维度:</span>
|
||||
<el-checkbox-group
|
||||
@change="searchDimension" v-model="tableSearch['Group by']"
|
||||
@@ -163,7 +170,23 @@
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;align-items:center;" v-if="reportCode=='zhxs-hz'">
|
||||
<span style="margin-right:10px;">月份:</span>
|
||||
<el-checkbox-group
|
||||
@change="changeMonths" v-model="showMonths"
|
||||
placeholder="请选择内容">
|
||||
<template v-for="(item,key) in zhxsMonths" :key="key">
|
||||
<el-checkbox
|
||||
:value="item.value"
|
||||
:label="item.label">
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</avue-crud>
|
||||
</div>
|
||||
<div v-else class="h-200px" v-loading="!isInit"></div>
|
||||
@@ -222,6 +245,16 @@ const newProps=ref<any>({
|
||||
'samoney_yoy':'lastYearSaMoney',
|
||||
'profit_yoy':'lastYearProfit'
|
||||
})
|
||||
const showMonths=ref<any>([])
|
||||
const changeMonths=(val:any)=>{
|
||||
zhxsMonths.value.forEach((item:any)=>{
|
||||
tableOption.value.column[item.value].hide=true
|
||||
})
|
||||
showMonths.value.forEach((item:any)=>{
|
||||
tableOption.value.column[item].hide=false
|
||||
})
|
||||
|
||||
}
|
||||
const tableSaleInfo=ref<any>([])
|
||||
const tableSaleSearch=ref<any>({})
|
||||
const tableSalePage = ref<any>({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@@ -231,6 +264,7 @@ const route = useRoute()
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { mergeLocaleMessage, t } = useI18n() // 国际化
|
||||
const defualtSearch=ref<any>({})
|
||||
const zhxsMonths=ref<any>([])
|
||||
const transferFields={
|
||||
'zoneName':'salezonename',
|
||||
'saleTypeName':'saletypename',
|
||||
@@ -239,7 +273,8 @@ const transferFields={
|
||||
'customName':'customname',
|
||||
'dosageName':'dosagename',
|
||||
'stdGoodsName':'stdGoodsIdName',
|
||||
'effectName':'effectname'
|
||||
'effectName':'effectname',
|
||||
'classname':'goodsclassname'
|
||||
}
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const isInit = ref(false)
|
||||
@@ -504,7 +539,7 @@ const summaryMethod1=({columns,data})=>{
|
||||
let styleObj={}
|
||||
dictFieldList.value.forEach(item=>{
|
||||
if(row[item.prop]){
|
||||
styleObj['color']=item.dicData.find(d=>d.value===row[item.prop]).cssClass
|
||||
styleObj['color']=item.dicData.find(d=>d.value===row[item.prop])?.cssClass
|
||||
}
|
||||
})
|
||||
return styleObj
|
||||
@@ -643,7 +678,12 @@ const initTable = async () => {
|
||||
if(props.reportCode=='zhxs-hz'&&item.fieldName=='板块'){
|
||||
config.overHidden=false
|
||||
}
|
||||
|
||||
if(props.reportCode=='zhxs-hz'&&config.label.includes('月(万)')){
|
||||
let month=(new Date().getMonth() + 1)+'',lastMonth=(new Date().getMonth() + 1)-1+''
|
||||
if(config.label.includes(month)||config.label.includes(lastMonth)){
|
||||
showMonths.value.push(config.prop)
|
||||
}
|
||||
}
|
||||
if(['年','年度','年份','月','月度','月份','年月'].includes(item.fieldName)&&config.search){
|
||||
config.searchSpan=3
|
||||
if(item.fieldName.includes('年')){
|
||||
@@ -705,7 +745,8 @@ const initTable = async () => {
|
||||
'业务员':'ywyxx',
|
||||
'业务区域':'ywqy',
|
||||
'标准品名':'bzpm',
|
||||
'疗效分类':'effect'
|
||||
'疗效分类':'effect',
|
||||
'产品大类':'cpdl'
|
||||
}
|
||||
|
||||
|
||||
@@ -1097,6 +1138,11 @@ const getTableData = async (isLoading = true) => {
|
||||
})
|
||||
}
|
||||
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
||||
if(props.reportCode=='zhxs-hz'&&!item.hide){
|
||||
if(item.label.includes('月(万)')){
|
||||
zhxsMonths.value.push({value:item.prop,label:item.label.replace('(万)','')})
|
||||
}
|
||||
}
|
||||
})
|
||||
const liveWidthCol={
|
||||
'InventoryRatio':['产品ID','货品ID','产品名称','产品规格',],
|
||||
@@ -1104,7 +1150,8 @@ const getTableData = async (isLoading = true) => {
|
||||
'ZHXSQK':['标准品名','客户名称'],
|
||||
'kcqmltj':['产品名称','规格','商品名','通用名'],
|
||||
'zd_customer':['客户名称','年月'],
|
||||
'zhxs-hz':['板块']
|
||||
'zhxs-hz':['板块'],
|
||||
'stgoodTop10':['产品名称']
|
||||
}
|
||||
Object.keys(tableOption.value.column).forEach(key=>{
|
||||
const showCols=Object.values(tableOption.value.column).filter(item=>!item.hide)
|
||||
@@ -1118,6 +1165,7 @@ const getTableData = async (isLoading = true) => {
|
||||
resolve(data.records)
|
||||
if(props.reportCode=='zhxs-hz'){
|
||||
initMerge()
|
||||
changeMonths()
|
||||
}
|
||||
} finally {
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ const initEcharts = () => {
|
||||
if (echartsType.includes(item.control)) {
|
||||
const dom = document.getElementById(item.prop)
|
||||
echartObj[item.prop] = echarts.init(dom)
|
||||
echartObj[item.prop].setOption(item.chartOption)
|
||||
echartObj[item.prop].setOption(item.chartOption,true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user