Commit 5c1b1d5f by lichengming

修改了报告档案

parent 44da5294
......@@ -9,10 +9,7 @@
<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>
<Input v-model="formObj.title" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -167,7 +164,8 @@ export default {
cusNames: '',
codes: '',
itemNames: '',
testAccordings: ''
testAccordings: '',
title: undefined
},
searchOpen: false
}
......
<template>
<div>
<!--内容-->
<Modal v-model="showModal" :width="100" class="modal-footer-none modal-top-0">
<p slot="header">{{modalTitle}}</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="样品台账" name="sample">
<ReportMakeBySample ref="sampleTabs"></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane label="汇总报告台账" name="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
<el-tab-pane label="试验项目报告台账" name="report">
<ReportInfoMake ref="reportTabs"></ReportInfoMake>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import ReportInfoMake from './sample-report-manage/ReportInfoMake'
import ReportMakeBySample from './sample-report-manage/ReportMakeBySample'
import SummaryInfo from './sample-report-manage/SummaryInfo'
export default {
components: {
ReportMakeBySample,
ReportInfoMake,
SummaryInfo
},
data() {
return {
showModal: false,
modalTitle: '',
activeName: '',
contractId: '',
entrustId: '',
type: '',
personal: ''
}
},
computed: {
tableHeight: function() {
return document.documentElement.clientHeight - 135
}
},
methods: {
_open(entrustId) {
this.modalTitle = '管理样品和报告'
this.showModal = true
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
},
_sample() {
console.log(this.entrustId)
this.$refs.sampleTabs._open(this.entrustId)
},
_summary() {
this.$refs.summaryTabs._open(this.entrustId)
},
_changeTabs(tab, event) {
switch (tab.name) {
case 'sample':
this._sample()
break
case 'report':
this._report()
break
case 'summary':
this._summary()
break
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
......@@ -85,8 +85,11 @@
<script>
import { soilReport } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
import SampleByMakeModal from '../../report-manage/SampleByMakeModal'
import OriginalRecordView from '../OriginalRecordView'
export default {
components: { Operation },
// eslint-disable-next-line vue/no-unused-components
components: { Operation, SampleByMakeModal, OriginalRecordView },
props: {
reportStatus: null
},
......@@ -121,6 +124,17 @@ export default {
// componentName: 'ErecordIndex'
// },
{
type: 'ios-flask-outline',
id: '',
name: '管理样品和报告'
},
{
type: 'ios-beaker',
id: '',
name: '查看原始记录'
},
{ type: 'ios-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作记录'
......@@ -184,23 +198,6 @@ export default {
break
}
},
_reportDateChange(data) {
$('input[name="reportDueDateBegin"]').val(data[0])
$('input[name="reportDueDateEnd"]').val(data[1])
},
// 制单日期
_ctimeChange(data) {
$('input[name="ctimeBegin"]').val(data[0])
$('input[name="ctimeEnd"]').val(data[1])
},
_dateChange(data) {
$('input[name=auditDateBegin]').val(data[0])
$('input[name=auditDateEnd]').val(data[1])
},
_issueDateChange(data) {
$('input[name=issueDateBegin]').val(data[0])
$('input[name=issueDateEnd]').val(data[1])
},
_btnClick(msg) {
switch (msg) {
case '导出发放记录':
......@@ -291,8 +288,14 @@ export default {
this.currentComponent = componentName
this.$nextTick(() => {
switch (res) {
case '资料管理':
this._resManage(data)
case '管理样品和报告':
this._sampleManage(data.id)
break
case '查看原始记录':
this._viewRecord(data.id)
break
case '附件':
this._upload(data.id)
break
case '操作记录':
this._record(data.id)
......@@ -300,6 +303,26 @@ export default {
}
})
},
_upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件
// this.$refs.FileManage._open(id, 'entrustId')
},
_viewRecord(id) {
this.currentComponent = 'OriginalRecordView'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_sampleManage(id) {
this.currentComponent = 'SampleByMakeModal'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_record(id) {
this.$refs.recordModal._open(id)
},
......
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