Browse Source

恢复原理项目

master
邓宏 2 years ago
parent
commit
1f8cec851b
  1. 2
      App.vue
  2. 6
      manifest.json
  3. 3
      pages.js
  4. 196
      pages/home/index.vue
  5. 166
      pages/massif/add_farming.vue
  6. 79
      pages/massif/add_transaction.vue
  7. 54
      pages/massif/detail.vue
  8. 6
      pages/massif/index.vue
  9. 3
      pages/massif/info.vue
  10. 178
      pages/massif/mana/recovery.vue
  11. 123
      pages/massif/mana/transactions.vue
  12. 58
      pages/massif/plant_info.vue
  13. 39
      pages/seeding/info.vue
  14. 177
      pages/seeding/mana.vue
  15. 6
      router/massif.js
  16. 24
      router/seeding.js
  17. BIN
      static/banner.png
  18. 2
      uni.scss
  19. 0
      uni_modules/d-dateRange/changelog.md
  20. 109
      uni_modules/d-dateRange/components/d-dateRange/d-dateRange.vue
  21. 81
      uni_modules/d-dateRange/package.json
  22. 1
      uni_modules/d-dateRange/readme.md

2
App.vue

@ -20,7 +20,7 @@
if(this.$store.getters.token){
}else{
// this.$store.commit('outLogin')
this.$store.commit('outLogin')
}
},
onShow: function() {

6
manifest.json

@ -1,7 +1,7 @@
{
"name" : "plant_manage_sanqi_mobile",
"appid" : "__UNI__9B32D98",
"description" : "种植三七管理",
"name" : "plant_manage_mobile",
"appid" : "__UNI__D917821",
"description" : "种植管理",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,

3
pages.js

@ -9,7 +9,6 @@ module.exports = hot((pagesJson)=>{
...require("./router/massif.js"),
...require('./router/purchase.js'),
...require('./router/stock.js'),
...require('./router/seeding.js'),
],
tabBar:{
color:"#999",
@ -17,7 +16,7 @@ module.exports = hot((pagesJson)=>{
backgroundColor:"#fff",
list:[
{pagePath:"pages/home/index",visible:true,text:"首页",iconPath: "/static/tab_home.png",selectedIconPath: "/static/tab_home_active.png"},
{pagePath:"pages/massif/index",text:"基地管理",iconPath: "/static/tab_massif.png",selectedIconPath: "/static/tab_massif_active.png"},
{pagePath:"pages/massif/index",text:"种植管理",iconPath: "/static/tab_massif.png",selectedIconPath: "/static/tab_massif_active.png"},
{pagePath:"pages/home/my",text:"我的",iconPath: "/static/tab_my.png",selectedIconPath: "/static/tab_my_active.png"},
]
},

196
pages/home/index.vue

@ -67,28 +67,8 @@
display:flex;
align-items: center;
.u-transition{
position:relative;
&:before{
content:attr(data-num);
color:#fff;
position:absolute;
z-index: 10;
top:0;
left:0;
width: 100%;
height:100%;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
text-shadow: 2rpx 2rpx 5rpx #000;
}
&+.u-transition{
margin-left:-12rpx;
}
&/deep/ .u-image__image,&/deep/ .u-image__error{
border:4rpx solid #fff;
margin-left:15rpx;
}
.plant-xiaopangchetupianjiazaishibai{
&:before{
@ -97,10 +77,15 @@
}
}
}
.link{
color:#999;
margin-left:10rpx;
font-size:30rpx ;
}
}
text{
&:before{
color:var(--c);
color:#31C888;
margin-right:14rpx;
}
&.line{
@ -112,6 +97,61 @@
}
}
}
&.mana{
width:calc(50% - 46rpx);
flex-shrink: 0;
margin-top:0;
.title{
color:#333;
font-size:32rpx;
display:flex;
align-items: center;
padding-bottom:24rpx;
border-bottom:2rpx solid #D8D8D8;
[class*=plant-]{
color:#10C176;
}
.more{
color:#999;
font-size:24rpx;
margin-left:auto;
}
}
.item{
display:flex;
align-items: center;
margin-top:24rpx;
color:#707070;
font-size:24rpx;
&:nth-child(2){ --c:235, 67, 118; }
&:nth-child(3){ --c:255, 195, 83; }
&:nth-child(4){ --c:16, 193, 118; }
&:before{
flex-shrink: 0;
content:" ";
width:20rpx;
height:20rpx;
border-radius: 50%;
background-image:radial-gradient(rgba(var(--c), 1) 2px,rgba(var(--c), 0.2) 2.5px);
margin-right:10rpx;
}
text{
&:nth-child(2){
margin-left:auto;
flex-shrink: 0;
}
}
}
.u-empty{
min-height:auto;
}
&:first-child{
margin-right:calc(30rpx/2);
}
&:nth-child(2){
margin-left:calc(30rpx/2);
}
}
&.base{
margin-top:0;
background:linear-gradient(#fff,#F1FBF6);
@ -191,70 +231,8 @@
}
}
}
&.butcher{
display:flex;
align-items: center;
margin:30rpx;
view{
display: flex;
flex-direction: column;
align-items: center;
&+view{
margin-left:120rpx;
}
&:before{
background-repeat: no-repeat;
background-size:100% 100%;
margin-bottom:5rpx;
content:"";
width:68rpx;
height:62rpx;
}
&.harvest:before{
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAAXNSR0IArs4c6QAABsxJREFUWEe1ln9sVWcZxz/Pe+45t/e2l9JCGSuDQgWEiegcosQp6hISTSbTZIkuM9viHyZKzJapMSZsINExN2M2okvQxLj9s01McEtUYIwljI4MGJUC8nuDlkt/l/66vT/OOY95b3tpb9vbtUze5P5zzznP83m/z/d53lf4GOvxBo25IZF4lu+FyiMY9kqOnVs3SHKmYWWmHxTe37xPPy0OPxMlgbAUoRKlH2g58yGvvPoSL/O2+NONf1MgW06pF7byphiqgGZA0mnKsj71zUl1L1xmXi4jq0/9Tk7fWpC39EEjwdYQk1Zkdmc3Vw836l2+jyuCKGQ7OlurkjtrU7cMxKpR3pk65hr/Uw6ave7Hk/86FKlOpagsJK2u4OJz35V7P1cvl28ZyJP79duO0WfiztCCgbQTv3TN1aazUlRiEbKVMfpzKs+3tfP8hR3S91FAM/LIA6+ps7KGv4nyyXSWubmcznvvPzAwRQFCONzZKfcmd8qUZZoRyJNv6+MS8ktgYChD4lq7zmk6+1F7hTDUZ09sd34+1ZvTBnnqgK4RaFDwUQI/JHfwPa3qGxgN7xi0PBaGfYPGKUqq9DZ2SQ07JVcKZlogWw5oBHgfpQ4hKqjXfFWDo6fF/n9j3bkkR0+/k7vWadzxCYNQ1jRtl2MfD+Qt/YkKvxIhIaqSSiH7GpRQBc8NyeaEMjdk7aqAg40uqpPsT+T+xl/LP24aZMtr6jGP8yiLHIFQlXeOKh09NnnAhq8IV5MhRpSBfp/a2yLsPzpBEAu98cTT8vpNgaiq82wDT2R9njZg/BCSrT6Hm0YtUFWe5QurlWh5lIH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YheXBHmeO02kCqf+1Mri1l2WHSQ22D8UNFlGsHJvg9R652KSJolCdFiBO6JWo4LA1fhVSUjCmnWJESb7aiV2uHV5JBOOFnwTMzXscWePaVNOLLC6thLRKx30r942BGU5UoLCZuiYNVJZm3pq1IDTg1dholERAhWRAihYooRVcKIJiOMzLCL4bCS2RCTND9kLQCBCAVRufhK5LqZq6GfFMqU7sHC1NRUvyH6N24Pi5StpSaib0UjTH9DCTOt6n03UHHrChSoczgc7wojC6KEcAPILthgF8IRJY7/pltTjInM0T7SZM4Pzb6cWVzp6zlhgrBLXyYRNCsynYE+XJObxsUMwQkxXVQMh5lCxXde2Lkf0LVZYlWy+4AA2hcFC5sgzIrMAhX06BrLTfpZgEEC0bQ+/Zr1vs/mLPHXfO7nBKaiaFhggjBnPAEG6R8GBCOxxq91RaNPByC99/bGYJlAbgbcYHaTQC5o1DMLZEgaeUggOjNCyvIh9psTeSoxdRFhUmymhJH74yB6+dQhjHvjS82Kpu4029DqIMfwXFGdMyLDkvfbJAi/9XEw3DQ+V6OeTGy0UPYY850PbLbax/Ar+Q7HAkB0H0OStEmAWgmi0OF4gfkxezihVtX834yzxXXPfPgfT/Fevz9T1YIXASz7ryGmHHSJgnmr3WptmO7zjn8nBiVpmYm0iwyMv1zu3BRm7iMiFzP3kCC4iOFmTe3RwG6YRBdJwRsxMTHGQXyy3RFEH+jxeGLYKlYSKB0MNwj6y8TNYDdpE7/Q3EEE3fG2+JtENH/Vm2ci/waLuvV8ZtN9WgAAAABJRU5ErkJggg==);
}
}
}
}
&>.tabs{
display:flex;
margin:30rpx;
justify-content: space-between;
&>view{
height:108rpx;
width:calc(100%/2 - 10rpx);
padding:0 30rpx;
display: flex;
align-items: center;
border-radius: 20rpx;
box-shadow: 4rpx 4rpx 6rpx rgba(var(--c),0.1);
color:rgba(var(--c),1);
font-size:32rpx;
font-weight: bold;
&:before{
margin-right:6rpx;
font-size:40rpx;
font-weight: 100;
}
text{
font-weight: 100;
margin-left:auto;
font-size:20rpx;
}
&.plant-dikuaimianji{
--c:49, 200, 136;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='166.519' height='54' viewBox='0 0 166.519 54'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:%23f1fffa;%7D.b%7Bopacity:0.17;fill:url(%23a);%7D.c,.d%7Bopacity:0.1;%7D.c%7Bfill:url(%23c);%7D.d%7Bfill:url(%23d);%7D%3C/style%3E%3ClinearGradient id='a' x1='0.5' x2='0.5' y2='1' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%2331c888'/%3E%3Cstop offset='1' stop-color='%2366febd'/%3E%3C/linearGradient%3E%3ClinearGradient id='c' x1='0.887' y1='-0.116' x2='0.064' y2='0.953' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%2310c176'/%3E%3Cstop offset='1' stop-color='%23f3fcf7'/%3E%3C/linearGradient%3E%3ClinearGradient id='d' x1='0.678' y1='1.074' x2='0.853' y2='0.091' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%2331c888'/%3E%3Cstop offset='1' stop-color='%23fff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect class='a' width='166' height='54' rx='12' transform='translate(0)'/%3E%3Ccircle class='b' cx='4.5' cy='4.5' r='4.5' transform='translate(99.816 22.069)'/%3E%3Ccircle class='b' cx='3' cy='3' r='3' transform='translate(31.886 11.889)'/%3E%3Cpath class='c' d='M8,35.486a8,8,0,0,1-8-8V.034a30.214,30.214,0,0,1,9.28,1A30.239,30.239,0,0,1,31.236,35.486Z' transform='translate(0 16.514)'/%3E%3Cpath class='d' d='M40.819,35.8,0,.319Q.071.16.143,0h82.4L52.106,35.014a8,8,0,0,1-11.286.789Z' transform='translate(83.976 0)'/%3E%3C/svg%3E");
}
&.plant-cangkuguanliguanli{
--c:76, 167, 255;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='166.519' height='54' viewBox='0 0 166.519 54'%3E %3Cdefs%3E %3Cstyle%3E.a%7Bfill:%23ecf5ff;%7D.b,.c%7Bopacity:0.17;%7D.b%7Bfill:url(%23c);%7D.c%7Bfill:url(%23d);%7D.d,.e%7Bopacity:0.1;%7D.d%7Bfill:url(%23e);%7D.e%7Bfill:url(%23f);%7D.f%7Bfilter:url(%23a);%7D%3C/style%3E %3Cfilter id='a' x='0' y='0' width='184' height='72' filterUnits='userSpaceOnUse'%3E %3CfeOffset dy='3' input='SourceAlpha'/%3E %3CfeGaussianBlur stdDeviation='3' result='b'/%3E %3CfeFlood flood-opacity='0.102'/%3E %3CfeComposite operator='in' in2='b'/%3E %3CfeComposite in='SourceGraphic'/%3E %3C/filter%3E %3ClinearGradient id='c' x1='0.5' x2='0.5' y2='1' gradientUnits='objectBoundingBox'%3E %3Cstop offset='0' stop-color='%234ca7ff'/%3E %3Cstop offset='1' stop-color='%23a2d0ff'/%3E %3C/linearGradient%3E %3ClinearGradient id='d' x1='0.5' x2='0.5' y2='1' gradientUnits='objectBoundingBox'%3E %3Cstop offset='0' stop-color='%234ca7ff'/%3E %3Cstop offset='1' stop-color='%23dfeefe'/%3E %3C/linearGradient%3E %3ClinearGradient id='e' x1='0.887' y1='-0.116' x2='0.064' y2='0.953' gradientUnits='objectBoundingBox'%3E %3Cstop offset='0' stop-color='%234ca7ff'/%3E %3Cstop offset='1' stop-color='%23f3fcf7'/%3E %3C/linearGradient%3E %3ClinearGradient id='f' x1='0.678' y1='1.074' x2='0.853' y2='0.091' gradientUnits='objectBoundingBox'%3E %3Cstop offset='0' stop-color='%234ca7ff'/%3E %3Cstop offset='1' stop-color='%23fff'/%3E %3C/linearGradient%3E %3C/defs%3E %3Crect class='a' width='166' height='54' rx='12' transform='translate(0)'/%3E %3Ccircle class='b' cx='4.5' cy='4.5' r='4.5' transform='translate(99.816 22.069)'/%3E %3Ccircle class='c' cx='3' cy='3' r='3' transform='translate(31.886 11.889)'/%3E %3Cpath class='d' d='M8,35.486a8,8,0,0,1-8-8V.034a30.214,30.214,0,0,1,9.28,1A30.239,30.239,0,0,1,31.236,35.486Z' transform='translate(0 16.514)'/%3E %3Cpath class='e' d='M40.819,35.8,0,.319Q.071.16.143,0h82.4L52.106,35.014a8,8,0,0,1-11.286.789Z' transform='translate(83.976 0)'/%3E %3C/svg%3E");
}
}
}
.u-popup{
&/deep/ .u-popup__content{
border-radius: 24rpx 24rpx 0 0;
@ -292,33 +270,39 @@
</table>
<view class="article">
<view class="plant" @click="$u.route({url:'pages/massif/myPlant'})">
<text class="plant-bijibenjilutongxunlu" style="--c:#FCA606;"/>
<u-image
v-for="(v,k) in (massif.images||[])" :key="k" mode="aspectFill"
width="60rpx"
height="50rpx"
radius="16rpx"
:data-num="param.imgNum((massif.images||[]).length,k)"
:src="`${host}/${v}`">
<text class="plant-bijibenjilutongxunlu"/>
<u-image v-for="(v,k) in (massif.images||[])" :key="k" mode="aspectFill" width="56rpx" height="46rpx" radius="8rpx" :src="`${host}/${v}`">
<text slot="error" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<text class="link">>></text>
</view>
<text class="line"/>
<text class="plant-nongzi" style="margin-right:64rpx;--c:#4CA7FF;" @click="$u.route({url:'pages/stock/mana'})">库存</text>
<text class="plant-shumiao" style="--c:#EB4376;" @click="$u.route({url:'pages/seeding/info'})">种苗</text>
<text class="plant-nongzi" style="margin-right:64rpx;" @click="$u.route({url:'pages/stock/mana'})">库存</text>
<text class="plant-caigou" @click="$u.route({url:'pages/purchase/apply'})">采购</text>
</view>
</view>
<view class="tabs">
<view class="plant-dikuaimianji" @click="$u.route({url:'pages/massif/index'})">基地 <text>更多>></text></view>
<view class="plant-cangkuguanliguanli" @click="$u.route({url:'pages/warehouse/mana'})">仓库 <text>更多>></text></view>
</view>
<view class="card butcher">
<view class="harvest" @click="$u.route({url:'/pages/base/outRecord'})">收获</view>
<view class="business" @click="$u.route({url:'/pages/base/businessRecord'})">交易</view>
<view style="display:flex;">
<view class="card mana">
<view class="title">
<text class="plant-dikuaimianji"/> 地块管理 <text class="more" @click="$u.route({type:'switchTab',url:'pages/massif/index'})">更多>></text>
</view>
<view class="item" v-for="(v,k) in massif.plotList||[]" :key="k">
<text class="over">{{v.plotName}}</text> <text>{{v.realityArea}}</text>
</view>
<u-empty :show="(massif.plotList||[]).length<=0" text=" " width="70%" icon="/static/noData.png"/>
</view>
<view class="card mana">
<view class="title">
<text class="plant-cangkuguanliguanli"/> 仓库管理 <text class="more" @click="$u.route({url:'pages/warehouse/mana'})">更多>></text>
</view>
<view class="item" v-for="(v,k) in stockList" :key="k">
<text class="over">{{v.warehouseName}}</text> <text>{{v.warehouseVolume}}</text>
</view>
<u-empty :show="stockList.length<=0" text=" " width="60%" icon="/static/noData.png"/>
</view>
</view>
<view class="card base">
<view class="title">
{{$store.state.baseInfo.name||'基地管理'}} <text class="plant-jiantou_zuoyouqiehuan" v-if="isAdmin" @click="show=true">切换基地</text>
@ -348,13 +332,6 @@
</view>
</template>
<script lang="wxs" module="param">
module.exports={
imgNum(len,index){
return len-1==index?'30+':''
}
}
</script>
<script>
import request,{host} from '@/common/request'
export default {
@ -362,6 +339,7 @@ import request,{host} from '@/common/request'
return {
host:host('imgUrl'),
headImgs:[],
mapContext:null,
show:false,
plantBase:[[]],
massif:{images:[]},

166
pages/massif/add_farming.vue

@ -4,6 +4,37 @@
background:#f6f6f6;
padding:30rpx 0;
&>.type{
margin:0 30rpx 30rpx;
.title{
color:#333;
margin-bottom:22rpx;
&:before{
content:"*";
color:#EE4949;
}
}
.content{
display:flex;
flex-wrap: wrap;
margin:0 -30rpx -20rpx 0;
text{
background:#EEEEEE;
color:#999;
height:54rpx;
line-height: 54rpx;
border-radius: 50rpx;
margin:0 30rpx 20rpx 0;
width:calc(100%/4 - 30rpx);
text-align: center;
transition: all 0.3s;
&.active{
color:#fff;
background:#10C176;
}
}
}
}
.card{
margin-top:0;
&>.item{
@ -58,7 +89,7 @@
color:#10C176;
}
&:after{
content:"添加种苗";
content:"添加农资";
color:#777;
}
}
@ -133,6 +164,12 @@
}
}
}
.u-popup{
.u-popup__content>input{
width:100%;
margin:30rpx;
}
}
}
</style>
<template>
@ -141,14 +178,17 @@
<button slot="right" class="cu-btn round" @click="submit">提交</button>
</d-navbar>
<u-form class="inline" style="margin:30rpx;" labelWidth="auto" ref="upForm" errorType="toast" :model="formData" :rules="upRules">
<d-form label="农事类型" type="select-tab" required field="farmingType" dictCode="farming_type"/>
<d-form label="种植计划" style="--bg:#fff;" type="select" required field="farmingPlanId" :columns="farmingPlan" :value="[formData.farmingPlanId]"/>
</u-form>
<view class="type">
<view class="title">农事类型</view>
<view class="content">
<text :class="{active:formData.farmingType==v.value}" v-for="(v,k) in typeList" :key="k" @click="formData.farmingType=v.value">{{v.label}}</text>
<text @click="isShow=true">自定义+</text>
</view>
</view>
<view class="card">
<view class="plant-dikuaimianji">{{massif.plotName}}</view>
<view v-if="formData.inputList.length<=0" class="plant-batch-add" @click="toSeeding"/>
<view v-if="formData.inputList.length<=0" class="plant-batch-add" @click="toCollectList"/>
<u-swipe-action v-for="(v,k) in formData.inputList" :key="k">
<u-swipe-action-item>
<view>
@ -159,7 +199,7 @@
</view>
</u-swipe-action-item>
</u-swipe-action>
<button class="cu-btn round bg-green shadow submit" v-if="formData.inputList.length>0" @click="toSeeding">+继续添加种苗</button>
<button class="cu-btn round bg-green shadow submit" v-if="formData.inputList.length>0" @click="toCollectList">+继续添加农资</button>
</view>
<view class="card">
@ -171,19 +211,22 @@
过程:{{formData.farmPests.growthProcess}}病虫害部位:{{formData.farmPests.pestSite}}症状{{formData.farmPests.symptom}}({{formData.farmPests.pestName.map(v=>v.name).join(',')}})
</view>
</view>
<u-form class="inline" errorType="toast" ref="downForm" :model="formData" :rules="downRules" labelWidth="auto">
<u-form class="inline" errorType="toast" :model="formData" :rules="rules" ref="form" labelWidth="auto">
<d-form
v-for="(v,k) in fields"
:key="k"
v-bind="v"
:field="k"
:required="!!downRules[k]"
:required="!!rules[k]"
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"
@input="formData[k]=$event"
@select="fields[k].value=$event.map(v=>v.value);formData[k]=fields[k].value[0]"
@imgs="fields[k].value=$event"/>
</u-form>
</view>
<u-popup :show="isShow" closeOnClickOverlay @close="isShow=false">
<input placeholder="请输入" :focus="isShow" confirm-type="done" v-model="tempType" @confirm="addType"/>
</u-popup>
</view>
</template>
<script>
@ -191,10 +234,12 @@ import request from '@/common/request'
export default {
data(){
return{
farmingPlan:[],
typeList:[],
fields:{
principal:{label:"操作人",styleType:"parallel", disabled:true},
farmingTime:{label:"操作日期",styleType:"parallel",type:"calendar"},
userNum:{label:"人工投入(个)"},
farmingPlanId:{label:"种植计划",type:"select",columns:[],value:[]},
images:{label:"农事图片",type:"upImg",num:3},
farmingRemarks:{label:"备注",type:"textarea"},
},
@ -211,18 +256,14 @@ export default {
plotId:"",
plantBaseInfoId: this.$store.state.baseInfo.id,
},
upRules:{
farmingType:{required:true,validator:(rule,val,call)=>{
if(!val)call(new Error("请选择农事类型!"));
else if(/^播种$|^用药$|^施肥$/.test(val) && this.formData.inputList.length<=0)call(new Error('请添加农资!'));//
else if(/^用药$/.test(val) && !this.formData.farmPests)call(new Error("请添加病虫害记录!"));
},trigger:['change','blur']},
farmingPlanId:{required:true,message:"请选择种植计划!",trigger:['change','blur']},
},
downRules:{
rules:{
userNum:{required:true,message:"人工投入必填!",trigger:'blur'},
farmingTime:{required:true,message:"操作日期必填!",trigger:'blur'},
farmingPlanId:{required:true,message:"种植计划必选!",trigger:'blur'},
},
massif:{},
tempType:"",
isShow:false,
eventChannel:null,
}
},
@ -252,7 +293,7 @@ export default {
params:{plotId: this.formData.plotId}
})
if(res.statu){
this.farmingPlan=[res.data]
this.fields.farmingPlanId.columns=[res.data]
}else{
uni.showModal({
title:"提示",
@ -275,37 +316,84 @@ export default {
})
}
},
toSeeding(){
toCollectList(){
uni.navigateTo({
url:"/pages/seeding/mana?into=addFarming",
events:{ update: e=>{
} },
success(e){
}
url:"/pages/massif/collectList",
events:{ addSpecs: e=>{
if(!this.formData.inputList.some(v=>{
if(v.inventoryId==e.inventoryId){
v.inputQuantity=Math.round((v.inputQuantity+e.inputQuantity)*100)/100
return true
}else{
return false
}
})){
this.formData.inputList.push(e)
}
} }
})
},
async submit(){
if(await this.$refs.upForm.validate()&&await this.$refs.downForm.validate()){
var res=await request("/api/plantFarming/addOrUpdate",{
method:"post",
body:{
...this.formData,
images: this.fields.images.value,
farmPests: Object.assign(this.formData.farmPests||{},{pestName:this.formData.farmPests?.pestName?.map?.(v=>v.name).join(",")||''})
check(){
if(!this.formData.farmingType){
uni.showToast({title:"农资类型必选!",icon:"none"})
return false
//
}else if(/^播种$|^用药$|^施肥$/.test(this.formData.farmingType) && this.formData.inputList.length<=0){
uni.showToast({title:"请添加农资!",icon:"none"})
return false
}else if(/^用药$/.test(this.formData.farmingType) && !this.formData.farmPests){
uni.showToast({title:"请添加病虫害记录!",icon:"none"})
return false
}
return true
},
submit(){
if(this.check()){
this.$refs.form.validate().then(async valid=>{
if(valid){
var res=await request("/api/plantFarming/addOrUpdate",{
method:"post",
body:{
...this.formData,
images: this.fields.images.value,
farmPests: Object.assign(this.formData.farmPests||{},{pestName:this.formData.farmPests?.pestName?.map?.(v=>v.name).join(",")||''})
}
})
if(res.statu){
uni.navigateBack()
this.eventChannel.emit("update")
}else{
uni.showModal({
title:"提示",
content:res.msg||"保存农事失败!",
showCancel:false,
})
}
}
})
}
},
async addType(){
if(this.tempType){
var res=await request("/common/api/dict/addDictItem",{
params:{
text: this.tempType,
dictCode:"farming_type",
}
})
if(res.statu){
uni.navigateBack()
this.eventChannel.emit("update")
this.isShow=false
this.tempType=''
this.typeList.push({label: res.data.itemText, value: res.data.itemValue})
}else{
uni.showModal({
title:"提示",
content:res.msg||"保存农事失败!",
content:res.msg||"添加农资类型失败!",
showCancel:false,
})
}
}else{
uni.showToast({title:"请输入内容!",icon:"none"})
}
},
//

79
pages/massif/add_transaction.vue

@ -49,58 +49,11 @@
}
}
}
&.prod{
.plant-dikuaimianji{
display:flex;
align-items: center;
font-weight: bold;
margin-bottom:20rpx;
&:before{
color:#10C176;
font-weight: normal;
margin-right:10rpx;
}
}
.item{
display:flex;
align-items: center;
background:#EEFBF5;
padding:30rpx;
border-radius: 24rpx;
.tab{
font-size:20rpx;
background:#10C176;
color:#fff;
border-radius: 4rpx 40rpx 4rpx 40rpx;
padding:4rpx 20rpx;
margin-right:20rpx;
}
.name{
font-weight: bold;
margin-right:20rpx;
}
.weight{
color:#10C176;
font-weight: bold;
margin-left:auto;
}
}
&>button{
display:flex;
background:#10C176;
width:80%;
margin:60rpx auto 0;
}
}
}
}
</style>
<template>
<view class="container">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="交易信息">
<button slot="right" class="cu-btn round" @click="submit">提交</button>
</d-navbar>
<view class="card info">
<view class="name">
<text>{{detail.plantTypeName}}</text> <text>{{detail.plantName}}</text>
@ -111,8 +64,7 @@
</view>
<view class="card">
<u-form class="inline" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<!-- <d-form label="交易重量" required field="tradeWeight" type="digit" suffix="kg" :value="formData.tradeWeight" @input="formData.tradeWeight=$event"/>
<d-form label="交易重量" required field="tradeWeight" type="digit" suffix="kg" :value="formData.tradeWeight" @input="formData.tradeWeight=$event"/>
<view style="display:flex;align-items: center;">
<d-form label="规格" required field="specification" type="digit" suffix="kg" :value="formData.specification" @input="formData.specification=$event"/>
<text style="margin:45rpx 20rpx 0 20rpx;">/</text>
@ -121,29 +73,11 @@
<d-form label="交易数量" disabled type="digit" :suffix="formData.packUnit" :value="tradeNum"/>
<d-form label="买方名称" required field="buyerName" btnIcon="plant-sousuo" :btnFun="searchBuy" :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.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
v-for="(v,k) in fields" :key="k"
:field="k"
v-bind="v"
:required="!!rules[k]"
:value="/^select$/.test(v.type)?fields[k].value:formData[k]"
@input="formData[k]=$event"
@select="fields[k].value=$event.map(v=>v.value);formData[k]=fields[k].value.slice(-1)[0]"/>
<d-form label="收货地址" required field="buyerAddress" type="textarea" :value="formData.buyerAddress" @input="formData.buyerAddress=$event"/>
</u-form>
</view>
<view style="color:#FBA83C;margin:40rpx auto;width:max-content;">+添加采收详情</view>
<view class="card prod">
<view class="plant-dikuaimianji">林下三七1号基地</view>
<view class="item">
<text class="tab">外采</text>
<text class="name over">三七(A12263664)</text>
<text class="weight">23kg</text>
</view>
<button class="cu-btn round bg-green shadow" @click="sumbit">+继续添加</button>
</view>
<!-- <button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button> -->
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button>
</view>
</template>
<script>
@ -155,13 +89,6 @@ export default {
packWeightList:[],
detail:{},
fields:{
weight:{label:"交易重量",type:'digit',suffix:"kg"},
date:{label:"交易日期",type:"calendar"},
buyerName:{label:"买方名称"},
buyerType:{label:"买方类型",type:"select",columns:[],value:[]},
buyerAddress:{label:"收货地址",type:"textarea"},
},
formData:{
harvestId:"",
tradeWeight:"",

54
pages/massif/detail.vue

@ -16,7 +16,6 @@
text{
&:first-child{
flex-shrink: 0;
margin-right:20rpx;
}
}
&.inline{
@ -40,14 +39,6 @@
margin-right:0;
}
}
&.bg{
background:#F7F7F7;
padding:30rpx 30rpx 0;
border-radius: 24rpx;
.u-transition{
box-shadow: 4rpx 4rpx 10rpx -4rpx rgba(0,0,0,0.2);
}
}
}
.detail{
background:#F7F7F7;
@ -58,15 +49,6 @@
width:100%;
}
}
.u-tabs{
margin-bottom:20rpx;
&/deep/ .u-tabs__wrapper__nav__item{
height:56rpx!important;
.u-tabs__wrapper__nav__item__text{
font-size:24rpx;
}
}
}
}
}
</style>
@ -79,10 +61,10 @@
<text>基地名称</text> <text>{{detail.plantBaseName}}</text>
</view>
<view class="item">
<text>块编号</text> <text>{{detail.plotNumber}}</text>
<text>块编号</text> <text>{{detail.plotNumber}}</text>
</view>
<view class="item">
<text>块面积</text> <text>{{detail.drawArea}}</text>
<text>块面积</text> <text>{{detail.drawArea}}</text>
</view>
<view class="item">
<text>实际面积</text> <text>{{detail.realityArea}}</text>
@ -99,43 +81,13 @@
<text>使用日期</text> <text>{{detail.beginTime}} {{detail.endTime}}</text>
</view>
<view class="item">
<text>海拔</text> <text>123</text>
</view>
<view class="item">
<text>基地管理员</text> <text>张阿肆(1556325665)</text>
<text>经纬度</text> <text>东经97°31,北纬21°8</text>
</view>
<view class="item inline">
<text>详细地址</text>
<view class="detail"> {{detail.address}} </view>
</view>
</view>
<view class="card" style="margin-top:30rpx;">
<u-tabs
lineColor="#10C176"
:scrollable="false"
lineWidth="60rpx"
:list="[{name:'土壤检测信息'},{name:'水质检测信息'},{name:'空气质量信息'}]"/>
<view class="item">
<text>送检人</text> <text>赵晓敏</text>
</view>
<view class="item">
<text>检测时间</text> <text class="over">2023-04-23</text>
</view>
<view class="item">
<text>检测机构</text> <text class="over">xxxx检测机构</text>
</view>
<view class="item">
<text>检测人</text> <text class="over">张欣欣</text>
</view>
<view class="item inline">
<text>检测报告</text>
<view class="imgs bg">
<u-image mode="aspectFill" v-for="k in 4" :key="k" radius="8rpx" width="100%" height="220rpx" src="https://tse1-mm.cn.bing.net/th/id/OIP-C.0H1wH1c5Gj0VDWYOP_EcawHaKe?pid=ImgDet&rs=1">
<text slot="error" style="font-size:60rpx" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
</view>
</view>
</view>
</view>
</template>
<script>

