|
|
|
|
@ -378,7 +378,7 @@
|
|
|
|
|
>招标审查</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="scope.row.FLOWSTATUS['shenpi'].isEnabled()">
|
|
|
|
|
<template v-if="scope.row.FLOWSTATUS['shenpi'].isEnabled() && shouldShowContractApproval(scope.row)">
|
|
|
|
|
<Button
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
size="small"
|
|
|
|
|
@ -387,16 +387,7 @@
|
|
|
|
|
>合同审批
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="scope.row.can_split && scope.row.is_contract && hasSplitSections(scope.row)">
|
|
|
|
|
<Button
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
size="small"
|
|
|
|
|
type="warning"
|
|
|
|
|
@click="openSplit(scope.row)"
|
|
|
|
|
>继续拆分
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="scope.row.is_split_child && scope.row.can_delete">
|
|
|
|
|
<template v-if="scope.row.is_split_child && scope.row.join_status === 1">
|
|
|
|
|
<Button
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
size="small"
|
|
|
|
|
@ -600,6 +591,13 @@
|
|
|
|
|
>
|
|
|
|
|
查看
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
v-if="scope.row.can_split && scope.row.is_contract && hasSplitSections(scope.row) && !scope.row.is_split_child"
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openSplit(scope.row)"
|
|
|
|
|
>继续拆分</Button>
|
|
|
|
|
<template v-if="scope.row.status != 2 || hasEdit">
|
|
|
|
|
<Button
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
@ -1418,6 +1416,9 @@ export default {
|
|
|
|
|
purchaseWay: [], //购买方式
|
|
|
|
|
moneyWay: [], //资金渠道
|
|
|
|
|
departments: [], //部门科室
|
|
|
|
|
rawListData: [],
|
|
|
|
|
splitGroupExpanded: {},
|
|
|
|
|
splitChildrenRowsCache: {},
|
|
|
|
|
list: [], //数据
|
|
|
|
|
total: 0,
|
|
|
|
|
//表格
|
|
|
|
|
@ -1605,15 +1606,7 @@ export default {
|
|
|
|
|
fixed: "left",
|
|
|
|
|
align: "left",
|
|
|
|
|
customFn:row => {
|
|
|
|
|
const prefix = row.is_split_child ? ' └ ' : ''
|
|
|
|
|
const displayName = row.section_name ? `${prefix}${row.section_no ? row.section_no + ' ' : ''}${row.section_name}` : `${prefix}${row.name}`
|
|
|
|
|
if (row.type === 1 && row.end_date && (this.$moment().valueOf() - this.$moment(row.end_date).valueOf()) > 0) {
|
|
|
|
|
return (<span style="color: red;"><span>【已到期】</span><span>{displayName}</span></span>)
|
|
|
|
|
} else {
|
|
|
|
|
return (
|
|
|
|
|
<span>{displayName}</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
return this.renderProjectNameCell(row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -2388,16 +2381,21 @@ export default {
|
|
|
|
|
this.signProcess(row)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$confirm('是否为多标段合同?','提示',{
|
|
|
|
|
confirmButtonText: '合同拆分',
|
|
|
|
|
cancelButtonText: '合同审批',
|
|
|
|
|
distinguishCancelAndClose: true,
|
|
|
|
|
this.$msgbox({
|
|
|
|
|
title: '提示',
|
|
|
|
|
message: '是否为多标段合同?',
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
showClose: true,
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
distinguishCancelAndClose: true,
|
|
|
|
|
confirmButtonText: '采购项目拆分',
|
|
|
|
|
cancelButtonText: '合同审批',
|
|
|
|
|
confirmButtonClass: 'el-button--primary',
|
|
|
|
|
cancelButtonClass: 'el-button--primary',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(_ => {
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.openSplit(row)
|
|
|
|
|
}).catch(action => {
|
|
|
|
|
// 仅点「合同审批」才跳转 OA;点 X / ESC 关闭不做任何事
|
|
|
|
|
if (action === 'cancel') {
|
|
|
|
|
this.signProcess(row)
|
|
|
|
|
}
|
|
|
|
|
@ -2415,6 +2413,95 @@ export default {
|
|
|
|
|
const children = row.split_children || row.splitChildren || []
|
|
|
|
|
return children.length > 0
|
|
|
|
|
},
|
|
|
|
|
/** 源项目已拆分标段时隐藏合同审批;标段删光后恢复 */
|
|
|
|
|
shouldShowContractApproval(row) {
|
|
|
|
|
if (row.is_split_child) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return !this.hasSplitSections(row)
|
|
|
|
|
},
|
|
|
|
|
isSplitGroupExpanded(sourceId) {
|
|
|
|
|
if (this.splitGroupExpanded[sourceId] === undefined) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return !!this.splitGroupExpanded[sourceId]
|
|
|
|
|
},
|
|
|
|
|
toggleSplitGroup(sourceId) {
|
|
|
|
|
const next = !this.isSplitGroupExpanded(sourceId)
|
|
|
|
|
this.$set(this.splitGroupExpanded, sourceId, next)
|
|
|
|
|
|
|
|
|
|
const sourceIndex = this.list.findIndex(r => r.id === sourceId && r._hasSplitChildren)
|
|
|
|
|
if (sourceIndex === -1) {
|
|
|
|
|
this.list = this.rebuildDisplayList(this.rawListData)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (next) {
|
|
|
|
|
const source = this.rawListData.find(r => r.id === sourceId)
|
|
|
|
|
if (!source) return
|
|
|
|
|
const childRows = this.getSplitChildRows(source)
|
|
|
|
|
this.list.splice(sourceIndex + 1, 0, ...childRows)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let removeCount = 0
|
|
|
|
|
for (let i = sourceIndex + 1; i < this.list.length; i++) {
|
|
|
|
|
if (this.list[i]._splitParentId === sourceId) {
|
|
|
|
|
removeCount++
|
|
|
|
|
} else {
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (removeCount > 0) {
|
|
|
|
|
this.list.splice(sourceIndex + 1, removeCount)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
formatSectionLabel(index) {
|
|
|
|
|
const n = Number(index) + 1
|
|
|
|
|
const cn = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
|
|
|
|
|
if (n >= 1 && n <= 10) {
|
|
|
|
|
return `标段${cn[n - 1]}`
|
|
|
|
|
}
|
|
|
|
|
return `标段${n}`
|
|
|
|
|
},
|
|
|
|
|
renderProjectNameCell(row) {
|
|
|
|
|
const displayName = row.is_split_child
|
|
|
|
|
? (row.section_name || row.name)
|
|
|
|
|
: row.name
|
|
|
|
|
const expired = row.type === 1 && row.end_date &&
|
|
|
|
|
(this.$moment().valueOf() - this.$moment(row.end_date).valueOf()) > 0
|
|
|
|
|
|
|
|
|
|
if (row._hasSplitChildren) {
|
|
|
|
|
const expanded = this.isSplitGroupExpanded(row.id)
|
|
|
|
|
const childCount = (row.split_children || row.splitChildren || []).length
|
|
|
|
|
return (
|
|
|
|
|
<span>
|
|
|
|
|
<a
|
|
|
|
|
style="cursor:pointer;margin-right:8px;color:#409EFF;font-weight:600;"
|
|
|
|
|
onClick={(e) => { e.stopPropagation(); this.toggleSplitGroup(row.id) }}
|
|
|
|
|
>{expanded ? '▼' : '▶'}</a>
|
|
|
|
|
<Tag color="success" size="small" style="margin-right:6px;">采购项目</Tag>
|
|
|
|
|
<span style={expired ? 'color:red;' : ''}>{expired ? '【已到期】' : ''}{displayName}</span>
|
|
|
|
|
<span style="color:#909399;margin-left:8px;">({childCount}个标段)</span>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (row.is_split_child) {
|
|
|
|
|
const sectionLabel = this.formatSectionLabel(row._splitSectionIndex ?? 0)
|
|
|
|
|
return (
|
|
|
|
|
<span style="display:inline-flex;align-items:center;padding-left:12px;">
|
|
|
|
|
<Tag color="primary" size="small" style="margin-right:8px;">{sectionLabel}</Tag>
|
|
|
|
|
<span style={expired ? 'color:red;' : ''}>{expired ? '【已到期】' : ''}{displayName}</span>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (expired) {
|
|
|
|
|
return (<span style="color: red;"><span>【已到期】</span><span>{displayName}</span></span>)
|
|
|
|
|
}
|
|
|
|
|
return (<span>{displayName}</span>)
|
|
|
|
|
},
|
|
|
|
|
destroySplitSection(row) {
|
|
|
|
|
this.$confirm('确认删除该标段?删除后不可恢复。', '提示', { type: 'warning' }).then(() => {
|
|
|
|
|
destroySection({ id: row.id }).then(() => {
|
|
|
|
|
@ -2426,11 +2513,43 @@ export default {
|
|
|
|
|
buildDisplayList(data) {
|
|
|
|
|
const rows = []
|
|
|
|
|
;(data || []).forEach(source => {
|
|
|
|
|
rows.push(source)
|
|
|
|
|
const children = source.split_children || source.splitChildren || []
|
|
|
|
|
children.forEach(child => {
|
|
|
|
|
rows.push(child)
|
|
|
|
|
})
|
|
|
|
|
const hasChildren = children.length > 0
|
|
|
|
|
rows.push({ ...source, _hasSplitChildren: hasChildren })
|
|
|
|
|
if (hasChildren && this.isSplitGroupExpanded(source.id)) {
|
|
|
|
|
children.forEach((child, index) => {
|
|
|
|
|
rows.push({ ...child, _splitParentId: source.id, _splitSectionIndex: index })
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return rows
|
|
|
|
|
},
|
|
|
|
|
getSplitChildRows(source) {
|
|
|
|
|
const sourceId = source.id
|
|
|
|
|
if (this.splitChildrenRowsCache[sourceId]) {
|
|
|
|
|
return this.splitChildrenRowsCache[sourceId]
|
|
|
|
|
}
|
|
|
|
|
const children = source.split_children || source.splitChildren || []
|
|
|
|
|
const rows = children.map((child, index) => {
|
|
|
|
|
const row = { ...child, _splitParentId: sourceId, _splitSectionIndex: index }
|
|
|
|
|
this.handleContractFlow(row)
|
|
|
|
|
return row
|
|
|
|
|
})
|
|
|
|
|
this.$set(this.splitChildrenRowsCache, sourceId, rows)
|
|
|
|
|
return rows
|
|
|
|
|
},
|
|
|
|
|
rebuildDisplayList(data) {
|
|
|
|
|
this.splitChildrenRowsCache = {}
|
|
|
|
|
const rows = []
|
|
|
|
|
;(data || []).forEach(source => {
|
|
|
|
|
const children = source.split_children || source.splitChildren || []
|
|
|
|
|
const hasChildren = children.length > 0
|
|
|
|
|
const sourceRow = { ...source, _hasSplitChildren: hasChildren }
|
|
|
|
|
this.handleContractFlow(sourceRow)
|
|
|
|
|
rows.push(sourceRow)
|
|
|
|
|
if (hasChildren && this.isSplitGroupExpanded(source.id)) {
|
|
|
|
|
rows.push(...this.getSplitChildRows(source))
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return rows
|
|
|
|
|
},
|
|
|
|
|
@ -2626,9 +2745,8 @@ export default {
|
|
|
|
|
is_auth: 1,
|
|
|
|
|
},noloading);
|
|
|
|
|
|
|
|
|
|
const displayList = this.buildDisplayList(res.list.data)
|
|
|
|
|
displayList.forEach(i => this.handleContractFlow(i))
|
|
|
|
|
this.list = displayList;
|
|
|
|
|
this.rawListData = res.list.data
|
|
|
|
|
this.list = this.rebuildDisplayList(res.list.data)
|
|
|
|
|
this.total = res.list.total;
|
|
|
|
|
this.tableTotal.fundLogTotal = res.fund_log_total;
|
|
|
|
|
this.tableTotal.moneyTotal = Number(res.money_total)
|
|
|
|
|
@ -2924,9 +3042,10 @@ export default {
|
|
|
|
|
if (item.is_contract) {
|
|
|
|
|
//为合同 不为网上商城
|
|
|
|
|
flowStatus["shenpi"].setStatus(item.join_status)
|
|
|
|
|
if (item.join_status === 1 && (item.invite_status === 3 ||
|
|
|
|
|
(item.purchase_way?.remark === 'false' && item.purchase_status === 3))) {
|
|
|
|
|
//审批未开始 走招标招标完成或不走招标采购完成
|
|
|
|
|
const canStartJoin = item.join_status === 1 && (item.invite_status === 3 ||
|
|
|
|
|
(item.purchase_way?.remark === 'false' && item.purchase_status === 3))
|
|
|
|
|
if (canStartJoin && !(item.is_split_child === 0 && this.hasSplitSections(item))) {
|
|
|
|
|
// 源项目已拆分标段时不显示合同审批,由各标段独立发起
|
|
|
|
|
flowStatus["shenpi"].setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|