bodyCenterLeft.vue 2.58 KB
<template>
	<div class="dv-content-body-center-list-left">
		<dv-border-box-12 :dur="35" :color="[, '#ffffff']">
			<div style="width: 100; ">
				<span class="div-span-title">{{ $gl('warehouse location usage status') }} </span>
			</div>
			<div style="width: 100%; height: 85%">
				<dv-scroll-board :config="WarehouselocationTable" style="width: 97%; margin-left: 0.4vw" />
			</div>
		</dv-border-box-12>
	</div>
</template>

<script>
export default {
	data() {
		return {
			sysData: {},
			WarehouselocationTable: null,

			optTableWarehouse: '',
		}
	},
	methods: {
		// 库位使用情况
		getData(flag, dataTable) {
			if (dataTable != null) {
				this.optTableWarehouse = dataTable
			} else {
				this.optTableWarehouse = window.optTableWarehouse
			}
			let urlSuffix = window.baseOnLineOrOff ? '/wms/api/tv/roadWayLocation?zoneCode=L' : 'wms/api/tv/roadWayLocation?zoneCode='
			let opt = {
				urlSuffix: urlSuffix + flag,
				logTitle: '库位使用情况',
				isHanderAjaxSuccessActionLoad: false,
				headers: true
			}
			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
				if (dataTable != null) {
					this.setWarehouselocationDuanzi()
				} else {
					this.setWarehouselocation()
				}
			}
			''.ajax(this, opt, callBackFn)
		},
		setWarehouselocation() {
			let listData = []
			this.sysData.forEach((item) => {
				let bgan = `${item.unHaveContainerNum}/${item.haveContainerNum}`
				listData.push([item.roadWay, item.sumNum, bgan, item.usagerate])
			})
			this.initWarehouselocationTable(listData)
		},
		setWarehouselocationDuanzi() {
			let listData = []
			this.sysData.forEach((item) => {
				listData.push([item.roadWay, item.sumNum, item.haveContainerNum, item.usagerate])
			})
			this.initWarehouselocationTable(listData)
		},

		initWarehouselocationTable(s) {
			this.WarehouselocationTable = {
				header: this.optTableWarehouse.header,
				data: s,
				columnWidth: [150, 150, 190, 150],
				align: this.optTableWarehouse.align,
				headerBGC: '#201e1e', //表头
				oddRowBGC: '#021c66',
				evenRowBGC: '#65,105,225',
				rowNum: 4,
				headerHeight: 25,
				carousel: 'page',
				waitTime: 8000,
			}
		},
		ajaxSuccessDataBefore(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getData')
				this.initWarehouselocationTable([])
				return false
			}
			return true
		},
	},
	mounted() {
		//eslint-disable-next-line no-debugger
		debugger
	},
}
</script>

<style lang="less" scoped>
.dv-content-body-center-list-left {
	width: 33vw;
	height: 95%;
	//background-color: #441f75;
}
</style>