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