|
|
@@ -71,9 +71,14 @@
|
|
|
<a role="menuitem" tabindex="-1" style="cursor: pointer" class="ml-3"
|
|
|
@click="selectedWarehouse(warehouse)">@{{ warehouse.name }}</a>
|
|
|
</li>
|
|
|
+ <li role="presentation" class="text-center" @click="addWarehouseDetail()">
|
|
|
+ <a role="menuitem" tabindex="-1" style="cursor: pointer" class="ml-3 text-primary"
|
|
|
+ ><i class="fa fa-plus"></i> 新增</a>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- <p class="font-weight-bold p-0 mb-0 mt-5">位置</p>
|
|
|
+ <button class="btn btn-info mt-5 w-100 text-white" @click="openRepository()">新增库区</button>
|
|
|
+ <p class="font-weight-bold p-0 mb-0 mt-1">位置</p>
|
|
|
<div class="row text-muted small">
|
|
|
<small class="col-6">X</small>
|
|
|
<small class="col-6">Y</small>
|
|
|
@@ -217,6 +222,8 @@
|
|
|
</div>
|
|
|
@include("equipment._detailInfo")
|
|
|
@include("equipment._location")
|
|
|
+ @include("equipment._warehouseDetail")
|
|
|
+ @include("equipment._repository")
|
|
|
</div>
|
|
|
</body>
|
|
|
<script src="{{ mix('js/app.js') }}"></script>
|
|
|
@@ -225,6 +232,10 @@
|
|
|
var vue = new Vue({
|
|
|
el:"#container",
|
|
|
data:{
|
|
|
+ group:[],//库区列表
|
|
|
+ ws:[],//仓库列表
|
|
|
+ warehouseDetail:{},//当前操作的仓库
|
|
|
+ repository:{},//当前操作的库区
|
|
|
warehouses:[], //仓库描述
|
|
|
repositories:[], //库区
|
|
|
selected:"", //当前选中的仓库ID
|
|
|
@@ -687,6 +698,122 @@
|
|
|
timeout:3000,
|
|
|
})
|
|
|
},
|
|
|
+ showAddWarehouseDetail(){
|
|
|
+ if (this.ws.length>0){
|
|
|
+ $("#warehouseDetail").modal("show");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url : this.baseUrl+"warehouse/getList",
|
|
|
+ type : "get",
|
|
|
+ dataType : "JSON",
|
|
|
+ success : (res)=>{
|
|
|
+ switch (res.code){
|
|
|
+ case 200:
|
|
|
+ this.ws = res.data;
|
|
|
+ $("#warehouseDetail").modal("show");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ window.toast.error("仓库建立失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : (err)=>{
|
|
|
+ window.tempTip.setIndex(999);
|
|
|
+ window.tempTip.show("网络错误");
|
|
|
+ },
|
|
|
+ complete:(req,status)=>{
|
|
|
+ this.isLoadLocation = false;
|
|
|
+ if (status==='timeout'){
|
|
|
+ window.toast.error("获取仓库超时");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeout:3000,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addWarehouseDetail(){
|
|
|
+ $.ajax({
|
|
|
+ url : this.baseUrl+"warehouse/detail",
|
|
|
+ type : "post",
|
|
|
+ dataType : "JSON",
|
|
|
+ headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
+ data : JSON.stringify(this.warehouseDetail),
|
|
|
+ success : (res)=>{
|
|
|
+ switch (res.code){
|
|
|
+ case 200:
|
|
|
+ window.toast.success("仓库新建成功");
|
|
|
+ this.warehouses = res.data;
|
|
|
+ $("#warehouseDetail").modal("hide");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ window.toast.error(res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : (err)=>{
|
|
|
+ window.tempTip.setIndex(999);
|
|
|
+ window.tempTip.show("网络错误");
|
|
|
+ },
|
|
|
+ timeout:3000,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openRepository(){
|
|
|
+ $.ajax({
|
|
|
+ url : this.baseUrl+"repository/group",
|
|
|
+ type : "get",
|
|
|
+ dataType : "JSON",
|
|
|
+ data:{id:this.selected},
|
|
|
+ success : (res)=>{
|
|
|
+ switch (res.code){
|
|
|
+ case 200:
|
|
|
+ this.group = res.data;
|
|
|
+ $("#repository").modal("show");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ window.toast.error("获取区域失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : (err)=>{
|
|
|
+ window.tempTip.setIndex(999);
|
|
|
+ window.tempTip.show("网络错误");
|
|
|
+ },
|
|
|
+ complete:(req,status)=>{
|
|
|
+ this.isLoadLocation = false;
|
|
|
+ if (status==='timeout'){
|
|
|
+ window.toast.error("获取区域超时");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeout:3000,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addRepository(){
|
|
|
+ $.ajax({
|
|
|
+ url : this.baseUrl+"repository/addRepository",
|
|
|
+ type : "post",
|
|
|
+ dataType : "JSON",
|
|
|
+ headers:{'Content-Type':'application/json;charset=utf8'},
|
|
|
+ data:JSON.stringify(this.repository),
|
|
|
+ success : (res)=>{
|
|
|
+ switch (res.code){
|
|
|
+ case 200:
|
|
|
+ this.repositories.push(res.data);
|
|
|
+ $("#repository").modal("hide");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ window.toast.error("库区建立失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : (err)=>{
|
|
|
+ window.tempTip.setIndex(999);
|
|
|
+ window.tempTip.show("网络错误");
|
|
|
+ },
|
|
|
+ complete:(req,status)=>{
|
|
|
+ this.isLoadLocation = false;
|
|
|
+ if (status==='timeout'){
|
|
|
+ window.toast.error("建立库区超时");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeout:3000,
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
</script>
|