diff --git a/App.vue b/App.vue
index d30aba9..a8c1b05 100644
--- a/App.vue
+++ b/App.vue
@@ -20,9 +20,9 @@
if(this.$store.getters.token){
}else{
- uni.reLaunch({
- url:"pages/home/login",
- })
+ // uni.reLaunch({
+ // url:"pages/home/login",
+ // })
}
},
onShow: function() {
diff --git a/components/colorui/main.css b/common/main.css
similarity index 100%
rename from components/colorui/main.css
rename to common/main.css
diff --git a/common/request.js b/common/request.js
index 42aafc8..d913056 100644
--- a/common/request.js
+++ b/common/request.js
@@ -3,8 +3,8 @@ import store from "@/store"
export function host(host='default',suffix='/plant_manage'){
return(
process.env.NODE_ENV === 'development'?{
- // default:`http://10.0.0.217${suffix}` //陈
- default:`http://mq3s8b.natappfree.cc${suffix}` //马
+ default:`http://xvff42.natappfree.cc${suffix}` //陈
+ // default:`http://mq3s8b.natappfree.cc${suffix}` //马
}:{
default:`http://qv6mj8.natappfree.cc${suffix}`
}
diff --git a/components/colorui/animation.css b/components/colorui/animation.css
deleted file mode 100644
index 931bb51..0000000
--- a/components/colorui/animation.css
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- Animation 微动画
- 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
- */
-
-/* css 滤镜 控制黑白底色gif的 */
-.gif-black{
- mix-blend-mode: screen;
-}
-.gif-white{
- mix-blend-mode: multiply;
-}
-
-
-/* Animation css */
-[class*=animation-] {
- animation-duration: .5s;
- animation-timing-function: ease-out;
- animation-fill-mode: both
-}
-
-.animation-fade {
- animation-name: fade;
- animation-duration: .8s;
- animation-timing-function: linear
-}
-
-.animation-scale-up {
- animation-name: scale-up
-}
-
-.animation-scale-down {
- animation-name: scale-down
-}
-
-.animation-slide-top {
- animation-name: slide-top
-}
-
-.animation-slide-bottom {
- animation-name: slide-bottom
-}
-
-.animation-slide-left {
- animation-name: slide-left
-}
-
-.animation-slide-right {
- animation-name: slide-right
-}
-
-.animation-shake {
- animation-name: shake
-}
-
-.animation-reverse {
- animation-direction: reverse
-}
-
-@keyframes fade {
- 0% {
- opacity: 0
- }
-
- 100% {
- opacity: 1
- }
-}
-
-@keyframes scale-up {
- 0% {
- opacity: 0;
- transform: scale(.2)
- }
-
- 100% {
- opacity: 1;
- transform: scale(1)
- }
-}
-
-@keyframes scale-down {
- 0% {
- opacity: 0;
- transform: scale(1.8)
- }
-
- 100% {
- opacity: 1;
- transform: scale(1)
- }
-}
-
-@keyframes slide-top {
- 0% {
- opacity: 0;
- transform: translateY(-100%)
- }
-
- 100% {
- opacity: 1;
- transform: translateY(0)
- }
-}
-
-@keyframes slide-bottom {
- 0% {
- opacity: 0;
- transform: translateY(100%)
- }
-
- 100% {
- opacity: 1;
- transform: translateY(0)
- }
-}
-
-@keyframes shake {
-
- 0%,
- 100% {
- transform: translateX(0)
- }
-
- 10% {
- transform: translateX(-9px)
- }
-
- 20% {
- transform: translateX(8px)
- }
-
- 30% {
- transform: translateX(-7px)
- }
-
- 40% {
- transform: translateX(6px)
- }
-
- 50% {
- transform: translateX(-5px)
- }
-
- 60% {
- transform: translateX(4px)
- }
-
- 70% {
- transform: translateX(-3px)
- }
-
- 80% {
- transform: translateX(2px)
- }
-
- 90% {
- transform: translateX(-1px)
- }
-}
-
-@keyframes slide-left {
- 0% {
- opacity: 0;
- transform: translateX(-100%)
- }
-
- 100% {
- opacity: 1;
- transform: translateX(0)
- }
-}
-
-@keyframes slide-right {
- 0% {
- opacity: 0;
- transform: translateX(100%)
- }
-
- 100% {
- opacity: 1;
- transform: translateX(0)
- }
-}
\ No newline at end of file
diff --git a/components/colorui/components/cu-custom.vue b/components/colorui/components/cu-custom.vue
deleted file mode 100644
index a4e1773..0000000
--- a/components/colorui/components/cu-custom.vue
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/cu-navbar.vue b/components/cu-navbar.vue
deleted file mode 100644
index e275c15..0000000
--- a/components/cu-navbar.vue
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
- {{text}}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/main.js b/main.js
index 34c3620..a179037 100644
--- a/main.js
+++ b/main.js
@@ -2,11 +2,9 @@ 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 {defineObj} from 'black-knight/lib/config/custom'
Vue.use(uView)
-// Vue.component("cuNavbar", cuNavbar)
Vue.prototype.$store=store
Vue.config.productionTip = false
diff --git a/pages.js b/pages.js
index 456f679..a6d10b4 100644
--- a/pages.js
+++ b/pages.js
@@ -9,6 +9,19 @@ module.exports = hot((pagesJson)=>{
...require("./router/massif.js"),
...require('./router/purchase.js'),
...require('./router/stock.js'),
+ // {
+ // "path":"pages/demo",
+ // "style":{
+ // "navigationBarTitleText":"测试地图",
+ // "navigationBarBackgroundColor":"#10C176",
+ // "navigationBarTextStyle":"white",
+ // "app-plus":{
+ // "titleNView":true,
+ // "nvueCompiler":"uni-app",
+ // "nvueStyleCompiler":"uni-app"
+ // }
+ // }
+ // },
],
tabBar:{
color:"#999",
@@ -21,5 +34,19 @@ module.exports = hot((pagesJson)=>{
{pagePath:"pages/home/my",text:"我的",iconPath: "/static/tab_my.png",selectedIconPath: "/static/tab_my_active.png"},
]
},
+ condition : {
+ current: 0,
+ list: [
+ // {name:"测试页面",path:"pages/demo"},
+ {name: "登录",path: "pages/home/login","query": ""},
+ {name: "首页",path: "pages/home/index","query": ""},
+ {name: "仓库管理",path: "pages/warehouse/mana","query": ""},
+ {name: "仓库基本信息",path: "pages/warehouse/info","query": ""},
+ {name: "仓库详情",path: "pages/warehouse/detail","query": ""},
+ {name: "地块管理",path: "pages/massifMana","query": ""},
+ {name: "地块详情",path: "pages/massifDetail","query": ""},
+ {name: "地块基本信息",path: "pages/massifInfo","query": ""}
+ ]
+ }
}
})
\ No newline at end of file
diff --git a/pages.json b/pages.json
index db5269b..5d99eac 100644
--- a/pages.json
+++ b/pages.json
@@ -9,17 +9,8 @@
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {},
- "condition" : { //模式配置,仅开发期间生效
- "current": 0, //当前激活的模式(list 的索引项)
- "list": [
- {"name": "登录","path": "pages/home/login","query": ""},
- {"name": "首页","path": "pages/home/index","query": ""},
- {"name": "仓库管理","path": "pages/warehouse/mana","query": ""},
- {"name": "仓库基本信息","path": "pages/warehouse/info","query": ""},
- {"name": "仓库详情","path": "pages/warehouse/detail","query": ""},
- {"name": "地块管理","path": "pages/massifMana","query": ""},
- {"name": "地块详情","path": "pages/massifDetail","query": ""},
- {"name": "地块基本信息","path": "pages/massifInfo","query": ""}
- ]
+ "condition" : {
+ "current": 0,
+ "list": []
}
}
diff --git a/pages/demo.nvue b/pages/demo.nvue
new file mode 100644
index 0000000..7e6312e
--- /dev/null
+++ b/pages/demo.nvue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
diff --git a/pages/home/login.vue b/pages/home/login.vue
index 10a0857..d3b571a 100644
--- a/pages/home/login.vue
+++ b/pages/home/login.vue
@@ -73,6 +73,9 @@ export default {
}
},
onLoad(){
+ uni.navigateTo({
+ url:"/pages/demo"
+ })
if(process.env.NODE_ENV === 'development'){
this.formData.username="13383434048"
this.formData.password="1qaz@WSX"
diff --git a/pages/massif/detail.vue b/pages/massif/detail.vue
index 6d57bdc..583be8a 100644
--- a/pages/massif/detail.vue
+++ b/pages/massif/detail.vue
@@ -32,11 +32,9 @@
width:100%;
display:flex;
flex-wrap: wrap;
- image{
- height:160rpx;
- margin:0 20rpx 20rpx 0;
+ &>view{
width:calc((100% - 40rpx)/3);
- border-radius: 8rpx;
+ margin:0 20rpx 20rpx 0;
&:nth-child(3n){
margin-right:0;
}
@@ -74,7 +72,9 @@
地块图片
-
+
+
+
diff --git a/pages/massif/info.vue b/pages/massif/info.vue
index a98e897..9b7987e 100644
--- a/pages/massif/info.vue
+++ b/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.indexs;formData[k]=$event.value[0].value"
+ @select="fields[k].value=$event.value.map(v=>v.value);formData[k]=$event.value[0].value"
@imgs="fields[k].value=$event"/>
@@ -29,7 +29,7 @@ import request from '@/common/request'
data(){
return{
fields:{
- plantBaseName:{label:"基地名称",type:"select",columns:[[]],value:[null]},
+ plantBaseInfoId:{label:"基地名称",type:"select",columns:[[]],value:[]},
plotNumber:{label:"地块编号"},
plotName:{label:"地块名称"},
drawArea:{label:"地块面积(亩)",type:'digit'},
@@ -40,7 +40,7 @@ import request from '@/common/request'
address:{label:"详细地址",type:"textarea"},
},
formData:{
- plantBaseName:"",
+ plantBaseInfoId:"",
plotNumber:"",
plotName:"",
drawArea:'',
@@ -53,7 +53,7 @@ import request from '@/common/request'
address:"",
},
rules:{
- plantBaseName:{required:true, message:"基地名称必填!", trigger:"change"},
+ plantBaseInfoId:{required:true, message:"基地名称必填!", trigger:"change"},
plotNumber:{required:true, message:"地块编号必填!", trigger:"blur"},
plotName:{required:true, message:"地块名称必填!", trigger:"blur"},
drawArea:{required:true, type:'number', message:"地块面积必填!", trigger:"blur"},
@@ -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.baseName,value:v.id}))]
+ this.fields.plantBaseInfoId.columns = [res.data.map(v=>({label:v.baseName,value:v.id}))]
}else{
uni.showModal({
title:"提示",
@@ -129,7 +129,7 @@ import request from '@/common/request'
if(res.statu){
this.formData=res.data
this.fields.date.value=[res.data.beginTime, res.data.endTime]
- this.fields.plantBaseName.value=[this.fields.plantBaseName.columns[0].findIndex(v=>v.value==res.data.plantBaseName)]
+ this.fields.plantBaseInfoId.value=[res.data.plantBaseInfoId]//[this.fields.plantBaseInfoId.columns[0].findIndex(v=>v.value==res.data.plantBaseName)]
this.fields.image.value=res.data.image.join(',')
}else{
uni.showModal({
diff --git a/pages/massif/mana/index.vue b/pages/massif/mana/index.vue
index 58af1b5..9e84348 100644
--- a/pages/massif/mana/index.vue
+++ b/pages/massif/mana/index.vue
@@ -16,7 +16,7 @@
-
+
@@ -45,5 +45,29 @@ export default {
onLoad(options){
this.plantId=options.id
},
+ onReady(){
+ /* #ifdef APP-PLUS */
+ var a=uni.createMapContext("amap",this)
+
+ var maps=a.$getAppMap()
+ maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
+ maps.onclick=(e)=>{
+ console.log(e,'-------maps--click---------')
+ }
+ var polygon=new plus.maps.Polygon([
+ new plus.maps.Point(116.39524,39.925301),
+ new plus.maps.Point(116.400444,39.925285),
+ new plus.maps.Point(116.400558,39.923282),
+ new plus.maps.Point(116.395502,39.923082),
+ ])
+ polygon.setLineWidth(0)
+ polygon.setFillColor("#ff0000")
+ polygon.setFillOpacity(0.3)
+ maps.addOverlay(polygon)
+ /* #endif */
+ },
+ methods:{
+
+ }
}
\ No newline at end of file
diff --git a/pages/massif/mana/plantPlan.vue b/pages/massif/mana/plantPlan.vue
index 6b88d3a..46b58c5 100644
--- a/pages/massif/mana/plantPlan.vue
+++ b/pages/massif/mana/plantPlan.vue
@@ -3,15 +3,13 @@
.card{
&>.info{
display:flex;
- image{
- width:170rpx;
- height:140rpx;
- margin-right:20rpx;
+ &>.u-transition{
position:relative;
- border-radius: 20rpx;
+ margin-right:20rpx;
&:before{
content:attr(data-type);
position:absolute;
+ z-index: 30;
top:0;
left:0;
border-radius: 20rpx 20rpx 20rpx 0;
@@ -21,6 +19,10 @@
min-width:80rpx;
text-align: center;
}
+ &/deep/ image{
+ color:red;
+ border-radius: 20rpx!important;
+ }
}
&>.detail{
flex-grow: 1;
@@ -91,7 +93,9 @@
-
+
+ 加载失败
+
{{v.plantStandard}} {{v.varietyName}}
diff --git a/pages/massif/plant_info.vue b/pages/massif/plant_info.vue
index 82a335e..1c3ebf8 100644
--- a/pages/massif/plant_info.vue
+++ b/pages/massif/plant_info.vue
@@ -43,15 +43,14 @@ export default {
harvestTime:"",
status:"",
plantSchedulId:"",//种植计划id
- plotId:"",
+ plotId:"",//地块id
},
rules:{
- harvestNum: {required:true, message:"必填!", trigger:"blur"},
- harvestBatch:{required:true, message:"必填!", trigger:"blur"},
- principal:{required:true, message:"必填!", trigger:"blur"},
- harvestTime:{required:true, message:"必填!", trigger:"blur"},
- status:{required:true, message:"必填!", trigger:"blur"},
- plantSchedulId:{required:true, message:"必填!", trigger:"blur"},
+ harvestNum: {required:true, type:"number", message:"采收数量必填!", trigger:"blur"},
+ harvestBatch:{required:true, message:"收获批次号必填!", trigger:"blur"},
+ principal:{required:true, message:"负责人必填!", trigger:"blur"},
+ harvestTime:{required:true, message:"采收时间必填!", trigger:"blur"},
+ status:{required:true, message:"采收状态必填!", trigger:"blur"},
}
}
},
@@ -73,7 +72,25 @@ export default {
})
}
},
- submit(){},
+ submit(){
+ this.$refs.form.validate().then(async valid=>{
+ if(valid){
+ var res=await request("/api/plantHarvest/add",{
+ method:"post",
+ body: this.formData
+ })
+ if(res.statu){
+
+ }else{
+ uni.showModal({
+ title:"提示",
+ content:res.msg||"保存失败失败!",
+ showCancel:false,
+ })
+ }
+ }
+ })
+ },
},
}
\ No newline at end of file
diff --git a/pages/massif/plant_plan.vue b/pages/massif/plant_plan.vue
index 5dffc64..55a420e 100644
--- a/pages/massif/plant_plan.vue
+++ b/pages/massif/plant_plan.vue
@@ -12,8 +12,7 @@
-
-
+
v.value);formData[k]=$event.value[1].value"
@input="formData[k]=$event"
@imgs="fields[k].value=$event"/>
@@ -35,7 +34,7 @@ export default {
return{
fields:{
varietyName:{label:"品种名称"},
- plantType:{label:"作物类型",type:"select",columns:[[]],value:[null,null]},
+ plantType:{label:"作物类型",type:"select",columns:[[]],value:[]},
plantArea:{label:"种植面积(亩)",type:"digit"},
startTime:{label:"种植开始日期",type:"calendar"},
harvestTime:{label:"预估采收日期",type:"calendar"},
@@ -130,9 +129,8 @@ export default {
})
if(res.statu){
this.formData=res.data
- this.fields.images.value=res.data.images.join(',')
- this.fields.plantType.value=[this.fields.plantType.columns[0].findIndex(v=>v.value==res.data.plantType[0])]
- this.fields.plantType.value[1]=this.fields.plantType.columns[0][this.fields.plantType.value[0]].children.findIndex(v=>v.value==res.data.plantType[1])
+ this.fields.images.value=res.data.images?.join?.(',')||''
+ this.fields.plantType.value=res.data.plantType
}else{
uni.showModal({
title:"提示",
diff --git a/pages/purchase/agrProdList.vue b/pages/purchase/agrProdList.vue
index 6332aae..d18f609 100644
--- a/pages/purchase/agrProdList.vue
+++ b/pages/purchase/agrProdList.vue
@@ -1,6 +1,6 @@
-
-
+
+ v.value);formData[k]=$event.value.slice(-1)[0].value"/>
-
+
\ No newline at end of file
diff --git a/uni.scss b/uni.scss
index 3340e2b..40e95a6 100644
--- a/uni.scss
+++ b/uni.scss
@@ -75,9 +75,9 @@ $uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
-@import '@/components/colorui/main.css';
+@import '@/common/main.css';
@import 'uview-ui/theme.scss';
-@import url('https://at.alicdn.com/t/c/font_3852037_4hl5eh2pi96.css');
+@import url('https://at.alicdn.com/t/c/font_3852037_xtabq0losfb.css');
[class*=plant-]{
font-family: "plantMana" !important;
font-size: 16px;
diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue
index 3f471b0..6153649 100644
--- a/uni_modules/d-form/components/d-form/d-form.vue
+++ b/uni_modules/d-form/components/d-form/d-form.vue
@@ -151,7 +151,7 @@
- {{pickerContent}}
+ {{pickerContent}}
添加照片
@@ -177,13 +177,14 @@
{{tip}}
+
import request,{host} from '@/common/request'
+import {dataType} from 'black-knight/lib/config/tools'
function setPickerCol(columns, value, n){
if(columns.length<=0)return
@@ -221,6 +223,15 @@ import request,{host} from '@/common/request'
setPickerCol(columns[v].children, value, ++n)
}
}
+ function setPickerVal(columns, value){
+ if(dataType(columns,'array')){
+ for(var i=0;i({url:`${host(undefined,"/plant_manage/sys/common/static")}/${v}`,status:"success",index,type:'saved'})).concat(this.imgList.map((v,index)=>Object.assign(v,{index,type:'unsaved'})))
return []
},
- pickerContent(){
- if(/^\d+$/.test(this.value[0])){
- if(/^\d+$/.test(this.value[1])){
- return this.columns[0][this.value[0]].children[this.value[1]].label
- }else{
- return this.columns[0][this.value[0]].label
- }
- }else{
- return this.placeholder||`请选择${this.label}`
+ pickerContent(){//下拉选择 表单显示数据
+ if(this.type=='select'){
+ return setPickerVal(this.columns[0], this.value).findLast(v=>v)?.label||`请选择${this.label}`
}
+ return ''
+ },
+ pickerValue(){// 下拉选择 数据
+ if(this.type=='select'){
+ return setPickerVal(this.columns[0], this.value).map(v=>v?._index||0)
+ }
+ return []
},
},
created(){
@@ -365,8 +377,8 @@ import request,{host} from '@/common/request'
this.$emit('imgs',this.imgs.map(v=>({saved:v.url,unsaved:v.tempUrl})[v.type]).join(','))
},
pickerChange(e){
- if(e.value[e.columnIndex]?.children?.length>0){
- this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children)
+ if(e.value[e.columnIndex].hasOwnProperty('children')){
+ this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children||[])
}
},
},