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
a31a7b3e
Commit
a31a7b3e
authored
Nov 05, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了开土制备导入检测项目
parent
7232dc6f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
754 additions
and
23 deletions
+754
-23
soil-sample.js
api/soil/soil-sample.js
+10
-1
SoilSampleItemManage.vue
pages/soil-sample-manage/SoilSampleItemManage.vue
+20
-21
SampleduplicateIndex.vue
...l-sample-manage/duplicate-manage/SampleduplicateIndex.vue
+48
-0
SurplusduplicateApply.vue
...-sample-manage/duplicate-manage/SurplusduplicateApply.vue
+0
-0
SampleduplicateManage.vue
...ple-manage/duplicate-manage/tab/SampleduplicateManage.vue
+0
-0
SampleduplicateQuery.vue
...mple-manage/duplicate-manage/tab/SampleduplicateQuery.vue
+278
-0
AptitudeItem.vue
pages/soil-sample-manage/sample-preparation/AptitudeItem.vue
+165
-0
ImportItem.vue
pages/soil-sample-manage/sample-preparation/ImportItem.vue
+226
-0
SampleParpareBatchEdit.vue
...mple-manage/sample-preparation/SampleParpareBatchEdit.vue
+1
-1
soil-routes.js
router/soil-routes.js
+6
-0
No files found.
api/soil/soil-sample.js
View file @
a31a7b3e
...
@@ -143,5 +143,14 @@ export default {
...
@@ -143,5 +143,14 @@ export default {
.
post
(
'soil/v1/sample/scan_take_sample?sampleCode='
+
data
)
.
post
(
'soil/v1/sample/scan_take_sample?sampleCode='
+
data
)
.
then
(
res
=>
res
),
.
then
(
res
=>
res
),
pageLocationSample
:
data
=>
pageLocationSample
:
data
=>
http
.
post
(
'soil/v1/sample/page_location_sample'
,
data
).
then
(
res
=>
res
)
http
.
post
(
'soil/v1/sample/page_location_sample'
,
data
).
then
(
res
=>
res
),
importExperiments
:
data
=>
http
.
post
(
'soil/v1/experiment/import_experiments?aptitudeIds='
+
data
.
aptitudeIds
+
'&ids='
+
data
.
ids
)
.
then
(
res
=>
res
)
}
}
pages/soil-sample-manage/SoilSampleItemManage.vue
View file @
a31a7b3e
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<!-- 表格 -->
<!-- 表格 -->
<Col
span=
"24"
>
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
:get-page=
"getPage"
@
on-result-change=
"_tableResultChange"
>
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
select-data
>
<vxe-table-column
<vxe-table-column
v-for=
"item in pageColumns"
v-for=
"item in pageColumns"
:key=
"item.key"
:key=
"item.key"
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
</el-select>
</el-select>
<span
v-if=
"!showOption"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</span>
<span
v-if=
"!showOption"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</span>
</div>
</div>
<span
v-else-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
<span
v-else-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
]
.
display
}}
</span>
<div
v-else-if=
"item.judged"
>
<div
v-else-if=
"item.judged"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</div>
</div>
...
@@ -105,28 +105,36 @@
...
@@ -105,28 +105,36 @@
<modal-footer
ref=
"footerModal"
:footer=
"footerList"
@
on-result-change=
"_footerResult"
/>
<modal-footer
ref=
"footerModal"
:footer=
"footerList"
@
on-result-change=
"_footerResult"
/>
</div>
</div>
</Modal>
</Modal>
<ImportItem
ref=
"itemImport"
@
on-result-change=
"_page"
></ImportItem>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
http
from
'../../api/http'
import
http
from
'../../api/http'
import
{
soilEntrust
}
from
'../../api'
import
{
soilEntrust
}
from
'../../api'
import
ImportItem
from
'./sample-preparation/ImportItem'
export
default
{
export
default
{
components
:
{},
components
:
{
ImportItem
},
data
()
{
data
()
{
return
{
return
{
formId
:
'SoilSampleItemManage'
,
formId
:
'SoilSampleItemManage'
,
currentComponent
:
''
,
currentComponent
:
''
,
btn
:
[],
btn
:
[
iconMsg
:
[{
type
:
'pt-a-end'
,
id
:
''
,
name
:
'删除'
}],
{
type
:
'success'
,
id
:
''
,
name
:
'导入检测项目'
}
],
iconMsg
:
[{
type
:
'md-trash'
,
id
:
''
,
name
:
'删除'
}],
sampleId
:
''
,
// 样品id
sampleId
:
''
,
// 样品id
showModal
:
false
,
showModal
:
false
,
modalTitle
:
'管理检测项目'
,
modalTitle
:
'管理检测项目'
,
selectIds
:
[],
selectIds
:
[],
selectData
:
[],
itemId
:
''
,
itemId
:
''
,
index
:
''
,
index
:
''
,
showOption
:
true
,
showOption
:
true
,
searchOpen
:
true
,
searchOpen
:
true
,
selectData
:
{},
getPage
:
{},
getPage
:
{},
currentRow
:
''
,
currentRow
:
''
,
currentIndex
:
''
,
currentIndex
:
''
,
...
@@ -142,7 +150,7 @@ export default {
...
@@ -142,7 +150,7 @@ export default {
{
title
:
'小类'
,
key
:
'smallType'
},
{
title
:
'小类'
,
key
:
'smallType'
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
}
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
,
status
:
true
}
],
],
subOptions
:
[
subOptions
:
[
{
{
...
@@ -381,7 +389,6 @@ export default {
...
@@ -381,7 +389,6 @@ export default {
this
.
_copy
(
data
)
this
.
_copy
(
data
)
break
break
case
'删除'
:
case
'删除'
:
console
.
log
(
index
)
this
.
_deleteById
(
data
.
id
)
this
.
_deleteById
(
data
.
id
)
break
break
case
'导出样品委托协议'
:
case
'导出样品委托协议'
:
...
@@ -425,9 +432,9 @@ export default {
...
@@ -425,9 +432,9 @@ export default {
this
.
selectIds
=
selectIds
this
.
selectIds
=
selectIds
this
.
selectData
=
data
this
.
selectData
=
data
break
break
//
case 'iconClick':
case
'iconClick'
:
//
this._iconClick(data.name, data.rowData, data.componentName)
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
//
break
break
case
'page'
:
case
'page'
:
this
.
_page
()
this
.
_page
()
break
break
...
@@ -480,7 +487,7 @@ export default {
...
@@ -480,7 +487,7 @@ export default {
},
},
_deleteOk
:
async
function
(
ids
)
{
_deleteOk
:
async
function
(
ids
)
{
const
result
=
await
soilEntrust
.
d
eleteById
(
ids
)
const
result
=
await
soilEntrust
.
experimentD
eleteById
(
ids
)
if
(
result
)
{
if
(
result
)
{
this
.
_resultChange
(
'删除成功! '
)
this
.
_resultChange
(
'删除成功! '
)
}
}
...
@@ -588,15 +595,7 @@ export default {
...
@@ -588,15 +595,7 @@ export default {
},
},
// 导入检测项目
// 导入检测项目
_importItem
()
{
_importItem
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$refs
.
itemImport
.
_open
(
this
.
sampleId
)
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
,
this
.
selectData
[
0
],
this
.
selectData
)
}
},
},
// 导入检测项目包
// 导入检测项目包
_importItemPackage
()
{
_importItemPackage
()
{
...
...
pages/soil-sample-manage/duplicate-manage/SampleduplicateIndex.vue
0 → 100644
View file @
a31a7b3e
<
template
>
<div>
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"_changeTabs"
>
<el-tab-pane
label=
"副样管理"
name=
"wait"
>
<SampleBackupsManage
ref=
"waitTabs"
></SampleBackupsManage>
</el-tab-pane>
<el-tab-pane
label=
"副样查询"
name=
"query"
>
<SampleBackupsQuery
ref=
"queryTabs"
></SampleBackupsQuery>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</
template
>
<
script
>
import
SampleBackupsManage
from
'./tab/SampleduplicateManage'
import
SampleBackupsQuery
from
'./tab/SampleduplicateQuery'
export
default
{
components
:
{
SampleBackupsManage
,
SampleBackupsQuery
},
data
()
{
return
{
activeName
:
'wait'
}
},
mounted
()
{
this
.
activeName
=
'wait'
this
.
$refs
.
waitTabs
.
_page
()
},
methods
:
{
_changeTabs
(
tab
,
event
)
{
if
(
tab
.
name
===
'wait'
)
{
this
.
$refs
.
waitTabs
.
_page
()
}
else
if
(
tab
.
name
===
'applyRecord'
)
{
// this.$refs.applyRecordTabs._page()
}
else
{
this
.
$refs
.
queryTabs
.
_page
()
}
}
}
}
</
script
>
pages/soil-sample-manage/duplicate-manage/SurplusduplicateApply.vue
0 → 100644
View file @
a31a7b3e
This diff is collapsed.
Click to expand it.
pages/soil-sample-manage/duplicate-manage/tab/SampleduplicateManage.vue
0 → 100644
View file @
a31a7b3e
This diff is collapsed.
Click to expand it.
pages/soil-sample-manage/duplicate-manage/tab/SampleduplicateQuery.vue
0 → 100644
View file @
a31a7b3e
<
template
>
<div>
<!--内容-->
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"search-form-query"
:label-width=
"80"
v-show=
"searchOpen"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"试样编号:"
>
<Input
@
on-enter=
"_formSearch"
v-model=
"formObj.sampleCode"
name=
"sampleCode"
placeholder=
"请输入委托名称"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
@
on-result-change=
"_btnClick"
:showSearchBtn=
"true"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETableHeight
ref=
"pageTable"
:table-height=
"tableHeight"
:loading=
"true"
:get-page=
"getPage"
@
on-result-change=
"_tableResultChange"
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<span
v-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<vxe-table-column
slot=
"col"
:width=
"80"
title=
"操作"
align=
"center"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<VXEIconList
:msg=
"editIndex===scope.rowIndex?iconMsgSave:iconMsg"
@
on-result-change=
"_iconClick"
:rowData=
"scope.row"
:rowIndex=
"scope.rowIndex"
></VXEIconList>
</
template
>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</div>
<Operation
ref=
"recordModal"
></Operation>
</div>
</template>
<
script
>
import
{
soilSample
}
from
'../../../../api'
import
Operation
from
'../../../../components/operation/Operation'
export
default
{
components
:
{
Operation
},
data
()
{
return
{
currentComponent
:
''
,
selectIds
:
[],
formObj
:
{
client
:
''
,
entrustCode
:
''
,
sampleCode
:
''
},
iconMsg
:
[
{
type
:
'ios-clock'
,
id
:
''
,
name
:
'操作日志'
}
],
btn
:
[
// { type: '', id: '', name: '导出' },
],
pageColumns
:
[
{
title
:
'试样编号'
,
key
:
'sampleCode'
,
width
:
150
},
{
title
:
'状态'
,
key
:
'status'
,
status
:
true
,
width
:
100
},
{
title
:
'包装类型'
,
key
:
'samplePack'
,
width
:
100
},
{
title
:
'保存容器'
,
key
:
'keepContainer'
,
width
:
100
},
{
title
:
'制备数量'
,
key
:
'quantity'
,
width
:
100
},
{
title
:
'单位'
,
key
:
'unit'
,
width
:
70
},
{
title
:
'制备人'
,
key
:
'preparer'
,
width
:
130
},
{
title
:
'制备时间'
,
key
:
'prepareDate'
,
date
:
true
,
width
:
130
}
],
searchOpen
:
false
,
getPage
:
{},
selectData
:
[],
endDateBegin
:
''
,
endDateEnd
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
''
,
255
)
}
else
{
return
this
.
$tableHeight
(
''
,
220
)
}
}
},
methods
:
{
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
console
.
log
(
'this.formObj'
,
this
.
formObj
)
const
result
=
await
soilSample
.
pageSurplusHis
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
selectIds
=
[]
this
.
getPage
=
this
.
$store
.
state
.
FoodSampleBackup
.
page
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
break
case
'selectData'
:
this
.
selectData
=
data
this
.
selectIds
=
[]
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
this
.
selectIds
.
push
(
data
[
i
].
id
)
}
break
case
'changeSize'
:
this
.
_page
()
break
// default :
// this._page();
}
},
_iconClick
(
res
,
data
,
componentName
,
index
)
{
this
.
currentIndex
=
index
switch
(
res
)
{
case
'操作日志'
:
this
.
_record
(
data
.
id
)
break
default
:
this
.
_page
()
}
},
_record
(
id
)
{
this
.
$refs
.
recordModal
.
_openSurplus
(
id
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_dateChange
(
data
)
{
this
.
endDateBegin
=
data
[
0
]
this
.
endDateEnd
=
data
[
1
]
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'导出'
:
if
(
this
.
getPage
.
records
.
length
===
0
)
{
this
.
$Message
.
warning
(
'暂无数据,不可导出'
)
}
else
{
this
.
_export
()
}
break
case
'导出样品贮存表'
:
this
.
_exportSampleStore
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
},
_exportSampleStore
()
{
const
obj
=
{
param
:
'ids'
,
ids
:
this
.
selectIds
,
url
:
''
,
queryObj
:
this
.
$serialize
(
'search-form-query'
)
}
this
.
$store
.
dispatch
(
'ReportExport/getById'
,
'food-sample-handle-already-export-sample-store'
)
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
ReportExport
.
model
obj
.
url
=
result
this
.
$exportByQuery
(
obj
)
})
},
// 样品详情
_sampleDetailModal
(
data
)
{
if
(
data
.
type
===
1
)
{
// 政府
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$nextTick
(()
=>
{
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$nextTick
(()
=>
{
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export
()
{
let
result
=
[]
if
(
this
.
selectData
.
length
===
0
)
{
// 导出全部数据
this
.
$store
.
dispatch
(
'FoodSampleBackup/perSampleQuery'
,
this
.
_searchParams
())
.
then
(()
=>
{
result
=
this
.
$store
.
state
.
FoodSampleBackup
.
page
.
records
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
this
.
selectData
.
length
===
0
?
'确定导出全部数据(最多导出5000条)?'
:
'确定导出这'
+
result
.
length
+
' 条数据?'
,
onOk
:
()
=>
{
this
.
$exportExcel
(
'perSampleQuery'
,
'样品处理'
,
this
.
pageColumns
,
result
)
}
})
})
}
else
{
// 只导出选中的数据
result
=
this
.
selectData
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
this
.
selectData
.
length
===
0
?
'确定导出全部数据(最多导出5000条)?'
:
'确定导出这'
+
result
.
length
+
' 条数据?'
,
onOk
:
()
=>
{
this
.
$exportExcel
(
'perSampleQuery'
,
'样品处理'
,
this
.
pageColumns
,
result
)
}
})
}
},
// 参数
_searchParams
()
{
const
data
=
this
.
$serialize
(
'search-form-query'
)
return
this
.
$extend
(
data
,
{
page
:
1
,
rows
:
5000
})
}
/** *********************************导出样品台账-end*********************************************/
}
}
</
script
>
pages/soil-sample-manage/sample-preparation/AptitudeItem.vue
0 → 100644
View file @
a31a7b3e
<!--资质项目列表-->
<
template
>
<div>
<div>
<Form
:label-width=
"65"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
label=
"检测项目:"
class=
"search-item"
>
<Input
v-model=
"formObj.name"
@
on-enter=
"_search"
placeholder=
"请输入检测项目"
clearable
/>
</Form-item>
<Form-item>
<Button
@
click=
"_search"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</div>
<PTVXETable
ref=
"pageTable"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
select-data
>
<vxe-table-column
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
v-for=
"item in pageColumns"
:key=
"item.key"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.judge"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</div>
<div
v-else-if=
"item.key==='testBasis'"
>
{{
(
scope
.
row
.
testBasis
?
scope
.
row
.
testBasis
:
' '
)
+
(
scope
.
row
.
testBasisName
?
scope
.
row
.
testBasisName
:
''
)
}}
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
</PTVXETable>
</div>
</template>
<
script
>
import
{
soilAptitude
}
from
'../../../api'
export
default
{
components
:
{},
data
()
{
return
{
getPage
:
{},
formObj
:
{
name
:
undefined
,
testBasis
:
undefined
,
aptitude
:
undefined
},
tableHeight
:
document
.
documentElement
.
clientHeight
-
285
,
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
100
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
260
},
// {title: '检测依据名称', key: 'testBasisName', width: 330},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
130
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
140
},
{
title
:
'资质'
,
key
:
'aptitude'
,
width
:
130
},
{
title
:
'检出限类别'
,
key
:
'detectionType'
,
width
:
130
},
{
title
:
'检出限'
,
key
:
'detectionLimit'
,
width
:
130
},
{
title
:
'单位'
,
key
:
'unit'
,
width
:
130
}
],
formId
:
''
,
itemList
:
[],
testBasisList
:
[]
}
},
methods
:
{
_open
()
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
_page
()
},
// 获取检测项目
_getItemList
(
data
)
{
const
obj
=
{}
if
(
data
)
{
obj
.
name
=
data
}
this
.
$store
.
dispatch
(
'FoodAptitudeItem/getTestItem'
,
obj
).
then
(()
=>
{
this
.
itemList
=
this
.
$store
.
state
.
FoodAptitudeItem
.
list
})
},
// 检测项目结果
_testItemChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'select'
:
this
.
formObj
.
name
=
data
this
.
_getItemList
()
break
case
'query'
:
this
.
formObj
.
name
=
data
this
.
_getItemList
(
data
)
break
case
'focus'
:
this
.
_getItemList
()
break
case
'enter'
:
this
.
_search
()
break
}
},
_getTestBasisList
(
data
)
{
const
obj
=
{
classify
:
1
,
page
:
1
,
rows
:
20
}
if
(
data
)
{
obj
.
name
=
data
.
stdNum
}
this
.
$store
.
dispatch
(
'StandardInfo/pageListByName'
,
obj
).
then
(()
=>
{
this
.
testBasisList
=
this
.
$store
.
state
.
StandardInfo
.
page
.
records
})
},
_testBasisChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'select'
:
this
.
formObj
.
testBasis
=
data
.
stdNum
this
.
_getTestBasisList
()
break
case
'query'
:
this
.
formObj
.
testBasis
=
data
.
stdNum
this
.
_getTestBasisList
(
data
)
break
case
'focus'
:
this
.
_getTestBasisList
()
break
case
'enter'
:
this
.
_search
()
break
}
},
_page
:
async
function
()
{
const
result
=
await
soilAptitude
.
page
(
this
.
$serializeForm
(
this
.
formObj
))
if
(
result
)
{
console
.
log
(
result
)
this
.
getPage
=
result
this
.
$refs
.
pageTable
.
_hideLoading
()
}
},
_clearSelection
()
{
this
.
$refs
.
pageTable
.
_clearSelection
()
},
_search
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_reset
()
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
},
_tableResultChange
(
msg
,
data
,
checked
)
{
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
break
case
'selectAll'
:
this
.
$emit
(
'on-result-change'
,
'selectAll'
,
data
)
break
case
'selectData'
:
this
.
$emit
(
'on-result-change'
,
'selectData'
,
data
)
break
case
'dbSelect'
:
this
.
$emit
(
'on-result-change'
,
'dbClick'
,
data
)
break
case
'changeSize'
:
this
.
_page
()
break
}
}
}
}
</
script
>
pages/soil-sample-manage/sample-preparation/ImportItem.vue
0 → 100644
View file @
a31a7b3e
<!--Collapse关联框 单个导入项目-->
<
template
>
<div>
<Modal
v-model=
"showModal"
:mask-closable=
"false"
width=
"100"
class=
"zIndex-1200 full-screen modal-header-none"
>
<div>
<Collapse
:right-title=
"'已选的检测项目 (共'+getPage.records.length+'条)'"
@
on-result-change=
"_optionResult"
:left-width=
"18"
left-title=
"资质项目"
>
<template
#
left
>
<AptitudeItem
ref=
"leftModal"
@
on-result-change=
"_leftResult"
></AptitudeItem>
</
template
>
<
template
#
right
>
<PTVXETable
ref=
"pageTable"
:tableHeight=
"tableHeight"
:getPage=
"getPage"
@
on-result-change=
"_rightResult"
select-data
hide-page
>
<vxe-table-column
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
v-for=
"item in pageColumns"
:key=
"item.key"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key==='scened'"
>
{{
scope
.
row
[
item
.
key
]?
''
:
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</div>
<div
v-else-if=
"item.key==='testBasis'"
>
{{
(
scope
.
row
.
testBasis
?
scope
.
row
.
testBasis
:
' '
)
+
(
scope
.
row
.
testBasisName
?
scope
.
row
.
testBasisName
:
''
)
}}
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
</PTVXETable>
</template>
</Collapse>
</div>
<div
slot=
"footer"
>
<modal-footer
ref=
"footerModal"
@
on-result-change=
"_footerResult"
:footer=
"footerList"
></modal-footer>
</div>
</Modal>
</div>
</template>
<
script
>
import
Collapse
from
'../../../components/base/Collapse'
import
{
soilSample
}
from
'../../../api'
import
AptitudeItem
from
'./AptitudeItem'
/* 普通样品导入检测项目(一种是直接走接口保存,另一种是返回已选中的数据),专用于除了【质控】之外的导入检测项目 */
export
default
{
components
:
{
Collapse
,
// AddItem,
AptitudeItem
},
props
:
{
isRepeat
:
null
// 只有模拟样品才能导入重复的检测项目
},
data
()
{
return
{
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
100
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
260
},
// {title: '检测依据名称', key: 'testBasisName', width: 180,},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
130
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
140
}
],
footerList
:
[
{
name
:
'取消'
,
type
:
''
},
{
name
:
'确定'
,
type
:
'primary'
}
],
selectData
:
[],
showModal
:
false
,
addIds
:
[],
sampleId
:
''
,
delData
:
[],
getPage
:
{
records
:
[]
},
isEditModal
:
false
,
isReceive
:
false
,
// 用于区别是样品接收中导入检测项目还是普通样品中导入检测项目
tableHeight
:
document
.
documentElement
.
clientHeight
-
240
}
},
methods
:
{
_open
(
sampleId
)
{
this
.
showModal
=
true
this
.
isReceive
=
false
this
.
sampleId
=
sampleId
this
.
selectData
=
[]
this
.
addIds
=
[]
this
.
delData
=
[]
this
.
getPage
.
records
=
[]
this
.
$refs
.
leftModal
.
_open
()
},
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'确定'
:
this
.
_ok
()
break
}
},
_ok
:
async
function
()
{
const
result
=
await
soilSample
.
importExperiments
({
aptitudeIds
:
this
.
addIds
,
ids
:
this
.
sampleId
})
if
(
result
)
{
this
.
showModal
=
false
this
.
$Message
.
success
(
'导入成功'
)
this
.
$emit
(
'on-result-change'
)
}
},
_cancel
()
{
this
.
showModal
=
false
this
.
$refs
.
footerModal
.
_hideLoading
()
},
// 样品接收中用的导入检测项目(给一个样品导入检测项目)
_openReceive
()
{
this
.
isReceive
=
true
this
.
selectData
=
[]
this
.
addIds
=
[]
this
.
delData
=
[]
// this.getPage = [];
this
.
getPage
.
records
=
[]
this
.
$refs
.
leftModal
.
_open
()
},
_optionResult
(
name
)
{
switch
(
name
)
{
case
'添加'
:
this
.
_add
()
break
case
'删除'
:
this
.
_deleteSelected
()
break
}
},
// 未关联方法返回的数据
_leftResult
(
msg
,
data
,
checked
)
{
switch
(
msg
)
{
case
'selectAll'
:
this
.
selectData
=
data
break
case
'selectData'
:
this
.
selectData
=
data
// if (data.checked) {
// this.selectData.push(data)
// const set = new Set([...this.selectData])
// this.selectData = [...set]
// console.log('选择的数据', this.selectData)
// } else {
// const index = this.selectData.indexOf(data)
// this.selectData.splice(index, 1)
// }
break
case
'dbClick'
:
this
.
selectData
=
[
data
]
this
.
_add
()
break
case
'search'
:
this
.
selectData
=
[]
break
}
},
// 已关联方法返回的数据
_rightResult
(
msg
,
data
)
{
switch
(
msg
)
{
case
'selectData'
:
this
.
delData
=
data
break
}
},
// 添加关联方法
_add
()
{
if
(
this
.
selectData
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
for
(
let
i
=
0
;
i
<
this
.
selectData
.
length
;
i
++
)
{
if
(
this
.
isRepeat
)
{
// 表示模拟样品,可导入重复的项目
this
.
getPage
.
records
.
push
(
this
.
selectData
[
i
])
this
.
addIds
.
push
(
this
.
selectData
[
i
].
id
)
}
else
{
// 普通样品,不能导入重复的项目
// eslint-disable-next-line no-lonely-if
if
(
!
this
.
getPage
.
records
.
find
(
item
=>
item
.
name
===
this
.
selectData
[
i
].
name
)
)
{
this
.
getPage
.
records
.
push
(
this
.
selectData
[
i
])
this
.
addIds
.
push
(
this
.
selectData
[
i
].
id
)
}
}
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this
.
$refs
.
leftModal
.
_clearSelection
()
this
.
$refs
.
pageTable
.
_clearSelection
()
this
.
selectData
=
[]
}
},
_deleteSelected
()
{
if
(
this
.
delData
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
this
.
delData
,
'确定删除 '
+
this
.
delData
.
length
+
' 条记录?'
)
}
},
_deleteByIds
(
row
,
content
)
{
for
(
let
i
=
0
;
i
<
row
.
length
;
i
++
)
{
const
dataIndex
=
this
.
getPage
.
records
.
indexOf
(
row
[
i
])
this
.
getPage
.
records
.
splice
(
dataIndex
,
1
)
const
idIndex
=
this
.
addIds
.
indexOf
(
row
[
i
].
id
)
this
.
addIds
.
splice
(
idIndex
,
1
)
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this
.
$refs
.
leftModal
.
_clearSelection
()
this
.
$refs
.
pageTable
.
_clearSelection
()
// 手动清空删除的数据
this
.
delData
=
[]
}
}
}
</
script
>
pages/soil-sample-manage/sample-preparation/SampleParpareBatchEdit.vue
View file @
a31a7b3e
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
</Form-item>
</Form-item>
<Form-item
label=
"制备人:"
>
<Form-item
label=
"制备人:"
>
<el-select
:value=
"formObj.preparer"
@
change=
"selUser"
style=
"width:100%"
size=
"small"
>
<el-select
:value=
"formObj.preparer"
@
change=
"selUser"
style=
"width:100%"
size=
"small"
>
<el-option
v-for=
"
item in backupUserList"
:value=
"item.id"
:label=
"item.realname"
:key=
"item.realname
"
>
{{
item
.
realname
}}
<el-option
v-for=
"
(item,index) in backupUserList"
:value=
"item.id"
:label=
"item.realname"
:key=
"index
"
>
{{
item
.
realname
}}
</el-option>
</el-option>
</el-select>
</el-select>
</Form-item>
</Form-item>
...
...
router/soil-routes.js
View file @
a31a7b3e
...
@@ -13,6 +13,7 @@ import AddressManage from '../pages/soil-sample-manage/sample-address/AddressMan
...
@@ -13,6 +13,7 @@ import AddressManage from '../pages/soil-sample-manage/sample-address/AddressMan
import
BackupsManage
from
'../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import
BackupsManage
from
'../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import
SampleTakeIndex
from
'../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import
SampleTakeIndex
from
'../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import
SurplusManage
from
'../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
import
SurplusManage
from
'../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
import
DuplicateManage
from
'../pages/soil-sample-manage/duplicate-manage/SampleduplicateIndex'
import
TestTaskIndex
from
'../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import
TestTaskIndex
from
'../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import
TestInputIndex
from
'../pages/soil-test-manage/test-input/TestInputIndex'
import
TestInputIndex
from
'../pages/soil-test-manage/test-input/TestInputIndex'
import
CheckIndex
from
'../pages/soil-test-manage/test-data-check/CheckIndex'
import
CheckIndex
from
'../pages/soil-test-manage/test-data-check/CheckIndex'
...
@@ -83,6 +84,11 @@ export default [
...
@@ -83,6 +84,11 @@ export default [
meta
:
{
title
:
'余样管理'
}
meta
:
{
title
:
'余样管理'
}
},
},
{
{
path
:
'copy'
,
component
:
DuplicateManage
,
meta
:
{
title
:
'副样管理'
}
},
{
path
:
'dispose'
,
path
:
'dispose'
,
component
:
SampleDisposeIndex
,
component
:
SampleDisposeIndex
,
meta
:
{
title
:
'样品处理'
}
meta
:
{
title
:
'样品处理'
}
...
...
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