Browse Source

修改样式

master
邓宏 2 years ago
parent
commit
44714be964
  1. 2
      pages/home/index.vue
  2. 4
      pages/massif/info.vue
  3. 27
      pages/massif/mana/index.vue
  4. 7
      pages/massif/mana/plantPlan.vue
  5. 20
      pages/massif/mana/recovery.vue
  6. 2
      pages/massif/plant_info.vue
  7. 139
      pages/purchase/index.vue
  8. 11
      router/purchase.js
  9. 19
      uni_modules/d-form/components/d-form/d-form.vue

2
pages/home/index.vue

@ -291,7 +291,7 @@
<view class="item meansAgrProd">农资库存</view>
<view class="item agrProd">农产品库存</view>
</view>
<view class="card stock" style="--c:#ffc353;" @click="$u.route({url:'pages/purchase/index'})">
<view class="card stock" style="--c:#ffc353;" @click="$u.route({url:'pages/purchase/apply'})">
<view class="title">采购申请</view>
<view class="item warehousing">入库管理</view>

4
pages/massif/info.vue

@ -140,5 +140,9 @@ import request from '@/common/request'
}
},
},
onBackPress(e){
console.log(e)
return false
},
}
</script>

27
pages/massif/mana/index.vue

@ -1,28 +1,41 @@
<style lang="scss">
.container{
min-height: 100%;
height: 100%;
background:#F6F6F6;
&>map{
flex-shrink: 0;
height:348rpx;
width:100%;
margin-bottom:-9rpx;
}
&>.u-tabs{
flex-shrink: 0;
background:#fff;
box-shadow: 0 6rpx 12rpx 2rpx rgba(0,0,0,0.1);
}
swiper{
flex-grow: 1;
height:1rpx;
}
}
</style>
<template>
<view class="container">
<view class="container flex">
<map id="amap"/>
<u-tabs :list="tabs" :current="tabIndex" activeStyle="color:#10C176;" lineColor="#10C176" lineWidth="50" :scrollable="false" @change="tabIndex=$event.index"/>
<u-tabs :list="tabs" :current="tabIndex" activeStyle="color:#10C176;" lineColor="#10C176" lineWidth="50" :scrollable="false" @change="plantId='';tabIndex=$event.index"/>
<plant-plan v-if="tabIndex==0" :plotId="plotId" @trigger="tabIndex=$event.tabIndex;plantId=$event.plantId"/>
<farmRecord v-else-if="tabIndex==1" :plotId="plotId"/>
<recovery v-else :plotId="plotId"/>
<swiper :current="tabIndex" @change="tabIndex=$event.detail.current">
<swiper-item>
<plant-plan :plotId="plotId" @trigger="tabIndex=$event.tabIndex;plantId=$event.plantId"/>
</swiper-item>
<swiper-item>
<farmRecord :plotId="plotId"/>
</swiper-item>
<swiper-item>
<recovery :plotId="plotId" :plantId="plantId"/>
</swiper-item>
</swiper>
</view>
</template>
<script>

7
pages/massif/mana/plantPlan.vue

@ -203,9 +203,14 @@ export default {
},
//
toAdd(plantId){
this.$emit("trigger",{tabIndex:2,plantId})
uni.navigateTo({
url:`/pages/massif/plant_info?plantId=${plantId}&plotId=${this.plotId}`,
event:{ toRecovery:()=> {this.$emit("trigger",{tabIndex:2,plantId})} }
event:{ toRecovery:()=>{
// this.$nextTick(()=>{
this.$emit("trigger",{tabIndex:2,plantId})
// })
} }
})
}
}

20
pages/massif/mana/recovery.vue

