|
@@ -1,14 +1,18 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { shallowRef, ref, computed } from 'vue'
|
|
|
import { useRouter } from "vue-router"
|
|
|
import { useDetail } from "/@/hooks/core/useDetail";
|
|
|
-// import { usePermission } from "/@/hooks/core/usePermission";
|
|
|
+import { usePermission } from "/@/hooks/core/usePermission";
|
|
|
import ReconciliationForm from "/@/components/ReconciliationForm";
|
|
|
import { ElTabs, ElTabPane, ElCollapse, ElCollapseItem } from "element-plus"
|
|
|
import OrderForm from "./components/order-form.vue"
|
|
|
+import { useAsync } from "/@/hooks/core/useAsync";
|
|
|
+import { httpStatus } from "/@/api/purchase/orderRecord";
|
|
|
+import { DefaultApprovalNode } from "/@/components/ApprovalNode";
|
|
|
|
|
|
const pageName = "currentcyOrderRecordDetail"
|
|
|
|
|
|
+const status = computed(() => formRef.value?.detail.status || "");
|
|
|
const { id, title, isDetail, collapses } = useDetail({
|
|
|
baseName: '通用订单对账',
|
|
|
collapseLen: 2
|
|
@@ -16,6 +20,19 @@ const { id, title, isDetail, collapses } = useDetail({
|
|
|
|
|
|
const { push } = useRouter();
|
|
|
const loading = shallowRef(false);
|
|
|
+
|
|
|
+const formRef = ref<InstanceType<typeof ReconciliationForm>>(null);
|
|
|
+const { run: approval } = useAsync({ success: () => formRef.value.refresh() });
|
|
|
+const { hasPermissionWithCode } = usePermission(pageName);
|
|
|
+
|
|
|
+function handleApproval(data) {
|
|
|
+ const params = {
|
|
|
+ ...data,
|
|
|
+ payNo: id.value
|
|
|
+ };
|
|
|
+
|
|
|
+ approval(httpStatus(params));
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
|
|
@@ -25,9 +42,13 @@ const loading = shallowRef(false);
|
|
|
<ElTabPane :label="title">
|
|
|
<ElCollapse v-model="collapses">
|
|
|
<ElCollapseItem :title="title" name="1">
|
|
|
- <ReconciliationForm v-if="isDetail" :id="id" :loading="loading" :readonly="isDetail" isPurch />
|
|
|
+ <ReconciliationForm v-if="isDetail" ref="formRef" :id="id" :loading="loading" :readonly="isDetail" isPurch />
|
|
|
<OrderForm v-else @create="() => push('/InvoiceSales/currentcyOrderRecord')" />
|
|
|
</ElCollapseItem>
|
|
|
+
|
|
|
+ <ElCollapseItem name="2" title="买方公司业务审核" v-if="String(status) === '1' && hasPermissionWithCode('039')">
|
|
|
+ <DefaultApprovalNode approveValue="2" rejectValue="3" @approval="handleApproval" />
|
|
|
+ </ElCollapseItem>
|
|
|
</ElCollapse>
|
|
|
</ElTabPane>
|
|
|
</ElTabs>
|