<template>
	<div class="other-msg-box">
		<el-radio-group
			v-model="chooseMsg"
			@change="changeChoose">
			<el-radio :label="1">
				<div style="display: inline-block">
					<el-form
						:inline="true"
						:model="printMsg1"
						class="demo-form-inline">
						<el-form-item label="客户">
							<el-select
								size="small"
								v-model="printMsg1.customerId"
								filterable
								placeholder="客户">
								<el-option
									v-for="item in customerList"
									:key="item.id"
									:label="item.name"
									:value="item.id"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="封箱人员工号">
							<el-input
								v-model="printMsg1.sealWorker"
								size="small"
								placeholder="封箱人员工号"></el-input>
						</el-form-item>
						<el-form-item label="打包人员工号">
							<el-input
								v-model="printMsg1.packWorker"
								size="small"
								placeholder="打包人员工号"></el-input>
						</el-form-item>
						<el-form-item label="流程卡号">
							<el-input
								v-model="printMsg1.processCard"
								size="small"
								style="width: 120px"
								placeholder="流程卡号"></el-input>
						</el-form-item>
						<el-form-item label="托盘规格">
							<el-input
								v-model="printMsg1.pallet"
								size="small"
								style="width: 120px"
								placeholder="托盘规格"></el-input>
						</el-form-item>
						<el-form-item label="备注">
							<el-input
								v-model="printMsg1.remark"
								size="small"
								placeholder="备注"></el-input>
						</el-form-item>
					</el-form>
				</div>
			</el-radio>
			<el-radio :label="2">
				<div style="display: inline-block">
					<el-form
						:inline="true"
						:model="printMsg2"
						class="demo-form-inline">
						<el-form-item label="客户">
							<el-select
								size="small"
								v-model="printMsg2.customerId"
								filterable
								placeholder="客户">
								<el-option
									v-for="item in customerList"
									:key="item.id"
									:label="item.name"
									:value="item.id"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="封箱人员工号">
							<el-input
								v-model="printMsg2.sealWorker"
								size="small"
								placeholder="封箱人员工号"></el-input>
						</el-form-item>
						<el-form-item label="打包人员工号">
							<el-input
								v-model="printMsg2.packWorker"
								size="small"
								placeholder="打包人员工号"></el-input>
						</el-form-item>
						<el-form-item label="流程卡号">
							<el-input
								v-model="printMsg2.processCard"
								size="small"
								style="width: 120px"
								placeholder="流程卡号"></el-input>
						</el-form-item>
						<el-form-item label="托盘规格">
							<el-input
								v-model="printMsg2.pallet"
								size="small"
								style="width: 120px"
								placeholder="托盘规格"></el-input>
						</el-form-item>
						<el-form-item label="备注">
							<el-input
								v-model="printMsg2.remark"
								size="small"
								placeholder="备注"></el-input>
						</el-form-item>
					</el-form>
				</div>
			</el-radio>
			<el-radio :label="3">
				<div style="display: inline-block">
					<el-form
						:inline="true"
						:model="printMsg3"
						class="demo-form-inline">
						<el-form-item label="客户">
							<el-select
								size="small"
								v-model="printMsg3.customerId"
								filterable
								placeholder="客户">
								<el-option
									v-for="item in customerList"
									:key="item.id"
									:label="item.name"
									:value="item.id"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="封箱人员工号">
							<el-input
								v-model="printMsg3.sealWorker"
								size="small"
								placeholder="封箱人员工号"></el-input>
						</el-form-item>
						<el-form-item label="打包人员工号">
							<el-input
								v-model="printMsg3.packWorker"
								size="small"
								placeholder="打包人员工号"></el-input>
						</el-form-item>
						<el-form-item label="流程卡号">
							<el-input
								v-model="printMsg3.processCard"
								size="small"
								style="width: 120px"
								placeholder="流程卡号"></el-input>
						</el-form-item>
						<el-form-item label="托盘规格">
							<el-input
								v-model="printMsg3.pallet"
								size="small"
								style="width: 120px"
								placeholder="托盘规格"></el-input>
						</el-form-item>
						<el-form-item label="备注">
							<el-input
								v-model="printMsg3.remark"
								size="small"
								placeholder="备注"></el-input>
						</el-form-item>
					</el-form>
				</div>
			</el-radio>
		</el-radio-group>
	</div>
</template>
<script>
import { getCustomerList } from '@/api/base/packingInfo';
export default {
	name: 'OtherMsg',
	props: {
		printMsg1: {
			type: Object,
			default: () => ({}),
		},
		printMsg2: {
			type: Object,
			default: () => ({}),
		},
		printMsg3: {
			type: Object,
			default: () => ({}),
		},
	},
	data() {
		return {
			chooseMsg: 1,
			customerList: [],
		};
	},
	mounted() {
		this.getCList();
	},
	methods: {
		getCList() {
			getCustomerList().then((res) => {
				console.log(res);
				console.log('customer');
				this.customerList = res.data;
			});
		},
		changeChoose(val) {
			console.log(val);
			this.$emit('changeChoose', val);
		},
	},
};
</script>
<style lang="scss" scoped>
.other-msg-box {
	.el-radio {
		display: block;
		line-height: 36px;
		.demo-form-inline {
			width: 100%;
			white-space: normal;
		}
		.el-form-item {
			margin-bottom: 0px;
		}
	}
}
</style>
