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
d025b3d8
Commit
d025b3d8
authored
Dec 29, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了样品管理
parent
56ff28df
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1061 additions
and
4 deletions
+1061
-4
EntrustRegister.vue
pages/soil-alone-sample-instock/EntrustRegister.vue
+21
-4
AddressManage.vue
...-sample-manage/storehouse-sample-manage/AddressManage.vue
+260
-0
AddressManageEdit.vue
...ple-manage/storehouse-sample-manage/AddressManageEdit.vue
+234
-0
ViewLocationEntrust.vue
...e-manage/storehouse-sample-manage/ViewLocationEntrust.vue
+286
-0
ViewSample.vue
...one-sample-manage/storehouse-sample-manage/ViewSample.vue
+254
-0
soil-routes.js
router/soil-routes.js
+6
-0
No files found.
pages/soil-alone-sample-instock/EntrustRegister.vue
View file @
d025b3d8
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
<Col
span=
"24"
style=
"margin-top: 10px"
>
<Col
span=
"24"
style=
"margin-top: 10px"
>
<Form
id=
"formId"
v-show=
"searchOpen"
:label-width=
"90"
inline
onsubmit=
"return false"
>
<Form
id=
"formId"
v-show=
"searchOpen"
:label-width=
"90"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"委托编号:"
>
<Input
v-model=
"formObj.entrustCode"
@
on-enter=
"_formSearch"
name=
"entrustCode"
placeholder=
"请输入委托编号"
clearable
/>
</Form-item>
<Form-item
class=
"search-item"
label=
"项目名称:"
>
<Form-item
class=
"search-item"
label=
"项目名称:"
>
<Input
v-model=
"formObj.projectName"
@
on-enter=
"_formSearch"
name=
"projectName"
placeholder=
"请输入项目名称"
clearable
/>
<Input
v-model=
"formObj.projectName"
@
on-enter=
"_formSearch"
name=
"projectName"
placeholder=
"请输入项目名称"
clearable
/>
</Form-item>
</Form-item>
...
@@ -103,6 +100,16 @@ export default {
...
@@ -103,6 +100,16 @@ export default {
name
:
'查看'
name
:
'查看'
},
},
{
{
type
:
'ios-cloud-download'
,
id
:
''
,
name
:
'导出入库资料'
},
{
type
:
'ios-camera'
,
id
:
''
,
name
:
'照片'
},
{
type
:
'md-cloud'
,
type
:
'md-cloud'
,
id
:
''
,
id
:
''
,
name
:
'附件'
name
:
'附件'
...
@@ -231,6 +238,9 @@ export default {
...
@@ -231,6 +238,9 @@ export default {
case
'试验项目列表'
:
case
'试验项目列表'
:
this
.
_itemManage
(
data
.
id
)
this
.
_itemManage
(
data
.
id
)
break
break
case
'照片'
:
this
.
_uploadPhoto
(
data
)
break
case
'附件'
:
case
'附件'
:
this
.
_upload
(
data
.
id
)
this
.
_upload
(
data
.
id
)
break
break
...
@@ -243,7 +253,14 @@ export default {
...
@@ -243,7 +253,14 @@ export default {
}
}
})
})
},
},
_uploadPhoto
(
data
)
{
// 上传照片文件
this
.
currentComponent
=
'PhotoManage'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
'entrustId'
)
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_sampleManage
(
data
)
{
_sampleManage
(
data
)
{
// 管理样品
// 管理样品
this
.
currentComponent
=
'SoilSampleManage'
this
.
currentComponent
=
'SoilSampleManage'
...
...
pages/soil-alone-sample-manage/storehouse-sample-manage/AddressManage.vue
0 → 100644
View file @
d025b3d8
<
template
>
<div>
<!--内容-->
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<Row>
<Col
span=
"24"
class=
"margin-top-10"
>
<!--搜索表单-->
<Form
id=
"search-form"
:label-width=
"90"
v-show=
"searchOpen"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"库房号:"
>
<Input
@
on-enter=
"_formSearch"
v-model=
"formObj.warehouse"
name=
"warehouse"
placeholder=
"请输入库房号"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
:showSearchBtn=
"true"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<!--表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:iconMsg=
"iconMsg"
>
<vxe-table-column
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
v-for=
"item in pageColumns"
:key=
"item.key"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.key==='status'"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'现行'
:
scope
.
row
[
item
.
key
]
===
1
?
'即将实施'
:
scope
.
row
[
item
.
key
]
===
2
?
'部分被代替'
:
scope
.
row
[
item
.
key
]
===
3
?
'被代替'
:
scope
.
row
[
item
.
key
]
===
4
?
'作废'
:
''
}}
</div>
<div
v-else-if=
"item.key==='classify'"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'判定依据'
:
scope
.
row
[
item
.
key
]
===
1
?
'检测依据'
:
scope
.
row
[
item
.
key
]
===
2
?
'其他'
:
''
}}
</div>
<div
v-else-if=
"item.key==='type'"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'待检'
:
scope
.
row
[
item
.
key
]
===
1
?
'备样'
:
scope
.
row
[
item
.
key
]
===
2
?
'备用'
:
''
}}
</div>
<div
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</div>
<div
v-else-if=
"item.key==='fileUrl'"
>
<span
v-if=
"scope.row['fileUrl']"
class=
"green-color"
>
是
</span>
<span
v-else
class=
"red-color"
>
否
</span>
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!--组件加载-->
<ViewSample
ref=
"viewSample"
></ViewSample>
<StandardsManageEdit
ref=
"editModal"
@
on-result-change=
"_page"
></StandardsManageEdit>
</div>
</template>
<
script
>
import
{
soilSample
}
from
'../../../api'
import
StandardsManageEdit
from
'./AddressManageEdit'
// 添加、编辑
import
ViewSample
from
'./ViewLocationEntrust'
export
default
{
components
:
{
StandardsManageEdit
,
ViewSample
},
data
()
{
return
{
currentComponent
:
''
,
formObj
:
{
code
:
undefined
,
name
:
undefined
},
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'添加'
,
componentName
:
'StandardsManageEdit'
},
{
type
:
'error'
,
id
:
''
,
name
:
'删除'
}
],
// 表格
pageColumns
:
[
{
title
:
'库房号'
,
key
:
'warehouse'
},
{
title
:
'货架号'
,
key
:
'name'
},
{
title
:
'位置分类'
,
key
:
'type'
},
{
title
:
'位置管理人'
,
key
:
'manager'
},
{
title
:
'备注说明'
,
key
:
'remark'
}
],
// 操作
iconMsg
:
[
{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
,
componentName
:
'StandardsManageEdit'
},
{
type
:
'md-apps'
,
id
:
''
,
name
:
'查看试样'
},
{
type
:
'md-remove-circle'
,
id
:
''
,
name
:
'删除'
}
],
searchOpen
:
false
,
getPage
:
{},
// 选中的内容
selectIds
:
[]
}
},
computed
:
{
// 表格的高度
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
'search'
)
}
else
{
return
this
.
$tableHeight
(
'noSearch'
)
}
}
},
mounted
()
{
this
.
_page
()
},
methods
:
{
// 操作按钮
_btnClick
(
msg
,
currentComponent
)
{
this
.
currentComponent
=
currentComponent
switch
(
msg
)
{
case
'添加'
:
this
.
$nextTick
(()
=>
{
this
.
_editModal
(
false
)
})
break
case
'删除'
:
this
.
_deleteSelected
()
break
case
'导入'
:
this
.
$nextTick
(()
=>
{
this
.
_import
()
})
break
case
'导出'
:
// this._export()
break
// 收起搜索
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
},
// 表格中操作
_iconClick
(
res
,
data
,
currentComponent
)
{
this
.
currentComponent
=
currentComponent
this
.
$nextTick
(()
=>
{
switch
(
res
)
{
case
'编辑'
:
this
.
_editModal
(
true
,
data
.
id
)
break
case
'查看试样'
:
this
.
_viewSample
(
data
.
name
)
break
case
'删除'
:
this
.
_deleteById
(
data
.
id
)
break
}
})
},
_viewSample
(
data
)
{
this
.
$refs
.
viewSample
.
_open
(
data
)
},
_editModal
:
async
function
(
edit
,
id
)
{
if
(
edit
)
{
const
result
=
await
soilSample
.
aloneWarehouseLocationGetById
(
id
)
if
(
result
)
{
this
.
$refs
.
editModal
.
_open
(
result
)
}
}
else
{
// 添加
this
.
$refs
.
editModal
.
_open
()
}
},
// 获取数据
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilSample
.
aloneWarehouseLocation
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
// 查询
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
// 删除一条记录
_deleteById
(
id
)
{
this
.
_deleteByIds
([
id
])
},
// 批量删除
_deleteSelected
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
this
.
selectIds
,
'确定删除这 '
+
this
.
selectIds
.
length
+
' 条记录?'
)
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
loading
:
true
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
_delOk
(
ids
)
}
})
},
_delOk
:
async
function
(
ids
)
{
const
result
=
await
soilSample
.
aloneWarehouseLocationDelete
(
ids
)
if
(
result
)
{
this
.
_page
()
this
.
$Modal
.
remove
()
this
.
$Message
.
success
(
'删除成功'
)
}
},
// 表格内容
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
_page
()
break
case
'selectIds'
:
this
.
selectIds
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
break
case
'changeSize'
:
this
.
_page
()
break
}
}
}
}
</
script
>
pages/soil-alone-sample-manage/storehouse-sample-manage/AddressManageEdit.vue
0 → 100644
View file @
d025b3d8
<
template
>
<div>
<Modal
v-model=
"showEditModal"
v-drag
:mask-closable=
"false"
:width=
"500"
class=
"zIndex-1200"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<Form
id=
"edit-form"
ref=
"formObj"
:model=
"formObj"
:rules=
"ruleValidate"
:label-width=
"100"
inline
>
<Form-item
label=
"库房号"
prop=
"warehouse"
style=
"width: 100%"
>
<Input
v-model=
"formObj.warehouse"
name=
"warehouse"
placeholder=
"请输入库房号"
/>
</Form-item>
<Form-item
label=
"货架号"
prop=
"name"
style=
"width: 100%"
>
<Input
v-model=
"formObj.name"
name=
"name"
placeholder=
"请输入货架号"
/>
</Form-item>
<Form-item
label=
"位置分类:"
prop=
"type"
style=
"width: 100%"
>
<Select
v-model=
"formObj.type"
clearable
name=
"type"
placeholder=
"请选择类别"
>
<Option
v-for=
"(item,index) in typeData"
:value=
"item.value"
:key=
"index"
>
{{
item
.
name
}}
</Option>
</Select>
</Form-item>
<Form-item
label=
"位置管理人"
prop=
"manager"
style=
"width: 100%"
>
<Input
v-model=
"formObj.manager"
@
click
.
native=
"_selectStaff"
name=
"manager"
readonly
/>
</Form-item>
<Form-item
prop=
"managerId"
style=
"width: 100%;display: none"
>
<Input
v-model=
"formObj.managerId"
@
click
.
native=
"_selectStaff"
name=
"managerId"
readonly
/>
</Form-item>
<Form-item
label=
"备注说明"
prop=
"remark"
style=
"width: 100%"
>
<Input
v-model=
"formObj.remark"
name=
"remark"
placeholder=
"请输入备注说明"
/>
</Form-item>
</Form>
</div>
<div
slot=
"footer"
>
<ModalFooter
ref=
"footerModal"
@
on-result-change=
"_footerResult"
:footer=
"footerList"
></ModalFooter>
</div>
</Modal>
<UserInfo
ref=
"userModal"
@
on-result-change=
"_userData"
is-change
></UserInfo>
</div>
</
template
>
<
script
>
/**
* 添加编辑
*/
import
ModalFooter
from
'../../../components/base/modalFooter'
import
{
soilSample
}
from
'../../../api'
import
Global
from
'../../../api/config'
import
UserInfo
from
'../../../components/user-info-single/assignPerson'
export
default
{
components
:
{
ModalFooter
,
UserInfo
},
data
()
{
return
{
formId
:
''
,
lengthLimitList
:
[
{
key
:
'stdNum'
,
title
:
'标准号'
},
{
key
:
'enName'
,
title
:
'英文名称'
},
{
key
:
'belongUnit'
,
title
:
'归口单位'
},
{
key
:
'publishUnit'
,
title
:
'发布单位'
}
],
modalTitle
:
'收样位置选择'
,
formObj
:
{
name
:
''
,
warehouse
:
''
,
type
:
''
,
remark
:
''
,
manager
:
''
,
managerId
:
''
},
options
:
[
{
name
:
'国家标准'
},
{
name
:
'地方标准'
},
{
name
:
'行业标准'
},
{
name
:
'企业标准'
}
],
typeData
:
[
{
name
:
'待检'
,
value
:
0
},
{
name
:
'备样'
,
value
:
1
},
{
name
:
'备用'
,
value
:
2
}
],
ruleValidate
:
{
warehouse
:
[
{
required
:
true
,
message
:
'库房号不能为空'
,
trigger
:
'blur'
}
]
},
showEditModal
:
false
,
classifyList
:
[
{
value
:
0
,
name
:
'判定依据'
},
{
value
:
1
,
name
:
'检测依据'
},
{
value
:
2
,
name
:
'其他'
}
],
typeList
:
[
{
value
:
0
,
name
:
'国家标准'
},
{
value
:
1
,
name
:
'地方标准'
},
{
value
:
2
,
name
:
'行业标准'
},
{
value
:
3
,
name
:
'企业标准'
}
],
statusList
:
[
{
value
:
0
,
name
:
'现行'
},
{
value
:
1
,
name
:
'即将实施'
},
{
value
:
2
,
name
:
'部分被代替'
},
{
value
:
3
,
name
:
'被代替'
},
{
value
:
4
,
name
:
'作废'
}
],
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'保存'
,
type
:
'primary'
}
]
}
},
methods
:
{
_getUser
()
{
const
user
=
Global
.
getUserInfo
()
this
.
formObj
.
manager
=
user
.
realname
this
.
formObj
.
managerId
=
user
.
id
console
.
log
(
user
)
},
_selectStaff
()
{
this
.
$refs
.
userModal
.
_open
()
},
_userData
(
data
,
msg
,
contractTempData
)
{
this
.
formObj
.
manager
=
data
.
realname
this
.
formObj
.
managerId
=
data
.
id
console
.
log
(
data
,
msg
)
},
/** *modal-footer */
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'保存'
:
this
.
_ok
()
break
}
},
_hideLoading
()
{
this
.
$refs
.
footerModal
.
_hideLoading
()
},
_resultChange
(
msg
)
{
this
.
showEditModal
=
false
this
.
$Message
.
success
(
msg
)
this
.
$emit
(
'on-result-change'
)
this
.
_hideLoading
()
},
_ok
()
{
this
.
$refs
.
formObj
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
formObj
.
publishDate
&&
this
.
formObj
.
effectDate
)
{
if
(
this
.
formObj
.
publishDate
>
this
.
formObj
.
effectDate
)
{
this
.
$Message
.
error
(
'发布日期应早于实施日期'
)
this
.
_hideLoading
()
return
}
}
const
data
=
this
.
$serialize
(
'edit-form'
)
if
(
this
.
$string
(
this
.
formObj
.
id
).
isEmpty
())
{
// 添加
console
.
log
(
'data'
,
data
)
this
.
_save
(
data
)
}
else
{
// 编辑
this
.
_edit
({
id
:
this
.
formObj
.
id
,
obj
:
data
})
}
}
else
{
this
.
$Message
.
error
(
'表单验证失败!'
)
this
.
_hideLoading
()
}
})
},
_save
:
async
function
(
data
)
{
const
result
=
await
soilSample
.
aloneWarehouseLocationAdd
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'添加成功!'
)
}
},
_edit
:
async
function
(
data
)
{
const
result
=
await
soilSample
.
aloneWarehouseLocationEdit
(
data
)
if
(
result
)
{
this
.
_resultChange
(
'编辑成功!'
)
}
},
_cancel
()
{
this
.
_hideLoading
()
this
.
showEditModal
=
false
},
_open
(
formObj
)
{
this
.
formId
=
this
.
$randomCode
()
this
.
_hideLoading
()
this
.
$refs
.
formObj
.
resetFields
()
if
(
this
.
$string
(
formObj
).
isEmpty
())
{
this
.
modalTitle
=
'添加'
this
.
formObj
.
id
=
''
this
.
_getUser
()
}
else
{
this
.
formObj
=
formObj
this
.
formObj
.
id
=
formObj
.
id
this
.
formObj
.
effectDate
=
this
.
formObj
.
effectDate
?
new
Date
(
formObj
.
effectDate
)
:
''
this
.
formObj
.
publishDate
=
this
.
formObj
.
publishDate
?
new
Date
(
formObj
.
publishDate
)
:
''
this
.
modalTitle
=
'编辑'
}
this
.
showEditModal
=
true
},
_registerAdd
()
{
this
.
formId
=
this
.
$randomCode
()
this
.
_hideLoading
()
this
.
$refs
.
formObj
.
resetFields
()
this
.
modalTitle
=
'添加'
this
.
formObj
.
id
=
''
this
.
formObj
.
type
=
3
this
.
showEditModal
=
true
}
}
}
</
script
>
pages/soil-alone-sample-manage/storehouse-sample-manage/ViewLocationEntrust.vue
0 → 100644
View file @
d025b3d8
<
template
>
<div>
<Modal
v-model=
"showModal"
v-drag
width=
"1030"
class=
"modal-footer-none"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
v-show=
"searchOpen"
id=
"search-sample-company"
:label-width=
"80"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
label=
"委托编号:"
class=
"search-item"
>
<Input
v-model=
"formObj.entrustCode"
placeholder=
"请输入委托编号"
clearable
@
on-enter=
"_formSearch"
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
type=
"primary"
@
click=
"_page"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
class=
"contHide"
show-search-btn=
"true"
@
on-result-change=
"_btnClick"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
:get-page=
"getPage"
:icon-msg=
"iconMsg"
select-data
@
on-result-change=
"_tableResultChange"
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</div>
<div
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</div>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
<div
slot=
"footer"
>
<modal-footer
ref=
"footerModal"
:footer=
"footerList"
@
on-result-change=
"_footerResult"
/>
</div>
</Modal>
<SoilSampleItemManage
ref=
"sampleItemManage"
@
on-result-change=
"_page"
></SoilSampleItemManage>
</div>
</template>
<
script
>
import
{
soilEntrust
}
from
'../../../api'
import
SoilSampleItemManage
from
'./ViewSample'
export
default
{
components
:
{
SoilSampleItemManage
},
data
()
{
return
{
formId
:
'soilSampleManage'
,
currentComponent
:
''
,
btn
:
[
// {
// type: 'success',
// id: '',
// name: '导入检测项目'
// }
// {
// type: 'success',
// id: '',
// name: '导入检测项目包'
// },
// {
// type: 'success',
// id: '',
// name: '打印标签'
// }
],
itemList
:
[],
indexList
:
[],
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'确定'
,
type
:
'primary'
}
],
iconMsg
:
[
{
type
:
'ios-beaker'
,
id
:
''
,
name
:
'查看试样'
}
],
contractId
:
''
,
// 委托id
showModal
:
false
,
searchOpen
:
true
,
modalTitle
:
'管理样品'
,
selectIds
:
[],
selectData
:
{},
getPage
:
{},
pageColumns
:
[
{
title
:
'委托商'
,
key
:
'client'
,
width
:
230
},
{
title
:
'委托编号'
,
key
:
'entrustCode'
,
width
:
120
},
{
title
:
'委托日期'
,
key
:
'entrustDate'
,
width
:
120
,
date
:
true
},
{
title
:
'钻孔位置'
,
key
:
'boreholeLocation'
,
width
:
120
},
{
title
:
'水深(米)'
,
key
:
'waterDepth'
,
width
:
120
},
{
title
:
'钻孔名称'
,
key
:
'boreholeName'
,
width
:
120
},
{
title
:
'进度'
,
key
:
'progress'
,
width
:
120
,
status
:
true
},
{
title
:
'平均容重'
,
key
:
'projectNo'
,
width
:
120
},
{
title
:
'检验类别'
,
key
:
'testType'
,
width
:
120
}
],
formObj
:
{
receiveLocation
:
undefined
,
entrustCode
:
undefined
,
client
:
undefined
},
receiveLocation
:
''
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tableModal'
)
}
},
methods
:
{
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'确定'
:
this
.
_ok
()
break
}
},
_cancel
()
{
this
.
showModal
=
false
},
_ok
()
{
this
.
showModal
=
false
this
.
$refs
.
footerModal
.
_hideLoading
()
console
.
log
(
this
.
getPage
)
},
_dateChange
(
data
)
{
this
.
formObj
.
ctimeBegin
=
data
[
0
]
this
.
formObj
.
ctimeEnd
=
data
[
1
]
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'添加'
:
this
.
_editModal
(
false
)
break
case
'删除'
:
this
.
_deleteSelected
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
_copyHisSample
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
contractId
)
},
_iconClick
(
res
,
data
,
componentName
,
index
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
case
'查看试样'
:
this
.
_itemManage
(
data
.
id
)
break
case
'编辑'
:
this
.
_editModal
(
true
,
data
)
break
case
'复制'
:
this
.
_copy
(
data
)
break
case
'删除'
:
console
.
log
(
index
)
this
.
_deleteById
(
data
.
id
)
break
}
})
},
_itemManage
(
data
)
{
this
.
$refs
.
sampleItemManage
.
_open
(
data
,
this
.
receiveLocation
)
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'allSelect'
:
this
.
allSelect
(
data
)
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
)
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_open
(
name
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
.
receiveLocation
=
name
this
.
receiveLocation
=
name
this
.
showModal
=
true
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
_page
()
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
.
entrustId
=
this
.
contractId
const
result
=
await
soilEntrust
.
pageLocationEntrust
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
_deleteOk
(
ids
)
}
})
},
_deleteById
(
id
)
{
// 删除一条记录
this
.
_deleteByIds
([
id
])
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
,
'确定删除 '
+
ids
.
length
+
' 条记录?'
)
}
},
_editModal
(
edit
,
data
)
{
if
(
edit
)
{
console
.
log
(
data
)
this
.
$refs
.
sampleManageEdit
.
_open
(
data
)
}
else
{
// 添加
this
.
$refs
.
refModal
.
_open
(
''
,
this
.
contractId
)
}
},
_search
()
{
this
.
_page
()
},
_resultChange
(
msg
)
{
this
.
_page
()
this
.
$Message
.
success
(
msg
)
},
_operationRecord
(
id
)
{
// 操作日志
this
.
$refs
.
recordModal
.
_open
(
id
)
}
}
}
</
script
>
pages/soil-alone-sample-manage/storehouse-sample-manage/ViewSample.vue
0 → 100644
View file @
d025b3d8
<
template
>
<div>
<Modal
v-model=
"showModal"
v-drag
width=
"980"
class=
"modal-footer-none"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"search-sample-company"
v-show=
"searchOpen"
:label-width=
"80"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
label=
"试样编号:"
class=
"search-item"
>
<Input
v-model=
"formObj.sampleCode"
@
on-enter=
"_formSearch"
placeholder=
"请输入样品编号"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_page"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
@
on-result-change=
"_btnClick"
class=
"contHide"
show-search-btn=
"true"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETableHeight
ref=
"pageTable"
:rows=
"500"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
select-data
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</div>
<div
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<div
slot=
"footer"
>
<modal-footer
ref=
"footerModal"
:footer=
"footerList"
@
on-result-change=
"_footerResult"
/>
</div>
</Modal>
</div>
</template>
<
script
>
import
{
soilSample
}
from
'../../../api'
export
default
{
components
:
{},
data
()
{
return
{
formId
:
'soilSampleManage'
,
currentComponent
:
''
,
btn
:
[
{
type
:
'error'
,
id
:
''
,
name
:
'批量删除'
}
],
iconMsg
:
[{
type
:
'md-trash'
,
id
:
''
,
name
:
'删除'
}],
itemList
:
[],
indexList
:
[],
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'确定'
,
type
:
'primary'
}
],
entrustId
:
''
,
// 委托id
showModal
:
false
,
recordHis
:
false
,
searchOpen
:
true
,
modalTitle
:
'管理样品'
,
selectIds
:
[],
selectData
:
{},
getPage
:
{},
pageColumns
:
[
{
title
:
'试样编号'
,
key
:
'sampleCode'
,
width
:
100
,
fixed
:
'left'
},
{
title
:
'试样深度'
,
key
:
'sampleDepth'
,
width
:
100
},
{
title
:
'现场编号'
,
key
:
'siteNo'
,
width
:
100
},
{
title
:
'委托编号'
,
key
:
'entrustCode'
,
width
:
100
},
{
title
:
'收样位置'
,
key
:
'receiveLocation'
,
width
:
100
},
{
title
:
'土质描述'
,
key
:
'sampleDescribe'
,
width
:
160
},
{
title
:
'土质描述详情'
,
key
:
'describeDetail'
,
width
:
160
},
{
title
:
'样品包装类型'
,
key
:
'samplePack'
,
width
:
120
}
],
sampleId
:
''
,
dateList
:
[],
formObj
:
{
receiveLocation
:
undefined
,
entrustId
:
undefined
}
}
},
computed
:
{
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
'search'
)
}
else
{
return
this
.
$tableHeight
(
'noSearch'
)
}
}
},
methods
:
{
_handleRow
(
data
)
{
this
.
currentRow
=
data
.
row
this
.
currentIndex
=
data
.
rowIndex
},
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'确定'
:
this
.
_ok
()
break
}
},
_cancel
()
{
this
.
showModal
=
false
},
_ok
()
{
this
.
showModal
=
false
this
.
$refs
.
footerModal
.
_hideLoading
()
console
.
log
(
this
.
getPage
)
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'批量删除'
:
this
.
_deleteSelected
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
_iconClick
(
res
,
data
,
componentName
,
index
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
case
'删除'
:
this
.
_deleteById
(
data
.
id
)
break
}
})
},
_tableResultChange
(
msg
,
data
)
{
const
selectIds
=
[]
switch
(
msg
)
{
case
'selectData'
:
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'allSelect'
:
this
.
allSelect
(
data
)
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
)
break
case
'changeSize'
:
this
.
_page
()
break
}
},
allSelect
(
data
)
{
this
.
indexList
=
[]
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
this
.
indexList
.
push
(
data
[
i
].
index
)
}
console
.
log
(
'索引'
,
this
.
indexList
)
},
_open
(
id
,
name
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
dateList
=
[]
this
.
showModal
=
true
this
.
formObj
.
entrustId
=
id
// 委托id
this
.
formObj
.
receiveLocation
=
name
// 委托id
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
_page
()
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilSample
.
pageLocationSample
(
this
.
formObj
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
_deleteOk
(
ids
)
}
})
},
_deleteById
(
id
)
{
// 删除一条记录
this
.
_deleteByIds
([
id
])
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
,
'确定删除 '
+
ids
.
length
+
' 条记录?'
)
}
},
_deleteOk
:
async
function
(
ids
)
{
const
result
=
await
soilSample
.
removeSampleFromLocation
({
ids
:
ids
.
join
(
','
)
})
if
(
result
)
{
this
.
$Message
.
success
(
'成功移除'
)
this
.
_page
()
}
// const result = await drugCatalogueItem.deleteById(id)
},
// 添加编辑模拟样品
_search
()
{
this
.
_page
()
},
_resultChange
(
msg
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
}
}
}
</
script
>
router/soil-routes.js
View file @
d025b3d8
...
@@ -10,6 +10,7 @@ import ReceiveSampleIndex from '../pages/soil-alone-sample/EntrustIndex'
...
@@ -10,6 +10,7 @@ import ReceiveSampleIndex from '../pages/soil-alone-sample/EntrustIndex'
import
InstockIndex
from
'../pages/soil-alone-sample-instock/EntrustIndex'
import
InstockIndex
from
'../pages/soil-alone-sample-instock/EntrustIndex'
import
OutstockIndex
from
'../pages/soil-alone-sample-manage/soil-alone-sample-outstock/EntrustIndex'
import
OutstockIndex
from
'../pages/soil-alone-sample-manage/soil-alone-sample-outstock/EntrustIndex'
import
StorehousePlace
from
'../pages/soil-alone-sample-manage/storehouse-place-manage/AddressManage'
import
StorehousePlace
from
'../pages/soil-alone-sample-manage/storehouse-place-manage/AddressManage'
import
StorehouseSample
from
'../pages/soil-alone-sample-manage/storehouse-sample-manage/AddressManage'
import
ReviewEntrust
from
'../pages/meter-entrust/entrust-review/ReviewEntrust'
import
ReviewEntrust
from
'../pages/meter-entrust/entrust-review/ReviewEntrust'
import
SampleReceiveIndex
from
'../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import
SampleReceiveIndex
from
'../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import
SamplePreparationIndex
from
'../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
import
SamplePreparationIndex
from
'../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
...
@@ -72,6 +73,11 @@ export default [
...
@@ -72,6 +73,11 @@ export default [
path
:
'storehouse_place'
,
path
:
'storehouse_place'
,
component
:
StorehousePlace
,
component
:
StorehousePlace
,
meta
:
{
title
:
'库房位置管理'
}
meta
:
{
title
:
'库房位置管理'
}
},
{
path
:
'storehouse_sample'
,
component
:
StorehouseSample
,
meta
:
{
title
:
'库房样品管理'
}
}
}
]
]
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment