|
@@ -30,24 +30,24 @@
|
|
|
<el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="项目名称" align="left" prop="projectName" width="230" />
|
|
|
- <el-table-column label="项目编号" align="center" prop="num" />
|
|
|
+ <el-table-column label="项目编号" align="center" prop="num" width="180" />
|
|
|
<el-table-column label="项目周期" align="center" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.startDate }} 至 {{ scope.row.finishDate }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="服务公司" align="center" width="150">
|
|
|
+ <el-table-column label="服务公司" align="center" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="omit" :title="scope.row.serviceCompany">{{ scope.row.serviceCompany }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="接包人数" align="center" prop="peoples" width="110">
|
|
|
+ <el-table-column label="接包人数" align="center" prop="peoples" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="omit">{{ scope.row.peoples || 0 }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发包日期" align="center" prop="createTime" />
|
|
|
- <el-table-column label="项目状态" align="center" prop="state" width="100">
|
|
|
+ <el-table-column label="发包日期" align="center" prop="createTime" width="160" />
|
|
|
+ <el-table-column label="项目状态" align="center" prop="state" width="100" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="switch">
|
|
|
<el-switch v-model="scope.row.state" :active-value="0" :width="50" :inactive-value="1" @change="op('change', scope.row)"></el-switch>
|
|
@@ -56,9 +56,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="270" fixed="right">
|
|
|
+ <el-table-column label="操作" align="center" width="370" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-s-goods" @click="op('packages', scope.row)" v-hasPermi="['work:project:list']">接包明细</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-document-copy" @click="op('generate', scope.row)" v-hasPermi="['work:statement:make']">生成结算单</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:project:list']">详情</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:project:edit']">修改</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:project:remove']">删除</el-button>
|
|
@@ -73,93 +74,100 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import edit from './edit';
|
|
|
-import packages from './packages/index.vue';
|
|
|
-export default {
|
|
|
- name: 'Project',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- ids: [],
|
|
|
- showSearch: true,
|
|
|
- response: {},
|
|
|
- dateRange: [],
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- projectName: null,
|
|
|
- num: null,
|
|
|
- state: null,
|
|
|
- orderByColumn: 'id',
|
|
|
- isAsc: 'desc'
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getList() {
|
|
|
- if (this.dateRange) {
|
|
|
- this.queryParams.dateBegin = this.dateRange[0];
|
|
|
- this.queryParams.dateEnd = this.dateRange[1];
|
|
|
- }
|
|
|
- this.ajax({ url: '/work/project/list', data: this.queryParams }).then((response) => {
|
|
|
- this.response = response;
|
|
|
- });
|
|
|
+ import edit from './edit';
|
|
|
+ import packages from './packages/index.vue';
|
|
|
+ export default {
|
|
|
+ name: 'Project',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ ids: [],
|
|
|
+ showSearch: true,
|
|
|
+ response: {},
|
|
|
+ dateRange: [],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ projectName: null,
|
|
|
+ num: null,
|
|
|
+ state: null,
|
|
|
+ orderByColumn: 'id',
|
|
|
+ isAsc: 'desc'
|
|
|
+ }
|
|
|
+ };
|
|
|
},
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
+ created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
- resetQuery() {
|
|
|
- this.resetForm('queryForm');
|
|
|
- this.dateRange = [];
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- selects(rows) {
|
|
|
- this.ids = rows.map((item) => item.id);
|
|
|
- },
|
|
|
- op(tag, row) {
|
|
|
- if (tag == 'add') {
|
|
|
- this.iframe({ obj: edit, param: {}, title: '新增项目', width: '50%', height: '50%' });
|
|
|
- return;
|
|
|
- }
|
|
|
- const id = row.id || this.ids[0];
|
|
|
- if (tag == 'packages') {
|
|
|
- this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '75%', height: '75%' });
|
|
|
- }
|
|
|
- if (tag == 'detail') {
|
|
|
- this.iframe({ obj: edit, param: { id: id, detail: true }, title: '项目详情', width: '55%', height: '55%' });
|
|
|
- }
|
|
|
- if (tag == 'edit') {
|
|
|
- this.iframe({ obj: edit, param: { id: id }, title: '编辑项目', width: '55%', height: '55%' });
|
|
|
- }
|
|
|
- //账号状态
|
|
|
- if (tag == 'change') {
|
|
|
- let text = row.state === 0 ? '发布' : '停用';
|
|
|
- this.$confirm('确认要' + text + '该项目吗?', '警告', { type: 'warning' })
|
|
|
- .then(() => {
|
|
|
- this.post({ url: '/work/project/edit', data: { id: row.id, state: row.state } })
|
|
|
- .then((response) => {
|
|
|
- this.$modal.msgSuccess(text + '成功');
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.state = row.state === 0 ? 1 : 0;
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.state = row.state === 0 ? 1 : 0;
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ if (this.dateRange) {
|
|
|
+ this.queryParams.dateBegin = this.dateRange[0];
|
|
|
+ this.queryParams.dateEnd = this.dateRange[1];
|
|
|
+ }
|
|
|
+ this.ajax({ url: '/work/project/list', data: this.queryParams }).then((response) => {
|
|
|
+ this.response = response;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm('queryForm');
|
|
|
+ this.dateRange = [];
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ selects(rows) {
|
|
|
+ this.ids = rows.map((item) => item.id);
|
|
|
+ },
|
|
|
+ op(tag, row) {
|
|
|
+ if (tag == 'add') {
|
|
|
+ this.iframe({ obj: edit, param: {}, title: '新增项目', width: '50%', height: '50%' });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const id = row.id || this.ids[0];
|
|
|
+ if (tag == 'packages') {
|
|
|
+ this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '75%', height: '75%' });
|
|
|
+ }
|
|
|
+ if (tag == 'detail') {
|
|
|
+ this.iframe({ obj: edit, param: { id: id, detail: true }, title: '项目详情', width: '55%', height: '55%' });
|
|
|
+ }
|
|
|
+ if (tag == 'edit') {
|
|
|
+ this.iframe({ obj: edit, param: { id: id }, title: '编辑项目', width: '55%', height: '55%' });
|
|
|
+ }
|
|
|
+ //账号状态
|
|
|
+ if (tag == 'change') {
|
|
|
+ let text = row.state === 0 ? '发布' : '停用';
|
|
|
+ this.$confirm('确认要' + text + '该项目吗?', '警告', { type: 'warning' })
|
|
|
+ .then(() => {
|
|
|
+ this.post({ url: '/work/project/edit', data: { id: row.id, state: row.state } })
|
|
|
+ .then((response) => {
|
|
|
+ this.$modal.msgSuccess(text + '成功');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.state = row.state === 0 ? 1 : 0;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.state = row.state === 0 ? 1 : 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (tag == 'generate') {
|
|
|
+ this.$confirm('是否确认生成结算单!', '警告', { type: 'warning' }).then(() => {
|
|
|
+ this.get({ url: 'work/statement/make/generate/project/' + row.id }).then((response) => {
|
|
|
+ this.$modal.msgSuccess('生成成功');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del(row) {
|
|
|
+ this.$confirm('是否确认删除选中项目? 会影响已经接包用户!', '警告', { type: 'warning' }).then(() => {
|
|
|
+ this.get({ url: '/work/project/remove/' + (row.id || this.ids) }).then((response) => {
|
|
|
+ this.$modal.msgSuccess('删除成功');
|
|
|
+ this.getList();
|
|
|
});
|
|
|
- }
|
|
|
- },
|
|
|
- del(row) {
|
|
|
- this.$confirm('是否确认删除选中项目? 会影响已经接包用户!', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.get({ url: '/work/project/remove/' + (row.id || this.ids) }).then((response) => {
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
- this.getList();
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|