Browse Source

修改页面

master
邓宏 2 years ago
parent
commit
72ca2f0e26
  1. 55
      pages/purchase/specs.vue

55
pages/purchase/specs.vue

@ -46,7 +46,7 @@
color:#707070;
}
&:nth-child(2){
margin:auto;
margin-left:20rpx;
font-size:20rpx;
color:#FBA83C;
}
@ -162,7 +162,7 @@
<view class="name">
<text>{{formData.detailedParentName}}</text>
<text>{{formData.goodsName}}</text>
<text class="plant-jiantou_zuoyouqiehuan" @click="$refs.dPicker.show=true"/>
<text class="plant-jiantou_zuoyouqiehuan" @click="$u.route({type:'back'})"/>
</view>
<view class="company">
<text>{{formData.detailedType}}</text>
@ -200,13 +200,6 @@
@close="show=false"
@cancel="show=false"
@confirm="searchStock($event.value[0].id);formData.goodsSpecification=$event.value[0].value;formData.specificationId=$event.value[0].id;show=false"/>
<d-picker :list="goodsList" ref="dPicker" :value="pickerValue" @select="setGoodsVal">
<view slot-scope="{row}" class="purcahse-picker">
<view class="name"><text>{{row.detailedParentName}}</text> <text>{{row.goodsName}}</text></view>
<view class="company" :data-name="row.detailedType" :data-company="row.supplier"/>
</view>
</d-picker>
</view>
</template>
<script>
@ -214,7 +207,6 @@ import request from '@/common/request'
export default{
data(){
return{
purchaseId:'',
specList:[[]],
specStr:"",
dressingUnit:"",
@ -224,7 +216,6 @@ export default{
goodsName:"",
goodsSpecification:"",
num:"",
purchaseId:"",
specificationId:"",
detailedType:"",
@ -232,34 +223,24 @@ export default{
supplier:"",
},
goodsList:[],
goodsDetail:{},
eventChannel:null,
}
},
computed:{
pickerValue(){
return this.goodsList.findIndex(v=>v.id==this.purchaseId)
},
},
async onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.formData.goodsId=options.id
await this.searchGoods()
this.goodsList.forEach(v=>{
if(v.id==options.id){
this.setGoodsVal(v)
}
this.eventChannel.on("detail", detail=>{
this.formData.goodsName=detail.goodsName
this.formData.detailedType=detail.detailedType
this.formData.detailedParentName=detail.detailedParentName
this.formData.supplier=detail.supplier
})
this.formData.goodsId=options.id
this.setGoodsVal()
},
methods:{
async setGoodsVal(val){
this.purchaseId=val.id
this.formData.goodsName=val.goodsName
this.formData.detailedType=val.detailedType
this.formData.detailedParentName=val.detailedParentName
this.formData.supplier=val.supplier
var res=await request("/api/goods/queryGoodsSpecification",{
params:{
goodsName:this.formData.goodsName,
@ -293,7 +274,7 @@ export default{
},
toAdd(){
uni.navigateTo({
url:`/pages/purchase/newSpecs?goodsId=${this.purchaseId}`,
url:`/pages/purchase/newSpecs?goodsId=${this.formData.goodsId}`,
events:{addUnit:e=>{
this.specList[0].push({label:e.goodsSpecification,value:e.goodsSpecification,id:e.goodsSpecificationId})
this.searchStock(e.goodsSpecificationId)
@ -317,20 +298,6 @@ export default{
this.eventChannel.emit("submit", this.formData)
}
},
async searchGoods(){
var res=await request("/api/goods/goodsList",{
params: { goodsName:"",pageNo:1,pageSize:50 }
})
if(res.statu){
this.goodsList=res.data.records
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取农资列表失败!",
showCancel:false,
})
}
},
}
}
</script>
Loading…
Cancel
Save