Kaynağa Gözat

异常审核待办

zhangjie 1 yıl önce
ebeveyn
işleme
1cd4ef4f22

+ 15 - 0
src/views/my-workbenches/workbenches/my-waits/waits-list.vue

@@ -73,6 +73,12 @@
       type="fill"
       @confirm="sopStepConfirm"
     ></quality-issue-dialog>
+    <!-- AbnormalAudit -->
+    <abnormal-audit
+      v-model:visible="showAbnormalAudit"
+      :curRow="curSopData"
+      @confirm="sopStepConfirm"
+    ></abnormal-audit>
   </div>
 </template>
 
@@ -82,6 +88,8 @@ import { timestampFilter, customerTypeFilter } from '@/utils/filter';
 import SopStepDialog from '@/views/sop/sop-manage/sop-step/sop-step-dialog.vue';
 import PlanChangeDialog from '@/views/sop/sop-manage/plan-change/plan-change-dialog.vue';
 import QualityIssueDialog from '@/views/sop/sop-manage/quality-issue/quality-issue-dialog.vue';
+import AbnormalAudit from '@/views/work-hours/work-hours-manage/abnormal-check/abnormal-audit.vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 
 const { tableData, pagination, onChange } = defineProps([
   'tableData',
@@ -93,6 +101,7 @@ const emit = defineEmits(['success']);
 const showSopStepDialog = ref(false);
 const showPlanChangeDialog = ref(false);
 const showQualityIssueDialog = ref(false);
+const showAbnormalAudit = ref(false);
 const curSopData = ref({});
 const editSopFlowHandle = (row) => {
   curSopData.value = row;
@@ -108,6 +117,12 @@ const editSopFlowHandle = (row) => {
     showSopStepDialog.value = true;
     return;
   }
+  if (row.type === 'DING_EXCEPTION_FLOW') {
+    showAbnormalAudit.value = true;
+    return;
+  }
+
+  MessagePlugin.error('未知类型待办');
 };
 const sopStepConfirm = () => {
   emit('success');

+ 78 - 0
src/views/work-hours/work-hours-manage/abnormal-check/abnormal-audit.vue

@@ -0,0 +1,78 @@
+<template>
+  <my-dialog
+    :visible="visible"
+    header="异常处理审核"
+    :width="800"
+    attach="body"
+    :closeOnOverlayClick="false"
+    @close="emit('update:visible', false)"
+  >
+    <t-form colon>
+      <t-row :gutter="[0, 0]">
+        <t-col :span="12">
+          <t-form-item label="审核" required-mark>
+            <t-radio-group
+              v-model="dingExceptionApprove"
+              allow-uncheck
+              :options="optionList"
+            ></t-radio-group>
+          </t-form-item>
+        </t-col>
+      </t-row>
+    </t-form>
+    <template #foot>
+      <t-button theme="default" @click="emit('update:visible', false)"
+        >取消</t-button
+      >
+      <t-button theme="primary" @click="handleAudit">保存</t-button>
+    </template>
+  </my-dialog>
+</template>
+
+<script setup name="AbnormalAudit">
+import { ref } from 'vue';
+import { workHoursWaitCheckAuditApi } from '@/api/work-hours';
+// import { customerTypeFilter, timestampFilter } from '@/utils/filter';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
+
+const emit = defineEmits(['update:visible', 'confirm']);
+const props = defineProps({
+  visible: Boolean,
+  curRow: Object,
+});
+
+const dingExceptionApprove = ref('PASS');
+const optionList = ref([
+  {
+    label: '通过',
+    value: 'PASS',
+  },
+  {
+    label: '拒绝',
+    value: 'NO_PASS',
+  },
+]);
+const handleAudit = async () => {
+  const actionName = dingExceptionApprove.value === 'PASS' ? '通过' : '拒绝';
+  const warningBody = `确定要${actionName}当前记录吗`;
+
+  const confirmDia = DialogPlugin({
+    header: '操作提示',
+    body: warningBody,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      let data = {
+        dingExceptionApprove: dingExceptionApprove.value,
+        taskId: props.curRow.taskId,
+      };
+      const res = await workHoursWaitCheckAuditApi(data, false).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      emit('update:visible', false);
+      emit('confirm');
+    },
+  });
+};
+</script>