灌溉方式修改
This commit is contained in:
parent
aabd2430d2
commit
c3ab1b77cd
|
@ -13,7 +13,11 @@
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
<view class="">
|
|
||||||
|
<view class="" v-if="info.kindarea">
|
||||||
|
当前种植: {{info.kindarea}}亩
|
||||||
|
</view>
|
||||||
|
<view class="" v-else>
|
||||||
当前种植: {{info.total_area-info.residual_area}}亩
|
当前种植: {{info.total_area-info.residual_area}}亩
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="">
|
<!-- <view class="">
|
||||||
|
|
|
@ -80,9 +80,13 @@
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<view>
|
<view>
|
||||||
<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"
|
||||||
|
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
||||||
|
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
||||||
|
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -120,11 +124,16 @@
|
||||||
const calendar1 = ref(null)
|
const calendar1 = ref(null)
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
const task_id = ref('');
|
const task_id = ref('');
|
||||||
|
const value1 = ref(Date.now());
|
||||||
|
const show1 = ref(false);
|
||||||
|
const show2 = ref(false);
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
calendar.value.open()
|
// calendar.value.open()
|
||||||
|
show1.value = true
|
||||||
}
|
}
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
calendar1.value.open()
|
// calendar1.value.open()
|
||||||
|
show2.value = true
|
||||||
}
|
}
|
||||||
// console.log()
|
// console.log()
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
@ -136,14 +145,26 @@
|
||||||
end_date: "",
|
end_date: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const formatter = (type, value) => {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
//获取时间
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
console.log(e)
|
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.start_date = e.fulldate
|
show1.value = false
|
||||||
}
|
}
|
||||||
const dateConfirmfn1 = (e) => {
|
const dateConfirmfn1 = (e) => {
|
||||||
console.log(e)
|
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.end_date = e.fulldate
|
show2.value = false
|
||||||
}
|
}
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
'kind': {
|
'kind': {
|
||||||
|
@ -288,9 +309,13 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,22 +18,22 @@
|
||||||
|
|
||||||
<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"
|
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
|
||||||
v-model="formData.start_date" style="pointer-events: none;"></up-input>
|
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"
|
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
|
||||||
v-model="formData.end_date" style="pointer-events: none;"></up-input>
|
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"
|
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
|
||||||
v-model="formData.start_date" style="pointer-events: none;"></up-input>
|
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"
|
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
|
||||||
v-model="formData.end_date" style="pointer-events: none;"></up-input>
|
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>
|
||||||
|
@ -57,7 +57,8 @@
|
||||||
<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;" @click="delimg(i)"
|
||||||
v-show="mode=='add'"></u-icon>
|
v-show="mode=='add'"></u-icon>
|
||||||
<u-image :src="item" width="150.85rpx" height="150.85rpx" @click="perviewFn(item)"></u-image>
|
<u-image :src="item" width="150.85rpx" height="150.85rpx"
|
||||||
|
@click="perviewFn(item)"></u-image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -82,9 +83,14 @@
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<view>
|
<view>
|
||||||
<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"
|
||||||
|
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
||||||
|
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
||||||
|
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -122,11 +128,16 @@
|
||||||
const calendar1 = ref(null)
|
const calendar1 = ref(null)
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
const task_id = ref('');
|
const task_id = ref('');
|
||||||
|
const value1 = ref(Date.now());
|
||||||
|
const show1 = ref(false);
|
||||||
|
const show2 = ref(false);
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
calendar.value.open()
|
// calendar.value.open()
|
||||||
|
show1.value = true
|
||||||
}
|
}
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
calendar1.value.open()
|
// calendar1.value.open()
|
||||||
|
show2.value = true
|
||||||
}
|
}
|
||||||
// console.log()
|
// console.log()
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
@ -140,12 +151,12 @@
|
||||||
|
|
||||||
|
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
|
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.start_date = e.fulldate
|
show1.value = false
|
||||||
}
|
}
|
||||||
const dateConfirmfn1 = (e) => {
|
const dateConfirmfn1 = (e) => {
|
||||||
|
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.end_date = e.fulldate
|
show2.value = false
|
||||||
}
|
}
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
'kind': {
|
'kind': {
|
||||||
|
@ -201,6 +212,18 @@
|
||||||
form.value.setRules(rules);
|
form.value.setRules(rules);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
const formatter = (type, value) => {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
//图片上传
|
//图片上传
|
||||||
const updateImgFn = async () => {
|
const updateImgFn = async () => {
|
||||||
|
|
||||||
|
@ -246,12 +269,9 @@
|
||||||
|
|
||||||
const addFn = () => {
|
const addFn = () => {
|
||||||
form.value.validate().then(res => {
|
form.value.validate().then(res => {
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
|
|
||||||
let data1 = {
|
let data1 = {
|
||||||
|
@ -292,9 +312,13 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//查看图片
|
//查看图片
|
||||||
const perviewFn = (url) => {
|
const perviewFn = (url) => {
|
||||||
|
|
|
@ -154,9 +154,13 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//查看图片
|
//查看图片
|
||||||
const perviewFn = (url) => {
|
const perviewFn = (url) => {
|
||||||
|
|
|
@ -75,9 +75,13 @@
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<view>
|
<view>
|
||||||
<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"
|
||||||
|
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
||||||
|
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
||||||
|
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
||||||
<u-action-sheet :show="showgg" :actions="range" title="请选择灌溉方式" @close="showgg = false"
|
<u-action-sheet :show="showgg" :actions="range" title="请选择灌溉方式" @close="showgg = false"
|
||||||
@select="ggSelect">
|
@select="ggSelect">
|
||||||
</u-action-sheet>
|
</u-action-sheet>
|
||||||
|
@ -116,15 +120,15 @@
|
||||||
addaction
|
addaction
|
||||||
} from '@/api/api.js'
|
} from '@/api/api.js'
|
||||||
const range = reactive([{
|
const range = reactive([{
|
||||||
value: 0,
|
value: 1,
|
||||||
name: "喷灌"
|
name: "喷灌"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 1,
|
value: 2,
|
||||||
name: "滴灌"
|
name: "滴灌"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 2,
|
value: 3,
|
||||||
name: "沟灌"
|
name: "沟灌"
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
@ -135,12 +139,29 @@
|
||||||
const formDatatype = ref('')
|
const formDatatype = ref('')
|
||||||
const showgg = ref(false)
|
const showgg = ref(false)
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
|
const value1 = ref(Date.now());
|
||||||
|
const show1 = ref(false);
|
||||||
|
const show2 = ref(false);
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
calendar.value.open()
|
// calendar.value.open()
|
||||||
|
show1.value = true
|
||||||
}
|
}
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
calendar1.value.open()
|
// calendar1.value.open()
|
||||||
|
show2.value = true
|
||||||
}
|
}
|
||||||
|
const formatter = (type, value) => {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
// console.log()
|
// console.log()
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
|
@ -162,11 +183,12 @@
|
||||||
|
|
||||||
//获取时间
|
//获取时间
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
formData.start_date = e.fulldate
|
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
|
show1.value = false
|
||||||
}
|
}
|
||||||
const dateConfirmfn1 = (e) => {
|
const dateConfirmfn1 = (e) => {
|
||||||
|
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.end_date = e.fulldate
|
show2.value = false
|
||||||
}
|
}
|
||||||
const rules = {
|
const rules = {
|
||||||
'type': {
|
'type': {
|
||||||
|
@ -216,9 +238,8 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const addFn = () => {
|
const addFn = () => {
|
||||||
console.log(formData)
|
// console.log(formData)
|
||||||
form.value.validate().then(res => {
|
form.value.validate().then(res => {
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
formData.pic = pic
|
formData.pic = pic
|
||||||
let data1 = {
|
let data1 = {
|
||||||
|
@ -256,7 +277,9 @@
|
||||||
})
|
})
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
v-model="data.formData.breed"></up-input>
|
v-model="data.formData.breed"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="开始日期" prop="date" borderBottom required @click="openDate">
|
<u-form-item label="开始日期" prop="date" borderBottom required @click="openDate">
|
||||||
<up-input placeholder="请选择日期" readonly border="surround"
|
<up-input placeholder="请选择日期" readonly border="surround" v-model="data.formData.date"
|
||||||
v-model="data.formData.date" style="pointer-events: none;"></up-input>
|
style="pointer-events: none;"></up-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item label="种植面积" prop="area" borderBottom required>
|
<u-form-item label="种植面积" prop="area" borderBottom required>
|
||||||
|
@ -33,9 +33,10 @@
|
||||||
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;"
|
<u-icon name="close" size="15" style="margin-left:120.85rpx;" @click="delimg(i)"
|
||||||
@click="delimg(i)" v-show="mode=='add'"></u-icon>
|
v-show="mode=='add'"></u-icon>
|
||||||
<u-image :src="item" width="150.85rpx" height="150.85rpx" @click="perviewFn(item)"></u-image>
|
<u-image :src="item" width="150.85rpx" height="150.85rpx"
|
||||||
|
@click="perviewFn(item)"></u-image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -54,14 +55,17 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form-item label="备注" borderBottom >
|
<u-form-item label="备注" borderBottom>
|
||||||
<u--textarea v-model="data.formData.remark" :disabled="mode=='detail'"
|
<u--textarea v-model="data.formData.remark" :disabled="mode=='detail'"
|
||||||
placeholder="请输入内容"></u--textarea>
|
placeholder="请输入内容"></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
</u-form>
|
</u-form>
|
||||||
<view>
|
<view>
|
||||||
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
|
<!-- <uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" /> -->
|
||||||
|
<u-datetime-picker :show="show" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
|
||||||
|
:formatter="formatter" @cancel="show=false"></u-datetime-picker>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -101,6 +105,8 @@
|
||||||
const form1 = ref(null);
|
const form1 = ref(null);
|
||||||
const task_id = ref('');
|
const task_id = ref('');
|
||||||
const pic = reactive([]);
|
const pic = reactive([]);
|
||||||
|
const value1 = ref(Date.now());
|
||||||
|
const show = ref(false);
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
formData: {
|
formData: {
|
||||||
|
|
||||||
|
@ -154,16 +160,25 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
calendar.value.open()
|
// calendar.value.open()
|
||||||
|
show.value = true
|
||||||
}
|
}
|
||||||
|
const formatter = (type, value) => {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
|
data.formData.date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
data.formData.date = e.fulldate
|
show.value = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//图片删除
|
//图片删除
|
||||||
|
@ -205,7 +220,7 @@
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
|
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta:1
|
delta: 1
|
||||||
})
|
})
|
||||||
uni.$u.toast(res.msg)
|
uni.$u.toast(res.msg)
|
||||||
}
|
}
|
||||||
|
@ -229,7 +244,7 @@
|
||||||
// console.log()
|
// console.log()
|
||||||
|
|
||||||
}
|
}
|
||||||
//图片上传
|
//图片上传
|
||||||
const updateImgFn = async () => {
|
const updateImgFn = async () => {
|
||||||
|
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
|
|
|
@ -81,9 +81,13 @@
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<view>
|
<view>
|
||||||
<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"
|
||||||
|
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
|
||||||
|
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
|
||||||
|
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -121,12 +125,29 @@
|
||||||
const calendar1 = ref(null)
|
const calendar1 = ref(null)
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
const task_id = ref('');
|
const task_id = ref('');
|
||||||
|
const value1 = ref(Date.now());
|
||||||
|
const show1 = ref(false);
|
||||||
|
const show2 = ref(false);
|
||||||
const openDate = () => {
|
const openDate = () => {
|
||||||
calendar.value.open()
|
// calendar.value.open()
|
||||||
|
show1.value = true
|
||||||
}
|
}
|
||||||
const openDate1 = () => {
|
const openDate1 = () => {
|
||||||
calendar1.value.open()
|
// calendar1.value.open()
|
||||||
|
show2.value = true
|
||||||
}
|
}
|
||||||
|
const formatter = (type, value) => {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
// console.log()
|
// console.log()
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
kind: "",
|
kind: "",
|
||||||
|
@ -138,13 +159,14 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//获取时间
|
||||||
const dateConfirmfn = (e) => {
|
const dateConfirmfn = (e) => {
|
||||||
console.log(e)
|
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.start_date = e.fulldate
|
show1.value = false
|
||||||
}
|
}
|
||||||
const dateConfirmfn1 = (e) => {
|
const dateConfirmfn1 = (e) => {
|
||||||
console.log(e)
|
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
|
||||||
formData.end_date = e.fulldate
|
show2.value = false
|
||||||
}
|
}
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
'kind': {
|
'kind': {
|
||||||
|
@ -293,9 +315,13 @@
|
||||||
// uni.$u.toast('校验成功')
|
// uni.$u.toast('校验成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}).catch((err)=>{
|
||||||
|
uni.$u.toast(err[0].message)
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,18 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
<view class="detaila">
|
<view class="detaila">
|
||||||
生产地址:
|
种植日期:
|
||||||
</view>
|
</view>
|
||||||
<view class="detailb">
|
<view class="detailb">
|
||||||
{{dataobj.land_address}}
|
{{dataobj.plant_date}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail">
|
||||||
|
<view class="detaila">
|
||||||
|
收获日期:
|
||||||
|
</view>
|
||||||
|
<view class="detailb">
|
||||||
|
{{dataobj.harvest_date}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
|
@ -34,9 +42,28 @@
|
||||||
<!-- {{dataobj.plant_date}} -->
|
<!-- {{dataobj.plant_date}} -->
|
||||||
<!-- {{dataobj.actions[dataobj.actions.length-1].create_time.split(' ')[0]}} -->
|
<!-- {{dataobj.actions[dataobj.actions.length-1].create_time.split(' ')[0]}} -->
|
||||||
|
|
||||||
{{ daysDiff }}天
|
{{ dataobj.group_day }}天
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="detail">
|
||||||
|
<view class="detaila">
|
||||||
|
负责人:
|
||||||
|
</view>
|
||||||
|
<view class="detailb">
|
||||||
|
<!-- {{dataobj.plant_date}} -->
|
||||||
|
<!-- {{dataobj.actions[dataobj.actions.length-1].create_time.split(' ')[0]}} -->
|
||||||
|
{{ dataobj.user}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail">
|
||||||
|
<view class="detaila">
|
||||||
|
生产地址:
|
||||||
|
</view>
|
||||||
|
<view class="detailb">
|
||||||
|
{{dataobj.land_address}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -87,7 +114,7 @@
|
||||||
灌溉方式:
|
灌溉方式:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.detail.type==0?"喷灌":item.detail.type==1?"滴灌":"沟灌"}}
|
{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="action-detail">
|
<view class="action-detail">
|
||||||
|
@ -121,7 +148,7 @@
|
||||||
收获时间:
|
收获时间:
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">
|
<view class="detail">
|
||||||
{{item.create_time}}
|
{{dataobj.harvest_date}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -176,7 +203,7 @@
|
||||||
//获取详情
|
//获取详情
|
||||||
const getlist1 = (id) => {
|
const getlist1 = (id) => {
|
||||||
suYuan({
|
suYuan({
|
||||||
plant_id: 5
|
plant_id:id
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="item.detail.type&&item.detail.type==1">
|
<view class="" v-if="item.detail.type&&item.detail.type==1">
|
||||||
{{item.type_text.slice(0, -2)}}方式:{{item.detail.type==0?"喷灌":item.detail.type==1?"滴灌":"沟灌"}}
|
{{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}}
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
getlist2();
|
getlist2();
|
||||||
|
|
||||||
})
|
})
|
||||||
const getlist1 = (id, a, b) => {
|
const getlist1 = (id, a, b,c) => {
|
||||||
landdetail({
|
landdetail({
|
||||||
land_id: id
|
land_id: id
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
@ -200,6 +200,7 @@
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
res.data.kind = a
|
res.data.kind = a
|
||||||
res.data.datapic = b
|
res.data.datapic = b
|
||||||
|
res.data.kindarea= c
|
||||||
Object.assign(dataobj, res.data);
|
Object.assign(dataobj, res.data);
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +212,7 @@
|
||||||
plant_id: typeID.value
|
plant_id: typeID.value
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
getlist1(res.data.land_id, res.data.kind, res.data.pic)
|
getlist1(res.data.land_id, res.data.kind, res.data.pic,res.data.area)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue