Browse Source

修改页面数据显示 保存接口参数

master
邓宏 2 years ago
parent
commit
f8d0290bb8
  1. 33
      pages/stock/list.vue

33
pages/stock/list.vue

@ -185,23 +185,9 @@
<view class="title">
<text>规格</text> <text>{{detail.specDescribe}}</text>
</view>
<!-- <view style="display:flex;">
<view class="select">
<text>请添加规格</text>
<text class="plant-youbian"/>
</view>
<text class="plant-xinjian">新建</text>
</view> -->
<view class="tip">库存2(200kg)</view>
<view class="tip">库存{{detail.equivalentInventory}}{{detail.packgeUnit}}({{detail.equivalentInventory*detail.unitNum}}{{detail.unit}})</view>
</view>
<!-- <view class="card purchase">
<view class="title_mast">{{({out:"出",in:"入"})[mode]}}库数量</view>
<view class="input">
<input placeholder="请输入采购数量" type="digit"/>
<text>{{detail.unit}}</text>
</view>
</view> -->
<view class="card">
<u-form class="inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<d-form
@ -233,7 +219,7 @@ export default{
fields:{
inOutType:{label:"库类型",type:"select",columns:[],value:[]},
inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`KC${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`${({in:'RK',out:'CK'})[this.mode]}${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
pic:{label:"库凭证",type:"upImg",value:"",num:3},
number:{label:"库数量",placeholder:"请输入采购数量"},
},
@ -248,11 +234,15 @@ export default{
rules:{
inOutType:{required:true},
inOutBatchNo:{required:true},
pic:{required:true,validator(rule,val,call){
if(!this.fields.pic.value)call(new Error("请上传库凭证!"));
// pic:{required:true,validator(rule,val,call){
// if(!this.fields.pic.value)call(new Error(""));
// else call()
// }},
number:{required:true,validator(rule,val,call){
if(!val)call(new Error(`请输入${({in:'入',out:'出'})[this.mode]}库数量!`));
else if(this.mode=='out' && val>this.detail.equivalentInventory)call(new Error(`${({in:'入',out:'出'})[this.mode]}库数量不能大于库存数量!`));
else call()
}},
number:{required:true,type:"number"},
},type:"number"},
},
mode:"",
eventChannel:null,
@ -295,7 +285,7 @@ export default{
method:"post",
body:{
...this.formData,
...this.detail,
inventoryId: this.detail.inventoryId,
equivalentAmount: this.detail.equivalentInventory,
supplier: this.detail.supplierName,
pic:this.fields.pic.value,
@ -304,6 +294,7 @@ export default{
})
if(res.statu){
uni.navigateBack()
this.eventChannel.emit("update")
}else{
uni.showModal({
title:"提示",

Loading…
Cancel
Save