Browse Source

联调仓库接口

master
邓宏 2 years ago
parent
commit
be29062d25
  1. 2
      common/request.js
  2. 2
      pages/massif/index.vue
  3. 2
      pages/massif/mana/plantPlan.vue
  4. 2
      pages/massif/mana/recovery.vue
  5. 2
      pages/purchase/agrProdList.vue
  6. 2
      pages/purchase/record.vue
  7. 27
      pages/warehouse/info.vue
  8. 116
      pages/warehouse/mana.vue

2
common/request.js

@ -4,7 +4,7 @@ export function host(host='default',suffix='/plant_manage'){
var url=process.env.NODE_ENV === 'development'?{ var url=process.env.NODE_ENV === 'development'?{
// default:`http://dpe74u.natappfree.cc` //陈 // default:`http://dpe74u.natappfree.cc` //陈
// default:`http://czixnn.natappfree.cc` //马 // default:`http://czixnn.natappfree.cc` //马
default:`http://pe7wdu.natappfree.cc` //何 default:`http://spp799.natappfree.cc` //何
// default:`http://192.168.0.116:8080` //孙 // default:`http://192.168.0.116:8080` //孙
}:{ }:{
default:`` default:``

2
pages/massif/index.vue

@ -154,6 +154,8 @@ import request,{host} from '@/common/request'
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

2
pages/massif/mana/plantPlan.vue

@ -179,6 +179,8 @@ export default {
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

2
pages/massif/mana/recovery.vue

@ -180,6 +180,8 @@ export default {
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

2
pages/purchase/agrProdList.vue

@ -104,6 +104,8 @@ export default {
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

2
pages/purchase/record.vue

@ -135,6 +135,8 @@ export default {
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

27
pages/warehouse/info.vue

@ -43,6 +43,7 @@ import request from '@/common/request.js'
contactPeople:"小明", contactPeople:"小明",
contactNumber:"13752000000", contactNumber:"13752000000",
warehousePic:[], warehousePic:[],
baseId: this.$store.state.plantBaseInfoId,
}, },
rules:{ rules:{
warehouseName:{required:true, message:"仓库名称必填!", trigger:["blur","change"]}, warehouseName:{required:true, message:"仓库名称必填!", trigger:["blur","change"]},
@ -60,10 +61,15 @@ import request from '@/common/request.js'
else call() else call()
}, trigger:["blur","change"]}, }, trigger:["blur","change"]},
}, },
eventChannel:null,
} }
}, },
onLoad(){ onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.init() this.init()
if(options.id){
this.getDetail(options.id)
}
}, },
methods:{ methods:{
async init(){ async init(){
@ -89,7 +95,8 @@ import request from '@/common/request.js'
} }
}) })
if(res.statu){ if(res.statu){
this.eventChannel.emit("update")
uni.navigateBack()
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",
@ -99,7 +106,21 @@ import request from '@/common/request.js'
} }
} }
}) })
} },
async getDetail(warehouseId){
var res=await request("/api/WarehouseManageApi/addOrUpdate",{
params:{warehouseId}
})
if(res.statu){
this.formData=res.data.upper
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取仓库详情失败!",
showCancel:false,
})
}
},
}, },
} }
</script> </script>

116
pages/warehouse/mana.vue

