完善成本汇总和公司检索

This commit is contained in:
龙运模 2024-09-10 22:15:45 +08:00
parent 17dae88049
commit 3ce04e6702
7 changed files with 90 additions and 53 deletions

View File

@ -79,6 +79,13 @@ export default {
post: async function (params) {
return await http.post(this.url, params);
}
},
summaryExport:{
url: `${config.API_URL}/cost.summary.download`,
name: "成本汇总导出",
post: async function (params) {
return await http.post(this.url, params);
}
},
},
};

View File

@ -199,6 +199,13 @@ export default {
return await http.post(this.url, params);
},
},
field:{
url: `${config.API_URL}/organization.field.list`,
name: "公司检索",
post: async function (params) {
return await http.post(this.url, params);
},
},
select:{
url: `${config.API_URL}/organization.name.list`,
name: "公司下拉选择",

View File

@ -41,7 +41,7 @@ export default {
},
data(){
return{
list:[{},{},{},{},{}],
list:[{},{},{},{},{},{}],
}
},
setup(){
@ -56,7 +56,7 @@ export default {
},
methods:{
getWsResult(res){
if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19)){
if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19 || res.data.type == 20)){
let item = {
type:res.data.type,
type_desc:res.data.type_desc,
@ -79,6 +79,9 @@ export default {
if(res.data.type == 19){
this.list[4] = item;
}
if(res.data.type == 20){
this.list[5] = item;
}
this.$emit('updateShow', item);
if(res.data.status==1){

View File

@ -130,13 +130,13 @@ export default {
return this
},
async getSelectType() {
const res = await this.$API.finance.cost.typeList.post();
const res = await this.$API.finance.cost.typeList.post({type_code:this.form.type_code,category_code:this.form.category_code});
if (res.code == 200) {
this.setMap.typeList = res.data;
}
},
async getSelectCategory() {
const res = await this.$API.finance.cost.categoryList.post();
const res = await this.$API.finance.cost.categoryList.post({type_code:this.form.type_code,category_code:this.form.category_code});
if (res.code == 200) {
this.setMap.categoryList = res.data;
}

View File

@ -65,7 +65,7 @@ export default {
white-space: nowrap;
margin: 0 10px;
line-height: 23px;
width: 90px;
width: 85px;
text-align: left;
color: #606266;
font-weight: 400;
@ -84,7 +84,7 @@ export default {
.td{
white-space: nowrap;
margin: 0 10px;
width: 90px;
width: 85px;
line-height: 23px;
color: #606266;
font-weight: inherit;

View File

@ -18,8 +18,8 @@
<div class="searchItem searchBtn">
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="11">
<el-button :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button>
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="20">
<el-button :size="size" v-auth="'costSummaryDownload'" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport>
</div>
</div>
@ -74,7 +74,7 @@ export default {
reqParams:{
page:1,
pageSize:30,
date_type:'day',
date_type:'month',
dateSelect:[],
start:'',
end:'',
@ -137,7 +137,32 @@ export default {
this.feesData = res.data;
let option = {
tooltip: {
trigger: 'axis'
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
const filteredParams = params.filter(param => param.value !== 0);
const formattedParams = filteredParams.map(param => {
const seriesColor = param.color;
return `<span style="display: flex;justify-content: space-between"><span><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${seriesColor};"></span> ${param.seriesName} </span><span style="font-weight: 500;margin-left: 10px">${param.value}</span></span>`;
}).join('');
return params[0].name + '<br/>' + formattedParams;
}
},
toolbox:{
show:true,
feature: {
magicType: { type: ['line', 'bar'] },
}
},
grid:{
bottom:40,
left:10,
},
legend:{
show:true,
bottom:10
},
xAxis: {
boundaryGap: false,
@ -192,13 +217,13 @@ export default {
//
exportChangeShow(params){
if(params.type == 11){
if(params.type == 20){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
const res = await this.$API.finance.cost.summaryExport.post(this.reqParams);
if(res.code == 200){
this.$message.success('开始导出');
}
@ -211,7 +236,7 @@ export default {
this.reqParams = {
page:1,
pageSize:30,
date_type:'day',
date_type:'month',
dateSelect:[],
start:'',
end:''
@ -219,9 +244,6 @@ export default {
this.$refs.scSearch.reload();
this.getData();
},
handleSaveSuccess(){
// this.$refs.table.refresh();
},
}
}
</script>

View File

@ -110,9 +110,9 @@ export default {
searchShow:false,
searchList:[
{name:'开通日期',type:'date',code:'activation_date',show:true},
{name:'公司类型',type:'select',code:['company_type'], data:[], placeholder:"请选择公司类型",show:true},
{name:'公司名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:true},
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",isOpen:true,show:false},
{name:'公司类型',type:'select',code:['company_type'],isConstant:true, data:[], placeholder:"请选择公司类型",show:true},
{name:'公司名称',type:'multiple',code:'full_name',data:[], placeholder:"请选择公司名称",show:true},
{name:'状态',type:'select',code:['active_status'],isConstant:true, data:[], placeholder:"请选择状态",isOpen:true,show:false},
{name:'手机号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
@ -134,15 +134,37 @@ export default {
}
})
},
getSelectData(item){
let {data,params} = item;
async getSelectData(item) {
let {data, params} = item;
this.params = params;
if(data.code == "id"){
this.getCompanyList(data,params)
}else if(data.code == "active_status"){
this.getStatusList(data,params);
}else if(data.code == "company_type"){
this.getCompanyTypeList(data,params);
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.code === 'string') {
searchParams.field = data.code;
} else {
searchParams.field = data.code[0];
}
if (data.type == 'select' || data.type == 'multiple') {
const res = await this.$API.system.company.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
if(data.isConstant){
item.label = item[data.code+'_display'];
item.value = item[data.code];
}else{
item.label = item[data.code];
item.value = item.id;
item.id = item[data.code];
}
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
}
},
//
@ -152,31 +174,7 @@ export default {
this.setMap['companyType'] = res.data;
}
},
async getCompanyList(data,params) {
const res = await this.$API.system.company.select.post(params);
if(res.data && res.data.length>0){
res.data.forEach(item=>{
item.label = item.full_name;
})
}
if(res.code == 200){
this.searchList.forEach(item=>{
if(item.code == data.code){
item.data = res.data;
}
})
}
},
async getStatusList(data,params) {
const res = await this.$API.oss.status.post(params);
if(res.code == 200){
this.searchList.forEach(item=>{
if(item.code == data.code){
item.data = res.data;
}
})
}
},
async getCompanyTypeList(data,params) {
const res = await this.$API.system.company.typeSelect.post(params);
if (res.data && res.data.length > 0) {