Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-h5app-drs
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-drs
Commits
dde19e69
Commit
dde19e69
authored
Mar 11, 2021
by
zhuxiaomei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维护人员地点
parent
c55e1d4c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
480 additions
and
502 deletions
+480
-502
package.json
package.json
+1
-0
sampling-plan.js
src/api/drs/sampling-plan.js
+3
-0
Home.vue
src/page/Home.vue
+2
-2
Maintain.vue
src/page/sampling-plan/Maintain.vue
+157
-0
SamplingPlan.vue
src/page/sampling-plan/SamplingPlan.vue
+294
-287
SamplingPlanAdd.vue
src/page/sampling-plan/SamplingPlanAdd.vue
+0
-202
SelectSampler.vue
src/page/sampling-plan/sampler/SelectSampler.vue
+3
-0
sampling-plan-routes.js
src/router/sampling-plan-routes.js
+15
-11
main.less
src/styles/main.less
+5
-0
No files found.
package.json
View file @
dde19e69
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"private"
:
true
,
"private"
:
true
,
"scripts"
:
{
"scripts"
:
{
"serve"
:
"vue-cli-service serve --mode development"
,
"serve"
:
"vue-cli-service serve --mode development"
,
"devtest"
:
"vue-cli-service serve --mode devtest"
,
"build"
:
"vue-cli-service build --mode production"
,
"build"
:
"vue-cli-service build --mode production"
,
"pertest"
:
"vue-cli-service build --mode pertest"
,
"pertest"
:
"vue-cli-service build --mode pertest"
,
"lint"
:
"vue-cli-service lint"
"lint"
:
"vue-cli-service lint"
...
...
src/api/drs/sampling-plan.js
View file @
dde19e69
...
@@ -14,6 +14,7 @@ export default {
...
@@ -14,6 +14,7 @@ export default {
add
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/'
,
data
).
then
(
res
=>
res
),
add
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/'
,
data
).
then
(
res
=>
res
),
addPlan
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/add_plan'
,
data
).
then
(
res
=>
res
),
edit
:
data
=>
http
.
put
(
'/drs/v1/sampling_plan/'
+
data
.
id
,
data
.
obj
).
then
(
res
=>
res
),
edit
:
data
=>
http
.
put
(
'/drs/v1/sampling_plan/'
+
data
.
id
,
data
.
obj
).
then
(
res
=>
res
),
deleteByIds
:
ids
=>
http
.
delete
(
'/drs/v1/sampling_plan/?ids='
+
ids
).
then
(
res
=>
res
),
deleteByIds
:
ids
=>
http
.
delete
(
'/drs/v1/sampling_plan/?ids='
+
ids
).
then
(
res
=>
res
),
...
@@ -26,4 +27,6 @@ export default {
...
@@ -26,4 +27,6 @@ export default {
samplerPage
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/search_plan_sampler'
,
data
).
then
(
res
=>
res
),
samplerPage
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/search_plan_sampler'
,
data
).
then
(
res
=>
res
),
saveSampler
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/save_plan_sampler'
,
data
).
then
(
res
=>
res
),
saveSampler
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/save_plan_sampler'
,
data
).
then
(
res
=>
res
),
deletePlanSampler
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/delete_plan_sampler'
,
data
).
then
(
res
=>
res
),
deletePlanSampler
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/delete_plan_sampler'
,
data
).
then
(
res
=>
res
),
saveSubmitPlan
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/save_submit_plan'
,
data
).
then
(
res
=>
res
),
getSamplerPlace
:
data
=>
http
.
post
(
'/drs/v1/sampling_plan/search_selected_sampler_place'
,
data
).
then
(
res
=>
res
),
}
}
src/page/Home.vue
View file @
dde19e69
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<div>
<div>
<img
src=
"@/assets/home/plan.png"
></div>
<img
src=
"@/assets/home/plan.png"
></div>
<div>
<div>
<div
class=
"title"
>
抽样计划执行双随机
</div>
<div
class=
"title"
>
我创建的抽样计划
</div>
<!--todo 每个模块的数量-->
<!--todo 每个模块的数量-->
<div
class=
"num"
>
3
</div>
<div
class=
"num"
>
3
</div>
</div>
</div>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<div
class=
"box-img"
>
<div
class=
"box-img"
>
<img
src=
"@/assets/home/task.png"
></div>
<img
src=
"@/assets/home/task.png"
></div>
<div
class=
"cont"
>
<div
class=
"cont"
>
<div
class=
"title"
>
我的任务
</div>
<div
class=
"title"
>
我的
双随机
任务
</div>
<div
class=
"num"
>
4
</div>
<div
class=
"num"
>
4
</div>
</div>
</div>
</div>
</div>
...
...
src/page/sampling-plan/Maintain.vue
0 → 100644
View file @
dde19e69
<
template
>
<div>
<van-field
label=
"人员"
center
>
<template
#
input
>
<Tag
v-for=
"(item,index) in userList"
:key=
"item.id"
:name=
"index"
closable
@
on-close=
"_userHandleClose"
>
{{
item
.
name
}}
</Tag>
<van-button
size=
"small"
type=
"default"
@
click=
"_userAdd"
>
添加
</van-button>
</
template
>
</van-field>
<van-field
label=
"地点"
center
>
<
template
#
input
>
<Tag
v-for=
"(item,index) in locList"
:key=
"item.id"
:name=
"index"
closable
@
on-close=
"_locHandleClose"
>
{{
item
.
name
}}
</Tag>
<van-button
size=
"small"
type=
"default"
@
click=
"_locAdd"
>
手动添加
</van-button>
<van-button
size=
"small"
type=
"default"
@
click=
"_locSearch"
style=
"margin-left: 10px"
>
搜索选择
</van-button>
</
template
>
</van-field>
<van-popup
v-model=
"showUserSelect"
>
<SamplerLab
@
cancel=
"showUserSelect=false"
@
on-change=
"_selectUserChange"
ref=
"userSelect"
></SamplerLab>
</van-popup>
<van-popup
v-model=
"showLocAdd"
>
<customer-navBar-layout
style=
"width: 100vw;height:100vh"
>
<
template
#
navBar
>
<van-nav-bar
title=
"添加地点"
left-arrow
@
click-left=
"showLocAdd=false"
></van-nav-bar>
</
template
>
<
template
#
content
>
<div
class=
"layout-cont pop-page-cont"
>
<LocAdd
@
on-change=
"_addLocChange"
ref=
"locAdd"
></LocAdd>
</div>
</
template
>
</customer-navBar-layout>
</van-popup>
<van-popup
v-model=
"showLocSelect"
>
<customer-navBar-layout
style=
"width: 100vw;height:100vh"
>
<
template
#
navBar
>
<van-nav-bar
title=
"选择地点"
left-arrow
@
click-left=
"showLocSelect=false"
></van-nav-bar>
</
template
>
<
template
#
content
>
<div
class=
"layout-cont pop-page-cont"
>
<SelectLoc
@
on-change=
"_selectLocChange"
ref=
"locSelect"
></SelectLoc>
</div>
</
template
>
</customer-navBar-layout>
</van-popup>
<div
class=
"bottom-btn"
style=
"position: fixed;bottom: 0"
>
<van-button
type=
"info"
block
@
click=
"_create"
>
随机生成
</van-button>
</div>
</div>
</template>
<
script
>
import
{
samplingPlace
,
samplingPlan
}
from
"../../api"
;
import
SamplerLab
from
'./sampler/SamplerLab'
import
LocAdd
from
'./loc/LocAdd'
import
SelectLoc
from
'./loc/SelectLoc'
export
default
{
components
:
{
SamplerLab
,
LocAdd
,
SelectLoc
,
},
data
()
{
return
{
planId
:
''
,
userList
:
[],
locList
:
[],
showUserSelect
:
false
,
showLocAdd
:
false
,
showLocSelect
:
false
,
}
},
mounted
()
{
this
.
planId
=
this
.
$route
.
query
.
planId
this
.
_getUserList
()
this
.
_getLocList
()
},
methods
:
{
_getUserList
:
async
function
()
{
const
page
=
await
samplingPlan
.
samplerPage
({
page
:
1
,
rows
:
1000
,
planId
:
this
.
planId
})
this
.
userList
=
page
?
page
.
records
:
[]
},
_getLocList
:
async
function
()
{
const
page
=
await
samplingPlace
.
page
({
page
:
1
,
rows
:
1000
,
planId
:
this
.
planId
})
this
.
locList
=
page
?
page
.
records
:
[]
},
_userAdd
()
{
this
.
showUserSelect
=
true
this
.
$nextTick
(
function
()
{
this
.
$refs
.
userSelect
.
_open
(
this
.
planId
)
})
},
_locAdd
()
{
this
.
showLocAdd
=
true
this
.
$nextTick
(
function
()
{
this
.
$refs
.
locAdd
.
_open
(
this
.
planId
)
})
},
_locSearch
()
{
this
.
showLocSelect
=
true
this
.
$nextTick
(
function
()
{
this
.
$refs
.
locSelect
.
_open
(
this
.
planId
)
})
},
_selectUserChange
()
{
this
.
showUserSelect
=
false
this
.
_getUserList
()
},
_addLocChange
()
{
this
.
showLocAdd
=
false
this
.
_getLocList
()
},
_selectLocChange
()
{
this
.
showLocSelect
=
false
this
.
_getLocList
()
},
_userHandleClose
:
async
function
(
event
,
index
)
{
const
result
=
await
samplingPlan
.
deletePlanSampler
({
samplerId
:
this
.
userList
[
index
].
id
,
planId
:
this
.
planId
})
if
(
result
)
{
this
.
userList
.
splice
(
index
,
1
);
}
},
_locHandleClose
:
async
function
(
event
,
index
)
{
const
result
=
await
samplingPlace
.
deleteByIds
(
this
.
locList
[
index
].
id
)
if
(
result
)
{
this
.
locList
.
splice
(
index
,
1
);
}
},
_create
()
{
this
.
$router
.
push
({
path
:
'/sampling_plan/random_create'
,
query
:{
planId
:
this
.
planId
}})
},
}
}
</
script
>
<
style
scoped
>
.pop-page-cont
>
div
{
width
:
100%
;
height
:
100%
;
}
</
style
>
src/page/sampling-plan/SamplingPlan.vue
View file @
dde19e69
<
template
>
<
template
>
<customer-navBar-layout>
<customer-navBar-layout>
<template
#
navBar
>
<template
#
navBar
>
<van-nav-bar
v-if=
"showCheck"
<van-nav-bar
v-if=
"showCheck"
:title=
"$route.meta.title"
:title=
"$route.meta.title"
right-text=
"取消"
right-text=
"取消"
left-arrow
left-arrow
@
click-left=
"_back"
@
click-left=
"_back"
@
click-right=
"_hideCheck"
>
@
click-right=
"_hideCheck"
>
</van-nav-bar>
</van-nav-bar>
<van-nav-bar
<van-nav-bar
v-else
v-else
:title=
"$route.meta.title"
:title=
"$route.meta.title"
right-text=
"添加"
right-text=
"添加"
left-arrow
left-arrow
@
click-left=
"_back"
@
click-left=
"_back"
@
click-right=
"_add"
@
click-right=
"_add"
></van-nav-bar>
></van-nav-bar>
</
template
>
<
template
#
content
>
<search-bar
label=
"计划名称"
ref=
"searchBar"
highSearch
@
search=
"_search"
@
high-search=
"_highSearch"
@
clear-high=
"_clearHigh"
>
<template
#
highSearch
>
<van-field
v-model=
"formObj.name"
label=
"计划名称"
placeholder=
"请输入计划名称"
></van-field>
<datetime-field
label=
"计划开始日期"
v-model=
"formObj.planDateBegin"
></datetime-field>
<datetime-field
label=
"计划结束日期"
v-model=
"formObj.planDateEnd"
></datetime-field>
<van-field
v-model=
"formObj.uname"
label=
"登记人"
placeholder=
"请输入登记人"
></van-field>
<datetime-field
label=
"登记开始日期"
v-model=
"formObj.ctimeBegin"
></datetime-field>
<datetime-field
label=
"登记结束日期"
v-model=
"formObj.ctimeEnd"
></datetime-field>
<picker-field
label=
"状态"
v-model=
"formObj.progress"
:columns=
"statusList"
show-key=
"text"
></picker-field>
</
template
>
</
template
>
<
template
#
content
>
</search-bar>
<search-bar
label=
"计划名称"
ref=
"searchBar"
<div
class=
"layout-cont-sh"
:class=
"{'layout-cont-sh-btn':showCheck}"
>
highSearch
@
search=
"_search"
@
high-search=
"_highSearch"
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
@
clear-high=
"_clearHigh"
>
<van-pull-refresh
v-model=
"refreshing"
@
refresh=
"_refresh"
>
<template
#
highSearch
>
<!--上拉加载 https://vant-contrib.gitee.io/vant/#/zh-CN/list-->
<van-field
v-model=
"formObj.name"
label=
"计划名称"
placeholder=
"请输入计划名称"
></van-field>
<van-list
<datetime-field
label=
"计划开始日期"
v-model=
"formObj.planDateBegin"
></datetime-field>
v-model=
"loading"
<datetime-field
label=
"计划结束日期"
v-model=
"formObj.planDateEnd"
></datetime-field>
:finished=
"finished"
<van-field
v-model=
"formObj.uname"
label=
"登记人"
placeholder=
"请输入登记人"
></van-field>
finished-text=
"没有更多了"
<datetime-field
label=
"登记开始日期"
v-model=
"formObj.ctimeBegin"
></datetime-field>
@
load=
"_load"
>
<datetime-field
label=
"登记结束日期"
v-model=
"formObj.ctimeEnd"
></datetime-field>
<van-checkbox-group
v-model=
"checkListValue"
ref=
"checkboxGroup"
>
<picker-field
label=
"状态"
v-model=
"formObj.progress"
:columns=
"statusList"
<van-swipe-cell
v-for=
"item in resultList"
:key=
"item.id"
>
show-key=
"text"
></picker-field>
<div
class=
"result-item"
@
click=
"_tapItem(item)"
v-touch:longtap=
"_longtapHandler"
>
<div
style=
"width: 100%;display: flex;justify-content: space-between;border-bottom: 1px solid #eeeeee"
>
<div
style=
"display: flex"
>
<div
style=
"margin-right: 20px"
v-if=
"showCheck"
>
<van-checkbox
:name=
"item.id"
shape=
"square"
></van-checkbox>
</div>
<div>
计划名称:{{ item.name }}
</div>
</div>
<div
@
click
.
stop=
"_goFile(item.id)"
>
<img
src=
"../../assets/file-nav.png"
style=
"width: 20px"
>
</div>
</div>
<div>
状态:{{ item.progress }}
</div>
<div>
计划日期:{{ $dateformat(item.planDate, 'yyyy-mm-dd') }}
</div>
<div>
任务下达单位:{{ item.issuingUnit }}
</div>
<div>
任务来源:{{ item.taskSource }}
</div>
<div
style=
"width: 100%"
>
抽样人员:{{ item.samplerNames }}
</div>
<div
style=
"width: 100%"
>
抽样地点:{{ item.placeNames }}
</div>
<div>
抽样进度:{{ item.completionRatio }}
</div>
<div>
产品:{{ item.product }}
</div>
</div>
<
template
#
right
v-if=
"item.progress==='草稿'||item.progress==='审批驳回'"
>
<van-button
square
color=
"#75b7bd"
text=
"提交 "
class=
"swipe-cell-btn"
@
click=
"_submit([item.id])"
></van-button>
<!--
<van-button
square
type=
"info"
text=
"编辑"
class=
"swipe-cell-btn"
--
>
<!-- @click="_edit(item)">
</van-button>
-->
<!--
<van-button
square
type=
"primary"
text=
"管理人员"
class=
"swipe-cell-btn"
--
>
<!-- @click="_peopleManage(item)">
</van-button>
-->
<!--
<van-button
square
type=
"warning"
text=
"管理地点"
class=
"swipe-cell-btn"
--
>
<!-- @click="_locManage(item)">
</van-button>
-->
<van-button
square
type=
"warning"
text=
"维护人员地点"
class=
"swipe-cell-btn"
@
click=
"_maintain(item)"
></van-button>
<van-button
square
type=
"danger"
text=
"删除"
class=
"swipe-cell-btn"
@
click=
"_del([item.id])"
></van-button>
</
template
>
</
template
>
</search-bar>
</van-swipe-cell>
<div
class=
"layout-cont-sh"
:class=
"{'layout-cont-sh-btn':showCheck}"
>
</van-checkbox-group>
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
</van-list>
<van-pull-refresh
v-model=
"refreshing"
@
refresh=
"_refresh"
>
</van-pull-refresh>
<!--上拉加载 https://vant-contrib.gitee.io/vant/#/zh-CN/list-->
</div>
<van-list
<div
class=
"bottom-btn"
v-if=
"showCheck"
>
v-model=
"loading"
<van-button
square
block
@
click=
"_checkAll"
>
{{ checkAll ? '取消全选' : '全选' }}
</van-button>
:finished=
"finished"
<van-button
square
block
type=
"danger"
@
click=
"_del(checkListValue)"
>
删除
</van-button>
finished-text=
"没有更多了"
<van-button
square
block
type=
"info"
@
click=
"_submit(checkListValue)"
>
提交
</van-button>
@
load=
"_load"
>
</div>
<van-checkbox-group
v-model=
"checkListValue"
ref=
"checkboxGroup"
>
</template>
<van-swipe-cell
v-for=
"item in resultList"
:key=
"item.id"
>
</customer-navBar-layout>
<div
class=
"result-item"
@
click=
"_tapItem(item)"
v-touch:longtap=
"_longtapHandler"
>
<div
style=
"width: 100%;display: flex;justify-content: space-between;border-bottom: 1px solid #eeeeee"
>
<div
style=
"display: flex"
>
<div
style=
"margin-right: 20px"
v-if=
"showCheck"
>
<van-checkbox
:name=
"item.id"
shape=
"square"
></van-checkbox>
</div>
<div>
计划名称:{{item.name}}
</div>
</div>
<div
@
click
.
stop=
"_goFile(item.id)"
>
<img
src=
"../../assets/file-nav.png"
style=
"width: 20px"
>
</div>
</div>
<div>
状态:{{item.progress}}
</div>
<div>
计划日期:{{$dateformat(item.planDate,'yyyy-mm-dd')}}
</div>
<div>
任务下达单位:{{item.issuingUnit}}
</div>
<div>
任务来源:{{item.taskSource}}
</div>
<div
style=
"width: 100%"
>
抽样人员:{{item.samplerNames}}
</div>
<div
style=
"width: 100%"
>
抽样地点:{{item.placeNames}}
</div>
<div>
抽样进度:{{item.completionRatio}}
</div>
<div>
产品:{{item.product}}
</div>
</div>
<
template
#
right
v-if=
"item.progress==='草稿'||item.progress==='审批驳回'"
>
<van-button
square
color=
"#75b7bd"
text=
"提交 "
class=
"swipe-cell-btn"
@
click=
"_submit([item.id])"
></van-button>
<van-button
square
type=
"info"
text=
"编辑"
class=
"swipe-cell-btn"
@
click=
"_edit(item)"
></van-button>
<van-button
square
type=
"primary"
text=
"管理人员"
class=
"swipe-cell-btn"
@
click=
"_peopleManage(item)"
></van-button>
<van-button
square
type=
"warning"
text=
"管理地点"
class=
"swipe-cell-btn"
@
click=
"_locManage(item)"
></van-button>
<van-button
square
type=
"danger"
text=
"删除"
class=
"swipe-cell-btn"
@
click=
"_del([item.id])"
></van-button>
</
template
>
</van-swipe-cell>
</van-checkbox-group>
</van-list>
</van-pull-refresh>
</div>
<div
class=
"bottom-btn"
v-if=
"showCheck"
>
<van-button
square
block
@
click=
"_checkAll"
>
{{checkAll?'取消全选':'全选'}}
</van-button>
<van-button
square
block
type=
"danger"
@
click=
"_del(checkListValue)"
>
删除
</van-button>
<van-button
square
block
type=
"info"
@
click=
"_submit(checkListValue)"
>
提交
</van-button>
</div>
</template>
</customer-navBar-layout>
</template>
</template>
<
script
>
<
script
>
import
{
samplingPlan
}
from
'../../api'
import
{
samplingPlan
}
from
'../../api'
export
default
{
export
default
{
name
:
"SamplingPlan"
,
name
:
"SamplingPlan"
,
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
formObj
:
{
formObj
:
{
name
:
''
,
name
:
''
,
planDateBegin
:
''
,
planDateBegin
:
''
,
planDateEnd
:
''
,
planDateEnd
:
''
,
uname
:
''
,
uname
:
''
,
ctimeBegin
:
''
,
ctimeBegin
:
''
,
ctimeEnd
:
''
,
ctimeEnd
:
''
,
progress
:
''
,
progress
:
''
,
flag
:
0
flag
:
0
},
},
statusList
:
[
statusList
:
[
{
value
:
1
,
text
:
'草稿'
},
{
value
:
1
,
text
:
'草稿'
},
{
value
:
2
,
text
:
'审批中'
},
{
value
:
2
,
text
:
'审批中'
},
{
value
:
3
,
text
:
'审批通过'
},
{
value
:
3
,
text
:
'审批通过'
},
{
value
:
4
,
text
:
'审批驳回'
},
{
value
:
4
,
text
:
'审批驳回'
},
{
value
:
5
,
text
:
'实施中'
},
{
value
:
5
,
text
:
'实施中'
},
{
value
:
6
,
text
:
'完成'
},
{
value
:
6
,
text
:
'完成'
},
],
],
key
:
''
,
key
:
''
,
showPopup
:
true
,
showPopup
:
true
,
showCheck
:
false
,
showCheck
:
false
,
checkListValue
:
[],
checkListValue
:
[],
resultList
:
[],
resultList
:
[],
page
:
1
,
page
:
1
,
rows
:
10
,
rows
:
10
,
refreshing
:
false
,
//刷新中...
refreshing
:
false
,
//刷新中...
loading
:
false
,
//加载中...
loading
:
false
,
//加载中...
finished
:
false
,
//没有更多数据
finished
:
false
,
//没有更多数据
planId
:
this
.
$route
.
query
.
planId
planId
:
this
.
$route
.
query
.
planId
}
}
},
},
watch
:
{
watch
:
{
checkListValue
:
function
(
oldVal
,
newVal
)
{
checkListValue
:
function
(
oldVal
,
newVal
)
{
console
.
log
(
oldVal
,
newVal
)
console
.
log
(
oldVal
,
newVal
)
}
}
},
},
computed
:
{
computed
:
{
checkAll
:
function
()
{
checkAll
:
function
()
{
if
(
this
.
resultList
.
length
)
{
if
(
this
.
resultList
.
length
)
{
return
this
.
checkListValue
.
length
===
this
.
resultList
.
length
;
return
this
.
checkListValue
.
length
===
this
.
resultList
.
length
;
}
else
{
}
else
{
return
false
return
false
}
}
}
}
},
},
mounted
()
{
mounted
()
{
this
.
_getData
()
this
.
_getData
()
},
},
methods
:
{
methods
:
{
//简单查询 清空高级查询条件 赋值简单查询数据
//简单查询 清空高级查询条件 赋值简单查询数据
_search
(
value
)
{
_search
(
value
)
{
this
.
key
=
value
this
.
key
=
value
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
.
flag
=
0
this
.
formObj
.
flag
=
0
this
.
_refresh
()
this
.
_refresh
()
},
},
//高级搜索 清空key 查询
//高级搜索 清空key 查询
_highSearch
()
{
_highSearch
()
{
this
.
key
=
''
this
.
key
=
''
if
(
this
.
_valParams
())
{
if
(
this
.
_valParams
())
{
this
.
$refs
.
searchBar
.
_hideHighSearch
()
this
.
$refs
.
searchBar
.
_hideHighSearch
()
this
.
_refresh
()
this
.
_refresh
()
}
}
},
},
_valParams
()
{
_valParams
()
{
if
(
this
.
formObj
.
planDateBegin
===
''
&&
this
.
formObj
.
planDateEnd
!==
''
)
{
if
(
this
.
formObj
.
planDateBegin
===
''
&&
this
.
formObj
.
planDateEnd
!==
''
)
{
this
.
$toast
(
'请选择计划开始日期!'
)
this
.
$toast
(
'请选择计划开始日期!'
)
return
false
return
false
}
else
if
(
this
.
formObj
.
planDateBegin
!==
''
&&
this
.
formObj
.
planDateEnd
===
''
)
{
}
else
if
(
this
.
formObj
.
planDateBegin
!==
''
&&
this
.
formObj
.
planDateEnd
===
''
)
{
this
.
$toast
(
'请选择计划结束日期!'
)
this
.
$toast
(
'请选择计划结束日期!'
)
return
false
return
false
}
else
if
(
this
.
formObj
.
planDateBegin
!==
''
&&
this
.
formObj
.
planDateEnd
!==
''
&&
(
new
Date
(
this
.
formObj
.
planDateBegin
)
>
new
Date
(
this
.
formObj
.
planDateEnd
)))
{
}
else
if
(
this
.
formObj
.
planDateBegin
!==
''
&&
this
.
formObj
.
planDateEnd
!==
''
&&
(
new
Date
(
this
.
formObj
.
planDateBegin
)
>
new
Date
(
this
.
formObj
.
planDateEnd
)))
{
this
.
$toast
(
'计划开始日期不能大于计划结束日期!'
)
this
.
$toast
(
'计划开始日期不能大于计划结束日期!'
)
return
false
return
false
}
}
if
(
this
.
formObj
.
ctimeBegin
===
''
&&
this
.
formObj
.
ctimeEnd
!==
''
)
{
if
(
this
.
formObj
.
ctimeBegin
===
''
&&
this
.
formObj
.
ctimeEnd
!==
''
)
{
this
.
$toast
(
'请选择登记开始日期!'
)
this
.
$toast
(
'请选择登记开始日期!'
)
return
false
return
false
}
else
if
(
this
.
formObj
.
ctimeBegin
!==
''
&&
this
.
formObj
.
ctimeEnd
===
''
)
{
}
else
if
(
this
.
formObj
.
ctimeBegin
!==
''
&&
this
.
formObj
.
ctimeEnd
===
''
)
{
this
.
$toast
(
'请选择登记结束日期!'
)
this
.
$toast
(
'请选择登记结束日期!'
)
return
false
return
false
}
else
if
(
this
.
formObj
.
ctimeBegin
!==
''
&&
this
.
formObj
.
ctimeEnd
!==
''
&&
(
new
Date
(
this
.
formObj
.
ctimeBegin
)
>
new
Date
(
this
.
formObj
.
ctimeEnd
)))
{
}
else
if
(
this
.
formObj
.
ctimeBegin
!==
''
&&
this
.
formObj
.
ctimeEnd
!==
''
&&
(
new
Date
(
this
.
formObj
.
ctimeBegin
)
>
new
Date
(
this
.
formObj
.
ctimeEnd
)))
{
this
.
$toast
(
'登记开始日期不能大于登记结束日期!'
)
this
.
$toast
(
'登记开始日期不能大于登记结束日期!'
)
return
false
return
false
}
}
return
true
return
true
},
},
_clearHigh
()
{
_clearHigh
()
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
.
flag
=
0
this
.
formObj
.
flag
=
0
},
},
_searchParams
()
{
_searchParams
()
{
let
data
=
{
let
data
=
{
page
:
this
.
page
,
page
:
this
.
page
,
rows
:
this
.
rows
,
rows
:
this
.
rows
,
planId
:
this
.
planId
,
planId
:
this
.
planId
,
...
this
.
formObj
...
this
.
formObj
};
};
if
(
this
.
key
)
{
if
(
this
.
key
)
{
data
.
name
=
this
.
key
data
.
name
=
this
.
key
}
}
return
this
.
$serializeForm
(
data
)
return
this
.
$serializeForm
(
data
)
},
},
_getData
:
async
function
()
{
_getData
:
async
function
()
{
let
result
=
await
samplingPlan
.
page
(
this
.
_searchParams
())
let
result
=
await
samplingPlan
.
page
(
this
.
_searchParams
())
this
.
resultList
=
[...(
this
.
page
===
1
?
[]
:
this
.
resultList
),
...
result
.
records
]
this
.
resultList
=
[...(
this
.
page
===
1
?
[]
:
this
.
resultList
),
...
result
.
records
]
this
.
refreshing
=
false
this
.
refreshing
=
false
this
.
loading
=
false
this
.
loading
=
false
if
(
this
.
resultList
.
length
===
result
.
total
)
{
if
(
this
.
resultList
.
length
===
result
.
total
)
{
this
.
finished
=
true
this
.
finished
=
true
}
}
},
},
_refresh
()
{
_refresh
()
{
this
.
page
=
1
;
this
.
page
=
1
;
this
.
_getData
()
this
.
_getData
()
},
},
_load
()
{
_load
()
{
this
.
page
=
this
.
page
+
1
;
this
.
page
=
this
.
page
+
1
;
this
.
_getData
()
this
.
_getData
()
},
},
_back
()
{
_back
()
{
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
)
},
},
_add
()
{
_add
()
{
this
.
$router
.
push
({
path
:
'/sampling_plan/sampling_plan_add'
,
query
:
{
title
:
'抽样计划添加'
}})
this
.
$router
.
push
({
path
:
'/sampling_plan/sampling_plan_add'
,
query
:
{
title
:
'抽样计划添加'
}})
},
},
_longtapHandler
()
{
_longtapHandler
()
{
this
.
showCheck
=
true
this
.
showCheck
=
true
},
},
_hideCheck
()
{
_hideCheck
()
{
this
.
showCheck
=
false
this
.
showCheck
=
false
this
.
checkListValue
=
[]
this
.
checkListValue
=
[]
},
},
_checkAll
()
{
_checkAll
()
{
if
(
this
.
checkAll
)
{
if
(
this
.
checkAll
)
{
this
.
$refs
.
checkboxGroup
.
toggleAll
();
this
.
$refs
.
checkboxGroup
.
toggleAll
();
}
else
{
}
else
{
this
.
$refs
.
checkboxGroup
.
toggleAll
(
true
);
this
.
$refs
.
checkboxGroup
.
toggleAll
(
true
);
}
}
},
},
_tapItem
(
item
)
{
_tapItem
(
item
)
{
if
(
this
.
showCheck
)
{
if
(
this
.
showCheck
)
{
if
(
this
.
checkListValue
.
indexOf
(
item
.
id
)
===
-
1
)
{
if
(
this
.
checkListValue
.
indexOf
(
item
.
id
)
===
-
1
)
{
this
.
checkListValue
.
push
(
item
.
id
);
this
.
checkListValue
.
push
(
item
.
id
);
}
else
{
}
else
{
this
.
checkListValue
.
splice
(
this
.
checkListValue
.
indexOf
(
item
.
id
),
1
);
this
.
checkListValue
.
splice
(
this
.
checkListValue
.
indexOf
(
item
.
id
),
1
);
}
}
else
{
// if (item.testedType === 1) {
// this.$router.push({path: '/sampling_plan/sampling_plan_detail_net', query: {id: item.id}})
// } else if (item.testedType === 0) {
// this.$router.push({path: '/sampling_plan/sampling_plan_detail', query: {id: item.id}})
// } else {
// this.$router.push({
// path: '/sampling_plan/sampling_plan_detail_agriculture',
// query: {id: item.id}
// })
// }
}
},
_edit
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/sampling_plan_add'
,
query
:
{
id
:
item
.
id
,
title
:
'抽样计划编辑'
}})
},
_peopleManage
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/sampler_checked'
,
query
:
{
planId
:
item
.
id
}})
},
_locManage
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/loc_checked'
,
query
:
{
planId
:
item
.
id
}})
},
_del
(
ids
)
{
if
(
ids
.
length
===
0
)
{
this
.
$toast
(
'请至少选择一条数据!'
)
}
else
{
this
.
_delOk
(
ids
)
}
},
_delOk
:
async
function
(
ids
)
{
let
result
=
await
samplingPlan
.
deleteByIds
(
ids
)
if
(
result
)
{
this
.
$toast
(
'操作成功!'
)
this
.
_refresh
()
}
},
_submit
()
{
if
(
this
.
checkListValue
.
length
===
0
)
{
this
.
$toast
(
'请至少选择一条数据!'
)
}
else
{
// this._delOk(ids)
// todo 提交
}
},
_goFile
(
id
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/file'
,
query
:
{
planId
:
id
}})
}
}
}
}
else
{
this
.
_edit
(
item
)
// if (item.testedType === 1) {
// this.$router.push({path: '/sampling_plan/sampling_plan_detail_net', query: {id: item.id}})
// } else if (item.testedType === 0) {
// this.$router.push({path: '/sampling_plan/sampling_plan_detail', query: {id: item.id}})
// } else {
// this.$router.push({
// path: '/sampling_plan/sampling_plan_detail_agriculture',
// query: {id: item.id}
// })
// }
}
},
_edit
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/sampling_plan_add'
,
query
:
{
id
:
item
.
id
,
title
:
'抽样计划编辑'
}})
},
_peopleManage
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/sampler_checked'
,
query
:
{
planId
:
item
.
id
}})
},
_locManage
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/loc_checked'
,
query
:
{
planId
:
item
.
id
}})
},
_maintain
(
item
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/maintain'
,
query
:
{
planId
:
item
.
id
}})
},
_del
(
ids
)
{
if
(
ids
.
length
===
0
)
{
this
.
$toast
(
'请至少选择一条数据!'
)
}
else
{
this
.
_delOk
(
ids
)
}
},
_delOk
:
async
function
(
ids
)
{
let
result
=
await
samplingPlan
.
deleteByIds
(
ids
)
if
(
result
)
{
this
.
$toast
(
'操作成功!'
)
this
.
_refresh
()
}
},
_submit
()
{
if
(
this
.
checkListValue
.
length
===
0
)
{
this
.
$toast
(
'请至少选择一条数据!'
)
}
else
{
// this._delOk(ids)
// todo 提交
}
},
_goFile
(
id
)
{
this
.
$router
.
push
({
path
:
'/sampling_plan/file'
,
query
:
{
planId
:
id
}})
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/page/sampling-plan/SamplingPlanAdd.vue
deleted
100644 → 0
View file @
c55e1d4c
<
template
>
<div>
<van-form
@
submit=
"onSubmit"
>
<van-field
v-model=
"formObj.name"
name=
"name"
label=
"计划名称"
placeholder=
"计划名称"
:rules=
"[
{ required: true, message: '请填写计划名称'}]"
>
</van-field>
<van-field
v-model=
"formObj.planDate"
name=
"monitorDate"
label=
"计划日期"
placeholder=
"计划日期"
@
click=
"_selectDate('formObj.planDate')"
></van-field>
<van-field
v-model=
"formObj.issuingUnit"
name=
"issuingUnit"
label=
"任务下达单位"
placeholder=
"任务下达单位"
></van-field>
<van-field
v-model=
"formObj.taskSource"
name=
"taskSource"
label=
"任务来源"
placeholder=
"任务来源"
></van-field>
<van-field
type=
"textarea"
v-model=
"formObj.product"
name=
"product"
label=
"产品"
placeholder=
"产品"
></van-field>
<van-field
v-model=
"formObj.standard"
name=
"standard"
label=
"抽查依据标准"
placeholder=
"抽查依据标准"
></van-field>
<van-field
v-model=
"formObj.finishDate"
name=
"finishDate"
label=
"完成时间"
placeholder=
"完成时间"
@
click=
"_selectDate('formObj.finishDate')"
></van-field>
<van-field
type=
"number"
v-model=
"formObj.samplingQuantity"
name=
"samplingQuantity"
label=
"抽样数量"
placeholder=
"抽样数量"
></van-field>
<van-field
type=
"number"
v-model=
"formObj.testCost"
name=
"testCost"
label=
"检测费用"
placeholder=
"检测费用"
></van-field>
<van-field
v-model=
"formObj.announcementNo"
name=
"announcementNo"
label=
"公告号"
placeholder=
"公告号"
></van-field>
<van-field
v-model=
"formObj.announcementDate"
name=
"announcementDate"
label=
"公告日期"
placeholder=
"公告日期"
@
click=
"_selectDate('formObj.announcementDate')"
></van-field>
<van-field
type=
"textarea"
v-model=
"formObj.remark"
name=
"remark"
label=
"备注"
placeholder=
"备注"
></van-field>
<div
style=
"margin: 16px;"
>
<van-button
round
block
type=
"info"
native-type=
"submit"
>
保存
</van-button>
</div>
</van-form>
<van-popup
v-model=
"showDatePicker"
position=
"bottom"
:safe-area-inset-bottom=
"true"
:close-on-popstate=
"true"
>
<van-datetime-picker
type=
"date"
v-model=
"currentDate"
@
confirm=
"_dateConfirm"
@
cancel=
"showDatePicker = false"
></van-datetime-picker>
</van-popup>
</div>
</
template
>
<
script
>
import
{
samplingPlan
}
from
'../../api'
export
default
{
name
:
"SamplingPlanAdd"
,
data
()
{
return
{
showDatePicker
:
false
,
currentDate
:
new
Date
(),
selectDateType
:
''
,
id
:
''
,
formObj
:
{
name
:
''
,
planDate
:
''
,
issuingUnit
:
''
,
taskSource
:
''
,
product
:
''
,
standard
:
''
,
finishDate
:
''
,
samplingQuantity
:
''
,
testCost
:
0
,
announcementNo
:
''
,
announcementDate
:
''
,
remark
:
''
}
}
},
mounted
()
{
this
.
_open
()
},
methods
:
{
_open
()
{
if
(
this
.
$route
.
query
.
id
)
{
//编辑
this
.
id
=
this
.
$route
.
query
.
id
this
.
_getData
()
}
else
{
this
.
id
=
''
}
},
_getData
:
async
function
()
{
let
result
=
await
samplingPlan
.
getById
(
this
.
id
)
if
(
result
)
{
for
(
let
key
in
this
.
formObj
)
{
if
(
result
[
key
])
{
if
(
key
===
'planDate'
||
key
===
'finishDate'
||
key
===
'announcementDate'
)
{
this
.
formObj
[
key
]
=
this
.
$dateformat
(
result
[
key
],
'yyyy-mm-dd'
)
}
else
{
this
.
formObj
[
key
]
=
result
[
key
]
}
}
}
}
},
onSubmit
(
res
)
{
if
(
this
.
id
)
{
this
.
_editSave
(
this
.
$serializeForm
(
res
))
}
else
{
this
.
_addSave
(
this
.
$serializeForm
(
res
))
}
},
_editSave
:
async
function
(
res
)
{
let
result
=
await
samplingPlan
.
edit
({
id
:
this
.
id
,
obj
:
res
})
if
(
result
)
{
this
.
$toast
(
'编辑成功!'
)
this
.
$router
.
go
(
-
1
)
}
},
_addSave
:
async
function
(
res
)
{
let
result
=
await
samplingPlan
.
add
(
res
)
if
(
result
)
{
this
.
$toast
(
'添加成功!'
)
this
.
$router
.
go
(
-
1
)
}
},
_selectDate
(
type
)
{
this
.
selectDateType
=
type
this
.
showDatePicker
=
true
},
_dateConfirm
(
date
)
{
switch
(
this
.
selectDateType
)
{
case
'formObj.planDate'
:
this
.
formObj
.
planDate
=
this
.
$dateformat
(
date
,
'yyyy-mm-dd'
)
break
case
'formObj.finishDate'
:
this
.
formObj
.
finishDate
=
this
.
$dateformat
(
date
,
'yyyy-mm-dd'
)
break
case
'formObj.announcementDate'
:
this
.
formObj
.
announcementDate
=
this
.
$dateformat
(
date
,
'yyyy-mm-dd'
)
break
}
this
.
showDatePicker
=
false
},
}
}
</
script
>
<
style
scoped
>
</
style
>
src/page/sampling-plan/sampler/SelectSampler.vue
View file @
dde19e69
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
/**
* 抽样任务-人员双随机-手动添加
*/
import
{
sampler
,
samplingPlan
}
from
'../../../api'
import
{
sampler
,
samplingPlan
}
from
'../../../api'
export
default
{
export
default
{
...
...
src/router/sampling-plan-routes.js
View file @
dde19e69
import
SamplingPlan
from
'@/page/sampling-plan/SamplingPlan.vue'
import
SamplingPlan
from
'@/page/sampling-plan/SamplingPlan.vue'
import
SamplingPlanAdd
from
'@/page/sampling-plan/SamplingPlanAdd.vue'
import
Maintain
from
'@/page/sampling-plan/Maintain.vue'
import
RandomCreate
from
'@/page/sampling-plan/RandomCreate.vue'
import
SamplingPlanAdd
from
'@/page/sampling-plan/add/SamplingPlanAdd.vue'
import
SamplerChecked
from
'@/page/sampling-plan/sampler/SamplerChecked.vue'
//
import SamplerChecked from '@/page/sampling-plan/sampler/SamplerChecked.vue'
import
SelectSampler
from
'@/page/sampling-plan/sampler/SelectSampler.vue'
import
SelectSampler
from
'@/page/sampling-plan/sampler/SelectSampler.vue'
import
CreateSampler
from
'@/page/sampling-plan/sampler/CreateSampler.vue'
//
import CreateSampler from '@/page/sampling-plan/sampler/CreateSampler.vue'
import
LocChecked
from
'@/page/sampling-plan/loc/LocChecked.vue'
import
LocChecked
from
'@/page/sampling-plan/loc/LocChecked.vue'
import
SelectLoc
from
'@/page/sampling-plan/loc/SelectLoc.vue'
//
import SelectLoc from '@/page/sampling-plan/loc/SelectLoc.vue'
import
CreateLoc
from
'@/page/sampling-plan/loc/CreateLoc.vue'
//
import CreateLoc from '@/page/sampling-plan/loc/CreateLoc.vue'
import
LocAdd
from
'@/page/sampling-plan/loc/LocAdd.vue'
//
import LocAdd from '@/page/sampling-plan/loc/LocAdd.vue'
import
File
from
'@/page/sampling-plan/file/File.vue'
import
File
from
'@/page/sampling-plan/file/File.vue'
import
FileDownLoad
from
'@/page/sampling-plan/file/FileDownLoad.vue'
import
FileDownLoad
from
'@/page/sampling-plan/file/FileDownLoad.vue'
...
@@ -16,16 +18,18 @@ import FileUpload from '@/page/sampling-plan/file/FileUpload.vue'
...
@@ -16,16 +18,18 @@ import FileUpload from '@/page/sampling-plan/file/FileUpload.vue'
export
default
[
export
default
[
{
path
:
'sampling_plan'
,
component
:
SamplingPlan
,
meta
:
{
title
:
'抽样计划'
,
hideNavBar
:
true
}},
{
path
:
'sampling_plan'
,
component
:
SamplingPlan
,
meta
:
{
title
:
'抽样计划'
,
hideNavBar
:
true
}},
{
path
:
'maintain'
,
component
:
Maintain
,
meta
:
{
title
:
'维护人员、地点'
}},
{
path
:
'random_create'
,
component
:
RandomCreate
,
meta
:
{
title
:
'随机生成'
}},
{
path
:
'sampling_plan_add'
,
component
:
SamplingPlanAdd
,
meta
:
{
customerNavBarTitle
:
true
}},
{
path
:
'sampling_plan_add'
,
component
:
SamplingPlanAdd
,
meta
:
{
customerNavBarTitle
:
true
}},
{
path
:
'sampler_checked'
,
component
:
SamplerChecked
,
meta
:
{
title
:
'管理抽样人员'
}},
//
{path: 'sampler_checked', component: SamplerChecked, meta: {title: '管理抽样人员'}},
{
path
:
'select_sampler'
,
component
:
SelectSampler
,
meta
:
{
title
:
'选择抽样人员'
}},
{
path
:
'select_sampler'
,
component
:
SelectSampler
,
meta
:
{
title
:
'选择抽样人员'
}},
{
path
:
'create_sampler'
,
component
:
CreateSampler
,
meta
:
{
title
:
'生成抽样人员'
}},
//
{path: 'create_sampler', component: CreateSampler, meta: {title: '生成抽样人员'}},
{
path
:
'loc_checked'
,
component
:
LocChecked
,
meta
:
{
title
:
'管理抽样地点'
}},
{
path
:
'loc_checked'
,
component
:
LocChecked
,
meta
:
{
title
:
'管理抽样地点'
}},
{
path
:
'select_loc'
,
component
:
SelectLoc
,
meta
:
{
title
:
'选择抽样地点'
}},
//
{path: 'select_loc', component: SelectLoc, meta: {title: '选择抽样地点'}},
{
path
:
'create_loc'
,
component
:
CreateLoc
,
meta
:
{
title
:
'生成抽样地点'
}},
//
{path: 'create_loc', component: CreateLoc, meta: {title: '生成抽样地点'}},
{
path
:
'loc_add'
,
component
:
LocAdd
,
meta
:
{
title
:
'添加地点'
}},
//
{path: 'loc_add', component: LocAdd, meta: {title: '添加地点'}},
{
path
:
'file'
,
component
:
File
,
meta
:
{
title
:
'附件'
}},
{
path
:
'file'
,
component
:
File
,
meta
:
{
title
:
'附件'
}},
{
path
:
'file_upload'
,
component
:
FileUpload
,
meta
:
{
title
:
'添加附件'
}},
{
path
:
'file_upload'
,
component
:
FileUpload
,
meta
:
{
title
:
'添加附件'
}},
...
...
src/styles/main.less
View file @
dde19e69
...
@@ -287,3 +287,8 @@ html, body, #app, .main-content-con {
...
@@ -287,3 +287,8 @@ html, body, #app, .main-content-con {
color: @text-color-white;
color: @text-color-white;
}
}
}
}
.van-field__control--custom{
flex-wrap: wrap;
}
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