Browse Source

联调

master
邓宏 2 years ago
parent
commit
cbad5dab50
  1. 2
      pages/massif/plant_plan.vue
  2. 2
      pages/purchase/specs.vue
  3. 98
      pages/stock/list.vue

2
pages/massif/plant_plan.vue

@ -45,7 +45,7 @@ export default {
{label:"无公害",value:'3'}, {label:"无公害",value:'3'},
{label:"普通",value:'4'}, {label:"普通",value:'4'},
]}, ]},
plantBatch:{label:"种植批次号",btnText:"生成",btnFun:()=>this.formData.plantBatch=`CS${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, plantBatch:{label:"种植批次号",btnText:"生成",btnFun:()=>this.formData.plantBatch=`ZZ${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
principal:{label:"负责人"}, principal:{label:"负责人"},
principalId:{label:"负责人身份证"}, principalId:{label:"负责人身份证"},
productIntroduce:{label:"产品介绍",type:"textarea"}, productIntroduce:{label:"产品介绍",type:"textarea"},

2
pages/purchase/specs.vue

@ -236,7 +236,7 @@ export default{
this.formData.detailedParentName=detail.detailedParentName this.formData.detailedParentName=detail.detailedParentName
this.formData.supplier=detail.supplier this.formData.supplier=detail.supplier
}) })
this.formData.goodsId=options.id this.formData.goodsId=options.goodsId
this.setGoodsVal() this.setGoodsVal()
}, },
methods:{ methods:{

98
pages/stock/list.vue

@ -5,6 +5,14 @@
padding:30rpx 0; padding:30rpx 0;
.card{ .card{
margin-top:0; margin-top:0;
&>.title{
display:flex;
align-items: center;
justify-content: space-between;
text:nth-child(2){
color:#777;
}
}
} }
&>.fertilizer{ &>.fertilizer{
&>.name{ &>.name{
@ -44,12 +52,12 @@
&:first-child{ &:first-child{
flex-shrink: 0; flex-shrink: 0;
font-size:20rpx; font-size:20rpx;
color:#707070; color:#FBA83C;
} }
&:nth-child(2){ &:nth-child(2){
margin:auto; margin-left:20rpx;
font-size:20rpx; font-size:20rpx;
color:#FBA83C; color:#707070;
} }
} }
} }
@ -163,19 +171,19 @@
<view class="container"> <view class="container">
<view class="card fertilizer"> <view class="card fertilizer">
<view class="name"> <view class="name">
<text>化肥</text> <text>{{detail.agriculturalGoods}}</text>
<text>中量元素水溶肥</text> <text>{{detail.substanceName}}</text>
<!-- <text class="plant-jiantou_zuoyouqiehuan" @click="$refs.dPicker.show=true"/> --> <!-- <text class="plant-jiantou_zuoyouqiehuan" @click="$refs.dPicker.show=true"/> -->
</view> </view>
<view class="company"> <view class="company">
<text>云南云天化股份有限公司</text> <text>{{detail.detailType}}</text>
<text>微量元素肥</text> <text>{{detail.supplierName}}</text>
</view> </view>
</view> </view>
<view class="card specs"> <view class="card specs">
<view class="title_mast"> <view class="title">
<text>规格</text> <text></text> <text>规格</text> <text>{{detail.specDescribe}}</text>
</view> </view>
<!-- <view style="display:flex;"> <!-- <view style="display:flex;">
<view class="select"> <view class="select">
@ -187,12 +195,26 @@
<view class="tip">库存2(200kg)</view> <view class="tip">库存2(200kg)</view>
</view> </view>
<view class="card purchase"> <!-- <view class="card purchase">
<view class="title_mast">{{({out:"出",in:"入"})[mode]}}库数量</view> <view class="title_mast">{{({out:"出",in:"入"})[mode]}}库数量</view>
<view class="input"> <view class="input">
<input placeholder="请输入采购数量" type="digit"/> <input placeholder="请输入采购数量" type="digit"/>
<text>kg</text> <text>{{detail.unit}}</text>
</view> </view>
</view> -->
<view class="card">
<u-form class="inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<d-form
v-for="(v,k) in fields" :key="k"
v-bind="v"
:label="`${({in:'入',out:'出'})[mode]}${v.label}`"
:field="k"
:required="!!rules[k]"
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"
@select="formData[k]=$event.value[0].value;fields[k].value=[formData[k]]"
@imgs="fields[k].value=$event"
@input="formData[k]=$event"/>
</u-form>
</view> </view>
<button class="cu-btn round bg-green shadow submit">确定</button> <button class="cu-btn round bg-green shadow submit">确定</button>
@ -214,43 +236,65 @@
</template> </template>
<script> <script>
import request from '@/common/request' import request from '@/common/request'
import dForm from '../../uni_modules/d-form/components/d-form/d-form.vue'
export default{ export default{
components: { dForm },
data(){ data(){
return{ return{
mode:"", mode:"",
stockList:[],
eventChannel:null,
detail:{}, detail:{},
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},
number:{label:"库数量",placeholder:"请输入采购数量"},
},
formData:{
inOutType:"",
goodsId:"",
inOutBatchNo:"",
inOutVoucher:[],
number:""
},
rules:{
inOutType:{required:true},
inOutBatchNo:{required:true},
inOutVoucher:{required:true,validator(rule,val,call){
if(!this.fields.inOutVoucher.value)call(new Error("请上传库凭证!"));
else call()
}},
number:{required:true,type:"number"},
},
mode:"",
eventChannel:null,
} }
}, },
onLoad(options){ onLoad(options){
this.eventChannel=this.getOpenerEventChannel() this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("detail", e=>this.detail=e) this.eventChannel.on("detail", e=>{
this.detail=e
this.fields.number.suffix=(e.specDescribe.match(/\/(.+)/)||['',''])[1]
this.formData.goodsId=e.id
})
this.mode=options.mode this.mode=options.mode
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:({out:"出库",in:"入库列表"})[this.mode] title:({out:"出库",in:"入库列表"})[this.mode]
}) })
this.getStore({ this.init()
baseId: this.$store.state.plantBaseInfoId,
search:"",
substanceType: options.type,
pageNo:1,
pageSize:50,
warehouseId: options.warehouseId,
})
}, },
methods:{ methods:{
async getStore(body){ async init(){
var res=await request("/api/InventoryManageApi/queryInventoryList",{ var res=await request("/common/api/dict/queryDictItemByDictCode",{
method:"post", method:"post",
body, params:{dictCode: ({out:"out_type",in:"in_type"})[this.mode]}
}) })
if(res.statu){ if(res.statu){
this.stockList=res.data.nz this.fields.inOutType.columns=[res.data]
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",
content:res.msg||"获取库存列表失败!", content:res.msg||"获取企业类型选项失败!",
showCancel:false, showCancel:false,
}) })
} }

Loading…
Cancel
Save