Browse Source

联调接口

master
邓宏 2 years ago
parent
commit
b1ae082480
  1. 2
      common/request.js
  2. 6
      main.js
  3. 4
      pages/home/index.vue
  4. 1
      pages/home/login.vue
  5. 4
      pages/massif/add_farming.vue
  6. 4
      pages/massif/agrSpecs.vue
  7. 4
      pages/massif/index.vue
  8. 4
      pages/massif/info.vue
  9. 7
      pages/massif/mana/recovery.vue
  10. 38
      pages/massif/plant_info.vue
  11. 4
      pages/purchase/agrProdList.vue
  12. 4
      pages/stock/mana.vue
  13. 2
      pages/warehouse/info.vue
  14. 4
      pages/warehouse/mana.vue
  15. 0
      uni_modules/d-form/changelog.md
  16. 11
      uni_modules/d-form/components/d-form/d-form.vue
  17. 81
      uni_modules/d-form/package.json
  18. 1
      uni_modules/d-form/readme.md
  19. 0
      uni_modules/d-navbar/changelog.md
  20. 72
      uni_modules/d-navbar/components/d-navbar/d-navbar.vue
  21. 81
      uni_modules/d-navbar/package.json
  22. 1
      uni_modules/d-navbar/readme.md

2
common/request.js

