回访明细

master
xy 1 year ago
parent 5d978ad53c
commit b90bd260be

@ -19,6 +19,7 @@
"core-js": "3.6.5",
"echarts": "^4.2.1",
"element-ui": "2.13.2",
"file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"less-loader": "^5.0.0",
"moment": "^2.29.2",
@ -30,7 +31,8 @@
"vue-amap": "^0.5.10",
"vue-count-to": "^1.0.13",
"vue-router": "3.0.6",
"vuex": "3.1.0"
"vuex": "3.1.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",

@ -0,0 +1,33 @@
import request from "@/utils/request";
export function getList(params){
return request({
method:'get',
url:'/api/admin/schedule-list-callbacks/get-list',
params
})
}
export function getForm(id,params){
return request({
method:'get',
url:`/api/admin/schedule-list-callbacks/get-form/${id}`,
params
})
}
export function save(data){
return request({
method:'post',
url:'/api/admin/schedule-list-callbacks/save',
data
})
}
export function destroy(id,data){
return request({
method:'post',
url:`/api/admin/schedule-list-callbacks/delete/${id}`,
data
})
}

@ -1,178 +1,184 @@
import {
login,
logout,
getInfo
} from '@/api/user'
import {
getToken,
setToken,
removeToken
} from '@/utils/auth'
import { getList as areaList } from "@/api/system/adminArea"
import { getList as typeList } from "@/api/system/adminProductType"
import {
resetRouter
} from '@/router'
const getDefaultState = () => {
return {
token: getToken(),
name: '',
user_id:'',
avatar: '',
roles: [],
typeAuth: [],
areaAuth: []
}
}
const state = getDefaultState()
const mutations = {
RESET_STATE: (state) => {
Object.assign(state, getDefaultState())
},
SET_TOKEN: (state, token) => {
state.token = token
},
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_TYPEAUTH:(state,arr) => {
state.typeAuth = arr
},
SET_AREAAUTH:(state,arr) => {
state.areaAuth = arr
},
SET_USERID:(state,id) => {
state.user_id = id
}
}
const actions = {
// user login
login({
commit
}, userInfo) {
const {
username,
password
} = userInfo
return new Promise((resolve, reject) => {
login({
username: username.trim(),
password: password
}).then(response => {
console.log(response)
const {
data
} = response;
console.log(response.access_token)
commit('SET_TOKEN', response.access_token)
setToken(response.access_token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// get user info
getInfo({
commit,
state
}) {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
if (!response) {
reject('身份验证失败请重新登录')
}
response["roles"] = ["admin"];
const {
roles,
name,
avatar,
id
} = response
commit('SET_ROLES', roles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
commit('SET_USERID',id)
resolve(response)
}).catch(error => {
reject(error)
})
})
},
// user logout
logout({
commit,
state
}) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
removeToken() // must remove token first
resetRouter()
commit('RESET_STATE')
resolve()
}).catch(error => {
reject(error)
})
})
},
// remove token
resetToken({
commit
}) {
return new Promise(resolve => {
removeToken() // must remove token first
commit('RESET_STATE')
resolve()
})
},
//获取用户板块权限
getType({commit,state}){
return new Promise((resolve,reject) => {
typeList({
admin_id:state.user_id
}).then(res => {
commit('SET_TYPEAUTH',res)
resolve(res)
}).catch(err => {
reject(err)
})
})
},
//获取用户地区权限
getArea({commit,state}){
return new Promise((resolve,reject) => {
areaList({
admin_id:state.user_id
}).then(res => {
commit('SET_AREAAUTH',res)
resolve(res)
}).catch(err => {
reject(err)
})
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
import {
login,
logout,
getInfo
} from '@/api/user'
import {
getToken,
setToken,
removeToken
} from '@/utils/auth'
import { getList as areaList } from "@/api/system/adminArea"
import { getList as typeList } from "@/api/system/adminProductType"
import {
resetRouter
} from '@/router'
const getDefaultState = () => {
return {
token: getToken(),
name: '',
user_id:'',
avatar: '',
roles: [],
typeAuth: [],
areaAuth: [],
myRoles: [],
}
}
const state = getDefaultState()
const mutations = {
SET_MYROLES: (state, roles) => {
state.myRoles = roles;
},
RESET_STATE: (state) => {
Object.assign(state, getDefaultState())
},
SET_TOKEN: (state, token) => {
state.token = token
},
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_TYPEAUTH:(state,arr) => {
state.typeAuth = arr
},
SET_AREAAUTH:(state,arr) => {
state.areaAuth = arr
},
SET_USERID:(state,id) => {
state.user_id = id
}
}
const actions = {
// user login
login({
commit
}, userInfo) {
const {
username,
password
} = userInfo
return new Promise((resolve, reject) => {
login({
username: username.trim(),
password: password
}).then(response => {
console.log(response)
const {
data
} = response;
console.log(response.access_token)
commit('SET_TOKEN', response.access_token)
setToken(response.access_token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// get user info
getInfo({
commit,
state
}) {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
if (!response) {
reject('身份验证失败请重新登录')
}
response["roles"] = ["admin"];
const {
roles,
name,
avatar,
id,
role
} = response
commit('SET_MYROLES', role)
commit('SET_ROLES', roles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
commit('SET_USERID',id)
resolve(response)
}).catch(error => {
reject(error)
})
})
},
// user logout
logout({
commit,
state
}) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
removeToken() // must remove token first
resetRouter()
commit('RESET_STATE')
resolve()
}).catch(error => {
reject(error)
})
})
},
// remove token
resetToken({
commit
}) {
return new Promise(resolve => {
removeToken() // must remove token first
commit('RESET_STATE')
resolve()
})
},
//获取用户板块权限
getType({commit,state}){
return new Promise((resolve,reject) => {
typeList({
admin_id:state.user_id
}).then(res => {
commit('SET_TYPEAUTH',res)
resolve(res)
}).catch(err => {
reject(err)
})
})
},
//获取用户地区权限
getArea({commit,state}){
return new Promise((resolve,reject) => {
areaList({
admin_id:state.user_id
}).then(res => {
commit('SET_AREAAUTH',res)
resolve(res)
}).catch(err => {
reject(err)
})
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}

@ -11,15 +11,15 @@
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.business.server_money_total}}
{{totaldata.business.server_money_total.toFixed(2)}}
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.business.nurse_money_total}}</span>
<span>{{totaldata.business.nurse_money_total.toFixed(2)}}</span>
<span>护工金额</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.business.remain_money_total}}</span>
<span>{{totaldata.business.remain_money_total.toFixed(2)}}</span>
<span>留存金额</span>
</div>
</div>

