lion 4 months ago
parent 82dd119bec
commit 397a99a61a

@ -770,14 +770,14 @@ export default {
}, },
{ {
label: '预算类型', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
width: 115, width: 115,
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.typesbefore.filter((item) => { // const res = this.typesbefore.filter((item) => {
return item.id === value // return item.id === value
}) // })
return res[0]?.name || '未知' // return res[0]?.name || ''
} // }
}, },
{ {
label: '所属年份', label: '所属年份',

@ -162,14 +162,15 @@ export default {
}, },
{ {
label: '预算类型', label: '预算类型',
prop: 'type', // prop: 'type',
prop:'type_detail.name',
width: 115, width: 115,
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.types.filter(item => { // const res = this.types.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
} // }
}, },
{ {
label: '所属年份', label: '所属年份',

@ -469,14 +469,14 @@ export default {
align: 'center' align: 'center'
}, },
{ {
label: '分类', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter(item => { // const res = this.moneyWay.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
} // }
}, },
{ {
label: '名称', label: '名称',

@ -277,7 +277,7 @@
<i class="el-icon-time" /> 查看同类历史记录 <i class="el-icon-time" /> 查看同类历史记录
</el-button> </el-button>
</div> </div>
<!-- 根据是否有第二个表格决定显示方式 --> <!-- 根据是否有第二个表格决定显示方式 -->
<div v-if="hasSecondPostPaymentForm"> <div v-if="hasSecondPostPaymentForm">
<!-- 有第二个表格时显示Tab切换 --> <!-- 有第二个表格时显示Tab切换 -->
@ -717,14 +717,14 @@ export default {
type: 'selection' type: 'selection'
}, },
{ {
label: '分类', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.planTypes.filter(item => { // const res = this.planTypes.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
} // }
}, },
{ {
label: '名称', label: '名称',
@ -1041,7 +1041,7 @@ export default {
this.forms = this.contractTemplate this.forms = this.contractTemplate
// tab // tab
this.forms1 = this.contractTemplate this.forms1 = this.contractTemplate
// //
if (this.contract.contract_template2 && this.contract.contract_template2.template) { if (this.contract.contract_template2 && this.contract.contract_template2.template) {
this.hasSecondPostPaymentForm = true this.hasSecondPostPaymentForm = true
@ -1054,7 +1054,7 @@ export default {
this.hasSecondPostPaymentForm = false this.hasSecondPostPaymentForm = false
this.forms2 = null this.forms2 = null
} }
if (!this.contract.contract_template.contract_template_fields) { if (!this.contract.contract_template.contract_template_fields) {
this.contract.contract_template.contract_template_fields = this.contract.other_data || [] this.contract.contract_template.contract_template_fields = this.contract.other_data || []
} }
@ -1154,7 +1154,7 @@ export default {
// DOM // DOM
const dom = tableIndex === 1 ? this.$refs.mainTable1 : this.$refs.mainTable2 const dom = tableIndex === 1 ? this.$refs.mainTable1 : this.$refs.mainTable2
if (dom) { if (dom) {
const input = dom.querySelector(`[data-field="${field.field}"]`) const input = dom.querySelector(`[data-field="${field.field}"]`)
if (input) { if (input) {
@ -1192,7 +1192,7 @@ export default {
// tabDOM // tabDOM
let currentDom = null let currentDom = null
let templateFields = null let templateFields = null
if (this.activePostPaymentTab === 'form1' && this.contract.contract_template) { if (this.activePostPaymentTab === 'form1' && this.contract.contract_template) {
currentDom = this.$refs.mainTable1 currentDom = this.$refs.mainTable1
templateFields = this.contract.contract_template.contract_template_fields templateFields = this.contract.contract_template.contract_template_fields
@ -1200,7 +1200,7 @@ export default {
currentDom = this.$refs.mainTable2 currentDom = this.$refs.mainTable2
templateFields = this.contract.contract_template2.contract_template_fields templateFields = this.contract.contract_template2.contract_template_fields
} }
if (currentDom && templateFields) { if (currentDom && templateFields) {
// //
const inputs = currentDom.querySelectorAll('input, select, textarea') const inputs = currentDom.querySelectorAll('input, select, textarea')
@ -1377,7 +1377,7 @@ export default {
} else if (this.activePostPaymentTab === 'form2') { } else if (this.activePostPaymentTab === 'form2') {
currentDom = this.$refs.mainTable2 currentDom = this.$refs.mainTable2
} }
if (currentDom) { if (currentDom) {
const currentPaymentInput = currentDom.querySelector('input[data-field="currentDuePayment"]') const currentPaymentInput = currentDom.querySelector('input[data-field="currentDuePayment"]')
if (currentPaymentInput) { if (currentPaymentInput) {
@ -1398,7 +1398,7 @@ export default {
} else if (this.activePostPaymentTab === 'form2') { } else if (this.activePostPaymentTab === 'form2') {
currentDom = this.$refs.mainTable2 currentDom = this.$refs.mainTable2
} }
if (currentDom && this.contract.contract_template) { if (currentDom && this.contract.contract_template) {
const updatedForms = syncFormDomToHtml(currentDom, this.contract.contract_template.contract_template_fields) const updatedForms = syncFormDomToHtml(currentDom, this.contract.contract_template.contract_template_fields)
// //
@ -1449,7 +1449,7 @@ export default {
// tabDOM // tabDOM
let currentDom = null let currentDom = null
let templateFields = null let templateFields = null
if (this.activePostPaymentTab === 'form1') { if (this.activePostPaymentTab === 'form1') {
currentDom = this.$refs.mainTable1 currentDom = this.$refs.mainTable1
if (this.contract.contract_template) { if (this.contract.contract_template) {
@ -1461,7 +1461,7 @@ export default {
templateFields = this.contract.contract_template2.contract_template_fields templateFields = this.contract.contract_template2.contract_template_fields
} }
} }
if (currentDom && templateFields) { if (currentDom && templateFields) {
//console.log(templateFields) //console.log(templateFields)
const updatedForms = syncFormDomToHtml(currentDom, templateFields) const updatedForms = syncFormDomToHtml(currentDom, templateFields)
@ -1494,22 +1494,22 @@ export default {
} else if (this.activePostPaymentTab === 'form2' && this.contract.contract_template2) { } else if (this.activePostPaymentTab === 'form2' && this.contract.contract_template2) {
templateFields = this.contract.contract_template2.contract_template_fields templateFields = this.contract.contract_template2.contract_template_fields
} }
if (templateFields) { if (templateFields) {
// //
const updatedForms = syncFormDomToHtml(dom, templateFields) const updatedForms = syncFormDomToHtml(dom, templateFields)
// tab // tab
if (this.activePostPaymentTab === 'form1') { if (this.activePostPaymentTab === 'form1') {
this.forms1 = updatedForms this.forms1 = updatedForms
} else if (this.activePostPaymentTab === 'form2') { } else if (this.activePostPaymentTab === 'form2') {
this.forms2 = updatedForms this.forms2 = updatedForms
} }
// forms // forms
this.forms = updatedForms this.forms = updatedForms
this.contract.forms = updatedForms this.contract.forms = updatedForms
// //
this.$nextTick(() => { this.$nextTick(() => {
if (this.activePostPaymentTab === 'form1' && this.$refs.mainTable1) { if (this.activePostPaymentTab === 'form1' && this.$refs.mainTable1) {
@ -1701,7 +1701,7 @@ export default {
// //
// this.calculateTotal() // this.calculateTotal()
console.log('setupAmountListeners: listeners setup completed for dom', dom) console.log('setupAmountListeners: listeners setup completed for dom', dom)
console.log('Found inputs:', { console.log('Found inputs:', {
sdate: dom.querySelectorAll('input[data-field^="sdate"]').length, sdate: dom.querySelectorAll('input[data-field^="sdate"]').length,
@ -1726,7 +1726,7 @@ export default {
} else if (this.activePostPaymentTab === 'form2') { } else if (this.activePostPaymentTab === 'form2') {
currentDom = this.$refs.mainTable2 currentDom = this.$refs.mainTable2
} }
if (currentDom) { if (currentDom) {
const sdateInput = currentDom.querySelector('input[data-field^="sdate"]') const sdateInput = currentDom.querySelector('input[data-field^="sdate"]')
const edateInput = currentDom.querySelector('input[data-field^="edate"]') const edateInput = currentDom.querySelector('input[data-field^="edate"]')
@ -1768,7 +1768,7 @@ export default {
calculateTotal() { calculateTotal() {
console.log('calculateTotal called') console.log('calculateTotal called')
// //
let currentDom = null let currentDom = null
if (this.activePostPaymentTab === 'form1') { if (this.activePostPaymentTab === 'form1') {
@ -1776,12 +1776,12 @@ export default {
} else if (this.activePostPaymentTab === 'form2') { } else if (this.activePostPaymentTab === 'form2') {
currentDom = this.$refs.mainTable2 currentDom = this.$refs.mainTable2
} }
if (currentDom) { if (currentDom) {
console.log('calculateTotal: calculating for current tab dom', currentDom) console.log('calculateTotal: calculating for current tab dom', currentDom)
this.calculateTableTotal(currentDom) this.calculateTableTotal(currentDom)
} }
// //
if (this.$refs.zoomedTable) { if (this.$refs.zoomedTable) {
console.log('calculateTotal: calculating for zoomed table') console.log('calculateTotal: calculating for zoomed table')

@ -1441,14 +1441,14 @@ export default {
fixed: 'left' fixed: 'left'
}, },
{ {
label: '分类', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter(item => { // const res = this.moneyWay.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
}, // },
width: 100, width: 100,
fixed: 'left' fixed: 'left'
}, },

@ -272,13 +272,13 @@ export default {
planTableSearch: [ planTableSearch: [
{ {
label: '分类', label: '分类',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter((item) => { // const res = this.moneyWay.filter((item) => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
}, // },
width: 170 width: 170
}, },
{ {

@ -1013,14 +1013,14 @@ export default {
fixed: 'left' fixed: 'left'
}, },
{ {
label: '分类', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter(item => { // const res = this.moneyWay.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
}, // },
width: 100, width: 100,
fixed: 'left' fixed: 'left'
}, },

@ -172,13 +172,43 @@
placeholder="请选择资金列支渠道" placeholder="请选择资金列支渠道"
@change="moneyWayChange" @change="moneyWayChange"
> >
<el-option v-for="item in planTypes" :key="item.id" :value="item.id" :label="item.value" /> <el-option v-for="item in planTypes_arr" :key="item.id" :value="item.id" :label="item.value" />
</el-select> </el-select>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:extraFormBottom> <template v-slot:extraFormBottom>
<Input v-model="plansSelect.name" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" /> <div style="display: flex;">
<el-select
v-model="plansSelect.typeName"
clearable
placeholder="请选择预算类型"
style="width: 200px;margin-right:10px"
@change="changeType"
size="small"
>
<el-option disabled value="" style="height:150px;overflow: scroll;">
<el-tree
class="planselsct"
ref="tree1"
style="width:300px"
default-expand-all
:default-checked-keys="checkArr"
:check-strictly="true"
:data="planTypes"
show-checkbox
node-key="id"
highlight-current
:props="defaultProps"
@check="(data, node)=>{return getSelectedNodes(data,node,'tree1')}"
/>
</el-option>
</el-select>
<Input v-model="plansSelect.name" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
</div>
<div class="contract-add-plan" style="min-width: 300px;"> <div class="contract-add-plan" style="min-width: 300px;">
<template v-if="paymentRegistrationForm.plan.length > 0"> <template v-if="paymentRegistrationForm.plan.length > 0">
<Tag v-for="item in paymentRegistrationForm.plan" :key="item.plan_id" closable color="primary" @on-close="delPlan(item)">{{ item.label }}</Tag> <Tag v-for="item in paymentRegistrationForm.plan" :key="item.plan_id" closable color="primary" @on-close="delPlan(item)">{{ item.label }}</Tag>
@ -231,12 +261,23 @@ import {
} from 'element-ui' } from 'element-ui'
import { import {
parseTime, parseTime,
moneyFormatter moneyFormatter,
buildTree
} from '@/utils' } from '@/utils'
import {
index as getPlanType
} from '@/api/budget/plantype.js'
export default { export default {
data() { data() {
return { return {
checkArr: [],
defaultProps: {
children: 'children',
label: 'name'
},
planTotal: 0, planTotal: 0,
pageIndex: 1, pageIndex: 1,
// //
@ -244,6 +285,7 @@ export default {
contract: {}, contract: {},
payment: [], // payment: [], //
planTypes: [], planTypes: [],
planTypes_arr:[],
payTable: [{ payTable: [{
label: '申请金额', label: '申请金额',
prop: 'apply_money', prop: 'apply_money',
@ -326,7 +368,9 @@ export default {
plansSelect: { plansSelect: {
page: 1, page: 1,
page_size: 10, page_size: 10,
name: '' name: '',
type:'',
typeName:'',
}, },
planTable: [{ planTable: [{
sortable: false, sortable: false,
@ -340,15 +384,15 @@ export default {
width: 96 width: 96
}, },
{ {
label: '分类', label: '预算类型',
width: 136, width: 136,
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.planTypes.filter(item => { // const res = this.planTypes.filter(item => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
} // }
}, },
{ {
label: '科室', label: '科室',
@ -407,8 +451,9 @@ export default {
} }
}, },
async mounted() { async mounted() {
// await this.getBudgets() await this.getBudgets()
await this.getPlanTypes() await this.getPlanTypes()
}, },
methods: { methods: {
delPlan(val) { delPlan(val) {
@ -428,22 +473,22 @@ export default {
}, },
// //
moneyWayChange() { moneyWayChange() {
const page = 1 // const page = 1
const pageSize = this.plansSelect.page_size // const pageSize = this.plansSelect.page_size
const name = this.plansSelect.name // const name = this.plansSelect.name
this.plansSelect = { // this.plansSelect = {
page: page, // page: page,
page_size: pageSize, // page_size: pageSize,
name: name // name: name
} // }
if (this.paymentRegistrationForm.moneyWay) { if (this.paymentRegistrationForm.moneyWay) {
const _arr = [] const _arr = []
this.paymentRegistrationForm.moneyWay.forEach((item, index) => { this.paymentRegistrationForm.moneyWay.forEach((item, index) => {
_arr.push(item) _arr.push(item)
}) })
this.plansSelect['type'] = _arr + '' // this.plansSelect['type'] = _arr + ''
} }
this.getBudgets() // this.getBudgets()
}, },
inputMoney(e, row) { inputMoney(e, row) {
@ -455,11 +500,51 @@ export default {
}) })
}, },
async getPlanTypes() { async getPlanTypes() {
const res = await getparameter({ const res1 = await getparameter({
number: 'money_way' number: 'money_way'
}) })
this.planTypes = res.detail this.planTypes_arr = res1.detail
const res = await getPlanType({
page_size: 999,
page: 1,
sort_name: 'sort',
sort_type: 'asc',
filter: [{
key: 'year',
op: 'eq',
value: this.$moment().format('YYYY'),
}]
})
this.planTypes = buildTree(res.data)
},
changeType(e){
if(!e){
this.plansSelect.type = ''
this.plansSelect.typeName = ''
}
}, },
getSelectedNodes(data, node, ref) {
const ref_data = ref || 'tree'
this.$refs[ref_data].setCheckedKeys([])
this.checkArr = []
if (data.children && data.children.length > 0) {
this.$Message.warning('当前节点不可选择')
this.form.type = ''
this.select.type = ''
this.editorForm.type = ''
this.$refs[ref_data].setCheckedKeys([])
return
}
this.$refs[ref_data].setCheckedKeys([]) //
this.$refs[ref_data].setCheckedNodes([data]) //
this.plansSelect.type = data.id
this.plansSelect.typeName = data.name
this.getBudgets()
this.$forceUpdate()
},
// //
pageChange(e) { pageChange(e) {
this.pageIndex = e this.pageIndex = e
@ -685,4 +770,7 @@ export default {
z-index: 2; z-index: 2;
} }
} }
::v-deep .planselsct .el-checkbox__input .el-checkbox__inner {
border-radius: 50%;
}
</style> </style>

@ -223,13 +223,13 @@ export default {
planTableSearch: [ planTableSearch: [
{ {
label: '分类', label: '分类',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter((item) => { // const res = this.moneyWay.filter((item) => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
}, // },
width: 120 width: 120
}, },
{ {
@ -513,10 +513,10 @@ export default {
if (this.selectDate) url += '&date=' + this.selectDate if (this.selectDate) url += '&date=' + this.selectDate
if (this.keyword) url += '&keyword=' + this.keyword if (this.keyword) url += '&keyword=' + this.keyword
if (typeof this.status !== 'undefined') { if (typeof this.status !== 'undefined') {
url += '&status=' + this.status url += '&status=' + this.status
} }
if (this.select.plan_id) { if (this.select.plan_id) {
url += '&act_plan_link_id=' + this.select.plan_id url += '&act_plan_link_id=' + this.select.plan_id
} }
url += '&is_export=' + this.is_export url += '&is_export=' + this.is_export
url = location.host + url url = location.host + url

@ -307,14 +307,14 @@ export default {
}, },
planTable: [ planTable: [
{ {
label: '分类', label: '预算类型',
prop: 'type', prop: 'type_detail.name',
formatter: (cell, data, value) => { // formatter: (cell, data, value) => {
const res = this.moneyWay.filter((item) => { // const res = this.moneyWay.filter((item) => {
return item.id === value // return item.id === value
}) // })
return res[0]?.value || '未知' // return res[0]?.value || ''
}, // },
width: 100, width: 100,
fixed: 'left' fixed: 'left'
}, },

Loading…
Cancel
Save