Commit d05d500a by lichengming

修改了分包数据录入

parent 8f61d1f6
<template>
<div>
<Modal v-model="showModal" width="1200" class="modal-footer-none zIndex-1000">
<p slot="header">历史版本</p>
<Row>
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" hide-checkbox>
<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 pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</Modal>
</div>
</template>
<script>
/**
* 报告的历史版本
*/
import global from '../../../api/config'
// import { meterSample } from '../../../api'
export default {
data() {
return {
iconMsg: [],
checkOut: [{ type: 'arrow-return-left', id: '', name: '签入' }],
defVal: [
{ type: 'android-image', id: '', name: '预览' },
{ type: 'ios-download', id: '', name: '下载' }
],
pageColumns: [
{ title: '报告编号', key: 'reportSn', width: 180 },
{ title: '变更人', key: 'maker' },
{ title: '变更时间', key: 'ctime', width: 240, dateTime: true },
{ title: '版本', key: 'version' }
],
getPage: {},
reportId: '',
showModal: false
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_open(reportId, reportType) {
this.showModal = true
this.reportId = reportId
this.iconMsg = []
// 报告编制、报告档案模块调用
if (
reportType === 'FOOD_REPORT_MAKE' ||
reportType === 'FOOD_REPORT_MANAGE'
) {
this.iconMsg = this.defVal.concat(this.checkOut)
} else {
this.iconMsg = this.defVal
}
this._page()
},
_page() {
const data = {
reportId: this.reportId
}
// this.$refs.pageTable._page('', 'FoodSampleReportDetail/page', data)
console.log(data)
// const result = meterSample.pageHis(data)
// console.log('result', result)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSampleReportDetail.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '预览':
this._viewReport(data.id)
break
case '下载':
this._download(data.id)
break
case '签入':
this._checkOut(data.id)
break
}
},
// 下载
_download(id) {
window.open(
global.baseURL + '/food/v1/sample_report/download_by_report_id/' + id,
'_blank'
)
},
// 预览
_viewReport(id) {
this.$store.dispatch('FoodSampleReport/getByPreviewId', id).then(() => {
const data = this.$store.state.FoodSampleReport.model
if (data !== undefined) {
this.$openWindowModeless({
objectKey: data.objectKey,
id: id,
isReport: 0
})
}
})
},
_checkOut(id) {
this.$Modal.confirm({
title: '提示',
content: '确定该操作?',
onOk: () => {
this.$store
.dispatch('FoodSampleReportDetail/checkOut', { id })
.then(() => {
if (this.$store.state.FoodSampleReportDetail.success) {
this.$Message.success('操作成功!')
this._page()
this.$emit('on-result-change')
}
})
}
})
}
}
}
</script>
...@@ -10,24 +10,24 @@ ...@@ -10,24 +10,24 @@
<Form id="formId" :label-width="80" inline onsubmit="return false"> <Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item"> <Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入样品名称" clearable/>
</Form-item> </Form-item>
<Form-item label="样品编号:" class="search-item"> <Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/> <Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入样品编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn" style="margin-left: -10px"> <Form-item class="search-btn" style="margin-left: -10px">
<Button type="primary" @click="_formSearch">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
@on-result-change="_btnClick"></btn-list> class="contHide"></btn-list>
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage"
:icon-msg="iconMsg" select-data @on-result-change="_tableResultChange"> :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -61,16 +61,25 @@ ...@@ -61,16 +61,25 @@
</Modal> </Modal>
<MeterSubSampleEdit ref="batchEditModal" @on-result-change="_page"></MeterSubSampleEdit> <MeterSubSampleEdit ref="batchEditModal" @on-result-change="_page"></MeterSubSampleEdit>
<SubOutWarehouse ref="OutWarehouseModal" ></SubOutWarehouse> <SubOutWarehouse ref="OutWarehouseModal" ></SubOutWarehouse>
<SubResultInput ref="ResultInputModal"></SubResultInput>
<UploadByReport ref="UploadModal"></UploadByReport>
<HisRevision ref="HisModal"></HisRevision>
</div> </div>
</template> </template>
<script> <script>
import { meterSample } from '../../../api' import { meterSample } from '../../../api'
import MeterSubSampleEdit from './MeterSubSampleEdit' import MeterSubSampleEdit from './MeterSubSampleEdit'
import SubOutWarehouse from './SubOutWarehouse' import SubOutWarehouse from './SubOutWarehouse'
import SubResultInput from './SubResultInputEdit'
import UploadByReport from './UploadByReport'
import HisRevision from './HisRevision'
export default { export default {
components: { components: {
MeterSubSampleEdit, MeterSubSampleEdit,
SubOutWarehouse SubOutWarehouse,
SubResultInput,
UploadByReport,
HisRevision
// FoodSampleGovernDetail, // FoodSampleGovernDetail,
// CopyModal, // CopyModal,
// FoodSampleGovernLYEdits // FoodSampleGovernLYEdits
...@@ -89,6 +98,9 @@ export default { ...@@ -89,6 +98,9 @@ export default {
// {id: '', name: '删除'}, // {id: '', name: '删除'},
// ], // ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '检测结果录入' },
{ type: 'ios-list', id: '', name: '历史版本' },
{ type: 'ios-cloud-upload', id: '', name: '上传' },
{ type: 'compose', id: '', name: '编辑' }, { type: 'compose', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' }, { type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
{ type: 'trash-a', id: '', name: '删除' } { type: 'trash-a', id: '', name: '删除' }
...@@ -124,6 +136,7 @@ export default { ...@@ -124,6 +136,7 @@ export default {
} }
], ],
formId: 'meterReviewSampleManageFormId', formId: 'meterReviewSampleManageFormId',
reportType: 'FOOD_REPORT_MAKE',
showModal: false, showModal: false,
modalTitle: '管理样品', modalTitle: '管理样品',
selectIds: [], selectIds: [],
...@@ -228,6 +241,15 @@ export default { ...@@ -228,6 +241,15 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '历史版本':
this._HisEdit(data)
break
case '上传':
this._upload(data)
break
case '检测结果录入':
this._resultModal(data)
break
case '编辑': case '编辑':
localStorage.setItem('type', data.type) localStorage.setItem('type', data.type)
if (data.type === 2) { if (data.type === 2) {
...@@ -248,6 +270,16 @@ export default { ...@@ -248,6 +270,16 @@ export default {
} }
}) })
}, },
_HisEdit(data) {
this.$refs.HisModal._open(data.id, this.reportType)
},
_upload(data) {
this.$refs.UploadModal._open(data.id)
},
_resultModal(data) {
console.log(data.id)
this.$refs.ResultInputModal._open(data.id)
},
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'selectData': case 'selectData':
......
<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">
<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 @click="_cancel" style="margin-left: 8px">取消</Button>
<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 +
'/food/v1/sample_report/upload_report/' +
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>
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