@{
|
ViewBag.Title = "StoreRel";
|
Layout = "~/Views/Shared/_LayoutVue.cshtml";
|
}
|
@section head{
|
<style>
|
.el-transfer-panel {
|
width: 170px;
|
height: 240px;
|
}
|
.el-transfer {
|
padding:5px 0 0 10px;
|
}
|
.el-transfer-panel__list {
|
height: 170px;
|
}
|
</style>
|
}
|
|
<div id="strategyAdd" v-cloak>
|
<el-card class="box-card">
|
<el-form label-width="70px" v-bind:inline="true">
|
<el-form-item label="业务名称:">
|
<el-input style="width:150px" v-model="op.opName" size="mini" v-bind:disabled="true"></el-input>
|
</el-form-item>
|
<el-form-item label="仓库名:">
|
<el-input style="width:150px" v-model="stockCode" size="mini" v-bind:disabled="true"></el-input>
|
@*<hh-select-url v-model="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>
|
<div style="padding:5px 0 15px 0">
|
<template>
|
<el-transfer v-bind:data="strategyData" v-model="selectValue" v-bind:titles="['可关联库区', '已选库区']"></el-transfer>
|
</template>
|
</div>
|
<div><el-button size="mini" type="success" v-on:click="add" style="float:right; margin:0 10px 10px 0px">保存关联</el-button></div>
|
</el-card>
|
</div>
|
@section scripts{
|
<script>
|
new Vue({
|
mixins: [useAutoHeight],
|
computed: {},
|
data: {
|
strategyData: [],
|
selectValue: [],
|
stockCode: '@ViewData["stockName"]',
|
op: {
|
opCode: '@ViewData["opCode"]',
|
opName: '@ViewData["opName"]',
|
}
|
},
|
methods: {
|
add: function () {
|
var $this = this;
|
ajaxManage({
|
url: "@Url.Action("SaveAreaRel")",
|
data: {
|
stockCode: $this.stockCode, opCode: $this.op.opCode, selectValue: $this.selectValue.join(',')
|
},
|
success: function (data) {
|
if (data.Success) {
|
wms.success("关联成功!");
|
wms.dialogFrame.cb();
|
} else {
|
wms.error(data.Msg);
|
}
|
}
|
});
|
},
|
GetSelectedArea: function () {
|
var $this = this;
|
ajaxManage({
|
url: "@Url.Action("AbleAreas")?stockCode=" + $this.stockCode + "&opCode=" + $this.op.opCode,
|
success: function (data) {
|
$.each(data.Data, function (i, r) {
|
$this.selectValue.push(r.CN_S_AREA_CODE);
|
});
|
}
|
});
|
},
|
GetAllArea: function () {
|
var $this = this;
|
ajaxManage({
|
url: "/Basic/Common/AreaList?stockCode=" + $this.stockCode + "&include=1",
|
success: function (result) {
|
if (result.Success) {
|
console.log(result.Data);
|
$.each(result.Data, function (i, r) {
|
$this.strategyData.push({
|
key: r.CN_S_AREA_CODE,
|
label: r.CN_S_AREA_NAME
|
});
|
});
|
$this.GetSelectedArea();
|
}
|
else {
|
wms.error(data.Msg);
|
}
|
}
|
});
|
}
|
},
|
mounted: function () {
|
var $this = this;
|
$this.GetAllArea();
|
},
|
el: '#strategyAdd'
|
});
|
</script>
|
}
|