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
96a6b329
Commit
96a6b329
authored
Oct 23, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了检测依据管理查看附件
parent
9075c453
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
449 additions
and
13 deletions
+449
-13
StanardFileManage.vue
pages/meter-aptitude/standard-manage/StanardFileManage.vue
+431
-0
StandardManage.vue
pages/meter-aptitude/standard-manage/StandardManage.vue
+17
-12
EntrustRegisterEdit.vue
pages/meter-entrust/entrust-register/EntrustRegisterEdit.vue
+1
-1
No files found.
pages/meter-aptitude/standard-manage/StanardFileManage.vue
0 → 100644
View file @
96a6b329
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"900"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"search-sample-company"
v-show=
"searchOpen"
:label-width=
"90"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
label=
"文件名称:"
class=
"search-item"
>
<Input
v-model=
"formObj.name"
@
on-enter=
"_formSearch"
placeholder=
"请输入检测项目"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
@
on-result-change=
"_btnClick"
class=
"contHide"
show-search-btn=
"true"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-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>
</PTVXETable>
</Col>
</Row>
</div>
<div
slot=
"footer"
>
<modal-footer
ref=
"footerModal"
:footer=
"footerList"
@
on-result-change=
"_footerResult"
/>
</div>
</Modal>
</div>
</template>
<
script
>
import
{
soilEntrust
}
from
'../../../api'
export
default
{
components
:
{},
data
()
{
return
{
formId
:
'SampleItemManage'
,
currentComponent
:
''
,
btn
:
[],
iconMsg
:
[
{
type
:
'pt-a-end'
,
id
:
''
,
name
:
'预览'
},
{
type
:
'pt-a-end'
,
id
:
''
,
name
:
'下载'
},
{
type
:
'pt-a-end'
,
id
:
''
,
name
:
'删除'
}
],
sampleId
:
''
,
// 样品id
entrustId
:
''
,
showModal
:
false
,
modalTitle
:
'查看附件'
,
selectIds
:
[],
itemId
:
''
,
index
:
''
,
showOption
:
true
,
searchOpen
:
true
,
selectData
:
{},
getPage
:
{},
currentRow
:
''
,
currentIndex
:
''
,
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'关闭'
,
type
:
'primary'
}
],
pageColumns
:
[
{
title
:
'文件名'
,
key
:
'fileName'
},
{
title
:
'类型'
,
key
:
'type'
,
width
:
120
},
{
title
:
'上传时间'
,
key
:
'ctime'
,
width
:
140
,
date
:
true
}
],
dateList
:
[],
formObj
:
{
name
:
undefined
}
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tableModal'
)
}
},
methods
:
{
_selectjudgeBasis
(
id
,
index
)
{
console
.
log
(
id
)
this
.
itemId
=
id
this
.
index
=
index
this
.
$refs
.
EditModal
.
_open
()
},
_footerResult
(
name
)
{
switch
(
name
)
{
case
'取消'
:
this
.
_cancel
()
break
case
'关闭'
:
this
.
_cancel
()
break
}
},
_cancel
()
{
this
.
$emit
(
'on-result-change'
)
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
$refs
.
footerModal
.
_hideLoading
()
this
.
showModal
=
false
},
_ok
()
{
console
.
log
(
this
.
getPage
.
records
)
},
_modalResult
(
data1
,
data2
)
{
switch
(
this
.
currentComponent
)
{
case
'CopyModal'
:
if
(
data1
===
0
)
{
this
.
_copySample
(
data2
)
}
else
{
this
.
_copyAll
(
data2
)
}
break
default
:
this
.
_search
()
}
},
_handleRow
(
data
)
{
this
.
currentRow
=
data
.
row
this
.
currentIndex
=
data
.
rowIndex
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'导入检测项目包'
:
this
.
_importItemPackage
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
_iconClick
(
res
,
data
,
componentName
,
index
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
case
'编辑'
:
this
.
_editModal
(
true
,
data
)
break
case
'复制'
:
this
.
_copy
(
data
)
break
case
'删除'
:
console
.
log
(
index
)
this
.
_deleteById
(
data
.
id
)
break
case
'导出样品委托协议'
:
this
.
_exportAgreement
(
data
.
id
)
break
case
'附件'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
'sampleId'
)
break
}
})
},
_exportAgreement
(
id
)
{
this
.
$store
.
dispatch
(
'ReportExport/getById'
,
'food-contract-company-export-sample-agreement'
)
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
ReportExport
.
model
)
{
if
(
this
.
$store
.
state
.
ReportExport
.
model
.
indexOf
(
'?'
)
!==
-
1
)
{
window
.
open
(
this
.
$store
.
state
.
ReportExport
.
model
+
'&sampleId='
+
id
,
'_blank'
)
}
else
{
window
.
open
(
this
.
$store
.
state
.
ReportExport
.
model
+
'?sampleId='
+
id
,
'_blank'
)
}
}
})
},
_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 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case
'page'
:
this
.
_page
()
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_open
(
id
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
dateList
=
[]
this
.
showModal
=
true
this
.
sampleId
=
id
// 委托id
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
_page
()
},
_openByEntrustId
(
id
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
dateList
=
[]
this
.
showModal
=
true
this
.
entrustId
=
id
// 委托id
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
_pageByEntrustId
()
},
_openRecord
(
id
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
dateList
=
[]
this
.
showModal
=
true
this
.
sampleId
=
id
// 委托id
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
showOption
=
false
this
.
_page
()
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_pageByEntrustId
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
=
this
.
$serializeForm
(
this
.
formObj
)
this
.
formObj
.
entrustId
=
this
.
entrustId
const
result
=
await
soilEntrust
.
pageItemByEntrustId
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
console
.
log
(
result
)
}
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
=
this
.
$serializeForm
(
this
.
formObj
)
this
.
formObj
.
sampleId
=
this
.
sampleId
const
result
=
await
soilEntrust
.
pageItem
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
console
.
log
(
result
)
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
_deleteOk
(
ids
)
}
})
},
_deleteOk
:
async
function
(
ids
)
{
const
result
=
await
soilEntrust
.
deleteById
(
ids
)
if
(
result
)
{
this
.
_resultChange
(
'删除成功! '
)
}
},
_deleteById
(
id
)
{
// 删除一条记录
this
.
_deleteByIds
([
id
])
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
,
'确定删除 '
+
ids
.
length
+
' 条记录?'
)
}
},
_detailModal
(
data
)
{},
_editModal
(
edit
,
data
)
{
if
(
edit
)
{
console
.
log
(
data
)
this
.
$refs
.
sampleManageEdit
.
_open
(
data
)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
}
else
{
// 添加
this
.
$refs
.
refModal
.
_open
(
''
,
this
.
sampleId
)
}
},
// 添加编辑模拟样品
_editImitateModal
(
edit
,
data
)
{
if
(
edit
)
{
// 模拟样品的编辑
const
tempData
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
// 深拷贝
this
.
$refs
.
imitateModal
.
_open
(
tempData
,
this
.
sampleId
)
}
else
{
// 模拟样品的添加
this
.
$refs
.
imitateModal
.
_open
(
''
,
this
.
sampleId
)
}
},
_search
()
{
this
.
_page
()
},
_resultChange
(
msg
)
{
this
.
_page
()
this
.
$Message
.
success
(
msg
)
this
.
$emit
(
'on-result-change'
)
},
_copy
(
data
)
{
this
.
$refs
.
copyModal
.
_open
(
data
.
id
,
data
.
type
)
},
// 复制样品
_copySample
(
data
)
{
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
FoodSample
.
companyModel
if
(
data
.
type
===
0
)
{
// 普通样品
this
.
currentComponent
=
'FoodSampleCompanyEdit'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopySample
(
result
)
})
}
else
if
(
data
.
type
===
3
)
{
// 模拟样品
this
.
$refs
.
imitateModal
.
_openCopySample
(
result
)
}
})
},
_copyAll
(
data
)
{
this
.
$store
.
dispatch
(
'FoodSample/getByCompanyId'
,
data
.
sampleId
)
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
FoodSample
.
companyModel
if
(
data
.
type
===
0
)
{
// 普通样品
this
.
currentComponent
=
'FoodSampleCompanyEdit'
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopyAll
(
result
)
})
}
else
if
(
data
.
type
===
3
)
{
// 模拟样品
this
.
$refs
.
imitateModal
.
_openCopyAll
(
result
)
}
})
},
// 导入样品
_importSample
()
{
const
data
=
{
importUrl
:
'/food/v1/sample/company/import_'
+
this
.
sampleId
,
downloadUrl
:
'/food/v1/excel/template/FoodSampleCompany'
,
title
:
'导入'
}
this
.
$refs
.
refModal
.
_open
(
data
)
},
// 导入检测项目
_importItem
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
,
this
.
selectData
[
0
],
this
.
selectData
)
}
},
// 导入检测项目包
_importItemPackage
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
,
'sample-rel-package-item'
)
}
},
_copyHisItem
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
)
}
},
_operationRecord
(
id
)
{
// 操作日志
this
.
$refs
.
recordModal
.
_open
(
id
)
}
}
}
</
script
>
pages/meter-aptitude/standard-manage/StandardManage.vue
View file @
96a6b329
...
...
@@ -85,10 +85,10 @@
<DownloadTemplateImport
ref=
"importModal"
@
on-result-change=
"_page"
></DownloadTemplateImport>
<SubstitutionalRelation
ref=
"relationModal"
@
on-result-change=
"_page"
></SubstitutionalRelation>
<UploadModal
ref=
"uploadModal"
@
on-result-change=
"_page"
></UploadModal>
<StanardFileManage
ref=
"FileManage"
></StanardFileManage>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
</div>
</template>
<
script
>
import
http
from
'../../../api/http'
import
{
soilAptitude
}
from
'../../../api'
...
...
@@ -97,13 +97,14 @@ import DownloadTemplateImport from '../../../components/import/DownloadTemplateI
import
StandardsManageEdit
from
'./StandardsManageEdit'
// 添加、编辑
import
SubstitutionalRelation
from
'./SubstitutionalRelation'
// 查看替代关系
import
UploadModal
from
'./UploadFileModal'
// 上传文件
import
StanardFileManage
from
'./StanardFileManage'
export
default
{
components
:
{
StandardsManageEdit
,
DownloadTemplateImport
,
SubstitutionalRelation
,
UploadModal
UploadModal
,
StanardFileManage
},
data
()
{
return
{
...
...
@@ -126,7 +127,8 @@ export default {
// 表格
pageColumns
:
[
{
title
:
'检测依据'
,
key
:
'code'
},
{
title
:
'检测依据名称'
,
key
:
'name'
}
{
title
:
'检测依据名称'
,
key
:
'name'
},
{
title
:
'附件是否已上传'
,
key
:
'uploaded'
}
// { title: '标准状态', key: 'status', width: 120 },
// { title: '标准分类', key: 'classify' },
// { title: '标准类型', key: 'type' },
...
...
@@ -153,8 +155,11 @@ export default {
id
:
''
,
name
:
'上传'
},
{
type
:
'ios-download'
,
id
:
''
,
name
:
'下载'
},
{
type
:
'ios-book'
,
id
:
''
,
name
:
'预览'
},
{
type
:
'ios-cloud'
,
id
:
''
,
name
:
'查看附件'
},
{
type
:
'md-remove-circle'
,
id
:
''
,
name
:
'删除'
}
],
searchOpen
:
false
,
...
...
@@ -232,11 +237,8 @@ export default {
case
'上传'
:
this
.
_upload
(
data
.
id
)
break
case
'下载'
:
this
.
_download
(
data
)
break
case
'预览'
:
this
.
_viewReport
(
data
)
case
'查看附件'
:
this
.
_fileManage
(
data
.
id
)
break
case
'查看替代关系'
:
this
.
$refs
.
relationModal
.
_open
(
data
.
id
)
...
...
@@ -247,6 +249,9 @@ export default {
}
})
},
_fileManage
(
id
)
{
this
.
$refs
.
FileManage
.
_openByEntrustId
(
id
)
},
_upload
(
id
)
{
const
obj
=
{
importUrl
:
'/soil/v1/standard_annex/upload/'
+
id
...
...
@@ -384,7 +389,7 @@ export default {
title
:
'提示'
,
content
:
'确定要下载文件?'
,
onOk
:
()
=>
{
if
(
!
data
.
fileUrl
)
{
if
(
data
.
uploaded
!==
'是'
)
{
this
.
$Message
.
error
(
'附件未上传,请上传附件!'
)
return
}
...
...
pages/meter-entrust/entrust-register/EntrustRegisterEdit.vue
View file @
96a6b329
...
...
@@ -126,7 +126,7 @@ import { meterEntrust, meterSample, soilEntrust } from '../../../api'
import
importModal
from
'../../../components/import/DownloadTemplateImport'
import
AutoComplete
from
'../../../components/base/AutoCompletes'
import
SampleItemSelect
from
'../../meter-aptitude/standard-manage/SampleItemSelect'
import
assignPerson
from
'../../../components/user-info-single/
a
ssignPerson'
import
assignPerson
from
'../../../components/user-info-single/
A
ssignPerson'
import
Global
from
'../../../api/config'
export
default
{
components
:
{
...
...
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