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
05496160
Commit
05496160
authored
Nov 02, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了扫码接收
parent
5f47328f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
3 deletions
+135
-3
TakeByEwm.vue
pages/soil-sample-manage/sample-take/TakeByEwm.vue
+121
-0
TakeBySample.vue
pages/soil-sample-manage/sample-take/TakeBySample.vue
+14
-3
No files found.
pages/soil-sample-manage/sample-take/TakeByEwm.vue
0 → 100644
View file @
05496160
<
template
>
<div>
<Modal
v-model=
"showSubmitModal"
:mask-closable=
"false"
@
on-visible-change=
"_visibleChange"
width=
"700"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<Form
:label-width=
"80"
onsubmit=
"return false"
>
<Form-item
label=
"样品编号"
prop=
"num"
>
<Input
ref=
"inputFocus"
@
submit
.
native
.
prevent
@
on-enter=
"_numBlur"
v-model=
"num"
placeholder=
"请将鼠标聚焦在此,并保持英文输入状态"
style=
"width:100%"
></Input>
</Form-item>
<Form-item
label=
"扫码信息"
>
<div
class=
"scanInfo"
>
<ul>
<li
v-for=
"item in scanInfo"
>
{{
item
}}
</li>
</ul>
</div>
</Form-item>
</Form>
</div>
</Modal>
</div>
</
template
>
<
script
>
/* 扫码接收、扫码发放 */
export
default
{
components
:
{},
data
()
{
return
{
modalTitle
:
''
,
showSubmitModal
:
false
,
scanInfo
:
[],
num
:
''
,
formObj
:
{
personId
:
''
,
person
:
''
}
}
},
methods
:
{
_open
(
title
,
data
)
{
if
(
title
)
{
this
.
modalTitle
=
title
}
else
{
this
.
modalTitle
=
'扫码接收'
}
if
(
data
)
{
this
.
formObj
.
person
=
data
.
realname
this
.
formObj
.
personId
=
data
.
userId
}
else
{
this
.
formObj
=
this
.
$serializeFormSearch
(
this
.
formObj
)
}
this
.
showSubmitModal
=
true
this
.
num
=
''
this
.
scanInfo
=
[]
this
.
_autoFocus
()
},
_autoFocus
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
inputFocus
.
focus
()
})
},
_cancel
()
{
this
.
showSubmitModal
=
false
},
_numBlur
()
{
if
(
this
.
modalTitle
===
'扫码接收'
)
{
// 扫码接收
this
.
$store
.
dispatch
(
'FoodSample/scanReceive'
,
{
num
:
this
.
num
})
.
then
(()
=>
{
this
.
_resultChange
(
' 接收'
)
})
}
else
{
// 扫码发放
const
param
=
{}
Object
.
assign
(
param
,
this
.
formObj
,
{
num
:
this
.
num
})
if
(
this
.
modalTitle
===
'扫码发放'
)
{
this
.
$store
.
dispatch
(
'FoodSample/scanSend'
,
this
.
$serializeFormSearch
(
param
))
.
then
(()
=>
{
this
.
_resultChange
(
' 发放'
)
})
}
else
if
(
this
.
modalTitle
===
'扫码接收发放'
)
{
this
.
$store
.
dispatch
(
'FoodSample/scanReceiveSend'
,
this
.
$serializeFormSearch
(
param
)
)
.
then
(()
=>
{
this
.
_resultChange
(
' 接收发放'
)
})
}
// 扫码接收发放
}
this
.
_autoFocus
()
},
_resultChange
(
msg
)
{
const
returnNum
=
this
.
$store
.
state
.
FoodSample
.
success
if
(
returnNum
)
{
this
.
scanInfo
.
push
(
'编号 '
+
returnNum
+
msg
+
'成功!'
)
this
.
num
=
''
}
else
{
this
.
num
=
''
}
},
// 关闭弹框,刷新界面
_visibleChange
(
data
)
{
if
(
!
data
)
{
this
.
$emit
(
'on-result-change'
)
}
}
}
}
</
script
>
<
style
>
.scanInfo
{
overflow
:
auto
;
}
</
style
>
pages/soil-sample-manage/sample-take/TakeBySample.vue
View file @
05496160
...
...
@@ -59,6 +59,7 @@
<!--打印(可填打印数量)-->
<!--选择领样人-->
<UserInfo
ref=
"userModal"
@
on-result-change=
"_userResult"
></UserInfo>
<TakeByEwm
ref=
"ewmModal"
></TakeByEwm>
</div>
</template>
...
...
@@ -66,10 +67,11 @@
import
http
from
'../../../api/http'
import
UserInfo
from
'../../../components/user-info-single/assignPerson'
import
{
soilEntrust
,
soilSample
}
from
'../../../api'
import
TakeByEwm
from
'./TakeByEwm'
export
default
{
components
:
{
UserInfo
UserInfo
,
TakeByEwm
},
data
()
{
return
{
...
...
@@ -142,7 +144,10 @@ export default {
{
title
:
'单位'
,
key
:
'unit'
,
width
:
130
}
],
searchOpen
:
false
,
btn
:
[{
type
:
'primary'
,
id
:
''
,
name
:
'领样'
,
componentName
:
''
}],
btn
:
[
{
type
:
'primary'
,
id
:
''
,
name
:
'领样'
,
componentName
:
''
},
{
type
:
'primary'
,
id
:
''
,
name
:
'扫码接收'
,
componentName
:
''
}
],
selectIds
:
[],
selectData
:
[],
currentComponent
:
''
,
...
...
@@ -207,11 +212,17 @@ export default {
case
'领样'
:
this
.
_sampleTake
()
break
case
'扫码接收'
:
this
.
_ewmTake
()
break
default
:
this
.
_btnOption
(
msg
,
formTypeObj
)
}
})
},
_ewmTake
()
{
this
.
$refs
.
ewmModal
.
_open
()
},
// btn操作
_btnOption
(
msg
,
formTypeObj
)
{
switch
(
msg
)
{
...
...
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