dev_review
yujialong 3 months ago
parent 0d952de033
commit e44b2ad9b9
  1. 1
      src/utils/api.js
  2. 33
      src/views/customer/AddCustomer.vue
  3. 1
      src/views/match/add/step3.vue
  4. 186
      src/views/match/add/template.vue
  5. 49
      src/views/match/manage/theoryReport.vue

@ -39,6 +39,7 @@ export default {
getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
refreshCache: `data/data/myDate/refreshCache`, refreshCache: `data/data/myDate/refreshCache`,
getPartnerTeamRates: `nakadai/nakadai/partner-team/getPartnerTeamRates`, getPartnerTeamRates: `nakadai/nakadai/partner-team/getPartnerTeamRates`,
getCustomerOrderRecord: `nakadai/nakadai/order/getCustomerOrderRecord`,
// 客户管理 // 客户管理
delCustomers: `nakadai/nakadai/customer/delCustomers`, delCustomers: `nakadai/nakadai/customer/delCustomers`,

@ -565,7 +565,6 @@ export default {
pageSizeOrder: 10, pageSizeOrder: 10,
totalOrder: 0, totalOrder: 0,
orders: [], orders: [],
orderAll: [],
bmsKeyword: '', bmsKeyword: '',
bms: [], bms: [],
@ -625,7 +624,7 @@ export default {
this.pageOrder = 1 this.pageOrder = 1
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.handlePageOrder() this.initOrder()
}, 500) }, 500)
}, },
bmsKeyword: function (val) { bmsKeyword: function (val) {
@ -937,35 +936,31 @@ export default {
// //
getOrder () { getOrder () {
const { orderStatus, orderType } = this.form3 const { orderStatus, orderType } = this.form3
this.$post(this.api.orderList, { this.$post(this.api.getCustomerOrderRecord, {
customerId: this.customerId,
cityId: '', cityId: '',
customerName: this.form.customerName, customerName: this.form.customerName,
orderStatus, orderStatus,
orderType, orderType,
pageNo: 1, pageNo: this.pageOrder,
pageSize: 10000, pageSize: this.pageSizeOrder,
provinceId: '' provinceId: ''
}).then(({ orderPage }) => { }).then(({ orders }) => {
orderPage.orders.forEach(e => { orders.records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType) e.orderType = this.orderTypeFn(e.orderType)
e.orderStatus = this.orderStatusFn(e.orderStatus) e.orderStatus = this.orderStatusFn(e.orderStatus)
e.orderNature = this.orderNatureFn(e.orderNature)
}); });
this.orderAll = orderPage.orders this.orders = orders.records
this.totalOrder = orderPage.total this.totalOrder = orders.total
this.handlePageOrder()
}).catch(res => { }) }).catch(res => { })
}, },
// initOrder () {
handlePageOrder () { this.pageOrder = 1
const { keyword } = this.form3 this.getOrder()
const list = keyword ? this.orderAll.filter(e => e.orderNumber.includes(keyword) || e.orderContent.includes(keyword)) : this.orderAll
this.totalOrder = list.length
this.orders = list.slice((this.pageOrder - 1) * this.pageSizeOrder, this.pageOrder * this.pageSizeOrder)
}, },
handleCurrentChangeOrder (val) { handleCurrentChangeOrder (val) {
this.pageOrder = val this.pageOrder = val
this.handlePageOrder() this.getOrder()
this.$router.push(`addcustomer?id=${this.customerId}&type=tab3&page=${val}`) this.$router.push(`addcustomer?id=${this.customerId}&type=tab3&page=${val}`)
}, },
// //
@ -1014,7 +1009,7 @@ export default {
this.pageProduct = 1 this.pageProduct = 1
this.pageOrder = 1 this.pageOrder = 1
this.pageBm = 1 this.pageBm = 1
index === 'tab3' && this.handlePageOrder() index === 'tab3' && this.initOrder()
this.updateTime = this.form.customerId ? 1 : 0 this.updateTime = this.form.customerId ? 1 : 0
} }
}, },

