master
lion 8 months ago
commit 1f4f9b19cc

@ -51,6 +51,15 @@ export function getContractCategoryTemplate(params) {
})
}
// 获取合同分类模版配置参数
export function getContractCategoryTemplateConfigParams(params) {
return request({
method: 'get',
url: '/api/admin/contract-category/config',
params
})
}
// 删除合同分类模版
export function deleteContractCategoryTemplate(id) {
return request({

File diff suppressed because it is too large Load Diff

@ -123,7 +123,18 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="paymentForm" label="支付表格" width="100"></el-table-column>
<el-table-column label="支付表格">
<el-table-column prop="prePaymentForm" label="事前支付表格" width="120">
<template #default="scope">
<span>{{ scope.row.prePaymentForm || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="postPaymentForm" label="事后支付表格" width="120">
<template #default="scope">
<span>{{ scope.row.postPaymentForm || '-' }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button size="small" @click="handleEdit(scope.row)"></el-button>
@ -220,11 +231,10 @@
<div class="checkbox-group">
<el-checkbox v-model="form.projectName"></el-checkbox>
<el-checkbox v-model="form.projectType"></el-checkbox>
<el-checkbox v-model="form.purchaseWay"></el-checkbox>
<el-checkbox v-model="form.budgetPrice"></el-checkbox>
</div>
<div class="checkbox-group">
<el-checkbox v-model="form.budgetPrice"></el-checkbox>
<el-checkbox v-model="form.fundChannel"></el-checkbox>
<el-checkbox v-model="form.budgetPlan"></el-checkbox>
</div>
@ -242,8 +252,19 @@
</div>
<!-- 支付表格 -->
<el-form-item label="支付表格" prop="paymentForm" class="form-section">
<el-select v-model="form.paymentForm" placeholder="请选择支付表格" class="form-input">
<el-form-item label="事前支付表格" prop="prePaymentForm" class="form-section">
<el-select v-model="form.prePaymentForm" placeholder="请选择事前支付表格" class="form-input" clearable>
<el-option
v-for="item in paymentFormOptions"
:key="item.id"
:label="item.label"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="事后支付表格" prop="postPaymentForm" class="form-section">
<el-select v-model="form.postPaymentForm" placeholder="请选择事后支付表格" class="form-input" clearable>
<el-option
v-for="item in paymentFormOptions"
:key="item.id"
@ -308,7 +329,8 @@ export default {
purchaseApproval: false,
tenderReview: false,
contractSign: false,
paymentForm: ''
prePaymentForm: '', //
postPaymentForm: '' //
},
rules: {
category: [
@ -326,11 +348,15 @@ export default {
purchaseMethod: [
{ required: true, message: '请选择采购方式', trigger: 'change' }
],
paymentForm: [
{ required: true, message: '请选择支付表格', trigger: 'change' }
prePaymentForm: [
//
],
postPaymentForm: [
{ required: true, message: '请选择事后支付表格', trigger: 'change' }
]
},
originalPaymentForm: ''
originalPrePaymentForm: '',
originalPostPaymentForm: ''
}
},
created() {
@ -397,7 +423,11 @@ export default {
purchaseApproval: item.flow_purchase || false,
tenderReview: item.flow_invite || false,
contractSign: item.flow_join || false,
paymentForm: item.contract_template?.name || '-'
prePaymentForm: item.before_contract_template?.name || '-',
postPaymentForm: item.contract_template?.name || '-',
// ID
before_contract_template_id: item.before_contract_template_id,
contract_template_id: item.contract_template_id
}
})
} else {
@ -631,7 +661,8 @@ export default {
purchaseApproval: false,
tenderReview: false,
contractSign: false,
paymentForm: ''
prePaymentForm: '',
postPaymentForm: ''
}
// 使
@ -639,7 +670,7 @@ export default {
this.dialogVisible = true
},
handleEdit(row) {
async handleEdit(row) {
this.dialogTitle = '编辑配置'
//
@ -647,9 +678,12 @@ export default {
this.contractTypeOptions = []
this.purchaseFormOptions = []
//
this.getPaymentFormOptions()
.then(() => {
try {
//
await this.getPaymentFormOptions()
console.log('编辑行数据:', row) //
//
this.form = {
id: row.id, // ID
@ -668,22 +702,29 @@ export default {
purchaseApproval: row.purchaseApproval === true || row.purchaseApproval === 1,
tenderReview: row.tenderReview === true || row.tenderReview === 1,
contractSign: row.contractSign === true || row.contractSign === 1,
paymentForm: row.paymentForm || ''
prePaymentForm: row.before_contract_template_id || '',
postPaymentForm: row.contract_template_id || ''
}
//
this.originalPaymentForm = row.paymentForm
this.originalPrePaymentForm = row.before_contract_template_id
this.originalPostPaymentForm = row.contract_template_id
//
this.loadEditOptions(row)
//
this.$nextTick(() => {
console.log('表单数据:', this.form)
console.log('支付表格选项:', this.paymentFormOptions)
//
this.dialogVisible = true
})
.catch(error => {
console.error('加载支付表格选项失败:', error)
this.$message.error('加载支付表格选项失败')
})
} catch (error) {
console.error('加载数据失败:', error)
this.$message.error('加载数据失败')
}
},
//
@ -798,14 +839,22 @@ export default {
// ID
submitData.id = this.form.id
//
if (this.form.paymentForm && this.form.paymentForm !== this.originalPaymentForm) {
submitData.contract_template_id = this.form.paymentForm
//
if (this.form.prePaymentForm === '') {
submitData.before_contract_template_id = ''
} else if (this.form.prePaymentForm && this.form.prePaymentForm !== this.originalPrePaymentForm) {
submitData.before_contract_template_id = this.form.prePaymentForm
}
//
if (this.form.postPaymentForm && this.form.postPaymentForm !== this.originalPostPaymentForm) {
submitData.contract_template_id = this.form.postPaymentForm
}
} else {
//
if (this.form.paymentForm) {
submitData.contract_template_id = this.form.paymentForm
submitData.before_contract_template_id = this.form.prePaymentForm || ''
if (this.form.postPaymentForm) {
submitData.contract_template_id = this.form.postPaymentForm
}
}
@ -850,7 +899,8 @@ export default {
//
async getPaymentFormOptions() {
try {
const res = await getContractFormList({})
// status=1
const res = await getContractFormList({ status: 1 })
if (res.errcode !== undefined) {
this.$message.error(res.errmsg || '获取支付表格选项失败')
return
@ -862,7 +912,8 @@ export default {
id: item.id,
label: item.name || item.title || `附件${item.id}`
}))
this.originalPaymentForm = res.data[0].id // ID
console.log('支付表格选项:', this.paymentFormOptions)
} else {
this.paymentFormOptions = []
}

@ -561,23 +561,24 @@
},
//
selectPlan(sel, row) {
if (sel) {
let select = sel.map(item => {
return {
label: item.name,
value: {
plan_id: item.id,
use_money: item.useMoney,
use_money: item.useMoney || 0,
new_money: item.money
}
}
})
this.plan = [...this.detail.plan, ...select]
//
const existingPlanIds = this.detail.plan.map(p => p.value.plan_id)
const newPlans = select.filter(p => !existingPlanIds.includes(p.value.plan_id))
this.plan = [...this.detail.plan, ...newPlans]
} else {
this.plan = this.detail.plan;
this.plan = this.detail.plan
}
},
delPlan(val) {
@ -611,15 +612,18 @@
},
//
toggleSelection(plans) {
var selPlans = [...this.detail.plan, ...this.plan]
if (plans) {
this.plans.filter(plan => {
if (plans.includes(plan.id)) {
plan.useMoney = selPlans[plans.indexOf(plan.id)].value.use_money
return true
}
}).map(row => {
this.$refs.editorPlanTable.toggleRowSelection(row)
if (plans && plans.length > 0) {
this.plans.forEach(plan => {
const isSelected = plans.includes(plan.id)
if (isSelected) {
const selectedPlan = this.plan.find(p => p.value.plan_id === plan.id)
if (selectedPlan) {
plan.useMoney = selectedPlan.value.use_money
}
this.$nextTick(() => {
this.$refs.editorPlanTable.toggleRowSelection(plan, true)
})
}
})
} else {
this.$refs.editorPlanTable.clearSelection()
@ -649,13 +653,12 @@
price: res.plan_price,
isBudget: res.is_plan === 1 ? true : false,
plan: res.plans.map(item => {
const planLink = res.plan_link.find(link => link.plan_id === item.id)
return {
label: item.name,
value: {
plan_id: item.id,
use_money: res.plan_link.filter(item1 => {
return item1.plan_id === item.id
})[0].use_money,
use_money: planLink ? planLink.use_money : 0,
new_money: item.money
}
}
@ -664,15 +667,8 @@
gov_plane: res.gov_plane,
contract_carry_department: res.contract_carry_department.map(i => i.carry_department_id)
}
this.plan = [...this.detail.plan]
this.$refs['govPlane'].selected = res.gov_plane
this.plan = this.detail.plan
this.oaFlow = {
hetonghuiqian: res.join_last_flow_id,
caigou: res.purchase_last_flow_id,
zhaobiaowenjianshencha: res.invite_last_flow_id,
qingshi: res.req_last_flow_id
}
},
//y
checkName(e) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save