master
lion 6 months ago
parent 7374388f62
commit 7ef1e60f88

@ -50,20 +50,23 @@
var printObj = result var printObj = result
// var fenleiName = printObj['wuzibianma_material_infos_wuzibianma_relation']['fenlei_detail']? // var fenleiName = printObj['wuzibianma_material_infos_wuzibianma_relation']['fenlei_detail']?
// printObj['wuzibianma_material_infos_wuzibianma_relation']['fenlei_detail']['name']:'' // printObj['wuzibianma_material_infos_wuzibianma_relation']['fenlei_detail']['name']:''
var guige = printObj['wuzibianma_material_infos_wuzibianma_relation']['wuziguige']?printObj['wuzibianma_material_infos_wuzibianma_relation']['wuziguige']:''
var xinghao = printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']?printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']:""
var shunxuhao = printObj['shunxuhao']?"-"+printObj['shunxuhao']:''
$(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;font-size: 16px;font-weight:bold;background-color: #fff;'>" + $(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;font-size: 16px;font-weight:bold;background-color: #fff;'>" +
"<p style='text-align:center;margin-bottom:0;padding-top:5px;'>苏州河道处</p>"+ "<p style='text-align:center;margin-bottom:0;padding-top:5px;'>苏州河道处</p>"+
"<div style='padding:15px;padding-top:5px'>"+ "<div style='padding:5px 15px;'>"+
"<img src='"+printObj['path']+"' style='width:3cm; height:3cm;display: inline-block'>"+ "<img src='"+printObj['path']+"' style='width:3cm; height:3cm;display: inline-block'>"+
"<div style='display:inline-block;vertical-align: top;width:170px'>"+ "<div style='display:inline-block;vertical-align: top;width:170px'>"+
"<p style='margin:0'>类别:"+printObj['material_info_type']+"</p>"+ "<p style='margin:0'>类别:"+printObj['material_info_type']+"</p>"+
"<p style='margin:0'>规格:"+printObj['wuzibianma_material_infos_wuzibianma_relation']['wuziguige']+"</p>"+ "<p style='margin:0'>规格:"+guige+"</p>"+
"<p style='margin:0'>型号:"+printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']+"</p>"+ "<p style='margin:0'>型号:"+xinghao+"</p>"+
"<p style='margin:0'>批次:"+printObj['rukupici']+"</p>"+ "<p style='margin:0'>批次:"+printObj['rukupici']+"</p>"+
"<p style='margin:0'>数量:"+printObj['zaikushuliang']+"</p>"+ "<p style='margin:0'>数量:"+printObj['zaikushuliang']+shunxuhao+"</p>"+
"</div>"+ "</div>"+
"</div>"+ "</div>"+
"<p style='padding:15px;padding-top:5px;text-align:left'>"+printDate+"</p>" "<p style='padding:15px;padding-top:0;margin:0;text-align:left'>"+printDate+"</p>"+
"</li>") "</li>")
// createCode("#page" + index, printObj) // createCode("#page" + index, printObj)
$(".load").remove() $(".load").remove()

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-dialog style="z-index:10001" :visible.sync="dialogVisible" title="数据导入" width="740px"> <el-dialog style="z-index:19009" :visible.sync="dialogVisible" title="数据导入" width="740px">
<div class="title">模板下载</div> <div class="title">模板下载</div>
<el-button <el-button
style="margin-top: 10px" style="margin-top: 10px"
@ -31,7 +31,7 @@
</el-upload> </el-upload>
<div class="title" style="margin-top: 10px;">数据预览</div> <div class="title" style="margin-top: 10px;">数据预览</div>
<Table :data="tableList" :columns="table" style="margin-top: 10px;height:400px;overflow: scroll;" /> <Table :data="tableList" :columns="table" :height="400" style="margin-top: 10px;" />
<div style="font-size: 12px;zoom: 0.8;">总共数据{{ tableList.length }}</div> <div style="font-size: 12px;zoom: 0.8;">总共数据{{ tableList.length }}</div>
<el-button type="primary" size="small" style="margin-top: 10px;" @click="imports"></el-button> <el-button type="primary" size="small" style="margin-top: 10px;" @click="imports"></el-button>
</el-dialog> </el-dialog>
@ -77,6 +77,15 @@ export default {
}) })
console.log('this.table', this.table) console.log('this.table', this.table)
} }
},
dialogVisible(newval){
if(newval){
}else{
this.tableList = []
this.table = []
this.headers = []
}
} }
}, },
methods: { methods: {

@ -7,88 +7,90 @@ import echarts from 'echarts'
export default { export default {
name: 'Pie3DChart', name: 'Pie3DChart',
mounted() { props: {
this.chart = echarts.init(this.$refs.chart2) data: {
this.chart.setOption({ type: Array,
color: ['#6340f3', '#c740f1', '#6dcde6'], default: []
title: {
text: '待办任务',
left: 'center',
textStyle: {
color: '#6dcde6'
} }
}, },
tooltip: { watch:{
trigger: 'item' data(val){
}, if(val){
// legend: { this.initChart()
// orient: 'vertical', this.resizeChart()
// left: 'left' }
// },
series: [{
name: '',
type: 'pie',
radius: '50%',
data: [{
value: 8,
name: '工单'
}, },
{
value: 7,
name: '维修'
}, },
{ mounted() {
value: 8, this.chart = echarts.init(this.$refs.chart2)
name: '盘点' // this.chart.setOption({
} // color: ['#6340f3', '#c740f1', '#6dcde6', '#8800cc'],
], // title: {
emphasis: { // text: '',
itemStyle: { // left: 'center',
shadowBlur: 10, // textStyle: {
shadowOffsetX: 0, // color: '#6dcde6'
shadowColor: '#fff' // }
} // },
} // tooltip: {
}] // trigger: 'item',
}) // formatter: function(params) {
this.resizeChart() // // params.data.unit unit
// return `${params.name} : ${params.value}${params.data.unit ? ' ' + params.data.unit : ''}`;
// }
// },
// // legend: {
// // orient: 'vertical',
// // left: 'left'
// // },
// series: [{
// name: '',
// type: 'pie',
// radius: '50%',
// data: this.data,
// emphasis: {
// itemStyle: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: '#fff'
// }
// }
// }]
// })
// this.resizeChart()
}, },
beforeDestroy() { beforeDestroy() {
if (this.chart) this.chart.dispose() if (this.chart) this.chart.dispose()
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = echarts.init(this.$refs.chart)
const option = { const option = {
title: { title: {
text: 'Referer of a Website', text: '物资数量统计',
subtext: 'Fake Data', left: 'center',
left: 'center' textStyle: {
color: '#6dcde6'
}
}, },
color: ['#6340f3', '#c740f1', '#6dcde6', '#8800cc', '#cc0066', '#ff3366', '#ff6600', '#ff9900'],
tooltip: { tooltip: {
trigger: 'item' trigger: 'item',
}, formatter: function(params) {
legend: { // params.data.unit unit
orient: 'vertical', return `${params.name} : ${params.value}${params.data.unit ? ' ' + params.data.unit : ''}`;
left: 'left' }
}, },
// legend: {
// orient: 'vertical',
// left: 'left',
// },
series: [{ series: [{
name: 'Access From', name: 'Access From',
type: 'pie', type: 'pie',
radius: '50%', radius: '50%',
data: [{ data: this.data,
value: 8,
name: '工单'
},
{
value: 7,
name: '维修'
},
{
value: 8,
name: '盘点'
}
],
emphasis: { emphasis: {
itemStyle: { itemStyle: {
shadowBlur: 10, shadowBlur: 10,

@ -12,12 +12,14 @@
</div> </div>
<div class="jscC-center"> <div class="jscC-center">
<div class="jscC-center-left" > <div class="jscC-center-left" >
<div class="jscC-center-left-title">物资数量统计</div> <Pie3DChart :data="upList"></Pie3DChart>
<div class="jscC-center-left-content"> <!-- <div class="jscC-center-left-title">物资数量统计</div> -->
<div v-for="item in upList"> <!-- <div class="jscC-center-left-content"> -->
<!-- <div v-for="item in upList">
<span>{{item.name}}</span> <span>{{item.name}}</span>
<span>{{item.total}}{{item.unit?item.unit:''}}</span> <span>{{item.total}}{{item.unit?item.unit:''}}</span>
</div> </div> -->
<!-- <Pie3DChart :data="upList"></Pie3DChart> -->
<!-- <span <!-- <span
v-for="item in Object.keys(chartDataMap)" v-for="item in Object.keys(chartDataMap)"
:key="item" :key="item"
@ -26,7 +28,7 @@
> >
{{ item }} {{ item }}
</span> --> </span> -->
</div> <!-- </div> -->
<!-- <Bar3DChart></Bar3DChart> --> <!-- <Bar3DChart></Bar3DChart> -->
<!-- <fenleiChart :chart-data="chartData" /> --> <!-- <fenleiChart :chart-data="chartData" /> -->
</div> </div>
@ -150,7 +152,7 @@ export default {
yData: [], yData: [],
todoList: [{ todoList: [{
id: 'gongdan', id: 'gongdan',
value: '令' value: '令'
}, { }, {
id: 'pandian', id: 'pandian',
value: '盘点' value: '盘点'
@ -210,7 +212,57 @@ export default {
// //
// this.apiData = res.fenleiLevel1 // this.apiData = res.fenleiLevel1
// this.chartDataMap = this.convertFenleiToChartDataMap(this.apiData) // this.chartDataMap = this.convertFenleiToChartDataMap(this.apiData)
this.upList = res.upList // let arr = []
// res.upList.map(item=>{
// arr.push({
// name:item.name,
// value:item.total,
// unit:item.unit
// })
// })
this.upList = this.mergeAndRename(res.upList)
console.log("this.upList",this.upList)
},
mergeAndRename(arr) {
const resultMap = new Map();
let pumpTotal = 0; //
let mobilePumpTotal = 0; //
let pumpUnit = ""; //
//
arr.forEach(item => {
const { name, total, unit } = item;
const value = total;
if (name === "排水类") {
pumpTotal += value;
// unitunit
if (!pumpUnit) pumpUnit = unit;
} else if (name === "移动泵车") {
mobilePumpTotal += value;
//
if (resultMap.has(name)) {
resultMap.get(name).value += value;
} else {
resultMap.set(name, { name, value, unit });
}
} else {
//
if (resultMap.has(name)) {
resultMap.get(name).value += value;
} else {
resultMap.set(name, { name, value, unit });
}
}
});
//
if (pumpTotal > 0) {
const finalPumpValue = pumpTotal - mobilePumpTotal;
resultMap.set("泵", { name: "泵", value: finalPumpValue, unit: pumpUnit });
}
return Array.from(resultMap.values());
}, },
// //
convertFenleiToChartDataMap(fenleiLevel1) { convertFenleiToChartDataMap(fenleiLevel1) {

@ -401,6 +401,14 @@
.map((i) => { .map((i) => {
return i return i
}) })
this.importForm.unshift({
filed:'二级分类',
name:'二级分类'
})
this.importForm.unshift({
filed:'一级分类',
name:'一级分类'
})
} }
} }

@ -70,7 +70,7 @@
<div v-show="activeStep === 1"> <div v-show="activeStep === 1">
<div class="operation-bar" style="margin-bottom: 20px;"> <div class="operation-bar" style="margin-bottom: 20px;">
<el-button size="mini" type="primary" @click="addStockItems"></el-button> <el-button size="mini" type="primary" @click="addStockItems"></el-button>
<!-- <el-button size="mini" type="primary" @click="importsRuku"></el-button> --> <el-button size="mini" type="primary" @click="importsRuku"></el-button>
</div> </div>
<xy-table style="width: 100%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable"> <xy-table style="width: 100%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns> <template v-slot:btns>
@ -392,7 +392,7 @@
const res = await getQingShi({ const res = await getQingShi({
table: tableName, table: tableName,
page: 1, page: 1,
page_size:999, page_size:100,
status: 1, status: 1,
}) })
this.flowList = res.data.flow.data this.flowList = res.data.flow.data
@ -422,8 +422,9 @@
}, },
// //
importsRuku() { importsRuku() {
this.$refs['imports'].show()
this.getField() this.getField()
this.$refs['imports'].show()
}, },
getimportData(e) { getimportData(e) {
console.log('e', e) console.log('e', e)
@ -714,6 +715,14 @@
.map((i) => { .map((i) => {
return i return i
}) })
this.importForm.unshift({
filed:'二级分类',
name:'二级分类'
})
this.importForm.unshift({
filed:'一级分类',
name:'一级分类'
})
} }
} }

Loading…
Cancel
Save