Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
f4ffcf40
Commit
f4ffcf40
authored
Dec 14, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e1b00863
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1241 additions
and
584 deletions
+1241
-584
transfer-order.vue
src/components/school/student/transfer-order.vue
+276
-146
courselist.vue
src/components/school/student/transfer-order/courselist.vue
+57
-438
order-form.vue
src/components/school/student/transfer-order/order-form.vue
+908
-0
No files found.
src/components/school/student/transfer-order.vue
View file @
f4ffcf40
...
@@ -14,93 +14,115 @@ div<template>
...
@@ -14,93 +14,115 @@ div<template>
<q-space
/>
<q-space
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
<q-btn
icon=
"close"
flat
round
dense
v-close-popup
/>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height:
7
0vh"
>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height:
8
0vh"
>
<q-stepper
v-model=
"step"
ref=
"stepper"
color=
"primary"
animated
flat
>
<q-stepper
v-model=
"step"
ref=
"stepper"
color=
"primary"
animated
flat
>
<q-step
:name=
"1"
title=
"选择班级"
icon=
"settings"
:done=
"step > 1"
>
<q-step
:name=
"1"
title=
"选择课程"
icon=
"settings"
:done=
"step > 1"
>
<div
class=
"row"
>
<div
class=
"page-search row items-center"
>
<q-select
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
v-model=
"OrderMsg.ClassId"
<div
class=
"col-3"
>
:options=
"ClassList"
<q-select
filled
@
input=
"resetSearch"
use-input
filled
label=
"选择班级"
option-value=
"SId"
option-label=
"ClassName"
option-label=
"SName"
option-value=
"ClassId"
v-model=
"courseMsg.School_Id"
ref=
"ClassName"
:options=
"schoolList"
class=
"col-6"
emit-value
emit-value
map-options
map-options
label=
"关联校区"
@
filter=
"filterClass"
clearable
>
/>
<template
v-slot:no-option
>
</div>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
</div>
</q-step>
<q-step
:name=
"2"
title=
"选择课程"
icon=
"settings"
:done=
"step > 2"
>
<div
class=
"row"
>
<q-select
v-model=
"OrderMsg.HelpEnterId"
:options=
"EmployeeList"
filled
use-input
label=
"选择课程"
option-label=
"EmployeeName"
option-value=
"Id"
ref=
"EmployeeName"
class=
"col-6 q-pb-lg"
emit-value
map-options
@
filter=
"classFilterClass"
>
<
template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
</div>
</q-step>
<q-step
:name=
"3"
title=
"选择"
:done=
"step > 3"
>
<q-table
:data=
"data.StuList"
:columns=
"columns"
flat
row-key=
"StuId"
>
<
template
v-slot:body-cell-IsRenewGuest=
"props"
>
<q-td
:props=
"props"
>
<span
v-if=
"props.row.IsRenewGuest === 0"
>
否
</span>
<span
v-if=
"props.row.IsRenewGuest === 1"
>
是
</span>
</q-td>
</
template
>
<
template
v-slot:bottom
>
</
template
>
</q-table>
</q-step>
<q-step
:name=
"4"
title=
"确认"
icon=
"settings"
:done=
"step > 4"
>
<div
class=
"col-3"
>
<div
class=
"row"
>
<q-input
<q-input
@
change=
"resetSearch"
filled
clearable
stack-label
filled
:dense=
"false"
v-model=
"courseMsg.ClassNo"
v-model=
"OrderMsg.GuestNum"
label=
"班号"
class=
"col-12"
@
clear=
"resetSearch"
label=
"人数"
maxlength=
"20"
disable
/>
/>
</div>
<div
class=
"col-6"
>
<q-input
@
change=
"resetSearch"
clearable
filled
v-model=
"courseMsg.ClassName"
label=
"班级名称"
@
clear=
"resetSearch"
maxlength=
"20"
/>
</div>
<div
class=
"col-6"
>
<q-select
@
input=
"resetSearch"
@
filter=
"filterCourseFn"
use-input
filled
option-value=
"CourseId"
option-label=
"CourseName"
v-model=
"courseMsg.CouseId"
:options=
"myClassList"
emit-value
map-options
label=
"学习课程"
clearable
/>
</div>
<div
class=
"col-6"
>
<div
class=
"col-3 Sysuser_Date"
>
<q-field
filled
>
<template
v-slot:control
>
<el-date-picker
v-model=
"courseMsg.StartTime"
type=
"date"
placeholder=
"开学日期"
size=
"small"
style=
"width:47%;"
@
change=
"resetSearch"
clear-icon=
"iconfont icon-guanbi"
>
</el-date-picker
>
至
<el-date-picker
v-model=
"courseMsg.EndTime"
type=
"date"
placeholder=
"结束日期"
size=
"small"
style=
"width:47%;"
@
change=
"resetSearch"
clear-icon=
"iconfont icon-guanbi"
>
</el-date-picker>
</
template
>
</q-field>
</div>
</div>
</div>
</div>
</div>
<Course
:dataList=
"courseData"
@
select=
"selectCourse"
></Course>
<q-pagination
class=
"full-width justify-end"
v-model=
"courseMsg.pageIndex"
color=
"primary"
:max=
"coursePageCount"
:input=
"true"
@
input=
"changePage"
/>
</q-step>
<q-step
:name=
"2"
title=
"确认"
icon=
"settings"
:done=
"step > 2"
>
<orderForm
:save-obj=
"saveObj"
:stuData=
"stuData"
:isChaBan=
"isChaBan"
></orderForm>
</q-step>
</q-step>
</q-stepper>
</q-stepper>
</q-card-section>
</q-card-section>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-card-actions
align=
"right"
class=
"bg-white
q-mx-md
"
>
<q-btn
<q-btn
label=
"取消"
label=
"取消"
flat
flat
...
@@ -112,15 +134,10 @@ div<template>
...
@@ -112,15 +134,10 @@ div<template>
@
click=
"$refs.stepper.previous()"
@
click=
"$refs.stepper.previous()"
color=
"primary"
color=
"primary"
label=
"上一步"
label=
"上一步"
v-if=
"step >1"
v-if=
"step > 1"
/>
<q-btn
@
click=
"$refs.stepper.next()"
color=
"primary"
label=
"下一步"
v-if=
"step <4"
/>
/>
<q-btn
label=
"保存"
color=
"primary"
@
click=
""
v-if=
"step == 4"
/>
<q-btn
@
click=
"next"
color=
"primary"
label=
"下一步"
v-if=
"step < 2"
/>
<!-- <q-btn label="保存" color="primary" @click="" v-if="step == 2" /> -->
</q-card-actions>
</q-card-actions>
</q-card>
</q-card>
</q-dialog>
</q-dialog>
...
@@ -128,13 +145,20 @@ div<template>
...
@@ -128,13 +145,20 @@ div<template>
<
script
>
<
script
>
import
{
import
{
getClassPruductList
,
//
getClassPruductList
,
//获取日语培训列表
setClassOrder
,
setClassOrder
,
//新增 修改订单
getOrderGuestRenewState
getOrderGuestRenewState
}
from
"../../../api/sale/sale"
;
}
from
"../../../api/sale/sale"
;
import
{
import
{
getClassDropDownList
,
//获取班级下拉列表
getSchoolDropdown
,
//获取校区列表
}
from
'../../../api/school/index'
getTeacherDropDownList
}
from
"../../../api/school/index"
;
import
{
queryCourseDropdownList
,
getCourseSubject
}
from
"../../../api/course/index"
;
import
Course
from
"./transfer-order/courselist"
;
import
orderForm
from
"./transfer-order/order-form"
;
export
default
{
export
default
{
props
:
{
props
:
{
select
:
{
select
:
{
...
@@ -142,31 +166,15 @@ export default {
...
@@ -142,31 +166,15 @@ export default {
default
:
()
=>
[]
default
:
()
=>
[]
}
}
},
},
components
:
{
Course
,
orderForm
},
data
()
{
data
()
{
return
{
return
{
persistent
:
true
,
persistent
:
true
,
step
:
1
,
step
:
1
,
data
:
{},
stuData
:
{},
//学生是否续费
columns
:
[
{
name
:
"StuName"
,
label
:
"名称"
,
field
:
"StuName"
,
align
:
"left"
},
{
name
:
"StuTel"
,
label
:
"电话"
,
align
:
"left"
,
field
:
"StuTel"
},
{
name
:
"IsRenewGuest"
,
label
:
"是否续费"
,
field
:
"IsRenewGuest"
,
align
:
"left"
}
],
OrderMsg
:
{
OrderMsg
:
{
ClassId
:
0
,
//班级编号
ClassId
:
0
,
//班级编号
GuestNum
:
0
,
//人数
GuestNum
:
0
,
//人数
...
@@ -198,52 +206,174 @@ export default {
...
@@ -198,52 +206,174 @@ export default {
DiscountMoney
:
0
,
//优惠金额
DiscountMoney
:
0
,
//优惠金额
PerDiscountMoney
:
0
//每人优惠金额
PerDiscountMoney
:
0
//每人优惠金额
},
},
ClassList
:[],
courseMsg
:
{
allClassList
:[],
pageIndex
:
1
,
pageSize
:
9
,
ClassName
:
""
,
//班级名称
StartTime
:
""
,
//开始时间
EndTime
:
""
,
//结束时间
School_Id
:
""
,
//关联校区
CouseId
:
0
,
//课程id
Teacher_Id
:
0
,
//教师id
Q_CanApply
:
"0"
,
//是否可以报名 1是
JoinStartTime
:
""
,
//报名截止日期开始
JoinEndTime
:
""
,
//报名截止日期结束
ClassNo
:
""
,
//班号
CourseSubject
:
""
//所属科目
},
courseData
:
[],
//课程列表
coursePageCount
:
0
,
//课程页数
saveObj
:
{},
//所选课程
isChaBan
:
0
,
//是否插班
//关联校区列表
schoolList
:
[],
ClassList
:
[],
//关联课程下拉数据
myClassList
:
[]
};
};
},
},
mounted
()
{
mounted
()
{
let
nowDay
=
new
Date
();
var
year
=
nowDay
.
getFullYear
();
//年
var
month
=
nowDay
.
getMonth
()
+
1
;
//月
var
day
=
nowDay
.
getDate
();
//日
var
currentDay
=
year
+
"-"
+
month
+
"-"
+
day
;
this
.
courseMsg
.
StartTime
=
currentDay
;
this
.
getOrderGuestRenewState
();
this
.
getOrderGuestRenewState
();
this
.
getClass
();
this
.
getCourseList
();
this
.
getSchool
();
this
.
CourseList
();
},
},
methods
:
{
methods
:
{
getOrderGuestRenewState
()
{
getOrderGuestRenewState
()
{
const
ids
=
this
.
select
.
map
(
e
=>
e
.
StuId
).
toString
();
const
ids
=
this
.
select
.
map
(
e
=>
e
.
StuId
).
toString
();
getOrderGuestRenewState
({
StuIds
:
ids
}).
then
(
res
=>
{
getOrderGuestRenewState
({
StuIds
:
ids
}).
then
(
res
=>
{
console
.
log
(
"res"
,
res
);
this
.
stuData
=
res
.
Data
;
this
.
data
=
res
.
Data
;
if
(
res
.
Data
.
RenewNum
==
0
)
{
this
.
isChaBan
=
0
;
}
else
{
this
.
isChaBan
=
1
;
}
});
});
},
},
//获取班级下拉
//获取课程分页列表
getClass
()
{
getCourseList
()
{
getClassDropDownList
({
getClassPruductList
(
this
.
courseMsg
).
then
(
res
=>
{
CourseId
:
0
,
this
.
courseData
=
res
.
Data
.
PageData
;
IsAddDefault
:
0
,
//添加默认选项
this
.
coursePageCount
=
res
.
Data
.
PageCount
;
}).
then
(
res
=>
{
this
.
courseData
.
forEach
(
x
=>
{
if
(
res
.
Code
==
1
)
{
if
(
x
.
ClassStyle
==
1
)
{
var
jsonData
=
res
.
Data
;
let
weekList
=
[
jsonData
.
unshift
({
//定义一个数组
ClassId
:
0
,
{
ClassName
:
"不限"
id
:
7
,
})
select
:
false
if
(
jsonData
&&
jsonData
.
length
>
0
)
{
},
this
.
ClassList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));
{
this
.
allClassList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));;
id
:
1
,
select
:
false
},
{
id
:
2
,
select
:
false
},
{
id
:
3
,
select
:
false
},
{
id
:
4
,
select
:
false
},
{
id
:
5
,
select
:
false
},
{
id
:
6
,
select
:
false
}
];
weekList
.
forEach
(
j
=>
{
x
.
ClassPlanList
.
forEach
(
z
=>
{
if
(
j
.
id
==
z
.
WeekDay
)
{
j
.
select
=
true
;
}
});
});
x
.
weeks
=
weekList
;
}
else
if
(
x
.
ClassStyle
==
2
)
{
let
data
=
[];
for
(
let
i
=
0
;
i
<
31
;
i
++
)
{
let
obj
=
{
name
:
i
+
1
,
select
:
false
};
x
.
ClassPlanList
.
forEach
(
j
=>
{
if
(
j
.
WeekDay
==
i
+
1
)
{
obj
.
select
=
true
;
}
});
data
.
push
(
obj
);
}
}
x
.
month
=
data
;
}
}
});
});
},
});
//筛选班级
},
filterClass
(
val
,
update
)
{
// 课程翻页
update
(()
=>
{
changePage
(
val
)
{
if
(
val
===
''
)
{
this
.
courseMsg
.
pageIndex
=
val
;
this
.
ClassList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
allClassList
))
this
.
getCourseList
();
}
else
{
},
const
needle
=
val
.
toLowerCase
()
// 选择课程
this
.
ClassList
=
this
.
allClassList
.
filter
(
v
=>
v
.
ClassName
.
toLowerCase
().
indexOf
(
needle
)
>
-
1
)
selectCourse
(
val
)
{
}
this
.
saveObj
=
val
[
0
];
})
this
.
saveObj
.
Unit_Price
=
this
.
saveObj
.
SellPrice
;
},
},
next
()
{
if
(
!
this
.
saveObj
.
ClassId
||
this
.
saveObj
.
ClassId
==
0
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
position
:
"top"
,
message
:
`请选择班级`
});
return
;
}
this
.
$refs
.
stepper
.
next
();
},
//获取校区列表
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
schoolList
=
res
.
Data
;
}
});
},
//获取课程
CourseList
()
{
queryCourseDropdownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
ClassList
=
res
.
Data
;
this
.
ClassList
.
unshift
({
CourseId
:
0
,
CourseName
:
"不限"
});
this
.
myClassList
=
this
.
ClassList
;
}
});
},
//课程筛选
filterCourseFn
(
val
,
update
,
abort
)
{
update
(()
=>
{
this
.
myClassList
=
this
.
ClassList
.
filter
(
v
=>
v
.
CourseName
.
indexOf
(
val
)
>
-
1
);
});
},
resetSearch
()
{
this
.
courseMsg
.
pageIndex
=
1
;
this
.
getCourseList
();
}
}
}
};
};
</
script
>
</
script
>
...
...
src/components/school/student/transfer-order/courselist.vue
View file @
f4ffcf40
<
template
>
<
template
>
<div
class=
"page-body japaneseTrain"
>
<div
class=
"orderCourse"
>
<div
class=
"page-content"
>
<q-table
<div>
:pagination=
"msg"
<span
selection=
"single"
style=
"font-size: 20px;font-weight: bold;font-family:'perfectFont' "
:selected
.
sync=
"selection"
></span
no-data-label=
"暂无相关数据"
>
flat
</div>
class=
"sticky-tow-column-table "
<q-table
separator=
"none"
:pagination=
"msg"
:data=
"dataList"
:loading=
"loading"
:columns=
"columns"
no-data-label=
"暂无相关数据"
row-key=
"ClassId"
flat
title=
"日语培训产品列表"
class=
"sticky-column-table"
@
update:selected =
"emitSel"
separator=
"none"
>
:data=
"dataList"
<!--
<template
v-slot:body-cell-ClassName=
"props"
>
:columns=
"columns"
row-key=
"name"
title=
"日语培训产品列表"
>
<template
v-slot:body-cell-ClassName=
"props"
>
<q-td
:props=
"props"
style=
"padding-right: 0px"
>
<q-td
:props=
"props"
style=
"padding-right: 0px"
>
{{
props
.
row
.
ClassName
}}
【
{{
props
.
row
.
ClassNo
}}
】
{{
props
.
row
.
ClassName
}}
【
{{
props
.
row
.
ClassNo
}}
】
</q-td>
</q-td>
</
template
>
</
template
>
-->
<
template
v-slot:bottom
>
<
template
v-slot:bottom
>
</
template
>
<q-pagination
</q-table>
class=
"full-width justify-end"
v-model=
"msg.pageIndex"
color=
"primary"
:max=
"pageCount"
:input=
"true"
@
input=
"changePage"
/>
</
template
>
</q-table>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
getClassPruductList
,
//获取日语培训列表
setClassOrder
//新增 修改订单
}
from
"../../api/sale/sale"
;
import
{
getSchoolDropdown
,
//获取校区列表
getTeacherDropDownList
}
from
"../../api/school/index"
;
import
{
queryCourseDropdownList
,
getCourseSubject
}
from
"../../api/course/index"
;
import
editorderForm
from
"../../components/sale/editorder-form"
;
//修改订单
export
default
{
export
default
{
meta
:
{
props
:
{
title
:
"日语培训"
dataList
:
{
}
,
type
:
Array
,
components
:
{
default
:
()
=>
[]
editorderForm
}
},
},
data
()
{
data
()
{
return
{
return
{
dialog
:
false
,
selection
:
[],
data
:
[],
loading
:
false
,
dateList
:
[],
//开学时间
msg
:
{
msg
:
{
pageIndex
:
1
,
pageIndex
:
1
,
pageSize
:
10
,
rowsPerPage
:
0
ClassName
:
""
,
//班级名称
StartTime
:
""
,
//开始时间
EndTime
:
""
,
//结束时间
School_Id
:
""
,
//关联校区
CouseId
:
0
,
//课程id
Teacher_Id
:
0
,
//教师id
Q_CanApply
:
"0"
,
//是否可以报名 1是
JoinStartTime
:
""
,
//报名截止日期开始
JoinEndTime
:
""
,
//报名截止日期结束
ClassNo
:
""
,
//班号
CourseSubject
:
""
//所属科目
},
//关联校区列表
schoolList
:
[],
pageCount
:
0
,
ClassList
:
[],
//关联课程下拉数据
TeacherList
:
[],
//关联教师下拉数据
elvalue
:
new
Date
(),
isShowEditOrderForm
:
false
,
//是否显示订单弹窗
//订单对象
orderObj
:
{
ClassId
:
0
,
Unit_Price
:
0
,
CourseId
:
0
},
},
isChaBan
:
0
,
//是否插班(0-正常报入,1-插班报入)
columns
:
[
CourseSubjectList
:
[],
//科目列表
{
myClassList
:
[]
name
:
"ClassName"
,
label
:
"班级"
,
align
:
"left"
,
field
:
"ClassName"
},
{
name
:
"CourseName"
,
label
:
"课程"
,
field
:
"CourseName"
,
align
:
"left"
},
{
name
:
"TeacherName"
,
label
:
"老师"
,
field
:
"TeacherName"
,
align
:
"left"
},
{
name
:
"OpenTime"
,
label
:
"上课时间"
,
field
:
"OpenTime"
,
align
:
"left"
}
]
};
};
},
},
created
()
{
this
.
getSchool
();
this
.
queryCourseSubject
();
this
.
CourseList
();
this
.
GetTeacherList
();
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
ClassName
)
{
this
.
msg
.
ClassName
=
decodeURI
(
this
.
$route
.
query
.
ClassName
);
}
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
ClassNo
)
{
this
.
msg
.
ClassNo
=
this
.
$route
.
query
.
ClassNo
;
}
let
nowDay
=
new
Date
();
var
year
=
nowDay
.
getFullYear
();
//年
var
month
=
nowDay
.
getMonth
()
+
1
;
//月
var
day
=
nowDay
.
getDate
();
//日
var
currentDay
=
year
+
"-"
+
month
+
"-"
+
day
;
this
.
msg
.
StartTime
=
currentDay
;
},
mounted
()
{
this
.
getList
();
},
methods
:
{
methods
:
{
//课程筛选
emitSel
(
val
){
filterCourseFn
(
val
,
update
,
abort
)
{
this
.
$emit
(
"select"
,
val
)
update
(()
=>
{
this
.
myClassList
=
this
.
ClassList
.
filter
(
v
=>
v
.
CourseName
.
indexOf
(
val
)
>
-
1
);
});
},
queryCourseSubject
()
{
getCourseSubject
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
CourseSubjectList
=
res
.
Data
;
}
});
},
//关闭订单修改
closeOrderSaveForm
()
{
this
.
isShowEditOrderForm
=
false
;
},
refreshOrder
()
{
this
.
getList
();
},
//跳转到班级订单
goclassorder
(
item
)
{
var
tempStr
=
"/course/classorder?ClassId="
+
item
.
ClassId
;
this
.
$router
.
push
({
path
:
tempStr
});
},
//获取校区列表
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
var
tempArray
=
res
.
Data
;
if
(
!
tempArray
)
{
tempArray
=
[];
}
this
.
schoolList
=
tempArray
;
}
});
},
//判断是否过期
getEXPDate
(
time
)
{
var
str
=
time
.
replace
(
/年/g
,
"/"
)
.
replace
(
/月/g
,
"/"
)
.
replace
(
/日/g
,
""
);
var
date
=
new
Date
(
str
).
getTime
();
var
now
=
new
Date
().
getTime
()
+
86400
;
if
(
date
<
now
)
{
return
true
;
//过期
}
else
{
return
false
;
//没过期
}
}
},
//获取课程
CourseList
()
{
queryCourseDropdownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
ClassList
=
res
.
Data
;
this
.
ClassList
.
unshift
({
CourseId
:
0
,
CourseName
:
"不限"
});
this
.
myClassList
=
this
.
ClassList
;
}
});
},
//获取教师下拉
GetTeacherList
()
{
getTeacherDropDownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
TeacherList
=
res
.
Data
;
this
.
TeacherList
.
unshift
({
TId
:
0
,
TeacherName
:
"不限"
});
}
});
},
//翻页
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getList
();
},
resetSearch
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
getList
();
},
//获取菜单分页列表
getList
()
{
this
.
loading
=
true
;
getClassPruductList
(
this
.
msg
)
.
then
(
res
=>
{
this
.
loading
=
false
;
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
this
.
data
.
forEach
(
x
=>
{
if
(
x
.
ClassStyle
==
1
)
{
let
weekList
=
[
//定义一个数组
{
id
:
7
,
select
:
false
},
{
id
:
1
,
select
:
false
},
{
id
:
2
,
select
:
false
},
{
id
:
3
,
select
:
false
},
{
id
:
4
,
select
:
false
},
{
id
:
5
,
select
:
false
},
{
id
:
6
,
select
:
false
}
];
weekList
.
forEach
(
j
=>
{
x
.
ClassPlanList
.
forEach
(
z
=>
{
if
(
j
.
id
==
z
.
WeekDay
)
{
j
.
select
=
true
;
}
});
});
x
.
weeks
=
weekList
;
}
else
if
(
x
.
ClassStyle
==
2
)
{
let
data
=
[];
for
(
let
i
=
0
;
i
<
31
;
i
++
)
{
let
obj
=
{
name
:
i
+
1
,
select
:
false
};
x
.
ClassPlanList
.
forEach
(
j
=>
{
if
(
j
.
WeekDay
==
i
+
1
)
{
obj
.
select
=
true
;
}
});
data
.
push
(
obj
);
}
x
.
month
=
data
;
}
});
})
.
catch
(()
=>
{
this
.
loading
=
false
;
});
},
//立即报名和插班报名
placeAnorder
(
item
,
type
)
{
if
(
item
.
Teacher_Id
==
0
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
position
:
"top"
,
message
:
`请联系班级管理员,关联班级老师后报名`
});
return
;
}
this
.
isChaBan
=
type
;
this
.
orderObj
.
ClassId
=
item
.
ClassId
;
this
.
orderObj
.
Unit_Price
=
item
.
SellPrice
;
this
.
orderObj
.
CourseId
=
item
.
CouseId
;
this
.
orderObj
.
B2CRatio
=
item
.
B2CRatio
;
this
.
orderObj
.
B2CReNewRatio
=
item
.
B2CReNewRatio
;
this
.
isShowEditOrderForm
=
true
;
},
//跳转到课程大纲
goChapter
(
CouseId
)
{
this
.
OpenNewUrl
(
"/course/chapter"
,
{
CourseId
:
CouseId
});
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
li
{
.orderCourse
.q-table__bottom
{
list-style-type
:
none
;
min-height
:
0
;
}
.japaneseTrain
ul
{
padding
:
0px
;
}
.japaneseTrain
li
{
background
:
rgba
(
221
,
222
,
224
,
0.2
);
border-radius
:
4px
;
margin-top
:
15px
;
}
.japaneseTrain
li
.dline
{
display
:
table
;
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
}
.japaneseTrain
li
.d1
,
.japaneseTrain
li
.d2
,
.japaneseTrain
li
.d3
,
.japaneseTrain
li
.d4
,
.japaneseTrain
li
.d5
{
width
:
18%
;
padding
:
20px
20px
10px
;
}
.japaneseTrain
li
.d7
{
flex
:
1
;
width
:
1px
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
.japaneseTrain
li
.d1
.di-title
{
font-size
:
16px
;
color
:
#111111
;
}
.japaneseTrain
li
.d1
.di-c
{
font-size
:
14px
;
display
:
flex
;
align-items
:
center
;
line-height
:
28px
;
color
:
#111111
;
}
.japaneseTrain
li
.d6
{
padding
:
10px
20px
;
width
:
100%
;
height
:
inherit
;
position
:
relative
;
border-top
:
1px
solid
#dddee0
;
}
.japaneseTrain
li
.d6
.progress
{
width
:
100%
;
height
:
5px
;
position
:
absolute
;
left
:
0
;
bottom
:
0
;
}
.japaneseTrain
li
.d2
>
div
{
margin
:
10px
0
;
font-size
:
14px
;
color
:
#111111
;
}
.japaneseTrain
li
.d2-n
{
font-size
:
12px
;
color
:
#999999
;
margin-right
:
20px
;
}
.japaneseTrain
li
.d3
.d3-s
{
color
:
var
(
--q-color-negative
);
font-weight
:
bold
;
}
.japaneseTrain
li
.d3
div
{
margin
:
10px
0
;
font-size
:
14px
;
}
.japaneseTrain
li
.d4
div
{
font-size
:
14px
;
color
:
#111111
;
margin
:
10px
0
;
}
.japaneseTrain
li
.d5
div
{
font-size
:
14px
;
color
:
#111111
;
margin
:
10px
0
;
}
.japaneseTrain
.price-popup
{
border-radius
:
4px
;
}
.japaneseTrain
.el-range-editor
.el-range-input
{
background
:
none
;
}
.japaneseTrain
.el-range-editor.el-input__inner
{
background-color
:
transparent
;
}
.japaneseTrain
.q-mb-md
{
margin-bottom
:
0
;
}
.japaneseTrain
.month-item
{
display
:
inline-block
;
width
:
45.5px
;
height
:
45.4px
;
line-height
:
45.4px
;
text-align
:
center
;
font-size
:
12px
;
color
:
#2d2d2d
;
}
.price-popup
.el-calendar-table
.el-calendar-day
{
height
:
60px
;
}
.japaneseTrain
.el-input__inner
{
border
:
none
!important
;
background
:
transparent
!important
;
}
.japanFeature
{
font-size
:
14px
;
color
:
#111111
;
cursor
:
pointer
;
margin-left
:
-1px
;
}
.CourseFearure
{
margin
:
10px
;
width
:
500px
;
color
:
#000
;
}
}
</
style
>
</
style
>
src/components/school/student/transfer-order/order-form.vue
0 → 100644
View file @
f4ffcf40
<
style
>
.editOrderDrawerTop
{
width
:
100%
;
height
:
50px
;
display
:
flex
;
justify-content
:
space-between
;
background-color
:
#f0f5fb
;
padding
:
5px
10px
;
align-items
:
center
;
}
</
style
>
<!--订单操作-->
<
template
>
<div>
<!--
<div
class=
"editOrderDrawerTop"
>
<div
style=
"display:flex;align-items:center;margin-left:10px;"
>
<span
class=
"drawer_Span"
>
{{
OrderMsg
.
OrderId
>
0
?
"修改订单"
:
"立即下单"
}}
</span>
</div>
</div>
-->
<div
class=
"row"
>
<div
v-for=
"(item, index) in stuData.StuList"
>
<q-chip
icon=
"person"
class=
"primary"
>
{{
item
.
StuName
}}
<span
v-if=
"item.IsRenewGuest == 1"
>
(续费)
</span>
</q-chip>
</div>
</div>
<div
style=
"row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<q-input
filled
stack-label
maxlength=
"3"
:dense=
"false"
@
keyup
.
native=
"checkInteger(OrderMsg, 'GuestNum')"
v-model=
"OrderMsg.GuestNum"
@
input=
"calcPrice()"
class=
"col-6"
label=
"人数"
:rules=
"[val => !!val || '请填写人数']"
disable
/>
<template
v-if=
"isChaBan == 1"
>
<q-select
filled
option-value=
"CourseId"
:disable=
"modityOrderType == 2"
option-label=
"CourseName"
ref=
"CourseId"
v-model=
"OrderMsg.CourseId"
:options=
"CourseList"
emit-value
map-options
class=
"col-6"
:rules=
"[val => !!val || '请选择课程']"
label=
"选择课程"
@
input=
"calcPrice()"
/>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.StartClassHours"
:disable=
"modityOrderType == 2"
@
keyup
.
native=
"checkInteger(OrderMsg, 'StartClassHours')"
ref=
"StartClassHours"
@
input=
"calcPrice()"
class=
"col-6"
label=
"起始课时"
:rules=
"[val =>!!val&&val
<0
||
'请填起始课时']"
/>
<q-input
filled
v-model=
"OrderMsg.EffectTime"
ref=
"EffectTime"
:rules=
"[val => !!val || '请填生效时间']"
class=
"col-6"
:disable=
"modityOrderType == 2"
mask=
"date"
label=
"生效时间"
>
<template
v-slot:append
>
<q-icon
name=
"event"
class=
"cursor-pointer"
>
<q-popup-proxy
ref=
"qDateProxy1"
transition-show=
"scale"
transition-hide=
"scale"
>
<q-date
v-model=
"OrderMsg.EffectTime"
@
input=
"() => $refs.qDateProxy1.hide()"
/>
</q-popup-proxy>
</q-icon>
</
template
>
</q-input>
<q-select
filled
option-value=
"OrderId"
option-label=
"CourseName"
class=
"col-6"
:disable=
"modityOrderType == 2"
v-model=
"OrderMsg.UpOrderId"
:options=
"beforeOrderList"
emit-value
map-options
label=
"前置订单"
>
<
template
v-slot:option=
"{
itemProps,
itemEvents,
opt,
selected,
toggleOption
}"
>
<q-item
v-bind=
"itemProps"
v-on=
"itemEvents"
>
<q-item-section>
<q-item-label
><span
style=
"color:blue"
>
{{
opt
.
OrderId
}}
</span>
{{
opt
.
CourseName
}}
{{
opt
.
ClassName
}}
{{
getStudent
(
opt
.
GuestList
)
}}
</q-item-label
>
</q-item-section>
</q-item>
</
template
>
</q-select>
</template>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.Class_Price"
:disable=
"true"
class=
"col-6"
label=
"单价(课程售价)"
style=
"display:none;"
/>
<
template
v-if=
"modityOrderType == 1"
>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.Unit_Price"
:disable=
"IsShowUpPrice == true ? false : true"
@
blur=
"calcPrice()"
class=
"col-6"
label=
"成交单价"
:rules=
"[val => !!val || '请填成交单价']"
/>
<q-toggle
v-model=
"IsShowUpPrice"
label=
"高于定价收生"
class=
"q-mb-md"
style=
"display:none;"
/>
</
template
>
<
template
v-if=
"modityOrderType == 2"
>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.Unit_Price"
:disable=
"true"
@
input=
"calcPrice()"
class=
"col-6"
label=
"成交单价"
:rules=
"[val => !!val || '请填成交单价']"
/>
</
template
>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.DiscountMoney"
:disable=
"true"
class=
"col-6"
label=
"优惠金额"
/>
<!-- <q-input filled stack-label :dense="false" v-model="OrderMsg.PerDiscountMoney" :disable="true"
class="col-6" label="优惠金额(每人)" :hint="'总优惠金额:'+(OrderMsg.PerDiscountMoney*OrderMsg.GuestNum)" /> -->
<
template
v-if=
"modityOrderType == 3"
>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.Unit_Price"
@
input=
"calcPrice()"
class=
"col-6"
label=
"成交单价"
:rules=
"[val => !!val || '请填成交单价']"
/>
</
template
>
<q-input
filled
stack-label
:disable=
"modityOrderType != 3"
:dense=
"false"
maxlength=
"10"
@
keyup
.
native=
"checkPrice(OrderMsg, 'PreferPrice')"
v-model=
"OrderMsg.PreferPrice"
class=
"col-6"
label=
"应收"
/>
<q-select
:disable=
"modityOrderType == 2"
standout=
"bg-primary text-white"
option-value=
"Id"
option-label=
"Name"
v-model=
"OrderMsg.OrderSource"
:options=
"SourceEnumList"
emit-value
map-options
class=
"col-6"
label=
"客人来源"
/>
<q-select
:disable=
"modityOrderType == 2 || OrderMsg.JoinType == 3"
v-model=
"OrderMsg.HelpEnterId"
:options=
"EmployeeList"
filled
use-input
label=
"协助老师"
option-label=
"EmployeeName"
option-value=
"Id"
ref=
"EmployeeName"
class=
"col-6"
emit-value
map-options
@
filter=
"filterFn"
>
<
template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<q-select
:disable=
"modityOrderType == 2 || OrderMsg.JoinType == 3"
v-model=
"OrderMsg.CourseConsultantId"
:options=
"EmployeeList"
filled
use-input
label=
"课程顾问"
option-label=
"EmployeeName"
option-value=
"Id"
ref=
"EmployeeName"
class=
"col-6"
emit-value
map-options
@
filter=
"filterFn"
>
<
template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<q-select
:disable=
"modityOrderType == 2 || OrderMsg.JoinType == 3"
v-model=
"OrderMsg.CustomerId"
:options=
"myCustomerList"
filled
use-input
label=
"同行"
option-label=
"CustomerName"
option-value=
"CustomerId"
ref=
"CustomerName"
class=
"col-6"
emit-value
map-options
@
filter=
"cusfilterFn"
>
<
template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<q-input
:disable=
"modityOrderType == 2"
v-if=
"OrderMsg.OrderSource == 3"
filled
stack-label
:dense=
"false"
maxlength=
"50"
v-model=
"OrderMsg.GeneralOccupation"
class=
"col-6"
label=
"一般同行"
/>
<q-input
:disable=
"modityOrderType == 2"
v-if=
"OrderMsg.OrderSource == 7"
filled
stack-label
:dense=
"false"
maxlength=
"50"
v-model=
"OrderMsg.EduOccupation"
class=
"col-6"
label=
"教育同行"
/>
<!-- <q-toggle :disable="(modityOrderType==2)" v-model="OrderMsg.IsLessPrice" :false-value="0" :true-value="1"
label="是否少价" class="q-mb-md" /> -->
<q-input
:disable=
"modityOrderType == 2"
v-if=
"OrderMsg.IsLessPrice == 1"
@
input=
"calcPrice()"
@
keyup
.
native=
"checkPrice(OrderMsg, 'PerLessMoney')"
maxlength=
"10"
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.PerLessMoney"
class=
"col-6"
label=
"少价金额(每人)"
:hint=
"'总少价金额:' + OrderMsg.PerLessMoney * OrderMsg.GuestNum"
/>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"OrderMsg.SaleRemark"
style=
"margin-top: 20px"
type=
"textarea"
class=
"col-12"
label=
"备注"
/>
<!-- ?? -->
</div>
<div
style=
"margin:30px 10px 70px 0;"
class=
"flex justify-end"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
label=
"保存"
@
click=
"saveOrderInfo()"
/>
</div>
</div>
<div
class=
"dialog-out-close"
@
click=
"closeEditOrder"
style=
"height:40px !important;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;"
>
<q-icon
name=
"iconfont icon-jujue1"
size=
"26px"
/>
</div>
</div>
</template>
<
script
>
import
{
getClassOrderInfo
,
//获取订单操作日志列表
getOrderSourceEnumList
,
//获取订单来源 枚举
setClassOrder
,
//修改订单
queryChaClassInfo
,
GetSelectClassOrderList
,
//获取前置下拉
getMyCustomerList
//同行下拉
}
from
"../../../../api/sale/sale"
;
import
{
queryEmployee
}
from
"../../../../api/users/user"
;
//获取员工
import
{
mapState
}
from
"vuex"
;
export
default
{
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
},
//订单类型
orderType
:
{
type
:
Number
,
default
:
1
},
//修改订单类型
modityOrderType
:
{
type
:
Number
,
default
:
0
//1-销售修改,2-OP修改,3-总经理修改
},
isChaBan
:
{
type
:
Number
,
default
:
0
//1-是插班报入
},
stuData
:
{
//学生是否续费
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
IsShowEditOrder
:
true
,
OrderMsg
:
{
ClassId
:
0
,
//班级编号
GuestNum
:
0
,
//人数
B2CRatio
:
0
,
B2CReNewRatio
:
0
,
CustomerId
:
0
,
//市场专员
Unit_Price
:
0
,
PreferPrice
:
0
,
//应收
OrderSource
:
0
,
SaleRemark
:
""
,
Class_Price
:
0
,
//单价
OrderId
:
0
,
OrderType
:
0
,
//订单类型(1-班级课程订单,2-留学就业订单)
SourceId
:
0
,
//来源编号
HelpEnterId
:
0
,
//协助老师编号
GeneralOccupation
:
""
,
//一般同行
EduOccupation
:
""
,
//教育同行
IsLessPrice
:
0
,
//是否少价 0 不少 1 少
LessPrice
:
0
,
//少价金额
PerLessMoney
:
0
,
//每人少价金额
OrderNature
:
1
,
//订单性质
OldPreferPrice
:
0
,
//原实际应收
IsChaBan
:
0
,
//是否插班报入(1-是)
CourseId
:
""
,
//课程编号
StartClassHours
:
0
,
//已上课时
EffectTime
:
""
,
//生效时间
UpOrderId
:
0
,
//前置订单编号
JoinType
:
1
,
//订单报入类型
DiscountMoney
:
0
,
//优惠金额
PerDiscountMoney
:
0
,
//每人优惠金额
CourseConsultantId
:
0
,
//课程顾问
CustomerId
:
0
,
//同行
OrderIdentify
:
2
,
//标识参数, 1产品下单 2客户转订单
StuIds
:
""
// NormalCommission:'',//正常返佣金额
// RenewCommission:"",// 预计返佣金额
},
Unit_PriceRemark
:
""
,
//单价规则
IsShowUpPrice
:
false
,
//是否显示高于定价
UnitPrice
:
0
,
SourceEnumList
:
[],
//订单来源
EmployeeList
:
[],
//员工列表
AllemployeeList
:
[],
//所有员工列表
CourseList
:
[],
//课程列表
courseObj
:
{},
//选择的课程
beforeOrderList
:
[],
//前置订单数据
myCustomerList
:
[],
//同行列表
allCustomerList
:
[]
//所有同行列表
};
},
created
()
{
this
.
OrderMsg
.
IsChaBan
=
this
.
isChaBan
;
//HK2021-08-06新增
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
)
{
this
.
OrderMsg
.
CourseId
=
this
.
saveObj
.
CourseId
;
}
this
.
getOrderSEList
();
this
.
getEmployee
();
this
.
initConfig
();
this
.
getSelectClass
();
this
.
getCustomerList
();
},
mounted
()
{
this
.
initData
();
},
watch
:
{},
methods
:
{
//获取班级课程信息
initConfig
()
{
var
qMsg
=
{
ClassId
:
0
};
if
(
this
.
saveObj
.
ClassId
)
{
qMsg
.
ClassId
=
this
.
saveObj
.
ClassId
;
}
queryChaClassInfo
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
CourseList
=
res
.
Data
.
otherCourse
;
if
(
this
.
saveObj
&&
this
.
saveObj
.
OrderId
>
0
)
{
}
else
{
this
.
OrderMsg
.
StartClassHours
=
res
.
Data
.
finishHours
;
}
if
(
this
.
OrderMsg
&&
this
.
OrderMsg
.
CourseId
)
{
this
.
courseObj
=
this
.
CourseList
.
find
(
x
=>
x
.
CourseId
==
this
.
OrderMsg
.
CourseId
);
}
this
.
calcPrice
();
}
});
},
//计算课程单价和应收金额
calcPrice
()
{
var
guestNum
=
0
;
if
(
this
.
OrderMsg
.
GuestNum
&&
this
.
OrderMsg
.
GuestNum
>
0
)
{
guestNum
=
Number
(
this
.
OrderMsg
.
GuestNum
);
}
let
temp
=
this
.
CourseList
.
find
(
x
=>
x
.
CourseId
==
this
.
OrderMsg
.
CourseId
);
if
(
temp
)
{
this
.
courseObj
=
temp
;
var
tempDiscountMoney
=
0
;
//优惠金额
var
tempSaleRemark
=
`直客首次报名优惠比例
${
temp
.
B2CRatio
??
0
}
%
`; //备注
//插班课时单价
var classHourPrice = temp.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(
classHourPrice *
(this.courseObj.ClassHours - this.OrderMsg.StartClassHours)
).toFixed(2);
if (guestNum == 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[0].PriceType == 0) {
if (this.OrderMsg.IsChaBan == 1) {
tempDiscountMoney =
(chaBanPrice * temp.CoursePriceList[0].PriceMoney) / 100;
} else {
tempDiscountMoney =
(temp.SellPrice * temp.CoursePriceList[0].PriceMoney) / 100;
}
// tempSaleRemark = "单人报名优惠" + temp.CoursePriceList[0].PriceMoney + "%";
} else {
tempDiscountMoney = item.CoursePriceList[0].PriceMoney;
// tempSaleRemark = "单人报名优惠" + temp.CoursePriceList[0].PriceMoney;
}
}
}
if (guestNum > 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[1].PriceType == 0) {
// tempSaleRemark = "双人报名优惠" + temp.CoursePriceList[1].PriceMoney + "%";
if (this.OrderMsg.IsChaBan == 1) {
tempDiscountMoney =
(chaBanPrice * temp.CoursePriceList[1].PriceMoney) / 100;
} else {
tempDiscountMoney =
(temp.SellPrice * temp.CoursePriceList[1].PriceMoney) / 100;
}
} else {
tempDiscountMoney = item.CoursePriceList[1].PriceMoney;
// tempSaleRemark = "双人报名优惠" + temp.CoursePriceList[1].PriceMoney;
}
}
}
var perDiscountMoney = Number(tempDiscountMoney).toFixed(2);
this.OrderMsg.PerDiscountMoney = perDiscountMoney;
// this.OrderMsg.DiscountMoney = perDiscountMoney * guestNum;
// this.OrderMsg.DiscountMoney =
// this.OrderMsg.Class_Price *
// this.OrderMsg.GuestNum *
// this.OrderMsg.B2CRatio;
//计算每人优惠和总优惠
if (this.OrderMsg.IsChaBan == 1) {
this.OrderMsg.Unit_Price = chaBanPrice;
this.UnitPrice = chaBanPrice;
} else {
this.OrderMsg.Unit_Price = temp.SellPrice;
this.UnitPrice = temp.SellPrice;
}
this.OrderMsg.SaleRemark = tempSaleRemark;
} else {
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
}
if (this.saveObj.Unit_Price) {
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
this.courseObj = {};
}
/**计算少价---开始*/
var tempPerLessMoney = 0;
if (this.OrderMsg.PerLessMoney && this.OrderMsg.PerLessMoney > 0) {
tempPerLessMoney = this.OrderMsg.PerLessMoney;
}
this.OrderMsg.LessPrice = tempPerLessMoney * guestNum;
/**计算少价----结束*/
var unit_price = 0;
if (this.OrderMsg.Unit_Price && this.OrderMsg.Unit_Price > 0) {
unit_price = Number(this.OrderMsg.Unit_Price);
}
var str = "";
//计算应收价格
if (this.OrderMsg.IsChaBan == 1) {
var newPreferPrice = 0;
if (
this.courseObj &&
this.courseObj.CourseId &&
this.courseObj.CourseId > 0
) {
newPreferPrice = chaBanPrice * guestNum;
}
this.OrderMsg.PreferPrice =
Number(newPreferPrice).toFixed(2) - this.OrderMsg.LessPrice;
} else {
this.OrderMsg.PreferPrice =
Number(guestNum * unit_price).toFixed(2) - this.OrderMsg.LessPrice;
}
//留学就业订单
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
}
this.OrderMsg.GuestNum = this.stuData.StuList.length;
console.log("tag551", this.OrderMsg.GuestNum);
this.OrderMsg.DiscountMoney = 0;
this.stuData.StuList.map(e => {
if (e.IsRenewGuest == 0) {
this.OrderMsg.DiscountMoney +=
this.OrderMsg.Class_Price * this.OrderMsg.B2CRatio;
} else {
this.OrderMsg.DiscountMoney +=
this.OrderMsg.Class_Price * this.OrderMsg.B2CReNewRatio;
}
});
},
initData() {
console.log("tag", "init", this.saveObj);
if (this.saveObj && this.saveObj.OrderId > 0) {
getClassOrderInfo({
OrderId: this.saveObj.OrderId
}).then(res => {
if (res.Code == 1) {
var tempData = res.Data.OrderInfo;
this.OrderMsg.ClassId = tempData.ClassId;
// this.OrderMsg.GuestNum = tempData.GuestNum;
this.OrderMsg.Unit_Price = tempData.Unit_Price;
this.OrderMsg.PreferPrice = tempData.PreferPrice;
this.OrderMsg.OrderSource = tempData.OrderSource;
this.OrderMsg.SaleRemark = tempData.SaleRemark;
this.OrderMsg.Class_Price = tempData.Class_Price;
this.OrderMsg.OrderId = tempData.OrderId;
this.OrderMsg.OrderType = tempData.OrderType;
this.OrderMsg.SourceId = tempData.SourceId;
this.OrderMsg.HelpEnterId = tempData.HelpEnterId;
this.OrderMsg.GeneralOccupation = tempData.GeneralOccupation;
this.OrderMsg.EduOccupation = tempData.EduOccupation;
this.OrderMsg.IsLessPrice = tempData.IsLessPrice;
this.OrderMsg.LessPrice = tempData.LessPrice;
this.OrderMsg.PerLessMoney = tempData.PerLessMoney;
this.OrderMsg.OrderNature = tempData.OrderNature;
this.OrderMsg.OldPreferPrice = tempData.OldPreferPrice;
this.OrderMsg.CourseId = tempData.CourseId;
this.OrderMsg.JoinType = tempData.JoinType;
this.OrderMsg.StartClassHours = tempData.StartClassHours;
this.OrderMsg.IsChaBan = tempData.IsChaBan;
this.OrderMsg.EffectTime = tempData.EffectTime;
this.OrderMsg.UpOrderId = tempData.UpOrderId;
this.OrderMsg.DiscountMoney = tempData.DiscountMoney;
this.OrderMsg.PerDiscountMoney = tempData.PerDiscountMoney;
this.OrderMsg.B2CRatio =
tempData.B2CRatio > 1
? tempData.B2CRatio / 100
: tempData.B2CRatio;
this.OrderMsg.B2CReNewRatio =
tempData.B2CReNewRatio > 1
? tempData.B2CReNewRatio / 100
: tempData.B2CReNewRatio;
this.OrderMsg.CustomerId = tempData.CustomerId;
this.OrderMsg.CourseConsultantId = tempData.CourseConsultantId;
this.UnitPrice = this.OrderMsg.Unit_Price;
this.IsShowEditOrder = true;
}
});
} else {
this.OrderMsg.SaleRemark = ""; //清空备注
this.OrderMsg.HelpEnterId = 0;
this.OrderMsg.GeneralOccupation = "";
this.OrderMsg.EduOccupation = "";
this.OrderMsg.IsLessPrice = 0;
this.OrderMsg.LessPrice = 0;
this.OrderMsg.PerLessMoney = 0;
this.OrderMsg.OrderNature = 0;
this.OrderMsg.OldPreferPrice = 0;
// this.OrderMsg.GuestNum = 1;
this.OrderMsg.StartClassHours = 0;
this.OrderMsg.IsChaBan = this.isChaBan;
this.OrderMsg.EffectTime = "";
this.OrderMsg.UpOrderId = 0;
this.OrderMsg.JoinType = 1;
this.OrderMsg.DiscountMoney = 0;
this.OrderMsg.PerDiscountMoney = 0;
this.OrderMsg.OrderType = this.orderType;
this.OrderMsg.B2CRatio = 0;
this.OrderMsg.B2CReNewRatio = 0;
this.OrderMsg.CustomerId = 0;
this.OrderMsg.CourseConsultantId = 0;
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OrderNature = 1;
}
if (this.saveObj) {
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
}
if (this.saveObj.Unit_Price) {
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.OrderMsg.Class_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
if (this.saveObj.CourseId) {
this.OrderMsg.CourseId = this.saveObj.CourseId;
} else {
this.OrderMsg.CourseId = "";
}
if (this.saveObj.B2CRatio) {
this.OrderMsg.B2CRatio =
this.saveObj.B2CRatio > 1
? this.saveObj.B2CRatio / 100
: this.saveObj.B2CRatio;
}
if (this.saveObj.B2CReNewRatio) {
this.OrderMsg.B2CReNewRatio =
this.saveObj.B2CReNewRatio > 1
? this.saveObj.B2CReNewRatio / 100
: this.saveObj.B2CReNewRatio;
}
}
this.IsShowEditOrder = true;
this.calcPrice();
// console.log("this.saveObj", this.saveObj);
}
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList));
} else {
const needle = val.toLowerCase();
this.EmployeeList = this.AllemployeeList.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//筛选同行
cusfilterFn(val, update) {
update(() => {
if (val === "") {
this.myCustomerList = JSON.parse(
JSON.stringify(this.allCustomerList)
);
} else {
const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//获取业务员
getEmployee() {
var qMsg = {
Dept_Id: 0
};
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeList = res.Data;
this.AllemployeeList = res.Data;
let obj = {
Id: 0,
EmployeeName: "不限"
};
this.EmployeeList.unshift(obj);
}
});
},
//关闭弹窗
closeEditOrder() {
this.IsShowEditOrder = false;
this.$emit("close");
},
//获取订单来源
getOrderSEList() {
getOrderSourceEnumList({}).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
this.SourceEnumList = tempArray;
this.OrderMsg.OrderSource = tempArray[0].Id;
}
});
},
//修改订单
saveOrderInfo() {
//插班验证课程和生效时间
if (this.isChaBan == 1) {
this.$refs.CourseId.validate();
this.$refs.EffectTime.validate();
if (this.$refs.CourseId.hasError) {
this.$q.notify({
type: "negative",
position: "top",
message: `
请选择课程
!
`
});
return;
}
if (this.$refs.EffectTime.hasError) {
this.$q.notify({
type: "negative",
position: "top",
message: `
请选择生效时间
!
`
});
return;
}
}
//插班报名计算应收
if (this.OrderMsg.IsChaBan == 1) {
if (this.modityOrderType == 1 || this.modityOrderType == 2) {
if (
!this.courseObj ||
(this.courseObj && !this.courseObj.ClassHours)
) {
if (this.OrderMsg && this.OrderMsg.CourseId) {
this.courseObj = this.CourseList.find(
x => x.CourseId == this.OrderMsg.CourseId
);
}
}
//插班课时单价
var classHourPrice =
this.courseObj.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(
classHourPrice *
(this.courseObj.ClassHours - this.OrderMsg.StartClassHours)
).toFixed(2);
var newPreferPrice =
chaBanPrice * this.OrderMsg.GuestNum - this.OrderMsg.LessPrice;
this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
}
}
//正常报名计算应收
if (this.OrderMsg.IsChaBan == 0) {
if (this.modityOrderType == 1 || this.modityOrderType == 2) {
this.OrderMsg.PreferPrice =
this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price -
this.OrderMsg.LessPrice;
}
}
this.OrderMsg.StuIds = this.stuData.StuList.map(e => e.StuId).toString();
setClassOrder(this.OrderMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "操作成功!",
position: "top"
});
//调用父页面成功方法
this.$emit("success");
this.IsShowEditOrder = false;
} else {
this.$q.notify({
type: "negative",
position: "top",
message: res.Message
});
}
});
},
//获取前置下拉数据
getSelectClass() {
var qMsg = {
ClassId: 0
};
if (this.saveObj.ClassId) {
qMsg.ClassId = this.saveObj.ClassId;
}
GetSelectClassOrderList(qMsg).then(res => {
if (res.Code == 1) {
this.beforeOrderList = res.Data;
}
});
},
getStudent(item) {
let str = "";
if (item && item.length > 1) {
str = item[0].GuestName + "等" + item.length + "人";
}
if (item.length == 1) {
str = item[0].GuestName;
}
return str;
},
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data;
this.allCustomerList = res.Data;
this.myCustomerList.unshift({
CustomerId: 0,
CustomerName: "不限"
});
});
}
}
};
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment