完善成本汇总和公司检索
This commit is contained in:
parent
17dae88049
commit
3ce04e6702
@ -79,6 +79,13 @@ export default {
|
|||||||
post: async function (params) {
|
post: async function (params) {
|
||||||
return await http.post(this.url, 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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -199,6 +199,13 @@ export default {
|
|||||||
return await http.post(this.url, params);
|
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:{
|
select:{
|
||||||
url: `${config.API_URL}/organization.name.list`,
|
url: `${config.API_URL}/organization.name.list`,
|
||||||
name: "公司下拉选择",
|
name: "公司下拉选择",
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
list:[{},{},{},{},{}],
|
list:[{},{},{},{},{},{}],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(){
|
setup(){
|
||||||
@ -56,7 +56,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getWsResult(res){
|
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 = {
|
let item = {
|
||||||
type:res.data.type,
|
type:res.data.type,
|
||||||
type_desc:res.data.type_desc,
|
type_desc:res.data.type_desc,
|
||||||
@ -79,6 +79,9 @@ export default {
|
|||||||
if(res.data.type == 19){
|
if(res.data.type == 19){
|
||||||
this.list[4] = item;
|
this.list[4] = item;
|
||||||
}
|
}
|
||||||
|
if(res.data.type == 20){
|
||||||
|
this.list[5] = item;
|
||||||
|
}
|
||||||
this.$emit('updateShow', item);
|
this.$emit('updateShow', item);
|
||||||
|
|
||||||
if(res.data.status==1){
|
if(res.data.status==1){
|
||||||
|
|||||||
@ -130,13 +130,13 @@ export default {
|
|||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
async getSelectType() {
|
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) {
|
if (res.code == 200) {
|
||||||
this.setMap.typeList = res.data;
|
this.setMap.typeList = res.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getSelectCategory() {
|
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) {
|
if (res.code == 200) {
|
||||||
this.setMap.categoryList = res.data;
|
this.setMap.categoryList = res.data;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
width: 90px;
|
width: 85px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -84,7 +84,7 @@ export default {
|
|||||||
.td{
|
.td{
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
width: 90px;
|
width: 85px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
|
|||||||
@ -18,8 +18,8 @@
|
|||||||
<div class="searchItem searchBtn">
|
<div class="searchItem searchBtn">
|
||||||
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
<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>
|
<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">
|
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="20">
|
||||||
<el-button :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button>
|
<el-button :size="size" v-auth="'costSummaryDownload'" icon="sc-icon-Download" @click="exportData">下载</el-button>
|
||||||
</scExport>
|
</scExport>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -74,7 +74,7 @@ export default {
|
|||||||
reqParams:{
|
reqParams:{
|
||||||
page:1,
|
page:1,
|
||||||
pageSize:30,
|
pageSize:30,
|
||||||
date_type:'day',
|
date_type:'month',
|
||||||
dateSelect:[],
|
dateSelect:[],
|
||||||
start:'',
|
start:'',
|
||||||
end:'',
|
end:'',
|
||||||
@ -137,7 +137,32 @@ export default {
|
|||||||
this.feesData = res.data;
|
this.feesData = res.data;
|
||||||
let option = {
|
let option = {
|
||||||
tooltip: {
|
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: {
|
xAxis: {
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
@ -192,13 +217,13 @@ export default {
|
|||||||
|
|
||||||
// 下载导出
|
// 下载导出
|
||||||
exportChangeShow(params){
|
exportChangeShow(params){
|
||||||
if(params.type == 11){
|
if(params.type == 20){
|
||||||
this.exportShow = params.status==0?true:false
|
this.exportShow = params.status==0?true:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async exportData() {
|
async exportData() {
|
||||||
if(this.exportShow) return
|
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){
|
if(res.code == 200){
|
||||||
this.$message.success('开始导出');
|
this.$message.success('开始导出');
|
||||||
}
|
}
|
||||||
@ -211,7 +236,7 @@ export default {
|
|||||||
this.reqParams = {
|
this.reqParams = {
|
||||||
page:1,
|
page:1,
|
||||||
pageSize:30,
|
pageSize:30,
|
||||||
date_type:'day',
|
date_type:'month',
|
||||||
dateSelect:[],
|
dateSelect:[],
|
||||||
start:'',
|
start:'',
|
||||||
end:''
|
end:''
|
||||||
@ -219,9 +244,6 @@ export default {
|
|||||||
this.$refs.scSearch.reload();
|
this.$refs.scSearch.reload();
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
handleSaveSuccess(){
|
|
||||||
// this.$refs.table.refresh();
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -110,9 +110,9 @@ export default {
|
|||||||
searchShow:false,
|
searchShow:false,
|
||||||
searchList:[
|
searchList:[
|
||||||
{name:'开通日期',type:'date',code:'activation_date',show:true},
|
{name:'开通日期',type:'date',code:'activation_date',show:true},
|
||||||
{name:'公司类型',type:'select',code:['company_type'], data:[], placeholder:"请选择公司类型",show:true},
|
{name:'公司类型',type:'select',code:['company_type'],isConstant:true, data:[], placeholder:"请选择公司类型",show:true},
|
||||||
{name:'公司名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:true},
|
{name:'公司名称',type:'multiple',code:'full_name',data:[], placeholder:"请选择公司名称",show:true},
|
||||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",isOpen:true,show:false},
|
{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:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||||
{name:'邮件地址',type:'text',code:['email'],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},
|
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||||
@ -134,15 +134,37 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSelectData(item){
|
async getSelectData(item) {
|
||||||
let {data,params} = item;
|
let {data, params} = item;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
if(data.code == "id"){
|
let searchParams = this.$TOOL.objCopy(params);
|
||||||
this.getCompanyList(data,params)
|
searchParams.field = ""
|
||||||
}else if(data.code == "active_status"){
|
if (typeof data.code === 'string') {
|
||||||
this.getStatusList(data,params);
|
searchParams.field = data.code;
|
||||||
}else if(data.code == "company_type"){
|
} else {
|
||||||
this.getCompanyTypeList(data,params);
|
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;
|
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) {
|
async getCompanyTypeList(data,params) {
|
||||||
const res = await this.$API.system.company.typeSelect.post(params);
|
const res = await this.$API.system.company.typeSelect.post(params);
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user