|
@@ -0,0 +1,259 @@
|
|
|
+<template>
|
|
|
+ <a-card :bordered="false">
|
|
|
+ <div class="table-page-search-wrapper" @keyup.enter="handleEnter">
|
|
|
+ <a-form layout="inline">
|
|
|
+ <a-row :gutter="48">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="设备位号">
|
|
|
+ <a-input v-model.trim="queryParam.positionNo" placeholder="请输入设备位号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="操作类型">
|
|
|
+ <a-select v-model="queryParam.otherType" placeholder="请选择操作类型">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label,value) in otherTypeMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="开始时间">
|
|
|
+ <a-date-picker style="width:100%" v-model.trim="queryParam.createdTimeStart" placeholder="请选择开始时间"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="结束时间">
|
|
|
+ <a-date-picker style="width:100%" v-model.trim="queryParam.createdTimeEnd" placeholder="请选择结束时间"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6 || 24" :sm="24">
|
|
|
+ <span class="table-page-search-submitButtons">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="table-operator" style="margin-bottom: 8px;">
|
|
|
+ <!-- <a-button v-if="$auth('sb-run-fills-add')" type="primary" icon="plus" @click="$refs.baseFormList.base(null,DictCache.VALUE.FILL_INFO_USE_TYPE.FILL_INFO_USE_TYPE_YUN_XING)">新增</a-button> -->
|
|
|
+ <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">履历导出</a-button>
|
|
|
+ <!-- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-run-fills-del')">
|
|
|
+ <a-menu slot="overlay">
|
|
|
+ <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
|
+ <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
|
|
|
+ </a-popconfirm>
|
|
|
+ </a-menu>
|
|
|
+ <a-button style="margin-left: 8px">
|
|
|
+ 批量操作 <a-icon type="down" />
|
|
|
+ </a-button>
|
|
|
+ </a-dropdown> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <s-table
|
|
|
+ ref="table"
|
|
|
+ size="default"
|
|
|
+ rowKey="id"
|
|
|
+ :bordered="this.MyGlobalConstant.BORDERED"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :alert="options.alert"
|
|
|
+ :rowSelection="options.rowSelection"
|
|
|
+ showPagination="auto"
|
|
|
+ >
|
|
|
+ <span slot="action" slot-scope="record">
|
|
|
+ <template>
|
|
|
+ <a @click="handleView(record)">查看</a>
|
|
|
+ <operation-button
|
|
|
+ v-if="$auth('sb-run-fills-edit')"
|
|
|
+ @click="handleEdit(record)"
|
|
|
+ >修改</operation-button>
|
|
|
+ <operation-button
|
|
|
+ v-if="$auth('sb-run-fills-del')"
|
|
|
+ :type="2"
|
|
|
+ title="是否要删除该条数据?"
|
|
|
+ @confirm="batchDelete(record.id)">删除</operation-button>
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { STable, Ellipsis } from '@/components'
|
|
|
+
|
|
|
+import { getMeasurePage, exportSbMeasure } from '@/api/sb/sb-resume'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'SbRunFillList',
|
|
|
+ components: {
|
|
|
+ STable,
|
|
|
+ Ellipsis
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ },
|
|
|
+ // 表头
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'index',
|
|
|
+ width: 100,
|
|
|
+ checked: true,
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备名称',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作类型',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'type',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return this.otherTypeMap[text]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'positionNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位置',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'positionName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规格型号',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'sbModel'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作时间',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'createdTime'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ otherTypeMap: {},
|
|
|
+ // 下拉框map
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ if (this.queryParam.createdTimeStart) {
|
|
|
+ this.queryParam.createdTimeStart = this.BaseTool.Date.formatter(this.queryParam.createdTimeStart, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 00:00:00'
|
|
|
+ }
|
|
|
+ if (this.queryParam.createdTimeEnd) {
|
|
|
+ this.queryParam.createdTimeEnd = this.BaseTool.Date.formatter(this.queryParam.createdTimeEnd, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 23:59:59'
|
|
|
+ }
|
|
|
+ parameter = {
|
|
|
+ ...parameter,
|
|
|
+ ...this.queryParam
|
|
|
+ }
|
|
|
+ return getMeasurePage(parameter)
|
|
|
+ .then(res => {
|
|
|
+ return res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectedRowKeys: [],
|
|
|
+ selectedRows: [],
|
|
|
+
|
|
|
+ options: {
|
|
|
+ alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
+ rowSelection: {
|
|
|
+ selectedRowKeys: this.selectedRowKeys,
|
|
|
+ onChange: this.onSelectChange
|
|
|
+ }
|
|
|
+ },
|
|
|
+ optionAlertShow: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ // 下拉框map
|
|
|
+ this.otherTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_MEASURE_OTHER_TYPE)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tableOption () {
|
|
|
+ if (!this.optionAlertShow) {
|
|
|
+ this.options = {
|
|
|
+ alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
+ rowSelection: {
|
|
|
+ selectedRowKeys: this.selectedRowKeys,
|
|
|
+ onChange: this.onSelectChange,
|
|
|
+ getCheckboxProps: record => ({
|
|
|
+ props: {
|
|
|
+ disabled: false,
|
|
|
+ name: record.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.optionAlertShow = true
|
|
|
+ } else {
|
|
|
+ this.options = {
|
|
|
+ alert: false,
|
|
|
+ rowSelection: null
|
|
|
+ }
|
|
|
+ this.optionAlertShow = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ batchDelete (id) {
|
|
|
+ let ids = []
|
|
|
+ if (this.BaseTool.String.isBlank(id)) {
|
|
|
+ const length = this.selectedRows.length
|
|
|
+ if (length === 0) {
|
|
|
+ this.$message.info('请选择要删除的记录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ids = this.selectedRows.map(item => item.id)
|
|
|
+ } else {
|
|
|
+ ids = [id]
|
|
|
+ }
|
|
|
+ // deleteSbRunFills(ids).then(res => {
|
|
|
+ // this.$message.info('删除成功')
|
|
|
+ // this.handleOk()
|
|
|
+ // this.$refs.table.clearSelected()
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ handleOk () {
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
+ this.selectedRows = selectedRows
|
|
|
+ },
|
|
|
+ resetSearchForm () {
|
|
|
+ this.queryParam = {
|
|
|
+ }
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ doExport () {
|
|
|
+ const parameter = {
|
|
|
+ ...this.queryParam
|
|
|
+ }
|
|
|
+ exportSbMeasure(parameter).then(file => {
|
|
|
+ this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleEnter () {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|