充电任务
This commit is contained in:
@@ -59,5 +59,7 @@
|
|||||||
"take-and-place": "Take and place",
|
"take-and-place": "Take and place",
|
||||||
"filter.point": "Point",
|
"filter.point": "Point",
|
||||||
"warning": "Warning",
|
"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?"
|
||||||
}
|
}
|
||||||
@@ -59,5 +59,7 @@
|
|||||||
"take-and-place": "픽업 허용",
|
"take-and-place": "픽업 허용",
|
||||||
"filter.point": "포인트",
|
"filter.point": "포인트",
|
||||||
"warning": "힌트",
|
"warning": "힌트",
|
||||||
"toast.command-reissue": "발송해야 하나요?"
|
"toast.command-reissue": "발송해야 하나요?",
|
||||||
|
"charging-task": "충전 작업",
|
||||||
|
"toast.charging-task": "충전이 필요하십니까?"
|
||||||
}
|
}
|
||||||
@@ -59,5 +59,8 @@
|
|||||||
"take-and-place": "允许取放",
|
"take-and-place": "允许取放",
|
||||||
"filter.point": "点位",
|
"filter.point": "点位",
|
||||||
"warning": "提示",
|
"warning": "提示",
|
||||||
"toast.command-reissue": "是否需要下发?"
|
"toast.command-reissue": "是否需要下发?",
|
||||||
|
"charging-task": "充电任务",
|
||||||
|
"toast.charging-task": "是否需要充电?"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,14 +20,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-row submit-bar">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar
|
NavBar
|
||||||
@@ -71,6 +72,34 @@
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.disabled = false
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,4 +94,11 @@ export const updateTask = (code,type) => request({
|
|||||||
device_code: code,
|
device_code: code,
|
||||||
option: type
|
option: type
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* 充电任务
|
||||||
|
*/
|
||||||
|
export const taskCharge = () => request({
|
||||||
|
url:'api/hand/taskCharge',
|
||||||
|
data: {}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user