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
e1f58483
Commit
e1f58483
authored
Sep 23, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了试样检测页面
parent
b7ea0817
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
3396 additions
and
73 deletions
+3396
-73
soil-test.js
api/soil/soil-test.js
+9
-1
InputSampleManage.vue
pages/soil-test-manage/test-input/InputSampleManage.vue
+82
-0
SampleManage.vue
pages/soil-test-manage/test-input/SampleManage.vue
+93
-0
TestInput.vue
pages/soil-test-manage/test-input/TestInput.vue
+5
-2
ItemLeftList.vue
pages/soil-test-manage/test-input/item-tab/ItemLeftList.vue
+212
-0
ItemRightList.vue
pages/soil-test-manage/test-input/item-tab/ItemRightList.vue
+536
-0
ItemTabs.vue
pages/soil-test-manage/test-input/item-tab/ItemTabs.vue
+54
-0
ItemLeftList.vue
pages/soil-test-manage/test-input/item-tabs/ItemLeftList.vue
+152
-0
ItemRightList.vue
...s/soil-test-manage/test-input/item-tabs/ItemRightList.vue
+560
-0
ItemTabs.vue
pages/soil-test-manage/test-input/item-tabs/ItemTabs.vue
+45
-0
SampleLeftList.vue
...soil-test-manage/test-input/sample-tab/SampleLeftList.vue
+214
-0
SampleRightList.vue
...oil-test-manage/test-input/sample-tab/SampleRightList.vue
+536
-0
SampleTabs.vue
pages/soil-test-manage/test-input/sample-tab/SampleTabs.vue
+61
-0
SampleLeftList.vue
...oil-test-manage/test-input/sample-tabs/SampleLeftList.vue
+161
-0
SampleRightList.vue
...il-test-manage/test-input/sample-tabs/SampleRightList.vue
+536
-0
SampleTabs.vue
pages/soil-test-manage/test-input/sample-tabs/SampleTabs.vue
+41
-0
SampleManage.vue
...e/test-task-manage/entrust-sample-manage/SampleManage.vue
+2
-2
ItemLeftList.vue
...k-manage/entrust-sample-manage/item-tabs/ItemLeftList.vue
+7
-5
ItemRightList.vue
...-manage/entrust-sample-manage/item-tabs/ItemRightList.vue
+82
-59
ItemTabs.vue
...-task-manage/entrust-sample-manage/item-tabs/ItemTabs.vue
+8
-4
No files found.
api/soil/soil-test.js
View file @
e1f58483
...
...
@@ -23,5 +23,13 @@ export default {
samplePage
:
data
=>
http
.
post
(
'soil/v1/sample/page'
,
data
).
then
(
res
=>
res
),
pageExpTestSample
:
data
=>
http
.
post
(
'soil/v1/sample/page_exp_test_sample'
,
data
).
then
(
res
=>
res
),
pageItem
:
data
=>
http
.
post
(
'soil/v1/experiment/page'
,
data
).
then
(
res
=>
res
)
pageItem
:
data
=>
http
.
post
(
'soil/v1/experiment/page'
,
data
).
then
(
res
=>
res
),
pageAllotByExp
:
data
=>
http
.
post
(
'soil/v1/experiment/page_allot_by_exp'
,
data
).
then
(
res
=>
res
),
pageExperimentAllot
:
data
=>
http
.
post
(
'soil/v1/experiment/page_exp_allot'
,
data
).
then
(
res
=>
res
),
pageTestByExp
:
data
=>
http
.
post
(
'soil/v1/experiment/page_test_by_exp'
,
data
).
then
(
res
=>
res
),
pageExperimentTest
:
data
=>
http
.
post
(
'soil/v1/experiment/page_exp_test'
,
data
).
then
(
res
=>
res
)
}
pages/soil-test-manage/test-input/InputSampleManage.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Modal
v-model=
"showModal"
@
on-visible-change=
"_visibleChange"
width=
"1000"
>
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"_changeTabs"
>
<el-tab-pane
v-if=
"sampleShow"
label=
"按样品录入"
name=
"sample"
/>
<el-tab-pane
v-if=
"itemShow"
label=
"按项目录入"
name=
"item"
/>
</el-tabs>
<!--组件加载,缓存-->
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component
ref=
"refModal"
:id=
"id"
:is=
"currentComponent"
></component>
</keep-alive>
</div>
</div>
</Modal>
</div>
</
template
>
<
script
>
import
ItemTabs
from
'./item-tabs/ItemTabs'
import
SampleTabs
from
'./sample-tabs/SampleTabs'
/**
* 任务分配
*/
export
default
{
components
:
{
// eslint-disable-next-line vue/no-unused-components
ItemTabs
,
// eslint-disable-next-line vue/no-unused-components
SampleTabs
},
data
()
{
return
{
activeName
:
''
,
currentComponent
:
''
,
showModal
:
false
,
id
:
''
,
sampleShow
:
true
,
itemShow
:
true
}
},
mounted
()
{
// 初始化tab,按钮权限
this
.
_initTab
()
},
methods
:
{
_open
(
id
)
{
this
.
showModal
=
true
this
.
id
=
id
this
.
activeName
=
'sample'
},
_initTab
()
{
if
(
this
.
sampleShow
)
{
// eslint-disable-next-line no-unused-expressions
this
.
activeName
===
'sample'
this
.
currentComponent
=
'SampleTabs'
}
else
if
(
this
.
itemShow
)
{
// eslint-disable-next-line no-unused-expressions
this
.
activeName
===
'item'
this
.
currentComponent
=
'ItemTabs'
}
},
_changeTabs
(
tab
,
event
)
{
if
(
tab
.
name
===
'item'
)
{
this
.
currentComponent
=
'ItemTabs'
}
else
if
(
tab
.
name
===
'sample'
)
{
this
.
currentComponent
=
'SampleTabs'
}
},
_search
()
{
this
.
$emit
(
'on-result-change'
)
},
_visibleChange
(
data
)
{
if
(
data
===
false
)
{
this
.
_search
()
}
}
}
}
</
script
>
pages/soil-test-manage/test-input/SampleManage.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Modal
v-model=
"showSampleModal"
@
on-visible-change=
"_visibleChange"
width=
"1200"
class=
"zIndex-900 modal-footer-none"
>
<p
slot=
"header"
>
{{
name
}}
--管理样品
</p>
<div>
<el-tabs
v-model=
"activeName"
@
tab-click=
"_changeTabs"
>
<el-tab-pane
label=
"按项目录入"
name=
"waitReceive"
>
<WaitReceive
ref=
"waitReceiveModal"
></WaitReceive>
</el-tab-pane>
<el-tab-pane
label=
"按样品录入"
name=
"waitScan"
>
<WaitScan
ref=
"waitScanModal"
></WaitScan>
</el-tab-pane>
</el-tabs>
<!--
<keep-alive>
-->
<!-- <!– eslint-disable-next-line vue/require-component-is –>-->
<!--
<component
ref=
"refModal"
:is=
"currentComponent"
></component>
-->
<!--
</keep-alive>
-->
</div>
</Modal>
</div>
</
template
>
<
script
>
import
WaitReceive
from
'./item-tabs/ItemTabs'
import
WaitScan
from
'./sample-tabs/SampleTabs'
export
default
{
components
:
{
WaitReceive
,
WaitScan
},
data
()
{
return
{
type
:
''
,
contractId
:
''
,
// 合同id
entrustId
:
''
,
showSampleModal
:
false
,
modalTitle
:
''
,
selectIds
:
[],
activeName
:
'waitReceive'
,
name
:
''
,
currentComponent
:
''
}
},
mounted
()
{
// this.currentComponent = 'waitScan'
},
methods
:
{
_open
(
contractId
,
type
,
name
)
{
this
.
type
=
type
// 类型(采样或送样)
this
.
name
=
name
this
.
showSampleModal
=
true
this
.
entrustId
=
contractId
// 合同id
this
.
activeName
=
'waitReceive'
// this.currentComponent = 'waitScan'
this
.
selectIds
=
[]
this
.
_waitPage
()
},
// 待接收
_waitPage
()
{
this
.
$refs
.
waitReceiveModal
.
_open
(
this
.
entrustId
)
},
// 待发放
_waitSend
()
{
this
.
$refs
.
waitScanModal
.
_open
(
this
.
entrustId
)
},
// 已接收
_issuedPage
()
{
this
.
$refs
.
alreadyIssuedModal
.
_open
(
this
.
contractId
,
this
.
type
)
},
_changeTabs
(
tab
,
event
)
{
if
(
tab
.
name
===
'alreadyIssued'
)
{
// this._issuedPage()
}
else
if
(
tab
.
name
===
'waitReceive'
)
{
// this._waitPage()
this
.
$refs
.
waitReceiveModal
.
_open
(
this
.
entrustId
)
}
else
if
(
tab
.
name
===
'waitScan'
)
{
this
.
$refs
.
waitScanModal
.
_open
(
this
.
entrustId
)
// this._waitSend()
}
},
_search
()
{
this
.
$emit
(
'on-result-change'
)
},
// 关闭弹框的时候刷新上个界面
_visibleChange
(
data
)
{
if
(
data
===
false
)
{
this
.
_search
()
}
}
}
}
</
script
>
pages/soil-test-manage/test-input/TestInput.vue
View file @
e1f58483
...
...
@@ -63,7 +63,7 @@
<!--选择领样人-->
<UserInfo
ref=
"userModal"
@
on-result-change=
"_userResult"
></UserInfo>
<Operation
ref=
"operation"
></Operation>
<
dataEntry
ref=
"sampleManageModal"
@
on-result-change=
"_page"
></dataEntry
>
<
SampleManage
ref=
"sampleManageModal"
@
on-result-change=
"_page"
></SampleManage
>
</div>
</template>
<
script
>
...
...
@@ -71,11 +71,14 @@ import UserInfo from '../../../components/user-info-single/AssignPerson'
import
{
soilTest
}
from
'../../../api'
import
Operation
from
'../../../components/operation/Operation'
import
dataEntry
from
'./dataEntry'
import
SampleManage
from
'./SampleManage'
export
default
{
components
:
{
UserInfo
,
Operation
,
dataEntry
// eslint-disable-next-line vue/no-unused-components
dataEntry
,
SampleManage
},
data
()
{
return
{
...
...
pages/soil-test-manage/test-input/item-tab/ItemLeftList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-left"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:table-name=
"tableName"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
select-data
:getPage=
"getPage"
:rows=
"100"
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<a
v-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component
ref=
"refModal"
:is=
"currentComponent"
@
on-result-change=
"_modalResult"
></component>
</keep-alive>
</div>
</template>
<
script
>
import
{
soilTest
}
from
'../../../../api'
export
default
{
props
:
{
id
:
null
},
components
:
{},
data
()
{
return
{
currentComponent
:
''
,
tableName
:
'food-task-assign-sample-left'
,
// 用户自己选中的列
userColumns
:
[],
switchStatusData
:
this
.
id
,
formObj
:
{
entrustId
:
''
},
optionList
:
[
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'cname'
,
name
:
'委托单位'
,
placeholder
:
'请输入委托单位'
},
{
key
:
'testedName'
,
name
:
'受检单位'
,
placeholder
:
'请输入受检单位'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'name'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
}
],
btn
:
[{
id
:
'food-task-assign-auto'
,
name
:
'自动分配'
}],
getPage
:
{},
pageColumns
:
[{
title
:
'检测项目'
,
key
:
'name'
,
width
:
180
}],
resultDateBegin
:
''
,
resultDateEnd
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
}
},
mounted
()
{
this
.
_page
()
},
methods
:
{
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
_modalResult
()
{
if
(
this
.
currentComponent
===
'AutoAssignModal'
)
{
this
.
_formSearch
()
}
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'search'
:
this
.
_formSearch
()
break
}
},
_open
(
id
)
{
this
.
_page
(
id
)
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
Object
.
assign
(
obj
,
obj1
)
return
obj
},
_page
:
async
function
()
{
console
.
log
(
'项目'
)
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
switchStatusData
const
result
=
await
soilTest
.
pageTestByExp
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
FoodSample
.
page
break
case
'selectIds'
:
console
.
log
(
data
)
this
.
$emit
(
'on-result-change'
,
data
)
break
case
'selectData'
:
console
.
log
(
data
)
this
.
$emit
(
'on-result-change'
,
data
)
break
case
'changeSize'
:
this
.
_page
()
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
}
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'自动分配'
:
this
.
_autoAssign
()
break
}
},
_autoAssign
()
{
this
.
currentComponent
=
'AutoAssignModal'
this
.
$store
.
dispatch
(
'FoodItem/autoAllotNum'
).
then
(()
=>
{
const
num
=
this
.
$store
.
state
.
FoodItem
.
count
if
(
num
!==
undefined
)
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
num
)
})
}
})
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
id
).
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
id
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/item-tab/ItemRightList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-right"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"委托编号:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:table-name=
"tableName"
:rows=
"100"
is-task
select-data
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key === 'name'"
:style=
"
{color:colorComputed(scope.row.planEndDate)}">
{{
scope
.
row
[
item
.
key
]
}}
</div>
<a
v-else-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.key==='status'"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</span>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else-if=
"item.datetime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_assignBackData"
></AssignPerson>
</div>
</template>
<
script
>
import
Global
from
'../../../../api/config'
import
{
soilTest
}
from
'../../../../api'
import
AssignPerson
from
'../../../../components/user-info-single/AssignPerson'
export
default
{
components
:
{
AssignPerson
},
data
()
{
return
{
// 定义表格名称----英文
tableName
:
'food-task-assign-item-right'
,
formObj
:
{},
// 用户自己选中的列
userColumns
:
[],
currentComponent
:
''
,
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'sampleName'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
},
{
key
:
'receiveDate'
,
name
:
'接样日期'
,
placeholder
:
'请选择接样日期'
,
date
:
true
},
{
key
:
'tester'
,
name
:
'主检人'
,
placeholder
:
'请输入主检人'
},
{
key
:
'detectType'
,
name
:
'样品类别'
,
placeholder
:
'请输入样品类别'
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'试验项目分配'
},
{
type
:
''
,
id
:
'food-task-assign-adjust-group'
,
name
:
'调整分组'
},
{
type
:
''
,
id
:
'food-task-assign-plan-date'
,
name
:
'设置计划完成时间'
},
{
type
:
''
,
id
:
'food-task-assign-maintain-info'
,
name
:
'信息维护'
}
],
getPage
:
{},
pageColumns
:
[
{
title
:
'试验名称'
,
key
:
'name'
,
width
:
160
},
{
title
:
'试验项目英文简写'
,
key
:
'shortName'
,
width
:
140
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
,
width
:
140
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
}
],
leftSelectData
:
[],
sampleIds
:
[],
selectIds
:
[],
// 检测项目id
selectData
:
[],
// 检测项目data
selectSampleIds
:
[],
// 样品ids
result
:
[],
sampleNames
:
''
,
// 没有计划完成时间的样品名
defaultPlanDate
:
null
,
// 是否有字典
warningValue
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
},
colorComputed
()
{
return
function
(
val
)
{
return
val
-
new
Date
().
getTime
()
>
this
.
warningValue
*
86400000
?
'#606266'
:
val
-
new
Date
().
getTime
()
<=
0
?
'#eb6877'
:
'#f90'
}
}
},
mounted
()
{
// this._dicSearch()
},
methods
:
{
// 获取column
_getColumn
()
{
this
.
$refs
.
pageTable
.
_getColByTableName
()
},
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
// 从字典查预警期
_dicSearch
()
{
const
data
=
[
'食品检测预警天数'
,
'食品默认计划完成时间'
]
this
.
$store
.
dispatch
(
'LmsBaseDict/listDict'
,
data
).
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
LmsBaseDict
.
list
// eslint-disable-next-line camelcase
const
result_1
=
result
[
0
]
// eslint-disable-next-line camelcase
const
result_2
=
result
[
1
]
// 1食品检测预警天数
if
(
result_1
.
length
!==
0
)
{
this
.
warningValue
=
result_1
[
0
].
name
}
// 2食品默认计划完成时间
this
.
defaultPlanDate
=
result_2
.
length
!==
0
?
result_2
[
0
].
name
===
'是'
?
(
this
.
defaultPlanDate
=
true
)
:
(
this
.
defaultPlanDate
=
false
)
:
(
this
.
defaultPlanDate
=
false
)
})
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput2
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_selInputResult2
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput1
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_modalResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'AssignPerson'
:
if
(
this
.
defaultPlanDate
)
{
this
.
_trueDefault
(
data
)
}
else
{
this
.
_userResult
(
data
)
}
break
case
'EndDateModal'
:
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this
.
_page
()
// }
break
case
'UserGroup'
:
this
.
_userGroupResult
(
data
)
break
default
:
this
.
_page
()
}
},
// 为 true时,有字典按人分配
_trueDefault
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/personAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
sampleNames
=
''
this
.
_page
()
this
.
_resultChange
(
'分配成功!'
)
}
})
},
// 设置时间
_endDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
currentComponent
=
'AssignPerson'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
})
}
},
// 调整分组
_userGroupResult
(
data
)
{
const
tempData
=
{
groupId
:
data
.
id
,
groupName
:
data
.
name
,
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$store
.
dispatch
(
'FoodItem/adjustTestGroup'
,
tempData
).
then
(()
=>
{
this
.
_resultChange
(
'调整成功'
)
})
},
_resultChange
(
msg
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
this
.
$emit
(
'on-result-change'
)
this
.
selectIds
=
[]
},
async
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'试验项目分配'
:
this
.
_userAssign
()
break
case
'按组分配'
:
await
this
.
_reportDueDate
()
await
this
.
_groupAssign
()
break
case
'调整分组'
:
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择=一条数据'
)
}
else
{
this
.
currentComponent
=
'UserGroup'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
()
})
}
break
case
'设置计划完成时间'
:
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
_changeDate
()
})
break
case
'信息维护'
:
this
.
_maintainInfo
()
break
}
},
// 信息维护
_maintainInfo
()
{
if
(
this
.
selectSampleIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
currentComponent
=
'MaintainInfoModal'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectSampleIds
,
2
)
})
}
},
_changeDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$refs
.
refModal
.
_open
(
tempData
,
'planDate'
)
}
},
_open
(
data
)
{
this
.
getPage
.
records
=
[]
this
.
sampleIds
=
data
if
(
data
.
length
===
0
)
{
this
.
$set
(
this
.
getPage
,
'records'
,
[])
this
.
$set
(
this
.
getPage
,
'total'
,
0
)
this
.
$set
(
this
.
getPage
,
'current'
,
1
)
this
.
selectSampleIds
=
[]
this
.
selectIds
=
[]
this
.
selectData
=
[]
this
.
result
=
[]
}
else
{
this
.
_page
()
}
},
_refresh
()
{
this
.
$emit
(
'on-result-change'
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
const
obj2
=
this
.
$refs
.
selInput2
.
_getFormObj
()
const
obj3
=
{
foodItemList
:
this
.
leftSelectData
}
Object
.
assign
(
obj
,
obj1
,
obj2
,
obj3
)
return
obj
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
sampleIds
=
this
.
sampleIds
const
result
=
await
soilTest
.
pageAllot
(
this
.
$serializeForm
(
this
.
formObj
))
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
$refs
.
pageTable
.
_checkAll
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
case
'changeSize'
:
this
.
_page
()
// this.$refs.pageTable._checkAll()
break
}
},
// 按人分配 选人选时间
_userAssign
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
console
.
log
(
user
)
this
.
$refs
.
personModal
.
_openGoup
(
'分配人员'
,
'itemTree'
)
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate
()
{
const
sampleNames
=
[]
for
(
let
i
=
0
;
i
<
this
.
result
.
length
;
i
++
)
{
if
(
!
this
.
result
[
i
].
planEndDate
)
{
sampleNames
.
push
(
this
.
result
[
i
].
name
)
}
}
this
.
sampleNames
=
[...
new
Set
(
sampleNames
)].
join
(
','
)
return
this
.
sampleNames
},
_userResult
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'user'
)
})
},
// 按组分配 选时间
_groupAssign
()
{
if
(
this
.
defaultPlanDate
)
{
// 有字典
if
(
this
.
sampleNames
===
''
)
{
// 有计划完成时间
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/groupAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
$Message
.
success
(
'分配成功!'
)
this
.
_page
()
}
})
}
else
{
// 有字典,无计划完成时间
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'所选项目中含有未设置计划完成时间的'
+
`
${
this
.
_reportDueDate
()}
`
+
'请确认!'
,
onOk
:
()
=>
{}
})
}
}
else
{
// 无字典的
// eslint-disable-next-line no-lonely-if
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'group'
)
})
}
}
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
_assignBackData
(
data
)
{
console
.
log
(
data
)
const
tempData
=
{}
tempData
.
ids
=
this
.
selectIds
.
join
(
','
)
tempData
.
user
=
data
.
realname
tempData
.
userId
=
data
.
userId
this
.
_allotItems
(
tempData
)
},
_allotItems
:
async
function
(
data
)
{
const
result
=
await
soilTest
.
allotExp
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'分配成功'
)
}
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
this
.
$refs
.
refModal
.
_open
(
data
.
sampleId
)
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/item-tab/ItemTabs.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<TwoColumnPage>
<template
#
left
>
<ItemLeftList
ref=
"itemleftModal"
:id=
"id"
@
on-result-change=
"_leftResult"
></ItemLeftList>
</
template
>
<
template
#
right
>
<!--
<NoData
v-if=
"!currentComponent"
msg=
"请选中左侧数据后,查看此界面信息"
/>
-->
<!-- eslint-disable-next-line vue/require-component-is -->
<component
ref=
"refModal"
:is=
"currentComponent"
@
on-result-change=
"_rightResult"
></component>
</
template
>
</TwoColumnPage>
</div>
</template>
<
script
>
// import NoData from '@/components/base/NoData'
import
TwoColumnPage
from
'../../../../components/base/TwoColumnPage'
import
ItemLeftList
from
'./ItemLeftList'
import
ItemRightList
from
'./ItemRightList'
export
default
{
components
:
{
ItemLeftList
,
TwoColumnPage
,
// eslint-disable-next-line vue/no-unused-components
ItemRightList
// NoData
},
props
:
{
id
:
null
},
data
()
{
return
{
currentComponent
:
'ItemRightList'
,
switchStatusData
:
this
.
id
}
},
computed
:
{
switchStatus
:
function
()
{
return
this
.
status
// 直接监听props里的status状态
}
},
methods
:
{
_leftResult
(
data
)
{
this
.
currentComponent
=
'ItemRightList'
this
.
$refs
.
refModal
.
_open
(
data
.
join
(
','
))
},
_rightResult
()
{
this
.
$refs
.
itemleftModal
.
_page
()
}
}
}
</
script
>
pages/soil-test-manage/test-input/item-tabs/ItemLeftList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-item-left"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"检测项目:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
@
on-result-change=
"_btnClick"
class=
"contHide"
style=
"margin-bottom: 6px;"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:table-name=
"tableName"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:rows=
"100"
select-data
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<a
v-if=
"item.detail"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<
script
>
import
{
soilTest
}
from
'../../../../api'
export
default
{
components
:
{},
data
()
{
return
{
currentComponent
:
''
,
formObj
:
{},
tableName
:
'food-task-assign-item-left'
,
// 用户自己选中的列
userColumns
:
[],
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
}
],
getPage
:
{},
id
:
''
,
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
120
},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
140
},
{
title
:
'检测依据名称'
,
key
:
'testBasisName'
,
width
:
200
}
]
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
}
},
methods
:
{
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
_modalResult
()
{
if
(
this
.
currentComponent
===
'AutoAssignModal'
)
{
this
.
_formSearch
()
}
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'search'
:
this
.
_formSearch
()
break
}
},
_open
(
id
)
{
this
.
id
=
id
this
.
_page
()
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
Object
.
assign
(
obj
,
obj1
)
return
obj
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
id
const
result
=
await
soilTest
.
pageTestByExp
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
FoodItem
.
page
break
case
'selectData'
:
this
.
$emit
(
'on-result-change'
,
data
)
break
case
'changeSize'
:
this
.
_page
()
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'自动分配'
:
this
.
_autoAssign
()
break
}
},
_autoAssign
()
{
console
.
log
(
'自动分配'
)
// this.$refs.autoAssignModal._open()
// this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
// const num = this.$store.state.FoodItem.count
// if (num !== undefined) {
// this.$refs.refModal._open(num)
// }
// })
}
}
}
</
script
>
pages/soil-test-manage/test-input/item-tabs/ItemRightList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-item-right"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"检测项目:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:table-name=
"tableName"
:rows=
"100"
is-task
select-data
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key === 'name'"
:style=
"
{color:colorComputed(scope.row.planEndDate)}">
{{
scope
.
row
[
item
.
key
]
}}
</div>
<a
v-else-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else-if=
"item.datetime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_assignBackData"
></AssignPerson>
</div>
</template>
<
script
>
import
Global
from
'../../../../api/config'
import
{
soilTest
}
from
'../../../../api'
import
AssignPerson
from
'../../../../components/user-info-single/AssignPerson'
export
default
{
components
:
{
AssignPerson
},
data
()
{
return
{
// 定义表格名称----英文
tableName
:
'food-task-assign-item-right'
,
formObj
:
{
entrustId
:
''
,
name
:
''
,
testMethod
:
''
,
testBasis
:
''
},
entrustId
:
''
,
// 用户自己选中的列
userColumns
:
[],
currentComponent
:
''
,
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'sampleName'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
},
{
key
:
'receiveDate'
,
name
:
'接样日期'
,
placeholder
:
'请选择接样日期'
,
date
:
true
},
{
key
:
'tester'
,
name
:
'主检人'
,
placeholder
:
'请输入主检人'
},
{
key
:
'detectType'
,
name
:
'样品类别'
,
placeholder
:
'请输入样品类别'
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'填写原始记录'
},
{
type
:
''
,
id
:
'food-task-assign-adjust-group'
,
name
:
'调整分组'
},
{
type
:
''
,
id
:
'food-task-assign-plan-date'
,
name
:
'设置计划完成时间'
},
{
type
:
''
,
id
:
'food-task-assign-maintain-info'
,
name
:
'信息维护'
}
],
getPage
:
{},
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
120
,
fixed
:
'left'
},
{
title
:
'试样编号'
,
key
:
'sampleCode'
,
width
:
180
},
{
title
:
'试样深度'
,
key
:
'sampleDepth'
,
width
:
180
},
{
title
:
'试样包装类型'
,
key
:
'samplePack'
,
width
:
180
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
,
width
:
140
},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
260
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
140
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
150
}
],
leftSelectData
:
[],
selectIds
:
[],
// 检测项目id
selectData
:
[],
// 检测项目data
selectSampleIds
:
[],
// 样品ids
result
:
[],
sampleNames
:
''
,
// 没有计划完成时间的样品名
defaultPlanDate
:
null
,
// 是否有字典
warningValue
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
},
colorComputed
()
{
return
function
(
val
)
{
return
val
-
new
Date
().
getTime
()
>
this
.
warningValue
*
86400000
?
'#606266'
:
val
-
new
Date
().
getTime
()
<=
0
?
'#eb6877'
:
'#f90'
}
}
},
mounted
()
{
// this._dicSearch()
},
methods
:
{
// 获取column
_getColumn
()
{
this
.
$refs
.
pageTable
.
_getColByTableName
()
},
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
// 从字典查预警期
_dicSearch
()
{
const
data
=
[
'食品检测预警天数'
,
'食品默认计划完成时间'
]
this
.
$store
.
dispatch
(
'LmsBaseDict/listDict'
,
data
).
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
LmsBaseDict
.
list
// eslint-disable-next-line camelcase
const
result_1
=
result
[
0
]
// eslint-disable-next-line camelcase
const
result_2
=
result
[
1
]
// 1食品检测预警天数
if
(
result_1
.
length
!==
0
)
{
this
.
warningValue
=
result_1
[
0
].
name
}
// 2食品默认计划完成时间
this
.
defaultPlanDate
=
result_2
.
length
!==
0
?
result_2
[
0
].
name
===
'是'
?
(
this
.
defaultPlanDate
=
true
)
:
(
this
.
defaultPlanDate
=
false
)
:
(
this
.
defaultPlanDate
=
false
)
})
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput2
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_selInputResult2
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput1
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_modalResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'AssignPerson'
:
if
(
this
.
defaultPlanDate
)
{
this
.
_trueDefault
(
data
)
}
else
{
this
.
_userResult
(
data
)
}
break
case
'EndDateModal'
:
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this
.
_page
()
// }
break
case
'UserGroup'
:
this
.
_userGroupResult
(
data
)
break
default
:
this
.
_page
()
}
},
// 为 true时,有字典按人分配
_trueDefault
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/personAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
sampleNames
=
''
this
.
_page
()
this
.
_resultChange
(
'分配成功!'
)
}
})
},
// 设置时间
_endDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
currentComponent
=
'AssignPerson'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
})
}
},
// 调整分组
_userGroupResult
(
data
)
{
const
tempData
=
{
groupId
:
data
.
id
,
groupName
:
data
.
name
,
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$store
.
dispatch
(
'FoodItem/adjustTestGroup'
,
tempData
).
then
(()
=>
{
this
.
_resultChange
(
'调整成功'
)
})
},
_resultChange
(
msg
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
this
.
$emit
(
'on-result-change'
)
},
async
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'按人分配'
:
this
.
_allotByPerson
()
// await this._reportDueDate()
// await this._userAssign()
break
case
'试验项目分配'
:
this
.
_userAssign
()
break
case
'按组分配'
:
await
this
.
_reportDueDate
()
await
this
.
_groupAssign
()
break
case
'调整分组'
:
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择=一条数据'
)
}
else
{
this
.
currentComponent
=
'UserGroup'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
()
})
}
break
case
'设置计划完成时间'
:
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
_changeDate
()
})
break
case
'信息维护'
:
this
.
_maintainInfo
()
break
}
},
_allotByPerson
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
$refs
.
personModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
},
// 信息维护
_maintainInfo
()
{
if
(
this
.
selectSampleIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
currentComponent
=
'MaintainInfoModal'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectSampleIds
,
2
)
})
}
},
_changeDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$refs
.
refModal
.
_open
(
tempData
,
'planDate'
)
}
},
_open
(
id
,
data
)
{
this
.
leftSelectData
=
data
this
.
entrustId
=
id
if
(
data
.
length
===
0
)
{
this
.
$set
(
this
.
getPage
,
'records'
,
[])
this
.
$set
(
this
.
getPage
,
'total'
,
0
)
this
.
$set
(
this
.
getPage
,
'current'
,
1
)
this
.
selectSampleIds
=
[]
this
.
selectIds
=
[]
this
.
selectData
=
[]
this
.
result
=
[]
}
else
{
this
.
_formSearch
()
}
},
_refresh
()
{
this
.
$emit
(
'on-result-change'
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
const
obj2
=
this
.
$refs
.
selInput2
.
_getFormObj
()
const
obj3
=
{
foodItemList
:
this
.
leftSelectData
}
Object
.
assign
(
obj
,
obj1
,
obj2
,
obj3
)
return
obj
},
_page
:
async
function
()
{
const
saveName
=
[]
const
saveMethod
=
[]
for
(
let
i
=
0
;
i
<
this
.
leftSelectData
.
length
;
i
++
)
{
saveName
.
push
(
this
.
leftSelectData
[
i
].
name
)
saveMethod
.
push
(
this
.
leftSelectData
[
i
].
testMethod
)
}
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
entrustId
this
.
formObj
.
name
=
saveName
.
join
(
','
)
this
.
formObj
.
testMethod
=
saveMethod
.
join
(
','
)
const
result
=
await
soilTest
.
pageExperimentTest
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
$refs
.
pageTable
.
_checkAll
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
case
'changeSize'
:
this
.
_page
()
// this.$refs.pageTable._checkAll()
break
}
},
// 按人分配 选人选时间
_assignBackData
(
data
)
{
console
.
log
(
data
)
const
tempData
=
{}
tempData
.
ids
=
this
.
selectIds
.
join
(
','
)
tempData
.
user
=
data
.
realname
tempData
.
userId
=
data
.
userId
this
.
_allotItems
(
tempData
)
},
_allotItems
:
async
function
(
data
)
{
const
result
=
await
soilTest
.
allotExp
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'分配成功'
)
}
},
_userAssign
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
console
.
log
(
user
)
this
.
$refs
.
personModal
.
_openGoup
(
'分配人员'
,
'itemTree'
)
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate
()
{
const
sampleNames
=
[]
for
(
let
i
=
0
;
i
<
this
.
result
.
length
;
i
++
)
{
if
(
!
this
.
result
[
i
].
planEndDate
)
{
sampleNames
.
push
(
this
.
result
[
i
].
name
)
}
}
this
.
sampleNames
=
[...
new
Set
(
sampleNames
)].
join
(
','
)
return
this
.
sampleNames
},
_userResult
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'user'
)
})
},
// 按组分配 选时间
_groupAssign
()
{
if
(
this
.
defaultPlanDate
)
{
// 有字典
if
(
this
.
sampleNames
===
''
)
{
// 有计划完成时间
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/groupAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
$Message
.
success
(
'分配成功!'
)
this
.
_page
()
}
})
}
else
{
// 有字典,无计划完成时间
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'所选项目中含有未设置计划完成时间的'
+
`
${
this
.
_reportDueDate
()}
`
+
'请确认!'
,
onOk
:
()
=>
{}
})
}
}
else
{
// 无字典的
// eslint-disable-next-line no-lonely-if
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'group'
)
})
}
}
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
this
.
$refs
.
refModal
.
_open
(
data
.
sampleId
)
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/item-tabs/ItemTabs.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<TwoColumnPage>
<template
slot=
"left"
>
<ItemLeftList
ref=
"leftModal"
@
on-result-change=
"_leftResult"
></ItemLeftList>
</
template
>
<
template
slot=
"right"
>
<ItemRightList
ref=
"rightModal"
@
on-result-change=
"_rightResult"
></ItemRightList>
</
template
>
</TwoColumnPage>
</div>
</template>
<
script
>
import
TwoColumnPage
from
'../../../../components/base/TwoColumnPage'
import
ItemLeftList
from
'./ItemLeftList'
import
ItemRightList
from
'./ItemRightList'
export
default
{
components
:
{
TwoColumnPage
,
ItemLeftList
,
ItemRightList
},
data
()
{
return
{
id
:
''
}
},
methods
:
{
_leftResult
(
data
)
{
this
.
$refs
.
rightModal
.
_open
(
this
.
id
,
data
)
},
_rightResult
()
{
this
.
$refs
.
leftModal
.
_page
()
},
_open
(
id
)
{
this
.
id
=
id
console
.
log
(
id
)
this
.
$refs
.
leftModal
.
_open
(
this
.
id
)
// this.$refs.rightModal._getColumn()
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tab/SampleLeftList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-left"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:table-name=
"tableName"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:rows=
"100"
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<a
v-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component
ref=
"refModal"
:is=
"currentComponent"
@
on-result-change=
"_modalResult"
></component>
</keep-alive>
</div>
</template>
<
script
>
import
{
soilTest
}
from
'../../../../api'
export
default
{
components
:
{},
props
:
{
id
:
null
},
data
()
{
return
{
currentComponent
:
''
,
tableName
:
'food-task-assign-sample-left'
,
// 用户自己选中的列
userColumns
:
[],
switchStatusData
:
this
.
id
,
formObj
:
{
entrustId
:
''
},
optionList
:
[
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'cname'
,
name
:
'委托单位'
,
placeholder
:
'请输入委托单位'
},
{
key
:
'testedName'
,
name
:
'受检单位'
,
placeholder
:
'请输入受检单位'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'name'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
}
],
btn
:
[{
id
:
'food-task-assign-auto'
,
name
:
'自动分配'
}],
getPage
:
{},
pageColumns
:
[
{
title
:
'委托编号'
,
key
:
'code'
,
width
:
180
},
{
title
:
'受检单位'
,
key
:
'testedName'
,
width
:
180
},
{
title
:
'样品编号'
,
key
:
'num'
,
width
:
180
},
{
title
:
'样品名称'
,
key
:
'name'
,
width
:
140
},
{
title
:
'委托单位'
,
key
:
'cname'
,
width
:
180
},
{
title
:
'数据出具日期'
,
key
:
'resultDate'
,
width
:
120
,
date
:
true
}
],
resultDateBegin
:
''
,
resultDateEnd
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
}
},
mounted
()
{
this
.
_page
()
},
methods
:
{
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
_modalResult
()
{
if
(
this
.
currentComponent
===
'AutoAssignModal'
)
{
this
.
_formSearch
()
}
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'search'
:
this
.
_formSearch
()
break
}
},
_open
()
{
this
.
_page
()
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
Object
.
assign
(
obj
,
obj1
)
return
obj
},
_page
:
async
function
()
{
console
.
log
(
'样品'
)
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
switchStatusData
const
result
=
await
soilTest
.
pageExpTestSample
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
FoodSample
.
page
break
case
'selectIds'
:
this
.
$emit
(
'on-result-change'
,
data
)
break
case
'changeSize'
:
this
.
_page
()
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
}
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'自动分配'
:
this
.
_autoAssign
()
break
}
},
_autoAssign
()
{
this
.
currentComponent
=
'AutoAssignModal'
this
.
$store
.
dispatch
(
'FoodItem/autoAllotNum'
).
then
(()
=>
{
const
num
=
this
.
$store
.
state
.
FoodItem
.
count
if
(
num
!==
undefined
)
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
num
)
})
}
})
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
id
).
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
id
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tab/SampleRightList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-right"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"委托编号:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:table-name=
"tableName"
:rows=
"100"
is-task
select-data
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key === 'name'"
:style=
"
{color:colorComputed(scope.row.planEndDate)}">
{{
scope
.
row
[
item
.
key
]
}}
</div>
<a
v-else-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.key==='status'"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</span>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else-if=
"item.datetime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_assignBackData"
></AssignPerson>
</div>
</template>
<
script
>
import
Global
from
'../../../../api/config'
import
{
soilTest
}
from
'../../../../api'
import
AssignPerson
from
'../../../../components/user-info-single/AssignPerson'
export
default
{
components
:
{
AssignPerson
},
data
()
{
return
{
// 定义表格名称----英文
tableName
:
'food-task-assign-item-right'
,
formObj
:
{},
// 用户自己选中的列
userColumns
:
[],
currentComponent
:
''
,
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'sampleName'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
},
{
key
:
'receiveDate'
,
name
:
'接样日期'
,
placeholder
:
'请选择接样日期'
,
date
:
true
},
{
key
:
'tester'
,
name
:
'主检人'
,
placeholder
:
'请输入主检人'
},
{
key
:
'detectType'
,
name
:
'样品类别'
,
placeholder
:
'请输入样品类别'
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'试验项目分配'
},
{
type
:
''
,
id
:
'food-task-assign-adjust-group'
,
name
:
'调整分组'
},
{
type
:
''
,
id
:
'food-task-assign-plan-date'
,
name
:
'设置计划完成时间'
},
{
type
:
''
,
id
:
'food-task-assign-maintain-info'
,
name
:
'信息维护'
}
],
getPage
:
{},
pageColumns
:
[
{
title
:
'试验名称'
,
key
:
'name'
,
width
:
160
},
{
title
:
'试验项目英文简写'
,
key
:
'shortName'
,
width
:
140
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
,
width
:
140
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
}
],
leftSelectData
:
[],
sampleIds
:
[],
selectIds
:
[],
// 检测项目id
selectData
:
[],
// 检测项目data
selectSampleIds
:
[],
// 样品ids
result
:
[],
sampleNames
:
''
,
// 没有计划完成时间的样品名
defaultPlanDate
:
null
,
// 是否有字典
warningValue
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
},
colorComputed
()
{
return
function
(
val
)
{
return
val
-
new
Date
().
getTime
()
>
this
.
warningValue
*
86400000
?
'#606266'
:
val
-
new
Date
().
getTime
()
<=
0
?
'#eb6877'
:
'#f90'
}
}
},
mounted
()
{
// this._dicSearch()
},
methods
:
{
// 获取column
_getColumn
()
{
this
.
$refs
.
pageTable
.
_getColByTableName
()
},
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
// 从字典查预警期
_dicSearch
()
{
const
data
=
[
'食品检测预警天数'
,
'食品默认计划完成时间'
]
this
.
$store
.
dispatch
(
'LmsBaseDict/listDict'
,
data
).
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
LmsBaseDict
.
list
// eslint-disable-next-line camelcase
const
result_1
=
result
[
0
]
// eslint-disable-next-line camelcase
const
result_2
=
result
[
1
]
// 1食品检测预警天数
if
(
result_1
.
length
!==
0
)
{
this
.
warningValue
=
result_1
[
0
].
name
}
// 2食品默认计划完成时间
this
.
defaultPlanDate
=
result_2
.
length
!==
0
?
result_2
[
0
].
name
===
'是'
?
(
this
.
defaultPlanDate
=
true
)
:
(
this
.
defaultPlanDate
=
false
)
:
(
this
.
defaultPlanDate
=
false
)
})
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput2
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_selInputResult2
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput1
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_modalResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'AssignPerson'
:
if
(
this
.
defaultPlanDate
)
{
this
.
_trueDefault
(
data
)
}
else
{
this
.
_userResult
(
data
)
}
break
case
'EndDateModal'
:
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this
.
_page
()
// }
break
case
'UserGroup'
:
this
.
_userGroupResult
(
data
)
break
default
:
this
.
_page
()
}
},
// 为 true时,有字典按人分配
_trueDefault
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/personAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
sampleNames
=
''
this
.
_page
()
this
.
_resultChange
(
'分配成功!'
)
}
})
},
// 设置时间
_endDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
currentComponent
=
'AssignPerson'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
})
}
},
// 调整分组
_userGroupResult
(
data
)
{
const
tempData
=
{
groupId
:
data
.
id
,
groupName
:
data
.
name
,
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$store
.
dispatch
(
'FoodItem/adjustTestGroup'
,
tempData
).
then
(()
=>
{
this
.
_resultChange
(
'调整成功'
)
})
},
_resultChange
(
msg
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
this
.
$emit
(
'on-result-change'
)
this
.
selectIds
=
[]
},
async
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'试验项目分配'
:
this
.
_userAssign
()
break
case
'按组分配'
:
await
this
.
_reportDueDate
()
await
this
.
_groupAssign
()
break
case
'调整分组'
:
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择=一条数据'
)
}
else
{
this
.
currentComponent
=
'UserGroup'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
()
})
}
break
case
'设置计划完成时间'
:
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
_changeDate
()
})
break
case
'信息维护'
:
this
.
_maintainInfo
()
break
}
},
// 信息维护
_maintainInfo
()
{
if
(
this
.
selectSampleIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
currentComponent
=
'MaintainInfoModal'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectSampleIds
,
2
)
})
}
},
_changeDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$refs
.
refModal
.
_open
(
tempData
,
'planDate'
)
}
},
_open
(
data
)
{
this
.
getPage
.
records
=
[]
this
.
sampleIds
=
data
if
(
data
.
length
===
0
)
{
this
.
$set
(
this
.
getPage
,
'records'
,
[])
this
.
$set
(
this
.
getPage
,
'total'
,
0
)
this
.
$set
(
this
.
getPage
,
'current'
,
1
)
this
.
selectSampleIds
=
[]
this
.
selectIds
=
[]
this
.
selectData
=
[]
this
.
result
=
[]
}
else
{
this
.
_page
()
}
},
_refresh
()
{
this
.
$emit
(
'on-result-change'
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
const
obj2
=
this
.
$refs
.
selInput2
.
_getFormObj
()
const
obj3
=
{
foodItemList
:
this
.
leftSelectData
}
Object
.
assign
(
obj
,
obj1
,
obj2
,
obj3
)
return
obj
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
sampleIds
=
this
.
sampleIds
const
result
=
await
soilTest
.
pageAllot
(
this
.
$serializeForm
(
this
.
formObj
))
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
$refs
.
pageTable
.
_checkAll
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
case
'changeSize'
:
this
.
_page
()
// this.$refs.pageTable._checkAll()
break
}
},
// 按人分配 选人选时间
_userAssign
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
console
.
log
(
user
)
this
.
$refs
.
personModal
.
_openGoup
(
'分配人员'
,
'itemTree'
)
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate
()
{
const
sampleNames
=
[]
for
(
let
i
=
0
;
i
<
this
.
result
.
length
;
i
++
)
{
if
(
!
this
.
result
[
i
].
planEndDate
)
{
sampleNames
.
push
(
this
.
result
[
i
].
name
)
}
}
this
.
sampleNames
=
[...
new
Set
(
sampleNames
)].
join
(
','
)
return
this
.
sampleNames
},
_userResult
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'user'
)
})
},
// 按组分配 选时间
_groupAssign
()
{
if
(
this
.
defaultPlanDate
)
{
// 有字典
if
(
this
.
sampleNames
===
''
)
{
// 有计划完成时间
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/groupAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
$Message
.
success
(
'分配成功!'
)
this
.
_page
()
}
})
}
else
{
// 有字典,无计划完成时间
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'所选项目中含有未设置计划完成时间的'
+
`
${
this
.
_reportDueDate
()}
`
+
'请确认!'
,
onOk
:
()
=>
{}
})
}
}
else
{
// 无字典的
// eslint-disable-next-line no-lonely-if
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'group'
)
})
}
}
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
_assignBackData
(
data
)
{
console
.
log
(
data
)
const
tempData
=
{}
tempData
.
ids
=
this
.
selectIds
.
join
(
','
)
tempData
.
user
=
data
.
realname
tempData
.
userId
=
data
.
userId
this
.
_allotItems
(
tempData
)
},
_allotItems
:
async
function
(
data
)
{
const
result
=
await
soilTest
.
allotExp
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'分配成功'
)
}
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
this
.
$refs
.
refModal
.
_open
(
data
.
sampleId
)
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tab/SampleTabs.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<TwoColumnPage>
<template
#
left
>
<SampleLeftList
ref=
"leftModal"
:id=
"id"
@
on-result-change=
"_leftResult"
></SampleLeftList>
</
template
>
<
template
#
right
>
<!--
<NoData
v-if=
"!currentComponent"
msg=
"请选中左侧数据后,查看此界面信息"
/>
-->
<!-- eslint-disable-next-line vue/require-component-is -->
<component
ref=
"refModal"
:is=
"currentComponent"
@
on-result-change=
"_rightResult"
></component>
</
template
>
</TwoColumnPage>
</div>
</template>
<
script
>
// import NoData from '@/components/base/NoData'
import
TwoColumnPage
from
'../../../../components/base/TwoColumnPage'
import
SampleLeftList
from
'./SampleLeftList'
import
SampleRightList
from
'./SampleRightList'
export
default
{
components
:
{
SampleLeftList
,
TwoColumnPage
,
// eslint-disable-next-line vue/no-unused-components
SampleRightList
// NoData
},
props
:
{
id
:
null
},
data
()
{
return
{
currentComponent
:
'SampleRightList'
,
switchStatusData
:
this
.
id
}
},
computed
:
{
switchStatus
:
function
()
{
return
this
.
status
// 直接监听props里的status状态
}
},
methods
:
{
_open
()
{
console
.
log
(
'y123123123123123123'
)
this
.
this
.
$refs
.
leftModal
.
_open
()
},
_sendData
(
id
)
{
this
.
$refs
.
leftModal
.
_open
(
this
.
id
)
},
_leftResult
(
data
)
{
this
.
currentComponent
=
'SampleRightList'
this
.
$refs
.
refModal
.
_open
(
data
.
join
(
','
))
},
_rightResult
()
{
this
.
$refs
.
leftModal
.
_page
()
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tabs/SampleLeftList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-left"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"委托编号:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
@
on-result-change=
"_btnClick"
class=
"contHide"
style=
"margin-bottom: 6px;"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:table-name=
"tableName"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:rows=
"100"
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<a
v-if=
"item.detail"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<
script
>
import
{
soilTest
}
from
'../../../../api'
export
default
{
components
:
{},
data
()
{
return
{
currentComponent
:
''
,
formObj
:
{
entrustId
:
undefined
},
entrustId
:
''
,
tableName
:
'food-task-assign-item-left'
,
// 用户自己选中的列
userColumns
:
[],
selectIds
:
[],
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
}
],
getPage
:
{},
pageColumns
:
[
{
title
:
'试样编号'
,
key
:
'sampleCode'
,
width
:
120
},
{
title
:
'委托编号'
,
key
:
'entrustCode'
,
width
:
140
},
{
title
:
'委托商'
,
key
:
'client'
,
width
:
200
}
]
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
}
},
methods
:
{
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
_modalResult
()
{
if
(
this
.
currentComponent
===
'AutoAssignModal'
)
{
this
.
_formSearch
()
}
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'search'
:
this
.
_formSearch
()
break
}
},
_open
(
id
)
{
this
.
entrustId
=
id
this
.
_page
()
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
Object
.
assign
(
obj
,
obj1
)
return
obj
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
entrustId
const
result
=
await
soilTest
.
pageExpTestSample
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
break
// case 'selectData':
// this.$emit('on-result-change', data)
// break
case
'selectIds'
:
this
.
selectIds
=
data
this
.
$emit
(
'on-result-change'
,
this
.
selectIds
.
join
(
','
))
break
case
'changeSize'
:
this
.
_page
()
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'自动分配'
:
this
.
currentComponent
=
'AutoAssignModal'
this
.
$nextTick
(
function
()
{
this
.
_autoAssign
()
})
break
}
},
_autoAssign
()
{
this
.
$store
.
dispatch
(
'FoodItem/autoAllotNum'
).
then
(()
=>
{
const
num
=
this
.
$store
.
state
.
FoodItem
.
count
if
(
num
!==
undefined
)
{
this
.
$refs
.
refModal
.
_open
(
num
)
}
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tabs/SampleRightList.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"task-assign-sample-right"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"委托编号:"
>
<Input
v-model=
"formObj.client"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:table-name=
"tableName"
:rows=
"100"
is-task
select-data
>
<vxe-table-column
v-for=
"item in userColumns.length > 0 ?userColumns:pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key === 'name'"
:style=
"
{color:colorComputed(scope.row.planEndDate)}">
{{
scope
.
row
[
item
.
key
]
}}
</div>
<a
v-else-if=
"item.key==='code'"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<a
v-else-if=
"item.key==='num'"
@
click
.
stop=
"_sampleDetail(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
<span
v-else-if=
"item.key==='status'"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</span>
<span
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
<span
v-else-if=
"item.datetime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM'
):
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
<VXESettingCol
slot=
"setting"
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_assignBackData"
></AssignPerson>
</div>
</template>
<
script
>
import
Global
from
'../../../../api/config'
import
{
soilTest
}
from
'../../../../api'
import
AssignPerson
from
'../../../../components/user-info-single/AssignPerson'
export
default
{
components
:
{
AssignPerson
},
data
()
{
return
{
// 定义表格名称----英文
tableName
:
'food-task-assign-item-right'
,
formObj
:
{},
// 用户自己选中的列
userColumns
:
[],
currentComponent
:
''
,
optionList
:
[
{
key
:
'name'
,
name
:
'检测项目'
,
placeholder
:
'请输入检测项目'
},
{
key
:
'code'
,
name
:
'委托编号'
,
placeholder
:
'请输入委托编号'
},
{
key
:
'num'
,
name
:
'样品编号'
,
placeholder
:
'请输入样品编号'
},
{
key
:
'sampleName'
,
name
:
'样品名称'
,
placeholder
:
'请输入样品名称'
},
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
},
{
key
:
'resultDate'
,
name
:
'数据出具日期'
,
placeholder
:
'请选择数据出具日期'
,
date
:
true
},
{
key
:
'receiveDate'
,
name
:
'接样日期'
,
placeholder
:
'请选择接样日期'
,
date
:
true
},
{
key
:
'tester'
,
name
:
'主检人'
,
placeholder
:
'请输入主检人'
},
{
key
:
'detectType'
,
name
:
'样品类别'
,
placeholder
:
'请输入样品类别'
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'试验项目分配'
},
{
type
:
''
,
id
:
'food-task-assign-adjust-group'
,
name
:
'调整分组'
},
{
type
:
''
,
id
:
'food-task-assign-plan-date'
,
name
:
'设置计划完成时间'
},
{
type
:
''
,
id
:
'food-task-assign-maintain-info'
,
name
:
'信息维护'
}
],
getPage
:
{},
pageColumns
:
[
{
title
:
'试验名称'
,
key
:
'name'
,
width
:
160
},
{
title
:
'试验项目英文简写'
,
key
:
'shortName'
,
width
:
140
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
,
width
:
140
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
}
],
leftSelectData
:
[],
sampleIds
:
[],
selectIds
:
[],
// 检测项目id
selectData
:
[],
// 检测项目data
selectSampleIds
:
[],
// 样品ids
result
:
[],
sampleNames
:
''
,
// 没有计划完成时间的样品名
defaultPlanDate
:
null
,
// 是否有字典
warningValue
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tabSearch'
)
},
colorComputed
()
{
return
function
(
val
)
{
return
val
-
new
Date
().
getTime
()
>
this
.
warningValue
*
86400000
?
'#606266'
:
val
-
new
Date
().
getTime
()
<=
0
?
'#eb6877'
:
'#f90'
}
}
},
mounted
()
{
// this._dicSearch()
},
methods
:
{
// 获取column
_getColumn
()
{
this
.
$refs
.
pageTable
.
_getColByTableName
()
},
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
// 从字典查预警期
_dicSearch
()
{
const
data
=
[
'食品检测预警天数'
,
'食品默认计划完成时间'
]
this
.
$store
.
dispatch
(
'LmsBaseDict/listDict'
,
data
).
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
LmsBaseDict
.
list
// eslint-disable-next-line camelcase
const
result_1
=
result
[
0
]
// eslint-disable-next-line camelcase
const
result_2
=
result
[
1
]
// 1食品检测预警天数
if
(
result_1
.
length
!==
0
)
{
this
.
warningValue
=
result_1
[
0
].
name
}
// 2食品默认计划完成时间
this
.
defaultPlanDate
=
result_2
.
length
!==
0
?
result_2
[
0
].
name
===
'是'
?
(
this
.
defaultPlanDate
=
true
)
:
(
this
.
defaultPlanDate
=
false
)
:
(
this
.
defaultPlanDate
=
false
)
})
},
_selInputResult1
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput2
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_selInputResult2
(
msg
,
data
)
{
switch
(
msg
)
{
case
'keyword'
:
this
.
$refs
.
selInput1
.
_setCompareKeyword
(
data
)
break
case
'search'
:
this
.
_formSearch
()
break
}
},
_modalResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'AssignPerson'
:
if
(
this
.
defaultPlanDate
)
{
this
.
_trueDefault
(
data
)
}
else
{
this
.
_userResult
(
data
)
}
break
case
'EndDateModal'
:
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this
.
_page
()
// }
break
case
'UserGroup'
:
this
.
_userGroupResult
(
data
)
break
default
:
this
.
_page
()
}
},
// 为 true时,有字典按人分配
_trueDefault
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/personAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
sampleNames
=
''
this
.
_page
()
this
.
_resultChange
(
'分配成功!'
)
}
})
},
// 设置时间
_endDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
currentComponent
=
'AssignPerson'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
})
}
},
// 调整分组
_userGroupResult
(
data
)
{
const
tempData
=
{
groupId
:
data
.
id
,
groupName
:
data
.
name
,
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$store
.
dispatch
(
'FoodItem/adjustTestGroup'
,
tempData
).
then
(()
=>
{
this
.
_resultChange
(
'调整成功'
)
})
},
_resultChange
(
msg
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
this
.
$emit
(
'on-result-change'
)
this
.
selectIds
=
[]
},
async
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'试验项目分配'
:
this
.
_userAssign
()
break
case
'按组分配'
:
await
this
.
_reportDueDate
()
await
this
.
_groupAssign
()
break
case
'调整分组'
:
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择=一条数据'
)
}
else
{
this
.
currentComponent
=
'UserGroup'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
()
})
}
break
case
'设置计划完成时间'
:
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
_changeDate
()
})
break
case
'信息维护'
:
this
.
_maintainInfo
()
break
}
},
// 信息维护
_maintainInfo
()
{
if
(
this
.
selectSampleIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
currentComponent
=
'MaintainInfoModal'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectSampleIds
,
2
)
})
}
},
_changeDate
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$refs
.
refModal
.
_open
(
tempData
,
'planDate'
)
}
},
_open
(
data
)
{
this
.
getPage
.
records
=
[]
this
.
sampleIds
=
data
if
(
data
.
length
===
0
)
{
this
.
$set
(
this
.
getPage
,
'records'
,
[])
this
.
$set
(
this
.
getPage
,
'total'
,
0
)
this
.
$set
(
this
.
getPage
,
'current'
,
1
)
this
.
selectSampleIds
=
[]
this
.
selectIds
=
[]
this
.
selectData
=
[]
this
.
result
=
[]
}
else
{
this
.
_page
()
}
},
_refresh
()
{
this
.
$emit
(
'on-result-change'
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_searchParams
()
{
const
obj
=
{}
const
obj1
=
this
.
$refs
.
selInput1
.
_getFormObj
()
const
obj2
=
this
.
$refs
.
selInput2
.
_getFormObj
()
const
obj3
=
{
foodItemList
:
this
.
leftSelectData
}
Object
.
assign
(
obj
,
obj1
,
obj2
,
obj3
)
return
obj
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
sampleIds
=
this
.
sampleIds
const
result
=
await
soilTest
.
pageAllot
(
this
.
$serializeForm
(
this
.
formObj
))
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
$refs
.
pageTable
.
_checkAll
()
this
.
getPage
=
result
}
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'table-col'
:
// 用户选中的表格列
this
.
userColumns
=
data
break
case
'changeSize'
:
this
.
_page
()
// this.$refs.pageTable._checkAll()
break
}
},
// 按人分配 选人选时间
_userAssign
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
console
.
log
(
user
)
this
.
$refs
.
personModal
.
_openGoup
(
'分配人员'
,
'itemTree'
)
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate
()
{
const
sampleNames
=
[]
for
(
let
i
=
0
;
i
<
this
.
result
.
length
;
i
++
)
{
if
(
!
this
.
result
[
i
].
planEndDate
)
{
sampleNames
.
push
(
this
.
result
[
i
].
name
)
}
}
this
.
sampleNames
=
[...
new
Set
(
sampleNames
)].
join
(
','
)
return
this
.
sampleNames
},
_userResult
(
data
)
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
),
personId
:
data
.
userId
,
personName
:
data
.
realname
,
groupId
:
data
.
groupId
,
groupName
:
data
.
groupName
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'user'
)
})
},
// 按组分配 选时间
_groupAssign
()
{
if
(
this
.
defaultPlanDate
)
{
// 有字典
if
(
this
.
sampleNames
===
''
)
{
// 有计划完成时间
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
Object
.
assign
(
tempData
,
{
planDate
:
null
})
this
.
$store
.
dispatch
(
'FoodItem/groupAllot'
,
tempData
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
$Message
.
success
(
'分配成功!'
)
this
.
_page
()
}
})
}
else
{
// 有字典,无计划完成时间
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'所选项目中含有未设置计划完成时间的'
+
`
${
this
.
_reportDueDate
()}
`
+
'请确认!'
,
onOk
:
()
=>
{}
})
}
}
else
{
// 无字典的
// eslint-disable-next-line no-lonely-if
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
const
tempData
=
{
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
tempData
,
'group'
)
})
}
}
},
// 委托详情
_detailModal
(
data
)
{
this
.
$store
.
dispatch
(
'FoodContract/getById'
,
data
.
contractId
).
then
(()
=>
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodContractGovernDetail'
}
else
{
this
.
currentComponent
=
'FoodContractCompanyDetail'
}
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodContract
.
model
)
})
})
},
_assignBackData
(
data
)
{
console
.
log
(
data
)
const
tempData
=
{}
tempData
.
ids
=
this
.
selectIds
.
join
(
','
)
tempData
.
user
=
data
.
realname
tempData
.
userId
=
data
.
userId
this
.
_allotItems
(
tempData
)
},
_allotItems
:
async
function
(
data
)
{
const
result
=
await
soilTest
.
allotExp
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'分配成功'
)
}
},
// 样品详情
_sampleDetail
(
data
)
{
this
.
$nextTick
(
function
()
{
if
(
data
.
type
===
1
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
}
else
{
this
.
currentComponent
=
'FoodSampleCompanyDetail'
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
companyModel
)
})
}
this
.
$refs
.
refModal
.
_open
(
data
.
sampleId
)
})
}
}
}
</
script
>
pages/soil-test-manage/test-input/sample-tabs/SampleTabs.vue
0 → 100644
View file @
e1f58483
<
template
>
<div>
<TwoColumnPage>
<template
slot=
"left"
>
<ItemLeftList
ref=
"SampleleftModal"
@
on-result-change=
"_leftResult"
></ItemLeftList>
</
template
>
<
template
slot=
"right"
>
<ItemRightList
ref=
"SamplerightModal"
@
on-result-change=
"_rightResult"
></ItemRightList>
</
template
>
</TwoColumnPage>
</div>
</template>
<
script
>
import
TwoColumnPage
from
'../../../../components/base/TwoColumnPage'
import
ItemLeftList
from
'./SampleLeftList'
import
ItemRightList
from
'./SampleRightList'
export
default
{
components
:
{
TwoColumnPage
,
ItemLeftList
,
ItemRightList
},
data
()
{
return
{}
},
methods
:
{
_leftResult
(
data
)
{
this
.
$refs
.
SamplerightModal
.
_open
(
data
)
},
_rightResult
()
{
this
.
$refs
.
SampleleftModal
.
_page
()
},
_open
(
id
)
{
this
.
$refs
.
SampleleftModal
.
_open
(
id
)
// this.$refs.rightModal._getColumn()
}
}
}
</
script
>
pages/soil-test-manage/test-task-manage/entrust-sample-manage/SampleManage.vue
View file @
e1f58483
...
...
@@ -58,7 +58,7 @@ export default {
},
// 待接收
_waitPage
()
{
this
.
$refs
.
waitReceiveModal
.
_open
()
this
.
$refs
.
waitReceiveModal
.
_open
(
this
.
entrustId
)
},
// 待发放
_waitSend
()
{
...
...
@@ -73,7 +73,7 @@ export default {
// this._issuedPage()
}
else
if
(
tab
.
name
===
'waitReceive'
)
{
// this._waitPage()
this
.
$refs
.
waitReceiveModal
.
_open
()
this
.
$refs
.
waitReceiveModal
.
_open
(
this
.
entrustId
)
}
else
if
(
tab
.
name
===
'waitScan'
)
{
this
.
$refs
.
waitScanModal
.
_open
(
this
.
entrustId
)
// this._waitSend()
...
...
pages/soil-test-manage/test-task-manage/entrust-sample-manage/item-tabs/ItemLeftList.vue
View file @
e1f58483
...
...
@@ -14,7 +14,7 @@
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
style=
"margin-bottom: 6px;"
></btn-list>
<btn-list
@
on-result-change=
"_btnClick"
class=
"contHide"
style=
"margin-bottom: 6px;"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
...
...
@@ -60,9 +60,10 @@ export default {
{
key
:
'testBasis'
,
name
:
'检测依据'
,
placeholder
:
'请输入检测依据'
}
],
getPage
:
{},
id
:
''
,
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
120
},
{
title
:
'检测
依据'
,
key
:
'testBasis
'
,
width
:
140
},
{
title
:
'检测
方法'
,
key
:
'testMethod
'
,
width
:
140
},
{
title
:
'检测依据名称'
,
key
:
'testBasisName'
,
width
:
200
}
]
}
...
...
@@ -90,7 +91,8 @@ export default {
break
}
},
_open
()
{
_open
(
id
)
{
this
.
id
=
id
this
.
_page
()
},
_searchParams
()
{
...
...
@@ -101,8 +103,8 @@ export default {
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
console
.
log
(
'this.formObj'
,
this
.
formObj
)
const
result
=
await
soilTest
.
page
ExpAllot
(
this
.
formObj
.
entrustId
=
this
.
id
const
result
=
await
soilTest
.
page
AllotByExp
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
...
...
pages/soil-test-manage/test-task-manage/entrust-sample-manage/item-tabs/ItemRightList.vue
View file @
e1f58483
...
...
@@ -46,7 +46,7 @@
</PTVXETable>
</Col>
</Row>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_
page
"
></AssignPerson>
<AssignPerson
ref=
"personModal"
@
on-result-change=
"_
assignBackData
"
></AssignPerson>
</div>
</template>
<
script
>
...
...
@@ -59,7 +59,13 @@ export default {
return
{
// 定义表格名称----英文
tableName
:
'food-task-assign-item-right'
,
formObj
:
{},
formObj
:
{
entrustId
:
''
,
name
:
''
,
testMethod
:
''
,
testBasis
:
''
},
entrustId
:
''
,
// 用户自己选中的列
userColumns
:
[],
currentComponent
:
''
,
...
...
@@ -85,8 +91,7 @@ export default {
{
key
:
'detectType'
,
name
:
'样品类别'
,
placeholder
:
'请输入样品类别'
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'按人分配'
},
{
type
:
'warning'
,
id
:
''
,
name
:
'按组分配'
},
{
type
:
'success'
,
id
:
''
,
name
:
'试验项目分配'
},
{
type
:
''
,
id
:
'food-task-assign-adjust-group'
,
name
:
'调整分组'
},
{
type
:
''
,
...
...
@@ -98,24 +103,14 @@ export default {
getPage
:
{},
pageColumns
:
[
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
120
,
fixed
:
'left'
},
{
title
:
'样品编号'
,
key
:
'num'
,
width
:
180
},
{
title
:
'样品名称'
,
key
:
'sampleName'
,
width
:
140
},
{
title
:
'服务类型'
,
key
:
'serviceType'
,
width
:
160
},
{
title
:
'产品'
,
key
:
'subClass'
,
width
:
160
},
{
title
:
'计划完成时间'
,
key
:
'planEndDate'
,
width
:
120
,
date
:
true
},
{
title
:
'应出报告日期'
,
key
:
'reportDueDate'
,
width
:
120
,
date
:
true
},
{
title
:
'数据出具日期'
,
key
:
'resultDate'
,
width
:
120
,
date
:
true
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
140
},
{
title
:
'检测依据名称'
,
key
:
'testBasisName'
,
width
:
200
},
{
title
:
'试样编号'
,
key
:
'sampleCode'
,
width
:
180
},
{
title
:
'试样深度'
,
key
:
'sampleDepth'
,
width
:
180
},
{
title
:
'试样包装类型'
,
key
:
'samplePack'
,
width
:
180
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
,
width
:
140
},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
260
},
{
title
:
'主检人'
,
key
:
'tester'
,
width
:
100
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
150
},
{
title
:
'判定依据'
,
key
:
'judgeBasis'
,
width
:
140
},
{
title
:
'判定依据名称'
,
key
:
'judgeBasisName'
,
width
:
200
},
{
title
:
'接样日期'
,
key
:
'receiveDate'
,
width
:
100
,
date
:
true
},
{
title
:
'项目备注'
,
key
:
'remark'
,
width
:
200
},
{
title
:
'样品备注'
,
key
:
'sampleRemark'
,
width
:
200
},
{
title
:
'委托备注'
,
key
:
'contractRemark'
,
width
:
200
}
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
140
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
150
}
],
leftSelectData
:
[],
selectIds
:
[],
// 检测项目id
...
...
@@ -261,10 +256,9 @@ export default {
})
},
_resultChange
(
msg
)
{
if
(
this
.
$store
.
state
.
FoodItem
.
success
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
}
this
.
$Message
.
success
(
msg
)
this
.
_page
()
this
.
$emit
(
'on-result-change'
)
},
async
_btnClick
(
msg
)
{
switch
(
msg
)
{
...
...
@@ -273,6 +267,9 @@ export default {
// await this._reportDueDate()
// await this._userAssign()
break
case
'试验项目分配'
:
this
.
_userAssign
()
break
case
'按组分配'
:
await
this
.
_reportDueDate
()
await
this
.
_groupAssign
()
...
...
@@ -323,8 +320,9 @@ export default {
this
.
$refs
.
refModal
.
_open
(
tempData
,
'planDate'
)
}
},
_open
(
data
)
{
_open
(
id
,
data
)
{
this
.
leftSelectData
=
data
this
.
entrustId
=
id
if
(
data
.
length
===
0
)
{
this
.
$set
(
this
.
getPage
,
'records'
,
[])
this
.
$set
(
this
.
getPage
,
'total'
,
0
)
...
...
@@ -352,9 +350,17 @@ export default {
return
obj
},
_page
:
async
function
()
{
const
saveName
=
[]
const
saveMethod
=
[]
for
(
let
i
=
0
;
i
<
this
.
leftSelectData
.
length
;
i
++
)
{
saveName
.
push
(
this
.
leftSelectData
[
i
].
name
)
saveMethod
.
push
(
this
.
leftSelectData
[
i
].
testMethod
)
}
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
console
.
log
(
'this.formObj'
,
this
.
formObj
)
const
result
=
await
soilTest
.
pageExpAllot
(
this
.
formObj
.
entrustId
=
this
.
entrustId
this
.
formObj
.
name
=
saveName
.
join
(
','
)
this
.
formObj
.
testMethod
=
saveMethod
.
join
(
','
)
const
result
=
await
soilTest
.
pageExperimentAllot
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
...
...
@@ -394,39 +400,56 @@ export default {
}
},
// 按人分配 选人选时间
_userAssign
()
{
if
(
this
.
defaultPlanDate
)
{
// 有字典
if
(
this
.
sampleNames
===
''
)
{
// 有计划完成时间
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
this
.
currentComponent
=
'AssignPerson'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openGoupByUserId
(
'分配人员'
,
user
.
id
,
'itemTree'
)
})
}
else
{
// 有字典,无计划完成时间的
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'所选项目中含有未设置计划完成时间的'
+
`
${
this
.
_reportDueDate
()}
`
+
'请确认!'
,
onOk
:
()
=>
{}
})
}
}
else
{
// 无字典
this
.
currentComponent
=
'EndDateModal'
this
.
$nextTick
(()
=>
{
this
.
_endDate
()
})
_assignBackData
(
data
)
{
console
.
log
(
data
)
const
tempData
=
{}
tempData
.
ids
=
this
.
selectIds
.
join
(
','
)
tempData
.
user
=
data
.
realname
tempData
.
userId
=
data
.
userId
this
.
_allotItems
(
tempData
)
},
_allotItems
:
async
function
(
data
)
{
const
result
=
await
soilTest
.
allotExp
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'分配成功'
)
}
},
_userAssign
()
{
const
user
=
Global
.
getUserInfo
(
'userInfo'
)
console
.
log
(
user
)
this
.
$refs
.
personModal
.
_openGoup
(
'分配人员'
,
'itemTree'
)
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate
()
{
const
sampleNames
=
[]
...
...
pages/soil-test-manage/test-task-manage/entrust-sample-manage/item-tabs/ItemTabs.vue
View file @
e1f58483
...
...
@@ -23,17 +23,21 @@ export default {
ItemRightList
},
data
()
{
return
{}
return
{
id
:
''
}
},
methods
:
{
_leftResult
(
data
)
{
this
.
$refs
.
rightModal
.
_open
(
data
)
this
.
$refs
.
rightModal
.
_open
(
this
.
id
,
data
)
},
_rightResult
()
{
this
.
$refs
.
leftModal
.
_page
()
},
_open
()
{
this
.
$refs
.
leftModal
.
_open
()
_open
(
id
)
{
this
.
id
=
id
console
.
log
(
id
)
this
.
$refs
.
leftModal
.
_open
(
this
.
id
)
// this.$refs.rightModal._getColumn()
}
}
...
...
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