|
@@ -1,20 +1,23 @@
|
|
|
<!--
|
|
<!--
|
|
|
- * @Author: liuzl liuzl0802
|
|
|
|
|
|
|
+ * @Author: liuzl 461480418@qq.com
|
|
|
* @Date: 2023-01-09 13:54:40
|
|
* @Date: 2023-01-09 13:54:40
|
|
|
* @LastEditors: liuzhenlin
|
|
* @LastEditors: liuzhenlin
|
|
|
- * @LastEditTime: 2023-01-09 15:28:38
|
|
|
|
|
|
|
+ * @LastEditTime: 2023-01-10 14:39:40
|
|
|
* @Description: file content
|
|
* @Description: file content
|
|
|
* @FilePath: \订单全流程管理系统\src\views\contract\components\DetailsCollection.vue
|
|
* @FilePath: \订单全流程管理系统\src\views\contract\components\DetailsCollection.vue
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
<div class="collection-container">
|
|
<div class="collection-container">
|
|
|
|
|
+ <!-- 回款计划 -->
|
|
|
<div class="collection-plan mb10">
|
|
<div class="collection-plan mb10">
|
|
|
<el-row class="mb10">
|
|
<el-row class="mb10">
|
|
|
<el-col class="text-right" :span="24">
|
|
<el-col class="text-right" :span="24">
|
|
|
- <el-button icon="el-icon-plus" size="mini" type="primary">新建回款计划</el-button>
|
|
|
|
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="$refs.collectionPlan.init()">
|
|
|
|
|
+ 新建回款计划
|
|
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-table border :data="collectionPlanData" height="calc(100% - 40px)">
|
|
|
|
|
|
|
+ <el-table border :data="collectionPlanData" height="calc(100% - 50px)">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-for="(item, index) in planColumns"
|
|
v-for="(item, index) in planColumns"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -24,21 +27,37 @@
|
|
|
:prop="item.prop"
|
|
:prop="item.prop"
|
|
|
show-overflow-tooltip>
|
|
show-overflow-tooltip>
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <span v-if="item.label == '合计'">
|
|
|
|
|
- {{ calculatedDiscount(row.tranPrice, row.prodNum) }}
|
|
|
|
|
|
|
+ <span v-if="item.prop == 'contractStatus'">
|
|
|
|
|
+ {{ row.contractStatus == '10' ? '待回款' : row.contractStatus == '20' ? '部分回款' : '全部回款' }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'planAmount'">{{ formatPrice(row.planAmount) }}</span>
|
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ :disabled="scope.row.contractStatus == '30'"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="$refs.collection.init(scope.row.id)">
|
|
|
|
|
+ 新建回款
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button type="text" @click="$refs.collectionPlan.init(scope.row.id)">编辑</el-button>
|
|
|
|
|
+ <el-button type="text" @click="handleDel(scope.row, 'plan')">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 回款 -->
|
|
|
<div class="collection">
|
|
<div class="collection">
|
|
|
<el-row class="mb10">
|
|
<el-row class="mb10">
|
|
|
<el-col class="text-right" :span="24">
|
|
<el-col class="text-right" :span="24">
|
|
|
- <el-button icon="el-icon-plus" size="mini" type="primary">新建回款</el-button>
|
|
|
|
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="$refs.collection.init()">
|
|
|
|
|
+ 新建回款
|
|
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-table border :data="collectionData" height="calc(100% - 40px)">
|
|
|
|
|
|
|
+ <el-table border :data="collectionData" height="calc(100% - 50px)">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-for="(item, index) in collectionColumns"
|
|
v-for="(item, index) in collectionColumns"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -48,23 +67,41 @@
|
|
|
:prop="item.prop"
|
|
:prop="item.prop"
|
|
|
show-overflow-tooltip>
|
|
show-overflow-tooltip>
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <span v-if="item.label == '合计'">
|
|
|
|
|
- {{ calculatedDiscount(row.tranPrice, row.prodNum) }}
|
|
|
|
|
|
|
+ <span v-if="item.prop == 'collectionType'">
|
|
|
|
|
+ {{ collectionTypeOption.filter((item) => item.key == row.collectionType)[0].value || '-' }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'approStatus'">
|
|
|
|
|
+ {{ row.approStatus == '10' ? '未回款' : '已回款' }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'collectionAmount'">{{ formatPrice(row.collectionAmount) }}</span>
|
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 新增编辑回款计划 -->
|
|
|
|
|
+ <edit-plan ref="collectionPlan" :details="details" @collectionPlanSave="getCollectionPlaneList()" />
|
|
|
|
|
+ <!-- 新增编辑回款合同 -->
|
|
|
|
|
+ <edit-collection
|
|
|
|
|
+ ref="collection"
|
|
|
|
|
+ :collection-type-data="collectionTypeOption"
|
|
|
|
|
+ :details="details"
|
|
|
|
|
+ @collectionSave="getCollectionList()" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import collectionApi from '@/api/contract/collection'
|
|
import collectionApi from '@/api/contract/collection'
|
|
|
import collectionPlanApi from '@/api/contract/collectionPlan'
|
|
import collectionPlanApi from '@/api/contract/collectionPlan'
|
|
|
|
|
+ import EditPlan from '@/views/contract/components/EditPlan'
|
|
|
|
|
+ import EditCollection from './EditCollection'
|
|
|
import to from 'await-to-js'
|
|
import to from 'await-to-js'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'DetailsCollection',
|
|
name: 'DetailsCollection',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ EditPlan,
|
|
|
|
|
+ EditCollection,
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
details: {
|
|
details: {
|
|
|
type: Object,
|
|
type: Object,
|
|
@@ -73,92 +110,142 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- collectionData: [],
|
|
|
|
|
- collectionPlanData: [],
|
|
|
|
|
|
|
+ collectionData: [], //回款数据
|
|
|
|
|
+ collectionPlanData: [], //回款计划数据
|
|
|
planColumns: [
|
|
planColumns: [
|
|
|
{
|
|
{
|
|
|
- label: '产品名称',
|
|
|
|
|
|
|
+ label: '客户名称',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
- prop: 'prodName',
|
|
|
|
|
|
|
+ prop: 'custName',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '产品类别',
|
|
|
|
|
|
|
+ label: '合同编号',
|
|
|
width: '100px',
|
|
width: '100px',
|
|
|
- prop: 'prodClass',
|
|
|
|
|
|
|
+ prop: 'contractCode',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '建议成交价',
|
|
|
|
|
|
|
+ label: '计划回款金额',
|
|
|
width: '100px',
|
|
width: '100px',
|
|
|
- prop: 'sugSalesPrice',
|
|
|
|
|
|
|
+ prop: 'planAmount',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '售价',
|
|
|
|
|
- width: '160px',
|
|
|
|
|
- prop: 'tranPrice',
|
|
|
|
|
|
|
+ label: '回款状态',
|
|
|
|
|
+ width: '100px',
|
|
|
|
|
+ prop: 'contractStatus',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '数量',
|
|
|
|
|
- width: '160px',
|
|
|
|
|
- prop: 'prodNum',
|
|
|
|
|
|
|
+ label: '计划回款日期',
|
|
|
|
|
+ width: '100px',
|
|
|
|
|
+ prop: 'planDatetime',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '合计',
|
|
|
|
|
- width: '120px',
|
|
|
|
|
|
|
+ label: '备注',
|
|
|
|
|
+ width: '100px',
|
|
|
|
|
+ prop: 'remark',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
collectionColumns: [
|
|
collectionColumns: [
|
|
|
{
|
|
{
|
|
|
- label: '产品名称',
|
|
|
|
|
|
|
+ label: '客户名称',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
- prop: 'prodName',
|
|
|
|
|
|
|
+ prop: 'custName',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '产品类别',
|
|
|
|
|
|
|
+ label: '合同编号',
|
|
|
width: '100px',
|
|
width: '100px',
|
|
|
- prop: 'prodClass',
|
|
|
|
|
|
|
+ prop: 'contractCode',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '建议成交价',
|
|
|
|
|
|
|
+ label: '回款金额',
|
|
|
width: '100px',
|
|
width: '100px',
|
|
|
- prop: 'sugSalesPrice',
|
|
|
|
|
|
|
+ prop: 'collectionAmount',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '售价',
|
|
|
|
|
|
|
+ label: '回款方式',
|
|
|
width: '160px',
|
|
width: '160px',
|
|
|
- prop: 'tranPrice',
|
|
|
|
|
|
|
+ prop: 'collectionType',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '审核状态',
|
|
|
|
|
+ width: '80px',
|
|
|
|
|
+ prop: 'approStatus',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '数量',
|
|
|
|
|
|
|
+ label: '回款日期',
|
|
|
width: '160px',
|
|
width: '160px',
|
|
|
- prop: 'prodNum',
|
|
|
|
|
|
|
+ prop: 'collectionDatetime',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '合计',
|
|
|
|
|
- width: '120px',
|
|
|
|
|
|
|
+ label: '备注',
|
|
|
|
|
+ width: '160px',
|
|
|
|
|
+ prop: 'remark',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
|
|
+ collectionTypeOption: [], //,回款方式
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this.getCollectionData()
|
|
|
|
|
- this.getCollectionPlaneData()
|
|
|
|
|
|
|
+ this.getOptions()
|
|
|
|
|
+ this.getCollectionList()
|
|
|
|
|
+ this.getCollectionPlaneList()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getOptions() {
|
|
|
|
|
+ Promise.all([this.getDicts('collection_type')])
|
|
|
|
|
+ .then(([collectionType]) => {
|
|
|
|
|
+ this.collectionTypeOption = collectionType.data.values || []
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => console.log(err))
|
|
|
|
|
+ },
|
|
|
// 获取回款和回款计划列表
|
|
// 获取回款和回款计划列表
|
|
|
- async getCollectionData() {
|
|
|
|
|
|
|
+ async getCollectionList() {
|
|
|
let params = { contractId: this.details.id, pageNum: 0 }
|
|
let params = { contractId: this.details.id, pageNum: 0 }
|
|
|
const [err, res] = await to(collectionApi.getList(params))
|
|
const [err, res] = await to(collectionApi.getList(params))
|
|
|
if (err) return
|
|
if (err) return
|
|
|
this.collectionData = res.data.list
|
|
this.collectionData = res.data.list
|
|
|
},
|
|
},
|
|
|
- async getCollectionPlaneData() {
|
|
|
|
|
|
|
+ async getCollectionPlaneList() {
|
|
|
let params = { contractId: this.details.id, pageNum: 0 }
|
|
let params = { contractId: this.details.id, pageNum: 0 }
|
|
|
const [err, res] = await to(collectionPlanApi.getList(params))
|
|
const [err, res] = await to(collectionPlanApi.getList(params))
|
|
|
if (err) return
|
|
if (err) return
|
|
|
this.collectionPlanData = res.data.list
|
|
this.collectionPlanData = res.data.list
|
|
|
},
|
|
},
|
|
|
|
|
+ // 删除回款计划
|
|
|
|
|
+ handleDel(row, type) {
|
|
|
|
|
+ this.$confirm('确认删除?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(async () => {
|
|
|
|
|
+ // 回款计划
|
|
|
|
|
+ if (type == 'plan') {
|
|
|
|
|
+ const [err, res] = await to(collectionPlanApi.delCollectionPlan({ id: [row.id] }))
|
|
|
|
|
+ if (err) return
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除成功!',
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getCollectionPlaneList()
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 回款
|
|
|
|
|
+ const [err, res] = await to(collectionPlanApi.delCollectionPlan({ id: [row.id] }))
|
|
|
|
|
+ if (err) return
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除成功!',
|
|
|
|
|
+ })
|
|
|
|
|
+ this.queryData()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {})
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|