|
|
|
|
@ -284,21 +284,39 @@
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- (scope.row.purchase_way ? scope.row.purchase_way.remark === 'true' : false) && -->
|
|
|
|
|
<template
|
|
|
|
|
|
|
|
|
|
v-if="scope.row.invite_status === 1 && scope.row.purchase_status === 3 && !scope.row.is_substitute && (!scope.row.contract_category || scope.row.invite_status === 1)"
|
|
|
|
|
>
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="bidding(scope.row)">招标审查</Button>
|
|
|
|
|
<!-- 旧合同的招标审查 -->
|
|
|
|
|
<!-- contract_category.flow_invite -->
|
|
|
|
|
<!-- 新合同的招标审查 =1 且如果需要走采购,采购=3 -->
|
|
|
|
|
<template v-if="scope.row.contract_category">
|
|
|
|
|
<!-- 如果需要 走采购 且采购状态=3的 需要走招标flow_invite=1,就可以走招标审查 -->
|
|
|
|
|
<!-- 如果不需要走采购 只需要走招标的flow_invite=1,就可以走招标审查 -->
|
|
|
|
|
<!-- invite_status=3 代表招标审查已结束,不需要显示按钮 -->
|
|
|
|
|
<template v-if="scope.row.contract_category.flow_purchase && scope.row.purchase_status === 3 && scope.row.contract_category.flow_invite==1 && scope.row.invite_status == 1">
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="bidding(scope.row)">招标审查</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="!scope.row.contract_category.flow_purchase && scope.row.contract_category.flow_invite==1 && scope.row.invite_status == 1">
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="bidding(scope.row)">招标审查</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<template
|
|
|
|
|
v-if="scope.row.invite_status === 1 && scope.row.purchase_status === 3 && (scope.row.purchase_way ? scope.row.purchase_way.remark === 'true' : false) && !scope.row.is_substitute"
|
|
|
|
|
>
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="bidding(scope.row)">招标审查</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <Button class="slot-btns-item" type="primary" size="small">附件管理</Button>-->
|
|
|
|
|
<template v-if="scope.row.req_status === 1 && (scope.row.is_plan === 0 && !scope.row.is_substitute || scope.row.has_charge) && (!scope.row.contract_category || scope.row.req_status === 1)">
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="askProcess(scope.row)">请示流程
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!--不需要走采购流程那么直接就是会签,如果采购方式不需要招标的也是直接会签-->
|
|
|
|
|
<!-- (scope.row.purchase_way ? scope.row.purchase_way.remark === 'false' : false) -->
|
|
|
|
|
<template
|
|
|
|
|
v-if="(scope.row.has_charge && scope.row.req_status === 3 && scope.row.join_status === 1) || (scope.row.join_status === 1 && ((scope.row.invite_status === 3)||(scope.row.purchase_status === 3)) || ( scope.row.is_substitute && scope.row.join_status === 1) ) && (!scope.row.contract_category || scope.row.join_status === 1)"
|
|
|
|
|
v-if="(scope.row.has_charge && scope.row.req_status === 3 && scope.row.join_status === 1) || (scope.row.join_status === 1 && ((scope.row.invite_status === 3)||(scope.row.purchase_status === 3 && (!scope.row.contract_category || !scope.row.contract_category.flow_invite || scope.row.invite_status === 3))) || ( scope.row.is_substitute && scope.row.join_status === 1) ) && (!scope.row.contract_category || scope.row.join_status === 1)"
|
|
|
|
|
>
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="signProcess(scope.row)">合同会签
|
|
|
|
|
</Button>
|
|
|
|
|
@ -309,18 +327,19 @@
|
|
|
|
|
<Button class="slot-btns-item" size="small" type="primary" @click="buyProcess(scope.row)">采购流程
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- v-if="!(scope.row.req_status != 1 || scope.row.join_status != 1 || scope.row.invite_status != 1 || scope.row.purchase_status != 1 || scope.row.status === 2)" -->
|
|
|
|
|
|
|
|
|
|
<Poptip trigger="hover" placement="bottom" transfer>
|
|
|
|
|
<Button ghost size="small" type="primary">更多</Button>
|
|
|
|
|
<div slot="content">
|
|
|
|
|
<template
|
|
|
|
|
v-if="!(scope.row.req_status != 1 || scope.row.join_status != 1 || scope.row.invite_status != 1 || scope.row.purchase_status != 1 || scope.row.status === 2)"
|
|
|
|
|
>
|
|
|
|
|
v-if="$store.state.user.myRole.find(i => /财审科|系统管理员/g.test(i.name))"
|
|
|
|
|
>
|
|
|
|
|
<Poptip
|
|
|
|
|
:transfer="true"
|
|
|
|
|
confirm
|
|
|
|
|
placement="bottom"
|
|
|
|
|
title="确认要删除吗"
|
|
|
|
|
title="可能存在已办结的流程,确认要删除吗?"
|
|
|
|
|
@on-ok="()=>deleteContract(scope.row.id)"
|
|
|
|
|
>
|
|
|
|
|
<i-button class="slot-btns-item" ghost size="small" type="error">删除
|
|
|
|
|
@ -866,6 +885,37 @@
|
|
|
|
|
<printRegistration ref="printRegistration" />
|
|
|
|
|
<printFundApproval ref="printFundApproval" />
|
|
|
|
|
<printPaymentForm ref="printPaymentForm" />
|
|
|
|
|
|
|
|
|
|
<!-- OA流程流水号弹窗 -->
|
|
|
|
|
<Modal
|
|
|
|
|
v-model="isShowFlowDialog"
|
|
|
|
|
title="填写OA流程流水号"
|
|
|
|
|
@on-ok="submitFlowId"
|
|
|
|
|
@on-cancel="cancelFlowDialog"
|
|
|
|
|
>
|
|
|
|
|
<div style="padding: 20px 0;">
|
|
|
|
|
<div style="margin-bottom: 15px;">
|
|
|
|
|
<span style="display: inline-block; width: 100px; text-align: right; margin-right: 10px;">流水号:</span>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="flowId"
|
|
|
|
|
placeholder="请输入OA流程流水号"
|
|
|
|
|
style="width: 300px;"
|
|
|
|
|
@on-enter="submitFlowId"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 15px;">
|
|
|
|
|
<span style="display: inline-block; width: 100px; text-align: right; margin-right: 10px;">状态:</span>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="flowStatus"
|
|
|
|
|
style="width: 300px;"
|
|
|
|
|
placeholder="请选择状态"
|
|
|
|
|
>
|
|
|
|
|
<Option :value="0">流转中</Option>
|
|
|
|
|
<Option :value="1">已办结</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -876,7 +926,8 @@ import {
|
|
|
|
|
delContract,
|
|
|
|
|
checkContractName,
|
|
|
|
|
editorContract,
|
|
|
|
|
detailContract
|
|
|
|
|
detailContract,
|
|
|
|
|
updateContract
|
|
|
|
|
} from '@/api/contract/contract'
|
|
|
|
|
import {
|
|
|
|
|
getparameter
|
|
|
|
|
@ -1196,118 +1247,188 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '采购流程',
|
|
|
|
|
multiHd: [{
|
|
|
|
|
multiHd: [ {
|
|
|
|
|
label: '请示流程',
|
|
|
|
|
width: 140,
|
|
|
|
|
prop: 'req_status',
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (cell.is_substitute && !cell.has_charge) {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
if (cell.is_plan === 1 && !cell.has_charge) {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
return '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
return '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
return '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '异常'
|
|
|
|
|
break
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
let statusText = '无'
|
|
|
|
|
if (!(row.is_substitute && !row.has_charge) && !(row.is_plan === 1 && !row.has_charge)) {
|
|
|
|
|
switch (row.req_status) {
|
|
|
|
|
case 0:
|
|
|
|
|
statusText = '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
statusText = '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
statusText = '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
statusText = '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
statusText = '异常'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const needFlow = !(row.is_substitute && !row.has_charge) && !(row.is_plan === 1 && !row.has_charge)
|
|
|
|
|
const canEdit = needFlow && row.req_status > 0 && row.req_status <= 3 &&
|
|
|
|
|
this.$store.state.user.myRole &&
|
|
|
|
|
this.$store.state.user.myRole.find(i => /财审科|系统管理员/g.test(i.name))
|
|
|
|
|
return (
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
|
|
|
<span>{statusText}</span>
|
|
|
|
|
{canEdit && (
|
|
|
|
|
<i
|
|
|
|
|
class="el-icon-edit"
|
|
|
|
|
style="cursor: pointer; color: #409EFF; margin-left: 5px;"
|
|
|
|
|
on-click={(e) => {
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
this.openFlowDialog(row, 'qingshi')
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '采购业务审批流程',
|
|
|
|
|
width: 158,
|
|
|
|
|
prop: 'purchase_status',
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (cell.is_substitute || cell.is_simple) {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
return '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
return '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
return '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '异常'
|
|
|
|
|
break
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
let statusText = '无'
|
|
|
|
|
if (!row.is_substitute && !row.is_simple) {
|
|
|
|
|
switch (row.purchase_status) {
|
|
|
|
|
case 0:
|
|
|
|
|
statusText = '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
statusText = '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
statusText = '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
statusText = '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
statusText = '异常'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const needFlow = !row.is_substitute && !row.is_simple
|
|
|
|
|
const canEdit = needFlow && row.purchase_status > 0 && row.purchase_status <= 3 &&
|
|
|
|
|
this.$store.state.user.myRole &&
|
|
|
|
|
this.$store.state.user.myRole.find(i => /财审科|系统管理员/g.test(i.name))
|
|
|
|
|
return (
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
|
|
|
<span>{statusText}</span>
|
|
|
|
|
{canEdit && (
|
|
|
|
|
<i
|
|
|
|
|
class="el-icon-edit"
|
|
|
|
|
style="cursor: pointer; color: #409EFF; margin-left: 5px;"
|
|
|
|
|
on-click={(e) => {
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
this.openFlowDialog(row, 'caigou')
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '招标审核流程',
|
|
|
|
|
width: 145,
|
|
|
|
|
prop: 'invite_status',
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (cell.is_substitute || cell.is_simple) {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
if (cell.purchase_way?.remark === 'false') {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
return '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
return '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
return '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '异常'
|
|
|
|
|
break
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
let statusText = '无'
|
|
|
|
|
if (!row.is_substitute && !row.is_simple && row.purchase_way?.remark !== 'false') {
|
|
|
|
|
switch (row.invite_status) {
|
|
|
|
|
case 0:
|
|
|
|
|
statusText = '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
statusText = '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
statusText = '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
statusText = '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
statusText = '异常'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const needFlow = !row.is_substitute && !row.is_simple && row.purchase_way?.remark !== 'false'
|
|
|
|
|
const canEdit = needFlow && row.invite_status > 0 && row.invite_status <= 3 &&
|
|
|
|
|
this.$store.state.user.myRole &&
|
|
|
|
|
this.$store.state.user.myRole.find(i => /财审科|系统管理员/g.test(i.name))
|
|
|
|
|
return (
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
|
|
|
<span>{statusText}</span>
|
|
|
|
|
{canEdit && (
|
|
|
|
|
<i
|
|
|
|
|
class="el-icon-edit"
|
|
|
|
|
style="cursor: pointer; color: #409EFF; margin-left: 5px;"
|
|
|
|
|
on-click={(e) => {
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
this.openFlowDialog(row, 'zhaobiaowenjianshencha')
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '合同会签流程',
|
|
|
|
|
width: 145,
|
|
|
|
|
prop: 'join_status',
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (cell.is_simple) {
|
|
|
|
|
return '无'
|
|
|
|
|
}
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
return '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
return '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
return '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '异常'
|
|
|
|
|
break
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
let statusText = '无'
|
|
|
|
|
if (!row.is_simple) {
|
|
|
|
|
switch (row.join_status) {
|
|
|
|
|
case 0:
|
|
|
|
|
statusText = '无'
|
|
|
|
|
break
|
|
|
|
|
case 1:
|
|
|
|
|
statusText = '待申请'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
statusText = '流转中'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
statusText = '已办结'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
statusText = '异常'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const needFlow = !row.is_simple
|
|
|
|
|
const canEdit = needFlow && row.join_status > 0 && row.join_status <= 3 &&
|
|
|
|
|
this.$store.state.user.myRole &&
|
|
|
|
|
this.$store.state.user.myRole.find(i => /财审科|系统管理员/g.test(i.name))
|
|
|
|
|
return (
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
|
|
|
<span>{statusText}</span>
|
|
|
|
|
{canEdit && (
|
|
|
|
|
<i
|
|
|
|
|
class="el-icon-edit"
|
|
|
|
|
style="cursor: pointer; color: #409EFF; margin-left: 5px;"
|
|
|
|
|
on-click={(e) => {
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
this.openFlowDialog(row, 'hetonghuiqian')
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
@ -1652,6 +1773,13 @@ export default {
|
|
|
|
|
availableYears: [],
|
|
|
|
|
planTotal: 0,
|
|
|
|
|
plansPageIndex: 1,
|
|
|
|
|
// OA流程流水号弹窗相关
|
|
|
|
|
isShowFlowDialog: false,
|
|
|
|
|
currentFlow: '', // 当前流程类型: qingshi, caigou, zhaobiaowenjianshencha, hetonghuiqian
|
|
|
|
|
currentRow: null, // 当前行数据
|
|
|
|
|
flowId: '', // 流水号
|
|
|
|
|
flowStatus: 0, // 流程状态: 0流转中, 1已办结
|
|
|
|
|
oatoken: '', // OA token
|
|
|
|
|
|
|
|
|
|
isShowEditor: false,
|
|
|
|
|
contractTypes: [
|
|
|
|
|
@ -2470,22 +2598,34 @@ export default {
|
|
|
|
|
// 提交成功后关闭弹窗
|
|
|
|
|
this.isShowAdd = false
|
|
|
|
|
|
|
|
|
|
// 获取最新的合同列表
|
|
|
|
|
const res = await getContract({
|
|
|
|
|
page_size: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
is_auth: 1
|
|
|
|
|
})
|
|
|
|
|
// 如果是编辑模式,获取编辑的那条合同数据;如果是新增模式,获取最新的合同列表
|
|
|
|
|
let contractData = null
|
|
|
|
|
if (this.isEditMode && this.currentContractId) {
|
|
|
|
|
// 编辑模式:获取编辑的那条合同数据
|
|
|
|
|
const res = await getContract({ id: this.currentContractId })
|
|
|
|
|
if (res && res.list && res.list.data && res.list.data.length > 0) {
|
|
|
|
|
contractData = res.list.data[0]
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 新增模式:获取最新的合同列表
|
|
|
|
|
const res = await getContract({
|
|
|
|
|
page_size: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
is_auth: 1
|
|
|
|
|
})
|
|
|
|
|
if (res.list.data && res.list.data.length > 0) {
|
|
|
|
|
contractData = res.list.data[0]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查第一条数据的状态
|
|
|
|
|
if (res.list.data && res.list.data.length > 0) {
|
|
|
|
|
const firstContract = res.list.data[0]
|
|
|
|
|
if (firstContract.req_status === 0 &&
|
|
|
|
|
firstContract.purchase_status === 0 &&
|
|
|
|
|
firstContract.invite_status === 0 &&
|
|
|
|
|
firstContract.join_status === 0) {
|
|
|
|
|
// 检查合同数据的状态
|
|
|
|
|
if (contractData) {
|
|
|
|
|
if (contractData.req_status === 0 &&
|
|
|
|
|
contractData.purchase_status === 0 &&
|
|
|
|
|
contractData.invite_status === 0 &&
|
|
|
|
|
contractData.join_status === 0) {
|
|
|
|
|
// 所有状态都为0,直接唤起付款登记窗口
|
|
|
|
|
this.$refs['paymentRegistration'].getContract(firstContract)
|
|
|
|
|
this.$refs['paymentRegistration'].getContract(contractData)
|
|
|
|
|
this.$refs['paymentRegistration'].isShowPaymentRegistration = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -2518,6 +2658,86 @@ export default {
|
|
|
|
|
this.getContracts()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 打开OA流程流水号弹窗
|
|
|
|
|
openFlowDialog(row, flowType) {
|
|
|
|
|
const flow2contractField = new Map([
|
|
|
|
|
['caigou', 'purchase_status'],
|
|
|
|
|
['hetonghuiqian', 'join_status'],
|
|
|
|
|
['qingshi', 'req_status'],
|
|
|
|
|
['zhaobiaowenjianshencha', 'invite_status']
|
|
|
|
|
])
|
|
|
|
|
this.currentRow = row
|
|
|
|
|
this.currentFlow = flowType
|
|
|
|
|
this.flowId = ''
|
|
|
|
|
// 初始化状态:将当前状态值转换为OA状态值
|
|
|
|
|
// 状态选择中只有 0(流转中)和 1(已办结)
|
|
|
|
|
// 1(待申请)和 2(流转中)-> 0(流转中),3(已办结)-> 1(已办结)
|
|
|
|
|
const currentStatus = row[flow2contractField.get(flowType)]
|
|
|
|
|
if (currentStatus === 3) {
|
|
|
|
|
this.flowStatus = 1 // 已办结
|
|
|
|
|
} else {
|
|
|
|
|
this.flowStatus = 0 // 待申请或流转中都设置为流转中
|
|
|
|
|
}
|
|
|
|
|
this.isShowFlowDialog = true
|
|
|
|
|
},
|
|
|
|
|
// 取消弹窗
|
|
|
|
|
cancelFlowDialog() {
|
|
|
|
|
this.isShowFlowDialog = false
|
|
|
|
|
this.currentRow = null
|
|
|
|
|
this.currentFlow = ''
|
|
|
|
|
this.flowId = ''
|
|
|
|
|
this.flowStatus = 0
|
|
|
|
|
},
|
|
|
|
|
// 提交OA流程流水号
|
|
|
|
|
async submitFlowId() {
|
|
|
|
|
if (!this.flowId || !this.flowId.trim()) {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '请输入OA流程流水号'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
const flow_type = new Map([
|
|
|
|
|
['caigou', 2],
|
|
|
|
|
['hetonghuiqian', 3],
|
|
|
|
|
['qingshi', 17],
|
|
|
|
|
['zhaobiaowenjianshencha', 27]
|
|
|
|
|
])
|
|
|
|
|
const flow2contractField = new Map([
|
|
|
|
|
['caigou', 'purchase_status'],
|
|
|
|
|
['hetonghuiqian', 'join_status'],
|
|
|
|
|
['qingshi', 'req_status'],
|
|
|
|
|
['zhaobiaowenjianshencha', 'invite_status']
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
if (!this.oatoken) {
|
|
|
|
|
const res = await getOatoken()
|
|
|
|
|
this.oatoken = res.oatoken
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await updateContract({
|
|
|
|
|
out_contract_id: this.currentRow.id,
|
|
|
|
|
flow_type: flow_type.get(this.currentFlow),
|
|
|
|
|
status: this.flowStatus,
|
|
|
|
|
flow_id: this.flowId.trim()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
Message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '提交成功'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.cancelFlowDialog()
|
|
|
|
|
this.getContracts()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('提交失败:', error)
|
|
|
|
|
Message({
|
|
|
|
|
type: 'error',
|
|
|
|
|
message: '提交失败,请重试'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCategoryChange() {
|
|
|
|
|
this.form.affairType = ''
|
|
|
|
|
this.form.contractType = ''
|
|
|
|
|
|