1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| // 页面扩展配置:库存页面组盘/拆盘按钮扩展
| let extension = {
| components: {
| gridHeader: "",
| gridBody: "",
| gridFooter: "",
| modelHeader: "",
| modelBody: "",
| modelFooter: "",
| },
| tableAction: "stock",
| buttons: { view: [], box: [], detail: [] },
| methods: {
| onInit() {
| return true;
| },
| onInited() {
| // 注入组盘、拆盘按钮到操作列
| this.editTableButtons = [
| { name: "组盘", onClick: this.onGroupPallet },
| { name: "拆盘", onClick: this.onSplitPallet }
| ];
| return true;
| },
| async onGroupPallet({ row }) {
| // 调用组盘接口
| let result = await this.$api.post("/Stock/GroupPalletConfirm", { palletCode: row.palletCode });
| if (result.status) {
| this.$Message.success("组盘成功,MES数据已异步上传");
| this.$refs.grid.search();
| } else {
| this.$Message.error(result.message || "组盘失败");
| }
| },
| async onSplitPallet({ row }) {
| // 调用拆盘接口
| let result = await this.$api.post("/Stock/SplitPalletConfirm", { palletCode: row.palletCode });
| if (result.status) {
| this.$Message.success("拆盘成功,MES数据已异步上传");
| this.$refs.grid.search();
| } else {
| this.$Message.error(result.message || "拆盘失败");
| }
| },
| searchBefore(param) {
| return true;
| },
| searchAfter(result) {
| return true;
| },
| addBefore(formData) {
| return true;
| },
| updateBefore(formData) {
| return true;
| },
| rowClick({ row, column, event }) {
| return true;
| },
| modelOpenAfter(row) {
| return true;
| },
| },
| };
|
| export default extension;
|
|