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
@{
    ViewBag.Title = "Location";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
 
<div id="list" 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="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_stockcode"):">
                <hh-select-url v-model="formData.stockCode"
                               url="/Basic/Common/StockList"
                               valuefield="CN_S_STOCK_CODE"
                               textfield="CN_S_STOCK_NAME"
                               datafield="Data">
                </hh-select-url>
            </el-form-item>
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_areacode"):">
                <hh-select-url v-model="formData.stockArea"
                               v-bind:url="areaUrl"
                               valuefield="CN_S_AREA_CODE"
                               textfield="CN_S_AREA_NAME"
                               datafield="Data">
                </hh-select-url>
            </el-form-item>
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_locationcode"):">
                <el-input v-model="formData.locationCode" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemcode"):">
                <el-input v-model="formData.itemCode" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemname"):">
                <el-input v-model="formData.itemName" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemmodel"):">
                <el-input v-model="formData.model" size="mini"></el-input>
            </el-form-item>
            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_public_button_search")</el-button>
        </el-form>
        <el-row style="padding-left: 10px; margin-top: 7px;">
            <el-button size="mini" type="primary" v-on:click="exportExecl">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_public_button_export")</el-button>
        </el-row>
    </el-card>
    <hh-table v-bind:coloptions="outCols"
              v-bind:paging="true"
              v-bind:check="false"
              v-bind:where="formData"
              v-bind:rowno="true"
              dh="145"
              url="@Url.Action("GetLocationInventoryList")"
              ref="inventorylist"></hh-table>
</div>
@section scripts{
    <script>
        var outList = new Vue({
            data: {
                formData: {
                    stockCode: "",
                    stockArea: "",
                    locationCode: "",
                    itemCode: "",
                    itemName: "",
                    model: "",
                    state:"",
                    owner:""
                },
                where: {},
                outCols: [
                    { f: "CN_S_STOCK_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_stockcode")", w: 120 },
                    { f: "CN_S_STOCK_AREA", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_areacode")", w: 120 },
                    { f: "CN_S_LOCATION_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_locationcode")", w: 120 },
                    { f: "CN_S_ITEM_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemcode")", w: 120 },
                    { f: "CN_S_ITEM_NAME", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemname")", w: 150 },
                    { f: "CN_S_MODEL", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_itemmodel")", w: 120 },
                    { f: "CN_S_PRODUCTION_BATCH", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_productbatch")", w: 130 },
                    { f: "CN_F_QUANTITY", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_quantity")", w: 80 }
                  
                ]
            },
            methods: {
                search: function () {
                    var $this = this;
                    this.$refs.inventorylist.loadData($this.formData);
                },
                exportExecl: function () {
                    $this = this;
                    var v = { formData: $this.formData, columns: $this.outCols };
                    ajaxManage({
                        url: "@Url.Action("ExportLocationInventory")",
                        data: JSON.stringify(v),
                    success: function (result) {
                        if (result.Success) 
                            location.href = "/Basic/Common/GetFile?fileName=" + result.Data.fileName
                        else
                            wms.error(result.Msg);
                    }
                });
        }
            },
            watch: {
                deep: true,
                "formData.showArea": function () {
                    $this = this;
                    if ($this.formData.showArea) {
                        $this.outCols.unshift({ f: "CN_S_AREA_NAME", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_allquery_inventory_locationqzhk_areacode")", w: 100 });
                        this.$refs.inventorylist.loadData($this.formData);
                    }
                    else {
                        $this.outCols.shift();
                        this.$refs.inventorylist.loadData($this.formData);
                    }
                }
            },
            computed: {
                areaUrl: function () {
                    var $this = this;
                    return '/Basic/Common/AreaList?stockCode=' + $this.formData.stockCode + "&include=1";
                }
            },
            el: '#list'
        });
    </script>
}