前台页面

master
xy 2 years ago
parent ef2ff05af1
commit e2b4a3f3f0

@ -25,6 +25,11 @@
:row-key="(row) => row._index" :row-key="(row) => row._index"
:table-item="table" :table-item="table"
:auths="[]" :auths="[]"
:row-style="({ row }) => {
return {
'height': '44px'
}
}"
> >
</xy-table> </xy-table>
@ -50,7 +55,7 @@
<el-form-item label="内容" required prop="content"> <el-form-item label="内容" required prop="content">
<el-input <el-input
type="textarea" type="textarea"
:autosize="{ minRows: 30 }" :autosize="{ minRows: 15 }"
v-model="form.content" v-model="form.content"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -86,7 +91,12 @@
</div> </div>
</el-drawer> </el-drawer>
<detail ref="show" @edit="editShow"></detail> <detail ref="show"
@edit="editShow"
@destroyed="() => {
getCategories()
getStatics()
}"></detail>
</div> </div>
</template> </template>
@ -98,7 +108,7 @@ export default {
components: { components: {
detail detail
}, },
inject: ['myInfo', 'statics'], inject: ['myInfo', 'statics', 'getStatics'],
data() { data() {
return { return {
isShowDrawer: false, isShowDrawer: false,
@ -156,11 +166,11 @@ export default {
label: "填报要求", label: "填报要求",
width: 240, width: 240,
customFn: row => { customFn: row => {
return(<div> return row._is_end ? (<div>
{ {
row.rules.map(item => (<div>{item.start_at} ~ {item.end_at}不少于{item.quantity}</div>)) row.rules.map(item => (<div>{item.start_at} ~ {item.end_at}不少于{item.quantity}</div>))
} }
</div>) </div>) : ''
} }
}, },
{ {
@ -274,13 +284,18 @@ export default {
}) })
this.$integrateData(this.form, res) this.$integrateData(this.form, res)
this.form.id = id this.form.id = id
this.fileList = res?.files?.map(i => ({
name: i.original_name,
url: i.url,
response: i
})) || []
}, },
async editShow (id) { async editShow (id) {
this.type = 'edit' this.type = 'edit'
await this.getDetail(id) await this.getDetail(id)
let rule = this.pickRule.find(i => i.id === this.form.category_rule_id) let rule = this.pickRule.find(i => i.id === this.form.category_rule_id)
this.form._week = `${rule.start_at} ~ ${rule.end_at}` this.form._week = `${rule?.start_at || ''} ~ ${rule?.end_at || ''}`
this.isShowDrawer = true this.isShowDrawer = true
}, },
@ -362,6 +377,7 @@ export default {
}); });
this.isShowDrawer = false; this.isShowDrawer = false;
this.getCategories() this.getCategories()
this.getStatics()
}); });
} else { } else {
save(this.form).then((res) => { save(this.form).then((res) => {

@ -77,6 +77,7 @@ export default {
message: '删除成功!' message: '删除成功!'
}); });
_this.$refs['xyTable'].getTableData() _this.$refs['xyTable'].getTableData()
this.$emit('destroyed')
}) })
}) })
} }

@ -7,10 +7,12 @@
{{ descriptionLabel(key) }} {{ descriptionLabel(key) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="本年统计"> <el-descriptions-item label="本年统计">
正常填报{{ static.count_normal }}迟报{{ static.count_delayed }}超期未报{{ static.count_missed }} <div class="card__status">
正常填报<div class="cir1"></div>{{ static.count_normal }}迟报<div class="cir2"></div>{{ static.count_delayed }}超期未报<div class="cir3"></div>{{ static.count_missed }}
</div>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<Button type="primary" long @click="$router.push('/h5/form')"></Button> <Button style="margin-top: 24px;height: 34px;" type="primary" long @click="$router.push('/h5/form')"></Button>
</Card> </Card>
</div> </div>
</template> </template>
@ -21,9 +23,9 @@ export default {
data() { data() {
return { return {
descriptions: { descriptions: {
"department.name": "市委", "department.name": "部\u3000\u3000门",
"name": "姓名", "name": "姓\u3000\u3000名",
"position": "职位", "position": "职\u3000\u3000位",
"start_at": "开始填报", "start_at": "开始填报",
"end_at": "结束填报" "end_at": "结束填报"
} }
@ -71,8 +73,29 @@ export default {
top: calc(50% - #{$height} / 2); top: calc(50% - #{$height} / 2);
.title { .title {
font-size: 24px;
text-align: center; text-align: center;
padding: 20px 0; padding: 20px 0;
} }
&__status {
$color: #377e22,#f2a93c,#ea3423;
display: flex;
align-items: center;
font-size: 12px;
@mixin cir {
padding: 8px;
border-radius: 100%;
margin: 0 6px;
}
@for $i from 1 through length($color) {
.cir#{$i} {
@include cir;
background: nth($color, $i);
}
}
}
} }
</style> </style>

@ -41,6 +41,7 @@ export default {
return { return {
myInfo: () => this.myInfo, myInfo: () => this.myInfo,
statics: () => this.statics, statics: () => this.statics,
getStatics: this.getStatics,
} }
}, },
data() { data() {
@ -51,17 +52,35 @@ export default {
count_normal: 0, count_normal: 0,
count_delayed: 0, count_delayed: 0,
count_missed: 0 count_missed: 0
} },
loadingInstance: null,
} }
}, },
methods: { methods: {
async getStatics () { async getStatics () {
this.statics = await getYearStatistics(this.select); this.statics = await getYearStatistics(this.select);
}, },
async getInfo () {
this.myInfo = await getBaseInfo()
},
async logout() { async logout() {
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/logout')
this.$router.push(`/h5/login?redirect=${this.$route.fullPath}`) this.$router.push(`/h5/login?redirect=${this.$route.fullPath}`)
},
loading () {
this.loadingInstance = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.8)'
})
},
loaded () {
if (this.loadingInstance && this.loadingInstance.close) {
this.loadingInstance.close()
}
} }
}, },
computed: { computed: {
@ -69,9 +88,14 @@ export default {
return this.$route.path return this.$route.path
} }
}, },
created() { async created() {
this.getStatics(); try {
getBaseInfo().then(res => (this.myInfo = res)) this.loading()
await Promise.all([this.getStatics(),this.getInfo()])
this.loaded()
} catch (e) {
this.loaded()
}
} }
} }
</script> </script>

Loading…
Cancel
Save