@ -108,7 +108,11 @@ export default {
plotId:{
type:String,
defaylt:""
}
},
plantId:{
type:String,
default:'',
},
},
data(){
return{
@ -116,7 +120,6 @@ export default {
dateType:"startTime",
host:host(undefined,"/plant_manage/sys/common/static"),
searchVal:{
plantScheduleId:"",// id
pageNo:1,
pageSize:5,
startTime:"",
@ -128,9 +131,17 @@ export default {
},
computed:{
date(){
return new Date().format('yyyy-MM-dd')
return this.searchVal[this.dateType] || new Date().format('yyyy-MM-dd')
}
},
watch:{
plantId(){
this.list=[]
this.total=0
this.searchVal.pageNo=1
this.search()
},
},
created(){
this.search()
},
@ -140,7 +151,8 @@ export default {
var res=await request("/api/plantHarvest/list",{
params:{
...this.searchVal,
plotId:this.plotId
plotId:this.plotId,
plantScheduleId:this.plantId,
}
})
if(res.statu){

2
pages/massif/plant_info.vue

@ -82,7 +82,7 @@ export default {
body: this.formData
})
if(res.statu){
this.eventChannel('toRecovery')
this.eventChannel.emit('toRecovery')
uni.navigateBack()
}else{
uni.showModal({

139
pages/purchase/index.vue

@ -1,139 +0,0 @@
<style lang="scss">
.container{
min-height: 100%;
background:#f6f6f6;
// padding:30rpx 0;
scroll-view{
flex-grow: 1;
height:1rpx;
border:1rpx solid transparent;
.card{
margin-top:0;
&>.info{
display:flex;
align-items: center;
margin-bottom:20rpx;
text{
&:first-child{
font-size:20rpx;
color:#fff;
background:#10C176;
border-radius: 0 20rpx 0 20rpx;
height:40rpx;
width:80rpx;
line-height: 40rpx;
text-align: center;
margin-right:16rpx;
}
&:nth-child(2){
font-weight: bold;
}
&:nth-child(3){
color:#999;
font-size: 20rpx;
margin-left:6rpx;
}
}
}
&>.name{
text{
&:first-child{
color:#FBA83C;
}
&:nth-child(2){
color:#999;
margin-left:22rpx;
}
}
}
&>.data{
display:flex;
align-items: center;
justify-content: space-between;
border-top:2rpx solid #D8D8D8;
margin-top:20rpx;
padding-top:16rpx;
text{
&:first-child{
color:#999;
font-size:24rpx;
}
&:nth-child(2){
font-weight: bold;
&:after{
content:"("attr(data-unit)")";
font-weight: normal;
margin-left:5rpx;
}
}
}
}
}
}
}
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.baseName" @search="clean();search()"/>
<scroll-view scroll-y >
<view class="card" v-for="(v,k) in list" :key="k">
<view class="info">
<text>化肥</text> <text>中量元素水溶肥</text> <text>(100kg/)</text>
</view>
<view class="name">
<text>微量元素肥</text> <text>云南云天化股份有限公司</text>
</view>
<view class="data">
<text>采购时间{{v.applicantTime}}</text> <text data-unit="共200kg">2</text>
</view>
</view>
<u-empty v-if="list.length==0" icon="http://cdn.uviewui.com/uview/empty/data.png"/>
</scroll-view>
</view>
</template>
<script>
import request from '@/common/request'
export default {
data(){
return{
searchVal:{
pageNo:1,
pageSize:5,
companyId: this.$store.getters['userInfo'].companyId
},
list:[],
total:0,
}
},
onLoad(){
this.search()
},
methods:{
clean(){
this.list=[]
this.total=0
this.searchVal.pageNo=1
},
async search(){
if(this.total==0||this.list.length<this.total){
var res=await request("/api/purchase/purchaseList",{
methods:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.records)
this.total=res.data.total
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取采购列表失败!",
showCancel:false,
})
}
}
},
}
}
</script>

11
router/purchase.js

@ -1,15 +1,4 @@
module.exports=[
{
path:"pages/purchase/index",
style:{
navigationBarTitleText:"采购管理",
navigationBarBackgroundColor:"#10C176",
navigationBarTextStyle:"white",
"app-plus":{
titleNView:true
}
}
},
{
path:"pages/purchase/apply",
style:{

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

@ -154,29 +154,29 @@
</u-input>
<button v-if="btnText" @click="btnFun" class="cu-btn bg-green shadow">{{btnText}}</button>
</view>
<view v-if="type=='select'" class="plant-youbian" :class="{noData: !value[0]}" @click="show=true">{{pickerContent}}</view>
<u-upload v-if="type=='upImg'" :fileList="imgs" previewFullImage multiple :maxCount="num" @delete="delImg" @afterRead="afterRead">
<view v-else-if="type=='select'" class="plant-youbian" :class="{noData: !value[0]}" @click="show=true">{{pickerContent}}</view>
<u-upload v-else-if="type=='upImg'" :fileList="imgs" previewFullImage multiple :maxCount="num" @delete="delImg" @afterRead="afterRead">
<view class="album">
<text class="plant-paizhao">添加照片</text>
</view>
</u-upload>
<textarea v-if="type=='textarea'" auto-height :value="value" :placeholder="placeholder||`请输入${label}`" @input="$emit('input',$event.detail.value)"/>
<view v-if="type=='dateRange'" class="dateRange">
<textarea v-else-if="type=='textarea'" auto-height :value="value" :placeholder="placeholder||`请输入${label}`" @input="$emit('input',$event.detail.value)"/>
<view v-else-if="type=='dateRange'" class="dateRange">
<text style="margin-right:20rpx;" :class="{noData:!value[0]}" @click="dateType='start';show=true">{{value[0]||startPlaceholder||'开始时间'}}</text>
-
<text style="margin-left:20rpx;" :class="{noData:!value[1]}" @click="dateType='end';show=true">{{value[1]||endPlaceholder||'结束时间'}}</text>
</view>
<view v-if="type=='radio'" class="radio">
<view v-else-if="type=='radio'" class="radio">
<u-radio-group :value="value" shape="square" @change="$emit('input',$event)" activeColor="#D9F6E9" iconColor="#10C176">
<u-radio :customStyle="{marginRight: '30rpx'}" v-for="(v, k) in columns" :key="k" :label="v.label" :name="v.value"/>
</u-radio-group>
</view>
<view v-if="type=='checkBox'" class="checkBox">
<view v-else-if="type=='checkBox'" class="checkBox">
<u-checkbox-group :value="[]" @change="$emit('select',$event)" >
<u-checkbox :customStyle="{marginRight: '30rpx'}" v-for="(v, k) in columns" :key="k" activeColor="#D9F6E9" iconColor="#10C176" :label="v.label" :name="v.value" />
</u-checkbox-group>
</view>
<view v-if="type=='calendar'" class="calendar" @click="$refs.calendar.open()" :class="{noData:!value}">{{value||placeholder||`请选择${label}`}} <text class="plant-rili"/></view>
<view v-else-if="type=='calendar'" class="calendar" @click="$refs.calendar.open()" :class="{noData:!value}">{{value||placeholder||`请选择${label}`}} <text class="plant-rili"/></view>
<view class="tip" v-if="tip">{{tip}}</view>
</u-form-item>
@ -323,7 +323,7 @@ import {dataType} from 'black-knight/lib/config/tools'
},
pickerContent(){//
if(this.type=='select'){
return setPickerVal(this.columns[0], this.value).findLast(v=>v)?.label||`请选择${this.label}`
return setPickerVal(this.columns[0], this.value).filter(v=>v).at(-1)?.label||`请选择${this.label}`
}
return ''
},
@ -340,9 +340,6 @@ import {dataType} from 'black-knight/lib/config/tools'
setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1)
})
}
if(this.type=='select'){
window.the=this
}
},
methods:{
async afterRead(e){

Loading…
Cancel
Save