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
5edd0b93
Commit
5edd0b93
authored
Oct 20, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了报告编制
parent
9b664f66
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1146 additions
and
1 deletions
+1146
-1
ItemView.vue
pages/soil-report-manage/report-make/ItemView.vue
+627
-0
OriginalRecordEdit.vue
pages/soil-report-manage/report-make/OriginalRecordEdit.vue
+139
-0
OriginalRecordView.vue
pages/soil-report-manage/report-make/OriginalRecordView.vue
+374
-0
ReportMakeByEntrust.vue
...il-report-manage/report-make/tabs/ReportMakeByEntrust.vue
+6
-1
No files found.
pages/soil-report-manage/report-make/ItemView.vue
0 → 100644
View file @
5edd0b93
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"1200"
>
<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
label=
"检测依据:"
class=
"search-item"
>
<Input
v-model=
"formObj.code"
@
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
: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"
@
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.detail"
>
<a
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a>
</div>
<div
v-else-if=
"item.key==='epibolyItem'"
@
click
.
stop=
"_handleRow(scope)"
>
<el-select
v-if=
"showOption"
v-model=
"scope.row.epibolyItem"
@
change=
"_optionChange(scope.row)"
placeholder=
"请选择"
>
<el-option
v-for=
"(item,index) in subOptions"
:key=
"index"
:label=
"item.label"
:value=
"index"
/>
</el-select>
<span
v-if=
"!showOption"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</span>
</div>
<div
v-else-if=
"item.key==='status'"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</div>
<div
v-else-if=
"item.judged"
>
{{
scope
.
row
[
item
.
key
]
===
0
?
'否'
:
'是'
}}
</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==='code'"
@
click
.
stop=
"_handleRow(scope)"
>
<el-input
v-model=
"scope.row.code"
@
blur=
"_codeEdit(
{id:scope.row.id, obj :{code:scope.row.code}})"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i
@
click
.
stop=
"_selectjudgeBasis(scope.row.id,scope.$index)"
style=
"cursor: pointer;font-size: 14px;"
class=
"icons iconfont pt-search icon-search"
></i>
</div>
<div
v-else-if=
"item.key==='compareSymbol'"
@
click
.
stop=
"_handleRow(scope)"
>
<el-input
v-model=
"scope.row.compareSymbol"
@
blur=
"_compareSymbolEdit(
{id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
blur
placeholder="请输入比较符"
/>
</div>
<div
v-else-if=
"item.key==='limitValue'"
@
click
.
stop=
"_handleRow(scope)"
>
<el-input
v-model=
"scope.row.limitValue"
@
blur=
"_limitValueEdit(
{id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
blur
placeholder="请输入限值"
/>
</div>
<div
v-else-if=
"item.key==='unit'"
@
click
.
stop=
"_handleRow(scope)"
>
<el-input
v-model=
"scope.row.unit"
@
blur=
"_unitEdit(
{id:scope.row.id, obj :{unit:scope.row.unit}})"
blur
placeholder="请输入单位"
/>
</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
http
from
'../../../api/http'
import
{
soilEntrust
,
soilTest
}
from
'../../../api'
export
default
{
components
:
{},
data
()
{
return
{
formId
:
'SampleItemManage'
,
currentComponent
:
''
,
iconMsg
:
[{
type
:
'pt-a-end'
,
id
:
''
,
name
:
'删除'
}],
sampleId
:
''
,
// 样品id
showModal
:
false
,
modalTitle
:
'管理检测项目'
,
selectIds
:
[],
itemId
:
''
,
recordId
:
''
,
index
:
''
,
showOption
:
true
,
searchOpen
:
true
,
selectData
:
{},
getPage
:
{},
currentRow
:
''
,
currentIndex
:
''
,
footerList
:
[
{
id
:
''
,
name
:
'取消'
,
type
:
''
},
{
id
:
''
,
name
:
'关闭'
,
type
:
'primary'
}
],
pageColumns
:
[
{
title
:
'试验名称'
,
key
:
'name'
,
width
:
160
},
{
title
:
'试验项目英文简写'
,
key
:
'shortName'
,
width
:
140
},
{
title
:
'大类'
,
key
:
'mainType'
,
width
:
140
},
{
title
:
'小类'
,
key
:
'smallType'
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
180
},
{
title
:
'试验方法'
,
key
:
'testMethod'
,
width
:
180
},
{
title
:
'状态'
,
key
:
'status'
,
width
:
180
}
],
subOptions
:
[
{
value
:
'0'
,
label
:
'否'
},
{
value
:
'1'
,
label
:
'是'
}
],
dateList
:
[],
formObj
:
{
name
:
undefined
,
recordId
:
undefined
,
code
:
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
()
},
_optionChange
(
data
)
{
console
.
log
(
data
)
if
(
data
.
epibolyItem
===
1
)
{
this
.
_submit
(
data
.
id
)
}
else
{
this
.
_cancelSub
(
data
.
id
)
}
},
_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
},
_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
.
_submitOutPack
()
break
case
'取消分包'
:
this
.
_cancelOutPack
()
break
case
'添加'
:
this
.
_editModal
(
false
)
break
case
'复制历史样品'
:
this
.
_copyHisSample
()
break
case
'导入样品'
:
this
.
_importSample
()
break
case
'导入检测项目'
:
this
.
_importItem
()
break
case
'导入检测项目包'
:
this
.
_importItemPackage
()
break
case
'复制历史样品检测项目'
:
this
.
_copyHisItem
()
break
case
'删除'
:
this
.
_deleteSelected
()
break
case
'导出'
:
this
.
_exportSample
()
break
case
'添加模拟样品'
:
this
.
_editImitateModal
(
false
)
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
_backData
(
data
)
{
this
.
getPage
.
records
[
this
.
index
].
code
=
data
.
code
this
.
_codeEdit
({
id
:
this
.
itemId
,
obj
:
{
code
:
data
.
code
}
})
},
_codeEdit
:
async
function
(
data
)
{
const
result
=
await
soilEntrust
.
pageItemEdit
(
data
)
if
(
result
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
_page
()
}
else
{
this
.
$message
.
warning
(
'保存失败'
)
}
},
_compareSymbolEdit
:
async
function
(
data
)
{
const
result
=
await
soilEntrust
.
pageItemEdit
(
data
)
if
(
result
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
_page
()
}
else
{
this
.
$message
.
warning
(
'保存失败'
)
}
},
_limitValueEdit
:
async
function
(
data
)
{
const
result
=
await
soilEntrust
.
pageItemEdit
(
data
)
if
(
result
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
_page
()
}
else
{
this
.
$message
.
warning
(
'保存失败'
)
}
},
_unitEdit
:
async
function
(
data
)
{
const
result
=
await
soilEntrust
.
pageItemEdit
(
data
)
if
(
result
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
_page
()
}
else
{
this
.
$message
.
warning
(
'保存失败'
)
}
},
_submitOutPack
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定分包这'
+
this
.
selectIds
.
length
+
'条'
,
onOk
:
()
=>
{
this
.
_submit
()
}
})
}
},
_cancelOutPack
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定取消这'
+
this
.
selectIds
.
length
+
'条分包'
,
onOk
:
()
=>
{
this
.
_cancelSub
()
}
})
}
},
_submit
:
async
function
(
data
)
{
if
(
data
!==
undefined
)
{
this
.
selectIds
=
data
}
const
result
=
await
soilEntrust
.
submitOutPack
(
this
.
selectIds
)
if
(
result
)
{
this
.
_resultChange
(
'分包成功'
)
}
},
_cancelSub
:
async
function
(
data
)
{
if
(
data
!==
undefined
)
{
this
.
selectIds
=
data
}
const
result
=
await
soilEntrust
.
cancelOutPack
(
this
.
selectIds
)
if
(
result
)
{
this
.
_resultChange
(
'取消分包成功'
)
}
},
_exportSample
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条样品'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定导出这'
+
this
.
selectIds
.
length
+
'条样品'
,
onOk
:
()
=>
{
http
.
open
(
'/food/v1/sample/company/export'
,
{
ids
:
this
.
selectIds
.
join
(
','
)
},
'_blank'
)
}
})
}
},
_copyHisSample
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
sampleId
)
},
_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
.
recordId
=
id
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
_page
()
},
_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
)
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
this
.
formObj
=
this
.
$serializeForm
(
this
.
formObj
)
this
.
formObj
.
recordId
=
this
.
recordId
const
result
=
await
soilTest
.
pageOriginalExp
(
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/soil-report-manage/report-make/OriginalRecordEdit.vue
0 → 100644
View file @
5edd0b93
<
template
>
<div>
<!--
<Modal
v-model=
"showModal"
title=
"原始记录"
:mask-closable=
"false"
width=
"1300"
class=
"modal-footer-none"
>
-->
<!--
<div
style=
"text-align:center;align-content:center;width: 100%;height: 790px"
v-html=
"htmlContent"
>
-->
<!--
</div>
-->
<!--
</Modal>
-->
</div>
</
template
>
<
script
>
import
Global
from
'../../../api/config'
import
{
soilTest
}
from
'../../../api'
/**
* 编辑原始记录详情
*/
export
default
{
data
()
{
return
{
// showModal: false,
again
:
false
,
formId
:
''
,
htmlContent
:
''
,
formIdTemp
:
''
}
},
created
()
{
// 监听原始记录消息
// eslint-disable-next-line nuxt/no-globals-in-created
window
.
addEventListener
(
'message'
,
this
.
_saveOriginal
)
},
// 销毁监听事件
beforeDestroy
()
{
this
.
again
=
false
window
.
removeEventListener
(
'message'
,
this
.
_saveOriginal
)
},
methods
:
{
_open
(
formId
)
{
this
.
formId
=
formId
this
.
formIdTemp
=
formId
+
this
.
$randomCode
()
this
.
again
=
true
// this.showModal = true;
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const
bindUri
=
Global
.
baseURL
+
'/env/v1/env_item/original_record_data_bind?source='
const
url
=
Global
.
recordURL
+
'/print/v1/eln/form_YT_'
+
formId
+
'?bindUri='
+
encodeURIComponent
(
bindUri
)
// this.htmlContent = '
<
iframe
style
=
"padding: 0px;width:100%;height:100%"
frameborder
=
"0"
src
=
' + encodeURI(url) + '
><
/iframe>'
;
this
.
$layx
(
this
.
formIdTemp
,
'编辑原始记录'
,
url
)
},
_openWithType
(
formId
,
fromType
)
{
this
.
formId
=
formId
this
.
formIdTemp
=
formId
+
this
.
$randomCode
()
this
.
again
=
true
// this.showModal = true;
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const
bindUri
=
Global
.
baseURL
+
'/env/v1/env_item/original_record_data_bind?source='
const
url
=
Global
.
recordURL
+
'/print/v1/eln/form_YT_'
+
formId
+
'?bindUri='
+
encodeURIComponent
(
bindUri
)
+
'&type='
+
fromType
// this.htmlContent = '
<
iframe
style
=
"padding: 0px;width:100%;height:100%"
frameborder
=
"0"
src
=
' + encodeURI(url) + '
><
/iframe>'
;
this
.
$layx
(
this
.
formIdTemp
,
'编辑原始记录'
,
url
)
},
_saveOriginal
(
data
)
{
console
.
log
(
'修改的数据'
,
data
)
if
(
this
.
again
)
{
if
(
data
.
data
.
msg
===
true
)
{
this
.
_editSaveRecord
(
data
)
}
else
{
this
.
_cancel
()
}
this
.
again
=
false
}
},
_cancel
()
{
// this.showModal = false;
// 关闭所有layx弹框
// eslint-disable-next-line no-undef
layx
.
destroyAll
(
this
.
formIdTemp
)
},
_updateRecord
:
async
function
(
param
)
{
const
result
=
await
soilTest
.
updateItem
(
param
)
console
.
log
(
result
)
if
(
result
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
_cancel
()
this
.
$emit
(
'on-result-change'
)
}
},
// 保存后解析项目的检测值
_editSaveRecord
(
data
)
{
const
param
=
{
formId
:
this
.
formId
}
console
.
log
(
'data'
,
data
)
const
copyMapTemp
=
{}
if
(
data
.
data
.
copySheet
&&
data
.
data
.
copyedSheet
)
{
param
.
copyMap
=
{}
const
copyedKey
=
String
(
data
.
data
.
copyedSheet
)
copyMapTemp
[
copyedKey
]
=
''
copyMapTemp
[
copyedKey
]
=
String
(
data
.
data
.
copySheet
)
// 存在复制sheet的情况
param
.
copyMap
=
JSON
.
stringify
(
copyMapTemp
)
}
else
if
(
typeof
data
.
data
.
testValueArry
!==
'undefined'
)
{
const
testValue
=
data
.
data
.
testValueArry
param
.
copyMap
=
{}
testValue
.
forEach
(
item
=>
{
const
copyedKey
=
String
(
item
.
copyedSheet
)
copyMapTemp
[
copyedKey
]
=
''
copyMapTemp
[
copyedKey
]
=
String
(
item
.
copySheet
)
param
.
copyMap
=
JSON
.
stringify
(
copyMapTemp
)
})
}
this
.
_updateRecord
(
param
)
// this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('保存成功')
// // this.showModal = false;
// this.$emit('on-result-change')
// this._cancel()
// }
// })
}
}
}
</
script
>
pages/soil-report-manage/report-make/OriginalRecordView.vue
0 → 100644
View file @
5edd0b93
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"1200"
class=
"zIndex-900 modal-footer-none"
>
<div
slot=
"header"
><p>
查看原始记录
</p></div>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
:label-width=
"80"
v-show=
"searchOpen"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"模板名称:"
>
<Input
v-model=
"formObj.templateTitle"
@
on-enter=
"_formSearch"
placeholder=
"请输入模板名称"
clearable
></Input>
</Form-item>
<Form-item
class=
"search-item"
label=
"委托单位:"
>
<Input
v-model=
"formObj.cusNames"
@
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
: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"
:icon-msg=
"iconMsg"
:getPage=
"getPage"
>
<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.dateTime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM'
):
''
}}
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
<!-- <template slot="col">-->
<!-- <vxe-table-column-->
<!-- :width="190"-->
<!-- title="操作"-->
<!-- align="center"-->
<!-- fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <VXEIconList :msg="(scope.row.hasInputItem===1) ? iconMsg : iconMsgDisable"-->
<!-- @on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>-->
<!-- </template>-->
<!-- </vxe-table-column>-->
<!-- </template>-->
</PTVXETable>
</Col>
</Row>
</Modal>
<ItemOriginalRecordEdit
ref=
"recordEditModal"
></ItemOriginalRecordEdit>
<ItemView
ref=
"itemViewModal"
></ItemView>
</div>
</template>
<
script
>
/**
* 原始记录查看
*/
import
Global
from
'../../../api/config'
import
{
soilTest
}
from
'../../../api'
import
ItemOriginalRecordEdit
from
'./OriginalRecordEdit'
import
ItemView
from
'./ItemView'
export
default
{
components
:
{
ItemOriginalRecordEdit
,
ItemView
},
data
()
{
return
{
currentComponent
:
''
,
getPage
:
{},
showModal
:
false
,
btn
:
[
{
type
:
''
,
id
:
''
,
name
:
'纠正填写时间'
,
componentName
:
'EditDateModal'
},
{
type
:
''
,
id
:
''
,
name
:
'设置填写人乙'
},
{
type
:
'error'
,
id
:
''
,
name
:
'删除'
}
],
selectIds
:
[],
iconMsg
:
[
{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
},
{
type
:
'ios-book'
,
id
:
''
,
name
:
'查看原始记录'
},
{
type
:
'ios-list'
,
id
:
''
,
name
:
'查看试验项目'
}
// {
// type: 'erlenmeyer-flask',
// id: '',
// name: '查看样品',
// componentName: 'SampleView'
// },
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除' },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
],
iconMsgDisable
:
[
{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
,
disabled
:
true
},
{
type
:
''
,
id
:
''
,
name
:
'查看原始记录'
,
componentName
:
'OriginalItemView'
},
{
type
:
'ios-list'
,
id
:
''
,
name
:
'查看试验项目'
}
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除', disabled: true },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
],
pageColumns
:
[
{
title
:
'模板名称'
,
key
:
'title'
},
{
title
:
'委托编号'
,
key
:
'entrustCode'
},
{
title
:
'填写人'
,
key
:
'uname'
},
{
title
:
'创建时间'
,
key
:
'ctime'
,
dateTime
:
true
}
],
formObj
:
{
entrustId
:
''
,
batchNos
:
''
,
sampleNums
:
''
,
templateTitle
:
''
,
fillInTimeBegin
:
''
,
fillInTimeEnd
:
''
,
cusNames
:
''
,
codes
:
''
,
itemNames
:
''
,
testAccordings
:
''
},
searchOpen
:
false
}
},
computed
:
{
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
''
,
340
)
}
else
{
return
this
.
$tableHeight
(
'tabNoSearch'
)
}
}
},
mounted
()
{
this
.
_page
()
},
methods
:
{
_componentResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'EditDateModal'
:
this
.
_updateDate
(
data
)
break
default
:
this
.
_page
()
}
},
_updateDate
(
date
)
{
this
.
$store
.
dispatch
(
'PrintForm/updateTimeBatch'
,
{
ids
:
this
.
selectIds
.
join
(
','
),
fillInTime
:
date
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
PrintForm
.
success
)
{
this
.
_page
()
this
.
$Message
.
success
(
'更新成功!'
)
}
})
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'纠正填写时间'
:
this
.
_editWriteTime
()
break
case
'设置填写人乙'
:
this
.
_setAnotherTester
()
break
case
'删除'
:
this
.
_batchDelete
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
// 设置填写人乙
_setAnotherTester
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$msgTip
(
'warning'
)
}
else
{
this
.
$refs
.
testerModal
.
_open
(
this
.
selectIds
)
}
},
_editWriteTime
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
'填写时间'
)
}
},
_dateChange
(
data
)
{
this
.
formObj
.
fillInTimeBegin
=
data
[
0
]
this
.
formObj
.
fillInTimeEnd
=
data
[
1
]
},
_iconClick
(
res
,
data
,
currentComponent
)
{
this
.
currentComponent
=
currentComponent
this
.
$nextTick
(()
=>
{
switch
(
res
)
{
case
'编辑'
:
this
.
$refs
.
recordEditModal
.
_openWithType
(
data
.
originalRecordId
,
'ENVTESTMAKEEDIT'
)
break
case
'查看原始记录'
:
this
.
_recordView
(
data
.
originalRecordId
)
break
case
'查看试验项目'
:
this
.
_itemView
(
data
.
id
)
break
case
'查看检测项目'
:
this
.
$refs
.
refModal
.
_open
(
data
)
break
case
'查看样品'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
)
break
case
'附件'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
'originalId'
)
break
case
'删除'
:
this
.
_deleteByIds
([
data
.
id
])
break
case
'操作记录'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
)
break
}
})
},
// 查看试验项目
_itemView
(
id
)
{
this
.
$refs
.
itemViewModal
.
_open
(
id
)
},
// 查看原始记录
_recordView
(
originalRecordId
)
{
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
// eslint-disable-next-line no-undef
layx
.
iframe
(
'labRecordWriteOriView'
,
'原始记录预览'
,
Global
.
recordURL
+
'/print/v1/form/'
+
originalRecordId
+
'?type=ENVTESTMAKE'
,
{
event
:
{
onload
:
{
after
:
function
(
layxWindow
,
winform
)
{
// eslint-disable-next-line no-undef
layx
.
max
(
winform
.
id
)
}
}
}
}
)
},
_open
(
entrustId
)
{
this
.
showModal
=
true
this
.
formObj
.
entrustId
=
entrustId
this
.
_page
()
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
EnvItem
.
page
break
case
'selectIds'
:
this
.
selectIds
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilTest
.
recordPage
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
// 批量删除原始记录
_batchDelete
()
{
if
(
this
.
selectIds
.
length
>
0
)
{
const
content
=
'确定删除这'
+
this
.
selectIds
.
length
+
'条数据?'
this
.
_deleteByIds
(
this
.
selectIds
,
content
)
}
else
{
this
.
$msgTip
(
'warning'
)
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
$store
.
dispatch
(
'EnvItem/deleteOriRecord'
,
ids
).
then
(()
=>
{
if
(
this
.
$store
.
state
.
EnvItem
.
success
)
{
this
.
_page
()
this
.
$Message
.
success
(
'删除成功!'
)
}
})
}
})
}
}
}
</
script
>
pages/soil-report-manage/report-make/tabs/ReportMakeByEntrust.vue
View file @
5edd0b93
...
@@ -81,14 +81,16 @@
...
@@ -81,14 +81,16 @@
<SampleByMakeModal
ref=
"sampleByMakeModal"
></SampleByMakeModal>
<SampleByMakeModal
ref=
"sampleByMakeModal"
></SampleByMakeModal>
<Operation
ref=
"operation"
></Operation>
<Operation
ref=
"operation"
></Operation>
<FileManage
ref=
"FileManage"
></FileManage>
<FileManage
ref=
"FileManage"
></FileManage>
<OriginalRecordView
ref=
"originalRecordView"
></OriginalRecordView>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
soilStatistics
}
from
'../../../../api'
import
{
soilStatistics
}
from
'../../../../api'
import
SampleByMakeModal
from
'../SampleByMakeModal'
import
SampleByMakeModal
from
'../SampleByMakeModal'
import
Operation
from
'../../../../components/operation/Operation'
import
Operation
from
'../../../../components/operation/Operation'
import
OriginalRecordView
from
'../OriginalRecordView'
export
default
{
export
default
{
components
:
{
SampleByMakeModal
,
Operation
},
components
:
{
SampleByMakeModal
,
Operation
,
OriginalRecordView
},
data
()
{
data
()
{
return
{
return
{
typeList
:
[{
name
:
'企业'
,
value
:
0
},
{
name
:
'政府'
,
value
:
1
}],
typeList
:
[{
name
:
'企业'
,
value
:
0
},
{
name
:
'政府'
,
value
:
1
}],
...
@@ -217,6 +219,9 @@ export default {
...
@@ -217,6 +219,9 @@ export default {
this
.
personal
this
.
personal
)
)
break
break
case
'查看原始记录'
:
this
.
$refs
.
originalRecordView
.
_open
(
data
.
id
)
break
case
'检测项目'
:
case
'检测项目'
:
this
.
$refs
.
refModal
.
_open
(
data
)
this
.
$refs
.
refModal
.
_open
(
data
)
break
break
...
...
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