Browse Source

联调接口

master
邓宏 2 years ago
parent
commit
8985129628
  1. 2
      pages/baseMana/formReacord.vue
  2. 2
      pages/home/index.vue
  3. 2
      pages/massif/index.vue
  4. 16
      pages/massif/info.vue
  5. 2
      pages/massif/mana/plantPlan.vue
  6. 2
      pages/massif/mana/recovery.vue
  7. 5
      pages/massif/plant_plan.vue
  8. 2
      pages/purchase/agrProdList.vue
  9. 2
      pages/purchase/detail.vue
  10. 2
      pages/stock/already.vue
  11. 44
      pages/stock/list.vue
  12. 2
      pages/stock/mana.vue
  13. 2
      pages/stock/record.vue
  14. 19
      pages/warehouse/info.vue
  15. 2
      pages/warehouse/mana.vue
  16. 2
      uni_modules/d-form/components/d-form/d-form.vue

2
pages/baseMana/formReacord.vue

@ -96,7 +96,7 @@
<text>负责人{{v.principal}}</text> <text>记录时间{{v.time}}</text> <text>负责人{{v.principal}}</text> <text>记录时间{{v.time}}</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>

2
pages/home/index.vue

@ -356,7 +356,7 @@
<text>投入品</text> <text class="over">{{v.userName}}{{new Date(v.time).format('yyyy-MM-dd')}}日完成了{{v.plotName}}{{v.farmWorkName}}任务</text> <text>投入品</text> <text class="over">{{v.userName}}{{new Date(v.time).format('yyyy-MM-dd')}}日完成了{{v.plotName}}{{v.farmWorkName}}任务</text>
</view> </view>
</template> </template>
<u-empty v-if="isEmpty" width="70%" icon="/static/noData.png"/> <u-empty v-if="isEmpty" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</view> </view>
<u-picker v-if="isAdmin" :show="show" :columns="plantBase" keyName="baseName" closeOnClickOverlay @close="show=false" @confirm="$store.commit('setBaseId', $event.value[0].id);show=false" @cancel="show=false"/> <u-picker v-if="isAdmin" :show="show" :columns="plantBase" keyName="baseName" closeOnClickOverlay @close="show=false" @confirm="$store.commit('setBaseId', $event.value[0].id);show=false" @cancel="show=false"/>

2
pages/massif/index.vue

@ -103,7 +103,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>

16
pages/massif/info.vue

