This commit is contained in:
zmj 2024-06-03 18:02:57 +08:00
parent 96c000d2e9
commit 4f216c4a2c
11 changed files with 590 additions and 5 deletions

3
.gitignore vendored
View File

@ -32,4 +32,5 @@ components.d.ts
# .env # .env
.env.development .env.development
.env.production .env.production
helper.json

22
src/api/goodsList.ts Normal file
View File

@ -0,0 +1,22 @@
import request from '@/utils/request'
// 商品列表
export function apiGoodsListLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/lists', params })
}
// 库存管理
export function apiGoodsListDetail(params: any) {
return request.get({ url: '/consult_target.consult_decision/add', params })
}
// 库存管理
export function apiGoodsTypeLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/add', params })
}
// 上架&下架
export function apiStatus(params: any) {
return request.post({ url: '/consult_target.consult_decision/add', params })
}

View File

@ -13,10 +13,10 @@ export function logout() {
// 用户信息 // 用户信息
export function getUserInfo() { export function getUserInfo() {
return request.get({ url: '/auth.admin/mySelf' }) return request.get({ url: '/auth/admin/mySelf' })
} }
// 编辑管理员信息 // 编辑管理员信息
export function setUserInfo(params: any) { export function setUserInfo(params: any) {
return request.post({ url: '/auth.admin/editSelf', params }) return request.post({ url: '/auth/admin/editSelf', params })
} }

View File

@ -0,0 +1,210 @@
<!-- 订单详情 -->
<template>
<el-drawer v-model="showDetail" direction="rtl" :destroy-on-close="true" title="订单详情" size="50%">
<template #header>
<h4>订单详情</h4>
</template>
<template #default>
<!-- head -->
<div class="flex">
<el-image class="w-[50px] h-[50px]" :src="url" :fit="fit" />
<div class="flex flex-col ml-3 justify-between">
<div style="font-size:16px">
核销订单
</div>
<div>
订单编号 5754545
</div>
</div>
</div>
<ul class="flex justify-between w-[70%] mt-[20px]">
<li>
<div>订单状态</div>
<div>未核销</div>
</li>
<li>
<div>实际支付</div>
<div>未核销</div>
</li>
<li>
<div>支付方式</div>
<div>未核销</div>
</li>
<li>
<div>支付时间</div>
<div>未核销</div>
</li>
</ul>
<!-- content -->
<el-tabs v-model="activeName" class="mt-[20px]">
<el-tab-pane label="订单信息" name="first">
<el-descriptions :column="3" border title="用户信息" class="mb-[30px]"
v-for="(item, index) in orderInfoCongig" :key="index">
<el-descriptions-item :label="el.name" label-class-name="my-label" v-for="el in item.child">
{{ el.value }}
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="商品信息" name="second">
<el-table border :data="formData.detail">
<el-table-column label="商品信息" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<div class="flex items-center w-[300px] ">
<el-image class="w-[50px] h-[50px] mr-2" :src="url" />
受到广泛接
</div>
</template>
</el-table-column>
<el-table-column label="价格" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="数量" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="小计" prop="engineering_status_text" show-overflow-tooltip />
</el-table>
</el-tab-pane>
<el-tab-pane label="订单记录" name="third">
<el-table border :data="formData.detail2">
<el-table-column label="订单id" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="操作记录" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="操作时间" prop="engineering_status_text" show-overflow-tooltip />
</el-table>
</el-tab-pane>
</el-tabs>
</template>
<template #footer>
<div style="flex: auto">
<el-button type="primary" @click="showDetail = false">确定</el-button>
</div>
</template>
</el-drawer>
</template>
<script lang="ts" setup>
import { ref, reactive, defineEmits, defineProps } from "vue"
const showDetail = ref(false)
const url =
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
const props = defineProps({
// showDetail: {
// type: Boolean,
// },
})
const formData = reactive({
detail: [
{}
],
detail2: [],
})
const orderInfoCongig = reactive([
{
title: '用户信息',
child: [
{
name: "用户昵称",
value: '军哥'
},
{
name: "绑定电话",
value: '19130550023'
},
]
},
{
title: '收货人信息',
child: [
{
name: "收货人",
value: '好天气'
},
{
name: "收获电话",
value: '19130550023'
},
{
name: "收获地址",
value: '19130550023'
},
]
},
{
title: '订单信息',
child: [
{
name: "创建时间",
value: '好天气'
},
{
name: "商品总数",
value: '19130550023'
},
{
name: "商品总价",
value: '19130550023'
},
{
name: "优惠券金额",
value: '好天气'
},
{
name: "积分抵扣",
value: '19130550023'
},
{
name: "支付邮费",
value: '19130550023'
},
{
name: "会员商品优惠",
value: '好天气'
},
{
name: "门店名称",
value: '19130550023'
},
{
name: "核销码",
value: '19130550023'
},
{
name: "支付时间",
value: '19130550023'
},
{
name: "支付方式",
value: '19130550023'
},
]
},
])
const activeName = 'first'
const open = () => {
showDetail.value = true
}
const close = () => {
showDetail.value = false
}
defineExpose({
open,
close
})
</script>

View File

@ -3,10 +3,9 @@ const config = {
title: '后台管理系统', //网站默认标题 title: '后台管理系统', //网站默认标题
version: '1.8.0', //版本号 version: '1.8.0', //版本号
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名 baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名
urlPrefix: 'adminapi', //请求默认前缀 urlPrefix: 'store', //请求默认前缀
timeout: 10 * 1000 //请求超时时长 timeout: 10 * 1000 //请求超时时长
} }
console.log(import.meta,'meta')
export default config export default config

