zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@{
    ViewBag.Title = "ServiceExecStatus";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
 
<div id="app" v-cloak>
    <el-card class="box-card">
        <el-form label-width="100px" v-bind:model="formData" class="demo-ruleForm" v-bind:inline="true">
            <el-form-item label="@L("cshtml_serviceexecstatus_tasktype"):">
                <hh-select-url v-model="formData.taskType"
                               v-bind:options="taskTypeOptions"
                               ref="ztt"></hh-select-url>
            </el-form-item>
            <el-form-item label="@L("cshtml_serviceexecstatus_taskno"):">
                <el-input v-model="formData.taskNo" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="@L("cshtml_serviceexecstatus_iscomplete"):">
                <hh-select-url v-model="formData.isComplete"
                               v-bind:options="boolOptions"></hh-select-url>
            </el-form-item>
            <el-form-item label="@L("cshtml_serviceexecstatus_issendmes"):">
                <hh-select-url v-model="formData.isSendMes"
                               v-bind:options="boolOptions"></hh-select-url>
            </el-form-item>
 
            <el-form-item>
            </el-form-item>
 
        </el-form>
        <el-row style="padding-left: 10px; margin-top: 7px;">
            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">@L("cshtml_public_button_search")</el-button>
            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="restartTask">@L("cshtml_serviceexecstatus_restartexecute")</el-button>
            @*<el-button size="mini" type="primary" v-on:click="add">导 出</el-button>*@
        </el-row>
    </el-card>
    <hh-table v-bind:coloptions="cols"
              v-bind:paging="true"
              v-bind:check="true"
              v-bind:rowno="true"
              dh="120"
              url="@Url.Action("GetServiceExecList")"
              ref="list"></hh-table>
</div>
 
@section scripts{
    <script>
        new Vue({
            el: "#app",
            data: {
                formData: {
                    taskType: "",
                    isComplete: "",
                    isSendMes: ""
                },
                taskTypeOptions: [{
                    value: '',
                    label: '全部'
                }, {
                    value: '移送',
                    label: '移送'
                }, {
                    value: '移库',
                    label: '移库'
                }],
                boolOptions: [{
                    value: '',
                    label: '全部'
                }, {
                    value: 'Y',
                    label: 'Y'
                }, {
                    value: 'N',
                    label: 'N'
                }],
                cols: [
                    { f: "CN_S_TASK_TYPE", n: "@L("cshtml_serviceexecstatus_tasktype")", w: 80 },
                    {
                        f: "CN_S_TASK_NO", n: "@L("cshtml_serviceexecstatus_taskno")", w: 80, format: function (row) {
                            if (row.CN_S_TASK_TYPE == "移库")
                                return "";
                            return row.CN_S_TASK_NO;
                        }
                    },
                    { f: "CN_S_TRANS_TYPE", n: "@L("cshtml_serviceexecstatus_transtype")", w: 80 },
                    { f: "CN_S_TRAY_CODE", n: "@L("cshtml_serviceexecstatus_loadno")", w: 80 },
                    { f: "CN_S_ITEM_CODE", n: "@L("cshtml_serviceexecstatus_itemcode")" },
                    { f: "CN_S_ITEM_NAME", n: "@L("cshtml_serviceexecstatus_itemname")" },
                    { f: "CN_N_PRIORITY", n: "@L("cshtml_serviceexecstatus_priority")", w: 100 },
                    { f: "CN_S_START_LOCATION", n: "@L("cshtml_serviceexecstatus_startlocation")", w: 80 },
                    { f: "CN_S_END_LOCATION", n: "@L("cshtml_serviceexecstatus_endlocation")", w: 80 },
                    { f: "CN_T_CREATE", n: "@L("cshtml_serviceexecstatus_createtime")" },
                    { f: "CN_S_MSG", n: "@L("cshtml_serviceexecstatus_message")" },
                    { f: "CN_C_COMPLETE", n: "@L("cshtml_serviceexecstatus_iscomplete")", w: 100 },
                    { f: "CN_C_SEND_MES", n: "@L("cshtml_serviceexecstatus_issendmes")", w: 110 }]
            },
            methods: {
                search: function () {
                    this.$refs.list.loadData(this.formData);
                },
                restartTask: function () {
                    var $this = this;
                    $this.selectRowEvent(true, function (row) {
                        wms.confirm("@L("cshtml_serviceexecstatus_confirmexecute")?", function () {
                             ajaxManage({
                                url: '@Url.Action("RestartTask")?taskNo=' + row.CN_S_TASK_NO,
                                data: $this.formData,
                                success: function (data) {
                                    switch (data.Status) {
                                        case 0:
                                            wms.error(data.Msg); break;
                                        case 2:
                                            wms.warning(data.Msg); break;
                                        case 1:
                                            wms.success("@L("cshtml_serviceexecstatus_executesuccess")!"); break;
                                            break;
                                        default: wms.error("@L("cshtml_serviceexecstatus_errorsystem")");
                                    }
                                    $this.search();
                                }
                            });
                         });
 
                    });
                },
                selectRowEvent: function (isSingle, callBack) {
                    var selectRow = this.$refs.list.selections;
                    var row = null;
                    if (isSingle) {
                        if (selectRow.length != 1) {
                            wms.warning("@L("cshtml_serviceexecstatus_confirmselect")");
                            return;
                        }
                        row = selectRow[0];
                    } else {
                        if (selectRow.length <= 0) {
                            wms.warning("@L("cshtml_serviceexecstatus_confirmselectsingle")");
                            return;
                        }
                        row = selectRow;
                    }
                    if (callBack)
                        callBack(row);
                },
            }
        });
    </script>
}