From d2d4e9cf9089460e1222691e9d46c8fb4cf55670 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Mon, 1 Apr 2024 15:27:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=8D=95=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9=E6=9A=82?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/worksheet/aside/WorkSheetList.vue | 7 +- src/views/worksheet/modal/ApprovalModal.vue | 90 ++++-- src/views/worksheet/modal/ApprovalModal2.vue | 2 +- .../worksheet/modal/ApprovalModal_bak.vue | 260 ++++++++++++++++++ 4 files changed, 325 insertions(+), 34 deletions(-) create mode 100644 src/views/worksheet/modal/ApprovalModal_bak.vue diff --git a/src/views/worksheet/aside/WorkSheetList.vue b/src/views/worksheet/aside/WorkSheetList.vue index f797a21..330b045 100644 --- a/src/views/worksheet/aside/WorkSheetList.vue +++ b/src/views/worksheet/aside/WorkSheetList.vue @@ -33,7 +33,7 @@ const pagination = reactive({ pageSize: 10, }) -const approvalModalRef = ref(null) +const approvalModalRef: any = ref(null) const notPassedRef: any = ref(null) const overTask = ref(null); @@ -94,8 +94,9 @@ watch( (newVal) => { if (isEmpty(newVal)) return - - activeId.value = newVal + activeId.value = newVal; + approvalModalRef.value.showModal(activeId.value) + }, ) diff --git a/src/views/worksheet/modal/ApprovalModal.vue b/src/views/worksheet/modal/ApprovalModal.vue index eac9608..e075306 100644 --- a/src/views/worksheet/modal/ApprovalModal.vue +++ b/src/views/worksheet/modal/ApprovalModal.vue @@ -2,9 +2,10 @@ import { onMounted, reactive, ref, toRefs } from "vue"; import { format } from "date-fns"; import { NButton, NDataTable, useDialog, useMessage } from "naive-ui"; -import { aiApprovaltools, aiApprovaltoolsClearmark } from "@/api/work/work"; +import { aiApprovaltools, aiApprovaltoolsClearmark, setTF } from "@/api/work/work"; import { getToolsCount } from "@/api/home/main"; - +import { storage } from "@/utils/Storage"; +import { CURRENT_USER } from "@/store/mutation-types"; const emit = defineEmits<{ (e: "reject", params: any); (e: "notPass", params: any); @@ -14,7 +15,7 @@ const dialog = useDialog(); const state: any = reactive({ detail: {}, - taskId: "", + packageid: "", }); const { detail } = toRefs(state); const cardStyle = { @@ -26,23 +27,34 @@ const cardStyle = { const show = ref(false); function showModal(id) { - console.log(id); - state.taskId = id; + state.packageid = id; getDetail(id); } async function getDetail(id) { + // const userInfo = storage.get(CURRENT_USER); + // const nodeType = userInfo.nodeType; + id = "264626184091111068"; const res = await aiApprovaltools({ taskid: id }); if (res.code === "OK") { state.detail = res.data; show.value = true; } - console.log(res); + console.log(res, "getDetail"); } +const handleReject = async () => { + const res = await setTF({ + taskchildpictureids: state.detail.taskIdList.join(","), + packageid: state.packageid, + iztrueorfalse: 0, + }); + console.log(res, "handleReject"); +}; + async function clearMark() { - const res = await aiApprovaltoolsClearmark({ taskid: state.taskId }); + const res = await aiApprovaltoolsClearmark({ taskid: state.packageid }); if (res.code === "OK") closeModal(); } @@ -69,7 +81,7 @@ async function reject() { async function viewRepeat(e: MouseEvent) { emit("notPass", { - id: state.taskId, + id: state.packageid, detail: state.detail, }); e.preventDefault(); @@ -78,7 +90,7 @@ async function viewRepeat(e: MouseEvent) { async function getShowStatus() { const res = await getToolsCount(); - if (res.code == 'OK') { + if (res.code == "OK") { show.value = true; } } @@ -92,7 +104,7 @@ defineExpose({