lion 2 days ago
parent 85a020244c
commit 95ba4bc9fc

@ -33,10 +33,6 @@ export default {
},
okText:{
type:String
},
loading:{
type:Boolean,
default:false
}
},
data() {
@ -49,16 +45,16 @@ export default {
if(this.type === 'form'){
return (
<div>
<Button ghost type="primary" disabled={this.loading} on-click={this.reset}>重置</Button>
<Button type="primary" loading={this.loading} disabled={this.loading} on-click={this.submit}>{this.okText || '确定'}</Button>
<Button ghost type="primary" on-click={this.reset}>重置</Button>
<Button type="primary" on-click={this.submit}>{this.okText || '确定'}</Button>
</div>
)
}
if(this.type === 'normal'){
return (
<div>
<Button ghost type="primary" disabled={this.loading} on-click={()=>{this.$emit('update:isShow',false)}}>取消</Button>
<Button type="primary" loading={this.loading} disabled={this.loading} on-click={()=>{this.$emit('on-ok')}}>{this.okText || '确定'}</Button>
<Button ghost type="primary" on-click={()=>{this.$emit('update:isShow',false)}}>取消</Button>
<Button type="primary" on-click={()=>{this.$emit('on-ok')}}>{this.okText || '确定'}</Button>
</div>
)
}
@ -88,13 +84,15 @@ export default {
if(this.type === 'normal'){
return
}
this.$refs['elForm'].resetFields()
if (this.$refs['elForm']) {
this.$refs['elForm'].resetFields()
}
},
submit(){
if(this.type === 'normal'){
return
}
if(this.loading){
if (!this.$refs['elForm']) {
return
}
this.$refs['elForm'].validate().then(res=>{
@ -156,16 +154,6 @@ export default {
}
}
return (
<div
class={this.loading ? 'xy-dialog-form-loading' : ''}
{...{
directives: [{
name: 'loading',
value: this.loading
}]
}}
element-loading-text="加载中..."
>
<el-form
class="xy-dialog-form"
style={title.length === 0 ? {'margin-top':'32px'} : {}}
@ -195,7 +183,6 @@ export default {
{$scopedSlots.extraFormBottom ? $scopedSlots.extraFormBottom() : ''}
</el-form>
</div>
)
}else{
return (
@ -244,10 +231,6 @@ export default {
overflow: scroll;
}
.xy-dialog-form-loading {
position: relative;
min-height: 260px;
}
.xy-table-item{
display: flex;
align-items: center;

@ -1,12 +1,11 @@
<template>
<div>
<div class="payment-registration-dialog">
<!-- 付款登记-->
<xy-dialog
title="付款登记"
:is-show.sync="isShowPaymentRegistration"
type="form"
class="payment-registration"
:loading="detailLoading"
:form="paymentRegistrationForm"
:rules="paymentRegistrationRules"
@submit="submit"
@ -266,6 +265,12 @@
<Page :total="planTotal" show-elevator @on-change="pageChange" />
</div>
</template>
<template v-slot:footerContent>
<div>
<Button ghost type="primary" :disabled="detailLoading" @click="resetPaymentForm"></Button>
<Button type="primary" :disabled="detailLoading" @click="triggerSubmit"></Button>
</div>
</template>
</xy-dialog>
</div>
</template>
@ -319,6 +324,7 @@ export default {
paymentType: ["首付款","进度款", "结算款", "质保金"],
isShowPaymentRegistration: false,
detailLoading: false,
detailLoadingInstance: null,
paymentRegistrationForm: {
applyMoney: "",
//deductionMoney: "",
@ -450,9 +456,51 @@ export default {
return Number(this.contract.money) ? ((total / Number(this.contract.money)) * 100).toFixed(2) : 0;
},
closeDetailLoading() {
if (this.detailLoadingInstance) {
this.detailLoadingInstance.close()
this.detailLoadingInstance = null
}
this.detailLoading = false
},
openDetailLoading() {
this.detailLoading = true
this.$nextTick(() => {
if (this.detailLoadingInstance) {
return
}
const modalBody = document.querySelector('.payment-registration-dialog .ivu-modal-body')
if (!modalBody) {
return
}
this.detailLoadingInstance = this.$loading({
target: modalBody,
lock: true,
text: '加载中...'
})
})
},
resetPaymentForm() {
if (this.detailLoading) {
return
}
this.$refs.paymentRegistration?.reset()
},
triggerSubmit() {
if (this.detailLoading) {
return
}
this.$refs.paymentRegistration?.submit()
},
async open(row) {
this.isShowPaymentRegistration = true
await this.$nextTick()
await this.getContract(row)
},
//
async getContract(info) {
this.detailLoading = true
this.openDetailLoading()
this.contract = {}
this.payment = []
try {
@ -489,7 +537,7 @@ export default {
message: '加载合同信息失败,请重试',
})
} finally {
this.detailLoading = false
this.closeDetailLoading()
}
},
@ -620,7 +668,7 @@ export default {
if (newVal) {
this.getBudgets()
} else {
this.detailLoading = false
this.closeDetailLoading()
this.contract = {}
this.payment = []
}
@ -633,6 +681,13 @@ export default {
</script>
<style scoped lang="scss">
.payment-registration-dialog {
::v-deep .ivu-modal-body {
position: relative;
min-height: 260px;
}
}
.payment-registration {
&-row {
display: flex;

@ -263,12 +263,7 @@
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
@click="$refs['paymentRegistration'].open(scope.row)"
>
付款登记
</Button>
@ -279,12 +274,7 @@
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
@click="$refs['paymentRegistration'].open(scope.row)"
>
<!-- @click="$refs['paymentRegistration'].getContract(scope.row),$refs['paymentRegistration'].isShowPaymentRegistration = true"-->
付款登记

@ -327,12 +327,7 @@
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
@click="$refs['paymentRegistration'].open(scope.row)"
>
付款登记
</Button>
@ -343,12 +338,7 @@
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
@click="$refs['paymentRegistration'].open(scope.row)"
>付款登记
</Button>
</template>
@ -1650,7 +1640,7 @@ export default {
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.caigou.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.caigou.getStatus()) }</span>
<br/>
{
(row.FLOWSTATUS.caigou.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>this.toOaDetail('caigou',row)}}>查看</a> : ''
(row.FLOWSTATUS.caigou.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>this.toOaDetail('caigou', row)}}>查看</a> : ''
}
</div>
)
@ -1664,12 +1654,16 @@ export default {
if (!row.FLOWSTATUS.zhaobiao.getStatus()) {
return (<span style="color: rgb(140, 140, 140)"></span>);
}
const sourceRow = this.getSplitSourceRow(row) || row
return (
<div>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.zhaobiao.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.zhaobiao.getStatus()) }</span>
<br/>
{
(row.FLOWSTATUS.zhaobiao.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
if (this.openFlowDetail(sourceRow.invite_last_flow_id)) {
return
}
this.$refs['biddingUpload'].setId(this.flowSourceId(row))
this.$refs['biddingUpload'].show()
}}}>查看</a> : ''
@ -1691,7 +1685,7 @@ export default {
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.shenpi.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.shenpi.getStatus()) }</span>
<br/>
{
(row.FLOWSTATUS.shenpi.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>this.toOaDetail('hetong',row)}}>查看</a> : ''
(row.FLOWSTATUS.shenpi.getStatus() > 1 && !this.shouldHideSourceJoinView(row)) ? <a style="color: #333" on={{['click']:()=>this.toOaDetail('hetong',row)}}>查看</a> : ''
}
</div>
)
@ -2159,7 +2153,76 @@ export default {
flowSourceId (row) {
return row.is_split_child && row.split_source_id ? row.split_source_id : row.id
},
getSplitSourceRow(row) {
if (!row) return null
const parentId = row._splitParentId || row.split_source_id
if (!parentId) return null
return (this.rawListData || []).find(item => item.id === parentId) || null
},
getSplitChildren(row) {
return row?.split_children || row?.splitChildren || []
},
aggregateSectionJoinStatus(children) {
if (!children || !children.length) {
return 1
}
const statuses = children.map(child => Number(child.join_status) || 1)
if (statuses.every(status => status === 3)) {
return 3
}
if (statuses.some(status => status === 2)) {
return 2
}
if (statuses.some(status => status === 3) && statuses.some(status => status === 1)) {
return 2
}
return 1
},
enrichSplitChildRow(child, source) {
if (!source) {
return child
}
return {
...child,
type: child.type ?? source.type,
purchase_type_id: child.purchase_type_id || source.purchase_type_id,
purchase_way_id: child.purchase_way_id || source.purchase_way_id,
money_way_id: child.money_way_id || source.money_way_id,
purchase_type: child.purchase_type || source.purchase_type,
purchaseType: child.purchaseType || source.purchaseType,
purchase_way: child.purchase_way || source.purchase_way || source.purchaseWay,
purchaseWay: child.purchaseWay || source.purchaseWay || source.purchase_way,
money_way_detail: (child.money_way_detail && child.money_way_detail.length)
? child.money_way_detail
: (source.money_way_detail || []),
purchase_last_flow_id: source.purchase_last_flow_id,
invite_last_flow_id: source.invite_last_flow_id,
req_last_flow_id: source.req_last_flow_id,
}
},
shouldHideSourceJoinView(row) {
return !!(row._hasSplitChildren || (!row.is_split_child && this.hasSplitSections(row)))
},
openFlowDetail(flowId) {
if (!flowId) {
return false
}
window.open(
`${process.env.VUE_APP_OUT_OLD}/index.php?s=/flow/edit/id/${flowId}&auth_token=${this.$store.getters.oa_token}`,
'bidding',
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
return true
},
async toOaDetail (tbname,row) {
const sourceRow = this.getSplitSourceRow(row) || row
if (tbname === 'caigou' && this.openFlowDetail(sourceRow.purchase_last_flow_id)) {
return
}
if (tbname === 'hetong' && this.openFlowDetail(row.join_last_flow_id)) {
return
}
let res;
const flowId = this.flowSourceId(row)
switch (tbname) {
@ -2184,11 +2247,7 @@ export default {
}
console.log(res)
if (res && res.flow?.id) {
window.open(
`${process.env.VUE_APP_OUT_OLD}/index.php?s=/flow/edit/id/${res.flow.id}&auth_token=${this.$store.getters.oa_token}`,
"bidding",
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
this.openFlowDetail(res.flow.id)
} else {
this.$message({
type: 'warning',
@ -2518,7 +2577,11 @@ export default {
rows.push({ ...source, _hasSplitChildren: hasChildren })
if (hasChildren && this.isSplitGroupExpanded(source.id)) {
children.forEach((child, index) => {
rows.push({ ...child, _splitParentId: source.id, _splitSectionIndex: index })
rows.push(this.enrichSplitChildRow({
...child,
_splitParentId: source.id,
_splitSectionIndex: index
}, source))
})
}
})
@ -2531,7 +2594,11 @@ export default {
}
const children = source.split_children || source.splitChildren || []
const rows = children.map((child, index) => {
const row = { ...child, _splitParentId: sourceId, _splitSectionIndex: index }
const row = this.enrichSplitChildRow({
...child,
_splitParentId: sourceId,
_splitSectionIndex: index
}, source)
this.handleContractFlow(row)
return row
})
@ -3010,7 +3077,6 @@ export default {
}
if (item.is_simple !== 1 && !item.is_substitute && !item.is_split_child) {
//
flowStatus["caigou"].setStatus(item.purchase_status)
if (item.purchase_status === 1) {
//
@ -3020,18 +3086,23 @@ export default {
}
}
}
if (item.is_split_child) {
// contract contract
if (item.is_simple !== 1 && !item.is_substitute) {
flowStatus['caigou'].setStatus(item.purchase_status)
const splitChildren = this.getSplitChildren(item)
const hasSections = !item.is_split_child && splitChildren.length > 0
const sourceRow = item.is_split_child ? (this.getSplitSourceRow(item) || item) : item
const sharedPurchaseRow = sourceRow || item
if (item.is_split_child || hasSections || item._hasSplitChildren) {
// / contract
if (sharedPurchaseRow.is_simple !== 1 && !sharedPurchaseRow.is_substitute) {
flowStatus['caigou'].setStatus(sharedPurchaseRow.purchase_status)
flowStatus['caigou'].setExecutable(false)
}
if (item.is_contract && item.purchase_way?.remark === 'true') {
flowStatus['zhaobiao'].setStatus(item.invite_status)
if (sharedPurchaseRow.is_contract && sharedPurchaseRow.purchase_way?.remark === 'true') {
flowStatus['zhaobiao'].setStatus(sharedPurchaseRow.invite_status)
flowStatus['zhaobiao'].setExecutable(false)
}
}
if (item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute && !item.is_split_child) {
if (item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute && !item.is_split_child && !hasSections) {
// \
flowStatus["zhaobiao"].setStatus(item.invite_status)
if (item.invite_status === 1 && item.purchase_status === 3) {
@ -3041,12 +3112,18 @@ export default {
}
if (item.is_contract) {
//
flowStatus["shenpi"].setStatus(item.join_status)
if (hasSections || item._hasSplitChildren) {
flowStatus["shenpi"].setStatus(this.aggregateSectionJoinStatus(splitChildren))
} else {
flowStatus["shenpi"].setStatus(item.join_status)
}
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))) {
if (!hasSections && !item._hasSplitChildren && canStartJoin && !item.is_split_child) {
//
flowStatus["shenpi"].setExecutable(true)
} else if (item.is_split_child && canStartJoin) {
flowStatus["shenpi"].setExecutable(true)
}
}
if (item.is_contract && !item.is_substitute && !item.is_split_child) {

Loading…
Cancel
Save