@{
|
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>
|
}
|