Commit 9798e061 by lichengming

修改了委托地区查询

parent 7260eb53
...@@ -20,5 +20,13 @@ export default { ...@@ -20,5 +20,13 @@ export default {
pageCustomer: data => pageCustomer: data =>
http http
.post('soil/v1/statistics/page_customer_entrust_statistics', data) .post('soil/v1/statistics/page_customer_entrust_statistics', data)
.then(res => res),
listCoordinateStatistics: data =>
http
.post('soil/v1/statistics/list_coordinate_statistics', data)
.then(res => res),
pageCustomerEntrustStatistics: data =>
http
.post('soil/v1/statistics/page_customer_entrust_statistics', data)
.then(res => res) .then(res => res)
} }
<template>
<div>
<div style="position: relative">
<div>
<el-table
ref="moveTable"
:data="getPage.records"
:height="tableHeight"
v-loading="loading"
@select-all="_selectAll"
@selection-change="_selectRowChange"
@cell-click="_cellClick"
@row-dblclick="_dbClickRow"
:cell-class-name="_tableCellClassName"
:row-class-name="_tableRowClassName"
@current-change="_currentChange"
stripe
border
size="small"
style="width: 100%"
element-loading-text="拼命加载中...">
<el-table-column
v-if="hideCheckbox===undefined || hideCheckbox === false"
type="selection"
width="55"
fixed="left"
align="center">
</el-table-column>
<slot></slot>
<el-table-column
:width="$optColWidth(iconMsg)"
v-if="$optColWidth(iconMsg)>0?true:false"
label="操作"
align="center" fixed="right">
<template slot-scope="scope">
<IconList :msg="iconMsg" @on-result-change="_iconClick" :rowData="scope.row"
:rowIndex="scope.$index"></IconList>
</template>
</el-table-column>
<slot name="col"></slot>
</el-table>
</div>
<!--自定义表格列-->
<div style="position: absolute;right:0;top:0;z-index:2000">
<slot name="setting"></slot>
</div>
</div>
<Page v-if="hidePage===undefined" :total="getPage.total" :page-size="getPage.size" :current="getPage.current"
@on-change="_pageChange"
@on-page-size-change='_pageSizeChange' :page-size-opts="pageSizeOpts"
:show-elevator="hideElevator===undefined" :show-total="hideTotal===undefined"
:show-sizer="hideSizer===undefined" placement="top"
style="margin: 10px 0 0"></Page>
</div>
</template>
<script>
// import { sys-table-column } from '../../../'
export default {
name: 'PageTable',
props: {
noHighlight: null, // 不高亮显示
pageColumns: null,
hideCheckbox: null,
optColWidth: null,
tableHeight: null,
getPage: null,
iconMsg: null,
selectData: null,
hidePage: null,
hideElevator: null,
hideTotal: null,
hideSizer: null,
clickValue: null, // 单击返回值
noWarning: null, // 不显示警告提示
isReport: null, // 判断是否是报告
isDataInput: null, // 判断数据录入
isTask: null, // 判断是否是检测管理
isView: null, // 预览报告
isHandle: null, // 样品
tableName: null, // 该值存在,则支持自定义表格
editable: null,
isGC: null // 国抽(抽样单管理)
},
data() {
return {
formId: '', // 表单id
loading: false,
isRowClick: false,
pageParams: {
rows: this.$defRow
},
extendsData: {}, // 扩展数据,数据传不过来使用
rowData: {},
pageSizeOpts: this.$pageSizeOpt,
sampleHandleValue: '',
checkData: []
}
},
mounted() {
// 样品存储期限预警
this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue'))
},
methods: {
// _initTable() {
// this.loading = false
// if (this.tableName) {
// // tableName存在-----支持自定义表格
// this._getByUserTable()
// }
// },
// 点击单元格触发
_cellClick(row, event, column) {
if (event.label === '操作') {
} else {
this._rowClickChange(row)
}
},
_rowClickChange(row) {
this.checkData = [row]
if (this.clickValue === undefined) {
// 默认选中该行数据
this.$refs.moveTable.toggleRowSelection(row)
} else {
// 有clickValue参数时执行
this.$emit('on-result-change', 'select', row)
}
},
_checkAll() {
this.$refs.moveTable.toggleAllCheckboxRow()
},
_clearSelection() {
this.$refs.moveTable.clearSelection()
},
// 获取当前行数据与上一行数据
_currentChange(currentRow, oldCurrentRow) {
if (this.editable !== undefined) {
if (currentRow) {
this.$set(currentRow, 'editable', true)
}
if (oldCurrentRow) {
this.$set(oldCurrentRow, 'editable', false)
}
}
},
// 整行变色
_tableRowClassName({ row, rowIndex }) {
if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row)
if (index !== -1) {
return 'high-light-row'
} else {
/* 没选中的根据页面逻辑变色 */
return this._rowClassName(row, rowIndex)
}
} else {
/* 没选中的根据页面逻辑变色 */
return this._rowClassName(row, rowIndex)
}
},
_rowClassName(row, rowIndex) {
if (this.isHandle !== undefined && row.endDate) {
// 样品待处理界面
if (this.$warningValue(row.endDate) <= 0) {
return 'warning-row' // 红色
} else if (
this.$warningValue(row.endDate) > 0 &&
this.$warningValue(row.endDate) <= this.sampleHandleValue
) {
return 'warn-row' // 橙色
}
} else {
return ''
}
},
// 单元格变色
_tableCellClassName({ row, column, rowIndex, columnIndex }) {
if (this.isReport !== undefined) {
// 报告管理
if (
column.property === 'sampleProgress' &&
row.sampleProgress &&
row.sampleProgress.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
if (
column.property === 'progress' &&
row.progress &&
row.progress.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
// 是否合格字体变色
if (
column.property === 'isEligible' &&
row.isEligible &&
row.isEligible === '合格'
) {
return 'cell-blue-color'
} else if (
column.property === 'isEligible' &&
row.isEligible &&
row.isEligible === '不合格'
) {
return 'cell-red-color'
}
} else if (this.isDataInput !== undefined) {
if (
column.property === 'name' &&
row.progress &&
row.progress.display.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
} else if (this.isTask !== undefined) {
if (
column.property === 'serviceType' &&
row.serviceType &&
row.serviceType.indexOf('加急') !== -1
) {
return 'cell-red'
}
if (
column.property === 'name' &&
row.name &&
row.name.indexOf('复测') !== -1
) {
// 含有复测就变红
return 'cell-red'
}
} else if (this.isGC !== undefined) {
// 国抽的抽样单管理
if (
column.property === 'samplingNum' &&
row.unsuccessfulCount &&
row.unsuccessfulCount > 0
) {
// 国抽对接未成功项目数量(抽样单编号变红)
return 'cell-red'
}
} else {
// 其他列表状态
// eslint-disable-next-line no-lonely-if
if (column.property === 'progress') {
if (undefined === row.progress) {
return 'cell-blue-color'
} else if (
undefined !== row.progress &&
undefined !== row.progress.display
) {
if (row.progress.display.indexOf('退回') !== -1) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
} else if (undefined !== row.progress) {
if (row.progress.indexOf('退回') !== -1) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
} else {
return 'cell-blue-color'
}
} else if (column.property === 'status') {
if (
row.status &&
row.status.display !== undefined &&
row.status.display.indexOf('退回') !== -1
) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
}
}
},
_searchParams() {
const data = {}
const serData = this.$serialize(this.formId)
Object.assign(data, serData, this.extendsData)
if (this.hidePage === undefined) {
return this.$extend(data, this.pageParams)
} else {
return this.$extend(data)
}
},
_page(formId, uri, extendsData) {
this.loading = true
if (this.tableName) {
// tableName存在-----支持自定义表格
this._settingCol(formId, uri, extendsData)
} else {
this._pageTemp(formId, uri, extendsData)
}
},
_settingCol(formId, uri, extendsData) {
if (uri) {
// 为了避免uri为undefined
this.$store
.dispatch('SysTableColumn/getByTableName', this.tableName)
.then(() => {
// 查询用户下的表格数据
const userTableCode = this.$store.state.SysTableColumn.model
this.$emit(
'on-result-change',
'table-col',
this.$tableColumns(this.pageColumns, userTableCode)
)
this._pageTemp(formId, uri, extendsData)
})
}
},
// 临时
_pageTemp(formId, uri, extendsData) {
this.formId = formId
if (extendsData) {
this.extendsData = extendsData
}
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.loading = false
this.$emit('on-result-change', 'page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this._pageParamsChange()
},
_pageSizeChange(rows) {
if (rows !== this.pageParams.rows) {
this.pageParams.rows = rows
this._pageParamsChange()
}
},
_pageParamsChange() {
this.$emit('on-result-change')
},
// 多选
_selectRowChange(data) {
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
this.checkData = data
// 默认返回的是id数组
if (this.selectData === undefined) {
const idList = []
for (let i = 0; i < data.length; i++) {
idList.push(data[i].id)
}
this.$emit('on-result-change', 'selectIds', idList)
} else {
// 有selectData参数时执行
this.$emit('on-result-change', 'selectData', data)
}
}
},
_selectAll: function(data) {
this._selectRowChange(data)
},
// 操作列回调
_iconClick(name, rowData, componentName, rowIndex, obj) {
this.$emit('on-result-change', 'iconClick', {
name: name,
rowData: rowData,
componentName: componentName,
rowIndex: rowIndex,
obj: obj
})
// 点击操作列中的某个操作选中当前行数据
if (this.isView !== undefined) {
if (name === '预览/编辑报告' || name === '预览') {
this._rowClickChange(rowData)
}
}
},
// 双击行操作
_dbClickRow(row, event) {
this.$emit('on-result-change', 'dbSelect', row)
},
// 关闭loading
_hideLoading() {
this.loading = false
},
// 打开loading
_showLoading() {
this.loading = true
}
}
}
</script>
...@@ -22,31 +22,7 @@ ...@@ -22,31 +22,7 @@
<ClientLocationSearch ref="clientMap"></ClientLocationSearch> <ClientLocationSearch ref="clientMap"></ClientLocationSearch>
</Col> </Col>
<Col span="10"> <Col span="10">
<element-table <LocationWatch></LocationWatch>
id="table-year"
ref="pageTable"
:get-page="getPage"
hide-checkbox
>
<el-table-column fixed type="index" label="序号" width="100">
</el-table-column>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
>
<template slot-scope="scope">
<div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</element-table>
</Col> </Col>
</Row> </Row>
</Col> </Col>
...@@ -58,8 +34,9 @@ ...@@ -58,8 +34,9 @@
<script> <script>
import ClientLocationSearch from './ClientLocationSearch' import ClientLocationSearch from './ClientLocationSearch'
import LocationWatch from './LocationWatch'
export default { export default {
components: { ClientLocationSearch }, components: { ClientLocationSearch, LocationWatch },
data() { data() {
return { return {
formObj: {}, formObj: {},
......
<template> <template>
<div style="position:relative;"> <div style="position:relative;">
<div style="margin-top: 6px ;position:relative; "> <div style="margin-top: 6px ;position:relative; ">
<Form id="edit-form11" label-width="50" inline > <Form id="edit-form11" :label-width="50" inline >
<label class="label-sign"></label> <label class="label-sign"></label>
<!-- <Form-item label="人员:" prop="username" >--> <!-- <Form-item label="人员:" prop="username" >-->
<!-- <Select v-model="formObj.username" @on-change="_chargerChange" :label-in-value="true" style="width: 100px" name="username"--> <!-- <Select v-model="formObj.username" @on-change="_chargerChange" :label-in-value="true" style="width: 100px" name="username"-->
...@@ -21,14 +21,19 @@ ...@@ -21,14 +21,19 @@
<!-- </Form-item>--> <!-- </Form-item>-->
</Form> </Form>
</div> </div>
<div id="map"></div> <div id="map" :style="contentStyleObj"></div>
</div> </div>
</template> </template>
<script> <script>
import { soilStatistics } from '../../../api'
export default { export default {
name: 'PeopleLocationSearchVue', name: 'PeopleLocationSearchVue',
data() { data() {
return { return {
contentStyleObj: {
height: ''
},
regdateBegin: '', regdateBegin: '',
regdateEnd: '', regdateEnd: '',
value: '', value: '',
...@@ -41,12 +46,18 @@ export default { ...@@ -41,12 +46,18 @@ export default {
locationList: [] locationList: []
} }
}, },
created() {
this.getHeight()
},
mounted() { mounted() {
// this._getLocationList() this._getLocationList()
// this._getUserList() // this._getUserList()
this.getMapInfo() // this.getMapInfo()
}, },
methods: { methods: {
getHeight() {
this.contentStyleObj.height = window.innerHeight - 100 + 'px'
},
_getUserList() { _getUserList() {
// 用户列表 // 用户列表
this.$store.dispatch('LmsStaffInfo/list', { status: 1 }).then(() => { this.$store.dispatch('LmsStaffInfo/list', { status: 1 }).then(() => {
...@@ -63,15 +74,20 @@ export default { ...@@ -63,15 +74,20 @@ export default {
}) })
}, },
_getLocationList() { _getLocationList: async function() {
this.$store const result = await soilStatistics.listCoordinateStatistics()
.dispatch('LmsStaffInfo/getLocationList', this.formObj) if (result) {
.then(() => { console.log(result)
this.locationList = this.$store.state.LmsStaffInfo.listLocation this.getMapInfo(result)
}
this.getMapInfo(this.locationList) // this.$store
// this.getMapInfoPoint(this.locationList); // .dispatch('LmsStaffInfo/getLocationList', this.formObj)
}) // .then(() => {
// this.locationList = this.$store.state.LmsStaffInfo.listLocation
//
// this.getMapInfo(this.locationList)
// // this.getMapInfoPoint(this.locationList);
// })
}, },
getMapInfo(data) { getMapInfo(data) {
...@@ -102,42 +118,44 @@ export default { ...@@ -102,42 +118,44 @@ export default {
} }
) )
console.log(myIcon) console.log(myIcon)
// for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
// const location = data[i] // const location = data[i]
// const objs = location.usersList // const objs = location.usersList
// const userName = location.username // const clientName = location.client
// const pois = []
// console.log('--objs-', objs) // eslint-disable-next-line no-undef
// pois[i] = new BMap.Point(data[i].longitude, data[i].latitude)
// const pois = [] console.log('--pois-', pois)
// for (let j = 0; j < objs.length; j++) { // for (let j = 0; j < objs.length; j++) {
// const obj = objs[j] // const obj = objs[j]
// // eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// pois[j] = new BMap.Point(obj.longitude, obj.latitude) // pois[j] = new BMap.Point(obj.longitude, obj.latitude)
// // eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// const marker = new BMap.Marker( const marker = new BMap.Marker(
// // eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// new BMap.Point(obj.longitude, obj.latitude), new BMap.Point(data[i].longitude, data[i].latitude),
// { icon: myIcon } { icon: myIcon }
// ) // 创建标注 ) // 创建标注
// const content = const content =
// '人员:' + '委托单位:' +
// userName + data[i].client +
// ' </br> ' + '<br>' +
// '时间:' + '钻孔名称:' +
// this.$dateformat(obj.sendDate, 'yyyy-mm-dd HH:MM:ss') data[i].boreholeName +
// map.addOverlay(marker) // 将标注添加到地图中 '<br>' +
// addClickHandler(content, marker) '钻孔位置:' +
// } data[i].boreholeLocation
// console.log('--pois-', pois) map.addOverlay(marker) // 将标注添加到地图中
// // eslint-disable-next-line no-undef addClickHandler(content, marker)
// const polyline = new BMap.Polyline(pois, { // }
// strokeColor: 'blue', // eslint-disable-next-line no-undef
// strokeWeight: 2, // const polyline = new BMap.Polyline(pois, {
// strokeOpacity: 1 // strokeColor: 'blue',
// }) // 创建折线 // strokeWeight: 2,
// map.addOverlay(polyline) // 增加折线 // strokeOpacity: 1
// } // }) // 创建折线
// map.addOverlay(polyline) // 增加折线
}
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
function addClickHandler(content, marker) { function addClickHandler(content, marker) {
marker.addEventListener('click', function(e) { marker.addEventListener('click', function(e) {
...@@ -180,9 +198,14 @@ export default { ...@@ -180,9 +198,14 @@ export default {
} }
</script> </script>
<style scoped> <style>
#map { #map {
height: 400px;
margin-top: -9px; margin-top: -9px;
} }
.BMap_cpyCtrl {
display: none !important;
}
.anchorBL {
display: none !important;
}
</style> </style>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main intra-line">
<Row>
<!-- 查询-->
<!-- 表格 -->
<Col span="24">
<element-table-height
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
@on-result-change="_tableResultChange"
hide-checkbox
>
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip sortable>
<template slot-scope="scope">
<span v-if="item.key === 'status'">
<!-- {{ scope.row[item.value] === PASS?'通过':'' }}-->
{{ scope.row.status.display }}
</span>
<span v-else-if="item.key==='ctime'">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</div>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="操作"-->
<!-- align="center"-->
<!-- :width="$optColWidth(iconMsg)"-->
<!-- fixed="right" v-if="$optColWidth(iconMsg)>0?true:false">-->
<!-- <template slot-scope="scope">-->
<!-- <IconList :msg="type == 1?iconMsg1:iconMsg" @on-result-change="_iconClick" :rowData="scope.row"-->
<!-- :rowIndex="scope.$index"></IconList>-->
<!-- </template>-->
<!-- </el-table-column>-->
</element-table-height>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
// eslint-disable-next-line no-unused-vars
import global from '../../../api/config'
import { soilStatistics } from '../../../api'
export default {
name: 'FormFiles',
components: {},
data() {
return {
getPage: {
records: []
// records: [
// {formName: '79874'}
// ]
},
detectionDate: '',
formObj: {
username: '',
sendDate: '',
sendDateBegin: '',
sendDateEnd: ''
},
startTime: '',
endTime: '',
pageColumns: [
{ title: '委托单位', key: 'client' },
{ title: '委托数量', key: 'quantity' }
],
selectIds: [],
selectData: [],
iconMsg: [
// { type: 'images', id: '', name: '预览' },
// { type: 'ios-download', id: '', name: '下载' },
// { type: 'ios-clock', id: '', name: '操作日志' },
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('noSearch') + 60
}
},
mounted() {
this._page()
},
methods: {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_search() {
this._page()
},
_page: async function() {
const result = await soilStatistics.pageCustomerEntrustStatistics(
this.$serializeFormSearch(this.formObj)
)
if (result) {
this.getPage.records = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
default:
this._page()
}
},
_iconClick(res, data) {
switch (res) {
case '预览':
this._viewReport(data)
break
}
}
// 日期查询
// _dateChange(date) {
// // eslint-disable-next-line no-sequences
// ;(this.formObj.sendDateBegin = date[0]),
// (this.formObj.sendDateEnd = date[1])
// }
}
}
</script>
<style scoped>
</style>
...@@ -15,11 +15,13 @@ import FileManage from '../components/file/file-manage/FileManage' ...@@ -15,11 +15,13 @@ import FileManage from '../components/file/file-manage/FileManage'
import VXESettingCol from '../components/base/VXESettingCol' import VXESettingCol from '../components/base/VXESettingCol'
import ElTableNoPage from '../components/table/ElTableNoPage' import ElTableNoPage from '../components/table/ElTableNoPage'
import PhotoManage from '../components/file/photo-manage/PhotoManage' import PhotoManage from '../components/file/photo-manage/PhotoManage'
import elementTableHeight from '../components/table/elementTableHeight'
Vue.use(VXETable) Vue.use(VXETable)
Vue.component('btn-list', btnList) Vue.component('btn-list', btnList)
Vue.component('icon-list', iconList) Vue.component('icon-list', iconList)
Vue.component('element-table', elementTable) Vue.component('element-table', elementTable)
Vue.component('element-table-height', elementTableHeight)
Vue.component('modal-footer', modalFooter) Vue.component('modal-footer', modalFooter)
Vue.component('PTVXETable', PTVXETable) Vue.component('PTVXETable', PTVXETable)
Vue.component('PTVXETableData', PTVXETableData) Vue.component('PTVXETableData', PTVXETableData)
......
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