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
44da5294
Commit
44da5294
authored
Dec 30, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了查看样品和报告
parent
f6af2692
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
694 additions
and
10 deletions
+694
-10
soil-report.js
api/soil/soil-report.js
+2
-1
soil-test.js
api/soil/soil-test.js
+2
-1
SampleByMakeModal.vue
pages/soil-report-manage/report-make/SampleByMakeModal.vue
+19
-8
SummaryInfo.vue
pages/soil-report-manage/report-make/tabs/SummaryInfo.vue
+671
-0
No files found.
api/soil/soil-report.js
View file @
44da5294
...
@@ -23,5 +23,6 @@ export default {
...
@@ -23,5 +23,6 @@ export default {
originalRecordGetById
:
data
=>
originalRecordGetById
:
data
=>
http
.
get
(
'soil/v1/original_record/'
+
data
).
then
(
res
=>
res
),
http
.
get
(
'soil/v1/original_record/'
+
data
).
then
(
res
=>
res
),
expReportGetById
:
data
=>
expReportGetById
:
data
=>
http
.
get
(
'soil/v1/exp_report/'
+
data
).
then
(
res
=>
res
)
http
.
get
(
'soil/v1/exp_report/'
+
data
).
then
(
res
=>
res
),
reportGetById
:
data
=>
http
.
get
(
'soil/v1/report/'
+
data
).
then
(
res
=>
res
)
}
}
api/soil/soil-test.js
View file @
44da5294
...
@@ -159,5 +159,6 @@ export default {
...
@@ -159,5 +159,6 @@ export default {
pageExperimentReport
:
data
=>
pageExperimentReport
:
data
=>
http
.
post
(
'soil/v1/exp_report/page'
,
data
).
then
(
res
=>
res
),
http
.
post
(
'soil/v1/exp_report/page'
,
data
).
then
(
res
=>
res
),
deleteReport
:
data
=>
deleteReport
:
data
=>
http
.
delete
(
'soil/v1/exp_report/?ids='
+
data
).
then
(
res
=>
res
)
http
.
delete
(
'soil/v1/exp_report/?ids='
+
data
).
then
(
res
=>
res
),
reportPage
:
data
=>
http
.
post
(
'soil/v1/report/page'
,
data
).
then
(
res
=>
res
)
}
}
pages/soil-report-manage/report-make/SampleByMakeModal.vue
View file @
44da5294
...
@@ -6,7 +6,10 @@
...
@@ -6,7 +6,10 @@
<div>
<div>
<el-tabs
v-model=
"activeName"
@
tab-click=
"_changeTabs"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"_changeTabs"
>
<el-tab-pane
label=
"样品台账"
name=
"sample"
>
<el-tab-pane
label=
"样品台账"
name=
"sample"
>
<ReportMakeBySample
ref=
"sampleTabs"
@
on-result-change=
"_sampleTabResult"
></ReportMakeBySample>
<ReportMakeBySample
ref=
"sampleTabs"
></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane
label=
"汇总报告台账"
name=
"summary"
>
<SummaryInfo
ref=
"summaryTabs"
></SummaryInfo>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"试验项目报告台账"
name=
"report"
>
<el-tab-pane
label=
"试验项目报告台账"
name=
"report"
>
<ReportInfoMake
ref=
"reportTabs"
></ReportInfoMake>
<ReportInfoMake
ref=
"reportTabs"
></ReportInfoMake>
...
@@ -19,11 +22,13 @@
...
@@ -19,11 +22,13 @@
<
script
>
<
script
>
import
ReportInfoMake
from
'./tabs/ReportInfoMake'
import
ReportInfoMake
from
'./tabs/ReportInfoMake'
import
ReportMakeBySample
from
'./tabs/ReportMakeBySample'
import
ReportMakeBySample
from
'./tabs/ReportMakeBySample'
import
SummaryInfo
from
'./tabs/SummaryInfo'
export
default
{
export
default
{
components
:
{
components
:
{
ReportMakeBySample
,
ReportMakeBySample
,
ReportInfoMake
ReportInfoMake
,
SummaryInfo
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -93,6 +98,9 @@ export default {
...
@@ -93,6 +98,9 @@ export default {
console
.
log
(
this
.
entrustId
)
console
.
log
(
this
.
entrustId
)
this
.
$refs
.
sampleTabs
.
_open
(
this
.
entrustId
)
this
.
$refs
.
sampleTabs
.
_open
(
this
.
entrustId
)
},
},
_summary
()
{
this
.
$refs
.
summaryTabs
.
_open
(
this
.
entrustId
)
},
_changeTabs
(
tab
,
event
)
{
_changeTabs
(
tab
,
event
)
{
switch
(
tab
.
name
)
{
switch
(
tab
.
name
)
{
case
'sample'
:
case
'sample'
:
...
@@ -101,14 +109,17 @@ export default {
...
@@ -101,14 +109,17 @@ export default {
case
'report'
:
case
'report'
:
this
.
_report
()
this
.
_report
()
break
break
}
case
'summary'
:
},
this
.
_summary
()
_sampleTabResult
(
msg
)
{
break
if
(
msg
===
'changeTab'
)
{
this
.
activeName
=
'report'
this
.
$refs
.
reportTabs
.
_open
(
this
.
contractId
,
this
.
personal
)
}
}
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
}
}
</
script
>
</
script
>
pages/soil-report-manage/report-make/tabs/SummaryInfo.vue
0 → 100644
View file @
44da5294
<
template
>
<div>
<!--内容-->
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<Row>
<!--查询-->
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
:iconMsg=
"iconMsg"
:tableName=
"tableName"
select-data
is-report
>
<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 (userColumns.length>0?userColumns: pageColumns)"
:key=
"item.key"
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-if=
"item.dateTime"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd HH:MM:ss'
):
''
}}
</div>
<div
v-else-if=
"item.judge"
>
{{
Number
(
scope
.
row
[
item
.
key
])
===
1
?
'是'
:
'否'
}}
</div>
<div
v-else-if=
"item.notOkCount"
>
<span
v-if=
"scope.row[item.key] === 0"
class=
"blue-color"
>
合格
</span>
<span
v-else
class=
"red-color"
>
不合格
</span>
</div>
<div
v-else-if=
"item.key==='progress'"
>
{{
scope
.
row
[
item
.
key
].
display
}}
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
<
template
slot=
"setting"
>
<VXESettingCol
:pageColumns=
"pageColumns"
:userColumns=
"userColumns"
@
on-result-change=
"_resetColumn"
:table-name=
"tableName"
></VXESettingCol>
</
template
>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<Modal
v-model=
"showIssueModal"
@
on-cancel=
"_issueCancel"
@
on-ok=
"_issueOk"
class=
"zIndex-1100"
>
<p
slot=
"header"
>
请选择签发日期
</p>
签发日期:
<DatePicker
:editable=
"false"
v-model=
"issueDateTemp"
@
on-change=
'_issueChange'
placeholder=
"请选择签发日期"
style=
"width:400px"
>
</DatePicker>
</Modal>
</div>
</template>
<
script
>
import
global
from
'../../../../api/config'
import
http
from
'../../../../api/http'
import
{
soilReport
,
soilTest
}
from
'../../../../api'
import
Global
from
'../../../../api/config'
/**
* 报告编制的-待办-报告台账
*/
export
default
{
components
:
{},
data
()
{
return
{
notOkCountList
:
[
{
value
:
0
,
name
:
'合格'
},
{
value
:
1
,
name
:
'不合格'
}
],
currentComponent
:
''
,
searchOpen
:
false
,
getPage
:
{},
pageColumns
:
[
{
title
:
'创建人'
,
key
:
'uname'
,
width
:
180
,
fixed
:
'left'
},
{
title
:
'创建时间'
,
key
:
'ctime'
,
width
:
180
,
dateTime
:
true
}
],
selectIds
:
[],
selectData
:
[],
formObj
:
{
entrustId
:
''
},
dateList
:
[],
iconMsg
:
[
{
type
:
'ios-book'
,
id
:
''
,
name
:
'预览报告'
}
// {
// type: 'ios-document',
// id: '',
// name: '项目台账',
// componentName: 'ItemModalByReportMake'
// },
// {
// type: 'ios-cloud-upload',
// id: '',
// name: '上传',
// componentName: 'UploadByReport'
// },
// {
// type: 'cloud',
// id: '',
// name: '附件',
// componentName: 'ReportFileManage'
// },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'FoodReportRecord'
// }
],
// 签发日期
issueDateTemp
:
''
,
issueDate
:
''
,
showIssueModal
:
false
,
reportId
:
''
,
tempId
:
''
,
reportType
:
'FOOD_REPORT_MAKE'
,
// 批量还是单个生成报告
reportBatch
:
false
,
reportBatchData
:
{},
dataPushedList
:
[{
value
:
0
,
name
:
'否'
},
{
value
:
1
,
name
:
'是'
}],
userColumns
:
[],
tableName
:
'food-report-make-report-info-by-contract'
,
reportStatus
:
'FLOW_REPORT_MAKE'
}
},
computed
:
{
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
'tabSearchTwo'
)
}
else
{
return
this
.
$tableHeight
(
'tabNoSearch'
)
}
}
},
mounted
()
{},
methods
:
{
// 重置column
_resetColumn
(
colList
)
{
this
.
userColumns
=
colList
this
.
$refs
.
pageTable
.
_loadColumn
(
colList
)
},
// 盖章
_toPDF
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
)
}
},
_reportDateChange
(
data
)
{
this
.
formObj
.
reportDueDateBegin
=
data
[
0
]
this
.
formObj
.
reportDueDateEnd
=
data
[
1
]
},
// 签发日期
_issueChange
(
data
)
{
if
(
data
)
{
this
.
issueDate
=
data
}
},
_modalResult
(
data
)
{
switch
(
this
.
currentComponent
)
{
case
'Reason'
:
this
.
_overdueReason
(
data
)
break
case
'ReportTemplateModal'
:
this
.
_regenerate
(
data
)
break
case
'AssignPerson'
:
this
.
_auditorResult
(
data
)
break
default
:
this
.
_page
()
}
},
_iconClick
(
res
,
data
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
case
'上传'
:
this
.
_upload
(
data
.
id
)
break
case
'重新生成'
:
this
.
$refs
.
refModal
.
_open
(
data
)
break
case
'预览报告'
:
this
.
_reportView
(
data
)
// this._viewReport(data)
break
case
'操作记录'
:
this
.
_record
(
data
.
id
)
break
case
'项目台账'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
)
break
case
'历史版本'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
this
.
reportType
)
break
case
'附件'
:
this
.
$refs
.
refModal
.
_open
(
data
.
id
,
'reportId'
)
break
case
'档案查看'
:
this
.
reportViewFiles
(
data
,
{
location
:
'report'
,
archivesType
:
'reportManage'
})
break
}
})
},
_upload
(
id
)
{
this
.
$refs
.
refModal
.
_open
(
id
)
},
_reportView
(
data
)
{
if
(
data
.
objectKey
)
{
this
.
_reportMakeLook
(
data
)
}
else
{
this
.
_recordView
(
data
.
originalRecordId
)
}
},
_reportMakeLook
:
async
function
(
data
)
{
console
.
log
(
data
)
const
result
=
await
soilReport
.
reportGetById
(
data
.
id
)
// this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
if
(
result
)
{
console
.
log
(
'result'
)
this
.
_viewReport
(
result
)
}
},
_viewReport
(
data
)
{
if
(
data
)
{
this
.
$openWindowModeless
({
objectKey
:
data
.
objectKey
,
idType
:
11
,
id
:
data
.
id
,
isReport
:
4
})
}
},
_recordView
(
originalRecordId
)
{
let
recordUrl
=
''
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
recordUrl
=
'http://record.patzn.com'
}
else
{
recordUrl
=
Global
.
recordURL
}
// eslint-disable-next-line no-undef
layx
.
iframe
(
'labRecordWriteOriView'
,
'原始记录预览'
,
recordUrl
+
'/print/v1/form/'
+
originalRecordId
+
'?type=ENVTESTMAKE'
,
{
event
:
{
onload
:
{
after
:
function
(
layxWindow
,
winform
)
{
// eslint-disable-next-line no-undef
layx
.
max
(
winform
.
id
)
}
}
}
}
)
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
selectIds
=
[]
this
.
reportBatch
=
false
this
.
reportBatchData
=
{}
this
.
getPage
=
this
.
$store
.
state
.
FoodSampleReport
.
page
break
case
'selectData'
:
this
.
selectData
=
data
this
.
selectIds
=
[]
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
this
.
selectIds
.
push
(
data
[
i
].
id
)
}
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
break
case
'table-col'
:
console
.
log
(
'table-col'
,
data
)
this
.
userColumns
=
data
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_open
(
entrustId
)
{
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
.
entrustId
=
entrustId
this
.
showIssueModal
=
false
this
.
_page
()
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilTest
.
reportPage
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_record
(
id
)
{
// 操作记录
this
.
$refs
.
refModal
.
_open
(
id
)
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'提交'
:
this
.
_submit
(
'submit'
)
break
case
'提交至报告签发'
:
this
.
_submit
(
'submit-to-issue'
)
break
case
'下载'
:
this
.
_downloadBatch
()
break
case
'删除'
:
this
.
_deleteSelected
()
break
case
'记录报告超期原因'
:
this
.
_batchOverdueReason
()
break
case
'修改报告资质要求'
:
this
.
_editReportAptitude
()
break
case
'选择审核人'
:
this
.
_selectAuditor
()
break
case
'重新生成'
:
if
(
this
.
selectData
.
length
>
0
)
{
this
.
$refs
.
refModal
.
_open
({
reportBatch
:
true
,
id
:
''
,
tempId
:
this
.
selectData
[
0
].
tempId
})
}
else
{
this
.
$msgTip
(
'warning'
)
}
break
case
'推送至国抽平台'
:
this
.
_selectToGc
()
break
case
'完成'
:
this
.
_achieveReport
()
break
case
'盖章'
:
this
.
_toPDF
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
})
},
// 完成报告
_achieveReport
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$msgTip
(
'warning'
,
'请至少选择一条数据!'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定完成这'
+
this
.
selectIds
.
length
+
'个报告?'
,
loading
:
true
,
onOk
:
()
=>
{
this
.
$store
.
dispatch
(
'FoodSampleReport/submitMakeToEnd'
,
{
reportIds
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
this
.
$msgTip
(
'success'
,
'提交成功'
)
this
.
_page
()
}
this
.
$Modal
.
remove
()
})
}
})
}
},
// 推送至国抽
_selectToGc
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确认提交这'
+
this
.
selectIds
.
length
+
'条数据至国抽平台?'
,
loading
:
true
,
onOk
:
()
=>
{
this
.
_submitToGc
()
}
})
}
},
_submitToGc
()
{
// 提交之前进行验证
this
.
$store
.
dispatch
(
'FoodSampleReport/submitMakeCheck'
,
{
ids
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
this
.
$store
.
dispatch
(
'FoodSample/pushDataToGcReport'
,
{
ids
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSample
.
success
)
{
this
.
$msgTip
(
'success'
,
'提交成功'
)
this
.
_page
()
}
this
.
$Modal
.
remove
()
})
}
})
},
// 选择审核人
_selectAuditor
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
'auditor'
,
'选择审核人'
)
}
},
_auditorResult
(
data
)
{
const
tempData
=
{
auditorId
:
data
.
userId
,
auditor
:
data
.
realname
,
ids
:
this
.
selectIds
.
join
(
','
)
}
this
.
$layxLoading
()
// 提交之前进行验证
this
.
$store
.
dispatch
(
'FoodSampleReport/submitMakeCheck'
,
{
ids
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
this
.
$store
.
dispatch
(
'FoodSampleReport/submitMakeToAuditor'
,
tempData
)
.
then
(()
=>
{
this
.
_resultChange
(
'提交成功'
)
})
}
else
{
this
.
$layxLoading
(
false
)
}
})
},
_editReportAptitude
()
{
this
.
$refs
.
refModal
.
_open
(
this
.
formObj
.
contractId
)
},
_batchOverdueReason
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
'超期原因'
)
}
},
_overdueReason
(
reason
)
{
this
.
$layxLoading
()
this
.
$store
.
dispatch
(
'FoodReportSummary/addReason'
,
{
ids
:
this
.
selectIds
.
join
(
','
),
reason
:
reason
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodReportSummary
.
success
)
{
this
.
$Message
.
success
(
'操作成功!'
)
this
.
_page
()
}
this
.
$layxLoading
(
false
)
})
},
_resultChange
(
msg
)
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
this
.
$Message
.
success
(
msg
)
this
.
_page
()
}
this
.
$Modal
.
remove
()
this
.
$layxLoading
(
false
)
},
// 重新生成报告ok(多个)
_regenerateBatch
()
{
const
validateObj
=
{
ids
:
this
.
selectIds
.
join
(
','
),
issueDate
:
this
.
issueDate
,
reportModelId
:
this
.
reportBatchData
.
tempId
}
// 先进行验证
this
.
$store
.
dispatch
(
'FoodSampleReport/generateAgainBatchCheck'
,
validateObj
)
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const
currentTime
=
new
Date
().
getTime
()
// true --- 建立连接
this
.
currentComponent
=
'ProgressByRegenerateReport'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
.
length
,
currentTime
)
})
validateObj
.
seriesNo
=
currentTime
this
.
$store
.
dispatch
(
'FoodSampleReport/generateAgainBatch'
,
validateObj
)
.
then
(()
=>
{})
}
})
},
// 重新生成报告(单个、批量)
_regenerate
(
data
)
{
this
.
reportBatch
=
data
.
reportBatch
this
.
reportBatchData
=
data
if
(
!
data
.
reportBatch
)
{
// 单个生成
this
.
reportId
=
data
.
id
this
.
tempId
=
data
.
tempId
}
// 判断字典中是否配置报告编制日期
this
.
$store
.
dispatch
(
'LmsBaseDict/getItem'
,
'编制时选择签发日期'
)
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
LmsBaseDict
.
item
if
(
result
.
length
!==
0
&&
result
[
0
].
code
===
'yes'
)
{
// 配置为yes弹出
this
.
showIssueModal
=
true
this
.
issueDateTemp
=
''
this
.
issueDate
=
''
}
else
{
// 配置为no不弹出
this
.
showIssueModal
=
false
this
.
issueDate
=
''
this
.
_createOk
()
}
})
},
_issueCancel
()
{
this
.
showIssueModal
=
false
},
// 选择时间ok
_issueOk
()
{
this
.
showIssueModal
=
false
this
.
_createOk
()
},
// 生成报告
_createOk
()
{
if
(
!
this
.
reportBatch
)
{
// 单个生成报告
const
obj
=
{
id
:
this
.
reportId
,
issueDate
:
this
.
issueDate
,
reportModelId
:
this
.
tempId
}
this
.
$store
.
dispatch
(
'FoodSampleReport/generateAgain'
,
obj
).
then
(()
=>
{
this
.
_resultChange
(
'报告重新生成成功'
)
})
}
else
{
// 批量改生成报告
this
.
_regenerateBatch
()
}
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
.
join
(
','
),
'确定删除 '
+
ids
.
length
+
' 条记录?'
)
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
loading
:
true
,
onOk
:
()
=>
{
this
.
$store
.
dispatch
(
'FoodSampleReport/sampleReportDeletes'
,
{
ids
:
ids
})
.
then
(()
=>
{
this
.
_resultChange
(
'删除成功!'
)
})
}
})
},
_downloadBatch
()
{
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定要下载这 '
+
ids
.
length
+
' 个报告?'
,
onOk
:
()
=>
{
const
obj
=
{
ids
:
ids
.
join
(
','
),
contractId
:
this
.
formObj
.
contractId
,
flag
:
0
}
http
.
open
(
global
.
baseURL
+
'/food/v1/sample_report/download_batch_by_sampleIds'
,
obj
,
'_blank'
)
}
})
}
},
_submit
(
msg
)
{
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据'
)
}
else
{
let
url
=
''
let
successMsg
=
''
let
content
=
''
switch
(
msg
)
{
case
'submit'
:
// 提交
url
=
'FoodSampleReport/submitMake'
successMsg
=
'提交成功'
content
=
'确定要提交这 '
+
ids
.
length
+
' 条数据?'
break
case
'submit-to-issue'
:
// 提交至报告签发
url
=
'FoodSampleReport/submitToIssue'
successMsg
=
'成功提交至报告签发'
content
=
'确定要将这 '
+
ids
.
length
+
' 条数据提交至报告签发?'
break
}
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
,
loading
:
true
,
onOk
:
()
=>
{
this
.
$store
.
dispatch
(
'FoodSampleReport/submitMakeCheck'
,
{
ids
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
this
.
$store
.
dispatch
(
url
,
{
ids
:
this
.
selectIds
.
join
(
','
)
})
.
then
(()
=>
{
this
.
_resultChange
(
successMsg
)
})
}
})
}
})
}
}
}
}
</
script
>
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