@ -31,7 +31,7 @@ import request from '@/common/request'
data(){ data(){
return{ return{
fields:{ fields:{
plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[]}, plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[],disabled:this.$store.getters['userInfo'].roleCode=="baseAdmin"},
plotNumber:{label:"地块编号"}, plotNumber:{label:"地块编号"},
plotName:{label:"地块名称"}, plotName:{label:"地块名称"},
drawArea:{label:"地块面积(亩)",type:'digit'}, drawArea:{label:"地块面积(亩)",type:'digit'},
@ -73,9 +73,17 @@ import request from '@/common/request'
eventChannel:null, eventChannel:null,
} }
}, },
onLoad(options){ async onLoad(options){
this.init() await this.init()
if(options.id)this.getDetail(options.id); if(options.id){
this.getDetail(options.id)
}else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){
var baseVal=this.fields.plantBaseInfoId.columns[0].find(v=>v.value==this.$store.state.plantBaseInfoId)
if(baseVal){
this.formData.plantBaseInfoId=baseVal.value
this.fields.plantBaseInfoId.value=[baseVal.value]
}
}
this.eventChannel=this.getOpenerEventChannel() this.eventChannel=this.getOpenerEventChannel()
}, },
methods:{ methods:{

2
pages/massif/mana/plantPlan.vue

@ -132,7 +132,7 @@
<text v-if="v.status==2" class="over">已结束</text> <text v-if="v.status==2" class="over">已结束</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
<button class="cu-btn round bg-green shadow submit" @click="addPlant">+新增种植计划</button> <button class="cu-btn round bg-green shadow submit" @click="addPlant">+新增种植计划</button>

2
pages/massif/mana/recovery.vue

@ -108,7 +108,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
<u-datetime-picker <u-datetime-picker

5
pages/massif/plant_plan.vue

@ -93,7 +93,10 @@ export default {
}, },
methods:{ methods:{
async init(){ async init(){
var res=await request("/api/plantPlan/getType") var res=await request("/common/api/dict/categoryValue",{
method:"post",
params:{code:"B06"}
})
if(res.statu){ if(res.statu){
this.fields.plantType.columns=[res.data] this.fields.plantType.columns=[res.data]
}else{ }else{

2
pages/purchase/agrProdList.vue

@ -67,7 +67,7 @@
<text>{{v.detailedType}}</text> <text class="over">{{v.supplier}}</text> <text>{{v.detailedType}}</text> <text class="over">{{v.supplier}}</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>

2
pages/purchase/detail.vue

@ -73,7 +73,7 @@
<text>{{v.detailedType}}</text> <text class="over">{{v.supplier}}</text> <text :data-total="v.heft">{{v.packing}}</text> <text>{{v.detailedType}}</text> <text class="over">{{v.supplier}}</text> <text :data-total="v.heft">{{v.packing}}</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</view> </view>
</view> </view>
</template> </template>

2
pages/stock/already.vue

@ -87,7 +87,7 @@
<text>领用时间{{new Date(v.collectingTime).format("yyyy-MM-dd")}}</text> <text :data-unit="`共${v.total}kg`">{{v.num}}{{(v.specDescribe.match(/\/(.+)/)||['',''])[1]}}</text> <text>领用时间{{new Date(v.collectingTime).format("yyyy-MM-dd")}}</text> <text :data-unit="`共${v.total}kg`">{{v.num}}{{(v.specDescribe.match(/\/(.+)/)||['',''])[1]}}</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>

44
pages/stock/list.vue

@ -217,21 +217,8 @@
</u-form> </u-form>
</view> </view>
<button class="cu-btn round bg-green shadow submit">确定</button> <button class="cu-btn round bg-green shadow submit" @click="submit">确定</button>
<!-- <d-picker ref="dPicker" :list="stockList">
<view slot-scope="{row}" class="stock-picker">
<view class="info">
<text>{{row.agriculturalGoods}}</text>
<text :data-unit="row.specDescribe">{{row.substanceName}}</text>
<text>补货量{{row.replenishment||0}}kg</text>
</view>
<view class="company">
<text style="--c:#FBA83C;margin-right:14rpx;">{{row.detailType}}</text>
<text style="--c:#999;" class="over">{{row.supplierName}}</text>
</view>
</view>
</d-picker> -->
</view> </view>
</template> </template>
<script> <script>
@ -255,7 +242,8 @@ export default{
goodsId:"", goodsId:"",
inOutBatchNo:"", inOutBatchNo:"",
inOutVoucher:[], inOutVoucher:[],
number:"" number:"",
substanceType:"",
}, },
rules:{ rules:{
inOutType:{required:true}, inOutType:{required:true},
@ -277,6 +265,7 @@ export default{
this.fields.number.suffix=(e.specDescribe.match(/\/(.+)/)||['',''])[1] this.fields.number.suffix=(e.specDescribe.match(/\/(.+)/)||['',''])[1]
this.formData.goodsId=e.id this.formData.goodsId=e.id
}) })
this.formData.substanceType = ({nz:1, ncp:2})[options.type],
this.mode=options.mode this.mode=options.mode
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:({out:"出库",in:"入库列表"})[this.mode] title:({out:"出库",in:"入库列表"})[this.mode]
@ -299,6 +288,31 @@ export default{
}) })
} }
}, },
submit(){
this.$refs.form.validate().then(async valid=>{
if(valid){
var res=await request("/api/OutInManageApi/outInList",{
method:"post",
body:{
...this.formData,
...this.detail,
supplier: this.detail.supplierName,
inOutVoucher:this.fields.inOutVoucher.value,
type: ({in:2, out:1})[this.mode],
}
})
if(res.statu){
uni.navigateBack()
}else{
uni.showModal({
title:"提示",
content:res.msg||"保存失败!",
showCancel:false,
})
}
}
})
},
}, },
} }
</script> </script>

