<template>
|
<div>
|
<c-r-m-list-head
|
ref="listHead"
|
title="合同处理列表"
|
main-title="商务管理"/>
|
<c-r-m-table-head
|
ref="crmTableHead"
|
:crm-type="crmType"
|
:fieldList='fieldList'
|
@filter="handleFilter"
|
@handle="handleHandle"
|
@on-handle="listHeadHandle"
|
@scene="handleScene"
|
@queryList='queryList'/>
|
<el-card class="el-card">
|
<el-table
|
v-loading="loading"
|
id="crm-table"
|
:data="list"
|
:height="tableHeight"
|
:cell-style="cellStyle"
|
class="n-table--border"
|
border
|
highlight-current-row
|
style="width: 100%"
|
@row-click="handleRowClick"
|
@sort-change="sortChange"
|
@header-dragend="handleHeaderDragend"
|
@selection-change="handleSelectionChange">
|
<!--<el-table-column
|
show-overflow-tooltip
|
type="selection"
|
align="left"
|
width="55"/>-->
|
<el-table-column
|
v-for="(item, index) in fieldList"
|
:key="index"
|
:prop="item.field"
|
:label="item.value"
|
:width="item.width"
|
:formatter="fieldFormatter"
|
sortable="custom"
|
show-overflow-tooltip>
|
<template
|
slot="header"
|
slot-scope="scope">
|
<div class="table-head-name">
|
{{ scope.column.label }}
|
<c-r-m-table-filter
|
:show="scope.column.label==='合同类型'"
|
:tableType="scope.column.label"
|
@queryList="queryList">
|
</c-r-m-table-filter>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column prop="BeforeSealFile" label="盖章前合同">
|
<template
|
slot="header"
|
slot-scope="scope">
|
<div class="table-head-name">{{ scope.column.label }}</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{scope.row.BeforeSealFile===''?'--':'点击下载'}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="SealFile" label="盖章后合同">
|
<template
|
slot="header"
|
slot-scope="scope">
|
<div class="table-head-name">{{ scope.column.label }}</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{scope.row.SealFile===''?'--':'点击下载'}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="operation"
|
width="150">
|
<template
|
slot="header"
|
slot-scope="scope">
|
<div class="table-head-name">操作</div>
|
</template>
|
<template slot-scope="scope">
|
<el-button type="text" size="small" @click='editList(scope.row)'>上传盖章合同</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="p-contianer" v-show='total>0'>
|
<el-pagination
|
:current-page="currentPage"
|
:page-sizes="pageSizes"
|
:page-size.sync="pageSize"
|
:total="total"
|
class="p-bar"
|
layout="total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"/>
|
</div>
|
</el-card>
|
<el-dialog title="上传盖章合同" :visible.sync="isCreate" :modal-append-to-body="false" width="30%">
|
<c-r-m-create-file-view
|
v-if="isCreate"
|
:id="rowID"
|
:action="createActionInfo"
|
crm-type="sealContract"
|
@save-success="createSaveSuccess"
|
@hiden-view="isCreate=false"/>
|
</el-dialog>
|
<!-- 相关详情页面 -->
|
<c-r-m-all-detail
|
:visible.sync="showDview"
|
:crm-type="rowType"
|
:id="rowID"
|
class="d-view"
|
@handle="handleHandle"/>
|
<fields-set
|
:crm-type="crmType"
|
:dialog-visible.sync="showFieldSet"
|
@set-success="setSave"/>
|
</div>
|
</template>
|
|
<script>
|
import CRMAllDetail from '@/views/clients/components/CRMAllDetail'
|
import table from '../mixins/table'
|
import CRMTableFilter from '../components/CRMTableFilter'
|
import CRMCreateFileView from '@/views/clients/components/CRMCreateFileView'
|
import { DeleteAgreenment } from '@/api/customermanagement/contract'
|
|
export default {
|
/** 客户管理 的 合同列表 */
|
name: 'BusinessContractsIndex',
|
components: {
|
CRMAllDetail,
|
CRMTableFilter,
|
CRMCreateFileView
|
},
|
mixins: [table],
|
data () {
|
return {
|
crmType: 'businessContract',
|
isCreate: false,
|
// 创建的相关信息
|
createActionInfo: { type: 'update', crmType: this.crmType, data: {} },
|
fieldList: [],
|
moneyData: null // 合同列表金额
|
}
|
},
|
computed: {
|
moneyPageData () {
|
// 未勾选展示合同总金额信息
|
if (this.selectionList.length === 0 && this.moneyData) {
|
return this.moneyData
|
} else {
|
let contractMoney = 0.0
|
let receivedMoney = 0.0
|
for (let index = 0; index < this.selectionList.length; index++) {
|
const element = this.selectionList[index]
|
// 2 审核通过的合同
|
if (element.checkStatus === 1) {
|
contractMoney += parseFloat(element.money)
|
receivedMoney += parseFloat(element.receivedMoney)
|
}
|
}
|
return {
|
contractMoney: contractMoney.toFixed(2),
|
receivedMoney: receivedMoney.toFixed(2)
|
}
|
}
|
}
|
},
|
mounted () {
|
this.getFieldList()
|
},
|
methods: {
|
getFieldList () {
|
this.fieldList.push(
|
{ field: 'AgreeNumber', value: '合同编号' },
|
{ field: 'AgreeName', value: '合同名称' },
|
{ field: 'Comment', value: '合同备注' },
|
{ field: 'CustomerName', value: '客户名称' },
|
{ field: 'SalesChanceName', value: '商机名称' },
|
{ field: 'AuditStatus', value: '是否审核', width: '100' },
|
{ field: 'AuditUserName', value: '审核人' },
|
{ field: 'SealTypeString', value: '合同类型' },
|
{ field: 'IsSeal', value: '是否盖章', width: '100' },
|
{ field: 'SealUserName', value: '盖章上传人' },
|
{ field: 'CreateTime', value: '创建时间' },
|
{ field: 'ExpressNumber', value: '快递单号' },
|
{ field: 'ExpressComment', value: '快递备注信息' }
|
// { field: 'BeforeSealFile', value: '盖章前合同' },
|
// { field: 'SealFile', value: '盖章后合同' }
|
)
|
},
|
queryList (data) {
|
this.getList(data)
|
},
|
/** 编辑 */
|
editList (row) {
|
console.log(row)
|
this.createActionInfo.data = row
|
this.isCreate = true
|
},
|
deleteModule (id) {
|
this.$confirm('确定删除?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
})
|
.then(() => {
|
DeleteAgreenment([{'Id': id}]).then(res => {
|
if (res.data.ErrorCode === 200) {
|
this.$message.success(res.data.Message)
|
this.getList()
|
} else {
|
this.$message.error(res.data.Message)
|
}
|
})
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
})
|
})
|
},
|
createSaveSuccess () {
|
this.getList()
|
this.isCreate = false
|
},
|
/** 通过回调控制style */
|
cellStyle ({ row, column, rowIndex, columnIndex }) {
|
if (column.property === 'BeforeSealFile' || column.property === 'SealFile' || column.property === 'SalesChanceName' ||
|
column.property === 'CustomerName') {
|
return { color: '#4D88FF', cursor: 'pointer' }
|
} else if (column.property === 'AuditStatus') {
|
if (row[column.property] === '审批中') {
|
return { color: '#FF8800' }
|
} else if (row[column.property] === '通过') {
|
return { color: '#2DB300' }
|
} else if (row[column.property] === '驳回') {
|
return { color: '#FF4D4D' }
|
}
|
} else {
|
return { textAlign: 'left' }
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '../styles/table.scss';
|
.money-bar {
|
color: #99a9bf;
|
line-height: 44px !important;
|
position: absolute;
|
left: 20px;
|
top: 0;
|
}
|
</style>
|