07e70c68 by zrj

大屏日光夜光模式修改

1 parent 4a087cfd
......@@ -21,6 +21,7 @@
:size="size"
style="width: 100%;height: 100%"
value-format="YYYY-MM"
:disabled-date="disabledFutureMonth"
></el-date-picker>
</div>
<el-row class="w100">
......@@ -60,7 +61,7 @@ const nowDate = ref(`${year}-${formatMonth(month)}`)
let selectBase = ref()
let baseList = ref()
let isLeader = ref(false)
// url.value = 'http://192.168.1.152:8899/login/sid=986af69a-c0a2-44a8-9eb5-6702f5ff9a13#/'
// url.value = 'http://192.168.1.152:8899/login/sid=164eaf97-0f29-45fe-b273-8c6b520c41a6#/'
url.value = window.location.href
result.value = url.value?.split('=')[1]?.split('#')[0];
......@@ -86,6 +87,21 @@ onMounted(() => {
}
})
const disabledFutureMonth = (date) => {
// 获取当前月份的年和月
const now = new Date()
const currentYear = now.getFullYear()
const currentMonth = now.getMonth()
// 获取选中日期对应的年和月
const targetYear = date.getFullYear()
const targetMonth = date.getMonth()
// 判断逻辑:
// 1. 选中年份 > 当前年份 → 禁用
// 2. 选中年份 = 当前年份,但选中月份 > 当前月份 → 禁用
return targetYear > currentYear || (targetYear === currentYear && targetMonth > currentMonth)
}
async function handelGetYS000() {
const res = await getYS000(result.value)
......
......@@ -177,15 +177,25 @@ async function handelGetYS006() {
obj.value["SELECTDATE"] = hDate
obj.value["BASE"] = sBase
const res = await getYS006(url.value, obj.value)
let monthFlag = false
let currentMonth = new Date().getMonth()+1
for (const v1 of list.value) {
for (const v2 of v1.list) {
if (v2.MONTH === currentMonth && v2.YSBALANCE != 0) {
monthFlag = true
}
}
}
currentMonth = monthFlag ? currentMonth : currentMonth - 1
list.value = res.data.baselist
set1.value = []
set2.value = []
set3.value = []
s1.value = [...new Array(12).fill(0)]
s1.value = [...new Array(currentMonth).fill(0)]
s2.value = [...new Array(12).fill(0)]
s3.value = [...new Array(12).fill(0)]
s4.value = [...new Array(12).fill(0)]
s4.value = [...new Array(currentMonth).fill(0)]
// h3.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
type2.value = []
for (const v1 of list.value) {
......@@ -211,10 +221,12 @@ async function handelGetYS006() {
type2.value.push(v1.BASEJC)
for (const v2 of v1.list) {
const i = v2.MONTH - 1; // 转为 0~11 的索引
s1.value[i] += v2.INCOME / 10000 || 0;
if (i < currentMonth) {
s1.value[i] += v2.INCOME / 10000 || 0;
s4.value[i] += v2.YSBALANCE / 10000 || 0;
}
s2.value[i] += v2.LASTINCOME / 10000 || 0;
s3.value[i] += v2.LASTYSBALANCE / 10000 || 0;
s4.value[i] += v2.YSBALANCE / 10000 || 0;
}
}
......@@ -235,7 +247,7 @@ async function handelGetYS006() {
set3.value.forEach((n,index) => {
n.itemStyle = {borderColor: colorList2[index], borderWidth: 2}
})
setA(set1.value, set2.value, set3.value)
setB(
type1.value.includes('1') ? s1.value : [],
......@@ -315,19 +327,33 @@ function handelSelect1() {
}
function handelSelect2() {
s1.value = [...new Array(12).fill(0)]
let arr = type2.value.map(val => list.value.find(item => item.BASEJC === val))
let monthFlag = false
let currentMonth = new Date().getMonth()+1
for (const v1 of arr) {
for (const v2 of v1.list) {
if (v2.MONTH === currentMonth && v2.YSBALANCE != 0) {
monthFlag = true
}
}
}
currentMonth = monthFlag ? currentMonth : currentMonth - 1
s1.value = [...new Array(currentMonth).fill(0)]
s2.value = [...new Array(12).fill(0)]
s3.value = [...new Array(12).fill(0)]
s4.value = [...new Array(12).fill(0)]
let arr = type2.value.map(val => list.value.find(item => item.BASEJC === val))
s4.value = [...new Array(currentMonth).fill(0)]
for (const v1 of arr) {
for (const v2 of v1.list) {
const i2 = v2.MONTH - 1; // 转为 0~11 的索引
s1.value[i2] += v2.INCOME / 10000 || 0;
if (i2 < currentMonth) {
s1.value[i2] += v2.INCOME / 10000 || 0;
s4.value[i2] += v2.YSBALANCE / 10000 || 0;
}
s2.value[i2] += v2.LASTINCOME / 10000 || 0;
s3.value[i2] += v2.LASTYSBALANCE / 10000 || 0;
s4.value[i2] += v2.YSBALANCE / 10000 || 0;
}
}
......
......@@ -66,8 +66,8 @@
placeholder="全部"
size="small"
@change="handelSelect4">
<el-option :label="`${Year1}年`" value="1"/>
<el-option :label="`${Year2}年`" value="2"/>
<el-option :label="`${Year2}年`" value="1"/>
<el-option :label="`${Year1}年`" value="2"/>
</el-select>
</div>
<div class="itemBox" v-if="myType">
......@@ -131,6 +131,8 @@ const sBase = computed(() => props.sBase)
watch(() => props.historyDate,(newVal) => {
if (isMounted.value) {
nowYear.value = parseInt(newVal.substring(0,4))
nowMonth.value = parseInt(newVal.substring(6,7))
Year1.value = parseInt(hDate.value.substring(0,4)) - 1
Year1.value = parseInt(hDate.value.substring(0,4)) - 1
Year2.value = parseInt(hDate.value.substring(0,4))
legend1.value = [`${Year1.value}待收款`, `${Year1.value}收费单待签`, `预提占比`]
......@@ -257,6 +259,8 @@ const type8 = ref(0)
const month8 = ref([])
const year8 = ref([])
let nowYear = ref(parseInt(hDate.value.substring(0,4)))
let nowMonth = ref(parseInt(hDate.value.substring(6,7)))
let tMonth = ref(0)
const list8 = ref([
{
BASE: '上海分公司1',
......@@ -309,8 +313,8 @@ const h6 = ref([])
let Year1 = ref(parseInt(hDate.value.substring(0,4)) - 1)
let Year2 = ref(parseInt(hDate.value.substring(0,4)))
const legend1 = ref([`${Year1.value}待收款`, `${Year1.value}收费单待签`, `预提占比`])
const legend2 = ref([`${Year2.value}待收款`, `${Year2.value}收费单待签`, `同期预提占比`])
const legend1 = ref([`${Year1.value}待收款`, `${Year1.value}收费单待签`, `同期预提占比`])
const legend2 = ref([`${Year2.value}待收款`, `${Year2.value}收费单待签`, `预提占比`])
const type4 = ref(['1','2'])
const type3 = ref('0')
......@@ -390,29 +394,33 @@ async function handelGetYS006() {
obj.value["SELECTDATE"] = hDate
obj.value["BASE"] = sBase
const cityName = ['陕西','山西','伊拉克','新疆','环保','深圳','湛江','海南','塘沽','上海']
const res = await getYS006(url.value, obj.value)
list.value = res.data.baselist
list.value = cityName.map(n => list.value.find(item => item.BASEJC === n))
console.log(list.value)
arrX.value = []
if (myType.value) {
tMonth.value = findInvalidMonth(nowMonth.value - 1, list.value)
for (let i=0; i<list.value.length; i++) {
let row = list.value[i]
arrX.value.push(list.value[i].BASEJC)
h2.value[i] = {value:'',info:''}
h5.value[i] = {value:'',info:''}
h1.value[i] = list.value[i].YSDSKTOTAL / 10000;
h2.value[i].value = list.value[i].SFDDQTOTAL / 10000;
h3.value[i] = list.value[i].BASEYTZB
h4.value[i] = list.value[i].LASTYSDSKTOTAL / 10000;
h5.value[i].value = list.value[i].LASTSFDDQTOTAL / 10000
h6.value[i] = list.value[i].BASELASTYTZB
h1.value[i] = list.value[i].list[tMonth.value].JNYSDSK / 10000;
h2.value[i].value = list.value[i].list[tMonth.value].JNSFDDQ / 10000;
h3.value[i] = list.value[i].list[tMonth.value].MONTHYTZB
h4.value[i] = list.value[i].list[tMonth.value].YSDSK / 10000;
h5.value[i].value = list.value[i].list[tMonth.value].SFDDQ / 10000
h6.value[i] = list.value[i].list[tMonth.value].MONTHLASTYTZB
for (let n=0; n<row.list.length; n++) {
h2.value[i].info += row.list[n].YSWELLINFO
h5.value[i].info += row.list[n].JNYSWELLINFO
}
h2.value[i].info += list.value[i].list[tMonth.value].JNYSWELLINFO
h5.value[i].info += list.value[i].list[tMonth.value].YSWELLINFO
}
} else {
h3.value = []
h2.value = []
......@@ -428,10 +436,10 @@ async function handelGetYS006() {
for (let i=0; i<obj2.list.length; i++) {
h2.value[i] = {value:'',info:''}
h5.value[i] = {value:'',info:''}
h1.value[i] = obj2.list[i].YSDSK / 10000;
h2.value[i].value = obj2.list[i].SFDDQ / 10000;
h4.value[i] = obj2.list[i].JNYSDSK / 10000;
h5.value[i].value = obj2.list[i].JNSFDDQ / 10000;
h1.value[i] = obj2.list[i].JNYSDSK / 10000;
h2.value[i].value = obj2.list[i].JNSFDDQ / 10000;
h4.value[i] = obj2.list[i].YSDSK / 10000;
h5.value[i].value = obj2.list[i].SFDDQ / 10000;
h2.value[i].info += obj2.list[i].YSWELLINFO
h5.value[i].info += obj2.list[i].JNYSWELLINFO
......@@ -447,11 +455,39 @@ async function handelGetYS006() {
type4.value.includes('2') ? h4.value : [],
type4.value.includes('2') ? h5.value : [],
type4.value.includes('2') ? h6.value : [],
type4.value.includes('1') ? legend1.value : [],
type4.value.includes('2') ? legend2.value : [],
type4.value.includes('1') ? legend2.value : [],
type4.value.includes('2') ? legend1.value : [],
)
}
function findInvalidMonth(month, data) {
const d1 = []
const d2 = []
let flag = true
for (let i=0; i<data.length; i++) {
d1[i] = data[i].list[month].JNYSDSK / 10000;
d2[i] = data[i].list[month].JNSFDDQ / 10000;
}
d1.forEach(n => {
if (n !== 0) {
flag = false
}
})
d2.forEach(n => {
if (n !== 0) {
flag = false
}
})
if (flag) {
return month - 1 > -1 ? month - 1 : 0
}
return month
}
async function handelGetYS007() {
const res = await getYS007(url.value, obj.value)
list7.value = res.data.list
......@@ -663,17 +699,15 @@ function handelSelect3() {
h2.value[i] = {value:'',info:''}
h5.value[i] = {value:'',info:''}
h1.value[i] = list.value[i].YSDSKTOTAL / 10000;
h2.value[i].value = list.value[i].SFDDQTOTAL / 10000;
h3.value[i] = list.value[i].BASEYTZB
h4.value[i] = list.value[i].LASTYSDSKTOTAL / 10000;
h5.value[i].value = list.value[i].LASTSFDDQTOTAL / 10000
h6.value[i] = list.value[i].BASELASTYTZB
h1.value[i] = list.value[i].list[tMonth.value].JNYSDSK / 10000;
h2.value[i].value = list.value[i].list[tMonth.value].JNSFDDQ / 10000;
h3.value[i] = list.value[i].list[tMonth.value].MONTHYTZB
h4.value[i] = list.value[i].list[tMonth.value].YSDSK / 10000;
h5.value[i].value = list.value[i].list[tMonth.value].SFDDQ / 10000
h6.value[i] = list.value[i].list[tMonth.value].MONTHLASTYTZB
for (let n=0; n<row.list.length; n++) {
h2.value[i].info += row.list[n].YSWELLINFO
h5.value[i].info += row.list[n].JNYSWELLINFO
}
h2.value[i].info += list.value[i].list[tMonth.value].JNYSWELLINFO
h5.value[i].info += list.value[i].list[tMonth.value].YSWELLINFO
}
} else {
// 找到对应的数据
......@@ -708,8 +742,8 @@ function handelSelect3() {
type4.value.includes('2') ? h4.value : [],
type4.value.includes('2') ? h5.value : [],
type4.value.includes('2') ? h6.value : [],
type4.value.includes('1') ? legend1.value : [],
type4.value.includes('2') ? legend2.value : [],
type4.value.includes('1') ? legend2.value : [],
type4.value.includes('2') ? legend1.value : [],
)
// setC(h1.value, h2.value, h3.value, h4.value, h5.value, h6.value)
}
......@@ -725,8 +759,8 @@ function handelSelect4() {
type4.value.includes('2') ? h4.value : [],
type4.value.includes('2') ? h5.value : [],
type4.value.includes('2') ? h6.value : [],
type4.value.includes('1') ? legend1.value : [],
type4.value.includes('2') ? legend2.value : [],
type4.value.includes('1') ? legend2.value : [],
type4.value.includes('2') ? legend1.value : [],
)
}
......@@ -1904,7 +1938,7 @@ const setC = (arr, h1, h2, h3, h4, h5, h6, l1, l2) => {
// barWidth: '30%'
// },
{
name: `预提占比`,
name: `同期预提占比`,
type: 'line',
data: h6,
symbol:'circle',
......@@ -1912,7 +1946,7 @@ const setC = (arr, h1, h2, h3, h4, h5, h6, l1, l2) => {
yAxisIndex:1,
itemStyle: {
normal:{
color:'#F7CE10'
color:'#00B5A3'
}
},
},
......@@ -1992,7 +2026,7 @@ const setC = (arr, h1, h2, h3, h4, h5, h6, l1, l2) => {
// barWidth: '30%'
// },
{
name: `同期预提占比`,
name: `预提占比`,
type: 'line',
data: h3,
symbol:'circle',
......@@ -2000,7 +2034,7 @@ const setC = (arr, h1, h2, h3, h4, h5, h6, l1, l2) => {
yAxisIndex:1,
itemStyle: {
normal:{
color:'#00B5A3'
color:'#F7CE10'
}
},
},
......
......@@ -65,7 +65,8 @@ export default defineConfig(({mode, command}) => {
input: {
main: resolve(__dirname, 'index.html')
}
}
},
outDir: 'cwys'
}
}
})
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!