分支自 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
49
50
51
52
53
54
55
56
57
58
//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() {
        let permissionButtons = this.permission.getButtons(this.$route.path, null, this.extend.tableAction);
            // console.log(permissionButtons.find(r => r.value == "Update"));
            if (null == permissionButtons || null == permissionButtons.find(r => r.value == "Update"))
                return;   
        this.single = true;
        this.buttons.splice(2, 0, {
            name: "任务重发",
            value: "Update",
            icon: 'md-freed',
            hidden: false,
            type: 'info',
            onClick: function () {
 
                let rows = this.$refs.table.getSelected();
                if (rows.length == 0) return this.$error("请选择任务行!");
 
                this.$Modal.confirm({
                    title: "提示",
                    content:
                        '<p style="color: red;font-weight: bold;letter-spacing: 3px;">确认要重发此任务吗?</p>',
                    onOk: () => {
                       
                        let params = {
                            MainData: {barcode: rows[0].stacktask_barcode,taskNum:rows[0].stacktask_tasknumber,stacker:rows[0].stacktask_stacker},
                            DetailData: null,
                            DelKeys: null
                        }
                        //let url = this.getUrl(this.const.DEL);
                        this.http.post("/api/dt_stacktaskinfo/StackTaskResend", params, "正在重发....").then(x => {
                            if (!x.status) return this.$error('重发失败:'+x.message);
                            this.$success("重发成功!");
 
                            this.refresh();
                        });
                    } //, onCancel: () => {}
                });
            }
        });
       }
    }
};
export default extension;