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
4d71e35e
Commit
4d71e35e
authored
Mar 28, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
63969c27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
815 additions
and
801 deletions
+815
-801
course-form.vue
src/components/course/course-form.vue
+509
-496
transfer-order.vue
src/components/school/student/transfer-order.vue
+306
-305
No files found.
src/components/course/course-form.vue
View file @
4d71e35e
...
@@ -17,9 +17,8 @@
...
@@ -17,9 +17,8 @@
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"row wrap"
>
<div
class=
"col-6 q-pb-lg q-pr-lg"
>
<div
class=
"col-6 q-pb-lg q-pr-lg"
>
<q-uploader
:style=
"
{ backgroundImage: 'url(' + objOption.CoverImg + ')' }"
<q-uploader
:style=
"
{ backgroundImage: 'url(' + objOption.CoverImg + ')' }" style="width: auto; height: 139px"
style="width: auto; height: 139px" flat hide-upload-btn max-files="1" label="课程封面" accept=".jpg, image/*"
flat hide-upload-btn max-files="1" label="课程封面" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
:factory="uploadFile" auto-upload>
</q-uploader>
</q-uploader>
</div>
</div>
<div
class=
"col-6 q-pr-lg q-pb-lg"
>
<div
class=
"col-6 q-pr-lg q-pb-lg"
>
...
@@ -133,23 +132,23 @@
...
@@ -133,23 +132,23 @@
</div>
</div>
</div>
</div>
<div
class=
"row"
v-if=
"objOption.IsScrollClass
==
1"
>
<div
class=
"row"
v-if=
"objOption.IsScrollClass
==
1"
>
<q-input
filled
stack-label
v-model=
"objOption.ScrollMinNum"
ref=
"ScrollMinNum"
class=
"col-6 q-pr-lg q-pb-lg"
<q-input
filled
stack-label
v-model=
"objOption.ScrollMinNum"
ref=
"ScrollMinNum"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"最小上课人数"
:rules=
"[val => !!val || '请填写最小上课人数']"
/>
label=
"最小上课人数"
:rules=
"[val => !!val || '请填写最小上课人数']"
/>
<q-input
filled
stack-label
v-model=
"objOption.ScrollMaxNum"
ref=
"ScrollMaxNum"
class=
"col-6 q-pr-lg q-pb-lg"
<q-input
filled
stack-label
v-model=
"objOption.ScrollMaxNum"
ref=
"ScrollMaxNum"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"最大上课人数"
:rules=
"[val => !!val || '请填写最大上课人数']"
/>
label=
"最大上课人数"
:rules=
"[val => !!val || '请填写最大上课人数']"
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<q-input
filled
stack-label
v-model=
"objOption.FreeCoffeeNum"
ref=
"FreeCoffeeNum"
<q-input
filled
stack-label
v-model=
"objOption.FreeCoffeeNum"
ref=
"FreeCoffeeNum"
class=
"col-6 q-pr-lg q-pb-lg"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"赠送咖啡杯数"
:rules=
"[val => val >=
0 || '请填写赠送咖啡杯数']"
/>
label=
"赠送咖啡杯数"
:rules=
"[val => val >=
0 || '请填写赠送咖啡杯数']"
/>
<q-input
filled
stack-label
v-model=
"objOption.AddHoursMoney"
ref=
"AddHoursMoney"
<q-input
filled
stack-label
v-model=
"objOption.AddHoursMoney"
ref=
"AddHoursMoney"
class=
"col-6 q-pr-lg q-pb-lg"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"课程增加课时费"
:rules=
"[val => val >=
0 || '请填写课程增加课时费']"
/>
label=
"课程增加课时费"
:rules=
"[val => val >=
0 || '请填写课程增加课时费']"
/>
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"CourseEmphasis"
multiple
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"CourseEmphasis"
multiple
use-chips
use-chips
ref=
"CourseEmphasis"
:options=
"keynoteList"
label=
"课程重点"
class=
"col-6 q-pr-lg q-pb-lg"
ref=
"CourseEmphasis"
:options=
"keynoteList"
label=
"课程重点"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
emit-value
map-options
/>
map-options
/>
</div>
</div>
<div
class=
"col-6 q-pb-lg q-pr-lg"
>
<div
class=
"col-6 q-pb-lg q-pr-lg"
>
<q-uploader
:style=
"{ backgroundImage: 'url(' + objOption.B2BIcon + ')' }"
style=
"width: auto; "
flat
<q-uploader
:style=
"{ backgroundImage: 'url(' + objOption.B2BIcon + ')' }"
style=
"width: auto; "
flat
...
@@ -188,6 +187,18 @@
...
@@ -188,6 +187,18 @@
:true-value=
"1"
v-model=
"objOption.IsKCourse"
/>
:true-value=
"1"
v-model=
"objOption.IsKCourse"
/>
</div>
</div>
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"col-9"
>
<q-field
stack-label
class=
"col-3 q-pr-lg"
prefix=
"是否显示:"
borderless
>
<
template
v-slot:control
>
<q-radio
v-model=
"objOption.SaleState"
:val=
"1"
label=
"显示"
/>
<q-radio
v-model=
"objOption.SaleState"
:val=
"2"
label=
"隐藏"
/>
</
template
>
</q-field>
</div>
<div
class=
"col-3"
>
</div>
</div>
<div
class=
"row col-12"
v-if=
"choosePlat.find(e => e == 4)"
>
<div
class=
"row col-12"
v-if=
"choosePlat.find(e => e == 4)"
>
<span
class=
"q-mb-sm"
>
选择分类:
</span>
<span
class=
"q-mb-sm"
>
选择分类:
</span>
<q-card
class=
"full-width"
>
<q-card
class=
"full-width"
>
...
@@ -208,523 +219,525 @@
...
@@ -208,523 +219,525 @@
</template>
</template>
<
script
>
<
script
>
import
ColorThief
from
"colorthief"
;
import
ColorThief
from
"colorthief"
;
import
{
import
{
queryCourseCategoryTree
,
queryCourseCategoryTree
,
saveCourseInfo
,
saveCourseInfo
,
queryCourseInfo
,
queryCourseInfo
,
querySaleplatList
,
querySaleplatList
,
getCourseRate
,
getCourseRate
,
getCourseSubject
,
getCourseSubject
,
getCourseEmphasisEnumList
getCourseEmphasisEnumList
}
from
"../../api/course/index"
;
}
from
"../../api/course/index"
;
import
{
import
{
getTeacherDropDownList
,
getTeacherDropDownList
,
GetBankTypeList
GetBankTypeList
}
from
"../../api/school/index"
;
}
from
"../../api/school/index"
;
import
{
import
{
UploadSelfFile
UploadSelfFile
}
from
"../../api/common/common"
;
}
from
"../../api/common/common"
;
import
{
import
{
getScrollCourseTimeList
getScrollCourseTimeList
}
from
"../../api/course/roll"
;
}
from
"../../api/course/roll"
;
import
extEditor
from
"../common/ext-editor"
;
import
extEditor
from
"../common/ext-editor"
;
import
{
import
{
mapState
mapState
}
from
"vuex"
;
}
from
"vuex"
;
export
default
{
export
default
{
components
:
{
components
:
{
extEditor
extEditor
},
},
props
:
{
props
:
{
saveObj
:
{
saveObj
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
objOption
:
{
CourseId
:
0
,
//课程编号
CoverImg
:
""
,
//课程封面图
CourseName
:
""
,
//课程名称
CourseIntro
:
""
,
//课程介绍
CateId
:
0
,
//课程编号
School_Id
:
0
,
//校区编号
Teacher_Ids
:
""
,
//教学团队
CourseFeature
:
""
,
//课程特色
OriginalPrice
:
0
,
//原价
SellPrice
:
0
,
//售价
IsOpenStepPrice
:
0
,
//是否开启阶梯定价(1-开启)
IsRenew
:
0
,
//是否可续费课程(1-是)
RenewOgPrice
:
0
,
//续费原价
RenewSlPrice
:
0
,
//续费售价
Saleplat
:
""
,
//销售平台
IsKCourse
:
0
,
//是否是K12课程(1-是)
ClassHours
:
0
,
CategoryList
:
[],
CourseRate
:
""
,
//课程等级
CourseSubject
:
""
,
//课程科目
B2BIcon
:
""
,
//图标
B2BBackground
:
""
,
//背景
CourseEmphasis
:
[],
//课程重点 多选 英文逗号分隔
ContractInfo
:
""
,
//合同补充协议
IsScrollClass
:
0
,
// 是否开启滚动开班 1是 0否(默认)
ScrollMinNum
:
0
,
// 最小上课人数
ScrollMaxNum
:
0
,
// 最大上课人数
FreeCoffeeNum
:
0
,
// 赠送咖啡
AddHoursMoney
:
0
,
// 课程增加课时费
CourseTimeId
:
0
,
// 关联上课时段
ContractInfo
:
""
,
//合同补充协议
OpenBankLevelList
:
[],
//开放题库
ChineseHours
:
""
,
//中教课时
ForeignHours
:
""
,
//外教课时
SaleState
:
1
,
//上架状态(1-上架,2-下架)
},
CourseTimeList
:
[],
//上课时段列表
CourseEmphasis
:
[],
//数据临时存放
optionTitle
:
""
,
defaultArray
:
[],
ladderPriceList
:
[],
//阶梯定价数组
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
TeacherList
:
[],
//关联教师下拉数据
SaleplatList
:
[],
//销售端口
choosePlat
:
[],
//选择的平台
chooseTeacher
:
[],
//选择老师
isShowPrice
:
0
,
//是否显示价格【hk2021-03-05新增】
goodClassify
:
[],
//商品分类列表
chooseGoodsClassify
:
[],
//选中的商品分类
modifyClassifyList
:
[],
//修改时返回的分类列表
courseLevelList
:
[],
//课程等级列表
courseSubjectList
:
[],
//课程科目列表
keynoteList
:
[],
//重点枚举列表
LevelData
:
[]
};
},
created
()
{
this
.
getCategorytree
();
this
.
GetTeacherList
();
this
.
getSaleplat
();
//获取电商商品分类
this
.
getGoodsClassify
();
this
.
getCourseRateList
();
this
.
getCourseEmphasisList
();
//获取课程重点枚举列表
this
.
initObj
();
this
.
getLevel
();
},
computed
:
mapState
({
//是否有编辑课时权限
isHaveCourseHoursEdit
(
state
)
{
if
(
state
.
user
.
userInfo
&&
state
.
user
.
userInfo
.
ActionMenuList
&&
state
.
user
.
userInfo
.
ActionMenuList
.
length
>
0
)
{
let
action
=
state
.
user
.
userInfo
.
ActionMenuList
.
find
(
x
=>
{
if
(
x
.
FunctionCode
==
"Edit_CourseClassHours"
)
{
return
x
;
}
});
if
(
action
)
{
return
true
;
}
}
}
return
false
;
}
}),
mounted
()
{
this
.
getCourseTimeList
();
},
methods
:
{
//获取关联考试等级
getLevel
()
{
GetBankTypeList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
LevelData
=
res
.
Data
;
}
})
},
},
data
()
{
//根据系列改变获取所属科目
return
{
changeCourseSubject
(
Id
)
{
persistent
:
true
,
if
(
Id
>
0
)
{
objOption
:
{
let
val
=
this
.
TreeCategoryList
.
find
(
x
=>
x
.
CateId
==
Id
);
CourseId
:
0
,
//课程编号
this
.
objOption
.
CourseSubject
=
val
.
CourseSubject
;
CoverImg
:
""
,
//课程封面图
}
CourseName
:
""
,
//课程名称
CourseIntro
:
""
,
//课程介绍
CateId
:
0
,
//课程编号
School_Id
:
0
,
//校区编号
Teacher_Ids
:
""
,
//教学团队
CourseFeature
:
""
,
//课程特色
OriginalPrice
:
0
,
//原价
SellPrice
:
0
,
//售价
IsOpenStepPrice
:
0
,
//是否开启阶梯定价(1-开启)
IsRenew
:
0
,
//是否可续费课程(1-是)
RenewOgPrice
:
0
,
//续费原价
RenewSlPrice
:
0
,
//续费售价
Saleplat
:
""
,
//销售平台
IsKCourse
:
0
,
//是否是K12课程(1-是)
ClassHours
:
0
,
CategoryList
:
[],
CourseRate
:
""
,
//课程等级
CourseSubject
:
""
,
//课程科目
B2BIcon
:
""
,
//图标
B2BBackground
:
""
,
//背景
CourseEmphasis
:
[],
//课程重点 多选 英文逗号分隔
ContractInfo
:
""
,
//合同补充协议
IsScrollClass
:
0
,
// 是否开启滚动开班 1是 0否(默认)
ScrollMinNum
:
0
,
// 最小上课人数
ScrollMaxNum
:
0
,
// 最大上课人数
FreeCoffeeNum
:
0
,
// 赠送咖啡
AddHoursMoney
:
0
,
// 课程增加课时费
CourseTimeId
:
0
,
// 关联上课时段
ContractInfo
:
""
,
//合同补充协议
OpenBankLevelList
:
[],
//开放题库
ChineseHours
:
""
,
//中教课时
ForeignHours
:
""
,
//外教课时
},
CourseTimeList
:
[],
//上课时段列表
CourseEmphasis
:
[],
//数据临时存放
optionTitle
:
""
,
defaultArray
:
[],
ladderPriceList
:
[],
//阶梯定价数组
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
TeacherList
:
[],
//关联教师下拉数据
SaleplatList
:
[],
//销售端口
choosePlat
:
[],
//选择的平台
chooseTeacher
:
[],
//选择老师
isShowPrice
:
0
,
//是否显示价格【hk2021-03-05新增】
goodClassify
:
[],
//商品分类列表
chooseGoodsClassify
:
[],
//选中的商品分类
modifyClassifyList
:
[],
//修改时返回的分类列表
courseLevelList
:
[],
//课程等级列表
courseSubjectList
:
[],
//课程科目列表
keynoteList
:
[],
//重点枚举列表
LevelData
:
[]
};
},
},
created
()
{
//获取课程等级列表
this
.
getCategorytree
();
getCourseRateList
()
{
this
.
GetTeacherList
();
getCourseRate
({}).
then
(
res
=>
{
this
.
getSaleplat
();
if
(
res
.
Code
==
1
)
{
//获取电商商品分类
var
tempData
=
res
.
Data
;
this
.
getGoodsClassify
();
if
(
tempData
&&
tempData
.
length
>
0
)
{
this
.
getCourseRateList
();
tempData
.
forEach
(
item
=>
{
this
.
getCourseEmphasisList
();
//获取课程重点枚举列表
this
.
courseLevelList
.
push
({
this
.
initObj
();
Id
:
item
.
Id
,
this
.
getLevel
();
Name
:
item
.
Name
.
replace
(
/课程/g
,
""
)
});
});
}
}
});
getCourseSubject
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
courseSubjectList
=
res
.
Data
;
}
});
},
},
computed
:
mapState
({
getCourseEmphasisList
()
{
//是否有编辑课时权限
getCourseEmphasisEnumList
({}).
then
(
res
=>
{
isHaveCourseHoursEdit
(
state
)
{
if
(
res
.
Code
==
1
)
{
if
(
this
.
keynoteList
=
res
.
Data
;
state
.
user
.
userInfo
&&
this
.
keynoteList
.
map
(
x
=>
{
state
.
user
.
userInfo
.
ActionMenuList
&&
this
.
CourseEmphasis
.
push
(
x
.
Id
);
state
.
user
.
userInfo
.
ActionMenuList
.
length
>
0
)
{
let
action
=
state
.
user
.
userInfo
.
ActionMenuList
.
find
(
x
=>
{
if
(
x
.
FunctionCode
==
"Edit_CourseClassHours"
)
{
return
x
;
}
});
});
if
(
action
)
{
return
true
;
}
}
}
return
false
;
});
}
},
}),
//获取教师下拉
mounted
()
{
GetTeacherList
()
{
this
.
getCourseTimeList
();
getTeacherDropDownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
TeacherList
=
res
.
Data
;
}
});
},
//获取销售端口列表
getSaleplat
()
{
querySaleplatList
().
then
(
res
=>
{
this
.
SaleplatList
=
res
.
Data
;
});
},
//获取编辑器值
getEditValue
(
obj
)
{
this
.
objOption
.
CourseIntro
=
obj
;
},
},
methods
:
{
uploadFile
(
files
)
{
//获取关联考试等级
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
getLevel
()
{
if
(
res
.
Code
==
1
)
{
GetBankTypeList
({}).
then
(
res
=>
{
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
if
(
res
.
Code
==
1
)
{
}
this
.
LevelData
=
res
.
Data
;
});
},
uploadFile2
(
files
)
{
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
objOption
.
B2BIcon
=
res
.
FileUrl
;
this
.
ImgColor
();
}
});
},
ImgColor
()
{
//获取图标上传的主色
let
domImg
=
document
.
querySelector
(
"#background"
);
let
colorthief
=
new
ColorThief
();
domImg
.
addEventListener
(
"load"
,
()
=>
{
let
color
=
colorthief
.
getColor
(
domImg
,
2
);
this
.
objOption
.
B2BBackground
=
this
.
rgb2Hex
(
`RGB(
${
color
[
0
]}
,
${
color
[
1
]}
,
${
color
[
2
]}
)`
);
});
},
rgb2Hex
(
string
)
{
//rgb转化为16进制
var
reg
=
/^#
([
0-9a-fA-f
]{3}
|
[
0-9a-fA-f
]{6})
$/
;
if
(
/^
(
rgb|RGB
)
/
.
test
(
string
))
{
var
aColor
=
string
.
replace
(
/
(?:\(
|
\)
|rgb|RGB
)
*/g
,
""
).
split
(
","
);
var
strHex
=
"#"
;
for
(
var
i
=
0
;
i
<
aColor
.
length
;
i
++
)
{
var
hex
=
Number
(
aColor
[
i
]).
toString
(
16
);
if
(
hex
===
"0"
)
{
hex
+=
hex
;
}
}
})
strHex
+=
hex
;
},
//根据系列改变获取所属科目
changeCourseSubject
(
Id
)
{
if
(
Id
>
0
)
{
let
val
=
this
.
TreeCategoryList
.
find
(
x
=>
x
.
CateId
==
Id
);
this
.
objOption
.
CourseSubject
=
val
.
CourseSubject
;
}
}
},
if
(
strHex
.
length
!==
7
)
{
//获取课程等级列表
strHex
=
string
;
getCourseRateList
()
{
}
getCourseRate
({}).
then
(
res
=>
{
return
strHex
;
if
(
res
.
Code
==
1
)
{
}
else
if
(
reg
.
test
(
string
))
{
var
tempData
=
res
.
Data
;
var
aNum
=
string
.
replace
(
/#/
,
""
).
split
(
""
);
if
(
tempData
&&
tempData
.
length
>
0
)
{
if
(
aNum
.
length
===
6
)
{
tempData
.
forEach
(
item
=>
{
return
string
;
this
.
courseLevelList
.
push
({
}
else
if
(
aNum
.
length
===
3
)
{
Id
:
item
.
Id
,
var
numHex
=
"#"
;
Name
:
item
.
Name
.
replace
(
/课程/g
,
""
)
for
(
var
i
=
0
;
i
<
aNum
.
length
;
i
+=
1
)
{
});
numHex
+=
aNum
[
i
]
+
aNum
[
i
];
}
return
numHex
;
}
}
else
{
return
string
;
}
},
//获取课程系列
getCategorytree
()
{
this
.
TreeCategoryList
=
[];
var
qMsg
=
{};
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
this
.
TreeCategoryList
=
res
.
Data
;
});
},
//新增阶梯定价
addStepPrice
()
{
var
obj
=
{
ClassStepPriceId
:
0
,
PersionNum
:
2
,
PersionPrice
:
0
};
if
(
this
.
ladderPriceList
&&
this
.
ladderPriceList
.
length
>
0
)
{
var
_index
=
this
.
ladderPriceList
.
length
-
1
;
obj
.
PersionNum
=
parseInt
(
this
.
ladderPriceList
[
_index
].
PersionNum
)
+
1
;
}
this
.
ladderPriceList
.
push
(
obj
);
},
//删除阶梯定价
delStepPrice
(
index
)
{
this
.
ladderPriceList
.
splice
(
index
,
1
);
},
//初始化表单
initObj
()
{
this
.
defaultArray
=
[];
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
>
0
)
{
queryCourseInfo
({
CourseId
:
this
.
saveObj
.
CourseId
}).
then
(
res
=>
{
this
.
objOption
.
CourseId
=
res
.
Data
.
CourseId
;
this
.
objOption
.
CoverImg
=
res
.
Data
.
CoverImg
;
this
.
objOption
.
CourseName
=
res
.
Data
.
CourseName
;
this
.
objOption
.
CourseIntro
=
res
.
Data
.
CourseIntro
;
this
.
objOption
.
CateId
=
res
.
Data
.
CateId
;
this
.
objOption
.
School_Id
=
res
.
Data
.
School_Id
;
this
.
objOption
.
Teacher_Ids
=
res
.
Data
.
Teacher_Ids
;
this
.
objOption
.
CourseFeature
=
res
.
Data
.
CourseFeature
;
this
.
objOption
.
OriginalPrice
=
res
.
Data
.
OriginalPrice
;
this
.
objOption
.
SellPrice
=
res
.
Data
.
SellPrice
;
this
.
objOption
.
ClassHours
=
res
.
Data
.
ClassHours
;
this
.
objOption
.
IsOpenStepPrice
=
res
.
Data
.
IsOpenStepPrice
;
this
.
objOption
.
IsRenew
=
res
.
Data
.
IsRenew
;
this
.
objOption
.
RenewOgPrice
=
res
.
Data
.
RenewOgPrice
;
this
.
objOption
.
RenewSlPrice
=
res
.
Data
.
RenewSlPrice
;
this
.
objOption
.
Saleplat
=
res
.
Data
.
Saleplat
;
this
.
objOption
.
IsKCourse
=
res
.
Data
.
IsKCourse
;
this
.
objOption
.
CourseRate
=
res
.
Data
.
CourseRate
;
this
.
objOption
.
CourseSubject
=
res
.
Data
.
CourseSubject
;
this
.
objOption
.
B2BIcon
=
res
.
Data
.
B2BIcon
;
this
.
objOption
.
B2BBackground
=
res
.
Data
.
B2BBackground
;
this
.
objOption
.
ContractInfo
=
res
.
Data
.
ContractInfo
;
this
.
objOption
.
IsScrollClass
=
res
.
Data
.
IsScrollClass
;
this
.
objOption
.
ScrollMinNum
=
res
.
Data
.
ScrollMinNum
;
this
.
objOption
.
ScrollMaxNum
=
res
.
Data
.
ScrollMaxNum
;
this
.
objOption
.
FreeCoffeeNum
=
res
.
Data
.
FreeCoffeeNum
;
this
.
objOption
.
AddHoursMoney
=
res
.
Data
.
AddHoursMoney
;
this
.
objOption
.
CourseTimeId
=
res
.
Data
.
CourseTimeId
;
this
.
objOption
.
OpenBankLevelList
=
res
.
Data
.
OpenBankLevelList
;
this
.
objOption
.
ChineseHours
=
res
.
Data
.
ChineseHours
;
this
.
objOption
.
ForeignHours
=
res
.
Data
.
ForeignHours
;
this
.
objOption
.
SaleState
=
res
.
Data
.
SaleState
;
this
.
CourseEmphasis
=
[];
setTimeout
(()
=>
{
//Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if
(
res
.
Data
.
CourseEmphasis
&&
res
.
Data
.
CourseEmphasis
!=
""
)
{
this
.
CourseEmphasis
=
res
.
Data
.
CourseEmphasis
.
split
(
","
).
map
(
Number
);
}
else
{
this
.
keynoteList
.
map
(
x
=>
{
this
.
CourseEmphasis
.
push
(
x
.
Id
);
});
});
}
}
},
100
);
if
(
res
.
Data
.
StepPriceList
&&
res
.
Data
.
StepPriceList
.
length
>
0
)
{
this
.
ladderPriceList
=
res
.
Data
.
StepPriceList
;
}
}
});
if
(
res
.
Data
.
TeacherIdList
&&
res
.
Data
.
TeacherIdList
.
length
>
0
)
{
getCourseSubject
({}).
then
(
res
=>
{
this
.
chooseTeacher
=
res
.
Data
.
TeacherIdList
;
if
(
res
.
Code
==
1
)
{
this
.
courseSubjectList
=
res
.
Data
;
}
}
});
if
(
res
.
Data
.
SalePlatList
&&
res
.
Data
.
SalePlatList
.
length
>
0
)
{
},
this
.
choosePlat
=
res
.
Data
.
SalePlatList
;
getCourseEmphasisList
()
{
getCourseEmphasisEnumList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
keynoteList
=
res
.
Data
;
this
.
keynoteList
.
map
(
x
=>
{
this
.
CourseEmphasis
.
push
(
x
.
Id
);
});
}
}
});
if
(
res
.
Data
.
CategoryList
&&
res
.
Data
.
CategoryList
.
length
>
0
)
{
},
this
.
modifyClassifyList
=
res
.
Data
.
CategoryList
;
//获取教师下拉
this
.
chooseGoodsClassify
=
res
.
Data
.
CategoryList
.
map
(
e
=>
{
GetTeacherList
()
{
return
e
.
CategoryId
;
getTeacherDropDownList
({}).
then
(
res
=>
{
});
if
(
res
.
Code
==
1
)
{
this
.
TeacherList
=
res
.
Data
;
}
});
},
//获取销售端口列表
getSaleplat
()
{
querySaleplatList
().
then
(
res
=>
{
this
.
SaleplatList
=
res
.
Data
;
});
},
//获取编辑器值
getEditValue
(
obj
)
{
this
.
objOption
.
CourseIntro
=
obj
;
},
uploadFile
(
files
)
{
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
}
});
},
uploadFile2
(
files
)
{
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
objOption
.
B2BIcon
=
res
.
FileUrl
;
this
.
ImgColor
();
}
}
this
.
defaultArray
.
push
(
res
.
Data
.
CateId
);
this
.
handleCheckChange
();
});
});
},
this
.
optionTitle
=
"修改课程信息"
;
ImgColor
()
{
}
else
{
//获取图标上传的主色
this
.
optionTitle
=
"新增课程"
;
let
domImg
=
document
.
querySelector
(
"#background"
);
this
.
objOption
.
CourseId
=
0
;
let
colorthief
=
new
ColorThief
();
this
.
objOption
.
CoverImg
=
""
;
domImg
.
addEventListener
(
"load"
,
()
=>
{
this
.
objOption
.
CourseName
=
""
;
let
color
=
colorthief
.
getColor
(
domImg
,
2
);
this
.
objOption
.
CourseIntro
=
""
;
this
.
objOption
.
B2BBackground
=
this
.
rgb2Hex
(
this
.
objOption
.
CateId
=
0
;
`RGB(
${
color
[
0
]}
,
${
color
[
1
]}
,
${
color
[
2
]}
)`
this
.
objOption
.
School_Id
=
0
;
);
this
.
objOption
.
Teacher_Ids
=
""
;
});
this
.
objOption
.
CourseFeature
=
""
;
},
this
.
objOption
.
OriginalPrice
=
0
;
rgb2Hex
(
string
)
{
this
.
objOption
.
SellPrice
=
0
;
//rgb转化为16进制
this
.
objOption
.
ClassHours
=
0
;
var
reg
=
/^#
([
0-9a-fA-f
]{3}
|
[
0-9a-fA-f
]{6})
$/
;
this
.
objOption
.
IsOpenStepPrice
=
0
;
if
(
/^
(
rgb|RGB
)
/
.
test
(
string
))
{
this
.
objOption
.
IsRenew
=
0
;
var
aColor
=
string
.
replace
(
/
(?:\(
|
\)
|rgb|RGB
)
*/g
,
""
).
split
(
","
);
this
.
objOption
.
RenewOgPrice
=
0
;
var
strHex
=
"#"
;
this
.
objOption
.
RenewSlPrice
=
0
;
for
(
var
i
=
0
;
i
<
aColor
.
length
;
i
++
)
{
this
.
objOption
.
Saleplat
=
""
;
var
hex
=
Number
(
aColor
[
i
]).
toString
(
16
);
this
.
objOption
.
IsKCourse
=
0
;
if
(
hex
===
"0"
)
{
this
.
objOption
.
CourseRate
=
""
;
hex
+=
hex
;
this
.
objOption
.
ContractInfo
=
""
;
}
this
.
objOption
.
IsScrollClass
=
0
;
strHex
+=
hex
;
this
.
objOption
.
ScrollMinNum
=
0
;
}
this
.
objOption
.
ScrollMaxNum
=
0
;
if
(
strHex
.
length
!==
7
)
{
this
.
objOption
.
FreeCoffeeNum
=
0
;
strHex
=
string
;
this
.
objOption
.
AddHoursMoney
=
0
;
}
this
.
objOption
.
CourseTimeId
=
0
;
return
strHex
;
this
.
objOption
.
OpenBankLevelList
=
[];
}
else
if
(
reg
.
test
(
string
))
{
this
.
objOption
.
ChineseHours
=
""
;
var
aNum
=
string
.
replace
(
/#/
,
""
).
split
(
""
);
this
.
objOption
.
ForeignHours
=
""
;
if
(
aNum
.
length
===
6
)
{
}
return
string
;
},
}
else
if
(
aNum
.
length
===
3
)
{
//关闭弹窗
var
numHex
=
"#"
;
closeCourseForm
()
{
for
(
var
i
=
0
;
i
<
aNum
.
length
;
i
+=
1
)
{
this
.
$emit
(
"close"
);
numHex
+=
aNum
[
i
]
+
aNum
[
i
];
this
.
persistent
=
false
;
}
},
return
numHex
;
//保存菜单
}
saveCourse
()
{
}
else
{
this
.
$refs
.
CourseName
.
validate
();
return
string
;
//this.$refs.ClassHours.validate();
this
.
$refs
.
CateId
.
validate
();
this
.
$refs
.
FreeCoffeeNum
.
validate
();
this
.
$refs
.
AddHoursMoney
.
validate
();
//!this.$refs.ClassHours.hasError &&
if
(
!
this
.
$refs
.
CourseName
.
hasError
&&
!
this
.
$refs
.
CateId
.
hasError
&&
!
this
.
$refs
.
FreeCoffeeNum
.
hasError
&&
!
this
.
$refs
.
AddHoursMoney
.
hasError
)
{
this
.
saveCourseLoading
=
true
;
var
Teacher_Ids
=
""
;
if
(
this
.
chooseTeacher
&&
this
.
chooseTeacher
.
length
>
0
)
{
this
.
chooseTeacher
.
forEach
(
item
=>
{
Teacher_Ids
+=
","
+
item
;
});
}
}
},
if
(
Teacher_Ids
!=
""
)
{
//获取课程系列
Teacher_Ids
=
Teacher_Ids
.
substring
(
1
);
getCategorytree
()
{
this
.
TreeCategoryList
=
[];
var
qMsg
=
{};
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
this
.
TreeCategoryList
=
res
.
Data
;
});
},
//新增阶梯定价
addStepPrice
()
{
var
obj
=
{
ClassStepPriceId
:
0
,
PersionNum
:
2
,
PersionPrice
:
0
};
if
(
this
.
ladderPriceList
&&
this
.
ladderPriceList
.
length
>
0
)
{
var
_index
=
this
.
ladderPriceList
.
length
-
1
;
obj
.
PersionNum
=
parseInt
(
this
.
ladderPriceList
[
_index
].
PersionNum
)
+
1
;
}
}
this
.
ladderPriceList
.
push
(
obj
);
var
salePlat
=
""
;
},
if
(
this
.
choosePlat
&&
this
.
choosePlat
.
length
>
0
)
{
//删除阶梯定价
this
.
choosePlat
.
forEach
(
item
=>
{
delStepPrice
(
index
)
{
salePlat
+=
","
+
item
;
this
.
ladderPriceList
.
splice
(
index
,
1
);
},
//初始化表单
initObj
()
{
this
.
defaultArray
=
[];
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
>
0
)
{
queryCourseInfo
({
CourseId
:
this
.
saveObj
.
CourseId
}).
then
(
res
=>
{
this
.
objOption
.
CourseId
=
res
.
Data
.
CourseId
;
this
.
objOption
.
CoverImg
=
res
.
Data
.
CoverImg
;
this
.
objOption
.
CourseName
=
res
.
Data
.
CourseName
;
this
.
objOption
.
CourseIntro
=
res
.
Data
.
CourseIntro
;
this
.
objOption
.
CateId
=
res
.
Data
.
CateId
;
this
.
objOption
.
School_Id
=
res
.
Data
.
School_Id
;
this
.
objOption
.
Teacher_Ids
=
res
.
Data
.
Teacher_Ids
;
this
.
objOption
.
CourseFeature
=
res
.
Data
.
CourseFeature
;
this
.
objOption
.
OriginalPrice
=
res
.
Data
.
OriginalPrice
;
this
.
objOption
.
SellPrice
=
res
.
Data
.
SellPrice
;
this
.
objOption
.
ClassHours
=
res
.
Data
.
ClassHours
;
this
.
objOption
.
IsOpenStepPrice
=
res
.
Data
.
IsOpenStepPrice
;
this
.
objOption
.
IsRenew
=
res
.
Data
.
IsRenew
;
this
.
objOption
.
RenewOgPrice
=
res
.
Data
.
RenewOgPrice
;
this
.
objOption
.
RenewSlPrice
=
res
.
Data
.
RenewSlPrice
;
this
.
objOption
.
Saleplat
=
res
.
Data
.
Saleplat
;
this
.
objOption
.
IsKCourse
=
res
.
Data
.
IsKCourse
;
this
.
objOption
.
CourseRate
=
res
.
Data
.
CourseRate
;
this
.
objOption
.
CourseSubject
=
res
.
Data
.
CourseSubject
;
this
.
objOption
.
B2BIcon
=
res
.
Data
.
B2BIcon
;
this
.
objOption
.
B2BBackground
=
res
.
Data
.
B2BBackground
;
this
.
objOption
.
ContractInfo
=
res
.
Data
.
ContractInfo
;
this
.
objOption
.
IsScrollClass
=
res
.
Data
.
IsScrollClass
;
this
.
objOption
.
ScrollMinNum
=
res
.
Data
.
ScrollMinNum
;
this
.
objOption
.
ScrollMaxNum
=
res
.
Data
.
ScrollMaxNum
;
this
.
objOption
.
FreeCoffeeNum
=
res
.
Data
.
FreeCoffeeNum
;
this
.
objOption
.
AddHoursMoney
=
res
.
Data
.
AddHoursMoney
;
this
.
objOption
.
CourseTimeId
=
res
.
Data
.
CourseTimeId
;
this
.
objOption
.
OpenBankLevelList
=
res
.
Data
.
OpenBankLevelList
;
this
.
objOption
.
ChineseHours
=
res
.
Data
.
ChineseHours
;
this
.
objOption
.
ForeignHours
=
res
.
Data
.
ForeignHours
;
this
.
CourseEmphasis
=
[];
setTimeout
(()
=>
{
//Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if
(
res
.
Data
.
CourseEmphasis
&&
res
.
Data
.
CourseEmphasis
!=
""
)
{
this
.
CourseEmphasis
=
res
.
Data
.
CourseEmphasis
.
split
(
","
).
map
(
Number
);
}
else
{
this
.
keynoteList
.
map
(
x
=>
{
this
.
CourseEmphasis
.
push
(
x
.
Id
);
});
}
},
100
);
if
(
res
.
Data
.
StepPriceList
&&
res
.
Data
.
StepPriceList
.
length
>
0
)
{
this
.
ladderPriceList
=
res
.
Data
.
StepPriceList
;
}
if
(
res
.
Data
.
TeacherIdList
&&
res
.
Data
.
TeacherIdList
.
length
>
0
)
{
this
.
chooseTeacher
=
res
.
Data
.
TeacherIdList
;
}
if
(
res
.
Data
.
SalePlatList
&&
res
.
Data
.
SalePlatList
.
length
>
0
)
{
this
.
choosePlat
=
res
.
Data
.
SalePlatList
;
}
if
(
res
.
Data
.
CategoryList
&&
res
.
Data
.
CategoryList
.
length
>
0
)
{
this
.
modifyClassifyList
=
res
.
Data
.
CategoryList
;
this
.
chooseGoodsClassify
=
res
.
Data
.
CategoryList
.
map
(
e
=>
{
return
e
.
CategoryId
;
});
}
this
.
defaultArray
.
push
(
res
.
Data
.
CateId
);
this
.
handleCheckChange
();
});
});
this
.
optionTitle
=
"修改课程信息"
;
}
if
(
salePlat
!=
""
)
{
salePlat
=
salePlat
.
substring
(
1
);
}
this
.
objOption
.
StepPriceList
=
this
.
ladderPriceList
;
this
.
objOption
.
Teacher_Ids
=
Teacher_Ids
;
this
.
objOption
.
Saleplat
=
salePlat
;
if
(
this
.
CourseEmphasis
.
length
>
0
)
{
this
.
objOption
.
CourseEmphasis
=
this
.
CourseEmphasis
.
join
(
","
);
}
else
{
}
else
{
this
.
optionTitle
=
"新增课程"
;
this
.
objOption
.
CourseEmphasis
=
""
;
this
.
objOption
.
CourseId
=
0
;
this
.
objOption
.
CoverImg
=
""
;
this
.
objOption
.
CourseName
=
""
;
this
.
objOption
.
CourseIntro
=
""
;
this
.
objOption
.
CateId
=
0
;
this
.
objOption
.
School_Id
=
0
;
this
.
objOption
.
Teacher_Ids
=
""
;
this
.
objOption
.
CourseFeature
=
""
;
this
.
objOption
.
OriginalPrice
=
0
;
this
.
objOption
.
SellPrice
=
0
;
this
.
objOption
.
ClassHours
=
0
;
this
.
objOption
.
IsOpenStepPrice
=
0
;
this
.
objOption
.
IsRenew
=
0
;
this
.
objOption
.
RenewOgPrice
=
0
;
this
.
objOption
.
RenewSlPrice
=
0
;
this
.
objOption
.
Saleplat
=
""
;
this
.
objOption
.
IsKCourse
=
0
;
this
.
objOption
.
CourseRate
=
""
;
this
.
objOption
.
ContractInfo
=
""
;
this
.
objOption
.
IsScrollClass
=
0
;
this
.
objOption
.
ScrollMinNum
=
0
;
this
.
objOption
.
ScrollMaxNum
=
0
;
this
.
objOption
.
FreeCoffeeNum
=
0
;
this
.
objOption
.
AddHoursMoney
=
0
;
this
.
objOption
.
CourseTimeId
=
0
;
this
.
objOption
.
OpenBankLevelList
=
[];
this
.
objOption
.
ChineseHours
=
""
;
this
.
objOption
.
ForeignHours
=
""
;
}
}
},
saveCourseInfo
(
this
.
objOption
)
//关闭弹窗
.
then
(
res
=>
{
closeCourseForm
()
{
this
.
saveCourseLoading
=
false
;
this
.
$emit
(
"close"
);
this
.
$q
.
notify
({
this
.
persistent
=
false
;
icon
:
"iconfont icon-chenggong"
,
},
color
:
"accent"
,
//保存菜单
timeout
:
2000
,
saveCourse
()
{
message
:
"数据保存成功!"
,
this
.
$refs
.
CourseName
.
validate
();
position
:
"top"
//this.$refs.ClassHours.validate();
this
.
$refs
.
CateId
.
validate
();
this
.
$refs
.
FreeCoffeeNum
.
validate
();
this
.
$refs
.
AddHoursMoney
.
validate
();
//!this.$refs.ClassHours.hasError &&
if
(
!
this
.
$refs
.
CourseName
.
hasError
&&
!
this
.
$refs
.
CateId
.
hasError
&&
!
this
.
$refs
.
FreeCoffeeNum
.
hasError
&&
!
this
.
$refs
.
AddHoursMoney
.
hasError
)
{
this
.
saveCourseLoading
=
true
;
var
Teacher_Ids
=
""
;
if
(
this
.
chooseTeacher
&&
this
.
chooseTeacher
.
length
>
0
)
{
this
.
chooseTeacher
.
forEach
(
item
=>
{
Teacher_Ids
+=
","
+
item
;
});
}
if
(
Teacher_Ids
!=
""
)
{
Teacher_Ids
=
Teacher_Ids
.
substring
(
1
);
}
var
salePlat
=
""
;
if
(
this
.
choosePlat
&&
this
.
choosePlat
.
length
>
0
)
{
this
.
choosePlat
.
forEach
(
item
=>
{
salePlat
+=
","
+
item
;
});
}
if
(
salePlat
!=
""
)
{
salePlat
=
salePlat
.
substring
(
1
);
}
this
.
objOption
.
StepPriceList
=
this
.
ladderPriceList
;
this
.
objOption
.
Teacher_Ids
=
Teacher_Ids
;
this
.
objOption
.
Saleplat
=
salePlat
;
if
(
this
.
CourseEmphasis
.
length
>
0
)
{
this
.
objOption
.
CourseEmphasis
=
this
.
CourseEmphasis
.
join
(
","
);
}
else
{
this
.
objOption
.
CourseEmphasis
=
""
;
}
saveCourseInfo
(
this
.
objOption
)
.
then
(
res
=>
{
this
.
saveCourseLoading
=
false
;
this
.
$q
.
notify
({
icon
:
"iconfont icon-chenggong"
,
color
:
"accent"
,
timeout
:
2000
,
message
:
"数据保存成功!"
,
position
:
"top"
});
this
.
$emit
(
"success"
);
this
.
closeSaveForm
();
})
.
catch
(()
=>
{
this
.
saveCourseLoading
=
false
;
});
});
this
.
$emit
(
"success"
);
this
.
closeSaveForm
();
})
.
catch
(()
=>
{
this
.
saveCourseLoading
=
false
;
});
}
},
//获取商品分类
getGoodsClassify
()
{
let
msg1
=
{
Id
:
0
,
Name
:
""
,
Tier
:
0
,
ParentId
:
0
,
Enabled
:
1
,
IsShow
:
1
,
CategoryPageType
:
0
};
this
.
apipostDS
(
"/api/product/GetProductCategoryTreeList"
,
msg1
,
res
=>
{
if
(
res
.
data
.
resultCode
===
1
)
{
this
.
goodClassify
=
res
.
data
.
data
;
}
}
},
});
//获取商品分类
},
getGoodsClassify
()
{
//处理选中后的商品分类参数
let
msg1
=
{
handleCheckChange
()
{
Id
:
0
,
this
.
objOption
.
CategoryList
=
[];
Name
:
""
,
this
.
chooseGoodsClassify
.
forEach
(
list
=>
{
Tier
:
0
,
this
.
goodClassify
.
forEach
(
item
=>
{
ParentId
:
0
,
if
(
list
==
item
.
Id
)
{
Enabled
:
1
,
let
newItem
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
IsShow
:
1
,
newItem
.
CategoryId
=
item
.
Id
;
CategoryPageType
:
0
newItem
.
Id
=
0
;
};
//查找已提交的分类的id,否则为0
this
.
apipostDS
(
"/api/product/GetProductCategoryTreeList"
,
msg1
,
res
=>
{
let
findId
=
this
.
modifyClassifyList
.
find
(
if
(
res
.
data
.
resultCode
===
1
)
{
e
=>
e
.
CategoryId
===
newItem
.
CategoryId
this
.
goodClassify
=
res
.
data
.
data
;
);
if
(
findId
)
{
newItem
.
Id
=
findId
.
Id
;
}
this
.
objOption
.
CategoryList
.
push
(
newItem
);
}
}
});
item
.
ChildList
.
forEach
(
item2
=>
{
},
if
(
list
==
item2
.
Id
)
{
//处理选中后的商品分类参数
let
newItem2
=
JSON
.
parse
(
JSON
.
stringify
(
item2
));
handleCheckChange
()
{
newItem2
.
CategoryId
=
item2
.
Id
;
this
.
objOption
.
CategoryList
=
[];
newItem2
.
Id
=
0
;
this
.
chooseGoodsClassify
.
forEach
(
list
=>
{
let
findId2
=
this
.
modifyClassifyList
.
find
(
this
.
goodClassify
.
forEach
(
item
=>
{
e
=>
e
.
CategoryId
===
newItem2
.
CategoryId
if
(
list
==
item
.
Id
)
{
let
newItem
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
newItem
.
CategoryId
=
item
.
Id
;
newItem
.
Id
=
0
;
//查找已提交的分类的id,否则为0
let
findId
=
this
.
modifyClassifyList
.
find
(
e
=>
e
.
CategoryId
===
newItem
.
CategoryId
);
);
if
(
findId
)
{
if
(
findId
2
)
{
newItem
.
Id
=
findId
.
Id
;
newItem
2
.
Id
=
findId2
.
Id
;
}
}
this
.
objOption
.
CategoryList
.
push
(
newItem
);
this
.
objOption
.
CategoryList
.
push
(
newItem
2
);
}
}
item
.
ChildList
.
forEach
(
item2
=>
{
item
2
.
ChildList
.
forEach
(
item3
=>
{
if
(
list
==
item
2
.
Id
)
{
if
(
list
==
item
3
.
Id
)
{
let
newItem
2
=
JSON
.
parse
(
JSON
.
stringify
(
item2
));
let
newItem
3
=
JSON
.
parse
(
JSON
.
stringify
(
item3
));
newItem
2
.
CategoryId
=
item2
.
Id
;
newItem
3
.
CategoryId
=
item2
.
Id
;
newItem
2
.
Id
=
0
;
newItem
3
.
Id
=
0
;
let
findId
2
=
this
.
modifyClassifyList
.
find
(
let
findId
3
=
this
.
modifyClassifyList
.
find
(
e
=>
e
.
CategoryId
===
newItem
2
.
CategoryId
e
=>
e
.
CategoryId
===
newItem
3
.
CategoryId
);
);
if
(
findId
2
)
{
if
(
findId
3
)
{
newItem
2
.
Id
=
findId2
.
Id
;
newItem
3
.
Id
=
findId3
.
Id
;
}
}
this
.
objOption
.
CategoryList
.
push
(
newItem
2
);
this
.
objOption
.
CategoryList
.
push
(
newItem
3
);
}
}
item2
.
ChildList
.
forEach
(
item3
=>
{
if
(
list
==
item3
.
Id
)
{
let
newItem3
=
JSON
.
parse
(
JSON
.
stringify
(
item3
));
newItem3
.
CategoryId
=
item2
.
Id
;
newItem3
.
Id
=
0
;
let
findId3
=
this
.
modifyClassifyList
.
find
(
e
=>
e
.
CategoryId
===
newItem3
.
CategoryId
);
if
(
findId3
)
{
newItem3
.
Id
=
findId3
.
Id
;
}
this
.
objOption
.
CategoryList
.
push
(
newItem3
);
}
});
});
});
});
});
});
});
}
,
}
);
//关联上课时间段
},
getCourseTimeList
()
{
//关联上课时间段
getScrollCourseTimeList
({}).
then
(
res
=>
{
getCourseTimeList
()
{
if
(
res
.
Code
==
1
)
{
getScrollCourseTimeList
({}).
then
(
res
=>
{
this
.
CourseTimeList
=
res
.
Data
;
if
(
res
.
Code
==
1
)
{
}
this
.
CourseTimeList
=
res
.
Data
;
}
);
}
}
}
);
}
}
};
}
};
</
script
>
</
script
>
\ No newline at end of file
src/components/school/student/transfer-order.vue
View file @
4d71e35e
...
@@ -73,20 +73,21 @@
...
@@ -73,20 +73,21 @@
</q-step>
</q-step>
<q-step
:name=
"3"
title=
"确认"
icon=
"settings"
:done=
"step > 3"
>
<q-step
:name=
"3"
title=
"确认"
icon=
"settings"
:done=
"step > 3"
>
<orderForm
ref=
"orderForm"
:mode=
"mode"
:schoolList=
"schoolList"
:save-obj=
"saveObj"
:stuData=
"stuData"
<orderForm
ref=
"orderForm"
:mode=
"mode"
:schoolList=
"schoolList"
:save-obj=
"saveObj"
:stuData=
"stuData"
:modityOrderType=
"1"
:selectedCourseList=
"selectedCourseList"
@
success=
"$emit('close')"
@
cancelloading=
"cancelloading"
></orderForm>
:modityOrderType=
"1"
:selectedCourseList=
"selectedCourseList"
@
success=
"$emit('close')"
@
cancelloading=
"cancelloading"
></orderForm>
</q-step>
</q-step>
</q-stepper>
</q-stepper>
</q-card-section>
</q-card-section>
<q-card-actions
align=
"right"
class=
"bg-white q-mx-md "
>
<q-card-actions
align=
"right"
class=
"bg-white q-mx-md "
>
<q-btn
label=
"取消"
flat
color=
"grey-10"
style=
"font-weight:400 !important"
v-close-popup
/>
<q-btn
label=
"取消"
flat
color=
"grey-10"
style=
"font-weight:400 !important"
v-close-popup
/>
<q-btn
@
click=
"$refs.stepper.previous()"
color=
"primary"
label=
"上一步"
v-if=
"step > 1"
/>
<q-btn
@
click=
"$refs.stepper.previous()"
color=
"primary"
label=
"上一步"
v-if=
"step > 1"
/>
<
template
v-if=
"mode==3&&
step == 2"
>
<
template
v-if=
"mode == 3 &&
step == 2"
>
<q-btn
label=
"保存"
color=
"primary"
@
click=
"saveCourseForm"
/>
<q-btn
label=
"保存"
color=
"primary"
@
click=
"saveCourseForm"
/>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<q-btn
@
click=
"next"
color=
"primary"
label=
"下一步"
v-if=
"step
<
3
"
/>
<q-btn
@
click=
"next"
color=
"primary"
label=
"下一步"
v-if=
"step
<
3
"
/>
<q-btn
label=
"保存"
color=
"primary"
:loading=
"loading1"
@
click=
"saveOrderForm"
v-if=
"step == 3"
/>
<q-btn
label=
"保存"
color=
"primary"
:loading=
"loading1"
@
click=
"saveOrderForm"
v-if=
"step == 3"
/>
</
template
>
</
template
>
</q-card-actions>
</q-card-actions>
</q-card>
</q-card>
</q-dialog>
</q-dialog>
...
@@ -94,318 +95,318 @@
...
@@ -94,318 +95,318 @@
</template>
</template>
<
script
>
<
script
>
import
{
import
{
getClassPruductList
,
//获取日语培训列表
getClassPruductList
,
//获取日语培训列表
setClassOrder
,
//新增 修改订单
setClassOrder
,
//新增 修改订单
getOrderGuestRenewState
getOrderGuestRenewState
}
from
"../../../api/sale/sale"
;
}
from
"../../../api/sale/sale"
;
import
{
import
{
getSchoolDropdown
,
//获取校区列表
getSchoolDropdown
,
//获取校区列表
getTeacherDropDownList
getTeacherDropDownList
}
from
"../../../api/school/index"
;
}
from
"../../../api/school/index"
;
import
{
import
{
queryCourseDropdownList
,
queryCourseDropdownList
,
getCourseSubject
getCourseSubject
}
from
"../../../api/course/index"
;
}
from
"../../../api/course/index"
;
import
Mode
from
"./transfer-order/tickMode"
;
import
Mode
from
"./transfer-order/tickMode"
;
import
Course
from
"./transfer-order/courselist"
;
import
Course
from
"./transfer-order/courselist"
;
import
orderForm
from
"./transfer-order/order-form"
;
import
orderForm
from
"./transfer-order/order-form"
;
import
yueke
from
"./transfer-order/yueke"
;
import
yueke
from
"./transfer-order/yueke"
;
import
vipcourse
from
"./transfer-order/vipcourse"
;
import
vipcourse
from
"./transfer-order/vipcourse"
;
export
default
{
export
default
{
props
:
{
props
:
{
select
:
{
select
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
}
}
},
},
components
:
{
components
:
{
Course
,
Course
,
Mode
,
Mode
,
orderForm
,
orderForm
,
yueke
,
yueke
,
vipcourse
vipcourse
},
data
()
{
return
{
persistent
:
true
,
step
:
1
,
stuData
:
{},
//学生是否续费
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
//每人优惠金额
},
courseMsg
:
{
pageIndex
:
1
,
pageSize
:
8
,
ClassName
:
""
,
//班级名称
StartTime
:
""
,
//开始时间
EndTime
:
""
,
//结束时间
School_Id
:
""
,
//关联校区
CouseId
:
0
,
//课程id
Teacher_Id
:
0
,
//教师id
Q_CanApply
:
"0"
,
//是否可以报名 1是
JoinStartTime
:
""
,
//报名截止日期开始
JoinEndTime
:
""
,
//报名截止日期结束
ClassNo
:
""
,
//班号
CourseSubject
:
""
,
//所属科目
IsQuerySalePlat
:
1
},
courseData
:
[],
//课程列表
coursePageCount
:
0
,
//课程页数
saveObj
:
{},
//所选课程
defaultCourse
:
[],
//默认课程
//关联校区列表
schoolList
:
[],
ClassList
:
[],
//关联课程下拉数据
myClassList
:
[],
allClassList
:
[],
loading1
:
false
,
//防止多次点击
mode
:
1
,
selectedCourseList
:
[],
//多选课程
};
},
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
.
getCourseList
();
this
.
getSchool
();
this
.
CourseList
();
},
methods
:
{
getOrderGuestRenewState
()
{
const
ids
=
this
.
select
.
map
(
e
=>
e
.
StuId
).
toString
();
getOrderGuestRenewState
({
StuIds
:
ids
}).
then
(
res
=>
{
this
.
stuData
=
res
.
Data
;
});
},
},
data
()
{
//获取课程分页列表
return
{
getCourseList
()
{
persistent
:
true
,
getClassPruductList
(
this
.
courseMsg
).
then
(
res
=>
{
step
:
1
,
this
.
courseData
=
res
.
Data
.
PageData
;
stuData
:
{},
//学生是否续费
this
.
coursePageCount
=
res
.
Data
.
PageCount
;
OrderMsg
:
{
this
.
courseData
.
forEach
(
x
=>
{
ClassId
:
0
,
//班级编号
if
(
x
.
ClassStyle
==
1
)
{
GuestNum
:
0
,
//人数
let
weekList
=
[
B2CRatio
:
0
,
//定义一个数组
B2CReNewRatio
:
0
,
{
CustomerId
:
0
,
//市场专员
id
:
7
,
Unit_Price
:
0
,
select
:
false
PreferPrice
:
0
,
},
OrderSource
:
0
,
{
SaleRemark
:
""
,
id
:
1
,
Class_Price
:
0
,
//单价
select
:
false
OrderId
:
0
,
},
OrderType
:
0
,
//订单类型(1-班级课程订单,2-留学就业订单)
{
SourceId
:
0
,
//来源编号
id
:
2
,
HelpEnterId
:
0
,
//协助老师编号
select
:
false
GeneralOccupation
:
""
,
//一般同行
},
EduOccupation
:
""
,
//教育同行
{
IsLessPrice
:
0
,
//是否少价 0 不少 1 少
id
:
3
,
LessPrice
:
0
,
//少价金额
select
:
false
PerLessMoney
:
0
,
//每人少价金额
},
OrderNature
:
1
,
//订单性质
{
OldPreferPrice
:
0
,
//原实际应收
id
:
4
,
IsChaBan
:
0
,
//是否插班报入(1-是)
select
:
false
CourseId
:
""
,
//课程编号
},
StartClassHours
:
0
,
//已上课时
{
EffectTime
:
""
,
//生效时间
id
:
5
,
UpOrderId
:
0
,
//前置订单编号
select
:
false
JoinType
:
1
,
//订单报入类型
},
DiscountMoney
:
0
,
//优惠金额
{
PerDiscountMoney
:
0
//每人优惠金额
id
:
6
,
},
select
:
false
courseMsg
:
{
}
pageIndex
:
1
,
];
pageSize
:
8
,
weekList
.
forEach
(
j
=>
{
ClassName
:
""
,
//班级名称
x
.
ClassPlanList
.
forEach
(
z
=>
{
StartTime
:
""
,
//开始时间
if
(
j
.
id
==
z
.
WeekDay
)
{
EndTime
:
""
,
//结束时间
j
.
select
=
true
;
School_Id
:
""
,
//关联校区
}
CouseId
:
0
,
//课程id
});
Teacher_Id
:
0
,
//教师id
});
Q_CanApply
:
"0"
,
//是否可以报名 1是
x
.
weeks
=
weekList
;
JoinStartTime
:
""
,
//报名截止日期开始
}
else
if
(
x
.
ClassStyle
==
2
)
{
JoinEndTime
:
""
,
//报名截止日期结束
let
data
=
[];
ClassNo
:
""
,
//班号
for
(
let
i
=
0
;
i
<
31
;
i
++
)
{
CourseSubject
:
""
,
//所属科目
let
obj
=
{
IsQuerySalePlat
:
1
name
:
i
+
1
,
},
select
:
false
courseData
:
[],
//课程列表
};
coursePageCount
:
0
,
//课程页数
x
.
ClassPlanList
.
forEach
(
j
=>
{
saveObj
:
{},
//所选课程
if
(
j
.
WeekDay
==
i
+
1
)
{
defaultCourse
:
[],
//默认课程
obj
.
select
=
true
;
//关联校区列表
}
schoolList
:
[],
});
ClassList
:
[],
//关联课程下拉数据
data
.
push
(
obj
);
myClassList
:
[],
}
allClassList
:
[],
x
.
month
=
data
;
loading1
:
false
,
//防止多次点击
}
mode
:
1
,
});
selectedCourseList
:[],
//多选课程
});
};
},
},
mounted
()
{
// 课程翻页
let
nowDay
=
new
Date
();
changePage
(
val
)
{
var
year
=
nowDay
.
getFullYear
();
//年
this
.
courseMsg
.
pageIndex
=
val
;
var
month
=
nowDay
.
getMonth
()
+
1
;
//月
var
day
=
nowDay
.
getDate
();
//日
var
currentDay
=
year
+
"-"
+
month
+
"-"
+
day
;
this
.
courseMsg
.
StartTime
=
currentDay
;
this
.
getOrderGuestRenewState
();
this
.
getCourseList
();
this
.
getCourseList
();
this
.
getSchool
();
this
.
CourseList
();
},
},
methods
:
{
// 选择班级
getOrderGuestRenewState
()
{
selectClass
(
val
)
{
const
ids
=
this
.
select
.
map
(
e
=>
e
.
StuId
).
toString
();
this
.
selectedCourseList
=
[]
getOrderGuestRenewState
({
if
(
val
.
length
>
0
)
{
StuIds
:
ids
this
.
saveObj
=
val
[
0
];
}).
then
(
res
=>
{
this
.
saveObj
.
Unit_Price
=
this
.
saveObj
.
SellPrice
;
this
.
stuData
=
res
.
Data
;
this
.
defaultCourse
=
val
;
}
else
{
this
.
saveObj
=
{};
this
.
saveObj
.
Unit_Price
=
0
;
this
.
defaultCourse
=
[];
}
},
// 选择课程
selectCourse
(
val
)
{
this
.
selectedCourseList
=
[]
if
(
val
.
length
>
0
)
{
this
.
saveObj
=
val
[
0
];
this
.
saveObj
.
Unit_Price
=
this
.
saveObj
.
SellPrice
;
this
.
selectedCourseList
=
val
;
}
else
{
this
.
saveObj
=
{};
this
.
saveObj
.
Unit_Price
=
0
;
this
.
selectedCourseList
=
[];
}
},
next
()
{
if
(
this
.
step
==
1
&&
this
.
mode
<=
0
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
position
:
"top"
,
message
:
`请选择上课模式`
});
});
},
return
;
//获取课程分页列表
}
getCourseList
()
{
if
(
this
.
step
==
2
)
{
getClassPruductList
(
this
.
courseMsg
).
then
(
res
=>
{
if
(
this
.
courseData
=
res
.
Data
.
PageData
;
this
.
mode
==
1
&&
this
.
coursePageCount
=
res
.
Data
.
PageCount
;
(
!
this
.
saveObj
.
ClassId
||
this
.
saveObj
.
ClassId
==
0
)
this
.
courseData
.
forEach
(
x
=>
{
)
{
if
(
x
.
ClassStyle
==
1
)
{
this
.
$q
.
notify
({
let
weekList
=
[
type
:
"negative"
,
//定义一个数组
position
:
"top"
,
{
message
:
`请选择班级`
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
;
}
});
});
});
return
;
},
// 课程翻页
changePage
(
val
)
{
this
.
courseMsg
.
pageIndex
=
val
;
this
.
getCourseList
();
},
// 选择班级
selectClass
(
val
)
{
this
.
selectedCourseList
=
[]
if
(
val
.
length
>
0
)
{
this
.
saveObj
=
val
[
0
];
this
.
saveObj
.
Unit_Price
=
this
.
saveObj
.
SellPrice
;
this
.
defaultCourse
=
val
;
}
else
{
this
.
saveObj
=
{};
this
.
saveObj
.
Unit_Price
=
0
;
this
.
defaultCourse
=
[];
}
},
// 选择课程
selectCourse
(
val
)
{
this
.
selectedCourseList
=
[]
if
(
val
.
length
>
0
)
{
this
.
saveObj
=
val
[
0
];
this
.
saveObj
.
Unit_Price
=
this
.
saveObj
.
SellPrice
;
this
.
selectedCourseList
=
val
;
}
else
{
this
.
saveObj
=
{};
this
.
saveObj
.
Unit_Price
=
0
;
this
.
selectedCourseList
=
[];
}
}
},
if
(
next
()
{
this
.
mode
==
2
&&
if
(
this
.
step
==
1
&&
this
.
mode
<=
0
)
{
(
!
this
.
saveObj
.
ClassId
||
this
.
saveObj
.
ClassId
==
0
)
)
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
type
:
"negative"
,
type
:
"negative"
,
position
:
"top"
,
position
:
"top"
,
message
:
`请选择
上课模式
`
message
:
`请选择
课程
`
});
});
return
;
return
;
}
}
if
(
this
.
step
==
2
)
{
if
(
this
.
mode
==
1
&&
(
!
this
.
saveObj
.
ClassId
||
this
.
saveObj
.
ClassId
==
0
)
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
position
:
"top"
,
message
:
`请选择班级`
});
return
;
}
if
(
this
.
mode
==
2
&&
(
!
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
({
IsQuerySalePlat
:
1
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
ClassList
=
res
.
Data
;
this
.
ClassList
.
unshift
({
CourseId
:
0
,
CourseName
:
"不限"
});
this
.
myClassList
=
this
.
ClassList
;
this
.
allClassList
=
res
.
Data
;
}
});
},
//课程筛选
filterCourseFn
(
val
,
update
,
abort
)
{
update
(()
=>
{
if
(
val
===
""
)
{
this
.
myClassList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
allClassList
));
}
else
{
const
needle
=
val
.
toLowerCase
();
this
.
myClassList
=
this
.
allClassList
.
filter
(
v
=>
v
.
CourseName
.
toLowerCase
().
indexOf
(
needle
)
>
-
1
);
}
});
},
resetSearch
()
{
this
.
courseMsg
.
pageIndex
=
1
;
this
.
getCourseList
();
},
saveOrderForm
()
{
this
.
loading1
=
true
;
this
.
$refs
.
orderForm
.
saveOrderInfo
();
},
//保存课程
saveCourseForm
(){
this
.
$refs
.
vipCourse
.
saveVipCourse
();
},
cancelloading
()
{
this
.
loading1
=
false
;
}
}
this
.
$refs
.
stepper
.
next
();
},
//获取校区列表
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
schoolList
=
res
.
Data
;
}
});
},
//获取课程
CourseList
()
{
queryCourseDropdownList
({
IsQuerySalePlat
:
1
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
ClassList
=
res
.
Data
;
this
.
ClassList
.
unshift
({
CourseId
:
0
,
CourseName
:
"不限"
});
this
.
myClassList
=
this
.
ClassList
;
this
.
allClassList
=
res
.
Data
;
}
});
},
//课程筛选
filterCourseFn
(
val
,
update
,
abort
)
{
update
(()
=>
{
if
(
val
===
""
)
{
this
.
myClassList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
allClassList
));
}
else
{
const
needle
=
val
.
toLowerCase
();
this
.
myClassList
=
this
.
allClassList
.
filter
(
v
=>
v
.
CourseName
.
toLowerCase
().
indexOf
(
needle
)
>
-
1
);
}
});
},
resetSearch
()
{
this
.
courseMsg
.
pageIndex
=
1
;
this
.
getCourseList
();
},
saveOrderForm
()
{
this
.
loading1
=
true
;
this
.
$refs
.
orderForm
.
saveOrderInfo
();
},
//保存课程
saveCourseForm
()
{
this
.
$refs
.
vipCourse
.
saveVipCourse
();
},
cancelloading
()
{
this
.
loading1
=
false
;
}
}
};
}
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
/
deep
/
.el-input__inner
{
/
deep
/
.el-input__inner
{
background-color
:
transparent
;
background-color
:
transparent
;
border
:
none
;
border
:
none
;
}
}
/
deep
/
.q-stepper__step-inner
{
/
deep
/
.q-stepper__step-inner
{
padding
:
0
24px
;
padding
:
0
24px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
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