master
271556543@qq.com 4 years ago
parent 5de5036c0b
commit 0912b2383d

@ -32,3 +32,11 @@ export function destroy(id,data){
data
})
}
export function scheduleList(params){
return request({
method:'get',
url:'/api/admin/collect-money/schedule-list',
params
})
}

@ -0,0 +1,9 @@
import request from "@/utils/request";
export function home(params){
return request({
method:'get',
url:'/api/admin/chart/home',
params
})
}

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

@ -1,6 +1,6 @@
import request from "@/utils/request";
export function getList(params,isLoading){
export function getList(params,isLoading=true){
return request({
method:'get',
url:'/api/admin/pay_unit/get-list',

@ -1,307 +1,307 @@
<template>
<div>
<div class="statistics">
<panel-group :totaldata="list" />
</div>
<div class="chart">
<div class="chartItem" style="margin-right: 1%;">
<div class="chartItemTitle">营业与收入</div>
<div id="col-chart"></div>
</div>
<div class="chartItem" style="margin-left: 1%;">
<div class="chartItemTitle">客户与订单</div>
<div id="line-chart"></div>
</div>
</div>
</div>
</template>
<script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import {
getChartsHome
} from "../../api/dashboard.js"
export default {
components: {
PanelGroup
},
data() {
return {
col: '',
line: '',
business_data: [],
collect_data: [],
list: {},
customerArr: [],
orderArr: [],
chartData: {},
}
},
watch: {
chartData(val, newval) {
<template>
<div>
<div class="statistics">
<panel-group :totaldata="list" />
</div>
<div class="chart">
<div class="chartItem" style="margin-right: 1%;">
<div class="chartItemTitle">营业与收入</div>
<div id="col-chart"></div>
</div>
<div class="chartItem" style="margin-left: 1%;">
<div class="chartItemTitle">客户与订单</div>
<div id="line-chart"></div>
</div>
</div>
</div>
</template>
<script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import {
getChartsHome
} from "../../api/dashboard.js"
export default {
components: {
PanelGroup
},
data() {
return {
col: '',
line: '',
business_data: [],
collect_data: [],
list: {},
customerArr: [],
orderArr: [],
chartData: {},
}
},
watch: {
chartData(val, newval) {
if (newval){
this.init();
}
}
},
methods: {
async loadData() {
await getChartsHome().then((res) => {
console.log(res);
this.list = res.list;
this.chartData = res;
let _business_data = [];
let _collect_data = [];
res.business_data.map(item => {
_business_data.push(item.server_money_total)
_collect_data.push(item.collect_money)
})
this.business_data = _business_data;
this.collect_data = _collect_data;
let _customerArr = [];
let _orderArr = [];
res.order_data.map(item => {
_customerArr.push(item.active_customer)
_orderArr.push(item.order_total)
})
this.customerArr = _customerArr;
this.orderArr = _orderArr;
}).catch()
},
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position: 'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [{
name: '服务金额',
type: 'bar',
data: this.business_data,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: this.collect_data,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
},
yAxis: {
type: 'value',
},
series: [{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: this.customerArr,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: this.orderArr,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
}
},
created() {
this.loadData();
},
mounted() {
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
margin-top: 20px;
&-title {
padding-left: 6px;
}
&-content {
text-align: center;
font-size: 13px;
&-top {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-bottom {
display: flex;
justify-content: space-between;
&-left {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-right {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
}
}
&>div {
flex: 1;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
.chart {
display: flex;
margin-top: 20px;
.chartItem {
width: 49%;
.chartItemTitle {
font-size: 16px;
margin-bottom: 20px;
}
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
margin-right: 20px;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
width: 100%;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
}
}
}
}
}
},
methods: {
async loadData() {
await getChartsHome().then((res) => {
console.log(res);
this.list = res.list;
this.chartData = res;
let _business_data = [];
let _collect_data = [];
res.business_data.map(item => {
_business_data.push(item.server_money_total)
_collect_data.push(item.collect_money)
})
this.business_data = _business_data;
this.collect_data = _collect_data;
let _customerArr = [];
let _orderArr = [];
res.order_data.map(item => {
_customerArr.push(item.active_customer)
_orderArr.push(item.order_total)
})
this.customerArr = _customerArr;
this.orderArr = _orderArr;
}).catch()
},
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position: 'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [{
name: '服务金额',
type: 'bar',
data: this.business_data,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: this.collect_data,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
},
yAxis: {
type: 'value',
},
series: [{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: this.customerArr,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: this.orderArr,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
}
},
created() {
this.loadData();
},
mounted() {
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
margin-top: 20px;
&-title {
padding-left: 6px;
}
&-content {
text-align: center;
font-size: 13px;
&-top {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-bottom {
display: flex;
justify-content: space-between;
&-left {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-right {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
}
}
&>div {
flex: 1;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
.chart {
display: flex;
margin-top: 20px;
.chartItem {
width: 49%;
.chartItemTitle {
font-size: 16px;
margin-bottom: 20px;
}
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
margin-right: 20px;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
width: 100%;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
}
}
}
</style>

@ -25,7 +25,7 @@
</template>
<script>
import {getList,destroy} from '@/api/collectMoney'
import {getList,destroy,scheduleList} from '@/api/collectMoney'
import {parseTime} from "@/utils"
import add from "./component/addcollectMoney"

@ -15,7 +15,11 @@
<xy-table
:total="total"
:list="list"
:table-item="table"></xy-table>
:table-item="table">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</template>
@ -36,7 +40,73 @@ export default {
total:0,
list:[],
table:[]
table:[
{
prop:'nurse.name',
label:'护工',
width:200
},
{
prop:'date',
label:'服务日期',
width: 200
},
{
label:'时间段',
width: 180,
customFn:(row) => {
return (
<div>{parseTime(new Date(row.start_time),'{h}:{i}')}~{parseTime(new Date(row.start_time),'{h}:{i}')}</div>
)
}
},
{
label:'订单编号',
prop:'no',
width: 240
},
{
prop:'customer.name',
label:'服务对象',
width: 200
},
{
label:'上门地址',
minWidth:300,
align:'left',
customFn:(row)=>{
return (
<div>
{
row.customer_address.filter(item => {
return item.default === 1
})[0]?.address || row.customer_address[0]?.address || '无'
}
</div>
)
}
},
{
label:'服务状态',
prop:'status',
width: 180,
formatter:(cell,data,value) => {
switch (value){
case 0:
return '已排班未服务'
break;
case 1:
return '已排班未服务'
break;
case 2:
return '已服务'
break;
default:
return value
}
}
}
]
}
},
methods: {

@ -42,6 +42,22 @@
</div>
</template>
<template v-slot:product_type_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.product_type_id"
placeholder="请选择业务板块"
style="width: 300px">
<el-option v-for="item in types" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -101,7 +117,7 @@
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>总计金额
</div>
<div class="xy-table-item-content">
<div class="xy-table-item-content xy-table-item-price">
<el-input v-model="form.total_money" clearable
placeholder="请输入总计金额" style="width: 300px;"/>
</div>
@ -119,7 +135,7 @@
v-load-more="productLoad"
placeholder="请选择结算对象"
style="width: 300px">
<el-option v-for="item in accounts" :key="item.id" :label="item.value" :value="item.id"></el-option>
<el-option v-for="item in accounts" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
@ -152,6 +168,10 @@ export default {
accounts:{
type:Array,
default:()=>[]
},
types:{
type:Array,
default:()=>[]
}
},
data() {
@ -209,6 +229,7 @@ export default {
form: {
customer_id: '',
product_id: '',
product_type_id:'',
date: '',
service_times: '',
unit_price: '',
@ -253,6 +274,7 @@ export default {
this.form = {
customer_id: '',
product_id: '',
product_type_id:'',
date: '',
service_times: '',
unit_price: '',

@ -47,7 +47,29 @@ export default {
total:0,
list:[],
table:[]
table:[
{
prop:'name',
label:'名称',
minWidth: 200,
align:'left'
},
{
prop:'area_detail.value',
label:'所属区域',
width: 140
},
{
prop:'product_type_id',
label: '业务板块',
width:160,
formatter:(cell,data,value) => {
return this.types.filter(item => {
return item.id === value
})[0]?.name || ''
}
}
]
}
},
methods: {

@ -8,7 +8,7 @@
<slot>
<div>
<Input v-model="select.keyword" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px" @click="select.page = 1,getOrder">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="select.page = 1,getOrder()">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addOrder'].type = 'add',$refs['addOrder'].isShow = true">创建订单</Button>
</div>
</slot>
@ -25,13 +25,14 @@
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getOrder()}"></xy-table>
<add-order ref="addOrder" :accounts="accounts" @refresh="getOrder"></add-order>
<add-order ref="addOrder" :accounts="accounts" :types="types" @refresh="getOrder"></add-order>
</div>
</template>
<script>
import {getList,destroy} from '@/api/order'
import {getparameter} from '@/api/system/dictionary'
import {getList as getUnit} from '@/api/payUnit'
import {getList as getTypes} from '@/api/productType'
import addOrder from "@/views/order/component/addOrder";
export default {
@ -47,6 +48,7 @@ export default {
},
accounts:[],
types:[],
total:0,
list:[
@ -127,9 +129,14 @@ export default {
}
},
methods: {
async getTypes(){
const res = await getTypes({page:1,page_size:9999},false)
this.types = res.data
},
async getAccounts(){
const res = await getparameter({number:'accounts'})
this.accounts = res.detail
const res = await getUnit({page:1,page_size:9999})
this.accounts = res.data
},
async getOrder(){
@ -152,6 +159,7 @@ export default {
}
},
mounted() {
this.getTypes()
this.getAccounts()
this.getOrder()
}

@ -34,7 +34,7 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="form.cycle" style="width: 300px;" placeholder="请选择周期">
<el-option v-for="(item,index) in ['年','月','周','次']" :key="index" :label="item" :value="item"></el-option>
<el-option v-for="(item,index) in [{label:'年',value:1,disable:true},{label:'月',value:2},{label:'周',value:3,disable:true},{label:'次',value:4,disable:true}]" :disabled="item.disable" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
</div>

@ -64,7 +64,7 @@
上门地址
</el-col>
<el-col :span="18">
<el-input style="width: 300px;" readonly :value="defaultAddress(detail.customer.customer_address)"></el-input>
<el-input style="width: 300px;" readonly :value="defaultAddress(addresses)"></el-input>
</el-col>
</el-row>
@ -79,36 +79,15 @@
<el-calendar>
<template v-slot:dateCell="{date, data}">
<div @click="datePick(date,data)" style="display:flex;flex-direction: column;justify-content: center;align-items: center;width: 100%;height: 100%">
<div style="display:flex;flex-direction: column;justify-content: center;align-items: center;width: 100%;height: 100%">
<div>{{timeFormat(date)}}</div>
<template v-if="data.type === 'current-month'">
<i class="el-icon-plus" style="padding:10px;"></i>
</template>
<template v-if="scheduleCount(data.day)">
<Poptip transfer trigger="hover" title="当日排班" width="520" content="content" >
<template v-slot:default>
<div class="schedule-num">{{scheduleCount(data.day).length}}</div>
</template>
<template v-slot:content>
<xy-table :is-page="false" :height="220" :list="scheduleCount(data.day)" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" width="70">
<template v-slot:default="scope">
<Poptip
:transfer="true"
confirm
title="确认要删除吗?"
@on-ok="destroySchedule(scope.row)">
<Button size="small" type="primary" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
</template>
</Poptip>
<template v-if="scheduleCount(data.day)">
<div class="schedule-time" @click="datePick(date,data,2,scheduleCount(data.day)[0])">{{scheduleCount(data.day)[0].nurse_id}} {{timeFormat(scheduleCount(data.day)[0].start_time,'{h}:{m}')}}~{{timeFormat(scheduleCount(data.day)[0].end_time,'{h}:{m}')}}</div>
</template>
<template v-else>
<i class="el-icon-plus" style="padding:10px;" @click="datePick(date,data,1)"></i>
</template>
</template>
</div>
</template>
@ -121,9 +100,11 @@
</xy-dialog>
<timeSelect
ref="timeSelect"
@refresh="getCustomer"
:is-show.sync="isShowTime"
:nurses="nurses"
:skus="skus"
:skus="detail.product_type.product_skus"
:date="date"
:order-id="detail.id"
:product-id="detail.product.id"
@ -133,7 +114,7 @@
<script>
import {parseTime} from '@/utils'
import {customerDetail,scheduleDelete} from '@/api/schedule'
import {customerDetail} from '@/api/schedule'
import timeSelect from "@/views/schedule/component/timeSelect";
export default {
@ -157,10 +138,6 @@ export default {
type: Array,
default: () => []
},
skus:{
type: Array,
default: () => []
},
},
data() {
return {
@ -169,10 +146,9 @@ export default {
isShowTime:false,
date:'',
id:'',
detail: '',
schedules:[],
dateStartPick:'',
dateEndPick:'',
addresses:[],
pickType:1,
table:[
@ -197,29 +173,33 @@ export default {
},
methods: {
datePick(date,data){
datePick(date,data,type,schedule){
console.log(date,data)
if(data.type === 'current-month'){
this.date = data.day
this.isShowTime = true
if(type === 1){
this.date = data.day
this.isShowTime = true
}
if(type === 2){
this.$refs['timeSelect'].form.id = schedule.id
this.$refs['timeSelect'].form.nurse_id = schedule.nurse_id
this.$refs['timeSelect'].form.start_time = schedule.start_time
this.$refs['timeSelect'].form.end_time = schedule.end_time
this.$refs['timeSelect'].form.schedule_list_skus = schedule.sku.map(item => item.sku_info?.id)
this.isShowTime = true
}
}
},
async getCustomer() {
const res = await customerDetail({
product_id: this.detail.product.id,
id: this.detail.customer.id,
id: this.id
})
console.log(res)
this.schedules = res.detail.schedule
this.detail = res.detail
},
destroySchedule(row){
scheduleDelete({id:row.id}).then(res => {
this.$successMessage('destroy','排班')
this.getCustomer()
})
},
datePicked(data,date){
if(this.pickType === 1){
this.dateStartPick = data.day
@ -251,7 +231,7 @@ export default {
},
scheduleCount(){
return function (day){
let arr = this.schedules.filter(item => {
let arr = this.detail.schedule.filter(item => {
return day === item.date
})
if(arr.length > 0){
@ -298,4 +278,14 @@ export default {
background: $primaryColor;
border-radius: 100%;
}
.schedule-time{
color: #fff;
font-size: 13px;
border-radius: 18px;
background: $primaryColor;
filter: drop-shadow( 0 1px 3px #c93731);
padding: 4px 8px;
margin-top: 6px;
}
</style>

@ -6,16 +6,22 @@
<el-form-item label="时间选择" prop="end_time">
<div style="font-weight: 600">{{ date }}</div>
<el-time-picker
v-model="time"
arrow-control
end-placeholder="结束时间"
is-range
placeholder="选择时间范围"
range-separator="-"
start-placeholder="开始时间"
style="width: 300px;"
value-format="hh:mm:ss"
@change="timePick">
size="small"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="form.start_time"
:picker-options="{
selectableRange: '00:00:00 - 23:59:59'
}"
placeholder="开始时间">
</el-time-picker>
<el-time-picker
size="small"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="form.end_time"
:picker-options="{
selectableRange: '00:00:00 - 23:59:59'
}"
placeholder="结束时间">
</el-time-picker>
</el-form-item>
<el-form-item label="护工选择" prop="nurse_id">
@ -27,7 +33,7 @@
<el-form-item label="服务项目" prop="schedule_list_skus">
<el-checkbox-group v-model="form.schedule_list_skus">
<template v-for="(item) in skus">
<el-checkbox :label="item.id">{{ item.name }}</el-checkbox>
<el-checkbox :label="item.sku.id">{{ item.sku.name }}</el-checkbox>
</template>
</el-checkbox-group>
</el-form-item>
@ -35,7 +41,14 @@
</template>
<template v-slot:footer>
<Button @click="$emit('update:isShow',false)"></Button>
<Poptip
:transfer="true"
confirm
title="确认要删除吗"
@on-ok="destroySchedule">
<Button type="primary" ghost>删除</Button>
</Poptip>
<Button @click="$emit('update:isShow',false)" style="margin-left: 8px">取消</Button>
<Button type="primary" @click="submit"></Button>
</template>
</Modal>
@ -44,7 +57,7 @@
<script>
import {parseTime} from '@/utils'
import {scheduleSave} from '@/api/schedule'
import {scheduleDelete, scheduleSave} from '@/api/schedule'
export default {
props: {
@ -71,15 +84,16 @@ export default {
data() {
return {
form: {
id:'',
customer_id: '',
product_id: '',
order_id: '',
nurse_id: '',
start_time:'',
start_time: '',
end_time: '',
schedule_list_skus: []
},
time: [new Date(),new Date()],
time: [new Date(), new Date()],
rules: {
nurse_id: [
{required: true, message: '请选择护工'}
@ -97,10 +111,6 @@ export default {
}
},
methods: {
timePick(e) {
this.form.start_time = `${this.date} ${e[0]}`
this.form.end_time = `${this.date} ${e[1]}`
},
submit() {
this.form.customer_id = this.customerId
this.form.product_id = this.productId
@ -115,19 +125,25 @@ export default {
scheduleSave(this.form).then(res => {
this.$successMessage('add', '排班')
this.$emit('update:isShow', false)
this.$emit('refresh')
}).catch(err => {
this.$emit('update:isShow', false)
})
}
})
}
},
destroySchedule(){
scheduleDelete({id:this.form.id}).then(res => {
this.$successMessage('destroy','排班')
this.isShow = false
this.$emit('refresh')
})
},
},
watch: {
isShow(val) {
if(val){
this.form.start_time = `${this.date} ${parseTime(new Date(),'{h}:{i}:{s}')}`
this.form.end_time = `${this.date} ${parseTime(new Date(),'{h}:{i}:{s}')}`
}else{
if (val) {
} else {
this.$refs['elForm'].resetFields()
}
}

@ -69,8 +69,7 @@
:customers="customers"
:nurses="nurses"
:levels="levels"
:orders="orders"
:skus="skus"></add-schedule>
:orders="orders"></add-schedule>
</div>
</template>
@ -79,7 +78,6 @@ import {customerList} from '@/api/schedule'
import {getList as productIndex} from '@/api/product'
import {getList as nurseIndex} from '@/api/worker'
import {getparameter} from '@/api/system/dictionary'
import {getList as skuIndex} from '@/api/sku'
import {getList as typeIndex} from '@/api/productType'
import addSchedule from "@/views/schedule/component/addSchedule";
@ -108,7 +106,6 @@ export default {
nurses:[],
levels:[],
orders:[],
skus:[],
accounts:[],
types:[],
areas:[],
@ -181,11 +178,6 @@ export default {
this.types = res.data
},
async getSkus(){
const res = await skuIndex({page_size:9999,page:1})
this.skus = res.data
},
async getProducts(){
const res = await productIndex({page_size:9999,page:1},false)
this.products = res.data
@ -220,7 +212,8 @@ export default {
},
schedule(row){
this.$refs['addSchedule'].detail = row
this.$refs['addSchedule'].id = row.id
this.$refs['addSchedule'].addresses = row.customer.customer_address
this.$refs['addSchedule'].isShow = true
}
},
@ -230,7 +223,6 @@ export default {
this.getNurses()
this.getLevels()
this.getCustomerList()
this.getSkus()
this.getAreas()
}
}

@ -0,0 +1,102 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增注意' : '编辑注意'"
:form="form"
:rules="rules"
@submit="submit">
<template v-slot:title>
<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-input v-model="form.title" clearable placeholder="请输入标题" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:content>
<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-input type="textarea" :autosize="{minRows:2}" v-model="form.content" clearable placeholder="请输入内容" style="width: 300px;" />
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {save,getForm} from '@/api/notice'
export default {
data() {
return {
isShow:false,
id:'',
type:'',
form:{
title:'',
content:''
},
rules:{
title:[
{required:true,message:'请填写标题'}
],
content:[
{required:true,message:'请填写内容'}
]
}
}
},
methods: {
async getDetail(){
const res = await getForm(this.id)
this.$integrateData(this.form,res)
},
submit(){
if(this.type === 'editor'){
Object.defineProperty(this.form,'id',{
value:this.id,
enumerable:true,
configurable:true,
writable:true
})
}
save(this.form).then(res => {
this.$successMessage(this.type,'')
this.isShow = false
this.$emit('refresh')
})
}
},
watch:{
isShow(val){
if(val){
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
delete this.form.id
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner{
text-align: left;
}
</style>

@ -0,0 +1,100 @@
<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>
<Input v-model="select.keyword" 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="$refs['addnotice'].type = 'add',$refs['addnotice'].isShow = true">新建</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:total="total"
:list="list"
:table-item="table"
@editor="editor"
@delete="destroy"></xy-table>
<add ref="addnotice" @refresh="getList" />
</div>
</template>
<script>
import {getList,destroy} from '@/api/notice'
import {parseTime} from "@/utils"
import add from "./component/addnotice"
export default {
components:{
add
},
data() {
return {
select:{
page:1,
page_size:10,
keyword:''
},
types:[],
total:0,
list:[],
table:[
{
prop:'title',
label:'标题',
minWidth:200,
align:'left'
},
{
prop:'content',
label:'内容',
minWidth: 300,
align:'left'
},
{
prop:'created_at',
label:'创建信息',
width: 200,
formatter:(cell,data,value)=>{
return parseTime(value,'{y}-{m}-{d}')
}
}
]
}
},
methods: {
async getList(){
const res = await getList(this.select)
this.total = res.total
this.list = res.data
console.log(this.list)
},
editor(row){
this.$refs['addnotice'].type = 'editor'
this.$refs['addnotice'].id = row.id
this.$refs['addnotice'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','通知')
this.getList()
})
}
},
mounted() {
this.getList()
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save