Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
75267f49f5
8 files changed
+80
-131
No files matched your search
@@ -8,14 +8,6 @@ export const deptTree = (params?: Object) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const deptTreeSelect = (params?: Object) => {
|
||||
return request({
|
||||
url: "/admin/dept/tree-select",
|
||||
method: "get",
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
export const addObj = (obj: Object) => {
|
||||
return request({
|
||||
url: "/admin/dept",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<script setup lang="ts" name="SelectDept">
|
||||
import { ref, onMounted } from "vue"
|
||||
import { deptTree, deptTreeSelect } from "/@/api/admin/dept"
|
||||
import { deptTree } from "/@/api/admin/dept"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
|
||||
const selectId = defineModel()
|
||||
@@ -15,13 +15,6 @@ const props = defineProps({
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择部门",
|
||||
},
|
||||
/**
|
||||
* "all" | "scope"
|
||||
*/
|
||||
dataScope: {
|
||||
type: String,
|
||||
default: "scope",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -32,7 +25,7 @@ const deptOptions = ref<any[]>([])
|
||||
// 加载部门树数据
|
||||
const loadDeptTree = async () => {
|
||||
try {
|
||||
const res: any = props.dataScope == "scope" ? await deptTree() : await deptTreeSelect()
|
||||
const res: any = await deptTree()
|
||||
if (res.code == 0) {
|
||||
deptOptions.value = res.data || []
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'sys_dept_add'" @exportExcel="exportExcel"
|
||||
class="ml10" style="float: right; margin-right: 20px" @queryTable="getDataList">
|
||||
<el-tooltip class="item" effect="dark" :content="$t('queryTree.view')" placement="top">
|
||||
<el-button circle icon="Grid" @click="handleView"></el-button>
|
||||
<el-button v-if="!stores.userInfos.roleCodes.includes('DEPT_ADMIN')" circle icon="Grid"
|
||||
@click="handleView" />
|
||||
</el-tooltip>
|
||||
</right-toolbar>
|
||||
</div>
|
||||
@@ -47,11 +48,13 @@
|
||||
<script lang="ts" name="systemDept" setup>
|
||||
import { downBlobFile } from "/@/utils/other"
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { useUserInfo } from "/@/stores/userInfo"
|
||||
|
||||
const TreeView = defineAsyncComponent(() => import("./tree-view.vue"))
|
||||
const TableView = defineAsyncComponent(() => import("./table-view.vue"))
|
||||
|
||||
const { t } = useI18n()
|
||||
const stores = useUserInfo();
|
||||
|
||||
// 默认树视图展示
|
||||
const defaultTreeViewRef = ref(true)
|
||||
|
||||
@@ -1,31 +1,19 @@
|
||||
<template>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
style="width: 100%"
|
||||
row-key="id"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle?.headerCellStyle"
|
||||
>
|
||||
<el-table ref="tableRef" :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="id"
|
||||
default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle?.headerCellStyle">
|
||||
<el-table-column :label="$t('sysdept.name')" prop="name" width="400" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column :label="$t('sysdept.weight')" prop="weight" show-overflow-tooltip width="80"></el-table-column>
|
||||
<el-table-column prop="createTime" :label="$t('sysdept.createTime')" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('common.action')"
|
||||
v-auths="['sys_dept_add', 'sys_dept_edit', 'sys_dept_del']"
|
||||
show-overflow-tooltip
|
||||
width="250"
|
||||
>
|
||||
<el-table-column :label="$t('common.action')" v-auths="['sys_dept_add', 'sys_dept_edit', 'sys_dept_del']"
|
||||
show-overflow-tooltip width="250">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" icon="folder-add" @click="deptDialogRef.openDialog('add', scope.row?.id)" v-auth="'sys_dept_add'">
|
||||
<el-button text type="primary" icon="folder-add" @click="deptDialogRef.openDialog('add', scope.row?.id)"
|
||||
v-auth="'sys_dept_add'">
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="edit-pen" @click="deptDialogRef.openDialog('edit', scope.row?.id)" v-auth="'sys_dept_edit'"
|
||||
>{{ $t("common.editBtn") }}
|
||||
<el-button text type="primary" icon="edit-pen" @click="deptDialogRef.openDialog('edit', scope.row?.id)"
|
||||
v-auth="'sys_dept_edit'">{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="delete" @click="handleDelete(scope.row)" v-auth="'sys_dept_del'">
|
||||
{{ $t("common.delBtn") }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<vue3-tree-org ref="treeOrgRef" :props="props" :data="data" :label-style="style" :define-menus="getMenus()"
|
||||
<vue3-tree-org ref="treeOrgRef" :props="props" :data="data" :label-style="style" :define-menus="getMenus"
|
||||
:default-expand-level="expandLevel" center :horizontal="horizontal" :collapsable="collapsable"
|
||||
:only-one-node="onlyOneNode" :filter-node-method="filterNodeMethod" :clone-node-drag="cloneNodeDrag"
|
||||
:node-add="addNode" :node-delete="delNode" :node-edit="editNode" @on-node-click="onNodeClick" />
|
||||
@@ -17,11 +17,14 @@ import { useI18n } from "vue-i18n"
|
||||
import { storeToRefs } from "pinia"
|
||||
import { useThemeConfig } from "/@/stores/themeConfig"
|
||||
import { auth } from "/@/utils/authFunction"
|
||||
import { useUserInfo } from "/@/stores/userInfo"
|
||||
|
||||
const DeptForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const stores = useUserInfo();
|
||||
|
||||
// 定义org组件key-value定义
|
||||
const props = reactive({ id: "id", pid: "parentId", label: "name", expand: "expand", children: "children" })
|
||||
const data = reactive({})
|
||||
@@ -69,8 +72,14 @@ const filterNodeMethod = (value, data) => {
|
||||
return data.label.indexOf(value) !== -1
|
||||
}
|
||||
|
||||
const getMenus = () => {
|
||||
const getMenus = (event: any, v: any) => {
|
||||
const menus = []
|
||||
if (stores.userInfos.roleCodes.includes('DEPT_ADMIN')) {
|
||||
if (v.id == stores.userInfos.user.deptId) {
|
||||
return [{ name: t("sysdept.editNodeText"), command: "edit" }]
|
||||
}
|
||||
return []
|
||||
}
|
||||
if (auth("sys_dept_add")) {
|
||||
menus.push({ name: t("sysdept.addNodeText"), command: "add" })
|
||||
}
|
||||
@@ -173,9 +182,32 @@ const getOrgData = async () => {
|
||||
deptTree().then((res) => {
|
||||
Object.assign(data, { id: "0", name: tenant.data.name })
|
||||
data.children = res.data
|
||||
if (data.children && data.children.length && stores.userInfos.roleCodes.includes('DEPT_ADMIN')) {
|
||||
data.children = filterVisibleNodes(data.children)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const filterVisibleNodes = (nodes) => {
|
||||
if (!Array.isArray(nodes)) return [];
|
||||
return nodes.reduce((filtered, node) => {
|
||||
if (node.visible) {
|
||||
const filteredNode = { ...node };
|
||||
if (node.children?.length) {
|
||||
filteredNode.children = filterVisibleNodes(node.children);
|
||||
}
|
||||
filtered.push(filteredNode);
|
||||
} else if (node.children?.length) {
|
||||
// 如果当前节点不是visible,但是它的子节点可能是visible,所以需要继续检查
|
||||
const filteredChildren = filterVisibleNodes(node.children);
|
||||
if (filteredChildren.length > 0) {
|
||||
filtered.push({ ...node, children: filteredChildren });
|
||||
}
|
||||
}
|
||||
return filtered;
|
||||
}, []);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOrgData()
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<el-form-item label="充值类型" prop="bizType">
|
||||
<!-- :hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', '1']" -->
|
||||
<dict-select v-model="form.bizType" :disabled="form.invoiceId" dict-code="wallet_biz_recharge"
|
||||
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', '1']"
|
||||
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', form.bizType == '1' ? '' : '1']"
|
||||
placeholder="请选择饭卡类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -4,15 +4,18 @@
|
||||
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
|
||||
@keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="申请用户" prop="userIds">
|
||||
<el-form-item style="width: 350px" label="申请用户" prop="userIds">
|
||||
<select-user v-model="state.queryForm.userIds" placeholder="申请用户" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="交款单位或个人" prop="deptOrUser">
|
||||
<el-form-item style="width: 350px" label="交款单位或个人" prop="deptOrUser">
|
||||
<el-input v-model="state.queryForm.deptOrUser" clearable placeholder="交款单位或个人" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="发票状态" prop="userIds">
|
||||
<el-form-item style="width: 350px" label="发票状态" prop="userIds">
|
||||
<dict-select v-model="state.queryForm.status" dict-code="recharge_invoice_status" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 350px" label="备注" prop="remark">
|
||||
<el-input v-model="state.queryForm.remark" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetimerange" />
|
||||
@@ -61,7 +64,7 @@
|
||||
{{ displayPrice(row.totalPrice) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payeeUser" min-width="120" label="收款人" show-overflow-tooltip />
|
||||
<el-table-column prop="payeeUser" min-width="120" label="开票人" show-overflow-tooltip />
|
||||
<el-table-column prop="payeeDept" min-width="120" label="收款单位" show-overflow-tooltip />
|
||||
<el-table-column prop="processStatus" width="100" label="审核状态">
|
||||
<template #default="{ row }">
|
||||
@@ -96,16 +99,15 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300" fixed="right">
|
||||
<el-table-column label="操作" min-width="260" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div class="flex">
|
||||
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
|
||||
:disabled="loading" @click="previewInvoice(row)">
|
||||
查看发票
|
||||
</el-button>
|
||||
<!-- row.isCheckUser && -->
|
||||
<el-button v-if="row.processStatus == '1'" type="primary" link icon="VideoPlay"
|
||||
:disabled="loading" @click="deal(row)">
|
||||
<el-button v-if="row.isCheckUser && row.processStatus == '1'" type="primary" link
|
||||
icon="VideoPlay" :disabled="loading" @click="deal(row)">
|
||||
开始处理
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRechargeInvoice_del'"
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
<el-dialog v-model="visible" title="预览" width="800px" :close-on-click-modal="false" draggable destroy-on-close>
|
||||
<dict-tag class="mb-2" :options="check_status" :value="receiptData.processStatus" />
|
||||
|
||||
<div v-loading="loading" id="receiptRef" ref="receiptRef" class="w-[17.5cm] h-[9.5cm] border border-gray-400 p-6 bg-[#EBE1C622]">
|
||||
<div v-loading="loading" id="receiptRef" ref="receiptRef"
|
||||
class="w-[17.5cm] h-[9.5cm] border border-gray-400 p-6 bg-[#EBE1C622]">
|
||||
<div class="text-center mx-auto w-[10cm] text-3xl font-bold">浦江县行政事业单位食堂统一收款收据</div>
|
||||
|
||||
<div class="flex justify-between items-end mb-1">
|
||||
<div></div>
|
||||
<div>
|
||||
{{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ") }}
|
||||
{{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ")
|
||||
}}
|
||||
</div>
|
||||
<span>
|
||||
<span>No. </span>
|
||||
@@ -21,13 +23,9 @@
|
||||
<tr>
|
||||
<td class="border border-gray-600 px-2 w-3/12 h-[0.75cm]">交款单位(或个人)</td>
|
||||
<td class="border border-gray-600 px-2 w-9/12 h-[0.75cm] text-sm text-blue-800" colspan="4">
|
||||
<input
|
||||
type="text"
|
||||
v-model="receiptData.deptOrUser"
|
||||
class="caret-red-600 w-full h-full bg-transparent text-center"
|
||||
ref="deptOrUserInput"
|
||||
maxlength="30"
|
||||
/>
|
||||
<input type="text" v-model="receiptData.deptOrUser"
|
||||
class="caret-red-600 w-full h-full bg-transparent text-center" ref="deptOrUserInput"
|
||||
maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -64,14 +62,10 @@
|
||||
<td class="border border-gray-600 px-2 w-1/6 h-[0.75cm]">收款单位<br />(盖章)</td>
|
||||
<td class="border border-gray-600 px-2 text-left w-1/6 h-[0.75cm] text-sm text-blue-800">
|
||||
<!-- <input type="text" v-model="receiptData.payeeDept" class="w-full h-full bg-transparent" /> -->
|
||||
<!-- <img
|
||||
class="w-[2.5cm] h-[2.5cm] absolute -top-2 left-[140px]"
|
||||
:class="{ stamping: isStamping }"
|
||||
<img v-if="receiptData.stampPicUrl" class="w-[2.5cm] h-[2.5cm] absolute -top-2 left-[140px]"
|
||||
draggable="false"
|
||||
style="-webkit-user-drag: none; user-select: none; pointer-events: none"
|
||||
oncontextmenu="return false"
|
||||
src="/@/assets/receiptStamp.png"
|
||||
/> -->
|
||||
oncontextmenu="return false" src="/@/assets/receiptStamp.png" />
|
||||
</td>
|
||||
<td class="border border-gray-600 px-2 w-1/6 h-[0.75cm]">开票人<br />(签名)</td>
|
||||
<td class="border border-gray-600 px-2 text-left w-1/6 h-[0.75cm] text-sm text-blue-800">
|
||||
@@ -81,11 +75,8 @@
|
||||
<td class="border border-gray-600 px-2 text-left align-text-top w-1/3 h-[0.75cm]">
|
||||
<div class="flex">
|
||||
<span class="whitespace-nowrap">备注:</span>
|
||||
<textarea
|
||||
v-model="receiptData.remark"
|
||||
maxlength="12"
|
||||
class="flex-1 text-sm text-blue-800 w-full h-full bg-transparent resize-none overflow-y-hidden"
|
||||
/>
|
||||
<textarea v-model="receiptData.remark" maxlength="12"
|
||||
class="flex-1 text-sm text-blue-800 w-full h-full bg-transparent resize-none overflow-y-hidden" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -100,28 +91,17 @@
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
|
||||
<!-- <el-button
|
||||
v-if="!receiptData.picUrl"
|
||||
v-auth="'wallet_walletRechargeApply_receiptStamp'"
|
||||
type="primary"
|
||||
@click="stampReceipt"
|
||||
:disabled="loading"
|
||||
>
|
||||
盖章
|
||||
</el-button> -->
|
||||
<el-button
|
||||
v-if="receiptData.processStatus == '2' || receiptData.processStatus == '3'"
|
||||
v-auth="'wallet_walletRechargeApply_back'"
|
||||
type="primary"
|
||||
plain
|
||||
@click="backInvoice"
|
||||
:disabled="loading"
|
||||
>
|
||||
<el-button v-if="receiptData.processStatus == '2' || receiptData.processStatus == '3'"
|
||||
v-auth="'wallet_walletRechargeApply_back'" type="primary" plain @click="backInvoice"
|
||||
:disabled="loading">
|
||||
作废
|
||||
</el-button>
|
||||
<el-button v-if="!receiptData.processStatus" type="primary" :disabled="loading" @click="applyStamp">申请审批</el-button>
|
||||
<el-button v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt" :disabled="loading">保存</el-button>
|
||||
<el-button v-if="receiptData.stampPicUrl" type="warning" @click="handlePrint" :disabled="loading">打印</el-button>
|
||||
<el-button v-if="!receiptData.processStatus" type="primary" :disabled="loading"
|
||||
@click="applyStamp">申请审批</el-button>
|
||||
<el-button v-if="receiptData.processStatus == undefined" v-auth="'wallet_walletRechargeApply_receiptSave'"
|
||||
type="primary" @click="saveReceipt" :disabled="loading">保存</el-button>
|
||||
<el-button v-if="receiptData.stampPicUrl" type="warning" @click="handlePrint"
|
||||
:disabled="loading">打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -161,7 +141,6 @@ const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const receiptRef = ref<HTMLElement | null>(null)
|
||||
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
||||
const isStamping = ref(false) // 盖章动画开关
|
||||
const receiptData = ref<ReceiptData>({
|
||||
id: "",
|
||||
itemJson: "", // 款项json
|
||||
@@ -194,7 +173,6 @@ const openDialog = (data: ReceiptData, id: string) => {
|
||||
visible.value = true
|
||||
receiptData.value = data
|
||||
receiptData.value.id = id
|
||||
isStamping.value = false
|
||||
timer = setTimeout(() => {
|
||||
deptOrUserInput.value?.focus()
|
||||
}, 50)
|
||||
@@ -233,7 +211,6 @@ const genImage = async (): Promise<Blob | void | null> => {
|
||||
pixelRatio: 6,
|
||||
})
|
||||
.catch((error) => {
|
||||
isStamping.value = false
|
||||
return useMessage().error("图片生成错误")
|
||||
})
|
||||
return blob
|
||||
@@ -256,23 +233,6 @@ const uploadImage = async (blob: Blob): Promise<string | void> => {
|
||||
useMessage().error(data.msg || "上传失败")
|
||||
}
|
||||
|
||||
// 盖章并上传发票图片并保存
|
||||
// const stampReceipt = () => {
|
||||
// loading.value = true
|
||||
// isStamping.value = true
|
||||
|
||||
// timer = setTimeout(async () => {
|
||||
// const blob = await genImage()
|
||||
// if (blob) {
|
||||
// const url = await uploadImage(blob)
|
||||
// if (url) {
|
||||
// receiptData.value.picUrl = url
|
||||
// await saveReceipt()
|
||||
// }
|
||||
// }
|
||||
// }, 1030)
|
||||
// }
|
||||
|
||||
// 保存发票
|
||||
const saveReceipt = async (): Promise<void> => {
|
||||
try {
|
||||
@@ -354,25 +314,4 @@ defineExpose({
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
.stamping {
|
||||
animation: stamp-in 1s;
|
||||
}
|
||||
|
||||
@keyframes stamp-in {
|
||||
0% {
|
||||
transform: translateY(-100px) scale(2);
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: translateY(-10px) scale(1.5);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateY(0) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user