master
lion 1 month ago
parent 3c15579876
commit 26fea67ed9

@ -3,9 +3,9 @@ ENV = 'development'
# base api
VUE_APP_DOMIAN=http://192.168.60.99:8003/
VUE_APP_DOMIAN=http://192.168.60.99:9003/
VUE_APP_BASE_API = ''
VUE_APP_UPLOAD=http://192.168.60.99:8003/api/admin/upload-file
VUE_APP_UPLOAD=http://192.168.60.99:9003/api/admin/upload-file
VUE_APP_OUT_URL = http://192.168.60.18:8001
#VUE_APP_DOMIAN=http://192.168.60.99:9003/

@ -107,7 +107,7 @@ export default {
label: '进展率',
width: 200,
customFn: (row) => {
let m2 = row.update_money;
let m2 = row.update_money||0;
let m1 = row.money;
let m3 = row.use_money_total;
let per = 0;
@ -169,7 +169,7 @@ export default {
for (let m of res.list.data) {
m.pid_info_name = m.pid_info?.name
m.pid_info_id = m.pid_info?.id
console.log('m.pid_info_name',m.pid_info_name)
// console.log('m.pid_info_name',m.pid_info_name)
}
res.list.data.sort((a,b)=>{
return b.pid_info_id - a.pid_info_id
@ -186,6 +186,20 @@ export default {
},
selected (selections, selected) {
// selections:
// selected:
// selected
if (!selected || !selected.id) {
// selected使 selections
this.selections = Array.isArray(selections) ? selections : []
return
}
// 使 selections
// selections
this.selections = Array.isArray(selections) ? [...selections] : []
// if (selected['pid_info_name-span']?.rowspan > 1) {
// if (this.selections.find(i => i.id === selected.id)) {
// let len = selected['pid_info_name-span'].rowspan
@ -197,17 +211,29 @@ export default {
// this.selections.push(...this.list.slice(idx,idx+len))
// }
// } else {
if (this.selections.find(i => i.id === selected.id)) {
let idx = this.selections.indexOf(this.selections.find(i => i.id === selected.id))
this.selections.splice(idx,1)
} else {
this.selections.push(selected)
}
// const existingIndex = this.selections.findIndex(i => i.id === selected.id)
// if (existingIndex > -1) {
// //
// this.selections.splice(existingIndex, 1)
// } else {
// //
// this.selections.push(selected)
// }
// }
},
selectAll (selections) {
this.selections = selections
// selections
this.selections = Array.isArray(selections) ? [...selections] : []
//
this.$nextTick(() => {
//
if (this.selections.length === 0) {
if (this.$refs.xyTable && this.$refs.xyTable.clearSelection) {
this.$refs.xyTable.clearSelection()
}
}
})
},
summary ({ columns,data }) {
return columns.map((column,index) => {
@ -242,6 +268,19 @@ export default {
this.getPlanProgress(val)
},
immediate: true
},
drawer: {
handler: function(val) {
if (val) {
//
this.selections = []
this.$nextTick(() => {
if (this.$refs.xyTable && this.$refs.xyTable.clearSelection) {
this.$refs.xyTable.clearSelection()
}
})
}
}
}
},
created() {

@ -23,7 +23,7 @@
type="year"
placement="bottom-start"
style="width: 160px"
@on-change="(e)=>select.year = e"
@on-change="(e)=>{select.year = e,getType()}"
/>
</span>
@ -37,7 +37,7 @@
type="date"
style="width: 160px"
>
<el-option v-for="item in type" :key="item.id" :value="item.id" :label="item.value" />
<el-option v-for="item in type" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</span>
@ -97,6 +97,9 @@ import {
import {
getparameter
} from '@/api/system/dictionary'
import {
index as getPlanType
} from '@/api/budget/plantype.js'
import {
moneyFormatter
} from '@/utils'
@ -152,7 +155,10 @@ export default {
prop: 'update_money',
width: 180,
label: '调整后预算数(元)',
align: 'right'
align: 'right',
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
prop: 'use_money_total',
@ -184,7 +190,7 @@ export default {
width: 200,
fixed: 'right',
customFn: (row) => {
const per = (isNaN(Number(row.use_money_total ?? 0)) ? 0 : Number(row.use_money_total ?? 0)) / ((Number(row.update_money)) || (Number(row.money)))
const per = (isNaN(Number(row.use_money_total ?? 0)) ? 0 : Number(row.use_money_total ?? 0)) / ((Number(row.update_money||0)) || (Number(row.money)))
return (<div>
<el-progress percentage = {
Number((per * 100).toFixed(2))
@ -200,7 +206,7 @@ export default {
const res = this.type.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
return res[0]?.name || '未知'
}
},
{
@ -296,10 +302,21 @@ export default {
},
async getType() {
const res = await getparameter({
{/* const res = await getparameter({
number: 'money_way'
}) */}
const res = await getPlanType({
page_size: 999,
page: 1,
sort_name: 'sort',
sort_type: 'asc',
filter: [{
key: 'year',
op: 'eq',
value: this.select.year ? this.select.year : ''
}]
})
this.type = res.detail
this.type = res.data
},
//
pageChange(e) {
@ -338,7 +355,7 @@ export default {
this.total = res.list.total
this.useMoneyTotal = res.use_money_total
this.moneyTotal = res.money
this.updateMoneyTotal = res.update_money
this.updateMoneyTotal = res.update_money||0
this.rateTotal = this.toper(this.updateMoneyTotal, this.moneyTotal, this.useMoneyTotal)
console.log("list",this.list)
@ -372,7 +389,7 @@ export default {
money: parseFloat(pidInfo.money).toFixed(2),
type: pidInfo.type,
isParent:true,
update_money: parseFloat(pidInfo.update_money).toFixed(2),
update_money: parseFloat(pidInfo.update_money||0).toFixed(2),
use_money_total: parseFloat(useMoneyTotal).toFixed(2), //
children: children //
};
@ -381,7 +398,7 @@ export default {
const arrayWithPer = mergedResult.map(row => {
// peruse_money_total / (update_money || money) null NaN
const useMoneyTotal = Number(row.use_money_total ?? 0); // null 0
const denominator = Number(row.update_money) || Number(row.money); // update_money money
const denominator = Number(row.update_money||0) || Number(row.money); // update_money money
const calculation_result = isNaN(useMoneyTotal / denominator) ? 0 : useMoneyTotal / denominator;
return {

@ -19,8 +19,8 @@
style="width: 130px"
>
<Option v-for="item in parameterDetails" :key="item.id" :value="item.id">{{
item.value
}}</Option>
item.name
}}</Option>
</Select>
</span>
<span style="padding: 0 6px;word-break: keep-all;">年份</span>
@ -31,7 +31,7 @@
type="year"
placement="bottom-start"
style="width: 160px"
@on-change="(e)=>select.year = e"
@on-change="(e)=>{select.year = e,getList()}"
/>
</span>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
@ -46,7 +46,7 @@
type="primary"
style="margin-left: 10px"
ghost
@click=""
@click="select = {parameter_detail_id:'',type:1,page:1,page_size:10,keyword:'',is_auth:1,year:''}"
>重置</Button>
<Button
type="primary"
@ -85,7 +85,7 @@ import * as XLSX from 'xlsx'
import { saveAs } from 'file-saver'
import { departmentMoney } from '@/api/static'
import { getparameter } from '@/api/system/dictionary'
import { index as getPlanType } from '@/api/budget/plantype.js'
export default {
data() {
return {
@ -369,10 +369,21 @@ export default {
},
methods: {
async getTypes() {
const res = await getparameter({
number: 'money_way'
// const res = await getparameter({
// number: 'money_way'
// })
const res = await getPlanType({
page_size: 999,
page: 1,
sort_name: 'sort',
sort_type: 'asc',
filter: [{
key: 'year',
op: 'eq',
value: this.select.year ? this.select.year : ''
}]
})
this.parameterDetails = res.detail
this.parameterDetails = res.data
},
exportXLSX() {

Loading…
Cancel
Save