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
@{
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
    ViewBag.Title = "Logistics";
}
<div id="logisticsReport" v-cloak>
    <el-card class="box-card">
        <el-form label-width="90px" v-bind:model="formData" class="demo-ruleForm" v-bind:inline="true">
            <el-form-item label="物流公司:">
                <hh-select-url v-model="formData.logisticsFlag"
                               url="/Basic/Common/GetLogisticsCompany"
                               valuefield="CN_S_LOGISTICS_FLAG"
                               textfield="CN_S_LOGISTICS_NAME"
                               datafield="Data"></hh-select-url>
            </el-form-item>
            <el-form-item label="统计月份:">
                <el-date-picker v-model="formData.startTime"
                                type="month"
                                value-format="yyyy-MM"
                                placeholder="选择月" size="mini" style="width:120px">
                </el-date-picker>
            </el-form-item>
            <el-form-item>
                -
                <el-date-picker v-model="formData.endTime"
                                type="month"
                                value-format="yyyy-MM"
                                placeholder="选择月" size="mini" style="width:120px">
                </el-date-picker>
            </el-form-item>
            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">查 询</el-button>
        </el-form>
    </el-card>
    <hh-table v-bind:coloptions="logisticsReportCols"
              v-bind:paging="true"
              v-bind:single="true"
              v-bind:check="true"
              v-on:clickrow="clickLogisticsRow"
              v-bind:url="logisticsUrl"
              ref="logisticsList"
              v-bind:dh="tableHeight"></hh-table>
    <hh-table v-bind:coloptions="logisticsDetailCols"
              v-bind:paging="false"
              v-bind:single="true"
              v-bind:check="true"
              v-bind:url="logisticsDetailUrl"
              ref="logisticsDetailList"
              v-bind:dh="bottomTableHeight"></hh-table>
</div>
@section scripts{
    <script>
        new Vue({
            mixins: [useAutoHeight],
            computed: {
                tableHeight: function () {
                    return (this.autoHeight + 165) / 2;
                },
                bottomTableHeight: function () {
                    return (this.autoHeight) / 2;
                },
            },
            data: {
                formData: {
                    logisticsFlag: '',
                    startTime: '',
                    endTime: ''
                },
                logisticsUrl: "@Url.Action("GetLogisticsReport")",
                logisticsDetailUrl: "",
                logisticsReportCols: [
                    { f: "CN_S_LOGISTICS_NAME", n: "物流公司" },
                    { f: "DeliverGoodsNum", n: "已发货量" },
                    { f: "StayNum", n: "待发货量" },
                    { f: "CN_T_CREATE", n: "日期" },
                ],
                logisticsDetailCols: [
                    { f: "CN_S_LOGISTICS_NAME", n: "物流公司" },
                    { f: "CN_S_WAYBILL_NO", n: "物流单号" },
                    { f: "CN_S_CUSTOMER_NAME", n: "客户" },
                    { f: "CN_S_RECEIVER_NAME", n: "联系人" },
                    { f: "CN_S_DETAIL_ADDRESS", n: "收货地址" },
                    { f: "CN_T_CREATE", n: "单据时间" },
                    { f: "PackNum", n: "包裹数" },
                ],
            },
            el: '#logisticsReport',
            methods: {
                clickLogisticsRow: function (row, event, column) {
                    var logisticsFlag = row.CN_S_LOGISTICS_FLAG;
                    var startTime = this.formData.startTime || '';
                    var endTime = this.formData.endTime || '';
                    var param = "?logisticsFlag=" + logisticsFlag + "&startTime=" + startTime + "&endTime=" + endTime;
                    this.logisticsDetailUrl = "@Url.Action("GetLogisticsDetail")" + param;
                },
                search: function () {
                    this.$refs.logisticsList.loadData(this.formData);
                }
            }
        });
    </script>
}