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){
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) {
// url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数)
var strRegex =

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

@ -224,7 +224,11 @@
_arr = this.user_options.filter(item => !this.form.user_id.includes(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(",")
}
if (this.type === "editor") {
@ -264,11 +268,11 @@
changeUser(e) {
if (e) {
this.form.user_id = e
this.form.name = ''
if (this.type === "add") {
this.user_options.map(item => {
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)
if(e){
this.form.name = e
this.form.user_id = ''
this.form.user_id = 0
}
console.log(this.form.user_id, this.form.name)
},

@ -34,6 +34,52 @@
</el-time-picker>
</div>
</div>
</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>
<div class="xy-table-item">
@ -71,9 +117,13 @@
form: {
name: '',
introduce: '',
dateRange: ['08:30','17:30'],
dateRange: ['09:00','17:30'],
is_book:0,
floor:'',
total:'',
sort:0,
image_id: [],
start_time:'08:30',
start_time:'09:00',
end_time:'17:30'
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
@ -138,7 +188,9 @@
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
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>
<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">
<template v-slot:name>
<div class="xy-table-item" style="padding:0">
@ -72,6 +72,33 @@
<el-button type="primary" style='margin:15px;' @click="submit(2)"></el-button>
<el-button type="primary" plain style='margin:15px;' @click="submit(3)"></el-button>
</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>
@ -91,7 +118,8 @@
import myMixins from "@/mixin/selectMixin.js";
import {
show,
save
save,
retry
} from "@/api/book/index.js"
export default {
mixins: [myMixins],
@ -103,10 +131,21 @@
isShow: false,
type: 'show',
id: '',
submitObj: {},
submitObj: {},
thirdArr:[],
form: {
name: '',
},
},
table_item:[{
prop:'remark',
label:'预约内容'
},{
prop:'finally',
label:'预约结果'
},{
prop:'created_at',
label:'发送时间'
}]
}
},
created() {},
@ -121,6 +160,17 @@
this.isShow = false
this.$emit('refresh')
})
},
sendBook(id){
retry({
id:id
}).then(res=>{
this.$message({
type: 'success',
message: '重新发送预约成功'
})
this.getDetail()
})
},
formatHH(val){
if(val){
@ -132,10 +182,10 @@
async getDetail() {
await show({
id: this.id,
show_relation: ['user', 'appointmentAccompany', 'appointmentConfig']
show_relation: ['user', 'appointmentAccompany', 'appointmentConfig','third_appointment_logs']
}).then(res => {
this.submitObj = this.base.deepCopy(res, this.submitObj)
this.thirdArr = res.third_appointment_logs?res.third_appointment_logs:[]
})
}
},

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

@ -108,7 +108,9 @@
async getList() {
const res = await index({
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.total = res.total

@ -75,18 +75,25 @@
this.dialogVisible = false;
},
//
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({
table_name: this.tableName
table_name: this.tableName,
except: _except
})
let b = [];
for (let key in res) {
if (!this.base.isNull(res[key])) {
b.push({
key: key,
title: res[key]
title: res[key],
width:120
});
}
}
@ -94,7 +101,8 @@
if (this.tableName === 'course_contents') {
b.push({
key: '',
title: '老师简介'
title: '老师简介',
width:120
});
b.map(item => {
if (item.key === 'teacher_id') {
@ -112,13 +120,14 @@
item.key = 'status_name'
}
})
}
// +
if (this.tableName === 'users') {
b.unshift({
key: 'course_name',
title: '课程名字'
});
}
// +
if (this.tableName === 'users') {
b.unshift({
key: 'course_name',
title: '课程名字',
width:120
});
}
this.table = this.headers = b
@ -132,30 +141,30 @@
});
},
uploadSuccess(response, file, fileList) {
console.log(response, file, fileList)
console.log("window.screen.height",window.screen.height)
console.log(response, file, fileList)
console.log("window.screen.height", window.screen.height)
if (response && response.hasOwnProperty("errcode")) {
this.$message({
message: response.errmsg || "上传失败",
type: "error",
duration:2000,
type: "error",
duration: 2000,
offset: window.screen.height / 4
});
this.fileList = []
this.tableList = []
return
}
}
//
if (this.tableName === 'course_keeps') {
response.map(item => {
item.status_name = item.status === 1 ? '正常' : '缺勤'
})
}
//
if (this.tableName === 'users') {
response.map(item => {
item.is_schoolmate = 1
})
}
//
if (this.tableName === 'users') {
response.map(item => {
item.is_schoolmate = 1
})
}
this.tableList = response;
this.fileList = fileList
@ -167,7 +176,7 @@
},
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 ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
@ -184,7 +193,12 @@
);
},
imports() {
imports() {
if(this.tableName=='users'){
this.tableList.map(item=>{
item.username = item.name
})
}
request({
method: "post",
url: this.import_action,
@ -207,7 +221,7 @@
},
computed: {},
watch: {
formInfo(newVal) {
formInfo(newVal) {
console.log("formInfo", newVal)
if (newVal && newVal instanceof Array) {
this.table = this.headers = newVal.map((i) => {
@ -219,32 +233,32 @@
}
},
dialogVisible(newval) {
console.log("newval", newval, this.tableName,this.formInfo)
console.log("newval", newval, this.tableName, this.formInfo)
if (newval) {
let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import`
//
if(this.tableName==='users'){
this.import_action = `/api/admin/${changeTableName}/import-study`
}
// if(this.tableName==='users'){
// this.import_action = `/api/admin/${changeTableName}/import-study`
// this.table = this.headers = this.formInfo.map((i) => {
// if(i.prop){
// console.log("i.prop",i.prop)
// return {
// key: i.prop,
// title: i.label,
// };
// }
// });
// console.log("this.table",this.headers)
// }else{
this.getHeaders()
let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import`
//
if (this.tableName === 'users') {
this.import_action = `/api/admin/${changeTableName}/import-study`
}
// if(this.tableName==='users'){
// this.import_action = `/api/admin/${changeTableName}/import-study`
// this.table = this.headers = this.formInfo.map((i) => {
// if(i.prop){
// console.log("i.prop",i.prop)
// return {
// key: i.prop,
// title: i.label,
// };
// }
// });
// console.log("this.table",this.headers)
// }else{
this.getHeaders()
// }
console.log("action", this.action, this.import_action)

@ -103,7 +103,15 @@
</div>
</template>
</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>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center">
<template slot-scope="scope">

@ -96,6 +96,13 @@
</div>
</template>
</el-table-column>
</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>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center">

Loading…
Cancel
Save