|
@@ -31,6 +31,14 @@
|
|
<el-table-column label="开始日" prop="startDate"></el-table-column>
|
|
<el-table-column label="开始日" prop="startDate"></el-table-column>
|
|
<el-table-column label="结束日" prop="endDate"></el-table-column>
|
|
<el-table-column label="结束日" prop="endDate"></el-table-column>
|
|
<el-table-column label="运营跟进人" prop="operatorName"></el-table-column>
|
|
<el-table-column label="运营跟进人" prop="operatorName"></el-table-column>
|
|
|
|
+ <el-table-column label="状态" width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="hui-table-tag">
|
|
|
|
+ <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">
|
|
<el-table-column label="操作" width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="hui-table-operation">
|
|
<div class="hui-table-operation">
|
|
@@ -55,9 +63,15 @@
|
|
<div class="hui-flex" v-else>
|
|
<div class="hui-flex" v-else>
|
|
<div class="hui-nav">
|
|
<div class="hui-nav">
|
|
<el-page-header @back="type = 'list'" :content="type === 'edit'?'新建合同':'合同详情'"></el-page-header>
|
|
<el-page-header @back="type = 'list'" :content="type === 'edit'?'新建合同':'合同详情'"></el-page-header>
|
|
|
|
+ <div class="nav-button">
|
|
|
|
+ <el-button type="primary" size="medium" @click="sureConcart"
|
|
|
|
+ v-if="type == 'detail' && detail.status === 1">
|
|
|
|
+ 确认合同
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <edit v-if="type === 'edit'" class="hui-flex-box" @callback="callback" :detailId="detailId"></edit>
|
|
|
|
- <detail v-else class="hui-flex-box" @callback="callback" :detailId="detailId"></detail>
|
|
|
|
|
|
+ <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>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -68,7 +82,10 @@
|
|
import listFilter from '@/components/common/listFilter'
|
|
import listFilter from '@/components/common/listFilter'
|
|
import {
|
|
import {
|
|
getContractListByPage,
|
|
getContractListByPage,
|
|
- deleteContractById
|
|
|
|
|
|
+ deleteContractById,
|
|
|
|
+ updateContract,
|
|
|
|
+ archivedDocument,
|
|
|
|
+ paymentGenerate
|
|
} from '@/httpApi/contract'
|
|
} from '@/httpApi/contract'
|
|
import {
|
|
import {
|
|
bindProjectDetail
|
|
bindProjectDetail
|
|
@@ -82,14 +99,15 @@
|
|
currPage: 1,
|
|
currPage: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
totalCount: 0,
|
|
totalCount: 0,
|
|
- detailId: '',
|
|
|
|
filterOption: {},
|
|
filterOption: {},
|
|
- merchantId: ''
|
|
|
|
|
|
+ merchantId: '',
|
|
|
|
+ detail: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
bindProjectDetail({
|
|
bindProjectDetail({
|
|
- bindOrganizationId: this.$store.getters.organization.id
|
|
|
|
|
|
+ bindOrganizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.state) {
|
|
if (res.state) {
|
|
if (res.data.length == 0) return;
|
|
if (res.data.length == 0) return;
|
|
@@ -104,7 +122,8 @@
|
|
currPage: this.currPage,
|
|
currPage: this.currPage,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
merchantId: this.merchantId,
|
|
merchantId: this.merchantId,
|
|
- projectId: this.$store.getters.project.id
|
|
|
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
|
+ statusList: [1, 2, 3, 4, 5]
|
|
}
|
|
}
|
|
postData = Object.assign(postData, this.filterOption);
|
|
postData = Object.assign(postData, this.filterOption);
|
|
getContractListByPage(postData).then(res => {
|
|
getContractListByPage(postData).then(res => {
|
|
@@ -120,7 +139,7 @@
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
insert() {
|
|
insert() {
|
|
- this.detailId = '';
|
|
|
|
|
|
+ this.detail = {};
|
|
this.type = 'edit';
|
|
this.type = 'edit';
|
|
},
|
|
},
|
|
currentChange(currPage) {
|
|
currentChange(currPage) {
|
|
@@ -128,9 +147,51 @@
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
detailItem(item) {
|
|
detailItem(item) {
|
|
- this.detailId = item.id;
|
|
|
|
|
|
+ this.detail = item;
|
|
this.type = 'detail';
|
|
this.type = 'detail';
|
|
},
|
|
},
|
|
|
|
+ sureConcart() {
|
|
|
|
+ this.$confirm('是否确定合同无误,确定后账单将自动生成?', () => {
|
|
|
|
+ this.$loading.open();
|
|
|
|
+ let documentList = this.detail.document ? JSON.parse(this.detail.document) : [];
|
|
|
|
+ let promise = [];
|
|
|
|
+ for (let i = 0; i < documentList.length; i++) {
|
|
|
|
+ promise.push(new Promise((resolve, reject) => {
|
|
|
|
+ archivedDocument(documentList[i].id, this.$store.getters
|
|
|
|
+ .project.name).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ resolve(true)
|
|
|
|
+ } else {
|
|
|
|
+ reject(false)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
|
|
+ promise.push(new Promise((resolve, reject) => {
|
|
|
|
+ paymentGenerate(this.detail.id).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ resolve(true)
|
|
|
|
+ } else {
|
|
|
|
+ reject(false)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }))
|
|
|
|
+ Promise.all(promise).then(res => {
|
|
|
|
+ this.$loading.close();
|
|
|
|
+ updateContract({
|
|
|
|
+ id: this.detail.id,
|
|
|
|
+ status: 2
|
|
|
|
+ })
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '操作成功'
|
|
|
|
+ })
|
|
|
|
+ this.detail['status'] = 2;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.$loading.close();
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
callback(type) {
|
|
callback(type) {
|
|
if (type === 'init') this.init();
|
|
if (type === 'init') this.init();
|
|
this.type = 'list';
|
|
this.type = 'list';
|