This commit is contained in:
dzc committed 2025-03-28 13:51:36 +08:00
commit e924c989b1
3 files changed
+50 -2

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
import { useMessage } from "./message"
type tableRow = { id: string | undefined; checkStatus: number | string | undefined }
type ICreate = () => void
type IEdit = (row: tableRow) => void
type IFormClose = () => void
// 采购流程(补货申请、采购订单、采购入库、采购退货、零售出库、零售退货) 表格操作列行为hook
export function useSmProcessTableAction(processFormState: { formId: string | undefined; formDisabled: boolean; showForm: boolean }): {
create: ICreate
edit: IEdit
formClose: IFormClose
} {
// 点击新增
const create: ICreate = () => {
processFormState.formDisabled = false
processFormState.showForm = true
}
// 点击编辑
const edit: IEdit = (row: tableRow) => {
row.id ? (processFormState.formId = row.id) : useMessage().warning("清单id不存在")
row.checkStatus == 2 ? (processFormState.formDisabled = true) : (processFormState.formDisabled = false)
processFormState.showForm = true
}
// 表单关闭
const formClose: IFormClose = () => {
processFormState.showForm = false
processFormState.formId = undefined
processFormState.formDisabled = true
}
return {
create,
edit,
formClose,
}
}
+1 -1
View File
@@ -7,7 +7,7 @@
<el-input placeholder="请输入包厢名称" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList"> 查询 </el-button>
<el-button icon="search" type="primary" @click="getDataList">查询</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
+11 -1
View File
@@ -67,7 +67,10 @@
</el-table-column>
<el-table-column prop="collectionCode" width="150" label="商户收款二维码" show-overflow-tooltip>
<template #default="{ row }">
<preview-image :src="row.collectionCode" />
<div class="flex flex-col justify-center items-center">
<preview-image :src="row.collectionCode" />
<el-button size="small" type="primary" link @click="downloadCollectionCode(row)">下载</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="merchantType" label="商户类型" show-overflow-tooltip :min-width="100">
@@ -161,6 +164,7 @@ import { useDict } from "/@/hooks/dict"
import FormDialog from "./form.vue"
import Setting from "./setting.vue"
import { useUserInfo } from "/@/stores/userInfo"
import { downBlobFile as downCollectionCodeBlobFile } from "/@/utils/other"
const { merchant_type, wallet_type, yes_no_type } = useDict("merchant_type", "wallet_type", "yes_no_type")
@@ -256,4 +260,10 @@ const handleDelete = async (ids: string[]) => {
useMessage().error(err.msg)
}
}
// 点击二维码下载
const downloadCollectionCode = (row: any) => {
if (!row.collectionCode) return useMessage().error("二维码链接不存在")
downCollectionCodeBlobFile(row.collectionCode, {}, `${row.name} 收款二维码.png`)
}
</script>