Browse Source

库存表单新增字段

master
邓宏 2 years ago
parent
commit
4b0de7b706
  1. 55
      pages/stock/list.vue

55
pages/stock/list.vue

@ -165,6 +165,17 @@
</view>
</d-form>
<d-form :label="`${({in:'入',out:'出'})[mode]}库类型`" field="inOutType" required type="select" :columns="inOutType.list" :value="inOutType.value" @select="inOutType.value=$event.map(v=>v.value);formData.inOutType=inOutType.value.slice(-1)[0]"/>
<!-- 农资出库出库类型为损坏出库 -->
<block v-if="formData.substanceType==1&&formData.inOutType=='out02'">
<d-form label="采购单价" type='digit' v-model="formData.price" required field="price"/>
<d-form label="处理方式" type="select" :columns="[processMode]" :value="[formData.processMode]" @select="formData.processMode=$event[0].value" required field="processMode"/>
</block>
<!-- 农产品出库 出库类型为损坏出库-->
<block v-else-if="formData.substanceType==2&&formData.inOutType=='out03'">
<d-form label="损坏原因" type="select" :columns="[damageReason]" :value="formData.damageReason" @select="formData.damageReason=$event[0].value" required field="damageReason"/>
<d-form label="折价率" type="digit" v-model="formData.rateDiscount" required field="rateDiscount"/>
<d-form label="金额" type="digit" v-model="formData.amount" required field="amount"/>
</block>
<d-form :label="`${({in:'入',out:'出'})[mode]}库批次号`" field="inOutBatchNo" required :disabled="formData.substanceType==2" :value="formData.inOutBatchNo" @input="formData.inOutBatchNo=$event" :btnText="formData.substanceType==1?'生成':''" :btnFun="()=>this.formData.inOutBatchNo=`${({in:'RK',out:'CK'})[this.mode]}${new Date().format('yyyyMMdd')}${new Date().getTime()}`"/>
<d-form :label="({1:`${({in:'入',out:'出'})[mode]}库数量`,2:'重量'})[formData.substanceType]" field="number" required :suffix="number.suffix" :value="formData.number" @input="formData.number=$event" type="digit"/>
<d-form label="操作日期" field="operationTime" required type="calendar" v-model="formData.operateTime"/>
@ -201,6 +212,8 @@ export default{
number:{suffix:""},
buyerType:{list:[],value:[]},
packWeightList:[],
processMode:[],//
damageReason:[],//
formData:{
inInventoryBatch:"",
inOutType:"",
@ -217,6 +230,13 @@ export default{
tradeNum:"",
buyerType:"",
buyerAddress:"",
price:"",
processMode:"",
damageReason:"",
rateDiscount:"",
amount:"",
},
rules:{
inInventoryBatch:{required:true,message:"请选择采收批次!",trigger:['blur','change']},
@ -242,6 +262,13 @@ export default{
buyerName:{required:true,message:"买方名称必填!",trigger:['blur','change']},
buyerType:{required:true,message:"交易类型必选!",trigger:['blur','change']},
buyerAddress:{required:true,message:"收货地址必填!",trigger:['blur','change']},
price:{required:true, type:"number", message:"请输入采购单价!",tigger:['blur','change']},
processMode:{required:true, message:"请输入处理方式!",tigger:['blur','change']},
damageReason:{required:true, message:"请选择损坏原因!",tigger:['blur','change']},
rateDiscount:{required:true, type:"number", message:"请输入折价率!",tigger:['blur','change']},
amount:{required:true, type:"number", message:"请输入金额!",tigger:['blur','change']},
},
mode:"",
eventChannel:null,
@ -333,6 +360,34 @@ export default{
showCancel:false,
})
}
//
var res = await request("/common/api/dict/queryDictItemByDictCode",{
method:"post",
params:{dictCode:"process_mode"}
})
if(res.statu){
this.processMode=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取买方类型选项失败!",
showCancel:false,
})
}
//
var res = await request("/common/api/dict/queryDictItemByDictCode",{
method:"post",
params:{dictCode:"damage_reason"}
})
if(res.statu){
this.damageReason=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取买方类型选项失败!",
showCancel:false,
})
}
},
submit(){
this.$refs.form.validate().then(async valid=>{

Loading…
Cancel
Save