Compare commits
No commits in common. "4a4986d35e1f9f80d78507c7c130cc09e2494203" and "be68268fb50f231da30891b34812adab1536992c" have entirely different histories.
4a4986d35e
...
be68268fb5
|
@ -16,7 +16,7 @@
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
|
|
||||||
<view class="" v-if="info.kindarea">
|
<view class="" v-if="info.kindarea">
|
||||||
当前种植: {{info.kindarea}}亩
|
当前种植: {{info.kindarea}}亩
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-else>
|
<view class="" v-else>
|
||||||
当前种植: {{info.total_area-info.residual_area}}亩
|
当前种植: {{info.total_area-info.residual_area}}亩
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
<view class="">
|
<view class="">
|
||||||
联系方式: {{info.master_phone}}
|
土地负责人: {{info.master_phone}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -41,9 +41,7 @@
|
||||||
v-model="data.formData.master_phone"></up-input>
|
v-model="data.formData.master_phone"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
|
|
||||||
<view class="card-li-tit">
|
<view class="card-li-tit">
|
||||||
<span>*</span>
|
|
||||||
土地图片
|
土地图片
|
||||||
</view>
|
</view>
|
||||||
<view class="code-img1">
|
<view class="code-img1">
|
||||||
|
@ -433,19 +431,9 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.card-li-tit {
|
.card-li-tit {
|
||||||
position: relative;
|
|
||||||
|
|
||||||
span {
|
|
||||||
position: absolute;
|
|
||||||
left: -9px;
|
|
||||||
color: #f56c6c;
|
|
||||||
line-height: 20px;
|
|
||||||
font-size: 20px;
|
|
||||||
top: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confim-btn {
|
.confim-btn {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 196.26rpx;
|
width: 196.26rpx;
|
||||||
|
|
|
@ -3,37 +3,37 @@
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<u--form labelPosition="top" labelWidth='130' :model="formData" :rules="rules" ref="form">
|
<u--form labelPosition="top" labelWidth='130' :model="formData" :rules="rules" ref="form">
|
||||||
<u-form-item label="除虫剂种类" prop="kind" borderBottom ref='item1' required>
|
<u-form-item label="杀虫剂种类" prop="kind" borderBottom ref='item1' required>
|
||||||
<up-input placeholder="请输入除虫剂种类" :disabled="mode=='detail'" border="surround"
|
<up-input placeholder="请输入杀虫剂种类" :disabled="mode=='detail'" border="surround"
|
||||||
v-model="formData.kind"></up-input>
|
v-model="formData.kind"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="除虫剂品牌" prop="breed" borderBottom required>
|
<u-form-item label="杀虫剂品牌" prop="breed" borderBottom required>
|
||||||
<up-input placeholder="请输入除虫剂品牌" :disabled="mode=='detail'" border="surround"
|
<up-input placeholder="请输入杀虫剂品牌" :disabled="mode=='detail'" border="surround"
|
||||||
v-model="formData.breed"></up-input>
|
v-model="formData.breed"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="除虫剂用量(升)" prop="dosage" borderBottom required>
|
<u-form-item label="杀虫剂用量(升)" prop="dosage" borderBottom required>
|
||||||
<up-input placeholder="请输入除虫剂用量" type='number' border="surround" :disabled="mode=='detail'"
|
<up-input placeholder="请输入杀虫剂用量" type='number' border="surround" :disabled="mode=='detail'"
|
||||||
v-model="formData.dosage"></up-input>
|
v-model="formData.dosage"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<view class="" v-if="mode=='add'">
|
<view class="" v-if="mode=='add'">
|
||||||
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
|
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
|
||||||
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
|
<up-input placeholder="请选择日期" readonly border="surround"
|
||||||
style="pointer-events: none;"></up-input>
|
v-model="formData.start_date" style="pointer-events: none;"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
|
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
|
||||||
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
|
<up-input placeholder="请选择日期" readonly border="surround"
|
||||||
style="pointer-events: none;"></up-input>
|
v-model="formData.end_date" style="pointer-events: none;"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-else>
|
<view class="" v-else>
|
||||||
<u-form-item label="开始日期" prop="start_date" borderBottom required>
|
<u-form-item label="开始日期" prop="start_date" borderBottom required>
|
||||||
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
|
<up-input placeholder="请选择日期" readonly border="surround"
|
||||||
style="pointer-events: none;"></up-input>
|
v-model="formData.start_date" style="pointer-events: none;"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="结束日期" prop="end_date" borderBottom required>
|
<u-form-item label="结束日期" prop="end_date" borderBottom required>
|
||||||
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
|
<up-input placeholder="请选择日期" readonly border="surround"
|
||||||
style="pointer-events: none;"></up-input>
|
v-model="formData.end_date" style="pointer-events: none;"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
<u-form-item label="作业面积(亩)" prop="area" borderBottom required>
|
<u-form-item label="作业面积(亩)" prop="area" borderBottom required>
|
||||||
|
@ -41,23 +41,22 @@
|
||||||
v-model="formData.area"></up-input>
|
v-model="formData.area"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="参与人" prop="user" borderBottom required>
|
<u-form-item label="参与人" prop="user" borderBottom required>
|
||||||
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="txt" border="surround"
|
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="txt" border="surround"
|
||||||
v-model="formData.user"></up-input>
|
v-model="formData.user"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
<view class="card-li-tit">
|
<view class="card-li-tit">
|
||||||
<span>*</span>
|
<span>*</span>
|
||||||
除虫图片
|
杀虫图片
|
||||||
</view>
|
</view>
|
||||||
<view class="code-img1">
|
<view class="code-img1">
|
||||||
<view class="" v-if="pic.length>0"
|
<view class="" v-if="pic.length>0"
|
||||||
style="display: flex;flex-direction: row;flex-wrap: wrap;margin-bottom: 30rpx;">
|
style="display: flex;flex-direction: row;flex-wrap: wrap;margin-bottom: 30rpx;">
|
||||||
<view class="" v-for="(item,i) in pic" style="margin-right: 30rpx;">
|
<view class="" v-for="(item,i) in pic" style="margin-right: 30rpx;">
|
||||||
<view class="">
|
<view class="">
|
||||||
<u-icon name="close" size="15" style="margin-left:120.85rpx;" @click="delimg(i)"
|
<u-icon name="close" size="15" style="margin-left:120.85rpx;"
|
||||||
v-show="mode=='add'"></u-icon>
|
@click="delimg(i)" v-show="mode=='add'"></u-icon>
|
||||||
<u-image :src="item" width="150.85rpx" height="150.85rpx"
|
<u-image :src="item" width="150.85rpx" height="150.85rpx" @click="perviewFn(item)"></u-image>
|
||||||
@click="perviewFn(item)"></u-image>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -76,7 +75,7 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form-item label="备注" prop="remark" borderBottom>
|
<u-form-item label="备注" prop="remark" borderBottom >
|
||||||
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
|
@ -85,10 +84,10 @@
|
||||||
<!-- <uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
|
<!-- <uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
|
||||||
<uni-calendar ref="calendar1" :showMonth="true" :lunar="true" :insert="false"
|
<uni-calendar ref="calendar1" :showMonth="true" :lunar="true" :insert="false"
|
||||||
@confirm="dateConfirmfn1" /> -->
|
@confirm="dateConfirmfn1" /> -->
|
||||||
<u-datetime-picker :show="show1" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
|
<u-datetime-picker :show="show1" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
|
||||||
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
||||||
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
||||||
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -118,8 +117,7 @@
|
||||||
onReady
|
onReady
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
addaction,
|
addaction
|
||||||
plantdetail
|
|
||||||
} from '@/api/api.js'
|
} from '@/api/api.js'
|
||||||
|
|
||||||
const pic = reactive([]);
|
const pic = reactive([]);
|
||||||
|
@ -134,7 +132,6 @@
|
||||||
// calendar.value.open()
|
// calendar.value.open()
|
||||||
show1.value = true
|
show1.value = true
|
||||||
}
|
}
|
||||||
const dataobj = reactive({})
|
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
// calendar1.value.open()
|
// calendar1.value.open()
|
||||||
show2.value = true
|
show2.value = true
|
||||||
|
@ -149,19 +146,19 @@
|
||||||
end_date: "",
|
end_date: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
const formatter = (type, value) => {
|
const formatter = (type, value) => {
|
||||||
if (type === 'year') {
|
if (type === 'year') {
|
||||||
return `${value}年`;
|
return `${value}年`;
|
||||||
}
|
}
|
||||||
if (type === 'month') {
|
if (type === 'month') {
|
||||||
return `${value}月`;
|
return `${value}月`;
|
||||||
}
|
}
|
||||||
if (type === 'day') {
|
if (type === 'day') {
|
||||||
return `${value}日`;
|
return `${value}日`;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
//获取时间
|
//获取时间
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
show1.value = false
|
show1.value = false
|
||||||
|
@ -174,19 +171,19 @@
|
||||||
'kind': {
|
'kind': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
message: '请填写除虫剂品牌',
|
message: '请填写杀虫剂品牌',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
},
|
},
|
||||||
'breed': {
|
'breed': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
message: '请填写除虫剂品牌',
|
message: '请填写杀虫剂品牌',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
},
|
},
|
||||||
'dosage': {
|
'dosage': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
message: '请填写除虫剂用量',
|
message: '请填写杀虫剂用量',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
},
|
},
|
||||||
'start_date': {
|
'start_date': {
|
||||||
|
@ -284,10 +281,7 @@
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
|
|
||||||
if (formData.area > dataobj.area) {
|
|
||||||
uni.$u.toast('作业面积不能超过种植面积')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
let data1 = {
|
let data1 = {
|
||||||
|
@ -301,28 +295,6 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let endTime = new Date(formData.end_date)
|
|
||||||
let startTime = new Date(formData.start_date)
|
|
||||||
let plantTime = new Date(dataobj.plant_date)
|
|
||||||
|
|
||||||
if (startTime < plantTime) {
|
|
||||||
uni.$u.toast("除虫时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < plantTime) {
|
|
||||||
uni.$u.toast("除虫时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < startTime) {
|
|
||||||
uni.$u.toast("结束时间不能小于开始时间");
|
|
||||||
return
|
|
||||||
} else if (startTime > endTime) {
|
|
||||||
uni.$u.toast("开始时间不能大于结束时间");
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
console.log("开始时间和结束时间合法");
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('表单通过');
|
console.log('表单通过');
|
||||||
|
|
||||||
// 表单验证通过,执行提交操作
|
// 表单验证通过,执行提交操作
|
||||||
|
@ -339,24 +311,15 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err)=>{
|
||||||
uni.$u.toast(err[0].message)
|
uni.$u.toast(err[0].message)
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const getlist = () => {
|
|
||||||
plantdetail({
|
|
||||||
plant_id: task_id.value
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
// console.log(res)
|
|
||||||
Object.assign(dataobj, res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
|
@ -378,7 +341,7 @@
|
||||||
task_id.value = options.id
|
task_id.value = options.id
|
||||||
}
|
}
|
||||||
|
|
||||||
getlist()
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
<view class="shop_action-detail" v-if="item.type!=3&&item.type!=5">
|
<view class="shop_action-detail" v-if="item.type!=3&&item.type!=5">
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class=""
|
{{item.type_text.slice(0, -2)}}品种:
|
||||||
v-if="item.type==2||item.type==4">剂</text>品种:
|
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.kind}}
|
{{item.detail.kind}}
|
||||||
|
@ -19,8 +18,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail" v-if="item.detail.breed">
|
<view class="action-detail" v-if="item.detail.breed">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class=""
|
{{item.type_text.slice(0, -2)}}品牌:
|
||||||
v-if="item.type==2||item.type==4">剂</text>品牌:
|
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.breed}}
|
{{item.detail.breed}}
|
||||||
|
@ -28,8 +26,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class=""
|
{{item.type_text.slice(0, -2)}}用量:
|
||||||
v-if="item.type==2||item.type==4">剂</text>用量:
|
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.dosage}}
|
{{item.detail.dosage}}
|
||||||
|
@ -40,7 +37,7 @@
|
||||||
|
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
参与人:
|
{{item.type_text.slice(0, -2)}}人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
@ -89,13 +86,13 @@
|
||||||
灌溉方式:
|
灌溉方式:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
|
{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
参与人:
|
灌溉人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
@ -139,7 +136,7 @@
|
||||||
|
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title" style="width: 200rpx;">
|
<view class="title" style="width: 200rpx;">
|
||||||
参与人:
|
收获人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
v-model="formData.breed"></up-input>
|
v-model="formData.breed"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="肥料用量(斤)" prop="dosage" borderBottom required>
|
<u-form-item label="肥料用量(斤)" prop="dosage" borderBottom required>
|
||||||
<up-input placeholder="请输入肥料用量" border="surround" type='number' :disabled="mode=='detail'"
|
<up-input placeholder="请输入肥料用量" border="surround" type='number' :disabled="mode=='detail'"
|
||||||
v-model="formData.dosage"></up-input>
|
v-model="formData.dosage"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form-item label="备注" prop="remark" borderBottom>
|
<u-form-item label="备注" prop="remark" borderBottom >
|
||||||
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
|
@ -121,8 +121,7 @@
|
||||||
onReady
|
onReady
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
addaction,
|
addaction
|
||||||
plantdetail
|
|
||||||
} from '@/api/api.js'
|
} from '@/api/api.js'
|
||||||
|
|
||||||
const pic = reactive([]);
|
const pic = reactive([]);
|
||||||
|
@ -133,7 +132,6 @@
|
||||||
const value1 = ref(Date.now());
|
const value1 = ref(Date.now());
|
||||||
const show1 = ref(false);
|
const show1 = ref(false);
|
||||||
const show2 = ref(false);
|
const show2 = ref(false);
|
||||||
const dataobj = reactive({});
|
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
// calendar.value.open()
|
// calendar.value.open()
|
||||||
show1.value = true
|
show1.value = true
|
||||||
|
@ -217,16 +215,16 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
const formatter = (type, value) => {
|
const formatter = (type, value) => {
|
||||||
if (type === 'year') {
|
if (type === 'year') {
|
||||||
return `${value}年`;
|
return `${value}年`;
|
||||||
}
|
}
|
||||||
if (type === 'month') {
|
if (type === 'month') {
|
||||||
return `${value}月`;
|
return `${value}月`;
|
||||||
}
|
}
|
||||||
if (type === 'day') {
|
if (type === 'day') {
|
||||||
return `${value}日`;
|
return `${value}日`;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
//图片上传
|
//图片上传
|
||||||
const updateImgFn = async () => {
|
const updateImgFn = async () => {
|
||||||
|
@ -275,10 +273,7 @@
|
||||||
form.value.validate().then(res => {
|
form.value.validate().then(res => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
if (res) {
|
if (res) {
|
||||||
if (formData.area > dataobj.area) {
|
|
||||||
uni.$u.toast('作业面积不能超过种植面积')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
|
|
||||||
let data1 = {
|
let data1 = {
|
||||||
|
@ -286,7 +281,6 @@
|
||||||
type: 1,
|
type: 1,
|
||||||
detail: JSON.stringify(formData)
|
detail: JSON.stringify(formData)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (formData.pic.length == 0) {
|
if (formData.pic.length == 0) {
|
||||||
|
|
||||||
uni.$u.toast('请上传图片')
|
uni.$u.toast('请上传图片')
|
||||||
|
@ -294,17 +288,6 @@
|
||||||
}
|
}
|
||||||
let endTime = new Date(formData.end_date)
|
let endTime = new Date(formData.end_date)
|
||||||
let startTime = new Date(formData.start_date)
|
let startTime = new Date(formData.start_date)
|
||||||
let plantTime = new Date(dataobj.plant_date)
|
|
||||||
|
|
||||||
console.log(startTime<plantTime,endTime<plantTime)
|
|
||||||
if(startTime<plantTime ){
|
|
||||||
uni.$u.toast("施肥时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(endTime<plantTime){
|
|
||||||
uni.$u.toast("施肥时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < startTime) {
|
if (endTime < startTime) {
|
||||||
uni.$u.toast("结束时间不能小于开始时间");
|
uni.$u.toast("结束时间不能小于开始时间");
|
||||||
return
|
return
|
||||||
|
@ -315,9 +298,6 @@
|
||||||
console.log("开始时间和结束时间合法");
|
console.log("开始时间和结束时间合法");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log('表单通过');
|
console.log('表单通过');
|
||||||
|
|
||||||
// 表单验证通过,执行提交操作
|
// 表单验证通过,执行提交操作
|
||||||
|
@ -334,8 +314,8 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -352,16 +332,7 @@
|
||||||
const delimg = (i) => {
|
const delimg = (i) => {
|
||||||
pic.splice(i, 1);
|
pic.splice(i, 1);
|
||||||
}
|
}
|
||||||
const getlist = () => {
|
|
||||||
plantdetail({
|
|
||||||
plant_id: task_id.value
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
// console.log(res)
|
|
||||||
Object.assign(dataobj, res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
|
@ -384,7 +355,7 @@
|
||||||
task_id.value = options.id
|
task_id.value = options.id
|
||||||
}
|
}
|
||||||
|
|
||||||
getlist()
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -118,8 +118,7 @@
|
||||||
} from "@dcloudio/uni-app"
|
} from "@dcloudio/uni-app"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addaction,
|
addaction
|
||||||
plantdetail
|
|
||||||
} from '@/api/api.js'
|
} from '@/api/api.js'
|
||||||
const range = reactive([{
|
const range = reactive([{
|
||||||
value: 1,
|
value: 1,
|
||||||
|
@ -144,7 +143,6 @@
|
||||||
const value1 = ref(Date.now());
|
const value1 = ref(Date.now());
|
||||||
const show1 = ref(false);
|
const show1 = ref(false);
|
||||||
const show2 = ref(false);
|
const show2 = ref(false);
|
||||||
const dataobj = reactive({})
|
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
// calendar.value.open()
|
// calendar.value.open()
|
||||||
show1.value = true
|
show1.value = true
|
||||||
|
@ -245,10 +243,6 @@
|
||||||
// console.log(formData)
|
// console.log(formData)
|
||||||
form.value.validate().then(res => {
|
form.value.validate().then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
if (formData.area > dataobj.area) {
|
|
||||||
uni.$u.toast('灌溉面积不能超过种植面积')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
let data1 = {
|
let data1 = {
|
||||||
plant_id: task_id.value,
|
plant_id: task_id.value,
|
||||||
|
@ -261,16 +255,6 @@
|
||||||
}
|
}
|
||||||
let endTime = new Date(formData.end_date)
|
let endTime = new Date(formData.end_date)
|
||||||
let startTime = new Date(formData.start_date)
|
let startTime = new Date(formData.start_date)
|
||||||
let plantTime = new Date(dataobj.plant_date)
|
|
||||||
|
|
||||||
if (startTime < plantTime) {
|
|
||||||
uni.$u.toast("灌溉时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < plantTime) {
|
|
||||||
uni.$u.toast("灌溉时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < startTime) {
|
if (endTime < startTime) {
|
||||||
uni.$u.toast("结束时间不能小于开始时间");
|
uni.$u.toast("结束时间不能小于开始时间");
|
||||||
return
|
return
|
||||||
|
@ -347,16 +331,7 @@
|
||||||
// let res = await Uploads()
|
// let res = await Uploads()
|
||||||
// data.formData.pic = res.data.image
|
// data.formData.pic = res.data.image
|
||||||
}
|
}
|
||||||
const getlist = () => {
|
|
||||||
plantdetail({
|
|
||||||
plant_id: task_id.value
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
// console.log(res)
|
|
||||||
Object.assign(dataobj, res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.task) {
|
if (options.task) {
|
||||||
|
@ -376,7 +351,7 @@ const getlist = () => {
|
||||||
task_id.value = options.id
|
task_id.value = options.id
|
||||||
}
|
}
|
||||||
|
|
||||||
getlist()
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form-item label="备注" prop="remark" borderBottom>
|
<u-form-item label="备注" prop="remark" borderBottom >
|
||||||
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
|
@ -119,8 +119,7 @@
|
||||||
onReady
|
onReady
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
addaction,
|
addaction
|
||||||
plantdetail
|
|
||||||
} from '@/api/api.js'
|
} from '@/api/api.js'
|
||||||
|
|
||||||
const pic = reactive([]);
|
const pic = reactive([]);
|
||||||
|
@ -135,7 +134,6 @@
|
||||||
// calendar.value.open()
|
// calendar.value.open()
|
||||||
show1.value = true
|
show1.value = true
|
||||||
}
|
}
|
||||||
const dataobj = reactive({})
|
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
// calendar1.value.open()
|
// calendar1.value.open()
|
||||||
show2.value = true
|
show2.value = true
|
||||||
|
@ -275,13 +273,10 @@
|
||||||
|
|
||||||
const addFn = () => {
|
const addFn = () => {
|
||||||
form.value.validate().then(res => {
|
form.value.validate().then(res => {
|
||||||
// console.log(res)
|
console.log(res)
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
if (formData.area > dataobj.area) {
|
|
||||||
uni.$u.toast('作业面积不能超过种植面积')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
|
@ -297,16 +292,6 @@
|
||||||
}
|
}
|
||||||
let endTime = new Date(formData.end_date)
|
let endTime = new Date(formData.end_date)
|
||||||
let startTime = new Date(formData.start_date)
|
let startTime = new Date(formData.start_date)
|
||||||
let plantTime = new Date(dataobj.plant_date)
|
|
||||||
|
|
||||||
if (startTime < plantTime) {
|
|
||||||
uni.$u.toast("除草时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < plantTime) {
|
|
||||||
uni.$u.toast("除草时间必须超过种植的时间");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (endTime < startTime) {
|
if (endTime < startTime) {
|
||||||
uni.$u.toast("结束时间不能小于开始时间");
|
uni.$u.toast("结束时间不能小于开始时间");
|
||||||
return
|
return
|
||||||
|
@ -341,16 +326,7 @@
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const getlist = () => {
|
|
||||||
plantdetail({
|
|
||||||
plant_id: task_id.value
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
// console.log(res)
|
|
||||||
Object.assign(dataobj, res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
|
@ -372,7 +348,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getlist()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -77,14 +77,9 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="add-thing" v-if="(dataobj.total_area-dataobj.residual_area)==0" @click="palnt(dataobj.id)">
|
|
||||||
新增种植
|
|
||||||
</view>
|
|
||||||
<view class="" v-else>
|
|
||||||
<view class="add-thing" @click="showPicker1=true" v-if="columns2[0]&&columns2[0].length>0">
|
|
||||||
|
|
||||||
记农事
|
<view class="add-thing" @click="showPicker1=true" v-if="columns2[0]&&columns2[0].length>0">
|
||||||
</view>
|
记农事
|
||||||
</view>
|
</view>
|
||||||
<!-- 苗情监测 -->
|
<!-- 苗情监测 -->
|
||||||
<view class="">
|
<view class="">
|
||||||
|
@ -596,12 +591,6 @@
|
||||||
url: '/pages/landDetail/index?id=' + dataobj.id
|
url: '/pages/landDetail/index?id=' + dataobj.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const palnt = (id) => {
|
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/husbandryForm/sow?id=' + id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const navto = (url) => {
|
const navto = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
种植面积: {{item.area}}亩
|
种植面积: {{item.area}}亩
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
参与人: {{item.user}}
|
参与人员: {{item.user}}
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
种植日期: {{item.plant_date}}
|
种植日期: {{item.plant_date}}
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<view class="shop_action-detail" v-if="item.type!=3&&item.type!=5">
|
<view class="shop_action-detail" v-if="item.type!=3&&item.type!=5">
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>品种:
|
{{item.type_text.slice(0, -2)}}品种:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.kind}}
|
{{item.detail.kind}}
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail" v-if="item.detail.breed">
|
<view class="action-detail" v-if="item.detail.breed">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>品牌:
|
{{item.type_text.slice(0, -2)}}品牌:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.breed}}
|
{{item.detail.breed}}
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>用量:
|
{{item.type_text.slice(0, -2)}}用量:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.dosage}}<text v-if='item.type==4'>升</text>
|
{{item.detail.dosage}}<text v-if='item.type==4'>升</text>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
参与人:
|
{{item.type_text.slice(0, -2)}}人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
参与人:
|
灌溉人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
@ -165,7 +165,7 @@
|
||||||
|
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
参与人:
|
收获人:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.user}}
|
{{item.detail.user}}
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="" v-if="item.type==5">
|
<view class="" v-if="item.type==5">
|
||||||
<view class="">
|
<view class="">
|
||||||
参与人: {{item.detail.user}}
|
参与人员: {{item.detail.user}}
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
备注: {{item.detail.remark}}
|
备注: {{item.detail.remark}}
|
||||||
|
@ -48,16 +48,16 @@
|
||||||
<view class="" v-else>
|
<view class="" v-else>
|
||||||
<view class="" v-if="!item.detail.type">
|
<view class="" v-if="!item.detail.type">
|
||||||
<view class="">
|
<view class="">
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>种类: {{item.detail.kind}}
|
{{item.type_text.slice(0, -2)}}种类: {{item.detail.kind}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="">
|
<view class="">
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>品牌: {{item.detail.breed}}
|
{{item.type_text.slice(0, -2)}}品牌: {{item.detail.breed}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="" v-if='item.detail.dosage'>
|
<view class="" v-if='item.detail.dosage'>
|
||||||
{{item.type_text.slice(0, -2)}}<text class="" v-if="item.type==2||item.type==4">剂</text>用量: {{item.detail.dosage}}
|
{{item.type_text.slice(0, -2)}}用量: {{item.detail.dosage}}
|
||||||
|
|
||||||
<text v-if='item.type==4'>升</text>
|
<text v-if='item.type==4'>升</text>
|
||||||
<text v-if='item.type!=4&&item.type!=5'>斤</text>
|
<text v-if='item.type!=4&&item.type!=5'>斤</text>
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
{{item.type_text.slice(0, -2)}}方式: {{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
|
{{item.type_text.slice(0, -2)}}方式: {{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
参与人: {{item.detail.user}}
|
参与人员: {{item.detail.user}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="" v-if="item.detail.start_date">
|
<view class="" v-if="item.detail.start_date">
|
||||||
|
|
Loading…
Reference in New Issue