feat: 耗材补充修改
This commit is contained in:
parent
11b297baa5
commit
95f22ede1d
|
|
@ -0,0 +1,51 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Product_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Product_BaseUrl + "/admin/product";
|
||||||
|
// 供应商
|
||||||
|
const Api = {
|
||||||
|
/** 耗材库存变动记录*/
|
||||||
|
getList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/stock/flow`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 全部*/
|
||||||
|
getAllList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/list`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
get(id: string | number) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/` + id,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add(data: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
edit(data: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
delete(id: string | number) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/` + id,
|
||||||
|
method: "delete",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Api;
|
||||||
|
|
@ -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>
|
||||||
<!-- 格式化为价格 -->
|
<!-- 格式化为价格 -->
|
||||||
|
|
@ -180,7 +252,7 @@
|
||||||
{{
|
{{
|
||||||
scope.row[col.prop]
|
scope.row[col.prop]
|
||||||
? useDateFormat(scope.row[col.prop], col.dateFormat ?? "YYYY-MM-DD HH:mm:ss")
|
? useDateFormat(scope.row[col.prop], col.dateFormat ?? "YYYY-MM-DD HH:mm:ss")
|
||||||
.value
|
.value
|
||||||
: ""
|
: ""
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -191,56 +263,82 @@
|
||||||
<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>
|
||||||
</template>
|
</template>
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button v-if="item.isBtn" v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]" :icon="item.icon"
|
<el-button
|
||||||
:type="item.type ?? 'primary'" size="small" link @click="
|
v-if="item.isBtn"
|
||||||
|
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>
|
||||||
|
|
||||||
<el-dropdown style="margin-top: 4px" v-else>
|
<el-dropdown v-else style="margin-top: 4px">
|
||||||
<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 v-if="item.options && item.options.length > 0" #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="
|
<el-dropdown-item
|
||||||
handleOperat({
|
v-for="opt in item.options"
|
||||||
name: item.name,
|
:key="opt.value"
|
||||||
row: scope.row,
|
@click="
|
||||||
column: scope.column,
|
handleOperat({
|
||||||
$index: scope.$index,
|
name: item.name,
|
||||||
command: opt.command ? opt.command : '',
|
row: scope.row,
|
||||||
})
|
column: scope.column,
|
||||||
" v-for="opt in item.options" :key="opt.value">
|
$index: scope.$index,
|
||||||
|
command: opt.command ? opt.command : '',
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
{{ opt.label }}
|
{{ opt.label }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
|
|
@ -261,18 +359,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>
|
||||||
|
|
@ -282,10 +395,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">
|
||||||
|
|
@ -306,17 +425,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>
|
||||||
|
|
@ -325,8 +462,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>
|
||||||
|
|
@ -338,7 +480,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>
|
||||||
|
|
@ -814,10 +960,10 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
|
||||||
.indexAction(
|
.indexAction(
|
||||||
showPagination
|
showPagination
|
||||||
? {
|
? {
|
||||||
[request.pageName]: pagination.currentPage,
|
[request.pageName]: pagination.currentPage,
|
||||||
[request.limitName]: pagination.pageSize,
|
[request.limitName]: pagination.pageSize,
|
||||||
...formData,
|
...formData,
|
||||||
}
|
}
|
||||||
: formData
|
: formData
|
||||||
)
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
@ -880,7 +1026,7 @@ function saveXlsx(fileData: BlobPart, fileName: string) {
|
||||||
window.URL.revokeObjectURL(downloadUrl);
|
window.URL.revokeObjectURL(downloadUrl);
|
||||||
}
|
}
|
||||||
function test(rows: any[]) {
|
function test(rows: any[]) {
|
||||||
console.log(tableRef, 'tioshi222222222222222222222')
|
console.log(tableRef, "tioshi222222222222222222222");
|
||||||
// rows.forEach((row) => {
|
// rows.forEach((row) => {
|
||||||
// tableRef.value!.toggleRowSelection(row, undefined)
|
// tableRef.value!.toggleRowSelection(row, undefined)
|
||||||
// })
|
// })
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<stockHistory ref="refStockHistory"></stockHistory>
|
<stockHistory ref="refStockHistory" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -97,7 +97,6 @@ function refStockHistoryShow(key) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.DataStatistics {
|
.DataStatistics {
|
||||||
border: 1px solid #e4e7ed;
|
border: 1px solid #e4e7ed;
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ const contentConfig: IContentConfig = {
|
||||||
pageSizes: [10, 20, 30, 50],
|
pageSizes: [10, 20, 30, 50],
|
||||||
},
|
},
|
||||||
indexAction: function (params) {
|
indexAction: function (params) {
|
||||||
let obj = { ...params }
|
let obj = { ...params };
|
||||||
if (obj.createAt) {
|
if (obj.createAt) {
|
||||||
obj.beginTime = obj.createAt[0]
|
obj.beginTime = obj.createAt[0];
|
||||||
obj.endTime = obj.createAt[1]
|
obj.endTime = obj.createAt[1];
|
||||||
delete obj.createAt
|
delete obj.createAt;
|
||||||
}
|
}
|
||||||
return Api.getList(obj);
|
return Api.getList(obj);
|
||||||
},
|
},
|
||||||
|
|
@ -30,23 +30,43 @@ const contentConfig: IContentConfig = {
|
||||||
"add",
|
"add",
|
||||||
{
|
{
|
||||||
text: "入库",
|
text: "入库",
|
||||||
name: 'ruku',
|
name: "ruku",
|
||||||
auth: 'ruku'
|
auth: "ruku",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "出库",
|
text: "出库",
|
||||||
name: 'chuku',
|
name: "chuku",
|
||||||
auth: ''
|
auth: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "报损",
|
||||||
|
name: "reportinglosses",
|
||||||
|
auth: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "分类管理",
|
text: "分类管理",
|
||||||
name: 'category',
|
name: "category",
|
||||||
auth: ''
|
auth: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "供应商管理",
|
text: "供应商管理",
|
||||||
name: 'gongyinsahng',
|
name: "gongyinsahng",
|
||||||
auth: ''
|
auth: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "入库记录",
|
||||||
|
name: "manual-in",
|
||||||
|
auth: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "出库记录",
|
||||||
|
name: "manual-out",
|
||||||
|
auth: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "报损记录",
|
||||||
|
name: "damage-out",
|
||||||
|
auth: "",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
defaultToolbar: ["refresh", "filter", "search"],
|
defaultToolbar: ["refresh", "filter", "search"],
|
||||||
|
|
@ -68,8 +88,8 @@ const contentConfig: IContentConfig = {
|
||||||
{
|
{
|
||||||
label: "所属商品",
|
label: "所属商品",
|
||||||
align: "center",
|
align: "center",
|
||||||
templet: 'custom',
|
templet: "custom",
|
||||||
slotName: 'goods'
|
slotName: "goods",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "库存数量",
|
label: "库存数量",
|
||||||
|
|
@ -94,7 +114,7 @@ const contentConfig: IContentConfig = {
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 150,
|
width: 150,
|
||||||
templet: "custom",
|
templet: "custom",
|
||||||
slotName: 'operate'
|
slotName: "operate",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
@reset-click="handleResetClick"
|
@reset-click="handleResetClick"
|
||||||
/>
|
/>
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<data-tongji :data="gongjiData"></data-tongji>
|
<data-tongji :data="gongjiData" />
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content
|
<page-content
|
||||||
ref="contentRef"
|
ref="contentRef"
|
||||||
|
|
@ -35,24 +35,24 @@
|
||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<el-button
|
<el-button
|
||||||
v-for="item in scope.row.productList"
|
v-for="item in scope.row.productList"
|
||||||
@click="toGoods(item.id)"
|
|
||||||
:key="item.productId"
|
:key="item.productId"
|
||||||
type="text"
|
type="text"
|
||||||
|
@click="toGoods(item.id)"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<span v-if="scope.row.productList.length > 1">,</span>
|
<span v-if="scope.row.productList.length > 1">,</span>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown trigger="click" v-if="scope.row.productList.length > 1" @command="toGoods">
|
<el-dropdown v-if="scope.row.productList.length > 1" trigger="click" @command="toGoods">
|
||||||
<span class="el-dropdown-link" style="color: blue">
|
<span class="el-dropdown-link" style="color: blue">
|
||||||
<el-icon><CaretBottom /></el-icon>
|
<el-icon><CaretBottom /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
class="clearfix"
|
|
||||||
v-for="item in scope.row.productList"
|
v-for="item in scope.row.productList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
class="clearfix"
|
||||||
:command="item.id"
|
:command="item.id"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
|
|
@ -80,18 +80,31 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #operate="scope">
|
<template #operate="scope">
|
||||||
<div>
|
<div
|
||||||
<el-button @click="refAddHaocaiOpen(scope.row)" type="primary" link>编辑</el-button>
|
style="
|
||||||
<el-button @click="refAddHaocaiTakinShow(scope.row)" link type="primary">
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<el-button type="primary" link @click="refAddHaocaiOpen(scope.row)">编辑</el-button>
|
||||||
|
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
|
||||||
耗材盘点
|
耗材盘点
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'manual-in')">
|
||||||
|
入库记录
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'delete')">
|
||||||
|
删除
|
||||||
|
</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
<!-- 耗材添加编辑 -->
|
<!-- 耗材添加编辑 -->
|
||||||
<add-haocai ref="refAddHaocai" @refresh="refresh"></add-haocai>
|
<add-haocai ref="refAddHaocai" @refresh="refresh" />
|
||||||
<!-- 耗材盘点 -->
|
<!-- 耗材盘点 -->
|
||||||
<addConsTakin ref="refAddHaocaiTakin" @success="refresh"></addConsTakin>
|
<addConsTakin ref="refAddHaocaiTakin" @success="refresh" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -152,7 +165,20 @@ watch(
|
||||||
|
|
||||||
//耗材盘点
|
//耗材盘点
|
||||||
const refAddHaocaiTakin = ref();
|
const refAddHaocaiTakin = ref();
|
||||||
function refAddHaocaiTakinShow(item: any) {
|
function refAddHaocaiTakinShow(item: any, type: string) {
|
||||||
|
console.log(item);
|
||||||
|
if (type === "manual-in") {
|
||||||
|
router.push({ path: "/inventory/libraryrecords", query: { type: type, conId: item.id } });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (type === "delete") {
|
||||||
|
refAddHaocaiTakin.value.show(item, type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (type === "consumables") {
|
||||||
|
refAddHaocaiTakin.value.show(item, type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
refAddHaocaiTakin.value.show(item);
|
refAddHaocaiTakin.value.show(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,6 +221,10 @@ function handleToolbarClick(name: string) {
|
||||||
router.push({ path: "/inventory/operation_in", query: { type: "out" } });
|
router.push({ path: "/inventory/operation_in", query: { type: "out" } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
|
||||||
|
router.push({ path: "/inventory/libraryrecords", query: { type: name } });
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 其他操作列
|
// 其他操作列
|
||||||
async function handleOperatClick(data: IOperatData) {
|
async function handleOperatClick(data: IOperatData) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
import Api from "@/api/product/vendor";
|
||||||
|
import { returnOptions, switchAttr } from "./config";
|
||||||
|
import type { IModalConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
|
const modalConfig: IModalConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
dialog: {
|
||||||
|
title: "添加供应商",
|
||||||
|
width: 800,
|
||||||
|
draggable: true,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
labelWidth: 140,
|
||||||
|
},
|
||||||
|
formAction: function (data) {
|
||||||
|
return Api.add({ ...data });
|
||||||
|
},
|
||||||
|
beforeSubmit(data) {
|
||||||
|
console.log("提交之前处理", data);
|
||||||
|
},
|
||||||
|
formItems: [
|
||||||
|
|
||||||
|
{
|
||||||
|
label: "名称",
|
||||||
|
prop: "name",
|
||||||
|
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入名称",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "联系人名字",
|
||||||
|
prop: "contactName",
|
||||||
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入联系人名字",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "联系人电话",
|
||||||
|
prop: "telephone",
|
||||||
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入联系人名字",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "供应商地址",
|
||||||
|
prop: "address",
|
||||||
|
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入供应商地址",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "备注",
|
||||||
|
prop: "remark",
|
||||||
|
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入备注",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "排序",
|
||||||
|
prop: "sort",
|
||||||
|
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
||||||
|
type: "input-number",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入排序",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
||||||
|
export default reactive(modalConfig);
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
export interface options {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
export interface optionObject {
|
||||||
|
[property: string]: options[];
|
||||||
|
}
|
||||||
|
const options: optionObject = {
|
||||||
|
payType: [
|
||||||
|
{ label: "现金", value: "cash" },
|
||||||
|
{ label: "微信", value: "weixin" },
|
||||||
|
{ label: "银行卡", value: "bank" },
|
||||||
|
{ label: "会员支付", value: "member-account" },
|
||||||
|
{ label: "支付宝", value: "alipay" },
|
||||||
|
{ label: "刷卡", value: "deposit" },
|
||||||
|
{ label: "挂账", value: "arrears" },
|
||||||
|
{ label: "刷卡", value: "deposit" },
|
||||||
|
{ label: "储值", value: "member-account" },
|
||||||
|
{ label: "自定义", value: "virtual" },
|
||||||
|
],
|
||||||
|
isIdeal: [
|
||||||
|
{ label: "否", value: 0 },
|
||||||
|
{ label: "是", value: 1 },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const switchAttr = {
|
||||||
|
"active-value": 1,
|
||||||
|
"inactive-value": 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type optionsType = string;
|
||||||
|
|
||||||
|
export function returnOptions(type: optionsType) {
|
||||||
|
return options[type];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
|
||||||
|
const options = returnOptions(optionsType);
|
||||||
|
if (!options) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const option = options.find((item) => item.value === value);
|
||||||
|
return option ? option.label : "";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
import Api from "@/api/product/libraryrecords";
|
||||||
|
import type { IContentConfig } from "@/components/CURD/types";
|
||||||
|
import { log } from "console";
|
||||||
|
|
||||||
|
const contentConfig: IContentConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
table: {
|
||||||
|
border: true,
|
||||||
|
highlightCurrentRow: true,
|
||||||
|
},
|
||||||
|
pagination: {
|
||||||
|
background: true,
|
||||||
|
layout: "prev,pager,next,jumper,total,sizes",
|
||||||
|
pageSize: 20,
|
||||||
|
pageSizes: [10, 20, 30, 50],
|
||||||
|
},
|
||||||
|
indexAction: function (params) {
|
||||||
|
console.log("params", params);
|
||||||
|
return Api.getList(params);
|
||||||
|
},
|
||||||
|
deleteAction: function (id) {
|
||||||
|
return Api.delete(id);
|
||||||
|
},
|
||||||
|
modifyAction: function (data) {
|
||||||
|
return Api.edit(data);
|
||||||
|
},
|
||||||
|
indexActionData: {},
|
||||||
|
pk: "id",
|
||||||
|
toolbar: [
|
||||||
|
// {
|
||||||
|
// text: "入库记录",
|
||||||
|
// name: "manual-in",
|
||||||
|
// auth: "",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: "出库记录",
|
||||||
|
// name: "manual-out",
|
||||||
|
// auth: "",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: "报损记录",
|
||||||
|
// name: "damage-out",
|
||||||
|
// auth: "",
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
defaultToolbar: ["refresh", "filter", "search"],
|
||||||
|
cols: [
|
||||||
|
// { type: "selection", width: 50, align: "center" },
|
||||||
|
{
|
||||||
|
label: "耗材名称",
|
||||||
|
align: "center",
|
||||||
|
prop: "conName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "单位",
|
||||||
|
align: "center",
|
||||||
|
prop: "unitName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "变动前的库存",
|
||||||
|
align: "center",
|
||||||
|
prop: "beforeNumber",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "出入库数量",
|
||||||
|
align: "center",
|
||||||
|
prop: "inOutNumber",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "变动后的库存",
|
||||||
|
align: "center",
|
||||||
|
prop: "afterNumber",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "创建时间",
|
||||||
|
align: "center",
|
||||||
|
prop: "createTime",
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: "操作",
|
||||||
|
// align: "center",
|
||||||
|
// fixed: "right",
|
||||||
|
// width: 280,
|
||||||
|
// templet: "tool",
|
||||||
|
// operat: ["edit", "delete"],
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default contentConfig;
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
import Api from "@/api/product/vendor";
|
||||||
|
import { returnOptions, switchAttr } from "./config";
|
||||||
|
import type { IModalConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
|
const modalConfig: IModalConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
dialog: {
|
||||||
|
title: "编辑供应商",
|
||||||
|
width: 800,
|
||||||
|
draggable: true,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
labelWidth: 140,
|
||||||
|
},
|
||||||
|
formAction: function (data) {
|
||||||
|
return Api.edit({ ...data });
|
||||||
|
},
|
||||||
|
beforeSubmit(data) {
|
||||||
|
console.log("提交之前处理", data);
|
||||||
|
},
|
||||||
|
formItems: [
|
||||||
|
{
|
||||||
|
label: "名称",
|
||||||
|
prop: "name",
|
||||||
|
rules: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入名称",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "联系人名字",
|
||||||
|
prop: "contactName",
|
||||||
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入联系人名字",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "联系人电话",
|
||||||
|
prop: "telephone",
|
||||||
|
rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入联系人名字",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "供应商地址",
|
||||||
|
prop: "address",
|
||||||
|
rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入供应商地址",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "备注",
|
||||||
|
prop: "remark",
|
||||||
|
rules: [{ required: false, message: "请输入备注", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入备注",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "排序",
|
||||||
|
prop: "sort",
|
||||||
|
rules: [{ required: true, message: "请输入排序", trigger: "blur" }],
|
||||||
|
type: "input-number",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入排序",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
||||||
|
export default reactive(modalConfig);
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
|
const searchConfig: ISearchConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
isExpandable: false,
|
||||||
|
formItems: [
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "类型",
|
||||||
|
prop: "inOutItem",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: "增加",
|
||||||
|
value: "in",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "减少",
|
||||||
|
value: "out",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "名目",
|
||||||
|
prop: "inOutType",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
initialValue: "",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: "入库记录",
|
||||||
|
value: "manual-in",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "出库记录",
|
||||||
|
value: "manual-out",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "报损记录",
|
||||||
|
value: "damage-out",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default searchConfig;
|
||||||
|
|
@ -0,0 +1,117 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<page-search
|
||||||
|
ref="searchRef"
|
||||||
|
:search-config="searchConfig"
|
||||||
|
@query-click="handleQueryClick"
|
||||||
|
@reset-click="handleResetClick"
|
||||||
|
/>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<page-content
|
||||||
|
ref="contentRef"
|
||||||
|
:content-config="contentConfig"
|
||||||
|
@add-click="handleAddClick"
|
||||||
|
@edit-click="handleEditClick"
|
||||||
|
@export-click="handleExportClick"
|
||||||
|
@search-click="handleSearchClick"
|
||||||
|
@toolbar-click="handleToolbarClick"
|
||||||
|
@operat-click="handleOperatClick"
|
||||||
|
@filter-change="handleFilterChange"
|
||||||
|
>
|
||||||
|
<template #status="scope">
|
||||||
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #switch="scope">
|
||||||
|
<el-switch v-model="scope.row[scope.prop]" disabled :active-value="1" :inactive-value="0" />
|
||||||
|
</template>
|
||||||
|
<template #mobile="scope">
|
||||||
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
|
<copy-button
|
||||||
|
v-if="scope.row[scope.prop]"
|
||||||
|
:text="scope.row[scope.prop]"
|
||||||
|
style="margin-left: 2px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</page-content>
|
||||||
|
|
||||||
|
<!-- 新增 -->
|
||||||
|
<page-modal
|
||||||
|
ref="addModalRef"
|
||||||
|
:modal-config="addModalConfig"
|
||||||
|
@submit-click="handleSubmitClick"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 编辑 -->
|
||||||
|
<page-modal
|
||||||
|
ref="editModalRef"
|
||||||
|
:modal-config="editModalConfig"
|
||||||
|
@submit-click="handleSubmitClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import VersionApi from "@/api/system/version";
|
||||||
|
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||||
|
import usePage from "@/components/CURD/usePage";
|
||||||
|
import addModalConfig from "./config/add";
|
||||||
|
import contentConfig from "./config/content";
|
||||||
|
import editModalConfig from "./config/edit";
|
||||||
|
import searchConfig from "./config/search";
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchRef,
|
||||||
|
contentRef,
|
||||||
|
addModalRef,
|
||||||
|
editModalRef,
|
||||||
|
handleQueryClick,
|
||||||
|
handleResetClick,
|
||||||
|
// handleAddClick,
|
||||||
|
// handleEditClick,
|
||||||
|
handleSubmitClick,
|
||||||
|
handleExportClick,
|
||||||
|
handleSearchClick,
|
||||||
|
handleFilterChange,
|
||||||
|
} = usePage();
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const Query = route.query || "";
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (Query.type) {
|
||||||
|
searchRef.value?.setQueryValue("inOutType", Query.type);
|
||||||
|
}
|
||||||
|
if (Query.conId) {
|
||||||
|
searchRef.value?.setQueryValue("conId", Query.conId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
async function handleAddClick() {
|
||||||
|
addModalRef.value?.setModalVisible();
|
||||||
|
// addModalConfig.formItems[2]!.attrs!.data =
|
||||||
|
}
|
||||||
|
// 编辑
|
||||||
|
async function handleEditClick(row: IObject) {
|
||||||
|
editModalRef.value?.handleDisabled(false);
|
||||||
|
editModalRef.value?.setModalVisible();
|
||||||
|
// 根据id获取数据进行填充
|
||||||
|
console.log(row);
|
||||||
|
editModalRef.value?.setFormData({ ...row });
|
||||||
|
}
|
||||||
|
1;
|
||||||
|
// 其他工具栏
|
||||||
|
function handleToolbarClick(name: string) {
|
||||||
|
console.log(name);
|
||||||
|
if (name === "custom1") {
|
||||||
|
ElMessage.success("点击了自定义1按钮");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 其他操作列
|
||||||
|
async function handleOperatClick(data: IOperatData) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="类型">
|
<el-form-item label="类型">
|
||||||
<el-radio-group :model-value="type">
|
<el-radio-group :model-value="type" @change="tabChange">
|
||||||
<el-radio-button value="in">入库</el-radio-button>
|
<el-radio-button value="in">入库</el-radio-button>
|
||||||
<el-radio-button value="out">出库</el-radio-button>
|
<el-radio-button value="out">出库</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
@ -27,11 +27,11 @@
|
||||||
@change="changeTypeEnum"
|
@change="changeTypeEnum"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="item in purveyorList"
|
v-for="item in purveyorList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
></el-option>
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
{{ queryForm.waitAmount }}
|
{{ queryForm.waitAmount }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
></el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
v-model="queryForm.amountPayable"
|
v-model="queryForm.amountPayable"
|
||||||
placeholder="请输入应收金额"
|
placeholder="请输入应收金额"
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
></el-input>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
v-model="queryForm.actualPaymentAmount"
|
v-model="queryForm.actualPaymentAmount"
|
||||||
placeholder="请输入实收金额"
|
placeholder="请输入实收金额"
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
></el-input>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -79,32 +79,24 @@
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
></el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="批号">
|
<el-form-item label="批号">
|
||||||
<el-input
|
<el-input v-model="queryForm.batchNo" placeholder="请输入批号" style="width: 220px" />
|
||||||
v-model="queryForm.batchNo"
|
|
||||||
placeholder="请输入批号"
|
|
||||||
style="width: 220px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input
|
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px" />
|
||||||
v-model="queryForm.remark"
|
|
||||||
placeholder="请输入备注"
|
|
||||||
style="width: 220px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="选择耗材">
|
<el-form-item label="选择耗材">
|
||||||
<div></div>
|
<div />
|
||||||
<el-button type="primary" @click="showHaocai">选择耗材</el-button>
|
<el-button type="primary" @click="showHaocai">选择耗材</el-button>
|
||||||
|
|
||||||
<el-autocomplete
|
<el-autocomplete
|
||||||
|
|
@ -112,9 +104,9 @@
|
||||||
:fetch-suggestions="querySearchAsync"
|
:fetch-suggestions="querySearchAsync"
|
||||||
value-key="conName"
|
value-key="conName"
|
||||||
placeholder="耗材搜索"
|
placeholder="耗材搜索"
|
||||||
@select="handleSelect"
|
|
||||||
style="width: 200px; margin-left: 20px"
|
style="width: 200px; margin-left: 20px"
|
||||||
></el-autocomplete>
|
@select="handleSelect"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -133,11 +125,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="进价">
|
<el-table-column label="进价">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number
|
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" />
|
||||||
v-model="scope.row.price"
|
|
||||||
:min="0"
|
|
||||||
controls-position="right"
|
|
||||||
></el-input-number>
|
|
||||||
<div class="tips" style="font-size: 16px">
|
<div class="tips" style="font-size: 16px">
|
||||||
原价¥
|
原价¥
|
||||||
|
|
||||||
|
|
@ -154,12 +142,12 @@
|
||||||
:placeholder="scope.row.unit"
|
:placeholder="scope.row.unit"
|
||||||
@change="changeUnit(scope.row)"
|
@change="changeUnit(scope.row)"
|
||||||
>
|
>
|
||||||
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"></el-option>
|
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit" />
|
||||||
<el-option
|
<el-option
|
||||||
|
v-if="scope.row.conUnitTwo"
|
||||||
:label="scope.row.conUnitTwo"
|
:label="scope.row.conUnitTwo"
|
||||||
:value="scope.row.conUnitTwo"
|
:value="scope.row.conUnitTwo"
|
||||||
v-if="scope.row.conUnitTwo"
|
/>
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="tips"> </div>
|
<div class="tips"> </div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -172,7 +160,7 @@
|
||||||
:step="1"
|
:step="1"
|
||||||
step-strictly
|
step-strictly
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
></el-input-number>
|
/>
|
||||||
<div class="tips" style="font-size: 16px">
|
<div class="tips" style="font-size: 16px">
|
||||||
{{ type == "in" ? "入库" : "出库" }}前:
|
{{ type == "in" ? "入库" : "出库" }}前:
|
||||||
{{ returnStockNumber(scope.row, scope.row.number) }}
|
{{ returnStockNumber(scope.row, scope.row.number) }}
|
||||||
|
|
@ -195,7 +183,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
<el-button type="primary" :loading="queryFormLoading" @click="submitHandle">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选择耗材 -->
|
<!-- 选择耗材 -->
|
||||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||||
|
|
@ -248,7 +236,7 @@ export default {
|
||||||
{
|
{
|
||||||
label: "商品入库",
|
label: "商品入库",
|
||||||
value: "goods",
|
value: "goods",
|
||||||
type: "purveyor",
|
type: "out",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "耗材入库",
|
label: "耗材入库",
|
||||||
|
|
@ -257,22 +245,6 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
shopTypesActive: 0,
|
shopTypesActive: 0,
|
||||||
shopTypes: [
|
|
||||||
{
|
|
||||||
label: "供应商入库",
|
|
||||||
value: "purveyor",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "其他入库",
|
|
||||||
value: "purchase",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
shopTypes2: [
|
|
||||||
{
|
|
||||||
label: "供应商入库",
|
|
||||||
value: "purveyor",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
resetForm: "",
|
resetForm: "",
|
||||||
queryFormLoading: false,
|
queryFormLoading: false,
|
||||||
queryForm: {
|
queryForm: {
|
||||||
|
|
@ -314,11 +286,6 @@ export default {
|
||||||
timeout: null,
|
timeout: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.type = this.$route.query.type || "in";
|
|
||||||
this.resetForm = { ...this.queryForm };
|
|
||||||
this.tbShopPurveyorGet();
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
amountPayable() {
|
amountPayable() {
|
||||||
if (!this.tableData.list.length) return 0;
|
if (!this.tableData.list.length) return 0;
|
||||||
|
|
@ -333,6 +300,11 @@ export default {
|
||||||
this.queryForm.amountPayable = newval;
|
this.queryForm.amountPayable = newval;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.type = this.$route.query.type || "in";
|
||||||
|
this.resetForm = { ...this.queryForm };
|
||||||
|
this.tbShopPurveyorGet();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeUnit(row) {
|
changeUnit(row) {
|
||||||
row.price = this.returnPrice(row, row.originPrice);
|
row.price = this.returnPrice(row, row.originPrice);
|
||||||
|
|
@ -398,12 +370,13 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换入库内容
|
// 切换入库内容
|
||||||
tabChange(value, type) {
|
tabChange(value) {
|
||||||
this.shopTypesActive = type == "in" ? 0 : 1;
|
this.shopTypesActive = value == "in" ? 0 : 1;
|
||||||
this.inTabValue = value;
|
this.inTabValue = value;
|
||||||
|
this.type = value;
|
||||||
this.resetHandle();
|
this.resetHandle();
|
||||||
this.$refs.shopList.reset(); //清除选项
|
// this.$refs.shopList.reset(); //清除选项
|
||||||
this.$refs.ConsumableList.reset(); //清除选项
|
// this.$refs.ConsumableList.reset(); //清除选项
|
||||||
},
|
},
|
||||||
// 切换类型
|
// 切换类型
|
||||||
changeTypeEnum(index) {
|
changeTypeEnum(index) {
|
||||||
|
|
@ -494,7 +467,8 @@ export default {
|
||||||
resetHandle() {
|
resetHandle() {
|
||||||
this.showResult = false;
|
this.showResult = false;
|
||||||
this.queryForm = { ...this.resetForm };
|
this.queryForm = { ...this.resetForm };
|
||||||
this.queryForm.type = this.inTabs.find((item) => item.value == this.inTabValue).type;
|
console.log(this.inTabs, this.inTabValue);
|
||||||
|
this.queryForm.type = this.inTabs.find((item) => item.type == this.inTabValue).type;
|
||||||
this.tableData.list = [];
|
this.tableData.list = [];
|
||||||
this.$refs.queryForm.resetFields();
|
this.$refs.queryForm.resetFields();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue