pickupInformation_extend.vue 7.92 KB
<template>
	<div class="app-body">
		<Header title="P1001,P1002" ></Header>
		<div class="dv-content-body" v-for="(item, index) in tableData" :key="index">
			<!-- 主表 -->
			<div class="dv-content-body-head">
				<div class="dv-content-body-head-item">
					<div class="dv-content-body-head-conter">
						<div class="dv-content-body-head-mokuai">
							<div class="dv-content-body-head-mokuai-item">
								<div class="dv-content-body-head-mokuai-left">
									<div class="dv-content-body-head-type">托盘号:{{ item.taskHeader.containerCode }}</div>
								</div>
							</div>
						</div>
						<div class="dv-content-body-head-mokuai">
							<div class="dv-content-body-head-mokuai-item">
								<div class="dv-content-body-head-mokuai-left">
									<div class="dv-content-body-head-type">起始/目标库位:{{ item.taskHeader.fromLocationCode }}/{{ item.taskHeader.toLocationCode }}</div>
								</div>
							</div>
						</div>

						<div class="dv-content-body-head-mokuai">
							<div class="dv-content-body-head-mokuai-item">
								<div class="dv-content-body-head-mokuai-left">
									<div class="dv-content-body-head-type">起始/目标站台:{{ item.taskHeader.fromPortCode }}/{{ item.taskHeader.toPortCode }}</div>
								</div>
							</div>
						</div>

						<div class="dv-content-body-head-mokuai">
							<div class="dv-content-body-head-mokuai-item">
								<div class="dv-content-body-head-mokuai-left">
									<div class="dv-content-body-head-task-type">任务类型:{{ item.taskHeader.userdef1 }}</div>
								</div>
							</div>
						</div>
						<div class="dv-content-body-head-mokuai">
							<div class="dv-content-body-head-mokuai-item">
								<div class="dv-content-body-head-mokuai-left">
									<div class="dv-content-body-head-task-type">任务状态:{{ item.taskHeader.userdef2 }}</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- 明细表-上 -->
			<div class="dv-content-body-detail">
				<div class="dv-content-body-detail-broder">
					<dv-border-box-8 :dur="35" :reverse="setDvBorderBox(index)" :color="[, '#ffffff']">
						<div style="height: 100%; width: 98%; margin-top: 0vw">
							<div class="dv-content-body-detail-conter">
								<div class="box-con-main">
									<dv-scroll-board :config="item.tablePickupConfig" style="width: 100%; height: 100%" />
								</div>
							</div>
						</div>
					</dv-border-box-8>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
import Header from '@/layout/appHead'

export default {
	data() {
		return {
			baseUrlOff: 'http://127.0.0.1:6001/api/BulletinBoard/Mes/V1/ReadData3',
			baseUrlOnLine: window.appConfig.jianxuan,
			sysInitTimeNum: window.appConfig.sysTimeNum,
			sysTimeNum: window.appConfig.sysTimeNum,
			sysData: {},

			//代码降级后,static中js文件的数据使用
			finishProductOne: window.finishProductOne,
			tableData: [],
		}
	},
	components: { Header },
	computed: {},
	methods: {
		// 获取数据
		getData() {
			let opt = {
				urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOff,
				logTitle: '成品库任务信息看板',
				headers: window.baseOnLineOrOff,
				isUrlALL: true,
                isHanderAjaxSuccessActionLoad:true,
			}
			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
				//console.log(this.sysData, 'xx')
				this.setPickupTable()
			}
			''.ajax(this, opt, callBackFn)
		},
		// 解析数据渲染
		setPickupTable() {
			let tempResult = []
			this.sysData.forEach((item) => {
				var tempPickup = { taskHeader: null, tablePickupConfig: {} }
				var tempBodyData = []
				tempPickup.taskHeader = item.taskHeader
				item.taskDetailList.forEach((x) => {
					let temp = []
					temp.push(['【' + x.uniqueCode + '】#【' + x.materialCode + '】#【' + x.materialName + '】#【' + x.qty + '】#【' + x.childQty + '】#【' + x.userdef1 + '】'])
					var val = ''.insertStringEveryNChars(temp, 80)
					let dataList = val.split('#')
					val = dataList.join('')
					tempBodyData.push([val])
				})
				tempPickup.tablePickupConfig = {
					header: this.finishProductOne.header,
					index: true,
					rowNum: 4,
					data: tempBodyData,
					align: this.finishProductOne.align,
					columnWidth: [50, 1200],
					headerHeight: 35,
				}
				tempResult.push(tempPickup)
			})
			this.tableData = tempResult
		},
		setDvBorderBox(index) {
			return index % 2 === 0 ? true : false
		},

		ajaxSuccessDataBefore(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getData')
				this.sysData = []
				this.tableData = [
					{
						header: {
							containerCode: '',
							fromLocationCode: '',
							toLocationCode: '',
							toPortCode: '',
							userdef2: '',
							userdef1: '',
							userdef3: '',
						},
						tablePickupConfig: this.finishProductOne,
					},
				]
				return false
			}

			return true
		},
		intInterval: function() {
			''.intInterval(this, this.sysInitTimeNum, () => {
				this.getData()
			})
		},
	},
	mounted() {
		//eslint-disable-next-line no-debugger
		debugger
		this.getData()

		// 本地一定要测试定时器 会存在数据多次绑定问题4
		this.intInterval()
	},
}
</script>

