Commit 9b664f66 by lichengming

修改了地区查询

parent 12b1c21f
...@@ -28,5 +28,9 @@ export default { ...@@ -28,5 +28,9 @@ export default {
pageCustomerEntrustStatistics: data => pageCustomerEntrustStatistics: data =>
http http
.post('soil/v1/statistics/page_customer_entrust_statistics', data) .post('soil/v1/statistics/page_customer_entrust_statistics', data)
.then(res => res),
pageCoordinateStatistics: data =>
http
.post('soil/v1/statistics/page_coordinate_statistics', data)
.then(res => res) .then(res => res)
} }
...@@ -96,7 +96,7 @@ import global from '../../../api/config' ...@@ -96,7 +96,7 @@ import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入 import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
import StandardsManageEdit from './StandardsManageEdit' // 添加、编辑 import StandardsManageEdit from './StandardsManageEdit' // 添加、编辑
import SubstitutionalRelation from './SubstitutionalRelation' // 查看替代关系 import SubstitutionalRelation from './SubstitutionalRelation' // 查看替代关系
import UploadModal from './UploadModal' // 上传文件 import UploadModal from './UploadFileModal' // 上传文件
export default { export default {
components: { components: {
...@@ -151,8 +151,7 @@ export default { ...@@ -151,8 +151,7 @@ export default {
{ {
type: 'md-add', type: 'md-add',
id: '', id: '',
name: '上传', name: '上传'
componentName: 'UploadModal'
}, },
{ type: 'ios-download', id: '', name: '下载' }, { type: 'ios-download', id: '', name: '下载' },
{ type: 'ios-book', id: '', name: '预览' }, { type: 'ios-book', id: '', name: '预览' },
......
<!--下载模板导入-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<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>
<label>
<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"
:format="format"
>
<Button :disabled="isDisabled" type="primary">上传</Button>
</Upload>
</label>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel" :loading="isLoad">取消</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
import global from '../../../api/config'
export default {
components: {},
data() {
return {
modalTitle: '上传文件',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['doc', 'docx', 'xlsx', 'xls'],
importUrl: ''
}
},
methods: {
_open(data) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.importUrl = global.baseURL + data.importUrl
},
_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) {
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change')
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.msg
this.showError = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 doc、docx、xlsx 格式的文件!'
})
this.isLoad = false
}
}
}
</script>
...@@ -117,6 +117,11 @@ export default { ...@@ -117,6 +117,11 @@ export default {
id: '', id: '',
name: '管理样品和报告' name: '管理样品和报告'
}, },
{
type: 'ios-book',
id: '',
name: '查看原始记录'
},
// { // {
// type: 'ios-document-outline', // type: 'ios-document-outline',
// id: '', // id: '',
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<Form-item label="委托单位:"> <Form-item label="委托单位:">
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable/>
</Form-item> </Form-item>
<Button style="margin-left: 5px;" type="primary" @click="searchPage">搜索</Button>
</Form> </Form>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
<ClientLocationSearch ref="clientMap"></ClientLocationSearch> <ClientLocationSearch ref="clientMap"></ClientLocationSearch>
</Col> </Col>
<Col span="10"> <Col span="10">
<LocationWatch></LocationWatch> <LocationWatch ref="clientTable"></LocationWatch>
</Col> </Col>
</Row> </Row>
</Col> </Col>
...@@ -39,7 +40,9 @@ export default { ...@@ -39,7 +40,9 @@ export default {
components: { ClientLocationSearch, LocationWatch }, components: { ClientLocationSearch, LocationWatch },
data() { data() {
return { return {
formObj: {}, formObj: {
client: ''
},
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托商', key: 'client', width: 200 }, { title: '委托商', key: 'client', width: 200 },
...@@ -50,7 +53,12 @@ export default { ...@@ -50,7 +53,12 @@ export default {
} }
}, },
mounted() {}, mounted() {},
methods: {} methods: {
searchPage() {
this.$refs.clientMap._getLocationList(this.formObj.client)
this.$refs.clientTable._page(this.formObj.client)
}
}
} }
</script> </script>
<style> <style>
......
...@@ -74,8 +74,10 @@ export default { ...@@ -74,8 +74,10 @@ export default {
}) })
}, },
_getLocationList: async function() { _getLocationList: async function(client) {
const result = await soilStatistics.listCoordinateStatistics() const result = await soilStatistics.listCoordinateStatistics({
client: client
})
if (result) { if (result) {
console.log(result) console.log(result)
this.getMapInfo(result) this.getMapInfo(result)
......
...@@ -78,7 +78,10 @@ export default { ...@@ -78,7 +78,10 @@ export default {
endTime: '', endTime: '',
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client' }, { title: '委托单位', key: 'client' },
{ title: '委托数量', key: 'quantity' } { title: '钻孔位置', key: 'boreholeLocation' },
{ title: '钻孔名称', key: 'boreholeName' },
{ title: '经度', key: 'longitude' },
{ title: '纬度', key: 'latitude' }
], ],
selectIds: [], selectIds: [],
selectData: [], selectData: [],
...@@ -104,12 +107,17 @@ export default { ...@@ -104,12 +107,17 @@ export default {
_search() { _search() {
this._page() this._page()
}, },
_page: async function() { _page: async function(client) {
const result = await soilStatistics.pageCustomerEntrustStatistics( if (client) {
this.formObj.client = client
} else {
this.formObj.client = undefined
}
const result = await soilStatistics.pageCoordinateStatistics(
this.$serializeFormSearch(this.formObj) this.$serializeFormSearch(this.formObj)
) )
if (result) { if (result) {
this.getPage.records = result this.getPage = result
} }
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
......
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