@ -0,0 +1,348 @@
<template>
<div>
<xy-dialog ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增回访' : '编辑回访'"
:form="form"
:rules="rules"
@submit="submit">
<template v-slot:way>
<div class="xy-table-item">
<div class="xy-table-item-label">
回访方式
</div>
<div class="xy-table-item-content">
<el-select v-model="form.way"
clearable
placeholder="请选择回访方式"
style="width: 300px;">
<el-option v-for="item in ways"
:key="item.id"
:label="item.value"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:is_coherent>
<div class="xy-table-item">
<div class="xy-table-item-label">
是否接通
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.is_coherent"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
</div>
</div>
</template>
<template v-slot:visit_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>
回访时间
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.visit_time"
placeholder="请选择回访时间"
style="width: 300px;"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:is_serve>
<div class="xy-table-item">
<div class="xy-table-item-label">
是否服务
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.is_serve"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
</div>
</div>
</template>
<template v-slot:satisfy>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>
满意度
</div>
<div class="xy-table-item-content">
<el-select v-model="form.satisfy"
clearable
placeholder="请选择满意度"
style="width: 300px;">
<el-option v-for="item in satisfys"
:key="item.id"
:label="item.value"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:is_standard>
<div class="xy-table-item">
<div class="xy-table-item-label">
服务规范
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.is_standard"
:active-value="1"
:inactive-value="0"
active-text="规范"
inactive-text="不规范"
></el-switch>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
回访备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea"
:autosize="{minRows:2}"
v-model="form.remark"
clearable
placeholder="请输入回访备注"
style="width: 300px;"
></el-input>
</div>
</div>
</template>
<template v-slot:file_ids>
<div class="xy-table-item">
<div class="xy-table-item-label">
回访照片
</div>
<div class="xy-table-item-content">
<el-upload
style="width: 320px;"
class="upload-demo"
:action="action"
:on-success="(response, file, fileList) => successHandle(response, file, fileList, 'file_ids')"
:before-upload="uploadBefore"
:file-list="file_ids"
:on-remove="(file, fileList) => removeHande(file, fileList, 'file_ids')"
list-type="picture-card">
<i slot="default" class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过20MB</div>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import { getForm, save } from "@/api/callbacks";
export default {
props: {
ways: {
type: Array,
default: () => [
{
id: 1,
value: "上门"
},
{
id: 2,
value: "电话"
}
],
},
satisfys: {
type: Array,
default: () => [
{
id: 1,
value: "非常满意"
},
{
id: 2,
value: "满意"
},
{
id: 3,
value: "一般"
},
{
id: 4,
value: "不满意"
}
],
},
},
data() {
return {
isShow: false,
id: "",
type: "",
action: process.env.VUE_APP_UPLOAD_API,
file_ids: [],
form: {
schedule_list_id: "",
way: "",
is_coherent: "",
visit_time: "",
is_serve: "",
satisfy: "",
is_standard: "",
remark: "",
file_ids: "",
},
rules: {
visit_time: [
{
required: true,
message: "请填写回访时间",
},
],
satisfy: [
{
required: true,
message: "请填写满意度",
},
],
},
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["dialog"].clearValidate();
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
getId() {
return this.id;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
},
//
successHandle(response, file, fileList, key) {
this[key] = fileList;
},
removeHande(file, fileList, key) {
this[key] = fileList;
},
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 20 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过20MB",
});
return false;
}
},
async getDetail() {
const res = await getForm(this.id);
this.$integrateData(this.form, res);
this.file_ids = res.files.map(i => ({
url: i.url,
name: i.original_name,
response: i
}))
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.form.file_ids = this.file_ids.map(i => i.response.id)
save(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增回访" : "编辑回访" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
},
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.init();
this.file_ids = [];
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,129 @@
<template>
<div>
<Drawer title="回访明细" :closable="false" :width="54" v-model="isShow">
<div class="info">
<span class="info-title">工单服务日期</span>
<span class="info-content">
{{ (row.schedule_list && row.schedule_list.date) ? row.schedule_list.date : '' }}
</span>
</div>
<div class="info">
<span class="info-title">护理人</span>
<span class="info-content">
{{ (row.schedule_list && row.schedule_list.nurse) ? row.schedule_list.nurse.name : '' }}
</span>
</div>
<div class="info">
<span class="info-title">被护理人</span>
<span class="info-content">
{{ (row.schedule_list && row.schedule_list.customer) ? row.schedule_list.customer.name : '' }}
</span>
</div>
<div class="info">
<span class="info-title">回访方式</span>
<span class="info-content">
{{ (row.way && ways.find(i => i.id === row.way)) ? ways.find(i => i.id === row.way).value : '' }}
</span>
</div>
<div class="info">
<span class="info-title">是否接通</span>
<span class="info-content">{{ row.is_coherent ? '是' : '否' }}</span>
</div>
<div class="info">
<span class="info-title">回访时间</span>
<span class="info-content">{{ row.visit_time }}</span>
</div>
<div class="info">
<span class="info-title">是否服务</span>
<span class="info-content">{{ row.is_serve ? '是' : '否' }}</span>
</div>
<div class="info">
<span class="info-title">满意度</span>
<span class="info-content">
{{ (row.satisfy && satisfys.find(i => i.id === row.satisfy)) ? satisfys.find(i => i.id === row.satisfy).value : '' }}
</span>
</div>
<div class="info">
<span class="info-title">服务规范</span>
<span class="info-content">{{ row.is_standard ? '规范' : '不规范' }}</span>
</div>
<div class="info">
<span class="info-title">备注</span>
<span class="info-content">{{ row.remark }}</span>
</div>
<div class="info">
<span class="info-title">回访图片</span>
<div>
<el-image
:preview-src-list="row.files.map(i => i.url)"
v-for="item in row.files"
style="max-width: 200px;margin-right: 6px;"
:src="item.url"
fit="cover"></el-image>
</div>
</div>
</Drawer>
</div>
</template>
<script>
import { deepCopy } from "@/utils";
export default {
props: {
ways: Array,
satisfys: Array
},
data() {
return {
isShow: false,
row: {},
key2Name: {
schedule_list_id: "",
way: "回访方式",
is_coherent: "是否接通",
visit_time: "回访时间",
is_serve: "是否服务",
satisfy: "满意度",
is_standard: "服务规范",
remark: "备注",
file_ids: "回访图片",
}
}
},
methods: {
show () {
this.isShow = true;
},
hide () {
this.isShow = false;
},
setRow (row) {
this.row = deepCopy(row)
}
},
computed: {},
}
</script>
<style scoped lang="scss">
.info {
line-height: 2;
}
.info-title{
font-weight: 600;
}
.info-content{
padding-left: 10px;
}
</style>

@ -74,6 +74,7 @@
</template>
<template v-else>
<el-button
v-if="hasEditorAuth"
style="margin: 10px 0"
size="small"
round
@ -92,6 +93,7 @@
placement="top"
>
<Button
v-if="hasEditorAuth"
type="primary"
size="small"
style="margin-left: 4px;margin-bottom: 8px;"
@ -273,6 +275,9 @@ export default {
},
},
computed: {
hasEditorAuth () {
return !!this.$store.state.user.myRoles.find(item => item.name === '服务明细操作')
},
rowFormat() {
if (this.selectedRow()) {
if (this.type === 1) {

@ -0,0 +1,368 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="回访明细">
<div slot="content"></div>
<slot>
<div class="select">
<div>
<span>回访日期</span>
<el-date-picker v-model="select.start_visit_time" style="width: 186px;" placeholder="回访开始日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" size="small"></el-date-picker>
<span style="padding-left: 12px;"></span>
<el-date-picker v-model="select.end_visit_time" style="width: 186px;" placeholder="回访结束日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" size="small"></el-date-picker>
</div>
<div>
<span>服务日期</span>
<el-date-picker v-model="select.start_date" style="width: 140px;" placeholder="服务开始日期" type="date" value-format="yyyy-MM-dd" size="small"></el-date-picker>
<span style="padding-left: 12px;"></span>
<el-date-picker v-model="select.end_date" style="width: 140px;" placeholder="服务结束日期" type="date" value-format="yyyy-MM-dd" size="small"></el-date-picker>
</div>
<div>
<span>护理人</span>
<el-select
filterable
size="small"
v-model="select.nurse_id"
placeholder="选择护理人姓名"
clearable
style="width: 160px;"
>
<el-option
v-for="item in nurses"
:value="item.id"
:label="item.name"
:key="item.id"
></el-option>
</el-select>
</div>
<div>
<span>被护理人</span>
<el-select
v-load-more="getCustomers"
:loading="customerLoading"
remote
:remote-method="customerRemote"
filterable
size="small"
v-model="select.customer_id"
placeholder="选择被护理人"
clearable
style="width: 160px;"
>
<el-option
v-for="item in customers"
:value="item.id"
:label="item.name"
:key="item.id"
></el-option>
</el-select>
</div>
<div>
<Button type="primary" @click="total = 0,select.page = 1,getList()">查询</Button>
</div>
<div>
<Button type="primary" @click="exportExcel"></Button>
</div>
<!-- <div>-->
<!-- <Button type="primary" @click="$refs['add'].type = 'add',$refs['add'].isShow = true">新建</Button>-->
<!-- </div>-->
</div>
</slot>
</lx-header>
</div>
<xy-table
:total="total"
:list="list"
:table-item="table"
@editor="editor"
@delete="destroy"
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getList()}">
<template v-slot:btns>
<el-table-column label="操作" fixed="right" header-align="center" align="left" width="200">
<template v-slot:default="scope">
<Button
size="small"
type="primary"
style="margin-right: 6px"
@click="_ => {
$refs['drawer'].setRow(scope.row)
$refs['drawer'].show()
}"
>查看</Button>
<Poptip
transfer
confirm
title="确认要删除?"
@on-ok="destroy(scope.row)"
>
<Button size="small" type="error" ghost style="margin-right: 6px"
>删除</Button
>
</Poptip>
<Button size="small"
ghost
type="primary"
@click="editor(scope.row)">编辑</Button>
</template>
</el-table-column>
</template>
</xy-table>
<add ref="add" :ways="ways" :satisfys="satisfys" @refresh="getList"></add>
<drawer :ways="ways" :satisfys="satisfys" ref="drawer"></drawer>
</div>
</template>
<script>
import {getList,destroy} from '@/api/callbacks'
import {getList as customerIndex} from "@/api/customer";
import {getList as nurseList} from "@/api/worker";
import add from "@/views/finance/component/addCallbacks.vue";
import drawer from "@/views/finance/component/followUpDrawer.vue"
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
export default {
components:{
add,
drawer
},
data() {
return {
nurses: [],
ways: [
{
id: 1,
value: "上门"
},
{
id: 2,
value: "电话"
}
],
satisfys: [
{
id: 1,
value: "非常满意"
},
{
id: 2,
value: "满意"
},
{
id: 3,
value: "一般"
},
{
id: 4,
value: "不满意"
}
],
customers:[],
customerLoading: false,
customerTotal: 0,
customerSelect: {
page: 1,
page_size: 20,
keyword: ""
},
select:{
page:1,
page_size:10,
customer_id: "",
nurse_id: "",
start_visit_time: "",
end_visit_time: "",
start_date: "",
end_date: ""
},
total:0,
list:[],
table:[
{
type:'index',
label:' ',
width: 56,
},
{
prop: 'visit_time',
label:'回访日期',
width: 160
},
{
prop:'schedule_list.customer.name',
label: '被护理人',
width: 160,
},
{
prop: 'schedule_list.date',
label: '工单服务日期',
width: 160
},
{
prop: 'schedule_list.nurse.name',
label: '护理人',
width: 140
},
{
prop: 'is_standard',
label: '服务规范',
width: 180,
formatter: (data, row ,value) => {
return value ? '是' : '否'
}
},
{
prop: 'way',
label: '回访方式',
width: 180,
formatter: (data, row, value) => {
return this.ways.find(i => i.id === value)?.value
}
},
{
prop: 'satisfy',
label: '满意度',
width: 140,
formatter: (data, row, value) => {
return this.satisfys.find(i => i.id === value)?.value
}
}
]
}
},
methods: {
async getCustomers(){
if ((this.customers.length >= this.customerTotal) && this.customers.length !== 0) return;
this.customerLoading = true;
try {
const res = await customerIndex(this.customerSelect,false)
this.customers.push(...res.data.data);
this.customerTotal = res.data.total;
this.customerSelect.page++;
this.customerLoading = false;
} catch (err) {
this.customerLoading = false;
}
},
async getNurses(){
const res = await nurseList({
page: 1,
page_size: 999,
is_simple: 1
})
this.nurses = res.data
},
customerRemote (query) {
let keyword = query ? query.trim() : "";
this.customers = [];
this.customerTotal = 0;
this.customerSelect.page = 1;
this.customerSelect.keyword = keyword;
this.getCustomers();
},
async getList(){
const res = await getList(this.select)
this.total = res.total
this.list = res.data
console.log(this.list)
},
editor(row){
this.$refs['add'].setId(row.id)
this.$refs['add'].setType('editor')
this.$refs['add'].show()
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','')
this.getList()
})
},
async exportExcel () {
const res = await getList({
...this.select,
page: 1,
page_size: 9999
})
const handlerValue = (key, obj) => {
try {
if (key.includes(".")) {
let splitKey = key.split(".")
let temp = obj;
for (let i of splitKey) {
if (i && typeof i === 'string' && typeof temp === 'object') {
temp = temp[i]
}
}
return temp
} else {
return obj[key]
}
} catch (err) {
console.error(err)
}
}
if (res.data) {
let header = this.table.slice(1).map(i => i.label)
let data = res.data.map(i => {
let temp = [];
this.table.slice(1).forEach(row => {
if (row.hasOwnProperty("formatter")) {
temp.push(row.formatter(false, false, handlerValue(row.prop, i)))
} else {
temp.push(handlerValue(row.prop, i))
}
})
return temp;
})
data.unshift(header)
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, "回访明细");
const wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
`回访明细${this.$moment().format('YYYY-MM-DD')}.xlsx`
);
}
}
},
created() {
this.getNurses()
this.getCustomers()
this.getList()
}
}
</script>
<style scoped lang="scss">
.select {
display: flex;
flex-wrap: wrap;
align-items: center;
& > div {
margin: 2px 6px;
& > span {
padding-right: 12px;
font-weight: 600;
}
}
}
</style>

