master
xy 3 years ago
parent 8af56966d2
commit c2ec7b25c4

@ -2,6 +2,6 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = https://sstt.115.langye.net
#VUE_APP_BASE_API = https://sstt.115.langye.net
VUE_APP_BASE_API = http://sstt.ali251.langye.net/
VUE_APP_UPLOAD_API = https://sstt.115.langye.net/api/admin/upload-file

@ -244,11 +244,6 @@ export default {
['selection-change']:selectChange,
['expand-change']:(row,expanded) => this.$emit('expand-change', {row,expanded})
}}>
<el-table-column
type="index"
width="50" fixed="left" align="center" >
</el-table-column>
{
tableItem.map((item, index) => {
//

@ -1,26 +1,7 @@
<template>
<div>
<xy-dialog ref="dialog" :form="{...this.form,...this.form1}" :is-show.sync="isShow" :rules="flag === 1 ? rules : rules1" title="编辑客户"
:width="74" type="form">
<template v-if="type === 'add'" v-slot:headerContent>
<el-steps :active="flag" simple style="width: 72%;margin: auto;">
<el-step title="客户录入" icon="el-icon-user-solid"></el-step>
<el-step title="订单录入" icon="el-icon-document-add"></el-step>
</el-steps>
</template>
<template v-slot:footerContent>
<Button @click="$refs['dialog'].reset()"></Button>
<template v-if="flag === 1">
<Button type="primary" @click="submit">{{type === 'add' ? ',退' : ''}}</Button>
<template v-if="type === 'add'">
<Button type="primary" @click="submit1">,</Button>
</template>
</template>
<template v-else>
<Button type="primary" @click="submitOrder"></Button>
</template>
</template>
<xy-dialog ref="dialog" :form="formFormat" :is-show.sync="isShow" :rules="rulesFormat" :title="type === 'add' ? '新增客户' : '编辑客户'"
:width="74" type="form" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -678,82 +659,63 @@ export default {
},
submit() {
this.$refs['dialog'].validate().then(res => {
this.form.sex = getSex(this.form.idcard)
this.form.birthday = getBirth(this.form.idcard)
Object.defineProperty(this.form,'city_id',{
value:this.form.area[0] || '',
enumerable: true,
writable: true,
configurable: true
})
Object.defineProperty(this.form,'area_id',{
value:this.form.area[1] || '',
enumerable: true,
writable: true,
configurable: true
})
Object.defineProperty(this.form,'street_id',{
value:this.form.area[2] || '',
enumerable: true,
writable: true,
configurable: true
})
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
enumerable: true,
writable: true,
configurable: true
})
}
console.log(this.form)
save(this.form).then(res => {
this.$successMessage(this.type, '客户')
this.isShow = false
this.$emit('refresh')
})
this.form.sex = getSex(this.form.idcard)
this.form.birthday = getBirth(this.form.idcard)
Object.defineProperty(this.form,'city_id',{
value:this.form.area[0] || '',
enumerable: true,
writable: true,
configurable: true
})
},
submit1(){
this.$refs['dialog'].validate().then(res => {
this.form.sex = getSex(this.form.idcard)
this.form.birthday = getBirth(this.form.idcard)
Object.defineProperty(this.form,'city_id',{
value:this.form.area[0] || '',
enumerable: true,
writable: true,
configurable: true
})
Object.defineProperty(this.form,'area_id',{
value:this.form.area[1] || '',
enumerable: true,
writable: true,
configurable: true
})
Object.defineProperty(this.form,'street_id',{
value:this.form.area[2] || '',
Object.defineProperty(this.form,'area_id',{
value:this.form.area[1] || '',
enumerable: true,
writable: true,
configurable: true
})
Object.defineProperty(this.form,'street_id',{
value:this.form.area[2] || '',
enumerable: true,
writable: true,
configurable: true
})
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
enumerable: true,
writable: true,
configurable: true
})
}
console.log(this.form)
save(this.form).then(res => {
if(this.type === 'add'){
this.form1.customer_id = res.id
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
enumerable: true,
writable: true,
configurable: true
Object.defineProperty(this.form1,'start_date',{
value:this.form1.date[0],
enumerable:true,
writable:true,
configurable:true
})
Object.defineProperty(this.form1,'end_date',{
value:this.form1.date[1],
enumerable:true,
writable:true,
configurable:true
})
delete this.form1.date
orderSave(this.form1).then(res => {
this.$successMessage(this.type, '客户')
this.$emit('refresh')
this.isShow = false
})
}else{
this.$emit('refresh')
this.$successMessage(this.type,'客户')
this.isShow = false
}
console.log(this.form)
save(this.form).then(res => {
this.$successMessage(this.type, '客户')
this.flag = 2
this.form1.customer_id = res.id
this.customerIdcard = res.idcard
})
})
},
@ -761,7 +723,7 @@ export default {
productPick(e){
this.pickedProduct = e
//
let age = getAgeByIdcard(this.customerIdcard)
let age = getAgeByIdcard(this.form.idcard)
if(age > this.pickedProduct.product_type.max_age || age < this.pickedProduct.product_type.min_age){
this.ageTemp = true
this.$message({
@ -855,6 +817,28 @@ export default {
})
},
},
computed:{
formFormat(){
if(this.type === 'add'){
return {
...this.form,
...this.form1
}
}else{
return this.form
}
},
rulesFormat(){
if(this.type === 'add'){
return {
...this.rules,
...this.rules1
}
}else{
return this.rules
}
}
},
watch: {
isShow(val) {
if (val) {

@ -4,7 +4,7 @@
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="护工排班视图"
text="服务明细视图"
>
<div slot="content"></div>
<slot>
@ -17,7 +17,7 @@
<Button
style="margin-right: 10px"
type="primary"
@click="(select.page = 1), getList"
@click="(select.page = 1), getList()"
>查询</Button
>
<xy-selectors @search="(select.page = 1), getList()" @reset="reset">
@ -129,6 +129,13 @@
</div>
</template>
</xy-selectors>
<Button
style="margin-right: 10px"
type="primary"
@click="exports"
>导出</Button
>
</div>
</slot>
</lx-header>
@ -153,15 +160,40 @@
}
"
>
<template v-slot:btns></template>
<template v-slot:btns>
<el-table-column label="操作" fixed="right" align="center" width="130">
<template v-slot:default="scope">
<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"
style="margin-right: 6px"
>查看</Button
>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</template>
<script>
import { scheduleDelete } from "@/api/schedule/index"
import { getList as customerIndex } from "@/api/customer"
import { scheduleList } from "@/api/schedule";
import { getList as nurseList} from "@/api/worker"
import { download } from "@/utils/downloadRequest"
export default {
data() {
return {
@ -182,55 +214,139 @@ export default {
list: [],
table: [
{
prop:'',
prop:'id',
label:'序号',
width:50
width:56
},
{
prop:'',
prop:'customer.name',
label:'被护理人',
width:120
},
{
prop:'',
prop:'nurse.name',
label:'护理人',
width:120
},
{
prop:'',
prop:'status',
label:'状态',
width:120
width:120,
formatter:(cell,data,val) => {
let map = new Map([
[0,'待护理'],
[1,'护理中'],
[2,'已护理']
])
return map.get(val)
}
},
{
prop:'',
prop:'date',
label:'计划时间',
width:180
width:180,
},
{
prop:'',
prop:'start_time',
label:'签到时间',
width:180
},
{
prop:'',
prop:'end_time',
label:'签退时间',
width: 180
},
{
prop:'',
prop:'customer_address.name',
label:'上门地址',
minWidth:220
minWidth:220,
align:'left'
},
{
label:'勾选服务',
minWidth: 400,
customFn:row => {
return (
<div class="sku" style={
{
'display':'flex',
'flex-wrap':'wrap'
}
}>
{
row?.sku?.map(item => {
return (
<div class="sku-item">
<div class="sku-item__name">
{ item.sku_info.name }
</div>
<div class="sku-item__time">
{ item.time || 0 }
</div>
</div>
)
})
}
</div>
)
}
},
{
prop:'product.name',
label:'产品',
width: 180
},
{
prop:'sign_in_address',
label:'签到地址',
minWidth: 220,
align:'left'
},
{
prop:'sign_out_address',
label:'签退地址',
minWidth: 220,
align:'left'
},
{
prop:'',
label:'勾选的服务时长',
label:'',
width: 160
},
{
prop:'',
label:'街道(镇)',
width: 160
},
{
prop:'created_at',
label:'创建日期',
width:180
},
{
prop:'admin.name',
label:'创建人',
width: 140
},
{
prop:'department.name',
label:'创建人部门',
width: 180
}
],
total: 0,
};
},
methods: {
destroy(row){
scheduleDelete({id:row.id}).then(res => {
this.$message({
type:'success',
message:'删除成功'
})
this.getList()
})
},
async getCustomers(){
const res = await customerIndex({
page:1,
@ -248,7 +364,22 @@ export default {
async getList() {
const res = await scheduleList(this.select)
this.list = res.data
console.log(this.list)
this.total = res.total
},
exports(){
download('/api/admin/chart/schedule-list-log','get',{
page: 1,
page_size: 9999,
nurse_name:this.select.nurse_name,
customer_name:this.select.customer_name,
address_name:this.select.address_name,
start_sign_in:this.select.start_sign_in,
end_sign_in:this.select.end_sign_in,
start_start_time:this.select.start_start_time,
end_start_time:this.select.end_start_time,
is_export:1
},`服务明细.xlsx`)
},
reset() {
@ -267,9 +398,6 @@ export default {
},
},
computed: {},
mounted() {
this.getList();
},
created() {
this.getNurses()
this.getCustomers()
@ -288,4 +416,23 @@ export default {
padding: 10px 10px;
}
}
.sku{
&-item{
border: 1px solid $primaryColor;
border-radius: 4px;
margin-bottom: 4px;
margin-right: 6px;
&__name{
background: $primaryColor;
color:#fff;
padding: 0 4px;
}
&__time{
}
}
}
</style>

@ -31,6 +31,9 @@ module.exports = {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
less: {
javascriptEnabled: true
},
sass:{
prependData: '@import "@/styles/index.scss";'
}
}
},

Loading…
Cancel
Save