更新接口路径,调整配置,优化用户及订单管理功能,并修复部分bug

This commit is contained in:
zmj 2024-06-07 12:00:32 +08:00
parent c43b561d6c
commit 0a737b7b4b
12 changed files with 345 additions and 71 deletions

View File

@ -43,4 +43,13 @@ watch(
</el-config-provider>
</template>
<style></style>
<style>
.el-table th.el-table__cell>.cell {
text-align: center;
}
.el-table td.el-table__cell div {
text-align: center;
}
</style>

View File

@ -49,3 +49,10 @@ export function apiStaffDetail(params:any) {
export function apiStaffStatus(params:any) {
return request.post({ url: '/staff/status',params })
}
// 修改密码
export function apiStaffPwd(params: any) {
return request.post({ url: "/auth.admin/pwd", params });
}

View File

@ -9,3 +9,18 @@ export function apiStorFinanceFlowLists(params: any) {
export function apiStorFinanceFlowRemarks(params: any) {
return request.post({ url: '/finance/finance/remark', params })
}
export function apiStoreBillLists(params: any) {
return request.get({ url: '/finance/storeBill/lists', params })
}
export function apiStoreBillDetail(params: any) {
return request.get({ url: '/finance/storeBill/detail', params })
}
export function apiStoreBillDownload(params: any) {
return request.get({ url: '/finance/storeBill/download', params })
}

View File

@ -94,8 +94,6 @@ const handleDetail = async (data: any) => {
//
const handleDown = async (row) => {
const a = document.createElement('a')
// a.href = import.meta.env.VITE_APP_BASE_URL + res.url
a.click()

View File

@ -11,19 +11,19 @@
<el-form-item label="店员账号" prop="account">
<el-input v-model="formData.account" clearable placeholder="请输入店员账号" />
</el-form-item>
<el-form-item label="店员密码" prop="pwd">
<el-form-item label="店员密码">
<el-input v-model="formData.pwd" clearable placeholder="请输入店员账号" type="password" />
</el-form-item>
<el-form-item label="确认密码" prop="rePwd">
<el-form-item label="确认密码">
<el-input v-model="formData.rePwd" clearable placeholder="请确认账号密码" type="password" />
</el-form-item>
<el-form-item label="核销开关" prop="rePwd">
<el-form-item label="核销开关">
<el-switch v-model="formData.verify_status" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="订单状态" prop="rePwd">
<el-form-item label="订单状态">
<el-switch v-model="formData.order_status" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="是否是店长" prop="rePwd">
<el-form-item label="是否是店长">
<el-switch v-model="formData.is_manager" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="手机号码" prop="phone">
@ -61,7 +61,7 @@ const popupTitle = computed(() => {
const formData = reactive({
id: '',
staff_name: '',
avatar: 'https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20240606/20240606162227e3e005096.jpg',
avatar: '',
account: '',
pwd: '',
rePwd: '',

View File

@ -48,7 +48,7 @@
@change="changeStatus(row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<el-table-column label="操作" width="230" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)">
编辑
@ -67,6 +67,26 @@
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
<DetailPopup v-if="showDetail" ref="detailRef" @close="showEdit = false" />
<!-- 修改密码 -->
<el-dialog v-model="showDialog" v-if="showDialog" width="550px" title="修改密码">
<el-form class="mb-[-16px]" :model="form" label-width="100px">
<el-form-item label="账号">
<el-input v-model="form.account" readonly class="w-[280px]" />
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" class="w-[280px]" clearable type="password" />
</el-form-item>
<el-form-item label="确认密码">
<el-input v-model="form.password_confirm" class="w-[280px]" clearable type="password" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlePwd">修改</el-button>
<el-button @click="showDialog = false, resetForm()">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
@ -75,7 +95,7 @@ import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
import { apiStaffLists, apiStaffDetail, apiStaffStatus } from '@/api/goodsList.ts'
import { apiStaffLists, apiStaffDetail, apiStaffStatus, apiStaffPwd } from '@/api/goodsList.ts'
const detailRef = ref(null)
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
@ -138,5 +158,26 @@ const handleDetail = async (data: any) => {
})
}
const showDialog = ref(false)
const form = reactive({
id: '',
password: '',
password_confirm: ''
})
const resetForm = () => {
form.id = ''
form.password = ''
form.password_confirm = ''
}
const handlePwd = async () => {
await adminPwd({ ...form })
showDialog.value = false
resetForm()
}
getLists()
</script>

View File

@ -39,14 +39,14 @@ const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑日程安排' : '新增日程安排'
return mode.value == 'edit' ? '编辑配送员' : '新增配送员'
})
//
const formData = reactive({
id: '',
nickname: '',
avatar: 'https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20240606/20240606162227e3e005096.jpg',
avatar: '',
phone: '',
status: 0
})

View File

@ -45,6 +45,9 @@
<el-button type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(row.id)">
删除
</el-button>
<el-button type="primary" link @click="handleDetail(row)">
详情
</el-button>
@ -67,7 +70,8 @@ import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
import { apiDeliveryLists, apiDeliveryDetail, apiDeliveryStatus } from '@/api/delivery.ts'
import { apiDeliveryLists, apiDeliveryDetail, apiDeliveryStatus, apiDeliveryDelete } from '@/api/delivery.ts'
import feedback from '@/utils/feedback'
const detailRef = ref(null)
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
@ -129,5 +133,12 @@ const handleDetail = async (data: any) => {
})
}
//
const handleDelete = async (id: any[] | number) => {
await feedback.confirm('确定要删除?')
await apiDeliveryDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -3,20 +3,10 @@
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="字典名称">
<el-input
class="w-[280px]"
v-model="queryParams.name"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.name" clearable @keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="字典类型">
<el-input
class="w-[280px]"
v-model="queryParams.type"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.type" clearable @keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="状态">
<el-select class="w-[280px]" v-model="queryParams.status">
@ -33,22 +23,14 @@
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<div>
<el-button
v-perms="['setting.dict.dict_type/add']"
type="primary"
@click="handleAdd"
>
<el-button v-perms="['setting.dict.dict_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['setting.dict.dict_type/delete']"
:disabled="!selectData.length"
type="danger"
@click="handleDelete(selectData)"
>
<el-button v-perms="['setting.dict.dict_type/delete']" :disabled="!selectData.length" type="danger"
@click="handleDelete(selectData)">
<template #icon>
<icon name="el-icon-Delete" />
</template>
@ -57,11 +39,7 @@
</div>
<div class="mt-4" v-loading="pager.loading">
<div>
<el-table
:data="pager.lists"
size="large"
@selection-change="handleSelectionChange"
>
<el-table :data="pager.lists" size="large" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" />
<el-table-column label="字典名称" prop="name" min-width="120" />
@ -76,36 +54,22 @@
<el-table-column label="创建时间" prop="create_time" min-width="180" />
<el-table-column label="操作" width="190" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['setting.dict.dict_type/edit']"
link
type="primary"
@click="handleEdit(row)"
>
<el-button v-perms="['setting.dict.dict_type/edit']" link type="primary"
@click="handleEdit(row)">
编辑
</el-button>
<el-button
v-perms="['setting.dict.dict_data/lists']"
type="primary"
link
>
<router-link
:to="{
<el-button v-perms="['setting.dict.dict_data/lists']" type="primary" link>
<router-link :to="{
path: getRoutePath('setting.dict.dict_data/lists'),
query: {
id: row.id
}
}"
>
}">
数据管理
</router-link>
</el-button>
<el-button
v-perms="['setting.dict.dict_type/delete']"
link
type="danger"
@click="handleDelete(row.id)"
>
<el-button v-perms="['setting.dict.dict_type/delete']" link type="danger"
@click="handleDelete(row.id)">
删除
</el-button>
</template>

View File

@ -1,7 +1,6 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
<el-table :data="pager.lists">
<el-table-column label="图片" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">

View File

@ -0,0 +1,101 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
<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-input v-model="queryParams.keyword" 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-table :data="pager.lists">
<el-table-column label="交易单号" prop="order_sn" show-overflow-tooltip />
<el-table-column label="关联订单" prop="financial_record_sn" show-overflow-tooltip />
<el-table-column label="交易时间" prop="create_time" show-overflow-tooltip />
<el-table-column label="交易金额" prop="number" show-overflow-tooltip />
<el-table-column label="交易人" prop="nickname" show-overflow-tooltip />
<el-table-column label="关联店员" prop="staff_name" show-overflow-tooltip />
<el-table-column label="交易类型" prop="financial_type_name" show-overflow-tooltip />
<el-table-column label="支付方式" prop="pay_type_name" show-overflow-tooltip />
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</popup>
</div>
</template>
<script lang="ts" setup name="manageProjectEdit">
import Popup from '@/components/popup/index.vue'
import { usePaging } from '@/hooks/usePaging'
import { apiStoreBillDetail } from '@/api/store_finance_flow.ts'
const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
//
const popupTitle = computed(() => {
return '账单详情'
})
let queryParams = {
id: "",
keyword: "",
date_type: "",
date: "",
staff_id: "",
}
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiStoreBillDetail,
params: queryParams
})
//
const handleSubmit = async () => {
emit('close')
}
//
const open = (data: any) => {
queryParams.id = data.id
queryParams.date_type = data.type
queryParams.date = data.type == 2 ?
data.year + '-W' + data.week
:
data.time
console.log(queryParams)
// queryParams.id = id
popupRef.value?.open()
getLists()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
})
</script>

