211 行
6.5 KiB
HTML
可执行文件
211 行
6.5 KiB
HTML
可执行文件
<!--[1.6.48]-->
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
[v-cloak] {
|
|
display: none;
|
|
}
|
|
|
|
th {
|
|
background-color: #f5f7fa !important;
|
|
}
|
|
|
|
th > .cell {
|
|
white-space: nowrap !important;
|
|
text-align: center;
|
|
}
|
|
|
|
th, td {
|
|
text-align: center;
|
|
line-height: 30px;
|
|
padding: 0;
|
|
}
|
|
|
|
th > .cell, td > .cell {
|
|
text-align: center;
|
|
}
|
|
|
|
.el-table_1_column_13 {
|
|
border-right: none !important;
|
|
}
|
|
|
|
.el-pagination {
|
|
padding: 8px;
|
|
}
|
|
|
|
.el-input {
|
|
width: 200px;
|
|
}
|
|
|
|
.save {
|
|
white-space: nowrap;
|
|
background-color: #409EFF;
|
|
color: white;
|
|
font-size: 12px;
|
|
line-height: 30px;
|
|
padding: 0 4px;
|
|
border-radius: 4px;
|
|
margin-left: 3px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.center-content {
|
|
margin: 20px 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.center-content .el-input__inner {
|
|
padding: 0 15px;
|
|
text-align: left;
|
|
}
|
|
|
|
#moreEditBox * {
|
|
display: none;
|
|
}
|
|
|
|
.small-dialog-content {
|
|
margin-top: 15vh;
|
|
margin-left: 48vh;
|
|
}
|
|
|
|
.goods_title {
|
|
padding: 10px 0;
|
|
}
|
|
.el-table__row > td:last-child > .cell {
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|
|
<div class="goodsBox" id="warehouse" v-cloak>
|
|
<div class="goods_title">
|
|
<div class="goods_title_inner">
|
|
供给仓
|
|
</div>
|
|
</div>
|
|
<div class="center-content" v-if="type">
|
|
<div>
|
|
<if condition="$authArr['addWarehouse'] eq true">
|
|
<el-button type="primary" plain @click="addWarehouse('添加仓库','{:U('addWarehouse')}')" size="small">新增仓库</el-button>
|
|
</if>
|
|
</div>
|
|
</div>
|
|
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="warehouseList"
|
|
border
|
|
style="width: 100%">
|
|
<el-table-column prop="number" label="仓库编号" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="name" label="仓库名称" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="measure_area" label="仓库面积(m)" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="region" label="所在地区" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="address" label="详细地址" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="person_name" label="负责人" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="person_phone" label="负责人手机号" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
|
|
<el-table-column fixed="right" label="操作" style="border-right: none;">
|
|
<template slot-scope="scope">
|
|
<if condition="$authArr['setWarehouse'] eq true">
|
|
<el-button @click.native.prevent="setWarehouse('编辑仓库','{:U('addWarehouse')}?id=' + scope.row.id)" type="text" size="small">编辑
|
|
</el-button>
|
|
</if>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<!-- 页面加载-->
|
|
<el-dialog :title="dialogTitle"
|
|
:visible.sync="showSetChild"
|
|
:close-on-click-modal="false"
|
|
:append-to-body="true"
|
|
custom-class="small-dialog-content"
|
|
:close-on-press-escape="false"
|
|
:before-close="closeChild"
|
|
:show-close="true"
|
|
:center="true"
|
|
width="60%"
|
|
:modal = "false"
|
|
>
|
|
<div id="ChildHtml" v-loading="loading"
|
|
element-loading-text="数据加载中,请等待"
|
|
element-loading-spinner="el-icon-loading"></div>
|
|
</el-dialog>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var warehouse = new Vue({
|
|
el: '#warehouse',
|
|
data: function () {
|
|
return {
|
|
warehouseList: [],
|
|
loading: true,
|
|
dialogTitle:'',
|
|
showSetChild:false,
|
|
type:"{$type}",
|
|
}
|
|
},
|
|
methods: {
|
|
//初始化表格信息
|
|
getData: function () {
|
|
var that = this;
|
|
$.ajax({
|
|
url: "{:U(warehouseList)}",
|
|
type: 'POST',
|
|
data: {},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
that.loading = false;
|
|
that.warehouseList = [];
|
|
that.warehouseList = res.data;
|
|
} else {
|
|
that.$message({
|
|
type:'error',
|
|
message:res.msg,
|
|
duration:1500
|
|
})
|
|
}
|
|
}
|
|
});
|
|
},
|
|
closeChild: function () {
|
|
$('#ChildHtml').html('');
|
|
this.showSetChild = false;
|
|
this.getData();
|
|
},
|
|
//添加
|
|
addWarehouse:function(title,url){
|
|
var that = this;
|
|
that.dialogTitle = title;
|
|
that.showSetChild = true;
|
|
that.loading = true;
|
|
$.get(url, function (data) {
|
|
that.loading = false;
|
|
$('#ChildHtml').html(data);
|
|
$('#ChildHtml').ready(function () {
|
|
that.loading = false;
|
|
});
|
|
});
|
|
},
|
|
//编辑
|
|
setWarehouse:function(title,url){
|
|
var that = this;
|
|
that.dialogTitle = title;
|
|
that.showSetChild = true;
|
|
that.loading = true;
|
|
$.get(url, function (data) {
|
|
that.loading = false;
|
|
$('#ChildHtml').html(data);
|
|
$('#ChildHtml').ready(function () {
|
|
that.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
created: function () {
|
|
this.getData();
|
|
}
|
|
})
|
|
</script> |