Merge branch 'dev' of https://gitea.dykj.co/sundongyu/dykj-college-back-office-management-system into dev
This commit is contained in:
commit
53dc363736
|
@ -1,6 +1,8 @@
|
|||
import sdy from './modules/sdy'
|
||||
import ycy from './modules/ycy'
|
||||
import lcz from './modules/lcz'
|
||||
export default [
|
||||
...sdy,
|
||||
...ycy
|
||||
...ycy,
|
||||
...lcz,
|
||||
]
|
40
mock/modules/lcz.js
Normal file
40
mock/modules/lcz.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import Mock from "mockjs";
|
||||
|
||||
function randomGender() {
|
||||
return ['男', '女'][Math.floor(Math.random() * 2)];
|
||||
}
|
||||
const student = Mock.mock({
|
||||
"list|100": [
|
||||
{
|
||||
id: '@id',
|
||||
name: '@cname',
|
||||
gender: randomGender(),
|
||||
studentId: '@id',
|
||||
department: function () {
|
||||
return ['计算机科学系', '数学系', '物理系', '化学系'][this.random(0, 3)];
|
||||
},
|
||||
major: function () {
|
||||
return ['计算机科学与技术', '数学', '物理学', '化学', '生物学', '经济学'][this.random(0, 5)];
|
||||
},
|
||||
classes: function () {
|
||||
return ['一班', '二班', '三班', '四班', '五班'][this.random(0, 4)];
|
||||
},
|
||||
status: function () {
|
||||
return ['休学', '退学', '复学'][this.random(0, 2)];
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/api/student',
|
||||
method: 'post',
|
||||
response: (config) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: student.list
|
||||
};
|
||||
}
|
||||
}
|
||||
];
|
|
@ -1,4 +1,6 @@
|
|||
import Mock from "mockjs";
|
||||
|
||||
// 入库列表
|
||||
const StockList = Mock.mock({
|
||||
"list|20-30": [
|
||||
{
|
||||
|
@ -13,6 +15,8 @@ const StockList = Mock.mock({
|
|||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 领用列表
|
||||
const ReceiptList = Mock.mock([
|
||||
{
|
||||
"list|20-30": [
|
||||
|
@ -68,6 +72,63 @@ const ReceiptList = Mock.mock([
|
|||
},
|
||||
]);
|
||||
|
||||
// 退领列表
|
||||
const quitneckList = Mock.mock([
|
||||
{
|
||||
list: [
|
||||
{
|
||||
"id|+1": 0,
|
||||
billserial: "@integer(100000000,199999999)1",
|
||||
proposer: "孙东宇",
|
||||
billType: "@integer(0,4)",
|
||||
receiptNum: "@integer(1,10)",
|
||||
receiptDate: "@date",
|
||||
useInfo: "@csentence",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
list: [
|
||||
{
|
||||
"id|+1": 0,
|
||||
billserial: "@integer(100000000,199999999)1",
|
||||
proposer: "杨春宇",
|
||||
billType: "@integer(0,4)",
|
||||
receiptNum: "@integer(1,10)",
|
||||
receiptDate: "@date",
|
||||
useInfo: "@csentence",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
list: [
|
||||
{
|
||||
"id|+1": 0,
|
||||
billserial: "@integer(100000000,199999999)1",
|
||||
proposer: "吕才卓",
|
||||
billType: "@integer(0,4)",
|
||||
receiptNum: "@integer(1,10)",
|
||||
receiptDate: "@date",
|
||||
useInfo: "@csentence",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
list: [
|
||||
{
|
||||
"id|+1": 0,
|
||||
billserial: "@integer(100000000,199999999)1",
|
||||
proposer: "刘欣宇",
|
||||
billType: "@integer(0,4)",
|
||||
receiptNum: "@integer(1,10)",
|
||||
receiptDate: "@date",
|
||||
useInfo: "@csentence",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
// 人员名单
|
||||
const personName = () => {
|
||||
return [
|
||||
{
|
||||
|
@ -90,6 +151,7 @@ const personName = () => {
|
|||
];
|
||||
};
|
||||
|
||||
// 退库列表
|
||||
const CancelList = Mock.mock({
|
||||
"list|20-30": [
|
||||
{
|
||||
|
@ -105,6 +167,22 @@ const CancelList = Mock.mock({
|
|||
],
|
||||
});
|
||||
|
||||
// 报损列表
|
||||
const breakageList = Mock.mock({
|
||||
"list|20-30": [
|
||||
{
|
||||
"id|+1": 0,
|
||||
billserial: "@integer(100000000,199999999)1",
|
||||
billType: "@integer(0,4)",
|
||||
breakNum: "@integer(1,2)",
|
||||
breakDate: "@date",
|
||||
operator: "@cname",
|
||||
breakStatus: "@integer(0,2)",
|
||||
breakInfo: "@csentence",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
url: "/api/stockList",
|
||||
|
@ -164,4 +242,14 @@ export default [
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
url: "/api/breakageList",
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
code: 200,
|
||||
data: breakageList,
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
7
src/api/finance-bill-manage/breakageList.js
Normal file
7
src/api/finance-bill-manage/breakageList.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import request from "@/utils/requestMock";
|
||||
|
||||
const API = {
|
||||
BACKAGE_LIST: "/breakageList",
|
||||
};
|
||||
|
||||
export const reqBreakageList = () => request.get(API.BACKAGE_LIST);
|
|
@ -1,7 +1,5 @@
|
|||
import request from "@/utils/request";
|
||||
// 统一管理接口
|
||||
const API = {
|
||||
STUDENT_URL: "/api/student",
|
||||
};
|
||||
|
||||
export const reqStudent = () => request.post(API.STUDENT_URL);
|
||||
export function APIStudent(data) {
|
||||
return request.post('/api/student', data)
|
||||
}
|
|
@ -14,16 +14,22 @@
|
|||
<t-icon name="application" />
|
||||
</template>
|
||||
<t-menu-item value="2-1" to="/Bill/BillStock">
|
||||
<span>票据入库管理</span>
|
||||
<span>票据入库</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="2-2" to="/Bill/BillCancel">
|
||||
<span>票据退库管理</span>
|
||||
<span>票据退库</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="2-3" to="/Bill/BillReceipt">
|
||||
<span>票据领用管理</span>
|
||||
<span>票据领用</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="2-4" to="/Bill/BillQuitneck">
|
||||
<span>票据退领管理</span>
|
||||
<span>票据退领</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="2-5" to="/Bill/BillBreakagek">
|
||||
<span>票据报损</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="2-6" to="/Bill/BillDestroy">
|
||||
<span>票据核销</span>
|
||||
</t-menu-item>
|
||||
</t-submenu>
|
||||
<t-submenu value="3" title="应收款管理">
|
||||
|
|
559
src/pages/finance-bill-manage/billBreakage.vue
Normal file
559
src/pages/finance-bill-manage/billBreakage.vue
Normal file
|
@ -0,0 +1,559 @@
|
|||
<template>
|
||||
<div class="back-color">
|
||||
<t-layout style="height: 90%; background-color: #f5f7fb">
|
||||
<t-header class="scarch-box">
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="formData"
|
||||
label-width="calc(2em + 40px)"
|
||||
layout="inline"
|
||||
scroll-to-first-error="smooth"
|
||||
class="scarch-from"
|
||||
@reset="resetting"
|
||||
@submit="headerQuery"
|
||||
>
|
||||
<div style="margin-left: 1rem">
|
||||
<t-form-item label="票据编号:" name="billserial">
|
||||
<t-input v-model="formData.billserial" maxlength="10"></t-input>
|
||||
</t-form-item>
|
||||
|
||||
<t-form-item label="报损日期:" name="breakDate">
|
||||
<t-date-picker v-model="formData.breakDate" clearable />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="票据类型:"
|
||||
name="billType"
|
||||
style="margin-bottom: 0.3rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="formData.billType"
|
||||
placeholder="请选择票据类型"
|
||||
clearable
|
||||
>
|
||||
<t-option
|
||||
v-for="item in billType"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
></t-option>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="报损状态:"
|
||||
name="breakStatus"
|
||||
style="margin-bottom: 0.3rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="formData.breakStatus"
|
||||
placeholder="请选择报损状态"
|
||||
clearable
|
||||
>
|
||||
<t-option
|
||||
v-for="item in breakStatus"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
></t-option>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item style="margin-right: 1rem">
|
||||
<t-button theme="primary" type="submit">查询</t-button>
|
||||
<t-button theme="primary" type="reset">重置</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-header>
|
||||
<t-content class="table-box">
|
||||
<div class="table-header">
|
||||
<div>
|
||||
<h4 style="font-size: 110%">票据报损列表</h4>
|
||||
</div>
|
||||
<div>
|
||||
<t-button theme="primary" size="small" @click="breakageAdd">
|
||||
<template #icon><add-icon /></template>
|
||||
新增报损票据
|
||||
</t-button>
|
||||
<t-button
|
||||
shape="circle"
|
||||
theme="primary"
|
||||
@click="refresh"
|
||||
style="margin-left: 0.8rem"
|
||||
>
|
||||
<template #icon><load-icon /></template>
|
||||
</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-base-table
|
||||
hover
|
||||
row-key="index"
|
||||
:loading="loading"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
class="table"
|
||||
:max-height="550"
|
||||
>
|
||||
<template #breakNum="{ row }">
|
||||
{{ `${row.breakNum}张` }}
|
||||
</template>
|
||||
<template #billType="{ row }">
|
||||
<div v-for="item in billType" :key="item">
|
||||
<span v-if="row.billType === item.value">{{ item.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #breakStatus="{ row }">
|
||||
<div v-for="item in breakStatus" :key="item">
|
||||
<t-tag
|
||||
v-if="row.breakStatus === item.value"
|
||||
:theme="tagColor(row.breakStatus)"
|
||||
variant="light"
|
||||
>
|
||||
{{ item.label }}
|
||||
</t-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #status="slotProps">
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="breakEdit(slotProps)"
|
||||
:disabled="
|
||||
slotProps.row.breakStatus === 0 ||
|
||||
slotProps.row.breakStatus === 1
|
||||
"
|
||||
>修改</t-button
|
||||
>
|
||||
<t-popconfirm
|
||||
content="确认删除吗"
|
||||
@confirm="breakDelete(slotProps)"
|
||||
>
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
:disabled="slotProps.row.breakStatus === 0"
|
||||
>删除</t-button
|
||||
>
|
||||
</t-popconfirm>
|
||||
</template>
|
||||
</t-base-table>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
<t-space>
|
||||
<t-dialog
|
||||
ref="postForm"
|
||||
v-model:visible="visiblePost"
|
||||
:header="headerTitle"
|
||||
width="40%"
|
||||
:confirm-on-enter="true"
|
||||
:on-close="closePost"
|
||||
:confirm-btn="null"
|
||||
:cancel-btn="null"
|
||||
>
|
||||
<t-space direction="vertical" style="width: 100%">
|
||||
<div>
|
||||
<t-form
|
||||
ref="formDialog"
|
||||
scroll-to-first-error="smooth"
|
||||
label-align="left"
|
||||
:rules="FORM_RULES"
|
||||
:data="dialogData"
|
||||
:colon="true"
|
||||
@submit="breakSub"
|
||||
label-width="calc(2em + 55px)"
|
||||
layout="inline"
|
||||
@reset="onReset"
|
||||
>
|
||||
<t-form-item
|
||||
label="票据编号"
|
||||
name="billserial"
|
||||
:span="10"
|
||||
style="margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-input
|
||||
v-model="dialogData.billserial"
|
||||
placeholder="请输入票据编号"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="操作员"
|
||||
name="operator"
|
||||
:span="10"
|
||||
style="margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-input
|
||||
v-model="dialogData.operator"
|
||||
placeholder="请输入操作员"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="票据类型"
|
||||
name="billType"
|
||||
:span="12"
|
||||
style="width: 16rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="dialogData.billType"
|
||||
clearable
|
||||
placeholder="请选择票据类型"
|
||||
>
|
||||
<t-option
|
||||
v-for="item in billType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="报损数量"
|
||||
name="breakNum"
|
||||
:span="12"
|
||||
style="margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-input
|
||||
type="number"
|
||||
v-model="dialogData.breakNum"
|
||||
placeholder="请输入报损数量"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
|
||||
<t-form-item
|
||||
label="报损时间"
|
||||
name="breakDate"
|
||||
:span="10"
|
||||
style="width: 16rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-date-picker
|
||||
v-model="dialogData.breakDate"
|
||||
placeholder="请选择报损时间"
|
||||
clearable
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="报损原因"
|
||||
name="breakInfo"
|
||||
style="width: 33.6rem"
|
||||
>
|
||||
<t-textarea
|
||||
v-model="dialogData.breakInfo"
|
||||
placeholder="请输入备注"
|
||||
></t-textarea>
|
||||
</t-form-item>
|
||||
<t-form-item />
|
||||
<t-form-item>
|
||||
<t-space size="small">
|
||||
<t-button theme="primary" type="submit">提交</t-button>
|
||||
<t-button theme="default" variant="base" type="reset"
|
||||
>重置</t-button
|
||||
>
|
||||
</t-space>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</t-space>
|
||||
</t-dialog>
|
||||
</t-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { AddIcon, LoadIcon } from "tdesign-icons-vue-next";
|
||||
import { useBreakage } from "@/stores/billBreakage";
|
||||
|
||||
// 数据
|
||||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const breakageList = useBreakage();
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const headerTitle = ref("");
|
||||
// 表格表头
|
||||
const columns = ref([
|
||||
{
|
||||
colKey: "serial-number",
|
||||
title: "序号",
|
||||
width: 50,
|
||||
},
|
||||
{
|
||||
colKey: "billserial",
|
||||
title: "票据编号",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "billType",
|
||||
title: "票据类型",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakNum",
|
||||
title: "报损数量",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakDate",
|
||||
title: "报损日期",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "operator",
|
||||
title: "操作员",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakStatus",
|
||||
title: "报损状态",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakInfo",
|
||||
title: "报损原因",
|
||||
ellipsis: true,
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "status",
|
||||
title: "操作",
|
||||
width: 120,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
},
|
||||
]);
|
||||
|
||||
// 票据类型
|
||||
const billType = ref([
|
||||
{ label: "票据类型1", value: 0 },
|
||||
{ label: "票据类型2", value: 1 },
|
||||
{ label: "票据类型3", value: 2 },
|
||||
{ label: "票据类型4", value: 3 },
|
||||
{ label: "票据类型5", value: 4 },
|
||||
]);
|
||||
|
||||
// 审批状态
|
||||
const breakStatus = ref([
|
||||
{ label: "审核中", value: 0 },
|
||||
{ label: "审核通过", value: 1 },
|
||||
{ label: "审核拒绝", value: 2 },
|
||||
]);
|
||||
|
||||
// 获取票据列表
|
||||
const tableList = async () => {
|
||||
loading.value = true;
|
||||
tableData.value = await breakageList.getBreakageList();
|
||||
data.value = await breakageList.getBreakageList();
|
||||
pagination.value.total = tableData.value.length;
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false;
|
||||
clearInterval(timerId);
|
||||
}, 300);
|
||||
};
|
||||
|
||||
// 判断tag标签的颜色
|
||||
const tagColor = (value) => {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return "warning";
|
||||
case 1:
|
||||
return "success";
|
||||
case 2:
|
||||
return "danger";
|
||||
}
|
||||
};
|
||||
// 刷新列表
|
||||
const refresh = () => {
|
||||
tableList();
|
||||
};
|
||||
|
||||
// 弹出框表单
|
||||
const dialogData = ref({
|
||||
billserial: "",
|
||||
operator: "",
|
||||
billType: "",
|
||||
breakNum: Number,
|
||||
breakDate: "",
|
||||
breakInfo: "",
|
||||
});
|
||||
|
||||
// 查询表单
|
||||
const formData = ref({
|
||||
billserial: "",
|
||||
billType: "",
|
||||
breakStatus: "",
|
||||
breakDate: "",
|
||||
});
|
||||
|
||||
// 分页
|
||||
const pagination = ref({
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 10,
|
||||
total: 50,
|
||||
});
|
||||
|
||||
// 查询表单重置
|
||||
const resetting = () => {
|
||||
formData.value = {
|
||||
billserial: "",
|
||||
billType: "",
|
||||
breakStatus: "",
|
||||
breakDate: "",
|
||||
};
|
||||
getNewTable();
|
||||
};
|
||||
|
||||
// 查询
|
||||
const headerQuery = () => {
|
||||
tableData.value = data.value;
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
(formData.value.billType === undefined || formData.value.billType === "") &&
|
||||
(formData.value.breakStatus === undefined ||
|
||||
formData.value.breakStatus === "") &&
|
||||
formData.value.breakDate === ""
|
||||
) {
|
||||
getNewTable();
|
||||
} else {
|
||||
const list = tableData.value.filter((item) => {
|
||||
let arrList;
|
||||
if (formData.value.billserial === item.billserial) {
|
||||
arrList = item;
|
||||
}
|
||||
if (formData.value.billType === item.billType) {
|
||||
arrList = item;
|
||||
}
|
||||
if (formData.value.breakStatus === item.breakStatus) {
|
||||
arrList = item;
|
||||
}
|
||||
if (formData.value.breakDate === item.breakDate) {
|
||||
arrList = item;
|
||||
}
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
formData.value.billType === "" &&
|
||||
formData.value.breakStatus === "" &&
|
||||
formData.value.breakDate === ""
|
||||
) {
|
||||
arrList = item;
|
||||
}
|
||||
return arrList;
|
||||
});
|
||||
tableData.value = list;
|
||||
// @ts-expect-error
|
||||
pagination.value.total = list.length;
|
||||
}
|
||||
};
|
||||
// 打开窗口
|
||||
const breakageAdd = () => {
|
||||
visiblePost.value = true;
|
||||
headerTitle.value = "新增报损票据";
|
||||
dialogData.value = {
|
||||
billserial: "",
|
||||
operator: "",
|
||||
billType: "",
|
||||
breakNum: Number,
|
||||
breakDate: "",
|
||||
breakInfo: "",
|
||||
};
|
||||
};
|
||||
|
||||
// 关闭窗口
|
||||
const closePost = () => {
|
||||
visiblePost.value = false;
|
||||
};
|
||||
// 表单校验
|
||||
const FORM_RULES = {
|
||||
billserial: [{ required: true, message: "请输入票据编号", trigger: "blur" }],
|
||||
billType: [{ required: true, message: "请选择票据类型", trigger: "change" }],
|
||||
breakNum: [{ required: true, message: "请输入报损数量", trigger: "blur" }],
|
||||
breakDate: [{ required: true, message: "请选择报损日期", trigger: "change" }],
|
||||
operator: [{ required: true, message: "请输入操作员", trigger: "blur" }],
|
||||
breakInfo: [{ required: true, message: "请输入报损原因", trigger: "blur" }],
|
||||
};
|
||||
|
||||
// 新增
|
||||
const breakSub = async ({ validateResult, firstError }) => {
|
||||
if (validateResult === true) {
|
||||
dialogData.value.breakStatus = 0;
|
||||
await breakageList.addBreakageList(dialogData.value);
|
||||
getNewTable();
|
||||
MessagePlugin.success("提交成功");
|
||||
visiblePost.value = false;
|
||||
} else {
|
||||
console.log("Validate Errors: ", firstError, validateResult);
|
||||
}
|
||||
};
|
||||
|
||||
// 修改
|
||||
const breakEdit = (item) => {
|
||||
headerTitle.value = "修改报损票据";
|
||||
visiblePost.value = true;
|
||||
tableData.value.forEach((itemTable) => {
|
||||
if (itemTable.id === item.row.id) {
|
||||
dialogData.value = itemTable;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const breakDelete = async (itme) => {
|
||||
await breakageList.deleteBreakageList(itme.row);
|
||||
getNewTable();
|
||||
};
|
||||
|
||||
// 弹出框表单重置
|
||||
const onReset = () => {};
|
||||
|
||||
// 判断menuManagement里面是否存在数据
|
||||
const getNewTable = () => {
|
||||
let arr = JSON.parse(localStorage.getItem("breakageList"));
|
||||
if (arr) {
|
||||
tableData.value = arr.breakageList;
|
||||
data.value = arr.breakageList;
|
||||
pagination.value.total = tableData.value.length;
|
||||
} else {
|
||||
tableList();
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getNewTable();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.scarch-box {
|
||||
width: 100%;
|
||||
background-color: @base-white-color;
|
||||
margin-bottom: 2rem;
|
||||
.scarch-from {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.table-box {
|
||||
height: 42rem;
|
||||
background-color: @base-white-color;
|
||||
padding: 1rem;
|
||||
padding-top: 0;
|
||||
.table-header {
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
:deep(.t-form__controls-content) {
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
|
@ -234,8 +234,9 @@ const scarchData = ref({
|
|||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const cancelList = useCancel();
|
||||
const tableData = ref();
|
||||
const data = ref();
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const headerTiTle = ref("");
|
||||
// 表格表头
|
||||
const columns = ref([
|
||||
{
|
||||
|
|
406
src/pages/finance-bill-manage/billDestroy.vue
Normal file
406
src/pages/finance-bill-manage/billDestroy.vue
Normal file
|
@ -0,0 +1,406 @@
|
|||
<template>
|
||||
<div class="back-color">
|
||||
<t-layout style="height: 90%; background-color: #f5f7fb">
|
||||
<t-header class="scarch-box">
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="formData"
|
||||
label-width="calc(2em + 40px)"
|
||||
layout="inline"
|
||||
scroll-to-first-error="smooth"
|
||||
class="scarch-from"
|
||||
@reset="resetting"
|
||||
@submit="headerQuery"
|
||||
>
|
||||
<div style="margin-left: 1rem">
|
||||
<t-form-item label="票据编号:" name="billserial">
|
||||
<t-input v-model="formData.billserial" maxlength="10"></t-input>
|
||||
</t-form-item>
|
||||
|
||||
<t-form-item label="报损日期:" name="breakDate">
|
||||
<t-date-picker v-model="formData.breakDate" clearable />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="票据类型:"
|
||||
name="billType"
|
||||
style="margin-bottom: 0.3rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="formData.billType"
|
||||
placeholder="请选择票据类型"
|
||||
clearable
|
||||
>
|
||||
<t-option
|
||||
v-for="item in billType"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
></t-option>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item style="margin-right: 1rem">
|
||||
<t-button theme="primary" type="submit">查询</t-button>
|
||||
<t-button theme="primary" type="reset">重置</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-header>
|
||||
<t-content class="table-box">
|
||||
<div class="table-header">
|
||||
<div>
|
||||
<h4 style="font-size: 110%">票据核销列表</h4>
|
||||
</div>
|
||||
<div>
|
||||
<t-button
|
||||
shape="circle"
|
||||
theme="primary"
|
||||
@click="refresh"
|
||||
style="margin-left: 0.8rem"
|
||||
>
|
||||
<template #icon><load-icon /></template>
|
||||
</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-base-table
|
||||
hover
|
||||
row-key="index"
|
||||
:loading="loading"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
class="table"
|
||||
:max-height="550"
|
||||
>
|
||||
<template #breakNum="{ row }">
|
||||
{{ `${row.breakNum}张` }}
|
||||
</template>
|
||||
<template #billType="{ row }">
|
||||
<div v-for="item in billType" :key="item">
|
||||
<span v-if="row.billType === item.value">{{ item.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #status="slotProps">
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="breakEdit(slotProps)"
|
||||
>审核</t-button
|
||||
>
|
||||
</template>
|
||||
</t-base-table>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
<t-space>
|
||||
<t-dialog
|
||||
ref="postForm"
|
||||
v-model:visible="visiblePost"
|
||||
:header="headerTitle"
|
||||
width="40%"
|
||||
:confirm-on-enter="true"
|
||||
:on-close="closePost"
|
||||
:confirm-btn="null"
|
||||
:cancel-btn="null"
|
||||
>
|
||||
<t-space direction="vertical" style="width: 100%">
|
||||
<div>
|
||||
<t-form
|
||||
ref="formDialog"
|
||||
scroll-to-first-error="smooth"
|
||||
label-align="left"
|
||||
:rules="FORM_RULES"
|
||||
:data="dialogData"
|
||||
:colon="true"
|
||||
@submit="breakSub"
|
||||
label-width="calc(2em + 55px)"
|
||||
layout="inline"
|
||||
@reset="onReset"
|
||||
>
|
||||
<t-form-item
|
||||
label="审核状态"
|
||||
name="Status"
|
||||
style="margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-radio-group v-model="dialogData.Status">
|
||||
<t-radio value="1" @change="refuse === false"
|
||||
>审核通过</t-radio
|
||||
>
|
||||
<t-radio value="2" @change="refuse === true"
|
||||
>审核拒绝</t-radio
|
||||
>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item />
|
||||
<t-form-item
|
||||
label="拒绝原因"
|
||||
name="refuseInfo"
|
||||
v-if="refuse"
|
||||
style="width: 33.6rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-textarea
|
||||
v-model="dialogData.refuseInfo"
|
||||
placeholder="请输入备注"
|
||||
></t-textarea>
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-space size="small">
|
||||
<t-button theme="primary" type="submit">提交</t-button>
|
||||
<t-button theme="default" variant="base" type="reset"
|
||||
>重置</t-button
|
||||
>
|
||||
</t-space>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</t-space>
|
||||
</t-dialog>
|
||||
</t-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { AddIcon, LoadIcon } from "tdesign-icons-vue-next";
|
||||
import { useDestroy } from "@/stores/billDestroy";
|
||||
|
||||
// 数据
|
||||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const refuse = ref(false);
|
||||
const destroyList = useDestroy();
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const headerTitle = ref("");
|
||||
// 表格表头
|
||||
const columns = ref([
|
||||
{
|
||||
colKey: "serial-number",
|
||||
title: "序号",
|
||||
width: 50,
|
||||
},
|
||||
{
|
||||
colKey: "billserial",
|
||||
title: "票据编号",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "billType",
|
||||
title: "票据类型",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakNum",
|
||||
title: "报损数量",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "breakDate",
|
||||
title: "报损日期",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "operator",
|
||||
title: "报损人员",
|
||||
align: "center",
|
||||
width: "100",
|
||||
},
|
||||
{
|
||||
colKey: "status",
|
||||
title: "操作",
|
||||
width: 120,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
},
|
||||
]);
|
||||
|
||||
// 票据类型
|
||||
const billType = ref([
|
||||
{ label: "票据类型1", value: 0 },
|
||||
{ label: "票据类型2", value: 1 },
|
||||
{ label: "票据类型3", value: 2 },
|
||||
{ label: "票据类型4", value: 3 },
|
||||
{ label: "票据类型5", value: 4 },
|
||||
]);
|
||||
|
||||
// 审批状态
|
||||
const breakStatus = ref([
|
||||
{ label: "审核中", value: 0 },
|
||||
{ label: "审核通过", value: 1 },
|
||||
{ label: "审核拒绝", value: 2 },
|
||||
]);
|
||||
|
||||
// 获取票据列表
|
||||
const tableList = async () => {
|
||||
loading.value = true;
|
||||
tableData.value = await destroyList.getDestroyList();
|
||||
data.value = await destroyList.getDestroyList();
|
||||
pagination.value.total = tableData.value.length;
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false;
|
||||
clearInterval(timerId);
|
||||
}, 300);
|
||||
};
|
||||
|
||||
// 刷新列表
|
||||
const refresh = () => {
|
||||
tableList();
|
||||
};
|
||||
|
||||
// 弹出框表单
|
||||
const dialogData = ref({
|
||||
refuseInfo: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 查询表单
|
||||
const formData = ref({
|
||||
billserial: "",
|
||||
billType: "",
|
||||
breakStatus: "",
|
||||
breakDate: "",
|
||||
});
|
||||
|
||||
// 分页
|
||||
const pagination = ref({
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 10,
|
||||
total: 50,
|
||||
});
|
||||
|
||||
// 查询表单重置
|
||||
const resetting = () => {
|
||||
formData.value = {
|
||||
billserial: "",
|
||||
billType: "",
|
||||
breakStatus: "",
|
||||
breakDate: "",
|
||||
};
|
||||
getNewTable();
|
||||
};
|
||||
|
||||
// 查询
|
||||
const headerQuery = () => {
|
||||
tableData.value = data.value;
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
(formData.value.billType === undefined || formData.value.billType === "") &&
|
||||
formData.value.breakDate === ""
|
||||
) {
|
||||
getNewTable();
|
||||
} else {
|
||||
const list = tableData.value.filter((item) => {
|
||||
let arrList;
|
||||
if (formData.value.billserial === item.billserial) {
|
||||
arrList = item;
|
||||
}
|
||||
if (formData.value.billType === item.billType) {
|
||||
arrList = item;
|
||||
}
|
||||
if (formData.value.breakDate === item.breakDate) {
|
||||
arrList = item;
|
||||
}
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
formData.value.billType === "" &&
|
||||
formData.value.breakDate === ""
|
||||
) {
|
||||
arrList = item;
|
||||
}
|
||||
return arrList;
|
||||
});
|
||||
tableData.value = list;
|
||||
pagination.value.total = list.length;
|
||||
}
|
||||
};
|
||||
// 打开窗口
|
||||
const breakageAdd = () => {
|
||||
visiblePost.value = true;
|
||||
dialogData.value = {
|
||||
refuseInfo: "",
|
||||
status: "",
|
||||
};
|
||||
};
|
||||
|
||||
// 关闭窗口
|
||||
const closePost = () => {
|
||||
visiblePost.value = false;
|
||||
};
|
||||
// 表单校验
|
||||
const FORM_RULES = {
|
||||
Status: [{ required: true, message: "请选择审批状态", trigger: "change" }],
|
||||
refuseInfo: [{ required: true, message: "请输入拒绝原因", trigger: "blur" }],
|
||||
};
|
||||
|
||||
// 新增
|
||||
const breakSub = async ({ validateResult, firstError }) => {
|
||||
if (validateResult === true) {
|
||||
dialogData.value.breakStatus = 0;
|
||||
await breakageList.addBreakageList(dialogData.value);
|
||||
getNewTable();
|
||||
MessagePlugin.success("提交成功");
|
||||
visiblePost.value = false;
|
||||
} else {
|
||||
console.log("Validate Errors: ", firstError, validateResult);
|
||||
}
|
||||
};
|
||||
|
||||
// 审核
|
||||
const breakEdit = (item) => {
|
||||
visiblePost.value = true;
|
||||
};
|
||||
|
||||
// 弹出框表单重置
|
||||
const onReset = () => {};
|
||||
|
||||
// 判断breakageList里面是否存在数据
|
||||
const getNewTable = () => {
|
||||
let arr = JSON.parse(localStorage.getItem("breakageList"));
|
||||
if (arr) {
|
||||
tableData.value = arr.destroyList;
|
||||
data.value = arr.destroyList;
|
||||
pagination.value.total = tableData.value.length;
|
||||
}
|
||||
if (arr === null) {
|
||||
tableData.value = [];
|
||||
pagination.value.total = tableData.value.length;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getNewTable();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.scarch-box {
|
||||
width: 100%;
|
||||
background-color: @base-white-color;
|
||||
margin-bottom: 2rem;
|
||||
.scarch-from {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.table-box {
|
||||
height: 42rem;
|
||||
background-color: @base-white-color;
|
||||
padding: 1rem;
|
||||
padding-top: 0;
|
||||
.table-header {
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
:deep(.t-form__controls-content) {
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
|
@ -16,7 +16,10 @@
|
|||
</t-space>
|
||||
</t-aside>
|
||||
<t-content>
|
||||
<t-layout style="height: 100%; background-color: #f5f7fb">
|
||||
<t-layout
|
||||
style="height: 100%; background-color: #f5f7fb"
|
||||
v-if="pageJudge"
|
||||
>
|
||||
<t-header class="scarch-box">
|
||||
<t-form
|
||||
ref="form"
|
||||
|
@ -36,8 +39,8 @@
|
|||
></t-input>
|
||||
</t-form-item>
|
||||
|
||||
<t-form-item label="退领时间:" name="receiptDate">
|
||||
<t-date-picker v-model="scarchData.receiptDate" clearable />
|
||||
<t-form-item label="退领时间:" name="quitneckDate">
|
||||
<t-date-picker v-model="scarchData.quitneckDate" clearable />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="票据类型:"
|
||||
|
@ -97,12 +100,15 @@
|
|||
}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #receiptNum="{ row }">
|
||||
{{ `${row.receiptNum}张` }}
|
||||
<template #quitneckNum="{ row }">
|
||||
{{ `${row.quitneckNum}张` }}
|
||||
</template>
|
||||
</t-base-table>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
<t-layout class="layoutPage" v-else>
|
||||
<span> 请点击左侧员工名单 </span>
|
||||
</t-layout>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
</div>
|
||||
|
@ -112,14 +118,17 @@
|
|||
import { ref, onMounted, nextTick } from "vue";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { LoadIcon } from "tdesign-icons-vue-next";
|
||||
import { useQuitneckList } from "@/stores/billQuitneck";
|
||||
import { useReceiptList } from "@/stores/billReceipt";
|
||||
|
||||
const quitneckList = useQuitneckList();
|
||||
const receiptList = useReceiptList();
|
||||
const personName = ref([]);
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const rowItem = ref({});
|
||||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const pageJudge = ref(false);
|
||||
const columns = ref([
|
||||
{
|
||||
colKey: "serial-number",
|
||||
|
@ -157,8 +166,8 @@ const columns = ref([
|
|||
width: 100,
|
||||
},
|
||||
{
|
||||
colKey: "quitneckInfo",
|
||||
title: "退领原来",
|
||||
colKey: "quitneckReason",
|
||||
title: "退领原因",
|
||||
ellipsis: true,
|
||||
align: "center",
|
||||
width: 200,
|
||||
|
@ -172,16 +181,9 @@ const billType = ref([
|
|||
{ label: "票据类型4", value: 3 },
|
||||
{ label: "票据类型5", value: 4 },
|
||||
]);
|
||||
const dialogData = ref({
|
||||
quitneckDate: "",
|
||||
quitneckReason: "",
|
||||
quitneckNum: "",
|
||||
});
|
||||
|
||||
// 查询表单
|
||||
const scarchData = ref({
|
||||
billserial: "",
|
||||
});
|
||||
const scarchData = ref({});
|
||||
|
||||
// 分页
|
||||
const pagination = ref({
|
||||
|
@ -195,33 +197,23 @@ const personList = async () => {
|
|||
personName.value = await receiptList.getPersonNameList();
|
||||
};
|
||||
|
||||
// 效验规则
|
||||
const FORM_RULES = {
|
||||
quitneckNum: [{ required: true, message: "请输入退领张数", trigger: "blur" }],
|
||||
quitneckDate: [
|
||||
{ required: true, message: "请选择退领日期", trigger: "change" },
|
||||
],
|
||||
quitneckReason: [
|
||||
{ required: true, message: "请输入退领原因", trigger: "blur" },
|
||||
],
|
||||
};
|
||||
|
||||
// 查询
|
||||
const headerQuery = () => {
|
||||
tableData.value = data.value;
|
||||
console.log(
|
||||
scarchData.value.billserial,
|
||||
scarchData.value.billType,
|
||||
scarchData.value.receiptDate
|
||||
scarchData.value.quitneckDate
|
||||
);
|
||||
if (
|
||||
scarchData.value.billserial === "" &&
|
||||
(scarchData.value.billType === undefined ||
|
||||
scarchData.value.billType === "") &&
|
||||
(scarchData.value.receiptDate === undefined ||
|
||||
scarchData.value.receiptDate === "")
|
||||
(scarchData.value.quitneckDate === undefined ||
|
||||
scarchData.value.quitneckDate === "")
|
||||
) {
|
||||
getNewTable();
|
||||
tableData.value = data.value;
|
||||
pagination.value.total = tableData.value.length;
|
||||
} else {
|
||||
const list = tableData.value.filter((item) => {
|
||||
let arrList;
|
||||
|
@ -231,16 +223,17 @@ const headerQuery = () => {
|
|||
if (scarchData.value.billType === item.billType) {
|
||||
arrList = item;
|
||||
}
|
||||
if (scarchData.value.receiptDate === item.receiptDate) {
|
||||
if (scarchData.value.quitneckDate === item.quitneckDate) {
|
||||
arrList = item;
|
||||
}
|
||||
if (
|
||||
scarchData.value.billserial === "" &&
|
||||
scarchData.value.billType === "" &&
|
||||
scarchData.value.receiptDate === ""
|
||||
scarchData.value.quitneckDate === ""
|
||||
) {
|
||||
arrList = item;
|
||||
}
|
||||
console.log(arrList);
|
||||
return arrList;
|
||||
});
|
||||
tableData.value = list;
|
||||
|
@ -252,11 +245,13 @@ const resetting = () => {
|
|||
scarchData.value = {
|
||||
billserial: "",
|
||||
billType: "",
|
||||
receiptDate: "",
|
||||
quitneckDate: "",
|
||||
};
|
||||
getNewTable();
|
||||
tableData.value = data.value;
|
||||
pagination.value.total = tableData.value.length;
|
||||
};
|
||||
const rowItem = ref({});
|
||||
|
||||
// 表单重置
|
||||
const Quitneck = (value) => {
|
||||
dialogData.value = {
|
||||
quitneckDate: "",
|
||||
|
@ -266,36 +261,16 @@ const Quitneck = (value) => {
|
|||
visiblePost.value = true;
|
||||
rowItem.value = value;
|
||||
};
|
||||
// 表单提交
|
||||
const quitneckAdd = async ({ validateResult, firstError }) => {
|
||||
if (validateResult === true) {
|
||||
if (rowItem.value.row.receiptNum - dialogData.value.quitneckNum < 0) {
|
||||
return MessagePlugin.error("退领数量不能大于领用数量");
|
||||
}
|
||||
dialogData.value.quitneckNum =
|
||||
rowItem.value.row.receiptNum - dialogData.value.quitneckNum;
|
||||
dialogData.value.id = rowItem.value.row.id;
|
||||
await receiptList.getquitneckNum(dialogData.value);
|
||||
getTableData();
|
||||
MessagePlugin.success("提交成功");
|
||||
visiblePost.value = false;
|
||||
} else {
|
||||
console.log("Validate Errors: ", firstError, validateResult);
|
||||
}
|
||||
};
|
||||
const onClick = async (context) => {
|
||||
pageJudge.value = true;
|
||||
// 判断是否为顶层节点(无父节点)
|
||||
if (context.node.value === "t1") {
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
// 获取票据列表
|
||||
tableData.value = await receiptList.getReceiptList({
|
||||
name: context.node.label,
|
||||
});
|
||||
data.value = await receiptList.getReceiptList({
|
||||
name: context.node.label,
|
||||
});
|
||||
tableData.value = await quitneckList.getQuitneckList(context.node.label);
|
||||
data.value = await quitneckList.getQuitneckList(context.node.label);
|
||||
pagination.value.total = tableData.value.length;
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
@ -305,8 +280,9 @@ const onClick = async (context) => {
|
|||
// 刷新列表
|
||||
const refresh = () => {
|
||||
getTableData();
|
||||
pagination.value.total = tableData.value.length;
|
||||
};
|
||||
// 判断menuManagement里面是否存在数据
|
||||
// 判断ReceiptList里面是否存在数据
|
||||
const getPersonName = () => {
|
||||
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
|
||||
if (arr) {
|
||||
|
@ -315,38 +291,8 @@ const getPersonName = () => {
|
|||
personList();
|
||||
}
|
||||
};
|
||||
// 判断menuManagement里面是否存在数据
|
||||
const getTableData = async () => {
|
||||
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
|
||||
if (arr.receiptList.length > 0) {
|
||||
loading.value = true;
|
||||
tableData.value = arr.receiptList;
|
||||
pagination.value.total = tableData.value.length;
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false;
|
||||
clearInterval(timerId);
|
||||
}, 300);
|
||||
} else {
|
||||
await nextTick();
|
||||
// 找到第一个具有子节点的节点并模拟点击
|
||||
const firstNodeWithChildren = personName.value.find(
|
||||
(node) => Array.isArray(node.children) && node.children.length > 0
|
||||
);
|
||||
if (firstNodeWithChildren) {
|
||||
const simulatedContext = {
|
||||
node: {
|
||||
label: "孙东宇",
|
||||
},
|
||||
};
|
||||
onClick(simulatedContext);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
getPersonName();
|
||||
getTableData();
|
||||
// 等待 personName 数据加载完成
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -380,6 +326,18 @@ onMounted(async () => {
|
|||
align-items: center;
|
||||
}
|
||||
}
|
||||
.layoutPage {
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
span {
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
color: #191919;
|
||||
}
|
||||
}
|
||||
:deep(.t-tree--transition .t-tree__label) {
|
||||
width: 10rem;
|
||||
}
|
||||
|
|
|
@ -196,6 +196,8 @@ const tableData = ref([]);
|
|||
const data = ref([]);
|
||||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const rowItem = ref({});
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
colKey: "serial-number",
|
||||
|
@ -339,7 +341,6 @@ const resetting = () => {
|
|||
};
|
||||
getNewTable();
|
||||
};
|
||||
const rowItem = ref({});
|
||||
const Quitneck = (value) => {
|
||||
dialogData.value = {
|
||||
quitneckDate: "",
|
||||
|
@ -355,9 +356,10 @@ const quitneckAdd = async ({ validateResult, firstError }) => {
|
|||
if (rowItem.value.row.receiptNum - dialogData.value.quitneckNum < 0) {
|
||||
return MessagePlugin.error("退领数量不能大于领用数量");
|
||||
}
|
||||
dialogData.value.quitneckNum =
|
||||
rowItem.value.row.receiptNum - dialogData.value.quitneckNum;
|
||||
dialogData.value.id = rowItem.value.row.id;
|
||||
dialogData.value.billserial = rowItem.value.row.billserial;
|
||||
dialogData.value.billType = rowItem.value.row.billType;
|
||||
dialogData.value.proposer = rowItem.value.row.proposer;
|
||||
await receiptList.getquitneckNum(dialogData.value);
|
||||
getTableData();
|
||||
MessagePlugin.success("提交成功");
|
||||
|
@ -429,7 +431,6 @@ const getTableData = async () => {
|
|||
onMounted(async () => {
|
||||
getPersonName();
|
||||
getTableData();
|
||||
// 等待 personName 数据加载完成
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -88,13 +88,14 @@
|
|||
@click="stockEdit(slotProps)"
|
||||
>修改</t-button
|
||||
>
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="stockDelete(slotProps)"
|
||||
>删除</t-button
|
||||
<t-popconfirm
|
||||
content="确认删除吗"
|
||||
@confirm="stockDelete(slotProps)"
|
||||
>
|
||||
<t-button theme="default" variant="text" size="small"
|
||||
>删除</t-button
|
||||
>
|
||||
</t-popconfirm>
|
||||
</template>
|
||||
</t-base-table>
|
||||
</t-content>
|
||||
|
@ -163,7 +164,7 @@
|
|||
<t-input
|
||||
type="number"
|
||||
v-model="dialogData.stockNum"
|
||||
placeholder="请输入内容"
|
||||
placeholder="请输入入库数量"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
|
@ -179,7 +180,7 @@
|
|||
</t-form-item>
|
||||
<t-form-item
|
||||
label="入库时间"
|
||||
name="unit"
|
||||
name="stockDate"
|
||||
:span="10"
|
||||
style="width: 16rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
|
@ -191,7 +192,7 @@
|
|||
</t-form-item>
|
||||
<t-form-item
|
||||
label="操作员"
|
||||
name="unit"
|
||||
name="operator"
|
||||
:span="10"
|
||||
style="margin-bottom: 0.5rem"
|
||||
>
|
||||
|
|
|
@ -1,129 +1,193 @@
|
|||
<template>
|
||||
<t-space direction="vertical">
|
||||
<t-form ref="searchForm" @reset="onReset">
|
||||
<t-form-item label="姓名" name="name">
|
||||
<t-input v-model="searchCriteria.name" placeholder="请输入姓名"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="学号" name="studentId">
|
||||
<t-input v-model="searchCriteria.studentId" placeholder="请输入学号"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item>
|
||||
<t-space size="10px">
|
||||
<t-button theme="primary" type="submit" @click="onSearch">查询</t-button>
|
||||
<t-button theme="default" variant="base" type="reset">重置</t-button>
|
||||
</t-space>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
|
||||
<t-space>
|
||||
<t-checkbox v-model="stripe">显示斑马纹</t-checkbox>
|
||||
<t-checkbox v-model="bordered">显示表格边框</t-checkbox>
|
||||
<t-checkbox v-model="hover">显示悬浮效果</t-checkbox>
|
||||
<t-checkbox v-model="tableLayout">宽度自适应</t-checkbox>
|
||||
<t-checkbox v-model="showHeader">显示表头</t-checkbox>
|
||||
</t-space>
|
||||
|
||||
<t-table
|
||||
rowKey="studentId"
|
||||
:data="studentList"
|
||||
:columns="studentColumns"
|
||||
:stripe="stripe"
|
||||
:bordered="bordered"
|
||||
:hover="hover"
|
||||
:size="size"
|
||||
:table-layout="tableLayout ? 'auto' : 'fixed'"
|
||||
:pagination="pagination"
|
||||
:showHeader="showHeader"
|
||||
cellEmptyContent="-"
|
||||
resizable
|
||||
></t-table>
|
||||
</t-space>
|
||||
<!-- 动态操作列 -->
|
||||
<!-- <t-table-column label="操作">
|
||||
<template #default="{ row }">
|
||||
<t-button-group>
|
||||
<t-button @click="handleLeave(row)">休学</t-button>
|
||||
<t-button @click="handleWithdraw(row)">退学</t-button>
|
||||
<t-button @click="handleReturn(row)">复学</t-button>
|
||||
</t-button-group>
|
||||
</template>
|
||||
</t-table-column> -->
|
||||
<div class="back-color">
|
||||
<t-layout style="height: 90%; background-color: #f5f7fb">
|
||||
<t-header class="scarch-box">
|
||||
<t-modal
|
||||
v-model="isModalVisible"
|
||||
@confirm="onSave"
|
||||
@cancel="onModalCancel"
|
||||
title="修改学生信息"
|
||||
>
|
||||
<t-form ref="searchForm" @reset="onReset" class="scarch-from">
|
||||
<div style="margin-left: 1rem">
|
||||
<t-form-item label="姓名" name="name">
|
||||
<t-input
|
||||
v-model="searchCriteria.name"
|
||||
placeholder="请输入姓名"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<div style="margin-left: 1rem">
|
||||
<t-form-item label="学号" name="studentId">
|
||||
<t-input
|
||||
v-model="searchCriteria.studentId"
|
||||
placeholder="请输入学号"
|
||||
></t-input>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item style="margin-right: 1rem">
|
||||
<t-space size="10px">
|
||||
<t-button theme="primary" type="submit" @click="onSearch"
|
||||
>查询</t-button
|
||||
>
|
||||
<t-button theme="default" variant="base" type="reset"
|
||||
>重置</t-button
|
||||
>
|
||||
</t-space>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-modal>
|
||||
</t-header>
|
||||
<t-content class="table-box">
|
||||
<t-table
|
||||
rowKey="studentId"
|
||||
:data="studentList"
|
||||
:columns="studentColumns"
|
||||
:stripe="stripe"
|
||||
:bordered="bordered"
|
||||
:hover="hover"
|
||||
:size="size"
|
||||
:table-layout="tableLayout ? 'auto' : 'fixed'"
|
||||
:pagination="pagination"
|
||||
:showHeader="showHeader"
|
||||
cellEmptyContent="-"
|
||||
resizable
|
||||
>
|
||||
<template #operation="slotProps">
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="showEditModal(slotProps)"
|
||||
>修改</t-button
|
||||
>
|
||||
</template>
|
||||
</t-table>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ref, reactive, computed } from "vue";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { useRouter } from "vue-router";
|
||||
import { reqStudent } from "@/api/students";
|
||||
// import { reqStudent } from "@/api/students";
|
||||
import { APIStudent } from "@/api/students";
|
||||
|
||||
const isModalVisible = ref(false);
|
||||
const editStudent = ref({});
|
||||
|
||||
// 显示编辑弹出框的方法
|
||||
const showEditModal = (student) => {
|
||||
isModalVisible.value = true;
|
||||
editStudent.value = Object.assign({}, student);
|
||||
};
|
||||
|
||||
// 确认修改的回调方法
|
||||
const onSave = () => {
|
||||
// 调用 API 更新学生状态(这里假设有个 updateStudent 方法)
|
||||
updateStudent(editStudent.value).then(() => {
|
||||
// 更新成功后关闭模态框,同时更新表格数据
|
||||
isModalVisible.value = false;
|
||||
// 重新获取或更新 studentList 数据
|
||||
});
|
||||
};
|
||||
|
||||
// 取消编辑的回调方法
|
||||
const onModalCancel = () => {
|
||||
isModalVisible.value = false;
|
||||
editStudent.value = {};
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const searchForm = ref(null);
|
||||
const initialStudentData = [];
|
||||
const total = 28;
|
||||
for (let i = 0; i < total; i++) {
|
||||
let statusValue = ["休学", "退学", "复学"][i % 3];
|
||||
initialStudentData.push({
|
||||
studentId: `${'S'}${i + 1}`,
|
||||
name: ['贾明', '张三', '王芳'][i % 3],
|
||||
gender: ['男', '女'][i % 2],
|
||||
departmentCode: 'D' + (i % 4 + 1),
|
||||
department: ['计算机科学系', '数学系', '物理系', '化学系'][i % 4],
|
||||
className: 'C' + (i % 5 + 1),
|
||||
majorCode: 'M' + (i % 6 + 1),
|
||||
major: ['计算机科学与技术', '数学', '物理学', '化学', '生物学', '经济学'][i % 6],
|
||||
classCode: 'C' + (i % 5 + 1),
|
||||
classes: ['一班', '二班', '三班', '四班', '五班'][i % 5],
|
||||
Id: `${i + 1}`,
|
||||
name: ["贾明", "张三", "王芳"][i % 3],
|
||||
gender: ["男", "女"][i % 2],
|
||||
studentId: i + 1000000000,
|
||||
department: ["计算机科学系", "数学系", "物理系", "化学系"][i % 4],
|
||||
major: ["计算机科学与技术", "数学", "物理学", "化学", "生物学", "经济学"][
|
||||
i % 6
|
||||
],
|
||||
classes: ["一班", "二班", "三班", "四班", "五班"][i % 5],
|
||||
status: statusValue,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询条件
|
||||
const searchCriteria = reactive({ name: '', studentId: '' });
|
||||
const searchCriteria = reactive({ name: "", studentId: "" });
|
||||
|
||||
// 学生列表数据
|
||||
const studentList = computed(() => {
|
||||
return initialStudentData.filter(student =>
|
||||
(!searchCriteria.name || student.name.includes(searchCriteria.name)) &&
|
||||
(!searchCriteria.studentId || student.studentId === searchCriteria.studentId)
|
||||
return initialStudentData.filter(
|
||||
(student) =>
|
||||
(!searchCriteria.name || student.name.includes(searchCriteria.name)) &&
|
||||
(!searchCriteria.studentId ||
|
||||
student.studentId === searchCriteria.studentId)
|
||||
);
|
||||
});
|
||||
|
||||
// 表格列定义
|
||||
const studentColumns = ref([
|
||||
{
|
||||
colKey: 'studentId',
|
||||
title: '学号',
|
||||
colKey: "Id",
|
||||
title: "序号",
|
||||
},
|
||||
{
|
||||
colKey: 'name',
|
||||
title: '姓名',
|
||||
colKey: "name",
|
||||
title: "姓名",
|
||||
},
|
||||
{
|
||||
colKey: 'gender',
|
||||
title: '性别',
|
||||
colKey: "gender",
|
||||
title: "性别",
|
||||
},
|
||||
{
|
||||
colKey: 'department',
|
||||
title: '系院',
|
||||
colKey: "studentId",
|
||||
title: "学号",
|
||||
},
|
||||
{
|
||||
colKey: 'major',
|
||||
title: '专业',
|
||||
colKey: "department",
|
||||
title: "系院",
|
||||
},
|
||||
{
|
||||
colKey: 'classes',
|
||||
title: '班级',
|
||||
colKey: "major",
|
||||
title: "专业",
|
||||
},
|
||||
{
|
||||
colKey: "classes",
|
||||
title: "班级",
|
||||
},
|
||||
{
|
||||
colKey: "status",
|
||||
title: "状态",
|
||||
formatter: (value) => {
|
||||
switch (value) {
|
||||
case "休学":
|
||||
return "休学";
|
||||
case "退学":
|
||||
return "退学";
|
||||
case "复学":
|
||||
return "复学";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
colKey: "operation",
|
||||
title: "操作",
|
||||
},
|
||||
]);
|
||||
|
||||
const size = ref('medium');
|
||||
const tableLayout = ref(false);
|
||||
const stripe = ref(false);
|
||||
const bordered = ref(false);
|
||||
const hover = ref(true);
|
||||
const showHeader = ref(true);
|
||||
|
||||
const pagination = reactive({
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 5,
|
||||
defaultPageSize: 10,
|
||||
total: initialStudentData.length,
|
||||
});
|
||||
|
||||
|
@ -133,14 +197,36 @@ const onSearch = () => {
|
|||
};
|
||||
|
||||
const onReset = () => {
|
||||
searchCriteria.name = '';
|
||||
searchCriteria.studentId = '';
|
||||
searchCriteria.name = "";
|
||||
searchCriteria.studentId = "";
|
||||
pagination.defaultCurrent = 1;
|
||||
MessagePlugin.success("重置成功");
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.scarch-box {
|
||||
width: 100%;
|
||||
background-color: @base-white-color;
|
||||
margin-bottom: 2rem;
|
||||
.scarch-from {
|
||||
height: 3.75rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.table-box {
|
||||
height: 42rem;
|
||||
background-color: @base-white-color;
|
||||
padding: 1rem;
|
||||
padding-top: 0;
|
||||
.table-header {
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -3,6 +3,8 @@ import BillStockURL from "@/pages/finance-bill-manage/billStock.vue";
|
|||
import BillCancelURL from "@/pages/finance-bill-manage/billCancel.vue";
|
||||
import BillReceiptURL from "@/pages/finance-bill-manage/billReceipt.vue";
|
||||
import BillQuitneckURL from "@/pages/finance-bill-manage/billQuitneck.vue";
|
||||
import BillBreakagekURL from "@/pages/finance-bill-manage/billBreakage.vue";
|
||||
import BillDestroyURL from "@/pages/finance-bill-manage/billDestroy.vue";
|
||||
|
||||
const financeBillManage = [
|
||||
{
|
||||
|
@ -43,6 +45,22 @@ const financeBillManage = [
|
|||
title: "票据退领",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "BillBreakagek",
|
||||
name: "billBreakagek",
|
||||
component: BillBreakagekURL,
|
||||
meta: {
|
||||
title: "票据报损",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "BillDestroy",
|
||||
name: "billDestroy",
|
||||
component: BillDestroyURL,
|
||||
meta: {
|
||||
title: "票据核销",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
36
src/stores/billBreakage.js
Normal file
36
src/stores/billBreakage.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { reqBreakageList } from "@/api/finance-bill-manage/breakageList";
|
||||
|
||||
export const useBreakage = defineStore("breakageList", {
|
||||
state: () => {
|
||||
return {
|
||||
breakageList: [],
|
||||
destroyList: [],
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
async getBreakageList() {
|
||||
let { data } = await reqBreakageList();
|
||||
this.breakageList = data.list;
|
||||
return this.breakageList;
|
||||
},
|
||||
addBreakageList(arr) {
|
||||
const index = this.breakageList.findIndex((item) => item.id === arr.id);
|
||||
if (index !== -1) {
|
||||
this.breakageList[index] = arr;
|
||||
} else {
|
||||
arr.id = new Date().getTime();
|
||||
this.breakageList.unshift(arr);
|
||||
localStorage.setItem("breakageList", JSON.stringify(this.breakageList));
|
||||
}
|
||||
this.destroyList.push(arr);
|
||||
localStorage.setItem("destroyList", JSON.stringify(this.breakageList));
|
||||
return this.breakageList;
|
||||
},
|
||||
deleteBreakageList(item) {
|
||||
let arr = this.breakageList.filter((i) => i.id !== item.id);
|
||||
this.breakageList = arr;
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
});
|
19
src/stores/billDestroy.js
Normal file
19
src/stores/billDestroy.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useDestroy = defineStore("destroyList", {
|
||||
state: () => {
|
||||
return {
|
||||
destroyList: [],
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
async getDestroyList() {
|
||||
this.destroyList = JSON.parse(
|
||||
localStorage.getItem("breakageList")
|
||||
).destroyList;
|
||||
console.log(this.destroyList);
|
||||
return this.destroyList;
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
});
|
56
src/stores/billQuitneck.js
Normal file
56
src/stores/billQuitneck.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useQuitneckList = defineStore("QuitneckList", {
|
||||
state: () => {
|
||||
return {
|
||||
sdyList: [],
|
||||
ycyList: [],
|
||||
lczList: [],
|
||||
lxyList: [],
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
getQuitneckList(name) {
|
||||
this.sdyList = [];
|
||||
this.ycyList = [];
|
||||
this.lczList = [];
|
||||
this.lxyList = [];
|
||||
const allArr = JSON.parse(
|
||||
localStorage.getItem("ReceiptList")
|
||||
).quitneckList;
|
||||
if (name === "孙东宇") {
|
||||
allArr.forEach((item) => {
|
||||
if (item.proposer === "孙东宇") {
|
||||
this.sdyList.push(item);
|
||||
}
|
||||
});
|
||||
return this.sdyList;
|
||||
}
|
||||
if (name === "杨春宇") {
|
||||
allArr.forEach((item) => {
|
||||
if (item.proposer === "杨春宇") {
|
||||
this.ycyList.push(item);
|
||||
}
|
||||
});
|
||||
return this.ycyList;
|
||||
}
|
||||
if (name === "吕才卓") {
|
||||
allArr.forEach((item) => {
|
||||
if (item.proposer === "吕才卓") {
|
||||
this.lczList.push(item);
|
||||
}
|
||||
});
|
||||
return this.lczList;
|
||||
}
|
||||
if (name === "刘欣宇") {
|
||||
allArr.forEach((item) => {
|
||||
if (item.proposer === "刘欣宇") {
|
||||
this.lxyList.push(item);
|
||||
}
|
||||
});
|
||||
return this.lxyList;
|
||||
}
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
});
|
|
@ -9,6 +9,7 @@ export const useReceiptList = defineStore("ReceiptList", {
|
|||
return {
|
||||
personName: [],
|
||||
receiptList: [],
|
||||
quitneckList: [],
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
|
@ -25,12 +26,12 @@ export const useReceiptList = defineStore("ReceiptList", {
|
|||
return this.receiptList;
|
||||
},
|
||||
async getquitneckNum(obj) {
|
||||
console.log(obj);
|
||||
const index = this.receiptList.findIndex((item) => item.id === obj.id);
|
||||
if (index !== -1) {
|
||||
this.receiptList[index].receiptNum = obj.quitneckNum;
|
||||
this.receiptList[index].receiptNum =
|
||||
this.receiptList[index].receiptNum - obj.quitneckNum;
|
||||
}
|
||||
console.log(this.receiptList);
|
||||
this.quitneckList.push(obj);
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user