@ -10,46 +10,55 @@
.item{ .item{
margin-top:0; margin-top:0;
.title{ display:flex;
display:flex; .u-transition{
align-items: center; flex-shrink: 0;
font-weight: bold; margin-right:28rpx;
text{
margin-left:auto;
color:#333;
}
}
.adder{
color:#999;
font-size:24rpx;
margin-top: 16rpx;
} }
.data{ .info{
display:flex; flex-grow: 1;
justify-content: space-between; width:1rpx;
align-items: center; .title{
margin-top:16rpx; display:flex;
color:#999; align-items: center;
font-size:24rpx;
text:nth-child(2){
color:#10C176;
font-weight: bold; font-weight: bold;
font-size: 32rpx; text{
margin-left:auto;
color:#333;
}
} }
} .adder{
.btns{
display: flex;
justify-content: space-between;
align-items: center;
border-top:2rpx solid #D8D8D8;
margin:20rpx 0 -30rpx 0;
text{
padding:16rpx 0 30rpx 0;
color:#999; color:#999;
font-size:24rpx; font-size:24rpx;
&:before{ margin-top: 16rpx;
}
.data{
display:flex;
justify-content: space-between;
align-items: center;
margin-top:16rpx;
color:#999;
font-size:24rpx;
text:nth-child(2){
color:#10C176; color:#10C176;
margin-right:8rpx; font-weight: bold;
font-size: 32rpx;
}
}
.btns{
display: flex;
justify-content: space-between;
align-items: center;
border-top:2rpx solid #D8D8D8;
margin:20rpx 0 -30rpx 0;
text{
padding:16rpx 0 30rpx 0;
color:#999;
font-size:24rpx;
&:before{
color:#10C176;
margin-right:8rpx;
}
} }
} }
} }
@ -60,29 +69,35 @@
<template> <template>
<view class="container flex"> <view class="container flex">
<d-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack> <d-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack>
<text class="plant-xinjian" slot="right" @click="toAdd"/> <text class="plant-xinjian" slot="right" @click="toAdd()"/>
</d-navbar> </d-navbar>
<d-search v-model="searchVal.search" style="margin-top:30rpx;" @search="clean();search()"/> <d-search v-model="searchVal.search" style="margin-top:30rpx;" @search="clean();search()"/>
<scroll-view scroll-y @scrolltolower="search"> <scroll-view scroll-y @scrolltolower="search">
<view class="card item" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/warehouse/detail',params:{id:v.warehouseId}})"> <view class="card item" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/warehouse/detail',params:{id:v.warehouseId}})">
<view class="title">{{v.warehouseName}} <text class="plant-youbian"/></view> <u-image width="164rpx" height="164rpx" radius="16rpx" mode="aspectFill" :src="`${host}/${v.warehousePic[0]}`">
<view class="adder">{{v.warehouseAddress}}</view> <text slot="error" class="plant-xiaopangchetupianjiazaishibai" style="font-size:45rpx"/>
<view class="data"> </u-image>
<text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</text> <view class="info">
</view> <view class="title">{{v.warehouseName}} <text class="plant-youbian"/></view>
<view class="btns"> <view class="adder">{{v.warehouseAddress}}</view>
<text class="plant-xiugai" @click="toAdd(v.warehouseId)">修改</text> <view class="data">
<text class="plant-shanchu" @click.stop="del(k)">删除</text> <text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</text>
<text class="plant-chakan" @click.stop="$u.route({url:'pages/warehouse/info'})">查看库存</text> </view>
<view class="btns">
<text class="plant-xiugai" @click.stop="toAdd(v.warehouseId)">修改</text>
<text class="plant-shanchu" @click.stop="del(k)">删除</text>
<text class="plant-chakan" @click.stop="$u.route({url:'pages/warehouse/info'})">查看库存</text>
</view>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
import request from '@/common/request.js' import request,{host} from '@/common/request.js'
export default { export default {
data(){ data(){
return{ return{
@ -94,6 +109,7 @@ import request from '@/common/request.js'
}, },
list:[], list:[],
total:0, total:0,
host:host('imgUrl'),
} }
}, },
onLoad(options){ onLoad(options){
@ -112,8 +128,10 @@ import request from '@/common/request.js'
body: this.searchVal body: this.searchVal
}) })
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.warehouseList) this.list=this.list.concat(res.data.warehouseList.map(v=>({...v,warehousePic:(v.warehousePic||'').split(",").filter(v=>v)})))
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",
@ -155,7 +173,11 @@ import request from '@/common/request.js'
}, },
toAdd(id){ toAdd(id){
uni.navigateTo({ uni.navigateTo({
url:`/pages/warehouse/info?id=${id}` url:`/pages/warehouse/info?id=${id||''}`,
events:{update:()=>{
this.clean()
this.search()
}}
}) })
} }
} }

Loading…
Cancel
Save