Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
operation-web-project
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d74ed360
authored
Sep 17, 2020
by
jack
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
test 部署
1 parent
7ba6bab0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
132 additions
and
121 deletions
src/common/common.js
src/http/api.js
src/views/main/deviceConnection.vue
src/common/common.js
View file @
d74ed36
...
...
@@ -15,12 +15,17 @@ const common = {
return
false
;
}
console
.
log
(
options
.
data
);
axios
(
{
let
oParams
=
{
method
:
options
.
method
||
'post'
,
url
:
options
.
url
,
params
:
options
.
data
,
responseType
:
'blob'
}).
then
(
response
=>
{
}
if
(
options
.
method
==
'GET'
||
options
.
method
==
'get'
){
oParams
.
params
=
options
.
data
}
else
{
oParams
.
data
=
options
.
data
;
}
axios
(
oParams
).
then
(
response
=>
{
if
(
!
response
)
{
return
};
...
...
src/http/api.js
View file @
d74ed36
...
...
@@ -125,9 +125,7 @@ export default function $axios(options) {
break
;
case
'-1'
:
if
(
data
.
errId
==
'-200'
)
{
//window.refresh();
location
.
reload
();
//window.reload()
}
else
{
Util
.
Info
({
message
:
data
.
message
||
data
.
msg
||
'出错了,请联系管理员'
...
...
@@ -193,7 +191,7 @@ export default function $axios(options) {
}
Util
.
Info
({
message
:
err
.
message
+
'66666'
||
'出错了,请联系管理员'
message
:
err
.
message
||
'出错了,请联系管理员'
})
return
Promise
.
reject
(
err
)
// 返回接口返回的错误信息
}
...
...
src/views/main/deviceConnection.vue
View file @
d74ed36
...
...
@@ -246,7 +246,7 @@
<!-- 查看设备详情弹框区域 end -->
<!-- 设备初始化弹框 开始 -->
<glsx-dialog
:show=
"showInitModal"
width=
"30%"
>
<glsx-dialog
:show=
"showInitModal"
width=
"30%"
usefooter
@
closed=
"closeInitDialog"
>
<div
class=
"init_box"
v-if=
"showInitModal"
>
<h2
class=
"h2"
>
请确认是否初始化
</h2>
<h3
class=
"h3"
>
...
...
@@ -275,7 +275,7 @@
</div>
<div
slot=
"footer"
>
<el-button
type=
"primary"
@
click=
"deviceInit()"
>
确定
</el-button>
<el-button
@
click=
"
showInitModal = false
"
>
取消
</el-button>
<el-button
@
click=
"
closeInitDialog
"
>
取消
</el-button>
</div>
</glsx-dialog>
<!-- 设备初始化弹框 end -->
...
...
@@ -289,12 +289,12 @@ import {
FINDSENDMERCHANTNO
,
GETMAXDEVICESTATISREPORT
,
GETDEVICERELATIONDETAIL
,
INITDEVICERELATION
}
from
"@/http/interface"
;
import
GlsxDialog
from
"@/components/dialog/index"
;
INITDEVICERELATION
,
}
from
'@/http/interface'
import
GlsxDialog
from
'@/components/dialog/index'
export
default
{
components
:
{
"glsx-dialog"
:
GlsxDialog
'glsx-dialog'
:
GlsxDialog
,
},
data
()
{
return
{
...
...
@@ -310,17 +310,17 @@ export default {
registerDate
:
[],
packageDate
:
[],
tdWidth
:
170
,
DATEFORMATE
:
str
=>
{
return
this
.
$Util
.
dateFormate
(
str
)
;
DATEFORMATE
:
(
str
)
=>
{
return
this
.
$Util
.
dateFormate
(
str
)
},
CUTSTR
:
(
str
,
num
)
=>
{
return
this
.
$Util
.
cutStr
(
str
,
num
)
;
return
this
.
$Util
.
cutStr
(
str
,
num
)
},
deviceTypeList
:
[],
DEVICESTATUS
:
{
UA
:
"未激活"
,
AL
:
"已激活"
,
IN
:
"已初始化"
UA
:
'未激活'
,
AL
:
'已激活'
,
IN
:
'已初始化'
,
},
merchantList
:
[],
report
:
{},
...
...
@@ -331,195 +331,203 @@ export default {
initForm
:
{},
initFormRules
:
{
reason
:
[
{
required
:
true
,
message
:
"请选择初始化原因"
,
trigger
:
"change"
}
{
required
:
true
,
message
:
'请选择初始化原因'
,
trigger
:
'change'
},
],
remark
:
[
{
required
:
true
,
message
:
'请输入原因描述'
,
trigger
:
'blur'
},
],
remark
:
[{
required
:
true
,
message
:
"请输入原因描述"
,
trigger
:
"blur"
}]
},
currentSn
:
''
}
;
currentSn
:
''
,
}
},
created
()
{},
mounted
:
function
()
{
this
.
getList
(
0
,
"100107"
);
this
.
getDeviceList
()
;
this
.
getMerchantList
()
;
this
.
getStatistics
()
;
mounted
:
function
()
{
this
.
getList
(
0
,
'100107'
)
this
.
getDeviceList
()
this
.
getMerchantList
()
this
.
getStatistics
()
},
methods
:
{
/**
* 查询列表
*/
getList
:
function
(
current
,
code
)
{
const
_this
=
this
;
const
oParams
=
_this
.
getParams
()
;
console
.
log
(
current
)
;
oParams
.
pageNum
=
current
||
_this
.
currentPage
;
getList
:
function
(
current
,
code
)
{
const
_this
=
this
const
oParams
=
_this
.
getParams
()
console
.
log
(
current
)
oParams
.
pageNum
=
current
||
_this
.
currentPage
//oParams.currentPage = current || _this.currentPage;
if
(
code
)
{
oParams
.
deviceCode
=
"100107"
;
oParams
.
deviceCode
=
'100107'
}
else
{
delete
oParams
.
deviceCode
;
delete
oParams
.
deviceCode
}
oParams
.
pageStart
=
(
oParams
.
pageNum
-
1
)
*
10
;
_this
.
tableLoading
=
true
;
GETLISTDEVICEFILE
(
oParams
).
then
(
res
=>
{
console
.
log
(
res
)
;
_this
.
tableLoading
=
false
;
oParams
.
pageStart
=
(
oParams
.
pageNum
-
1
)
*
10
_this
.
tableLoading
=
true
GETLISTDEVICEFILE
(
oParams
).
then
(
(
res
)
=>
{
console
.
log
(
res
)
_this
.
tableLoading
=
false
if
(
res
.
returnCode
==
0
)
{
const
{
data
}
=
res
;
const
{
total
,
list
}
=
data
;
_this
.
tableData
=
list
||
[]
;
_this
.
pageTotal
=
total
;
const
{
data
}
=
res
const
{
total
,
list
}
=
data
_this
.
tableData
=
list
||
[]
_this
.
pageTotal
=
total
}
})
;
})
},
/**
* 获取查询参数
*/
getParams
:
function
()
{
const
oParams
=
this
.
formInline
;
const
m
=
this
.
registerDate
;
const
n
=
this
.
packageDate
;
getParams
:
function
()
{
const
oParams
=
this
.
formInline
const
m
=
this
.
registerDate
const
n
=
this
.
packageDate
if
(
m
&&
m
.
length
>
0
)
{
oParams
.
outStorageStartDate
=
m
[
0
]
;
oParams
.
outStorageEndDate
=
m
[
1
]
;
oParams
.
outStorageStartDate
=
m
[
0
]
oParams
.
outStorageEndDate
=
m
[
1
]
}
else
{
delete
this
.
formInline
.
startDate
;
delete
this
.
formInline
.
endDate
;
delete
this
.
formInline
.
startDate
delete
this
.
formInline
.
endDate
}
if
(
n
&&
n
.
length
>
0
)
{
oParams
.
packageUserStartDate
=
n
[
0
]
;
oParams
.
packageUserEndDate
=
n
[
1
]
;
oParams
.
packageUserStartDate
=
n
[
0
]
oParams
.
packageUserEndDate
=
n
[
1
]
}
else
{
delete
this
.
formInline
.
startDate
;
delete
this
.
formInline
.
endDate
;
delete
this
.
formInline
.
startDate
delete
this
.
formInline
.
endDate
}
oParams
.
pageSize
=
this
.
pageSize
;
return
oParams
;
oParams
.
pageSize
=
this
.
pageSize
return
oParams
},
/**
* 每页展示
*/
changePageSize
:
function
(
e
)
{
this
.
pageSize
=
e
;
this
.
getList
()
;
changePageSize
:
function
(
e
)
{
this
.
pageSize
=
e
this
.
getList
()
},
/**
* 获取设备类型列表
*/
getDeviceList
:
function
()
{
const
_this
=
this
;
GETDEVICETYPE
().
then
(
res
=>
{
const
{
data
}
=
res
;
_this
.
deviceTypeList
=
data
||
[]
;
})
;
getDeviceList
:
function
()
{
const
_this
=
this
GETDEVICETYPE
().
then
(
(
res
)
=>
{
const
{
data
}
=
res
_this
.
deviceTypeList
=
data
||
[]
})
},
/**
* 获取所有信息
*/
getMerchantList
:
function
()
{
const
_this
=
this
;
FINDSENDMERCHANTNO
().
then
(
res
=>
{
_this
.
merchantList
=
res
.
data
||
[]
;
})
;
getMerchantList
:
function
()
{
const
_this
=
this
FINDSENDMERCHANTNO
().
then
(
(
res
)
=>
{
_this
.
merchantList
=
res
.
data
||
[]
})
},
/**
* 切换搜索条件
*/
changeCondition
:
function
(
e
)
{
console
.
log
(
e
)
;
changeCondition
:
function
(
e
)
{
console
.
log
(
e
)
/* if (e == 'SM') {
delete this.formInline.searchValue
} */
delete
this
.
formInline
.
searchValue
;
delete
this
.
formInline
.
searchValue
},
/**
* 获取统计信息
*/
getStatistics
:
function
()
{
let
_this
=
this
;
GETMAXDEVICESTATISREPORT
().
then
(
res
=>
{
console
.
log
(
res
)
;
_this
.
report
=
res
.
data
||
{}
;
})
;
getStatistics
:
function
()
{
let
_this
=
this
GETMAXDEVICESTATISREPORT
().
then
(
(
res
)
=>
{
console
.
log
(
res
)
_this
.
report
=
res
.
data
||
{}
})
},
/**
* 查看详情
*/
lookDetail
:
function
(
id
)
{
lookDetail
:
function
(
id
)
{
if
(
!
id
)
{
return
false
;
return
false
}
let
_this
=
this
;
let
oParams
=
{}
;
oParams
.
id
=
id
;
_this
.
showModal
=
true
;
_this
.
modalLoading
=
true
;
GETDEVICERELATIONDETAIL
(
oParams
).
then
(
res
=>
{
console
.
log
(
res
)
;
_this
.
modalLoading
=
false
;
let
_this
=
this
let
oParams
=
{}
oParams
.
id
=
id
_this
.
showModal
=
true
_this
.
modalLoading
=
true
GETDEVICERELATIONDETAIL
(
oParams
).
then
(
(
res
)
=>
{
console
.
log
(
res
)
_this
.
modalLoading
=
false
if
(
res
.
returnCode
==
0
)
{
let
_obj
=
res
.
data
||
{}
;
_this
.
detailInfo
=
_obj
||
{}
;
let
_obj
=
res
.
data
||
{}
_this
.
detailInfo
=
_obj
||
{}
}
})
;
})
},
/**
* 监听关闭弹框
*/
closeModal
:
function
()
{
this
.
showModal
=
false
;
this
.
detailInfo
=
{}
;
closeModal
:
function
()
{
this
.
showModal
=
false
this
.
detailInfo
=
{}
},
/**
* 打开初始化弹框
*/
openInitModal
:
function
(
sn
){
this
.
currentSn
=
sn
;
this
.
showInitModal
=
true
;
openInitModal
:
function
(
sn
)
{
this
.
currentSn
=
sn
this
.
showInitModal
=
true
},
/**关闭初始化弹框 */
closeInitDialog
:
function
()
{
this
.
currentSn
=
''
this
.
showInitModal
=
false
},
/**
* 初始化设备
*/
deviceInit
:
function
()
{
let
_this
=
this
;
let
o
=
_this
.
initForm
;
_this
.
$refs
.
initForm
.
validate
(
valid
=>
{
deviceInit
:
function
()
{
let
_this
=
this
let
o
=
_this
.
initForm
_this
.
$refs
.
initForm
.
validate
(
(
valid
)
=>
{
if
(
!
valid
)
{
return
false
;
return
false
}
let
oParams
=
{};
oParams
.
sn
=
_this
.
currentSn
;
oParams
.
remark
=
o
.
reason
==
1
?
'机器返厂翻新售卖'
:
'其他原因:'
+
o
.
remark
;
INITDEVICERELATION
(
oParams
).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
returnCode
==
0
){
let
oParams
=
{}
oParams
.
sn
=
_this
.
currentSn
oParams
.
remark
=
o
.
reason
==
1
?
'机器返厂翻新售卖'
:
'其他原因:'
+
o
.
remark
INITDEVICERELATION
(
oParams
).
then
((
res
)
=>
{
console
.
log
(
res
)
if
(
res
.
returnCode
==
0
)
{
_this
.
$Util
.
Info
({
message
:
'操作成功'
,
type
:
'success'
message
:
'操作成功'
,
type
:
'success'
,
})
_this
.
showInitModal
=
false
;
_this
.
getList
()
;
_this
.
showInitModal
=
false
_this
.
getList
()
}
});
});
}
}
};
})
})
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment