Browse Source

农资入库 修改表单

master
邓宏 2 years ago
parent
commit
468f4cbb43
  1. 10
      pages/purchase/newSpecs.vue
  2. 10
      pages/purchase/specs.vue
  3. 7
      pages/stock/agrWarehouse.vue

10
pages/purchase/newSpecs.vue

@ -60,10 +60,10 @@
<view class="tip">例如肥料一袋50kg录入规格则为50kg/</view>
</view>
<view class="card warning">
<!-- <view class="card warning">
<view class="title_mast">预警值</view>
<view class="input"><input placeholder="请输入预警值" type="digit" v-model="formData.earlyValue"/><text>{{formData.dressingUnit}}</text></view>
</view>
</view> -->
<button class="cu-btn round bg-green shadow submit" @click="submit">确定</button>
@ -124,9 +124,9 @@ export default {
if(!this.formData.num>0){
uni.showToast({title:"规格值必填!",icon:"none"})
return false
}else if(!this.formData.earlyValue>0){
uni.showToast({title:"预警值必填!",icon:"none"})
return false
// }else if(!this.formData.earlyValue>0){
// uni.showToast({title:"",icon:"none"})
// return false
}
return true
},

10
pages/purchase/specs.vue

@ -188,6 +188,12 @@
<input placeholder="请输入采购数量" type="digit" v-model="formData.num"/>
<text>{{dressingUnit}}</text>
</view>
<view class="title_mast" style="margin-top:20rpx;">预警值</view>
<view class="input">
<input placeholder="请输入预警值" type="digit" v-model="formData.warning"/>
<text>{{dressingUnit}}</text>
</view>
</view>
<button class="cu-btn round bg-green shadow submit" @click="submit">确定</button>
@ -216,6 +222,7 @@ export default{
goodsName:"",
goodsSpecification:"",
num:"",
warning:"",
specificationId:"",
detailedType:"",
@ -239,8 +246,7 @@ export default{
this.formData.supplier=detail.supplier
})
this.formData.goodsId=options.goodsId
//
if(this.intoPage=='purchase')this.setGoodsVal()
this.setGoodsVal()
},
methods:{
async setGoodsVal(val){

7
pages/stock/agrWarehouse.vue

@ -93,7 +93,8 @@ import request from '@/common/request'
return{
fields:{
specName:{label:"规格", disabled:true, agr:true},
number:{label:"入库数量", type:"digit",suffix:"袋", tip:""},
warning:{label:"预计值",type:"digit",suffix:"",agr:true},
number:{label:"入库数量", type:"digit",suffix:"", tip:""},
inOutBatchNo:{label:"入库批次号",agr:true, btnText:"生成", btnFun:()=>this.formData.inOutBatchNo=`RK${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
warehouseId:{label:"选择仓库", type:"select",columns:[],value:[],agr:true},
inOutType:{label:"入库类型",type:"select",columns:[],value:[]},
@ -104,6 +105,7 @@ import request from '@/common/request'
formData:{
enterpriseId: this.$store.getters['userInfo'].companyId,
specName:"",
warning:"",
specId:"",
number:"",
warehouseId:"",
@ -117,6 +119,7 @@ import request from '@/common/request'
},
rules:{
number:{required:true,type:"number", message:"入库数量必填!"},
warning:{required:true,type:"number", message:"入库数量必填!"},
inOutBatchNo:{required:true, message:"入库批次号必填!"},
warehouseId:{required:true, message:"仓库必选!"},
inOutType:{required:true, message:"入库类型必选!"},
@ -139,6 +142,7 @@ import request from '@/common/request'
watch:{
specs(n){
this.fields.number.suffix=n.specs[2]
this.fields.warning.suffix=n.specs[2]
if(n.num>0 && n.specs[0]){
this.fields.number.tip=`共计:${parseFloat(n.num)*parseFloat(n.specs[0])}${n.specs[1]}`
}else{
@ -180,6 +184,7 @@ import request from '@/common/request'
})
}
},
//
toAddAgr(){
uni.navigateTo({
url:"/pages/purchase/agrProdList?intoPage=stock",

Loading…
Cancel
Save