充电任务

This commit is contained in:
2024-08-14 14:04:33 +08:00
parent 3473030744
commit 91a786804f
5 changed files with 48 additions and 5 deletions

View File

@@ -59,5 +59,7 @@
"take-and-place": "Take and place",
"filter.point": "Point",
"warning": "Warning",
"toast.command-reissue": "Do you need to issue it?"
"toast.command-reissue": "Do you need to issue it?",
"charging-task": "Charging task",
"toast.charging-task": "Do you need to charge it?"
}

View File

@@ -59,5 +59,7 @@
"take-and-place": "픽업 허용",
"filter.point": "포인트",
"warning": "힌트",
"toast.command-reissue": "발송해야 하나요?"
"toast.command-reissue": "발송해야 하나요?",
"charging-task": "충전 작업",
"toast.charging-task": "충전이 필요하십니까?"
}

View File

@@ -59,5 +59,8 @@
"take-and-place": "允许取放",
"filter.point": "点位",
"warning": "提示",
"toast.command-reissue": "是否需要下发?"
"toast.command-reissue": "是否需要下发?",
"charging-task": "充电任务",
"toast.charging-task": "是否需要充电?"
}

View File

@@ -20,14 +20,15 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-22 button-primary" :disabled="disabled" @tap="toSure('1')">{{$t('button.handtask')}}</button>
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="toSure('1')">{{$t('button.handtask')}}</button>
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="toCharge">{{$t('charging-task')}}</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {queryArea, queryPointByArea, callTask} from '@/utils/getData2.js'
import {queryArea, queryPointByArea, callTask, taskCharge} from '@/utils/getData2.js'
export default {
components: {
NavBar
@@ -71,6 +72,34 @@
} catch (err) {
this.disabled = false
}
},
toCharge () {
this.disabled = true
uni.showModal({
title: this.$t('warning'),
cancelText: this.$t('button.cancel'),
confirmText: this.$t('button.confirm'),
content: this.$t('toast.charging-task'),
success: (res) => {
if (res.confirm) {
this._taskCharge()
} else if (res.cancel) {
this.disabled = false
}
}
})
},
async _taskCharge () {
try {
let res = await taskCharge()
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (err) {
this.disabled = false
}
}
}
}

View File

@@ -95,3 +95,10 @@ export const updateTask = (code,type) => request({
option: type
}
})
/**
* 充电任务
*/
export const taskCharge = () => request({
url:'api/hand/taskCharge',
data: {}
})