View File

@ -0,0 +1 @@
<!-- 员工 -->

View File

@ -0,0 +1 @@
<!-- 财务 -->

View File

@ -0,0 +1,83 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
<el-table border :data="formData.detail">
<el-table-column label="图片" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<!-- <el-image style="width: 50px; height: 50px" :src="url" /> -->
</template>
</el-table-column>
<el-table-column label="产品规格" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="商品条形码" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="商品编码" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="当前库存" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="入/出库数量" prop="engineering_status_text" show-overflow-tooltip />
<!-- <el-table-column label="状态" prop="engineering_status_text" show-overflow-tooltip>
<template #default="{ row }">
</template>
</el-table-column> -->
</el-table>
</popup>
</div>
</template>
<script lang="ts" setup name="manageProjectEdit">
import Popup from '@/components/popup/index.vue'
const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return '库存管理'
})
//
const formData = reactive({
id: '',
detail: []
})
//
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 handleSubmit = async () => {
emit('close')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
})
</script>

View File

@ -0,0 +1,145 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="商品状态">
<el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品状态">
<el-option label="销售中" :value="0" />
<el-option label="仓库中" :value="0" />
<el-option label="已售罄" :value="0" />
<el-option label="库存预警" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品分类" prop="project_code">
<!-- <el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品分类">
<el-option v-for="(item, index) in typeLists" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品搜索" prop="nature">
<el-input v-model="queryParams.status" clearable placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table border :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="商品id" prop="progress" show-overflow-tooltip />
<el-table-column label="商品图" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<!-- <el-image style="width: 50px; height: 50px" :src="url" /> -->
</template>
</el-table-column>
<el-table-column label="商品名称" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="商品售价" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="销量" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="库存" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="排序" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="状态" prop="engineering_status_text" show-overflow-tooltip>
<template #default="{ row }">
<el-switch v-model="row.status" :active-value="1" :inactive-value="0"
@change="changeStatus(row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button type="primary" 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>
<edit-popup v-if="showDetail" ref="editRef" @close="showDetail = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiGoodsListDetail, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
import EditPopup from './detail.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showDetail = ref(false)
//
const queryParams = reactive({
status: ""
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
params: queryParams
})
// &
const changeStatus = (data: any) => {
apiStatus({
// id: data.id,
// account: data.account,
// name: data.name,
// role_id: data.role_id,
// disable: data.disable,
// org_id: data.org_id,
// dept_id: data.dept_id,
// job_id: data.job_id,
// multipoint_login: data.multipoint_login
}).finally(() => {
getLists()
})
}
//
const handleEdit = async (data: any) => {
// let res = await apiGoodsListDetail({ id: data.id })
showDetail.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
const typeLists = reactive([])
const getTypeLists = async () => {
let res = await apiGoodsTypeLists()
typeLists.push(...res)
}
getTypeLists()
getLists()
</script>

View File

@ -0,0 +1,122 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="商品状态">
<el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品状态">
<el-option label="销售中" :value="0" />
<el-option label="仓库中" :value="0" />
<el-option label="已售罄" :value="0" />
<el-option label="库存预警" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品分类" prop="project_code">
<!-- <el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品分类">
<el-option v-for="(item, index) in typeLists" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品搜索" prop="nature">
<el-input v-model="queryParams.status" clearable placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table border :data="pager.lists">
<el-table-column label="订单号" prop="progress" show-overflow-tooltip />
<el-table-column label="用户信息" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<!-- <el-image style="width: 50px; height: 50px" :src="url" /> -->
</template>
</el-table-column>
<el-table-column label="商品信息" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="实际支付" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="支付方式" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="收银店员" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="下单时间" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="订单状态" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right" align="center">
<template #default="{ row }">
<el-button type="primary" link @click="handleWriteOff(row.id)">
立即核销
</el-button>
<el-button type="primary" link @click="handleDetail(row.id)">
订单详情
</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>
<orderDetail ref="detailRef"></orderDetail>
<!-- <edit-popup v-if="showDetail" ref="editRef" @close="showDetail = false" /> -->
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import orderDetail from './../../components/orderDetail/index.vue'
import { ref, reactive } from 'vue'
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiGoodsListDetail, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
import feedback from '@/utils/feedback'
//
const queryParams = reactive({
status: ""
})
//
const handleWriteOff = async (id: number) => {
await feedback.confirm('确定要核销订单吗?')
// await adminDelete({ id })
getLists()
}
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
params: queryParams
})
const detailRef = ref(null)
//
const handleDetail = async (data: any) => {
detailRef.value.open()
// let res = await apiGoodsListDetail({ id: data.id })
// showDetail.value = true
// await nextTick()
// editRef.value?.open('edit')
// editRef.value?.setFormData(res)
}
getLists()
</script>

View File

@ -0,0 +1 @@
<!-- 用户 -->