lynn 3 months ago
commit 6aaa72859f

@ -40,3 +40,12 @@ export function homeCharts(params) {
})
}
export function soCharts(params) {
return request({
url: '/api/admin/chart/stocks-and-outbounds',
method: 'get',
params: params
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,8 +1,13 @@
<template>
<div>
<!-- 选择物资编号 -->
<Modal v-model="isShowWuzi" :z-index="10000" width="70" title="库存选择" :loading="showLoading">
<div class="searchCompanys">
<Modal v-model="isShowWuzi" :z-index="10000" width="70" title="库存选择"
@on-visible-change="visibleChange"
:loading="showLoading">
<div class="searchCompanys">
<el-cascader v-model="wuzifenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 60%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
<el-input
v-model="wuzibianmakeyword"
style="margin-right:10px"
@ -18,12 +23,14 @@
type="text"
placeholder="请输入物资名称查找"
@keyup.enter.native="getWuzi"
/>
/>
<el-button type="primary" @click="getWuzi"></el-button>
</div>
<Table
ref="currentRowTable"
:loading="loadingtable"
highlight-row
:columns="wuziColumns"
:data="wzList"
@ -51,16 +58,22 @@
// } from "@/api/system/baseForm.js"
import {
index
} from '@/api/inventory.js'
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
export default {
data() {
return {
//
showLoading: false,
showLoading: false,
loadingtable:false,
isShowWuzi: false,
wuziPageIndex: 1,
wuzibianmakeyword: '',
wuzimingchengkeyword: '',
wuzimingchengkeyword: '',
wuzifenlei:'',
fenleiList:[],
wuziTotal: 0,
wzList: [],
selectItem: {},
@ -125,22 +138,57 @@ export default {
},
watch: {
isShowWuzi(newVal) {
if (newVal) {
if (newVal) {
this.getFenlei()
this.getWuzi()
}else{
this.wzList = []
this.loadingtable = false
this.wuziPageIndex = 1
}
}
},
methods: {
methods: {
async getFenlei() {
const res = await getFenleilist({
tree: 1
})
this.fenleiList = this.removeEmptyChildren(res)
},
changeFenlei(e, row) {
console.log('e', e)
if (e) {
this.wuzifenlei = e[e.length - 1]
} else {
this.wuzifenlei = ''
}
},
// children=[]
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
async getWuzi() {
this.showLoading = true
this.showLoading = true
this.loadingtable = true
const res = await index({
page_size: 40,
page: this.wuziPageIndex,
sort_type: 'DESC',
sort_name: 'wuzibianma',
sort_name: 'wuzibianma',
fenlei:this.wuzifenlei,
// table_name: 'inventorys',
filter: [{
'key': 'zichanmingcheng',
@ -153,7 +201,7 @@ export default {
}]
})
console.log("res.list.data",res.list.data)
let arr = this.processInventoryData(res.list.data)
for (var m of arr) {
m.isSelect = false
@ -161,7 +209,8 @@ export default {
this.wzList = arr
console.log("this.wzList",this.wzList)
this.wuziTotal = res.list.total
this.showLoading = false
this.showLoading = false
this.loadingtable = false
console.log('res', this.wzList)
},
wuziSelect(e) {
@ -180,9 +229,19 @@ export default {
this.selectItem = {}
this.getWuzi()
},
visibleChange(e){
console.log("e",e)
this.selectItem = {}
this.wuziPageIndex = 1
// this.isShowWuzi = false
},
mingxiConfirm() {
if (Object.keys(this.selectItem).length === 0) {
this.isShowWuzi = false
// this.isShowWuzi = false
this.$message({
type: 'warning',
message: '请选择物资'
})
return
}
this.$emit('refresh', this.selectItem)
@ -197,7 +256,7 @@ export default {
processInventoryData(data) {
// wuzileixing =
const matchedData = data
.filter(item => item.wuzileixing === '一物一码' && parseFloat(item.zaikushuliang) !== 0 && parseFloat(item.wait_num)> 0 ); // zaikushuliang !== 0
.filter(item => item.wuzileixing === '一物一码' && parseFloat(item.zaikushuliang) !== 0 && parseFloat(item.wait_num) === 0 ); // zaikushuliang !== 0
//
const unmatchedData = data

@ -7,13 +7,18 @@
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<div class="selector-item">
<span class="selector-item__label">种类编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
<el-input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
</div>
<div class="selector-item">
<span class="selector-item__label">物资名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
<el-input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
</div>
<div>
<el-cascader v-model="select.fenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 20%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
</div>
<div class="selector-item">
<!-- <div class="selector-item">
<span class="selector-item__label">入库数量</span>
<Input v-model="select.rmin" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
@ -24,12 +29,12 @@
<Input v-model="select.min" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
<Input v-model="select.max" clearable style="width: 60px;margin:0 3px" placeholder="" />
</div>
</div> -->
<Button type="primary" style="margin-left: 10px;" @click="getindex"></Button>
<Button type="primary" style="margin-left: 10px;" @click="toprint"></Button>
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
<el-button type="primary" style="margin-left: 10px;" @click="getindex"></el-button>
<el-button type="primary" style="margin-left: 10px;" @click="toprint"></el-button>
<el-button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</el-button>
</div>
</slot>
@ -77,7 +82,10 @@
import {
index,
destroy
} from '@/api/inventory.js'
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
import {
getInfo
} from '@/api/user.js'
@ -110,12 +118,14 @@
authName: '',
roleName: '',
isCkName: '',
isPandian: '',
isPandian: '',
fenleiList:[],
select: {
pageSize: 40,
pageIndex: 1,
keyword: '',
wzbm: '',
wzbm: '',
fenlei:'',
is_export: 0,
min: '',
max: '',
@ -293,7 +303,8 @@
if (path[1]) {
this.isPandian = 'pandian'
}
}
}
this.getFenlei()
this.getField()
this.getindex()
this.getUserName()
@ -442,6 +453,37 @@
search() {
this.select.pageIndex = 1
this.getindex()
},
async getFenlei() {
const res = await getFenleilist({
tree: 1
})
this.fenleiList = this.removeEmptyChildren(res)
},
changeFenlei(e, row) {
console.log('e', e)
if (e) {
this.select.fenlei = e[e.length - 1]
} else {
this.select.fenlei = ''
}
},
// children=[]
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
async getindex() {
this.loading = true
@ -454,7 +496,8 @@
page: this.select.pageIndex,
table_name: 'inventorys',
sort_type: 'DESC',
sort_name: 'wuzibianma',
sort_name: 'wuzibianma',
fenlei:this.select.fenlei,
// is_export:this.select.is_export,
filter: [{
'key': 'wuzibianma',

@ -0,0 +1,230 @@
<template>
<div class="warehouse-table">
<div class="warehouse-table-title">年度物资动态</div>
<!-- Element-UI 表格 -->
<el-table :data="currentPageData" style="width: 100%" height="200" :row-class-name="getRowClass"
:cell-style="{background: 'transparent', border: 'none'}" :header-cell-class-name="'headerRow'">
<el-table-column show-overflow-tooltip prop="type" width="80" label="出入库" align="center" />
<el-table-column show-overflow-tooltip prop="zichanmingcheng" width="120" label="物资名称" align="left" />
<el-table-column show-overflow-tooltip prop="total" width="80" label="数量" align="center" />
<el-table-column show-overflow-tooltip prop="suozaicangku_text" width="100" label="仓库" align="left" />
<el-table-column show-overflow-tooltip prop="riqi" label="时间" width="100" align="left" />
</el-table>
<!-- 四个角的三角形 -->
<div class="corner top-left"></div>
<div class="corner top-right"></div>
<div class="corner bottom-left"></div>
<div class="corner bottom-right"></div>
</div>
</template>
<script>
import {
soCharts
} from '@/api/charts.js'
export default {
name: 'WarehouseTable',
data() {
return {
//
tableData: [],
pageSize: 3, // 3
currentPage: 1, //
timer: null //
}
},
computed: {
//
currentPageData() {
const start = (this.currentPage - 1) * this.pageSize
const end = start + this.pageSize
return this.tableData.slice(start, end)
},
//
totalPages() {
return Math.ceil(this.tableData.length / this.pageSize)
}
},
mounted() {
// 3
this.getChartData()
// this.startTimer()
},
beforeDestroy() {
//
this.clearTimer()
},
methods: {
async getChartData() {
const so = await soCharts()
//
let arr = []
so.map(item => {
arr.push({
suozaicangku_text: item.suozaicangku_text,
type: item.jieyongshuliang ? '出库' : '入库',
total: item.jieyongshuliang ? item.jieyongshuliang : item.rukushuliang,
zichanmingcheng: item.zichanmingcheng,
fenlei_text: item.fenlei_text,
riqi: item.riqi ? item.riqi : item.created_at.substring(0, 10)
})
})
this.tableData = arr
if (this.tableData.length > 0) {
this.startTimer()
}
},
//
nextPage() {
this.currentPage = this.currentPage % this.totalPages + 1
},
//
startTimer() {
this.timer = setInterval(() => {
this.nextPage()
}, 3000)
},
//
clearTimer() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
},
//
getRowClass({
row
}) {
if (row.type === '出库') {
return 'outbound-row';
} else if (row.type === '入库') {
return 'inbound-row';
}
return '';
}
}
}
</script>
<style scoped lang="scss">
.warehouse-table {
width: 100%;
position: relative;
/* 可根据实际调整宽度 */
margin: 0 auto;
border: 1px solid #6dcde6;
box-shadow: inset 0 0 10px 2px #6dcde6;
padding: 20px;
margin-bottom: 20px;
}
/* 四角三角形基础样式 */
.corner {
position: absolute;
width: 0;
height: 0;
border-style: solid;
z-index: 10;
/* 确保显示在表格内容上方 */
}
/* 左上角 */
.top-left {
top: 3px;
left: 3px;
border-width: 10px 10px 0 0;
border-color: #6dcde6 transparent transparent transparent;
}
/* 右上角 */
.top-right {
top: 3px;
right: 3px;
border-width: 0 10px 10px 0;
border-color: transparent #6dcde6 transparent transparent;
}
/* 左下角 */
.bottom-left {
bottom: 3px;
left: 3px;
border-width: 10px 0 0 10px;
border-color: transparent transparent transparent #6dcde6;
}
/* 右下角 */
.bottom-right {
bottom: 3px;
right: 3px;
border-width: 0 0 10px 10px;
border-color: transparent transparent #6dcde6 transparent;
}
::v-deep .el-table {
background: transparent !important;
}
::v-deep .el-table tr {
background: transparent !important;
}
::v-deep .headerRow {
background: transparent !important;
color: #fff;
border: none !important;
}
/* 出库行样式 */
::v-deep .el-table .outbound-row {
background-color: #084d82 !important;
/* 浅红色背景 */
color: #2fb9d6 !important;
/* 红色文字 */
}
/* 入库行样式 */
::v-deep .el-table .inbound-row {
background-color: #37548c !important;
/* 浅绿色背景 */
color: #ef830f !important;
/* 绿色文字 */
}
::v-deep .el-table .el-table__cell {
padding: 10px 0;
}
::v-deep .el-table__body {
border-collapse: separate !important;
border-spacing: 0 5px !important;
table-layout: auto !important;
}
::v-deep .el-table,
.el-table__expanded-cell {
background-color: transparent !important;
}
::v-deep .el-table--enable-row-transition .el-table__body td,
.el-table .cell {
background-color: transparent;
}
/* 移除表格边框 */
// ::v-deep .el-table, .el-table__header-wrapper, .el-table__body-wrapper {
// border: none !important;
// }
// ::v-deep .el-table__header th {
// border-bottom: none !important;
// }
// ::v-deep .el-table__body td {
// border-bottom: none !important;
// }
</style>

@ -5,20 +5,25 @@
<div v-for="item in topObj">
<div class="label">{{ item.label }}</div>
<div class="value">
{{ item.value }}
{{ item.value }} <span style="font-size: 0.2rem;">{{item.unit?item.unit:''}}</span>
<!-- <CountUp :end="item.value" :duration="6" ref="count" /> -->
</div>
</div>
</div>
<div class="jscC-center">
<div class="jscC-center-left" >
<Pie3DChart :data="upList"></Pie3DChart>
<!-- <div class="jscC-center-left-title">物资数量统计</div> -->
<!-- <div class="jscC-center-left-content"> -->
<!-- <div v-for="item in upList">
<div class="jscC-center-top">
<div class="jscC-center-left-title">年度物资动态</div>
<WarehouseTable></WarehouseTable>
</div>
<!-- <Pie3DChart :data="upList"></Pie3DChart> -->
<div class="jscC-center-left-title">重要防汛物资</div>
<div class="jscC-center-left-content">
<div v-for="item in upList">
<img :src="item.img" alt="">
<span>{{item.name}}</span>
<span>{{item.total}}{{item.unit?item.unit:''}}</span>
</div> -->
<span>{{item.value}}{{item.unit?item.unit:''}}</span>
</div>
<!-- <Pie3DChart :data="upList"></Pie3DChart> -->
<!-- <span
v-for="item in Object.keys(chartDataMap)"
@ -28,7 +33,7 @@
>
{{ item }}
</span> -->
<!-- </div> -->
</div>
<!-- <Bar3DChart></Bar3DChart> -->
<!-- <fenleiChart :chart-data="chartData" /> -->
</div>
@ -56,17 +61,21 @@
import Bar3DChart from '../jsc/components/barChart.vue'
import fenleiChart from '../jsc/components/fenleiChart.vue'
import Pie3DChart from '../jsc/components/pieChart.vue'
import echartsMap from './components/mapChart.vue'
import echartsMap from './components/mapChart.vue'
import WarehouseTable from './components/WarehouseTable.vue'
import {
fenleiCharts,
homeCharts
homeCharts,
} from '@/api/charts.js'
export default {
components: {
Bar3DChart,
Pie3DChart,
echartsMap,
fenleiChart
fenleiChart,
WarehouseTable
},
data() {
return {
@ -84,11 +93,13 @@ export default {
topObj: [{
label: '仓库数量',
value: 0,
id: 'cangku_count'
id: 'cangku_count',
unit:'间'
}, {
label: '物资种类',
value: 0,
id: 'wuzizhonglei_count'
id: 'wuzizhonglei_count',
unit:'类'
},
// {
// label: '',
@ -100,22 +111,35 @@ export default {
// id: 'ruku_month_count'
// },
{
label: '应急调度次数',
value: 0,
id: 'yingjidiaodu_count'
}, {
label: '装备总数',
label: '本年度市级调度',
value: 0,
id: 'shebei_count'
id: 'yingjidiaodu_count',
unit:'次'
}, {
label: '盘点',
label: '队伍数量',
value: 0,
id: 'pan_count'
id: 'shebei_count',
unit:'个'
}, {
label: '维护',
label: '队伍出动人次',
value: 0,
id: 'weihu_count'
}],
id: 'shebei_count',
unit:'人次'
}
// {
// label: '',
// value: 0,
// id: 'shebei_count'
// }, {
// label: '',
// value: 0,
// id: 'pan_count'
// }, {
// label: '',
// value: 0,
// id: 'weihu_count'
// },
],
bottomObj: [{
label: '库存管理',
path: '/views/inventorys'
@ -159,7 +183,16 @@ export default {
}, {
id: 'weihu',
value: '维护'
}]
}],
imgList:{
'袋类':require("@/assets/dailei.jpg"),
'排水类':require('@/assets/beng.jpg'),
'土工布类':require('@/assets/tugongbu.jpg'),
'动力及照明类':require('@/assets/zhaoming.jpg'),
'移动泵车':require('@/assets/bengche.jpg'),
'桩类':require('@/assets/zhuanglei.jpg'),
'砂石类':require('@/assets/shashi.jpg'),
},
}
},
computed: {
@ -180,7 +213,6 @@ export default {
this.calculateScreenSize()
window.addEventListener('resize', this.calculateScreenSize)
this.startAutoSwitch()
},
beforeRouteLeave(to, from, next) {
this.$store.dispatch('app/toggleSideBar')
@ -208,18 +240,10 @@ export default {
this.xData.push(item.value)
this.yData.push(home.rate[item.id])
})
console.log(this.xData, this.yData)
//
// this.apiData = res.fenleiLevel1
// this.chartDataMap = this.convertFenleiToChartDataMap(this.apiData)
// let arr = []
// res.upList.map(item=>{
// arr.push({
// name:item.name,
// value:item.total,
// unit:item.unit
// })
// })
console.log(this.xData, this.yData)
res.upList.map(item=>{
item.img = this.imgList[item.name]
})
this.upList = this.mergeAndRename(res.upList)
console.log("this.upList",this.upList)
},
@ -228,30 +252,31 @@ export default {
let pumpTotal = 0; //
let mobilePumpTotal = 0; //
let pumpUnit = ""; //
let pumpImg = this.imgList['排水类']
//
arr.forEach(item => {
const { name, total, unit } = item;
const { name, total, unit, img } = 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 });
resultMap.set(name, { name, value, unit,img });
}
} else {
//
if (resultMap.has(name)) {
resultMap.get(name).value += value;
} else {
resultMap.set(name, { name, value, unit });
resultMap.set(name, { name, value, unit,img });
}
}
});
@ -259,84 +284,12 @@ export default {
//
if (pumpTotal > 0) {
const finalPumpValue = pumpTotal - mobilePumpTotal;
resultMap.set("泵", { name: "泵", value: finalPumpValue, unit: pumpUnit });
resultMap.set("泵", { name: "泵", value: finalPumpValue, unit: pumpUnit,img:pumpImg });
}
return Array.from(resultMap.values());
},
//
convertFenleiToChartDataMap(fenleiLevel1) {
const chartDataMap = {}
this.typeList = []
fenleiLevel1.forEach(level1 => {
const level1Name = level1.value
//
this.typeList.push(level1Name)
const level1Arr = [{
value: level1.details.reduce((sum, d) => sum + (d.total_count || 0), 0), //
name: level1Name
}]
//
const level2Arr = []
//
const level3Arr = [];
(level1.details || []).forEach(level2 => {
// value inventorys total_count
let level2Value = 0;
(level2.inventorys || []).forEach(inv => {
level2Value += Number(inv.total_count) || 0
})
// total_count
if (level2Value === 0) level2Value = level2.total_count || 0
level2Arr.push({
value: level2Value,
name: level2.value
});
//
(level2.inventorys || []).forEach(inv => {
level3Arr.push({
value: inv.total_count,
name: inv.jiliangdanwei,
parent: level2.value
})
})
})
chartDataMap[level1Name] = {
level1: level1Arr,
level2: level2Arr,
level3: level3Arr
}
})
return chartDataMap
},
//
startAutoSwitch() {
clearInterval(this.autoTimer)
let idx = this.typeList.indexOf(this.activeType)
this.autoTimer = setInterval(() => {
idx = (idx + 1) % this.typeList.length
this.activeType = this.typeList[idx]
}, 5000) // 10
},
// 20
stopAutoSwitchAndResumeLater() {
clearInterval(this.autoTimer)
clearTimeout(this.resumeTimer)
this.resumeTimer = setTimeout(() => {
this.startAutoSwitch()
}, 10000) // 20
},
//
handleTypeClick(type) {
this.activeType = type
this.stopAutoSwitchAndResumeLater()
},
setRem() {
// 使100px
const baseSize = 100
@ -430,7 +383,7 @@ export default {
// flex-wrap: wrap;
&-left {
// height: 400px;
&-title {
color: #6dcde6;
text-align: center;
@ -440,12 +393,21 @@ export default {
}
&-content{
width: 450px;
height: 400px;
display:flex;
flex-wrap: wrap;
&>div{
text-align: center;
flex-basis: 50%;
text-align: left;
margin:10px 0;
color:#fff;
font-size: 16px;
display: flex;
align-items: center;
&>img{
width:30px;
height:30px;
margin-right:10px;
}
}
}
.custom-btn {

@ -1,7 +1,8 @@
<template>
<div class="printwrap">
<Modal v-model="isShow" width="70" title="出库">
<div id="printmodal" class="print" :class="{'watermark':!showwatermark}">
<Modal v-model="isShow" width="70" title="出库">
<!-- :class="{'watermark':!showwatermark}" -->
<div id="printmodal" class="print">
<div class="printtitle">苏州市河道管理处物资出库记录单</div>
<div class="printtop">
<span>业务科室:{{ form.jieyongbumen }}</span>
@ -32,7 +33,7 @@
</tr>
<tr class="printbottom">
<td colspan="3" rowspan="3">
<p>业务科室签字区</p>
<p>经办人签字区</p>
<p>
<span></span>
<span></span>
@ -226,11 +227,11 @@ export default {
table_name: this.tableName
})
this.form = res
if (res.zhuangtai == '已办结') {
this.showwatermark = true
} else {
this.showwatermark = false
}
// if (res.zhuangtai == 2) {
// this.showwatermark = true
// } else {
// this.showwatermark = false
// }
this.mingxiList = res.id_outbounds_items_outbounds_id_relation
},
handlePrint() {

@ -2,7 +2,7 @@
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="防汛工单管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" text="应急调令管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Select v-model="select.storages_id" style="width: 200px;margin-right: 10px;" placeholder="所在仓库" clearable>

Loading…
Cancel
Save