Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
7edf6ee5
Commit
7edf6ee5
authored
Sep 11, 2019
by
chenjundi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增赠品配置、赠品领取记录、合同协议管理,修改商品列表、系统订单列表
parent
e2e8dbdd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2433 additions
and
1167 deletions
+2433
-1167
dialog.vue
src/components/contract/dialog.vue
+151
-0
editorDetail.vue
src/components/contract/editorDetail.vue
+220
-0
index.vue
src/components/contract/index.vue
+144
-0
dialog.vue
src/components/gitConfig/dialog.vue
+145
-0
index.vue
src/components/gitConfig/index.vue
+162
-0
index.vue
src/components/gitDeliverRecord/index.vue
+147
-0
dialog.vue
src/components/shop/dialog.vue
+572
-541
giftDeliverDialog.vue
src/components/teacherDetail/giftDeliverDialog.vue
+110
-0
index.vue
src/components/teacherDetail/index.vue
+696
-621
api.js
src/service/api.js
+55
-4
menuList.js
src/util/menuList.js
+31
-1
No files found.
src/components/contract/dialog.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<el-dialog
:title=
"dialogObj.title"
:visible
.
sync=
"dialogObj.show"
center
width=
"800px"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<el-form-item
label=
"合同协议名称"
prop=
"contract_name"
label-width=
"120px"
>
<el-input
v-model=
"form.contract_name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"类型"
prop=
"contract_type"
label-width=
"120px"
>
<el-select
v-model=
"form.contract_type"
placeholder=
"请选择"
clearable
>
<el-option
label=
"用户协议"
value=
"0"
></el-option>
<el-option
label=
"正式课合同"
value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"关联商品"
label-width=
"120px"
>
<el-select
multiple
v-model=
"form.goods_ids"
placeholder=
"请选择"
clearable
:popper-class=
"'refresh-select-multi width-480'"
style=
"width: 480px"
>
<el-option
v-for=
"data in goodslist"
:key=
"data.id"
:label=
"`【$
{data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"合同/协议文本"
prop=
""
label-width=
"120px"
required
>
<!--
<el-input
type=
"textarea"
:rows=
"10"
v-model=
"form.contract_text"
></el-input>
-->
<editor-detail
:lookData=
"form.contract_text"
/>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"sub"
>
保 存
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
import
{
contractGoodslistApi
,
contractAddApi
,
contractEditApi
}
from
"../../service/api"
;
import
editorDetail
from
"./editorDetail"
;
export
default
{
name
:
"dialogObj"
,
props
:
[
'dialogObj'
],
components
:
{
editorDetail
},
data
()
{
return
{
form
:
{
contract_name
:
''
,
contract_type
:
''
,
goods_ids
:
[],
contract_text
:
{
detail
:
""
}
},
goodslist
:
[],
rules
:
{
contract_name
:
[
{
required
:
true
,
message
:
'请输入赠品名称'
},
{
max
:
20
,
message
:
'合同协议名称不能超过20汉字'
}
],
contract_type
:
[
{
required
:
true
,
message
:
'请选择类型'
,
trigger
:
'change'
}
]
}
}
},
methods
:
{
sub
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
!
this
.
form
.
contract_text
.
detail
)
{
this
.
$message
({
message
:
'合同/协议文本不能为空'
,
type
:
'error'
});
return
;
}
let
json
=
{
contract_name
:
this
.
form
.
contract_name
,
contract_type
:
this
.
form
.
contract_type
,
goods_ids
:
this
.
form
.
goods_ids
.
join
(
','
),
contract_text
:
this
.
form
.
contract_text
.
detail
};
switch
(
this
.
dialogObj
.
type
)
{
case
0
:
contractAddApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
case
1
:
contractEditApi
(
this
.
dialogObj
.
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
}
}
else
{
return
false
;
}
});
}
},
created
()
{
contractGoodslistApi
().
then
(
res
=>
{
this
.
goodslist
=
res
.
goods_list
;
});
},
watch
:
{
'dialogObj.show'
()
{
this
.
$nextTick
(()
=>
{
this
.
form
.
goods_ids
=
[];
this
.
form
.
contract_text
.
detail
=
''
;
this
.
$refs
[
'form'
].
resetFields
();
if
(
this
.
dialogObj
.
type
==
1
)
{
let
goods_ids_arr
=
[];
if
(
this
.
dialogObj
.
goods_ids
)
{
this
.
dialogObj
.
goods_ids
.
split
(
','
).
map
(
i
=>
{
goods_ids_arr
.
push
(
Number
(
i
));
});
}
this
.
form
.
name
=
this
.
dialogObj
.
name
;
this
.
form
.
contract_name
=
this
.
dialogObj
.
contract_name
;
this
.
form
.
contract_type
=
this
.
dialogObj
.
contract_type
.
toString
();
this
.
form
.
goods_ids
=
goods_ids_arr
;
this
.
form
.
contract_text
.
detail
=
this
.
dialogObj
.
contract_text
;
}
});
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/contract/editorDetail.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<div
class=
'tinymce'
>
<editor
id=
'tinymce'
v-model=
'lookData.detail'
:init=
'init'
></editor>
<div>
<div
class=
"imgInter"
@
click=
"showDialog()"
>
插入图片
</div>
</div>
<el-dialog
title=
"插入图片"
:visible
.
sync=
"dialogVisible"
:modal-append-to-body=
"false"
:close-on-click-modal=
"false"
center
:append-to-body=
"true"
width=
"550px"
>
<el-form
label-width=
"80px"
>
<el-form-item
label=
"图片"
>
<el-upload
action=
"/api/public/upload"
:http-request=
"uploadFile"
:on-remove=
"removeFile"
:before-upload=
"beforeAvatarUploadImg"
drag
:on-exceed=
"handleExceed"
multiple
:limit=
"1"
:file-list=
"form.imgList"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传png或jpg文件
</div>
</el-upload>
</el-form-item>
<el-form-item
label=
"铺满"
>
<el-switch
v-model=
"form.big"
>
</el-switch>
</el-form-item>
<el-form-item
label=
"居中"
>
<el-switch
v-model=
"form.center"
>
</el-switch>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"imgInter"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
tinymce
from
'tinymce/tinymce'
import
'tinymce/themes/modern/theme'
import
Editor
from
'@tinymce/tinymce-vue'
import
'tinymce/plugins/link'
import
'tinymce/plugins/code'
import
'tinymce/plugins/table'
import
'tinymce/plugins/lists'
import
'tinymce/plugins/contextmenu'
import
'tinymce/plugins/wordcount'
import
'tinymce/plugins/textcolor'
import
'tinymce/plugins/colorpicker'
import
'tinymce/plugins/preview'
import
'tinymce/plugins/fullpage'
import
'tinymce/plugins/textpattern'
import
'tinymce/plugins/colorpicker'
import
'tinymce/plugins/media'
import
{
uploadFileApi
}
from
"../../service/api"
;
export
default
{
name
:
'tinymce'
,
props
:[
'lookData'
],
data
()
{
return
{
radio
:[],
imageType
:
false
,
form
:{
imgList
:[],
big
:
false
,
weight
:
''
,
center
:
true
},
show
:
''
,
dialogVisible
:
false
,
init
:
{
toolbar
:
'bold italic underline strikethrough | fontselect | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | '
,
language_url
:
'/static/tinymce/zh_CN.js'
,
language
:
'zh_CN'
,
skin_url
:
'/static/tinymce/skins/lightgray'
,
height
:
500
,
plugins
:
'preview textpattern colorpicker lists code colorpicker fullpage textcolor wordcount contextmenu media'
,
branding
:
false
,
}
}
},
activated
(){
this
.
show
=
true
},
deactivated
(){
},
mounted
()
{
},
methods
:{
beforeAvatarUploadImg
(
file
){
const
isJPG
=
(
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
);
if
(
!
isJPG
)
{
this
.
$message
.
error
(
'上传头像图片只能是 JPG 或 PNG 格式!'
);
}
return
isJPG
;
},
imgInter
(){
if
(
this
.
form
.
imgList
.
length
<
1
){
this
.
$message
({
type
:
'error'
,
message
:
'请选择图片'
});
return
false
}
let
ImageStyle
=
''
;
if
(
this
.
form
.
big
){
ImageStyle
+=
'width:100%;'
}
else
{
ImageStyle
+=
'width:70%'
}
if
(
this
.
form
.
center
){
ImageStyle
=
'display:block;margin:auto'
}
let
str
=
`<img src="
${
this
.
form
.
imgList
[
0
].
url
}
" style="
${
ImageStyle
}
"/>`
;
tinymce
.
activeEditor
.
insertContent
(
str
);
this
.
dialogVisible
=
false
},
uploadFile
(
a
){
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'上传成功!'
});
this
.
form
.
imgList
=
[{
name
:
res
.
name
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
}];
})
},
showDialog
(){
this
.
dialogVisible
=
true
;
this
.
form
=
{
imgList
:[],
big
:
false
,
weight
:
''
,
center
:
true
}
},
insertContent
(
content
)
{
if
(
!
content
)
{
//如果插入的内容为空则返回
return
;
}
let
sel
=
null
;
if
(
document
.
selection
)
{
//IE9以下
sel
=
document
.
selection
;
sel
.
createRange
().
pasteHTML
(
content
);
}
else
{
sel
=
document
.
getElementById
(
'tinymce_ifr'
).
contentWindow
.
getSelection
();
if
(
sel
.
rangeCount
>
0
)
{
let
range
=
sel
.
getRangeAt
(
0
);
//获取选择范围
range
.
deleteContents
();
//删除选中的内容
let
el
=
document
.
createElement
(
"div"
);
//创建一个空的div外壳
el
.
innerHTML
=
content
;
//设置div内容为我们想要插入的内容。
let
frag
=
document
.
createDocumentFragment
();
//创建一个空白的文档片段,便于之后插入dom树
let
node
=
el
.
firstChild
;
let
lastNode
=
frag
.
appendChild
(
node
);
range
.
insertNode
(
frag
);
//设置选择范围的内容为插入的内容
let
contentRange
=
range
.
cloneRange
();
//克隆选区
contentRange
.
setStartAfter
(
lastNode
);
//设置光标位置为插入内容的末尾
contentRange
.
collapse
(
true
);
//移动光标位置到末尾
sel
.
removeAllRanges
();
//移出所有选区
sel
.
addRange
(
contentRange
);
//添加修改后的选区
}
}
},
removeFile
(){},
handleExceed
(){}
},
created
:
function
(){
tinymce
.
init
({})
},
components
:
{
Editor
}
}
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
.tinymce{
position: relative;
.clear-both;
.imgInter{
position: absolute;
display: inline-block;
text-shadow: 0 1px 1px rgba(255,255,255,0.75);
top: 3px;
left: 330px;
box-shadow: none;
filter: none;
padding: 4px 6px;
border: 1px solid transparent;
line-height: 1.4;
margin: 0 5px;
&:hover{
border-color: #e2e4e7;
cursor: pointer;
}
}
}
</
style
>
src/components/contract/index.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<div
class=
"container"
>
<div
class=
"search-form"
>
<el-button
type=
"success"
size=
"small"
plain
icon=
"el-icon-plus"
@
click=
"add"
>
新增
</el-button>
</div>
<div
class=
"table-form"
>
<el-table
:data=
"dataList"
size=
"mini"
style=
"width: 100%"
>
<el-table-column
prop=
"contract_number"
label=
"合同协议编号"
></el-table-column>
<el-table-column
prop=
"contract_name"
label=
"合同协议名称"
></el-table-column>
<el-table-column
prop=
"contract_type"
label=
"类型"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.contract_type == 0"
>
用户协议
</div>
<div
v-if=
"scope.row.contract_type == 1"
>
正式课合同
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"goods_name"
label=
"关联商品"
></el-table-column>
<el-table-column
prop=
"created_at"
label=
"创建时间"
></el-table-column>
<el-table-column
prop=
"updated_at"
label=
"最后编辑时间"
></el-table-column>
<el-table-column
prop=
"operator"
label=
"最后编辑人"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.status == 0"
>
启用
</div>
<div
v-if=
"scope.row.status == 1"
>
停用
</div>
</
template
>
</el-table-column>
<el-table-column
width=
"150"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
plain
@
click=
"edit(scope.row)"
>
编辑
</el-button>
<el-button
v-if=
"scope.row.status == 0"
type=
"warning"
size=
"mini"
plain
@
click=
"switchStatus(scope.row)"
>
停用
</el-button>
<el-button
v-if=
"scope.row.status == 1"
type=
"success"
size=
"mini"
plain
@
click=
"switchStatus(scope.row)"
>
启用
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<dialog-com
:dialogObj=
"dialogObj"
@
reflash=
"getDataList"
/>
</div>
</template>
<
script
>
import
{
contractListApi
,
contractSwitchstatusApi
}
from
"../../service/api"
;
import
dialogCom
from
'./dialog'
;
export
default
{
name
:
"index"
,
data
()
{
return
{
dataList
:
[],
dialogObj
:
{
type
:
0
,
show
:
false
,
id
:
''
,
title
:
''
}
}
},
components
:
{
dialogCom
},
methods
:
{
getDataList
()
{
contractListApi
().
then
(
res
=>
{
this
.
dataList
=
res
;
});
},
add
()
{
this
.
dialogObj
=
{
type
:
0
,
show
:
true
,
id
:
''
,
title
:
'新增合同协议'
}
},
edit
(
data
)
{
this
.
dialogObj
=
{
type
:
1
,
show
:
true
,
id
:
data
.
id
,
title
:
'编辑合同协议'
,
contract_name
:
data
.
contract_name
,
contract_type
:
data
.
contract_type
,
goods_ids
:
data
.
goods_ids
,
contract_text
:
data
.
contract_text
}
},
switchStatus
(
data
)
{
let
json
=
{
status
:
data
.
status
};
if
(
data
.
status
==
0
)
{
json
.
status
=
1
;
}
if
(
data
.
status
==
1
)
{
json
.
status
=
0
;
}
contractSwitchstatusApi
(
data
.
id
,
json
).
then
(
res
=>
{
if
(
json
.
status
==
0
)
{
this
.
$confirm
(
'此操作将启用合同?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'启用成功'
});
this
.
getDataList
();
}).
catch
(()
=>
{});
}
if
(
json
.
status
==
1
)
{
this
.
$confirm
(
'此操作将停用合同?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'停用成功'
});
this
.
getDataList
();
}).
catch
(()
=>
{});
}
});
},
},
created
()
{
this
.
getDataList
();
}
}
</
script
>
<
style
scoped
>
.container
{
padding
:
20px
;
}
.search-form
{
margin-bottom
:
20px
;
}
</
style
>
src/components/gitConfig/dialog.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<el-dialog
:title=
"dialogObj.title"
:visible
.
sync=
"dialogObj.show"
center
width=
"500px"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<el-form-item
label=
"赠品名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
<el-form-item
label=
"成本价格"
prop=
"cost_price"
>
<el-input
v-model
.
number=
"form.cost_price"
></el-input>
</el-form-item>
<el-form-item
label=
"赠品总数"
prop=
"gift_num"
>
<el-input
v-model
.
number=
"form.gift_num"
@
change=
"giftNumChange"
></el-input>
</el-form-item>
<el-form-item
label=
"库存数量"
prop=
"stock_num"
>
<div>
{{
form
.
stock_num
}}
</div>
</el-form-item>
<el-form-item
label=
"赠品类型"
prop=
"type"
>
<el-select
v-model=
"form.type"
placeholder=
"请选择"
clearable
>
<el-option
label=
"渠道赠品(市场渠道或投放需求关联的赠品)"
value=
"1"
></el-option>
<el-option
label=
"活动赠品(全勤打卡或其他运营活动关联的赠品)"
value=
"2"
></el-option>
<el-option
label=
"关联赠品(销售为了关单而赠送的赠品)"
value=
"3"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"sub"
>
保 存
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
import
{
giftConfigAddApi
,
giftConfigEditApi
}
from
"../../service/api"
;
export
default
{
name
:
"dialogObj"
,
props
:
[
'dialogObj'
],
data
()
{
const
validGiftNum
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
/^
[\d\/]
+$/
.
test
(
value
))
{
callback
(
new
Error
(
'只能填阿拉伯数字'
));
}
else
{
callback
();
}
};
return
{
form
:
{
name
:
''
,
cost_price
:
''
,
gift_num
:
'/'
,
stock_num
:
0
,
type
:
''
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入赠品名称'
},
{
max
:
20
,
message
:
'赠品名称不能超过20汉字'
}
],
cost_price
:
[
{
required
:
true
,
message
:
'请输入成本价格'
},
{
type
:
'number'
,
message
:
'只能填阿拉伯数字'
}
],
gift_num
:
[
{
required
:
true
,
message
:
'请输入赠品总数'
},
{
validator
:
validGiftNum
}
],
type
:
[
{
required
:
true
,
message
:
'请选择赠品类型'
,
trigger
:
'change'
}
]
}
}
},
methods
:
{
giftNumChange
()
{
if
(
!
this
.
form
.
gift_num
)
{
this
.
form
.
gift_num
=
'/'
;
}
},
sub
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
json
=
{
name
:
this
.
form
.
name
,
cost_price
:
this
.
form
.
cost_price
,
type
:
this
.
form
.
type
};
if
(
this
.
form
.
gift_num
!=
'/'
)
{
json
.
gift_num
=
this
.
form
.
gift_num
;
}
switch
(
this
.
dialogObj
.
type
)
{
case
0
:
giftConfigAddApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
case
1
:
giftConfigEditApi
(
this
.
dialogObj
.
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
}
}
else
{
return
false
;
}
});
}
},
watch
:
{
'dialogObj.show'
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'form'
].
resetFields
();
if
(
this
.
dialogObj
.
type
==
1
)
{
this
.
form
.
name
=
this
.
dialogObj
.
name
;
this
.
form
.
cost_price
=
this
.
dialogObj
.
cost_price
;
this
.
form
.
gift_num
=
this
.
dialogObj
.
gift_num
;
this
.
form
.
stock_num
=
this
.
dialogObj
.
stock_num
;
this
.
form
.
type
=
this
.
dialogObj
.
gift_type
.
toString
();
}
});
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/gitConfig/index.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<div
class=
"container"
>
<div
class=
"search-form"
>
<el-form
:inline=
"true"
:model=
"searchFrom"
size=
"small"
>
<el-form-item
label=
"赠品名称"
label-width=
"100px"
>
<el-input
v-model=
"searchFrom.name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"类型"
label-width=
"100px"
>
<el-select
v-model=
"searchFrom.type"
placeholder=
"请选择"
clearable
>
<el-option
label=
"渠道赠品"
value=
"1"
></el-option>
<el-option
label=
"活动赠品"
value=
"2"
></el-option>
<el-option
label=
"关联赠品"
value=
"3"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
plain
@
click=
"getDataList"
>
搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
plain
icon=
"el-icon-plus"
@
click=
"add"
>
新增
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"table-form"
>
<el-table
:data=
"dataList"
size=
"mini"
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"ID"
></el-table-column>
<el-table-column
prop=
"name"
label=
"赠品名称"
></el-table-column>
<el-table-column
prop=
"gift_type"
label=
"赠品类型"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.gift_type == 1"
>
渠道赠品
</div>
<div
v-if=
"scope.row.gift_type == 2"
>
活动赠品
</div>
<div
v-if=
"scope.row.gift_type == 3"
>
关联赠品
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"cost_price"
label=
"成本价"
></el-table-column>
<el-table-column
prop=
"gift_num"
label=
"赠品总数"
></el-table-column>
<el-table-column
prop=
"stock_num"
label=
"库存数量"
></el-table-column>
<el-table-column
prop=
"get_num"
label=
"领取数量"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.status == 1"
>
上架
</div>
<div
v-if=
"scope.row.status == 2"
>
下架
</div>
</
template
>
</el-table-column>
<el-table-column
width=
"150"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
plain
@
click=
"edit(scope.row)"
>
编辑
</el-button>
<el-button
type=
"warning"
size=
"mini"
plain
@
click=
"onDown(scope.row)"
>
下架
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"pagination"
>
<page
:nowPage=
"nowPage"
:total=
"total"
:limit=
"limit"
@
pageChange=
"onPageChange"
@
sizeChange=
"onSizeChange"
/>
</div>
<dialog-com
:dialogObj=
"dialogObj"
@
reflash=
"getDataList"
/>
</div>
</template>
<
script
>
import
page
from
"../framework/page"
;
import
{
relationGiftApi
,
giftSoldoutApi
}
from
"../../service/api"
;
import
dialogCom
from
'./dialog'
;
export
default
{
name
:
"index"
,
components
:
{
page
,
dialogCom
},
data
()
{
return
{
searchFrom
:
{
name
:
''
,
type
:
''
},
dataList
:
[],
nowPage
:
1
,
total
:
0
,
limit
:
10
,
dialogObj
:
{
type
:
0
,
show
:
false
,
id
:
''
,
title
:
''
}
}
},
methods
:
{
getDataList
()
{
let
json
=
{
name
:
this
.
searchFrom
.
name
,
type
:
this
.
searchFrom
.
type
,
limit
:
this
.
limit
,
page
:
this
.
nowPage
};
relationGiftApi
(
json
).
then
(
res
=>
{
this
.
dataList
=
res
.
list
;
this
.
total
=
res
.
total
;
});
},
add
()
{
this
.
dialogObj
=
{
type
:
0
,
show
:
true
,
id
:
''
,
title
:
'新增赠品'
}
},
edit
(
data
)
{
this
.
dialogObj
=
{
type
:
1
,
show
:
true
,
id
:
data
.
id
,
title
:
'编辑赠品'
,
name
:
data
.
name
,
cost_price
:
data
.
cost_price
,
gift_num
:
data
.
gift_num
,
stock_num
:
data
.
stock_num
,
gift_type
:
data
.
gift_type
};
},
onDown
(
data
)
{
this
.
$confirm
(
'此操作将下架该商品?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
giftSoldoutApi
(
data
.
id
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
});
this
.
getDataList
();
});
}).
catch
(()
=>
{
});
},
changeShow
(
data
)
{
this
.
dialogObj
.
show
=
data
;
},
onPageChange
(
val
)
{
this
.
nowPage
=
val
;
this
.
getDataList
();
},
onSizeChange
(
val
)
{
this
.
limit
=
val
;
this
.
nowPage
=
1
;
this
.
getDataList
();
}
},
created
()
{
this
.
getDataList
();
}
}
</
script
>
<
style
scoped
>
.container
{
padding
:
20px
;
}
</
style
>
src/components/gitDeliverRecord/index.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<div
class=
"container"
>
<div
class=
"search-form"
>
<el-form
:inline=
"true"
:model=
"searchFrom"
size=
"small"
>
<el-form-item
label=
"赠品名称"
label-width=
"100px"
>
<el-input
v-model=
"searchFrom.gift_name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"类型"
label-width=
"100px"
>
<el-select
v-model=
"searchFrom.gift_type"
placeholder=
"请选择"
clearable
>
<el-option
label=
"渠道赠品"
value=
"1"
></el-option>
<el-option
label=
"活动赠品"
value=
"2"
></el-option>
<el-option
label=
"关联赠品"
value=
"3"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"期数名称"
label-width=
"100px"
>
<el-input
v-model=
"searchFrom.periods_title"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"班级名称"
label-width=
"100px"
>
<el-input
v-model=
"searchFrom.class_name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"学员电话"
label-width=
"100px"
>
<el-input
v-model=
"searchFrom.mobile"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"领取时间"
label-width=
"100px"
>
<el-date-picker
v-model=
"searchFrom.receiveTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
plain
@
click=
"getRecordList"
>
搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button
type=
"success"
plain
@
click=
"exportTable"
>
导出
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"table-form"
>
<el-table
:data=
"recordList"
size=
"mini"
style=
"width: 100%"
>
<el-table-column
prop=
"gift_name"
label=
"赠品名称"
></el-table-column>
<el-table-column
prop=
"gift_type"
label=
"赠品类型"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.gift_type == 1"
>
渠道赠品
</div>
<div
v-if=
"scope.row.gift_type == 2"
>
活动赠品
</div>
<div
v-if=
"scope.row.gift_type == 3"
>
关联赠品
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"quantity"
label=
"数量"
></el-table-column>
<el-table-column
prop=
"cost"
label=
"成本"
></el-table-column>
<el-table-column
prop=
"periods_title"
label=
"期数名称"
></el-table-column>
<el-table-column
prop=
"class_name"
label=
"班级名称"
></el-table-column>
<el-table-column
prop=
"money"
label=
"实付金额"
></el-table-column>
<el-table-column
prop=
"teacher_name"
label=
"带班老师"
></el-table-column>
<el-table-column
prop=
"nickname"
label=
"学员名称"
></el-table-column>
<el-table-column
prop=
"mobile"
label=
"学员电话"
></el-table-column>
<el-table-column
prop=
"address"
label=
"学员地址"
></el-table-column>
<el-table-column
prop=
"created_at"
label=
"领取时间"
></el-table-column>
<el-table-column
prop=
"deliver_at"
label=
"物流导入时间"
></el-table-column>
<el-table-column
prop=
"express_no"
label=
"快递单号"
></el-table-column>
</el-table>
</div>
<div
class=
"pagination"
>
<page
:nowPage=
"nowPage"
:total=
"total"
:limit=
"limit"
@
pageChange=
"onPageChange"
@
sizeChange=
"onSizeChange"
/>
</div>
</div>
</template>
<
script
>
import
page
from
"../framework/page"
;
import
{
receiveRecordApi
,
exportExcelApi
}
from
"../../service/api"
;
export
default
{
name
:
"index"
,
components
:
{
page
},
data
()
{
return
{
searchFrom
:
{
gift_name
:
''
,
gift_type
:
''
,
periods_title
:
''
,
class_name
:
''
,
mobile
:
''
,
receiveTime
:
[]
},
recordList
:
[],
nowPage
:
1
,
total
:
0
,
limit
:
10
}
},
methods
:
{
getRecordList
()
{
let
json
=
{
gift_name
:
this
.
searchFrom
.
gift_name
,
gift_type
:
this
.
searchFrom
.
gift_type
,
periods_title
:
this
.
searchFrom
.
periods_title
,
class_name
:
this
.
searchFrom
.
class_name
,
mobile
:
this
.
searchFrom
.
mobile
,
start_at
:
this
.
searchFrom
.
receiveTime
[
0
],
over_at
:
this
.
searchFrom
.
receiveTime
[
1
],
limit
:
this
.
limit
,
page
:
this
.
nowPage
};
receiveRecordApi
(
json
).
then
(
res
=>
{
this
.
recordList
=
res
.
list
;
this
.
total
=
res
.
total
;
});
},
onPageChange
(
val
)
{
this
.
nowPage
=
val
;
this
.
getRecordList
();
},
onSizeChange
(
val
)
{
this
.
limit
=
val
;
this
.
nowPage
=
1
;
this
.
getRecordList
();
},
exportTable
()
{
let
json
=
{
gift_name
:
this
.
searchFrom
.
gift_name
,
gift_type
:
this
.
searchFrom
.
gift_type
,
periods_title
:
this
.
searchFrom
.
periods_title
,
class_name
:
this
.
searchFrom
.
class_name
,
mobile
:
this
.
searchFrom
.
mobile
,
start_at
:
this
.
searchFrom
.
receiveTime
[
0
],
over_at
:
this
.
searchFrom
.
receiveTime
[
1
]
};
exportExcelApi
(
"/api/admin/gift/receive/record/export"
,
json
);
},
},
created
()
{
this
.
getRecordList
();
}
}
</
script
>
<
style
scoped
>
.container
{
padding
:
20px
;
}
</
style
>
src/components/shop/dialog.vue
View file @
7edf6ee5
...
@@ -143,6 +143,7 @@
...
@@ -143,6 +143,7 @@
<el-form-item
v-if=
"form.goods_type==4"
label=
"领取到期时间(小时)"
label-width=
"160px"
>
<el-form-item
v-if=
"form.goods_type==4"
label=
"领取到期时间(小时)"
label-width=
"160px"
>
<el-input-number
v-model=
"form.goods_desc.time_limit"
></el-input-number>
<el-input-number
v-model=
"form.goods_desc.time_limit"
></el-input-number>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"form.goods_type==1||form.goods_type==2"
label=
"是否赠送优惠券"
label-width=
"160px"
>
<el-form-item
v-if=
"form.goods_type==1||form.goods_type==2"
label=
"是否赠送优惠券"
label-width=
"160px"
>
<el-select
v-model=
"form.goods_desc.coupon_goods_id"
placeholder=
"请选择"
>
<el-select
v-model=
"form.goods_desc.coupon_goods_id"
placeholder=
"请选择"
>
<el-option
v-for=
"data in coupongoods"
<el-option
v-for=
"data in coupongoods"
...
@@ -152,7 +153,18 @@
...
@@ -152,7 +153,18 @@
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"课程封面(670*472)"
v-if=
"form.goods_type !== 3 && form.goods_type !== 4 && form.goods_type !== 5"
required
>
<el-form-item
label=
"关联赠品"
v-if=
"dialogObj.type == 0 || dialogObj.type == 1"
>
<el-select
v-model=
"form.relation_gift"
multiple
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"data in relation_gift"
:key=
"data.id"
:label=
"`【$
{data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"课程封面(670*472)"
v-if=
"form.goods_type !== 3 && form.goods_type !== 4 && form.goods_type !== 5"
required
>
<el-upload
<el-upload
list-type=
"picture-card"
list-type=
"picture-card"
class=
"upload-demo"
class=
"upload-demo"
...
@@ -224,12 +236,16 @@
...
@@ -224,12 +236,16 @@
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
:label=
"form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '原价(元)' :form.goods_type === 4 ? '抵扣价格(元)' : '单买价格(元)'"
required
>
<el-form-item
:label=
"form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '原价(元)' :form.goods_type === 4 ? '抵扣价格(元)' : '单买价格(元)'"
required
>
<el-input-number
v-model=
"form.original_price"
label=
"原价"
></el-input-number>
<el-input-number
v-model=
"form.original_price"
label=
"原价"
></el-input-number>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
:label=
"form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '现价(元)' :form.goods_type === 4 ? '购买价格(元)' : '拼团价格(元)'"
required
>
<el-form-item
:label=
"form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '现价(元)' :form.goods_type === 4 ? '购买价格(元)' : '拼团价格(元)'"
required
>
<el-input-number
v-model=
"form.current_price"
label=
"现价"
></el-input-number>
<el-input-number
v-model=
"form.current_price"
label=
"现价"
></el-input-number>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -305,525 +321,535 @@
...
@@ -305,525 +321,535 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
getLessonApi
,
getLessonApi
,
addGoodsApi
,
addGoodsApi
,
editGoodsApi
,
editGoodsApi
,
getGoodsDetailApi
,
getGoodsDetailApi
,
uploadFileApi
,
uploadFileApi
,
getGoodsListApi
getGoodsListApi
,
}
from
"../../service/api"
;
relationGiftApi
import
{
TEACHERTYPE
,
GOODSTYPE
}
from
"../../util/wordbook"
;
}
from
"../../service/api"
;
import
editorDetail
from
"./editorDetail"
import
{
TEACHERTYPE
,
GOODSTYPE
}
from
"../../util/wordbook"
;
import
editorKnow
from
"./editorKnow"
import
editorDetail
from
"./editorDetail"
import
editorKnow
from
"./editorKnow"
export
default
{
export
default
{
name
:
"dialogObj"
,
name
:
"dialogObj"
,
props
:
[
props
:
[
'dialogObj'
,
'dialogObj'
,
],
],
components
:
{
// 引入组件
components
:
{
// 引入组件
editorDetail
,
editorDetail
,
editorKnow
editorKnow
},
filters
:
{
filterGoods
(
val
)
{
return
'['
+
GOODSTYPE
[
val
.
goods_type
]
+
']'
+
'['
+
val
.
current_price
/
100
+
'元]'
+
val
.
name
}
},
data
()
{
return
{
tiny
:
{
height
:
300
},
sendObj
:
{
content
:
'nihao'
},
loading
:
true
,
goodsYou
:
[],
goodsList
:
[],
form
:
{
name
:
''
,
goods_type
:
1
,
goods_desc
:
{
desc
:
""
,
imgLesson
:
[],
img
:
[],
course_title
:
''
,
time_limit
:
0
},
course_id
:
''
,
course_type
:
0
,
watch_num
:
''
,
invite_earnings
:
0
,
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
0
,
is_auth_teacher
:
0
,
share_desc
:
{
title
:
''
,
content
:
''
,
img
:
[],
refImg
:
[]
},
desc
:
{
detail
:
""
,
qa
:
""
,
customer_service
:
[],
after_goods_id
:
''
,
before_goods_id
:
''
},
is_into_periods
:
'0'
},
},
lessonList
:
[],
filters
:
{
goOn_goods_Id
:
{
filterGoods
(
val
)
{
after_goods_id
:
''
,
return
'['
+
GOODSTYPE
[
val
.
goods_type
]
+
']'
+
'['
+
val
.
current_price
/
100
+
'元]'
+
val
.
name
before_goods_id
:
''
},
coupongoods
:
[],
false
:
false
}
},
methods
:
{
goodsChange
()
{
if
(
this
.
form
.
goods_type
==
4
||
this
.
form
.
goods_type
==
3
)
{
let
json
=
{
limit
:
'999'
,
page
:
'1'
,
goods_type
:
'1,2'
,
status
:
"1"
};
getGoodsListApi
(
json
).
then
(
res
=>
{
console
.
log
(
json
)
// debugger
this
.
goodsList
=
res
.
list
});
}
else
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
// debugger
let
json
=
{
limit
:
'999'
,
page
:
'1'
,
goods_type
:
'4'
,
};
getGoodsListApi
(
json
).
then
(
res
=>
{
console
.
log
(
res
)
// debugger
let
item
=
{
name
:
'不赠送'
,
id
:
'0'
,
goods_type
:
4
,
course_type
:
0
,
current_price
:
0
}
this
.
coupongoods
=
res
.
list
this
.
coupongoods
.
unshift
(
item
)
});
}
},
sub
()
{
console
.
log
(
this
.
form
)
if
(
!
this
.
form
.
share_desc
.
img
&&
this
.
form
.
goods_type
==
2
)
{
this
.
$message
({
type
:
'success'
,
message
:
'请上传主图!'
});
return
}
let
_json
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
)
+
''
);
console
.
log
(
this
.
form
)
// debugger
if
(
_json
.
goods_type
===
3
||
_json
.
goods_type
===
4
||
_json
.
goods_type
===
5
)
{
_json
.
course_id
=
0
;
_json
.
watch_num
=
0
;
}
if
(
_json
.
goods_type
===
5
)
{
_json
.
is_real
=
1
;
}
_json
.
desc
.
before_goods_id
=
this
.
goOn_goods_Id
.
before_goods_id
;
if
(
this
.
goodsYou
.
length
<
1
)
{
_json
.
desc
.
use_goods_ids
=
''
}
else
{
_json
.
desc
.
use_goods_ids
=
this
.
goodsYou
.
toString
()
}
_json
.
desc
.
after_goods_id
=
this
.
goOn_goods_Id
.
after_goods_id
;
_json
.
original_price
=
(
_json
.
original_price
*
100
).
toFixed
(
0
);
_json
.
current_price
=
(
_json
.
current_price
*
100
).
toFixed
(
0
);
_json
.
invite_earnings
=
(
_json
.
invite_earnings
*
100
).
toFixed
(
0
);
_json
.
goods_desc
=
JSON
.
stringify
(
_json
.
goods_desc
);
_json
.
desc
=
JSON
.
stringify
(
_json
.
desc
);
_json
.
share_desc
=
JSON
.
stringify
(
_json
.
share_desc
);
switch
(
this
.
dialogObj
.
type
)
{
case
1
:
editGoodsApi
(
this
.
dialogObj
.
id
,
_json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
case
0
:
console
.
log
(
_json
)
addGoodsApi
(
_json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
})
break
}
},
removeFileMain
(
a
)
{
let
x
=
this
.
form
.
goods_desc
.
img
.
findIndex
(
i
=>
{
return
i
.
name
===
a
.
name
});
this
.
form
.
goods_desc
.
img
.
splice
(
x
,
1
);
},
uploadFileLesson
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
form
.
goods_desc
.
imgLesson
=
[{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}];
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
})
},
removeFileLesson
()
{
this
.
form
.
goods_desc
.
imgLesson
=
[]
},
uploadFileMain
(
a
)
{
console
.
log
(
a
)
// debugger
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
form
.
goods_desc
.
img
.
push
({
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
});
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
})
},
removeFileShareRef
()
{
this
.
form
.
share_desc
.
refImg
=
[]
},
uploadFileMainShareRef
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
share_desc
.
refImg
)
{
this
.
form
.
share_desc
.
refImg
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
refImg
=
[];
this
.
form
.
share_desc
.
refImg
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
uploadFileMainShare
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
share_desc
.
img
)
{
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
img
=
[];
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
}
},
})
data
()
{
},
return
{
removeFileService
()
{
tiny
:
{
this
.
form
.
desc
.
customer_service
=
[];
height
:
300
},
},
uploadFileMainService
(
a
)
{
sendObj
:
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
content
:
'nihao'
this
.
fileUid
=
a
.
file
.
uid
;
},
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
loading
:
true
,
this
.
$message
({
goodsYou
:
[],
message
:
'上传成功'
,
goodsList
:
[],
type
:
'success'
form
:
{
});
name
:
''
,
if
(
this
.
form
.
desc
.
customer_service
)
{
goods_type
:
1
,
this
.
form
.
desc
.
customer_service
[
0
]
=
{
goods_desc
:
{
name
:
res
.
url
,
desc
:
""
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
imgLesson
:
[],
title
:
''
,
img
:
[],
lable
:
''
course_title
:
''
,
}
time_limit
:
0
}
else
{
},
this
.
form
.
desc
.
customer_service
=
[];
course_id
:
''
,
this
.
form
.
desc
.
customer_service
[
0
]
=
{
course_type
:
0
,
name
:
res
.
url
,
watch_num
:
''
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
invite_earnings
:
0
,
title
:
''
,
original_price
:
''
,
lable
:
''
current_price
:
''
,
}
is_real
:
0
,
}
is_auth_user
:
0
,
})
is_auth_teacher
:
0
,
},
share_desc
:
{
uploadFileShare
(
a
)
{
title
:
''
,
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
content
:
''
,
this
.
fileUid
=
a
.
file
.
uid
;
img
:
[],
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
refImg
:
[]
this
.
$message
({
},
message
:
'上传成功'
,
desc
:
{
type
:
'success'
detail
:
""
,
});
qa
:
""
,
if
(
this
.
form
.
share_desc
.
img
)
{
customer_service
:
[],
this
.
form
.
share_desc
.
img
[
0
]
=
{
after_goods_id
:
''
,
name
:
res
.
url
,
before_goods_id
:
''
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
},
title
:
''
,
is_into_periods
:
'0'
,
lable
:
''
relation_gift
:
[]
}
},
}
else
{
lessonList
:
[],
this
.
form
.
share_desc
.
img
=
[];
goOn_goods_Id
:
{
this
.
form
.
share_desc
.
img
[
0
]
=
{
after_goods_id
:
''
,
name
:
res
.
url
,
before_goods_id
:
''
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
},
title
:
''
,
coupongoods
:
[],
lable
:
''
false
:
false
,
relation_gift
:
[]
}
}
}
},
})
methods
:
{
},
goodsChange
()
{
initDialog
()
{
if
(
this
.
form
.
goods_type
==
4
||
this
.
form
.
goods_type
==
3
)
{
switch
(
this
.
dialogObj
.
type
)
{
let
json
=
{
case
0
:
// 添加商品
limit
:
'999'
,
this
.
loading
=
false
;
page
:
'1'
,
this
.
goOn_goods_Id
.
after_goods_id
=
''
;
goods_type
:
'1,2'
,
this
.
goodsYou
=
[];
status
:
"1"
this
.
goOn_goods_Id
.
before_goods_id
=
''
;
};
this
.
form
=
{
getGoodsListApi
(
json
).
then
(
res
=>
{
name
:
''
,
console
.
log
(
json
)
goods_type
:
1
,
// debugger
goods_desc
:
{
this
.
goodsList
=
res
.
list
desc
:
""
,
});
img
:
[],
}
else
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
course_title
:
""
// debugger
},
let
json
=
{
course_id
:
''
,
limit
:
'999'
,
course_type
:
0
,
page
:
'1'
,
watch_num
:
''
,
goods_type
:
'4'
,
duration_num
:
0
,
};
original_price
:
''
,
getGoodsListApi
(
json
).
then
(
res
=>
{
current_price
:
''
,
console
.
log
(
res
)
is_real
:
0
,
// debugger
is_auth_user
:
0
,
let
item
=
{
is_auth_teacher
:
0
,
name
:
'不赠送'
,
share_desc
:
{
id
:
'0'
,
title
:
''
,
goods_type
:
4
,
content
:
''
,
course_type
:
0
,
refImg
:
[],
current_price
:
0
img
:
[]
}
},
this
.
coupongoods
=
res
.
list
desc
:
{
this
.
coupongoods
.
unshift
(
item
)
detail
:
""
,
});
qa
:
""
,
customer_service
:
[],
before_goods_id
:
0
,
after_goods_id
:
0
},
is_into_periods
:
'0'
};
this
.
getLessonList
();
console
.
log
(
this
.
form
.
course_type
)
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'4'
}
getGoodsListApi
(
json
).
then
(
res
=>
{
// debugger
let
item
=
{
name
:
'不赠送'
,
id
:
'0'
,
goods_type
:
4
,
course_type
:
0
,
current_price
:
0
}
}
this
.
coupongoods
=
res
.
list
},
this
.
coupongoods
.
unshift
(
item
)
sub
()
{
});
if
(
this
.
form
.
relation_gift
)
{
}
this
.
form
.
relation_gift
=
this
.
form
.
relation_gift
.
join
(
','
);
break
;
}
case
1
:
// 编辑商品
if
(
!
this
.
form
.
share_desc
.
img
&&
this
.
form
.
goods_type
==
2
)
{
case
2
:
// 查看商品
this
.
$message
({
this
.
goOn_goods_Id
.
after_goods_id
=
''
;
type
:
'success'
,
this
.
goOn_goods_Id
.
before_goods_id
=
''
;
message
:
'请上传主图!'
this
.
goodsYou
=
[];
});
this
.
form
=
{
return
name
:
''
,
}
goods_type
:
1
,
let
_json
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
)
+
''
);
goods_desc
:
{
desc
:
""
,
img
:
[],
course_title
:
''
},
course_id
:
''
,
course_type
:
0
,
watch_num
:
''
,
duration_num
:
0
,
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
0
,
is_auth_teacher
:
0
,
share_desc
:
{
title
:
''
,
content
:
''
,
refImg
:
[],
img
:
[]
},
desc
:
{
detail
:
""
,
qa
:
""
,
customer_service
:
[],
before_goods_id
:
0
,
after_goods_id
:
0
},
is_into_periods
:
'0'
};
getGoodsDetailApi
(
this
.
dialogObj
.
id
).
then
(
res
=>
{
this
.
loading
=
false
;
let
share_desc
=
JSON
.
parse
(
res
.
share_desc
);
if
(
!
share_desc
.
refImg
)
{
share_desc
.
refImg
=
[]
}
this
.
form
=
{
name
:
res
.
name
,
goods_type
:
res
.
goods_type
,
goods_desc
:
JSON
.
parse
(
res
.
goods_desc
),
course_id
:
res
.
course_id
,
course_type
:
res
.
course_type
,
watch_num
:
res
.
watch_num
,
duration_num
:
res
.
duration_num
,
original_price
:
res
.
original_price
/
100
,
current_price
:
res
.
current_price
/
100
,
is_real
:
res
.
is_real
,
is_auth_user
:
res
.
is_auth_user
,
share_desc
:
JSON
.
parse
(
res
.
share_desc
),
desc
:
JSON
.
parse
(
res
.
desc
),
invite_earnings
:
res
.
invite_earnings
/
100
,
is_auth_teacher
:
res
.
is_auth_teacher
,
is_into_periods
:
res
.
is_into_periods
};
if
(
this
.
form
.
desc
.
before_goods_id
)
{
this
.
goOn_goods_Id
.
before_goods_id
=
this
.
form
.
desc
.
before_goods_id
;
}
if
(
this
.
form
.
desc
.
after_goods_id
)
{
this
.
goOn_goods_Id
.
after_goods_id
=
this
.
form
.
desc
.
after_goods_id
;
}
if
(
this
.
form
.
desc
.
use_goods_ids
)
{
this
.
goodsYou
=
this
.
form
.
desc
.
use_goods_ids
.
split
(
','
);
this
.
goodsYou
=
this
.
goodsYou
.
map
(
function
(
item
)
{
return
+
item
;
});
}
console
.
log
(
this
.
form
)
if
(
this
.
form
.
course_type
!=
1
&&
this
.
form
.
course_type
!=
2
)
{
// debugger
getGoodsListApi
({
limit
:
200
}).
then
(
res
=>
{
this
.
goodsList
=
res
.
list
});
}
// debugger
console
.
log
(
this
.
form
.
course_type
)
if
(
this
.
form
.
goods_type
==
4
)
{
// debugger
// debugger
this
.
getLessonList
()
if
(
_json
.
goods_type
===
3
||
_json
.
goods_type
===
4
||
_json
.
goods_type
===
5
)
{
let
json
=
{
_json
.
course_id
=
0
;
limit
:
200
,
_json
.
watch_num
=
0
;
nowPage
:
1
,
goods_type
:
'1,2'
}
}
getGoodsListApi
(
json
).
then
(
res
=>
{
if
(
_json
.
goods_type
===
5
)
{
this
.
goodsList
=
res
.
list
_json
.
is_real
=
1
;
});
}
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'4'
}
}
getGoodsListApi
(
json
).
then
(
res
=>
{
_json
.
desc
.
before_goods_id
=
this
.
goOn_goods_Id
.
before_goods_id
;
// debugger
if
(
this
.
goodsYou
.
length
<
1
)
{
let
item
=
{
_json
.
desc
.
use_goods_ids
=
''
name
:
'不赠送'
,
}
else
{
id
:
'0'
,
_json
.
desc
.
use_goods_ids
=
this
.
goodsYou
.
toString
()
goods_type
:
4
,
}
course_type
:
0
,
_json
.
desc
.
after_goods_id
=
this
.
goOn_goods_Id
.
after_goods_id
;
current_price
:
0
_json
.
original_price
=
(
_json
.
original_price
*
100
).
toFixed
(
0
);
}
_json
.
current_price
=
(
_json
.
current_price
*
100
).
toFixed
(
0
);
this
.
coupongoods
=
res
.
list
_json
.
invite_earnings
=
(
_json
.
invite_earnings
*
100
).
toFixed
(
0
);
this
.
coupongoods
.
unshift
(
item
)
_json
.
goods_desc
=
JSON
.
stringify
(
_json
.
goods_desc
);
_json
.
desc
=
JSON
.
stringify
(
_json
.
desc
);
_json
.
share_desc
=
JSON
.
stringify
(
_json
.
share_desc
);
switch
(
this
.
dialogObj
.
type
)
{
case
1
:
editGoodsApi
(
this
.
dialogObj
.
id
,
_json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
break
;
case
0
:
console
.
log
(
_json
)
addGoodsApi
(
_json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
})
break
}
},
removeFileMain
(
a
)
{
let
x
=
this
.
form
.
goods_desc
.
img
.
findIndex
(
i
=>
{
return
i
.
name
===
a
.
name
});
});
}
this
.
form
.
goods_desc
.
img
.
splice
(
x
,
1
);
this
.
getLessonList
()
},
});
uploadFileLesson
(
a
)
{
break
;
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
case
3
:
this
.
fileUid
=
a
.
file
.
uid
;
this
.
title
=
'编辑'
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
show
=
this
.
dialogObj
.
show
;
this
.
form
.
goods_desc
.
imgLesson
=
[{
this
.
id
=
this
.
dialogObj
.
id
;
name
:
res
.
url
,
this
.
type
=
2
;
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
title
:
''
,
this
.
getLessonList
()
lable
:
''
let
json
=
{
}];
limit
:
200
,
this
.
$message
({
nowPage
:
1
,
message
:
'上传成功'
,
goods_type
:
'4'
type
:
'success'
}
});
getGoodsListApi
(
json
).
then
(
res
=>
{
})
this
.
coupongoods
=
res
.
list
},
});
removeFileLesson
()
{
}
this
.
form
.
goods_desc
.
imgLesson
=
[]
},
uploadFileMain
(
a
)
{
console
.
log
(
a
)
// debugger
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
form
.
goods_desc
.
img
.
push
({
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
});
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
})
},
removeFileShareRef
()
{
this
.
form
.
share_desc
.
refImg
=
[]
},
uploadFileMainShareRef
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
share_desc
.
refImg
)
{
this
.
form
.
share_desc
.
refImg
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
refImg
=
[];
this
.
form
.
share_desc
.
refImg
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
uploadFileMainShare
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
share_desc
.
img
)
{
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
img
=
[];
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
removeFileService
()
{
this
.
form
.
desc
.
customer_service
=
[];
},
uploadFileMainService
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
desc
.
customer_service
)
{
this
.
form
.
desc
.
customer_service
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
desc
.
customer_service
=
[];
this
.
form
.
desc
.
customer_service
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
uploadFileShare
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,
{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
if
(
this
.
form
.
share_desc
.
img
)
{
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
img
=
[];
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
initDialog
()
{
switch
(
this
.
dialogObj
.
type
)
{
case
0
:
// 添加商品
this
.
loading
=
false
;
this
.
goOn_goods_Id
.
after_goods_id
=
''
;
this
.
goodsYou
=
[];
this
.
goOn_goods_Id
.
before_goods_id
=
''
;
this
.
form
=
{
name
:
''
,
goods_type
:
1
,
goods_desc
:
{
desc
:
""
,
img
:
[],
course_title
:
""
},
course_id
:
''
,
course_type
:
0
,
watch_num
:
''
,
duration_num
:
0
,
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
0
,
is_auth_teacher
:
0
,
share_desc
:
{
title
:
''
,
content
:
''
,
refImg
:
[],
img
:
[]
},
desc
:
{
detail
:
""
,
qa
:
""
,
customer_service
:
[],
before_goods_id
:
0
,
after_goods_id
:
0
},
is_into_periods
:
'0'
,
relation_gift
:
[]
};
this
.
getLessonList
();
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'4'
}
getGoodsListApi
(
json
).
then
(
res
=>
{
// debugger
let
item
=
{
name
:
'不赠送'
,
id
:
'0'
,
goods_type
:
4
,
course_type
:
0
,
current_price
:
0
}
this
.
coupongoods
=
res
.
list
this
.
coupongoods
.
unshift
(
item
)
});
}
break
;
case
1
:
// 编辑商品
case
2
:
// 查看商品
this
.
goOn_goods_Id
.
after_goods_id
=
''
;
this
.
goOn_goods_Id
.
before_goods_id
=
''
;
this
.
goodsYou
=
[];
this
.
form
=
{
name
:
''
,
goods_type
:
1
,
goods_desc
:
{
desc
:
""
,
img
:
[],
course_title
:
''
},
course_id
:
''
,
course_type
:
0
,
watch_num
:
''
,
duration_num
:
0
,
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
0
,
is_auth_teacher
:
0
,
share_desc
:
{
title
:
''
,
content
:
''
,
refImg
:
[],
img
:
[]
},
desc
:
{
detail
:
""
,
qa
:
""
,
customer_service
:
[],
before_goods_id
:
0
,
after_goods_id
:
0
},
is_into_periods
:
'0'
};
getGoodsDetailApi
(
this
.
dialogObj
.
id
).
then
(
res
=>
{
this
.
loading
=
false
;
let
share_desc
=
JSON
.
parse
(
res
.
share_desc
);
if
(
!
share_desc
.
refImg
)
{
share_desc
.
refImg
=
[]
}
let
gift_ids_arr
=
[];
if
(
res
.
gift_ids
)
{
res
.
gift_ids
.
split
(
','
).
map
(
i
=>
{
gift_ids_arr
.
push
(
Number
(
i
));
});
}
this
.
form
=
{
name
:
res
.
name
,
goods_type
:
res
.
goods_type
,
goods_desc
:
JSON
.
parse
(
res
.
goods_desc
),
course_id
:
res
.
course_id
,
course_type
:
res
.
course_type
,
watch_num
:
res
.
watch_num
,
duration_num
:
res
.
duration_num
,
original_price
:
res
.
original_price
/
100
,
current_price
:
res
.
current_price
/
100
,
is_real
:
res
.
is_real
,
is_auth_user
:
res
.
is_auth_user
,
share_desc
:
JSON
.
parse
(
res
.
share_desc
),
desc
:
JSON
.
parse
(
res
.
desc
),
invite_earnings
:
res
.
invite_earnings
/
100
,
is_auth_teacher
:
res
.
is_auth_teacher
,
is_into_periods
:
res
.
is_into_periods
,
relation_gift
:
gift_ids_arr
};
if
(
this
.
form
.
desc
.
before_goods_id
)
{
this
.
goOn_goods_Id
.
before_goods_id
=
this
.
form
.
desc
.
before_goods_id
;
}
if
(
this
.
form
.
desc
.
after_goods_id
)
{
this
.
goOn_goods_Id
.
after_goods_id
=
this
.
form
.
desc
.
after_goods_id
;
}
if
(
this
.
form
.
desc
.
use_goods_ids
)
{
this
.
goodsYou
=
this
.
form
.
desc
.
use_goods_ids
.
split
(
','
);
this
.
goodsYou
=
this
.
goodsYou
.
map
(
function
(
item
)
{
return
+
item
;
});
}
if
(
this
.
form
.
course_type
!=
1
&&
this
.
form
.
course_type
!=
2
)
{
// debugger
getGoodsListApi
({
limit
:
200
}).
then
(
res
=>
{
this
.
goodsList
=
res
.
list
});
}
// debugger
console
.
log
(
this
.
form
.
course_type
)
if
(
this
.
form
.
goods_type
==
4
)
{
// debugger
this
.
getLessonList
()
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'1,2'
}
getGoodsListApi
(
json
).
then
(
res
=>
{
this
.
goodsList
=
res
.
list
});
}
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'4'
}
getGoodsListApi
(
json
).
then
(
res
=>
{
// debugger
let
item
=
{
name
:
'不赠送'
,
id
:
'0'
,
goods_type
:
4
,
course_type
:
0
,
current_price
:
0
}
this
.
coupongoods
=
res
.
list
this
.
coupongoods
.
unshift
(
item
)
});
}
this
.
getLessonList
()
});
break
;
case
3
:
this
.
title
=
'编辑'
;
this
.
show
=
this
.
dialogObj
.
show
;
this
.
id
=
this
.
dialogObj
.
id
;
this
.
type
=
2
;
if
(
this
.
form
.
goods_type
==
1
||
this
.
form
.
goods_type
==
2
)
{
this
.
getLessonList
()
let
json
=
{
limit
:
200
,
nowPage
:
1
,
goods_type
:
'4'
}
getGoodsListApi
(
json
).
then
(
res
=>
{
this
.
coupongoods
=
res
.
list
});
}
// getTeacherDetailApi(this.id).then(res=>{
// getTeacherDetailApi(this.id).then(res=>{
// this.form.name = res.name;
// this.form.name = res.name;
// this.form.alias = res.alias;
// this.form.alias = res.alias;
...
@@ -832,36 +858,41 @@
...
@@ -832,36 +858,41 @@
// this.form.status = res.status;
// this.form.status = res.status;
// this.loading = false
// this.loading = false
// });
// });
break
break
}
}
},
},
changeLessonType
()
{
changeLessonType
()
{
this
.
getLessonList
()
this
.
getLessonList
()
},
},
getLessonList
()
{
getLessonList
()
{
getLessonApi
({
type
:
this
.
form
.
course_type
}).
then
(
res
=>
{
getLessonApi
({
type
:
this
.
form
.
course_type
}).
then
(
res
=>
{
this
.
lessonList
=
res
.
list
this
.
lessonList
=
res
.
list
})
})
}
},
},
getRelationGift
()
{
watch
:
{
relationGiftApi
().
then
(
res
=>
{
dialogObj
:
{
this
.
relation_gift
=
res
.
list
;
handler
:
function
()
{
});
if
(
this
.
dialogObj
.
show
)
{
}
console
.
log
(
this
.
dialogObj
)
this
.
loading
=
true
;
this
.
initDialog
()
}
},
},
deep
:
true
watch
:
{
},
dialogObj
:
{
"dialogObj.show"
:
function
(
a
)
{
handler
:
function
()
{
},
if
(
this
.
dialogObj
.
show
)
{
show
(
value
)
{
this
.
loading
=
true
;
this
.
$emit
(
"changeShow"
,
value
);
this
.
initDialog
()
}
}
},
deep
:
true
},
"dialogObj.show"
:
function
(
a
)
{
this
.
getRelationGift
();
},
show
(
value
)
{
this
.
$emit
(
"changeShow"
,
value
);
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
...
...
src/components/teacherDetail/giftDeliverDialog.vue
0 → 100644
View file @
7edf6ee5
<
template
>
<el-dialog
:title=
"dialogObj.title"
center
append-to-body
:visible
.
sync=
"dialogObj.show"
>
<div
v-if=
"dialogObj.gift_deliver"
class=
"dialog-content"
>
<div
class=
"dialog-text"
>
物流已发货,不能修改赠品信息!
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"dialogObj.show = false"
>
知道了
</el-button>
</span>
</div>
<div
v-else
class=
"dialog-content"
>
<div>
当前商品:
{{
dialogObj
.
goods_name
}}
</div>
<div>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
>
<el-form-item
label=
"选择赠品"
required
prop=
"selectedGiftList"
>
<el-select
multiple
v-model=
"form.selectedGiftList"
placeholder=
"全部"
>
<el-option
v-for=
"data in selectedGiftList"
:key=
"data.id"
:label=
"`【$
{data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"sub"
:disabled=
"selectedGiftList.length == 0"
>
确 定
</el-button>
</span>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
relationGiftApi
,
orderSetApi
}
from
"../../service/api"
;
export
default
{
name
:
"giftDeliverDialog"
,
props
:
[
'dialogObj'
],
data
()
{
return
{
form
:
{
selectedGiftList
:
[]
},
selectedGiftList
:
[],
rules
:
{
selectedGiftList
:
[
{
required
:
true
,
message
:
'请选择赠品'
,
trigger
:
'change'
}
]
}
}
},
methods
:
{
initDialog
()
{
relationGiftApi
({
goods_id
:
this
.
dialogObj
.
goods_id
}).
then
(
res
=>
{
this
.
selectedGiftList
=
res
.
list
;
});
},
sub
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
json
=
{
gift_ids
:
this
.
form
.
selectedGiftList
.
join
(
','
),
goods_id
:
this
.
dialogObj
.
goods_id
,
user_id
:
this
.
dialogObj
.
user_id
,
user_address_id
:
this
.
dialogObj
.
user_address_id
,
out_trade_no
:
this
.
dialogObj
.
out_trade_no
};
orderSetApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
dialogObj
.
show
=
false
;
});
}
else
{
return
false
;
}
});
},
},
watch
:
{
'dialogObj.show'
(
val
)
{
if
(
val
)
{
this
.
initDialog
();
}
}
},
}
</
script
>
<
style
scoped
>
.dialog-content
{
text-align
:
center
;
}
.dialog-content
div
{
margin-bottom
:
20px
;
text-align
:
left
;
}
.dialog-content
.dialog-text
{
text-align
:
center
;
}
</
style
>
src/components/teacherDetail/index.vue
View file @
7edf6ee5
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
<el-card
style=
"width: 450px;display: inline-block;margin-right: 10px"
>
<el-card
style=
"width: 450px;display: inline-block;margin-right: 10px"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
<span><label>
{{
detail
.
type
|
teacherType
}}
:
</label>
{{
detail
.
name
}}
(T
{{
detail
.
squad
}}
)
</span>
<span><label>
{{
detail
.
type
|
teacherType
}}
:
</label>
{{
detail
.
name
}}
(T
{{
detail
.
squad
}}
)
</span>
<el-button
style=
"float: right;margin-top: -6px;"
size=
"small"
type=
"success"
v-if=
"!$store.state.readonly"
plain
@
click=
"onAddUser(true)"
>
老师绑定用户
</el-button>
<el-button
style=
"float: right;margin-top: -6px;"
size=
"small"
type=
"success"
v-if=
"!$store.state.readonly"
plain
@
click=
"onAddUser(true)"
>
老师绑定用户
</el-button>
</div>
</div>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<div
class=
"text item"
>
<div
class=
"text item"
>
...
@@ -34,7 +36,9 @@
...
@@ -34,7 +36,9 @@
<el-card
style=
"width: 450px;display: inline-block;margin-right: 10px"
v-if=
"detail.user_info"
>
<el-card
style=
"width: 450px;display: inline-block;margin-right: 10px"
v-if=
"detail.user_info"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
<span>
绑定用户
</span>
<span>
绑定用户
</span>
<el-button
@
click=
"createInviteLink(detail.user_info)"
style=
"float: right;"
size=
"mini"
plain
type=
"primary"
>
复制专属链接
</el-button>
<el-button
@
click=
"createInviteLink(detail.user_info)"
style=
"float: right;"
size=
"mini"
plain
type=
"primary"
>
复制专属链接
</el-button>
</div>
</div>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<div
class=
"text item"
>
<div
class=
"text item"
>
...
@@ -55,7 +59,8 @@
...
@@ -55,7 +59,8 @@
<span>
当月销售转化率【
{{
nowDate
}}
】
</span>
<span>
当月销售转化率【
{{
nowDate
}}
】
</span>
</div>
</div>
<div
class=
"text item"
>
<div
class=
"text item"
>
<el-progress
type=
"circle"
style=
"float: left;margin-right: 10px"
:percentage=
"Number(task4Data.trans_rate.split('%')[0])"
></el-progress>
<el-progress
type=
"circle"
style=
"float: left;margin-right: 10px"
:percentage=
"Number(task4Data.trans_rate.split('%')[0])"
></el-progress>
</div>
</div>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<div
class=
"text item"
>
<div
class=
"text item"
>
...
@@ -187,6 +192,15 @@
...
@@ -187,6 +192,15 @@
<el-form-item
label=
"交易订单号"
>
<el-form-item
label=
"交易订单号"
>
<el-input
v-model=
"form.out_trade_no"
></el-input>
<el-input
v-model=
"form.out_trade_no"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"关联赠品"
>
<el-input
v-model=
"form.gift_name"
></el-input>
</el-form-item>
<el-form-item
label=
"订单状态"
>
<el-select
v-model=
"form.deliver_status"
placeholder=
"请选择"
clearable
>
<el-option
label=
"未发货"
value=
"0"
></el-option>
<el-option
label=
"已发货"
value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
plain
@
click=
"getOrderList"
>
搜索
</el-button>
<el-button
type=
"primary"
plain
@
click=
"getOrderList"
>
搜索
</el-button>
</el-form-item>
</el-form-item>
...
@@ -208,7 +222,8 @@
...
@@ -208,7 +222,8 @@
<el-table-column
prop=
"goods_name"
label=
"商品名称"
></el-table-column>
<el-table-column
prop=
"goods_name"
label=
"商品名称"
></el-table-column>
<el-table-column
width=
"250"
prop=
"invite_id"
className=
"f-c"
label=
"推广人"
>
<el-table-column
width=
"250"
prop=
"invite_id"
className=
"f-c"
label=
"推广人"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<div
@
click=
"showSource(scope.row)"
v-if=
"scope.row.invite_earnings > 0 && scope.row.invite_id !== 0"
style=
"width:100%;display: flex;color: #409eff;cursor: pointer"
>
<div
@
click=
"showSource(scope.row)"
v-if=
"scope.row.invite_earnings > 0 && scope.row.invite_id !== 0"
style=
"width:100%;display: flex;color: #409eff;cursor: pointer"
>
<img
:src=
"scope.row.invite_avatar"
class=
"avatar"
/>
<img
:src=
"scope.row.invite_avatar"
class=
"avatar"
/>
类型:
{{
scope
.
row
.
invite_type
}}
(
{{
scope
.
row
.
invite_name
}}
)
类型:
{{
scope
.
row
.
invite_type
}}
(
{{
scope
.
row
.
invite_name
}}
)
<br>
<br>
...
@@ -235,6 +250,20 @@
...
@@ -235,6 +250,20 @@
<div
v-if=
"scope.row.invite_id === 0"
>
无
</div>
<div
v-if=
"scope.row.invite_id === 0"
>
无
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"relation_gift"
label=
"关联赠品"
>
<
template
slot-scope=
"scope"
>
<span
v-for=
"(data, index) in scope.row.relation_gift"
>
{{
data
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"gift_deliver"
label=
"关联赠品物流"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.gift_deliver"
>
<a
class=
"gift_deliver"
v-for=
"(data, index) in scope.row.gift_deliver"
:href=
"`https://m.baidu.com/from=1013755s/s?word=$
{data.express_no}
&
sa=tb
&
ts=2790568
&
t_kt=0
&
ie=utf-8
&
rsv_t=cbe2F%252FT5T3MIzkRl%252Fg8ZUw%252FEPHZmn2wHIrB8cLvgNlEKyyDqUNPrTyDEEDjkAb8
&
rsv_pq=11793168499026332712
&
ss=110000000001
&
tj=1
&
rqlang=zh
&
rsv_sug4=4111
&
inputT=3178
&
oq=快递单号查询`"
target="_blank">
{{
data
.
goods_title
}}
</a>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"优惠活动"
>
<el-table-column
label=
"优惠活动"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.order_coupon_id === 0"
>
无
</span>
<span
v-if=
"scope.row.order_coupon_id === 0"
>
无
</span>
...
@@ -245,7 +274,9 @@
...
@@ -245,7 +274,9 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"付款状态"
width=
"80"
>
<el-table-column
label=
"付款状态"
width=
"80"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
v-if=
"scope.row.status === 5 || scope.row.status === 3"
@
click=
"showRef(scope.row)"
>
{{
scope
.
row
.
status
|
status
}}
</el-button>
<el-button
type=
"text"
v-if=
"scope.row.status === 5 || scope.row.status === 3"
@
click=
"showRef(scope.row)"
>
{{
scope
.
row
.
status
|
status
}}
</el-button>
<div
v-if=
"scope.row.status !== 5 && scope.row.status !== 3"
>
{{
scope
.
row
.
status
|
status
}}
</div>
<div
v-if=
"scope.row.status !== 5 && scope.row.status !== 3"
>
{{
scope
.
row
.
status
|
status
}}
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -266,18 +297,19 @@
...
@@ -266,18 +297,19 @@
<el-table-column
prop=
"pay_at"
label=
"购买时间"
sortable
></el-table-column>
<el-table-column
prop=
"pay_at"
label=
"购买时间"
sortable
></el-table-column>
<el-table-column
prop=
"created_at"
label=
"下单时间"
sortable
></el-table-column>
<el-table-column
prop=
"created_at"
label=
"下单时间"
sortable
></el-table-column>
<el-table-column
prop=
"desc"
label=
"备注"
></el-table-column>
<el-table-column
prop=
"desc"
label=
"备注"
></el-table-column>
<el-table-column
width=
"5
0"
label=
"操作"
v-if=
"!$store.state.readonly"
fixed=
"right"
>
<el-table-column
align=
"center"
width=
"10
0"
label=
"操作"
v-if=
"!$store.state.readonly"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-
popover
placement=
"top"
width=
"200"
>
<el-
button
slot=
"reference"
size=
"mini"
type=
"text"
<div
style=
"text-align: center"
>
@
click=
"editComment(scope.row.id, scope.row.desc)"
>
编辑备注
<el-button
@
click=
"editComment(scope.row.id, scope.row.desc)"
type=
"info"
plain
size=
"mini"
>
编辑备注
</el-button>
</el-button>
</div>
<el-button
slot=
"reference"
size=
"mini"
type=
"text"
@
click=
"editGiftDeliver(scope.row)"
<el-button
slot=
"reference"
size=
"mini"
type=
"text"
>
操作
</el-button>
style=
"margin: 0;"
>
关联赠品
</el-
popover
>
</el-
button
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<page
:total=
"orderListObj.total"
:limit=
"orderListObj.limit"
@
pageChange=
"onPageChange2"
@
sizeChange=
"onSizeChange2"
/>
<page
:total=
"orderListObj.total"
:limit=
"orderListObj.limit"
@
pageChange=
"onPageChange2"
@
sizeChange=
"onSizeChange2"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"外部订单列表"
name=
"yunji"
>
<el-tab-pane
label=
"外部订单列表"
name=
"yunji"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"100px"
inline
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"100px"
inline
>
...
@@ -346,7 +378,9 @@
...
@@ -346,7 +378,9 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"付款状态"
width=
"80"
>
<el-table-column
label=
"付款状态"
width=
"80"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
v-if=
"scope.row.status === 5 || scope.row.status === 3"
@
click=
"showRef(scope.row)"
>
{{
scope
.
row
.
status
|
status
}}
</el-button>
<el-button
type=
"text"
v-if=
"scope.row.status === 5 || scope.row.status === 3"
@
click=
"showRef(scope.row)"
>
{{
scope
.
row
.
status
|
status
}}
</el-button>
<div
v-if=
"scope.row.status !== 5 && scope.row.status !== 3"
>
{{
scope
.
row
.
status
|
status
}}
</div>
<div
v-if=
"scope.row.status !== 5 && scope.row.status !== 3"
>
{{
scope
.
row
.
status
|
status
}}
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -361,7 +395,8 @@
...
@@ -361,7 +395,8 @@
<br>
<br>
tel:
{{
scope
.
row
.
receiver_phone
}}
tel:
{{
scope
.
row
.
receiver_phone
}}
<br>
<br>
{{
scope
.
row
.
receiver_province
}}
{{
scope
.
row
.
receiver_city
}}
{{
scope
.
row
.
receiver_area
}}
{{
scope
.
row
.
receiver_address
}}
{{
scope
.
row
.
receiver_province
}}
{{
scope
.
row
.
receiver_city
}}
{{
scope
.
row
.
receiver_area
}}
{{
scope
.
row
.
receiver_address
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"active_at"
label=
"激活时间"
width=
"90"
>
<el-table-column
prop=
"active_at"
label=
"激活时间"
width=
"90"
>
...
@@ -371,10 +406,12 @@
...
@@ -371,10 +406,12 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"create_time"
label=
"下单时间"
width=
"90"
></el-table-column>
<el-table-column
prop=
"create_time"
label=
"下单时间"
width=
"90"
></el-table-column>
<el-table-column
prop=
"pay_time"
label=
"付款时间"
width=
"90"
></el-table-column>
<el-table-column
prop=
"pay_time"
label=
"付款时间"
width=
"90"
></el-table-column>
<el-table-column
prop=
"user_status"
:formatter=
"userStatusFormatter"
label=
"沟通状态"
width=
"90"
></el-table-column>
<el-table-column
prop=
"user_status"
:formatter=
"userStatusFormatter"
label=
"沟通状态"
width=
"90"
></el-table-column>
<el-table-column
prop=
"desc"
label=
"备注"
></el-table-column>
<el-table-column
prop=
"desc"
label=
"备注"
></el-table-column>
</el-table>
</el-table>
<page
:total=
"yunjiListObj.total"
:limit=
"yunjiListObj.limit"
@
pageChange=
"onPageChange3"
@
sizeChange=
"onSizeChange3"
/>
<page
:total=
"yunjiListObj.total"
:limit=
"yunjiListObj.limit"
@
pageChange=
"onPageChange3"
@
sizeChange=
"onSizeChange3"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"话术列表"
name=
"huashu"
>
<el-tab-pane
label=
"话术列表"
name=
"huashu"
>
<div
class=
"cssbox"
>
<div
class=
"cssbox"
>
...
@@ -402,10 +439,12 @@
...
@@ -402,10 +439,12 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<page
:total=
"contentTotal"
:limit=
"contentLimit"
@
pageChange=
"onPageChangeC"
@
sizeChange=
"onSizeChangeC"
/>
<page
:total=
"contentTotal"
:limit=
"contentLimit"
@
pageChange=
"onPageChangeC"
@
sizeChange=
"onSizeChangeC"
/>
</el-collapse-item>
</el-collapse-item>
</el-collapse>
</el-collapse>
<page
:total=
"modularTotal"
:limit=
"modularLimit"
@
pageChange=
"onPageChangeModular"
@
sizeChange=
"onSizeChangeModular"
/>
<page
:total=
"modularTotal"
:limit=
"modularLimit"
@
pageChange=
"onPageChangeModular"
@
sizeChange=
"onSizeChangeModular"
/>
<!-- 查看内容 -->
<!-- 查看内容 -->
<el-dialog
<el-dialog
title=
""
title=
""
...
@@ -443,6 +482,7 @@
...
@@ -443,6 +482,7 @@
<user-list
:userObj=
"userObj"
@
reflash=
"getTeacherDetail"
/>
<user-list
:userObj=
"userObj"
@
reflash=
"getTeacherDetail"
/>
<choose-good-dialog
:dialogObj=
"chooseGoodDialogObj"
@
changeShow=
"changeShow"
/>
<choose-good-dialog
:dialogObj=
"chooseGoodDialogObj"
@
changeShow=
"changeShow"
/>
<gift-deliver-dialog
:dialogObj=
"giftDeliverDialogObj"
@
reflash=
"getOrderList"
></gift-deliver-dialog>
<el-dialog
append-to-body
:visible
.
sync=
"addShow"
top=
"5vh"
>
<el-dialog
append-to-body
:visible
.
sync=
"addShow"
top=
"5vh"
>
<el-form
label-width=
"90px"
inline
>
<el-form
label-width=
"90px"
inline
>
...
@@ -471,7 +511,8 @@
...
@@ -471,7 +511,8 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"mobile"
label=
"手机号"
></el-table-column>
<el-table-column
prop=
"mobile"
label=
"手机号"
></el-table-column>
</el-table>
</el-table>
<page
:total=
"userObj.total"
:limit=
"userObj.limit"
:small=
"true"
@
pageChange=
"onPageChange4"
@
sizeChange=
"onSizeChange4"
/>
<page
:total=
"userObj.total"
:limit=
"userObj.limit"
:small=
"true"
@
pageChange=
"onPageChange4"
@
sizeChange=
"onSizeChange4"
/>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"addShow = false"
>
取 消
</el-button>
<el-button
@
click=
"addShow = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"onAdd"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"onAdd"
>
确 定
</el-button>
...
@@ -481,619 +522,648 @@
...
@@ -481,619 +522,648 @@
</template>
</template>
<
script
>
<
script
>
import
{
import
{
getTeacherDetailApi
,
getTeacherDetailApi
,
getClassStatisticsApi
,
getClassStatisticsApi
,
task4Api
,
task4Api
,
getUserListApi
,
getUserListApi
,
getQuestionModularListApi
,
getQuestionModularListApi
,
getQuestionModularDetailApi
,
getQuestionModularDetailApi
,
teacherBindUserApi
,
teacherBindUserApi
,
getOrderListApi
,
getOrderListApi
,
getGoodsListApi
,
getGoodsListApi
,
editOrderDescApi
,
editOrderDescApi
,
updateOrderTeacherApi
,
updateOrderTeacherApi
,
getyunjiApi
,
getyunjiApi
,
getClassListApi
,
getClassListApi
,
getSourceStudentApi
getSourceStudentApi
}
from
"../../service/api"
;
}
from
"../../service/api"
;
import
{
import
{
TEACHERTYPE
,
TEACHERTYPE
,
ORDERSTATUSOPTION
,
ORDERSTATUSOPTION
,
GOODSTYPE
,
GOODSTYPE
,
ORDERSTATUS
,
ORDERSTATUS
,
CLASSSOURCE
,
CLASSSOURCE
,
USERSTATUSFORMATER
USERSTATUSFORMATER
}
from
"../../util/wordbook"
;
}
from
"../../util/wordbook"
;
import
AddressArray
from
'../framework/address-picker/addr'
import
AddressArray
from
'../framework/address-picker/addr'
import
task
from
'./task'
import
task
from
'./task'
import
page
from
'../framework/page'
import
page
from
'../framework/page'
// import customerDetail from './customer'
// import customerDetail from './customer'
import
sourceDialog
from
'./sourceDialog'
import
sourceDialog
from
'./sourceDialog'
import
couponDialog
from
'./couponDialog'
import
couponDialog
from
'./couponDialog'
import
refundDetail
from
'./refundDetail'
import
refundDetail
from
'./refundDetail'
import
UserList
from
'../class/userList'
import
UserList
from
'../class/userList'
import
chooseGoodDialog
from
'./chooseGoodDialog'
import
chooseGoodDialog
from
'./chooseGoodDialog'
import
giftDeliverDialog
from
'./giftDeliverDialog'
let
studentSource
=
{}
let
studentSource
=
{}
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
props
:
[
props
:
[
'parentDetail'
'parentDetail'
],
],
components
:
{
components
:
{
page
,
page
,
task
,
task
,
UserList
,
UserList
,
chooseGoodDialog
,
chooseGoodDialog
,
couponDialog
,
couponDialog
,
refundDetail
,
refundDetail
,
sourceDialog
,
sourceDialog
,
// customerDetail
giftDeliverDialog
},
data
()
{
let
nowDate
=
new
Date
();
let
month
=
(
nowDate
.
getMonth
()
+
1
);
if
(
month
<
10
)
month
=
'0'
+
month
.
toString
();
nowDate
=
nowDate
.
getFullYear
()
+
'-'
+
month
;
return
{
modularContentTitle
:
""
,
modularTotal
:
0
,
modularNowPage
:
1
,
modularLimit
:
10
,
contentTotal
:
0
,
contentNowPage
:
1
,
contentLimit
:
10
,
postModularContentDialog
:
false
,
modularId
:
""
,
questionListParams
:
{
type
:
"1"
,
pid
:
""
,
keywords
:
''
},
postModularParams
:
{},
modularList
:
[],
modularContent
:
[],
tabs
:
'task'
,
nowDate
:
nowDate
,
yunjiList
:
[],
searchFrom
:
{
user_id
:
''
,
is_add_teacher
:
''
,
is_view_course
:
''
,
start_at
:
''
,
end_at
:
''
},
form
:
{
nickname
:
''
,
user_id
:
''
,
status
:
[
1
,
3
,
4
,
5
],
goods_id
:
''
,
out_trade_no
:
''
,
receive_mobile
:
""
,
mobile
:
""
,
},
task4Data
:
null
,
goodList
:
[],
orderStatusOption
:
ORDERSTATUSOPTION
,
tableData
:
[],
userList
:
[],
list
:
[],
id
:
this
.
parentDetail
?
this
.
parentDetail
.
id
:
this
.
$route
.
params
.
id
,
isBindUser
:
true
,
addShow
:
false
,
detail
:
{},
total
:
0
,
limit
:
10
,
nowPage
:
1
,
customerObj
:
{
alias
:
''
,
name
:
''
,
adviser
:
''
},
userObj
:
{
classId
:
''
,
title
:
''
,
show
:
false
,
total
:
0
,
limit
:
10
,
nowPage
:
1
,
},
addId
:
''
,
multipleSelection
:
[],
chooseGoodDialogObj
:
{
show
:
false
,
code
:
''
},
},
orderListObj
:
{
data
()
{
total
:
0
,
let
nowDate
=
new
Date
();
limit
:
10
,
let
month
=
(
nowDate
.
getMonth
()
+
1
);
nowPage
:
1
,
if
(
month
<
10
)
month
=
'0'
+
month
.
toString
();
nowDate
=
nowDate
.
getFullYear
()
+
'-'
+
month
;
return
{
modularContentTitle
:
""
,
modularTotal
:
0
,
modularNowPage
:
1
,
modularLimit
:
10
,
contentTotal
:
0
,
contentNowPage
:
1
,
contentLimit
:
10
,
postModularContentDialog
:
false
,
modularId
:
""
,
questionListParams
:
{
type
:
"1"
,
pid
:
""
,
keywords
:
''
},
postModularParams
:
{},
modularList
:
[],
modularContent
:
[],
tabs
:
'task'
,
nowDate
:
nowDate
,
yunjiList
:
[],
searchFrom
:
{
user_id
:
''
,
is_add_teacher
:
''
,
is_view_course
:
''
,
start_at
:
''
,
end_at
:
''
},
form
:
{
nickname
:
''
,
user_id
:
''
,
status
:
[
1
,
3
,
4
,
5
],
goods_id
:
''
,
out_trade_no
:
''
,
receive_mobile
:
""
,
mobile
:
""
,
gift_name
:
""
,
deliver_status
:
""
},
task4Data
:
null
,
goodList
:
[],
orderStatusOption
:
ORDERSTATUSOPTION
,
tableData
:
[],
userList
:
[],
list
:
[],
id
:
this
.
parentDetail
?
this
.
parentDetail
.
id
:
this
.
$route
.
params
.
id
,
isBindUser
:
true
,
addShow
:
false
,
detail
:
{},
total
:
0
,
limit
:
10
,
nowPage
:
1
,
customerObj
:
{
alias
:
''
,
name
:
''
,
adviser
:
''
},
userObj
:
{
classId
:
''
,
title
:
''
,
show
:
false
,
total
:
0
,
limit
:
10
,
nowPage
:
1
,
},
addId
:
''
,
multipleSelection
:
[],
chooseGoodDialogObj
:
{
show
:
false
,
code
:
''
},
orderListObj
:
{
total
:
0
,
limit
:
10
,
nowPage
:
1
,
},
yunjiListObj
:
{
total
:
0
,
limit
:
10
,
nowPage
:
1
,
},
sourceDialog
:
{
show
:
false
,
out_trade_no
:
''
},
couponDetail
:
{
show
:
false
,
order_coupon_id
:
''
},
refundDetail
:
{
show
:
false
,
out_trade_no
:
''
},
giftDeliverDialogObj
:
{
show
:
false
,
title
:
'配置赠品'
,
gift_deliver
:
null
,
goods_id
:
''
,
user_id
:
''
,
user_address_id
:
''
,
out_trade_no
:
''
,
gift_ids
:
''
,
goods_name
:
''
}
}
},
},
yunjiListObj
:
{
methods
:
{
total
:
0
,
periodName
(
val
)
{
limit
:
10
,
let
str
=
''
;
nowPage
:
1
,
if
(
!
val
.
periods_title
)
{
},
str
=
'-'
sourceDialog
:
{
}
else
{
show
:
false
,
if
(
val
.
goods_id
)
{
out_trade_no
:
''
str
+=
`【
${
val
.
goods_id
}
】`
},
}
couponDetail
:
{
if
(
val
.
periods_title
)
{
show
:
false
,
str
+=
`
${
val
.
periods_title
}
<br>`
order_coupon_id
:
''
}
},
if
(
val
.
watch_num
)
{
refundDetail
:
{
str
+=
`
${
val
.
watch_num
}
课时`
show
:
false
,
}
out_trade_no
:
''
if
(
val
.
start_at
)
{
},
str
+=
`(
${
val
.
start_at
.
slice
(
5
).
replace
(
'-'
,
''
)}
)`
}
}
},
if
(
val
.
has_watch_num
||
val
.
has_watch_num
==
0
)
{
methods
:
{
str
+=
`-d
${
val
.
has_watch_num
}
`
periodName
(
val
)
{
}
let
str
=
''
;
}
if
(
!
val
.
periods_title
)
{
return
str
str
=
'-'
},
}
else
{
onPageChangeModular
(
val
)
{
if
(
val
.
goods_id
)
{
this
.
modularNowPage
=
val
;
str
+=
`【
${
val
.
goods_id
}
】`
this
.
getList
();
}
},
if
(
val
.
periods_title
)
{
onSizeChangeModular
(
val
)
{
str
+=
`
${
val
.
periods_title
}
<br>`
this
.
modularNowPage
=
1
;
}
this
.
modularLimit
=
val
;
if
(
val
.
watch_num
)
{
this
.
getList
();
str
+=
`
${
val
.
watch_num
}
课时`
},
}
onPageChangeC
(
val
)
{
if
(
val
.
start_at
)
{
this
.
contentNowPage
=
val
;
str
+=
`(
${
val
.
start_at
.
slice
(
5
).
replace
(
'-'
,
''
)}
)`
this
.
handleChange
();
}
},
if
(
val
.
has_watch_num
||
val
.
has_watch_num
==
0
)
{
onSizeChangeC
(
val
)
{
str
+=
`-d
${
val
.
has_watch_num
}
`
this
.
contentNowPage
=
1
;
}
this
.
contentLimit
=
val
;
}
this
.
handleChange
();
return
str
},
},
showContent
(
data
)
{
onPageChangeModular
(
val
)
{
this
.
modularContentTitle
=
data
.
title
this
.
modularNowPage
=
val
;
getQuestionModularDetailApi
(
data
.
id
).
then
(
res
=>
{
this
.
getList
();
this
.
postModularParams
=
Object
.
assign
({},
res
);
},
// console.log(this.postModularParams);
onSizeChangeModular
(
val
)
{
this
.
postModularContentDialog
=
true
;
this
.
modularNowPage
=
1
;
});
this
.
modularLimit
=
val
;
},
this
.
getList
();
handleChange
()
{
},
this
.
modularContent
=
[];
onPageChangeC
(
val
)
{
// console.log(val);
this
.
contentNowPage
=
val
;
let
json
=
{
this
.
handleChange
();
type
:
this
.
questionListParams
.
type
,
},
page
:
this
.
contentNowPage
,
onSizeChangeC
(
val
)
{
limit
:
this
.
contentLimit
this
.
contentNowPage
=
1
;
};
this
.
contentLimit
=
val
;
if
(
this
.
modularId
)
{
this
.
handleChange
();
json
.
pid
=
this
.
modularId
;
},
}
showContent
(
data
)
{
if
(
this
.
questionListParams
.
keywords
)
{
this
.
modularContentTitle
=
data
.
title
json
.
keywords
=
this
.
questionListParams
.
keywords
;
getQuestionModularDetailApi
(
data
.
id
).
then
(
res
=>
{
}
this
.
postModularParams
=
Object
.
assign
({},
res
);
// this.postModularParams.pid = this.modularId;
// console.log(this.postModularParams);
getQuestionModularListApi
(
json
.
type
,
json
).
then
(
res
=>
{
this
.
postModularContentDialog
=
true
;
this
.
modularContent
=
res
.
list
;
});
console
.
log
(
res
);
},
// debugger
handleChange
()
{
this
.
contentTotal
=
res
.
total
;
this
.
modularContent
=
[];
});
// console.log(val);
},
let
json
=
{
handleClick
(
tab
)
{
type
:
this
.
questionListParams
.
type
,
// console.log(tab.name,413)
page
:
this
.
contentNowPage
,
this
.
questionListParams
.
type
=
tab
.
name
;
limit
:
this
.
contentLimit
// this.postModularParams.type = tab.name;
};
this
.
getList
();
if
(
this
.
modularId
)
{
},
json
.
pid
=
this
.
modularId
;
getList
()
{
}
let
json
=
{
if
(
this
.
questionListParams
.
keywords
)
{
type
:
this
.
questionListParams
.
type
,
json
.
keywords
=
this
.
questionListParams
.
keywords
;
modularPage
:
this
.
modularNowPage
,
}
modularLimit
:
this
.
modularLimit
// this.postModularParams.pid = this.modularId;
};
getQuestionModularListApi
(
json
.
type
,
json
).
then
(
res
=>
{
if
(
this
.
questionListParams
.
pid
)
{
this
.
modularContent
=
res
.
list
;
json
.
pid
=
this
.
questionListParams
.
pid
;
console
.
log
(
res
);
}
// debugger
getQuestionModularListApi
(
json
.
type
,
json
).
then
(
res
=>
{
this
.
contentTotal
=
res
.
total
;
this
.
modularList
=
res
.
list
;
});
console
.
log
(
this
.
modularList
);
},
// debugger
handleClick
(
tab
)
{
this
.
modularTotal
=
res
.
total
;
// console.log(tab.name,413)
});
this
.
questionListParams
.
type
=
tab
.
name
;
},
// this.postModularParams.type = tab.name;
userStatusFormatter
(
val
)
{
this
.
getList
();
return
(
USERSTATUSFORMATER
[
val
.
user_status
])
},
},
getList
()
{
getTask4
()
{
let
json
=
{
task4Api
(
this
.
id
).
then
(
res
=>
{
type
:
this
.
questionListParams
.
type
,
this
.
task4Data
=
res
modularPage
:
this
.
modularNowPage
,
})
modularLimit
:
this
.
modularLimit
},
};
handleSelectionChange
(
val
)
{
if
(
this
.
questionListParams
.
pid
)
{
this
.
multipleSelection
=
val
;
json
.
pid
=
this
.
questionListParams
.
pid
;
},
}
onAdd
()
{
getQuestionModularListApi
(
json
.
type
,
json
).
then
(
res
=>
{
let
json
=
{
this
.
modularList
=
res
.
list
;
is_buy
:
0
console
.
log
(
this
.
modularList
);
}
// debugger
if
(
this
.
multipleSelection
.
length
===
0
)
{
this
.
modularTotal
=
res
.
total
;
this
.
$message
({
});
type
:
'error'
,
},
message
:
'请选择用户!'
userStatusFormatter
(
val
)
{
});
return
(
USERSTATUSFORMATER
[
val
.
user_status
])
return
},
}
else
if
(
this
.
multipleSelection
.
length
!==
1
)
{
getTask4
()
{
this
.
$message
({
task4Api
(
this
.
id
).
then
(
res
=>
{
type
:
'error'
,
this
.
task4Data
=
res
message
:
'只能选择一个用户!'
})
});
},
return
handleSelectionChange
(
val
)
{
}
this
.
multipleSelection
=
val
;
this
.
addId
=
this
.
multipleSelection
[
0
].
user_id
;
},
if
(
!
this
.
addId
)
{
onAdd
()
{
return
let
json
=
{
}
is_buy
:
0
if
(
!
this
.
isBindUser
)
{
}
if
(
this
.
multipleSelection
.
length
===
0
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请选择用户!'
});
return
}
else
if
(
this
.
multipleSelection
.
length
!==
1
)
{
this
.
$message
({
type
:
'error'
,
message
:
'只能选择一个用户!'
});
return
}
this
.
addId
=
this
.
multipleSelection
[
0
].
user_id
;
if
(
!
this
.
addId
)
{
return
}
if
(
!
this
.
isBindUser
)
{
}
else
{
}
else
{
teacherBindUserApi
(
this
.
id
,
{
user_id
:
this
.
addId
}).
then
(
res
=>
{
teacherBindUserApi
(
this
.
id
,
{
user_id
:
this
.
addId
}).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'绑定成功!'
message
:
'绑定成功!'
});
});
this
.
id
=
this
.
parentDetail
?
this
.
parentDetail
.
id
:
this
.
$route
.
params
.
id
;
this
.
id
=
this
.
parentDetail
?
this
.
parentDetail
.
id
:
this
.
$route
.
params
.
id
;
this
.
getTeacherDetail
();
this
.
getTeacherDetail
();
this
.
getGoodsOption
();
this
.
getGoodsOption
();
this
.
addShow
=
false
;
this
.
addShow
=
false
;
})
})
}
}
},
},
onAddUser
(
flag
)
{
onAddUser
(
flag
)
{
this
.
isBindUser
=
flag
;
this
.
isBindUser
=
flag
;
this
.
addShow
=
true
;
this
.
addShow
=
true
;
this
.
getUser
();
this
.
getUser
();
},
},
getUser
()
{
getUser
()
{
let
json
=
{
let
json
=
{
page
:
this
.
userObj
.
nowPage
,
page
:
this
.
userObj
.
nowPage
,
limit
:
this
.
userObj
.
limit
,
limit
:
this
.
userObj
.
limit
,
};
};
if
(
this
.
searchFrom
.
userId
)
{
if
(
this
.
searchFrom
.
userId
)
{
json
.
user_id
=
this
.
searchFrom
.
userId
json
.
user_id
=
this
.
searchFrom
.
userId
}
}
if
(
this
.
searchFrom
.
nickName
)
{
if
(
this
.
searchFrom
.
nickName
)
{
json
.
nickname
=
this
.
searchFrom
.
nickName
json
.
nickname
=
this
.
searchFrom
.
nickName
}
}
if
(
this
.
searchFrom
.
mobile
)
{
if
(
this
.
searchFrom
.
mobile
)
{
json
.
mobile
=
this
.
searchFrom
.
mobile
json
.
mobile
=
this
.
searchFrom
.
mobile
}
}
getUserListApi
(
json
).
then
(
res
=>
{
getUserListApi
(
json
).
then
(
res
=>
{
this
.
userList
=
res
.
list
;
this
.
userList
=
res
.
list
;
this
.
userObj
.
total
=
res
.
total
;
this
.
userObj
.
total
=
res
.
total
;
})
})
},
},
changeRow
(
data
,
b
)
{
changeRow
(
data
,
b
)
{
if
(
b
.
indexOf
(
data
)
>
-
1
)
{
if
(
b
.
indexOf
(
data
)
>
-
1
)
{
getClassStatisticsApi
(
data
.
periods_id
,
data
.
id
).
then
(
res
=>
{
getClassStatisticsApi
(
data
.
periods_id
,
data
.
id
).
then
(
res
=>
{
data
.
arrive_course_rate
=
res
.
arrive_course_rate
;
data
.
arrive_course_rate
=
res
.
arrive_course_rate
;
data
.
watch_course_rate
=
res
.
watch_course_rate
;
data
.
watch_course_rate
=
res
.
watch_course_rate
;
data
.
over_course_rate
=
res
.
over_course_rate
;
data
.
over_course_rate
=
res
.
over_course_rate
;
data
.
work_rate
=
res
.
work_rate
;
data
.
work_rate
=
res
.
work_rate
;
data
.
over_work_rate
=
res
.
over_work_rate
;
data
.
over_work_rate
=
res
.
over_work_rate
;
data
.
clock_rate
=
res
.
clock_rate
;
data
.
clock_rate
=
res
.
clock_rate
;
data
.
over_clock_rate
=
res
.
over_clock_rate
;
data
.
over_clock_rate
=
res
.
over_clock_rate
;
data
.
transform_rate
=
res
.
transform_rate
;
data
.
transform_rate
=
res
.
transform_rate
;
})
})
}
}
},
},
showUser
(
data
)
{
showUser
(
data
)
{
console
.
log
(
data
)
console
.
log
(
data
)
let
classType
=
data
.
type
==
1
?
'(带班班级)'
:
'(观摩班级)'
let
classType
=
data
.
type
==
1
?
'(带班班级)'
:
'(观摩班级)'
this
.
userObj
=
{
this
.
userObj
=
{
classId
:
data
.
id
,
classId
:
data
.
id
,
show
:
true
,
show
:
true
,
title
:
`
${
this
.
detail
.
name
}
班级用户列表
${
classType
}
`
,
title
:
`
${
this
.
detail
.
name
}
班级用户列表
${
classType
}
`
,
teacherId
:
data
.
teacher_id
,
teacherId
:
data
.
teacher_id
,
periods_id
:
data
.
periods_id
,
periods_id
:
data
.
periods_id
,
goods_id
:
data
.
goods_id
,
goods_id
:
data
.
goods_id
,
type
:
data
.
type
type
:
data
.
type
}
}
},
},
onPageChange4
(
val
)
{
onPageChange4
(
val
)
{
this
.
userObj
.
nowPage
=
val
;
this
.
userObj
.
nowPage
=
val
;
this
.
getUser
()
this
.
getUser
()
},
},
onSizeChange4
(
val
)
{
onSizeChange4
(
val
)
{
this
.
userObj
.
limit
=
val
;
this
.
userObj
.
limit
=
val
;
this
.
userObj
.
nowPage
=
1
;
this
.
userObj
.
nowPage
=
1
;
this
.
getUser
();
this
.
getUser
();
},
},
onPageChange
(
val
)
{
onPageChange
(
val
)
{
this
.
nowPage
=
val
;
this
.
nowPage
=
val
;
this
.
getTeacherDetail
();
this
.
getTeacherDetail
();
},
},
onSizeChange
(
val
)
{
onSizeChange
(
val
)
{
this
.
limit
=
val
;
this
.
limit
=
val
;
this
.
nowPage
=
1
;
this
.
nowPage
=
1
;
this
.
getTeacherDetail
();
this
.
getTeacherDetail
();
},
},
onPageChange2
(
val
)
{
onPageChange2
(
val
)
{
this
.
orderListObj
.
nowPage
=
val
;
this
.
orderListObj
.
nowPage
=
val
;
this
.
getOrderList
()
this
.
getOrderList
()
},
},
onSizeChange2
(
val
)
{
onSizeChange2
(
val
)
{
this
.
orderListObj
.
limit
=
val
;
this
.
orderListObj
.
limit
=
val
;
this
.
orderListObj
.
nowPage
=
1
;
this
.
orderListObj
.
nowPage
=
1
;
this
.
getOrderList
()
this
.
getOrderList
()
},
},
onPageChange3
(
val
)
{
onPageChange3
(
val
)
{
this
.
yunjiListObj
.
nowPage
=
val
;
this
.
yunjiListObj
.
nowPage
=
val
;
this
.
getyunjiList
()
this
.
getyunjiList
()
},
},
onSizeChange3
(
val
)
{
onSizeChange3
(
val
)
{
this
.
yunjiListObj
.
limit
=
val
;
this
.
yunjiListObj
.
limit
=
val
;
this
.
yunjiListObj
.
nowPage
=
1
;
this
.
yunjiListObj
.
nowPage
=
1
;
this
.
getyunjiList
()
this
.
getyunjiList
()
},
},
getTeacherDetail
()
{
getTeacherDetail
()
{
this
.
searchFrom
=
{
this
.
searchFrom
=
{
user_id
:
''
,
user_id
:
''
,
is_add_teacher
:
''
,
is_add_teacher
:
''
,
is_view_course
:
''
,
is_view_course
:
''
,
start_at
:
''
,
start_at
:
''
,
end_at
:
''
end_at
:
''
};
};
let
id
=
this
.
id
;
let
id
=
this
.
id
;
let
json
=
{
let
json
=
{
limit
:
this
.
limit
,
limit
:
this
.
limit
,
page
:
this
.
nowPage
page
:
this
.
nowPage
}
}
// getClassListApi(this.id,json).then(res =>{
// getClassListApi(this.id,json).then(res =>{
// console.log(res)
// console.log(res)
// debugger
// debugger
// })
// })
console
.
log
(
9999999
)
console
.
log
(
9999999
)
console
.
log
(
this
.
id
)
console
.
log
(
this
.
id
)
// debugger
// debugger
getTeacherDetailApi
(
id
,
json
).
then
((
res
)
=>
{
getTeacherDetailApi
(
id
,
json
).
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
detail
=
res
;
this
.
detail
=
res
;
if
(
this
.
detail
.
class_list
)
{
if
(
this
.
detail
.
class_list
)
{
this
.
detail
.
class_list
.
list
.
forEach
(
data
=>
{
this
.
detail
.
class_list
.
list
.
forEach
(
data
=>
{
data
.
arrive_course_rate
=
0
;
data
.
arrive_course_rate
=
0
;
data
.
watch_course_rate
=
0
;
data
.
watch_course_rate
=
0
;
data
.
over_course_rate
=
0
;
data
.
over_course_rate
=
0
;
data
.
work_rate
=
0
;
data
.
work_rate
=
0
;
data
.
over_work_rate
=
0
;
data
.
over_work_rate
=
0
;
data
.
clock_rate
=
0
;
data
.
clock_rate
=
0
;
data
.
over_clock_rate
=
0
;
data
.
over_clock_rate
=
0
;
data
.
transform_rate
=
0
;
data
.
transform_rate
=
0
;
});
});
this
.
list
=
this
.
detail
.
class_list
.
list
||
[];
this
.
list
=
this
.
detail
.
class_list
.
list
||
[];
this
.
total
=
this
.
detail
.
class_list
.
total
;
this
.
total
=
this
.
detail
.
class_list
.
total
;
}
}
// this.getOrderList();
// this.getOrderList();
})
})
},
},
createInviteLink
(
val
)
{
createInviteLink
(
val
)
{
this
.
chooseGoodDialogObj
.
show
=
true
;
this
.
chooseGoodDialogObj
.
show
=
true
;
//类型选择项
//类型选择项
if
(
this
.
detail
.
type
==
0
)
{
if
(
this
.
detail
.
type
==
0
)
{
this
.
chooseGoodDialogObj
.
code
=
`CC-TEACHER-
${
val
.
user_id
}
`
;
this
.
chooseGoodDialogObj
.
code
=
`CC-TEACHER-
${
val
.
user_id
}
`
;
}
else
if
(
this
.
detail
.
type
==
1
)
{
}
else
if
(
this
.
detail
.
type
==
1
)
{
this
.
chooseGoodDialogObj
.
code
=
`CC-XXMM-
${
val
.
user_id
}
`
;
this
.
chooseGoodDialogObj
.
code
=
`CC-XXMM-
${
val
.
user_id
}
`
;
}
else
{
}
else
{
this
.
chooseGoodDialogObj
.
code
=
`CC-TEACHER-
${
val
.
user_id
}
`
;
this
.
chooseGoodDialogObj
.
code
=
`CC-TEACHER-
${
val
.
user_id
}
`
;
}
}
},
},
changeShow
()
{
changeShow
()
{
this
.
chooseGoodDialogObj
.
show
=
false
;
this
.
chooseGoodDialogObj
.
show
=
false
;
this
.
chooseGoodDialogObj
.
code
=
''
;
this
.
chooseGoodDialogObj
.
code
=
''
;
},
},
getOrderList
()
{
getOrderList
()
{
let
json
=
{
let
json
=
{
limit
:
this
.
orderListObj
.
limit
,
limit
:
this
.
orderListObj
.
limit
,
page
:
this
.
orderListObj
.
nowPage
page
:
this
.
orderListObj
.
nowPage
};
};
if
(
this
.
form
.
nickname
)
{
if
(
this
.
form
.
nickname
)
{
json
.
nickname
=
this
.
form
.
nickname
json
.
nickname
=
this
.
form
.
nickname
}
}
if
(
this
.
form
.
user_id
)
{
if
(
this
.
form
.
user_id
)
{
json
.
user_id
=
this
.
form
.
user_id
json
.
user_id
=
this
.
form
.
user_id
}
}
if
(
this
.
form
.
status
)
{
if
(
this
.
form
.
status
)
{
json
.
status
=
this
.
form
.
status
.
toString
()
json
.
status
=
this
.
form
.
status
.
toString
()
}
}
if
(
this
.
form
.
goods_id
)
{
if
(
this
.
form
.
goods_id
)
{
json
.
goods_id
=
this
.
form
.
goods_id
json
.
goods_id
=
this
.
form
.
goods_id
}
}
if
(
this
.
form
.
receive_mobile
)
{
if
(
this
.
form
.
receive_mobile
)
{
json
.
receive_mobile
=
this
.
form
.
receive_mobile
json
.
receive_mobile
=
this
.
form
.
receive_mobile
}
}
if
(
this
.
form
.
out_trade_no
)
{
if
(
this
.
form
.
out_trade_no
)
{
json
.
out_trade_no
=
this
.
form
.
out_trade_no
json
.
out_trade_no
=
this
.
form
.
out_trade_no
}
}
if
(
this
.
form
.
mobile
)
{
if
(
this
.
form
.
mobile
)
{
json
.
mobile
=
this
.
form
.
mobile
json
.
mobile
=
this
.
form
.
mobile
}
}
// if(this.id){
if
(
this
.
form
.
gift_name
)
{
// json.invite_id=this.id;
json
.
gift_name
=
this
.
form
.
gift_name
// debugger
}
// }
if
(
this
.
form
.
deliver_status
)
{
// json.teacher_id=this.id;
json
.
deliver_status
=
this
.
form
.
deliver_status
// json.invite_id=this.id;
}
if
(
this
.
detail
.
user_id
!==
0
)
{
// if(this.id){
json
.
invite_id
=
this
.
detail
.
user_id
;
// json.invite_id=this.id;
getOrderListApi
(
json
).
then
((
res
)
=>
{
// debugger
res
.
list
.
forEach
(
i
=>
{
// }
i
.
refundList
=
[]
// json.teacher_id=this.id;
});
// json.invite_id=this.id;
this
.
tableData
=
res
.
list
;
if
(
this
.
detail
.
user_id
!==
0
)
{
this
.
orderListObj
.
total
=
res
.
total
json
.
invite_id
=
this
.
detail
.
user_id
;
})
getOrderListApi
(
json
).
then
((
res
)
=>
{
}
res
.
list
.
forEach
(
i
=>
{
i
.
refundList
=
[]
});
this
.
tableData
=
res
.
list
;
this
.
orderListObj
.
total
=
res
.
total
})
}
},
},
getGoodsOption
()
{
getGoodsOption
()
{
let
json
=
{
let
json
=
{
page
:
1
,
page
:
1
,
limit
:
100
,
limit
:
100
,
course_type
:
0
,
course_type
:
0
,
};
};
getGoodsListApi
(
json
).
then
(
res
=>
{
getGoodsListApi
(
json
).
then
(
res
=>
{
this
.
goodList
=
res
.
list
;
this
.
goodList
=
res
.
list
;
})
})
},
},
editComment
(
id
,
desc
)
{
editComment
(
id
,
desc
)
{
this
.
$prompt
(
''
,
'编辑备注'
,
{
this
.
$prompt
(
''
,
'编辑备注'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
inputType
:
'textarea'
,
inputType
:
'textarea'
,
inputValue
:
desc
||
''
inputValue
:
desc
||
''
}).
then
(({
value
})
=>
{
}).
then
(({
value
})
=>
{
this
.
$confirm
(
'确定保存?'
,
'提示'
,
{
this
.
$confirm
(
'确定保存?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
editOrderDescApi
(
id
,
'order'
,
{
desc
:
value
}).
then
(
res
=>
{
editOrderDescApi
(
id
,
'order'
,
{
desc
:
value
}).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'编辑备注成功'
message
:
'编辑备注成功'
});
});
this
.
getOrderList
();
this
.
getOrderList
();
});
});
});
});
})
})
},
},
showRef
(
data
)
{
editGiftDeliver
(
data
)
{
this
.
refundDetail
.
show
=
true
;
this
.
giftDeliverDialogObj
.
show
=
true
;
this
.
refundDetail
.
out_trade_no
=
data
.
out_trade_no
;
this
.
giftDeliverDialogObj
.
gift_deliver
=
data
.
gift_deliver
;
},
this
.
giftDeliverDialogObj
.
goods_id
=
data
.
goods_id
;
showCoupon
(
data
)
{
this
.
giftDeliverDialogObj
.
user_id
=
data
.
user_id
;
this
.
couponDetail
.
show
=
true
;
this
.
giftDeliverDialogObj
.
user_address_id
=
data
.
user_address_id
;
this
.
couponDetail
.
order_coupon_id
=
data
.
order_coupon_id
;
this
.
giftDeliverDialogObj
.
out_trade_no
=
data
.
out_trade_no
;
},
this
.
giftDeliverDialogObj
.
goods_name
=
data
.
goods_name
;
showSource
(
data
)
{
},
this
.
sourceDialog
.
show
=
true
;
showRef
(
data
)
{
this
.
sourceDialog
.
out_trade_no
=
data
.
out_trade_no
;
this
.
refundDetail
.
show
=
true
;
},
this
.
refundDetail
.
out_trade_no
=
data
.
out_trade_no
;
getyunjiList
()
{
},
let
json
=
{
showCoupon
(
data
)
{
limit
:
this
.
yunjiListObj
.
limit
,
this
.
couponDetail
.
show
=
true
;
page
:
this
.
yunjiListObj
.
nowPage
this
.
couponDetail
.
order_coupon_id
=
data
.
order_coupon_id
;
};
},
if
(
this
.
form
.
nickname
)
{
showSource
(
data
)
{
json
.
nickname
=
this
.
form
.
nickname
this
.
sourceDialog
.
show
=
true
;
}
this
.
sourceDialog
.
out_trade_no
=
data
.
out_trade_no
;
if
(
this
.
form
.
user_id
)
{
},
json
.
user_id
=
this
.
form
.
user_id
getyunjiList
()
{
}
let
json
=
{
if
(
this
.
form
.
status
)
{
limit
:
this
.
yunjiListObj
.
limit
,
json
.
status
=
this
.
form
.
status
.
toString
()
page
:
this
.
yunjiListObj
.
nowPage
}
};
if
(
this
.
form
.
goods_id
)
{
if
(
this
.
form
.
nickname
)
{
json
.
goods_id
=
this
.
form
.
goods_id
json
.
nickname
=
this
.
form
.
nickname
}
}
if
(
this
.
form
.
receive_mobile
)
{
if
(
this
.
form
.
user_id
)
{
json
.
receive_mobile
=
this
.
form
.
receive_mobile
json
.
user_id
=
this
.
form
.
user_id
}
}
if
(
this
.
form
.
out_trade_no
)
{
if
(
this
.
form
.
status
)
{
json
.
out_trade_no
=
this
.
form
.
out_trade_no
json
.
status
=
this
.
form
.
status
.
toString
()
}
}
if
(
this
.
form
.
mobile
)
{
if
(
this
.
form
.
goods_id
)
{
json
.
mobile
=
this
.
form
.
mobile
json
.
goods_id
=
this
.
form
.
goods_id
}
}
if
(
this
.
id
)
{
if
(
this
.
form
.
receive_mobile
)
{
json
.
teacher_id
=
this
.
id
;
json
.
receive_mobile
=
this
.
form
.
receive_mobile
}
}
getyunjiApi
(
json
).
then
(
res
=>
{
if
(
this
.
form
.
out_trade_no
)
{
this
.
yunjiListObj
.
total
=
res
.
total
;
json
.
out_trade_no
=
this
.
form
.
out_trade_no
this
.
yunjiList
=
res
.
list
?
res
.
list
:
[];
}
});
if
(
this
.
form
.
mobile
)
{
}
json
.
mobile
=
this
.
form
.
mobile
},
}
filters
:
{
if
(
this
.
id
)
{
teacherType
(
value
)
{
json
.
teacher_id
=
this
.
id
;
return
TEACHERTYPE
[
value
]
}
},
getyunjiApi
(
json
).
then
(
res
=>
{
percent
(
val
)
{
this
.
yunjiListObj
.
total
=
res
.
total
;
return
(
val
*
100
).
toFixed
(
2
)
+
'%'
this
.
yunjiList
=
res
.
list
?
res
.
list
:
[];
},
});
status
(
value
)
{
}
return
ORDERSTATUS
[
value
]
},
},
filters
:
{
moneytFilter
(
val
)
{
teacherType
(
value
)
{
return
val
=
val
/
100
+
'元'
return
TEACHERTYPE
[
value
]
},
},
filterGoods
(
val
)
{
percent
(
val
)
{
return
'['
+
val
.
id
+
']'
+
'['
+
GOODSTYPE
[
val
.
goods_type
]
+
']'
+
'['
+
val
.
current_price
/
100
+
'元]'
+
val
.
name
return
(
val
*
100
).
toFixed
(
2
)
+
'%'
},
},
classSource
(
val
)
{
status
(
value
)
{
// return CLASSSOURCE[val]
return
ORDERSTATUS
[
value
]
return
studentSource
[
val
]
},
}
moneytFilter
(
val
)
{
},
return
val
=
val
/
100
+
'元'
created
()
{
},
this
.
customerObj
.
alias
=
this
.
parentDetail
?
this
.
parentDetail
.
alias
:
this
.
$route
.
params
.
alias
;
filterGoods
(
val
)
{
this
.
customerObj
.
name
=
this
.
parentDetail
?
this
.
parentDetail
.
name
:
this
.
$route
.
params
.
name
;
return
'['
+
val
.
id
+
']'
+
'['
+
GOODSTYPE
[
val
.
goods_type
]
+
']'
+
'['
+
val
.
current_price
/
100
+
'元]'
+
val
.
name
this
.
customerObj
.
adviser
=
this
.
parentDetail
?
this
.
parentDetail
.
adviser
:
this
.
$route
.
params
.
adviser
;
},
},
classSource
(
val
)
{
mounted
()
{
// return CLASSSOURCE[val]
this
.
getTeacherDetail
();
return
studentSource
[
val
]
console
.
log
(
this
.
parentDetail
)
}
},
created
()
{
this
.
customerObj
.
alias
=
this
.
parentDetail
?
this
.
parentDetail
.
alias
:
this
.
$route
.
params
.
alias
;
this
.
customerObj
.
name
=
this
.
parentDetail
?
this
.
parentDetail
.
name
:
this
.
$route
.
params
.
name
;
this
.
customerObj
.
adviser
=
this
.
parentDetail
?
this
.
parentDetail
.
adviser
:
this
.
$route
.
params
.
adviser
;
},
mounted
()
{
this
.
getTeacherDetail
();
console
.
log
(
this
.
parentDetail
)
// this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
// this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
this
.
getTask4
();
this
.
getTask4
();
getSourceStudentApi
().
then
(
res
=>
{
getSourceStudentApi
().
then
(
res
=>
{
let
obj
=
{}
let
obj
=
{}
res
.
forEach
((
item
,
index
)
=>
{
res
.
forEach
((
item
,
index
)
=>
{
obj
[
item
.
type
]
=
item
.
name
obj
[
item
.
type
]
=
item
.
name
})
})
studentSource
=
obj
studentSource
=
obj
// console.log(obj)
// console.log(obj)
});
});
this
.
getGoodsOption
();
this
.
getGoodsOption
();
},
},
watch
:
{
watch
:
{
'tabs'
(
value
)
{
'tabs'
(
value
)
{
if
(
value
===
'order'
)
{
if
(
value
===
'order'
)
{
this
.
getOrderList
();
this
.
getOrderList
();
}
}
if
(
value
===
'yunji'
)
{
if
(
value
===
'yunji'
)
{
this
.
getyunjiList
();
this
.
getyunjiList
();
}
}
if
(
value
===
'huashu'
)
{
if
(
value
===
'huashu'
)
{
this
.
getList
();
this
.
getList
();
}
}
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
...
@@ -1210,6 +1280,11 @@
...
@@ -1210,6 +1280,11 @@
justify-content
:
flex-start
;
justify-content
:
flex-start
;
align-items
:
center
;
align-items
:
center
;
}
}
.gift_deliver
{
color
:
rgb
(
64
,
158
,
255
)
!important
;
text-decoration
:
none
!important
;
}
</
style
>
</
style
>
src/service/api.js
View file @
7edf6ee5
...
@@ -99,7 +99,6 @@ export const getTeacherListApi = function (json) {
...
@@ -99,7 +99,6 @@ export const getTeacherListApi = function (json) {
//获取教师详情
//获取教师详情
const
getTeacherDetailUrl
=
`
${
_baseUrl
}
api/admin/teacher/info`
;
const
getTeacherDetailUrl
=
`
${
_baseUrl
}
api/admin/teacher/info`
;
export
const
getTeacherDetailApi
=
function
(
id
,
json
)
{
export
const
getTeacherDetailApi
=
function
(
id
,
json
)
{
console
.
log
(
id
)
return
Vue
.
prototype
.
$fetch
(
`
${
getTeacherDetailUrl
}
/
${
id
}
`
,
json
)
return
Vue
.
prototype
.
$fetch
(
`
${
getTeacherDetailUrl
}
/
${
id
}
`
,
json
)
};
};
//添加教师
//添加教师
...
@@ -237,7 +236,6 @@ const deleteGoodsUrl = `${_baseUrl}api/admin/goods`;
...
@@ -237,7 +236,6 @@ const deleteGoodsUrl = `${_baseUrl}api/admin/goods`;
export
const
deleteGoodsApi
=
function
(
id
)
{
export
const
deleteGoodsApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
deleteGoodsUrl
}
/
${
id
}
`
)
return
Vue
.
prototype
.
$del
(
`
${
deleteGoodsUrl
}
/
${
id
}
`
)
};
};
// 商品上架
// 商品上架
const
upGoodsUrl
=
`
${
_baseUrl
}
api/admin/goods/putaway/`
;
const
upGoodsUrl
=
`
${
_baseUrl
}
api/admin/goods/putaway/`
;
export
const
upGoodsApi
=
function
(
id
)
{
export
const
upGoodsApi
=
function
(
id
)
{
...
@@ -1220,7 +1218,6 @@ export const deleteQuestionModularDetailApi = function (question_id) {
...
@@ -1220,7 +1218,6 @@ export const deleteQuestionModularDetailApi = function (question_id) {
export
const
sortQuestionModularDetailApi
=
function
(
json
)
{
export
const
sortQuestionModularDetailApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$put
(
`/api/admin/question/sort/`
,
json
)
return
Vue
.
prototype
.
$put
(
`/api/admin/question/sort/`
,
json
)
};
};
//用户收货地址
//用户收货地址
export
const
fetchAddressListApi
=
function
(
uid
)
{
export
const
fetchAddressListApi
=
function
(
uid
)
{
return
Vue
.
prototype
.
$fetch
(
`/api/admin/student/address/
${
uid
}
`
)
return
Vue
.
prototype
.
$fetch
(
`/api/admin/student/address/
${
uid
}
`
)
...
@@ -1502,4 +1499,58 @@ export const getHourTimeApi = function (json) {
...
@@ -1502,4 +1499,58 @@ export const getHourTimeApi = function (json) {
export
const
getGrowthRecordApi
=
function
(
json
)
{
export
const
getGrowthRecordApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/user/growth/list`
,
json
)
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/user/growth/list`
,
json
)
};
};
//赠品配置列表
const
relationGiftUrl
=
`
${
_baseUrl
}
api/admin/gift/config/list`
;
export
const
relationGiftApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
relationGiftUrl
}
`
,
json
)
};
// 订单配置赠品
const
orderSetUrl
=
`
${
_baseUrl
}
api/admin/order/set/gift`
;
export
const
orderSetApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
orderSetUrl
}
`
,
json
)
};
// 赠品领取记录
const
receiveRecordUrl
=
`
${
_baseUrl
}
api/admin/gift/receive/record`
;
export
const
receiveRecordApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
receiveRecordUrl
}
`
,
json
)
};
// 添加赠品配置
const
giftConfigAddUrl
=
`
${
_baseUrl
}
api/admin/gift/config/add`
;
export
const
giftConfigAddApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
giftConfigAddUrl
}
`
,
json
)
};
// 编辑赠品配置
const
giftConfigEditUrl
=
`
${
_baseUrl
}
api/admin/gift/config`
;
export
const
giftConfigEditApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
giftConfigEditUrl
}
/
${
id
}
`
,
json
)
};
// 赠品下架
const
giftSoldoutUrl
=
`
${
_baseUrl
}
api/admin/gift/soldout`
;
export
const
giftSoldoutApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$patch
(
`
${
giftSoldoutUrl
}
/
${
id
}
`
)
};
// 合同协议列表
const
contractListUrl
=
`
${
_baseUrl
}
api/admin/contract/list`
;
export
const
contractListApi
=
function
()
{
return
Vue
.
prototype
.
$fetch
(
`
${
contractListUrl
}
`
)
};
// 合同状态切换
const
contractSwitchstatusUrl
=
`
${
_baseUrl
}
api/admin/contract/switchstatus`
;
export
const
contractSwitchstatusApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
contractSwitchstatusUrl
}
/
${
id
}
`
,
json
)
};
// 合同协议绑定商品
const
contractGoodslistUrl
=
`
${
_baseUrl
}
api/admin/contract/goodslist`
;
export
const
contractGoodslistApi
=
function
()
{
return
Vue
.
prototype
.
$fetch
(
`
${
contractGoodslistUrl
}
`
)
};
// 合同协议创建
const
contractAddUrl
=
`
${
_baseUrl
}
api/admin/contract/add`
;
export
const
contractAddApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
contractAddUrl
}
`
,
json
)
};
// 合同协议编辑
const
contractEditUrl
=
`
${
_baseUrl
}
api/admin/contract/edit`
;
export
const
contractEditApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$patch
(
`
${
contractEditUrl
}
/
${
id
}
`
,
json
)
};
src/util/menuList.js
View file @
7edf6ee5
...
@@ -536,6 +536,26 @@ export default [
...
@@ -536,6 +536,26 @@ export default [
name
:
'disposable'
,
name
:
'disposable'
,
component
:
e
=>
require
([
'@/components/disposable'
],
e
),
component
:
e
=>
require
([
'@/components/disposable'
],
e
),
}
}
},
{
value
:
'赠品配置'
,
routerName
:
'gitConfig'
,
path
:
'/gitConfig'
,
cover
:
'6-5'
,
router
:
{
path
:
'/gitConfig'
,
name
:
'gitConfig'
,
component
:
e
=>
require
([
'@/components/gitConfig'
],
e
),
}
},
{
value
:
'赠品领取记录'
,
routerName
:
'gitDeliverRecord'
,
path
:
'/gitDeliverRecord'
,
cover
:
'6-6'
,
router
:
{
path
:
'/gitDeliverRecord'
,
name
:
'gitDeliverRecord'
,
component
:
e
=>
require
([
'@/components/gitDeliverRecord'
],
e
),
}
}
}
]
]
},
{
},
{
...
@@ -720,7 +740,17 @@ export default [
...
@@ -720,7 +740,17 @@ export default [
name
:
'config'
,
name
:
'config'
,
component
:
e
=>
require
([
'@/components/config'
],
e
),
component
:
e
=>
require
([
'@/components/config'
],
e
),
}
}
},
},
{
value
:
'合同协议管理'
,
routerName
:
'contract'
,
path
:
'/contract'
,
cover
:
'10-6'
,
router
:
{
path
:
'/contract'
,
name
:
'contract'
,
component
:
e
=>
require
([
'@/components/contract'
],
e
),
}
}
]
]
},
{
},
{
name
:
''
,
name
:
''
,
...
...
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