master
271556543@qq.com 3 years ago
parent 7654265fd0
commit f78b00a11b

@ -18,14 +18,13 @@
@pageIndexChange="e => {select.page = e;getTypes()}"
@pageSizeChange="e => select.page_size = e"></xy-table>
<add-business ref="addBusiness" :skus="skus" @refresh="getTypes"></add-business>
<add-business ref="addBusiness" @refresh="getTypes"></add-business>
</div>
</template>
<script>
import {getList,destroy} from '@/api/productType'
import {parseTime} from '@/utils'
import {getList as getSkus} from '@/api/sku'
import addBusiness from "@/views/business/component/addBusiness";
export default {
@ -38,7 +37,6 @@ export default {
page_size:10,
page:1
},
skus:[],
total:0,
list:[],
@ -117,10 +115,6 @@ export default {
console.log(this.list)
},
async getSkus(){
const res = await getSkus({page_size:9999,page:1})
this.skus = res.data
},
editor(row){
this.$refs['addBusiness'].type = 'editor'
@ -140,7 +134,6 @@ export default {
},
mounted() {
this.getTypes()
this.getSkus()
}
}
</script>

@ -89,22 +89,20 @@
</div>
</template>
<template v-slot:product_sku_list>
<template v-slot:product_sku_category_list>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>关联服务
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>服务分类
</div>
<div class="xy-table-item-content">
<xy-table
ref="table"
:is-page="false"
:height="260"
:list="skus"
:table-item="skuTable"
@select="rowSelect"
@select-all="rowSelect">
<template v-slot:btns></template>
</xy-table>
<div class="classify-content">
<div class="classify-content__btn">
<el-button type="primary" size="small" @click="form.product_sku_category_list.push({id:'',name:''})"></el-button>
</div>
<div class="classify-content__input" v-for="(item,index) in form.product_sku_category_list">
<el-input v-model="item.name" placeholder="输入服务分类名称" style="width: 240px;"></el-input>
<el-button type="danger" icon="el-icon-delete" circle size="small" style="margin-left: 20px" @click="deleteCategory(item,index)"></el-button>
</div>
</div>
</div>
</template>
@ -113,7 +111,8 @@
</template>
<script>
import {getForm, save} from '@/api/productType'
import { save as saveSkuCategory ,destroy } from '@/api/skuCategory'
import { getForm, save } from '@/api/productType'
export default {
@ -144,7 +143,7 @@ export default {
sortnumber: 0,
max_age:0,
min_age:100,
product_sku_list:[]
product_sku_category_list:[]
},
rules: {
name: [
@ -176,45 +175,59 @@ export default {
{
prop:'service',
label:'服务内容',
minWidth: 160,
width: 160,
align:'left'
}
]
}
},
methods: {
deleteCategory(item,index){
if(item.id){
destroy(item.id).then(() => {
this.getDetail()
})
}else{
this.form.product_sku_category_list.splice(index,1)
}
},
async getDetail() {
const res = await getForm(this.id)
this.$integrateData(this.form, res)
this.form.product_sku_list = res.product_skus.map(item => {
this.form.product_sku_category_list = res.sku_category.map(item => {
return {
sku_id:item.sku_id
id:item.id,
name:item.name
}
})
console.log(res)
//
this.$refs['table'].clearSelection()
let ids = this.form.product_sku_list.map(item => item.sku_id)
this.skus.forEach(item => {
if(ids.indexOf(item.id) !== -1){
this.$refs['table'].toggleRowSelection(item)
}
})
},
rowSelect(selection){
console.log(selection)
this.form.product_sku_list = selection.map(item => {
async submit() {
let arr1 = [];//
let arr2 = [];//
this.form.product_sku_category_list.forEach(item => {
if(item.id){
arr1.push(saveSkuCategory({
name:item.name,
id:item.id
}))
}else{
arr2.push(saveSkuCategory({
name:item.name
}))
}
})
let categoryRes = await Promise.all([...arr1,...arr2])
console.log(categoryRes)
this.form.product_sku_category_list = categoryRes.map(item => {
return {
sku_id:item.id
sku_category_id:item.id
}
})
},
submit() {
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
@ -223,11 +236,10 @@ export default {
configurable: true
})
}
save(this.form).then(res => {
this.$successMessage(this.type, '业务类型')
this.isShow = false
this.$emit('refresh')
})
await save(this.form)
this.$successMessage(this.type, '业务类型')
this.isShow = false
this.$emit('refresh')
}
},
watch: {
@ -254,4 +266,19 @@ export default {
::v-deep .el-slider__marks-text{
margin-top: 6px !important;
}
.classify-content{
&__btn{
margin-bottom: 10px;
}
&__input{
width: 300px;
margin-bottom: 10px;
}
&>div:last-child{
margin-bottom: 0;
}
}
</style>

@ -474,8 +474,8 @@ export default {
sex: '',
birthday: '',
remark: '',
level_type:'',
level_id: '',
level_type:''
},
rules: {
name: [
@ -626,8 +626,8 @@ export default {
sex: '',
birthday: '',
remark: '',
level_id: '',
level_type:'',
level_id: '',
}
this.form1 = {
product_id: '',

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增打卡记录' : '编辑打卡记录'" :form="form" :rules="rules" @submit="submit">
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增打卡记录' : '编辑打卡记录'" :form="form" :rules="rules" @submit="submit">
<template v-slot:schedule_list_id>
</template>
<template v-slot:lat>
@ -140,7 +140,7 @@
{
prop:'sku_info.name',
label:'服务名称',
minWidth:120
width:120
},
{
prop:'sku_info.time_lenth',

@ -1,6 +1,6 @@
<template>
<div class="serve-detail">
<xy-dialog :is-show.sync="isShow">
<xy-dialog :width="58" :is-show.sync="isShow">
<template>
<div style="display: flex;align-items: center">
<div class="serve-detail__title">
@ -18,7 +18,7 @@
<xy-table :height="300" :is-page="false" :table-item="columns" :list="detail">
<template v-slot:btns>
<el-table-column align="center" width="80" label="操作" header-align="center">
<el-table-column align="center" width="180" label="操作" header-align="center">
<template v-slot:default="scope">
<Poptip transfer placement="top" >
<template v-slot:default>
@ -32,7 +32,15 @@
</template>
</Poptip>
<Button type="primary" size="small" @click="editor(scope)"></Button>
<Button type="primary" size="small" style="margin-left: 4px;" @click="editor(scope)"></Button>
<Poptip
transfer
confirm
title="确认要删除?"
@on-ok="destroy(scope.row)">
<Button size="small" type="error" ghost style="margin-left: 4px">删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
@ -49,6 +57,7 @@
</template>
<script>
import { destroy } from '@/api/scheduleListLog'
import {scheduleLog} from '@/api/schedule'
import addScheduleListLog from "@/views/finance/component/addScheduleListLog";
@ -119,6 +128,13 @@ export default {
this.$refs['addScheduleListLog'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','打卡记录')
this.getDetail()
})
},
setPicList(row){
this.picList = row.upload_list.map(item => item.upload?.url)
},

@ -7,7 +7,7 @@
<slot>
<div>
<!-- <Input placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>-->
<Button style="margin-left: 10px" type="primary" @click="select.page = 1,getList()">查询</Button>
<!-- <Button style="margin-left: 10px" type="primary" @click="select.page = 1,getList()">查询</Button>-->
<Button style="margin-left: 10px" type="primary"
@click="$refs['addProduct'].type = 'add',$refs['addProduct'].isShow = true">新建产品
</Button>

@ -6,7 +6,7 @@
<slot>
<div>
<!-- <Input placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>-->
<Button style="margin-left: 10px" type="primary" @click="select.page = 1,getSku()">查询</Button>
<!-- <Button style="margin-left: 10px" type="primary" @click="select.page = 1,getSku()">查询</Button>-->
<Button style="margin-left: 10px" type="primary" @click="$refs['addSku'].type = 'add',$refs['addSku'].isShow = true">新建服务</Button>
</div>
</slot>

@ -6,7 +6,7 @@
<slot>
<div>
<!-- <Input placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>-->
<Button style="margin-left: 10px" type="primary" @click="getSkuType"></Button>
<!-- <Button style="margin-left: 10px" type="primary" @click="getSkuType"></Button>-->
<Button style="margin-left: 10px" type="primary" @click="$refs['addSkuType'].type = 'add',$refs['addSkuType'].isShow = true">新建分类
</Button>
</div>
@ -74,7 +74,7 @@ export default {
},
async getSkuType(){
const res = await getList()
const res = await getList({page_size:9999,page:1})
this.list = res.data
},

@ -102,7 +102,6 @@
ref="timeSelect"
@refresh="getCustomer"
:is-show.sync="isShowTime"
:nurse-rule="nurseRule"
:skus="detail.product_type.product_skus"
:addresses="addresses"
:date="date"
@ -148,10 +147,6 @@ export default {
detail: '',
addresses:[],
pickType:1,
nurseRule:{
isReadOnly: false,
id:''
},
table:[
{
@ -202,7 +197,6 @@ export default {
this.detail = res.detail
if(this.detail.product?.service_rule === 2 && this.detail.schedule && this.detail.schedule.length > 0){
this.nurseRule = true
this.nurseId = this.detail.schedule[0]?.nurse_id
}
},

@ -1,6 +1,6 @@
<template>
<div>
<Modal :value.sync="isShow" title="排班" width="48" @on-visible-change="e => $emit('update:isShow',e)">
<Modal :value.sync="isShow" title="排班" width="68" @on-visible-change="e => $emit('update:isShow',e)">
<template v-slot:default>
<el-form ref="elForm" :model="form" :rules="rules" label-width="110px">
<el-form-item label="时间选择" prop="end_time">
@ -15,6 +15,7 @@
placeholder="开始时间"
@change="startTimePick">
</el-time-picker>
<span>~</span>
<el-time-picker
size="small"
value-format="HH:mm:ss"
@ -28,7 +29,6 @@
</el-form-item>
<el-form-item label="护工选择" prop="nurse_id">
<el-select v-model="form.nurse_id"
:disabled="nurseRule"
placeholder="请选择护工"
style="width: 300px;"
filterable remote
@ -91,11 +91,6 @@ export default {
customerId: [Number, String],
orderId: [Number, String],
productId: [Number, String],
nurseRule:{
//,
type:Boolean,
default:false
},
date: {
type: String,
default: ''
@ -159,20 +154,20 @@ export default {
width:43
},
{
prop:'sku.name',
prop:'name',
width: 100,
label:'姓名',
sortable:false
},
{
label:'服务时长(分)',
prop:'sku.time_lenth',
prop:'time_lenth',
width: 124,
sortable: false
},
{
label:'内容',
prop:'sku.service',
prop:'service',
minWidth:140,
sortable: false,
align:'left'
@ -274,6 +269,7 @@ export default {
watch: {
isShow(val) {
if (val) {
console.log(this.skus)
this.form.address_id = this.addresses.filter(item => {
return item.default === 1
})[0]?.id || ''

Loading…
Cancel
Save