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. 51
      src/views/match/manage/theoryReport.vue

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

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

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

@ -5,6 +5,31 @@
@closed="closeDia">
<div class="tool">
<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>
<label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
@ -12,14 +37,14 @@
</li>
</ul>
<div>
<el-button type="primary" @click="add">自定义理论试卷</el-button>
<!-- <el-button type="primary" @click="add">自定义理论试卷</el-button> -->
</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">
<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>
</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 =>
e.id === scope.row.paperType).name : '' }}</template>
</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 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>
<div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange"
layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
<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>
</span>
</el-dialog>
@ -59,38 +90,32 @@
import Setting from '@/setting'
import Util from '@/libs/util'
import _ from 'lodash'
import QuesConst from '@/const/ques'
import TestPaperConst from '@/const/testPaper'
export default {
props: ['visible'],
props: ['visible', 'form'],
data () {
return {
arabicToChinese: Util.arabicToChinese,
questionTypes: QuesConst.questionTypes,
difficults: TestPaperConst.difficults,
paperTypes: TestPaperConst.paperTypes,
listVisible: false,
searchTimer: null,
questionTypes: [
{
name: '单选题'
},
{
name: '多选题'
},
{
name: '判断题'
},
{
name: '填空题'
},
{
name: '问答题'
},
],
questionType: [],
paperLibraries: [],
filter: {
libraryId: '',
paperType: '',
difficult: [],
keyWord: '',
},
list: [],
page: 1,
pageSize: 10,
total: 0,
paperId: '',
submiting: false,
};
@ -113,13 +138,14 @@ export default {
async getList () {
try {
const res = await this.$post(this.api.examPaperList, {
...this.filter,
pageNum: this.page,
pageSize: this.pageSize,
type: 1,
keyWord: this.keyword,
libraryId: this.systemId
})
this.projects = res.pageList.records
this.papers = res.pageList.records
this.total = res.pageList.total
} catch (e) { }
},
@ -128,103 +154,51 @@ export default {
this.page = val
this.getList()
},
handleCurrentChange (val) {
this.page = val
this.getList()
},
initData () {
this.page = 1
this.getList()
},
//
sortChange (column) {
if (column.prop === 'updateTime') this.filter.updateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : ''
this.getList()
},
//
add () {
this.form = _.cloneDeep(this.originForm)
this.detailVisible = true
},
//
addLine (i) {
this.form.paperOutline.splice(i + 1, 0, {
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) { }
//
previewPaper (row) {
this.$parent.previewPaper(row)
},
//
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
if (!form.templateName) return Util.warningMsg('请输入模板名称')
let invalid = 0
for (const e of form.paperOutline) {
if (!e.questionType) {
Util.warningMsg('请选择题型')
invalid = 1
break
}
if (!e.questionNum) {
Util.warningMsg('请输入目标题数')
invalid = 1
break
}
if (!e.targetScore) {
Util.warningMsg('请输入目标分值')
invalid = 1
break
// id
if (form.paperName !== form.originPaperName) {
const res = await this.$post(this.api.copyExamPaper, {
associatedID: form.stageId,
paperId: form.paperId,
typeId: 1
})
if (res.examPaper) {
form.paperId = res.examPaper.paperId
}
}
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
}
},
//
closeDia () {

@ -18,7 +18,7 @@
<ul class="serials">
<template v-for="(ques, j) in item.userAnswerList">
<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="score">{{ ques.userScore }}</p>
</li>
@ -126,7 +126,7 @@
</div>
<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>
</div>
@ -204,7 +204,7 @@
<div class="line">题目分值{{ ques.questionScore }}</div>
<div class="line">考生得分<el-input class="score-input" size="small" :value="ques.userScore"
readonly />
disabled />
</div>
</div>
</div>
@ -418,36 +418,17 @@ export default {
window.requestAnimationFrame(scroll)
},
//
scrollToQues (e) {
scrollToQues (e, item) {
item.shrink = false
const el = document.querySelector('#ques' + e.id)
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200)
this.$nextTick(() => {
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200)
})
},
//
filterStatus (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) {
const ext = url.split('.').pop()
@ -798,7 +779,7 @@ samp {
}
.right {
width: calc(100% - 359px);
width: calc(100% - 325px);
height: calc(100vh - 287px);
padding: 10px;
background-color: #fff;
@ -830,14 +811,13 @@ samp {
}
.ques {
max-height: none;
padding: 15px;
margin-bottom: 15px;
transition: all 1.5s;
overflow: hidden;
&.hide {
max-height: 10px;
display: none;
}
}
@ -946,6 +926,11 @@ samp {
.score-input {
width: 100px;
margin-right: 5px;
.el-input__inner {
color: #333;
background-color: #fff;
}
}
.fill-input {
@ -990,6 +975,12 @@ samp {
}
}
}
.ques-wrap {
&>li {
margin-bottom: 15px;
}
}
}
.result-pic {

Loading…
Cancel
Save