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
ea8dac77
Commit
ea8dac77
authored
Jan 23, 2021
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了样品分拨打印标签按钮
parent
f03b5af1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
205 additions
and
5 deletions
+205
-5
PrintNum.vue
...-manage/sample-receive/entrust-sample-manage/PrintNum.vue
+74
-0
WaitScan.vue
...-manage/sample-receive/entrust-sample-manage/WaitScan.vue
+131
-5
No files found.
pages/soil-sample-manage/sample-receive/entrust-sample-manage/PrintNum.vue
0 → 100644
View file @
ea8dac77
<
template
>
<div>
<Modal
v-model=
"showBackModal"
:mask-closable=
"false"
class=
"zIndex-1100"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<Form
ref=
"formObj"
:model=
"formObj"
:rules=
"ruleValidate"
:label-width=
"90"
>
<Form-item
label=
"打印份数"
prop=
"number"
>
<InputNumber
:min=
"1"
:step=
"1"
v-model
.
number=
"formObj.number"
name=
"number"
style=
"width:100%"
placeholder=
"请输入打印份数"
>
</InputNumber>
</Form-item>
</Form>
</div>
<div
slot=
"footer"
class=
"btn-width"
>
<Button
@
click=
"_cancel"
style=
"margin-left: 8px"
>
取消
</Button>
<Button
@
click=
"_ok"
type=
"primary"
>
确定
</Button>
</div>
</Modal>
</div>
</
template
>
<
script
>
/**
* 制备标签打印数量
*/
export
default
{
components
:
{},
data
()
{
return
{
currentComponent
:
''
,
modalTitle
:
'打印份数'
,
showBackModal
:
false
,
formObj
:
{
number
:
1
},
ruleValidate
:
{
number
:
[
{
required
:
true
,
message
:
'打印份数不能为空'
,
trigger
:
'blur'
,
type
:
'number'
}
]
},
printerVal
:
''
,
selectData
:
[],
companyId
:
''
}
},
methods
:
{
// 打开界面
_open
()
{
this
.
showBackModal
=
true
this
.
formObj
.
number
=
1
},
_cancel
()
{
this
.
showBackModal
=
false
},
// 打开界面
_ok
()
{
this
.
$refs
.
formObj
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
$emit
(
'on-result-change'
,
this
.
formObj
.
number
)
this
.
showBackModal
=
false
}
else
{
this
.
$Message
.
error
(
'表单验证失败!'
)
}
})
}
}
}
</
script
>
pages/soil-sample-manage/sample-receive/entrust-sample-manage/WaitScan.vue
View file @
ea8dac77
...
@@ -73,18 +73,26 @@
...
@@ -73,18 +73,26 @@
</Row>
</Row>
</div>
</div>
<!--选择领样人-->
<!--选择领样人-->
<downloadPlugin
ref=
"downloadPlugin"
></downloadPlugin>
<SelectPrinter
ref=
"selectPrint"
@
on-result-change=
"_printResult"
></SelectPrinter>
<PrintNum
ref=
"printNum"
@
on-result-change=
"_printNumResult"
></PrintNum>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
soilAptitude
,
soilEntrust
}
from
'../../../../api'
import
{
soilAptitude
,
soilEntrust
,
soilStatistics
}
from
'../../../../api'
import
SelectPrinter
from
'../../sample-preparation/SelectPrinter'
import
{
getLodop
}
from
'../../../../plugins/clodop/LodopFuncs'
import
downloadPlugin
from
'../../../../plugins/download/downloadPlugin'
import
PrintNum
from
'./PrintNum'
let
LODOP
export
default
{
export
default
{
components
:
{},
components
:
{
PrintNum
,
SelectPrinter
,
downloadPlugin
},
data
()
{
data
()
{
return
{
return
{
btn
:
[
btn
:
[
{
type
:
'primary'
,
id
:
''
,
name
:
'发放'
},
{
type
:
'primary'
,
id
:
''
,
name
:
'发放'
},
{
type
:
'primary'
,
id
:
''
,
name
:
'发放到高级试验'
}
{
type
:
'primary'
,
id
:
''
,
name
:
'发放到高级试验'
},
{
type
:
'primary'
,
id
:
''
,
name
:
'打印标签'
}
],
],
selectIds
:
[],
selectIds
:
[],
getPage
:
{},
getPage
:
{},
...
@@ -295,8 +303,15 @@ export default {
...
@@ -295,8 +303,15 @@ export default {
case
'接收'
:
case
'接收'
:
this
.
_sampleReceive
()
this
.
_sampleReceive
()
break
break
// case '打印标签':
// this._selectPrinter('print-label')
// break
case
'打印标签'
:
case
'打印标签'
:
this
.
_selectPrinter
(
'print-label'
)
if
(
this
.
selectData
.
length
>
0
)
{
this
.
$refs
.
selectPrint
.
_open
()
}
else
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
break
break
case
'自定义打印'
:
case
'自定义打印'
:
if
(
this
.
selectData
.
length
===
0
)
{
if
(
this
.
selectData
.
length
===
0
)
{
...
@@ -311,6 +326,117 @@ export default {
...
@@ -311,6 +326,117 @@ export default {
}
}
})
})
},
},
_pluginDownload
()
{
this
.
$refs
.
downloadPlugin
.
_open
()
},
_printResult
(
data
)
{
console
.
log
(
data
)
if
(
data
)
{
console
.
log
(
'data.printerVal'
)
this
.
printerVal
=
data
.
printerVal
this
.
$refs
.
printNum
.
_open
()
// this._getLabelInfo()
}
},
_printNumResult
(
data
)
{
this
.
printNum
=
data
this
.
_getLabelInfo
()
},
_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
()
},
_printMessage
:
function
()
{
LODOP
=
getLodop
()
if
(
LODOP
===
'undefined'
||
LODOP
===
undefined
)
{
this
.
_pluginDownload
()
return
false
}
if
(
LODOP
.
GET_PRINTER_COUNT
()
===
0
)
{
this
.
$Messager
.
warning
(
'系统未关联打印机,请确认....'
)
return
false
}
const
data
=
this
.
selectData
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
printNum
;
j
++
)
{
this
.
_printLabelOk
(
data
[
i
])
}
}
},
_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
(
/
\$
sampleDepth
\$
/g
,
undefined
!==
row
.
sampleDepth
?
row
.
sampleDepth
:
''
)
result
=
result
.
replace
(
/
\$
receiver
\$
/g
,
undefined
!==
row
.
receiver
?
row
.
receiver
:
''
)
result
=
result
.
replace
(
/
\$
receiveTime
\$
/g
,
undefined
!==
row
.
receiveTime
?
this
.
_formatDate
(
row
.
receiveTime
)
:
''
)
result
=
result
.
replace
(
/
\$
entrustCode
\$
/g
,
undefined
!==
row
.
entrustCode
?
row
.
entrustCode
:
''
)
// 检测项目
result
=
result
.
replace
(
/
\$
experimentNames
\$
/g
,
undefined
!==
row
.
experimentNames
?
row
.
experimentNames
:
''
)
// 二维码地址
result
=
result
.
replace
(
/
\$
qrCode
\$
/g
,
undefined
!==
row
.
qrCode
?
row
.
qrCode
:
''
)
return
result
},
_formatDate
(
time
)
{
const
date
=
new
Date
(
time
)
const
YY
=
date
.
getFullYear
()
+
'-'
const
MM
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
const
DD
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
const
hh
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
const
mm
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
const
ss
=
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
()
return
YY
+
MM
+
DD
+
' '
+
hh
+
mm
+
ss
},
// 扫码发放
// 扫码发放
_oneKeySend
()
{
_oneKeySend
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
if
(
this
.
selectIds
.
length
===
0
)
{
...
...
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