推送项目重构代码
This commit is contained in:
@@ -85,13 +85,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="手机" align="center" prop="mobile" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" />
|
||||
<el-table-column label="QQ" align="center" prop="qq" />
|
||||
<el-table-column label="微信" align="center" prop="wechat" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" />
|
||||
<el-table-column label="详细地址" align="center" prop="detailAddress" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="手机" align="center" prop="mobile" width="120" />
|
||||
<el-table-column label="电话" align="center" prop="telephone" width="120" />
|
||||
<el-table-column label="QQ" align="center" prop="qq" width="100" />
|
||||
<el-table-column label="微信" align="center" prop="wechat" width="100" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="详细地址" align="center" prop="detailAddress" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
|
||||
@@ -223,7 +223,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
name: undefined,
|
||||
followUpStatus: undefined,
|
||||
contactLastTime: undefined,
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="statusTab" @tab-click="onStatusTab" class="compact-tabs">
|
||||
<el-tab-pane name="undone">
|
||||
<span slot="label">未完成 ({{ stat.undone }})</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="all">
|
||||
<span slot="label">全部 ({{ stat.all }})</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="done">
|
||||
<span slot="label">已完成 ({{ stat.done }})</span>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch"
|
||||
label-width="68px" class="compact-search">
|
||||
<el-form-item label="需求标题" prop="title">
|
||||
@@ -257,6 +269,10 @@ export default {
|
||||
open: false,
|
||||
// 负责人选项
|
||||
ownerOptions: [],
|
||||
// 状态分组 tab:undone=未完成(0,1) / all=全部 / done=已完成(2)
|
||||
statusTab: 'undone',
|
||||
// 各 tab 计数
|
||||
stat: { undone: 0, all: 0, done: 0 },
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -268,6 +284,7 @@ export default {
|
||||
description: undefined,
|
||||
deadline: undefined,
|
||||
status: undefined,
|
||||
statusIn: undefined,
|
||||
accessory: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
@@ -301,8 +318,10 @@ export default {
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this.applyStatusTab();
|
||||
this.getList();
|
||||
this.getUsers();
|
||||
this.refreshStat();
|
||||
},
|
||||
methods: {
|
||||
// 跳到入库明细页面,并预填该采购需求
|
||||
@@ -382,6 +401,35 @@ export default {
|
||||
this.ownerOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 根据当前 tab 写 queryParams.statusIn / status */
|
||||
applyStatusTab () {
|
||||
if (this.statusTab === 'undone') {
|
||||
this.queryParams.statusIn = '0,1'
|
||||
this.queryParams.status = undefined
|
||||
} else if (this.statusTab === 'done') {
|
||||
this.queryParams.statusIn = undefined
|
||||
this.queryParams.status = 2
|
||||
} else {
|
||||
this.queryParams.statusIn = undefined
|
||||
this.queryParams.status = undefined
|
||||
}
|
||||
},
|
||||
onStatusTab () {
|
||||
this.applyStatusTab()
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 刷新三个 tab 的计数 */
|
||||
refreshStat () {
|
||||
const base = { ...this.queryParams, pageNum: 1, pageSize: 1, status: undefined, statusIn: undefined }
|
||||
Promise.all([
|
||||
listRequirements({ ...base, statusIn: '0,1' }),
|
||||
listRequirements({ ...base }),
|
||||
listRequirements({ ...base, status: 2 })
|
||||
]).then(([u, a, d]) => {
|
||||
this.stat = { undone: u.total || 0, all: a.total || 0, done: d.total || 0 }
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 查询OA 需求列表 */
|
||||
getList () {
|
||||
this.loading = true;
|
||||
@@ -389,6 +437,7 @@ export default {
|
||||
this.requirementsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.refreshStat();
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
@@ -425,6 +474,8 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery () {
|
||||
this.resetForm("queryForm");
|
||||
// 重置后保留当前 tab 对应的 status 过滤
|
||||
this.applyStatusTab();
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
|
||||
Reference in New Issue
Block a user