master
lion 1 month ago
parent 3c15579876
commit 26fea67ed9

@ -3,9 +3,9 @@ ENV = 'development'
# base api # 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_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_OUT_URL = http://192.168.60.18:8001
#VUE_APP_DOMIAN=http://192.168.60.99:9003/ #VUE_APP_DOMIAN=http://192.168.60.99:9003/

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

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

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

Loading…
Cancel
Save