<style lang="scss" scoped>
.app-body {
	height: 100%;
	width: 100%;

	.dv-content-body {
		width: 98%;
		height: 23.5vw;
		margin: auto;
		.dv-content-body-head {
			height: 14% !important;
			display: flex;
			justify-content: space-between;
			box-sizing: border-box;

			.dv-content-body-head-item {
				font-size: 1.5vw;
				height: 100%;
				width: 100%;
				.dv-content-body-head-conter {
					height: 92%;
					display: flex;

					.dv-content-body-head-mokuai {
						height: 3vw;
						width: 45%;
						display: flex;
						margin: 1vw 0.2vw;
						justify-content: space-between;
						border: 1px solid #868383;
						border-radius: 3px;

						.dv-content-body-head-mokuai-item {
							width: 100%;
							display: flex;
							justify-content: space-between;
							.dv-content-body-head-mokuai-left {
								position: relative;
								width: 100%;
								color: #fff;
								display: flex;
								height: 100%;
								align-items: center;
								margin-left: 1rem;
								.dv-content-body-head-type {
									height: 100%;
									width: 100%;
									line-height: 3.5vw;
									font-size: 1.1vw;
								}
								.dv-content-body-head-task-type {
									height: 100%;
									width: 100%;
									line-height: 3.5vw;
									font-size: 1.3vw;
								}
							}
							.dv-content-body-head-type-data {
								margin: 0.7vw 0vw 0 -3vw;
								width: 65%;
								height: 100%;
								color: #fff;
								font-size: 1.3vw;
							}
						}
					}
				}
			}
		}
	}

	.dv-content-body-detail {
		height: 18.5vw;
		width: 100%;
		display: flex;
		margin: 1vw 0 0 0vw;
		justify-content: space-between;
		box-sizing: border-box;
		position: relative;
		.dv-content-body-detail-broder {
			width: 100%;
			height: 100%;
			.dv-content-body-detail-conter {
				border-radius: 3px;
				height: 100%;

				.box-con-title {
					width: 100%;
					height: 2.5vh;
					display: flex;
					align-items: center;
					padding: 0.3vw;
					color: #ffffff;
				}

				.box-con-main {
					padding: 0.9vw 1vw;
					.box-con-echarts01 {
						width: 100%;
						height: calc(100% - 10vh);
					}
				}

				.box-con-main02 {
					width: 100%;
					height: calc(50% - 4vh);
					margin-top: 0.5vh;
				}
			}

			.box-con-main {
				width: 100%;
				height: calc(100% - 4vh);
				margin-top: 0.5vh;

				.box-con-echarts01 {
					width: 100%;
					height: calc(100% - 10vh);
				}
			}
		}
	}
}
</style>
<style lang="scss">
/*datav-表格-表头样式*/
.app-body {
	.dv-scroll-board .header {
		display: flex;
		flex-direction: row;
		font-size: 1.5vw !important;
		font-weight: 600 !important;
	}
	/*datav-表格-数据样式*/
	.dv-scroll-board .rows .ceil {
		font-size: 1.5vw;
	}
	/*datav-表格-行间距*/
	.dv-scroll-board .rows .row-item {
		padding-top: 2px 0 0 2px;
	}
}
</style>