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'?{
// default:`http://dpe74u.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:``

2
pages/massif/index.vue

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

2
pages/massif/mana/plantPlan.vue

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

2
pages/massif/mana/recovery.vue

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

2
pages/purchase/agrProdList.vue

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

2
pages/purchase/record.vue

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

27
pages/warehouse/info.vue

@ -43,6 +43,7 @@ import request from '@/common/request.js'
contactPeople:"小明",
contactNumber:"13752000000",
warehousePic:[],
baseId: this.$store.state.plantBaseInfoId,
},
rules:{
warehouseName:{required:true, message:"仓库名称必填!", trigger:["blur","change"]},
@ -60,10 +61,15 @@ import request from '@/common/request.js'
else call()
}, trigger:["blur","change"]},
},
eventChannel:null,
}
},
onLoad(){
onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.init()
if(options.id){
this.getDetail(options.id)
}
},
methods:{
async init(){
@ -89,7 +95,8 @@ import request from '@/common/request.js'
}
})
if(res.statu){
this.eventChannel.emit("update")
uni.navigateBack()
}else{
uni.showModal({
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>

116
pages/warehouse/mana.vue

@ -10,46 +10,55 @@
.item{
margin-top:0;
.title{
display:flex;
align-items: center;
font-weight: bold;
text{
margin-left:auto;
color:#333;
}
}
.adder{
color:#999;
font-size:24rpx;
margin-top: 16rpx;
display:flex;
.u-transition{
flex-shrink: 0;
margin-right:28rpx;
}
.data{
display:flex;
justify-content: space-between;
align-items: center;
margin-top:16rpx;
color:#999;
font-size:24rpx;
text:nth-child(2){
color:#10C176;
.info{
flex-grow: 1;
width:1rpx;
.title{
display:flex;
align-items: center;
font-weight: bold;
font-size: 32rpx;
text{
margin-left:auto;
color:#333;
}
}
}
.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;
.adder{
color:#999;
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;
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>
<view class="container flex">
<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-search v-model="searchVal.search" style="margin-top:30rpx;" @search="clean();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="title">{{v.warehouseName}} <text class="plant-youbian"/></view>
<view class="adder">{{v.warehouseAddress}}</view>
<view class="data">
<text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</text>
</view>
<view class="btns">
<text class="plant-xiugai" @click="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>
<u-image width="164rpx" height="164rpx" radius="16rpx" mode="aspectFill" :src="`${host}/${v.warehousePic[0]}`">
<text slot="error" class="plant-xiaopangchetupianjiazaishibai" style="font-size:45rpx"/>
</u-image>
<view class="info">
<view class="title">{{v.warehouseName}} <text class="plant-youbian"/></view>
<view class="adder">{{v.warehouseAddress}}</view>
<view class="data">
<text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</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>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/>
</scroll-view>
</view>
</template>
<script>
import request from '@/common/request.js'
import request,{host} from '@/common/request.js'
export default {
data(){
return{
@ -94,6 +109,7 @@ import request from '@/common/request.js'
},
list:[],
total:0,
host:host('imgUrl'),
}
},
onLoad(options){
@ -112,8 +128,10 @@ import request from '@/common/request.js'
body: this.searchVal
})
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.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{
uni.showModal({
title:"提示",
@ -155,7 +173,11 @@ import request from '@/common/request.js'
},
toAdd(id){
uni.navigateTo({
url:`/pages/warehouse/info?id=${id}`
url:`/pages/warehouse/info?id=${id||''}`,
events:{update:()=>{
this.clean()
this.search()
}}
})
}
}

Loading…
Cancel
Save