Commit 52c97148 by lichengming

修改了报告编制

parent 31582de9
...@@ -88,5 +88,8 @@ export default { ...@@ -88,5 +88,8 @@ export default {
getReport: data => getReport: data =>
http.get('soil/v1/report/get_report_' + data).then(res => res), http.get('soil/v1/report/get_report_' + data).then(res => res),
getToken: data => getToken: data =>
http.get('/print/url/get_access_token', data).then(res => res) http.get('/print/url/get_access_token', data).then(res => res),
// 报告编制提交至报告审核
reportMakeSubmit: data =>
http.post('soil/v1/entrust/report_make_submit?ids=' + data).then(res => res)
} }
<template>
<div>
<Modal v-model="showSubmitModal">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<Alert type="warning" show-icon>请填写修改信息,例:xxx由xxx修改为xxx,多条填写时以‘;’分隔!</Alert>
<Input v-model="remark" :autosize="{minRows: 3,maxRows: 5}" @on-keyup="_blurChange"
type="textarea" placeholder="请输入内容"></Input>
<div style="margin-top:10px">
<Form :label-width="80" onsubmit="return false">
<Form-item label="报告名称:">
<Input v-model="reportName" @on-blur="_action" placeholder="请输入报告名称"/>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 310px;float: left;">取消</Button>
<label style="margin-bottom: 0">
<Upload
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
>
<Button :disabled="isDisable" type="primary">上传</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 上传报告-----报告台账上传报告
*/
import global from '../../../api/config'
export default {
components: {},
data() {
return {
ids: [], // 合同ids
modalTitle: '上传报告',
showSubmitModal: false,
isLoad: false,
action: '',
dataObj: {
file: ''
},
remark: '',
reportId: 0,
isDisable: true,
isReport: false, // 是否有过报告,
reportName: ''
}
},
methods: {
_open(reportId) {
this.showSubmitModal = true
this.isLoad = false
this.reportId = reportId
this.reportName = ''
this.remark = ''
},
_blurChange() {
if (this.remark !== '') {
this._action()
this.isDisable = false
} else {
this.isDisable = true
}
},
_action() {
this.action =
global.baseURL +
'/soil/v1/report/upload/' +
this.reportId +
'?reason=' +
this.remark +
'&reportName=' +
this.reportName
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this.isLoad = false
this.$Message.success('上传成功!')
this.$emit('on-result-change')
this.showSubmitModal = false
} else {
this.isLoad = false
this.$Message.error(response.msg)
}
},
_cancel() {
this.showSubmitModal = false
}
}
}
</script>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
:tableHeight="tableHeight" :tableHeight="tableHeight"
:getPage="getPage" :getPage="getPage"
:iconMsg="iconMsg" :iconMsg="iconMsg"
@on-result-change="_tableResultChange" :rows="100"> @on-result-change="_tableResultChange" :rows="100" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage"></FileManage>
<OriginalRecordView ref="originalRecordView"></OriginalRecordView> <OriginalRecordView ref="originalRecordView"></OriginalRecordView>
<UploadByReport ref="uploadReport" @on-result-change="_page"></UploadByReport>
</div> </div>
</template> </template>
<script> <script>
...@@ -89,8 +90,14 @@ import { soilSample, soilStatistics } from '../../../../api' ...@@ -89,8 +90,14 @@ import { soilSample, soilStatistics } from '../../../../api'
import SampleByMakeModal from '../SampleByMakeModal' import SampleByMakeModal from '../SampleByMakeModal'
import Operation from '../../../../components/operation/Operation' import Operation from '../../../../components/operation/Operation'
import OriginalRecordView from '../OriginalRecordView' import OriginalRecordView from '../OriginalRecordView'
import UploadByReport from '../UploadByReport'
export default { export default {
components: { SampleByMakeModal, Operation, OriginalRecordView }, components: {
SampleByMakeModal,
Operation,
OriginalRecordView,
UploadByReport
},
data() { data() {
return { return {
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }], typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }],
...@@ -107,7 +114,7 @@ export default { ...@@ -107,7 +114,7 @@ export default {
{ title: '委托编号', key: 'entrustCode', width: 180 }, { title: '委托编号', key: 'entrustCode', width: 180 },
{ title: '报告编号', key: 'reportCode', width: 180 }, { title: '报告编号', key: 'reportCode', width: 180 },
{ title: '水深', key: 'waterDepth', width: 180 }, { title: '水深', key: 'waterDepth', width: 180 },
{ title: '报告是否编制', key: 'reported', width: 180 }, { title: '报告是否编制', key: 'reported', width: 180 },
{ title: '状态', key: 'status', width: 110, status: true }, { title: '状态', key: 'status', width: 110, status: true },
{ title: '委托日期', key: 'entrustDate', width: 180, date: true }, { title: '委托日期', key: 'entrustDate', width: 180, date: true },
{ title: '进度', key: 'progress', width: 110, status: true }, { title: '进度', key: 'progress', width: 110, status: true },
...@@ -126,6 +133,16 @@ export default { ...@@ -126,6 +133,16 @@ export default {
name: '查看原始记录' name: '查看原始记录'
}, },
{ {
type: 'ios-cloud-upload',
id: '',
name: '上传报告'
},
{
type: 'md-image',
id: '',
name: '预览报告'
},
{
type: 'ios-book', type: 'ios-book',
id: '', id: '',
name: '编辑报告' name: '编辑报告'
...@@ -148,11 +165,17 @@ export default { ...@@ -148,11 +165,17 @@ export default {
btn: [ btn: [
{ {
type: 'primary', type: 'primary',
id: '',
name: '提交'
},
{
type: 'primary',
id: 'food-report-make-maintain-info', id: 'food-report-make-maintain-info',
name: '信息维护' name: '信息维护'
} }
], ],
selectIds: [], selectIds: [],
selectData: [],
personal: 0 personal: 0
} }
}, },
...@@ -197,11 +220,41 @@ export default { ...@@ -197,11 +220,41 @@ export default {
case '信息维护': case '信息维护':
this._maintainInfo() this._maintainInfo()
break break
case '提交':
this._submitToCheck()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}, },
_submitToCheck() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
console.log(this.selectData)
for (let i = 0; i < this.selectIds.length; i++) {
if (this.selectData[i].reported !== '是') {
this.$Message.warning('报告未编制')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定提交这' + this.selectIds.length + '条数据?',
onOk: () => {
this._submitReportOk()
}
})
}
}
}
},
_submitReportOk: async function() {
const result = await soilSample.reportMakeSubmit(this.selectIds.join(','))
if (result) {
this.$Message.success('提交成功')
this._page()
}
},
// 信息维护 // 信息维护
_maintainInfo() { _maintainInfo() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
...@@ -223,6 +276,12 @@ export default { ...@@ -223,6 +276,12 @@ export default {
case '查看原始记录': case '查看原始记录':
this.$refs.originalRecordView._open(data.id) this.$refs.originalRecordView._open(data.id)
break break
case '上传报告':
this._uploadReport(data.id)
break
case '预览报告':
this._viewReport(data.id)
break
case '编辑报告': case '编辑报告':
this._viewReport(data.id) this._viewReport(data.id)
break break
...@@ -238,6 +297,9 @@ export default { ...@@ -238,6 +297,9 @@ export default {
} }
}) })
}, },
_uploadReport(id) {
this.$refs.uploadReport._open(id)
},
_viewReport: async function(id) { _viewReport: async function(id) {
const result = await soilSample.getReport(id) const result = await soilSample.getReport(id)
if (result) { if (result) {
...@@ -265,6 +327,13 @@ export default { ...@@ -265,6 +327,13 @@ export default {
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < this.selectData.length; i++) {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
......
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