|
@ -185,23 +185,9 @@ |
|
|
<view class="title"> |
|
|
<view class="title"> |
|
|
<text>规格</text> <text>{{detail.specDescribe}}</text> |
|
|
<text>规格</text> <text>{{detail.specDescribe}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<!-- <view style="display:flex;"> |
|
|
<view class="tip">库存:{{detail.equivalentInventory}}{{detail.packgeUnit}}({{detail.equivalentInventory*detail.unitNum}}{{detail.unit}})</view> |
|
|
<view class="select"> |
|
|
|
|
|
<text>请添加规格</text> |
|
|
|
|
|
<text class="plant-youbian"/> |
|
|
|
|
|
</view> |
|
|
|
|
|
<text class="plant-xinjian">新建</text> |
|
|
|
|
|
</view> --> |
|
|
|
|
|
<view class="tip">库存:2袋(200kg)</view> |
|
|
|
|
|
</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"> |
|
|
<view class="card"> |
|
|
<u-form class="inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto"> |
|
|
<u-form class="inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto"> |
|
|
<d-form |
|
|
<d-form |
|
@ -233,7 +219,7 @@ export default{ |
|
|
|
|
|
|
|
|
fields:{ |
|
|
fields:{ |
|
|
inOutType:{label:"库类型",type:"select",columns:[],value:[]}, |
|
|
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}, |
|
|
pic:{label:"库凭证",type:"upImg",value:"",num:3}, |
|
|
number:{label:"库数量",placeholder:"请输入采购数量"}, |
|
|
number:{label:"库数量",placeholder:"请输入采购数量"}, |
|
|
}, |
|
|
}, |
|
@ -248,11 +234,15 @@ export default{ |
|
|
rules:{ |
|
|
rules:{ |
|
|
inOutType:{required:true}, |
|
|
inOutType:{required:true}, |
|
|
inOutBatchNo:{required:true}, |
|
|
inOutBatchNo:{required:true}, |
|
|
pic:{required:true,validator(rule,val,call){ |
|
|
// pic:{required:true,validator(rule,val,call){ |
|
|
if(!this.fields.pic.value)call(new Error("请上传库凭证!")); |
|
|
// 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() |
|
|
else call() |
|
|
}}, |
|
|
},type:"number"}, |
|
|
number:{required:true,type:"number"}, |
|
|
|
|
|
}, |
|
|
}, |
|
|
mode:"", |
|
|
mode:"", |
|
|
eventChannel:null, |
|
|
eventChannel:null, |
|
@ -295,7 +285,7 @@ export default{ |
|
|
method:"post", |
|
|
method:"post", |
|
|
body:{ |
|
|
body:{ |
|
|
...this.formData, |
|
|
...this.formData, |
|
|
...this.detail, |
|
|
inventoryId: this.detail.inventoryId, |
|
|
equivalentAmount: this.detail.equivalentInventory, |
|
|
equivalentAmount: this.detail.equivalentInventory, |
|
|
supplier: this.detail.supplierName, |
|
|
supplier: this.detail.supplierName, |
|
|
pic:this.fields.pic.value, |
|
|
pic:this.fields.pic.value, |
|
@ -304,6 +294,7 @@ export default{ |
|
|
}) |
|
|
}) |
|
|
if(res.statu){ |
|
|
if(res.statu){ |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
|
|
|
this.eventChannel.emit("update") |
|
|
}else{ |
|
|
}else{ |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title:"提示", |
|
|
title:"提示", |
|
|