作者 李康

修改坐标点不重复

... ... @@ -2,10 +2,15 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
"default" :
{
"launchtype" : "remote"
},
"mp-weixin" :
{
"launchtype" : "remote"
},
"type" : "uniCloud"
}
]
}
... ...
... ... @@ -5,66 +5,74 @@
任务性质
</view>
<view class="inp">
<input type="text" v-model="orderParam.renwuxingzhi" placeholder="例:G32高速公路××至××段巡检飞行任务" placeholder-class="inpPh"/>
<input type="text" v-model="orderParam.renwuxingzhi" placeholder="例:G32高速公路××至××段巡检飞行任务"
placeholder-class="inpPh" />
</view>
</view>
<form-wrap @navTo="$href('range')" :title="'临时空域范围'" :alert="'请填写临时空域范围'" :rightType="'img'"></form-wrap>
<form-wrap @navTo="showDate = true" :title="'飞行日期'" :alert="'请选择日期'" :confirmTxt="time_str" :rightType="'img'"></form-wrap>
<form-wrap @navTo="showSTime = true" :title="'飞行时间'" :alert="'开始时间-结束时间'" :rightType="'img'" :confirmTxt="confirmTime"></form-wrap>
<form-wrap @navTo="showOrderNum = true" :confirmTxt="tomParam.order_id" :title="'选择申请编号'" :alert="'请选择申请编号'" :rightType="'img'"></form-wrap>
<!-- <form-wrap @navTo="$href('range')" :title="'临时空域范围'" :alert="'请填写临时空域范围'" :rightType="'img'"></form-wrap> -->
<form-wrap :title="'临时空域范围'"></form-wrap>
<view class="inpRightBox">
<view style="display: flex;padding-bottom: 10px;" @click="onder(1)">
<image class="radioImg" style="width: 38rpx;height: 38rpx;margin: 0 5px;"
:src="insurance_status == 1 ? '../../static/image/ic_circle_1@2x.png' : '../../static/image/ic_checked_1@2x.png'"
mode=""></image>
<text>与主申请的临时空域范围一致</text>
</view>
<view style="display: flex;padding-bottom: 10px;" @click="onder(0)">
<image class="radioImg" style="width: 38rpx;height: 38rpx;margin: 0 5px;"
:src="insurance_status == 0 ? '../../static/image/ic_circle_1@2x.png' : '../../static/image/ic_checked_1@2x.png'"
mode=""></image>
<text>与主申请的临时空域范围不一致,但在主申请的临时空域范围内</text>
</view>
</view>
<form-wrap @navTo="showDate = true" :title="'飞行日期'" :alert="'请选择日期'" :confirmTxt="time_str" :rightType="'img'">
</form-wrap>
<form-wrap @navTo="showSTime = true" :title="'飞行时间'" :alert="'开始时间-结束时间'" :rightType="'img'"
:confirmTxt="confirmTime"></form-wrap>
<form-wrap @navTo="showOrderNum = true" :confirmTxt="tomParam.order_id" :title="'选择申请编号'" :alert="'请选择申请编号'"
:rightType="'img'"></form-wrap>
<bottom-btn :btnList="btnList" @clickBtn="submit"></bottom-btn>
<u-select :default-value="defaultValue" :value-name="'id'" :label-name="'id'" :mode="modeOrderNum" v-model="showOrderNum" :list="orderNumList" @confirm="confirm" @cancel="cancel"></u-select>
<u-picker
:mode="modeDate"
v-model="showDate"
:params="paramsDate"
@confirm="confirmDate"
></u-picker>
<u-picker
:title="'开始时间'"
:mode="modeTime"
v-model="showSTime"
:params="paramsTime"
@confirm="confirmSTime"
></u-picker>
<u-picker
:title="'结束时间'"
:start-year="confirmTimeTxt"
:mode="modeTime"
v-model="showETime"
:params="paramsTime"
@confirm="confirmETime"
></u-picker>
<u-select :default-value="defaultValue" :value-name="'id'" :label-name="'id'" :mode="modeOrderNum"
v-model="showOrderNum" :list="orderNumList" @confirm="confirm" @cancel="cancel"></u-select>
<u-picker :mode="modeDate" v-model="showDate" :params="paramsDate" @confirm="confirmDate"></u-picker>
<u-picker :title="'开始时间'" :mode="modeTime" v-model="showSTime" :params="paramsTime" @confirm="confirmSTime">
</u-picker>
<u-picker :title="'结束时间'" :start-year="confirmTimeTxt" :mode="modeTime" v-model="showETime" :params="paramsTime"
@confirm="confirmETime"></u-picker>
</view>
</template>
<script>
import {mapState} from "vuex"
import {
mapState
} from "vuex"
import formWrap from '@/components/formWrap.vue'
import bottomBtn from '@/components/bottomBtn.vue'
export default{
data(){
return{
time_str:'',
s_time_str:'',
e_time_str:'',
tomParam:{
order_renwuxingzhi:'',
lsky_city:'',
lsky_city_text:'',
lsky_xy:'',
lsky_zcfs:'',
order_id:'',
time:'',
s_time:'',
e_time:''
export default {
data() {
return {
insurance_status: -1,
time_str: '',
s_time_str: '',
e_time_str: '',
tomParam: {
order_renwuxingzhi: '',
lsky_city: '',
lsky_city_text: '',
lsky_xy: '',
lsky_zcfs: '',
order_id: '',
time: '',
s_time: '',
e_time: ''
},
confirmTime:'',
btnList:[{
btnName:'提交',
background:'#096ec0',
color:'#fff',
width:'100%'
confirmTime: '',
btnList: [{
btnName: '提交',
background: '#096ec0',
color: '#fff',
width: '100%'
}],
// 订单选择 开始
showOrderNum: false,
... ... @@ -107,79 +115,88 @@
// 时间选择 结束
}
},
computed:{
computed: {
...mapState(["orderParam"])
},
components:{
components: {
formWrap,
bottomBtn
},
onLoad(option) {
this.tomParam.order_id = option.id
//订单列表
this.$request('/order/order_list',1,{type:1,category:5}).then((res)=>{
this.$request('/order/order_list', 1, {
type: 1,
category: 5
}).then((res) => {
this.orderNumList = res.data
})
},
methods:{
submit(){
if(this.orderParam.renwuxingzhi == ''){
methods: {
onder(type) {
this.insurance_status = type
if (type == 0) {
this.$href('range')
}
},
submit() {
if (this.orderParam.renwuxingzhi == '') {
uni.showToast({
title:'请填写任务性质',
icon:'none'
title: '请填写任务性质',
icon: 'none'
})
return
}
if(!this.orderParam.confirm_lsky){
if (!this.orderParam.confirm_lsky) {
uni.showToast({
title:'请确认临时空域范围',
icon:'none'
title: '请确认临时空域范围',
icon: 'none'
})
return
}
if(this.time_str == ''){
if (this.time_str == '') {
uni.showToast({
title:'请选择飞行日期',
icon:'none'
title: '请选择飞行日期',
icon: 'none'
})
return
}
if(this.tomParam.e_time == ''){
if (this.tomParam.e_time == '') {
uni.showToast({
title:'请选择飞行时间',
icon:'none'
title: '请选择飞行时间',
icon: 'none'
})
return
}
if(this.tomParam.order_id == ''){
if (this.tomParam.order_id == '') {
uni.showToast({
title:'请选择申请编号',
icon:'none'
title: '请选择申请编号',
icon: 'none'
})
return
}
this.tomParam.lsky_xy = JSON.stringify(this.orderParam.lsky_xy_json).replaceAll('position','坐标')
this.tomParam.lsky_xy = JSON.stringify(this.orderParam.lsky_xy_json).replaceAll('position', '坐标')
this.tomParam.order_renwuxingzhi = this.orderParam.renwuxingzhi
this.tomParam.lsky_city = this.orderParam.lsky_city
this.tomParam.lsky_city_text = this.orderParam.lsky_city_text
this.tomParam.lsky_zcfs = this.orderParam.lsky_zcfs
console.log('111111111111111',this.tomParam)
this.$request('/order/order_son_submit',1,this.tomParam,2).then((res)=>{
console.log('申请次日飞行计划_提交',res)
if(res.code == 1){
console.log('111111111111111', this.tomParam)
this.$request('/order/order_son_submit', 1, this.tomParam, 2).then((res) => {
console.log('申请次日飞行计划_提交', res)
if (res.code == 1) {
this.$store.commit('defOrderParam')
setTimeout(()=>{
setTimeout(() => {
uni.showToast({
title:'提交成功'
title: '提交成功'
})
},200)
}, 200)
uni.switchTab({
url:'/pages/index/index'
url: '/pages/index/index'
})
}else{
} else {
uni.showToast({
title:res.msg,
icon:'none'
title: res.msg,
icon: 'none'
})
}
})
... ... @@ -195,14 +212,15 @@
if (this.paramsDate.year) this.time_str += e.year;
if (this.paramsDate.month) this.time_str += '-' + e.month;
if (this.paramsDate.day) this.time_str += '-' + e.day;
this.tomParam.time = new Date(this.time_str.replace(/\.|\-/g, '/')).getTime()/1000
this.tomParam.time = new Date(this.time_str.replace(/\.|\-/g, '/')).getTime() / 1000
},
confirmSTime(e) {
this.s_time_str = ''
if (this.paramsTime.hour) this.s_time_str += '' + e.hour;
if (this.paramsTime.minute) this.s_time_str += ':' + e.minute;
if (this.paramsTime.second) this.s_time_str += ':' + e.second;
this.tomParam.s_time = new Date(this.time_str+' '+this.s_time_str.replace(/\.|\-/g, '/')).getTime()/1000
this.tomParam.s_time = new Date(this.time_str + ' ' + this.s_time_str.replace(/\.|\-/g, '/')).getTime() /
1000
this.showETime = true
},
confirmETime(e) {
... ... @@ -210,7 +228,8 @@
if (this.paramsTime.hour) this.e_time_str += '' + e.hour;
if (this.paramsTime.minute) this.e_time_str += ':' + e.minute;
if (this.paramsTime.second) this.e_time_str += ':' + e.second;
this.tomParam.e_time = new Date(this.time_str+' '+this.e_time_str.replace(/\.|\-/g, '/')).getTime()/1000
this.tomParam.e_time = new Date(this.time_str + ' ' + this.e_time_str.replace(/\.|\-/g, '/')).getTime() /
1000
this.confirmTime = this.s_time_str + '-' + this.e_time_str
},
}
... ... @@ -218,21 +237,28 @@
</script>
<style lang="scss">
page{
page {
background-color: #f7f8fa;
}
.taskType{
.inpRightBox {
background-color: #FFFFFF;
padding: 0 10px;
}
.taskType {
padding: 0 32rpx;
background: #fff;
.title{
.title {
height: 117rpx;
line-height: 117rpx;
font-size: 32rpx;
}
.inp{
.inp {
height: 80rpx;
}
.inpPh{
.inpPh {
color: #c8c9cc;
font-size: 32rpx;
}
... ...
... ... @@ -123,19 +123,19 @@
return
}
let isFlase = false
let dataJson = this.orderParam.lsky_xy_json
for (var i = 0; i < dataJson.length - 1; i++) {
if (dataJson[i].position == dataJson[i + 1].position) {
uni.showToast({
title: '坐标点不能相同',
duration: 2000,
icon: 'none'
})
isFlase = false
} else {
isFlase = true
console.log('不重复')
}
let dataJson = []
this.orderParam.lsky_xy_json.map((item, index) => {
dataJson.push(item.position)
})
if ((new Set(dataJson)).size != dataJson.length) {
uni.showToast({
title: '坐标点不能相同',
duration: 2000,
icon: 'none'
})
isFlase = false
} else {
isFlase = true
}
if (isFlase) {
this.orderParam.confirm_lsky = true
... ... @@ -143,7 +143,6 @@
delta: 1
})
}
},
add() {
this.orderParam.lsky_xy_json.push({
... ...
... ... @@ -9,10 +9,11 @@
placeholder-class="inpPh" />
</view>
</view>
<form-wrap :title="'临时空域范围'" >
<!-- <form-wrap :title="'临时空域范围'" >
</form-wrap>
<view class="inpRightBox">
</form-wrap> -->
<form-wrap @navTo="$href('range')" :title="'临时空域范围'" :alert="'请填写临时空域范围'" :rightType="'img'"></form-wrap>
<!-- <view class="inpRightBox">
<view style="display: flex;padding-bottom: 10px;" @click="onder(1)">
<image class="radioImg" style="width: 38rpx;height: 38rpx;margin: 0 5px;"
:src="insurance_status == 1 ? '../../static/image/ic_circle_1@2x.png' : '../../static/image/ic_checked_1@2x.png'"
... ... @@ -26,7 +27,7 @@
<text>与主申请的临时空域范围不一致,但在主申请的临时空域范围内</text>
</view>
</view>
</view> -->
<form-wrap @navTo="show = true" :title="'日期时间'" :alert="'请选择日期时间'" :confirmTxt="orderParam.time_str"
:rightType="'img'"></form-wrap>
<view class="inpWraps">
... ...