3月26日更新
This commit is contained in:
parent
b105e7f72b
commit
24e4114c6c
55
src/api/setting/account.ts
Normal file
55
src/api/setting/account.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = "1.0";
|
||||
|
||||
export function accountList(query: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.account.list',
|
||||
v,
|
||||
timestamp: new Date().getTime(),
|
||||
},
|
||||
data: query || {}
|
||||
})
|
||||
}
|
||||
|
||||
export function accountAdd(data: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.account.add',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function accountdelete(data: { employee_id: number }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.account.delete',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function accountUpdate(data: { employee_id: number, real_name?: string, file_id?: number }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.account.update',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -30,6 +30,7 @@ export function getProhibitedType() {
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 未使用,获取违禁品(限制品)列表
|
||||
export function getProhibitedList() {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -198,19 +199,19 @@ export function createUnit(data: any) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function getBoxUnits() {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'stock.warehouse.getBoxUnits',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: {},
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
// export function getBoxUnits() {
|
||||
// return request({
|
||||
// url: '/system',
|
||||
// method: 'post',
|
||||
// params: {
|
||||
// method: 'stock.warehouse.getBoxUnits',
|
||||
// v,
|
||||
// timestamp: new Date().getTime()
|
||||
// },
|
||||
// data: {},
|
||||
// isSystemApi: true
|
||||
// } as any)
|
||||
// }
|
||||
|
||||
export function checkItemCodeUnique(data: any) {
|
||||
return request({
|
||||
@ -310,6 +311,7 @@ export function deleteProhibited(data: any) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 未使用,在库存日志或历史记录组件中,用于执行“回退”到某个历史状态的操作
|
||||
export function backData(data: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -323,3 +325,18 @@ export function backData(data: any) {
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 已弃用
|
||||
// export function warehouseSearch(data:any) {
|
||||
// return request({
|
||||
// url: '/system',
|
||||
// method: 'post',
|
||||
// params: {
|
||||
// method: 'stock.warehouse.search',
|
||||
// v,
|
||||
// timestamp: new Date().getTime()
|
||||
// },
|
||||
// data: data,
|
||||
// isSystemApi: true
|
||||
// } as any)
|
||||
// }
|
||||
@ -251,9 +251,18 @@ const uploadAllFiles = async () => {
|
||||
file.status = 'uploading'
|
||||
const result = await uploadFile(file)
|
||||
|
||||
file.url = result.fileUrl
|
||||
file.uid = result.fileId
|
||||
file.status = 'success'
|
||||
// 注意:这里需要根据后端返回的结构来映射
|
||||
// 如果后端返回的是 { success: true },那么 result 可能没有 fileUrl 和 fileId
|
||||
// 这种情况下,可能需要重新 loadImages 或者等待后端返回完整信息
|
||||
if (result && result.fileUrl) {
|
||||
file.url = result.fileUrl
|
||||
file.uid = result.fileId
|
||||
file.status = 'success'
|
||||
} else if (result && result.success) {
|
||||
// 如果后端只返回了 success: true,说明上传通知成功
|
||||
// 我们标记为成功,但可能需要刷新列表来获取真实的 file_id
|
||||
file.status = 'success'
|
||||
}
|
||||
} catch (error: any) {
|
||||
file.status = 'fail'
|
||||
ElMessage.error(error.message || '上传失败')
|
||||
@ -292,8 +301,8 @@ const uploadFile = async (file: any) => {
|
||||
throw new Error(`上传失败: ${response.status}`)
|
||||
}
|
||||
|
||||
const { data } = await indexApi.uploadSuccessNotify(cosConfig.fileInfo || cosConfig) // 注意这里可能需要根据实际接口返回调整
|
||||
return data
|
||||
const { data: resultData } = await indexApi.uploadSuccessNotify(cosConfig.fileInfo || cosConfig)
|
||||
return resultData
|
||||
}
|
||||
|
||||
const getCOSUploadConfig = async (file: File) => {
|
||||
@ -494,6 +503,12 @@ const handleReset = () => {
|
||||
capturedImage.value = null
|
||||
stopCamera()
|
||||
}
|
||||
|
||||
// 暴露给父组件,方便父组件在关闭弹窗等环节主动停止摄像头
|
||||
defineExpose({
|
||||
stopCamera,
|
||||
handleReset
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@ -5,7 +5,7 @@ export const componentMap: Record<string, any> = {
|
||||
// 'system/setting/index': () => import('@/views/system/setting/index.vue'),
|
||||
'order/index': () => import('@/views/order/orderManagement/index.vue'),
|
||||
'auth/approve': () => import('@/views/auth/approve.vue'),
|
||||
'account/index': () => import('@/views/account/index.vue'),
|
||||
'account/index': () => import('@/views/system/setting/account/index.vue'),
|
||||
'warehouse/index': () => import('@/views/warehouse/index.vue'),
|
||||
'stock/index': () => import('@/views/stock/stock/index.vue'),
|
||||
'stock/storestock/index': () => import('@/views/stock/storestock/index.vue'),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="account-container">
|
||||
<h1>账户管理</h1>
|
||||
<h1>账户管理(废弃)</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -39,5 +39,7 @@ defineProps<{
|
||||
<style lang="scss" scoped>
|
||||
.order-detail-view {
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<div class="">日志</div>
|
||||
<div class="order-log-view">日志</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<style lang="css" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
.order-log-view {
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
@ -98,29 +98,31 @@
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<div class="lower-level" v-if="selectedOrderId" :class="tableSize">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="details" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="lower-level" :class="tableSize">
|
||||
<template v-if="selectedOrderId">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="details" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'details'">
|
||||
<detail :data="selectedRow" :config="deliverydetail" :column="3" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'details'">
|
||||
<detail :data="selectedRow" :config="deliverydetail" :column="3" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="no-selection" v-else>
|
||||
<div class="empty-tip">
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
<div class="no-selection" v-else>
|
||||
<div class="empty-tip">
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -481,7 +483,7 @@ function handleDeliveryPrintOperation(command: string) {
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 1;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -497,18 +499,16 @@ function handleDeliveryPrintOperation(command: string) {
|
||||
.detail-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
background-color: #fff;
|
||||
.empty-tip { text-align: center; }
|
||||
.no-selection {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
.empty-tip { text-align: center; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 1;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -66,7 +66,6 @@
|
||||
.detail-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -281,6 +281,7 @@ import { ref, reactive, watch, onMounted, nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Check, Refresh, InfoFilled, Plus } from '@element-plus/icons-vue'
|
||||
import * as stockApi from '@/api/stock'
|
||||
import { stockDefaultFormData, stockFormRules } from '../stock-config'
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
@ -314,39 +315,7 @@ const newUnitName = ref('')
|
||||
const newProhibitedName = ref('')
|
||||
const newProhibitedLevel = ref(1)
|
||||
|
||||
const formData = reactive({
|
||||
item_code: '',
|
||||
store_id: undefined as number | undefined,
|
||||
barcode: '',
|
||||
item_name: '',
|
||||
sku_property: '',
|
||||
stock_unit: '',
|
||||
packing_requirements: '',
|
||||
length: 0.00,
|
||||
width: 0.00,
|
||||
height: 0.00,
|
||||
volume: 0.00,
|
||||
gross_weight: 0,
|
||||
net_weight: 0,
|
||||
tag_price: 0.00,
|
||||
retail_price: 0.00,
|
||||
is_sn_mgmt: 'N',
|
||||
is_shelf_life_mgmt: 'N',
|
||||
is_batch_mgmt: 'N',
|
||||
prohibited_id: undefined as number | undefined,
|
||||
brand_name: '',
|
||||
managementFlags: [] as string[],
|
||||
// Box specs
|
||||
enable_box_spec: false,
|
||||
quantity_per_box: 0,
|
||||
box_gross_weight: 0,
|
||||
box_net_weight: 0,
|
||||
box_length: 0.00,
|
||||
box_width: 0.00,
|
||||
box_height: 0.00,
|
||||
box_volume: 0.00,
|
||||
box_unit: ''
|
||||
})
|
||||
const formData = reactive(JSON.parse(JSON.stringify(stockDefaultFormData)))
|
||||
|
||||
const originalData = reactive({})
|
||||
|
||||
@ -415,21 +384,8 @@ const validateItemCode = async (rule: any, value: any, callback: any) => {
|
||||
}
|
||||
|
||||
const formRules = {
|
||||
store_id: [{ required: true, message: '货主不能为空', trigger: 'change' }],
|
||||
barcode: [{ required: true, message: '条码不能为空', trigger: 'blur' }],
|
||||
...stockFormRules,
|
||||
item_code: [{ validator: validateItemCode, trigger: 'blur' }],
|
||||
item_name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
|
||||
stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'change' }],
|
||||
gross_weight: [
|
||||
{ required: true, message: '毛重不能为空', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value < 0) callback(new Error('毛重不能小于0'))
|
||||
else callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
quantity_per_box: [
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="barcode-container">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="0" class="barcode-form" :disabled="loading">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-position="top" class="barcode-form" :disabled="loading">
|
||||
<el-form-item prop="barcodeText" class="barcode-item">
|
||||
<template #label>
|
||||
<span>
|
||||
@ -22,11 +22,11 @@
|
||||
@blur="handleBlur"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="tip-text">一行一个</div>
|
||||
<!-- <div class="tip-text">一行一个</div> -->
|
||||
</el-form>
|
||||
|
||||
<div class="bottom-actions">
|
||||
<el-button-group>
|
||||
<el-button-group class="toolbar-btn-group">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="Check"
|
||||
@ -231,13 +231,21 @@ function resetForm() {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.barcode-form {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
padding: 20px;
|
||||
|
||||
/* 隐藏滚动条 */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
|
||||
.barcode-item {
|
||||
flex: 1;
|
||||
@ -248,6 +256,7 @@ function resetForm() {
|
||||
:deep(.el-form-item__content) {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: block; // 确保内容区域正常展开
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,6 +265,7 @@ function resetForm() {
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
height: 100%;
|
||||
min-height: 400px;
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
@ -269,9 +279,11 @@ function resetForm() {
|
||||
}
|
||||
|
||||
.bottom-actions {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
padding: 10px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -465,6 +465,7 @@ import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'elem
|
||||
import { Plus, Check, Refresh, Close, QuestionFilled } from '@element-plus/icons-vue'
|
||||
import * as stockApi from '@/api/stock'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { stockDefaultFormData, stockFormRules } from '../stock-config'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const hasPermission = (key: string) => userStore.checkPermission(key)
|
||||
@ -480,39 +481,7 @@ const loading = ref(false)
|
||||
|
||||
// 基础表单数据
|
||||
const baseFormData = {
|
||||
item_code: '',
|
||||
store_id: 0,
|
||||
item_name: '',
|
||||
sku_property: '',
|
||||
stock_unit: '',
|
||||
packing_requirements: '',
|
||||
length: 0.00,
|
||||
width: 0.00,
|
||||
height: 0.00,
|
||||
volume: 0.00,
|
||||
gross_weight: 0,
|
||||
net_weight: 0,
|
||||
tag_price: 0.00,
|
||||
retail_price: 0.00,
|
||||
is_sn_mgmt: 'N',
|
||||
is_shelf_life_mgmt: 'N',
|
||||
is_batch_mgmt: 'N',
|
||||
prohibited_id: null,
|
||||
brand_name: '',
|
||||
// 管理标识复选框
|
||||
managementFlags: [] as string[],
|
||||
|
||||
// 箱规相关字段
|
||||
enable_box_spec: false,
|
||||
quantity_per_box: 0,
|
||||
box_gross_weight: 0,
|
||||
box_net_weight: 0,
|
||||
box_length: 0.00,
|
||||
box_width: 0.00,
|
||||
box_height: 0.00,
|
||||
box_volume: 0.00,
|
||||
// 补充可能缺失的字段
|
||||
box_unit: '',
|
||||
...stockDefaultFormData,
|
||||
id: undefined as number | undefined
|
||||
}
|
||||
|
||||
@ -594,22 +563,8 @@ const validateItemCode = async (rule: any, value: string, callback: any) => {
|
||||
}
|
||||
|
||||
const formRules = reactive<FormRules>({
|
||||
...stockFormRules,
|
||||
item_code: [{ validator: validateItemCode, trigger: 'blur' }],
|
||||
item_name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
|
||||
stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'blur' }],
|
||||
gross_weight: [
|
||||
{ required: true, message: '毛重不能为空', trigger: 'change' },
|
||||
{
|
||||
validator: (rule: any, value: number, callback: any) => {
|
||||
if (value <= 0) {
|
||||
callback(new Error('毛重不能小于或等于0'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
quantity_per_box: [{
|
||||
required: true,
|
||||
message: '每箱数量不能为空',
|
||||
@ -943,9 +898,25 @@ async function handleDeleteProhibited(id: number) {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.stock-info-container {
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
padding-bottom: 70px; /* 为固定的底部留出空间 */
|
||||
// padding: 5px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.el-form {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
/* 隐藏滚动条 */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
.select-with-button {
|
||||
@ -959,7 +930,7 @@ async function handleDeleteProhibited(id: number) {
|
||||
}
|
||||
|
||||
.info-card {
|
||||
margin-bottom: 10px;
|
||||
// margin-bottom: 5px;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
@ -970,13 +941,12 @@ async function handleDeleteProhibited(id: number) {
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-top: 20px;
|
||||
flex-shrink: 0;
|
||||
// margin-top: 5px;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
text-align: right;
|
||||
padding: 10px 20px;
|
||||
padding: 0px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
|
||||
@ -119,28 +119,23 @@
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<!-- 自定义状态列 -->
|
||||
<!-- <template #column-status="{ row }">
|
||||
<el-tag :type="row.status === 'enabled' ? 'success' : 'danger'" size="small">
|
||||
{{ row.status === 'enabled' ? '启用' : '禁用' }}
|
||||
<template #column-is_sn_mgmt="{ row }">
|
||||
<el-tag :type="row.is_sn_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_sn_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template> -->
|
||||
</template>
|
||||
|
||||
<!-- 自定义列模板 -->
|
||||
<!-- <template #column-is_sn_mgmt="{ row }">
|
||||
<el-tag :type="row.is_sn_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_sn_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-is_shelf_life_mgmt="{ row }">
|
||||
<el-tag :type="row.is_shelf_life_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_shelf_life_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-is_batch_mgmt="{ row }">
|
||||
<el-tag :type="row.is_batch_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_batch_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template> -->
|
||||
<template #column-is_shelf_life_mgmt="{ row }">
|
||||
<el-tag :type="row.is_shelf_life_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_shelf_life_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-is_batch_mgmt="{ row }">
|
||||
<el-tag :type="row.is_batch_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_batch_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="custom-empty">
|
||||
@ -221,6 +216,7 @@ import Barcode from './component/barcode.vue'
|
||||
import Log from './component/log.vue'
|
||||
import Add from './component/add.vue'
|
||||
import Recycle from './component/recycle.vue'
|
||||
import { stockColumns, availableFields as stockAvailableFields, stockBatchConfig } from './stock-config'
|
||||
|
||||
// API
|
||||
import * as stockApi from '@/api/stock'
|
||||
@ -262,49 +258,7 @@ const pagination = reactive({
|
||||
page: 1
|
||||
})
|
||||
|
||||
const batchConfig = reactive({
|
||||
brand_name: {
|
||||
title: '品牌',
|
||||
placeholder: '请输入品牌名称',
|
||||
validator: (value: any) => value && value.trim().length > 0,
|
||||
errorMessage: '品牌名称不能为空'
|
||||
},
|
||||
stock_unit: {
|
||||
title: '库存单位',
|
||||
placeholder: '请选择库存单位',
|
||||
type: 'select',
|
||||
options: [] as any[]
|
||||
},
|
||||
prohibited_id: {
|
||||
title: '违禁品类型',
|
||||
placeholder: '请选择违禁品类型',
|
||||
type: 'select',
|
||||
options: [] as any[]
|
||||
},
|
||||
gross_weight: {
|
||||
title: '毛重',
|
||||
placeholder: '请输入毛重(g)',
|
||||
type: 'number',
|
||||
validator: (value: any) => !isNaN(value) && Number(value) >= 0,
|
||||
errorMessage: '请输入有效的数字'
|
||||
},
|
||||
packing_requirements: {
|
||||
title: '打包要求',
|
||||
placeholder: '请输入打包要求',
|
||||
validator: (value: any) => value && value.trim().length > 0,
|
||||
errorMessage: '打包要求不能为空'
|
||||
},
|
||||
managementFlags: {
|
||||
title: '管理标识',
|
||||
type: 'checkbox',
|
||||
options: [
|
||||
{ label: '序列号管理', value: 'is_sn_mgmt' },
|
||||
{ label: '保质期管理', value: 'is_shelf_life_mgmt' },
|
||||
{ label: '批次管理', value: 'is_batch_mgmt' }
|
||||
],
|
||||
placeholder: '请选择管理标识'
|
||||
}
|
||||
})
|
||||
const batchConfig = reactive(JSON.parse(JSON.stringify(stockBatchConfig)))
|
||||
|
||||
const tableSize = ref('small')
|
||||
|
||||
@ -322,394 +276,11 @@ const activeComponent = computed(() => {
|
||||
return componentMap[activeTab.value] || componentMap.info
|
||||
})
|
||||
|
||||
// Formatters
|
||||
const formatNumber = (num: any, digits = 0) => {
|
||||
if (num === null || num === undefined || num === '') return 0
|
||||
return Number(num).toFixed(digits)
|
||||
}
|
||||
|
||||
// Columns Definition
|
||||
const accountColumns = [
|
||||
{
|
||||
prop: 'item_name',
|
||||
label: '商品名称',
|
||||
fixed: 'left',
|
||||
minWidth: '150',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
// {
|
||||
// prop: 'status',
|
||||
// label: '状态',
|
||||
// width: '80',
|
||||
// align: 'center',
|
||||
// slotName: 'status'
|
||||
// },
|
||||
{
|
||||
prop: 'store_remask',
|
||||
label: '货主',
|
||||
width: '100',
|
||||
align: 'center',
|
||||
formatter: (row: any) => row['store_stock.store_remask'] || '--'
|
||||
},
|
||||
{
|
||||
prop: 'barcodes',
|
||||
label: '商品条码',
|
||||
width: '120',
|
||||
formatter: (row: any) => row.barcodes ? row.barcodes.join("|") : '--'
|
||||
},
|
||||
{
|
||||
prop: 'images',
|
||||
label: '商品图片',
|
||||
width: '120',
|
||||
align: 'center',
|
||||
imgs: (row: any) => {
|
||||
return row.images || []
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'gross_weight',
|
||||
label: '毛重',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.gross_weight ? `${formatNumber(row.gross_weight, 0)}g` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'brand_name',
|
||||
label: '品牌',
|
||||
minWidth: '100',
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: 'SKU',
|
||||
minWidth: '150',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'prohibited',
|
||||
label: '违禁品类型',
|
||||
width: '120',
|
||||
formatter: (row: any) => row['prohibited.type_name'] || '非违禁品'
|
||||
},
|
||||
{
|
||||
prop: 'item_code',
|
||||
label: '商品编码',
|
||||
width: '120',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'sku_property',
|
||||
label: 'SKU规格',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: any) => row.sku_property || '--'
|
||||
},
|
||||
// 库存
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '库存数量',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => formatNumber(row.quantity || 0, 0)
|
||||
},
|
||||
{
|
||||
prop: 'locked_quantity',
|
||||
label: '锁定量',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => formatNumber(row.locked_quantity || 0, 0)
|
||||
},
|
||||
{
|
||||
prop: 'available_quantity',
|
||||
label: '可用库存',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
const available = row.available_quantity || Math.max(0, (row.quantity || 0) - (row.locked_quantity || 0))
|
||||
return formatNumber(available, 0)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'lock_rate_display',
|
||||
label: '锁定率',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.lock_rate_display || '--'
|
||||
},
|
||||
// Units
|
||||
{
|
||||
prop: 'stock_unit',
|
||||
label: '库存单位',
|
||||
width: '100',
|
||||
align: 'center'
|
||||
},
|
||||
// Price
|
||||
{
|
||||
prop: 'tag_price',
|
||||
label: '标价',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => row.tag_price ? `¥${formatNumber(row.tag_price, 2)}` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'retail_price',
|
||||
label: '零售价',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => row.retail_price ? `¥${formatNumber(row.retail_price, 2)}` : '--'
|
||||
},
|
||||
// Management Flags - Using Slots
|
||||
{
|
||||
prop: 'is_sn_mgmt',
|
||||
label: 'SN码',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_sn_mgmt' // Custom property for UpperTable to know to use slot?
|
||||
// UpperTable usually uses dynamic slots based on prop name if configured.
|
||||
},
|
||||
{
|
||||
prop: 'is_shelf_life_mgmt',
|
||||
label: '保质期',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_shelf_life_mgmt'
|
||||
},
|
||||
{
|
||||
prop: 'is_batch_mgmt',
|
||||
label: '批次',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_batch_mgmt'
|
||||
},
|
||||
{
|
||||
prop: 'dimensions',
|
||||
label: '尺寸(长×宽×高)',
|
||||
width: '180',
|
||||
align: 'center',
|
||||
formatter: (row: any) => {
|
||||
if (!row.length && !row.width && !row.height) return '--'
|
||||
return `${row.length || 0} cm× ${row.width || 0} cm× ${row.height || 0}cm`
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: 'ABC分类',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
width: '100',
|
||||
},
|
||||
{
|
||||
prop: 'volume',
|
||||
label: '体积',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.volume ? `${formatNumber(row.volume, 2)}cm³` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'net_weight',
|
||||
label: '净重',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.net_weight ? `${formatNumber(row.net_weight, 0)}g` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'create_at_display',
|
||||
label: '创建时间',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
prop: 'update_at_display',
|
||||
label: '更新时间',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
]
|
||||
const accountColumns = stockColumns
|
||||
|
||||
// Available Fields for ScanBox
|
||||
const availableFields = reactive([
|
||||
{
|
||||
value: 'store_id',
|
||||
label: '货主',
|
||||
type: 'select',
|
||||
placeholder: '请选择货主',
|
||||
filterable: true,
|
||||
options: [] as any[],
|
||||
},
|
||||
{
|
||||
value: 'barcode',
|
||||
label: '条码',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品条码',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'id',
|
||||
label: 'SKU',
|
||||
type: 'text',
|
||||
placeholder: '请输入SKU',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'prohibited_type',
|
||||
label: '违禁品类型',
|
||||
type: 'select',
|
||||
placeholder: '请选择违禁品类型',
|
||||
filterable: true,
|
||||
options: [] as any[],
|
||||
},
|
||||
{
|
||||
value: 'is_images',
|
||||
label: '是否有图片',
|
||||
type: 'boolean',
|
||||
},
|
||||
{
|
||||
value: 'item_code',
|
||||
label: '商品编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品编码',
|
||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'brand_name',
|
||||
label: '品牌',
|
||||
type: 'text',
|
||||
placeholder: '请输入品牌',
|
||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'goods_code',
|
||||
label: '货物编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入货物编码',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'item_name',
|
||||
label: '商品名称',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品名称',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
value: 'sku_property',
|
||||
label: 'SKU规格',
|
||||
type: 'text',
|
||||
placeholder: '请输入SKU规格',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'level',
|
||||
label: 'ABC分类',
|
||||
type: 'select',
|
||||
placeholder: '请选择分类',
|
||||
options: [
|
||||
{ value: 'A', label: 'A类' },
|
||||
{ value: 'B', label: 'B类' },
|
||||
{ value: 'C', label: 'C类' }
|
||||
],
|
||||
},
|
||||
{
|
||||
value: 'quantity',
|
||||
label: '库存数量',
|
||||
type: 'number',
|
||||
placeholder: '请输入库存数量',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'ge'
|
||||
},
|
||||
{
|
||||
value: 'locked_quantity',
|
||||
label: '锁定量',
|
||||
type: 'number',
|
||||
placeholder: '请输入锁定量',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'],
|
||||
defaultOperator: 'eq'
|
||||
},
|
||||
{
|
||||
value: 'is_sn_mgmt',
|
||||
label: '序列号管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否序列号管理'
|
||||
},
|
||||
{
|
||||
value: 'is_shelf_life_mgmt',
|
||||
label: '保质期管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否保质期管理'
|
||||
},
|
||||
{
|
||||
value: 'is_batch_mgmt',
|
||||
label: '批次管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否批次管理'
|
||||
},
|
||||
{
|
||||
value: 'tag_price',
|
||||
label: '标价',
|
||||
type: 'number',
|
||||
placeholder: '请输入标价',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'between'
|
||||
},
|
||||
{
|
||||
value: 'retail_price',
|
||||
label: '零售价',
|
||||
type: 'number',
|
||||
placeholder: '请输入零售价',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'between'
|
||||
},
|
||||
// Dimensions
|
||||
{
|
||||
value: 'length',
|
||||
label: '长度',
|
||||
type: 'number',
|
||||
placeholder: '请输入长度',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'],
|
||||
defaultOperator: 'gt'
|
||||
},
|
||||
// ... (Other dimensions omitted for brevity but should be there)
|
||||
{
|
||||
value: 'create_at',
|
||||
label: '创建时间',
|
||||
type: 'daterange',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
},
|
||||
{
|
||||
value: 'update_at',
|
||||
label: '更新时间',
|
||||
type: 'daterange',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
},
|
||||
{
|
||||
value: 'stock_unit',
|
||||
label: '库存单位',
|
||||
type: 'select',
|
||||
placeholder: '请选择库存单位',
|
||||
options: [
|
||||
{ value: '件', label: '件' },
|
||||
{ value: '箱', label: '箱' },
|
||||
// ... others
|
||||
],
|
||||
required: false
|
||||
}
|
||||
])
|
||||
const availableFields = reactive(JSON.parse(JSON.stringify(stockAvailableFields)))
|
||||
|
||||
const hasSelection = computed(() => selectionIds.value.length > 0)
|
||||
|
||||
@ -834,19 +405,6 @@ const handleBatchChange = async (command: string) => {
|
||||
try {
|
||||
let value: any
|
||||
if (config.type === 'select') {
|
||||
// For select, we can use ElMessageBox with a workaround or a custom dialog.
|
||||
// Since Element Plus doesn't have a simple select prompt, we'll use a prompt and ask user to input value?
|
||||
// Or better, we skip complex implementation for now and just show a message or implement simple input.
|
||||
// Actually, let's implement a simple input for now as placeholder or try to use HTML message.
|
||||
// Vue 2 implementation used custom h() rendering.
|
||||
|
||||
// Simplified: Just use prompt but show options in message? No, that's bad UX.
|
||||
// Let's assume text input for now for all, except checkbox.
|
||||
// For proper migration, we should create a BatchEditDialog component.
|
||||
// But for this task, I'll use text input fallback for select, or skip it.
|
||||
|
||||
// Let's just implement text input for everything for now to satisfy the structure.
|
||||
// Or use a simple prompt.
|
||||
const { value: inputValue } = await ElMessageBox.prompt(`请输入${config.title}`, `批量修改${config.title}`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@ -903,7 +461,6 @@ const handleTabChange = () => {
|
||||
//
|
||||
}
|
||||
|
||||
// Initial Load
|
||||
onMounted(async () => {
|
||||
// Load stores, prohibited types etc.
|
||||
try {
|
||||
@ -946,7 +503,7 @@ const loadStockUnits = async () => {
|
||||
}
|
||||
|
||||
// Update available fields
|
||||
const field = availableFields.find(f => f.value === 'stock_unit')
|
||||
const field = (availableFields as any[]).find(f => f.value === 'stock_unit')
|
||||
if (field) {
|
||||
field.options = units
|
||||
}
|
||||
@ -994,9 +551,8 @@ const loadStockUnits = async () => {
|
||||
|
||||
|
||||
.lower-level {
|
||||
flex: 0 0 auto;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
min-height: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -1028,12 +584,12 @@ const loadStockUnits = async () => {
|
||||
.detail-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 0 0 auto;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
475
src/views/stock/stock/stock-config.ts
Normal file
475
src/views/stock/stock/stock-config.ts
Normal file
@ -0,0 +1,475 @@
|
||||
|
||||
// 格式化数字
|
||||
const formatNumber = (num: any, digits = 0) => {
|
||||
if (num === null || num === undefined || num === '') return 0
|
||||
return Number(num).toFixed(digits)
|
||||
}
|
||||
|
||||
// 库存列表字段定义
|
||||
export const stockColumns = [
|
||||
{
|
||||
prop: 'item_name',
|
||||
label: '商品名称',
|
||||
fixed: 'left',
|
||||
minWidth: '150',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'store_remask',
|
||||
label: '货主',
|
||||
width: '100',
|
||||
align: 'center',
|
||||
formatter: (row: any) => row['store_stock.store_remask'] || '--'
|
||||
},
|
||||
{
|
||||
prop: 'barcodes',
|
||||
label: '商品条码',
|
||||
width: '120',
|
||||
formatter: (row: any) => row.barcodes ? row.barcodes.join("|") : '--'
|
||||
},
|
||||
{
|
||||
prop: 'images',
|
||||
label: '商品图片',
|
||||
width: '120',
|
||||
align: 'center',
|
||||
imgs: (row: any) => {
|
||||
return row.images || []
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'gross_weight',
|
||||
label: '毛重',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.gross_weight ? `${formatNumber(row.gross_weight, 0)}g` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'brand_name',
|
||||
label: '品牌',
|
||||
minWidth: '100',
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
label: 'SKU',
|
||||
minWidth: '150',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'prohibited',
|
||||
label: '违禁品类型',
|
||||
width: '120',
|
||||
formatter: (row: any) => row['prohibited.type_name'] || '非违禁品'
|
||||
},
|
||||
{
|
||||
prop: 'item_code',
|
||||
label: '商品编码',
|
||||
width: '120',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'sku_property',
|
||||
label: 'SKU规格',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: any) => row.sku_property || '--'
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '库存数量',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => formatNumber(row.quantity || 0, 0)
|
||||
},
|
||||
{
|
||||
prop: 'locked_quantity',
|
||||
label: '锁定量',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => formatNumber(row.locked_quantity || 0, 0)
|
||||
},
|
||||
{
|
||||
prop: 'available_quantity',
|
||||
label: '可用库存',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
const available = row.available_quantity || Math.max(0, (row.quantity || 0) - (row.locked_quantity || 0))
|
||||
return formatNumber(available, 0)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'lock_rate_display',
|
||||
label: '锁定率',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.lock_rate_display || '--'
|
||||
},
|
||||
{
|
||||
prop: 'stock_unit',
|
||||
label: '库存单位',
|
||||
width: '100',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'tag_price',
|
||||
label: '标价',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => row.tag_price ? `¥${formatNumber(row.tag_price, 2)}` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'retail_price',
|
||||
label: '零售价',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
sortable: true,
|
||||
formatter: (row: any) => row.retail_price ? `¥${formatNumber(row.retail_price, 2)}` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'is_sn_mgmt',
|
||||
label: 'SN码',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_sn_mgmt',
|
||||
formatter: (row: any) => row.is_sn_mgmt === 'Y' ? '是' : '否'
|
||||
},
|
||||
{
|
||||
prop: 'is_shelf_life_mgmt',
|
||||
label: '保质期',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_shelf_life_mgmt',
|
||||
formatter: (row: any) => row.is_shelf_life_mgmt === 'Y' ? '是' : '否'
|
||||
},
|
||||
{
|
||||
prop: 'is_batch_mgmt',
|
||||
label: '批次',
|
||||
width: '80',
|
||||
align: 'center',
|
||||
slotName: 'is_batch_mgmt',
|
||||
formatter: (row: any) => row.is_batch_mgmt === 'Y' ? '是' : '否'
|
||||
},
|
||||
{
|
||||
prop: 'dimensions',
|
||||
label: '尺寸(长×宽×高)',
|
||||
width: '180',
|
||||
align: 'center',
|
||||
formatter: (row: any) => {
|
||||
if (!row.length && !row.width && !row.height) return '--'
|
||||
return `${row.length || 0} cm× ${row.width || 0} cm× ${row.height || 0}cm`
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: 'ABC分类',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
width: '100',
|
||||
},
|
||||
{
|
||||
prop: 'volume',
|
||||
label: '体积',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.volume ? `${formatNumber(row.volume, 2)}cm³` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'net_weight',
|
||||
label: '净重',
|
||||
width: '100',
|
||||
align: 'right',
|
||||
formatter: (row: any) => row.net_weight ? `${formatNumber(row.net_weight, 0)}g` : '--'
|
||||
},
|
||||
{
|
||||
prop: 'create_at_display',
|
||||
label: '创建时间',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
prop: 'update_at_display',
|
||||
label: '更新时间',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
]
|
||||
|
||||
// ScanBox 可用筛选字段
|
||||
export const availableFields = [
|
||||
{
|
||||
value: 'store_id',
|
||||
label: '货主',
|
||||
type: 'select',
|
||||
placeholder: '请选择货主',
|
||||
filterable: true,
|
||||
options: [],
|
||||
},
|
||||
{
|
||||
value: 'barcode',
|
||||
label: '条码',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品条码',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'id',
|
||||
label: 'SKU',
|
||||
type: 'text',
|
||||
placeholder: '请输入SKU',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'prohibited_type',
|
||||
label: '违禁品类型',
|
||||
type: 'select',
|
||||
placeholder: '请选择违禁品类型',
|
||||
filterable: true,
|
||||
options: [],
|
||||
},
|
||||
{
|
||||
value: 'is_images',
|
||||
label: '是否有图片',
|
||||
type: 'boolean',
|
||||
},
|
||||
{
|
||||
value: 'item_code',
|
||||
label: '商品编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品编码',
|
||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'brand_name',
|
||||
label: '品牌',
|
||||
type: 'text',
|
||||
placeholder: '请输入品牌',
|
||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'goods_code',
|
||||
label: '货物编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入货物编码',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'item_name',
|
||||
label: '商品名称',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品名称',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
value: 'sku_property',
|
||||
label: 'SKU规格',
|
||||
type: 'text',
|
||||
placeholder: '请输入SKU规格',
|
||||
operators: ['eq', 'ne', 'contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'level',
|
||||
label: 'ABC分类',
|
||||
type: 'select',
|
||||
placeholder: '请选择分类',
|
||||
options: [
|
||||
{ value: 'A', label: 'A类' },
|
||||
{ value: 'B', label: 'B类' },
|
||||
{ value: 'C', label: 'C类' }
|
||||
],
|
||||
},
|
||||
{
|
||||
value: 'quantity',
|
||||
label: '库存数量',
|
||||
type: 'number',
|
||||
placeholder: '请输入库存数量',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'ge'
|
||||
},
|
||||
{
|
||||
value: 'locked_quantity',
|
||||
label: '锁定量',
|
||||
type: 'number',
|
||||
placeholder: '请输入锁定量',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'],
|
||||
defaultOperator: 'eq'
|
||||
},
|
||||
{
|
||||
value: 'is_sn_mgmt',
|
||||
label: '序列号管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否序列号管理'
|
||||
},
|
||||
{
|
||||
value: 'is_shelf_life_mgmt',
|
||||
label: '保质期管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否保质期管理'
|
||||
},
|
||||
{
|
||||
value: 'is_batch_mgmt',
|
||||
label: '批次管理',
|
||||
type: 'boolean',
|
||||
placeholder: '请选择是否批次管理'
|
||||
},
|
||||
{
|
||||
value: 'tag_price',
|
||||
label: '标价',
|
||||
type: 'number',
|
||||
placeholder: '请输入标价',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'between'
|
||||
},
|
||||
{
|
||||
value: 'retail_price',
|
||||
label: '零售价',
|
||||
type: 'number',
|
||||
placeholder: '请输入零售价',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
||||
defaultOperator: 'between'
|
||||
},
|
||||
{
|
||||
value: 'length',
|
||||
label: '长度',
|
||||
type: 'number',
|
||||
placeholder: '请输入长度',
|
||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'],
|
||||
defaultOperator: 'gt'
|
||||
},
|
||||
{
|
||||
value: 'create_at',
|
||||
label: '创建时间',
|
||||
type: 'daterange',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
},
|
||||
{
|
||||
value: 'update_at',
|
||||
label: '更新时间',
|
||||
type: 'daterange',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
},
|
||||
{
|
||||
value: 'stock_unit',
|
||||
label: '库存单位',
|
||||
type: 'select',
|
||||
placeholder: '请选择库存单位',
|
||||
options: [
|
||||
{ value: '件', label: '件' },
|
||||
{ value: '箱', label: '箱' },
|
||||
],
|
||||
required: false
|
||||
}
|
||||
]
|
||||
|
||||
// 批量操作配置
|
||||
export const stockBatchConfig = {
|
||||
brand_name: {
|
||||
title: '品牌',
|
||||
placeholder: '请输入品牌名称',
|
||||
validator: (value: any) => value && value.trim().length > 0,
|
||||
errorMessage: '品牌名称不能为空'
|
||||
},
|
||||
stock_unit: {
|
||||
title: '库存单位',
|
||||
placeholder: '请选择库存单位',
|
||||
type: 'select',
|
||||
options: [] as any[]
|
||||
},
|
||||
prohibited_id: {
|
||||
title: '违禁品类型',
|
||||
placeholder: '请选择违禁品类型',
|
||||
type: 'select',
|
||||
options: [] as any[]
|
||||
},
|
||||
gross_weight: {
|
||||
title: '毛重',
|
||||
placeholder: '请输入毛重(g)',
|
||||
type: 'number',
|
||||
validator: (value: any) => !isNaN(value) && Number(value) >= 0,
|
||||
errorMessage: '请输入有效的数字'
|
||||
},
|
||||
packing_requirements: {
|
||||
title: '打包要求',
|
||||
placeholder: '请输入打包要求',
|
||||
validator: (value: any) => value && value.trim().length > 0,
|
||||
errorMessage: '打包要求不能为空'
|
||||
},
|
||||
managementFlags: {
|
||||
title: '管理标识',
|
||||
type: 'checkbox',
|
||||
options: [
|
||||
{ label: '序列号管理', value: 'is_sn_mgmt' },
|
||||
{ label: '保质期管理', value: 'is_shelf_life_mgmt' },
|
||||
{ label: '批次管理', value: 'is_batch_mgmt' }
|
||||
],
|
||||
placeholder: '请选择管理标识'
|
||||
}
|
||||
}
|
||||
|
||||
// 商品初始表单数据
|
||||
export const stockDefaultFormData = {
|
||||
item_code: '',
|
||||
store_id: undefined as number | undefined,
|
||||
barcode: '',
|
||||
item_name: '',
|
||||
sku_property: '',
|
||||
stock_unit: '',
|
||||
packing_requirements: '',
|
||||
length: 0.00,
|
||||
width: 0.00,
|
||||
height: 0.00,
|
||||
volume: 0.00,
|
||||
gross_weight: 0,
|
||||
net_weight: 0,
|
||||
tag_price: 0.00,
|
||||
retail_price: 0.00,
|
||||
is_sn_mgmt: 'N',
|
||||
is_shelf_life_mgmt: 'N',
|
||||
is_batch_mgmt: 'N',
|
||||
prohibited_id: undefined as number | undefined,
|
||||
brand_name: '',
|
||||
managementFlags: [] as string[],
|
||||
// 箱规信息
|
||||
enable_box_spec: false,
|
||||
quantity_per_box: 0,
|
||||
box_gross_weight: 0,
|
||||
box_net_weight: 0,
|
||||
box_length: 0.00,
|
||||
box_width: 0.00,
|
||||
box_height: 0.00,
|
||||
box_volume: 0.00,
|
||||
box_unit: ''
|
||||
}
|
||||
|
||||
// 基础表单验证规则
|
||||
export const stockFormRules = {
|
||||
store_id: [{ required: true, message: '货主不能为空', trigger: 'change' }],
|
||||
barcode: [{ required: true, message: '条码不能为空', trigger: 'blur' }],
|
||||
item_name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
|
||||
stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'change' }],
|
||||
gross_weight: [
|
||||
{ required: true, message: '毛重不能为空', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value < 0) callback(new Error('毛重不能小于0'))
|
||||
else callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,60 +1,90 @@
|
||||
<template>
|
||||
<div class="entry-operate">
|
||||
<div class="left-col">
|
||||
<div class="col-left">
|
||||
<el-form :model="form" label-width="120px" size="small">
|
||||
<!-- 动态渲染可用字段,此处可根据 entry-config 调整 -->
|
||||
<div class="entry-operate-container">
|
||||
<el-form :model="form" label-width="120px" class="details-form">
|
||||
<el-row :gutter="30">
|
||||
<!-- 第一列:基本信息 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
v-for="field in entryColums"
|
||||
v-for="field in detailpanel"
|
||||
:key="field.prop"
|
||||
:label="field.label"
|
||||
:prop="field.prop"
|
||||
>
|
||||
<el-input
|
||||
v-model="(form as any)[field.prop]"
|
||||
:placeholder="'请输入' + field.label"
|
||||
/>
|
||||
<template v-if="field.type === 'select'">
|
||||
<el-select
|
||||
v-model="(form as any)[field.prop]"
|
||||
:placeholder="'请选择' + field.label"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in availableFields.find(f => f.value === field.prop)?.options || []"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input
|
||||
v-model="(form as any)[field.prop]"
|
||||
:disabled="field.disabled"
|
||||
:placeholder="'请输入' + field.label"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="col-right">
|
||||
<!-- 预留扩展区域 -->
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<aside class="right-col">
|
||||
<div class="right-panel">
|
||||
<div class="panel-actions">
|
||||
<el-button size="small" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" size="small" @click="handleSave" :loading="saveLoading">保存</el-button>
|
||||
</div>
|
||||
|
||||
<div class="panel-info" v-if="row">
|
||||
<div class="info-item">
|
||||
<span class="info-label">创建时间:</span>
|
||||
<span class="info-value">{{ row.order_create_time }}</span>
|
||||
<!-- 第二列:附加展示区 -->
|
||||
<el-col :span="12">
|
||||
<div class="image-placeholder">
|
||||
<div class="placeholder-content">
|
||||
<el-icon :size="48" color="#909399"><Picture /></el-icon>
|
||||
<p>相关单据图片/附件展示区</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">当前状态:</span>
|
||||
<el-tag size="small">{{ row.status }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<div class="bottom">
|
||||
<el-button-group class="toolbar-btn-group">
|
||||
<el-button type="primary" icon="Check" @click="handleSave" :loading="saveLoading">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button type="danger" icon="Refresh" @click="handleReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { entryColums } from '../entry-config'
|
||||
import { availableFields, detailpanel } from '../entry-config'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Picture, Check, Refresh } from '@element-plus/icons-vue'
|
||||
|
||||
const props = defineProps<{
|
||||
id: string | number,
|
||||
row?: any
|
||||
}>()
|
||||
|
||||
const form = ref<any>({})
|
||||
const form = ref<any>({
|
||||
entry_order_code: '',
|
||||
store_name: '',
|
||||
order_status: '',
|
||||
order_type: '',
|
||||
purchase_order_code: '',
|
||||
sync_status: '',
|
||||
supplier_code: '',
|
||||
supplier_name: '',
|
||||
express_code: '',
|
||||
logistics_name: '',
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const saveLoading = ref(false)
|
||||
|
||||
// 监听行数据变化同步表单
|
||||
@ -67,9 +97,8 @@ watch(() => props.row, (newRow) => {
|
||||
const handleReset = () => {
|
||||
if (props.row) {
|
||||
form.value = { ...props.row }
|
||||
} else {
|
||||
form.value = {}
|
||||
}
|
||||
ElMessage.info('表单已重置')
|
||||
}
|
||||
|
||||
const handleSave = async () => {
|
||||
@ -93,75 +122,56 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.entry-operate {
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 320px;
|
||||
gap: 0 16px;
|
||||
align-items: start;
|
||||
.entry-operate-container {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.left-col {
|
||||
grid-column: 1 / 2;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding-right: 12px;
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.col-left {
|
||||
.details-form {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.col-right {
|
||||
flex: 1;
|
||||
border-left: 1px solid #f0f0f0;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.right-col {
|
||||
grid-column: 2 / 3;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
/* 隐藏滚动条 */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 1px 4px rgba(0,0,0,0.06);
|
||||
border: 1px solid #ebeef5;
|
||||
|
||||
.panel-actions {
|
||||
text-align: right;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.panel-info {
|
||||
border-top: 1px dashed #ebeef5;
|
||||
padding-top: 15px;
|
||||
|
||||
.info-item {
|
||||
margin-bottom: 10px;
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.info-label {
|
||||
color: #909399;
|
||||
}
|
||||
.info-value {
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
}
|
||||
.image-placeholder {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.placeholder-content {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
|
||||
p {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
padding: 10px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -44,7 +44,7 @@ export const entryColums = [
|
||||
{ prop: 'order_type',label:'类型',width:'160' },
|
||||
|
||||
{ prop: 'purchase_order_code',label:'单据编号 ',width:'160' },
|
||||
{ prop: 'total_order_lines',label:'商品数',width:'160' },
|
||||
{ prop: 'total_order_lines',label:'商品数',width:'160', sortable: 'custom' },
|
||||
{ prop: 'order_status',label:'订单状态',width:'160' },
|
||||
{ prop: 'sync_status',label:'同步状态',width:'160' },
|
||||
{ prop: 'supplier_code',label:'供应商编码',width:'160' },
|
||||
@ -77,20 +77,18 @@ export const entrydetail = [
|
||||
{ prop: 'received_quantity', label: '实收数量', width: '160' },
|
||||
{ prop: 'confirm_quantity', label: '确认数量', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
{ prop: '', label: '', width: '160' },
|
||||
]
|
||||
|
||||
export const detailpanel = [
|
||||
{ label: '入库单号', prop: 'entry_order_code', disabled: true },
|
||||
{ label: '货主名称', prop: 'store_name', disabled: true },
|
||||
{ label: '订单状态', prop: 'order_status', type: 'select' },
|
||||
{ label: '入库类型', prop: 'order_type', type: 'select' },
|
||||
{ label: '单据编号', prop: 'purchase_order_code' },
|
||||
{ label: '同步状态', prop: 'sync_status', type: 'select' },
|
||||
{ label: '供应商编码', prop: 'supplier_code' },
|
||||
{ label: '供应商名称', prop: 'supplier_name' },
|
||||
{ label: '运单号', prop: 'express_code' },
|
||||
{ label: '物流公司', prop: 'logistics_name' },
|
||||
{ label: '备注', prop: 'remark' }
|
||||
]
|
||||
@ -41,6 +41,7 @@
|
||||
:loading="loading"
|
||||
:queryTime="queryTime"
|
||||
@current-change="handleRowClick"
|
||||
@sort-change="handleSortChange"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadData"
|
||||
@ -138,6 +139,7 @@ const hasSelection = ref(false)
|
||||
const selectedEntryId = ref<number | string | null>(null)
|
||||
|
||||
const quickSearch = ref('')
|
||||
const currentSort = reactive({ prop: '', order: '' })
|
||||
|
||||
const componentMap: Record<string, any> = {
|
||||
details: entrydetail,
|
||||
@ -195,6 +197,8 @@ async function loadData() {
|
||||
page: pagination.currentPage,
|
||||
page_size: pagination.pageSize,
|
||||
quick_search: quickSearch.value,
|
||||
sort_prop: currentSort.prop,
|
||||
sort_order: currentSort.order,
|
||||
...(scanBox.value?.getConditions() || {})
|
||||
}
|
||||
|
||||
@ -343,6 +347,13 @@ function handleConditionChange(condition: any) {
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleSortChange({ prop, order }: any) {
|
||||
currentSort.prop = prop
|
||||
currentSort.order = order
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
const handleConditionClear = () => {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
@ -444,7 +455,7 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 0 0 auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
|
||||
overflow: hidden;
|
||||
@ -480,7 +491,8 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 1;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -517,7 +529,8 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 1;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@ -388,7 +388,7 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 0 0 auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
|
||||
overflow: hidden;
|
||||
@ -424,7 +424,8 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 1;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -457,7 +458,8 @@ function handleImport() {
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 1;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@ -1,55 +1,70 @@
|
||||
<template>
|
||||
<div class="receiving-details">
|
||||
<div class="left-col">
|
||||
<div class="col-left">
|
||||
<el-form :model="form" label-width="120px" >
|
||||
<el-form-item
|
||||
v-for="field in detailpanel"
|
||||
:key="field.prop"
|
||||
:label="field.label"
|
||||
:prop="field.prop"
|
||||
>
|
||||
<template v-if="field.type === 'select'">
|
||||
<el-select
|
||||
v-model="(form as any)[field.prop]"
|
||||
:placeholder="'请选择' + field.label"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in availableFields.find(f => f.value === field.prop)?.options || []"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
<div class="receiving-details-container">
|
||||
<el-form :model="form" label-width="120px" class="details-form">
|
||||
<el-row :gutter="30">
|
||||
<!-- 第一列:收货明细 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
v-for="field in detailpanel"
|
||||
:key="field.prop"
|
||||
:label="field.label"
|
||||
:prop="field.prop"
|
||||
>
|
||||
<template v-if="field.type === 'select'">
|
||||
<el-select
|
||||
v-model="(form as any)[field.prop]"
|
||||
:placeholder="'请选择' + field.label"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in availableFields.find(f => f.value === field.prop)?.options || []"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input
|
||||
v-model="(form as any)[field.prop]"
|
||||
:disabled="field.disabled"
|
||||
:placeholder="'请输入' + field.label"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input
|
||||
v-model="(form as any)[field.prop]"
|
||||
:disabled="field.disabled"
|
||||
:placeholder="'请输入' + field.label"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="col-right"></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<aside class="right-col">
|
||||
<div class="right-panel">
|
||||
<div class="panel-actions">
|
||||
<el-button type="">重置</el-button>
|
||||
<el-button type="primary" @click="handleSave" :loading="saveLoading">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
<!-- 第二列:收货图片占位 -->
|
||||
<el-col :span="12">
|
||||
<div class="image-placeholder">
|
||||
<div class="placeholder-content">
|
||||
<el-icon :size="48" color="#909399"><Picture /></el-icon>
|
||||
<p>收货图片占位区</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<div class="bottom">
|
||||
<el-button-group class="toolbar-btn-group">
|
||||
<el-button type="primary" icon="Check" @click="handleSave" :loading="saveLoading">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button type="danger" icon="Refresh" @click="handleReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { availableFields, detailpanel } from '../receiving-config'
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Picture, Check, Refresh } from '@element-plus/icons-vue'
|
||||
|
||||
const props = defineProps<{
|
||||
id: string | number,
|
||||
@ -76,8 +91,7 @@ const saveLoading = ref(false)
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
saveLoading.value = true
|
||||
// 这里可以调用接口保存数据,例如:
|
||||
// await api.saveReceivingDetails(props.id, form.value)
|
||||
// 这里可以调用接口保存数据
|
||||
ElMessage.success('保存成功')
|
||||
} catch (error) {
|
||||
ElMessage.error('保存失败')
|
||||
@ -86,8 +100,14 @@ const handleSave = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
if (props.row) {
|
||||
form.value = { ...props.row }
|
||||
}
|
||||
ElMessage.info('表单已重置')
|
||||
}
|
||||
|
||||
// 监听 row 变化,更新表单数据
|
||||
import { watch } from 'vue'
|
||||
watch(() => props.row, (newRow) => {
|
||||
if (newRow) {
|
||||
form.value = { ...newRow }
|
||||
@ -101,60 +121,57 @@ onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.receiving-details {
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 320px;
|
||||
gap: 0 16px;
|
||||
align-items: start;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #fff }
|
||||
|
||||
.left-col {
|
||||
grid-column: 1 / 2;
|
||||
<style scoped lang="scss">
|
||||
.receiving-details-container {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding-right: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 24px;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.col-left {
|
||||
flex: 1;
|
||||
}
|
||||
.col-right {
|
||||
flex: 1;
|
||||
background: #000000d8;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.right-col {
|
||||
grid-column: 2 / 3;
|
||||
height: 100%;
|
||||
.details-form {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
/* 隐藏滚动条 */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.right-panel { position: sticky;
|
||||
top: 20px; background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 12px;
|
||||
box-shadow: 0 1px 4px rgba(0,0,0,0.06)
|
||||
.image-placeholder {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.placeholder-content {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
|
||||
p {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panel-item { display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 12px
|
||||
}
|
||||
.panel-label { color: #606266; font-size: 13px; margin-bottom: 6px }
|
||||
.panel-value { font-weight: 500 }
|
||||
.panel-actions {
|
||||
.bottom {
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
padding: 0px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -36,6 +36,16 @@
|
||||
<span v-else>--</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #column-storage_status="{ row }">
|
||||
<el-tag
|
||||
:type="formatProductStorageStatus(row.storage_status).config.tagType"
|
||||
size="small"
|
||||
effect="light"
|
||||
>
|
||||
{{ formatProductStorageStatus(row.storage_status).text }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</UpperTable>
|
||||
</div>
|
||||
|
||||
@ -96,7 +106,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, computed, reactive, watch } from 'vue'
|
||||
import { productdetail,productquick,productsnapshop,windowtopbar } from '../receiving-config'
|
||||
import { productdetail, productquick, productsnapshop, windowtopbar, formatProductStorageStatus } from '../receiving-config'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { FullScreen, Close, CopyDocument } from '@element-plus/icons-vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
@ -464,7 +474,7 @@ onUnmounted(() => {
|
||||
|
||||
<style scoped>
|
||||
.product-details {
|
||||
/* padding: 5px; */
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
@ -665,4 +675,35 @@ onUnmounted(() => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 商品入库状态样式 */
|
||||
:deep(.el-table) {
|
||||
.storage-status-tag {
|
||||
font-weight: 500;
|
||||
padding: 2px 8px;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* 全部入库 - 绿色 */
|
||||
.storage-status-all {
|
||||
background-color: #f0f9ff;
|
||||
color: #67C23A;
|
||||
border: 1px solid #c6e2ff;
|
||||
}
|
||||
|
||||
/* 部分入库 - 橙色 */
|
||||
.storage-status-partial {
|
||||
background-color: #fdf6ec;
|
||||
color: #E6A23C;
|
||||
border: 1px solid #f5dab1;
|
||||
}
|
||||
|
||||
/* 未入库 - 灰色 */
|
||||
.storage-status-none {
|
||||
background-color: #f5f7fa;
|
||||
color: #909399;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1020,8 +1020,8 @@ async function handleExport() {
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 0 0 auto;
|
||||
max-height: 40%;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -1058,7 +1058,7 @@ async function handleExport() {
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 0 0 auto;
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -16,6 +16,19 @@ export const storageStatusConfig = {
|
||||
none: { text: '未入库', tagType: 'info' }
|
||||
}
|
||||
|
||||
// 商品入库状态映射
|
||||
export const productStorageStatusConfig: any = {
|
||||
all: { text: '全部入库', tagType: 'success', color: '#67C23A' },
|
||||
partial: { text: '部分入库', tagType: 'warning', color: '#E6A23C' },
|
||||
none: { text: '未入库', tagType: 'info', color: '#909399' }
|
||||
}
|
||||
|
||||
// 格式化产品入库状态
|
||||
export function formatProductStorageStatus(value: string): { text: string; config: any } {
|
||||
const config = productStorageStatusConfig[value] || productStorageStatusConfig.none
|
||||
return { text: config.text, config }
|
||||
}
|
||||
|
||||
export const deliveryMethodConfig: any = {
|
||||
truck: { text: '货车', tagType: 'primary' },
|
||||
express: { text: '快递', tagType: 'success' },
|
||||
@ -29,6 +42,25 @@ export const loadingMethodConfig: any = {
|
||||
without_pallet: { text: '不带托盘', tagType: 'info' }
|
||||
}
|
||||
|
||||
// 时间格式化函数
|
||||
export function formatDateTime(dateStr: string): string {
|
||||
if (!dateStr) return '--'
|
||||
try {
|
||||
const date = new Date(dateStr)
|
||||
if (isNaN(date.getTime())) return '--'
|
||||
// 转换为本地时间,格式:YYYY-MM-DD HH:mm:ss
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
} catch (e) {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
|
||||
export const receivingColumns = [
|
||||
{ prop: 'receiving_number', label: '收货单号', width: '110', fixed: 'left' },
|
||||
{ prop: 'status', label: '收货状态', width: '90', align: 'center' },
|
||||
@ -44,10 +76,10 @@ export const receivingColumns = [
|
||||
{ prop: 'delivery_method', label: '来货方式', width: '90', align: 'center' },
|
||||
{ prop: 'loading_method', label: '装卸方式', width: '100', align: 'center' },
|
||||
{ prop: 'creator_name', label: '创建人', width: '100' },
|
||||
{ prop: 'receiving_start_time', label: '收货开始', width: '150', sortable: true },
|
||||
{ prop: 'receiving_end_time', label: '收货结束', width: '150', sortable: true },
|
||||
{ prop: 'created_at', label: '创建时间', width: '150', sortable: true },
|
||||
{ prop: 'updated_at', label: '更新时间', width: '150', sortable: true },
|
||||
{ prop: 'receiving_start_time', label: '收货开始', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.receiving_start_time) },
|
||||
{ prop: 'receiving_end_time', label: '收货结束', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.receiving_end_time) },
|
||||
{ prop: 'created_at', label: '创建时间', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.created_at) },
|
||||
{ prop: 'updated_at', label: '更新时间', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.updated_at) },
|
||||
{ prop: 'remark', label: '备注', minWidth: '120' },
|
||||
]
|
||||
|
||||
|
||||
27
src/views/system/setting/account/account-config.ts
Normal file
27
src/views/system/setting/account/account-config.ts
Normal file
@ -0,0 +1,27 @@
|
||||
export const accountColumns = [
|
||||
{ label: '工号ID', prop: 'employee_id', width: 80 },
|
||||
{ label: '头像', prop: 'avatar_url', width: 70 },
|
||||
{ label: '姓名', prop: 'real_name', width: 120 },
|
||||
{ label: '手机号', prop: 'phone', width: 120 },
|
||||
{ label: '用户名', prop: 'username', width: 120 },
|
||||
{ label: '邮箱', prop: 'email', minWidth: 150 },
|
||||
{ label: '状态', prop: 'status', width: 100 },
|
||||
{ label: '操作', prop: 'actions', width: 200, fixed: 'right' }
|
||||
]
|
||||
|
||||
export const defaultTemp = {
|
||||
employee_id: undefined,
|
||||
phone: '',
|
||||
real_name: '',
|
||||
username: '',
|
||||
password: '',
|
||||
role_id: undefined,
|
||||
email: '',
|
||||
file_id: undefined,
|
||||
avatar_url: ''
|
||||
}
|
||||
|
||||
export const accountRules = {
|
||||
phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
||||
real_name: [{ required: true, message: '请输入工号姓名', trigger: 'blur' }]
|
||||
}
|
||||
254
src/views/system/setting/account/index.vue
Normal file
254
src/views/system/setting/account/index.vue
Normal file
@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div class="account-container app-container">
|
||||
<div class="filter-container">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="listQuery.status" placeholder="状态" clearable style="width: 120px">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="停用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="包含已删除">
|
||||
<el-switch v-model="listQuery.includeDisabled" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleFilter">搜索</el-button>
|
||||
<el-button type="success" icon="Plus" @click="handleCreate">新增工号</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<upper-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
row-key="employee_id"
|
||||
>
|
||||
<template #column-avatar_url="{ row }">
|
||||
<el-avatar :size="30" :src="row.avatar_url">
|
||||
<img src="https://cube.elemecdn.com/e/fd/0fc7693967a94116a3f11b0106734664jpg.png" />
|
||||
</el-avatar>
|
||||
</template>
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="row.status === 1 ? 'success' : 'danger'">
|
||||
{{ row.status === 1 ? '启用' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-actions="{ row }">
|
||||
<el-button type="primary" size="small" icon="Edit" @click="handleUpdate(row)">编辑</el-button>
|
||||
<el-button v-if="row.status === 1" type="danger" size="small" icon="Delete" @click="handleDelete(row)">停用</el-button>
|
||||
</template>
|
||||
</upper-table>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog :title="textMap[dialogStatus]" v-model="dialogFormVisible" width="1300px" top="2vh" custom-class="account-dialog" @close="handleDialogClose">
|
||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="80px">
|
||||
<!-- 上部:基础信息 -->
|
||||
<div class="form-section base-info">
|
||||
<div class="section-title">基础信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="temp.phone" :disabled="dialogStatus==='update'" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="real_name">
|
||||
<el-input v-model="temp.real_name" placeholder="请输入工号姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="dialogStatus === 'create'">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="temp.username" placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="temp.password" type="password" placeholder="默认 111111" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="temp.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 下部:头像管理 -->
|
||||
<div v-if="dialogStatus === 'update'" class="form-section avatar-section">
|
||||
<div class="section-title">工号头像 (支持本地上传及摄像头拍摄)</div>
|
||||
<div class="avatar-upload-container">
|
||||
<images-upload
|
||||
v-if="temp.employee_id"
|
||||
ref="imagesUploadRef"
|
||||
:id="temp.employee_id"
|
||||
type="avatar"
|
||||
@refresh="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { accountList, accountAdd, accountUpdate, accountdelete } from '@/api/setting/account'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import ImagesUpload from '@/components/ImagesUpload/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { accountColumns, defaultTemp, accountRules } from './account-config'
|
||||
|
||||
const list = ref([])
|
||||
const listLoading = ref(true)
|
||||
const listQuery = reactive({
|
||||
status: 1,
|
||||
includeDisabled: false
|
||||
})
|
||||
|
||||
const imagesUploadRef = ref()
|
||||
|
||||
const columns = accountColumns
|
||||
|
||||
const temp = reactive({ ...defaultTemp })
|
||||
|
||||
const dialogFormVisible = ref(false)
|
||||
const dialogStatus = ref('')
|
||||
const textMap: Record<string, string> = {
|
||||
update: '编辑工号',
|
||||
create: '新增工号'
|
||||
}
|
||||
|
||||
const rules = accountRules
|
||||
|
||||
const getList = async () => {
|
||||
listLoading.value = true
|
||||
try {
|
||||
const response = await accountList(listQuery)
|
||||
list.value = response.data || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
listLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleFilter = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetTemp = () => {
|
||||
Object.assign(temp, defaultTemp)
|
||||
}
|
||||
|
||||
const handleCreate = () => {
|
||||
resetTemp()
|
||||
dialogStatus.value = 'create'
|
||||
dialogFormVisible.value = true
|
||||
}
|
||||
|
||||
const createData = async () => {
|
||||
try {
|
||||
const { phone, real_name, username, password,email } = temp
|
||||
await accountAdd({ phone, real_name, username, password, email })
|
||||
dialogFormVisible.value = false
|
||||
ElMessage.success('创建成功')
|
||||
getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleUpdate = (row: any) => {
|
||||
Object.assign(temp, row)
|
||||
dialogStatus.value = 'update'
|
||||
dialogFormVisible.value = true
|
||||
}
|
||||
|
||||
const handleDialogClose = () => {
|
||||
imagesUploadRef.value?.stopCamera()
|
||||
}
|
||||
|
||||
const updateData = async () => {
|
||||
try {
|
||||
const { employee_id, real_name, file_id } = temp
|
||||
await accountUpdate({ employee_id: employee_id!, real_name, file_id })
|
||||
dialogFormVisible.value = false
|
||||
ElMessage.success('更新成功')
|
||||
getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
ElMessageBox.confirm('确认停用该工号吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
await accountdelete({ employee_id: row.employee_id })
|
||||
ElMessage.success('已停用')
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
const handleAvatarSuccess = (res: any) => {
|
||||
temp.file_id = res.file_id
|
||||
temp.avatar_url = res.url
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.account-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #606266;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-upload-container {
|
||||
background: #fff;
|
||||
min-height: 500px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:deep(.account-dialog) {
|
||||
.el-dialog__body {
|
||||
padding: 20px 25px;
|
||||
max-height: 85vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
23
日志.md
23
日志.md
@ -15,6 +15,7 @@
|
||||
根据需要更新完善orderManagement的"待审核订单"、"待处理订单"、"异常订单"、"配送订单"、"归档订单"五个页面的字段明细、筛选条件
|
||||
根据情况设计新增其他页面、新增操作功能或修复已有问题。
|
||||
|
||||
|
||||
2026.3.24
|
||||
一、今日完成
|
||||
“收货单”添加打印/批量打印收货单功能,能够根据所选的打印单号打印/批量打印收货单。
|
||||
@ -52,3 +53,25 @@
|
||||
三、后续计划
|
||||
完善项目页面及其组件屏幕尺寸适配。
|
||||
添加后端已完成的api接口并进行功能的完善与开发。
|
||||
|
||||
|
||||
2026.3.26
|
||||
一、今日完成
|
||||
-新增用户管理页面,添加account-config.ts用户管理配置文件和account.ts接口文件,实现用户管理功能。
|
||||
-优化stock、receving、entry、inventory、deliveryOrder页面和相关组件布局,统一结构设计和样式布局,提升可维护性。
|
||||
-修复receiving页面时间格式显示异常问题。
|
||||
-优化stock接口,排除删除废弃或无用接口。
|
||||
-更新stock-config.ts配置文件,提升stock页面维护性;更新表格状态字段数据。
|
||||
-
|
||||
|
||||
二、问题记录
|
||||
-stock回收站,后端 stock.warehouse.list 接口(对应的数据库表)中不存在 is_deleted 字段,或者该接口不支持通过 is_deleted 参数进行过滤。
|
||||
-stock.warehouse.bindItem接口错误,数据库架构与查询语句不匹配。
|
||||
-图片上传遇到跨域问题。
|
||||
|
||||
三、后续计划
|
||||
完善接口设计,排除故障接口,测试接口功能。
|
||||
完善各页面config.ts配置设计,优化功能结构。
|
||||
完善各页面布局设计,统一样式和风格,降低维护成本。
|
||||
解决跨域问题。
|
||||
解决路由相关的一些潜在小问题。
|
||||
Loading…
x
Reference in New Issue
Block a user