lion 1 year ago
parent e1ab0bc0f8
commit fc4124f788

@ -55,5 +55,13 @@ export function destroy(params) {
}) })
} }
export function retry(params) {
return request({
method: "get",
url: "/api/admin/appointments/retry-appointment",
params
})
}

@ -28,6 +28,26 @@ let base = {
isNull(val){ isNull(val){
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null'; return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
}, },
// 手机号*号
maskPhoneNumber(phoneNumber) {
if(this.isNull(phoneNumber)){
return
}
// 保留前两位
const firstPart = phoneNumber.slice(0, 2);
// 替换中间的数字为 *
const maskedPart = '*'.repeat(7);
// 保留最后两位
const lastPart = phoneNumber.slice(-2);
// 拼接成完整的字符串
const maskedPhoneNumber = firstPart + maskedPart + lastPart;
return maskedPhoneNumber;
},
checkUrl (url) { checkUrl (url) {
// url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数) // url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数)
var strRegex = var strRegex =

@ -173,9 +173,9 @@
total: '', total: '',
status: 1, status: 1,
use_student: 1, use_student: 1,
dateRange: ['08:30','17:30'], dateRange: ['09:00','17:30'],
file_ids: [], file_ids: [],
start_time:'08:30', start_time:'09:00',
end_time:'17:30', end_time:'17:30',
// door:'', // door:'',
// room:'' // room:''

@ -225,6 +225,10 @@
_arr = _arr.map(item => item.id) _arr = _arr.map(item => item.id)
} }
console.log("_arr", _arr) console.log("_arr", _arr)
if(_arr.length===0){
this.$Message.warning('当前没有筛选出学员')
return
}
this.form.user_id = _arr.join(",") this.form.user_id = _arr.join(",")
} }
if (this.type === "editor") { if (this.type === "editor") {
@ -264,11 +268,11 @@
changeUser(e) { changeUser(e) {
if (e) { if (e) {
this.form.user_id = e this.form.user_id = e
this.form.name = ''
if (this.type === "add") { if (this.type === "add") {
this.user_options.map(item => { this.user_options.map(item => {
if (item.id === e) { if (item.id === e) {
this.form.mobile = item.mobile this.form.mobile = item.mobile
this.form.name = item.name
} }
}) })
} }
@ -279,7 +283,7 @@
console.log("input", e) console.log("input", e)
if(e){ if(e){
this.form.name = e this.form.name = e
this.form.user_id = '' this.form.user_id = 0
} }
console.log(this.form.user_id, this.form.name) console.log(this.form.user_id, this.form.name)
}, },

@ -35,6 +35,52 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:is_book>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否可预约
</div>
<div class="xy-table-item-content">
<el-select v-model="form.is_book" placeholder="请选择是否可预约" style="width: 100%;">
<el-option v-for="item in false_or_true" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:floor>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>所在楼层
</div>
<div class="xy-table-item-content">
<el-input v-model="form.floor" placeholder="请输入所在楼层" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:total>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>容纳人数
</div>
<div class="xy-table-item-content">
<el-input v-model="form.total" placeholder="请输入容纳人数" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>排序
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sort" type="number" placeholder="请输入排序" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:image_id> <template v-slot:image_id>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;"> <div class="xy-table-item-label" style="font-weight: bold;">
@ -71,9 +117,13 @@
form: { form: {
name: '', name: '',
introduce: '', introduce: '',
dateRange: ['08:30','17:30'], dateRange: ['09:00','17:30'],
is_book:0,
floor:'',
total:'',
sort:0,
image_id: [], image_id: [],
start_time:'08:30', start_time:'09:00',
end_time:'17:30' end_time:'17:30'
}, },
action: `${process.env.VUE_APP_UPLOAD_API}`, action: `${process.env.VUE_APP_UPLOAD_API}`,
@ -138,7 +188,9 @@
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
this.fileList = res.image this.fileList = res.image
this.form.dateRange = res.start_time?[res.start_time,res.end_time]:['',''] this.form.dateRange = res.start_time?[res.start_time,res.end_time]:['',''],
this.form.sort = res.sort?res.sort:0
this.form.is_book = res.is_book?res.is_book:0
}) })
}, },

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'" :title="type=='show'?'预约查看':'预约审核'" <xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="type=='show'?'预约查看':'预约审核'"
:form="form"> :form="form">
<template v-slot:name> <template v-slot:name>
<div class="xy-table-item" style="padding:0"> <div class="xy-table-item" style="padding:0">
@ -73,6 +73,33 @@
<el-button type="primary" plain style='margin:15px;' @click="submit(3)"></el-button> <el-button type="primary" plain style='margin:15px;' @click="submit(3)"></el-button>
</div> </div>
</div> </div>
<div style="text-align: left;">第三方记录</div>
<div>
<xy-table :list="thirdArr" :isPage="false" :height="300"
:table-item="table_item">
<template v-slot:finally>
<el-table-column align='center' label="预约结果" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.finally===1">
成功
</div>
<div v-else>
失败
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="120" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" v-if="scope.row.finally!=1"
@click="sendBook(scope.row.appointment_id)">重新预约</el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div> </div>
</div> </div>
@ -91,7 +118,8 @@
import myMixins from "@/mixin/selectMixin.js"; import myMixins from "@/mixin/selectMixin.js";
import { import {
show, show,
save save,
retry
} from "@/api/book/index.js" } from "@/api/book/index.js"
export default { export default {
mixins: [myMixins], mixins: [myMixins],
@ -104,9 +132,20 @@
type: 'show', type: 'show',
id: '', id: '',
submitObj: {}, submitObj: {},
thirdArr:[],
form: { form: {
name: '', name: '',
}, },
table_item:[{
prop:'remark',
label:'预约内容'
},{
prop:'finally',
label:'预约结果'
},{
prop:'created_at',
label:'发送时间'
}]
} }
}, },
created() {}, created() {},
@ -122,6 +161,17 @@
this.$emit('refresh') this.$emit('refresh')
}) })
}, },
sendBook(id){
retry({
id:id
}).then(res=>{
this.$message({
type: 'success',
message: '重新发送预约成功'
})
this.getDetail()
})
},
formatHH(val){ formatHH(val){
if(val){ if(val){
return this.$moment(val).format("HH:mm:ss") return this.$moment(val).format("HH:mm:ss")
@ -132,10 +182,10 @@
async getDetail() { async getDetail() {
await show({ await show({
id: this.id, id: this.id,
show_relation: ['user', 'appointmentAccompany', 'appointmentConfig'] show_relation: ['user', 'appointmentAccompany', 'appointmentConfig','third_appointment_logs']
}).then(res => { }).then(res => {
this.submitObj = this.base.deepCopy(res, this.submitObj) this.submitObj = this.base.deepCopy(res, this.submitObj)
this.thirdArr = res.third_appointment_logs?res.third_appointment_logs:[]
}) })
} }
}, },

@ -145,7 +145,7 @@
align: 'center', align: 'center',
width: 120, width: 120,
}, { }, {
prop: 'user.username', prop: 'name',
label: '预约人', label: '预约人',
align: 'center', align: 'center',
width: 120, width: 120,

@ -109,6 +109,8 @@
const res = await index({ const res = await index({
page: this.select.page, page: this.select.page,
page_size: this.select.page_size, page_size: this.select.page_size,
sort_name:'sort',
sort_type:'ASC'
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -76,17 +76,24 @@
}, },
// //
async getHeaders() { async getHeaders() {
let _except = []
// //
if (this.tableName === 'users') {
_except = ['plate', 'is_import', 'is_vip', 'is_schoolmate', 'appointment_total', 'letter', 'score', 'code',
'pid'
]
}
const res = await realTableShow({ const res = await realTableShow({
table_name: this.tableName table_name: this.tableName,
except: _except
}) })
let b = []; let b = [];
for (let key in res) { for (let key in res) {
if (!this.base.isNull(res[key])) { if (!this.base.isNull(res[key])) {
b.push({ b.push({
key: key, key: key,
title: res[key] title: res[key],
width:120
}); });
} }
} }
@ -94,7 +101,8 @@
if (this.tableName === 'course_contents') { if (this.tableName === 'course_contents') {
b.push({ b.push({
key: '', key: '',
title: '老师简介' title: '老师简介',
width:120
}); });
b.map(item => { b.map(item => {
if (item.key === 'teacher_id') { if (item.key === 'teacher_id') {
@ -117,7 +125,8 @@
if (this.tableName === 'users') { if (this.tableName === 'users') {
b.unshift({ b.unshift({
key: 'course_name', key: 'course_name',
title: '课程名字' title: '课程名字',
width:120
}); });
} }
@ -133,12 +142,12 @@
}, },
uploadSuccess(response, file, fileList) { uploadSuccess(response, file, fileList) {
console.log(response, file, fileList) console.log(response, file, fileList)
console.log("window.screen.height",window.screen.height) console.log("window.screen.height", window.screen.height)
if (response && response.hasOwnProperty("errcode")) { if (response && response.hasOwnProperty("errcode")) {
this.$message({ this.$message({
message: response.errmsg || "上传失败", message: response.errmsg || "上传失败",
type: "error", type: "error",
duration:2000, duration: 2000,
offset: window.screen.height / 4 offset: window.screen.height / 4
}); });
this.fileList = [] this.fileList = []
@ -167,7 +176,7 @@
}, },
exportExcel(sheetName) { exportExcel(sheetName) {
const data = [this.headers.map((header) =>header.title)]; const data = [this.headers.map((header) => header.title)];
const wb = XLSX.utils.book_new(); const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data); const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName); XLSX.utils.book_append_sheet(wb, ws, sheetName);
@ -185,6 +194,11 @@
}, },
imports() { imports() {
if(this.tableName=='users'){
this.tableList.map(item=>{
item.username = item.name
})
}
request({ request({
method: "post", method: "post",
url: this.import_action, url: this.import_action,
@ -219,13 +233,13 @@
} }
}, },
dialogVisible(newval) { dialogVisible(newval) {
console.log("newval", newval, this.tableName,this.formInfo) console.log("newval", newval, this.tableName, this.formInfo)
if (newval) { if (newval) {
let changeTableName = this.tableName.replace('_', '-') let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show` this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import` this.import_action = `/api/admin/${changeTableName}/import`
// //
if(this.tableName==='users'){ if (this.tableName === 'users') {
this.import_action = `/api/admin/${changeTableName}/import-study` this.import_action = `/api/admin/${changeTableName}/import-study`
} }

@ -104,6 +104,14 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-slot:mobile>
<el-table-column align='center' label="联系方式" width="120" header-align="center">
<template slot-scope="scope">
{{base.maskPhoneNumber(scope.row.mobile)}}
</template>
</el-table-column>
</template>
<template v-slot:is_schoolmate> <template v-slot:is_schoolmate>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center"> <el-table-column align='center' label="是否校友库学员" width="120" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">

@ -97,6 +97,13 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-slot:mobile>
<el-table-column align='center' label="联系方式" width="120" header-align="center">
<template slot-scope="scope">
{{base.maskPhoneNumber(scope.row.mobile)}}
</template>
</el-table-column>
</template>
<template v-slot:is_schoolmate> <template v-slot:is_schoolmate>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center"> <el-table-column align='center' label="是否校友库学员" width="120" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save