Commit 8ae61c2e by wangchunyang

日常管理框架代码调整

parent be785147
......@@ -14,25 +14,17 @@
</Col>
</Row>
</div>
<Table :data="tables.inbound" :loading="loading.inbound" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="inbound_no" title="入库单号" align="center" />
<TableColumn prop="batch_no" title="批次号" align="center" />
<TableColumn prop="inbound_date" title="入库日期" align="center" />
<TableColumn prop="inbound_type" title="类型" align="center" />
<TableColumn prop="inbound_status" title="状态" align="center" />
<TableColumn title="操作" width="360" align="center">
<template slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
<Button size="small" type="primary" @click="openEdit(row)" v-if="canEdit(row)">修改</Button>
<Poptip confirm title="确认删除?" transfer @on-ok="deleteInbound(row)">
<Button size="small" type="error">删除</Button>
</Poptip>
<Poptip confirm title="确认执行入库?" transfer @on-ok="doInbound(row)" v-if="row.inbound_status===0">
<Button size="small" type="success">入库</Button>
</Poptip>
</template>
</TableColumn>
<Table :data="tables.inbound" :loading="loading.inbound" :columns="inboundColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
<Button size="small" type="primary" @click="openEdit(row)" v-if="canEdit(row)">修改</Button>
<Poptip confirm title="确认删除?" transfer @on-ok="deleteInbound(row)">
<Button size="small" type="error">删除</Button>
</Poptip>
<Poptip confirm title="确认执行入库?" transfer @on-ok="doInbound(row)" v-if="row.inbound_status===0">
<Button size="small" type="success">入库</Button>
</Poptip>
</template>
</Table>
<Page class="page_style" :total="pagers.inbound.totalRecord" :current="pagers.inbound.pageNo" :page-size="pagers.inbound.pageSize"
show-total show-sizer @on-change="pageChange('inbound', $event)" @on-page-size-change="sizeChange('inbound', $event)" />
......@@ -48,17 +40,10 @@
</Col>
</Row>
</div>
<Table :data="tables.return" :loading="loading.return" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="application_no" title="申请单号" align="center" />
<TableColumn prop="applicant_name" title="申请人" align="center" />
<TableColumn prop="department_name" title="部门" align="center" />
<TableColumn prop="issue_status" title="发放状态" align="center" />
<TableColumn title="操作" width="140" align="center">
<template slot-scope="{ row }">
<Button size="small" type="primary" @click="openReturnModal(row)">归还</Button>
</template>
</TableColumn>
<Table :data="tables.return" :loading="loading.return" :columns="returnColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" type="primary" @click="openReturnModal(row)">归还</Button>
</template>
</Table>
<Page class="page_style" :total="pagers.return.totalRecord" :current="pagers.return.pageNo" :page-size="pagers.return.pageSize"
show-total show-sizer @on-change="pageChange('return', $event)" @on-page-size-change="sizeChange('return', $event)" />
......@@ -74,14 +59,7 @@
</Col>
</Row>
</div>
<Table :data="tables.inventory" :loading="loading.inventory" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="material_code" title="物料编码" align="center" />
<TableColumn prop="material_name" title="物料名称" align="center" />
<TableColumn prop="total_quantity" title="总量" align="center" />
<TableColumn prop="available_quantity" title="可用" align="center" />
<TableColumn prop="borrowed_quantity" title="借出" align="center" />
</Table>
<Table :data="tables.inventory" :loading="loading.inventory" :columns="inventoryColumns" border />
</TabPane>
</Tabs>
......@@ -183,6 +161,31 @@ export default {
tables: { inbound: [], return: [], inventory: [] },
pagers: { inbound: { pageNo: 1, pageSize: 10, totalRecord: 0 }, return: { pageNo: 1, pageSize: 10, totalRecord: 0 }, inventory: { pageNo: 1, pageSize: 10, totalRecord: 0 } },
loading: { inbound: false, return: false, inventory: false },
inboundColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '入库单号', key: 'inbound_no', align: 'center' },
{ title: '批次号', key: 'batch_no', align: 'center' },
{ title: '入库日期', key: 'inbound_date', align: 'center' },
{ title: '类型', key: 'inbound_type', align: 'center' },
{ title: '状态', key: 'inbound_status', align: 'center' },
{ title: '操作', slot: 'action', width: 360, align: 'center' }
],
returnColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' },
{ title: '发放状态', key: 'issue_status', align: 'center' },
{ title: '操作', slot: 'action', width: 140, align: 'center' }
],
inventoryColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '物料编码', key: 'material_code', align: 'center' },
{ title: '物料名称', key: 'material_name', align: 'center' },
{ title: '总量', key: 'total_quantity', align: 'center' },
{ title: '可用', key: 'available_quantity', align: 'center' },
{ title: '借出', key: 'borrowed_quantity', align: 'center' }
],
inboundModal: { visible: false, isEdit: false, saving: false, form: {}, details: [] },
returnModal: { visible: false, record: {}, details: [], saving: false },
detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] }
......
......@@ -15,57 +15,35 @@
</Row>
</div>
<Table :data="tables.apply" :loading="loading.apply" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="application_no" title="申请单号" align="center" />
<TableColumn prop="applicant_name" title="申请人" align="center" />
<TableColumn prop="department_name" title="部门" align="center" />
<TableColumn prop="approval_status" title="状态" align="center" />
<TableColumn prop="submit_time" title="提交时间" align="center" />
<TableColumn title="操作" width="320" align="center">
<template slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
<Button size="small" type="primary" @click="openEdit(row)" v-if="canEdit(row)">修改</Button>
<Button size="small" type="success" @click="submit(row)" v-if="canSubmit(row)">提交</Button>
<Poptip confirm title="确认撤回?" transfer @on-ok="revoke(row)" v-if="canRevoke(row)">
<Button size="small" type="warning">撤回</Button>
</Poptip>
</template>
</TableColumn>
<Table :data="tables.apply" :loading="loading.apply" :columns="applyColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
<Button size="small" type="primary" @click="openEdit(row)" v-if="canEdit(row)">修改</Button>
<Button size="small" type="success" @click="submit(row)" v-if="canSubmit(row)">提交</Button>
<Poptip confirm title="确认撤回?" transfer @on-ok="revoke(row)" v-if="canRevoke(row)">
<Button size="small" type="warning">撤回</Button>
</Poptip>
</template>
</Table>
<Page class="page_style" :total="pagers.apply.totalRecord" :current="pagers.apply.pageNo" :page-size="pagers.apply.pageSize"
show-total show-sizer @on-change="pageChange('apply', $event)" @on-page-size-change="sizeChange('apply', $event)" />
</TabPane>
<TabPane label="办公用品待审核" name="pending">
<Table :data="tables.pending" :loading="loading.pending" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="application_no" title="申请单号" align="center" />
<TableColumn prop="applicant_name" title="申请人" align="center" />
<TableColumn prop="department_name" title="部门" align="center" />
<TableColumn prop="submit_time" title="提交时间" align="center" />
<TableColumn title="操作" width="140" align="center">
<template slot-scope="{ row }">
<Button size="small" type="primary" @click="openApproveModal(row)">处理</Button>
</template>
</TableColumn>
<Table :data="tables.pending" :loading="loading.pending" :columns="pendingColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" type="primary" @click="openApproveModal(row)">处理</Button>
</template>
</Table>
<Page class="page_style" :total="pagers.pending.totalRecord" :current="pagers.pending.pageNo" :page-size="pagers.pending.pageSize"
show-total show-sizer @on-change="pageChange('pending', $event)" @on-page-size-change="sizeChange('pending', $event)" />
</TabPane>
<TabPane label="办公用品审核历史查询" name="history">
<Table :data="tables.history" :loading="loading.history" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="application_no" title="申请单号" align="center" />
<TableColumn prop="applicant_name" title="申请人" align="center" />
<TableColumn prop="approval_status" title="状态" align="center" />
<TableColumn prop="approval_time" title="审批时间" align="center" />
<TableColumn title="操作" width="100" align="center">
<template slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
</template>
</TableColumn>
<Table :data="tables.history" :loading="loading.history" :columns="historyColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button>
</template>
</Table>
<Page class="page_style" :total="pagers.history.totalRecord" :current="pagers.history.pageNo" :page-size="pagers.history.pageSize"
show-total show-sizer @on-change="pageChange('history', $event)" @on-page-size-change="sizeChange('history', $event)" />
......@@ -175,6 +153,33 @@ export default {
tables: { apply: [], pending: [], history: [] },
pagers: { apply: { pageNo: 1, pageSize: 10, totalRecord: 0 }, pending: { pageNo: 1, pageSize: 10, totalRecord: 0 }, history: { pageNo: 1, pageSize: 10, totalRecord: 0 } },
loading: { apply: false, pending: false, history: false },
applyColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' },
{ title: '请假类型', key: 'borrow_purpose', align: 'center' },
{ title: '起止时间', key: 'start_time', align: 'center' },
{ title: '时长', key: 'duration', align: 'center' },
{ title: '状态', key: 'approval_status', align: 'center' },
{ title: '操作', slot: 'action', align: 'center', width: 320 }
],
pendingColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' },
{ title: '提交时间', key: 'submit_time', align: 'center' },
{ title: '操作', slot: 'action', width: 120, align: 'center' }
],
historyColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '状态', key: 'approval_status', align: 'center' },
{ title: '审批完成时间', key: 'approval_complete_time', align: 'center' },
{ title: '操作', slot: 'action', width: 100, align: 'center' }
],
applyModal: { visible: false, isEdit: false, saving: false, form: {}, details: [] },
approveModal: { visible: false, record: {}, details: [], opinion: '', submitting: false },
detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] }
......
......@@ -18,16 +18,10 @@
</Col>
</Row>
</div>
<Table :data="tables.usage" :loading="loading.usage" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="department_name" title="部门" align="center" />
<TableColumn prop="material_name" title="物料" align="center" />
<TableColumn prop="total_quantity" title="领用数量" align="center" />
<TableColumn title="操作" width="100" align="center">
<template slot-scope="{ row }">
<Button size="small" @click="openUsageDetail(row)">详细</Button>
</template>
</TableColumn>
<Table :data="tables.usage" :loading="loading.usage" :columns="usageColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" @click="openUsageDetail(row)">详细</Button>
</template>
</Table>
</TabPane>
......@@ -44,20 +38,11 @@
</Col>
</Row>
</div>
<Table :data="tables.workload" :loading="loading.workload" border>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="user_name" title="人员" align="center" />
<TableColumn prop="leave_applications" title="请假申请次数" align="center" />
<TableColumn prop="leave_approvals" title="请假审批次数" align="center" />
<TableColumn prop="borrow_applications" title="用品申请次数" align="center" />
<TableColumn prop="inbound_count" title="入库次数" align="center" />
<TableColumn prop="leave_duration" title="请假时长(天)" align="center" />
<TableColumn title="操作" width="160" align="center">
<template slot-scope="{ row }">
<Button size="small" @click="openWorkloadDetail(row,'leave')">请假明细</Button>
<Button size="small" class="ml5" @click="openWorkloadDetail(row,'inventory')">用品明细</Button>
</template>
</TableColumn>
<Table :data="tables.workload" :loading="loading.workload" :columns="workloadColumns" border>
<template slot="action" slot-scope="{ row }">
<Button size="small" @click="openWorkloadDetail(row,'leave')">请假明细</Button>
<Button size="small" class="ml5" @click="openWorkloadDetail(row,'inventory')">用品明细</Button>
</template>
</Table>
</TabPane>
</Tabs>
......@@ -85,6 +70,23 @@ export default {
workRange: [],
tables: { usage: [], workload: [] },
loading: { usage: false, workload: false },
usageColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' },
{ title: '物料', key: 'material_name', align: 'center' },
{ title: '领用数量', key: 'total_quantity', align: 'center' },
{ title: '操作', slot: 'action', width: 100, align: 'center' }
],
workloadColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '人员', key: 'user_name', align: 'center' },
{ title: '请假申请次数', key: 'leave_applications', align: 'center' },
{ title: '请假审批次数', key: 'leave_approvals', align: 'center' },
{ title: '用品申请次数', key: 'borrow_applications', align: 'center' },
{ title: '入库次数', key: 'inbound_count', align: 'center' },
{ title: '请假时长(天)', key: 'leave_duration', align: 'center' },
{ title: '操作', slot: 'action', width: 160, align: 'center' }
],
detailModal: { visible: false, rows: [], columns: [] }
}
},
......
<template>
<div class="key-dm-user-wrapper">
<Card>
<div class="search-div">
<Row type="flex" :gutter="16" align="middle">
<Col :span="8">
<span>机构编码:</span>
<Input v-model="officeCode" placeholder="请输入机构编码或留空为当前机构" style="width: 60%" />
<Button type="primary" class="mr10" @click="handleSync">同步</Button>
<Button @click="fetchList">刷新</Button>
</Col>
<Col :span="8" class="text-right">
<span>姓名:</span>
<Input v-model="filters.name" placeholder="请输入姓名" style="width: 40%" />
<Button type="primary" class="mr10" @click="handleSearch">搜索</Button>
<Button @click="handleReset">重置</Button>
</Col>
</Row>
</div>
<div class="search-div">
<Row type="flex" :gutter="16" align="middle">
<!-- <Col :span="8">
<span>机构编码:</span>
<Input v-model="officeCode" placeholder="请输入机构编码或留空为当前机构" style="width: 60%" />
<Table :data="rows" :loading="loading" border>
<template slot="index" slot-scope="{ index }">
<span>{{ index + 1 }}</span>
<Button @click="fetchList">刷新</Button>
</Col> -->
<Col :span="12" class="text-left">
<span>姓名:</span>
<Input v-model="filters.name" placeholder="请输入姓名" style="width: 40%" />
</Col>
<Col :span="12" class="text-right">
<Button type="primary" class="mr10" @click="handleSearch">搜索</Button>
<Button @click="handleReset" class="mr10">重置</Button>
<Button type="primary" class="mr10" @click="handleSync">同步</Button>
</Col>
</Row>
</div>
<Table border :loading="loading" :columns="columns" :data="rows">
<template slot="is_leave" slot-scope="{ row }">
<span>{{ renderIsLeave(null, { row }) }}</span>
</template>
<template slot="is_ext" slot-scope="{ row }">
<span>{{ renderIsExt(null, { row }) }}</span>
</template>
<template slot="action" slot-scope="{ row }">
<Button size="small" type="primary" @click="openEdit(row)">修改</Button>
</template>
<TableColumn type="index" title="序号" width="60" align="center" />
<TableColumn prop="name" title="姓名" align="center" />
<TableColumn prop="gh" title="工号" align="center" />
<TableColumn prop="office_name" title="归属部门" align="center" />
<TableColumn prop="email" title="邮箱" align="center" />
<TableColumn prop="phone" title="电话" align="center" />
<TableColumn prop="mobile" title="手机" align="center" />
<TableColumn prop="is_leave" title="离职" width="80" align="center" :render="renderIsLeave" />
<TableColumn prop="is_ext" title="同步来源" width="120" align="center" :render="renderIsExt" />
<TableColumn title="操作" width="200" align="center">
<template slot-scope="{ row }">
<Button size="small" type="primary" @click="openEdit(row)">修改</Button>
</template>
</TableColumn>
</Table>
<Page class="page_style" :total="pager.totalRecord" :current="pager.pageNo" :page-size="pager.pageSize"
show-total show-sizer @on-change="pageChange" @on-page-size-change="sizeChange" />
</Card>
<Page class="page_style" :total="pager.totalRecord" :current="pager.pageNo" :page-size="pager.pageSize"
show-total show-sizer @on-change="pageChange" @on-page-size-change="sizeChange" />
<Modal v-model="editModal.visible" title="编辑日常人员" width="700" :mask-closable="false">
<Form :model="editModal.form" :label-width="120" ref="editForm">
......@@ -96,6 +88,18 @@ export default {
filters: { name: '' },
rows: [],
loading: false,
columns: [
{ type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '姓名', key: 'name', align: 'center' },
{ title: '工号', key: 'gh', align: 'center' },
{ title: '归属部门', key: 'office_name', align: 'center' },
{ title: '邮箱', key: 'email', align: 'center' },
{ title: '电话', key: 'phone', align: 'center' },
{ title: '手机', key: 'mobile', align: 'center' },
{ title: '离职', key: 'is_leave', slot: 'is_leave', width: 80, align: 'center' },
{ title: '同步来源', key: 'is_ext', slot: 'is_ext', width: 120, align: 'center' },
{ title: '操作', slot: 'action', width: 200, align: 'center' }
],
pager: { pageNo: 1, pageSize: 10, totalRecord: 0 },
editModal: {
visible: false,
......@@ -116,12 +120,14 @@ export default {
},
fetchList () {
this.loading = true
const payload = { pageNo: this.pager.pageNo, pageSize: this.pager.pageSize, params: Object.assign({}, this.filters) }
const payload = Object.assign({}, { pageNo: this.pager.pageNo, pageSize: this.pager.pageSize }, this.filters)
getDmUserList(payload).then(ret => {
console.log('getDmUserList', ret)
if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {}
this.rows = data.results || []
this.pager.totalRecord = data.totalRecord || 0
console.log('data', this.rows)
} else {
this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}
......@@ -191,4 +197,10 @@ export default {
.search-div { border: 1px solid #dce1e7; padding: 12px; margin-bottom: 12px; background-color: #f8fbff; }
.mr10 { margin-right: 10px; }
.page_style { margin-top: 12px; text-align: right; }
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论