Merge branch 'master' of https://e.coding.net/g-cphe0354/cashier/cashier-web into dwb
This commit is contained in:
commit
d8b20f1963
|
|
@ -63,6 +63,14 @@ const Api = {
|
||||||
method: "post",
|
method: "post",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 统计
|
||||||
|
statistics(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/statistics`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,37 +8,58 @@
|
||||||
<template v-if="typeof item === 'string'">
|
<template v-if="typeof item === 'string'">
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<template v-if="item === 'add'">
|
<template v-if="item === 'add'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="primary" icon="plus"
|
<el-button
|
||||||
@click="handleToolbar(item)">
|
v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
||||||
|
type="primary"
|
||||||
|
icon="plus"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
>
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<template v-else-if="item === 'delete'">
|
<template v-else-if="item === 'delete'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="danger" icon="delete"
|
<el-button
|
||||||
:disabled="removeIds.length === 0" @click="handleToolbar(item)">
|
v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
||||||
|
type="danger"
|
||||||
|
icon="delete"
|
||||||
|
:disabled="removeIds.length === 0"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 导入 -->
|
<!-- 导入 -->
|
||||||
<template v-else-if="item === 'import'">
|
<template v-else-if="item === 'import'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="default" icon="upload"
|
<el-button
|
||||||
@click="handleToolbar(item)">
|
v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
||||||
|
type="default"
|
||||||
|
icon="upload"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
>
|
||||||
导入
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 导出 -->
|
<!-- 导出 -->
|
||||||
<template v-else-if="item === 'export'">
|
<template v-else-if="item === 'export'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="default" icon="download"
|
<el-button
|
||||||
@click="handleToolbar(item)">
|
v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
||||||
|
type="default"
|
||||||
|
icon="download"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
>
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]" :icon="item.icon"
|
<el-button
|
||||||
:type="item.type ?? 'default'" @click="handleToolbar(item.name)">
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
|
:icon="item.icon"
|
||||||
|
:type="item.type ?? 'default'"
|
||||||
|
@click="handleToolbar(item.name)"
|
||||||
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -67,36 +88,68 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 导出 -->
|
<!-- 导出 -->
|
||||||
<template v-else-if="item === 'exports'">
|
<template v-else-if="item === 'exports'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:export`]" icon="download" circle title="导出"
|
<el-button
|
||||||
@click="handleToolbar(item)" />
|
v-hasPerm="[`${contentConfig.pageName}:export`]"
|
||||||
|
icon="download"
|
||||||
|
circle
|
||||||
|
title="导出"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<!-- 导入 -->
|
<!-- 导入 -->
|
||||||
<template v-else-if="item === 'imports'">
|
<template v-else-if="item === 'imports'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:import`]" icon="upload" circle title="导入"
|
<el-button
|
||||||
@click="handleToolbar(item)" />
|
v-hasPerm="[`${contentConfig.pageName}:import`]"
|
||||||
|
icon="upload"
|
||||||
|
circle
|
||||||
|
title="导入"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<template v-else-if="item === 'search'">
|
<template v-else-if="item === 'search'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:query`]" icon="search" circle title="搜索"
|
<el-button
|
||||||
@click="handleToolbar(item)" />
|
v-hasPerm="[`${contentConfig.pageName}:query`]"
|
||||||
|
icon="search"
|
||||||
|
circle
|
||||||
|
title="搜索"
|
||||||
|
@click="handleToolbar(item)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<template v-if="item.auth">
|
<template v-if="item.auth">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]" :icon="item.icon" circle
|
<el-button
|
||||||
:title="item.title" @click="handleToolbar(item.name)" />
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
|
:icon="item.icon"
|
||||||
|
circle
|
||||||
|
:title="item.title"
|
||||||
|
@click="handleToolbar(item.name)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-button :icon="item.icon" circle :title="item.title" @click="handleToolbar(item.name)" />
|
<el-button
|
||||||
|
:icon="item.icon"
|
||||||
|
circle
|
||||||
|
:title="item.title"
|
||||||
|
@click="handleToolbar(item.name)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<el-table ref="tableRef" v-loading="loading" v-bind="contentConfig.table" :data="pageData" :row-key="pk"
|
<el-table
|
||||||
@selection-change="handleSelectionChange" @filter-change="handleFilterChange">
|
ref="tableRef"
|
||||||
|
v-loading="loading"
|
||||||
|
v-bind="contentConfig.table"
|
||||||
|
:data="pageData"
|
||||||
|
:row-key="pk"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@filter-change="handleFilterChange"
|
||||||
|
>
|
||||||
<template v-for="col in cols" :key="col">
|
<template v-for="col in cols" :key="col">
|
||||||
<el-table-column v-if="col.show" v-bind="col">
|
<el-table-column v-if="col.show" v-bind="col">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|
@ -105,15 +158,24 @@
|
||||||
<template v-if="col.prop">
|
<template v-if="col.prop">
|
||||||
<template v-if="Array.isArray(scope.row[col.prop])">
|
<template v-if="Array.isArray(scope.row[col.prop])">
|
||||||
<template v-for="(item, index) in scope.row[col.prop]" :key="item">
|
<template v-for="(item, index) in scope.row[col.prop]" :key="item">
|
||||||
<el-image :src="item" :preview-src-list="scope.row[col.prop]" :initial-index="index"
|
<el-image
|
||||||
:preview-teleported="true" :style="`width: ${col.imageWidth ?? 40}px; height: ${col.imageHeight ?? 40
|
:src="item"
|
||||||
}px`" />
|
:preview-src-list="scope.row[col.prop]"
|
||||||
|
:initial-index="index"
|
||||||
|
:preview-teleported="true"
|
||||||
|
:style="`width: ${col.imageWidth ?? 40}px; height: ${
|
||||||
|
col.imageHeight ?? 40
|
||||||
|
}px`"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-image :src="scope.row[col.prop]" :preview-src-list="[scope.row[col.prop]]"
|
<el-image
|
||||||
|
:src="scope.row[col.prop]"
|
||||||
|
:preview-src-list="[scope.row[col.prop]]"
|
||||||
:preview-teleported="true"
|
:preview-teleported="true"
|
||||||
:style="`width: ${col.imageWidth ?? 40}px; height: ${col.imageHeight ?? 40}px`" />
|
:style="`width: ${col.imageWidth ?? 40}px; height: ${col.imageHeight ?? 40}px`"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -135,20 +197,30 @@
|
||||||
<template v-else-if="col.templet === 'switch'">
|
<template v-else-if="col.templet === 'switch'">
|
||||||
<template v-if="col.prop">
|
<template v-if="col.prop">
|
||||||
<!-- pageData.length>0: 解决el-switch组件会在表格初始化的时候触发一次change事件 -->
|
<!-- pageData.length>0: 解决el-switch组件会在表格初始化的时候触发一次change事件 -->
|
||||||
<el-switch v-model="scope.row[col.prop]" :active-value="col.activeValue ?? 1"
|
<el-switch
|
||||||
:inactive-value="col.inactiveValue ?? 0" :inline-prompt="true" :active-text="col.activeText ?? ''"
|
v-model="scope.row[col.prop]"
|
||||||
:inactive-text="col.inactiveText ?? ''" :validate-event="false"
|
:active-value="col.activeValue ?? 1"
|
||||||
:disabled="!hasAuth(`${contentConfig.pageName}:modify`)" @change="
|
:inactive-value="col.inactiveValue ?? 0"
|
||||||
|
:inline-prompt="true"
|
||||||
|
:active-text="col.activeText ?? ''"
|
||||||
|
:inactive-text="col.inactiveText ?? ''"
|
||||||
|
:validate-event="false"
|
||||||
|
:disabled="!hasAuth(`${contentConfig.pageName}:modify`)"
|
||||||
|
@change="
|
||||||
pageData.length > 0 && handleModify(col.prop, scope.row[col.prop], scope.row)
|
pageData.length > 0 && handleModify(col.prop, scope.row[col.prop], scope.row)
|
||||||
" />
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<!-- 生成输入框组件 -->
|
<!-- 生成输入框组件 -->
|
||||||
<template v-else-if="col.templet === 'input'">
|
<template v-else-if="col.templet === 'input'">
|
||||||
<template v-if="col.prop">
|
<template v-if="col.prop">
|
||||||
<el-input v-model="scope.row[col.prop]" :type="col.inputType ?? 'text'"
|
<el-input
|
||||||
|
v-model="scope.row[col.prop]"
|
||||||
|
:type="col.inputType ?? 'text'"
|
||||||
:disabled="!hasAuth(`${contentConfig.pageName}:modify`)"
|
:disabled="!hasAuth(`${contentConfig.pageName}:modify`)"
|
||||||
@blur="handleModify(col.prop, scope.row[col.prop], scope.row)" />
|
@blur="handleModify(col.prop, scope.row[col.prop], scope.row)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<!-- 格式化为价格 -->
|
<!-- 格式化为价格 -->
|
||||||
|
|
@ -191,15 +263,21 @@
|
||||||
<template v-if="typeof item === 'string'">
|
<template v-if="typeof item === 'string'">
|
||||||
<!-- 编辑/删除 -->
|
<!-- 编辑/删除 -->
|
||||||
<template v-if="item === 'edit' || item === 'delete'">
|
<template v-if="item === 'edit' || item === 'delete'">
|
||||||
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
<el-button
|
||||||
:type="item === 'edit' ? 'primary' : 'danger'" :icon="item" size="small" link @click="
|
v-hasPerm="[`${contentConfig.pageName}:${item}`]"
|
||||||
|
:type="item === 'edit' ? 'primary' : 'danger'"
|
||||||
|
:icon="item"
|
||||||
|
size="small"
|
||||||
|
link
|
||||||
|
@click="
|
||||||
handleOperat({
|
handleOperat({
|
||||||
name: item,
|
name: item,
|
||||||
row: scope.row,
|
row: scope.row,
|
||||||
column: scope.column,
|
column: scope.column,
|
||||||
$index: scope.$index,
|
$index: scope.$index,
|
||||||
})
|
})
|
||||||
">
|
"
|
||||||
|
>
|
||||||
{{ item === "edit" ? "编辑" : "删除" }}
|
{{ item === "edit" ? "编辑" : "删除" }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -207,20 +285,30 @@
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-dropdown>
|
<el-dropdown>
|
||||||
<el-button v-if="item.render === undefined || item.render(scope.row)" v-bind="item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
|
<el-button
|
||||||
" :icon="item.icon" :type="item.type ?? 'primary'" size="small" link @click="
|
v-if="item.render === undefined || item.render(scope.row)"
|
||||||
|
v-bind="
|
||||||
|
item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
|
||||||
|
"
|
||||||
|
:icon="item.icon"
|
||||||
|
:type="item.type ?? 'primary'"
|
||||||
|
size="small"
|
||||||
|
link
|
||||||
|
@click="
|
||||||
handleOperat({
|
handleOperat({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
row: scope.row,
|
row: scope.row,
|
||||||
column: scope.column,
|
column: scope.column,
|
||||||
$index: scope.$index,
|
$index: scope.$index,
|
||||||
})
|
})
|
||||||
">
|
"
|
||||||
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown v-if="item.options && item.options.length > 0">
|
<template #dropdown v-if="item.options && item.options.length > 0">
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="
|
<el-dropdown-item
|
||||||
|
@click="
|
||||||
handleOperat({
|
handleOperat({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
row: scope.row,
|
row: scope.row,
|
||||||
|
|
@ -228,7 +316,10 @@
|
||||||
$index: scope.$index,
|
$index: scope.$index,
|
||||||
command: opt.command ? opt.command : '',
|
command: opt.command ? opt.command : '',
|
||||||
})
|
})
|
||||||
" v-for="opt in item.options" :key="opt.value">
|
"
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.value"
|
||||||
|
>
|
||||||
{{ opt.label }}
|
{{ opt.label }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
|
|
@ -249,18 +340,33 @@
|
||||||
<template v-if="showPagination">
|
<template v-if="showPagination">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<div class="mt-[12px]">
|
<div class="mt-[12px]">
|
||||||
<el-pagination v-bind="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
<el-pagination
|
||||||
|
v-bind="pagination"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
<!-- 导出弹窗 -->
|
<!-- 导出弹窗 -->
|
||||||
<el-dialog v-model="exportsModalVisible" :align-center="true" title="导出数据" width="600px" style="padding-right: 0"
|
<el-dialog
|
||||||
@close="handleCloseExportsModal">
|
v-model="exportsModalVisible"
|
||||||
|
:align-center="true"
|
||||||
|
title="导出数据"
|
||||||
|
width="600px"
|
||||||
|
style="padding-right: 0"
|
||||||
|
@close="handleCloseExportsModal"
|
||||||
|
>
|
||||||
<!-- 滚动 -->
|
<!-- 滚动 -->
|
||||||
<el-scrollbar max-height="60vh">
|
<el-scrollbar max-height="60vh">
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<el-form ref="exportsFormRef" label-width="auto" style="padding-right: var(--el-dialog-padding-primary)"
|
<el-form
|
||||||
:model="exportsFormData" :rules="exportsFormRules">
|
ref="exportsFormRef"
|
||||||
|
label-width="auto"
|
||||||
|
style="padding-right: var(--el-dialog-padding-primary)"
|
||||||
|
:model="exportsFormData"
|
||||||
|
:rules="exportsFormRules"
|
||||||
|
>
|
||||||
<el-form-item label="文件名" prop="filename">
|
<el-form-item label="文件名" prop="filename">
|
||||||
<el-input v-model="exportsFormData.filename" clearable />
|
<el-input v-model="exportsFormData.filename" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -270,10 +376,16 @@
|
||||||
<el-form-item label="数据源" prop="origin">
|
<el-form-item label="数据源" prop="origin">
|
||||||
<el-select v-model="exportsFormData.origin">
|
<el-select v-model="exportsFormData.origin">
|
||||||
<el-option label="当前数据 (当前页的数据)" :value="ExportsOriginEnum.CURRENT" />
|
<el-option label="当前数据 (当前页的数据)" :value="ExportsOriginEnum.CURRENT" />
|
||||||
<el-option label="选中数据 (所有选中的数据)" :value="ExportsOriginEnum.SELECTED"
|
<el-option
|
||||||
:disabled="selectionData.length <= 0" />
|
label="选中数据 (所有选中的数据)"
|
||||||
<el-option label="全量数据 (所有分页的数据)" :value="ExportsOriginEnum.REMOTE"
|
:value="ExportsOriginEnum.SELECTED"
|
||||||
:disabled="contentConfig.exportsAction === undefined" />
|
:disabled="selectionData.length <= 0"
|
||||||
|
/>
|
||||||
|
<el-option
|
||||||
|
label="全量数据 (所有分页的数据)"
|
||||||
|
:value="ExportsOriginEnum.REMOTE"
|
||||||
|
:disabled="contentConfig.exportsAction === undefined"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="字段" prop="fields">
|
<el-form-item label="字段" prop="fields">
|
||||||
|
|
@ -294,17 +406,35 @@
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 导入弹窗 -->
|
<!-- 导入弹窗 -->
|
||||||
<el-dialog v-model="importModalVisible" :align-center="true" title="导入数据" width="600px" style="padding-right: 0"
|
<el-dialog
|
||||||
@close="handleCloseImportModal">
|
v-model="importModalVisible"
|
||||||
|
:align-center="true"
|
||||||
|
title="导入数据"
|
||||||
|
width="600px"
|
||||||
|
style="padding-right: 0"
|
||||||
|
@close="handleCloseImportModal"
|
||||||
|
>
|
||||||
<!-- 滚动 -->
|
<!-- 滚动 -->
|
||||||
<el-scrollbar max-height="60vh">
|
<el-scrollbar max-height="60vh">
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<el-form ref="importFormRef" label-width="auto" style="padding-right: var(--el-dialog-padding-primary)"
|
<el-form
|
||||||
:model="importFormData" :rules="importFormRules">
|
ref="importFormRef"
|
||||||
|
label-width="auto"
|
||||||
|
style="padding-right: var(--el-dialog-padding-primary)"
|
||||||
|
:model="importFormData"
|
||||||
|
:rules="importFormRules"
|
||||||
|
>
|
||||||
<el-form-item label="文件名" prop="files">
|
<el-form-item label="文件名" prop="files">
|
||||||
<el-upload ref="uploadRef" v-model:file-list="importFormData.files" class="w-full"
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
v-model:file-list="importFormData.files"
|
||||||
|
class="w-full"
|
||||||
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||||
:drag="true" :limit="1" :auto-upload="false" :on-exceed="handleFileExceed">
|
:drag="true"
|
||||||
|
:limit="1"
|
||||||
|
:auto-upload="false"
|
||||||
|
:on-exceed="handleFileExceed"
|
||||||
|
>
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
<div class="el-upload__text">
|
<div class="el-upload__text">
|
||||||
<span>将文件拖到此处,或</span>
|
<span>将文件拖到此处,或</span>
|
||||||
|
|
@ -313,8 +443,13 @@
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<div class="el-upload__tip">
|
<div class="el-upload__tip">
|
||||||
*.xlsx / *.xls
|
*.xlsx / *.xls
|
||||||
<el-link v-if="contentConfig.importTemplate" type="primary" icon="download" :underline="false"
|
<el-link
|
||||||
@click="handleDownloadTemplate">
|
v-if="contentConfig.importTemplate"
|
||||||
|
type="primary"
|
||||||
|
icon="download"
|
||||||
|
:underline="false"
|
||||||
|
@click="handleDownloadTemplate"
|
||||||
|
>
|
||||||
下载模板
|
下载模板
|
||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -326,7 +461,11 @@
|
||||||
<!-- 弹窗底部操作按钮 -->
|
<!-- 弹窗底部操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div style="padding-right: var(--el-dialog-padding-primary)">
|
<div style="padding-right: var(--el-dialog-padding-primary)">
|
||||||
<el-button type="primary" :disabled="importFormData.files.length === 0" @click="handleImportSubmit">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="importFormData.files.length === 0"
|
||||||
|
@click="handleImportSubmit"
|
||||||
|
>
|
||||||
确 定
|
确 定
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="handleCloseImportModal">取 消</el-button>
|
<el-button @click="handleCloseImportModal">取 消</el-button>
|
||||||
|
|
@ -743,7 +882,7 @@ function handleOperat(data: IOperatData) {
|
||||||
|
|
||||||
// 属性修改
|
// 属性修改
|
||||||
function handleModify(field: string, value: boolean | string | number, row: Record<string, any>) {
|
function handleModify(field: string, value: boolean | string | number, row: Record<string, any>) {
|
||||||
console.log(1111111111111111111111111)
|
console.log(1111111111111111111111111);
|
||||||
if (props.contentConfig.modifyAction) {
|
if (props.contentConfig.modifyAction) {
|
||||||
props.contentConfig.modifyAction({
|
props.contentConfig.modifyAction({
|
||||||
[pk]: row[pk],
|
[pk]: row[pk],
|
||||||
|
|
@ -810,7 +949,6 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
|
||||||
: formData
|
: formData
|
||||||
)
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
||||||
if (showPagination) {
|
if (showPagination) {
|
||||||
if (props.contentConfig.parseData) {
|
if (props.contentConfig.parseData) {
|
||||||
data = props.contentConfig.parseData(data);
|
data = props.contentConfig.parseData(data);
|
||||||
|
|
@ -871,7 +1009,7 @@ function saveXlsx(fileData: BlobPart, fileName: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露的属性和方法
|
// 暴露的属性和方法
|
||||||
defineExpose({ fetchPageData, exportPageData, getFilterParams, getselectTable });
|
defineExpose({ fetchPageData, exportPageData, getFilterParams, getselectTable, pagination });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ const contentConfig: IContentConfig = {
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 300,
|
width: 300,
|
||||||
templet: "tool",
|
templet: "custom",
|
||||||
|
slotName: 'tools',
|
||||||
operat: [
|
operat: [
|
||||||
{
|
{
|
||||||
text: "查看明细",
|
text: "查看明细",
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,76 @@
|
||||||
style="margin-left: 2px"
|
style="margin-left: 2px"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #tools="scope">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
handleOperatClick({
|
||||||
|
name: 'detail',
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
查看明细
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" link size="small" @click="handleEditClick(scope.row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
:style="{ color: scope.row.repaymentMethod == 'order' ? '#999' : '' }"
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
handleOperatClick({
|
||||||
|
name: 'huankuan',
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
还款
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
handleOperatClick({
|
||||||
|
name: 'huankuan_detail',
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
还款记录
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
handleOperatClick({
|
||||||
|
name: 'delete',
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
|
|
@ -74,7 +144,7 @@ import contentConfig from "./config/content";
|
||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
contentRef,
|
contentRef,
|
||||||
|
|
@ -124,7 +194,7 @@ async function handleOperatClick(data: IOperatData) {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data.name == "huankuan") {
|
if (data.name == "huankuan" && data.row.repaymentMethod == "total") {
|
||||||
refHuanKuanShow(data.row, {});
|
refHuanKuanShow(data.row, {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -132,6 +202,23 @@ async function handleOperatClick(data: IOperatData) {
|
||||||
refHuanKuanRecordShow(data.row, {});
|
refHuanKuanRecordShow(data.row, {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (data.name == "delete") {
|
||||||
|
ElMessageBox.alert("是否删除挂账人" + data.row.debtor + "?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
callback: async (action: string) => {
|
||||||
|
if (action == "confirm") {
|
||||||
|
const res = await creditApi.delete(data.row.id);
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 还款
|
// 还款
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
<template>
|
||||||
|
<div class="DataStatistics">
|
||||||
|
<div style="width: 200px">
|
||||||
|
<el-icon class="iconStyle">
|
||||||
|
<UserFilled />
|
||||||
|
</el-icon>
|
||||||
|
<span>耗材种数</span>
|
||||||
|
<span class="font-700">{{ data.totalRow || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<div style="width: 300px">
|
||||||
|
<el-icon class="iconStyle">
|
||||||
|
<UserFilled />
|
||||||
|
</el-icon>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>增加数量:</span>
|
||||||
|
<span class="num">{{ data.inSumTotal || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex">
|
||||||
|
<div>
|
||||||
|
<span>手动增加:</span>
|
||||||
|
<span class="num">{{ data.winInNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||||
|
<div>
|
||||||
|
<span>入库:</span>
|
||||||
|
<span class="num">{{ data.stockInNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 500px">
|
||||||
|
<el-icon class="iconStyle">
|
||||||
|
<UserFilled />
|
||||||
|
</el-icon>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>减少数量:</span>
|
||||||
|
<span class="num">{{ data.outSumTotal || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex">
|
||||||
|
<div>
|
||||||
|
<span>手动减少:</span>
|
||||||
|
<span class="num">{{ data.lossOutNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||||
|
<div>
|
||||||
|
<span>消耗:</span>
|
||||||
|
<span class="num">{{ data.consumeNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||||
|
<div>
|
||||||
|
<span>报损:</span>
|
||||||
|
<span class="num">{{ data.damageNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||||
|
<div>
|
||||||
|
<span>出库:</span>
|
||||||
|
<span class="num">{{ data.stockOutNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.DataStatistics {
|
||||||
|
border: 1px solid #e4e7ed;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
height: 80px;
|
||||||
|
background-color: #f4f9ff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
.iconStyle {
|
||||||
|
background-color: #d4e9fe;
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 6px;
|
||||||
|
font-size: 36px;
|
||||||
|
color: #3f9eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
&.num {
|
||||||
|
color: #3f9eff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -5,9 +5,11 @@
|
||||||
<page-search
|
<page-search
|
||||||
ref="searchRef"
|
ref="searchRef"
|
||||||
:search-config="searchConfig"
|
:search-config="searchConfig"
|
||||||
@query-click="handleQueryClick"
|
@query-click="newHandleQueryClick"
|
||||||
@reset-click="handleResetClick"
|
@reset-click="handleResetClick"
|
||||||
/>
|
/>
|
||||||
|
<!-- 统计 -->
|
||||||
|
<data-tongji :data="gongjiData"></data-tongji>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content
|
<page-content
|
||||||
ref="contentRef"
|
ref="contentRef"
|
||||||
|
|
@ -92,15 +94,15 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import addHaocai from "./components/add-haocai.vue";
|
import addHaocai from "./components/add-haocai.vue";
|
||||||
|
import dataTongji from "./components/DataStatistics.vue";
|
||||||
import addConsTakin from "./components/addConsTakin.vue";
|
import addConsTakin from "./components/addConsTakin.vue";
|
||||||
import orderApi, { type getListResponse, OrderInfoVo } from "@/api/order/order";
|
import consApi from "@/api/product/cons";
|
||||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||||
import usePage from "@/components/CURD/usePage";
|
import usePage from "@/components/CURD/usePage";
|
||||||
import contentConfig from "./config/content";
|
import contentConfig from "./config/content";
|
||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
|
|
@ -113,6 +115,26 @@ const {
|
||||||
handleSearchClick,
|
handleSearchClick,
|
||||||
handleFilterChange,
|
handleFilterChange,
|
||||||
} = usePage();
|
} = usePage();
|
||||||
|
//统计数据
|
||||||
|
const gongjiData = reactive({ totalRow: 0 });
|
||||||
|
function getTongji(params: IObject | undefined) {
|
||||||
|
consApi.statistics(params).then((res) => {
|
||||||
|
Object.assign(gongjiData, res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function newHandleQueryClick(e: IObject | undefined) {
|
||||||
|
const filterParams = contentRef.value?.getFilterParams();
|
||||||
|
contentRef.value?.fetchPageData({ ...e, ...filterParams }, true);
|
||||||
|
getTongji(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => contentRef.value?.pagination.total,
|
||||||
|
(newval) => {
|
||||||
|
gongjiData.totalRow = newval as number;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
//耗材盘点
|
//耗材盘点
|
||||||
const refAddHaocaiTakin = ref();
|
const refAddHaocaiTakin = ref();
|
||||||
|
|
@ -123,14 +145,15 @@ function refAddHaocaiTakinShow(item: any) {
|
||||||
function refresh() {
|
function refresh() {
|
||||||
console.log("refresh");
|
console.log("refresh");
|
||||||
contentRef.value?.fetchPageData();
|
contentRef.value?.fetchPageData();
|
||||||
|
getTongji(undefined);
|
||||||
}
|
}
|
||||||
const refAddHaocai = ref();
|
const refAddHaocai = ref();
|
||||||
function refAddHaocaiOpen(item) {
|
function refAddHaocaiOpen(item: any) {
|
||||||
refAddHaocai.value.open(item);
|
refAddHaocai.value.open(item);
|
||||||
}
|
}
|
||||||
// 新增
|
// 新增
|
||||||
async function handleAddClick() {
|
async function handleAddClick() {
|
||||||
refAddHaocaiOpen();
|
refAddHaocaiOpen(undefined);
|
||||||
}
|
}
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEditClick(row: IObject) {
|
async function handleEditClick(row: IObject) {
|
||||||
|
|
@ -184,29 +207,9 @@ function returnStateType(status: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = useRouter();
|
onMounted(() => {
|
||||||
// 结账
|
getTongji({});
|
||||||
function toPayOrder(order: getListResponse) {
|
});
|
||||||
route.push({
|
|
||||||
path: "/tool/index",
|
|
||||||
query: {
|
|
||||||
id: order.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//详情
|
|
||||||
const refDetail = ref();
|
|
||||||
function showdetail(row: OrderInfoVo) {
|
|
||||||
refDetail.value.show(row);
|
|
||||||
}
|
|
||||||
function toGoods(id: number) {
|
|
||||||
router.push({
|
|
||||||
path: "/product/index",
|
|
||||||
query: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -205,9 +205,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
let isXianFuKuan = computed(() => {
|
let isXianFuKuan = computed(() => {
|
||||||
if (!props.table.tableCode) {
|
// if (!props.table.tableCode) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
return shopUser.userInfo.registerType === "before" ? true : false;
|
return shopUser.userInfo.registerType === "before" ? true : false;
|
||||||
});
|
});
|
||||||
const canWeiFee = computed(() => {
|
const canWeiFee = computed(() => {
|
||||||
|
|
|
||||||
|
|
@ -579,7 +579,8 @@ let goodsMapisFinish = ref(false);
|
||||||
async function getGoods() {
|
async function getGoods() {
|
||||||
const res = await productApi.getPage({
|
const res = await productApi.getPage({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 200,
|
size: 400,
|
||||||
|
status: "on_sale",
|
||||||
...goods.query,
|
...goods.query,
|
||||||
});
|
});
|
||||||
goods.list = res.records;
|
goods.list = res.records;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue