Browse Source

type:refactor

commit:库存、领用、出入库记录接口逻辑
master
孙家正 2 years ago
parent
commit
155f41d67b
  1. 8
      pages/stock/already.vue
  2. 8
      pages/stock/goods_detail.vue
  3. 2
      pages/stock/mana.vue
  4. 16
      pages/stock/record.vue

8
pages/stock/already.vue

@ -78,13 +78,13 @@
<scroll-view scroll-y @scrollotower="search">
<view class="card" v-for="(v,k) in list" :key="k">
<view class="info">
<text>{{v.agriculturalGoods}}</text> <text>{{v.substanceName}}</text> <text>({{v.specDescribe}})</text>
<text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text>({{v.specDescribe}})</text>
</view>
<view class="name">
<text>{{v.detailType}}</text> <text class="over">{{v.supplierName}}</text>
<text>{{v.goodsDetailType}}</text> <text class="over">{{v.supplier}}</text>
</view>
<view class="data">
<text>领用时间{{new Date(v.collectingTime).format("yyyy-MM-dd")}}</text> <text :data-unit="`共${v.total}kg`">{{v.num}}{{(v.specDescribe.match(/\/(.+)/)||['',''])[1]}}</text>
<text>领用时间{{new Date(v.operateTime).format("yyyy-MM-dd")}}</text> <text :data-unit="`共${v.equivalentAmount}${v.unit}`">{{v.number}}{{v.packgeUnit}}</text>
</view>
</view>
<u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
@ -122,7 +122,7 @@ export default {
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.list)
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"})

8
pages/stock/goods_detail.vue

@ -24,10 +24,10 @@
<view class="title">基本信息</view>
<view class="item">
<text>批次号</text> <text>{{detail.batchNo}}</text>
<text>批次号</text> <text>{{detail.inOutBatchNo}}</text>
</view>
<view class="item">
<text>出库类型</text> <text>{{detail.inOutType}}</text>
<text>操作类型</text> <text>{{detail.inOutType}}</text>
</view>
<view class="item">
<text>农资名称</text> <text>{{detail.substanceName}}</text>
@ -36,10 +36,10 @@
<text>规格</text> <text>{{detail.specDescribe}}</text>
</view>
<view class="item">
<text>物品数量</text> <text>{{detail.number}}({{detail.equivalentAmount}}{{detail.unit}})</text>
<text>操作数量</text> <text>{{detail.number}}{{detail.packgeUnit}}({{detail.equivalentAmount}}{{detail.unit}})</text>
</view>
<view class="item">
<text>供销商</text> <text>{{detail.supplierName}}</text>
<text>供销商</text> <text>{{detail.supplier}}</text>
</view>
</view>
</view>

2
pages/stock/mana.vue

@ -189,7 +189,7 @@ export default {
},
async search(){
if(this.total==0 || this.list.length<this.total){
var res=await request("/api/InventoryManageApi/queryInventoryList",{
var res=await request("/api/Inventory/queryInventoryList",{
method:"post",
body: this.searchVal
})

16
pages/stock/record.vue

@ -68,11 +68,11 @@
<view class="container">
<view class="card" v-for="(v,k) in list" :key="k" @click="toDetail(v)">
<view class="head">
<text class="plant-rili"/> <text>批次号{{v.batchNo}}</text> <text>{{v.inOutType}}</text>
<text class="plant-rili"/> <text>批次号{{v.inOutBatchNo}}</text> <text>{{v.inOutType}}</text>
</view>
<view class="plant-youbian"> <text :data-unit="v.specDescribe">{{v.substanceName}}</text> </view>
<view class="company">
<text>{{v.supplierName}}</text> <text>{{v.number}}({{v.equivalentAmount}}{{v.unit}})</text>
<text>{{v.supplier}}</text> <text>{{v.number}}{{v.packgeUnit}}({{v.equivalentAmount}}{{v.unit}})</text>
</view>
</view>
<u-empty v-if="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
@ -84,7 +84,8 @@ export default {
data(){
return{
searchVal:{
baseId: this.$store.state.plantBaseInfoId,
userId: '',
enterpriseId: '',
pageNo:1,
pageSize:6,
},
@ -94,6 +95,13 @@ export default {
},
onLoad(options){
this.search()
if (this.$store.getters['userInfo'].roleCode=="baseAdmin") {
this.searchVal.userId = this.$store.getters['userInfo'].id
this.searchVal.enterpriseId = ''
} else {
this.searchVal.enterpriseId = this.$store.getters.userInfo.companyId
this.searchVal.userId = ''
}
},
methods:{
async search(){
@ -103,7 +111,7 @@ export default {
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.list)
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"})

Loading…
Cancel
Save