// 新增公开派单
<template>
	<div class="steel_inbound">
		<div class="sache">
			<el-input placeholder="请输入内容" v-model="inputText" clearable>
			</el-input>
			<el-button type="primary" class="btn">
				<i class="el-icon-search"></i>查询
			</el-button>
			<el-button type="primary" class="btn" @click="Issue">
				<i class="el-icon-download"></i>新增
			</el-button>
		</div>
		<dilTable v-bind.sync="options" @selection-change="selectionChange">
		</dilTable>
	</div>
</template>
</div>
</div>
</template>
<script>
	export default {
		data() {
			return {
				inputText: "",
				options: {
					// first请求数据的地址
					requestUrl: "/api/v1/ams/getAmsSaleOrderMaterial?apiId=182&status=1",
					selectionType: "select",
					mapList: [],
				},
			}
		},
		methods: {
			selectionChange(selection) {
				this.options.mapList = selection
			},
			Issue() {
				console.log(this.first.mapList)
				this.$confirm("是否下发", "提示", {
						confirmButtonText: "确定",
						cancelButtonText: "取消",
						type: "warning",
						center: true,
					})
					.then(() => {
						this.axios
							.post("/api/v1/ams/addFixedAmsDispatchSaleOrder", this.options.mapList)
							.then((res) => {
								if (res.data.code == 200) {
									this.$message({
										type: "success",
										message: "下发成功!",
									});
									this.$router.go(0);
								} else {
									this.$message({
										message: "下发失败",
										type: "warning",
									});
								}
							});
					})
					.catch(() => {
						this.$message({
							type: "info",
							message: "取消下发!",
						});
					});
				// this.$router.push("/path/addHomeworkPath/");
			},

		}
	}
</script>
<style lang="scss" scode>
	.steel_inbound {
		.sache {
			padding: 1.25rem 0.375rem;
			.el-input {
			width: 20%;
			margin-right: 1.25rem;
			}
		}
	}
</style>
