| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <template>
- <div>
- <div class="topBox">
- <NavBar :go="{ type: 'push', path: '/menu' }" />
- <van-row>
- <van-col span="24"> <van-search v-model="evaluateName" placeholder="请输入搜索关键词" @search="onSearch" /></van-col>
- </van-row>
- <van-row>
- <van-col span="24">
- <org-tree v-model="cascaderValue" :name="'sss'" @changeItem="getDataList"></org-tree>
- </van-col>
- </van-row>
- <van-row>
- <van-col span="12"
- ><van-field
- v-model="fieldValue"
- label-width="3em"
- clearable
- :disabled="showStatus"
- label="状态"
- placeholder=""
- @click="showStatus = true"
- ><van-icon name="arrow-down" slot="button"
- /></van-field>
- <van-popup v-model="showStatus" round position="bottom">
- <van-picker
- title="状态"
- show-toolbar
- :columns="columns"
- @confirm="onConfirm"
- @cancel="onCancel"
- :close-on-click-overlay="false"
- />
- </van-popup>
- </van-col>
- <van-col span="12">
- <van-field
- v-model="currentDate"
- clearable
- label-width="3em"
- label="年份"
- placeholder=""
- :disabled="showDate"
- @click="showDate = true"
- >
- <van-icon name="arrow-down" slot="button"
- /></van-field>
- <van-popup v-model="showDate" round position="bottom">
- <van-picker
- v-model="presentDate"
- show-toolbar
- @cancel="onCancel"
- :columns="yearColumns"
- @confirm="onDateConfirm"
- :default-index="yearSelect"
- title="年份"
- />
- </van-popup>
- </van-col>
- </van-row>
- </div>
- <!-- //卡片内容区域 -->
- <div class="navBarclas">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
- <van-panel :title="item.title" v-for="item in taskList" :key="item.id" class="card" status="状态">
- <template #header>
- <div class="titleClass">
- <div class="title">{{ item.title }}</div>
- <div>
- <van-button type="info" v-if="evaluateTure(item)" size="mini" @click="evaluate(item.id)"
- >评价</van-button
- >
- </div>
- </div>
- </template>
- <div>
- <div class="mainItem" @click="goInfo(item.id)">
- <div>评价状态</div>
- <div>{{ item.orgName }}</div>
- </div>
- <div class="mainItem" @click="goInfo(item.id)">
- <div>评价周期</div>
- <div>{{ item.statusText }}</div>
- </div>
- </div>
- </van-panel>
- </van-list>
- </div>
- </div>
- </template>
- <script>
- import NavBar from '@/components/NavBar'
- import { Col, Row, Cascader, Dialog, DatetimePicker, Icon, Picker } from 'vant'
- import { getEvaluatePage } from '@/api/evaluateTask.js'
- import { deptTreeList } from '@/api/toConsult.js'
- import { Toast } from 'vant'
- import OrgTree from '@/components/orgTree'
- import { newDateMonth, newDateYear } from '@/utils/date.js'
- export default {
- data() {
- return {
- orgName: '',
- orgShow: false,
- presentDate: '', //默认时间
- pageNum: 1,
- loading: false, //加载状态
- finished: false, //是否全部加载完毕
- evaluateName:'',
- yearColumns: [],
- orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
- cascaderValue: '', //机构ID
- show: false, //机构弹框显示隐藏
- fieldNames: {
- text: 'name',
- value: 'id',
- children: 'children'
- },
- taskList: [{}], //列表数据
-
- yearSelect: null,
- value1: JSON.parse(sessionStorage.getItem('SET_USER_ID')) || '', //输入框model
- showStatus: false, //状态显示隐藏
- showDate: false, //月份显示隐藏
- fieldValue: '全部', //状态名称
- statusValue: ' ', //状态值
- columns: ['全部'], //状态数组
- columnsList: [], //状态数组
- currentDate: newDateYear(), //年份
- conditionShow: false //机构弹框显示隐藏
- }
- },
- components: {
- NavBar,
- OrgTree,
- Dialog,
- Icon,
- DatetimePicker,
- Picker,
- Col,
- Row,
- Cascader
- },
- created() {
- this.presentDate = new Date(newDateYear())
- this.yearData()
- },
- mounted() {
- this.init()
- this.cascaderValue = JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + ''
- },
- methods: {
- //机构搜索
- getDataList(val) {
- this.cascaderValue = val.id
- this.orgName = val.name
- this.selectListAppHandler()
- },
- //判断评价按钮是否展示
- evaluateTure(item) {
- return true
- if (item.status == 2 && window.sessionStorage.getItem('SET_USER_ORGTYPE') != 4) {
- return true
- }
- },
- //初始化
- init() {
- //获取数据字典
- this.getDictHandler('plan_status', res => {
- this.columnsList = res
- this.columns = res.map(item => item.dictLabel)
- this.columns.unshift('全部')
- })
- //获取分页列表
- this.selectListAppHandler()
- },
- selectListAppHandler(type = 0, callback = () => {}) {
- let obj = {
- evaluateName:this.evaluateName,
- pageNum: this.pageNum,
- pageSize: 10
- }
- if (!type) {
- obj.pageNum = 1
- this.pageNum = 1
- }
- if (this.statusValue) {
- obj.status = this.statusValue
- }
- obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
- if (this.currentDate) {
- obj.date = this.currentDate
- }
-
- //获取任务列表
- getEvaluatePage(obj).then(res => {
- let { code, rows, msg } = res
- if (code == 200) {
- if (type) {
- this.taskList.push(...rows)
- if (rows.length == 0 || rows.length < 10) {
- //已加载完全部数据
- this.finished = true
- }
- callback()
- } else {
- this.finished = false
- this.taskList = rows
- }
- }else{
- this.finished = true
- this.taskList =[]
- }
- })
- },
- //搜索选择状态时触发
- onConfirm(value, index) {
- this.fieldValue = value
- this.columnsList.forEach(item => {
- if (value == item.dictLabel) {
- this.statusValue = item.dictValue
- }
- })
- if (value == '全部') {
- this.statusValue = ' '
- }
- this.selectListAppHandler()
- this.showStatus = false
- },
- //月份选中触发
- onDateConfirm(val) {
- this.currentDate = this.newDate(val + '')
- this.showDate = false
- this.selectListAppHandler()
- },
- yearData() {
- // 获取默认显示的时间
- var nowTime = new Date()
- let year = nowTime.getFullYear()
- let month = nowTime.getMonth()
- let day = nowTime.getDate()
- // 循环数组 填写最小时间和最大时间范围
- for (let i = 1980; i < 2099; i++) {
- this.yearColumns.push(i)
- }
- // 格式化时间并截取
- var years = this.formatDate(new Date(year, month, day))
- var Year = years.slice(0, 4)
- // 将截取的年份赋值给绑定值 用于点击弹出日期窗口后显示当前的时间
- this.yearSelect = this.yearColumns.indexOf(Number(Year))
- }, //日期转换
- newDate(time) {
- var date = new Date(time)
- var y = date.getFullYear()
- var m = date.getMonth() + 1
- m = m < 10 ? '0' + m : m
- var d = date.getDate()
- d = d < 10 ? '0' + d : d
- return y
- },
- //日期格式
- formatDate(date) {
- return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
- },
- //onLoad下拉刷新
- onLoad() {
- if (this.pageNum == 1) {
- this.pageNum = 2
- }
- this.loading = true
- this.selectListAppHandler(1, () => {
- this.pageNum++
- this.loading = false
- console.log(1)
- })
- },
- onSearch(){
- },
- //评价
- evaluate(id) {
- this.$router.push('/evaluate/' + id )
- },
- //跳转详情
- goInfo(id) {
- this.$router.push('/rehearsalTasinfo/' + id + '_info')
- },
- onCancel() {
- this.show = false
- this.typeStatus = false
- this.showDate = false
- this.showStatus = false
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .popup {
- height: 40vh;
- }
- .navBarclas {
- height: calc(100vh - 380px);
- overflow: scroll;
- }
- .btnf_box {
- background-color: #fff;
- }
- .card {
- margin: 20px;
- margin-bottom: 0px;
- box-shadow: 0 8px 12px #ebedf0;
- }
- .btn {
- float: right;
- margin-top: 24px;
- margin-right: 20px;
- box-sizing: border-box;
- }
- .titleClass {
- display: flex;
- align-items: center;
- height: 100%;
- padding: 20px;
- border-bottom: 1px solid #ccc;
- .title {
- font-size: 30px;
- flex: 1;
- line-height: 50px;
- }
- }
- .mainItem {
- display: flex;
- font-size: 28px;
- padding: 20px;
- justify-content: space-between;
- .condition {
- color: #1989fa;
- text-decoration: underline;
- }
- }
- .conditionCls {
- .title {
- color: #1989fa;
- margin-left: 30px;
- // margin-top: 30px;
- }
- .people {
- margin-left: 80px;
- margin-bottom: 30px;
- margin-top: 30px;
- }
- }
- .topBox {
- overflow: hidden;
- }
- :deep.van-field--disabled {
- color: #323233;
- }
- :deep.van-field--disabled .van-field__label {
- color: #323233;
- }
- :deep .van-field__control[disabled] {
- color: #323233;
- -webkit-text-fill-color: #323233;
- }
- </style>
|