Commit 07f2e653 by lichengming

修改了样品拆分,导入gds数据,库房样品管理排序

parent 7241309b
...@@ -295,5 +295,7 @@ export default { ...@@ -295,5 +295,7 @@ export default {
storageSampleSubmit: data => storageSampleSubmit: data =>
http http
.post('soil/v1/alone_sample/storage_sample_submit', data) .post('soil/v1/alone_sample/storage_sample_submit', data)
.then(res => res) .then(res => res),
addSample: data =>
http.post('soil/v1/sample/sample_split_save', data).then(res => res)
} }
<!--下载模板导入-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<Alert v-if="hideDownloadBtn===undefined" type="warning" show-icon>请导入GDS数据</Alert>
<Alert v-if="msg === '资质项目管理导入'" type="warning" show-icon>此按钮可实现新增、更新资质项目的功能,不可新增或更新限量信息</Alert>
<Alert v-if="msg === '导入更新'" type="warning" show-icon>此功能可更新现有的资质项目、判定依据、限量信息</Alert>
<Alert v-if="showError" type="error" show-icon style="margin-top: 10px">{{errorMessage}}</Alert>
<Alert v-if="showSuccess" type="success" show-icon style="margin-top: 10px">{{successMessage}}</Alert>
<div v-show="isLoad">
<Spin>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel">取消</Button>
<label style="margin-bottom: 0;margin-left:15px; float: right">
<Upload
:action="importUrl"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
>
<Button :disabled="isDisabled" type="primary">导入</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
// import global from '../../api/config'
import global from '../../api/config'
export default {
components: {},
props: {
hideDownloadBtn: null
},
data() {
return {
msg: '',
modalTitle: '导入检测项目信息',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['xlsx', 'xls', 'doc', 'docx'],
importUrl: '',
downloadUrl: '',
// 500的提示语
errStr: '很抱歉!无法处理您的操作,请检查您的操作步骤或者联系系统管理员!'
}
},
methods: {
_open(data, msg) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.modalTitle = data.title
this.importUrl = global.baseURL + data.importUrl
this.downloadUrl = data.downloadUrl
this.msg = msg
},
_download() {
// this.$Modal.confirm({
// title: '提示',
// content: '确定要下载模板?',
// onOk: () => {
//
// }
// });
window.open(global.baseURL + this.downloadUrl, '_blank')
},
_cancel() {
this.showModal = false
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
this.isDisabled = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
console.log('---response', response)
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change', response.data)
this.showModal = false
this.isDisabled = false
this.showError = false
this.showSuccess = true
this.successMessage = response.msg
} else {
this.isLoad = false
this.showSuccess = false
this.isDisabled = false
this.errorMessage = response.code === '500' ? this.errStr : response.msg
this.showError = true
// this.$Message.error(response.msg);
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 .xlsx、xls、doc、docx 的文件!'
})
this.isLoad = false
}
}
}
</script>
...@@ -302,6 +302,9 @@ export default { ...@@ -302,6 +302,9 @@ export default {
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
if (this.getPage.records.length > 0) {
this.getPage.records = result.records.reverse()
}
} }
}, },
// 查询 // 查询
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
<Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false"> <Form id="search-sample-company" v-show="searchOpen" :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.sampleCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch" /> <Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_page"> <Button @click="_page" type="primary">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" class="contHide" show-search-btn="true" @on-result-change="_btnClick"></btn-list> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" is-edit select-data @on-result-change="_tableResultChange"> :get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" is-edit select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage> <SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<DescribeDetailModal ref="writeDetailModal" @on-result-change="_page"></DescribeDetailModal> <DescribeDetailModal ref="writeDetailModal" @on-result-change="_page"></DescribeDetailModal>
<PreparationModal ref="preModal" @on-result-change="_page"></PreparationModal> <PreparationModal ref="preModal" @on-result-change="_page"></PreparationModal>
<SoilSampleSplit ref="splitModal" @on-result-change="_page"></SoilSampleSplit>
</div> </div>
</template> </template>
<script> <script>
...@@ -73,8 +74,14 @@ import { soilEntrust } from '../../api' ...@@ -73,8 +74,14 @@ import { soilEntrust } from '../../api'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
import DescribeDetailModal from './sample-preparation/DescribeDetailModal' import DescribeDetailModal from './sample-preparation/DescribeDetailModal'
import PreparationModal from './sample-preparation/Preparation' import PreparationModal from './sample-preparation/Preparation'
import SoilSampleSplit from './SoilSampleSplit'
export default { export default {
components: { SoilSampleItemManage, DescribeDetailModal, PreparationModal }, components: {
SoilSampleItemManage,
DescribeDetailModal,
PreparationModal,
SoilSampleSplit
},
data() { data() {
return { return {
formId: 'soilSampleManage', formId: 'soilSampleManage',
...@@ -94,6 +101,11 @@ export default { ...@@ -94,6 +101,11 @@ export default {
type: 'success', type: 'success',
id: '', id: '',
name: '批量填写土质描述详情' name: '批量填写土质描述详情'
},
{
type: 'success',
id: '',
name: '样品拆分'
} }
], ],
itemList: [], itemList: [],
...@@ -116,7 +128,7 @@ export default { ...@@ -116,7 +128,7 @@ export default {
searchOpen: true, searchOpen: true,
modalTitle: '管理样品', modalTitle: '管理样品',
selectIds: [], selectIds: [],
selectData: {}, selectData: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
...@@ -245,12 +257,18 @@ export default { ...@@ -245,12 +257,18 @@ export default {
case '批量填写土质描述详情': case '批量填写土质描述详情':
this._writeDetail(this.selectIds) this._writeDetail(this.selectIds)
break break
case '样品拆分':
this._sampleSplit()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_sampleSplit() {
this.$refs.splitModal._open(this.selectData[0], this.contractId)
},
_samplePre() { _samplePre() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('至少选择一条数据') this.$Message.warning('至少选择一条数据')
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport> <CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport>
<Reason ref="reasonModal" @on-result-change="_reasonResult" /> <Reason ref="reasonModal" @on-result-change="_reasonResult" />
<Operation ref="Operation"></Operation> <Operation ref="Operation"></Operation>
<importModal ref="importModal"></importModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -73,6 +74,7 @@ import CollectManage from '../CollectManage' ...@@ -73,6 +74,7 @@ import CollectManage from '../CollectManage'
import CollectFileManage from '../CollectFileManage' import CollectFileManage from '../CollectFileManage'
import Reason from '../../../../components/base/Reason' import Reason from '../../../../components/base/Reason'
import Operation from '../../../../components/operation/ItemOperation' import Operation from '../../../../components/operation/ItemOperation'
import importModal from '../../../../components/import/GDSImport'
import CreateReport from './CreateReport' import CreateReport from './CreateReport'
export default { export default {
components: { components: {
...@@ -86,7 +88,8 @@ export default { ...@@ -86,7 +88,8 @@ export default {
CollectFileManage, CollectFileManage,
Reason, Reason,
CreateReport, CreateReport,
Operation Operation,
importModal
}, },
data() { data() {
return { return {
...@@ -137,7 +140,8 @@ export default { ...@@ -137,7 +140,8 @@ export default {
{ type: 'success', id: '', name: '原始记录填写' }, { type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' }, { type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }, { type: 'success', id: '', name: '设备' },
{ type: 'success', id: '', name: '退回' } { type: 'success', id: '', name: '退回' },
{ type: 'success', id: '', name: '导入GDS数据' }
], ],
iconMsg: [ iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' }, { type: 'ios-book', id: '', name: '查看原始记录' },
...@@ -425,7 +429,18 @@ export default { ...@@ -425,7 +429,18 @@ export default {
case '退回': case '退回':
this._goBack() this._goBack()
break break
case '导入GDS数据':
this._import()
break
}
},
_import() {
const data = {
importUrl: '/soil/v1/experiment/upload_gds_file/',
downloadUrl: '/soil/v1/excel/template/SoilEntrustImport',
title: '导入GDS数据'
} }
this.$refs.importModal._open(data, '导入GDS数据')
}, },
_goBack() { _goBack() {
// 退回 // 退回
......
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