|
|
|
|
@ -288,7 +288,13 @@
|
|
|
|
|
<Button type="primary" @click="toExport()" style="margin-left: 10px"
|
|
|
|
|
>导出</Button
|
|
|
|
|
>
|
|
|
|
|
<!-- <Button type="primary" style="margin-left: 10px">导出</Button>-->
|
|
|
|
|
<Button
|
|
|
|
|
v-if="$store.state.user.min_allow_level === 0"
|
|
|
|
|
type="warning"
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
:loading="syncOaFlowLoading"
|
|
|
|
|
@click="syncOaFlow"
|
|
|
|
|
>同步OA流程</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</lx-header>
|
|
|
|
|
@ -381,6 +387,24 @@
|
|
|
|
|
>合同审批
|
|
|
|
|
</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">
|
|
|
|
|
<Button
|
|
|
|
|
class="slot-btns-item"
|
|
|
|
|
size="small"
|
|
|
|
|
type="error"
|
|
|
|
|
@click="destroySplitSection(scope.row)"
|
|
|
|
|
>删除标段
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-if="scope.row.FLOWSTATUS['shenpi'].isEnabled()&&!scope.row.pid&&scope.row.is_contract">-->
|
|
|
|
|
<!-- <Button-->
|
|
|
|
|
<!-- class="slot-btns-item"-->
|
|
|
|
|
@ -1167,7 +1191,7 @@
|
|
|
|
|
|
|
|
|
|
<oaFiles ref="oaFiles"></oaFiles>
|
|
|
|
|
|
|
|
|
|
<addContractLedger ref="addContractLedger" @refresh="getContracts(false,false,true)"></addContractLedger>
|
|
|
|
|
<addContractLedger ref="addContractLedger" @refresh="onLedgerSaved"></addContractLedger>
|
|
|
|
|
|
|
|
|
|
<splitContract ref="splitContract" @refresh="getContracts(false,false,false)"></splitContract>
|
|
|
|
|
</div>
|
|
|
|
|
@ -1181,7 +1205,8 @@ import {
|
|
|
|
|
checkContractName,
|
|
|
|
|
updateStatus,
|
|
|
|
|
detailContract,
|
|
|
|
|
resetMoney
|
|
|
|
|
resetMoney,
|
|
|
|
|
destroySection
|
|
|
|
|
} from "@/api/contract/contract";
|
|
|
|
|
import { getparameter } from "@/api/system/dictionary";
|
|
|
|
|
import { listdeptNoAuth } from "@/api/system/department";
|
|
|
|
|
@ -1458,7 +1483,7 @@ export default {
|
|
|
|
|
prop: "sign_plan_count",
|
|
|
|
|
width: 120,
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (value == 0) return "暂无";
|
|
|
|
|
if (!value || value == 0) return "暂无";
|
|
|
|
|
return value + "期";
|
|
|
|
|
},
|
|
|
|
|
customFn:row => {
|
|
|
|
|
@ -1580,11 +1605,13 @@ 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>{row.name}</span></span>)
|
|
|
|
|
return (<span style="color: red;"><span>【已到期】</span><span>{displayName}</span></span>)
|
|
|
|
|
} else {
|
|
|
|
|
return (
|
|
|
|
|
<span>{row.name}</span>
|
|
|
|
|
<span>{displayName}</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1650,7 +1677,7 @@ export default {
|
|
|
|
|
<br/>
|
|
|
|
|
{
|
|
|
|
|
(row.FLOWSTATUS.zhaobiao.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
|
|
|
|
|
this.$refs['biddingUpload'].setId(row.id)
|
|
|
|
|
this.$refs['biddingUpload'].setId(this.flowSourceId(row))
|
|
|
|
|
this.$refs['biddingUpload'].show()
|
|
|
|
|
}}}>查看</a> : ''
|
|
|
|
|
}
|
|
|
|
|
@ -1807,7 +1834,7 @@ export default {
|
|
|
|
|
prop: "sign_plan_count",
|
|
|
|
|
width: 120,
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
if (value == 0) return "暂无";
|
|
|
|
|
if (!value || value == 0) return "暂无";
|
|
|
|
|
return value + "期";
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -2101,9 +2128,22 @@ export default {
|
|
|
|
|
selections: [], //已选择的框架合同
|
|
|
|
|
|
|
|
|
|
isShowEditor: false,
|
|
|
|
|
syncOaFlowLoading: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async syncOaFlow () {
|
|
|
|
|
this.syncOaFlowLoading = true
|
|
|
|
|
try {
|
|
|
|
|
await updateFlow()
|
|
|
|
|
this.$message.success('OA流程同步完成')
|
|
|
|
|
this.getContracts(false, true)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.$message.error('OA流程同步失败')
|
|
|
|
|
} finally {
|
|
|
|
|
this.syncOaFlowLoading = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
resetMoney (row) {
|
|
|
|
|
resetMoney({
|
|
|
|
|
id: row.id,
|
|
|
|
|
@ -2122,8 +2162,13 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 采购/招标 OA 关联源 contract */
|
|
|
|
|
flowSourceId (row) {
|
|
|
|
|
return row.is_split_child && row.split_source_id ? row.split_source_id : row.id
|
|
|
|
|
},
|
|
|
|
|
async toOaDetail (tbname,row) {
|
|
|
|
|
let res;
|
|
|
|
|
const flowId = this.flowSourceId(row)
|
|
|
|
|
switch (tbname) {
|
|
|
|
|
case 'hetong':
|
|
|
|
|
res = await httpCurl({
|
|
|
|
|
@ -2134,7 +2179,7 @@ export default {
|
|
|
|
|
case 'caigou':
|
|
|
|
|
res = await httpCurl({
|
|
|
|
|
tbname,
|
|
|
|
|
out_caigou_id: row.id
|
|
|
|
|
out_caigou_id: flowId
|
|
|
|
|
})
|
|
|
|
|
break;
|
|
|
|
|
case 'pay':
|
|
|
|
|
@ -2339,16 +2384,55 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//会签流程
|
|
|
|
|
signPre (row) {
|
|
|
|
|
if (!row.can_split) {
|
|
|
|
|
this.signProcess(row)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$confirm('是否为多标段合同?','提示',{
|
|
|
|
|
confirmButtonText: '合同拆分',
|
|
|
|
|
cancelButtonText: '合同审批',
|
|
|
|
|
distinguishCancelAndClose: true,
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(_ => {
|
|
|
|
|
this.$refs['splitContract'].setId(row.id)
|
|
|
|
|
this.$refs['splitContract'].show()
|
|
|
|
|
}).catch(_ => {
|
|
|
|
|
this.signProcess(row)
|
|
|
|
|
this.openSplit(row)
|
|
|
|
|
}).catch(action => {
|
|
|
|
|
// 仅点「合同审批」才跳转 OA;点 X / ESC 关闭不做任何事
|
|
|
|
|
if (action === 'cancel') {
|
|
|
|
|
this.signProcess(row)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
openSplit(row) {
|
|
|
|
|
this.$refs['splitContract'].setId(row.id)
|
|
|
|
|
this.$refs['splitContract'].show()
|
|
|
|
|
},
|
|
|
|
|
/** 已至少拆分出一个标段时才显示「继续拆分」 */
|
|
|
|
|
hasSplitSections(row) {
|
|
|
|
|
if (row.section_count > 0) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
const children = row.split_children || row.splitChildren || []
|
|
|
|
|
return children.length > 0
|
|
|
|
|
},
|
|
|
|
|
destroySplitSection(row) {
|
|
|
|
|
this.$confirm('确认删除该标段?删除后不可恢复。', '提示', { type: 'warning' }).then(() => {
|
|
|
|
|
destroySection({ id: row.id }).then(() => {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
this.getContracts(false, false, false)
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {})
|
|
|
|
|
},
|
|
|
|
|
buildDisplayList(data) {
|
|
|
|
|
const rows = []
|
|
|
|
|
;(data || []).forEach(source => {
|
|
|
|
|
rows.push(source)
|
|
|
|
|
const children = source.split_children || source.splitChildren || []
|
|
|
|
|
children.forEach(child => {
|
|
|
|
|
rows.push(child)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
return rows
|
|
|
|
|
},
|
|
|
|
|
async signProcess(row) {
|
|
|
|
|
this.setNowContract(row, "hetong");
|
|
|
|
|
@ -2491,6 +2575,24 @@ export default {
|
|
|
|
|
this.getContracts();
|
|
|
|
|
},
|
|
|
|
|
//获取合同列表
|
|
|
|
|
onLedgerSaved (contractId) {
|
|
|
|
|
this.getContracts(false, false, contractId || false)
|
|
|
|
|
},
|
|
|
|
|
async openOaAfterCreate (row) {
|
|
|
|
|
if (!row || row.is_simple === 1) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (row.is_substitute) {
|
|
|
|
|
await this.signProcess(row)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
row.purchase_status === 1 &&
|
|
|
|
|
((row.req_status === 3 && row.is_plan === 0) || row.is_plan === 1)
|
|
|
|
|
) {
|
|
|
|
|
await this.buyProcess(row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getContracts(is_export,noloading=false,isopenOa=false) {
|
|
|
|
|
const querySelect = {
|
|
|
|
|
...this.select,
|
|
|
|
|
@ -2524,8 +2626,9 @@ export default {
|
|
|
|
|
is_auth: 1,
|
|
|
|
|
},noloading);
|
|
|
|
|
|
|
|
|
|
res.list.data.forEach(i => this.handleContractFlow(i))
|
|
|
|
|
this.list = res.list.data;
|
|
|
|
|
const displayList = this.buildDisplayList(res.list.data)
|
|
|
|
|
displayList.forEach(i => this.handleContractFlow(i))
|
|
|
|
|
this.list = displayList;
|
|
|
|
|
this.total = res.list.total;
|
|
|
|
|
this.tableTotal.fundLogTotal = res.fund_log_total;
|
|
|
|
|
this.tableTotal.moneyTotal = Number(res.money_total)
|
|
|
|
|
@ -2537,22 +2640,15 @@ export default {
|
|
|
|
|
|
|
|
|
|
console.log(this.list)
|
|
|
|
|
|
|
|
|
|
//新增时打开oa采购录入
|
|
|
|
|
// 新增保存后打开 OA(优先用新建 contract id,避免列表第一条不是新建记录)
|
|
|
|
|
if (isopenOa) {
|
|
|
|
|
if (res.list.data[0]) {
|
|
|
|
|
if (
|
|
|
|
|
res.list.data[0].is_simple !== 1 &&
|
|
|
|
|
res.list.data[0].purchase_status === 1 &&
|
|
|
|
|
((res.list.data[0].req_status === 3 && res.list.data[0].is_plan === 0) ||
|
|
|
|
|
res.list.data[0].is_plan === 1) &&
|
|
|
|
|
!res.list.data[0].is_substitute
|
|
|
|
|
) {
|
|
|
|
|
await this.buyProcess(res.list.data[0])
|
|
|
|
|
}
|
|
|
|
|
if (res.list.data[0].is_simple !== 1 && res.list.data[0].is_substitute ) {
|
|
|
|
|
await this.signProcess(res.list.data[0])
|
|
|
|
|
}
|
|
|
|
|
let row = null
|
|
|
|
|
if (typeof isopenOa === 'number') {
|
|
|
|
|
row = await detailContract({ id: isopenOa }, true)
|
|
|
|
|
} else if (res.list.data[0]) {
|
|
|
|
|
row = res.list.data[0]
|
|
|
|
|
}
|
|
|
|
|
await this.openOaAfterCreate(row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -2794,7 +2890,7 @@ export default {
|
|
|
|
|
"qianding": new Flow(),
|
|
|
|
|
"zhifu": new Flow()
|
|
|
|
|
}
|
|
|
|
|
if (item.is_simple !== 1 && !item.is_substitute) {
|
|
|
|
|
if (item.is_simple !== 1 && !item.is_substitute && !item.is_split_child) {
|
|
|
|
|
//不为简易 采购未开始
|
|
|
|
|
|
|
|
|
|
flowStatus["caigou"].setStatus(item.purchase_status)
|
|
|
|
|
@ -2806,7 +2902,18 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) {
|
|
|
|
|
if (item.is_split_child) {
|
|
|
|
|
// 与源 contract 相同规则:源 contract 无此流程则子标段也显示「无」
|
|
|
|
|
if (item.is_simple !== 1 && !item.is_substitute) {
|
|
|
|
|
flowStatus['caigou'].setStatus(item.purchase_status)
|
|
|
|
|
flowStatus['caigou'].setExecutable(false)
|
|
|
|
|
}
|
|
|
|
|
if (item.is_contract && item.purchase_way?.remark === 'true') {
|
|
|
|
|
flowStatus['zhaobiao'].setStatus(item.invite_status)
|
|
|
|
|
flowStatus['zhaobiao'].setExecutable(false)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute && !item.is_split_child) {
|
|
|
|
|
//不为网上商场 是合同\
|
|
|
|
|
flowStatus["zhaobiao"].setStatus(item.invite_status)
|
|
|
|
|
if (item.invite_status === 1 && item.purchase_status === 3) {
|
|
|
|
|
@ -2823,7 +2930,13 @@ export default {
|
|
|
|
|
flowStatus["shenpi"].setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_contract && !item.is_substitute) {
|
|
|
|
|
if (item.is_contract && !item.is_substitute && !item.is_split_child) {
|
|
|
|
|
flowStatus["qianding"].setStatus(item.status)
|
|
|
|
|
if (item.join_status === 3 && item.status === 1) {
|
|
|
|
|
flowStatus["qianding"].setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.is_contract && item.is_split_child) {
|
|
|
|
|
flowStatus["qianding"].setStatus(item.status)
|
|
|
|
|
if (item.join_status === 3 && item.status === 1) {
|
|
|
|
|
flowStatus["qianding"].setExecutable(true)
|
|
|
|
|
@ -2834,7 +2947,8 @@ export default {
|
|
|
|
|
//最后一笔没付完
|
|
|
|
|
if ((!item.is_contract && !item.is_substitute && item.purchase_status === 3) ||
|
|
|
|
|
item.status === 2 ||
|
|
|
|
|
(!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) {
|
|
|
|
|
(!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3) ||
|
|
|
|
|
(item.is_contract && item.is_split_child && item.join_status === 3)) {
|
|
|
|
|
//网上商场的话采购完成 合同签订完成 不为合同并且为简易
|
|
|
|
|
flowStatus["zhifu"].setExecutable(true)
|
|
|
|
|
}
|
|
|
|
|
|