6
pages/massif/index.vue

@ -78,11 +78,11 @@
</style>
<template>
<view class="container flex">
<d-navbar style="--bg:#10C176;--c:#fff;" text="地管理">
<!-- <text class="plant-xinjian" slot="right" @click="toInfo"/> -->
<d-navbar style="--bg:#10C176;--c:#fff;" text="地管理">
<text class="plant-xinjian" slot="right" @click="toInfo"/>
</d-navbar>
<!-- <d-search v-model="searchVal.search" @search="clean();search()"/> -->
<d-search v-model="searchVal.search" @search="clean();search()"/>
<scroll-view scroll-y @scrolltolower="search">
<view class="card item" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/massif/detail',params:{id:v.id}})">

3
pages/massif/info.vue

@ -39,9 +39,6 @@ import request from '@/common/request'
image:{label:"地块图片",type:"upImg",num:3,value:''},
date:{label:"使用日期",type:"dateRange",value:[]},
// longitude:{label:"/",type:"map",value:[]},
hb:{label:"海拔",type:"digit"},
manager:{label:"基地管理员",disabled:true},
phone:{label:"管理员电话",type:"number",disabled:true},
address:{label:"详细地址",type:"textarea"},
},
formData:{

178
pages/massif/mana/recovery.vue

@ -42,79 +42,66 @@
.card{
margin-top:0;
&>.content{
display:flex;
border-bottom:2rpx solid rgba(216, 216, 216, 0.2);
padding-bottom:10rpx;
margin-bottom:20rpx;
.u-transition{
flex-shrink: 0;
margin-right:20rpx;
}
.info{
flex-grow: 1;
width:1rpx;
.title{
display: flex;
align-items: center;
margin-bottom:15rpx;
text{
&.name{
font-weight: bold;
display:flex;
.u-transition{
flex-shrink: 0;
margin-right:20rpx;
}
.detail{
flex-grow: 1;
width:1rpx;
.name{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom:15rpx;
text{
&:first-child{
font-weight: bold;
flex-grow: 1;
}
&.total{
flex-shrink: 0;
color:#10C176;
font-size:24rpx;
margin-right:20rpx;
&:after{
content:'kg';
}
&.tab{
flex-shrink: 0;
color:#fff;
background:#10C176;
height:36rpx;
line-height: 36rpx;
border-radius: 40rpx;
padding:0 10rpx;
font-size:24rpx;
margin:0 auto 0 20rpx;
min-width:60rpx;
text-align: center;
}
&.surplus{
flex-shrink: 0;
font-size:24rpx;
color:#FFC760;
&:before{
content:"剩余:";
font-weight: normal;
}
&.plant-youbian{
flex-shrink: 0;
margin-left:20rpx;
&:after{
content:'kg';
font-weight: normal;
}
}
}
.batch{
font-size:24rpx;
margin-bottom:6rpx;
}
.total{
color:#10C176;
font-size:24rpx;
font-weight: bold;
margin-bottom:6rpx;
}
.surplus{
color:#FCA606;
font-size:24rpx;
}
}
}
&>.foot{
display:flex;
align-items: center;
justify-content: space-between;
&>text{
.info{
font-size: 24rpx;
color:#999;
font-size:24rpx;
}
button{
background:#EEFBF5;
border-radius: 4rpx;
color:#10C176;
font-size:24rpx;
padding:0;
height:48rpx;
width:96rpx;
&:before{
font-size:40rpx;
display: flex;
align-items: center;
justify-content: space-between;
text.plant-jinrongjiaoyi{
display: flex;
align-items: center;
color:#10C176;
font-size:24rpx;
background:#EEFBF5;
height:48rpx;
line-height: 48rpx;
padding:0 10rpx;
&:before{
font-size:35rpx;
}
}
}
}
@ -127,32 +114,42 @@
</style>
<template>
<view class="recovery">
<d-dateRange @date="searchVal.startTime=$event[0];searchVal.endTime=$event[1];clean();search()"/>
<view class="dateRange">
<text class="plant-youbian" :class="{noDate:!searchVal.startTime}" @click="dateType='startTime';show=true">{{searchVal.startTime||"请选择开始日期"}}</text>
<text>~</text>
<text class="plant-youbian" :class="{noDate:!searchVal.endTime}" @click="dateType='endTime';show=true">{{searchVal.endTime||"请选择结束日期"}}</text>
</view>
<scroll-view scroll-y @scrolltolower="search">
<view class="card" v-for="(v,k) in list" :key="k">
<view class="content">
<u-image width="170rpx" height="140rpx" radius="6rpx" mode="aspectFill" :src="`${host}/${v.images}`">
<text slot="error" style="font-size:45rpx;" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<u-image width="90rpx" height="90rpx" radius="6rpx" mode="aspectFill" :src="`${host}/${v.images}`">
<text slot="error" style="font-size:45rpx;" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<view class="detail">
<view class="name">
<text class="over">{{v.plantName}}</text>
<text class="total">{{v.totalNum}}</text>
<text class="surplus">{{v.harvestNum}}</text></view>
<view class="info">
<view class="title">
<text class="name over">{{v.plantName}}</text>
<text class="tab">红籽</text>
<text class="plant-youbian"/>
</view>
<view class="batch">收获批次号A000001</view>
<view class="total">{{v.totalNum}}kg</view>
<view class="surplus">剩余{{v.harvestNum}}kg</view>
<text class="people">负责人:{{v.principal}}</text>
<text class="date">采收日期:{{v.harvestTime}}</text>
<text class="plant-jinrongjiaoyi" v-if="v.harvestNum>0" @click="toAddTransaction(v)">交易</text>
</view>
</view>
<view class="foot">
<text class="date">采收日期:{{v.harvestTime}}</text>
<button class="cu-btn plant-jinrongjiaoyi" v-if="v.harvestNum>0" @click="toAddTransaction(v)">交易</button>
</view>
</view>
<u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view>
<u-datetime-picker
:show="show"
mode="date"
closeOnClickOverlay
@close="show=false"
@cancel="show=false"
:minDate="dateType=='endTime'&&searchVal.startTime?new Date(searchVal.startTime).getTime():new Date().set('y',-15).getTime()"
:maxDate="dateType=='startTime'&&searchVal.endTime?new Date(searchVal.endTime).getTime():new Date().set('y',15).getTime()"
:value="searchVal[dateType] || new Date().format('yyyy-MM-dd')"
@confirm="searchVal[dateType]=new Date($event.value).format('yyyy-MM-dd');show=false"/>
</view>
</template>
<script>
@ -171,6 +168,8 @@ export default {
},
data(){
return{
show:false,
dateType:"startTime",
host:host("imgUrl"),
searchVal:{
pageNo:1,
@ -182,6 +181,19 @@ export default {
total:0,
}
},
computed:{
date(){
return [this.searchVal.startTime,this.searchVal.endTime]
}
},
watch:{
date(n){
if(n[0] && n[1]){
this.clean()
this.search()
}
}
},
created(){
this.search()

123
pages/massif/mana/transactions.vue

@ -43,53 +43,37 @@
.card{
margin-top:0;
display: flex;
border-bottom:2rpx solid rgba(216, 216, 216, 0.2);
&>.content{
padding-bottom:14rpx;
margin-bottom:20rpx;
.u-transition{
margin-right:20rpx;
.u-transition{
margin-right:20rpx;
}
&>.info{
flex-grow: 1;
width:1rpx;
.title{
font-weight: bold;
margin-bottom:6rpx;
}
&>.info{
flex-grow: 1;
width:1rpx;
&>.title{
margin-bottom:6rpx;
display:flex;
align-items: center;
&>view{
flex-shrink: 0;
}
.name{
font-weight: bold;
margin-right:12rpx;
}
.tab{
color:#fff;
font-size:20rpx;
background:#10C176;
height:36rpx;
line-height: 36rpx;
border-radius: 40rpx;
}
}
&>.batch{
font-size:24rpx;
.spec,.total{
font-size:24rpx;
color:#999;
margin-top:10rpx;
display:flex;
align-items: center;
text:first-child{
min-width:180rpx;
}
&>.weight{
}
.total{
text:first-child{
color:#10C176;
font-size:32rpx;
font-weight: bold;
&:after{
content:"("attr(data-unit)")";
font-weight: normal;
}
}
}
}
&>.foot{
display:flex;
align-items: center;
justify-content: space-between;
color:#999;
font-size:24rpx;
}
}
}
.u-popup{
@ -99,30 +83,42 @@
</style>
<template>
<view class="transaction">
<d-dateRange @date="searchVal.startTime=$event[0];searchVal.endTime=$event[1];clean();search()"/>
<view class="dateRange">
<text class="plant-youbian" :class="{noDate:!searchVal.startTime}" @click="dateType='startTime';show=true">{{searchVal.startTime||"请选择开始日期"}}</text>
<text>~</text>
<text class="plant-youbian" :class="{noDate:!searchVal.endTime}" @click="dateType='endTime';show=true">{{searchVal.endTime||"请选择结束日期"}}</text>
</view>
<scroll-view scroll-y @scrolltolower="search">
<view class="card" v-for="(v,k) in list" :key="k">
<view class="content">
<u-image radius="20rpx" width="130rpx" height="118rpx" mode="aspectFill" :src="`${host}/${v.images[0]}`">
<text slot="error" style="font-size:45rpx;" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<view class="info">
<view class="title">
<text class="name over">{{v.productName}}</text>
<text class="tab">叶片</text>
<text class="plant-youbian"/>
</view>
<view class="batch">收获批次号A000001</view>
<view class="weight">300kg</view>
<u-image radius="20rpx" width="130rpx" height="118rpx" mode="aspectFill" :src="`${host}/${v.images[0]}`">
<text slot="error" style="font-size:45rpx;" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<view class="info">
<view class="title">{{v.productName}}</view>
<view class="spec">
<text>规格{{v.specification}}</text>
<text class="over">{{v.buyerName}}</text>
</view>
<view class="total">
<text :data-unit="`${(parseFloat(v.tradeNum)||0)*(parseFloat(v.specification)||0)}${v.weightUnit}`">{{v.tradeNum}}{{v.packUnit_dictText}}</text>
<text>交易日期{{v.tradeTime}}</text>
</view>
</view>
<view class="foot">
<text>交易日期{{v.tradeTime}}</text> <text class="over">{{v.buyerName}}</text>
</view>
</view>
<u-empty v-if="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view>
<u-datetime-picker
:show="show"
mode="date"
closeOnClickOverlay
@close="show=false"
@cancel="show=false"
:minDate="dateType=='endTime'&&searchVal.startTime?new Date(searchVal.startTime).getTime():new Date().set('y',-15).getTime()"
:maxDate="dateType=='startTime'&&searchVal.endTime?new Date(searchVal.endTime).getTime():new Date().set('y',15).getTime()"
:value="searchVal[dateType] || new Date().format('yyyy-MM-dd')"
@confirm="searchVal[dateType]=new Date($event.value).format('yyyy-MM-dd');show=false"/>
</view>
</template>
<script>
@ -140,6 +136,7 @@ export default {
},
data(){
return{
show:false,
host:host('imgUrl'),
searchVal:{
startTime:"",
@ -149,6 +146,20 @@ export default {
},
list:[],
total:0,
dateType:"startTime",
}
},
computed:{
date(){
return [this.searchVal.startTime, this.searchVal.endTime]
},
},
watch:{
date(n){
if(n[0] && n[1]){
this.clean()
this.search()
}
}
},
created(){

58
pages/massif/plant_info.vue

@ -3,52 +3,6 @@
min-height:100%;
background:#f6f6f6;
padding:30rpx 0;
.card{
&.prod{
.plant-dikuaimianji{
display:flex;
align-items: center;
font-weight: bold;
margin-bottom:20rpx;
&:before{
color:#10C176;
font-weight: normal;
margin-right:10rpx;
}
}
.item{
display:flex;
align-items: center;
background:#EEFBF5;
padding:30rpx;
border-radius: 24rpx;
.tab{
font-size:20rpx;
background:#10C176;
color:#fff;
border-radius: 4rpx 40rpx 4rpx 40rpx;
padding:4rpx 20rpx;
margin-right:20rpx;
}
.name{
font-weight: bold;
margin-right:20rpx;
}
.weight{
color:#10C176;
font-weight: bold;
margin-left:auto;
}
}
&>button{
display:flex;
background:#10C176;
width:80%;
margin:60rpx auto 0;
}
}
}
}
</style>
<template>
@ -68,17 +22,6 @@
@select="fields[k].value=$event.map(v=>v.value);formData[k]=fields[k].value[0]"
@input="formData[k]=$event"/>
</u-form>
<view style="width:max-content;margin:90rpx auto 30rpx;color:#FBA83C;">+添加种植详情</view>
<view class="card prod">
<view class="plant-dikuaimianji">林下三七1号基地</view>
<view class="item">
<text class="tab">外采</text>
<text class="name over">三七(A12263664)</text>
<text class="weight">23kg</text>
</view>
<button class="cu-btn round bg-green shadow" @click="sumbit">+继续添加</button>
</view>
</view>
</template>
<script>
@ -87,7 +30,6 @@ export default {
data(){
return{
fields:{
bw:{label:"采收部位",type:"radio",columns:[{label:"红籽",value:0},{label:"叶片",value:1},{label:"根",value:2}]},
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",columns:[],value:[]},

39
pages/seeding/info.vue

@ -1,39 +0,0 @@
<style lang="less">
.container{
min-height:100%;
background:#f6f6f6;
padding:30rpx 0;
}
</style>
<template>
<view class="container">
<u-form class="card inline" labelWidth="auto" errorType="toast" :model="formData" :rules="rules">
<d-form
v-for="(v,k) in fields" :key="k"
:field="k"
v-bind="v"
:required="!!rules[k]"/>
</u-form>
<button class="cu-btn round bg-green shadow submit" @click="submit">确定提交</button>
</view>
</template>
<script>
export default {
data(){
return{
fields:{
name:{label:"名称"},
type:{label:"类型"},
batch:{label:"种苗批次号",btnText:"生成"},
source:{label:"来源",type:"radio",columns:[{label:"外采",value:'0'},{label:"培育",value:'1'}]},
supplier:{label:"供应商名称"},
date:{label:"种植日期",type:"calendar"},
num:{label:"采购数量",type:"number",suffix:"株"}
},
formData:{},
rules:{}
}
}
}
</script>

177
pages/seeding/mana.vue

@ -1,177 +0,0 @@
<style lang="less">
.container{
height:100%;
background:#f6f6f6;
padding-top:30rpx;
scroll-view{
height:100%;
.card{
margin-top:0;
&>.content{
display:flex;
border-bottom:2rpx solid rgba(216, 216, 216, 0.2);
padding-bottom:12rpx;
margin-bottom:20rpx;
.u-transition{
position:relative;
margin-right:22rpx;
&:before{
content:attr(data-attr);
position:absolute;
z-index: 10;
padding:6rpx 10rpx;
top:0;
left:0;
border-radius: 30rpx;
background:rgba(0,0,0,0.4);
color:#fff;
font-size:20rpx;
}
}
.info{
flex-grow: 1;
width:1rpx;
font-size:24rpx;
.title{
display:flex;
align-items: center;
margin-bottom:6rpx;
.name{
font-weight: bold;
margin-right:12rpx;
font-size:28rpx;
}
.tab{
background:#10C176;
height:36rpx;
line-height: 36rpx;
color:#fff;
font-size:20rpx;
border-radius: 40rpx;
padding:0 8rpx;
min-width:62rpx;
text-align: center;
}
}
.num{
color:#10C176;
font-size:32rpx;
font-weight: bold;
margin-top:6rpx;
}
.residue{
color:#FCA606;
font-size:24rpx;
margin-top:6rpx;
}
.zhu:after{content:"株";}
.company{
color:#999;
}
}
}
&>.foot{
display:flex;
align-items: center;
justify-content: space-between;
color:#999;
font-size:24rpx;
button{
height:max-content;
background:transparent;
color:#10C176;
padding:0;
font-size:24rpx;
&:before{
font-size:30rpx;
margin-right:6rpx;
}
}
}
}
}
.u-popup{
input{
width:100%;
background:rgba(0,0,0,0.1);
height:60rpx;
border-radius: 8rpx;
padding:0 20rpx;
&:focus{
border:2rpx solid #10C176;
}
}
}
}
</style>
<template>
<view class="container">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="种苗管理">
<text v-if="intoPage=='addFarming'" class="plant-caigou" slot="right" @click=""/>
</d-navbar>
<scroll-view scroll-y @scrolltolower="">
<view class="card">
<view class="content">
<u-image width="170rpx" data-attr="药材" height="140rpx" radius="12rpx" src="https://ts1.cn.mm.bing.net/th/id/R-C.d501f93a5f934a60940b47a1c241101d?rik=KBXjWV%2fVGKQ86Q&riu=http%3a%2f%2fwww.maisanqi.com%2fuploadfile%2f2015%2f1112%2f20151112023237448.png&ehk=qOz5xilHBTtcCB4Yd%2bVpFBY%2fB1sw0kDUIpGg%2fzkF1sM%3d&risl=&pid=ImgRaw&r=0">
<text slot="error" class="plant-xiaopangchetupianjiazaishibai"/>
</u-image>
<view class="info">
<view class="title">
<text class="name over">三七</text>
<text class="tab">外采</text>
</view>
<view class="batch">种苗批次号A00001</view>
<template v-if="intoPage=='addFarming'">
<view style="display:flex;align-items:center;">
<view class="num zhu" style="margin-right:20rpx;">145</view>
<view class="residue zhu">剩余123</view>
</view>
<view class="company">云南xxxx农业有限公司</view>
</template>
<template v-else>
<view class="num zhu">145</view>
<view class="residue zhu">剩余123</view>
</template>
</view>
</view>
<view class="foot">
<text class="date">采购日期2023-09-09</text>
<template v-if="intoPage=='addFarming'">
<button class="cu-btn plant-fuzhi" @click="select={...v}">选择</button>
</template>
<text class="company" v-else>云南xxxx农业有限公司</text>
</view>
</view>
</scroll-view>
<u-modal
:show="!!select"
closeOnClickOverlay
style="flex:0;"
title="提示"
@close="select=null"
@confirm="addSeedWeight">
<input placeholder="请输入重量" v-model="weight" type="digit"/>
</u-modal>
</view>
</template>
<script>
export default {
data(){
return{
intoPage:"",
select:null,
}
},
onLoad(options){
this.intoPage=options.into
},
methods:{
addSeedWeight(){
},
}
}
</script>

6
router/massif.js

@ -105,10 +105,10 @@ module.exports=[
path:"pages/massif/add_transaction",
style:{
navigationBarTitleText:"交易信息",
// navigationBarBackgroundColor:"#10C176",
// navigationBarTextStyle:"white",
navigationBarBackgroundColor:"#10C176",
navigationBarTextStyle:"white",
"app-plus":{
titleNView:false,
titleNView:true,
}
}
},

24
router/seeding.js

@ -1,24 +0,0 @@
module.exports=[
{
path:"pages/seeding/info",
style:{
navigationBarTitleText:"种苗信息",
navigationBarBackgroundColor:"#10C176",
navigationBarTextStyle:"white",
"app-plus":{
titleNView:true
}
}
},
{
path:"pages/seeding/mana",
style:{
navigationBarTitleText:"种苗管理",
// navigationBarBackgroundColor:"#10C176",
// navigationBarTextStyle:"white",
"app-plus":{
titleNView:false
}
}
},
]

BIN
static/banner.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 47 KiB

2
uni.scss

@ -77,7 +77,7 @@ $uni-font-size-paragraph:15px;
@import '@/common/main.css';
@import 'uview-ui/theme.scss';
@import url('https://at.alicdn.com/t/c/font_3852037_6r9mt8ndlft.css');
@import url('https://at.alicdn.com/t/c/font_3852037_8mq6duzc3f3.css');
[class*=plant-]{
font-family: "plantMana" !important;
font-size: 16px;

0
uni_modules/d-dateRange/changelog.md

109
uni_modules/d-dateRange/components/d-dateRange/d-dateRange.vue

@ -1,109 +0,0 @@
<style lang="less">
.d-dateRange{
flex-shrink: 0;
display:flex;
align-items: center;
margin:20rpx 30rpx;
&>text{
display: flex;
align-items: center;
justify-content: space-between;
background:#fff;
font-size:24rpx;
color:#333;
height:48rpx;
position: relative;
padding:0 30rpx 0 10rpx;
min-width:220rpx;
box-sizing: border-box;
border-radius: 8rpx;
&:first-child{margin-right:28rpx;}
&:nth-child(2){margin-left:28rpx;}
&.noDate{
color:#999;
}
.plant-youbian,.plant-zengjia{
font-size:24rpx;
height:48rpx;
width:40rpx;
text-align: center;
line-height: 48rpx;
position:absolute;
top:0;
right:0;
&:before{
display: inline-block;
transform: rotate(90deg);
}
}
.plant-zengjia{
z-index: 100;
&:before{
transform: rotate(45deg);
}
}
}
}
</style>
<template>
<view class="d-dateRange">
<text :class="{noDate:!startTime}" @click="type='start';show=true">
{{startTime||"请选择开始日期"}}
<text v-if="startTime" class="plant-zengjia" @click.stop="startTime=''"/>
<text v-else class="plant-youbian"/>
</text>
~
<text :class="{noDate:!endTime}" @click="type='end';show=true">
{{endTime||"请选择结束日期"}}
<text class="plant-youbian"/>
<text v-if="endTime" class="plant-zengjia" @click.stop="endTime=''"/>
<text v-else class="plant-youbian"/>
</text>
<u-datetime-picker
:show="show"
mode="date"
style="flex:0;"
closeOnClickOverlay
@close="show=false"
@cancel="show=false"
:minDate="type=='end'&&startTime?new Date(startTime).getTime():new Date().set('y',-15).getTime()"
:maxDate="type=='start'&&endTime?new Date(endTime).getTime():new Date().set('y',15).getTime()"
:value=" type=='start'&&startTime|| type=='end'&&endTime || new Date().format('yyyy-MM-dd')"
@confirm="confirm"/>
</view>
</template>
<script>
export default{
data(){
return{
startTime:"",
endTime:"",
type:"start",
show:false,
}
},
computed:{
date(){
return[this.startTime,this.endTime]
}
},
watch:{
date(n){
if(n[0]&&n[1]||!n[0]&&!n[1]){
this.$emit("date",n)
}
}
},
methods:{
confirm(e){
if(this.type=='start'){
this.startTime=new Date(e.value).format('yyyy-MM-dd')
}else{
this.endTime=new Date(e.value).format('yyyy-MM-dd')
}
this.show=false
},
}
}
</script>

81
uni_modules/d-dateRange/package.json

@ -1,81 +0,0 @@
{
"id": "d-dateRange",
"displayName": "d-dateRange",
"version": "1.0.0",
"description": "d-dateRange",
"keywords": [
"d-dateRange"
],
"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-dateRange/readme.md

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