ZaiZai 1 năm trước cách đây
mục cha
commit
9b3eb475ef
3 tập tin đã thay đổi với 26 bổ sung3 xóa
  1. 1 1
      public/version.json
  2. 1 1
      src/api/modules/other.js
  3. 24 1
      src/views/alter/admin/order.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240705200607"
+  "value": "20240708115802"
 }

+ 1 - 1
src/api/modules/other.js

@@ -78,7 +78,7 @@ export const saveSmsTimeout = (form) => HcApi({
 })
 
 
-//撤销上报, periodId 期数,type 类型(0中间,1材料,2开工)
+//撤销上报, periodId 期数,type 类型(0中间,1材料,2开工,3变更令)
 export const backMeterTask = (form) => HcApi({
     url: '/api/blade-meter/task/backMeterTask',
     method: 'get',

+ 24 - 1
src/views/alter/admin/order.vue

@@ -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>