Commit c2c17d7e by lichengming

添加了报告审核和报告签发页面

parent 9f681fc2
......@@ -7,32 +7,10 @@ import http from '../http'
export default {
// 检测依据管理
standardPage: data =>
http.post('soil/v1/standard/page', data).then(res => res),
standardGetById: data =>
http.get('soil/v1/standard/' + data).then(res => res),
standardSave: data => http.post('soil/v1/standard/', data).then(res => res),
standardEdit: data =>
http.put('soil/v1/standard/' + data.id, data.obj).then(res => res),
standardDeleteById: data =>
http.delete('soil/v1/standard/?ids=' + data).then(res => res),
// 试验项目
// page
page: data => http.post('soil/v1/aptitude_exp/page', data).then(res => res),
getById: data => http.get('soil/v1/aptitude_exp/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/aptitude_exp/?ids=' + data).then(res => res),
// 保存
save: data => http.post('soil/v1/aptitude_exp/', data).then(res => res),
edit: data =>
http.put('soil/v1/aptitude_exp/' + data.id, data.obj).then(res => res),
// 指标页面
expItemPage: data =>
http.post('soil/v1/exp_item/page', data).then(res => res),
expItemDeleteByIds: data =>
http.delete('soil/v1/exp_item/?ids=' + data).then(res => res),
expItemSave: data => http.post('soil/v1/exp_item/', data).then(res => res),
expItemEdit: data =>
http.put('soil/v1/exp_item/' + data.id, data.obj).then(res => res),
expItemGetById: data => http.get('soil/v1/exp_item/' + data).then(res => res)
pageReportMake: data =>
http.post('soil/v1/entrust/page_report_make', data).then(res => res),
pageReportCheck: data =>
http.post('soil/v1/entrust/page_report_check', data).then(res => res),
pageReportIssue: data =>
http.post('soil/v1/entrust/page_report_issue', data).then(res => res)
}
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="报告审核" name="lab">
<reportMake ref="labTabs" />
</el-tab-pane>
<el-tab-pane label="历史任务" name="his">
<historyTask ref="hisTabs" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import reportMake from './tabs/reportAudit'
import historyTask from './tabs/historyTask'
export default {
components: { reportMake, historyTask },
data() {
return {
activeName: 'lab'
}
},
mounted() {
this.activeName = 'lab'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'lab') {
this._page()
} else {
this.$refs.hisTabs._clearPage()
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.labTabs._clearPage()
this.$refs.labTabs._page()
}
}
}
</script>
<template>
<div>
<Row>
<Form
id="lab-sample-form-his"
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="报检时间:">-->
<!-- <Date-picker-->
<!-- ref="sampleTime"-->
<!-- type="datetimerange"-->
<!-- placeholder="报检时间"-->
<!-- style="width: 100%;"-->
<!-- :editable="false"-->
<!-- transfer-->
<!-- @on-change="_labSampleTime"-->
<!-- />-->
<!-- <input type="hidden" name="inspectionDateBegin">-->
<!-- <input type="hidden" name="inspectionDateEnd">-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col>
<Col />
<Button @click="_downloadByIds">
下载
</Button>
</Col>
<Col />
<element-table
ref="pageTable"
:page-columns="pageColumns"
:table-height="tableHeight"
:get-page="getPage"
@on-result-change="_tableResultChange"
show-check-box
select-data
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:align="item.align"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
show-overflow-tooltip
sortable
>
<template slot-scope="scope" @click.stop="_handleIndex(scope)">
<span v-if="item.datetime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span>
<div v-else-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</el-table-column>
<el-table-column
slot="col"
:width="120"
label="操作"
align="center"
fixed="right"
>
<template slot-scope="scope">
<icon-list
:msg="iconMsg"
:row-data="scope.row"
:row-index="scope.$index"
@on-result-change="_iconClick"
/>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
<fileManage ref="FileManage" @on-result-change="_fileResult" />
<OperationModal ref="operationModal" />
</div>
</template>
<script>
// eslint-disable-next-line import/named
import { soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
name: 'PreparationManage',
components: { OperationModal },
data() {
return {
name: '',
pageColumns: [
{ title: '委托方', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '报告是否生成', key: 'reported', width: 120 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '电话/手机', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮箱', key: 'email' },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '备注', key: 'remark' }
],
btn: [
// { id: 'env-report-make-submit', type: 'primary', name: '提交' },
// { id: '', type: 'primary', name: '生成' },
// { id: '', type: 'primary', name: '下载' }
],
getPage: {},
searchOpen: false,
currentIndex: '',
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
]
}
},
computed: {
tableHeight() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
async _page() {
const data = this.$serialize('lab-sample-form-his')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportMake(data)
if (result) {
this.getPage = result
this.$refs.pageTable._initTable()
}
},
_clearPage() {
$('#lab-sample-form-his')
.find('input')
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_scanReceive() {
this.$refs.receiveModal._open()
},
_sampleReceive() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._receiveByIds(ids, `确认要接收 ${ids.length} 条数据吗?`)
}
},
_receiveByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._receiveIds(ids)
}
})
},
async _receiveIds(ids) {
const result = await soilStatistics.submitReportCheck(ids)
if (result) {
this._resultChange('提交成功!')
}
},
_submitReportCheck() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请至少选择一条数据!')
return false
}
this._submitByIds(
this.selectIds,
`确定要提交 ${this.selectIds.length} 条数据吗?`
)
},
_submitByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要提交该条数据吗?`,
onOk: () => {
this._submit(ids)
}
})
},
// 接口异步
_submit: async function(ids) {
if (ids.length === 0) return false
const result = await soilStatistics.submitEntrustReportCheck(ids)
if (result) {
this.$Message.success('提交成功!')
this._formSearch()
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._formSearch()
},
_createReport() {
console.log(this.currentComponent)
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.createReportModal._open(this.selectData)
}
},
_downloadByIds() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._download(
this.selectIds,
`确定要下载 ${this.selectIds.length} 条数据吗?`
)
}
},
_download(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定要下载报告?',
onOk: () => {
window.open(
global.baseURL + '/v1/sample_report/download_report/' + ids,
'_blank'
)
}
})
},
_iconClick(name, data) {
switch (name) {
case '提交':
this._receiveByIds(data.id)
break
case '附件':
this._uploadByIds(data.id)
break
case '预览报告':
this._viewReport(data)
break
case '操作日志':
this._record(data.id)
break
}
},
_record(id) {
this.$refs.operationModal._open(id)
},
_viewReport(data) {
this._getObjectKey(data)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
id: data.id,
isReport: 0
})
}
},
_uploadByIds(id) {
const tempData = {
id: id,
uploadFileUrl: '/v1/entrust_attachment/upload/',
downloadFileUrl: '/v1/entrust_attachment/download/'
}
this.$refs.FileManage._open(tempData, 'entrustId')
},
// 文件返回的数据
_fileResult(msg, data) {
switch (msg) {
case 'file-page':
this.$refs.FileManage._openFile(data)
break
case 'delete-page':
this.$refs.FileManage._delEntrustPage('', data)
break
case 'success':
this.$Message.success('删除成功!')
this.$refs.FileManage._pageEntrust()
break
default:
this.$refs.FileManage._pageEntrust()
}
},
_handleIndex(data) {
this.currentIndex = data.$index
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectIds':
this.selectIds = data
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < this.selectData.length; i++) {
this.selectIds.push(this.selectData[i].id)
}
break
default:
this._page()
}
},
_labSampleTime(data) {
$('input[name="inspectionDateBegin"]').val(data[0])
$('input[name="inspectionDateEnd"]').val(data[1])
console.log(data)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Row>
<Form
id="lab-sample-form"
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="报检时间:">-->
<!-- <Date-picker-->
<!-- ref="sampleTime"-->
<!-- type="datetimerange"-->
<!-- placeholder="报检时间"-->
<!-- style="width: 100%;"-->
<!-- :editable="false"-->
<!-- transfer-->
<!-- @on-change="_labSampleTime"-->
<!-- />-->
<!-- <input type="hidden" name="inspectionDateBegin">-->
<!-- <input type="hidden" name="inspectionDateEnd">-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col>
<!-- <Col span="24">-->
<!-- <Button type="primary" @click="_submitReportCheck">-->
<!-- 提交-->
<!-- </Button>-->
<!-- <Button @click="_downloadByIds">-->
<!-- 下载-->
<!-- </Button>-->
<!-- <Button type="warning" @click="_goBack">-->
<!-- 退回-->
<!-- </Button>-->
<!-- </Col>-->
<Col span="24">
<PTVXETable
ref="pageTable"
:page-columns="pageColumns"
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box
select-data
>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope" @click.stop="_handleIndex(scope)">
<span v-if="item.datetime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span>
<div v-else-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<FileManage ref="FileManage" @on-result-change="_fileResult" />
<Reason ref="reasonModal" @on-result-change="_reasonResult" />
<OperationModal ref="operationModal" />
</div>
</template>
<script>
// eslint-disable-next-line import/named
import { soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation'
export default {
name: 'PreparationManage',
components: { Reason, OperationModal },
data() {
return {
name: '',
pageColumns: [
{ title: '委托方', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '报告是否生成', key: 'reported', width: 120 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '电话/手机', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮箱', key: 'email' },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '备注', key: 'remark' }
],
btn: [
{ id: '', type: 'primary', name: '提交' },
{ id: '', type: 'primary', name: '下载' },
{ id: '', type: 'primary', name: '退回' }
],
getPage: {},
searchOpen: false,
currentIndex: '',
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
]
}
},
computed: {
tableHeight() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
async _page() {
const data = this.$serialize('lab-sample-form')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportCheck(data)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_clearPage() {
$('#lab-sample-form')
.find('input')
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
case '提交':
this._submitReportCheck()
break
case '下载':
this._downloadByIds()
break
case '退回':
this._goBack()
break
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_goBack() {
// 退回
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilStatistics.entrustReportCheckBack({
ids: this.selectIds,
remark: data
})
if (result) {
this.$Message.success('退回成功!')
await this._page()
}
},
_scanReceive() {
this.$refs.receiveModal._open()
},
_sampleReceive() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._receiveByIds(ids, `确认要接收 ${ids.length} 条数据吗?`)
}
},
_receiveByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._receiveIds(ids)
}
})
},
async _receiveIds(ids) {
const result = await soilStatistics.submitReportCheck(ids)
if (result) {
this._resultChange('提交成功!')
}
},
_submitReportCheck() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请至少选择一条数据!')
return false
}
this._submitByIds(
this.selectIds,
`确定要提交 ${this.selectIds.length} 条数据吗?`
)
},
_submitByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要提交该条数据吗?`,
onOk: () => {
this._submit(ids)
}
})
},
// 接口异步
_submit: async function(ids) {
if (ids.length === 0) return false
const result = await soilStatistics.submitEntrustReportCheck(ids)
if (result) {
this.$Message.success('提交成功!')
this._formSearch()
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._formSearch()
},
_createReport() {
console.log(this.currentComponent)
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.createReportModal._open(this.selectData)
}
},
_downloadByIds() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._download(
this.selectIds,
`确定要下载 ${this.selectIds.length} 条数据吗?`
)
}
},
_download(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定要下载报告?',
onOk: () => {
window.open(
global.baseURL + '/v1/sample_report/download_report/' + ids,
'_blank'
)
}
})
},
_iconClick(name, data) {
switch (name) {
case '提交':
this._receiveByIds(data.id)
break
case '附件':
this._uploadByIds(data.id)
break
case '预览报告':
this._viewReport(data)
break
case '操作日志':
this._record(data.id)
break
}
},
_record(id) {
this.$refs.operationModal._open(id)
},
_viewReport(data) {
this._getObjectKey(data)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
id: data.id,
isReport: 0
})
}
},
_uploadByIds(id) {
const tempData = {
id: id,
uploadFileUrl: '/v1/entrust_attachment/upload/',
downloadFileUrl: '/v1/entrust_attachment/download/'
}
this.$refs.FileManage._open(tempData, 'entrustId')
},
// 文件返回的数据
_fileResult(msg, data) {
switch (msg) {
case 'file-page':
this.$refs.FileManage._openFile(data)
break
case 'delete-page':
this.$refs.FileManage._delEntrustPage('', data)
break
case 'success':
this.$Message.success('删除成功!')
this.$refs.FileManage._pageEntrust()
break
default:
this.$refs.FileManage._pageEntrust()
}
},
_handleIndex(data) {
this.currentIndex = data.$index
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectIds':
this.selectIds = data
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < this.selectData.length; i++) {
this.selectIds.push(this.selectData[i].id)
}
break
default:
this._page()
}
},
_labSampleTime(data) {
$('input[name="inspectionDateBegin"]').val(data[0])
$('input[name="inspectionDateEnd"]').val(data[1])
console.log(data)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="报告签发" name="lab">
<reportMake ref="labTabs" />
</el-tab-pane>
<el-tab-pane label="历史任务" name="his">
<historyTask ref="hisTabs" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import reportMake from './tabs/reportIssue'
import historyTask from './tabs/historyTask'
export default {
components: { reportMake, historyTask },
data() {
return {
activeName: 'lab'
}
},
mounted() {
this.activeName = 'lab'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'lab') {
this._page()
} else {
this.$refs.hisTabs._clearPage()
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.labTabs._clearPage()
this.$refs.labTabs._page()
}
}
}
</script>
<template>
<div>
<Row>
<Form
id="lab-sample-form-his"
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="报检时间:">-->
<!-- <Date-picker-->
<!-- ref="sampleTime"-->
<!-- type="datetimerange"-->
<!-- placeholder="报检时间"-->
<!-- style="width: 100%;"-->
<!-- :editable="false"-->
<!-- transfer-->
<!-- @on-change="_labSampleTime"-->
<!-- />-->
<!-- <input type="hidden" name="inspectionDateBegin">-->
<!-- <input type="hidden" name="inspectionDateEnd">-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col>
<Col />
<!-- <Button type="primary" @click="_submitReportCheck">-->
<!-- 提交-->
<!-- </Button>-->
<Button @click="_downloadByIds">
下载
</Button>
</Col>
<Col />
<element-table
ref="pageTable"
:page-columns="pageColumns"
:table-height="tableHeight"
:get-page="getPage"
@on-result-change="_tableResultChange"
show-check-box
select-data
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:align="item.align"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
show-overflow-tooltip
sortable
>
<template slot-scope="scope" @click.stop="_handleIndex(scope)">
<span v-if="item.datetime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span>
<div v-else-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</el-table-column>
<el-table-column
slot="col"
:width="120"
label="操作"
align="center"
fixed="right"
>
<template slot-scope="scope">
<icon-list
:msg="iconMsg"
:row-data="scope.row"
:row-index="scope.$index"
@on-result-change="_iconClick"
/>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
<fileManage ref="FileManage" @on-result-change="_fileResult" />
<OperationModal ref="operationModal" />
</div>
</template>
<script>
// eslint-disable-next-line import/named
import { soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
name: 'PreparationManage',
components: { OperationModal },
data() {
return {
name: '',
pageColumns: [
{ title: '委托方', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '报告是否生成', key: 'reported', width: 120 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '电话/手机', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮箱', key: 'email' },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '备注', key: 'remark' }
],
btn: [
// { id: 'env-report-make-submit', type: 'primary', name: '提交' },
// { id: '', type: 'primary', name: '生成' },
// { id: '', type: 'primary', name: '下载' }
],
getPage: {},
searchOpen: false,
currentIndex: '',
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
// { id: '', type: 'pt-a-view', name: '预览PDF' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
]
}
},
computed: {
tableHeight() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
async _page() {
const data = this.$serialize('lab-sample-form-his')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportMake(data)
if (result) {
this.getPage = result
this.$refs.pageTable._initTable()
}
},
_clearPage() {
$('#lab-sample-form-his')
.find('input')
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_scanReceive() {
this.$refs.receiveModal._open()
},
_sampleReceive() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._receiveByIds(ids, `确认要接收 ${ids.length} 条数据吗?`)
}
},
_receiveByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._receiveIds(ids)
}
})
},
async _receiveIds(ids) {
const result = await soilStatistics.submitReportCheck(ids)
if (result) {
this._resultChange('提交成功!')
}
},
_submitReportCheck() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请至少选择一条数据!')
return false
}
this._submitByIds(
this.selectIds,
`确定要提交 ${this.selectIds.length} 条数据吗?`
)
},
_submitByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要提交该条数据吗?`,
onOk: () => {
this._submit(ids)
}
})
},
// 接口异步
_submit: async function(ids) {
if (ids.length === 0) return false
const result = await soilStatistics.submitEntrustReportCheck(ids)
if (result) {
this.$Message.success('提交成功!')
this._formSearch()
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._formSearch()
},
_createReport() {
console.log(this.currentComponent)
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.createReportModal._open(this.selectData)
}
},
_downloadByIds() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._download(
this.selectIds,
`确定要下载 ${this.selectIds.length} 条数据吗?`
)
}
},
_download(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定要下载报告?',
onOk: () => {
window.open(
global.baseURL + '/v1/sample_report/download_report/' + ids,
'_blank'
)
}
})
},
_iconClick(name, data) {
switch (name) {
case '提交':
this._receiveByIds(data.id)
break
case '附件':
this._uploadByIds(data.id)
break
case '预览报告':
this._viewReport(data)
break
case '预览PDF':
this._viewPDF(data)
break
case '操作日志':
this._record(data.id)
break
}
},
// 没有生成pdf先生成在预览
_viewPDF(data) {
console.log(data)
if (data.pdfObjectKey) {
this.$pdfView(data.pdfObjectKey)
} else {
console.log(123456)
// window.open(
// 'http://api.pertest.patzn.com/food/v1/sample_report/generate_pdf_auto?id=' +
// data.id
// )
// this.autoPdf(data)
// window.open(
// global.baseURL +
// '/food/v1/sample_report/generate_pdf_auto?id=' +
// data.id
// )
}
},
_viewReport(data) {
this._getObjectKey(data)
},
_record(id) {
this.$refs.operationModal._open(id)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
id: data.id,
isReport: 0
})
}
},
_uploadByIds(id) {
const tempData = {
id: id,
uploadFileUrl: '/v1/entrust_attachment/upload/',
downloadFileUrl: '/v1/entrust_attachment/download/'
}
this.$refs.FileManage._open(tempData, 'entrustId')
},
// 文件返回的数据
_fileResult(msg, data) {
switch (msg) {
case 'file-page':
this.$refs.FileManage._openFile(data)
break
case 'delete-page':
this.$refs.FileManage._delEntrustPage('', data)
break
case 'success':
this.$Message.success('删除成功!')
this.$refs.FileManage._pageEntrust()
break
default:
this.$refs.FileManage._pageEntrust()
}
},
_handleIndex(data) {
this.currentIndex = data.$index
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectIds':
this.selectIds = data
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < this.selectData.length; i++) {
this.selectIds.push(this.selectData[i].id)
}
break
default:
this._page()
}
},
_labSampleTime(data) {
$('input[name="inspectionDateBegin"]').val(data[0])
$('input[name="inspectionDateEnd"]').val(data[1])
console.log(data)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Row>
<Form
id="lab-sample-form"
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="报检时间:">-->
<!-- <Date-picker-->
<!-- ref="sampleTime"-->
<!-- type="datetimerange"-->
<!-- placeholder="报检时间"-->
<!-- style="width: 100%;"-->
<!-- :editable="false"-->
<!-- transfer-->
<!-- @on-change="_labSampleTime"-->
<!-- />-->
<!-- <input type="hidden" name="inspectionDateBegin">-->
<!-- <input type="hidden" name="inspectionDateEnd">-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col>
<!-- <Col span="24">-->
<!-- &lt;!&ndash; <Button type="primary" @click="_submitReportCheck">&ndash;&gt;-->
<!-- <Button type="primary" @click="_submitReportIssue">-->
<!-- 提交-->
<!-- </Button>-->
<!-- <Button @click="_downloadByIds">-->
<!-- 下载-->
<!-- </Button>-->
<!-- <Button type="warning" @click="_goBack">-->
<!-- 退回-->
<!-- </Button>-->
<!-- </Col>-->
<Col span="24">
<PTVXETable
ref="pageTable"
:page-columns="pageColumns"
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box
select-data
>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope" @click.stop="_handleIndex(scope)">
<span v-if="item.datetime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span>
<div v-else-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<fileManage ref="FileManage" @on-result-change="_fileResult" />
<Reason ref="reasonModal" @on-result-change="_reasonResult" />
<OperationModal ref="operationModal" />
</div>
</template>
<script>
// eslint-disable-next-line import/named
import { soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation'
export default {
name: 'PreparationManage',
components: { Reason, OperationModal },
data() {
return {
name: '',
pageColumns: [
{ title: '委托方', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '报告是否生成', key: 'reported', width: 120 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '电话/手机', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮箱', key: 'email' },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '备注', key: 'remark' }
],
btn: [
{ id: '', type: 'primary', name: '提交' },
{ id: '', type: 'primary', name: '下载' },
{ id: '', type: 'primary', name: '退回' }
],
getPage: {},
searchOpen: false,
currentIndex: '',
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
]
}
},
computed: {
tableHeight() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
async _page() {
const data = this.$serialize('lab-sample-form')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportIssue(data)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_clearPage() {
$('#lab-sample-form')
.find('input')
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
case '提交':
this._submitReportIssue()
break
case '下载':
this._downloadByIds()
break
case '退回':
this._goBack()
break
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_scanReceive() {
this.$refs.receiveModal._open()
},
_sampleReceive() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._receiveByIds(ids, `确认要接收 ${ids.length} 条数据吗?`)
}
},
_receiveByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._receiveIds(ids)
}
})
},
async _receiveIds(ids) {
const result = await soilStatistics.submitReportCheck(ids)
if (result) {
this._resultChange('提交成功!')
}
},
_goBack() {
// 退回
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilStatistics.entrustReportIssueBack({
ids: this.selectIds,
remark: data
})
if (result) {
this.$Message.success('退回成功!')
await this._page()
}
},
_submitReportCheck() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请至少选择一条数据!')
return false
}
this._submitByIds(
this.selectIds,
`确定要提交 ${this.selectIds.length} 条数据吗?`
)
},
_submitReportIssue() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请至少选择一条数据!')
return false
}
this._submitByIds(
this.selectIds,
`确定要提交 ${this.selectIds.length} 条数据吗?`
)
},
_submitByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要提交该条数据吗?`,
onOk: () => {
this._submit(ids)
}
})
},
// 接口异步
_submit: async function(ids) {
if (ids.length === 0) return false
const result = await soilStatistics.submitEntrustReportIssue(ids)
if (result) {
this.$Message.success('提交成功!')
this._formSearch()
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._formSearch()
},
_createReport() {
console.log(this.currentComponent)
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.createReportModal._open(this.selectData)
}
},
_downloadByIds() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._download(
this.selectIds,
`确定要下载 ${this.selectIds.length} 条数据吗?`
)
}
},
_download(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定要下载报告?',
onOk: () => {
window.open(
global.baseURL + '/v1/sample_report/download_report/' + ids,
'_blank'
)
}
})
},
_iconClick(name, data) {
switch (name) {
case '提交':
this._receiveByIds(data.id)
break
case '附件':
this._uploadByIds(data.id)
break
case '预览报告':
this._viewReport(data)
break
case '操作日志':
this._record(data.id)
break
}
},
_viewReport(data) {
this._getObjectKey(data)
},
_record(id) {
this.$refs.operationModal._open(id)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
id: data.id,
isReport: 0
})
}
},
_uploadByIds(id) {
const tempData = {
id: id,
uploadFileUrl: '/v1/entrust_attachment/upload/',
downloadFileUrl: '/v1/entrust_attachment/download/'
}
this.$refs.FileManage._open(tempData, 'entrustId')
},
// 文件返回的数据
_fileResult(msg, data) {
switch (msg) {
case 'file-page':
this.$refs.FileManage._openFile(data)
break
case 'delete-page':
this.$refs.FileManage._delEntrustPage('', data)
break
case 'success':
this.$Message.success('删除成功!')
this.$refs.FileManage._pageEntrust()
break
default:
this.$refs.FileManage._pageEntrust()
}
},
_handleIndex(data) {
this.currentIndex = data.$index
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectIds':
this.selectIds = data
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < this.selectData.length; i++) {
this.selectIds.push(this.selectData[i].id)
}
break
default:
this._page()
}
},
_labSampleTime(data) {
$('input[name="inspectionDateBegin"]').val(data[0])
$('input[name="inspectionDateEnd"]').val(data[1])
console.log(data)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
......@@ -47,18 +47,9 @@
</Form>
</Col>
<Col span="24">
<BtnList :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
<btn-list :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide">
<!--切换待认领任务-->
<template slot="processTask">
<div class="fr process-task">
<el-checkbox v-model="formObj.personal" @change="_page" :true-label="1" :false-label="0"
size="medium">
个人任务
</el-checkbox>
</div>
</template>
</BtnList>
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
......
......@@ -79,13 +79,15 @@
</div>
</div>
<SampleByMakeModal ref="sampleByMakeModal"></SampleByMakeModal>
<Operation ref="operation"></Operation>
</div>
</template>
<script>
import { soilTest } from '../../../../api'
import { soilStatistics } from '../../../../api'
import SampleByMakeModal from '../SampleByMakeModal'
import Operation from '../../../../components/operation/Operation'
export default {
components: { SampleByMakeModal },
components: { SampleByMakeModal, Operation },
data() {
return {
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }],
......@@ -94,33 +96,19 @@ export default {
formObj: {},
pageColumns: [
{
title: '委托单位',
key: 'cname',
title: '委托',
key: 'client',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '委托名称', key: 'name', width: 160 },
{ title: '委托编号', key: 'code', width: 180 },
{ title: '类型', key: 'type', width: 80, type: true },
{ title: '状态', key: 'progress', width: 110, status: true },
{ title: '应出报告日期', key: 'reportDueDate', width: 130, date: true },
{ title: '是否判定', key: 'judge', width: 100, judge: true },
{
title: '报告剩余天数',
key: 'reportRemainDay',
width: 130,
day: true
},
{ title: '报告进度统计', key: 'reportProgress', width: 450 },
{ title: '主联系人', key: 'linkman', width: 100 },
{ title: '联系手机', key: 'tel', width: 120 },
{ title: '检测类型', key: 'detectType', width: 130 },
{ title: '服务类型', key: 'serviceType', width: 120 },
{ title: '是否带照片', key: 'havePhoto', width: 120 },
{ title: '报告语言', key: 'reportType', width: 100 },
{ title: '报告类别', key: 'reportClass', width: 120 },
{ title: '备注', key: 'remark' }
{ title: '委托编号', key: 'entrustCode', width: 180 },
{ title: '报告编号', key: 'reportCode', width: 180 },
{ title: '水深', key: 'waterDepth', width: 180 },
{ title: '状态', key: 'status', width: 110, status: true },
{ title: '委托日期', key: 'entrustDate', width: 180, date: true },
{ title: '进度', key: 'progress', width: 110, status: true },
{ title: '制表人', key: 'tabulater', width: 110 },
{ title: '制表日期', key: 'tabulateDate', width: 110, date: true }
],
iconMsg: [
{
......@@ -227,7 +215,7 @@ export default {
this.$refs.refModal._open(data)
break
case '操作记录':
this.$refs.refModal._open(data.id)
this._operationRecord(data.id)
break
case '附件':
this._upload(data.id)
......@@ -235,6 +223,10 @@ export default {
}
})
},
_operationRecord(id) {
// 操作日志
this.$refs.operation._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
......@@ -254,7 +246,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExpTest(
const result = await soilStatistics.pageReportMake(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -38,6 +38,7 @@
<span
v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.datetime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}</span>
<span v-else-if="item.key==='progress'">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
......@@ -123,6 +124,7 @@ export default {
{ title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '试样包装类型', key: 'samplePack', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '检测方法', key: 'testMethod', width: 260 },
......
......@@ -23,6 +23,8 @@ import yearDeclara from '../pages/soil-statistics/yearDeclara'
import MeterCustomerEntrust from '../pages/soil-statistics/customer-entrust/MeterCustomerEntrust'
import MeterPersonalTask from '../pages/soil-statistics/personal-task/MeterPersonalTask'
import MeterAnnualEntrust from '../pages/soil-statistics/annual-entrust/MeterAnnualEntrust'
import ReportAuditIndex from '../pages/soil-report-manage/report-audit/ReportAuditIndex'
import ReportIssueIndex from '../pages/soil-report-manage/report-issue/ReportIssueIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -116,6 +118,16 @@ export default [
path: 'make_report',
component: ReportMakeIndex,
meta: { title: '报告编制' }
},
{
path: 'report_audit',
component: ReportAuditIndex,
meta: { title: '报告审核' }
},
{
path: 'report_issue',
component: ReportIssueIndex,
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