<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form-item label="工位编码" prop="locationCode">
|
<el-input
|
v-model="queryParams.locationCode"
|
placeholder="请输入工位编码"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="工位名称" prop="locationName">
|
<el-input
|
v-model="queryParams.locationName"
|
placeholder="请输入工位名称"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item style="float: right">
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>
|
</el-form-item>
|
<transition name="fade">
|
<div v-if="advancedSearchVisible" class="advanced-search">
|
<el-form-item label="产品编码" prop="productCode">
|
<el-input
|
v-model="queryParams.productCode"
|
placeholder="请输入产品编码"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="产品名称" prop="productName">
|
<el-input
|
v-model="queryParams.productName"
|
placeholder="请输入产品名称"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="流程编码" prop="routeCode">
|
<el-input
|
v-model="queryParams.routeCode"
|
placeholder="请输入流程编码"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
</div>
|
</transition>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-plus"
|
size="mini"
|
@click="handleAdd"
|
v-hasPermi="['bs:routeChildInfo:add']"
|
>新增</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="success"
|
plain
|
icon="el-icon-edit"
|
size="mini"
|
:disabled="single"
|
@click="handleUpdate"
|
v-hasPermi="['bs:routeChildInfo:edit']"
|
>修改</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="danger"
|
plain
|
icon="el-icon-delete"
|
size="mini"
|
:disabled="multiple"
|
@click="handleDelete"
|
v-hasPermi="['bs:routeChildInfo:remove']"
|
>删除</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-download"
|
size="mini"
|
@click="handleExport"
|
v-hasPermi="['bs:routeChildInfo:export']"
|
>导出</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-close"
|
size="mini"
|
@click="handleClose"
|
>关闭</el-button>
|
</el-col>
|
</el-row>
|
<el-row>
|
<!-- <el-descriptions class="margin-top" :column="4" label-style="font-weight: bold" content-style="font-weight: bold">-->
|
<!-- <el-descriptions-item label="流程编码">{{this.queryParams.routeCode}}</el-descriptions-item>-->
|
<!-- <el-descriptions-item label="流程名称">{{this.routeInfo[0].routeName}}</el-descriptions-item>-->
|
<!-- <el-descriptions-item label="产品编码">{{this.routeInfo[0].productCode}}</el-descriptions-item>-->
|
<!-- <el-descriptions-item label="产品名称">{{this.routeInfo[0].productName}}</el-descriptions-item>-->
|
<!-- </el-descriptions>-->
|
<el-descriptions class="margin-top" :contentStyle="labelStyle" :column="3" :size="size" border>
|
<el-descriptions-item>
|
<template slot="label">
|
<i class="el-icon-user"></i>
|
流程编码
|
</template>
|
{{this.queryParams.routeCode}}
|
</el-descriptions-item>
|
<el-descriptions-item>
|
<template slot="label">
|
<i class="el-icon-mobile-phone"></i>
|
流程名称
|
</template>
|
{{this.routeInfo[0].routeName}}
|
</el-descriptions-item>
|
<el-descriptions-item>
|
<template slot="label">
|
<i class="el-icon-location-outline"></i>
|
产品编码
|
</template>
|
{{this.routeInfo[0].productCode}}
|
</el-descriptions-item>
|
<el-descriptions-item>
|
<template slot="label">
|
<i class="el-icon-tickets"></i>
|
产品名称
|
</template>
|
{{this.routeInfo[0].productName}}
|
</el-descriptions-item>
|
</el-descriptions>
|
</el-row>
|
|
<el-table border v-loading="loading" :data="routeChildInfoList" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column show-overflow-tooltip="true" label="工位编码" align="center" prop="locationCode" />
|
<el-table-column show-overflow-tooltip="true" label="工位名称" align="center" prop="locationName" />
|
<el-table-column show-overflow-tooltip="true" label="加工顺序" align="center" prop="stepNo" />
|
<el-table-column show-overflow-tooltip="true" label="产品编码" align="center" prop="productCode" />
|
<el-table-column show-overflow-tooltip="true" label="产品名称" align="center" prop="productName" />
|
<el-table-column show-overflow-tooltip="true" label="创建用户" align="center" prop="createBy" />
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
</el-table-column>
|
<el-table-column show-overflow-tooltip="true" label="更改用户" align="center" prop="updateBy" />
|
<el-table-column label="更改时间" align="center" prop="updateTime" width="180">
|
</el-table-column>
|
<el-table-column show-overflow-tooltip="true" label="流程编码" align="center" prop="routeCode" />
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
|
<!-- 添加或修改工艺路线子信息对话框 -->
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<!-- <el-form-item label="主键id" prop="id">-->
|
<!-- <el-input v-model="form.id" placeholder="请输入主键id" />-->
|
<!-- </el-form-item>-->
|
<el-form-item label="流程编码" prop="routeCode">
|
<el-input :disabled="true" v-model="form.routeCode" placeholder="请输入流程编码" />
|
</el-form-item>
|
<el-form-item label="产品编码" prop="productCode">
|
<el-input :disabled="true" v-model="form.productCode" placeholder="请输入产品编码" />
|
</el-form-item>
|
<el-form-item label="产品名称" prop="productName">
|
<el-input :disabled="true" v-model="form.productName" placeholder="请输入产品名称" />
|
</el-form-item>
|
<el-form-item label="工位编码" prop="locationCode">
|
<el-input v-model="form.locationCode" placeholder="请输入工位编码" />
|
</el-form-item>
|
<el-form-item label="工位名称" prop="locationName">
|
<el-input v-model="form.locationName" placeholder="请输入工位名称" />
|
</el-form-item>
|
<el-form-item label="加工顺序" prop="stepNo">
|
<el-input v-model="form.stepNo" placeholder="请输入加工顺序" />
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { listRouteChildInfo, getRouteChildInfo, delRouteChildInfo, addRouteChildInfo, updateRouteChildInfo } from "@/api/main/bs/routeChildInfo";
|
import {listRouteInfo} from "@/api/main/bs/routeInfo";
|
|
export default {
|
name: "RouteChildInfo",
|
data() {
|
return {
|
labelStyle: "width: 300px;",
|
size: 'medium',
|
advancedSearchVisible: false,
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 工艺路线子信息表格数据
|
routeChildInfoList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
productCode: null,
|
productName: null,
|
locationCode: null,
|
locationName: null,
|
routeCode: null
|
},
|
// 表单参数
|
form: {
|
routeCode: "12323",
|
},
|
// 表单校验
|
rules: {
|
id: [
|
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
],
|
locationCode: [
|
{ required: true, message: "工位编码不能为空", trigger: "blur" }
|
],
|
},
|
//父页面信息
|
routeInfo: {
|
}
|
};
|
},
|
created() {
|
let routeCode = this.$route.query.routeCode;
|
this.queryParams.routeCode = routeCode;
|
this.headerInformation();
|
this.getList();
|
console.log(this.routeInfo)
|
},
|
methods: {
|
/** 工艺流程表头信息 */
|
headerInformation() {
|
listRouteInfo(this.queryParams).then(response => {
|
this.routeInfo = response.rows;
|
});
|
},
|
toggleAdvancedSearch() {
|
this.advancedSearchVisible = !this.advancedSearchVisible;
|
},
|
/** 返回按钮操作 */
|
handleClose() {
|
const obj = { path: "/main/bs/routeInfo" };
|
this.$tab.closeOpenPage(obj);
|
},
|
/** 查询工艺路线子信息列表 */
|
getList() {
|
this.loading = true;
|
listRouteChildInfo(this.queryParams).then(response => {
|
this.routeChildInfoList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
id: null,
|
productCode: this.routeInfo[0].productCode,
|
productName: this.routeInfo[0].productName,
|
locationCode: null,
|
locationName: null,
|
stepNo: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
delFlag: null,
|
routeCode: this.queryParams.routeCode
|
};
|
this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.id)
|
this.single = selection.length!==1
|
this.multiple = !selection.length
|
},
|
/** 新增按钮操作 */
|
handleAdd() {
|
console.log(this.routeInfo)
|
this.reset();
|
this.open = true;
|
this.title = "添加工艺路线子信息";
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.reset();
|
const id = row.id || this.ids
|
getRouteChildInfo(id).then(response => {
|
this.form = response.data;
|
this.open = true;
|
this.title = "修改工艺路线子信息";
|
});
|
},
|
/** 提交按钮 */
|
submitForm() {
|
this.$refs["form"].validate(valid => {
|
if (valid) {
|
if (this.form.id != null) {
|
updateRouteChildInfo(this.form).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
this.open = false;
|
this.getList();
|
});
|
} else {
|
addRouteChildInfo(this.form).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getList();
|
});
|
}
|
}
|
});
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const ids = row.id || this.ids;
|
this.$modal.confirm('是否确认删除').then(function() {
|
return delRouteChildInfo(ids);
|
}).then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
}).catch(() => {});
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download('bs/routeChildInfo/export', {
|
...this.queryParams
|
}, `routeChildInfo_${new Date().getTime()}.xlsx`)
|
}
|
}
|
};
|
</script>
|