@ -164,7 +164,7 @@
"
>
<template v-slot:btns>
<el-table-column label="操作" fixed="right" align="center" width="130">
<el-table-column label="操作" fixed="right" header-align="center" align="left" width="200">
<template v-slot:default="scope">
<Poptip
transfer
@ -186,14 +186,18 @@
$refs['draw'].select.id = scope.row.id;
$refs['draw'].isShow = true;
}"
>查看</Button
>
>查看</Button>
<Button size="small"
ghost
type="primary"
@click="$refs['add'].setType('add'),$refs['add'].setForm('schedule_list_id', scope.row.id),$refs['add'].show()">回访</Button>
</template>
</el-table-column>
</template>
</xy-table>
<draw ref="draw" :type="2" @refresh="getList"></draw>
<add ref="add" @refresh="getList"></add>
</div>
</template>
@ -205,8 +209,10 @@ import { getList as nurseList} from "@/api/worker"
import { download } from "@/utils/downloadRequest"
import draw from "./component/serveDraw.vue"
import add from "@/views/finance/component/addCallbacks.vue";
export default {
components:{
add,
draw
},
provide(){

@ -38,7 +38,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>主服务板块
</div>
<div class="xy-table-item-content">
<el-select v-model="form.product_type_id" placeholder="请选择主服务板块" style="width: 300px;">
<el-select value-key="id" multiple :value="form.product_type_id.split(',').filter(i=>i).map(i=>Number(i))" placeholder="请选择主服务板块" style="width: 300px;" @change="e => form.product_type_id = e.toString()">
<el-option v-for="item in productType" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
@ -390,7 +390,7 @@ export default {
async getDetail() {
const res = await getForm(this.id)
this.$integrateData(this.form, res)
this.form.avatar_url = res.upload.url
this.form.avatar_url = res.upload?.url
},
submit() {
if (this.type === 'editor') {

@ -145,9 +145,19 @@ export default {
width: 180
},
{
prop: 'serve_area_detail.value',
label: '服务主区域',
width: 200
width: 200,
customFn: row => {
return (
<div style="display: flex;flex-wrap: wrap;">
{
row.product_type.map(i => (
<el-tag style="margin: 2px 4px;" size="mini" type="primary">{ i.name }</el-tag>
))
}
</div>
)
}
},
{
prop: 'product_type.name',

Loading…
Cancel
Save