zhao
2021-06-04 c7ec496f9e41c2227103b3ef776e4a3f91bce6b2
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
@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
 
 
@section head{
 
    <style>
        .el-transfer-panel {
            width: 296px;
            height: 350px;
        }
 
        .el-transfer-panel__list {
            height: 290px;
        }
    </style>
}
 
<div id="strategyAdd" v-cloak>
    <el-card class="box-card" style=" width: 688px;">
        <el-button size="mini" type="success" v-on:click="add" style="margin:10px 0px 10px 10px">保存关联</el-button>
    </el-card>
    <template style="width:700px">
        <el-transfer v-bind:data="strategyData" v-model="selectValue" v-bind:titles="['可关联策略', '已选策略']"></el-transfer>
    </template>
</div>
@section scripts{
    <script>
        new Vue({
            mixins: [useAutoHeight],
            computed: {},
            data: {
                strategyData: [],
                selectValue: [],
                stockCode: "",
                areaCode: "",
            },
            methods: {
                add: function () {
                    var $this = this;
                    console.log($this.selectValue);
                    ajaxManage({
                        url: "@Url.Action("SaveStrategyUse")",
                        data: { selectValue: $this.selectValue.join(','), areaCode: $this.areaCode, stockCode: $this.stockCode },
                        success: function (data) {
                            wms.success("策略关联成功!");
                            wms.dialogFrame.cb();
                        }
                    });
                }
            },
            mounted: function () {
                var $this = this;
                var areaCode = GetUrlParam("areaCode");
                var stockCode = GetUrlParam("stockCode");
                $this.areaCode = areaCode;
                $this.stockCode = stockCode;
                ajaxManage({
                    url: "/Sys/Strategy/GetNoStrategyList?areaCode=" + areaCode + "&stockCode=" + stockCode,
                    success: function (data) {
                        var DataList = data.Data;
                        if (DataList.length == 0) {
                            wms.warning("该库区已配置全部策略!");
                            return;
                        }
                        for (let i = 0; i < DataList.length; i++) {
                            $this.strategyData.push({
                                key: DataList[i].CN_GUID,
                                label: DataList[i].CN_S_NAME
                            });
                        }
                    }
                });
            },
            el: '#strategyAdd'
        });
    </script>
}