Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
9e8cad6d
Commit
9e8cad6d
authored
Mar 04, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
‘1’
parent
36d66056
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
450 additions
and
0 deletions
+450
-0
CouponList.vue
src/components/activity/Coupon/CouponList.vue
+450
-0
No files found.
src/components/activity/Coupon/CouponList.vue
0 → 100644
View file @
9e8cad6d
<
style
>
.user_time_picker
.el-date-editor--date
>
.el-input__inner
{
padding
:
0
10px
;
font-size
:
13px
;
}
.user_time_picker
.el-date-editor--date
>
span
.el-input__prefix
{
display
:
none
;
}
.user_time_picker
.el-date-editor--date
>
span
.el-input__suffix
{
top
:
-4px
;
right
:
2px
;
}
.zidingyiFz
i
{
font-size
:
14px
!important
;
}
</
style
>
<
template
>
<div
class=
"flexOne"
>
<div
class=
"query-box"
>
<ul
class=
"user_time_picker"
>
<li>
<span>
<em>
公司
</em>
<el-select
filterable
:disabled=
"msg.IsParentCompany==2"
v-model=
"msg.branchId"
>
<el-option
label=
"不限"
value=
"-1"
></el-option>
<el-option
v-for=
"item in companyList"
:label=
"item.BName"
:value=
"item.Id"
:key=
"item.Id"
></el-option>
</el-select>
</span>
</li>
<li>
<span>
<em>
所属线路
</em>
<el-select
filterable
v-model=
"msg.lineId"
>
<el-option
label=
"不限"
:value=
"-1"
></el-option>
<el-option
v-for=
"item in LineList"
:label=
"item.LineName"
:value=
"item.LineID"
:key=
"item.LineID"
></el-option>
</el-select>
</span>
</li>
<li>
<span>
<em>
优惠券名称
</em>
<el-input
v-model=
"msg.couponsName"
@
keyup
.
enter
.
native=
"getList"
></el-input>
</span>
</li>
<li>
<span>
<em>
状态
</em>
<el-select
filterable
v-model=
"msg.couponStatus"
>
<el-option
label=
"不限"
:value=
"-1"
></el-option>
<el-option
label=
"正常"
:value=
"1"
></el-option>
<el-option
label=
"禁用"
:value=
"2"
></el-option>
<el-option
label=
"已作废"
:value=
"3"
></el-option>
</el-select>
</span>
</li>
<li>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"查询"
@
click=
"resetPageIndex(),getList()"
>
<input
type=
"button"
@
click=
"outerVisible = true,isleaveBtn=false,dialogTitle='新增优惠券',getCompany()"
class=
"normalBtn"
value=
"新增"
>
</li>
</ul>
</div>
<div
class=
"clearfix"
></div>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
<tr>
<th>
优惠券名
</th>
<th>
类型
</th>
<th>
面额
</th>
<th>
使用条件
</th>
<th>
使用状态
</th>
<th>
叠加使用
</th>
<th>
生效日期
</th>
<th>
过期日期
</th>
<th>
创建人
</th>
<th>
操作
</th>
</tr>
<tr
v-for=
"(item,index) in DataList"
v-loading=
"loading"
>
<td>
{{
item
.
BranchName
}}
</td>
<td>
{{
item
.
DepartName
}}
</td>
<td>
{{
item
.
PostName
}}
</td>
<td>
{{
item
.
EmName
}}
</td>
<td>
{{
item
.
EmSex
==
0
?
'男'
:
'女'
}}
</td>
<td>
{{
item
.
EmAccount
}}
</td>
<td>
{{
item
.
EmLoginMobile
}}
</td>
<td>
{{
item
.
EmEntry
}}
</td>
<td>
{{
item
.
EmLeave
}}
</td>
<td>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"修改用户信息"
placement=
"top"
>
<el-button
type=
"primary"
icon=
"el-icon-edit"
circle
@
click=
"outerVisible=true,dialogTitle='修改用户信息',updateData(item.EmployeeId),getCompany()"
></el-button>
</el-tooltip>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"绑定账户信息"
placement=
"top"
>
<el-button
type=
"primary"
class=
"zidingyiFz"
icon=
"iconfont icon-bangdingzhagnhuxinxi"
circle
@
click=
"goUrl('empBankAccount',item.EmployeeId)"
></el-button>
</el-tooltip>
</td>
</tr>
</table>
<div
class=
"noDataNotice"
v-if=
"DataList.length
<1
"
>
<i
class=
"iconfont icon-kong"
></i>
<p>
没有找到你需要的数据
</p>
</div>
<el-pagination
background
@
current-change=
"handleCurrentChange"
v-if=
"DataList.length>0"
:current-page
.
sync=
"currentPage"
layout=
"total,prev, pager, next, jumper"
:page-size=
"msg.pageSize"
:total=
"total"
></el-pagination>
<el-dialog
custom-class=
"w800"
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible"
center
:before-close=
"closeChangeMachie"
>
<el-form
:model=
"addMsg"
:rules=
"rules"
ref=
"addMsg"
label-width=
"100px"
>
<table
class=
"layerTable layerNoIcon"
>
<tr>
<td>
<el-form-item
label=
"公司"
prop=
"branchId"
>
<el-select
filterable
class=
"w217"
v-model=
"addMsg.branchId"
placeholder=
"请选择"
>
<el-option
v-for=
"item in layerCompanyList"
:label=
"item.BName"
:value=
"item.Id"
:key=
"item.Id"
></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item
label=
"线路"
prop=
"lineId"
>
<el-select
filterable
v-model=
"addMsg.lineId"
>
<el-option
label=
"不限"
:value=
"-1"
></el-option>
<el-option
v-for=
"item in LineList"
:label=
"item.LineName"
:value=
"item.LineID"
:key=
"item.LineID"
></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<td>
<el-form-item
label=
"优惠券名称"
prop=
"EmName"
>
<el-input
maxlength=
"20"
class=
"w217"
type=
"text"
v-model=
"addMsg.EmName"
:placeholder=
"$t('pub.pleaseImport')"
></el-input>
</el-form-item>
</td>
<td>
<el-form-item
label=
"优惠券类型"
prop=
"couponsType"
>
<el-select
filterable
v-model=
"addMsg.couponsType"
>
<el-option
label=
"抵用券"
:value=
"1"
></el-option>
<el-option
label=
"折扣券"
:value=
"2"
></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item
label=
"叠加使用"
prop=
"overlapUse"
>
<el-select
filterable
v-model=
"addMsg.overlapUse"
class=
"w217"
>
<el-option
label=
"不允许"
:value=
"0"
></el-option>
<el-option
label=
"允许"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item
label=
"使用条件"
prop=
"useCondition"
>
<el-input
v-model=
"addMsg.useCondition"
class=
"w217"
placeholder=
"满多少可用"
/>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item
label=
"生效日期"
prop=
"effectDate"
>
<el-date-picker
value-format=
"yyyy-MM-dd"
class=
"w217"
v-model=
"addMsg.effectDate"
type=
"date"
></el-date-picker>
</el-form-item>
</td>
<td>
<el-form-item
label=
"有效截止日"
prop=
"expirationDate"
>
<el-date-picker
value-format=
"yyyy-MM-dd"
class=
"w217"
v-model=
"addMsg.expirationDate"
type=
"date"
></el-date-picker>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible = false,resetForm('addMsg')"
>
取 消
</button>
<button
class=
"normalBtn"
@
click=
"submitForm('addMsg')"
>
保存
</button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
let
validatorPwd1
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
pwdMsg
.
Pwd
!=
""
&&
this
.
pwdMsg
.
Pwd
!=
this
.
pwdMsg
.
Pwd1
)
{
return
callback
(
new
Error
(
"两次密码不一致!"
));
}
else
{
callback
();
}
};
return
{
leaveBtn
:
""
,
leaveId
:
""
,
loading
:
true
,
isleaveBtn
:
false
,
total
:
0
,
pageSize
:
""
,
currentPage
:
1
,
outerVisible
:
false
,
innerVisible
:
false
,
isRight
:
true
,
dialogTitle
:
""
,
insideDialogTxt
:
""
,
LineList
:
[],
//请求
msg
:
{
pageIndex
:
1
,
pageSize
:
15
,
lineId
:
-
1
,
couponsName
:
''
,
couponsType
:
-
1
,
couponStatus
:
-
1
,
groupId
:
''
,
branchId
:
''
,
},
rules
:
{
branchId
:
[{
required
:
true
,
message
:
"请选择公司"
,
trigger
:
"change"
}],
lineId
:
[{
required
:
true
,
message
:
"请选择线路"
,
trigger
:
"change"
}],
EmName
:
[{
required
:
true
,
message
:
"请输入优惠券名称"
,
trigger
:
"blur"
}],
useCondition
:
[{
required
:
true
,
message
:
"请输入使用条件"
,
trigger
:
"blur"
}],
effectDate
:
[{
required
:
true
,
message
:
"请选择生效日期"
,
trigger
:
"change"
}],
expirationDate
:
[{
required
:
true
,
message
:
"请选择截止日期"
,
trigger
:
"change"
}],
},
addMsg
:
{
couponsName
:
""
,
effectDate
:
""
,
expirationDate
:
""
,
couponsType
:
1
,
groupId
:
""
,
branchId
:
""
,
lineId
:
""
,
denomination
:
""
,
overlapUse
:
0
,
useCondition
:
""
,
id
:
0
,
},
pwdMsg
:
{
Id
:
""
,
Pwd
:
""
,
pwd1
:
""
},
rulesPwd
:
{
Pwd
:
[{
required
:
true
,
message
:
"请输入密码"
,
trigger
:
"blur"
}],
Pwd1
:
[{
validator
:
validatorPwd1
,
trigger
:
"blur"
}]
},
getCompanyMsg
:
{
RB_Group_Id
:
"0"
,
Status
:
"0"
},
//返回值的接收变量
DataList
:
[],
groupList
:
[],
layerCompanyList
:
[],
companyList
:
[],
layerDepartMentList
:
[],
departMentList
:
[],
PostList
:
[]
};
},
mounted
()
{
let
userInfo
=
this
.
getLocalStorage
();
this
.
msg
.
groupId
=
this
.
getCompanyMsg
.
RB_Group_Id
=
this
.
addMsg
.
groupId
=
userInfo
.
RB_Group_id
;
//集团
this
.
msg
.
branchId
=
userInfo
.
RB_Branch_id
;
//公司
this
.
getList
();
this
.
getCompany
();
this
.
getLineList
();
},
filters
:
{
},
methods
:
{
getCompany
()
{
this
.
apipost
(
"admin_get_BranchGetList"
,
this
.
getCompanyMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
this
.
outerVisible
)
{
this
.
layerCompanyList
=
res
.
data
.
data
;
}
else
{
this
.
companyList
=
res
.
data
.
data
;
}
//console.log(this.layerCompanyList)
}
else
{
}
},
err
=>
{}
);
},
getList
()
{
//获取数据
this
.
loading
=
true
this
.
apiJavaPost
(
"/api/sell/coupon/getCouponsList"
,
this
.
msg
,
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
resultCode
===
1
)
{
this
.
DataList
=
res
.
data
.
data
.
pageData
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
}
this
.
loading
=
false
},
null
);
},
addData
()
{
this
.
isleaveBtn
=
false
;
this
.
apipost
(
"admin_post_EmployeeOperate"
,
this
.
addMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
outerVisible
=
false
;
this
.
getList
();
this
.
resetForm
(
"addMsg"
);
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
);
}
},
err
=>
{}
);
this
.
getList
();
},
//获取线路列表
getLineList
()
{
this
.
apipost
(
'line_post_GetList'
,
{},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
LineList
=
res
.
data
.
data
}
})
},
updateData
(
id
)
{
this
.
pwdMsg
.
Id
=
id
;
this
.
leaveId
=
id
;
this
.
isleaveBtn
=
true
;
this
.
apipost
(
"admin_get_EmployeeGet"
,
{
Id
:
id
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
getDepartmentMsg
.
RB_Branch_Id
=
res
.
data
.
data
.
RB_Branch_id
;
this
.
getPost
();
this
.
addMsg
=
res
.
data
.
data
;
if
(
res
.
data
.
data
.
IsLeave
==
0
)
{
this
.
leaveBtn
=
"设为离职"
;
}
else
{
this
.
leaveBtn
=
"设为在职"
;
}
this
.
addMsg
.
EmSex
=
res
.
data
.
data
.
EmSex
.
toString
();
}
},
err
=>
{}
);
},
handleCurrentChange
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getList
();
},
resetPageIndex
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
currentPage
=
1
;
},
submitForm
(
addMsg
)
{
//提交创建、修改表单
this
.
$refs
[
addMsg
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
addData
();
}
else
{
return
false
;
}
});
},
goUrl
(
name
,
id
)
{
this
.
$router
.
push
({
name
:
name
,
query
:
{
id
:
id
,
type
:
9
,
blank
:
"y"
,
tab
:
"绑定账户信息"
}
});
},
closeChangeMachie
(
done
)
{
//弹出框关闭初始化弹框内表单
done
();
this
.
resetForm
(
"addMsg"
);
},
resetForm
(
formName
)
{
//弹出框取消 初始化谈框内表单
this
.
$refs
[
formName
].
resetFields
();
this
.
addMsg
.
EmployeeId
=
"0"
;
}
}
};
</
script
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment