|
@@ -144,6 +144,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, onActivated, onMounted, ref } from 'vue'
|
|
|
+import { backMeterTask } from '~api/other'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { actionConfirm, delMessage } from '~uti/tools'
|
|
|
import addModal from './components/order/addModal.vue'
|
|
@@ -394,7 +395,29 @@ const reportFinish = () => {
|
|
|
//撤销上报
|
|
|
const undoLoading = ref(false)
|
|
|
const undoReportClick = async () => {
|
|
|
- window?.$message.warning('功能开发中...')
|
|
|
+ const rows = tableCheckKeys.value
|
|
|
+ if (rows.length <= 0) {
|
|
|
+ window.$message?.warning('请先勾选要撤销的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (rows.length > 1) {
|
|
|
+ window.$message?.warning('每次只能撤销一条数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const { id, approveStatus } = rows[0]
|
|
|
+ if (approveStatus !== 2) {
|
|
|
+ window.$message?.warning('只能撤销待审批的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ undoLoading.value = true
|
|
|
+ const { isRes } = await backMeterTask({
|
|
|
+ periodId: id,
|
|
|
+ type: 3,
|
|
|
+ })
|
|
|
+ undoLoading.value = false
|
|
|
+ if (!isRes) return
|
|
|
+ window.$message.success('撤回成功')
|
|
|
+ reportFinish()
|
|
|
}
|
|
|
</script>
|
|
|
|