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
c6b107ee
Commit
c6b107ee
authored
Dec 26, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加汇总表报告模板菜单
parent
4c9397a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
878 additions
and
0 deletions
+878
-0
ConfigTemplate.vue
.../soil-report-manage/soil-summary-sheet/ConfigTemplate.vue
+163
-0
ConfigTemplateEdit.vue
...l-report-manage/soil-summary-sheet/ConfigTemplateEdit.vue
+0
-0
SoilReportEdit.vue
.../soil-report-manage/soil-summary-sheet/SoilReportEdit.vue
+268
-0
SoilReportTemplateEdit.vue
...port-manage/soil-summary-sheet/SoilReportTemplateEdit.vue
+177
-0
SoilSummarySheetTemplate.vue
...rt-manage/soil-summary-sheet/SoilSummarySheetTemplate.vue
+264
-0
soil-routes.js
router/soil-routes.js
+6
-0
No files found.
pages/soil-report-manage/soil-summary-sheet/ConfigTemplate.vue
0 → 100644
View file @
c6b107ee
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"1000"
class=
"modal-footer-none"
>
<div
slot=
"header"
>
{{
modalTitle
}}
</div>
<div>
<Form
id=
"index-right-form"
:label-width=
"80"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"属性名称:"
>
<Input
v-model=
"formObj.attributeName"
@
on-enter=
"_formSearch"
placeholder=
"请输入属性名称"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
style=
"margin-bottom: 10px;"
/>
<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"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"item.key==='defaulted'"
>
{{
scope
.
row
[
item
.
key
]?
'是'
:
'否'
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<ConfigTemplateEdit
ref=
"indexEdit"
@
on-result-change=
"_page"
></ConfigTemplateEdit>
</div>
</template>
<
script
>
import
{
soilAptitude
}
from
'../../../api'
import
ConfigTemplateEdit
from
'./ConfigTemplateEdit'
export
default
{
components
:
{
ConfigTemplateEdit
},
data
()
{
return
{
id
:
''
,
modalTitle
:
''
,
showModal
:
false
,
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'添加配置'
},
{
type
:
'error'
,
id
:
''
,
name
:
'删除'
}
],
tableHeight
:
document
.
documentElement
.
clientHeight
-
180
,
pageColumns
:
[
{
title
:
'属性名称'
,
key
:
'attributeName'
},
{
title
:
'属性'
,
key
:
'dataAttribute'
,
width
:
120
},
{
title
:
'列位置'
,
key
:
'columnPlace'
,
width
:
120
},
{
title
:
'合并开始列'
,
key
:
'mergeBegin'
,
width
:
120
},
{
title
:
'合并结束列'
,
key
:
'mergeEnd'
,
width
:
120
},
{
title
:
'合并行数'
,
key
:
'mergeRowNum'
,
width
:
120
}
],
getPage
:
{},
iconMsg
:
[{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
}],
selectIds
:
[],
formObj
:
{
attributeName
:
undefined
,
templateId
:
undefined
},
// 资质信息
aptitudeItemInfo
:
{}
}
},
methods
:
{
_open
(
data
)
{
console
.
log
(
data
)
this
.
aptitudeItemInfo
=
data
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
this
.
formObj
.
templateId
=
data
.
id
this
.
id
=
data
.
id
this
.
modalTitle
=
data
.
name
+
' 指标管理'
this
.
showModal
=
true
this
.
_page
()
},
_page
:
async
function
()
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilAptitude
.
pageTemplateConfig
(
this
.
formObj
)
if
(
result
)
{
console
.
log
(
result
)
this
.
getPage
=
result
this
.
$refs
.
pageTable
.
_hideLoading
()
}
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
break
case
'selectIds'
:
this
.
selectIds
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
)
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_iconClick
(
res
,
data
)
{
switch
(
res
)
{
case
'编辑'
:
this
.
_editModal
(
true
,
data
)
break
}
},
_editModal
(
edit
,
data
)
{
if
(
edit
)
{
this
.
_getById
(
data
)
}
else
{
this
.
$refs
.
indexEdit
.
_open
(
this
.
id
,
''
)
}
},
_getById
:
async
function
(
data
)
{
const
result
=
await
soilAptitude
.
expReportTemplateConfig
(
data
.
id
)
console
.
log
(
result
)
if
(
result
)
{
this
.
$refs
.
indexEdit
.
_open
(
''
,
result
)
}
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'添加配置'
:
this
.
_editModal
(
false
)
break
case
'删除'
:
this
.
_deleteByIds
()
break
}
},
_deleteByIds
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
// this.$msgTip('warning')
this
.
$message
.
warning
(
'请至少选择一条记录'
)
}
else
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定删除 '
+
this
.
selectIds
.
length
+
' 条记录?'
,
onOk
:
()
=>
{
this
.
_delOk
(
this
.
selectIds
)
}
})
}
},
_delOk
:
async
function
(
ids
)
{
const
result
=
await
soilAptitude
.
deleteReportTemplateConfig
(
ids
)
if
(
result
)
{
this
.
$message
.
success
(
'删除成功'
)
this
.
_page
()
}
}
}
}
</
script
>
pages/soil-report-manage/soil-summary-sheet/ConfigTemplateEdit.vue
0 → 100644
View file @
c6b107ee
This diff is collapsed.
Click to expand it.
pages/soil-report-manage/soil-summary-sheet/SoilReportEdit.vue
0 → 100644
View file @
c6b107ee
<
template
>
<div>
<Modal
v-model=
"showEditModal"
:mask-closable=
"false"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div
v-show=
"isLoad"
>
<Spin
fix
>
<Icon
type=
"load-c"
size=
18
class=
"file-spin-icon-load"
></Icon>
<div>
正在上传,请稍后...
</div>
</Spin>
</div>
<div>
<Form
id=
"edit-form"
ref=
"formObj"
:model=
"formObj"
:rules=
"ruleValidate"
:label-width=
"95"
inline
class=
"inputBox"
>
<Form-item
label=
"类别"
prop=
"classType"
style=
"width: 100%"
>
<el-select
v-model=
"formObj.classType"
placeholder=
"请选择类别"
size=
"small"
clearable
>
<el-option
:label=
"item.value"
:value=
"item.value"
v-for=
"(item,index) in typeList"
:key=
"index"
></el-option>
</el-select>
</Form-item>
<Form-item
label=
"报告模板名称"
prop=
"alias"
style=
"width: 100%"
>
<Input
v-model=
"formObj.alias"
name=
"alias"
placeholder=
"请输入报告模板名称"
></Input>
</Form-item>
<Form-item
label=
"备注"
prop=
"remark"
style=
"width: 100%"
>
<Input
v-model=
"formObj.remark"
name=
"remark"
placeholder=
"请输入备注"
></Input>
</Form-item>
<Form-item
label=
"样品开始行"
prop=
"sampleBeginRow"
class=
"width-48"
>
<el-input
v-model=
"formObj.sampleBeginRow"
@
keydown
.
native=
"channelInputLimit"
name=
"sampleBeginRow"
type=
"number"
onmousewheel=
"return false"
placeholder=
"请输入样品开始行"
/>
</Form-item>
<Form-item
label=
"数据占用行"
prop=
"sampleMergerNum"
class=
"width-48"
>
<el-input
v-model=
"formObj.sampleMergerNum"
@
keydown
.
native=
"channelInputLimit"
name=
"sampleMergerNum"
type=
"number"
onmousewheel=
"return false"
placeholder=
"请输入数据占用行"
/>
</Form-item>
<Form-item
label=
"模板样品数"
prop=
"templateSampleNum"
class=
"width-48"
>
<el-input
v-model=
"formObj.templateSampleNum"
@
keydown
.
native=
"channelInputLimit"
name=
"templateSampleNum"
type=
"number"
onmousewheel=
"return false"
placeholder=
"请输入模板样品数"
/>
</Form-item>
</Form>
</div>
<div
slot=
"footer"
class=
"btn-width clearfix"
>
<Button
@
click=
"_cancel"
style=
"margin-left: 8px;"
>
取消
</Button>
<Button
@
click=
"_ok"
type=
"primary"
style=
"margin-bottom: 0;float: right"
>
保存
</Button>
</div>
</Modal>
</div>
</
template
>
<
script
>
/**
* 添加编辑
*/
import
{
soilAptitude
}
from
'../../../api'
const
defVal
=
{
alias
:
undefined
,
classType
:
undefined
,
dataTotalRow
:
undefined
,
totalColumn
:
undefined
,
remark
:
undefined
,
sampleBeginRow
:
undefined
,
sampleBeginCol
:
undefined
,
sampleMergerNum
:
undefined
,
templateSampleNum
:
undefined
,
classifyId
:
0
}
export
default
{
data
()
{
const
validatesampleBeginRow
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
formObj
.
sampleBeginRow
===
''
)
{
callback
(
new
Error
(
'内容不能为空'
))
}
else
{
callback
()
}
}
const
validatetemplateSampleNum
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
formObj
.
templateSampleNum
===
''
)
{
callback
(
new
Error
(
'内容不能为空'
))
}
else
{
callback
()
}
}
return
{
modalTitle
:
'编辑'
,
formObj
:
defVal
,
ruleValidate
:
{
alias
:
[
{
required
:
true
,
message
:
'模板名称不能为空'
,
trigger
:
'blur'
}
],
sampleBeginRow
:
[
{
required
:
true
,
validator
:
validatesampleBeginRow
,
message
:
'样品开始行不能为空'
,
trigger
:
'blur'
}
],
templateSampleNum
:
[
{
required
:
true
,
validator
:
validatetemplateSampleNum
,
message
:
'模板样品数不能为空'
,
trigger
:
'blur'
}
],
classType
:
[
{
required
:
true
,
message
:
'类别不能为空'
,
trigger
:
'blur'
}
]
},
typeList
:
[
{
value
:
'力学'
},
{
value
:
'物性'
}
],
id
:
''
,
showEditModal
:
false
,
dataObj
:
{
file
:
''
},
pname
:
''
,
action
:
''
,
isLoad
:
false
,
isDisable
:
true
,
format
:
[
'docx'
,
'xlsx'
,
'xls'
]
}
},
methods
:
{
_onKeyUp
()
{
if
(
this
.
formObj
.
alias
===
''
||
this
.
formObj
.
classType
===
''
)
{
this
.
isDisable
=
true
}
else
{
this
.
isDisable
=
false
this
.
action
=
global
.
baseURL
+
'/meter/v1/file_template/upload_template/?classType='
+
this
.
formObj
.
classType
+
'&alias='
+
this
.
formObj
.
alias
+
'&remark='
+
this
.
formObj
.
remark
}
},
channelInputLimit
(
e
)
{
const
key
=
e
.
key
// 不允许输入'e'和'.'
if
(
key
===
'e'
||
key
===
'.'
)
{
e
.
returnValue
=
false
return
false
}
return
true
},
_selectZtree
()
{
// this.$refs.ztreeModal._openZtree()
},
_cancel
()
{
this
.
showEditModal
=
false
},
_ok
()
{
this
.
$refs
.
formObj
.
validate
(
valid
=>
{
console
.
log
(
'valid'
,
valid
)
if
(
valid
)
{
this
.
_editOk
()
}
else
{
this
.
$Message
.
error
(
'请输入必填值'
)
}
})
},
_editOk
:
async
function
()
{
const
result
=
await
soilAptitude
.
expReportTemplateEdit
({
id
:
this
.
id
,
formObj
:
this
.
formObj
})
if
(
result
)
{
this
.
$message
.
success
(
'编辑成功'
)
this
.
showEditModal
=
false
this
.
$emit
(
'on-result-change'
)
}
},
_open
(
data
)
{
console
.
log
(
data
)
this
.
showEditModal
=
true
this
.
isLoad
=
false
this
.
id
=
data
.
id
this
.
formObj
.
alias
=
data
.
alias
this
.
formObj
.
remark
=
data
.
remark
this
.
formObj
.
classType
=
data
.
classType
this
.
formObj
.
sampleBeginRow
=
data
.
sampleBeginRow
this
.
formObj
.
sampleBeginCol
=
data
.
sampleBeginCol
this
.
formObj
.
sampleMergerNum
=
data
.
sampleMergerNum
this
.
formObj
.
templateSampleNum
=
data
.
templateSampleNum
this
.
modalTitle
=
'编辑模板'
console
.
log
(
this
.
id
)
},
_beupload
(
file
)
{
this
.
dataObj
.
file
=
file
.
name
},
_handelprogress
(
event
,
file
,
fileList
)
{
this
.
isLoad
=
true
},
// _handelsuccess(response, file, fileList) {
// // 上传成功
// if (response.success) {
// this.isLoad = false
// this.$Message.success('上传成功!')
// this.$emit('on-result-change')
// this.showEditModal = false
// } else {
// this.isLoad = true
// this.$Message.error(response.msg)
// }
// },
_formatError
(
file
)
{
this
.
$Notice
.
error
({
title
:
'文件格式不正确'
,
duration
:
10
,
desc
:
'文件 '
+
file
.
name
+
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree
(
result
)
{
this
.
pname
=
''
if
(
result
===
undefined
)
{
this
.
formObj
.
classifyId
=
'0'
this
.
pname
=
''
}
else
{
this
.
formObj
.
classifyId
=
result
.
id
this
.
pname
=
result
.
name
}
// 判断必填项是否为空
}
}
}
</
script
>
<
style
scoped
>
.clearfix
:after
{
content
:
''
;
clear
:
both
;
display
:
block
;
}
.inputBox
>>>
input
::-webkit-outer-spin-button
,
input
::-webkit-inner-spin-button
{
-webkit-appearance
:
none
!important
;
}
.inputBox
>>>
input
[
type
=
'number'
]
{
-moz-appearance
:
textfield
!important
;
}
</
style
>
pages/soil-report-manage/soil-summary-sheet/SoilReportTemplateEdit.vue
0 → 100644
View file @
c6b107ee
<
template
>
<div>
<Modal
v-model=
"showEditModal"
:mask-closable=
"false"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div
v-show=
"isLoad"
>
<Spin
fix
>
<Icon
type=
"load-c"
size=
18
class=
"file-spin-icon-load"
></Icon>
<div>
正在上传,请稍后...
</div>
</Spin>
</div>
<div>
<Form
id=
"edit-form"
ref=
"formObj"
:model=
"formObj"
:rules=
"ruleValidate"
:label-width=
"95"
>
<Form-item
label=
"类别"
prop=
"classType"
>
<!--
<Input
v-model=
"formObj.classType"
@
on-keyup=
"_onKeyUp"
name=
"classType"
placeholder=
"请选择类别"
icon=
"plus-circled"
--
>
<!-- >
</Input>
-->
<el-select
v-model=
"formObj.classType"
placeholder=
"请选择类别"
size=
"small"
clearable
>
<el-option
:label=
"item.value"
:value=
"item.value"
v-for=
"(item,index) in typeList"
:key=
"index"
></el-option>
</el-select>
</Form-item>
<Form-item
label=
"报告模板名称"
prop=
"name"
>
<Input
v-model=
"formObj.name"
@
on-keyup=
"_onKeyUp"
name=
"name"
placeholder=
"请输入报告模板名称"
></Input>
</Form-item>
<Form-item
label=
"备注"
prop=
"remark"
>
<Input
v-model=
"formObj.remark"
@
on-keyup=
"_onKeyUp"
name=
"remark"
placeholder=
"请输入备注"
></Input>
</Form-item>
</Form>
</div>
<div
slot=
"footer"
class=
"btn-width clearfix"
>
<Button
@
click=
"_cancel"
style=
"margin-left: 8px;"
>
取消
</Button>
<label
style=
"margin-bottom: 0;float: right"
>
<Upload
:action=
"action"
:on-success=
"_handelsuccess"
:before-upload=
"_beupload"
:on-progress=
"_handelprogress"
:on-format-error=
"_formatError"
:data=
"dataObj"
:with-credentials=
"true"
:show-upload-list=
"false"
:format=
"format"
>
<Button
:disabled=
"isDisable"
type=
"primary"
>
导入文件
</Button>
</Upload>
</label>
</div>
</Modal>
<!--类别弹出树-->
<!--
<LmsTemplateClassifyZTree
ref=
"ztreeModal"
@
on-result-change=
"_ztree"
></LmsTemplateClassifyZTree>
-->
</div>
</
template
>
<
script
>
/**
* 添加编辑
*/
// import LmsTemplateClassifyZTree from '../lms-template-classify/LmsTemplateClassifyZTree.vue'
import
global
from
'../../../api/config'
const
defVal
=
{
name
:
''
,
remark
:
''
,
classType
:
''
,
classifyId
:
0
}
export
default
{
// components: { LmsTemplateClassifyZTree },
data
()
{
return
{
modalTitle
:
'添加'
,
formObj
:
defVal
,
ruleValidate
:
{
name
:
[{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}],
classType
:
[
{
required
:
true
,
message
:
'类别不能为空'
,
trigger
:
'blur'
}
]
},
typeList
:
[
{
value
:
'力学'
},
{
value
:
'物性'
}
],
showEditModal
:
false
,
dataObj
:
{
file
:
''
},
pname
:
''
,
action
:
''
,
isLoad
:
false
,
isDisable
:
true
,
format
:
[
'docx'
,
'xlsx'
,
'xls'
]
}
},
methods
:
{
_onKeyUp
()
{
if
(
this
.
formObj
.
name
===
''
||
this
.
formObj
.
classType
===
''
)
{
this
.
isDisable
=
true
}
else
{
this
.
isDisable
=
false
this
.
action
=
global
.
baseURL
+
'/soil/v1/exp_report_template/upload_template/?name='
+
this
.
formObj
.
name
+
'&remark='
+
this
.
formObj
.
remark
+
'&classType='
+
this
.
formObj
.
classType
}
},
_selectZtree
()
{
// this.$refs.ztreeModal._openZtree()
},
_cancel
()
{
this
.
showEditModal
=
false
},
_open
()
{
this
.
showEditModal
=
true
this
.
isLoad
=
false
this
.
formObj
.
name
=
''
this
.
formObj
.
alias
=
''
this
.
formObj
.
remark
=
''
this
.
formObj
.
classType
=
''
this
.
modalTitle
=
'添加模板'
},
_beupload
(
file
)
{
this
.
dataObj
.
file
=
file
.
name
},
_handelprogress
(
event
,
file
,
fileList
)
{
this
.
isLoad
=
true
},
_handelsuccess
(
response
,
file
,
fileList
)
{
// 上传成功
if
(
response
.
success
)
{
this
.
isLoad
=
false
this
.
$Message
.
success
(
'上传成功!'
)
this
.
$emit
(
'on-result-change'
)
this
.
showEditModal
=
false
}
else
{
this
.
isLoad
=
true
this
.
$Message
.
error
(
response
.
msg
)
}
},
_formatError
(
file
)
{
this
.
$Notice
.
error
({
title
:
'文件格式不正确'
,
duration
:
10
,
desc
:
'文件 '
+
file
.
name
+
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree
(
result
)
{
this
.
pname
=
''
if
(
result
===
undefined
)
{
this
.
formObj
.
classifyId
=
'0'
this
.
pname
=
''
}
else
{
this
.
formObj
.
classifyId
=
result
.
id
this
.
pname
=
result
.
name
}
// 判断必填项是否为空
this
.
_onKeyUp
()
}
}
}
</
script
>
<
style
scoped
>
.clearfix
:after
{
content
:
''
;
clear
:
both
;
display
:
block
;
}
</
style
>
pages/soil-report-manage/soil-summary-sheet/SoilSummarySheetTemplate.vue
0 → 100644
View file @
c6b107ee
<
template
>
<div>
<!--内容-->
<div
class=
"layout-content-padding marginLeft-10"
>
<div
class=
"layout-content-main tree-position"
>
<div
class=
"position-right"
>
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"search-form"
v-show=
"searchOpen"
:label-width=
"80"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"模板名称:"
>
<Input
v-model=
"formObj.alias"
@
on-enter=
"_formSearch"
name=
"alias"
placeholder=
"请输入模板名称"
clearable
></Input>
<input
type=
"hidden"
name=
"classifyId"
>
</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"
:show-search-btn=
"true"
@
on-result-change=
"_btnClick"
></btn-list>
</Col>
<!-- 表格 -->
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:page-columns=
"pageColumns"
:get-page=
"getPage"
:opt-col-width=
"120"
: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"
>
<span>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
<!-- 添加、编辑 -->
<SoilRecordTemplateEdit
ref=
"editModal"
@
on-result-change=
"_search"
></SoilRecordTemplateEdit>
<SoilRecordEdit
ref=
"reportEdit"
@
on-result-change=
"_search"
></SoilRecordEdit>
<ConfigTemplate
ref=
"configTemplateModal"
@
on-result-change=
"_page"
></ConfigTemplate>
</div>
</template>
<
script
>
import
global
from
'../../../api/config'
import
{
soilAptitude
}
from
'../../../api'
import
SoilRecordTemplateEdit
from
'./SoilReportTemplateEdit'
import
SoilRecordEdit
from
'./SoilReportEdit'
import
ConfigTemplate
from
'./ConfigTemplate'
export
default
{
components
:
{
SoilRecordTemplateEdit
,
SoilRecordEdit
,
ConfigTemplate
},
data
()
{
return
{
pageColumns
:
[
{
title
:
'报告模板名称'
,
key
:
'alias'
},
{
title
:
'类别'
,
key
:
'classType'
},
{
title
:
'备注'
,
key
:
'remark'
}
],
formObj
:
{
name
:
undefined
},
iconMsg
:
[
{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
},
{
type
:
'ios-build-outline'
,
id
:
''
,
name
:
'配置'
},
{
type
:
'ios-book'
,
id
:
''
,
name
:
'预览/编辑'
},
{
type
:
'md-remove-circle'
,
id
:
''
,
name
:
'删除'
}
],
getPage
:
{},
tableStyleObj
:
{},
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'添加'
},
{
type
:
'error'
,
id
:
''
,
name
:
'删除'
}
],
searchOpen
:
true
,
selectIds
:
[]
}
},
computed
:
{
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
mounted
()
{
// this._contHide()
// this._classTree()
this
.
_page
()
},
methods
:
{
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'添加'
:
this
.
_editModal
()
break
case
'删除'
:
this
.
_delAll
()
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
},
_refresh
()
{
// 刷新
this
.
id
=
''
this
.
name
=
''
this
.
_search
()
this
.
_classTree
()
},
_classData
(
result
,
msg
)
{
$
(
'input[name=classifyId]'
).
val
(
result
)
this
.
_formSearch
()
},
_classTree
()
{
this
.
$refs
.
classTree
.
_Ztree
()
},
_treeHide
()
{
// 左侧树隐藏
this
.
isTree
=
false
this
.
tableStyleObj
.
marginLeft
=
'15px'
},
_treeShow
()
{
this
.
isTree
=
true
this
.
tableStyleObj
.
marginLeft
=
'215px'
},
_iconClick
(
res
,
data
)
{
switch
(
res
)
{
case
'编辑'
:
this
.
_reportEdit
(
data
)
break
case
'配置'
:
this
.
_configData
(
data
)
break
case
'下载'
:
this
.
_download
(
data
.
id
)
break
case
'预览/编辑'
:
this
.
_lookReport
(
data
)
break
case
'删除'
:
this
.
_deleteByIds
([
data
.
id
])
break
}
},
_lookReport
:
async
function
(
data
)
{
const
result
=
await
soilAptitude
.
expReportTemplateGetById
(
data
.
id
)
if
(
result
)
{
this
.
_viewReport
(
result
)
}
},
_viewReport
(
data
)
{
// window.open(global.baseURL + '/print/v1/oos?key=' + objectKey+'&edit=true', '', 'height=' + (screen.availHeight - 50) + ',' +
// 'width=' + (screen.availWidth - 10) + ',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,' +
// 'location=no,status=no')
if
(
data
)
{
this
.
$openWindowModeless
({
objectKey
:
data
.
objectKey
,
id
:
data
.
id
,
idType
:
11
,
isReport
:
4
})
}
},
_contHide
()
{
this
.
_page
()
},
_page
:
async
function
()
{
console
.
log
(
'page'
)
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
const
result
=
await
soilAptitude
.
expReportTemplatePage
(
this
.
$serializeForm
(
this
.
formObj
)
)
if
(
result
)
{
this
.
$refs
.
pageTable
.
_hideLoading
()
this
.
getPage
=
result
}
// const result = await
// this.$refs.pageTable._page('search-form', 'SysFileTemplate/page')
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_editModal
()
{
this
.
$refs
.
editModal
.
_open
()
},
_reportEdit
(
data
)
{
this
.
$refs
.
reportEdit
.
_open
(
data
)
},
_configData
(
data
)
{
this
.
$refs
.
configTemplateModal
.
_open
(
data
)
},
// 批量删除
_delAll
()
{
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选择一条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
)
}
},
// 删除
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
_delete
(
ids
)
}
})
},
_delete
:
async
function
(
ids
)
{
const
result
=
await
soilAptitude
.
expReportTemplateDelete
(
ids
)
if
(
result
)
{
this
.
_formSearch
()
this
.
$Message
.
success
(
'删除成功!'
)
}
},
_download
(
id
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定要下载?'
,
onOk
:
()
=>
{
window
.
open
(
global
.
baseURL
+
'/base/v1/file_template/download/'
+
id
,
'_blank'
)
}
})
},
_search
()
{
this
.
_page
()
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
// this.getPage = this.$store.state.SysFileTemplate.page
break
case
'selectIds'
:
this
.
selectIds
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
)
break
case
'changeSize'
:
this
.
_page
()
break
}
}
}
}
</
script
>
router/soil-routes.js
View file @
c6b107ee
...
...
@@ -36,6 +36,7 @@ import FoodReportManageIndex from '../pages/soil-report-manage/report-manage/Foo
import
DataConsult
from
'../pages/soil-test-manage/test-data-consult/DataConsult'
import
SoilRecordTemplate
from
'../pages/soil-record-template-manage/SoilRecordTemplate'
import
SoilItemReportTemplate
from
'../pages/soil-report-manage/soil-item-report-template/SoilItemReportTemplate'
import
SoilSummarySheet
from
'../pages/soil-report-manage/soil-summary-sheet/SoilSummarySheetTemplate'
import
Blank
from
'~/pages/blank'
export
default
[
{
...
...
@@ -188,6 +189,11 @@ export default [
path
:
'item_report'
,
component
:
SoilItemReportTemplate
,
meta
:
{
title
:
'试验项目报告模板'
}
},
{
path
:
'summary_sheet'
,
component
:
SoilSummarySheet
,
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