Commit 0f41d4a7 by zhangtw

申领页面样式调整

parent 2eeb6f65
...@@ -21,7 +21,7 @@ export const getPendingBorrowList = (param) => { ...@@ -21,7 +21,7 @@ export const getPendingBorrowList = (param) => {
// 获取历史列表 // 获取历史列表
export const getHistoryBorrowList = (param) => { export const getHistoryBorrowList = (param) => {
return axios.request({ return axios.request({
url: '/api/keyDmBorrow/selectHistoryList', url: '/api/ac/jilinsscgsdp/keyDmBorrow/selectHistoryList',
method: 'post', method: 'post',
data: param data: param
}) })
......
...@@ -1035,7 +1035,7 @@ export default { ...@@ -1035,7 +1035,7 @@ export default {
user_ids: userIds user_ids: userIds
}).then(ret => { }).then(ret => {
if (ret.data && ret.data.errcode === 0) { if (ret.data && ret.data.errcode === 0) {
this.fetchList("org") this.fetchList('org')
this.$Message.success('保存成功') this.$Message.success('保存成功')
this.userAssignModal.visible = false this.userAssignModal.visible = false
} else { } else {
......
...@@ -4,55 +4,70 @@ ...@@ -4,55 +4,70 @@
<TabPane label="办公用品申领" name="apply"> <TabPane label="办公用品申领" name="apply">
<div class="search-div"> <div class="search-div">
<Row type="flex" :gutter="16"> <Row type="flex" :gutter="16">
<Col span="20"> <Col span="18">
<div class="search-form"> <span>部门:</span>
<Form :inline="true" :model="filters.apply" class="form-inline">
<FormItem label="申请单号:" class="form-item">
<Input <Input
v-model="filters.apply.application_no" v-model="filters.apply.department_name"
placeholder="请输入申请单号" placeholder="请输入部门"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>申请人:</span>
<FormItem label="申请人:" class="form-item">
<Input <Input
v-model="filters.apply.applicant_name" v-model="filters.apply.applicant_name"
placeholder="请输入申请人" placeholder="请输入申请人"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>开始时间:</span>
<FormItem label="审批状态:" class="form-item"> <DatePicker
v-model="filters.apply.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间"
class="mr10"
style="width: 200px"
/>
<span>结束时间:</span>
<DatePicker
v-model="filters.apply.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间"
class="mr10"
style="width: 200px"
/>
<br>
<span>审批状态:</span>
<Select <Select
v-model="filters.apply.approval_status" v-model="filters.apply.approval_status"
placeholder="请选择审批状态" placeholder="请选择审批状态"
class="form-input" class="mr10"
style="width: 200px"
> >
<Option :value='0'>待提交</Option> <Option :value='0'>待提交</Option>
<Option :value='1'>审核中</Option> <Option :value='1'>审核中</Option>
<Option :value='9'>审核通过</Option> <Option :value='9'>审核通过</Option>
<Option :value='-1'>驳回</Option> <Option :value='-1'>驳回</Option>
</Select> </Select>
</FormItem>
<FormItem class="form-item-actions">
<Button type="primary" @click="handleSearch('apply')">搜索</Button>
<Button @click="handleReset('apply')" style="margin-left: 8px;">重置</Button>
</FormItem>
</Form>
</div>
</Col> </Col>
<!-- 右侧操作按钮区:固定居右 --> <!-- 右侧操作按钮区:固定居右 -->
<Col span="4" class="action-col"> <Col span="6" class="action-col">
<Button type="success" @click="openApplyModal">申请</Button> <Button type="primary" class="mr10" @click="handleSearch('apply')">搜索</Button>
<Button type="primary" class="mr10" @click="handleReset('apply')">重置</Button>
<Button type="primary" class="mr10" @click="openApplyModal">申请</Button>
</Col> </Col>
</Row> </Row>
</div> </div>
<Table :data="tables.apply" :loading="loading.apply" :columns="applyColumns" border> <Table :data="tables.apply" :loading="loading.apply" :columns="applyColumns" border>
<template slot="action" slot-scope="{ row }"> <template slot="action" slot-scope="{ row }">
<Button size="small" @click="openDetail(row)">详细</Button> <Button size="small" @click="openDetail(row)" class="mr5" >详细</Button>
<Button size="small" type="primary" @click="openEdit(row)" v-if="canEdit(row)">修改</Button> <Button size="small" type="primary" class="mr5" @click="openEdit(row)" v-if="canEdit(row)">修改</Button>
<Button size="small" type="success" @click="submit(row)" v-if="canSubmit(row)">提交</Button> <Button size="small" type="success" class="mr5" @click="submit(row)" v-if="canSubmit(row)">提交</Button>
<Poptip confirm title="确认撤回?" transfer @on-ok="revoke(row)" v-if="canRevoke(row)"> <Poptip confirm title="确认撤回?" transfer @on-ok="revoke(row)" v-if="canRevoke(row)" class="mr5">
<Button size="small" type="warning">撤回</Button> <Button size="small" type="warning">撤回</Button>
</Poptip> </Poptip>
</template> </template>
...@@ -74,41 +89,58 @@ ...@@ -74,41 +89,58 @@
<TabPane label="办公用品审核历史查询" name="history"> <TabPane label="办公用品审核历史查询" name="history">
<div class="search-div"> <div class="search-div">
<Row type="flex" :gutter="16"> <Row type="flex" :gutter="16">
<Col span="24"> <Col span="18">
<div class="search-form"> <span>部门:</span>
<Form :inline="true" :model="filters.history" class="form-inline">
<FormItem label="申请单号:" class="form-item">
<Input <Input
v-model="filters.history.application_no" v-model="filters.history.department_name"
placeholder="请输入申请单号" placeholder="请输入部门"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>申请人:</span>
<FormItem label="申请人:" class="form-item">
<Input <Input
v-model="filters.history.applicant_name" v-model="filters.history.applicant_name"
placeholder="请输入申请人" placeholder="请输入申请人"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>提交开始时间:</span>
<FormItem label="审批状态:" class="form-item"> <DatePicker
v-model="filters.history.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间"
class="mr10"
style="width: 200px"
/>
<span>提交结束时间:</span>
<DatePicker
v-model="filters.history.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间"
class="mr10"
style="width: 200px"
/>
<br>
<span>审批状态:</span>
<Select <Select
v-model="filters.history.approval_status" v-model="filters.history.approval_status"
placeholder="请选择审批状态" placeholder="请选择审批状态"
class="form-input" class="mr10"
style="width: 200px"
> >
<Option :value= "0">待提交</Option> <Option :value= "0">待提交</Option>
<Option :value= "1">审核中</Option> <Option :value= "1">审核中</Option>
<Option :value= "9">审核通过</Option> <Option :value= "9">审核通过</Option>
<Option :value= "-1">驳回</Option> <Option :value= "-1">驳回</Option>
</Select> </Select>
</FormItem> </Col>
<FormItem class="form-item-actions"> <Col span="6" class="text-right">
<Button type="primary" @click="handleSearch('history')">搜索</Button> <Button type="primary" class="mr10" @click="handleSearch('history')">搜索</Button>
<Button @click="handleReset('history')" style="margin-left: 8px;">重置</Button> <Button type="primary" class="mr10" @click="handleReset('history')">重置</Button>
</FormItem>
</Form>
</div>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -235,12 +267,14 @@ import { ...@@ -235,12 +267,14 @@ import {
submitBorrow, submitBorrow,
revokeBorrow, revokeBorrow,
getPendingBorrowList, getPendingBorrowList,
getHistoryBorrowList,
approveBorrow, approveBorrow,
rejectBorrow, rejectBorrow,
getBorrowById getBorrowById
} from '@/api/key-dm-inventory' } from '@/api/key-dm-inventory'
import MaterialSelector from '@/view/key-person/key_dm_conf/materialSelector.vue' import MaterialSelector from '@/view/key-person/key_dm_conf/materialSelector.vue'
import { getSupplyApproval } from '@/api/key-dm-user-permission' import { getSupplyApproval } from '@/api/key-dm-user-permission'
import { normalizeVisitTimeValue } from '@/view/key-person/key_dm_conf/dates.js'
export default { export default {
name: 'key-dm-inventory-index', name: 'key-dm-inventory-index',
...@@ -262,44 +296,53 @@ export default { ...@@ -262,44 +296,53 @@ export default {
opTypeMap: { '1': '入库', '2': '出库' }, opTypeMap: { '1': '入库', '2': '出库' },
activeTab: 'apply', activeTab: 'apply',
filters: { filters: {
apply: { application_no: '', applicant_name: '', approval_status: null }, apply: { application_no: '', applicant_name: '', approval_status: null, startDate: null, endDate: null },
history: { application_no: '', applicant_name: '', approval_status: null } history: { application_no: '', applicant_name: '', approval_status: null, startDate: null, endDate: null }
}, },
tables: { apply: [], pending: [], history: [] }, 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 } }, 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 }, loading: { apply: false, pending: false, history: false },
applyColumns: [ applyColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' }, // { title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
{ title: '审评用途', key: 'borrow_purpose', align: 'center' }, { title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '申领用途', key: 'borrow_purpose', align: 'center' },
{ {
title: '起止时间', title: '提交申请时间',
key: 'start_time', key: 'submit_time',
align: 'center', align: 'center',
width: '300px', width: '300px',
render: (h, { row }) => { render: (h, { row }) => {
return h('span', (this.formatDateTime(row.create_time) || row.create_time || '-') + '--' + (this.formatDateTime(row.approval_time) || row.approval_time || '-')) return h('span', this.formatDateTime(row.submit_time) || '-')
} }
}, },
{ // {
title: '时长', // title: '起止时间',
key: 'duration', // key: 'start_time',
align: 'center', // align: 'center',
render: (h, { row }) => { // width: '300px',
const createTime = Number(row.create_time) || 0 // render: (h, { row }) => {
const approvalTime = Number(row.approval_time) || 0 // return h('span', (this.formatDateTime(row.create_time) || row.create_time || '-') + '--' + (this.formatDateTime(row.approval_time) || row.approval_time || '-'))
let duration = null // }
if (createTime !== 0 && approvalTime !== 0) { // },
const diffMs = Math.abs(approvalTime - createTime) // {
duration = this.formatDuration(diffMs) // title: '时长',
} else { // key: 'duration',
duration = this.formatDuration('') // align: 'center',
} // render: (h, { row }) => {
return h('span', duration) // const createTime = Number(row.create_time) || 0
} // const approvalTime = Number(row.approval_time) || 0
}, // let duration = null
// if (createTime !== 0 && approvalTime !== 0) {
// const diffMs = Math.abs(approvalTime - createTime)
// duration = this.formatDuration(diffMs)
// } else {
// duration = this.formatDuration('')
// }
// return h('span', duration)
// }
// },
{ {
title: '状态', title: '状态',
key: 'approval_status', key: 'approval_status',
...@@ -312,11 +355,12 @@ export default { ...@@ -312,11 +355,12 @@ export default {
], ],
pendingColumns: [ pendingColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' }, // { title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '申请用途', key: 'borrow_purpose', align: 'center' },
{ {
title: '提交时间', title: '提交申请时间',
key: 'submit_time', key: 'submit_time',
align: 'center', align: 'center',
render: (h, { row }) => { render: (h, { row }) => {
...@@ -327,8 +371,10 @@ export default { ...@@ -327,8 +371,10 @@ export default {
], ],
historyColumns: [ historyColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
// { title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' }, { title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '申请用途', key: 'borrow_purpose', align: 'center' },
{ {
title: '状态', title: '状态',
key: 'approval_status', key: 'approval_status',
...@@ -338,6 +384,14 @@ export default { ...@@ -338,6 +384,14 @@ export default {
} }
}, },
{ {
title: '提交审批时间',
key: 'submit_time',
align: 'center',
render: (h, { row }) => {
return h('span', this.formatDateTime(row.submit_time) || '-')
}
},
{
title: '审批完成时间', title: '审批完成时间',
key: 'approval_time', key: 'approval_time',
align: 'center', align: 'center',
...@@ -569,11 +623,15 @@ export default { ...@@ -569,11 +623,15 @@ export default {
if (name === 'history') this.fetchList('history') if (name === 'history') this.fetchList('history')
}, },
fetchList (tab) { fetchList (tab) {
const apiMap = { apply: getBorrowList, pending: getPendingBorrowList, history: getBorrowList } const apiMap = { apply: getBorrowList, pending: getPendingBorrowList, history: getHistoryBorrowList }
const api = apiMap[tab]; if (!api) return const api = apiMap[tab]; if (!api) return
this.loading[tab] = true this.loading[tab] = true
// 清理空值,防止参数传递问题 // 清理空值,防止参数传递问题
const cleanParams = (obj) => { const cleanParams = (obj) => {
console.log(obj)
obj.startDate = normalizeVisitTimeValue(obj.startDate)
obj.endDate = normalizeVisitTimeValue(obj.endDate)
console.log(obj)
const cleaned = {} const cleaned = {}
for (let key in obj) { for (let key in obj) {
const value = obj[key] const value = obj[key]
...@@ -844,4 +902,7 @@ export default { ...@@ -844,4 +902,7 @@ export default {
.ivu-table-row:hover .edit-icon { .ivu-table-row:hover .edit-icon {
opacity: 1; opacity: 1;
} }
.mr5 {
margin-right: 5px;
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论