Browse Source

type:refactor

commit:修改请求url
master
孙家正 2 years ago
parent
commit
f3ad69ddd9
  1. 2
      pages/stock/already.vue
  2. 12
      pages/stock/list.vue
  3. 6
      pages/stock/mana.vue
  4. 2
      pages/stock/record.vue

2
pages/stock/already.vue

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

12
pages/stock/list.vue

@ -234,22 +234,22 @@ export default{
fields:{
inOutType:{label:"库类型",type:"select",columns:[],value:[]},
inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`KC${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
inOutVoucher:{label:"库凭证",type:"upImg",value:"",num:3},
pic:{label:"库凭证",type:"upImg",value:"",num:3},
number:{label:"库数量",placeholder:"请输入采购数量"},
},
formData:{
inOutType:"",
goodsId:"",
inOutBatchNo:"",
inOutVoucher:[],
pic:[],
number:"",
substanceType:"",
},
rules:{
inOutType:{required:true},
inOutBatchNo:{required:true},
inOutVoucher:{required:true,validator(rule,val,call){
if(!this.fields.inOutVoucher.value)call(new Error("请上传库凭证!"));
pic:{required:true,validator(rule,val,call){
if(!this.fields.pic.value)call(new Error("请上传库凭证!"));
else call()
}},
number:{required:true,type:"number"},
@ -291,14 +291,14 @@ export default{
submit(){
this.$refs.form.validate().then(async valid=>{
if(valid){
var res=await request("/api/OutInManageApi/outInList",{
var res=await request("/api/Inventory/inventoryOperate",{
method:"post",
body:{
...this.formData,
...this.detail,
equivalentAmount: this.detail.equivalentInventory,
supplier: this.detail.supplierName,
inOutVoucher:this.fields.inOutVoucher.value,
pic:this.fields.pic.value,
type: ({in:2, out:1})[this.mode],
}
})

6
pages/stock/mana.vue

@ -133,14 +133,14 @@
<view class="info">
<text>{{v.agriculturalGoods}}</text>
<text :data-unit="v.specDescribe">{{v.substanceName}}</text>
<text>补货量{{v.replenishment||0}}kg</text>
<text v-if="v.replenishment">补货量{{v.replenishment}}{{v.unit}}</text>
</view>
<view class="company">
<text style="--c:#FBA83C;margin-right:14rpx;">{{v.detailType}}</text>
<text style="--c:#999;" class="over">{{v.supplierName}}</text>
</view>
<view class="num">
<text>库存量{{v.equivalentInventory||0}}kg</text>
<text>库存量{{v.equivalentInventory||0}}{{v.unit}}</text>
<view class="btns">
<button class="cu-btn" @click="toList('out',v)">出库</button>
<button class="cu-btn" @click="toList('in',v)">入库</button>
@ -187,7 +187,7 @@ export default {
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.nz)
this.list=this.list.concat(res.data.realRecords)
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})

2
pages/stock/record.vue

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

Loading…
Cancel
Save