footerCenter.vue 2.94 KB
<template>
	<div class="dv-content-body-bottom-list-center">
		<dv-border-box-12 :dur="35">
			<div style="width: 100; height: 10%">
				<span class="div-span-title">生产信息</span>
			</div>
			<div style="width: 100%; height: 88%">
				<dv-scroll-board :config="productionInformationTable" style="width: 97%; margin-top: -0.2vw; margin-left: 0.4vw" />
			</div>
		</dv-border-box-12>
	</div>
</template>

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

			productionInformationTable: null,
			optTableproductionInformation: '',
			productionInformation: {
				header: ['设备', '产量', '工件', '工位'],
				// data: [
				// 	['成品仓', '102', '锥套', '激光下料'],
				// 	['成品仓', '148', '底折弯板', '下料切割'],
				// 	['成品仓', '305', '支撑架2', '叶片焊接'],
				// 	['成品仓', '278', '底折弯板', '下料切割'],
				// 	['成品仓', '409', '底折弯板', '下料切割'],
				// 	['成品仓', '306', '支撑架2', '叶片焊接'],
				// ],
				align: ['left'],
				headerBGC: '#201e1e', //表头
				oddRowBGC: '#021c66',
				evenRowBGC: '#65,105,225',
				rowNum: 5,
				columnWidth: [130, 90, 120, 80],
				headerHeight: 25,
				carousel: 'page',
				waitTime: 8000,
			},
		}
	},
	methods: {
		// 生产情况
		getData(flag, dataList) {
			if (dataList != undefined) {
				this.optTableproductionInformation = dataList
			} else {
				this.optTableproductionInformation = window.optTableproductionInformation
			}
			//console.log(dataList);
			let urlSuffix = window.baseOnLineOrOff ? 'api/BulletinBoard/Mes/V1/ReadData5' : '/wms/api/mobile/produceSituation?zoneCode='
			let opt = {
				urlSuffix: urlSuffix + flag,
				logTitle: '生产情况',
			}
			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
				this.setproductionInformation()
			}
			''.ajax(this, opt, callBackFn)
		},
		setproductionInformation() {
			let listData = []
			this.sysData.forEach((item) => {
				listData.push([item.materialCode, item.inventorySumQty, item.sumCosumeQty, item.sumNeedQty])
			})
			this.initproductionInformationTable(listData)
		},
		initproductionInformationTable(e) {
			this.productionInformationTable = {
				header: this.optTableproductionInformation.header,
				data: e,
				align: this.optTableproductionInformation.align,
				headerBGC: '#201e1e', //表头
				oddRowBGC: '#021c66',
				evenRowBGC: '#65,105,225',
				rowNum: 4,
				columnWidth: [130, 90, 120, 80],
				headerHeight: 25,
				carousel: 'page',
				waitTime: 8000,
			}
		},
		ajaxSuccessDataBefore(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getData')
				this.initproductionInformationTable([])
				return false
			}
			return true
		},
	},
	mounted() {
		//eslint-disable-next-line no-debugger
		debugger
	},
}
</script>

<style scoped>
.dv-content-body-bottom-list-center {
	width: 33vw;
	height: 95%;
	/* background-color: #a5c8ca; */
}
</style>