master
lion 4 months ago
parent 7374388f62
commit 7ef1e60f88

@ -50,20 +50,23 @@
var printObj = result
// var fenleiName = printObj['wuzibianma_material_infos_wuzibianma_relation']['fenlei_detail']?
// 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;'>" +
"<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'>"+
"<div style='display:inline-block;vertical-align: top;width:170px'>"+
"<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'>型号:"+printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']+"</p>"+
"<p style='margin:0'>规格:"+guige+"</p>"+
"<p style='margin:0'>型号:"+xinghao+"</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>"+
"<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>")
// createCode("#page" + index, printObj)
$(".load").remove()

@ -1,6 +1,6 @@
<template>
<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>
<el-button
style="margin-top: 10px"
@ -31,7 +31,7 @@
</el-upload>
<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>
<el-button type="primary" size="small" style="margin-top: 10px;" @click="imports"></el-button>
</el-dialog>
@ -77,6 +77,15 @@ export default {
})
console.log('this.table', this.table)
}
},
dialogVisible(newval){
if(newval){
}else{
this.tableList = []
this.table = []
this.headers = []
}
}
},
methods: {

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

@ -12,12 +12,14 @@
</div>
<div class="jscC-center">
<div class="jscC-center-left" >
<div class="jscC-center-left-title">物资数量统计</div>
<div class="jscC-center-left-content">
<div v-for="item in upList">
<Pie3DChart :data="upList"></Pie3DChart>
<!-- <div class="jscC-center-left-title">物资数量统计</div> -->
<!-- <div class="jscC-center-left-content"> -->
<!-- <div v-for="item in upList">
<span>{{item.name}}</span>
<span>{{item.total}}{{item.unit?item.unit:''}}</span>
</div>
</div> -->
<!-- <Pie3DChart :data="upList"></Pie3DChart> -->
<!-- <span
v-for="item in Object.keys(chartDataMap)"
:key="item"
@ -26,7 +28,7 @@
>
{{ item }}
</span> -->
</div>
<!-- </div> -->
<!-- <Bar3DChart></Bar3DChart> -->
<!-- <fenleiChart :chart-data="chartData" /> -->
</div>
@ -150,7 +152,7 @@ export default {
yData: [],
todoList: [{
id: 'gongdan',
value: '令'
value: '令'
}, {
id: 'pandian',
value: '盘点'
@ -210,7 +212,57 @@ export default {
//
// this.apiData = res.fenleiLevel1
// 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) {

@ -400,7 +400,15 @@
?.filter((i) => i.list_show)
.map((i) => {
return i
})
})
this.importForm.unshift({
filed:'二级分类',
name:'二级分类'
})
this.importForm.unshift({
filed:'一级分类',
name:'一级分类'
})
}
}

@ -70,7 +70,7 @@
<div v-show="activeStep === 1">
<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="importsRuku"></el-button> -->
<el-button size="mini" type="primary" @click="importsRuku"></el-button>
</div>
<xy-table style="width: 100%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns>
@ -392,7 +392,7 @@
const res = await getQingShi({
table: tableName,
page: 1,
page_size:999,
page_size:100,
status: 1,
})
this.flowList = res.data.flow.data
@ -421,9 +421,10 @@
}
},
//
importsRuku() {
this.$refs['imports'].show()
importsRuku() {
this.getField()
this.$refs['imports'].show()
},
getimportData(e) {
console.log('e', e)
@ -713,6 +714,14 @@
?.filter((i) => i.list_show)
.map((i) => {
return i
})
this.importForm.unshift({
filed:'二级分类',
name:'二级分类'
})
this.importForm.unshift({
filed:'一级分类',
name:'一级分类'
})
}

Loading…
Cancel
Save