add
This commit is contained in:
parent
6f93320c89
commit
97d643080d
|
@ -1,5 +1,6 @@
|
|||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
VITE_APP_BASE_URL='https://admin-store.lihaink.cn'
|
||||
# VITE_APP_BASE_URL='https://admin-store.lihaink.cn'
|
||||
VITE_APP_BASE_URL='https://test-multi-store.lihaink.cn'
|
||||
# VITE_APP_BASE_URL='https://ceshi-logistics.lihaink.cn/'
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 门店入库操作列表
|
||||
export function apiSystemStoreStorageLists(params: any) {
|
||||
return request.get({ url: '/system_store_storage/systemstorestorage/lists', params })
|
||||
}
|
||||
|
||||
// 添加门店入库操作
|
||||
export function apiSystemStoreStorageAdd(params: any) {
|
||||
return request.post({ url: '/system_store_storage/systemstorestorage/add', params })
|
||||
}
|
||||
|
||||
// 编辑门店入库操作
|
||||
export function apiSystemStoreStorageEdit(params: any) {
|
||||
return request.post({ url: '/system_store_storage/systemstorestorage/edit', params })
|
||||
}
|
||||
|
||||
// 删除门店入库操作
|
||||
export function apiSystemStoreStorageDelete(params: any) {
|
||||
return request.post({ url: '/system_store_storage/systemstorestorage/delete', params })
|
||||
}
|
||||
|
||||
// 门店入库操作详情
|
||||
export function apiSystemStoreStorageDetail(params: any) {
|
||||
return request.get({ url: '/system_store_storage/systemstorestorage/detail', params })
|
||||
}
|
||||
|
||||
// 门店入库操作详情
|
||||
export function apiSystemStoreStorageInfoLists(params: any) {
|
||||
return request.get({ url: '/system_store_storage/systemstorestorage/lists', params })
|
||||
}
|
||||
|
||||
// 门店入库操作详情
|
||||
export function apiSystemStoreStorageInfoEdit(params: any) {
|
||||
return request.post({ url: '/system_store_storage/systemstorestorage/edit', params })
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
title="详情"
|
||||
:async="true"
|
||||
width="550px"
|
||||
:cancelButtonText="false"
|
||||
:confirmButtonText="false"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px">
|
||||
<el-form-item label="门店" prop="store_id">
|
||||
<el-input v-model="formData.store_id" clearable placeholder="请输入门店" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="导入人员" prop="admin_id">
|
||||
<el-input v-model="formData.admin_id" clearable placeholder="请输入导入人员" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店确认人员" prop="operating_id">
|
||||
<el-input v-model="formData.operating_id" clearable placeholder="请输入门店确认人员" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品" prop="product_id">
|
||||
<el-input v-model="formData.product_id" clearable placeholder="请输入商品" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="nums">
|
||||
<el-input v-model="formData.nums" clearable placeholder="请输入数量" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="formData.status" clearable placeholder="请输入状态" :readonly="true"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemStoreStorageDETAILS">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSystemStoreStorageAdd, apiSystemStoreStorageEdit, apiSystemStoreStorageDetail } from '@/api/system_store_storage'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
store_id: '',
|
||||
admin_id: '',
|
||||
operating_id: '',
|
||||
product_id: '',
|
||||
nums: '',
|
||||
status: '',
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSystemStoreStorageDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,112 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="门店" prop="system_store_name">
|
||||
<el-input v-model="formData.system_store_name" clearable placeholder="请输入门店" :readonly="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="nums">
|
||||
<el-input v-model="formData.nums" clearable placeholder="请输入数量" :readonly="false"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemStoreStorageEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSystemStoreStorageAdd, apiSystemStoreStorageEdit, apiSystemStoreStorageDetail } from '@/api/system_store_storage'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑门店入库操作' : '新增门店入库操作'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
system_store_name: '',
|
||||
product_id: '',
|
||||
nums: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
nums: [
|
||||
{ required: true, message: '请输入数量', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSystemStoreStorageDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSystemStoreStorageEdit(data)
|
||||
: await apiSystemStoreStorageAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,95 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="门店" prop="system_store_name" show-overflow-tooltip />
|
||||
<el-table-column label="导入人员" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="门店确认人员" prop="staff_name" show-overflow-tooltip />
|
||||
<el-table-column label="商品图" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image class="w-[40px] h-[40px]" :src="row.image" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品" prop="store_name" show-overflow-tooltip />
|
||||
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-tag type="success" v-if="row.status === 1">已入库</el-tag>
|
||||
<el-tag type="warning" v-else-if="row.status === 0">待确认</el-tag>
|
||||
<el-tag type="danger" v-else-if="row.status === -1">库存不足</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="mark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.status == 0"
|
||||
v-perms="['system_store_storage.system_store_storage/edit']" type="success" link
|
||||
@click="handleEdit(row)">
|
||||
确认入库
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemStoreStorageLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiSystemStoreStorageLists, apiSystemStoreStorageDelete, apiSystemStoreStorageInfoLists, apiSystemStoreStorageInfoEdit } from '@/api/system_store_storage'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
store_id: '',
|
||||
admin_id: '',
|
||||
operating_id: '',
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSystemStoreStorageInfoLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
apiSystemStoreStorageInfoEdit({
|
||||
id: data.id
|
||||
}).then(res => {
|
||||
getLists()
|
||||
})
|
||||
}
|
||||
getLists()
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue