综合销售表标准品名下钻销售详情
This commit is contained in:
@@ -76,6 +76,9 @@ export const getTableList = (reportCode, data?, isOpen?) => {
|
||||
return request.post({ url: `/lideeyunji/${isOpen ? 'open/report' : 'report-data'}/list/${reportCode}`, data })
|
||||
}
|
||||
|
||||
export const getTableInfo = ( data) => {
|
||||
return request.postOriginal({ url: `/lideeyunji/agg/month/record`, data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量获取报表数据
|
||||
|
||||
@@ -71,7 +71,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #stdGoodsName=scope>
|
||||
{{scope.row.stdGoodsName}}
|
||||
|
||||
<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 v-for="prop in numberRange" :key="prop" #[`${prop}-search`]="scope">
|
||||
<InputNumberRange
|
||||
@@ -80,6 +82,7 @@
|
||||
:column="scope.column"
|
||||
></InputNumberRange>
|
||||
</template>
|
||||
|
||||
<template v-for="prop in dateRange" :key="prop" #[`${prop}-search`]="scope">
|
||||
<InputDateRange
|
||||
v-model="tableSearch[prop]"
|
||||
@@ -121,7 +124,7 @@
|
||||
:column="scope.column"
|
||||
></InputDateTimeRange>
|
||||
</template>
|
||||
<template v-for="prop in timeRange" :key="prop" #[`${prop}-search`]="scope">
|
||||
<template v-for="prop in timeRange" :key="prop" #[`${prop}-search`]="scope">
|
||||
<InputTimeRange
|
||||
v-model="tableSearch[prop]"
|
||||
:size="scope.size"
|
||||
@@ -147,6 +150,25 @@
|
||||
</avue-crud>
|
||||
</div>
|
||||
<div v-else class="h-200px" v-loading="!isInit"></div>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
style="margin-top: 0;margin-bottom: 0; height: calc(100vh);"
|
||||
class="report-sale-dialog"
|
||||
title="销售详情"
|
||||
v-if="reportCode=='ZHXSQK'"
|
||||
v-model="dialogSaleDetail"
|
||||
width="100%"
|
||||
>
|
||||
<avue-crud
|
||||
:data="tableSaleInfo"
|
||||
:option="tableSaleOption"
|
||||
v-model:page.sync="tableSalePage"
|
||||
@refresh-change="refreshSaleChange"
|
||||
@size-change="sizeSaleChange"
|
||||
@current-change="currentSaleChange"
|
||||
ref="crudRef"
|
||||
v-model:search="tableSaleSearch"></avue-crud>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as ReportApi from '@/api/design/report'
|
||||
@@ -173,6 +195,9 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
return {}
|
||||
}
|
||||
})
|
||||
const tableSaleInfo=ref<any>([])
|
||||
const tableSaleSearch=ref<any>({})
|
||||
const tableSalePage = ref<any>({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const windowSize = useWindowSize()
|
||||
const { wsCache } = useCache()
|
||||
const route = useRoute()
|
||||
@@ -191,7 +216,19 @@ const transferFields={
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const isInit = ref(false)
|
||||
const isSearch = ref(false)
|
||||
const tableSaleOption = ref<any>({
|
||||
menu: false,
|
||||
addBtn: false,
|
||||
border: true,
|
||||
stripe:true,
|
||||
index:false,
|
||||
columnBtn:false,
|
||||
searchBtnText:'查询',
|
||||
column: {
|
||||
|
||||
}
|
||||
})
|
||||
const tableSaleData = ref<any>([])
|
||||
const tableHeightRef = ref<any>(null)
|
||||
const tableOption = ref<any>({})
|
||||
const tableData = ref<any>([])
|
||||
@@ -221,11 +258,62 @@ const hideFeilds= ref<any>({})
|
||||
const hideCols=ref<any>([])
|
||||
const dictFieldList=ref<any>([])
|
||||
const textAlignFiels=ref<any>({})
|
||||
const dialogSaleDetail=ref(false)
|
||||
|
||||
const permissions =
|
||||
wsCache.get(CACHE_KEY.USER).lideeYunJipermissions?.[route.meta.menuDataId as string] || false
|
||||
const selectIds = computed(() => {
|
||||
return tableSelect.value.map((item) => item['id'])
|
||||
})
|
||||
const openSaleDetail=(row)=>{
|
||||
|
||||
tablePage.value={
|
||||
currentPage: 1, pageSize: 50, total: 0
|
||||
}
|
||||
const {useMonthEnd,useMonthStart,useYearEnd,useYearMonthEnd,useYearMonthStart,useYearStart}=tableSaleSearch.value
|
||||
tableSaleSearch.value={
|
||||
...row,useMonthEnd,useMonthStart,useYearEnd,useYearMonthEnd,useYearMonthStart,useYearStart
|
||||
}
|
||||
if(useMonthEnd&&useMonthStart&&useYearEnd&&useYearMonthEnd&&useYearMonthStart&&useYearStart){
|
||||
tableSaleSearch.value['ny']=useYearStart+'-'+(useYearMonthStart>10?'':'0')+useYearMonthStart+'~'+useYearMonthEnd+'-'+(useYearMonthEnd>10?'':'0')+useYearMonthEnd
|
||||
}
|
||||
getSaleInfo(row)
|
||||
}
|
||||
|
||||
const refreshSaleChange=()=>{
|
||||
getSaleInfo()
|
||||
}
|
||||
const sizeSaleChange=(val)=>{
|
||||
tablePage.value.pageSize=val
|
||||
getSaleInfo(row)
|
||||
}
|
||||
const currentSaleChange=(val)=>{
|
||||
tablePage.value.currentPage=val
|
||||
getSaleInfo()
|
||||
}
|
||||
const getSaleInfo=async ()=>{
|
||||
let res = await ReportApi.getTableInfo({
|
||||
...tableSaleSearch.value,
|
||||
pageNo:tableSalePage.value.currentPage,
|
||||
pageSize:tableSalePage.value.pageSize
|
||||
})
|
||||
tableSaleOption.value.height='calc(100vh - 160px)'
|
||||
fieldList.value.forEach(item=>{
|
||||
if(Object.keys(res.records[0]).includes(item.fieldCode)){
|
||||
let config={
|
||||
prop:item.fieldCode,
|
||||
label:item.fieldName,
|
||||
width:item.width?item.width+'px':item.fieldName=='产品名称'?'200px':undefined,
|
||||
align:'center',
|
||||
}
|
||||
|
||||
tableSaleOption.value.column[item.fieldCode]=config
|
||||
}
|
||||
})
|
||||
tableSaleInfo.value=res.records
|
||||
tableSalePage.value.total=res.total
|
||||
dialogSaleDetail.value=true
|
||||
}
|
||||
const remoteMethod= async(query,column)=>{
|
||||
if(!query){
|
||||
return
|
||||
@@ -493,6 +581,7 @@ const initTable = async () => {
|
||||
'业务员':'ywyxx',
|
||||
'业务区域':'ywqy',
|
||||
'标准品名':'bzpm',
|
||||
'疗效分类':'zhxs-lxfl'
|
||||
}
|
||||
|
||||
|
||||
@@ -510,8 +599,10 @@ const initTable = async () => {
|
||||
}
|
||||
ReportApi.getTableList(jkTableDicFields[item.fieldName],{pageSize: 50, pageNo:1}).then(res=>{
|
||||
config.dicData=formatterData(res)
|
||||
console.log(config.dicData)
|
||||
})
|
||||
config.formatterDic=formatterData
|
||||
|
||||
searchReportSlots.value.push(config.prop)
|
||||
// config.multiple?tableSearch.value[config.prop]=item.searchDefaultValue?item.searchDefaultValue.split(','):[]:''
|
||||
}
|
||||
@@ -995,6 +1086,8 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
:deep(.el-form-item--default){
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,9 @@
|
||||
.el-dialog {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.el-dialog.report-sale-dialog {
|
||||
padding: var(--el-dialog-padding-primary) !important;
|
||||
}
|
||||
.avue-text-ellipsis__text {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user