Commit 7bbfb031 by zhangmengqi

Merge branch 'dev'

parents 4bde23b7 6f6b44e3
......@@ -183,5 +183,7 @@ export default {
callOutAloneKeepSample: data =>
http
.post('soil/v1/sample/call_out_alone_keep_sample/', data)
.then(res => res)
.then(res => res),
listSummaryQuery: data =>
http.post('soil/v1/entrust/list_summary_query', data).then(res => res)
}
......@@ -26,5 +26,9 @@ export default {
http.get('soil/v1/exp_report/' + data).then(res => res),
reportGetById: data => http.get('soil/v1/report/' + data).then(res => res),
expReportCheck: data =>
http.post('soil/v1/exp_report/exp_report_check', data).then(res => res)
http.post('soil/v1/exp_report/exp_report_check', data).then(res => res),
pageReportEndBySummaryReport: data =>
http
.post('soil/v1/entrust/page_report_end_by_summary_report', data)
.then(res => res)
}
......@@ -9,8 +9,19 @@ export default {
// 检测依据管理
pageReportMake: data =>
http.post('soil/v1/entrust/page_report_make', data).then(res => res),
pageReportMakeByExpReport: data =>
http
.post('soil/v1/entrust/page_report_make_by_exp_report', data)
.then(res => res),
pageReportCheck: data =>
http.post('soil/v1/entrust/page_report_check', data).then(res => res),
pageReportCheckBySummaryReport: data =>
http
.post('soil/v1/entrust/page_report_check_by_summary_report', data)
.then(res => res),
pageReportIssue: data =>
http.post('soil/v1/entrust/page_report_issue', data).then(res => res),
pageAnnual: data =>
......@@ -54,7 +65,6 @@ export default {
.then(res => res),
listSampleProgress: data =>
http.post('soil/v1/sample/list_sample_progress', data).then(res => res),
pageExpReportMake: data =>
http.post('soil/v1/entrust/page_exp_report_make', data).then(res => res),
pageExpReportCheck: data =>
......@@ -79,5 +89,21 @@ export default {
http
.post('soil/v1/statistics/page_personal_task_statistics', data)
.then(res => res),
_getLabel: data => http.post('/res/v1/label/page', data).then(res => res)
_getLabel: data => http.post('/res/v1/label/page', data).then(res => res),
summaryReportSubmit: data =>
http
.post('soil/v1/report/summary_report_submit?ids=' + data)
.then(res => res),
summaryReportCheckSubmit: data =>
http
.post('soil/v1/report/summary_report_check_submit?ids=' + data)
.then(res => res),
pageReportIssueBySummaryReport: data =>
http
.post('soil/v1/entrust/page_report_issue_by_summary_report', data)
.then(res => res),
summaryReportIssueSubmit: data =>
http
.post('soil/v1/report/summary_report_issue_submit?ids=' + data)
.then(res => res)
}
......@@ -197,11 +197,17 @@ export default {
deleteReport: data =>
http.delete('soil/v1/exp_report/?ids=' + data).then(res => res),
reportPage: data => http.post('soil/v1/report/page', data).then(res => res),
pageSummaryCheck: data =>
http.post('soil/v1/report/page_summary_check', data).then(res => res),
pageSummaryIssue: data =>
http.post('soil/v1/report/page_summary_issue', data).then(res => res),
dataGds: data => http.get('soil/v1/data_gds/' + data).then(res => res),
gdsGetMainInfo: data =>
http
.post('soil/v1/data_gds/get_main_info?sampleCode=' + data)
.then(res => res),
dataGdsDetail: data =>
http.post('soil/v1/data_gds_detail/page', data).then(res => res)
http.post('soil/v1/data_gds_detail/page', data).then(res => res),
pageSummaryEnd: data =>
http.post('soil/v1/report/page_summary_report_end', data).then(res => res)
}
<template>
<div class="flow-start" style="position: relative">
<div v-if="index === 0" :class="classObj(1)" class="flow-start-border"></div>
<div v-if="index === 1" :class="classObj(3)" class="flow-start-border"></div>
<div v-for="(item,itemIndex) in list" :key="itemIndex" style="position: relative;margin-bottom: 70px">
<div v-if="item.type !== 'rect'" class="flow-start">
<PtArrow :value="item.value" style="margin-top: 32px;"/>
<PtCircle :name="item.name" :per="item.per?item.per:''" :value="item.value"/>
</div>
<div v-if="item.type === 'rect'" class="flow-start" style="position: absolute;right: -10px;bottom:-60px">
<PtArrow :isRote="true" :value="item.value"/>
<PtRect :name="item.name" :value="item.value" style="margin-top: 60px;"/>
</div>
<!--最后的连接线-->
<div style="position: absolute;left: 81px;top: 30px">
<PtArrow v-if="item.line" :width="index === 1?'60px':'100px'"
:noArrow="index !== 1?true:false"
:value="endValue()"/>
</div>
</div>
</div>
</template>
<script>
/**
* 分支组合
*/
import PtArrow from './PtArrow.vue'
import PtRect from './PtRect.vue'
import PtCircle from './PtCircle.vue'
export default {
name: 'FlowBranch',
components: {
PtArrow,
PtRect,
PtCircle
},
props: {
// 数据源
list: null,
// 第几个分支
index: null,
// 最后一部分
endList: null,
// 分支总数据
branch: null
},
methods: {
// 左侧的边线
classObj(msg) {
// const list_0_value = this.branch[0][0].value
const listZeroValue = this.branch[0][0].value
// const list_2_value = this.branch[2][0].value
const listTwoValue = this.branch[2][0].value
if (msg === 1) {
// switch (list_0_value) {
switch (listZeroValue) {
case true:
return 'blue-flow-start-border'
case false:
return 'red-flow-start-border'
}
}
if (msg === 3) {
switch (listTwoValue) {
case true:
return 'blue-flow-start-border'
case false:
return 'red-flow-start-border'
}
}
},
// 右侧的连接线
endValue() {
// 最后一个节点数据
console.log('右侧连接线', this.list)
console.log('右侧连接线', this.endList)
// const current_value = this.list[2].value
const currentValue = this.list[2].value
const endValue = this.endList[0].value
// const list_0_value = this.list[0].value
const listZeroValue = this.list[0].value
// if (current_value) {
if (currentValue === false || currentValue === undefined) {
return undefined
} else if (currentValue) {
return endValue
} else {
// undefined,说明要接着向下走
// eslint-disable-next-line no-lonely-if
if (listZeroValue !== undefined && endValue) {
return true
} else if (listZeroValue !== undefined && endValue === false) {
return false
}
}
}
}
}
</script>
<style scoped>
.flow-start-border {
width: 2px;
height: 133px;
background: #666;
position: absolute;
top: 30px;
}
.blue-flow-start-border {
background: #00a0e9;
}
.red-flow-start-border {
background: #eb6877;
}
</style>
<template>
<div>
<div v-for="(item,index) in list"
:key="index" class="flow-start margin-bottom-10">
<div :class="item.class"></div>
<div class="legend-cont">{{item.name}}</div>
</div>
</div>
</template>
<script>
/**
* 图例
*
*/
export default {
name: 'Legend',
data() {
return {
list: [
{ name: '已流转', class: 'legend-blue' },
{ name: '待流转', class: 'legend-red' },
{ name: '无', class: 'legend-gray' }
]
}
}
}
</script>
<style scoped>
.legend-blue {
width: 15px;
height: 15px;
background: #00a0e9;
}
.legend-red {
width: 15px;
height: 15px;
background: #eb6877;
}
.legend-gray {
width: 15px;
height: 15px;
background: #999;
}
.legend-cont {
font-size: 12px;
margin-left: 5px;
margin-top: -3px;
}
.margin-bottom-10 {
margin-bottom: 10px;
}
</style>
<template>
<div
:class="{'rotate-90':isRote,'rotate--90':isRote1}"
style="display: flex;flex-direction: row">
<div :style="{'width':width?width:'10px'}"
:class="classObj(value,'left')"
class="arrow-left"></div>
<div :class="classObj(value,'right')"
v-show="noArrow === undefined || noArrow === false"
class="arrow-right"></div>
</div>
</template>
<script>
/**
* 箭头
*/
export default {
name: 'PtArrow',
props: {
// 箭头宽度
width: null,
// 是否进行旋转,默认否
isRote: null,
isRote1: null,
// 是否显示右侧的箭头标志
noArrow: null,
// 根据value值判断颜色
value: null
},
methods: {
// 颜色
classObj(value, msg) {
switch (value) {
case true:
return msg === 'left' ? 'blue-color-left' : 'blue-color-right'
case false:
return msg === 'left' ? 'red-color-left' : 'red-color-right'
default:
break
}
}
}
}
</script>
<style scoped>
.arrow-left {
height: 2px;
background: #666;
}
.arrow-right {
border: 6px solid transparent;
border-left: 10px solid #666;
width: 0;
height: 0px;
margin-top: -5px;
margin-right: -6px;
}
.rotate-90 {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
}
.rotate--90 {
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
}
.blue-color-left {
background: #00a0e9;
}
.red-color-left {
background: #eb6877;
}
.blue-color-right {
border-left-color: #00a0e9;
}
.red-color-right {
border-left-color: #eb6877;
}
</style>
<template>
<div :class="classObj(value)" class="circle">
<span :class="style(name)">{{name}}{{per}}</span>
</div>
</template>
<script>
/**
* 圆形
*/
export default {
name: 'PtCircle',
props: {
// 显示的内容
name: null,
value: null,
per: null
},
methods: {
// 文字居中问题
style(name) {
if (name && name.length <= 4) {
if (name === '完成率' && this.per !== '') {
return 'marginTop-10'
}
return 'lineHeight-60'
} else {
return 'marginTop-10'
}
},
// 颜色
classObj(value) {
switch (value) {
case true:
return 'blue-color'
case false:
return 'red-color'
default:
break
}
}
}
}
</script>
<style scoped>
.circle {
width: 60px;
height: 60px;
border: 1px solid #999;
background: #999;
color: #fff;
border-radius: 50%;
text-align: center;
font-size: 12px;
}
.circle span {
word-wrap: break-word;
display: inline-block;
width: 50px;
}
.lineHeight-60 {
line-height: 60px;
}
.marginTop-10 {
margin-top: 10px;
}
.blue-color {
border-color: #00a0e9;
background-color: #00a0e9;
color: #fff;
}
.red-color {
border-color: #eb6877;
background-color: #eb6877;
color: #fff;
}
</style>
<template>
<div :class="classObj(value)" class="rect">{{name}}</div>
</template>
<script>
/**
* 矩形
*/
export default {
name: 'PtRect',
props: {
// 显示的内容
name: null,
// 节点变色的依据(存在的变色)
value: null
},
methods: {
// 颜色
classObj(value) {
switch (value) {
case true:
return 'blue-color'
case false:
return 'red-color'
default:
break
}
}
}
}
</script>
<style scoped>
.rect {
padding: 10px;
border: 1px solid #999;
background: #999;
color: #fff;
font-size: 12px;
width: 80px;
text-align: center;
}
.blue-color {
border-color: #00a0e9;
background-color: #00a0e9;
color: #fff;
}
.red-color {
border-color: #eb6877;
background-color: #eb6877;
color: #fff;
}
</style>
<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="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import SummaryInfo from './SummaryInfo'
export default {
components: {
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 = 'summary'
this.entrustId = entrustId
this.$refs.summaryTabs._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>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<btn-list :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
:msg="btn" class="contHide">
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :tableName="tableName"
select-data is-report>
<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 (userColumns.length>0?userColumns: pageColumns)"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'): ''}}
</div>
<div v-else-if="item.dateTime">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'): ''}}
</div>
<div v-else-if="item.judge">{{Number(scope.row[item.key])===1?'是':'否'}}
</div>
<div v-else-if="item.notOkCount">
<span v-if="scope.row[item.key] === 0" class="blue-color">合格</span>
<span v-else class="red-color">不合格</span>
</div>
<div v-else-if="item.key==='progress'">
{{scope.row[item.key].display}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
<template slot="setting">
<VXESettingCol :pageColumns="pageColumns" :userColumns="userColumns" @on-result-change="_resetColumn"
:table-name="tableName"></VXESettingCol>
</template>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<Modal v-model="showIssueModal" @on-cancel="_issueCancel"
@on-ok="_issueOk"
class="zIndex-1100">
<p slot="header">请选择签发日期</p>签发日期:
<DatePicker :editable="false"
v-model="issueDateTemp"
@on-change='_issueChange'
placeholder="请选择签发日期"
style="width:400px">
</DatePicker>
</Modal>
</div>
</template>
<script>
import { soilReport, soilStatistics, soilTest } from '../../../api'
import Global from '../../../api/config'
/**
* 报告编制的-待办-报告台账
*/
export default {
components: {},
data() {
return {
notOkCountList: [
{ value: 0, name: '合格' },
{ value: 1, name: '不合格' }
],
currentComponent: '',
searchOpen: false,
getPage: {},
pageColumns: [
{ title: '创建人', key: 'uname', width: 180, fixed: 'left' },
{ title: '报告类型', key: 'reportType', width: 180 },
{ title: '备注', key: 'remark', width: 180 },
{ title: '创建时间', key: 'ctime', width: 180, dateTime: true }
],
btn: [
{
type: 'primary',
id: '',
name: '提交'
}
],
selectIds: [],
selectData: [],
formObj: {
entrustId: ''
},
dateList: [],
iconMsg: [{ type: 'ios-book', id: '', name: '预览报告' }],
// 签发日期
issueDateTemp: '',
issueDate: '',
showIssueModal: false,
reportId: '',
tempId: '',
reportType: 'FOOD_REPORT_MAKE',
// 批量还是单个生成报告
reportBatch: false,
reportBatchData: {},
dataPushedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
userColumns: [],
tableName: 'food-report-make-report-info-by-contract',
reportStatus: 'FLOW_REPORT_MAKE'
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('tabSearchTwo')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
mounted() {},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 盖章
_toPDF() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_reportDateChange(data) {
this.formObj.reportDueDateBegin = data[0]
this.formObj.reportDueDateEnd = data[1]
},
// 签发日期
_issueChange(data) {
if (data) {
this.issueDate = data
}
},
_modalResult(data) {
switch (this.currentComponent) {
case 'Reason':
this._overdueReason(data)
break
case 'ReportTemplateModal':
this._regenerate(data)
break
case 'AssignPerson':
this._auditorResult(data)
break
default:
this._page()
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '上传':
this._upload(data.id)
break
case '预览报告':
this._reportView(data)
break
case '操作记录':
this._record(data.id)
break
case '项目台账':
this.$refs.refModal._open(data.id)
break
case '历史版本':
this.$refs.refModal._open(data.id, this.reportType)
break
case '附件':
this.$refs.refModal._open(data.id, 'reportId')
break
case '档案查看':
this.reportViewFiles(data, {
location: 'report',
archivesType: 'reportManage'
})
break
}
})
},
_upload(id) {
this.$refs.refModal._open(id)
},
_reportView(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this._recordView(data.originalRecordId)
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.reportGetById(data.id)
if (result) {
console.log('result')
this._viewReport(result)
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 12,
id: data.id,
isReport: 4
})
}
},
_recordView(originalRecordId) {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'table-col':
console.log('table-col', data)
this.userColumns = data
break
case 'changeSize':
this._page()
break
}
},
_open(entrustId) {
this.formObj = this.$resetFields(this.formObj)
this.formObj.entrustId = entrustId
this.showIssueModal = false
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageSummaryCheck(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_record(id) {
// 操作记录
this.$refs.refModal._open(id)
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '提交':
this._submit()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 选择审核人
_selectAuditor() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('auditor', '选择审核人')
}
},
_editReportAptitude() {
this.$refs.refModal._open(this.formObj.contractId)
},
_batchOverdueReason() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('超期原因')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this.$emit('on-result-change')
this._page()
},
_issueCancel() {
this.showIssueModal = false
},
// 选择时间ok
_issueOk() {
this.showIssueModal = false
this._createOk()
},
_submit() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this._submitSummaryReportConfirm(
ids,
`确认要提交 ${ids.length} 条数据吗?`
)
}
},
_submitSummaryReportConfirm(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._submitSummaryReportOk(ids)
}
})
},
async _submitSummaryReportOk(ids) {
const result = await soilStatistics.summaryReportCheckSubmit(ids)
if (result) {
this._resultChange('提交成功!')
}
}
}
}
</script>
......@@ -65,6 +65,7 @@
<FileManage ref="FileManage" @on-result-change="_fileResult" />
<Reason ref="reasonModal" @on-result-change="_reasonResult" />
<OperationModal ref="operationModal" />
<SampleByMakeModal ref="summaryModal" @on-result-change="_page"></SampleByMakeModal>
</div>
</template>
......@@ -74,9 +75,10 @@ import { soilSample, soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation'
import SampleByMakeModal from '../SampleByMakeModal'
export default {
name: 'PreparationManage',
components: { Reason, OperationModal },
components: { Reason, OperationModal, SampleByMakeModal },
data() {
return {
name: '',
......@@ -84,23 +86,24 @@ export default {
{
title: '委托商',
key: 'client',
width: 100,
width: 160,
fixed: 'left'
},
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '报告编号', key: 'reportCode', width: 100 },
{ title: '进度', key: 'progress', width: 110, status: true },
{ title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 100, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 100 },
{ title: '钻孔名称', key: 'boreholeName', width: 100 },
{ title: '水深', key: 'waterDepth', width: 100 },
{ title: '项目名称', key: 'projectName', width: 150 },
{ title: '委托编号', key: 'entrustCode', width: 150 },
// { title: '报告编号', key: 'reportCode', width: 100 },
// { title: '进度', key: 'progress', width: 110, status: true },
// { title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 130, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '水深', key: 'waterDepth', width: 150 },
{ title: '制表人', key: 'tabulater', width: 110 },
{ title: '制表日期', key: 'tabulateDate', width: 110, date: true }
],
btn: [
{ id: '', type: 'primary', name: '提交' },
{ id: '', type: 'primary', name: '退回' }
// { id: '', type: 'primary', name: '提交' },
// { id: '', type: 'primary', name: '退回' }
],
getPage: {},
searchOpen: false,
......@@ -109,6 +112,7 @@ export default {
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-book', name: '查看汇总报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......@@ -127,7 +131,7 @@ export default {
async _page() {
const data = this.$serialize('lab-sample-form')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportCheck(data)
const result = await soilStatistics.pageReportCheckBySummaryReport(data)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
......@@ -139,7 +143,6 @@ export default {
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
......@@ -152,12 +155,6 @@ export default {
case '退回':
this._goBack()
break
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -207,12 +204,6 @@ export default {
}
})
},
async _receiveIds(ids) {
const result = await soilStatistics.submitReportCheck(ids)
if (result) {
this._resultChange('提交成功!')
}
},
_submitReportCheck() {
const data = this.selectData
if (data.length === 0) {
......@@ -249,16 +240,6 @@ export default {
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('请至少选择一条数据!')
......@@ -293,6 +274,9 @@ export default {
case '预览报告':
this._viewReport(data)
break
case '查看汇总报告':
this._viewSummary(data)
break
case '操作日志':
this._record(data.id)
break
......@@ -304,7 +288,9 @@ export default {
_viewReport(data) {
this._getObjectKey(data)
},
_viewSummary(data) {
this.$refs.summaryModal._open(data.id)
},
_getObjectKey: async function(data) {
const result = await soilSample.getReport(data.id)
if (result) {
......@@ -326,9 +312,6 @@ export default {
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()
......
<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="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import SummaryInfo from './SummaryInfo'
export default {
components: {
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 = 'summary'
this.entrustId = entrustId
this.$refs.summaryTabs._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>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<btn-list :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
:msg="btn" class="contHide">
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :tableName="tableName"
select-data is-report>
<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 (userColumns.length>0?userColumns: pageColumns)"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'): ''}}
</div>
<div v-else-if="item.dateTime">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'): ''}}
</div>
<div v-else-if="item.judge">{{Number(scope.row[item.key])===1?'是':'否'}}
</div>
<div v-else-if="item.notOkCount">
<span v-if="scope.row[item.key] === 0" class="blue-color">合格</span>
<span v-else class="red-color">不合格</span>
</div>
<div v-else-if="item.key==='progress'">
{{scope.row[item.key].display}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
<template slot="setting">
<VXESettingCol :pageColumns="pageColumns" :userColumns="userColumns" @on-result-change="_resetColumn"
:table-name="tableName"></VXESettingCol>
</template>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<Modal v-model="showIssueModal" @on-cancel="_issueCancel"
@on-ok="_issueOk"
class="zIndex-1100">
<p slot="header">请选择签发日期</p>签发日期:
<DatePicker :editable="false"
v-model="issueDateTemp"
@on-change='_issueChange'
placeholder="请选择签发日期"
style="width:400px">
</DatePicker>
</Modal>
</div>
</template>
<script>
import http from '../../../api/http'
import { soilReport, soilStatistics, soilTest } from '../../../api'
import Global from '../../../api/config'
/**
* 报告编制的-待办-报告台账
*/
export default {
components: {},
data() {
return {
notOkCountList: [
{ value: 0, name: '合格' },
{ value: 1, name: '不合格' }
],
currentComponent: '',
searchOpen: false,
getPage: {},
pageColumns: [
{ title: '创建人', key: 'uname', width: 180, fixed: 'left' },
{ title: '报告类型', key: 'reportType', width: 180 },
{ title: '备注', key: 'remark', width: 180 },
{ title: '创建时间', key: 'ctime', width: 180, dateTime: true }
],
btn: [
{
type: 'primary',
id: '',
name: '提交'
}
],
selectIds: [],
selectData: [],
formObj: {
entrustId: ''
},
dateList: [],
iconMsg: [{ type: 'ios-book', id: '', name: '预览报告' }],
// 签发日期
issueDateTemp: '',
issueDate: '',
showIssueModal: false,
reportId: '',
tempId: '',
reportType: 'FOOD_REPORT_MAKE',
// 批量还是单个生成报告
reportBatch: false,
reportBatchData: {},
dataPushedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
userColumns: [],
tableName: 'food-report-make-report-info-by-contract',
reportStatus: 'FLOW_REPORT_MAKE'
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('tabSearchTwo')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
mounted() {},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 盖章
_toPDF() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_reportDateChange(data) {
this.formObj.reportDueDateBegin = data[0]
this.formObj.reportDueDateEnd = data[1]
},
// 签发日期
_issueChange(data) {
if (data) {
this.issueDate = data
}
},
_modalResult(data) {
switch (this.currentComponent) {
case 'Reason':
this._overdueReason(data)
break
case 'ReportTemplateModal':
this._regenerate(data)
break
case 'AssignPerson':
this._auditorResult(data)
break
default:
this._page()
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '上传':
this._upload(data.id)
break
case '预览报告':
this._reportView(data)
break
case '操作记录':
this._record(data.id)
break
case '项目台账':
this.$refs.refModal._open(data.id)
break
case '历史版本':
this.$refs.refModal._open(data.id, this.reportType)
break
case '附件':
this.$refs.refModal._open(data.id, 'reportId')
break
case '档案查看':
this.reportViewFiles(data, {
location: 'report',
archivesType: 'reportManage'
})
break
}
})
},
_upload(id) {
this.$refs.refModal._open(id)
},
_reportView(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this._recordView(data.originalRecordId)
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.reportGetById(data.id)
if (result) {
console.log('result')
this._viewReport(result)
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 12,
id: data.id,
isReport: 4
})
}
},
_recordView(originalRecordId) {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'table-col':
console.log('table-col', data)
this.userColumns = data
break
case 'changeSize':
this._page()
break
}
},
_open(entrustId) {
this.formObj = this.$resetFields(this.formObj)
this.formObj.entrustId = entrustId
this.showIssueModal = false
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageSummaryIssue(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_record(id) {
// 操作记录
this.$refs.refModal._open(id)
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '提交':
this._submit()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 选择审核人
_selectAuditor() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('auditor', '选择审核人')
}
},
_editReportAptitude() {
this.$refs.refModal._open(this.formObj.contractId)
},
_batchOverdueReason() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('超期原因')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this.$emit('on-result-change')
this._page()
},
_issueCancel() {
this.showIssueModal = false
},
// 选择时间ok
_issueOk() {
this.showIssueModal = false
this._createOk()
},
_downloadBatch() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + ids.length + ' 个报告?',
onOk: () => {
const obj = {
ids: ids.join(','),
contractId: this.formObj.contractId,
flag: 0
}
http.open(
Global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
obj,
'_blank'
)
}
})
}
},
_submit() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this._submitSummaryReportConfirm(
ids,
`确认要提交 ${ids.length} 条数据吗?`
)
}
},
_submitSummaryReportConfirm(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._submitSummaryReportOk(ids)
}
})
},
async _submitSummaryReportOk(ids) {
const result = await soilStatistics.summaryReportIssueSubmit(ids)
if (result) {
this._resultChange('提交成功!')
}
}
}
}
</script>
......@@ -2,8 +2,8 @@
<div>
<Row>
<Form
id="lab-sample-form"
v-show="searchOpen"
id="lab-sample-form"
:label-width="70"
inline
onsubmit="return false"
......@@ -11,10 +11,10 @@
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
<Input name="client" placeholder="请输入委托方" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
<Input name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" />
</Form-item>
<!-- <Form-item class="search-item" label="报检时间:">-->
<!-- <Date-picker-->
......@@ -30,13 +30,13 @@
<!-- <input type="hidden" name="inspectionDateEnd">-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
<Button type="primary" @click="_formSearch">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" />
</Col>
<!-- <Col span="24">-->
<!-- &lt;!&ndash; <Button type="primary" @click="_submitReportCheck">&ndash;&gt;-->
......@@ -57,9 +57,9 @@
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box
select-data
@on-result-change="_tableResultChange"
>
<vxe-table-column
v-for="item in pageColumns"
......@@ -89,6 +89,7 @@
<fileManage ref="FileManage" @on-result-change="_fileResult" />
<Reason ref="reasonModal" @on-result-change="_reasonResult" />
<OperationModal ref="operationModal" />
<SampleByMakeModal ref="summaryModal" @on-result-change="_page"></SampleByMakeModal>
</div>
</template>
......@@ -98,9 +99,10 @@ import { soilSample, soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation'
import SampleByMakeModal from '../SampleByMakeModal'
export default {
name: 'PreparationManage',
components: { Reason, OperationModal },
components: { Reason, OperationModal, SampleByMakeModal },
data() {
return {
name: '',
......@@ -108,17 +110,18 @@ export default {
{
title: '委托商',
key: 'client',
width: 100,
width: 160,
fixed: 'left'
},
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '报告编号', key: 'reportCode', width: 100 },
{ title: '进度', key: 'progress', width: 110, status: true },
{ title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 100, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 100 },
{ title: '钻孔名称', key: 'boreholeName', width: 100 },
{ title: '水深', key: 'waterDepth', width: 100 },
{ title: '项目名称', key: 'projectName', width: 150 },
{ title: '委托编号', key: 'entrustCode', width: 150 },
// { title: '报告编号', key: 'reportCode', width: 100 },
// { title: '进度', key: 'progress', width: 110, status: true },
// { title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 130, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '水深', key: 'waterDepth', width: 150 },
{ title: '制表人', key: 'tabulater', width: 110 },
{ title: '制表日期', key: 'tabulateDate', width: 110, date: true }
],
......@@ -133,6 +136,7 @@ export default {
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-book', name: '查看汇总报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......@@ -151,7 +155,7 @@ export default {
async _page() {
const data = this.$serialize('lab-sample-form')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportIssue(data)
const result = await soilStatistics.pageReportIssueBySummaryReport(data)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
......@@ -328,11 +332,17 @@ export default {
case '预览报告':
this._viewReport(data)
break
case '查看汇总报告':
this._viewSummary(data)
break
case '操作日志':
this._record(data.id)
break
}
},
_viewSummary(data) {
this.$refs.summaryModal._open(data.id)
},
_viewReport(data) {
this._getObjectKey(data)
},
......
......@@ -7,16 +7,16 @@
<!--查询-->
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :tableName="tableName"
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" @on-result-change="_tableResultChange"
select-data is-report>
<vxe-table-column
v-for="item in (userColumns.length>0?userColumns: pageColumns)"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in (userColumns.length>0?userColumns: pageColumns)"
:key="item.key" sortable>
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'): ''}}
</div>
......@@ -36,8 +36,8 @@
</template>
</vxe-table-column>
<template slot="setting">
<VXESettingCol :pageColumns="pageColumns" :userColumns="userColumns" @on-result-change="_resetColumn"
:table-name="tableName"></VXESettingCol>
<VXESettingCol :page-columns="pageColumns" :user-columns="userColumns" :table-name="tableName"
@on-result-change="_resetColumn"></VXESettingCol>
</template>
</PTVXETable>
</Col>
......@@ -48,8 +48,8 @@
@on-ok="_issueOk"
class="zIndex-1100">
<p slot="header">请选择签发日期</p>签发日期:
<DatePicker :editable="false"
v-model="issueDateTemp"
<DatePicker v-model="issueDateTemp"
:editable="false"
@on-change='_issueChange'
placeholder="请选择签发日期"
style="width:400px">
......@@ -58,8 +58,6 @@
</div>
</template>
<script>
import global from '../../../../api/config'
import http from '../../../../api/http'
import { soilReport, soilTest } from '../../../../api'
import Global from '../../../../api/config'
......@@ -89,33 +87,7 @@ export default {
entrustId: ''
},
dateList: [],
iconMsg: [
{ type: 'ios-book', id: '', name: '预览/编辑报告' }
// {
// type: 'ios-document',
// id: '',
// name: '项目台账',
// componentName: 'ItemModalByReportMake'
// },
// {
// type: 'ios-cloud-upload',
// id: '',
// name: '上传',
// componentName: 'UploadByReport'
// },
// {
// type: 'cloud',
// id: '',
// name: '附件',
// componentName: 'ReportFileManage'
// },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'FoodReportRecord'
// }
],
iconMsg: [{ type: 'ios-book', id: '', name: '预览/编辑报告' }],
// 签发日期
issueDateTemp: '',
issueDate: '',
......@@ -148,14 +120,6 @@ export default {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 盖章
_toPDF() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_reportDateChange(data) {
this.formObj.reportDueDateBegin = data[0]
this.formObj.reportDueDateEnd = data[1]
......@@ -188,12 +152,8 @@ export default {
case '上传':
this._upload(data.id)
break
case '重新生成':
this.$refs.refModal._open(data)
break
case '预览/编辑报告':
this._reportView(data)
// this._viewReport(data)
break
case '操作记录':
this._record(data.id)
......@@ -207,12 +167,6 @@ export default {
case '附件':
this.$refs.refModal._open(data.id, 'reportId')
break
case '档案查看':
this.reportViewFiles(data, {
location: 'report',
archivesType: 'reportManage'
})
break
}
})
},
......@@ -229,8 +183,6 @@ export default {
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.expReportGetById(data.id)
// this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
console.log('result')
this._viewReport(result)
......@@ -272,12 +224,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.reportBatch = false
this.reportBatchData = {}
this.getPage = this.$store.state.FoodSampleReport.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -305,7 +251,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExperimentReport(
const result = await soilTest.pageExpReportEnd(
this.$serializeForm(this.formObj)
)
if (result) {
......@@ -336,103 +282,15 @@ export default {
case '删除':
this._deleteSelected()
break
case '记录报告超期原因':
this._batchOverdueReason()
break
case '修改报告资质要求':
this._editReportAptitude()
break
case '选择审核人':
this._selectAuditor()
break
case '重新生成':
if (this.selectData.length > 0) {
this.$refs.refModal._open({
reportBatch: true,
id: '',
tempId: this.selectData[0].tempId
})
} else {
this.$msgTip('warning')
}
break
case '推送至国抽平台':
this._selectToGc()
break
case '完成':
this._achieveReport()
break
case '盖章':
this._toPDF()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 完成报告
_achieveReport() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定完成这' + this.selectIds.length + '个报告?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/submitMakeToEnd', {
reportIds: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$msgTip('success', '提交成功')
this._page()
}
this.$Modal.remove()
})
}
})
}
},
// 推送至国抽
_selectToGc() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确认提交这' + this.selectIds.length + '条数据至国抽平台?',
loading: true,
onOk: () => {
this._submitToGc()
}
})
}
},
_submitToGc() {
// 提交之前进行验证
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch('FoodSample/pushDataToGcReport', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSample.success) {
this.$msgTip('success', '提交成功')
this._page()
}
this.$Modal.remove()
})
}
})
},
// 选择审核人
_selectAuditor() {
if (this.selectIds.length === 0) {
......@@ -441,30 +299,6 @@ export default {
this.$refs.refModal._open('auditor', '选择审核人')
}
},
_auditorResult(data) {
const tempData = {
auditorId: data.userId,
auditor: data.realname,
ids: this.selectIds.join(',')
}
this.$layxLoading()
// 提交之前进行验证
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch('FoodSampleReport/submitMakeToAuditor', tempData)
.then(() => {
this._resultChange('提交成功')
})
} else {
this.$layxLoading(false)
}
})
},
_editReportAptitude() {
this.$refs.refModal._open(this.formObj.contractId)
},
......@@ -475,83 +309,13 @@ export default {
this.$refs.refModal._open('超期原因')
}
},
_overdueReason(reason) {
this.$layxLoading()
this.$store
.dispatch('FoodReportSummary/addReason', {
ids: this.selectIds.join(','),
reason: reason
})
.then(() => {
if (this.$store.state.FoodReportSummary.success) {
this.$Message.success('操作成功!')
this._page()
}
this.$layxLoading(false)
})
},
_resultChange(msg) {
if (this.$store.state.FoodSampleReport.success) {
this.$Message.success(msg)
this._page()
}
this.$Message.success(msg)
this._page()
this.$Modal.remove()
this.$layxLoading(false)
},
// 重新生成报告ok(多个)
_regenerateBatch() {
const validateObj = {
ids: this.selectIds.join(','),
issueDate: this.issueDate,
reportModelId: this.reportBatchData.tempId
}
// 先进行验证
this.$store
.dispatch('FoodSampleReport/generateAgainBatchCheck', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
// true --- 建立连接
this.currentComponent = 'ProgressByRegenerateReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds.length, currentTime)
})
validateObj.seriesNo = currentTime
this.$store
.dispatch('FoodSampleReport/generateAgainBatch', validateObj)
.then(() => {})
}
})
},
// 重新生成报告(单个、批量)
_regenerate(data) {
this.reportBatch = data.reportBatch
this.reportBatchData = data
if (!data.reportBatch) {
// 单个生成
this.reportId = data.id
this.tempId = data.tempId
}
// 判断字典中是否配置报告编制日期
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 = ''
} else {
// 配置为no不弹出
this.showIssueModal = false
this.issueDate = ''
this._createOk()
}
})
},
_issueCancel() {
this.showIssueModal = false
},
......@@ -560,23 +324,6 @@ export default {
this.showIssueModal = false
this._createOk()
},
// 生成报告
_createOk() {
if (!this.reportBatch) {
// 单个生成报告
const obj = {
id: this.reportId,
issueDate: this.issueDate,
reportModelId: this.tempId
}
this.$store.dispatch('FoodSampleReport/generateAgain', obj).then(() => {
this._resultChange('报告重新生成成功')
})
} else {
// 批量改生成报告
this._regenerateBatch()
}
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
......@@ -585,88 +332,6 @@ export default {
} else {
this._deleteByIds(ids.join(','), '确定删除 ' + ids.length + ' 条记录?')
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/sampleReportDeletes', { ids: ids })
.then(() => {
this._resultChange('删除成功!')
})
}
})
},
_downloadBatch() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + ids.length + ' 个报告?',
onOk: () => {
const obj = {
ids: ids.join(','),
contractId: this.formObj.contractId,
flag: 0
}
http.open(
global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
obj,
'_blank'
)
}
})
}
},
_submit(msg) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
let url = ''
let successMsg = ''
let content = ''
switch (msg) {
case 'submit':
// 提交
url = 'FoodSampleReport/submitMake'
successMsg = '提交成功'
content = '确定要提交这 ' + ids.length + ' 条数据?'
break
case 'submit-to-issue':
// 提交至报告签发
url = 'FoodSampleReport/submitToIssue'
successMsg = '成功提交至报告签发'
content = '确定要将这 ' + ids.length + ' 条数据提交至报告签发?'
break
}
this.$Modal.confirm({
title: '提示',
content: content,
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch(url, { ids: this.selectIds.join(',') })
.then(() => {
this._resultChange(successMsg)
})
}
})
}
})
}
}
}
}
......
......@@ -22,16 +22,6 @@
<Col span="24">
<btn-list :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
:msg="btn" class="contHide">
<!-- <template slot="processTask">-->
<!-- <div class="fr process-task">-->
<!-- <el-checkbox v-model="personal" @change="_page" :true-label="1" :false-label="0" size="medium">-->
<!-- 个人任务-->
<!-- </el-checkbox>-->
<!-- <el-checkbox v-model="onlyReportMake" @change="_page" :true-label="1"-->
<!-- :false-label="0" size="medium">只显示待编报告-->
<!-- </el-checkbox>-->
<!-- </div>-->
<!-- </template>-->
</btn-list>
</Col>
<!-- 表格 -->
......@@ -206,22 +196,6 @@ export default {
$('input[name="reportDueDateBegin"]').val(data[0])
$('input[name="reportDueDateEnd"]').val(data[1])
},
// 从字典查预警期
_dicSearch() {
// 食品报告编制个人任务是否勾选
const data = ['食品报告编制个人任务是否勾选']
this.$store.dispatch('LmsBaseDict/listDict', data).then(() => {
const result = this.$store.state.LmsBaseDict.list
const personalList = result[0]
// 食品报告编制个人任务是否勾选
if (personalList.length && personalList[0].name === '是') {
this.personal = 1
} else {
this.personal = 0
}
this._page()
})
},
_btnClick(msg) {
switch (msg) {
case '信息维护':
......@@ -386,7 +360,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageReportMake(
const result = await soilStatistics.pageReportMakeByExpReport(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -5,6 +5,11 @@
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<btn-list :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
:msg="btn" class="contHide">
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
......@@ -58,9 +63,8 @@
</div>
</template>
<script>
import global from '../../../../api/config'
import http from '../../../../api/http'
import { soilReport, soilTest } from '../../../../api'
import { soilReport, soilStatistics, soilTest } from '../../../../api'
import Global from '../../../../api/config'
/**
......@@ -83,39 +87,20 @@ export default {
{ title: '备注', key: 'remark', width: 180 },
{ title: '创建时间', key: 'ctime', width: 180, dateTime: true }
],
btn: [
{
type: 'primary',
id: '',
name: '提交'
}
],
selectIds: [],
selectData: [],
formObj: {
entrustId: ''
},
dateList: [],
iconMsg: [
{ type: 'ios-book', id: '', name: '预览报告' }
// {
// type: 'ios-document',
// id: '',
// name: '项目台账',
// componentName: 'ItemModalByReportMake'
// },
// {
// type: 'ios-cloud-upload',
// id: '',
// name: '上传',
// componentName: 'UploadByReport'
// },
// {
// type: 'cloud',
// id: '',
// name: '附件',
// componentName: 'ReportFileManage'
// },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'FoodReportRecord'
// }
],
iconMsg: [{ type: 'ios-book', id: '', name: '预览报告' }],
// 签发日期
issueDateTemp: '',
issueDate: '',
......@@ -188,12 +173,8 @@ export default {
case '上传':
this._upload(data.id)
break
case '重新生成':
this.$refs.refModal._open(data)
break
case '预览报告':
this._reportView(data)
// this._viewReport(data)
break
case '操作记录':
this._record(data.id)
......@@ -229,8 +210,6 @@ export default {
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.reportGetById(data.id)
// this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
console.log('result')
this._viewReport(result)
......@@ -272,12 +251,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.reportBatch = false
this.reportBatchData = {}
this.getPage = this.$store.state.FoodSampleReport.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -325,45 +298,7 @@ export default {
this.$nextTick(function() {
switch (msg) {
case '提交':
this._submit('submit')
break
case '提交至报告签发':
this._submit('submit-to-issue')
break
case '下载':
this._downloadBatch()
break
case '删除':
this._deleteSelected()
break
case '记录报告超期原因':
this._batchOverdueReason()
break
case '修改报告资质要求':
this._editReportAptitude()
break
case '选择审核人':
this._selectAuditor()
break
case '重新生成':
if (this.selectData.length > 0) {
this.$refs.refModal._open({
reportBatch: true,
id: '',
tempId: this.selectData[0].tempId
})
} else {
this.$msgTip('warning')
}
break
case '推送至国抽平台':
this._selectToGc()
break
case '完成':
this._achieveReport()
break
case '盖章':
this._toPDF()
this._submit()
break
case 'search':
this.searchOpen = !this.searchOpen
......@@ -371,68 +306,6 @@ export default {
}
})
},
// 完成报告
_achieveReport() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定完成这' + this.selectIds.length + '个报告?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/submitMakeToEnd', {
reportIds: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$msgTip('success', '提交成功')
this._page()
}
this.$Modal.remove()
})
}
})
}
},
// 推送至国抽
_selectToGc() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确认提交这' + this.selectIds.length + '条数据至国抽平台?',
loading: true,
onOk: () => {
this._submitToGc()
}
})
}
},
_submitToGc() {
// 提交之前进行验证
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch('FoodSample/pushDataToGcReport', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSample.success) {
this.$msgTip('success', '提交成功')
this._page()
}
this.$Modal.remove()
})
}
})
},
// 选择审核人
_selectAuditor() {
if (this.selectIds.length === 0) {
......@@ -441,30 +314,6 @@ export default {
this.$refs.refModal._open('auditor', '选择审核人')
}
},
_auditorResult(data) {
const tempData = {
auditorId: data.userId,
auditor: data.realname,
ids: this.selectIds.join(',')
}
this.$layxLoading()
// 提交之前进行验证
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch('FoodSampleReport/submitMakeToAuditor', tempData)
.then(() => {
this._resultChange('提交成功')
})
} else {
this.$layxLoading(false)
}
})
},
_editReportAptitude() {
this.$refs.refModal._open(this.formObj.contractId)
},
......@@ -475,82 +324,9 @@ export default {
this.$refs.refModal._open('超期原因')
}
},
_overdueReason(reason) {
this.$layxLoading()
this.$store
.dispatch('FoodReportSummary/addReason', {
ids: this.selectIds.join(','),
reason: reason
})
.then(() => {
if (this.$store.state.FoodReportSummary.success) {
this.$Message.success('操作成功!')
this._page()
}
this.$layxLoading(false)
})
},
_resultChange(msg) {
if (this.$store.state.FoodSampleReport.success) {
this.$Message.success(msg)
this._page()
}
this.$Modal.remove()
this.$layxLoading(false)
},
// 重新生成报告ok(多个)
_regenerateBatch() {
const validateObj = {
ids: this.selectIds.join(','),
issueDate: this.issueDate,
reportModelId: this.reportBatchData.tempId
}
// 先进行验证
this.$store
.dispatch('FoodSampleReport/generateAgainBatchCheck', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
// true --- 建立连接
this.currentComponent = 'ProgressByRegenerateReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds.length, currentTime)
})
validateObj.seriesNo = currentTime
this.$store
.dispatch('FoodSampleReport/generateAgainBatch', validateObj)
.then(() => {})
}
})
},
// 重新生成报告(单个、批量)
_regenerate(data) {
this.reportBatch = data.reportBatch
this.reportBatchData = data
if (!data.reportBatch) {
// 单个生成
this.reportId = data.id
this.tempId = data.tempId
}
// 判断字典中是否配置报告编制日期
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 = ''
} else {
// 配置为no不弹出
this.showIssueModal = false
this.issueDate = ''
this._createOk()
}
})
this.$Message.success(msg)
this._page()
},
_issueCancel() {
this.showIssueModal = false
......@@ -560,46 +336,6 @@ export default {
this.showIssueModal = false
this._createOk()
},
// 生成报告
_createOk() {
if (!this.reportBatch) {
// 单个生成报告
const obj = {
id: this.reportId,
issueDate: this.issueDate,
reportModelId: this.tempId
}
this.$store.dispatch('FoodSampleReport/generateAgain', obj).then(() => {
this._resultChange('报告重新生成成功')
})
} else {
// 批量改生成报告
this._regenerateBatch()
}
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids.join(','), '确定删除 ' + ids.length + ' 条记录?')
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/sampleReportDeletes', { ids: ids })
.then(() => {
this._resultChange('删除成功!')
})
}
})
},
_downloadBatch() {
const ids = this.selectIds
if (ids.length === 0) {
......@@ -615,7 +351,7 @@ export default {
flag: 0
}
http.open(
global.baseURL +
Global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
obj,
'_blank'
......@@ -624,48 +360,30 @@ export default {
})
}
},
_submit(msg) {
_submit() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
let url = ''
let successMsg = ''
let content = ''
switch (msg) {
case 'submit':
// 提交
url = 'FoodSampleReport/submitMake'
successMsg = '提交成功'
content = '确定要提交这 ' + ids.length + ' 条数据?'
break
case 'submit-to-issue':
// 提交至报告签发
url = 'FoodSampleReport/submitToIssue'
successMsg = '成功提交至报告签发'
content = '确定要将这 ' + ids.length + ' 条数据提交至报告签发?'
break
this._submitSummaryReportConfirm(
ids,
`确认要提交 ${ids.length} 条数据吗?`
)
}
},
_submitSummaryReportConfirm(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || `确定要处理该条数据吗?`,
onOk: () => {
this._submitSummaryReportOk(ids)
}
this.$Modal.confirm({
title: '提示',
content: content,
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSampleReport/submitMakeCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
this.$store
.dispatch(url, { ids: this.selectIds.join(',') })
.then(() => {
this._resultChange(successMsg)
})
}
})
}
})
})
},
async _submitSummaryReportOk(ids) {
const result = await soilStatistics.summaryReportSubmit(ids)
if (result) {
this._resultChange('提交成功!')
}
}
}
......
......@@ -81,38 +81,7 @@ export default {
return {
currentComponent: '',
searchOpen: false,
btn: [
{
type: 'primary',
id: 'food-report-make-push-to-gc',
name: '推送至国抽平台'
},
{ type: 'success', id: 'ZBC', name: '生成' },
{
type: 'success',
id: 'food-report-make-select-template-create',
name: '选择模板生成',
componentName: 'CreateReport'
},
{
type: 'primary',
id: 'food-report-make-create-samples',
name: '多样品生成',
componentName: 'CreateReportBySamples'
},
{
type: 'primary',
id: 'food-report-make-edit-items',
name: '批量维护检测项目',
componentName: 'FoodItemBatchEditModal'
},
{
type: '',
id: 'food-report-make-sample-maintain-info',
name: '信息维护',
componentName: 'MaintainInfoModal'
}
],
btn: [{ type: 'success', id: 'ZBC', name: '生成' }],
getPage: {},
detectionDate: '',
pageColumns: [
......@@ -137,8 +106,7 @@ export default {
type: 'ios-beaker',
id: '',
name: '管理检测项目'
},
{ type: 'md-trash', id: '', name: '删除' }
}
],
iconMsg1: [
{
......@@ -198,9 +166,6 @@ export default {
// 进度条
this.$emit('on-result-change', 'changeTab')
break
case 'FoodSampleCompanyEdit':
case 'FoodSampleGovernLYEdit':
case 'FoodSampleGovernEdit':
case 'UploadReport':
// 单个编辑
this._updateRows()
......@@ -253,45 +218,8 @@ export default {
// 上传文件
this.$refs.refModal._open(id, 'sampleId')
},
_edit(data) {
if (data.type === 0) {
this.currentComponent = 'FoodSampleCompanyEdit'
this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel,
this.formObj.contractId
)
})
})
} else if (data.type === 2) {
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store.dispatch('FoodSample/getByGovernId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.formObj.contractId
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store.dispatch('FoodSample/getByGovernId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.formObj.contractId
)
})
})
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -340,63 +268,16 @@ export default {
case '选择模板生成':
this._judgeReport('create')
break
case '推送至国抽平台':
this._pushToGC()
break
case '多样品生成':
this._judgeReport('create-samples')
break
case '批量维护检测项目':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open(this.selectIds)
}
break
case '信息维护':
this._maintainInfo()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 信息维护
_maintainInfo() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds, 2)
}
},
// 推送至国抽平台
_pushToGC() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要推送这' + ids.length + '条数据至国抽平台?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSample/pushDataToGC', { ids: ids.join(',') })
.then(() => {
this._resultChange('信息推送成功')
})
}
})
}
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this.$Message.success(msg)
this._page()
this.selectIds = []
}
this.$Modal.remove()
this.$Message.success(msg)
this._page()
this.selectIds = []
},
// 生成报告
_judgeReport(name) {
......@@ -412,38 +293,6 @@ export default {
break
}
}
},
_createReport() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const validateObj = { sampleIds: this.selectIds }
// 先进行验证
this.$store
.dispatch('FoodSampleReport/generateAutomaticValidate', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
// true --- 建立连接
this.currentComponent = 'ProgressByReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds.length, currentTime)
})
validateObj.seriesNo = currentTime
this.$store
.dispatch('FoodSampleReport/generateAutomatic', validateObj)
.then(() => {})
} else {
// false --- 弹出选择模板框
this.currentComponent = 'CreateReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectData)
})
}
})
}
}
}
}
......
......@@ -305,7 +305,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.reportPage(
const result = await soilTest.pageSummaryEnd(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -98,27 +98,22 @@ export default {
{
title: '委托商',
key: 'client',
width: 100,
width: 160,
fixed: 'left'
},
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '报告编号', key: 'reportCode', width: 100 },
{ title: '进度', key: 'progress', width: 110, status: true },
{ title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 100, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 100 },
{ title: '钻孔名称', key: 'boreholeName', width: 100 },
{ title: '水深', key: 'waterDepth', width: 100 },
{ title: '项目名称', key: 'projectName', width: 150 },
{ title: '委托编号', key: 'entrustCode', width: 150 },
// { title: '报告编号', key: 'reportCode', width: 100 },
// { title: '进度', key: 'progress', width: 110, status: true },
// { title: '状态', key: 'status', width: 100, status: true },
{ title: '委托日期', key: 'entrustDate', width: 130, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '水深', key: 'waterDepth', width: 150 },
{ title: '制表人', key: 'tabulater', width: 110 },
{ title: '制表日期', key: 'tabulateDate', width: 110, date: true }
],
iconMsg: [
// {
// type: 'ios-list',
// id: '',
// name: '资料管理',
// componentName: 'ErecordIndex'
// },
{
type: 'ios-flask-outline',
id: '',
......@@ -136,35 +131,13 @@ export default {
name: '操作记录'
}
],
btn: [
{
type: 'primary',
id: 'food-report-manage-contract-push-to-gc',
name: '推送至国抽平台'
},
{
type: '',
id: 'food-report-manage-export-send-record',
name: '导出发放记录'
},
{
type: '',
id: 'food-report-manage-export-send-form',
name: '导出发放记录表'
},
{
type: '',
id: 'food-report-manage-export-report-collect',
name: '导出报告汇总统计表'
}
],
btn: [],
searchOpen: false,
selectIds: [],
formObj: {
reportSn: '',
num: ''
},
// 导出发放记录与统计表区分,false--统计表,true--统计表
exportSendRecords: false
}
},
......@@ -184,101 +157,20 @@ export default {
_modalChange(data) {
switch (this.currentComponent) {
case 'SelectReportExportModal':
if (this.exportSendRecords) {
// 导出发放记录
this._exportSendRecordsForm(data)
} else {
// 导出报告汇总统计表
this._exportReportCollect(data)
}
break
}
},
_btnClick(msg) {
switch (msg) {
case '导出发放记录':
this.currentComponent = 'GrantRecordModal'
this.$nextTick(() => {
this.$refs.refModal._open()
})
break
case '推送至国抽平台':
this._pushToGC()
break
case '导出发放记录表':
this.exportSendRecords = true
this.currentComponent = 'SelectReportExportModal'
this._exportSendForm()
break
case '导出报告汇总统计表':
this.exportSendRecords = false
this.currentComponent = 'SelectReportExportModal'
this._selectTempExport()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
// 导出发放记录表
_exportSendForm() {
this.$nextTick(() => {
this.$refs.refModal._open('food-report-manage-export-send-form')
})
},
// 导出发放记录表
_exportSendRecordsForm(result) {
const obj = {
param: 'ids',
ids: this.selectIds,
url: '',
queryObj: this.$serialize('search-form-report-tab')
}
obj.url = this.$judgeUrlChar(result) + '_n=' + '导出发放记录表'
// position,标识当前导出菜单位置用
this.$exportByQuery(obj, { position: 3 })
},
// 一个按钮对应多个报表
_selectTempExport() {
this.$nextTick(() => {
this.$refs.refModal._open('food-report-manage-export-report-collect')
})
},
// 导出报告汇总统计表
_exportReportCollect(url) {
const obj = {
param: 'ids',
ids: this.selectIds,
url: url,
queryObj: this.$serialize('search-form-report-tab')
}
this.$exportByQuery(obj)
},
// 推送至国抽平台
_pushToGC() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要推送这' + ids.length + '条数据至国抽平台?',
onOk: () => {
this.$store
.dispatch('FoodSample/pushDataToGCContract', ids)
.then(() => {
this._resultChange('信息推送成功')
})
}
})
}
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this.$Message.success(msg)
this._page()
this.selectIds = []
}
this.$Message.success(msg)
this._page()
this.selectIds = []
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
......@@ -327,9 +219,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
......@@ -341,11 +230,10 @@ export default {
break
}
},
// FoodContract/page
async _page() {
const data = this.$serialize('search-form-report-tab')
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await soilReport.pageReportIssueHis(data)
const result = await soilReport.pageReportEndBySummaryReport(data)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
......@@ -354,21 +242,6 @@ export default {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_detailModal(id, type) {
// 查看
this.$store.dispatch('FoodContract/getById', id).then(() => {
if (type === 0) {
// 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
}
this.$nextTick(() => {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
_search() {
this._page()
}
......
......@@ -564,12 +564,20 @@ export default {
/\$sampleCode\$/g,
undefined !== row.sampleCode ? row.sampleCode : ''
)
result = result.replace(/\$num\$/g, undefined !== row.num ? row.num : '')
result = result.replace(/\$resultDateTemp\$/g, row.resultDateTemp)
result = result.replace(
/\$groupId\$/g,
undefined !== row.groupId ? row.groupId : ''
)
result = result.replace(
/\$groupName\$/g,
undefined !== row.groupName ? row.groupName : ''
)
result = result.replace(
/\$prepareDate\$/g,
undefined !== row.prepareDate ? this._formatDate(row.prepareDate) : ''
)
result = result.replace(/\$num\$/g, undefined !== row.num ? row.num : '')
result = result.replace(/\$resultDateTemp\$/g, row.resultDateTemp)
// 检测项目
result = result.replace(
/\$items\$/g,
......
<template>
<div>
<div v-for="(itemInfo, index) in entrustList" :key="index" class="contract-box">
<Row>
<!--样品信息-->
<Col span="6">
<ul class="progress-ul">
<li>
<div class="title">委托单位</div>
<div class="cont">
<span
style="font-weight: bold"
>{{itemInfo.entrustVO.client}}</span>
</div>
</li>
<li>
<div class="title">委托编号</div>
<div class="cont">
{{itemInfo.entrustVO.entrustCode}}
</div>
</li>
<li>
<div class="title">钻孔名称</div>
<div class="cont">
{{itemInfo.entrustVO.boreholeName}}
</div>
</li>
<li>
<div class="title">水深(米)</div>
<div class="cont">
{{itemInfo.entrustVO.waterDepth}}
</div>
</li>
<li>
<div class="title">委托日期</div>
<div class="cont">
{{$dateformat(itemInfo.entrustVO.entrustDate)}}
</div>
</li>
<li>
<div class="title">项目负责人</div>
<div class="cont">
{{itemInfo.entrustVO.waterDepth}}
</div>
</li>
<li>
<div class="title">项目名称</div>
<div class="cont">
{{itemInfo.entrustVO.waterDepth}}
</div>
</li>
<li>
<div class="title">钻孔位置</div>
<div class="cont">
{{itemInfo.entrustVO.boreholeLocation}}
</div>
</li>
<li>
<div class="title">进度</div>
<div class="cont">
{{itemInfo.entrustVO.progress.display}}
</div>
</li>
</ul>
</Col>
<!--样品进度信息-->
<Col span="18">
<flowIndex></flowIndex>
</Col>
</Row>
</div>
</div>
</template>
<script>
import { soilEntrust } from '../../api'
import flowIndex from './flowIndex'
export default {
components: { flowIndex },
props: {
info: null
},
data() {
return {
progressList: [],
entrustList: []
}
},
watch: {
info: function(newVal, oldVal) {
console.log('newVal===========', newVal.oldValue)
}
},
mounted() {
this._getData()
},
methods: {
_getData: async function() {
const result = await soilEntrust.listSummaryQuery()
if (result) {
this.entrustList = result
console.log('this.entrustList', this.entrustList)
}
},
_sampleClick(data) {
// 样品详情
this.$refs.detail._open(data)
},
_console(info) {
console.log('info', info)
}
}
}
</script>
<style>
.progress-ul li {
border: 1px solid #ddd;
overflow: hidden;
}
.progress-ul li .title {
padding: 13px;
}
.progress-ul li .title {
width: 35%;
background: #eee;
padding: 13px;
border-right: 1px solid #ddd;
float: left;
}
.progress-ul li .cont {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-top: 15px;
padding-left: 15px;
float: left;
width: 65%;
}
.contract-box {
margin: 10px 0;
}
.contract-box {
border: 1px solid #dcdcdc;
}
</style>
<template>
<div style="position:relative;width:100%">
<div style="margin-top: 134px;">
<div class="flow-start">
<!--1.开始-->
<div class="flow-start">
<div
v-for="(itemStart,startIndex) in list.start"
:key="startIndex"
class="flow-start">
<PtCircle :name="itemStart.name" :value="itemStart.value"/>
<PtArrow :width="startIndex === 2?'20px':'10px'"
:noArrow="startIndex === 2?true:false"
:value="startEnd(startIndex,itemStart.value)"
style="margin-top: 30px;"/>
</div>
</div>
<!--2.分支-->
<div style="margin-top: -132px">
<div
v-for="(itemBranch,branchIndex) in list.branch"
:key="branchIndex">
<!--比较麻烦的在这里 start-->
<FlowBranch :list="itemBranch" :index="branchIndex" :endList="list.end" :branch="list.branch"/>
<!--比较麻烦的在这里 end-->
</div>
</div>
<!--3.结束-->
<div class="flow-start" style="margin-left: 70px;position: relative">
<div
v-for="(itemEnd,endIndex) in list.end"
:key="endIndex"
class="flow-start">
<!--上面的连接线-->
<PtArrow v-if="endIndex === 0" :isRote="true" :value="upLineClassObj()"
width="90px" style="position: absolute;top:-55px;left: -25px"/>
<!--下面的连接线-->
<PtArrow v-if="endIndex === 0" :isRote1="true" :value="downLineClassObj()"
width="90px" style="position: absolute;top:110px;left: -20px"/>
<PtCircle :name="itemEnd.name" :value="itemEnd.value"/>
<PtArrow v-if="endIndex !== 3" :value="endArrow(endIndex)" style="margin-top: 30px;"/>
</div>
</div>
</div>
</div>
<Legend style="position:absolute;bottom:0;right:0"/>
</div>
</template>
<script>
/**
* 流程结构
* 1.节点固定
* 2.蓝色的表示已经流转的节点;红色的表示在流程中,但是没有流转到的节点;灰色的表示没有的节点
* 3.前端根据value区分:value 为true--蓝色,为false--红色,undefined:灰色
* 4.key 值唯一,表示一个节点的英文名称
*/
import PtArrow from '../../components/flow/PtArrow'
import PtCircle from '../../components/flow/PtCircle'
import FlowBranch from '../../components/flow/FlowBranch'
import Legend from '../../components/flow/Legend'
export default {
name: 'Index',
components: {
PtArrow,
PtCircle,
FlowBranch,
Legend
},
data() {
return {
list: {
start: [
{ name: '收样', key: 'key1' },
{ name: '任务评审', key: 'key2' },
{ name: '开土', key: 'key3' }
],
branch: [
[
{ name: '物性试验', key: 'key4' },
{ name: '完成率', key: 'key5', line: true },
{ name: '自校版1', key: 'key6', type: 'rect' }
],
[
{ name: '力学试验', key: 'key7' },
{ name: '完成率', key: 'key8', line: true },
{ name: '自校版2', key: 'key9', type: 'rect' }
],
[
{ name: '高级试验', key: 'key10' },
{ name: '完成率', key: 'key11', line: true },
{ name: '自校版1', key: 'key12', type: 'rect' }
]
],
end: [
{ name: '报告编制', key: 'key13' },
{ name: '报告审核', key: 'key14' },
{ name: '报告批准', key: 'key15' },
{ name: '报告签发', key: 'key16' }
]
},
// 构造数据源
obj: {}
}
},
mounted() {
this.getData()
},
methods: {
getData() {
// 1.后台返回的数据,需要流转的全部节点数据(前后盾自己定义,对应上即可)
// key:bool (已经流转的节点为true,待流转的节点为false)
this.obj = {
key1: true,
key2: true,
key3: true,
key4: true,
key5: true,
key6: undefined,
// key7: true,
// key8: true,
// key9: true,
// key10: false,
// key11: false,
// key12: false,
key13: true,
key14: false,
key15: false,
key16: false,
key20: '20%'
}
// 2.前端进行过组合数据
const startArray = this.list.start
const branchArray = this.list.branch.flat() // 将一个二维数组拉平
const endArray = this.list.end
const allArray = startArray.concat(branchArray, endArray)
for (let i = 0; i < allArray.length; i++) {
const key = allArray[i].key
this.$set(allArray[i], 'value', this.obj[key])
if (allArray[i].key === 'key8') {
this.$set(allArray[i], 'per', this.obj.key20)
}
}
console.log('allArray', allArray)
console.log('this.list', this.list)
},
// 上面连接线颜色
upLineClassObj() {
console.log('右侧线')
const valueZero = this.list.end[0].value
const upValue = this.list.branch[0][2].value
const upValueZero = this.list.branch[0][0].value
if (
upValue === undefined ||
upValueZero === undefined ||
upValue === false
) {
return undefined
} else {
return valueZero
}
},
// 下面连接线颜色
downLineClassObj() {
const valueZero = this.list.end[0].value
const downValue = this.list.branch[2][2].value
const downValueZero = this.list.branch[2][0].value
if (
downValue !== undefined ||
(downValue === undefined && downValueZero === undefined)
) {
return undefined
} else {
return valueZero
}
},
// 开始模块的最后一个节点颜色(根据branch的第一个节点判断)
startEnd(index) {
let itemValue
const itemList = this.list.start[index + 1]
if (itemList !== undefined) {
itemValue = itemList.value
}
const branchZero = this.list.branch[0][0].value
const branchOne = this.list.branch[1][0].value
const branchTwo = this.list.branch[2][0].value
if (index === 2) {
if (branchZero !== undefined) {
return branchZero
}
if (branchOne !== undefined) {
return branchOne
}
if (branchTwo !== undefined) {
return branchTwo
}
} else {
return itemValue
}
},
endArrow(index) {
let itemValue
const itemList = this.list.end[index + 1]
if (itemList !== undefined) {
itemValue = itemList.value
}
return itemValue
}
}
}
</script>
<style>
.flow-start {
display: flex;
flex-direction: row;
justify-items: center;
}
</style>
......@@ -56,6 +56,9 @@
<!-- <Col span="12">-->
<!-- <CustomerContract></CustomerContract>-->
<!-- </Col>-->
<!-- <Col span="24">-->
<!-- <ItemFlow></ItemFlow>-->
<!-- </Col>-->
<div :style="{height}" v-if="moduleList.length" class="config_home">
<Row :gutter="10">
<Col
......@@ -91,6 +94,7 @@ import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract'
import SampleProgress from './sample-progress/SampleProgress'
import SampleProgressDetail from './SampleProgressDetail'
import ItemFlow from './ItemFlow'
export default {
name: 'Workbench',
components: {
......@@ -127,7 +131,9 @@ export default {
// eslint-disable-next-line vue/no-unused-components
SampleProgress,
// eslint-disable-next-line vue/no-unused-components
SampleProgressDetail
SampleProgressDetail,
// eslint-disable-next-line vue/no-unused-components
ItemFlow
},
data() {
return {
......
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