| | |
| | | //此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 |
| | | import RobotSelect from './extend/RobotSelect.vue'; |
| | | |
| | | let extension = { |
| | | components: { |
| | | //查询界面扩展组件 |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridBody: RobotSelect, |
| | | gridFooter: '', |
| | | //新建、编辑弹出框扩展组件 |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | modelHeader: "", |
| | | modelBody: "", |
| | | modelFooter: "", |
| | | }, |
| | | tableAction: '', |
| | | tableAction: "", |
| | | buttons: { view: [], box: [], detail: [] }, |
| | | methods: { |
| | | onInit() { |
| | | // 添加MES操作列 |
| | | this.columns.push({ |
| | | title: '操作', |
| | | field: '操作', |
| | | align: 'center', |
| | | title: "操作", |
| | | field: "操作", |
| | | align: "center", |
| | | width: 200, |
| | | fixed: 'right', |
| | | fixed: "right", |
| | | render: (h, { row, column, index }) => { |
| | | return ( |
| | | <div> |
| | |
| | | >解绑</el-button> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 托盘组盘操作 |
| | | async handleBind(row) { |
| | | try { |
| | | await this.$confirm(`确认执行托盘组盘操作?\n托盘编号:${row.palletCode}`, "组盘确认", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }); |
| | | |
| | | const result = await this.http.post("/api/StockInfoDetail/BindContainer", { |
| | | palletCode: row.palletCode |
| | | }, "正在调用MES接口..."); |
| | | |
| | | if (result.status) { |
| | | this.$Message.success(result.message || "托盘组盘成功"); |
| | | this.$refs.table.load(); |
| | | } else { |
| | | this.$error(result.message || "托盘组盘失败"); |
| | | } |
| | | } catch (error) { |
| | | if (error !== "cancel") { |
| | | this.$error(error.message || "网络错误,请稍后重试"); |
| | | } |
| | | } |
| | | handleBind(row) { |
| | | this.$refs.gridBody.open('bind', row); |
| | | }, |
| | | |
| | | // 托盘进站操作 |
| | | async handleInbound(row) { |
| | | try { |
| | | await this.$confirm(`确认执行托盘进站操作?\n托盘编号:${row.palletCode}`, "进站确认", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }); |
| | | await this.$confirm( |
| | | `确认执行托盘进站操作?\n托盘编号:${row.palletCode}`, |
| | | "进站确认", |
| | | { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }, |
| | | ); |
| | | |
| | | const result = await this.http.post("/api/StockInfo/inboundInContainer", { |
| | | palletCode: row.palletCode, |
| | | stockId: row.id |
| | | }, "正在调用MES接口..."); |
| | | const result = await this.http.post( |
| | | "/api/StockInfo/inboundInContainer", |
| | | { |
| | | palletCode: row.palletCode, |
| | | stockId: row.id, |
| | | }, |
| | | "正在调用MES接口...", |
| | | ); |
| | | |
| | | if (result.status) { |
| | | this.$Message.success(result.message || "托盘进站成功"); |
| | |
| | | // 托盘出站操作 |
| | | async handleOutbound(row) { |
| | | try { |
| | | await this.$confirm(`确认执行托盘出站操作?\n托盘编号:${row.palletCode}`, "出站确认", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }); |
| | | await this.$confirm( |
| | | `确认执行托盘出站操作?\n托盘编号:${row.palletCode}`, |
| | | "出站确认", |
| | | { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }, |
| | | ); |
| | | |
| | | const result = await this.http.post("/api/StockInfo/outboundInContainer", { |
| | | palletCode: row.palletCode, |
| | | stockId: row.id |
| | | }, "正在调用MES接口..."); |
| | | const result = await this.http.post( |
| | | "/api/StockInfo/outboundInContainer", |
| | | { |
| | | palletCode: row.palletCode, |
| | | stockId: row.id, |
| | | }, |
| | | "正在调用MES接口...", |
| | | ); |
| | | |
| | | if (result.status) { |
| | | this.$Message.success(result.message || "托盘出站成功"); |
| | |
| | | }, |
| | | |
| | | // 托盘拆盘操作 |
| | | async handleUnbind(row) { |
| | | try { |
| | | await this.$confirm(`确认执行托盘拆盘操作?\n托盘编号:${row.palletCode}`, "拆盘确认", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }); |
| | | |
| | | const result = await this.http.post("/api/StockInfoDetail/UnbindContainer", { |
| | | palletCode: row.palletCode, |
| | | }, "正在调用MES接口..."); |
| | | |
| | | if (result.status) { |
| | | this.$Message.success(result.message || "托盘拆盘成功"); |
| | | this.$refs.table.load(); |
| | | } else { |
| | | this.$error(result.message || "托盘拆盘失败"); |
| | | } |
| | | } catch (error) { |
| | | if (error !== "cancel") { |
| | | this.$error(error.message || "网络错误,请稍后重试"); |
| | | } |
| | | } |
| | | handleUnbind(row) { |
| | | this.$refs.gridBody.open('unbind', row); |
| | | }, |
| | | |
| | | onInited() { |
| | | // 框架初始化配置后 |
| | | }, |
| | | searchBefore(param) { |
| | | const stockStatusFilter = { |
| | | name: "stockStatus", |
| | | value: "1", |
| | | displayType: "notequal", |
| | | }; |
| | | if (!param.wheres) { |
| | | param.wheres = []; |
| | | } |
| | | // 将过滤条件添加到查询参数中 |
| | | param.wheres.push(stockStatusFilter); |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | |
| | | }, |
| | | modelOpenAfter(row) { |
| | | // 点击编辑、新建按钮弹出框后 |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | |
| | | export default extension; |