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
69a1b7ee
Commit
69a1b7ee
authored
Mar 11, 2021
by
zhuxiaomei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
禁用的文件
parent
4058f96c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
195 additions
and
195 deletions
+195
-195
CreateLocDIS.vue
src/page/sampling-plan/loc/CreateLocDIS.vue
+97
-97
CreateSamplerDIS.vue
src/page/sampling-plan/sampler/CreateSamplerDIS.vue
+98
-98
No files found.
src/page/sampling-plan/loc/CreateLocDIS.vue
View file @
69a1b7ee
<
template
>
<
!--<template>--
>
<div
>
<!-- <div>--
>
<div
class=
"layout-cont-btn"
>
<!-- <div class="layout-cont-btn">--
>
<van-form
@
submit=
"onSubmit"
>
<!-- <van-form @submit="onSubmit">--
>
<van-field
<!-- <van-field-->
v-model=
"count"
<!-- v-model="count"-->
name=
"count"
<!-- name="count"-->
type=
"digit"
<!-- type="digit"-->
required
center
<!-- required center-->
label=
"随机数量"
<!-- label="随机数量"-->
placeholder=
"请输入随机数量"
<!-- placeholder="请输入随机数量"-->
:rules=
"[
{ required: true, message: '' }]"
>
<!-- :rules="[{ required: true, message: '' }]">--
>
<template
#
button
>
<!-- <template #button>--
>
<van-button
size=
"small"
type=
"info"
native-type=
"submit"
>
生成
</van-button
>
<!-- <van-button size="small" type="info" native-type="submit">生成</van-button>--
>
</
template
>
<!-- </template>--
>
</van-field
>
<!-- </van-field>--
>
<van-field
label=
"地点"
center
>
<!-- <van-field label="地点" center>--
>
<
template
#
input
>
<!-- <template #input>--
>
<Tag
v-for=
"item in locList"
:key=
"item.id"
name=
"item"
closable
@
on-close=
"_handleClose"
>
<!-- <Tag v-for="item in locList" :key="item.id" name="item" closable @on-close="_handleClose">--
>
{{
item
.
name
}}
<!-- {{item.name}}-->
</Tag
>
<!-- </Tag>--
>
<van-button
size=
"small"
type=
"default"
@
click=
"_add"
>
添加
</van-button
>
<!-- <van-button size="small" type="default" @click="_add">添加</van-button>--
>
</
template
>
<!-- </template>--
>
</van-field
>
<!-- </van-field>--
>
</van-form
>
<!-- </van-form>--
>
</div
>
<!-- </div>--
>
<div
class=
"bottom-btn"
>
<!-- <div class="bottom-btn">--
>
<van-button
block
type=
"info"
@
click=
"_ok"
>
保存
</van-button
>
<!-- <van-button block type="info" @click="_ok">保存</van-button>--
>
</div
>
<!-- </div>--
>
<van-popup
v-model=
"showSelect"
>
<!-- <van-popup v-model="showSelect">--
>
<SelectLocChecked
@
cancel=
"showSelect=false"
@
on-change=
"_selectChange"
ref=
"select"
></SelectLocChecked
>
<!-- <SelectLocChecked @cancel="showSelect=false" @on-change="_selectChange" ref="select"></SelectLocChecked>--
>
</van-popup
>
<!-- </van-popup>--
>
</div
>
<!-- </div>--
>
<
/template
>
<
!--</template>--
>
<
script
>
<
!--<script>--
>
import
{
samplingPlan
}
from
'../../../api'
<!-- import {samplingPlan} from '../../../api'-->
import
SelectLocChecked
from
'../add/loc/SelectLocChecked'
<!-- import SelectLocChecked from '../add/loc/SelectLocChecked'-->
export
default
{
<!-- export default {-->
name
:
"CreateLoc"
,
<!-- name: "CreateLoc",-->
components
:
{
<!-- components: {-->
SelectLocChecked
<!-- SelectLocChecked-->
},
<!-- },-->
data
()
{
<!-- data() {-->
return
{
<!-- return {-->
showSelect
:
false
,
<!-- showSelect: false,-->
planId
:
''
,
<!-- planId: '',-->
count
:
''
,
<!-- count: '',-->
locList
:
[]
<!-- locList: []-->
}
<!-- }-->
},
<!-- },-->
mounted
()
{
<!-- mounted() {-->
this
.
planId
=
this
.
$route
.
query
.
planId
<!-- this.planId = this.$route.query.planId-->
},
<!-- },-->
methods
:
{
<!-- methods: {-->
onSubmit
()
{
<!-- onSubmit() {-->
this
.
_create
()
<!-- this._create()-->
},
<!-- },-->
_create
:
async
function
()
{
<!-- _create: async function () {-->
let
result
=
await
samplingPlan
.
generatePlace
({
count
:
this
.
count
,
planId
:
this
.
planId
})
<!-- let result = await samplingPlan.generatePlace({count: this.count, planId: this.planId})-->
if
(
result
)
{
<!-- if (result) {-->
this
.
$toast
(
'生成成功!'
)
<!-- this.$toast('生成成功!')-->
this
.
locList
=
result
<!-- this.locList = result-->
}
<!-- }-->
},
<!-- },-->
_handleClose
(
event
,
name
)
{
<!-- _handleClose(event, name) {-->
const
index
=
this
.
locList
.
indexOf
(
name
);
<!-- const index = this.locList.indexOf(name);-->
this
.
locList
.
splice
(
index
,
1
);
<!-- this.locList.splice(index, 1);-->
},
<!-- },-->
_add
()
{
<!-- _add() {-->
this
.
showSelect
=
true
<!-- this.showSelect = true-->
this
.
$nextTick
(
function
()
{
<!-- this.$nextTick(function () {-->
this
.
$refs
.
select
.
_open
(
this
.
planId
)
<!-- this.$refs.select._open(this.planId)-->
})
<!-- })-->
},
<!-- },-->
_selectChange
(
res
)
{
<!-- _selectChange(res) {-->
this
.
showSelect
=
false
<!-- this.showSelect = false-->
this
.
locList
=
res
<!-- this.locList = res-->
},
<!-- },-->
_ok
:
async
function
()
{
<!-- _ok: async function () {-->
if
(
this
.
userList
.
length
===
0
)
{
<!-- if (this.userList.length === 0) {-->
this
.
$toast
(
'请生成人员!'
)
<!-- this.$toast('请生成人员!')-->
}
else
{
<!-- } else {-->
let
result
=
await
samplingPlan
.
savePlace
({
<!-- let result = await samplingPlan.savePlace({-->
planId
:
this
.
planId
,
<!-- planId: this.planId,-->
placeIds
:
this
.
locList
.
map
(
item
=>
item
.
id
).
join
(
','
)
<!-- placeIds: this.locList.map(item => item.id).join(',')-->
})
<!-- })-->
if
(
result
)
{
<!-- if (result) {-->
this
.
$toast
(
'保存成功!'
)
<!-- this.$toast('保存成功!')-->
this
.
$router
.
go
(
-
2
)
<!-- this.$router.go(-2)-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
<
/
script
>
<
!--</script>--
>
<
style
scoped
>
<
!--<style scoped>--
>
<
/
style
>
<
!--</style>--
>
src/page/sampling-plan/sampler/CreateSamplerDIS.vue
View file @
69a1b7ee
<
template
>
<
!--<template>--
>
<div
>
<!-- <div>--
>
<div
class=
"layout-cont-btn"
>
<!-- <div class="layout-cont-btn">--
>
<van-form
@
submit=
"onSubmit"
>
<!-- <van-form @submit="onSubmit">--
>
<van-field
<!-- <van-field-->
v-model=
"count"
<!-- v-model="count"-->
name=
"count"
<!-- name="count"-->
type=
"digit"
<!-- type="digit"-->
required
center
<!-- required center-->
label=
"随机数量"
<!-- label="随机数量"-->
placeholder=
"请输入随机数量"
<!-- placeholder="请输入随机数量"-->
:rules=
"[
{ required: true, message: '' }]"
>
<!-- :rules="[{ required: true, message: '' }]">--
>
<template
#
button
>
<!-- <template #button>--
>
<van-button
size=
"small"
type=
"info"
native-type=
"submit"
>
生成
</van-button
>
<!-- <van-button size="small" type="info" native-type="submit">生成</van-button>--
>
</
template
>
<!-- </template>--
>
</van-field
>
<!-- </van-field>--
>
<van-field
label=
"人员"
center
>
<!-- <van-field label="人员" center>--
>
<
template
#
input
>
<!-- <template #input>--
>
<Tag
v-for=
"item in userList"
:key=
"item.id"
name=
"item"
closable
@
on-close=
"_handleClose"
>
<!-- <Tag v-for="item in userList" :key="item.id" name="item" closable @on-close="_handleClose">--
>
{{
item
.
name
}}
<!-- {{item.name}}-->
</Tag
>
<!-- </Tag>--
>
<van-button
size=
"small"
type=
"default"
@
click=
"_add"
>
添加
</van-button
>
<!-- <van-button size="small" type="default" @click="_add">添加</van-button>--
>
</
template
>
<!-- </template>--
>
</van-field
>
<!-- </van-field>--
>
</van-form
>
<!-- </van-form>--
>
</div
>
<!-- </div>--
>
<div
class=
"bottom-btn"
>
<!-- <div class="bottom-btn">--
>
<van-button
block
type=
"info"
@
click=
"_ok"
>
保存
</van-button
>
<!-- <van-button block type="info" @click="_ok">保存</van-button>--
>
</div
>
<!-- </div>--
>
<van-popup
v-model=
"showAllSelect"
>
<!-- <van-popup v-model="showAllSelect">--
>
<SelectSamplerChecked
@
cancel=
"showAllSelect=false"
@
on-change=
"_selectChange"
<!-- <SelectSamplerChecked @cancel="showAllSelect=false" @on-change="_selectChange"-->
ref=
"select"
></SelectSamplerChecked
>
<!-- ref="select"></SelectSamplerChecked>--
>
</van-popup
>
<!-- </van-popup>--
>
</div
>
<!-- </div>--
>
<
/template
>
<
!--</template>--
>
<
script
>
<
!--<script>--
>
import
{
samplingPlan
}
from
'../../../api'
<!-- import {samplingPlan} from '../../../api'-->
import
SelectSamplerChecked
from
'./SelectSamplerChecked'
<!-- import SelectSamplerChecked from './SelectSamplerChecked'-->
export
default
{
<!-- export default {-->
name
:
"CreateSampler"
,
<!-- name: "CreateSampler",-->
components
:
{
<!-- components: {-->
SelectSamplerChecked
<!-- SelectSamplerChecked-->
},
<!-- },-->
data
()
{
<!-- data() {-->
return
{
<!-- return {-->
showAllSelect
:
false
,
<!-- showAllSelect: false,-->
planId
:
''
,
<!-- planId: '',-->
count
:
''
,
<!-- count: '',-->
userList
:
[]
<!-- userList: []-->
}
<!-- }-->
},
<!-- },-->
mounted
()
{
<!-- mounted() {-->
this
.
planId
=
this
.
$route
.
query
.
planId
<!-- this.planId = this.$route.query.planId-->
},
<!-- },-->
methods
:
{
<!-- methods: {-->
onSubmit
()
{
<!-- onSubmit() {-->
this
.
_create
()
<!-- this._create()-->
},
<!-- },-->
_create
:
async
function
()
{
<!-- _create: async function () {-->
let
result
=
await
samplingPlan
.
generateSampler
({
count
:
this
.
count
,
planId
:
this
.
planId
})
<!-- let result = await samplingPlan.generateSampler({count: this.count, planId: this.planId})-->
if
(
result
)
{
<!-- if (result) {-->
this
.
$toast
(
'生成成功!'
)
<!-- this.$toast('生成成功!')-->
this
.
userList
=
result
<!-- this.userList = result-->
}
<!-- }-->
},
<!-- },-->
_handleClose
(
event
,
name
)
{
<!-- _handleClose(event, name) {-->
const
index
=
this
.
userList
.
indexOf
(
name
);
<!-- const index = this.userList.indexOf(name);-->
this
.
userList
.
splice
(
index
,
1
);
<!-- this.userList.splice(index, 1);-->
},
<!-- },-->
_add
()
{
<!-- _add() {-->
this
.
showAllSelect
=
true
<!-- this.showAllSelect = true-->
this
.
$nextTick
(
function
()
{
<!-- this.$nextTick(function () {-->
this
.
$refs
.
select
.
_open
(
this
.
planId
)
<!-- this.$refs.select._open(this.planId)-->
})
<!-- })-->
},
<!-- },-->
_selectChange
(
res
)
{
<!-- _selectChange(res) {-->
this
.
showAllSelect
=
false
<!-- this.showAllSelect = false-->
this
.
userList
=
res
<!-- this.userList = res-->
},
<!-- },-->
_ok
:
async
function
()
{
<!-- _ok: async function () {-->
if
(
this
.
userList
.
length
===
0
)
{
<!-- if (this.userList.length === 0) {-->
this
.
$toast
(
'请生成人员!'
)
<!-- this.$toast('请生成人员!')-->
}
else
{
<!-- } else {-->
let
result
=
await
samplingPlan
.
saveSamplerRandom
({
<!-- let result = await samplingPlan.saveSamplerRandom({-->
planId
:
this
.
planId
,
<!-- planId: this.planId,-->
samplerIds
:
this
.
userList
.
map
(
item
=>
item
.
id
).
join
(
','
)
<!-- samplerIds: this.userList.map(item => item.id).join(',')-->
})
<!-- })-->
if
(
result
)
{
<!-- if (result) {-->
this
.
$toast
(
'保存成功!'
)
<!-- this.$toast('保存成功!')-->
this
.
$router
.
go
(
-
2
)
<!-- this.$router.go(-2)-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
}
<!-- }-->
<
/
script
>
<
!--</script>--
>
<
style
scoped
>
<
!--<style scoped>--
>
<
/
style
>
<
!--</style>--
>
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