|
@@ -1,210 +1,215 @@
|
|
|
-<template>
|
|
|
- <div class="hui-flex hui-content">
|
|
|
- <div class="hui-flex" v-if="type === 'list'">
|
|
|
- <div class="hui-content-title">
|
|
|
- <div class="hui-title-item active">合同列表</div>
|
|
|
- </div>
|
|
|
- <div class="hui-flex-box hui-flex hui-table">
|
|
|
- <list-filter type="contract" @filter="filterInit"></list-filter>
|
|
|
- <div class="hui-content-insert">
|
|
|
- <el-button type="primary" size="medium" @click="insert">新增合同</el-button>
|
|
|
- </div>
|
|
|
- <div class="hui-flex-box">
|
|
|
- <el-table :data="tableData" row-key="id" border height="100%">
|
|
|
- <el-table-column label="序号" width="50">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="text-align: center;">{{scope.$index + 1}}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="合同类型" prop="type" width="110">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{$field.findTypeName('contractType',scope.row.type)}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="位置" prop="projectItemTargetRoomIds">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="hui-ellipsis">
|
|
|
- <span v-for="(item,index) in scope.row.roomMap">
|
|
|
- {{item}}、
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="客商" prop="name">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{scope.row.tenantType === 1 ? scope.row.merchantName: scope.row.clientName}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="合同编码" prop="code"></el-table-column>
|
|
|
- <el-table-column label="开始日" prop="startDate" width="110"></el-table-column>
|
|
|
- <el-table-column label="结束日" prop="endDate" width="110"></el-table-column>
|
|
|
- <el-table-column label="联系人" prop="tenantContactPerson" width="100"></el-table-column>
|
|
|
- <el-table-column label="跟进人" prop="operatorName" width="100"></el-table-column>
|
|
|
- <el-table-column label="状态" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="hui-table-operation" v-if="!scope.row.status">
|
|
|
- <span class="table-operation" @click="sendItem(scope.row)">
|
|
|
- 发送租客
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div class="hui-table-tag" v-else>
|
|
|
- <div class="hui-tag hui-tag-info" v-if="scope.row.status === 1">待客户确认</div>
|
|
|
- <div class="hui-tag hui-tag-success" v-else-if="scope.row.status === 2">已生效</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="hui-table-operation">
|
|
|
- <span class="table-operation" @click="detailItem(scope.row)">
|
|
|
- 详情
|
|
|
- </span>
|
|
|
- <span class="table-operation" v-if="scope.row.status != 2"
|
|
|
- @click="updateItem(scope.row)">
|
|
|
- 编辑
|
|
|
- </span>
|
|
|
- <span class="table-operation" v-if="scope.row.status != 2"
|
|
|
- @click="deleteItem(scope.row)">
|
|
|
- 删除
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <template slot="empty">
|
|
|
- <empty description="暂无数据"></empty>
|
|
|
- </template>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <div class="hui-content-pagination">
|
|
|
- <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
|
|
|
- @current-change="currentChange">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="hui-flex" v-else>
|
|
|
- <div class="hui-nav">
|
|
|
- <el-page-header @back="type = 'list'" :content="type === 'edit'?'新建合同':'合同详情'"></el-page-header>
|
|
|
- </div>
|
|
|
- <edit v-if="type === 'edit'" class="hui-flex-box" @callback="callback" :detailId="detail.id"></edit>
|
|
|
- <detail v-else class="hui-flex-box" @callback="callback" :detailId="detail.id"></detail>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- import edit from '@/components/work/contract/list/edit'
|
|
|
- import detail from '@/components/work/contract/list/detail'
|
|
|
- import listFilter from '@/components/common/listFilter'
|
|
|
- import {
|
|
|
- getContractListByPage,
|
|
|
- deleteContractById,
|
|
|
- updateContract
|
|
|
- } from '@/httpApi/contract'
|
|
|
- import {
|
|
|
- isPassRequestUseSeal
|
|
|
- } from '@/httpApi/organization'
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- type: 'list',
|
|
|
- tableData: [],
|
|
|
- currPage: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalCount: 0,
|
|
|
- detail: {},
|
|
|
- filterOption: {}
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.init();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- init() {
|
|
|
- //合同状态,0-初始状态、1.已发送租客、2.已确认生成合同、3.已续费、4.即将过期、5.已过期、6.已退租。
|
|
|
- let postData = {
|
|
|
- currPage: this.currPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- organizationId: this.$store.getters.organization.id,
|
|
|
- projectId: this.$store.getters.project.id
|
|
|
- }
|
|
|
- postData = Object.assign(postData, this.filterOption);
|
|
|
- getContractListByPage(postData).then(res => {
|
|
|
- if (res.state) {
|
|
|
- this.tableData = res.data.dataList;
|
|
|
- this.totalCount = res.data.totalCount;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- filterInit(option) {
|
|
|
- this.filterOption = option;
|
|
|
- this.currPage = 1;
|
|
|
- this.init();
|
|
|
- },
|
|
|
- insert() {
|
|
|
- this.detail = {};
|
|
|
- this.type = 'edit';
|
|
|
- },
|
|
|
- currentChange(currPage) {
|
|
|
- this.currPage = currPage;
|
|
|
- this.init();
|
|
|
- },
|
|
|
- detailItem(item) {
|
|
|
- this.detail = item;
|
|
|
- this.type = 'detail';
|
|
|
- },
|
|
|
- updateItem(item) {
|
|
|
- this.detail = item;
|
|
|
- this.type = 'edit';
|
|
|
- },
|
|
|
- sendItem(item) {
|
|
|
- let document = JSON.parse(item.document);
|
|
|
- isPassRequestUseSeal(document.map(node => node.id).join(',')).then(res => {
|
|
|
- if (res.state) {
|
|
|
- if (!res.data.hasSeal) return this.$message.warning('您暂未添加公章,请设置后发送给租客');
|
|
|
- if (!res.data.passSeal) return this.$message.warning('您申请的公章暂未审核通过,请审核通过后发送给租客');
|
|
|
- this.$confirm('确定要发送合同给租客?', () => {
|
|
|
- updateContract({
|
|
|
- id: item.id,
|
|
|
- status: 1
|
|
|
- }).then(res => {
|
|
|
- if (res.state) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功'
|
|
|
- })
|
|
|
- this.init();
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- deleteItem(item) {
|
|
|
- this.$confirm('确定要删除该合同?', () => {
|
|
|
- deleteContractById(item.id).then(res => {
|
|
|
- if (res.state) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功'
|
|
|
- })
|
|
|
- this.init();
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- callback(type) {
|
|
|
- if (type === 'init') this.init();
|
|
|
- this.type = 'list';
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- edit,
|
|
|
- detail,
|
|
|
- listFilter
|
|
|
- },
|
|
|
- }
|
|
|
-</script>
|
|
|
-
|
|
|
-<style>
|
|
|
+<template>
|
|
|
+ <div class="hui-flex hui-content">
|
|
|
+ <div class="hui-flex" v-if="type === 'list'">
|
|
|
+ <div class="hui-content-title">
|
|
|
+ <div class="hui-title-item active">合同列表</div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box hui-flex hui-table">
|
|
|
+ <list-filter type="contract" @filter="filterInit"></list-filter>
|
|
|
+ <div class="hui-content-insert">
|
|
|
+ <el-button type="primary" size="medium" @click="insert">新增合同</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box">
|
|
|
+ <el-table :data="tableData" row-key="id" border height="100%">
|
|
|
+ <el-table-column label="序号" width="50">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div style="text-align: center;">{{scope.$index + 1}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="合同类型" prop="type" width="110">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{$field.findTypeName('contractType',scope.row.type)}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="位置" prop="projectItemTargetRoomIds">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-ellipsis">
|
|
|
+ <span v-for="(item,index) in scope.row.roomMap">
|
|
|
+ {{item}}、
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="客商" prop="name">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.tenantType === 1 ? scope.row.merchantName: scope.row.clientName}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="合同编码" prop="code"></el-table-column>
|
|
|
+ <el-table-column label="开始日" prop="startDate" width="110"></el-table-column>
|
|
|
+ <el-table-column label="结束日" prop="endDate" width="110"></el-table-column>
|
|
|
+ <el-table-column label="联系人" prop="tenantContactPerson" width="100"></el-table-column>
|
|
|
+ <el-table-column label="跟进人" prop="operatorName" width="100"></el-table-column>
|
|
|
+ <el-table-column label="状态" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-table-operation" v-if="!scope.row.status">
|
|
|
+ <span class="table-operation" @click="sendItem(scope.row)">
|
|
|
+ 发送租客
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="hui-table-tag" v-else>
|
|
|
+ <div class="hui-tag hui-tag-info" v-if="scope.row.status === 1">待客户确认</div>
|
|
|
+ <div class="hui-tag hui-tag-success" v-else-if="scope.row.status === 2">已生效</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-table-operation">
|
|
|
+ <span class="table-operation" @click="detailItem(scope.row)">
|
|
|
+ 详情
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-if="scope.row.status != 2"
|
|
|
+ @click="updateItem(scope.row)">
|
|
|
+ 编辑
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-if="scope.row.status != 2"
|
|
|
+ @click="deleteItem(scope.row)">
|
|
|
+ 删除
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <empty description="暂无数据"></empty>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="hui-content-pagination">
|
|
|
+ <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
|
|
|
+ @current-change="currentChange">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex" v-else>
|
|
|
+ <div class="hui-nav">
|
|
|
+ <el-page-header @back="type = 'list'" :content="type === 'edit'?'新建合同':'合同详情'"></el-page-header>
|
|
|
+ </div>
|
|
|
+ <edit v-if="type === 'edit'" class="hui-flex-box" @callback="callback" :detailId="detail.id"></edit>
|
|
|
+ <detail v-else class="hui-flex-box" @callback="callback" :detailId="detail.id"></detail>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import edit from '@/components/work/contract/list/edit'
|
|
|
+ import detail from '@/components/work/contract/list/detail'
|
|
|
+ import listFilter from '@/components/common/listFilter'
|
|
|
+ import {
|
|
|
+ getContractListByPage,
|
|
|
+ deleteContractById,
|
|
|
+ updateContract
|
|
|
+ } from '@/httpApi/contract'
|
|
|
+ import {
|
|
|
+ isPassRequestUseSeal
|
|
|
+ } from '@/httpApi/organization'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ type: 'list',
|
|
|
+ tableData: [],
|
|
|
+ currPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalCount: 0,
|
|
|
+ detail: {},
|
|
|
+ filterOption: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ //合同状态,0-初始状态、1.已发送租客、2.已确认生成合同、3.已续费、4.即将过期、5.已过期、6.已退租。
|
|
|
+ let postData = {
|
|
|
+ currPage: this.currPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
+ projectId: this.$store.getters.project.id
|
|
|
+ }
|
|
|
+ postData = Object.assign(postData, this.filterOption);
|
|
|
+ getContractListByPage(postData).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.tableData = res.data.dataList;
|
|
|
+ this.totalCount = res.data.totalCount;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ filterInit(option) {
|
|
|
+ this.filterOption = option;
|
|
|
+ if (option.select === '1') {
|
|
|
+ this.filterOption['merchantName'] = option.value;
|
|
|
+ } else if (option.select === '2') {
|
|
|
+ this.filterOption['clientName'] = option.value;
|
|
|
+ }
|
|
|
+ this.currPage = 1;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ insert() {
|
|
|
+ this.detail = {};
|
|
|
+ this.type = 'edit';
|
|
|
+ },
|
|
|
+ currentChange(currPage) {
|
|
|
+ this.currPage = currPage;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ detailItem(item) {
|
|
|
+ this.detail = item;
|
|
|
+ this.type = 'detail';
|
|
|
+ },
|
|
|
+ updateItem(item) {
|
|
|
+ this.detail = item;
|
|
|
+ this.type = 'edit';
|
|
|
+ },
|
|
|
+ sendItem(item) {
|
|
|
+ let document = JSON.parse(item.document);
|
|
|
+ isPassRequestUseSeal(document.map(node => node.id).join(',')).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ if (!res.data.hasSeal) return this.$message.warning('您暂未添加公章,请设置后发送给租客');
|
|
|
+ if (!res.data.passSeal) return this.$message.warning('您申请的公章暂未审核通过,请审核通过后发送给租客');
|
|
|
+ this.$confirm('确定要发送合同给租客?', () => {
|
|
|
+ updateContract({
|
|
|
+ id: item.id,
|
|
|
+ status: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteItem(item) {
|
|
|
+ this.$confirm('确定要删除该合同?', () => {
|
|
|
+ deleteContractById(item.id).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ callback(type) {
|
|
|
+ if (type === 'init') this.init();
|
|
|
+ this.type = 'list';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ edit,
|
|
|
+ detail,
|
|
|
+ listFilter
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
</style>
|