灌溉方式修改

This commit is contained in:
jia 2023-12-02 18:37:08 +08:00
parent aabd2430d2
commit c3ab1b77cd
9 changed files with 241 additions and 92 deletions

View File

@ -13,7 +13,11 @@
</view> -->
</view>
<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}}
</view>
<!-- <view class="">

View File

@ -80,9 +80,13 @@
</u--form>
<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"
@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>
@ -120,11 +124,16 @@
const calendar1 = ref(null)
const form = ref(null)
const task_id = ref('');
const value1 = ref(Date.now());
const show1 = ref(false);
const show2 = ref(false);
const openDate = () => {
calendar.value.open()
// calendar.value.open()
show1.value = true
}
const openDate1 = () => {
calendar1.value.open()
// calendar1.value.open()
show2.value = true
}
// console.log()
const formData = reactive({
@ -136,14 +145,26 @@
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) => {
console.log(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) => {
console.log(e)
formData.end_date = e.fulldate
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
show2.value = false
}
const rules = ref({
'kind': {
@ -288,9 +309,13 @@
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
console.log(err)
})
}

View File

@ -18,22 +18,22 @@
<view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="作业面积" prop="area" borderBottom required>
@ -57,7 +57,8 @@
<view class="">
<u-icon name="close" size="15" style="margin-left:120.85rpx;" @click="delimg(i)"
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>
@ -82,9 +83,14 @@
</u--form>
<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"
@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>
@ -122,11 +128,16 @@
const calendar1 = ref(null)
const form = ref(null)
const task_id = ref('');
const value1 = ref(Date.now());
const show1 = ref(false);
const show2 = ref(false);
const openDate = () => {
calendar.value.open()
// calendar.value.open()
show1.value = true
}
const openDate1 = () => {
calendar1.value.open()
// calendar1.value.open()
show2.value = true
}
// console.log()
const formData = reactive({
@ -140,12 +151,12 @@
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) => {
formData.end_date = e.fulldate
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
show2.value = false
}
const rules = ref({
'kind': {
@ -201,6 +212,18 @@
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 () => {
@ -246,12 +269,9 @@
const addFn = () => {
form.value.validate().then(res => {
console.log(res)
// console.log(res)
if (res) {
formData.pic = pic
let data1 = {
@ -292,9 +312,13 @@
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
console.log(err)
})
}
//
const perviewFn = (url) => {

View File

@ -154,9 +154,13 @@
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
console.log(err)
})
}
//
const perviewFn = (url) => {

View File

@ -75,9 +75,13 @@
</u--form>
<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"
@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"
@select="ggSelect">
</u-action-sheet>
@ -116,15 +120,15 @@
addaction
} from '@/api/api.js'
const range = reactive([{
value: 0,
value: 1,
name: "喷灌"
},
{
value: 1,
value: 2,
name: "滴灌"
},
{
value: 2,
value: 3,
name: "沟灌"
},
])
@ -135,12 +139,29 @@
const formDatatype = ref('')
const showgg = ref(false)
const form = ref(null)
const value1 = ref(Date.now());
const show1 = ref(false);
const show2 = ref(false);
const openDate = () => {
calendar.value.open()
// calendar.value.open()
show1.value = true
}
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()
const formData = reactive({
type: "",
@ -162,11 +183,12 @@
//
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) => {
formData.end_date = e.fulldate
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
show2.value = false
}
const rules = {
'type': {
@ -216,9 +238,8 @@
})
}
const addFn = () => {
console.log(formData)
// console.log(formData)
form.value.validate().then(res => {
if (res) {
formData.pic = pic
let data1 = {
@ -256,7 +277,9 @@
})
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
console.log(err)
})

View File

@ -12,8 +12,8 @@
v-model="data.formData.breed"></up-input>
</u-form-item>
<u-form-item label="开始日期" prop="date" borderBottom required @click="openDate">
<up-input placeholder="请选择日期" readonly border="surround"
v-model="data.formData.date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="data.formData.date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="种植面积" prop="area" borderBottom required>
@ -33,9 +33,10 @@
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="">
<u-icon name="close" size="15" style="margin-left:120.85rpx;"
@click="delimg(i)" v-show="mode=='add'"></u-icon>
<u-image :src="item" width="150.85rpx" height="150.85rpx" @click="perviewFn(item)"></u-image>
<u-icon name="close" size="15" style="margin-left:120.85rpx;" @click="delimg(i)"
v-show="mode=='add'"></u-icon>
<u-image :src="item" width="150.85rpx" height="150.85rpx"
@click="perviewFn(item)"></u-image>
</view>
</view>
</view>
@ -61,7 +62,10 @@
</u-form>
<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>
@ -101,6 +105,8 @@
const form1 = ref(null);
const task_id = ref('');
const pic = reactive([]);
const value1 = ref(Date.now());
const show = ref(false);
const data = reactive({
formData: {
@ -154,16 +160,25 @@
});
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) => {
data.formData.date = e.fulldate
data.formData.date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
show.value = false
}
//

View File

@ -81,9 +81,13 @@
</u--form>
<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"
@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>
@ -121,12 +125,29 @@
const calendar1 = ref(null)
const form = ref(null)
const task_id = ref('');
const value1 = ref(Date.now());
const show1 = ref(false);
const show2 = ref(false);
const openDate = () => {
calendar.value.open()
// calendar.value.open()
show1.value = true
}
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()
const formData = reactive({
kind: "",
@ -138,13 +159,14 @@
})
//
const dateConfirmfn = (e) => {
console.log(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) => {
console.log(e)
formData.end_date = e.fulldate
formData.end_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
show2.value = false
}
const rules = ref({
'kind': {
@ -293,9 +315,13 @@
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
console.log(err)
})
}

View File

@ -20,10 +20,18 @@
</view>
<view class="detail">
<view class="detaila">
生产地址
种植日期
</view>
<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 class="detail">
@ -34,9 +42,28 @@
<!-- {{dataobj.plant_date}} -->
<!-- {{dataobj.actions[dataobj.actions.length-1].create_time.split(' ')[0]}} -->
{{ daysDiff }}
{{ dataobj.group_day }}
</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>
@ -87,7 +114,7 @@
灌溉方式
</view>
<view class="detail">
{{item.detail.type==0?"喷灌":item.detail.type==1?"滴灌":"沟灌"}}
{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
</view>
</view>
<view class="action-detail">
@ -121,7 +148,7 @@
收获时间
</view>
<view class="detail">
{{item.create_time}}
{{dataobj.harvest_date}}
</view>
</view>
@ -176,7 +203,7 @@
//
const getlist1 = (id) => {
suYuan({
plant_id: 5
plant_id:id
}).then((res) => {
if (res.code == 1) {

View File

@ -62,7 +62,7 @@
</view>
</view>
<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 class="">
参与人员: {{item.detail.user}}
@ -192,7 +192,7 @@
getlist2();
})
const getlist1 = (id, a, b) => {
const getlist1 = (id, a, b,c) => {
landdetail({
land_id: id
}).then((res) => {
@ -200,6 +200,7 @@
if (res.code == 1) {
res.data.kind = a
res.data.datapic = b
res.data.kindarea= c
Object.assign(dataobj, res.data);
@ -211,7 +212,7 @@
plant_id: typeID.value
}).then((res) => {
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)
}
});
};