Commit 07f52f64 by lichengming

添加试验项目报告模板菜单

parent 0417f9ea
......@@ -18,5 +18,6 @@ export default {
getExcelOriginalRecord: data =>
http
.post('soil/v1/original_record/get_excel_original_record?expId=' + data)
.then(res => res)
.then(res => res),
reportPage: data => http.post('soil/v1/report/page', data).then(res => res)
}
......@@ -256,6 +256,7 @@ export default {
if (result) {
this.$Message.success('报告成功生成')
this._page()
this.$emit('on-result-change')
}
},
openTooltip() {
......
......@@ -87,7 +87,7 @@ export default {
})
},
_report() {
this.$refs.reportTabs._open(this.contractId, this.personal)
this.$refs.reportTabs._open(this.entrustId)
},
_sample() {
console.log(this.entrustId)
......
......@@ -82,7 +82,7 @@
<script>
import global from '../../../../api/config'
import http from '../../../../api/http'
import { soilTest } from '../../../../api'
import { soilReport } from '../../../../api'
/**
* 报告编制的-待办-报告台账
......@@ -97,54 +97,7 @@ export default {
],
currentComponent: '',
searchOpen: false,
btn: [
{
type: 'primary',
id: 'food-report-make-submit-to-gc-platform-by-contract',
name: '推送至国抽平台'
},
{ type: 'primary', id: 'food-report-make-submit', name: '提交' },
{
type: 'primary',
id: 'food-report-make-to-pdf',
name: '盖章',
componentName: 'SignatureToPDF'
},
{
type: 'primary',
id: 'food-report-make-to-auditor',
name: '选择审核人',
componentName: 'AssignPerson'
},
{
type: 'primary',
id: 'food-report-make-submit-to-issue',
name: '提交至报告签发'
},
{
type: 'success',
id: 'food-report-make-batch-create-report',
name: '重新生成',
componentName: 'ReportTemplateModal'
},
{
type: 'error',
id: 'food-report-make-batch-del-report',
name: '删除'
},
{ id: 'food-report-make-batch-down', name: '下载' },
{ id: 'food-report-make-batch-achieve-by-contract', name: '完成' },
{
id: 'food-report-make-batch-overdue-reason',
name: '记录报告超期原因',
componentName: 'Reason'
},
{
id: 'food-report-make-edit-report-aptitude',
name: '修改报告资质要求',
componentName: 'EditReportAptitude'
}
],
btn: [{ id: 'food-report-make-batch-down', name: '下载' }],
getPage: {},
pageColumns: [
{ title: '报告编号', key: 'reportSn', width: 180, fixed: 'left' },
......@@ -173,57 +126,35 @@ export default {
selectIds: [],
selectData: [],
formObj: {
contractId: '',
reportSn: '',
sampleNum: '',
sampleName: '',
taskSource: '',
detectType: '',
reportDateBegin: '',
reportDateEnd: '',
notOkCount: '',
personal: 0,
dataPushed: ''
entrustId: ''
},
dateList: [],
iconMsg: [
{ type: 'ios-book', id: '', name: '预览/编辑报告' },
{ type: 'ios-book', id: '', name: '预览/编辑报告' }
// {
// type: 'loop',
// type: 'ios-document',
// id: '',
// name: '重新生成',
// componentName: 'ReportTemplateModal'
// name: '项目台账',
// componentName: 'ItemModalByReportMake'
// },
{
type: 'ios-document',
id: '',
name: '项目台账',
componentName: 'ItemModalByReportMake'
},
{
type: 'ios-cloud-upload',
id: '',
name: '上传',
componentName: 'UploadByReport'
},
// {
// type: 'information-circled',
// type: 'ios-cloud-upload',
// id: '',
// name: '历史版本',
// componentName: 'HisRevision'
// name: '上传',
// componentName: 'UploadByReport'
// },
{
type: 'cloud',
id: '',
name: '附件',
componentName: 'ReportFileManage'
},
{
type: 'ios-clock',
id: '',
name: '操作记录',
componentName: 'FoodReportRecord'
}
// {
// type: 'cloud',
// id: '',
// name: '附件',
// componentName: 'ReportFileManage'
// },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'FoodReportRecord'
// }
],
// 签发日期
issueDateTemp: '',
......@@ -380,19 +311,15 @@ export default {
break
}
},
_open(contractId, personal) {
_open(entrustId) {
this.formObj = this.$resetFields(this.formObj)
this.formObj.contractId = contractId
this.dateList = []
this.formObj.personal = personal
this.formObj.contractId = entrustId
this.showIssueModal = false
this.reportId = ''
this.tempId = ''
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExpTest(
const result = await soilReport.reportPage(
this.$serializeForm(this.formObj)
)
if (result) {
......
<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.name" @on-enter="_formSearch" name="name" 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>
</div>
</template>
<script>
import global from '../../../api/config'
import { soilAptitude } from '../../../api'
import SoilRecordTemplateEdit from './SoilReportTemplateEdit'
import SoilRecordEdit from './SoilReportEdit'
export default {
components: { SoilRecordTemplateEdit, SoilRecordEdit },
data() {
return {
pageColumns: [
{ title: '原始记录模板名称', key: 'alias' },
{ title: '类别', key: 'classType' },
{ title: '备注', key: 'remark' }
],
formObj: {
name: undefined
},
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'ios-book', id: '', name: '预览/编辑' },
// { type: 'ios-download', 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._download(data.id)
break
case '预览/编辑':
this._lookReport(data)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_lookReport: async function(data) {
const result = await soilAptitude.originalTemplateGetById(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.originalTemplatePage(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)
},
// 批量删除
_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.originalTemplateDeleteById(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
default:
this._page()
}
}
}
}
</script>
<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/original_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>
<template>
<div>
<Modal v-model="showBatchModal" :mask-closable="false" width="900">
<Modal v-model="showBatchModal" v-drag :mask-closable="false" width="900">
<p slot="header">
原始记录填写
</p>
......
......@@ -35,6 +35,7 @@ import ClientLocationSearch from '../pages/soil-statistics/client_location/Clien
import FoodReportManageIndex from '../pages/soil-report-manage/report-manage/FoodReportManageIndex'
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 Blank from '~/pages/blank'
export default [
{
......@@ -182,6 +183,11 @@ export default [
path: 'report_manage',
component: FoodReportManageIndex,
meta: { title: '报告档案' }
},
{
path: 'item_report',
component: SoilItemReportTemplate,
meta: { title: '试验项目报告模板' }
}
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment