Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d116efe8
authored
Feb 17, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
98116e97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
277 additions
and
101 deletions
src/components/menu.vue
src/views/User/login.vue
src/components/menu.vue
View file @
d116efe8
...
...
@@ -155,32 +155,6 @@
<span
class=
"icon iconfont iconuser"
></span>
</div>
</div>
<div
class=
"kf-box"
>
<el-tooltip
placement=
"left"
effect=
"light"
>
<div
slot=
"content"
>
<div
class=
"kf-boxs"
>
<div
class=
"itemg"
>
<span>
客服姓名:
</span>
<font>
邓小姐
</font>
</div>
<div
class=
"itemg"
>
<span>
邮箱:
</span>
<font>
vendor@ichunt.com
</font>
</div>
<div
class=
"itemg"
>
<span>
QQ:
</span>
<font>
2885072763
</font>
</div>
<img
src=
"https://static.ichunt.com/dist/res/home/images/fuwuhao.jpg"
alt=
""
>
</div>
</div>
<div
class=
"btnkf"
>
<img
src=
"../assets/images/kf.png"
alt=
""
>
</div>
</el-tooltip>
</div>
<!--修改库存弹窗-->
<el-dialog
title=
"修改密码"
:visible
.
sync=
"dialogVisible"
width=
"500px"
class=
"demo-ruleForm"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
>
...
...
@@ -201,52 +175,62 @@
</el-dialog>
<!--消息通知-->
<el-dialog
title=
"消息通知"
:visible
.
sync=
"dialogNewsVisible"
width=
"700px"
class=
"demo-ruleForm"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"全部"
name=
"all"
>
<div
slot=
"label"
>
全部
<el-badge
value=
10
:max=
"9999"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"询价"
name=
"inquiry"
>
<div
slot=
"label"
>
询价
<el-badge
value=
10
:max=
"9999"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"成单"
name=
"orderForm"
>
<div
slot=
"label"
>
成单
<el-badge
value=
10
:max=
"9999"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"退货"
name=
"returnGoods"
>
<div
slot=
"label"
>
退货
<el-badge
value=
10
:max=
"9999"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"上架有效期"
name=
"shelfLife"
>
<div
slot=
"label"
>
上架有效期
<el-badge
value=
10
:max=
"9999"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"库存不足"
name=
"insufficientInventory"
>
<div
slot=
"label"
>
库存不足
<el-badge
value=
10
:max=
"9999"
></el-badge>
<div
class=
"tab-news row verCenter bothSide"
>
<div>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"全部"
name=
"all"
>
<div
slot=
"label"
>
全部
<el-badge
:value=
"notReadCount[0]"
:max=
"99"
v-if=
"notReadCount[0] > 0"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"询价"
name=
"inquiry"
>
<div
slot=
"label"
>
询价
<el-badge
:value=
"notReadCount[6]"
:max=
"99"
v-if=
"notReadCount[6] > 0"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"成单"
name=
"orderForm"
>
<div
slot=
"label"
>
成单
<el-badge
:value=
"notReadCount[7]"
:max=
"99"
v-if=
"notReadCount[7] > 0"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"退货"
name=
"returnGoods"
>
<div
slot=
"label"
>
退货
<el-badge
:value=
"notReadCount[8]"
:max=
"99"
v-if=
"notReadCount[8] > 0"
></el-badge>
</div>
</el-tab-pane>
<el-tab-pane
label=
"上架有效期"
name=
"shelfLife"
>
<div
slot=
"label"
>
上架有效期
<el-badge
:value=
"notReadCount[9]"
:max=
"99"
v-if=
"notReadCount[9] > 0"
></el-badge>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div>
<el-button
type=
"primary"
@
click=
"updateMsg"
>
标记已读
</el-button>
<el-button
type=
"danger"
@
click=
"deleteMsg"
>
删除
</el-button>
</div>
</div>
<section>
<el-table
ref=
"table"
:data=
"tableData"
max-height=
"500"
@
selection-change=
"handleSelectionChange"
:show-header=
"false"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"left"
></el-table-column>
<el-table-column
prop=
"inquiry_sn"
label=
""
:show-overflow-tooltip=
"true"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<span
class=
"el-badge-num"
v-if=
"scope.row.msg_status == 0"
></span>
<span
style=
"margin-right: 4px;"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
date
}}
</span>
<span
style=
"margin-right: 4px;"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
title
}}
</span>
<a
class=
"alink"
target=
"_blank"
:href=
"JSON.parse(scope.row.msg_data).link"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
title_suffix
}}
</a>
</
template
>
</el-table-column>
</el-table>
<div
class=
"row verCenter bothSide"
>
<div
style=
"margin-left: 13px;"
>
<el-checkbox
v-model=
"checked"
@
change=
"selectAll"
></el-checkbox>
<el-button
type=
"primary"
@
click=
"getNewsStatus(0)"
style=
"margin-left: 10px;"
>
未读
</el-button>
<el-button
type=
"primary"
@
click=
"getNewsStatus(1)"
>
已读
</el-button>
</div>
</el-tab-pane>
<div
style=
"position: relative"
>
<el-table
:data=
"tableData"
max-height=
"500"
@
selection-change=
"handleSelectionChange"
:show-header=
"false"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"left"
></el-table-column>
<el-table-column
prop=
"inquiry_sn"
label=
""
:show-overflow-tooltip=
"true"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<span
class=
"el-badge-num"
v-if=
"scope.row.msg_status == 0"
></span>
<span
style=
"margin-right: 4px;"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
date
}}
</span>
<span
style=
"margin-right: 4px;"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
title
}}
</span>
<a
class=
"alink"
target=
"_blank"
:href=
"JSON.parse(scope.row.msg_data).link"
>
{{
JSON
.
parse
(
scope
.
row
.
msg_data
).
title_suffix
}}
</a>
</
template
>
</el-table-column>
</el-table>
<el-pagination
layout=
"total, sizes, prev, pager, next, jumper"
:page-sizes=
"[10, 20, 50, 100, 200]"
:total=
"total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"page"
></el-pagination>
</div>
</
el-tabs
>
</
section
>
</el-dialog>
</div>
</template>
...
...
@@ -255,11 +239,12 @@
import
Vue
from
'vue'
;
import
Util
from
"../tool"
;
import
axios
from
'axios'
;
import
{
Badge
,
Button
,
Dialog
,
Form
,
FormItem
,
Input
,
Menu
,
MenuItem
,
MenuItemGroup
,
Message
,
MessageBox
,
Pagination
,
Submenu
,
TabPane
,
Tabs
,
Tooltip
}
from
'element-ui'
import
{
Badge
,
Button
,
Checkbox
,
Dialog
,
Form
,
FormItem
,
Input
,
Menu
,
MenuItem
,
MenuItemGroup
,
Message
,
MessageBox
,
Notification
,
Pagination
,
Submenu
,
TabPane
,
Tabs
,
Tooltip
}
from
'element-ui'
Vue
.
prototype
.
$message
=
Message
;
Vue
.
prototype
.
$notify
=
Notification
;
Vue
.
use
(
Menu
).
use
(
MenuItem
).
use
(
MenuItemGroup
).
use
(
Submenu
).
use
(
Form
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Button
).
use
(
Tooltip
).
use
(
Input
).
use
(
Tabs
).
use
(
TabPane
).
use
(
Badge
).
use
(
Pagination
);
Vue
.
use
(
Menu
).
use
(
MenuItem
).
use
(
MenuItemGroup
).
use
(
Submenu
).
use
(
Form
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Button
).
use
(
Tooltip
).
use
(
Input
).
use
(
Tabs
).
use
(
TabPane
).
use
(
Badge
).
use
(
Pagination
)
.
use
(
Checkbox
)
;
var
news_url
=
"http://192.168.1.252:16543/"
;
export
default
{
...
...
@@ -268,7 +253,8 @@ export default {
created
()
{
var
self
=
this
this
.
getData
();
this
.
tabUi
()
this
.
tabUi
();
this
.
getLatestMsg
();
//获取最新消息
window
.
onresize
=
function
()
{
self
.
tabUi
()
};
...
...
@@ -284,6 +270,9 @@ export default {
}
}
return
{
supplier_id
:
Number
(
localStorage
.
getItem
(
'supplier_id'
))
||
0
,
seconds
:
60
,
checked
:
false
,
activeName
:
"all"
,
userinfo
:
{},
collapse
:
false
,
...
...
@@ -295,6 +284,10 @@ export default {
dialogNewsVisible
:
false
,
//消息通知
tableData
:
[],
multipleSelection
:
[],
notReadCount
:
{},
msg_status
:
''
,
//消息状态,0-未读,1-已读,-4-已删除
msg_category_id
:
''
,
//消息目的地系统下的分类id, 1-关注,2-报价,3-订单,4-系统通知,5-采购提醒不传代表全部
msg_id
:
''
,
//记录上一次的id
total
:
0
,
limit
:
10
,
page
:
1
,
...
...
@@ -345,29 +338,198 @@ export default {
this
.
tabss
(
this
.
$route
.
path
)
},
methods
:
{
/**
* 获取最新消息
*/
getLatestMsg
()
{
var
msg_id_val
=
sessionStorage
.
getItem
(
'msg_id'
)
||
''
;
//判断是不是最新的消息
if
(
this
.
msg_id
==
msg_id_val
)
{
return
;
}
axios
.
post
(
news_url
+
'/get_latest_msg'
,
{
page
:
1
,
limit
:
1
,
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
//云芯系统
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
Notification
.
closeAll
();
let
htmlArr
=
[];
let
data
=
JSON
.
parse
(
res
.
data
.
list
[
0
].
msg_data
);
sessionStorage
.
removeItem
(
'msg_id'
);
sessionStorage
.
setItem
(
'msg_id'
,
res
.
data
.
list
[
0
].
id
);
this
.
msg_id
=
res
.
data
.
list
[
0
].
id
;
//存储最新id
let
has_more
=
data
.
has_more
;
let
html
=
''
;
if
(
has_more
)
{
html
=
'
<
P
class
=
"notify-text"
><
b
>
' + data.date + '
<
/b><b>' + data.title + '</
b
><
a
class
=
"alink"
target
=
"_blank"
href
=
"' + data.link + '"
>
' + data.title_suffix + '
<
/a><a style="margin-left: 8px" class="alink" target="_blank" href="' + data.link + '">更多>>></
a
><
/P>'
;
}
else
{
html
=
'
<
P
class
=
"notify-text"
><
b
>
' + data.date + '
<
/b><b>' + data.title + '</
b
><
a
class
=
"alink"
target
=
"_blank"
href
=
"' + data.link + '"
>
' + data.title_suffix + '
<
/a></
P
>
';
}
htmlArr.push(html +
'
<
p
>
' + data.content[0].name + '
:
' + data.content[0].value + '
<
/p>'
+
'
<
p
>
' + data.content[1].name + '
:
' + data.content[1].value + '
<
/p>'
+
'
<
p
>
' + data.content[2].name + '
:
' + data.content[2].value + '
<
/p>'
+
'
<
p
>
' + data.content[3].name + '
:
' + data.content[3].value + '
<
/p>'
+
'
<
p
>
' + data.content[4].name + '
:
' + data.content[4].value + '
<
/p>'
)
;
this
.
countDown
();
this
.
$notify
({
title
:
'提示'
,
duration
:
20000
,
dangerouslyUseHTMLString
:
true
,
message
:
htmlArr
.
join
(
''
),
position
:
'bottom-right'
});
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'warning'
});
}
});
},
countDown
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
seconds
--
;
if
(
this
.
seconds
<=
0
)
{
this
.
seconds
=
60
;
this
.
getLatestMsg
();
}
},
1000
)
},
/**
* 获取新闻信息
*/
getNews
()
{
var
that
=
this
;
axios
.
post
(
news_url
+
'/get_category_msg_list'
,
{
page
:
this
.
page
,
limit
:
this
.
limit
,
msg_status
:
''
,
keyword
:
''
,
msg_category_id
:
''
,
user_id
:
12270
,
//供应商id
msg_status
:
this
.
msg_status
,
msg_category_id
:
this
.
msg_category_id
,
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
//云芯系统
}).
then
(
function
(
res
)
{
}).
then
(
(
res
)
=>
{
if
(
res
.
code
===
0
)
{
th
at
.
tableData
=
res
.
data
.
list
||
[];
th
at
.
total
=
res
.
data
.
total
;
th
is
.
tableData
=
res
.
data
.
list
||
[];
th
is
.
total
=
res
.
data
.
total
;
}
else
{
th
at
.
$message
({
th
is
.
$message
({
message
:
res
.
msg
,
type
:
'warning'
});
}
});
},
/**
* 全选
*/
selectAll
(
val
)
{
const
row
=
this
.
$refs
.
table
.
data
row
.
forEach
(
row
=>
{
this
.
$refs
.
table
.
toggleAllSelection
(
row
)
})
},
/**
* 获取tab的数量
*/
getNotReadCount
()
{
axios
.
post
(
news_url
+
'/get_not_read_count'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
//云芯系统
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
this
.
notReadCount
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'warning'
});
}
});
},
/**
* 更改消息状态为已读
*/
updateMsg
()
{
if
(
this
.
multipleSelection
.
length
==
0
)
{
this
.
$message
({
showClose
:
true
,
message
:
'请至少选择一条数据'
,
type
:
'warning'
});
return
;
}
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
return
obj
.
id
})
axios
.
post
(
news_url
+
'/update_msg'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
,
//云芯系统
msg_ids
:
msg_ids
.
join
(
','
)
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
this
.
getNotReadCount
();
this
.
getNews
();
this
.
$message
({
message
:
'标记成功'
,
type
:
'success'
});
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'warning'
});
}
});
},
/**
* 删除信息
*/
deleteMsg
()
{
if
(
this
.
multipleSelection
.
length
==
0
)
{
this
.
$message
({
showClose
:
true
,
message
:
'请至少选择一条数据'
,
type
:
'warning'
});
return
;
}
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
return
obj
.
id
})
axios
.
post
(
news_url
+
'/delete_msg'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
,
//云芯系统
msg_ids
:
msg_ids
.
join
(
','
)
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
this
.
getNotReadCount
();
this
.
getNews
();
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
});
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'warning'
});
}
});
},
/**
* 操作按钮未读已读
*/
getNewsStatus
(
type
)
{
this
.
msg_status
=
type
;
this
.
getNews
();
this
.
getNotReadCount
();
},
/**
* 获取个人信息
*/
getData
()
{
if
(
window
.
userInfo
)
{
this
.
userinfo
=
window
.
userInfo
;
...
...
@@ -385,6 +547,7 @@ export default {
*/
showMsg
()
{
this
.
dialogNewsVisible
=
true
;
this
.
getNotReadCount
();
this
.
getNews
();
},
/**
...
...
@@ -392,7 +555,19 @@ export default {
* @param index
*/
handleClick
(
tab
,
event
)
{
if
(
this
.
activeName
==
'all'
)
{
this
.
msg_category_id
=
0
;
}
else
if
(
this
.
activeName
==
'inquiry'
)
{
this
.
msg_category_id
=
6
;
}
else
if
(
this
.
activeName
==
'orderForm'
)
{
this
.
msg_category_id
=
7
;
}
else
if
(
this
.
activeName
==
'returnGoods'
)
{
this
.
msg_category_id
=
8
;
}
else
if
(
this
.
activeName
==
'shelfLife'
)
{
this
.
msg_category_id
=
9
;
}
this
.
getNotReadCount
();
this
.
getNews
();
},
/**
* chebox选择的数据
...
...
@@ -1075,26 +1250,25 @@ export default {
box-sizing
:
border-box
;
}
.el-badge-num-tab
{
position
:
absolute
;
left
:
27px
;
top
:
-51px
;
background-color
:
#fe0000
;
border-radius
:
10px
;
color
:
#fff
;
display
:
inline-block
;
font-size
:
12px
;
height
:
18px
;
line-height
:
18px
;
padding
:
0
6px
;
text-align
:
center
;
white-space
:
nowrap
;
border
:
1px
solid
#fff
;
z-index
:
999
;
.tab-news
{
margin-bottom
:
6px
;
border-bottom
:
1px
solid
#E4E7ED
;
}
.tab-news
.el-tabs__header
{
margin-bottom
:
0
!important
;
}
.el-tabs__nav-wrap
::after
{
background-color
:
transparent
;
}
.el-tabs__content
{
overflow
:
visible
!important
;
.notify-text
b
{
margin-right
:
5px
;
}
.notify-text
a
{
}
@keyframes
layui-rotate
{
...
...
src/views/User/login.vue
View file @
d116efe8
...
...
@@ -161,6 +161,8 @@ export default {
loadingInstance
.
close
();
if
(
res
.
code
===
0
)
{
sessionStorage
.
removeItem
(
'tabs'
);
localStorage
.
removeItem
(
'supplier_id'
);
localStorage
.
setItem
(
'supplier_id'
,
res
.
data
.
supplier_id
);
Util
.
setCookie
(
"token"
,
res
.
data
.
api_token
,
1
);
//强制要求微信绑定
if
(
!
res
.
data
.
is_bind_wechat
)
{
...
...
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