@ -4,7 +4,7 @@ export function host(host='default',suffix='/plant_manage'){
return(
process.env.NODE_ENV === 'development'?{
// default:`http://10.0.0.217${suffix}` //陈
default:`http://nrmmg7.natappfree.cc${suffix}` //马
default:`http://mq3s8b.natappfree.cc${suffix}` //马
}:{
default:`http://qv6mj8.natappfree.cc${suffix}`
}

6
main.js

@ -2,13 +2,11 @@ import Vue from 'vue'
import App from './App'
import store from './store'
import uView from 'uview-ui';
import cuNavbar from './components/cu-navbar.vue'
import dForm from './components/form.vue'
// import cuNavbar from './components/cu-navbar.vue'
import {defineObj} from 'black-knight/lib/config/custom'
Vue.use(uView)
Vue.component("cuNavbar", cuNavbar)
Vue.component("dForm", dForm)
// Vue.component("cuNavbar", cuNavbar)
Vue.prototype.$store=store
Vue.config.productionTip = false

4
pages/home/index.vue

@ -249,13 +249,13 @@
</swiper-item>
<swiper-item>
<view data-title="当前种植面积()" style="--c:6, 184, 249;">
<text class="value">422.25</text>
<text class="value">{{massif.plantArea}}</text>
<text class="plant-chayuanmianji"/>
</view>
</swiper-item>
<swiper-item>
<view data-title="当前种植品种()" style="--c:126, 107, 229;">
<text class="value">12</text>
<text class="value">{{massif.productCount}}</text>
<text class="plant-zhongzhipinzhong"/>
</view>
</swiper-item>

1
pages/home/login.vue

@ -64,6 +64,7 @@ export default {
data(){
return{
demo:[],
formData:{
password:"",
username:"",

4
pages/massif/add_farming.vue

@ -88,9 +88,9 @@
</style>
<template>
<view class="container">
<cu-navbar style="--bg:#10C176;--c:#fff;" isBack text="添加农事">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="添加农事">
<button slot="right" class="cu-btn round">提交</button>
</cu-navbar>
</d-navbar>
<view class="card">
<view class="plant-dikuaimianji">阳光玫瑰种植1号地块</view>

4
pages/massif/agrSpecs.vue

@ -104,9 +104,9 @@
</style>
<template>
<view class="container">
<cu-navbar style="--bg:#10C176;--c:#fff;" isBack>
<d-navbar style="--bg:#10C176;--c:#fff;" isBack>
<button slot="right" class="cu-btn round">确定</button>
</cu-navbar>
</d-navbar>
<view class="card info">
<view class="name">

4
pages/massif/index.vue

@ -76,9 +76,9 @@
</style>
<template>
<view class="container flex">
<cu-navbar style="--bg:#10C176;--c:#fff;" text="地块管理">
<d-navbar style="--bg:#10C176;--c:#fff;" text="地块管理">
<text class="plant-xinjian" slot="right" @click="toInfo"/>
</cu-navbar>
</d-navbar>
<d-search v-model="searchVal.search" @search="clean();search()"/>

4
pages/massif/info.vue

@ -17,7 +17,7 @@
:value="(/^dateRange$|^select$/.test(v.type)?fields[k].value:formData[k])"
@input="formData[k]=$event"
@selectRDate="selectDate"
@select="fields[k].value=$event;formData[k]=fields[k].columns[0][$event[0]].value"
@select="fields[k].value=$event.indexs;formData[k]=$event.value[0].value"
@imgs="fields[k].value=$event"/>
</u-form>
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button>
@ -82,7 +82,7 @@ import request from '@/common/request'
params:{companyId:this.$store.getters.userInfo.companyId}
})
if(res.statu){
this.fields.plantBaseName.columns = [res.data.map(v=>({label:v,value:v}))]
this.fields.plantBaseName.columns = [res.data.map(v=>({label:v.baseName,value:v.id}))]
}else{
uni.showModal({
title:"提示",

7
pages/massif/mana/recovery.vue

@ -90,9 +90,16 @@
import request from '@/common/request'
export default {
name:"recovery",
props:{
plotId:{
type:String,
defaylt:""
}
},
data(){
return{
searchVal:{
plotId:"",
plantScheduleId:"",// id
pageNo:"",
pageSize:"",

38
pages/massif/plant_info.vue

@ -3,26 +3,13 @@
min-height:100%;
background:#f6f6f6;
padding:30rpx 0;
.cu-navbar{
.action>button{
background:rgba(255, 255, 255, 0.1);
width:96rpx;
height:48rpx;
line-height: 48rpx;
text-align: center;
font-size:32rpx;
padding:0;
color:#fff;
}
}
}
</style>
<template>
<view class="container">
<cu-navbar text="采收信息" style="--bg:#10C176;--c:#fff;" isBack>
<d-navbar text="采收信息" style="--bg:#10C176;--c:#fff;" isBack>
<button slot="right" class="cu-btn round" @click="submit">提交</button>
</cu-navbar>
</d-navbar>
<u-form class="card inline" :model="formData" :rules="rules" ref="form" labelWidth="auto">
<d-form
@ -31,7 +18,9 @@
v-bind="v"
:field="k"
:required="!!rules[k]"
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"/>
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"
@select="fields[k].value=$event.indexs;formData[k]=$event.value[0].value"
@input="formData[k]=$event"/>
</u-form>
</view>
</template>
@ -41,9 +30,9 @@ export default {
data(){
return{
fields:{
harvestNum:{label:"采收数量",suffix:'kg'},
harvestNum:{label:"采收数量",suffix:'kg',type:"digit"},
harvestBatch:{label:"收获批次号",btnText:"生成", btnFun:()=>this.formData.harvestBatch=`CS${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
principal:{label:"负责人",type:"select"},
principal:{label:"负责人",type:"select",columns:[],value:[null]},
harvestTime:{label:"采收时间",type:"calendar"},
status:{label:"采收状态",type:"select",columns:[[{label:"本次采收完后续还会采收",value:"1"},{label:"已全部采收完",value:"2"}]],value:[null]},
},
@ -69,8 +58,21 @@ export default {
onLoad(options){
this.formData.plantSchedulId=options.plantId
this.formData.plotId=options.plotId
this.init()
},
methods:{
async init(){
var res=await request("/api/plantHarvest/getUser")
if(res.statu){
this.fields.principal.columns=[res.data.map(v=>({label:v,value:v}))]
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取负责人选项失败!",
showCancel:false,
})
}
},
submit(){},
},
}

4
pages/purchase/agrProdList.vue

@ -48,9 +48,9 @@
</style>
<template>
<view class="container flex">
<cu-navbar text="农资列表" isBack style="--bg:#10C176;--c:#fff;">
<d-navbar text="农资列表" isBack style="--bg:#10C176;--c:#fff;">
<text slot="right" class="plant-xinjian" @click="$u.route({url:'pages/purchase/newAgr'})"/>
</cu-navbar>
</d-navbar>
<d-search v-model="searchVal.goodsName" @search="search"/>

4
pages/stock/mana.vue

@ -100,12 +100,12 @@
</style>
<template>
<view class="container">
<cu-navbar style="--bg:#10C176;--c:#fff;" isBack text="库存管理">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="库存管理">
<view slot="right" class="head_btns">
<image @click="$u.route({url:'pages/stock/already'})" mode="aspectFit" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAh9JREFUOE+N0++rz2ccx/HH+5z5EZ1QZ+aGJEsStjgKIxrJIkUxRqa1pIlsmrM7ItzbuSN/gJw782Oo5dcN3BFlOYrdIto525EkzhlKjWNvu04fOr7ODe/61Oe6rvf1vN4/Xu/Qj2XmRGzHLNSjB+fQEhF3a69E7UZmrsFufI8/MQ2d+Bh7sDYiLva99xYkM2fgAGZHxD+Z+TnmV6BRWI+zmBcR5YFeewPJzDrcwCpccC3GYAvmqHPQ5O6/DBj+W7W3LiK+7A8yHodxzMvnna4P2qxhwQwxgPoGun/doCln4gT2Y2pEPK2NpBRxB4a5FEsN+aDLyK0MnsTgCdya3aMpi8+Kki6+iYg7tZDp2IcHOpo36Wq556Pm0POIhoW0r/5bU27DuAq0KiI6aiEf4hpWYqe2OKJOq/oR5H88ezzWZ3kaX5WUI2LCOzUpG5n5M27iu/JFRFu2aYzpHlbn6yOiNbM3rUvoxpPaFhdhLcInGIEuHMe/1atFaEPQXvlsKme9kMwsB40oIjqEU9Wlofgag6r13Aq4BPdxBZMiM0stfsdoLIuIM69zzcxPUfTy2n6sOngZV8t/RJwtkNv4CUUnJbwpEfGkinB5DaR043xVjzJHv/R2JzOLQssLpTP38G1fUN8ZycyBld/eiDj6VncqUDMWYzJKSn/0M+Cl8Lsi4mS/A1iBfkBriSYiivjey2pbXIZqI76IiBfvRfjf6RX9Zrpq7UEdfAAAAABJRU5ErkJggg=="/>
<image @click="$u.route({url:'pages/stock/record'})" mode="aspectFit" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAYAAAACCvahAAAAAXNSR0IArs4c6QAAAYlJREFUOE+Nkz1LnFEQhZ8TjR+gAREbBVFIlUZS5BeEFDZBVmysBAthC0nENBtSSZpIkiIhIkKwsFJLQRtFBBv1L6iNkEKi4lciEU8YuRte1102F25zZ56ZuWdmZLsZ+AL0A01UP+fAIjAq23NAPZCXdFiNtd0GfAOuAr4EOiQdVwOLdtstwEHAlqT/BTMB/A+2XQsMAg/LBFqXtJt9tz2ThWuAYaCxDLxUCofPnbKT8kg6y5RXB8SNcyXpT9GWzfwI2AaugR5J17bfA4WSSsYlfbyXueRPq8AD4EUECpvtBmAT2JM0UFZt23lgAHgu6cb2vqTuFCC02QE+VILDOCZpIwF32mm773aoyvU5DU6rpF8V4HZgqxJ8CnRKOknwD2BCUoxl/L0LWK8Eh1jTkuaT8+NwBl5LWrA9cquH7YuU5Wemt73AV+CZpKMU4AmwBgwB34FcwLNArOUboLgcv4G3SfF3wHJq2ysgsk5K+hxw7PAn4GVazUg0JalgOxeqA0+BmxApgSvh9BeDHNvqf9R6EgAAAABJRU5ErkJggg=="/>
</view>
</cu-navbar>
</d-navbar>
<d-search />

2
pages/warehouse/info.vue

@ -13,9 +13,7 @@
</view>
</template>
<script>
import dForm from '@/components/form.vue'
export default{
components:{dForm},
data(){
return{
fields:{

4
pages/warehouse/mana.vue

@ -64,9 +64,9 @@
</style>
<template>
<view class="container">
<cu-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack>
<d-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack>
<text class="plant-xinjian" slot="right" @click="$u.route({url:'pages/warehouse/info'})"/>
</cu-navbar>
</d-navbar>
<d-search style="margin-top:30rpx;"/>

0
uni_modules/d-form/changelog.md

11
components/form.vue → uni_modules/d-form/components/d-form/d-form.vue

@ -131,8 +131,13 @@
font-size:20rpx;
color:#FBA83C;
}
&/deep/ .u-form-item__body__right__message{
margin-left:0!important;
&/deep/ {
.u-form-item__body__left__content{
margin-left:20rpx;
}
.u-form-item__body__right__message{
margin-left:0!important;
}
}
}
}
@ -307,7 +312,7 @@ import request,{host} from '@/common/request'
if(/^\d+$/.test(this.value[1])){
return this.columns[0][this.value[0]].children[this.value[1]].label
}else{
this.columns[0][this.value[0]].label
return this.columns[0][this.value[0]].label
}
}else{
return this.placeholder||`请选择${this.label}`

81
uni_modules/d-form/package.json

@ -0,0 +1,81 @@
{
"id": "d-form",
"displayName": "d-form",
"version": "1.0.0",
"description": "d-form",
"keywords": [
"d-form"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

1
uni_modules/d-form/readme.md

@ -0,0 +1 @@
# d-form

0
uni_modules/d-navbar/changelog.md

72
uni_modules/d-navbar/components/d-navbar/d-navbar.vue

@ -0,0 +1,72 @@
<style lang="scss" scoped>
.cu-navbar{
height:calc(var(--status-bar-height) + 100rpx);
flex-shrink: 0;
&>.cu-bar{
position:fixed;
z-index: 200;
top:0;
left:0;
width:100%;
box-sizing: content-box;
padding-top:var(--status-bar-height);
height:100rpx;
background-color:var(--bg);
color:var(--c);
&>.left{
transform: rotate(180deg);
padding:10rpx;
text.plant-youbian{
font-size:45rpx;
}
}
&>.content{
top:var(--status-bar-height);
}
&>.action /deep/{
&>button{
background:rgba(255, 255, 255, 0.1);
width:96rpx;
height:48rpx;
line-height: 48rpx;
text-align: center;
font-size:30rpx;
padding:0;
color:#fff;
}
}
}
}
</style>
<template>
<view class="cu-navbar">
<view class="cu-bar">
<view class="left">
<text v-if="isBack" class="plant-youbian" @click="$u.route({type:'back'})"/>
</view>
<view class="content">
{{text}}
</view>
<view class="action">
<slot name="right"/>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
isBack:{
type:Boolean,
default:false,
},
text:{
type:String,
default:"",
}
},
created(){
},
}
</script>

81
uni_modules/d-navbar/package.json

@ -0,0 +1,81 @@
{
"id": "d-navbar",
"displayName": "d-navbar",
"version": "1.0.0",
"description": "d-navbar",
"keywords": [
"d-navbar"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

1
uni_modules/d-navbar/readme.md

@ -0,0 +1 @@
# d-navbar
Loading…
Cancel
Save