2
pages/stock/mana.vue

@ -147,7 +147,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="list.length<=0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
<button class="cu-btn round bg-green shadow submit" @click="$u.route({url:'/pages/stock/agrWarehouse'})">+农资入库</button> <button class="cu-btn round bg-green shadow submit" @click="$u.route({url:'/pages/stock/agrWarehouse'})">+农资入库</button>
</view> </view>

2
pages/stock/record.vue

@ -75,7 +75,7 @@
<text>{{v.supplierName}}</text> <text>{{v.number}}({{v.equivalentAmount}}{{v.unit}})</text> <text>{{v.supplierName}}</text> <text>{{v.number}}({{v.equivalentAmount}}{{v.unit}})</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length<=0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</view> </view>
</template> </template>
<script> <script>

19
pages/warehouse/info.vue

@ -28,7 +28,7 @@ import request from '@/common/request.js'
return{ return{
fields:{ fields:{
warehouseName:{label:"仓库名称"}, warehouseName:{label:"仓库名称"},
warehouseAddress:{label:"仓库位置"}, warehouseAddress:{label:"仓库位置",type:"textarea"},
warehouseVolume:{label:"仓库容量(㎡)", type:"digit",placeholder:"请输入仓库容量"}, warehouseVolume:{label:"仓库容量(㎡)", type:"digit",placeholder:"请输入仓库容量"},
warehouseType:{label:"仓库类型",type:"select",columns:[[{label:"标签1",value:1},{label:"标签2",value:2}]],value:[]}, warehouseType:{label:"仓库类型",type:"select",columns:[[{label:"标签1",value:1},{label:"标签2",value:2}]],value:[]},
contactPeople:{label:"基地管理员"}, contactPeople:{label:"基地管理员"},
@ -36,12 +36,12 @@ import request from '@/common/request.js'
warehousePic:{label:"仓库图片",type:"upImg",num:3}, warehousePic:{label:"仓库图片",type:"upImg",num:3},
}, },
formData:{ formData:{
warehouseName:"5号仓库", warehouseName:"",
warehouseAddress:"昆明五华区", warehouseAddress:"",
warehouseVolume:"32", warehouseVolume:"",
warehouseType:"", warehouseType:"",
contactPeople:"小明", contactPeople:"",
contactNumber:"13752000000", contactNumber:"",
warehousePic:[], warehousePic:[],
baseId: this.$store.state.plantBaseInfoId, baseId: this.$store.state.plantBaseInfoId,
}, },
@ -73,9 +73,12 @@ import request from '@/common/request.js'
}, },
methods:{ methods:{
async init(){ async init(){
var res=await request("/api/WarehouseManageApi/queryWarehouseType") var res=await request("/common/api/dict/queryDictItemByDictCode",{
method:"post",
params:{dictCode: "warehouse_type"}
})
if(res.statu){ if(res.statu){
this.fields.warehouseType.columns=[res.data.map(v=>({label:v,value:v}))] this.fields.warehouseType.columns=[res.data]
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

2
pages/warehouse/mana.vue

@ -92,7 +92,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> <u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>

2
uni_modules/d-form/components/d-form/d-form.vue

@ -245,7 +245,7 @@
</u-form-item> </u-form-item>
<u-picker <u-picker
v-if="type=='select'" v-if="type=='select' && !disabled"
:columns="columns" :columns="columns"
:show="show" :show="show"
keyName="label" keyName="label"

Loading…
Cancel
Save