|
@@ -5,9 +5,7 @@
|
|
|
<el-input v-model="queryParams.batchName" placeholder="请输入结算批次" @keyup.enter.native="handleQuery" clearable />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="关联项目" prop="projectId">
|
|
|
- <el-select v-model="queryParams.projectId" placeholder="请选择关联项目" class="se" clearable>
|
|
|
- <el-option v-for="dict in projectList" :key="dict.projectName" :label="dict.projectName" :value="dict.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <projectSelect v-model="queryParams.projectId"></projectSelect>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
@@ -15,27 +13,29 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
- <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:statement:add']">新增</el-button>
|
|
|
- <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:statement:edit']">修改</el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:statement:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-download" @click="op('download')">下载模板</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-document-add" @click="op('add')">创建结算单</el-button>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
- <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table :data="response.rows" border height="calc(100vh - 270px)">
|
|
|
<el-table-column type="index" label="序号" align="center" width="80" />
|
|
|
<el-table-column label="上传文档名称" align="center" prop="fileName" />
|
|
|
- <el-table-column label="结算批次" align="center" prop="batchName" />
|
|
|
- <el-table-column label="关联项目" align="center" prop="projectName" />
|
|
|
- <el-table-column label="发放金额(元)" align="center" prop="money" width="130" />
|
|
|
- <el-table-column label="发放人数" align="center" prop="peoples" width="130" />
|
|
|
- <el-table-column label="创建人" align="center" prop="opBy" width="130" />
|
|
|
- <el-table-column label="创建日期" align="center" prop="createTime" />
|
|
|
- <el-table-column label="操作" align="center" width="250">
|
|
|
+ <el-table-column label="结算批次" align="center" prop="batchName" width="180" />
|
|
|
+ <el-table-column label="关联项目" align="center" prop="projectName" width="180" />
|
|
|
+ <el-table-column label="发放金额(元)" align="center" prop="money" width="110" />
|
|
|
+ <el-table-column label="发放人数" align="center" prop="peoples" width="110" />
|
|
|
+ <el-table-column label="生成状态" align="center" width="110">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:statement:list']">详情</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="op('generate', scope.row)" v-hasPermi="['work:statement:edit']" v-if="scope.row.state === 0">生成结算单</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:statement:edit']" v-if="scope.row.state === 0">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:statement:remove']" v-if="scope.row.state === 0">删除</el-button>
|
|
|
+ <el-tag type="info" v-if="scope.row.state == 0">待生成</el-tag>
|
|
|
+ <el-tag type="success" v-if="scope.row.state == 1">已生成</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建日期" align="center" prop="createTime" width="170" />
|
|
|
+ <el-table-column label="操作" align="center" width="230">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="op('generate', scope.row)" v-if="scope.row.state === 0">生成结算单</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-if="scope.row.state === 0">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<template slot="empty">
|
|
@@ -52,8 +52,6 @@ import record from './record';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- ids: [],
|
|
|
- projectList: [],
|
|
|
showSearch: true,
|
|
|
response: {},
|
|
|
queryParams: {
|
|
@@ -61,19 +59,17 @@ export default {
|
|
|
pageSize: 10,
|
|
|
batchName: null,
|
|
|
projectId: null,
|
|
|
+ orderByColumn: 's.id',
|
|
|
isAsc: 'desc'
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.ajax({ url: '/work/project/selectAll' }).then((response) => {
|
|
|
- this.projectList = response.data;
|
|
|
- });
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
getList() {
|
|
|
- this.ajax({ url: '/work/statement/list', data: this.queryParams }).then((response) => {
|
|
|
+ this.ajax({ url: '/work/statement/make', data: this.queryParams }).then((response) => {
|
|
|
this.response = response;
|
|
|
});
|
|
|
},
|
|
@@ -85,15 +81,16 @@ export default {
|
|
|
this.resetForm('queryForm');
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
- selects(rows) {
|
|
|
- this.ids = rows.map((item) => item.id);
|
|
|
- },
|
|
|
op(tag, row) {
|
|
|
if (tag == 'add') {
|
|
|
- this.iframe({ obj: edit, param: {}, title: '创建结算单', width: '40%', height: '65%' });
|
|
|
+ this.iframe({ obj: edit, param: {}, title: '创建结算单', width: '40%', height: '63%' });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (tag == 'download') {
|
|
|
+ this.download('work/statement/importTemplate', {}, '结算单模版.xlsx');
|
|
|
return;
|
|
|
}
|
|
|
- const id = row.id || this.ids[0];
|
|
|
+ const id = row.id;
|
|
|
if (tag == 'detail') {
|
|
|
this.iframe({ obj: record, param: { id: id, detail: true }, title: '查看结算单明细', width: '65%', height: '65%' });
|
|
|
}
|
|
@@ -102,7 +99,7 @@ export default {
|
|
|
}
|
|
|
if (tag == 'generate') {
|
|
|
this.$confirm('是否确认生成结算单?', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.ajax({ url: '/work/statement/generate/' + id }).then((response) => {
|
|
|
+ this.ajax({ url: '/work/statement/make/generate/' + id }).then((response) => {
|
|
|
this.$modal.msgSuccess('生成成功');
|
|
|
this.getList();
|
|
|
});
|
|
@@ -111,7 +108,7 @@ export default {
|
|
|
},
|
|
|
del(row) {
|
|
|
this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.get({ url: '/work/statement/remove/' + (row.id || this.ids) }).then((response) => {
|
|
|
+ this.get({ url: '/work/statement/make/remove/' + row.id }).then((response) => {
|
|
|
this.$modal.msgSuccess('删除成功');
|
|
|
this.getList();
|
|
|
});
|