Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-back-soil
Overview
Overview
Details
Activity
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
wangweidong
patzn-cloud-web-back-soil
Commits
764faa81
Commit
764faa81
authored
Jan 09, 2021
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了检测管理
parent
7be7c0c2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
255 additions
and
37 deletions
+255
-37
soil-statistics.js
api/soil/soil-statistics.js
+2
-1
nuxt.config.js
nuxt.config.js
+0
-1
Preparation.vue
pages/soil-sample-manage/sample-preparation/Preparation.vue
+108
-34
PreparationOther.vue
...oil-sample-manage/sample-preparation/PreparationOther.vue
+0
-0
SelectPrinter.vue
...s/soil-sample-manage/sample-preparation/SelectPrinter.vue
+140
-0
routes.js
router/routes.js
+5
-1
No files found.
api/soil/soil-statistics.js
View file @
764faa81
...
...
@@ -53,5 +53,6 @@ export default {
.
post
(
'soil/v1/experiment/list_experiment_progress'
,
data
)
.
then
(
res
=>
res
),
listSampleProgress
:
data
=>
http
.
post
(
'soil/v1/sample/list_sample_progress'
,
data
).
then
(
res
=>
res
)
http
.
post
(
'soil/v1/sample/list_sample_progress'
,
data
).
then
(
res
=>
res
),
_getLabel
:
data
=>
http
.
post
(
'/res/v1/label/page'
,
data
).
then
(
res
=>
res
)
}
nuxt.config.js
View file @
764faa81
...
...
@@ -19,7 +19,6 @@ module.exports = {
title
:
'土工试验LIMS'
,
meta
:
[
{
charset
:
'utf-8'
},
{
name
:
'viewport'
,
content
:
'width=device-width, initial-scale=1'
},
{
hid
:
'description'
,
name
:
'description'
,
content
:
pkg
.
description
}
],
script
:
[
...
...
pages/soil-sample-manage/sample-preparation/Preparation.vue
View file @
764faa81
...
...
@@ -112,15 +112,17 @@
<!--下载插件-->
<downloadPlugin
ref=
"downloadPlugin"
/>
<SampleParpareBatchEdit
ref=
"batchEdit"
@
on-result-change=
"backData"
></SampleParpareBatchEdit>
<SelectPrinter
ref=
"selectPrint"
@
on-result-change=
"_printResult"
></SelectPrinter>
</div>
</template>
<
script
>
import
AutoComplete
from
'../../../components/base/AutoCompletes'
import
{
soilEntrust
,
soilSample
}
from
'../../../api'
import
{
soilEntrust
,
soilSample
,
soilStatistics
}
from
'../../../api'
import
{
getLodop
}
from
'../../../plugins/clodop/LodopFuncs'
// eslint-disable-next-line no-unused-vars
import
downloadPlugin
from
'../../../plugins/download/downloadPlugin'
import
SelectPrinter
from
'./SelectPrinter'
// eslint-disable-next-line no-unused-vars
import
SampleParpareBatchEdit
from
'./SampleParpareBatchEdit'
let
LODOP
...
...
@@ -128,7 +130,8 @@ export default {
components
:
{
AutoComplete
,
downloadPlugin
,
SampleParpareBatchEdit
SampleParpareBatchEdit
,
SelectPrinter
},
data
()
{
return
{
...
...
@@ -154,6 +157,7 @@ export default {
getPage
:
{
records
:
[]
},
labelCode
:
{},
currentIndex
:
-
1
,
selectData
:
[],
selectIds
:
[],
...
...
@@ -217,6 +221,14 @@ export default {
this
.
$forceUpdate
()
this
.
getPage
.
records
[
data
.
$rowIndex
].
printNum
=
data
.
row
.
printNum
},
_printResult
(
data
)
{
console
.
log
(
data
)
if
(
data
)
{
console
.
log
(
'data.printerVal'
)
this
.
printerVal
=
data
.
printerVal
this
.
_getLabelInfo
()
}
},
// 获取存储位置
_locationChange
(
msg
,
data
,
handleObj
)
{
this
.
currentRow
=
handleObj
...
...
@@ -441,11 +453,29 @@ export default {
break
}
},
_getLabelInfo
:
async
function
()
{
console
.
log
(
'this._getLabelInfo'
)
const
result
=
await
soilStatistics
.
_getLabel
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
for
(
let
i
=
0
;
i
<
result
.
records
.
length
;
i
++
)
{
if
(
result
.
records
[
i
].
type
.
display
===
'打印上机标签'
)
{
this
.
labelCode
=
result
.
records
[
i
].
code
}
}
console
.
log
(
result
)
}
this
.
_printMessage
()
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'打印标签'
:
if
(
this
.
selectData
.
length
>
0
)
{
this
.
_printMessage
()
// this._goto()
this
.
$refs
.
selectPrint
.
_open
()
// this._getLabelInfo()
// this._printMessage()
}
else
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
...
...
@@ -458,6 +488,13 @@ export default {
break
}
},
_goto
(
methodId
)
{
const
routeData
=
this
.
$router
.
resolve
({
path
:
'/blank/item_by_method'
,
query
:
{
id
:
123456
}
})
window
.
open
(
routeData
.
href
,
'_blank'
)
},
// 下载插件
_pluginDownload
()
{
this
.
$refs
.
downloadPlugin
.
_open
()
...
...
@@ -475,39 +512,76 @@ export default {
const
data
=
this
.
selectData
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
data
[
i
].
printNum
;
j
++
)
{
LODOP
.
PRINT_INITA
(
'0mm'
,
'0mm'
,
'60.01mm'
,
'40.01mm'
,
'打印控件功能演示_Lodop功能_打印图片3'
)
LODOP
.
ADD_PRINT_BARCODE
(
'0.08mm'
,
'18.39mm'
,
'58.87mm'
,
'24.74mm'
,
'QRCode'
,
data
[
i
].
sampleCode
+
'-'
+
data
[
i
].
groupId
)
LODOP
.
ADD_PRINT_TEXT
(
130
,
13
,
186
,
20
,
this
.
_formatDate
(
data
[
i
].
prepareDate
)
)
LODOP
.
SET_PRINT_STYLEA
(
0
,
'Alignment'
,
2
)
LODOP
.
ADD_PRINT_TEXT
(
113
,
13
,
187
,
20
,
data
[
i
].
groupName
)
LODOP
.
SET_PRINT_STYLEA
(
0
,
'Alignment'
,
2
)
LODOP
.
ADD_PRINT_TEXT
(
95
,
12
,
188
,
20
,
data
[
i
].
sampleCode
)
LODOP
.
SET_PRINT_STYLEA
(
0
,
'Alignment'
,
2
)
// LODOP.PRINT_DESIGN()
LODOP
.
PRINT
()
this
.
_printLabelOk
(
data
[
i
])
// LODOP.PRINT_INITA(
// '0mm',
// '0mm',
// '60.01mm',
// '40.01mm',
// '打印控件功能演示_Lodop功能_打印图片3'
// )
// LODOP.ADD_PRINT_BARCODE(
// '0.08mm',
// '18.39mm',
// '58.87mm',
// '24.74mm',
// 'QRCode',
// data[i].sampleCode + '-' + data[i].groupId
// )
// LODOP.ADD_PRINT_TEXT(
// 130,
// 13,
// 186,
// 20,
// this._formatDate(data[i].prepareDate)
// )
// LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
// LODOP.ADD_PRINT_TEXT(113, 13, 187, 20, data[i].groupName)
// LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
// LODOP.ADD_PRINT_TEXT(95, 12, 188, 20, data[i].sampleCode)
// LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
//
// // LODOP.PRINT_DESIGN()
// LODOP.PRINT()
}
}
},
_printLabelOk
(
row
)
{
LODOP
.
PRINT_INITA
(
''
)
// 必须在设置打印机之前
// 返回的标签代码
// eslint-disable-next-line no-eval
eval
(
this
.
_replaceCodes
(
row
))
// 设置打印机
LODOP
.
SET_PRINTER_INDEX
(
this
.
printerVal
)
// 打开设计模式
// LODOP.PRINT_DESIGN()
LODOP
.
PRINT
()
},
_replaceCodes
(
row
)
{
// /g表示全局替换
let
result
=
this
.
labelCode
result
=
result
.
replace
(
/
\$
sampleCode
\$
/g
,
undefined
!==
row
.
sampleCode
?
row
.
sampleCode
:
''
)
result
=
result
.
replace
(
/
\$
num
\$
/g
,
undefined
!==
row
.
num
?
row
.
num
:
''
)
result
=
result
.
replace
(
/
\$
resultDateTemp
\$
/g
,
row
.
resultDateTemp
)
result
=
result
.
replace
(
/
\$
groupName
\$
/g
,
undefined
!==
row
.
groupName
?
row
.
groupName
:
''
)
// 检测项目
result
=
result
.
replace
(
/
\$
items
\$
/g
,
undefined
!==
row
.
specialItems
?
row
.
specialItems
:
''
)
// 二维码地址
result
=
result
.
replace
(
/
\$
qrCode
\$
/g
,
undefined
!==
row
.
qrCode
?
row
.
qrCode
:
''
)
return
result
},
// 时间戳转换方法 date:时间戳数字
_formatDate
(
time
)
{
const
date
=
new
Date
(
time
)
...
...
pages/soil-sample-manage/sample-preparation/PreparationOther.vue
0 → 100644
View file @
764faa81
This diff is collapsed.
Click to expand it.
pages/soil-sample-manage/sample-preparation/SelectPrinter.vue
0 → 100644
View file @
764faa81
<
template
>
<div>
<Modal
v-model=
"showModal"
:mask-closable=
"false"
class=
"zIndex-1100"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<Alert
v-show=
"isPrinterDownload"
type=
"error"
><p
@
click=
"_download"
>
未安装打印控件,点此
<a>
下载
</a>
,安装完请刷新页面
</p></Alert>
<div
v-show=
"!isPrinterDownload"
>
<Form
ref=
"formObj"
:rules=
"ruleValidate"
:label-width=
"70"
onsubmit=
"return false"
>
<Form-item
label=
"打印机"
prop=
"printerVal"
>
<Select
v-model=
"printerVal"
@
on-change=
"_printChange"
name=
"printerVal"
placeholder=
"请选择打印机"
>
<Option
v-for=
"item in printList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
name
}}
</Option>
</Select>
</Form-item>
</Form>
</div>
</div>
<div
slot=
"footer"
class=
"btn-width"
>
<modal-footer
ref=
"footerModal"
@
on-result-change=
"_footerResult"
:footer=
"footerList"
></modal-footer>
</div>
</Modal>
</div>
</
template
>
<
script
>
/**
* 选择打印机
*/
import
global
from
'../../../api/config'
import
{
getLodop
}
from
'../../../plugins/clodop/LodopFuncs'
let
LODOP
export
default
{
components
:
{},
data
()
{
const
validatePrinter
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
printerVal
!==
null
)
{
callback
()
}
else
{
callback
(
new
Error
(
'请选择打印机~'
))
}
}
return
{
modalTitle
:
'选择打印机'
,
showModal
:
false
,
ruleValidate
:
{
printerVal
:
[
{
required
:
true
,
validator
:
validatePrinter
,
trigger
:
'change'
}
]
},
placeholder
:
''
,
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'确定'
,
type
:
'primary'
}
],
printList
:
[],
printerVal
:
null
,
type
:
''
,
isPrinterDownload
:
false
}
},
methods
:
{
// 获取打印机对象
_setPrinter
()
{
// 首先判断是否获取到打印机对象
if
(
undefined
===
LODOP
||
LODOP
===
'undefined'
)
{
LODOP
=
getLodop
()
}
// 其次判断是否安装打印机控件
if
(
undefined
===
LODOP
||
LODOP
===
'undefined'
)
{
this
.
isPrinterDownload
=
true
return
false
}
if
(
LODOP
.
GET_PRINTER_COUNT
()
===
0
)
{
this
.
$Message
.
warning
(
'系统未关联打印机,请确认....'
)
return
false
}
this
.
_createPrinterList
()
},
// 获取打印机列表
_createPrinterList
()
{
LODOP
=
getLodop
()
const
iPrinterCount
=
LODOP
.
GET_PRINTER_COUNT
()
const
printList
=
[]
for
(
let
i
=
0
;
i
<
iPrinterCount
;
i
++
)
{
printList
.
push
({
name
:
LODOP
.
GET_PRINTER_NAME
(
i
),
value
:
i
})
}
console
.
log
(
printList
)
this
.
printList
=
printList
if
(
this
.
printList
.
length
)
{
// 默认第一个打印机
this
.
printerVal
=
this
.
printList
[
0
].
value
}
},
_open
(
type
)
{
this
.
showModal
=
true
this
.
isPrinterDownload
=
false
this
.
type
=
type
// 打印标签还是自定义打印
this
.
_setPrinter
()
this
.
_createPrinterList
()
},
_printChange
(
data
)
{
this
.
printerVal
=
data
},
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'确定'
:
this
.
_ok
()
break
}
this
.
$refs
.
footerModal
.
_hideLoading
()
},
_cancel
()
{
this
.
showModal
=
false
},
_ok
()
{
this
.
$refs
.
formObj
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
$emit
(
'on-result-change'
,
{
printerVal
:
this
.
printerVal
,
type
:
this
.
type
})
this
.
showModal
=
false
}
else
{
this
.
$Message
.
error
(
'表单验证失败!'
)
}
})
},
// 下载打印机
_download
()
{
window
.
open
(
global
.
staticURL
+
'/clodop/CLodop_Setup_for_Win32NT.exe'
,
'_blank'
)
}
}
}
</
script
>
router/routes.js
View file @
764faa81
...
...
@@ -2,10 +2,10 @@
* 地址路由
*/
import
Lock
from
'../pages/Lock.vue'
// 锁屏
import
workbench
from
'../pages/soil-sample-manage/sample-preparation/PreparationOther'
import
Index
from
'~/pages/index'
import
Blank
from
'~/pages/blank'
import
SoilRouters
from
'~/router/soil-routes'
export
default
[
{
path
:
'/lock'
,
name
:
'Lock'
,
component
:
Lock
,
meta
:
{
allowBack
:
false
}
},
{
...
...
@@ -25,5 +25,9 @@ export default [
children
:
SoilRouters
,
meta
:
{
title
:
'土工试验LIMS'
}
},
{
path
:
'/blank/item_by_method'
,
component
:
workbench
},
{
path
:
'*'
,
redirect
:
'/'
}
]
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