|
|
|
@ -24,7 +24,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入考核名称" prefix-icon="el-icon-search" v-model="keyword" clearable @keyup.enter.native="onSearch"></el-input> |
|
|
|
|
<el-input placeholder="请输入考核名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
</el-form> |
|
|
|
@ -41,7 +41,7 @@ |
|
|
|
|
<span>考核管理</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="customerData" class="table" stripe header-align="center" :row-key="getRowKeys"> |
|
|
|
|
<el-table :data="listData" class="table" stripe header-align="center" :row-key="getRowKeys"> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
|
|
|
@ -62,7 +62,7 @@ |
|
|
|
|
<el-table-column label="倒计时" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span v-if="scope.row.surplusTime == '838:00:00'">>30天</span> |
|
|
|
|
<span v-else-if="scope.row.status == 2" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span> |
|
|
|
|
<span v-else-if="scope.row.status == 2">{{scope.row.surplusTime}}</span> |
|
|
|
|
<span v-else>00:00:00</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -122,7 +122,8 @@ export default { |
|
|
|
|
name:'已完成', |
|
|
|
|
value: 3 |
|
|
|
|
}], |
|
|
|
|
customerData: [], |
|
|
|
|
listData: [], |
|
|
|
|
listDataAll: [], |
|
|
|
|
date: [], |
|
|
|
|
form: { |
|
|
|
|
classId: '', |
|
|
|
@ -138,7 +139,7 @@ export default { |
|
|
|
|
icVisible: false, |
|
|
|
|
invitationCode: '', |
|
|
|
|
searchTimer: null, |
|
|
|
|
timerList: [], |
|
|
|
|
timer: null, |
|
|
|
|
curClassName: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -153,36 +154,11 @@ export default { |
|
|
|
|
mounted() { |
|
|
|
|
this.getClass() |
|
|
|
|
this.getData() |
|
|
|
|
this.$once('hook:beforeDestroy', function () { |
|
|
|
|
this.timerList.forEach((n,k) => { |
|
|
|
|
clearInterval(n) |
|
|
|
|
}) |
|
|
|
|
this.timerList = [] |
|
|
|
|
this.timer = setInterval(this.getData,1000) |
|
|
|
|
this.$once('hook:beforeDestroy',() => { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
directives: { |
|
|
|
|
countdown: { |
|
|
|
|
bind: function(el,binding,vnode) { |
|
|
|
|
let that = vnode.context |
|
|
|
|
let time = binding.value |
|
|
|
|
let timer = setInterval(() => { |
|
|
|
|
let timeList = time.split(':') |
|
|
|
|
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) |
|
|
|
|
if(total > 0){ |
|
|
|
|
--total |
|
|
|
|
let hours = Math.floor(total / (60 * 60)) |
|
|
|
|
let minutes = Math.floor(total % (60 * 60) / 60) |
|
|
|
|
let seconds = Math.floor(total % (60 * 60) % 60) |
|
|
|
|
time = `${that.core.formateTime(hours)}:${that.core.formateTime(minutes)}:${that.core.formateTime(seconds)}` |
|
|
|
|
}else{ |
|
|
|
|
clearInterval(timer) |
|
|
|
|
} |
|
|
|
|
el.innerHTML = time |
|
|
|
|
},1000) |
|
|
|
|
that.timerList.push(timer) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData() { |
|
|
|
|
let data = { |
|
|
|
@ -195,11 +171,32 @@ export default { |
|
|
|
|
searchContent: this.core.encodeString(this.keyword), |
|
|
|
|
status: this.form.status, |
|
|
|
|
pageNum: this.pageNo, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
pageSize: 10000, |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.stuAssessmentByScreen,data).then(res => { |
|
|
|
|
this.customerData = res.list.list |
|
|
|
|
this.totals = res.list.totalCount |
|
|
|
|
let list = res.list.list |
|
|
|
|
let result = [] |
|
|
|
|
let classId = this.form.classId |
|
|
|
|
let classList = this.classList.map(n => n.classId) |
|
|
|
|
list.map(n => { |
|
|
|
|
let classIds = n.classId.split(',') |
|
|
|
|
let className = n.className.split(',') |
|
|
|
|
if(classIds.length > 1){ |
|
|
|
|
classIds.map((e,i) => { |
|
|
|
|
let item = JSON.parse(JSON.stringify(n)) |
|
|
|
|
item.classId = e |
|
|
|
|
item.className = className[i] |
|
|
|
|
if(classList.includes(Number(e))){ |
|
|
|
|
if(!classId || classId == e) result.push(item) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
result.push(n) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.listDataAll = result |
|
|
|
|
this.totals = result.length |
|
|
|
|
this.handlePage() |
|
|
|
|
// this.$get(this.api.fictitiousRecord, { |
|
|
|
|
// userId: this.userId, |
|
|
|
|
// page: 1, |
|
|
|
@ -214,33 +211,25 @@ export default { |
|
|
|
|
// n.reportId = same.reportId |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// this.customerData = list |
|
|
|
|
// this.listData = list |
|
|
|
|
// }).catch(err => {}) |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
handlePage(){ |
|
|
|
|
let list = this.listDataAll |
|
|
|
|
this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) |
|
|
|
|
}, |
|
|
|
|
getClass(){ |
|
|
|
|
this.$get(`${this.api.mineClass}?userId=${this.userId}`).then(res => { |
|
|
|
|
this.classList = res.list |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
add(){ |
|
|
|
|
this.$store.commit("customerData", { customer_id : ''}); |
|
|
|
|
this.$router.push('/addclass'); |
|
|
|
|
}, |
|
|
|
|
edit(row){ |
|
|
|
|
this.$store.commit("customerData", { customer_id : row.customerId }); |
|
|
|
|
this.$router.push('/addcustomer'); |
|
|
|
|
}, |
|
|
|
|
getRowKeys(row) { |
|
|
|
|
return row.customerId; |
|
|
|
|
}, |
|
|
|
|
onSearch(){ |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.pageNo = val; |
|
|
|
|
this.getData(); |
|
|
|
|
this.pageNo = val |
|
|
|
|
this.handlePage() |
|
|
|
|
}, |
|
|
|
|
entry(row) { |
|
|
|
|
if(row.status == 1){ |
|
|
|
|