Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-h5app-taihe
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
zhuxiaomei
patzn-cloud-web-h5app-taihe
Commits
c546d62e
Commit
c546d62e
authored
Jan 06, 2021
by
zhuxiaomei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽样条码
parent
c680e4f8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
28 deletions
+76
-28
.env.development
.env.development
+1
-1
index.js
src/api/index.js
+1
-0
scan-rel-sampling-num.js
src/api/taihe/scan-rel-sampling-num.js
+13
-0
SamplingCode.vue
src/page/sampling-code/SamplingCode.vue
+7
-6
SamplingCodeAdd.vue
src/page/sampling-code/SamplingCodeAdd.vue
+54
-21
No files found.
.env.development
View file @
c546d62e
NODE_ENV=development
VUE_APP_BASE_URL=http://192.168.0.
13
:7000
VUE_APP_BASE_URL=http://192.168.0.
50
:7000
src/api/index.js
View file @
c546d62e
...
...
@@ -30,3 +30,4 @@ export {default as message} from './message/message'
*/
export
{
default
as
sample
}
from
'./taihe/sample'
export
{
default
as
scanRelSamplingNum
}
from
'./taihe/scan-rel-sampling-num'
src/api/taihe/scan-rel-sampling-num.js
0 → 100644
View file @
c546d62e
/**
*
*/
import
http
from
'../http'
export
default
{
page
:
data
=>
http
.
post
(
'/taihe/v1/scan_rel_sampling_num/page'
,
data
).
then
(
res
=>
res
),
add
:
data
=>
http
.
post
(
'/taihe/v1/scan_rel_sampling_num/'
,
data
).
then
(
res
=>
res
),
edit
:
data
=>
http
.
put
(
'/taihe/v1/scan_rel_sampling_num/'
+
data
.
id
,
data
.
obj
).
then
(
res
=>
res
),
getById
:
data
=>
http
.
get
(
'/taihe/v1/scan_rel_sampling_num/'
+
data
).
then
(
res
=>
res
),
deleteByIds
:
data
=>
http
.
delete
(
'/taihe/v1/scan_rel_sampling_num/?ids='
+
data
).
then
(
res
=>
res
),
}
src/page/sampling-code/SamplingCode.vue
View file @
c546d62e
...
...
@@ -10,7 +10,7 @@
></van-nav-bar>
</
template
>
<
template
#
content
>
<search-bar
label=
"抽样单号"
ref=
"searchBar"
></search-bar>
<search-bar
label=
"抽样单号"
ref=
"searchBar"
@
search=
"_search"
></search-bar>
<div
class=
"layout-cont-s"
>
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
<van-pull-refresh
v-model=
"refreshing"
@
refresh=
"_refresh"
>
...
...
@@ -22,7 +22,8 @@
@
load=
"_load"
>
<van-swipe-cell
v-for=
"item in resultList"
:key=
"item.id"
>
<div
class=
"result-item"
@
click=
"_tapItem(item)"
>
<div>
抽样单号:
{{
item
.
humidity
}}
</div>
<div
style=
"width: 100%"
>
抽样单号:
{{
item
.
samplingNum
}}
</div>
<div
style=
"width: 100%"
>
条码号:
{{
item
.
scanNum
}}
</div>
</div>
<template
#
right
>
<van-button
square
type=
"info"
text=
"编辑"
class=
"swipe-cell-btn"
...
...
@@ -39,7 +40,7 @@
</template>
<
script
>
import
{
envMonitor
}
from
'../../api'
import
{
scanRelSamplingNum
}
from
'../../api'
export
default
{
name
:
"SamplingCode"
,
...
...
@@ -69,12 +70,12 @@
rows
:
this
.
rows
,
};
if
(
this
.
key
)
{
data
.
location
=
this
.
key
data
.
samplingNum
=
this
.
key
}
return
this
.
$serializeForm
(
data
)
},
_getData
:
async
function
()
{
let
result
=
await
envMonitor
.
page
(
this
.
_searchParams
())
let
result
=
await
scanRelSamplingNum
.
page
(
this
.
_searchParams
())
this
.
resultList
=
[...(
this
.
page
===
1
?
[]
:
this
.
resultList
),
...
result
.
records
]
this
.
refreshing
=
false
this
.
loading
=
false
...
...
@@ -107,7 +108,7 @@
}
},
_delOk
:
async
function
(
ids
)
{
let
result
=
await
envMonitor
.
deleteByIds
(
ids
)
let
result
=
await
scanRelSamplingNum
.
deleteByIds
(
ids
)
if
(
result
)
{
this
.
$toast
(
'操作成功!'
)
this
.
_refresh
()
...
...
src/page/sampling-code/SamplingCodeAdd.vue
View file @
c546d62e
<
template
>
<div>
<div
class=
"layout-cont-btn"
>
<van-form
ref=
"form"
>
<van-field
v-model=
"code
"
v-model=
"formObj.scanNum
"
label=
"条码"
right-icon=
"scan"
:rules=
"[
{ required: true, message: '请填写条码'}]"
placeholder="请输入或扫码条码"
@click-right-icon="_scan"
>
</van-field>
<van-field
v-model=
"code
"
v-model=
"formObj.samplingNum
"
label=
"抽样单编号"
:rules=
"[
{ required: true, message: '请填写抽样单编号'}]"
placeholder="请输入抽样单号"
>
</van-field>
</van-form>
</div>
<div
class=
"bottom-btn"
>
<van-button
square
block
type=
"default"
@
click=
"_back"
>
取消
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_save"
v-if=
"id"
>
保存
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_saveNext"
v-else
>
保存并下一个
</van-button>
<van-button
square
block
type=
"primary"
@
click=
"_save"
>
保存
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_saveNext"
v-if=
"id===''"
>
保存并下一个
</van-button>
</div>
</div>
</
template
>
<
script
>
import
{
mapMutations
}
from
"vuex"
;
// import {envMonitor
} from '../../api'
import
{
scanRelSamplingNum
}
from
'../../api'
export
default
{
name
:
"SamplingCodeAdd"
,
data
()
{
return
{
code
:
''
,
formObj
:
{
scanNum
:
''
,
samplingNum
:
''
,
},
id
:
''
}
},
mounted
()
{
this
.
code
=
this
.
$store
.
state
.
barcode
this
.
formObj
.
scanNum
=
this
.
$store
.
state
.
barcode
this
.
setBarcode
()
this
.
_open
()
},
...
...
@@ -50,18 +58,18 @@
}
},
_getData
:
async
function
()
{
// let result = await envMonitor
.getById(this.id)
//
if (result) {
//
for (let key in this.formObj) {
//
if (result[key]) {
//
if (key === 'monitorDate') {
//
this.formObj[key] = this.$dateformat(result[key], 'yyyy-mm-dd')
//
} else {
//
this.formObj[key] = result[key]
//
}
//
}
//
}
//
}
let
result
=
await
scanRelSamplingNum
.
getById
(
this
.
id
)
if
(
result
)
{
for
(
let
key
in
this
.
formObj
)
{
if
(
result
[
key
])
{
if
(
key
===
'monitorDate'
)
{
this
.
formObj
[
key
]
=
this
.
$dateformat
(
result
[
key
],
'yyyy-mm-dd'
)
}
else
{
this
.
formObj
[
key
]
=
result
[
key
]
}
}
}
}
},
_scan
()
{
this
.
$router
.
push
(
'/scan_bar'
)
...
...
@@ -69,9 +77,34 @@
_back
()
{
this
.
$router
.
go
(
-
1
);
},
_saveNext
()
{
_save
()
{
if
(
this
.
id
)
{
this
.
_editSave
(
this
.
formObj
)
}
else
{
this
.
_addSave
(
this
.
formObj
)
}
},
_saveNext
:
async
function
()
{
let
result
=
await
scanRelSamplingNum
.
add
(
this
.
formObj
)
if
(
result
)
{
this
.
$toast
(
'添加成功!'
)
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
}
},
_addSave
:
async
function
(
res
)
{
let
result
=
await
scanRelSamplingNum
.
add
(
res
)
if
(
result
)
{
this
.
$toast
(
'添加成功!'
)
this
.
$router
.
go
(
-
1
)
}
},
_editSave
:
async
function
(
res
)
{
let
result
=
await
scanRelSamplingNum
.
edit
({
id
:
this
.
id
,
obj
:
res
})
if
(
result
)
{
this
.
$toast
(
'编辑成功!'
)
this
.
$router
.
go
(
-
1
)
}
},
}
}
</
script
>
...
...
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