Commit 4b030a3e by wangweidong

土工试验Lims

parent f19c568f
......@@ -9,6 +9,12 @@ 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),
pageReportIssue: data =>
......@@ -54,7 +60,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 =>
......
......@@ -7,16 +7,16 @@
<!--查询-->
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :tableName="tableName"
select-data is-report>
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" select-data
is-report @on-result-change="_tableResultChange">
<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,31 +36,29 @@
</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>
</Row>
</div>
</div>
<Modal v-model="showIssueModal" @on-cancel="_issueCancel"
@on-ok="_issueOk"
class="zIndex-1100">
<Modal v-model="showIssueModal" class="zIndex-1100"
@on-cancel="_issueCancel"
@on-ok="_issueOk">
<p slot="header">请选择签发日期</p>签发日期:
<DatePicker :editable="false"
v-model="issueDateTemp"
@on-change='_issueChange'
<DatePicker v-model="issueDateTemp"
:editable="false"
placeholder="请选择签发日期"
style="width:400px">
style="width:400px"
@on-change='_issueChange'>
</DatePicker>
</Modal>
</div>
</template>
<script>
import global from '../../../../api/config'
import http from '../../../../api/http'
import { soilReport, soilTest } from '../../../../api'
import { soilReport, soilEntrust } 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,9 +251,10 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExperimentReport(
const result = await soilEntrust.pageGroupExpReportIssue(
this.$serializeForm(this.formObj)
)
alert(result)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......@@ -336,103 +283,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 +300,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 +310,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.$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 +325,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 +333,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) {
......
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