分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-01-16 5884c9023393061afbe6d3d6e709e53e672ddde8
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
//author:jxx
//此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js)
let extension = {
    components: {//动态扩充组件或组件路径
        //表单header、content、footer对应位置扩充的组件
        gridHeader:'',//{ template: "<div>扩展组xx件</div>" },
        gridBody: '',
        gridFooter: '',
        //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件
        modelHeader: '',
        modelBody: '',
        modelFooter: ''
    },
    buttons: {view: [], box:[],  detail:[]},//扩展的按钮
    methods: {//事件扩展
       onInit() {
        this.single = true;
        this.buttons.splice(2, 0, {
            name: "任务完成",
            icon: '',
            type: 'info',
            onClick: function () {
                let rows = this.$refs.table.getSelected();
                console.log(rows);
                if (rows.length == 0) {
                    return this.$error("请选择完成的任务!");
                }
                console.log(rows[0].wcstask_tasknumber);
                let param = {
                    MainData: {barcode: rows[0].wcstask_tasknumber},
                    DetailData: null,
                    DelKeys: null
                };
                
                this.http.post("/api/ToWMS/WCSTaskCompleted",param,"任务完成...").then(x=>{
                    if(x.status){
                        this.$Notice.success({title: "任务完成",desc: "任务完成成功!",duration: 2});
                        this.refresh();
                    } else {
                        this.$Notice.error({title: "任务完成",desc: x.message,duration: 2});
                    }
                })
            }
        });
       }
    }
};
export default extension;