@{
|
ViewBag.Title = "Index";
|
Layout = "~/Views/Shared/_LayoutVue.cshtml";
|
}
|
|
<div id="logistics" 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="物流名称:">
|
<el-input v-model="formData.logistics" size="mini"></el-input>
|
</el-form-item>
|
<el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">查 询</el-button>
|
</el-form>
|
<el-row style="padding-left: 10px; margin-top: 7px;">
|
<el-button size="mini" type="primary" v-on:click="add" v-has="'Add'">新增</el-button>
|
<el-button size="mini" type="primary" v-on:click="edit" v-has="'Edit'">修 改</el-button>
|
<el-button size="mini" type="danger" v-on:click="remove" v-has="'Delete'">删 除</el-button>
|
@*<el-button size="mini" type="primary" v-on:click="addtemplet">新增模版</el-button>*@
|
</el-row>
|
</el-card>
|
<hh-table v-bind:coloptions="cols"
|
v-bind:single="true"
|
v-bind:paging="true"
|
v-bind:check="true"
|
v-bind:dh="tableHeight"
|
url="@Url.Action("LogisticsList")"
|
v-on:clickrow="clickRow"
|
ref="list">
|
</hh-table>
|
<el-card class="box-card">
|
<el-row style="padding-left: 10px; margin-top: 7px;" v-bind:inline="true">
|
<el-col>
|
<el-button size="mini" type="primary" v-on:click="addtemplet">新增模版</el-button>
|
<el-button size="mini" type="primary" v-on:click="update">修改模版</el-button>
|
<el-button size="mini" type="danger" v-on:click="deletetenmplet">删除模版</el-button>
|
</el-col>
|
</el-row>
|
</el-card>
|
<hh-table v-bind:coloptions="templetCols"
|
v-bind:single="true"
|
v-bind:paging="false"
|
v-bind:check="true"
|
v-bind:url="templetUrl"
|
ref="templetList"
|
v-bind:dh="tabTableHeight"></hh-table>
|
</div>
|
@section scripts{
|
<script src="~/Content/js/linq.js_ver2.2.0.2/linq.js"></script>
|
<script>
|
var outList = new Vue({
|
mixins: [useAutoHeight],
|
computed: {
|
tableHeight: function () {
|
return (this.autoHeight + 100) / 2;
|
},
|
tabHeight: function () {
|
return (this.autoHeight - 60) / 2;
|
},
|
tabTableHeight: function () {
|
return (this.autoHeight + 80) / 2;
|
}
|
},
|
data: {
|
formData: {
|
logistics: ""
|
},
|
templetCols: [
|
//{ f: "CN_GUID", n: "主键",hidden:true},
|
{ f: "CN_S_TEMPLET_NAME", n: "模版名称" },
|
{
|
f: "CN_N_IS_DEFAULT", n: "是否默认", format: function (row, column, cellValue, index) {
|
if (cellValue) return 'Y';
|
return 'N';
|
}
|
},
|
{ f: "CN_S_CREATOR_BY", n: "创建人" },
|
{ f: "CN_T_CREATE", n: "创建时间" },
|
],
|
cols: [
|
{ f: "CN_S_LOGISTICS_FLAG", n: "物流标识" },
|
{ f: "CN_S_LOGISTICS_NAME", n: "物流名称" },
|
{
|
f: "CN_C_DIGITAL", n: "是否电子面单", format: function (row, column, cellValue, index) {
|
if (cellValue) return 'Y';
|
return 'N';
|
}
|
},
|
{
|
f: "CN_C_RETURN_ORDER", n: "是否回单", format: function (row, column, cellValue, index) {
|
if (cellValue) return 'Y';
|
return 'N';
|
}
|
}
|
],
|
templetUrl:"",
|
},
|
methods: {
|
search: function () {
|
this.$refs.templetList.clearData();
|
this.$refs.list.loadData(this.formData);
|
},
|
add: function () {
|
var $this = this;
|
wms.showDialogFrame({
|
title: '新增',
|
dh: 380,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
$this.$refs.list.loadData();
|
},
|
url: "@Url.Action("Edit")"
|
});
|
},
|
addtemplet: function () {
|
var $this = this;
|
this.selectSingleRowEvent(function (row) {
|
wms.showDialogFrame({
|
title: '新增模版',
|
dh: 380,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
//$this.$refs.list.loadData();
|
$this.$refs.templetList.loadData();
|
},
|
url: "@Url.Action("PrintTemplet")?flag=" + row.CN_S_LOGISTICS_FLAG
|
});
|
})
|
},
|
edit: function () {
|
var $this = this;
|
this.selectSingleRowEvent(function (row) {
|
wms.showDialogFrame({
|
title: '修改',
|
dh: 380,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
$this.$refs.list.loadData();
|
},
|
url: "@Url.Action("Edit")?guid=" + row.CN_GUID
|
});
|
});
|
},
|
update:function()
|
{
|
var $this = this;
|
this.selectSingleRowEvents(function (row) {
|
wms.showDialogFrame({
|
title: '修改模版',
|
dh: 380,
|
width: "400px",
|
btn: false,
|
callBack: function (frame) {
|
//$this.$refs.list.loadData();
|
$this.$refs.templetList.loadData();
|
},
|
url: "@Url.Action("PrintTemplet")?guid=" + row.CN_GUID + "&flag=" + row.CN_S_LOGISTICS_FLAG
|
});
|
});
|
},
|
|
remove: function () {
|
var $this = this;
|
this.selectMultiRowEvent(function (rows) {
|
wms.confirm("确认删除?", function () {
|
var guid = "";
|
rows.forEach(function (value, index, array) {
|
if (index != 0)
|
guid += ",";
|
guid += value.CN_GUID;
|
});
|
ajaxManage({
|
url: "@Url.Action("Delete")?guid=" + guid,
|
type: "Get",
|
success: function (data) {
|
if (data.Success) {
|
$this.$refs.list.loadData();
|
wms.success("删除成功");
|
} else {
|
wms.error(data.Msg);
|
}
|
}
|
});
|
});
|
});
|
},
|
|
deletetenmplet:function()
|
{
|
var $this = this;
|
this.selectMultiRowEvents(function (rows) {
|
wms.confirm("确认删除?", function () {
|
var guid = "";
|
rows.forEach(function (value, index, array) {
|
if (index != 0)
|
guid += "','";
|
guid += value.CN_GUID;
|
});
|
ajaxManage({
|
url: "@Url.Action("DeleteTemplet")?guid=" + guid,
|
type: "Get",
|
success: function (data) {
|
if (data.Success) {
|
//$this.$refs.list.loadData();
|
$this.$refs.templetList.loadData();
|
wms.success("删除成功");
|
} else {
|
wms.error(data.Msg);
|
}
|
}
|
});
|
});
|
});
|
},
|
selectMultiRowEvent: function (callBack) {
|
var selectRow = this.$refs.list.selections;
|
if (selectRow.length <= 0) {
|
wms.warning("最少选择一条记录");
|
return;
|
}
|
if (callBack)
|
callBack(selectRow);
|
},
|
selectMultiRowEvents: function (callBack) {
|
var selectRow = this.$refs.templetList.selections;
|
if (selectRow.length <= 0) {
|
wms.warning("最少选择一条记录");
|
return;
|
}
|
if (callBack)
|
callBack(selectRow);
|
},
|
|
selectSingleRowEvent: function (callBack) {
|
var selectRow = this.$refs.list.selections;
|
if (selectRow.length != 1) {
|
wms.warning("请选择一条记录");
|
return;
|
}
|
if (callBack)
|
callBack(selectRow[0]);
|
},
|
selectSingleRowEvents: function (callBack) {
|
var selectRow = this.$refs.templetList.selections;
|
if (selectRow.length != 1) {
|
wms.warning("请选择一条记录");
|
return;
|
}
|
if (callBack)
|
callBack(selectRow[0]);
|
},
|
clickRow: function (row, event, column) {
|
var $this = this;
|
var logisticsFlag = row.CN_S_LOGISTICS_FLAG;
|
var token = (new Date()).getTime();
|
$this.templetUrl = "@Url.Action("LogisticsTempletList")?logisticsFlag=" + logisticsFlag + "&token=" + token;
|
//ajaxManage({
|
// url: '/Basic/Logistics/LogisticsTempletList?logisticsFlag=' + logisticsFlag,
|
// success: function (data) {
|
// //console.log(data);
|
// $this.templetdata = data.Data;
|
// }
|
//});
|
},
|
|
handleEdit: function (index, row) {
|
console.log(index, row);
|
},
|
handleDelete: function (index, row) {
|
console.log(index, row);
|
},
|
|
},
|
el: '#logistics'
|
});
|
</script>
|
}
|