@ -167,6 +167,7 @@ export default {
startTime: '', startTime: '',
systemId: '', systemId: '',
paperId: '', paperId: '',
paperName: '',
offlineAddress: '', offlineAddress: '',
offlineButton: 0, offlineButton: 0,
onlineAddress: '', onlineAddress: '',

@ -5,6 +5,31 @@
@closed="closeDia"> @closed="closeDia">
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li>
<label>试卷库</label>
<el-select v-model="filter.libraryId" placeholder="请选择试卷库" @change="initData">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId">
</el-option>
</el-select>
</li>
<li>
<label>建议用途</label>
<el-select v-model="filter.paperType" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>试卷难度</label>
<el-select v-model="filter.difficult" clearable multiple placeholder="请选择试卷难度" @change="initData">
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>题目类型</label>
<el-select v-model="questionType" clearable multiple placeholder="请选择题目类型" @change="initData">
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li> <li>
<label>搜索</label> <label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model="filter.keyWord" <el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
@ -12,14 +37,14 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" @click="add">自定义理论试卷</el-button> <!-- <el-button type="primary" @click="add">自定义理论试卷</el-button> -->
</div> </div>
</div> </div>
<el-table :data="projects" class="table" stripe header-align="center"> <el-table :data="papers" class="table" stripe header-align="center" @sort-change="sortChange">
<el-table-column width="60" label="选择" align="center"> <el-table-column width="60" label="选择" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio v-model="scope.row.paperId" :label="scope.row.paperId">&nbsp;</el-radio> <el-radio v-model="form.paperId" :label="scope.row.paperId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
@ -41,15 +66,21 @@
<template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e => <template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e =>
e.id === scope.row.paperType).name : '' }}</template> e.id === scope.row.paperType).name : '' }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="170"></el-table-column> <el-table-column prop="updateTime" label="最近编辑时间" align="center" width="170"
sortable="custom"></el-table-column>
<el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column> <el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column>
<el-table-column label="操作" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" @click="previewPaper(scope.row)">预览</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange" <el-pagination background :page-size="pageSize" @current-change="handleCurrentChange"
layout="total,prev, pager, next" :total="total"></el-pagination> layout="total,prev, pager, next" :total="total"></el-pagination>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="selectQuesVisible = false">取消</el-button> <el-button @click="listVisible = false">取消</el-button>
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button> <el-button type="primary" :loading="submiting" @click="submit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -59,38 +90,32 @@
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import _ from 'lodash' import _ from 'lodash'
import QuesConst from '@/const/ques'
import TestPaperConst from '@/const/testPaper'
export default { export default {
props: ['visible'], props: ['visible', 'form'],
data () { data () {
return { return {
arabicToChinese: Util.arabicToChinese, arabicToChinese: Util.arabicToChinese,
questionTypes: QuesConst.questionTypes,
difficults: TestPaperConst.difficults,
paperTypes: TestPaperConst.paperTypes,
listVisible: false, listVisible: false,
searchTimer: null, searchTimer: null,
questionTypes: [
{
name: '单选题'
},
{
name: '多选题'
},
{
name: '判断题'
},
{
name: '填空题'
},
{
name: '问答题'
},
],
questionType: [],
paperLibraries: [],
filter: { filter: {
libraryId: '',
paperType: '',
difficult: [],
keyWord: '', keyWord: '',
}, },
list: [], list: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
paperId: '',
submiting: false, submiting: false,
}; };
@ -113,13 +138,14 @@ export default {
async getList () { async getList () {
try { try {
const res = await this.$post(this.api.examPaperList, { const res = await this.$post(this.api.examPaperList, {
...this.filter,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
type: 1, type: 1,
keyWord: this.keyword, keyWord: this.keyword,
libraryId: this.systemId libraryId: this.systemId
}) })
this.projects = res.pageList.records this.papers = res.pageList.records
this.total = res.pageList.total this.total = res.pageList.total
} catch (e) { } } catch (e) { }
}, },
@ -128,102 +154,50 @@ export default {
this.page = val this.page = val
this.getList() this.getList()
}, },
handleCurrentChange (val) {
this.page = val
this.getList()
},
initData () { initData () {
this.page = 1 this.page = 1
this.getList() this.getList()
}, },
//
sortChange (column) {
if (column.prop === 'updateTime') this.filter.updateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : ''
this.getList()
},
// //
add () { add () {
this.form = _.cloneDeep(this.originForm) this.form = _.cloneDeep(this.originForm)
this.detailVisible = true this.detailVisible = true
}, },
// //
addLine (i) { previewPaper (row) {
this.form.paperOutline.splice(i + 1, 0, { this.$parent.previewPaper(row)
examQuestions: [],
outlineName: '',
questionNum: '',
questionType: '',
targetScore: '',
})
},
//
delLine (i) {
this.form.paperOutline.length > 1 && this.form.paperOutline.splice(i, 1)
},
// 使
async useTemplate (row) {
const data = await this.getDetail(row.templateId)
this.$parent.form.paperOutline = data.paperOutline
this.listVisible = false
},
//
async getDetail (id) {
const res = await this.$get(this.api.templateDetails, {
id
})
return res.template
},
//
async edit (row) {
this.detailVisible = true
const data = await this.getDetail(row.templateId)
this.form = data
},
//
async del (row) {
try {
await this.$confirm(`确认要删除【${row.templateName}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
await this.$post(this.api.deleteTemplate, {
ids: [row.templateId]
})
Util.successMsg('删除成功')
this.getList()
} catch (e) { }
}, },
// //
async submit () { async submit () {
if (this.submiting) return false const { paperId } = this.form
if (!paperId) return Util.warningMsg('请选择试卷')
const curPaper = this.papers.find(e => e.paperId === paperId)
if (curPaper) this.form.paperName = curPaper.name
this.handlePaper()
},
//
async handlePaper () {
const { form } = this const { form } = this
if (!form.templateName) return Util.warningMsg('请输入模板名称') // id
let invalid = 0 if (form.paperName !== form.originPaperName) {
for (const e of form.paperOutline) { const res = await this.$post(this.api.copyExamPaper, {
if (!e.questionType) { associatedID: form.stageId,
Util.warningMsg('请选择题型') paperId: form.paperId,
invalid = 1 typeId: 1
break })
} if (res.examPaper) {
if (!e.questionNum) { form.paperId = res.examPaper.paperId
Util.warningMsg('请输入目标题数')
invalid = 1
break
}
if (!e.targetScore) {
Util.warningMsg('请输入目标分值')
invalid = 1
break
}
} }
if (invalid) return false
this.submiting = true
form.createSource = 1
form.questionNum = this.questionNum
form.totalScore = this.totalScore
form.outlineNum = form.paperOutline.length
form.questionType = [...new Set(form.paperOutline.map(e => e.questionType))].join('、')
try {
await this.$post(this.api.saveExamPaperTemplate, form)
Util.successMsg('保存成功')
this.detailVisible = false
this.submiting = false
this.getList()
} catch (e) {
this.submiting = false
} }
}, },
// //

@ -18,7 +18,7 @@
<ul class="serials"> <ul class="serials">
<template v-for="(ques, j) in item.userAnswerList"> <template v-for="(ques, j) in item.userAnswerList">
<li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect" <li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect"
@click="scrollToQues(ques)"> @click="scrollToQues(ques, item)">
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p> <p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p>
<p class="score">{{ ques.userScore }}</p> <p class="score">{{ ques.userScore }}</p>
</li> </li>
@ -126,7 +126,7 @@
</div> </div>
<el-tag class="m-r-5" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag> <el-tag class="m-r-5" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag>
<div class="stem html-parse" :id="'stem' + ques.id" v-html="getQuesStem(ques)"></div> <div class="stem html-parse" :id="'stem' + ques.id" v-html="ques.stem"></div>
<p>{{ ques.questionScore }}</p> <p>{{ ques.questionScore }}</p>
</div> </div>
@ -204,7 +204,7 @@
<div class="line">题目分值{{ ques.questionScore }}</div> <div class="line">题目分值{{ ques.questionScore }}</div>
<div class="line">考生得分<el-input class="score-input" size="small" :value="ques.userScore" <div class="line">考生得分<el-input class="score-input" size="small" :value="ques.userScore"
readonly /> disabled />
</div> </div>
</div> </div>
</div> </div>
@ -418,36 +418,17 @@ export default {
window.requestAnimationFrame(scroll) window.requestAnimationFrame(scroll)
}, },
// //
scrollToQues (e) { scrollToQues (e, item) {
item.shrink = false
const el = document.querySelector('#ques' + e.id) const el = document.querySelector('#ques' + e.id)
this.$nextTick(() => {
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200) el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200)
})
}, },
// //
filterStatus (e) { filterStatus (e) {
this.sheetStatus = this.sheetStatus === e ? '' : e this.sheetStatus = this.sheetStatus === e ? '' : e
}, },
//
getQuesStem (ques) {
let { stem } = ques
if (ques.questionType === 'fill_blank') { //
return stem
let { fills } = ques
const regex = /<span class="gapfilling-span" data-id="(.*?)">______<\/span>/g
let match
let index = 0 //
let result = stem
while ((match = regex.exec(stem)) !== null) {
const newInput = `______`
result = result.replace(match[0], newInput)
index++
}
return result
} else {
return stem
}
},
// //
preview (url) { preview (url) {
const ext = url.split('.').pop() const ext = url.split('.').pop()
@ -798,7 +779,7 @@ samp {
} }
.right { .right {
width: calc(100% - 359px); width: calc(100% - 325px);
height: calc(100vh - 287px); height: calc(100vh - 287px);
padding: 10px; padding: 10px;
background-color: #fff; background-color: #fff;
@ -830,14 +811,13 @@ samp {
} }
.ques { .ques {
max-height: none;
padding: 15px; padding: 15px;
margin-bottom: 15px; margin-bottom: 15px;
transition: all 1.5s; transition: all 1.5s;
overflow: hidden; overflow: hidden;
&.hide { &.hide {
max-height: 10px; display: none;
} }
} }
@ -946,6 +926,11 @@ samp {
.score-input { .score-input {
width: 100px; width: 100px;
margin-right: 5px; margin-right: 5px;
.el-input__inner {
color: #333;
background-color: #fff;
}
} }
.fill-input { .fill-input {
@ -990,6 +975,12 @@ samp {
} }
} }
} }
.ques-wrap {
&>li {
margin-bottom: 15px;
}
}
} }
.result-pic { .result-pic {

Loading…
Cancel
Save