Commit e3c59339 by wangweidong

土工试验Lims

parent 4b01400f
......@@ -17,6 +17,11 @@ export default {
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 =>
......@@ -84,5 +89,9 @@ 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)
}
......@@ -84,23 +84,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,
......@@ -127,7 +128,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 +140,6 @@ export default {
.each(function() {
$(this).val('')
})
// this.$refs.sampleTime.handleClear()
},
_btnClick(msg, data) {
switch (msg) {
......@@ -152,12 +152,6 @@ export default {
case '退回':
this._goBack()
break
case '扫码接收':
this._scanReceive()
break
case '手动接收':
this._sampleReceive()
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -207,12 +201,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 +237,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('请至少选择一条数据!')
......@@ -326,9 +304,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()
......
......@@ -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"
......@@ -60,7 +65,7 @@
<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 +88,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 +174,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 +211,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 +252,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 +299,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 +307,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 +315,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 +325,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()
}
})
},
_issueCancel() {
this.showIssueModal = false
......@@ -560,46 +337,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) {
......@@ -624,48 +361,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,
loading: true,
content: content || `确定要处理该条数据吗?`,
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)
})
}
})
this._submitSummaryReportOk(ids)
}
})
},
async _submitSummaryReportOk(ids) {
const result = await soilStatistics.summaryReportSubmit(ids)
if (result) {
this._resultChange('提交成功!')
}
}
}
......
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