|
@@ -1,4 +1,4 @@
|
|
|
-<template>
|
|
|
|
|
|
|
+<template>
|
|
|
<div class="page">
|
|
<div class="page">
|
|
|
<el-form :inline="true" v-if="searchVisible" class="query-form m-b-10" ref="searchForm" :model="searchForm"
|
|
<el-form :inline="true" v-if="searchVisible" class="query-form m-b-10" ref="searchForm" :model="searchForm"
|
|
|
@keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
@keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
@@ -28,7 +28,8 @@
|
|
|
<template #buttons>
|
|
<template #buttons>
|
|
|
<el-button v-if="hasPermission('psi:creditCustomer:add')" type="primary" icon="el-icon-plus"
|
|
<el-button v-if="hasPermission('psi:creditCustomer:add')" type="primary" icon="el-icon-plus"
|
|
|
@click="add()">新建</el-button>
|
|
@click="add()">新建</el-button>
|
|
|
- <el-button v-if="hasPermission('psi:creditCustomer:del')" type="danger" icon="el-icon-delete" @click="del()"
|
|
|
|
|
|
|
+ <el-button v-if="hasPermission('psi:creditCustomer:del')" type="danger" icon="el-icon-delete"
|
|
|
|
|
+ @click="del()"
|
|
|
:disabled="$refs.creditCustomerTable && $refs.creditCustomerTable.getCheckboxRecords().length === 0"
|
|
:disabled="$refs.creditCustomerTable && $refs.creditCustomerTable.getCheckboxRecords().length === 0"
|
|
|
plain>删除</el-button>
|
|
plain>删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -38,9 +39,9 @@
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-toolbar>
|
|
</vxe-toolbar>
|
|
|
<div style="height: calc(100% - 90px)">
|
|
<div style="height: calc(100% - 90px)">
|
|
|
- <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" ref="creditCustomerTable"
|
|
|
|
|
- show-header-overflow show-overflow highlight-hover-row :menu-config="{}" :data="dataList"
|
|
|
|
|
- :checkbox-config="{}">
|
|
|
|
|
|
|
+ <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading"
|
|
|
|
|
+ ref="creditCustomerTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
|
|
|
|
|
+ :data="dataList" :checkbox-config="{}">
|
|
|
<vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
<vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
<vxe-column type="checkbox" width="60"></vxe-column>
|
|
<vxe-column type="checkbox" width="60"></vxe-column>
|
|
|
<vxe-column min-width="130" align="center" title="姓名" field="customerName">
|
|
<vxe-column min-width="130" align="center" title="姓名" field="customerName">
|
|
@@ -54,7 +55,8 @@
|
|
|
<vxe-column min-width="180" align="center" title="公司名称" field="companyName"></vxe-column>
|
|
<vxe-column min-width="180" align="center" title="公司名称" field="companyName"></vxe-column>
|
|
|
<vxe-column width="110" align="center" title="挂账状态" field="creditStatus">
|
|
<vxe-column width="110" align="center" title="挂账状态" field="creditStatus">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-tag :type="getStatusTagType(scope.row.creditStatus)">{{ getStatusText(scope.row.creditStatus) }}</el-tag>
|
|
|
|
|
|
|
+ <el-tag :type="getStatusTagType(scope.row.creditStatus)">{{
|
|
|
|
|
+ getStatusText(scope.row.creditStatus) }}</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column width="130" align="right" title="累计欠款金额" field="totalArrearsAmount">
|
|
<vxe-column width="130" align="right" title="累计欠款金额" field="totalArrearsAmount">
|
|
@@ -63,18 +65,30 @@
|
|
|
<vxe-column width="120" align="center" title="未结账单数" field="unsettledBillCount"></vxe-column>
|
|
<vxe-column width="120" align="center" title="未结账单数" field="unsettledBillCount"></vxe-column>
|
|
|
<vxe-column min-width="170" align="center" title="首次挂账时间" field="firstCreditTime"></vxe-column>
|
|
<vxe-column min-width="170" align="center" title="首次挂账时间" field="firstCreditTime"></vxe-column>
|
|
|
<vxe-column min-width="170" align="center" title="最后消费时间" field="lastConsumeTime"></vxe-column>
|
|
<vxe-column min-width="170" align="center" title="最后消费时间" field="lastConsumeTime"></vxe-column>
|
|
|
|
|
+ <vxe-column min-width="170" align="center" title="审核状态" field="status">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button effect="dark"
|
|
|
|
|
+ :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '')">
|
|
|
|
|
+ {{ $dictUtils.getDictLabel('cw_status', scope.row.status, '未发起') }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </vxe-column>
|
|
|
<vxe-column min-width="120" align="center" title="录入人" field="createName"></vxe-column>
|
|
<vxe-column min-width="120" align="center" title="录入人" field="createName"></vxe-column>
|
|
|
<vxe-column min-width="120" align="center" title="审核人" field="auditorName"></vxe-column>
|
|
<vxe-column min-width="120" align="center" title="审核人" field="auditorName"></vxe-column>
|
|
|
<vxe-column title="操作" width="250px" fixed="right" align="center">
|
|
<vxe-column title="操作" width="250px" fixed="right" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-button v-if="hasPermission('psi:creditCustomer:edit')" text type="primary" size="small"
|
|
<el-button v-if="hasPermission('psi:creditCustomer:edit')" text type="primary" size="small"
|
|
|
@click="edit(scope.row.id)">修改</el-button>
|
|
@click="edit(scope.row.id)">修改</el-button>
|
|
|
- <el-dropdown v-if="hasPermission('psi:creditCustomer:edit')" trigger="click" @command="handleStatusCommand(scope.row, $event)">
|
|
|
|
|
- <el-button text type="primary" size="small">状态<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
|
|
|
|
|
|
+ <el-dropdown v-if="hasPermission('psi:creditCustomer:edit')" trigger="click"
|
|
|
|
|
+ @command="handleStatusCommand(scope.row, $event)">
|
|
|
|
|
+ <el-button text type="primary" size="small">状态<i
|
|
|
|
|
+ class="el-icon-arrow-down el-icon--right"></i></el-button>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item v-for="item in $dictUtils.getDictList('credit_status')" :key="item.value"
|
|
|
|
|
- :command="item.value" :disabled="scope.row.creditStatus === item.value">{{ item.label }}</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item v-for="item in $dictUtils.getDictList('credit_status')"
|
|
|
|
|
+ :key="item.value" :command="item.value"
|
|
|
|
|
+ :disabled="scope.row.creditStatus === item.value">{{ item.label
|
|
|
|
|
+ }}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
@@ -97,6 +111,12 @@
|
|
|
<script>
|
|
<script>
|
|
|
import CreditCustomerService from '@/api/psi/CreditCustomerService'
|
|
import CreditCustomerService from '@/api/psi/CreditCustomerService'
|
|
|
import CreditCustomerForm from './CreditCustomerForm'
|
|
import CreditCustomerForm from './CreditCustomerForm'
|
|
|
|
|
+import taskService from '@/api/flowable/taskService'
|
|
|
|
|
+import processService from '@/api/flowable/processService'
|
|
|
|
|
+import pick from 'lodash.pick'
|
|
|
|
|
+
|
|
|
|
|
+const CREDIT_CUSTOMER_PROCESS_NAME = '景聚庭-新增挂账人'
|
|
|
|
|
+const CREDIT_CUSTOMER_FORM_URL = '/psiManagement/dishManage/creditCustomer/CreditCustomerApproval'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -114,7 +134,9 @@ export default {
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
orders: []
|
|
orders: []
|
|
|
},
|
|
},
|
|
|
- loading: false
|
|
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ processDefinitionAuditId: '',
|
|
|
|
|
+ procDefAuditKey: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
creditCustomerService: null,
|
|
creditCustomerService: null,
|
|
@@ -124,6 +146,11 @@ export default {
|
|
|
components: {
|
|
components: {
|
|
|
CreditCustomerForm
|
|
CreditCustomerForm
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ userName() {
|
|
|
|
|
+ return this.$store.state.user.name
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.refreshList()
|
|
this.refreshList()
|
|
|
},
|
|
},
|
|
@@ -132,7 +159,35 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
add() {
|
|
add() {
|
|
|
- this.$refs.creditCustomerForm.init('add', '')
|
|
|
|
|
|
|
+ this.loadProcessDefinition().then(() => {
|
|
|
|
|
+ if (this.commonJS.isEmpty(this.processDefinitionAuditId)) {
|
|
|
|
|
+ this.$message.error(`未找到流程【${CREDIT_CUSTOMER_PROCESS_NAME}】,请先配置流程`)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const tabTitle = `发起流程【${CREDIT_CUSTOMER_PROCESS_NAME}】`
|
|
|
|
|
+ const processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[${CREDIT_CUSTOMER_PROCESS_NAME}]`
|
|
|
|
|
+ taskService.getTaskDef({
|
|
|
|
|
+ procDefId: this.processDefinitionAuditId,
|
|
|
|
|
+ status: 'startAndClose'
|
|
|
|
|
+ }).then((data) => {
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
|
|
|
|
|
+ procDefId: this.processDefinitionAuditId,
|
|
|
|
|
+ procDefKey: this.procDefAuditKey,
|
|
|
|
|
+ status: 'startAndClose',
|
|
|
|
|
+ title: tabTitle,
|
|
|
|
|
+ formType: '2',
|
|
|
|
|
+ formUrl: CREDIT_CUSTOMER_FORM_URL,
|
|
|
|
|
+ formTitle: processTitle,
|
|
|
|
|
+ businessId: 'false',
|
|
|
|
|
+ isShow: false,
|
|
|
|
|
+ routePath: this.$route.path
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
edit(id) {
|
|
edit(id) {
|
|
|
this.$refs.creditCustomerForm.init('edit', id)
|
|
this.$refs.creditCustomerForm.init('edit', id)
|
|
@@ -141,6 +196,7 @@ export default {
|
|
|
this.$refs.creditCustomerForm.init('view', id)
|
|
this.$refs.creditCustomerForm.init('view', id)
|
|
|
},
|
|
},
|
|
|
refreshList() {
|
|
refreshList() {
|
|
|
|
|
+ this.loadProcessDefinition()
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
this.creditCustomerService.list({
|
|
this.creditCustomerService.list({
|
|
|
'current': this.tablePage.currentPage,
|
|
'current': this.tablePage.currentPage,
|
|
@@ -155,6 +211,14 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ loadProcessDefinition() {
|
|
|
|
|
+ return processService.getByName(CREDIT_CUSTOMER_PROCESS_NAME).then((data) => {
|
|
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
|
|
+ this.processDefinitionAuditId = data.id
|
|
|
|
|
+ this.procDefAuditKey = data.key
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
currentChangeHandle({ currentPage, pageSize }) {
|
|
currentChangeHandle({ currentPage, pageSize }) {
|
|
|
this.tablePage.currentPage = currentPage
|
|
this.tablePage.currentPage = currentPage
|
|
|
this.tablePage.pageSize = pageSize
|
|
this.tablePage.pageSize = pageSize
|