master
xy 3 years ago
parent 5b1789c93d
commit ccd65788c0

@ -23,3 +23,11 @@ export function effct(params){
params params
}) })
} }
export function checkAge(params){
return request({
method:'get',
url:'/api/admin/chart/check-age',
params
})
}

@ -6,7 +6,7 @@ export default {
default:'medium' default:'medium'
}, },
height: { height: {
type: Number type: [Number,String]
}, },
list: { list: {
type: Array, type: Array,

@ -694,6 +694,7 @@ export default {
this.$successMessage(this.type, '客户') this.$successMessage(this.type, '客户')
this.$emit('refresh') this.$emit('refresh')
this.isShow = false this.isShow = false
this.$router.push(`/schedule/schedule?product_type_id=${this.form1.product_type_id}`)
}) })
}else{ }else{
this.$emit('refresh') this.$emit('refresh')

@ -15,9 +15,10 @@
<el-select <el-select
placeholder="关联板块" placeholder="关联板块"
multiple multiple
collapse-tags
v-model="select.product_type_id" v-model="select.product_type_id"
size="small" size="small"
style="width: 300px; margin-right: 10px" style="min-width: 200px; margin-right: 10px"
> >
<el-option <el-option
v-for="(item, index) in types" v-for="(item, index) in types"
@ -282,10 +283,10 @@ export default {
width: "180", width: "180",
customFn: (row) => { customFn: (row) => {
let getColor = () => { let getColor = () => {
if (getAgeByIdcard(row.idcard) >= row.max_age) { if (row.near_age == 2) {
return "orange"; return "rgb(232,102,33)";
} }
if (row.near_age) { if (row.near_age == 1) {
return "yellow"; return "yellow";
} }
}; };

@ -0,0 +1,103 @@
<template>
<div>
<el-drawer
size="42%"
title="超龄人员"
:visible="isShow"
direction="rtl"
@close="$emit('update:isShow', false)"
>
<div>
<xy-table
height="80%"
style="margin: auto 6px"
:is-page="false"
:list="list"
:table-item="table"
>
<template v-slot:btns>
<el-table-column label="操作" min-width="80">
<template v-slot:default="scope">
<el-button
size="small"
type="primary"
@click="signOut(scope.row)"
>签退</el-button
>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</el-drawer>
</div>
</template>
<script>
import { checkAge } from "@/api/chart";
import { save as customerSave } from "@/api/customer/index";
import { deepCopy } from "@/utils";
export default {
props: {
isShow: {
type: Boolean,
default: false,
},
},
data() {
return {
total: 0,
list: [],
table: [
{
prop: "name",
label: "姓名",
width: 120,
},
{
label: "年龄",
prop: "age",
width: 80,
},
{
label: "身份证",
width: 166,
prop: "idcard",
},
{
prop: "phone",
label: "手机号",
width: "160",
},
],
};
},
methods: {
signOut(row) {
let data = deepCopy(row);
data.status = 3;
customerSave(data).then(res => {
this.$message({
type:'success',
message:'签退成功'
})
this.getList()
})
},
async getList() {
const res = await checkAge();
this.list = res;
if(this.list.length > 0){
this.$emit('update:isShow',true)
}
},
},
computed: {},
created() {
this.getList();
},
};
</script>
<style scoped lang="scss"></style>

@ -3,6 +3,7 @@
<div class="block" style="padding-top: 10px;display: flex; <div class="block" style="padding-top: 10px;display: flex;
justify-content: flex-end;"> justify-content: flex-end;">
<el-button type="primary" round style="margin-right: 10px" @click="isShowDraw = true">超龄查看</el-button>
<el-date-picker v-model="month" type="month" placeholder="选择月" @change="loadData()"> <el-date-picker v-model="month" type="month" placeholder="选择月" @change="loadData()">
</el-date-picker> </el-date-picker>
</div> </div>
@ -20,6 +21,8 @@
<div id="line-chart"></div> <div id="line-chart"></div>
</div> </div>
</div> </div>
<draw :isShow.sync="isShowDraw"></draw>
</div> </div>
</template> </template>
@ -29,18 +32,41 @@
import { import {
getChartsHome getChartsHome
} from "../../api/dashboard.js" } from "../../api/dashboard.js"
import draw from './components/draw.vue'
export default { export default {
components: { components: {
PanelGroup PanelGroup,
draw
}, },
data() { data() {
return { return {
isShowDraw:false,
col: '', col: '',
line: '', line: '',
business_data: [], business_data: [],
collect_data: [], collect_data: [],
list: {}, list: {
"business": {
"server_money_total": 0,
"nurse_money_total": 0,
"remain_money_total": 0
},
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
},
"order": {
"server_total": 0,
"cycle_total": 0,
"unit_total": 0
},
},
customerArr: [], customerArr: [],
orderArr: [], orderArr: [],
chartData: {}, chartData: {},
@ -186,13 +212,13 @@
}) })
} }
}, },
created() { created() {
this.month=this.$moment().format("YYYY-MM") this.month=this.$moment().format("YYYY-MM")
this.loadData(); this.loadData();
}, },
mounted() { mounted() {
//setInterval(()=>{ this.isShowDraw = !this.isShowDraw},3000)
//this.init() //this.init()
@ -313,4 +339,4 @@
} }
</style> </style>

@ -48,9 +48,9 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>打卡类型 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>打卡类型
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select v-model="form.type" clearable placeholder="请选择打卡类型 " style="width: 300px;"> <Select v-model="form.type" size="default" clearable placeholder="请选择打卡类型 " style="width: 300px;">
<el-option v-for="item in types" :key="item.id" :label="item.value" :value="item.id"></el-option> <Option v-for="item in types" :label="item.value" :value="item.id">{{item.value}}</Option>
</el-select> </Select>
</div> </div>
</div> </div>
@ -60,7 +60,7 @@
服务记录 服务记录
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<xy-table style="margin-top: 20px;" size="mini" :height="200" :is-page="false" :list="scheduleInfo().sku" :table-item="skuTable"> <xy-table style="margin-top: 20px;" size="mini" :height="200" :is-page="false" :list="selectedRow().sku" :table-item="skuTable">
<template v-slot:btns><</template> <template v-slot:btns><</template>
</xy-table> </xy-table>
</div> </div>
@ -128,7 +128,7 @@
default:()=>[{id:1,value:'签到'},{id:2,value:'过程打卡'},{id:3,value:'签退'}] default:()=>[{id:1,value:'签到'},{id:2,value:'过程打卡'},{id:3,value:'签退'}]
} }
}, },
inject:['scheduleInfo'], inject:['selectedRow'],
data() { data() {
return { return {
isShow: false, isShow: false,
@ -237,7 +237,7 @@
}) })
} }
if(this.form.type === 3){ if(this.form.type === 3){
let promiseAll = this.scheduleInfo().sku.map(item => { let promiseAll = this.selectedRow().sku.map(item => {
return saveSku({ return saveSku({
id:item.id, id:item.id,
schedule_list_id:item.schedule_list_id, schedule_list_id:item.schedule_list_id,
@ -256,7 +256,7 @@
watch: { watch: {
isShow(val) { isShow(val) {
if (val) { if (val) {
console.log(1111,this.scheduleInfo().sku) console.log(1111,this.selectedRow().sku)
this.form.schedule_list_id = this.scheduleListId this.form.schedule_list_id = this.scheduleListId
if (this.type === 'editor') { if (this.type === 'editor') {
this.getDetail() this.getDetail()

@ -48,7 +48,7 @@
type="primary" type="primary"
size="small" size="small"
style="margin-left: 4px" style="margin-left: 4px"
@click="editor(scope)" @click="editor(scope.row)"
>编辑</Button >编辑</Button
> >
@ -73,6 +73,17 @@
</xy-table> </xy-table>
</template> </template>
<template v-else> <template v-else>
<el-button
style="margin: 10px 0"
size="small"
round
type="primary"
@click="
($refs['addScheduleListLog'].type = 'add'),
($refs['addScheduleListLog'].isShow = true)
"
>录入服务记录</el-button
>
<el-timeline style="margin-left: 8px"> <el-timeline style="margin-left: 8px">
<el-timeline-item <el-timeline-item
v-for="item in list" v-for="item in list"
@ -80,6 +91,13 @@
:timestamp="item.created_at" :timestamp="item.created_at"
placement="top" placement="top"
> >
<Button
type="primary"
size="small"
style="margin-left: 4px;margin-bottom: 8px;"
@click="editor(item)"
>编辑</Button
>
<el-card> <el-card>
<h4>{{ typeFormat(item.type) }}</h4> <h4>{{ typeFormat(item.type) }}</h4>
<p>{{ item.address }}</p> <p>{{ item.address }}</p>
@ -100,7 +118,7 @@
</el-drawer> </el-drawer>
<detail ref="detail" @close="isShow = true"></detail> <detail ref="detail" @close="isShow = true"></detail>
<addScheduleListLog ref="addScheduleListLog"></addScheduleListLog> <addScheduleListLog ref="addScheduleListLog" @refresh="getList,()=>$emit('refresh')"></addScheduleListLog>
</div> </div>
</template> </template>
@ -215,8 +233,8 @@ export default {
}; };
}, },
methods: { methods: {
editor(scope) { editor(row) {
this.$refs["addScheduleListLog"].fileList = scope.row.upload_list.map( this.$refs["addScheduleListLog"].fileList = row.upload_list.map(
(item) => { (item) => {
return { return {
url: item.upload?.url, url: item.upload?.url,
@ -225,7 +243,7 @@ export default {
}; };
} }
); );
this.$refs["addScheduleListLog"].id = scope.row.id; this.$refs["addScheduleListLog"].id = row.id;
this.$refs["addScheduleListLog"].type = "editor"; this.$refs["addScheduleListLog"].type = "editor";
this.$refs["addScheduleListLog"].isShow = true; this.$refs["addScheduleListLog"].isShow = true;
}, },
@ -350,4 +368,7 @@ export default {
.pop-confirm { .pop-confirm {
z-index: 3000 !important; z-index: 3000 !important;
} }
.avue-dialog{
z-index:9999 !important;
}
</style> </style>

@ -139,6 +139,7 @@
</div> </div>
<xy-table <xy-table
:row-style="tableRowStyle"
:default-expand-all="false" :default-expand-all="false"
:list="list" :list="list"
:table-item="table" :table-item="table"
@ -187,7 +188,7 @@
</template> </template>
</xy-table> </xy-table>
<draw ref="draw" :type="2"></draw> <draw ref="draw" :type="2" @refresh="getList"></draw>
</div> </div>
</template> </template>
@ -281,8 +282,18 @@ export default {
width: 140, width: 140,
label:'实际服务时间', label:'实际服务时间',
customFn:row => { customFn:row => {
const getTime = () => {
if(row.sign_out && row.sign_in){
let seconds = this.$moment(row.sign_out).diff(row.sign_in,'seconds')
let point = seconds % 60
let min = parseInt(seconds / 60)
return `${min}分钟${point}`
}else{
return 0
}
}
return ( return (
<span>{ (row.sign_out && row.sign_in) ? this.$moment(row.sign_out).diff(row.sign_in,'minutes') : 0 }</span> <span>{ getTime() }</span>
) )
} }
}, },
@ -396,9 +407,34 @@ export default {
}; };
}, },
methods: { methods: {
tableRowStyle({row, rowIndex}){
let selectTime = row.sku.reduce((pre,cur) => {
return pre + Number(cur.time ?? 0)
},0)
let actTime = Math.round( this.$moment(row.sign_out).diff(row.sign_in,'seconds') / 60)
if(Math.abs(selectTime - actTime) <= 5){
return
}
if(Math.abs(selectTime - actTime) <= 10 && Math.abs(selectTime - actTime) > 5){
return {
'background':'rgb(255,227,150)'
}
}
if(Math.abs(selectTime - actTime) > 10){
return {
'background':'rgb(253,165,122)'
}
}
},
pickMonth(e){ pickMonth(e){
this.select.start_start_time = this.$moment(e).startOf('month').format('YYYY-MM-DD HH:mm:ss') if(e){
this.select.end_start_time = this.$moment(e).endOf('month').format('YYYY-MM-DD HH:mm:ss') this.select.start_start_time = this.$moment(e).startOf('month').format('YYYY-MM-DD HH:mm:ss')
this.select.end_start_time = this.$moment(e).endOf('month').format('YYYY-MM-DD HH:mm:ss')
}else{
this.select.start_start_time = ''
this.select.end_start_time = ''
}
}, },
destroy(row){ destroy(row){
@ -426,8 +462,8 @@ export default {
}, },
async getList() { async getList() {
const res = await scheduleList(this.select) const res = await scheduleList(this.select)
this.list = res.data this.list = res.list.data
this.total = res.total this.total = res.list.total
}, },
exports(){ exports(){
@ -501,4 +537,10 @@ export default {
} }
} }
} }
</style>
<style>
.has-time{
z-index:9998 !important;
}
</style> </style>

@ -1,16 +1,58 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :form="form" :is-show.sync="isShow" :rules="rules" :title="type === 'add' ? '新增产品' : '编辑产品'" <xy-dialog
:width="70" ref="dialog"
type="form" @submit="submit"> :form="form"
:is-show.sync="isShow"
:rules="rules"
:title="type === 'add' ? '新增产品' : '编辑产品'"
:width="70"
type="form"
@submit="submit"
>
<template v-slot:product_type_id> <template v-slot:product_type_id>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select v-model="form.product_type_id" placeholder="请选择业务板块" style="width: 300px"> <el-select
<el-option v-for="item in productType" :key="item.id" :label="item.name" :value="item.id"></el-option> v-model="form.product_type_id"
placeholder="请选择业务板块"
style="width: 300px"
>
<el-option
v-for="item in productType"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:area_id>
<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.area_id"
placeholder="请选择区域"
style="width: 300px"
>
<el-option
v-for="item in areas"
:key="item.id"
:label="item.value"
:value="item.id"
></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -19,10 +61,17 @@
<template v-slot:name> <template v-slot:name>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input v-model="form.name" clearable placeholder="请输入产品名称" style="width: 300px;"></el-input> <el-input
v-model="form.name"
clearable
placeholder="请输入产品名称"
style="width: 300px"
></el-input>
</div> </div>
</div> </div>
</template> </template>
@ -30,11 +79,27 @@
<template v-slot:cycle> <template v-slot:cycle>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select v-model="form.cycle" style="width: 300px;" placeholder="请选择周期"> <el-select
<el-option v-for="(item,index) in [{label:'年',value:1},{label:'月',value:2},{label:'周',value:3},{label:'次',value:4}]" :key="item.value" :label="item.label" :value="item.value"></el-option> v-model="form.cycle"
style="width: 300px"
placeholder="请选择周期"
>
<el-option
v-for="(item, index) in [
{ label: '年', value: 1 },
{ label: '月', value: 2 },
{ label: '周', value: 3 },
{ label: '次', value: 4 },
]"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -43,13 +108,17 @@
<template v-slot:service_rule> <template v-slot:service_rule>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-switch v-model="form.service_rule" <el-switch
active-text="总时长" v-model="form.service_rule"
inactive-text="单次限时" active-text="总时长"
style="width: 300px;"></el-switch> inactive-text="单次限时"
style="width: 300px"
></el-switch>
</div> </div>
</div> </div>
</template> </template>
@ -57,10 +126,17 @@
<template v-slot:total v-if="form.service_rule"> <template v-slot:total v-if="form.service_rule">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content xy-table-item-min"> <div class="xy-table-item-content xy-table-item-min">
<el-input v-model="form.total" clearable placeholder="请输入总计时长" style="width: 300px;"/> <el-input
v-model="form.total"
clearable
placeholder="请输入总计时长"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -68,10 +144,17 @@
<template v-slot:time_lenth v-else> <template v-slot:time_lenth v-else>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content xy-table-item-min"> <div class="xy-table-item-content xy-table-item-min">
<el-input v-model="form.time_lenth" clearable placeholder="请输入单次时长" style="width: 300px;"/> <el-input
v-model="form.time_lenth"
clearable
placeholder="请输入单次时长"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -79,11 +162,19 @@
<template v-slot:frequency> <template v-slot:frequency>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input-number v-model="form.frequency" :controls="false" :precision="0" clearable <el-input-number
placeholder="请输入周期内服务次数" style="width: 300px;"/> v-model="form.frequency"
:controls="false"
:precision="0"
clearable
placeholder="请输入周期内服务次数"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -91,11 +182,26 @@
<template v-slot:purchase_price> <template v-slot:purchase_price>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content" :class="form.service_rule ? 'xy-table-item-min_price' : 'xy-table-item-price'"> <div
<el-input-number v-model="form.purchase_price" :controls="false" :precision="2" clearable class="xy-table-item-content"
placeholder="请输入采购单价" style="width: 300px;"/> :class="
form.service_rule
? 'xy-table-item-min_price'
: 'xy-table-item-price'
"
>
<el-input-number
v-model="form.purchase_price"
:controls="false"
:precision="2"
clearable
placeholder="请输入采购单价"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -103,11 +209,26 @@
<template v-slot:nurse_price> <template v-slot:nurse_price>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content" :class="form.service_rule ? 'xy-table-item-min_price' : 'xy-table-item-price'"> <div
<el-input-number v-model="form.nurse_price" :controls="false" :precision="2" clearable placeholder="请输入护工单价" class="xy-table-item-content"
style="width: 300px;"/> :class="
form.service_rule
? 'xy-table-item-min_price'
: 'xy-table-item-price'
"
>
<el-input-number
v-model="form.nurse_price"
:controls="false"
:precision="2"
clearable
placeholder="请输入护工单价"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -115,11 +236,19 @@
<template v-slot:process_total> <template v-slot:process_total>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input-number v-model="form.process_total" :controls="false" :precision="0" clearable placeholder="请输入护工单价" <el-input-number
style="width: 300px;"/> v-model="form.process_total"
:controls="false"
:precision="0"
clearable
placeholder="请输入护工单价"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
@ -127,12 +256,25 @@
<template v-slot:type> <template v-slot:type>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <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>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select v-model="form.type" placeholder="请选择单次规定项目" style="width: 300px"> <el-select
<el-option v-for="item in [{id:1,value:''},{id:2,value:''}]" :key="item.id" :label="item.value" v-model="form.type"
:value="item.id"></el-option> placeholder="请选择单次规定项目"
style="width: 300px"
>
<el-option
v-for="item in [
{ id: 1, value: '自由组合' },
{ id: 2, value: '按订单组合' },
]"
:key="item.id"
:label="item.value"
:value="item.id"
></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -142,101 +284,91 @@
</template> </template>
<script> <script>
import {save, getForm} from '@/api/product' import { save, getForm } from "@/api/product";
export default { export default {
props: { props: {
productType: { productType: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
areas: {
type: Array,
default: () => [],
},
}, },
data() { data() {
return { return {
id: '', id: "",
isShow: false, isShow: false,
type: 'add', type: "add",
form: { form: {
product_type_id: '', product_type_id: "",
name: '', area_id: "",
cycle: '', name: "",
cycle: "",
frequency: 0, frequency: 0,
service_rule:false, service_rule: false,
purchase_price: '', purchase_price: "",
nurse_price: '', nurse_price: "",
time_lenth: '', time_lenth: "",
total:'', total: "",
process_total:'', process_total: "",
}, },
rules: { rules: {
product_type_id: [ product_type_id: [{ required: true, message: "请选择产品板块" }],
{required: true, message: '请选择产品板块'} area_id: [{ required: true, message: "请选择区域" }],
], name: [{ required: true, message: "请填写名称" }],
name: [ cycle: [{ required: true, message: "请填写周期" }],
{required: true, message: '请填写名称'} frequency: [{ required: true, message: "请填写服务次数" }],
], purchase_price: [{ required: true, message: "请填写采购单价" }],
cycle: [ nurse_price: [{ required: true, message: "请填写护工单价" }],
{required: true, message: '请填写周期'} time_lenth: [{ required: true, message: "请填写单词时长" }],
], type: [{ required: true, message: "请选择规定项目" }],
frequency: [ },
{required: true, message: '请填写服务次数'} };
],
purchase_price: [
{required: true, message: '请填写采购单价'}
],
nurse_price: [
{required: true, message: '请填写护工单价'}
],
time_lenth: [
{required: true, message: '请填写单词时长'}
],
type: [
{required: true, message: '请选择规定项目'}
],
}
}
}, },
methods: { methods: {
async getDetail() { async getDetail() {
const res = await getForm(this.id) const res = await getForm(this.id);
this.$integrateData(this.form, res) this.$integrateData(this.form, res);
this.form.service_rule = res.service_rule === 2 this.form.service_rule = res.service_rule === 2;
}, },
submit() { submit() {
this.form.service_rule = this.form.service_rule ? 2 : 1 this.form.service_rule = this.form.service_rule ? 2 : 1;
if (this.type === 'editor') { if (this.type === "editor") {
Object.defineProperty(this.form, 'id', { Object.defineProperty(this.form, "id", {
value: this.id, value: this.id,
writable: true, writable: true,
configurable: true, configurable: true,
enumerable: true enumerable: true,
}) });
} }
save(this.form).then(res => { save(this.form).then((res) => {
this.$successMessage(this.type, '产品') this.$successMessage(this.type, "产品");
this.$emit('refresh') this.$emit("refresh");
this.isShow = false this.isShow = false;
}) });
} },
}, },
watch: { watch: {
isShow(val) { isShow(val) {
if (val) { if (val) {
if (this.type === 'editor') { if (this.type === "editor") {
this.getDetail() this.getDetail();
} }
} else { } else {
this.id = '' this.id = "";
this.type = '' this.type = "";
this.$refs['dialog'].reset() this.$refs["dialog"].reset();
delete this.form.id delete this.form.id;
} }
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -247,24 +379,23 @@ export default {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
text-align: left !important; text-align: left !important;
} }
.xy-table-item-min{ .xy-table-item-min {
::v-deep .el-input__clear{ ::v-deep .el-input__clear {
position: relative; position: relative;
right: 46px; right: 46px;
z-index: 2; z-index: 2;
} }
} }
.xy-table-item-min_price {
.xy-table-item-min_price{
position: relative; position: relative;
&::after{ &::after {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
content:'(元/分钟)' content: "(元/分钟)";
} }
::v-deep .el-input__clear{ ::v-deep .el-input__clear {
position: relative; position: relative;
right: 46px; right: 46px;
z-index: 2; z-index: 2;

@ -26,7 +26,7 @@
@pageSizeChange="e => select.page_size = e" @pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getList()}"></xy-table> @pageIndexChange="e => {select.page = e;getList()}"></xy-table>
<add-product ref="addProduct" :product-type="productType" @refresh="getList"></add-product> <add-product ref="addProduct" :areas="areas" :product-type="productType" @refresh="getList"></add-product>
</div> </div>
</template> </template>
@ -34,6 +34,7 @@
import {getList,destroy} from '@/api/product' import {getList,destroy} from '@/api/product'
import {getparameter} from '@/api/system/dictionary' import {getparameter} from '@/api/system/dictionary'
import {getList as getTypes} from '@/api/productType' import {getList as getTypes} from '@/api/productType'
import { getAuthTypes,getAuthAreas } from "@/utils/auth"
import addProduct from "@/views/product/productComponent/addProduct"; import addProduct from "@/views/product/productComponent/addProduct";
@ -47,6 +48,7 @@ export default {
page:1, page:1,
page_size:10 page_size:10
}, },
areas:[],
productType: [], productType: [],
total:0, total:0,
@ -154,9 +156,11 @@ export default {
this.total = res.total this.total = res.total
console.log(this.list) console.log(this.list)
}, },
getAreas(){
this.areas = getAuthAreas(this)
},
async getProductType() { async getProductType() {
const res = await getTypes({page_size: 999},false) this.productType = getAuthTypes(this)
this.productType = res.data
}, },
editor(row){ editor(row){
@ -174,6 +178,7 @@ export default {
mounted() { mounted() {
this.getList() this.getList()
this.getProductType() this.getProductType()
this.getAreas()
} }
} }
</script> </script>

@ -230,6 +230,13 @@ export default {
this.$refs['addSchedule'].isShow = true this.$refs['addSchedule'].isShow = true
} }
}, },
beforeRouteEnter(to,from,next){
next(vm => {
if(from.path === '/customer/customer'){
vm.select.product_type_id = typeof to.query.product_type_id === 'string' ? Number(to.query.product_type_id) : ''
}
})
},
mounted() { mounted() {
this.getTypes() this.getTypes()
this.getProducts() this.getProducts()

Loading…
Cancel
Save