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
cd54af58
Commit
cd54af58
authored
Jun 14, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了证书编制生成按钮
parent
84aa257c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
421 additions
and
15 deletions
+421
-15
meter-sample.js
api/meter/meter-sample.js
+3
-0
CreateReport.vue
pages/meter-certificate/make/CreateReport.vue
+204
-0
ElementTable.vue
pages/meter-certificate/make/ElementTable.vue
+104
-0
MeterCertificateMake.vue
pages/meter-certificate/make/MeterCertificateMake.vue
+29
-15
ReportTemplate.vue
pages/meter-certificate/make/ReportTemplate.vue
+80
-0
common.js
plugins/common.js
+1
-0
No files found.
api/meter/meter-sample.js
View file @
cd54af58
...
...
@@ -8,6 +8,9 @@ import { https } from '../https'
export
default
{
// page
page
:
data
=>
http
.
post
(
'meter/v1/sample/page'
,
data
).
then
(
res
=>
res
),
// 报告模板
pageReport
:
data
=>
http
.
post
(
'/base/v1/file_template/page'
,
data
).
then
(
res
=>
res
),
// 车辆管理
pageCarManage
:
data
=>
http
.
post
(
'/res/v1/car_info/page_car_manage'
,
data
).
then
(
res
=>
res
),
...
...
pages/meter-certificate/make/CreateReport.vue
0 → 100644
View file @
cd54af58
<
template
>
<div>
<Modal
v-model=
"showBatchModal"
:mask-closable=
"false"
width=
"900"
>
<p
slot=
"header"
>
批量生成报告
</p>
<div>
<!--内容-->
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<Alert
type=
"warning"
show-icon
>
所选样品都将使用选择的模板生成报告
</Alert>
<Row>
<!--样品信息-->
<Col
span=
"24"
style=
"margin-bottom: 10px"
>
<el-table
:data=
"tableData"
:default-sort=
"
{prop: 'date', order: 'descending'}"
stripe
border
size="small"
highlight-current-row
height="350"
style="width: 100%">
<el-table-column
prop=
"name"
label=
"样品名称"
sortable
></el-table-column>
<el-table-column
prop=
"code"
label=
"样品编号"
sortable
></el-table-column>
<el-table-column
prop=
"reportSn"
label=
"报告编号"
sortable
>
<template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.reportSn"
placeholder=
"留白则自动生成"
size=
"small"
></el-input>
</
template
>
</el-table-column>
</el-table>
</Col>
<!--报告模板-->
<Col
span=
"24"
>
<ReportTemplate
ref=
"reportTemplate"
@
on-result-change=
"_templateResultChange"
></ReportTemplate>
</Col>
</Row>
</div>
</div>
</div>
<div
slot=
"footer"
>
<ModalFooter
ref=
"footerModal"
:footer=
"footerBtn"
@
on-result-change=
"_footerResult"
></ModalFooter>
</div>
</Modal>
<Modal
v-model=
"showIssueModal"
>
<p
slot=
"header"
>
请选择签发日期
</p>
签发日期:
<DatePicker
:editable=
"false"
v-model=
"issueDateTemp"
@
on-change=
'_issueChange'
placeholder=
"请选择签发日期"
style=
"width:400px"
>
</DatePicker>
<div
slot=
"footer"
class=
"btn-width"
>
<Button
@
click=
"_issueCancel"
>
取消
</Button>
<Button
@
click=
"_issueOk"
:loading=
"isLoading"
type=
"primary"
>
确定
</Button>
</div>
</Modal>
<!--生成报告的进度条-->
<!-- <ProgressByReport ref="progressModal" @on-result-change="_closeResult"/>-->
</div>
</template>
<
script
>
import
ModalFooter
from
'../../../components/base/modalFooter'
import
ReportTemplate
from
'./ReportTemplate'
// import ProgressByReport from '../../ProgressByReport'
/**
* 样品列表--生成报告或者选择模板生成报告
*/
export
default
{
components
:
{
ModalFooter
,
ReportTemplate
// ProgressByReport
},
data
()
{
return
{
selectIds
:
[],
showBatchModal
:
false
,
isLoading
:
false
,
footerBtn
:
[
{
type
:
''
,
id
:
''
,
name
:
'取消'
},
{
type
:
'primary'
,
id
:
''
,
name
:
'确定'
}
],
reportModelId
:
''
,
// 样品数据
tableData
:
[],
// 签发日期
issueDateTemp
:
''
,
issueDate
:
''
,
showIssueModal
:
false
}
},
methods
:
{
_open
(
data
)
{
this
.
tableData
=
data
this
.
showBatchModal
=
true
this
.
_reportTemplate
()
this
.
reportModelId
=
''
this
.
isLoading
=
false
},
// 报告模板
_reportTemplate
()
{
this
.
$refs
.
reportTemplate
.
_open
()
},
_footerResult
(
name
)
{
switch
(
name
)
{
case
'确定'
:
this
.
_creatReport
()
break
case
'取消'
:
this
.
showBatchModal
=
false
break
}
},
_templateResultChange
(
selectData
)
{
this
.
reportModelId
=
selectData
.
id
},
_issueChange
(
data
)
{
if
(
data
)
{
this
.
issueDate
=
data
}
},
_hideLoading
()
{
this
.
$refs
.
footerModal
.
_hideLoading
()
},
_creatReport
()
{
if
(
this
.
reportModelId
===
''
)
{
this
.
$Message
.
warning
(
'请选择报告模板!'
)
this
.
_hideLoading
()
}
else
{
console
.
log
(
this
.
tableData
)
console
.
log
(
this
.
reportModelId
)
// 判断字典中是否配置报告编制日期
// 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 = ''
// this._hideLoading()
// } else {
// // 配置为no不弹出
// this.showIssueModal = false
// this.issueDate = ''
// this._createOk()
// }
// })
}
},
_issueCancel
()
{
this
.
showIssueModal
=
false
},
// 选择时间ok
_issueOk
()
{
this
.
isLoading
=
true
this
.
showIssueModal
=
false
this
.
_createOk
()
},
// 生成报告
_createOk
()
{
const
obj
=
[]
for
(
let
i
=
0
;
i
<
this
.
tableData
.
length
;
i
++
)
{
obj
.
push
({
sampleId
:
this
.
tableData
[
i
].
id
,
reportSn
:
this
.
tableData
[
i
].
reportSn
,
issueDate
:
this
.
issueDate
})
}
const
validateObj
=
{
sampleReports
:
obj
,
reportModelId
:
this
.
reportModelId
}
// 先进行验证
this
.
$store
.
dispatch
(
'FoodSampleReport/createReportValidate'
,
validateObj
)
.
then
(()
=>
{
if
(
this
.
$store
.
state
.
FoodSampleReport
.
success
)
{
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const
currentTime
=
new
Date
().
getTime
()
this
.
$refs
.
progressModal
.
_open
(
this
.
tableData
.
length
,
currentTime
)
validateObj
.
seriesNo
=
currentTime
this
.
$store
.
dispatch
(
'FoodSampleReport/createReport'
,
validateObj
)
.
then
(()
=>
{})
this
.
_hideLoading
()
this
.
isLoading
=
false
}
else
{
this
.
_hideLoading
()
this
.
isLoading
=
false
}
})
},
_closeResult
()
{
this
.
showBatchModal
=
false
this
.
$emit
(
'on-result-change'
)
}
}
}
</
script
>
pages/meter-certificate/make/ElementTable.vue
0 → 100644
View file @
cd54af58
<
template
>
<div>
<el-table
ref=
"moveTable"
:data=
"getPage.records"
:height=
"300"
:default-sort=
"
{prop: 'date', order: 'descending'}"
v-loading="loading"
@row-click="_rowClickChange"
stripe
border
size="small"
highlight-current-row
style="width: 100%">
<el-table-column
label=
""
width=
"60"
>
<template
slot-scope=
"scope"
>
<div
style=
"text-align: center !important;margin-right: -10px"
>
<el-radio
:label=
"scope.row.id"
v-model=
"templateRadio"
@
change
.
native=
"_getTemplateRow(scope.row)"
>
</el-radio>
</div>
</
template
>
</el-table-column>
<slot></slot>
</el-table>
<Page
:total=
"getPage.total"
:page-size=
"getPage.size"
:current=
"getPage.current"
@
on-change=
"_pageChange"
@
on-page-size-change=
'_pageSizeChange'
:page-size-opts=
"pageSizeOpts"
:show-elevator=
"hideElevator===undefined"
:show-total=
"hideTotal===undefined"
:show-sizer=
"hideSizer===undefined"
placement=
"top"
style=
"margin-top: 10px;"
></Page>
</div>
</template>
<
script
>
export
default
{
name
:
'PageTable'
,
props
:
{
pageColumns
:
null
,
// tableHeight: 300,
hideCheckbox
:
null
,
optColWidth
:
null
,
getPage
:
null
,
iconMsg
:
null
,
warnKey
:
null
,
selectData
:
null
,
hideElevator
:
null
,
hideTotal
:
null
,
hideSizer
:
null
},
data
()
{
return
{
formId
:
''
,
// 表单id
loading
:
false
,
isRowClick
:
false
,
pageParams
:
{
rows
:
20
},
extendsData
:
{},
// 扩展数据,数据传不过来使用
rowData
:
{},
pageSizeOpts
:
this
.
$pageSizeOpt
,
templateRadio
:
''
}
},
methods
:
{
_getTemplateRow
(
row
)
{
this
.
$emit
(
'on-result-change'
,
'radioSelect'
,
row
)
},
_searchParams
()
{
const
data
=
this
.
$serialize
(
this
.
formId
)
Object
.
assign
(
data
,
this
.
extendsData
)
return
this
.
$extend
(
data
,
this
.
pageParams
)
},
_page
(
formId
,
uri
,
extendsData
)
{
this
.
loading
=
true
this
.
formId
=
formId
this
.
templateRadio
=
''
if
(
extendsData
)
{
this
.
extendsData
=
extendsData
}
this
.
$store
.
dispatch
(
uri
,
this
.
_searchParams
()).
then
(()
=>
{
this
.
loading
=
false
this
.
$emit
(
'on-result-change'
,
'page'
,
''
)
})
},
_pageChange
(
page
)
{
this
.
pageParams
.
page
=
page
this
.
_pageParamsChange
()
},
_pageSizeChange
(
rows
)
{
if
(
rows
!==
this
.
pageParams
.
rows
)
{
this
.
pageParams
.
rows
=
rows
this
.
_pageParamsChange
()
}
},
_pageParamsChange
()
{
this
.
$emit
(
'on-result-change'
)
},
// 点击单元格触发
_rowClickChange
(
row
)
{
this
.
templateRadio
=
row
.
id
this
.
$emit
(
'on-result-change'
,
'radioSelect'
,
row
)
}
}
}
</
script
>
pages/meter-certificate/make/MeterCertificateMake.vue
View file @
cd54af58
...
...
@@ -28,7 +28,7 @@
<!--表格-->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:loading=
"true"
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
>
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
select-data
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
...
...
@@ -45,12 +45,14 @@
</Row>
</div>
</div>
<CreateReport
ref=
"CreateReport"
></CreateReport>
</div>
</template>
<
script
>
import
{
meterSample
}
from
'../../../api'
import
CreateReport
from
'./CreateReport'
export
default
{
components
:
{},
components
:
{
CreateReport
},
data
()
{
return
{
currentComponent
:
''
,
...
...
@@ -60,17 +62,7 @@ export default {
{
type
:
'success'
,
id
:
''
,
name
:
'仪器领用'
},
{
type
:
'success'
,
id
:
''
,
name
:
'车辆管理'
},
{
type
:
'success'
,
id
:
''
,
name
:
'提交'
name
:
'生成'
}
],
iconMsg
:
[
...
...
@@ -102,6 +94,7 @@ export default {
aptitude
:
undefined
},
selectIds
:
[],
selectData
:
[],
getPage
:
{},
pageColumns
:
[
{
title
:
'样品名称'
,
key
:
'name'
,
width
:
120
},
...
...
@@ -140,6 +133,9 @@ export default {
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'生成'
:
this
.
_create
()
break
case
'添加'
:
this
.
_editModal
(
false
)
break
...
...
@@ -172,6 +168,15 @@ export default {
})
}
},
_create
()
{
const
selectData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectData
))
console
.
log
(
selectData
)
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
$refs
.
CreateReport
.
_open
(
this
.
selectData
)
}
},
_iconClick
(
res
,
data
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
...
...
@@ -206,9 +211,18 @@ export default {
switch
(
msg
)
{
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
console
.
log
(
'操作按钮点击后的值'
,
data
)
break
case
'selectIds'
:
this
.
selectIds
=
data
// case 'selectIds':
// this.selectIds = data
// console.log('操作按钮点击后的值', data)
// break
case
'selectData'
:
this
.
selectData
=
data
this
.
selectIds
=
[]
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
this
.
selectIds
.
push
(
data
[
i
].
id
)
}
break
case
'changeSize'
:
this
.
_page
()
...
...
pages/meter-certificate/make/ReportTemplate.vue
0 → 100644
View file @
cd54af58
<
template
>
<div>
<ElementTable
ref=
"pageTable"
:pageColumns=
"pageColumns"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
>
<el-table-column
:prop=
"item.key"
:label=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
v-for=
"item in pageColumns"
:key=
"item.key"
sortable
show-overflow-tooltip
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</el-table-column>
</ElementTable>
</div>
</template>
<
script
>
// import global from '../../../api/config'
import
{
meterSample
}
from
'../../../api'
import
ElementTable
from
'./ElementTable'
export
default
{
components
:
{
ElementTable
},
data
()
{
return
{
tableHeight
:
'400'
,
pageColumns
:
[{
title
:
'报告模板名称'
,
key
:
'name'
}],
getPage
:
{},
modalTitle
:
'报告模板'
,
tempId
:
''
,
formObj
:
{
// classifyName: '食品报告模板',
// service: 'meter',
// rows: 20
}
}
},
methods
:
{
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
SysFileTemplate
.
page
if
(
this
.
tempId
)
{
this
.
$refs
.
pageTable
.
templateRadio
=
this
.
tempId
this
.
$emit
(
'on-result-change'
,
{
id
:
this
.
tempId
})
}
break
case
'radioSelect'
:
this
.
$emit
(
'on-result-change'
,
data
)
break
default
:
this
.
_page
()
}
},
_open
(
tempId
)
{
this
.
tempId
=
tempId
||
''
this
.
_page
()
},
_page
:
async
function
()
{
// this.$refs.pageTable._page(
// 'report-template-list',
// 'SysFileTemplate/page',
// {
// classifyName: '食品报告模板',
// service: global.getCode()
// }
// )
const
result
=
await
meterSample
.
pageReport
(
this
.
formObj
)
console
.
log
(
'模板结果'
,
result
)
if
(
result
)
{
this
.
getPage
=
result
}
}
}
}
</
script
>
plugins/common.js
View file @
cd54af58
...
...
@@ -63,6 +63,7 @@ Vue.prototype.$getLastDay = function(year, month) {
/**
*table默认展示切换list
*/
Vue
.
prototype
.
$pageSizeOpt
=
[
20
,
50
,
100
,
200
]
Vue
.
prototype
.
$pageSizeOpts
=
function
()
{
return
[
50
,
100
,
200
,
300
,
500
]
}
...
...
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