|
@ -59,7 +59,7 @@ |
|
|
<text style="margin:45rpx 20rpx 0 20rpx;">/</text> |
|
|
<text style="margin:45rpx 20rpx 0 20rpx;">/</text> |
|
|
<d-form style="width:max-content;margin-top:40rpx;" type="select" placeholder=" " @select="formData.packUnit=$event.value[0].value" :columns="[packWeightList]" :value="[formData.packUnit]"/> |
|
|
<d-form style="width:max-content;margin-top:40rpx;" type="select" placeholder=" " @select="formData.packUnit=$event.value[0].value" :columns="[packWeightList]" :value="[formData.packUnit]"/> |
|
|
</view> |
|
|
</view> |
|
|
<d-form label="交易数量" type="digit" suffix="袋" required field="tradeNum" :value="formData.tradeNum" @input="formData.tradeNum=$event"/> |
|
|
<d-form label="交易数量" disabled type="digit" suffix="袋" :value="tradeNum"/> |
|
|
<d-form label="买方名称" required field="buyerName" :value="formData.buyerName" @input="formData.buyerName=$event"/> |
|
|
<d-form label="买方名称" required field="buyerName" :value="formData.buyerName" @input="formData.buyerName=$event"/> |
|
|
<d-form label="买方类型" required field="buyerType" type="select" :columns="[buyerType.list]" :value="buyerType.value" @select="buyerType.value=$event.value.map(v=>v.value);formData.buyerType=buyerType.value[1]"/> |
|
|
<d-form label="买方类型" required field="buyerType" type="select" :columns="[buyerType.list]" :value="buyerType.value" @select="buyerType.value=$event.value.map(v=>v.value);formData.buyerType=buyerType.value[1]"/> |
|
|
<d-form label="收货地址" required field="buyerAddress" type="textarea" :value="formData.buyerAddress" @input="formData.buyerAddress=$event"/> |
|
|
<d-form label="收货地址" required field="buyerAddress" type="textarea" :value="formData.buyerAddress" @input="formData.buyerAddress=$event"/> |
|
@ -103,6 +103,11 @@ export default { |
|
|
eventChannel:null, |
|
|
eventChannel:null, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed:{ |
|
|
|
|
|
tradeNum(){ |
|
|
|
|
|
return Math.round((parseFloat(this.formData.tradeWeight)/parseFloat(this.formData.specification)||0)*100)/100 |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
onLoad(options){ |
|
|
onLoad(options){ |
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
this.eventChannel=this.getOpenerEventChannel() |
|
|
this.eventChannel.on("detail", e=>{ |
|
|
this.eventChannel.on("detail", e=>{ |
|
@ -148,7 +153,10 @@ export default { |
|
|
if(valid){ |
|
|
if(valid){ |
|
|
var res=await request("/api/plantTrade/add",{ |
|
|
var res=await request("/api/plantTrade/add",{ |
|
|
method:"post", |
|
|
method:"post", |
|
|
body: this.formData |
|
|
body: { |
|
|
|
|
|
...this.formData, |
|
|
|
|
|
tradeNum: this.tradeNum |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(res.statu){ |
|
|
if(res.statu){ |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|