View File

@ -0,0 +1,129 @@
<!-- 门店流水 -->
<!-- 门店流水 -->
<!-- 门店流水 -->
<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-date-picker v-model="date" type="daterange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" value-format="YYYY-MM-DD" :clearable="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="handleResetPage">查询</el-button>
<el-button @click="handleResetParams">重置</el-button>
<!-- <el-button @click="showDialog = true">重置</el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick">
<el-tab-pane label="日账单" :name="1"></el-tab-pane>
<el-tab-pane label="周账单" :name="2"></el-tab-pane>
<el-tab-pane label="月账单" :name="3"></el-tab-pane>
</el-tabs>
<div class="mt-4">
<el-table :data="pager.lists">
<el-table-column label="标题" prop="financial_record_sn" show-overflow-tooltip>
<template #default="{ row }">
{{ queryParams.type == 1 ? '日账单' : queryParams.type == 2 ? '周账单' : "月账单" }}
</template>
</el-table-column>
<el-table-column label="日期" prop="time" show-overflow-tooltip>
<template #default="{ row }">
{{ row.time ? row.time : `${row.year}-${row.week}周(${row.month}月) ` }}
</template>
</el-table-column>
<el-table-column label="收入金额" prop="income" show-overflow-tooltip />
<el-table-column label="支出金额" prop="expense" show-overflow-tooltip />
<el-table-column label="门店入账金额" prop="expense" show-overflow-tooltip>
<template #default="{ row }">
{{ ((+row.income) - (+row.expense)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button @click="handleDetail(row)" link type="primary">详情</el-button>
<el-button @click="handleDownlon(row)" link type="primary">下载</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>
<DetailPop v-if="showDetail" ref="detailRef" @close="showDetail = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiStoreBillLists, apiStoreBillDownload } from '@/api/store_finance_flow.ts'
import DetailPop from './detail.vue'
const activeName = ref(1)
const date = ref(null)
const showDetail = ref(false)
const detailRef = ref(null)
//
const queryParams = reactive({
type: 1,
start_time: "",
end_time: "",
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiStoreBillLists,
params: queryParams
})
const handleResetPage = () => {
if (date.value.length) {
queryParams.start_time = date.value[0]
queryParams.end_time = date.value[1]
}
resetPage()
}
const handleResetParams = () => {
date.value = []
resetParams()
}
const handleClick = (e) => {
queryParams.type = activeName.value
getLists()
}
const handleDetail = async (row) => {
row.type = queryParams.type
showDetail.value = true
await nextTick()
detailRef.value.open(row)
}
const handleDownlon = (row) => {
const a = document.createElement('a')
a.href = 'https://multi-store.crmeb.net/store/bill/index'
a.click()
}
getLists()
</script>