12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199 |
- <template>
- <div>
- <a-card :bordered="false" v-show="visible">
- <a-row :gutter="8">
- <a-col :span="24">
- <div>
- <div class="table-page-search-wrapper">
- <a-form layout="inline">
- <a-row :gutter="48">
- <a-col :md="6" :sm="24">
- <a-form-item label="关键字">
- <a-input v-model.trim="queryParam.keyword" placeholder="关键字" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="车间位置">
- <a-tree-select
- style="width: 100%"
- :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
- :treeData="positionTreeData"
- :treeNodeFilterProp="'title'"
- :showSearch="true"
- v-model="queryParam.positionId"
- placeholder="请选择">
- </a-tree-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="设备名称">
- <a-input v-model.trim="queryParam.name" placeholder="名称"/>
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="24">
- <a-form-item label="父位号">
- <a-input v-model.trim="queryParam.no" placeholder="父位号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <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-input v-model.trim="queryParam.producerId" placeholder="生产商"/>
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="24">
- <a-form-item label="设备自编号">
- <a-input v-model="queryParam.zbh" placeholder="设备自编号"/>
- </a-form-item>
- </a-col>-->
- <a-col :md="6" :sm="24">
- <a-form-item label="设备等级">
- <a-select v-model="queryParam.level" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in levelMap"
- :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-select v-model="queryParam.useType" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in useTypeMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>-->
- <!-- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="检定日期范围">
- <a-range-picker v-model="dateRangeCheck" />
- </a-form-item>
- </a-col> -->
- <a-col :md="6" :sm="24">
- <a-form-item label="有效日期范围">
- <a-range-picker v-model="dateRange" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" >
- <a-form-item label="设备状态">
- <a-select v-model="queryParam.status" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in statusMap"
- :key="value"
- :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="规格型号">
- <a-input v-model="queryParam.model" placeholder="规格型号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="设备类型">
- <a-tree-select
- style="width: 100%"
- :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
- :treeData="treeData"
- :treeNodeFilterProp="'title'"
- :showSearch="true"
- v-model="queryParam.typeId"
- placeholder="请选择"
- >
- </a-tree-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="主子设备">
- <a-select v-model="queryParam.isChild" placeholder="请选择">
- <a-select-option value="1">子设备</a-select-option>
- <a-select-option value="2">父设备</a-select-option>
- <a-select-option value="3">普通设备</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="电力线路">
- <a-select v-model="queryParam.baoyangTimes" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in lineMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
- <a-form-item label="是否强检">
- <a-select v-model="queryParam.checkType" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in checkTypeMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col> -->
- <a-col :span="6" >
- <span class="table-page-search-submitButtons">
- <a-button type="primary" @click="handleOk">查询</a-button>
- <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
- <!-- <a :style="{ marginLeft: '8px', fontSize: '12px' }" @click="expand=!expand">
- {{ !expand ? '展开' : '折叠' }} <a-icon :type="expand ? 'up' : 'down'" />
- </a> -->
- </span>
- </a-col>
- </a-row>
- </a-form>
- <a-row :gutter="8">
- </a-row>
- </div>
- <div class="table-operator" style="margin-bottom: 8px;">
- <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
- <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
- <!-- <a-button style="margin-left:8px;" type="primary" @click="doImport">
- <a-icon type="upload"/>
- 新增导入
- </a-button>-->
- <a-button style="margin-left:8px;" type="primary" @click="doImportStandard">
- <a-icon type="upload" />
- 导入
- </a-button>
- <a-button style="margin-left:8px;" type="primary" @click="doImportForUpdate">
- <a-icon type="upload" />
- 修改导入
- </a-button>
- <a-button style="margin-left:8px;" type="primary" @click="doImportMeasure">
- <a-icon type="upload" />
- 检定导入
- </a-button>
- <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
- <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handleBackBatch(13)">批量退库</a-button>
- <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handleBackBatch(4)">批量报废</a-button>
- <!-- <a-button style="margin-left: 8px" type="primary" icon="reload" @click="handleMeasureBatch()">批量检定</a-button> -->
- <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-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-popconfirm v-if="isMeasure===1" @visibleChange="batchIncorrect()">
- <a-menu-item key="2"><my-icon type="icon-pandian" /><a>检定</a></a-menu-item>
- </a-popconfirm>
- <a-popconfirm v-if="isMeasure===1" @visibleChange="batchIncorrectInStore()">
- <a-menu-item key="3"><my-icon type="icon-pandian" /><a>入库</a></a-menu-item>
- </a-popconfirm>
- <a-popconfirm :visible="false" @visibleChange="batchLocation()">
- <a-menu-item key="4"><my-icon type="icon-pandian" /><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"
- :onExpand="onExpand"
- size="default"
- rowKey="id"
- :widthSpace="true"
- :columns="columns"
- :data="loadData"
- :alert="options.alert"
- :rowSelection="options.rowSelection"
- :scroll="{x: 1300, y: BaseTool.Constant.scrollY}"
- showPagination="auto"
- :rowClassName="rowClassName">
- <template #positionNo="text,record">
- <a @click="showChangeLog(record)">{{ text }}</a>
- </template>
- <template #sbMeasureLogCredential="text">
- <a @click="$refs.listModal.base(text)">查看</a>
- </template>
- <span slot="action" slot-scope="record">
- <template>
- <div>
- <!--<a-divider type="vertical" />
- <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要删除该设备?" @confirm="batchDelete(record.id)">
- <a>删除</a>
- </a-popconfirm>
- <a-divider type="vertical" />
- <a @click="handleCopy(record)">复制</a>-->
- <a-dropdown>
- <a-menu slot="overlay">
- <a-menu-item key="0">
- <a @click="handleView(record)">查看</a>
- </a-menu-item>
- <a-menu-item key="1">
- <a v-if="$auth('sb-infos-edit')" @click="addLogBySb(record)">新增记录</a>
- </a-menu-item>
- <a-menu-item key="1">
- <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
- </a-menu-item>
- <a-menu-item key="2" v-if="isMeasure===1">
- <a @click="batchIncorrect(record)">检定</a>
- </a-menu-item>
- <a-menu-item key="3" v-if="isMeasure===1">
- <a @click="batchIncorrectInStore(record)">入库</a>
- </a-menu-item>
- <a-menu-item v-if="record.status != 2" key="2">
- <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
- <a>启用</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item v-if="record.status != 7" key="3">
- <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
- <a>停用</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item key="10">
- <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
- </a-menu-item>
- <a-menu-item key="4">
- <a @click="handlePrint(record)">打印</a>
- </a-menu-item>
- </a-menu>
- <a-button> 操作 <a-icon type="down" /> </a-button>
- </a-dropdown>
- </div>
- </template>
- </span>
- <span slot="status" slot-scope="text">
- <badge :status="DictCache.COLOR.SB_INFO_STATUS[text]" :text="statusMap[text]" />
- </span>
- <span slot="measureStatus" slot-scope="text">
- <badge :status="DictCache.COLOR.SB_MEASURE_STATUS[text]" :text="yesNoMap[text]" />
- </span>
- <div slot="expandedRowRender" slot-scope="record" style="width:100%;">
- <a-card :bordered="false" style="width:100%;position: relative; z-inde:9999">
- <div slot="title">
- <a-row :gutter="20">
- <a-col :span="8">
- <a-input v-model.trim="createdUserName" placeholder="请输入操作人" />
- </a-col>
- <a-col :span="8">
- <a-button type="primary" @click="getLogBySbId(record,createdUserName)">查询</a-button>
- <a-button style="margin-left: 8px" @click="()=>{getLogBySbId(record);createdUserName=''}">重置</a-button>
- <!-- <a-button style="margin-left: 8px" type="primary" icon="plus" @click="addLogBySb(record)">新增</a-button> -->
- </a-col>
- </a-row>
- </div>
- <a-table rowKey="id" :columns="childColumns1" :data-source="record.childMap">
- <template #sbMeasureLogCredential="text">
- <a @click="$refs.listModal.base(text)">查看</a>
- </template>
- </a-table>
- </a-card>
- </div>
- </s-table>
- </div>
- </a-col>
- </a-row>
- </a-card>
- <base-form ref="baseModal" :parent-id="queryParam.parentId" :parent-name="queryParam.parentName" @ok="handleOk" />
- <base-form-status-log ref="baseModalStatusLog" @ok="handleOk" />
- <detail ref="detailModal" @ok="handleOk" />
- <download-modal ref="downloadModal" />
- <preview-modal ref="previewModal" />
- <import-form-add ref="importModal" @ok="handleOk" />
- <ImportMeasure ref="importMeasure" @ok="handleOk" />
- <import-form-add-standard ref="importModalStandard" @ok="handleOk" />
- <import-form-update2 ref="importModalUpdate2" @ok="handleOk" />
- <print-sb-code ref="printSbCode" />
- <print-in-sb-info-batch ref="printInSbInfoBatch" @ok="handleOk" />
- <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk" />
- <base-form-measure ref="baseModalMeasure" @ok="handleOk" />
- <base-form-measure-in-store ref="baseModalMeasureInStore" @ok="handleOk" />
- <base-form-location ref="baseFormLocation" @ok="handleOk" />
- <SbChangeLogSelectModal ref="sbChangeRecordSelectModal" @ok="handleOk" />
- <AddLogForm ref="addLogForm" @ok="handleLogOk" />
- <BackForm ref="backForm" @ok="handleOk" />
- <ListModal ref="listModal" />
- </div>
- </template>
- <script>
- import { STable, Ellipsis } from '@/components'
- import BaseForm from './modules/BaseForm'
- import BackForm from './modules/BackForm'
- import ListModal from './modules/ListModal'
- import AddLogForm from './modules/AddLogForm'
- import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheckBatch'
- import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
- import Detail from './modules/Detail'
- import BaseFormMeasure from './modules/BaseFormMeasure'
- import BaseFormMeasureInStore from './modules/BaseFormMeasureInStore'
- import BaseFormLocation from './modules/BaseFormLocation'
- import DownloadModal from '@/views/download/DownloadModal'
- import PreviewModal from '@/views/preview/PreviewModal'
- import {
- getSbInfoPage2,
- deleteSbInfos,
- querySbInfo,
- getLogBySbId,
- updateLogBySbId,
- fetchSbInfo,
- fetchSbInfos,
- exportSbInfo2,
- batchLocationList
- } from '@/api/sb/info'
- import { queryDept } from '@/api/upms/dept'
- import { generateSbCodeAll } from '@/api/upms/code'
- import { fetchSbTypeTree } from '@/api/sb/type'
- import ImportFormAdd from './modules/ImportFormAdd'
- import ImportMeasure from './modules/ImportMeasure'
- import ImportFormAddStandard from './modules/ImportFormAddStandard'
- import ImportFormUpdate2 from './modules/ImportFormUpdate2'
- import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
- import PrintInSbInfoBatch from '@/views/sb/info/modules/PrintInSbInfoBatch'
- import { getSbPositionTree } from '@/api/sb/position'
- import SbChangeLogSelectModal from '@/views/sb/change-log/modules/SbChangeLogSelectModal'
- export default {
- name: 'SbInfoList',
- components: {
- STable,
- Ellipsis,
- AddLogForm,
- BaseForm,
- DetailSbMeasure,
- Detail,
- DownloadModal,
- PreviewModal,
- PrintSbCode,
- ImportFormAdd,
- ImportFormAddStandard,
- ImportFormUpdate2,
- PrintInSbInfoBatch,
- BaseFormMeasure,
- BaseFormMeasureInStore,
- BaseFormLocation,
- BaseFormStatusLog,
- SbChangeLogSelectModal,
- ListModal,
- BackForm,
- ImportMeasure
- },
- props: {
- filter: {
- type: Number,
- default: -1
- },
- useType: {
- type: Number,
- default: null
- },
- correctType: {
- type: Number,
- default: 1
- },
- measureStatus: {
- type: Number,
- default: null
- },
- isMeasure: {
- type: Number,
- default: null
- },
- isSelf: {
- type: Number,
- default: null
- },
- typeFlag: {
- type: Number,
- default: null
- },
- status: {
- type: Number,
- default: null
- }
- },
- data () {
- return {
- // 查询参数
- queryParam: {
- filter: this.filter,
- useType: this.useType,
- measureStatus: this.measureStatus,
- isMeasure: this.isMeasure,
- isSelf: this.isSelf,
- id: this.$route.query.id,
- typeId: this.$route.query.typeId,
- status: this.$route.query.status || this.status
- },
- expand: false,
- record: {},
- depreciationTypeMap: {},
- visible: true,
- dateRange: [],
- dateRangeCheck: [],
- sbPositionData: [],
- levelMap: {},
- lineMap: {},
- unitMap: {},
- checkTypeMap: {},
- areaList: {},
- childMap: [],
- companyList: {},
- projectList: {},
- isChildMap: {},
- isShowMap: {},
- deptList: {},
- confirmLoading: false,
- useTypeMap: {},
- statusMap: {},
- yesNoMap: {},
- createdUserName: '',
- expandedKeys: [],
- selectedKeys: [],
- sourceTypeMap: {},
- treeData: [],
- positionTreeData: [],
- // 表头
- 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: 100,
- dataIndex: 'positionName'
- },
- // {
- // title: '位置',
- // dataIndex: 'cph',
- // width: 150,
- // checked: true
- // },
- {
- title: '父位号',
- dataIndex: 'no',
- width: 100,
- checked: true
- },
- {
- title: '设备名称',
- checked: true,
- dataIndex: 'name',
- width: 100
- },
- {
- title: '设备等级',
- checked: true,
- dataIndex: 'level',
- width: 120,
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.levelMap, text)
- }
- },
- {
- title: '规格、型号',
- dataIndex: 'model',
- width: 150,
- checked: true
- },
- // {
- // title: '操作类型',
- // dataIndex: 'operatorType',
- // width: 100,
- // checked: true,
- // customRender: (text, record, index) => {
- // return this.BaseTool.Object.getField(this.otherTypeMap, text)
- // }
- // },
- // {
- // title: '操作人',
- // dataIndex: 'operator',
- // width: 100,
- // checked: true
- // },
- // {
- // title: '处理人员',
- // dataIndex: 'updateUserName',
- // width: 100,
- // checked: true
- // },
- // {
- // title: '操作内容',
- // dataIndex: 'operatorContent',
- // width: 100,
- // checked: true
- // },
- // {
- // title: '异常处理描述',
- // dataIndex: 'exceptionDescription',
- // width: 100,
- // checked: true
- // },
- // {
- // title: '文件查看',
- // checked: true,
- // dataIndex: 'sbMeasureLogCredential',
- // width: 120,
- // scopedSlots: { customRender: 'sbMeasureLogCredential' }
- // },
- // {
- // title: '操作时间',
- // dataIndex: 'operatorTime',
- // width: 100,
- // checked: true
- // },
- {
- title: '厂牌',
- dataIndex: 'producerId',
- width: 100,
- checked: true
- },
- /* {
- title: '自定义类型',
- checked: true,
- dataIndex: 'useType',
- width: 150,
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.useTypeMap, text)
- }
- }, */
- /* {
- title: '使用机台',
- checked: true,
- width: 200,
- dataIndex: 'saveUserName'
- },
- {
- title: '生产商',
- dataIndex: 'producerId',
- width: 120,
- checked: true
- }, */
- /* {
- title: '大小尺寸',
- dataIndex: 'zz',
- width: 120,
- checked: true
- }, */
- {
- title: '出厂编号',
- dataIndex: 'zzh',
- width: 100,
- checked: true
- },
- {
- title: '管理编号',
- dataIndex: 'positionNo',
- width: 120,
- checked: true
- },
- /* {
- title: '是否显示',
- dataIndex: 'isShow',
- width: 120,
- checked: true,
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.isShowMap, text)
- }
- }, */
- /* {
- title: '是否子设备',
- dataIndex: 'isChild',
- width: 120,
- checked: true,
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.isChildMap, text)
- }
- }, */
- /* {
- title: '资产编号',
- dataIndex: 'financingNo',
- width: 120,
- checked: true
- },
- {
- title: '设备原值',
- dataIndex: 'initialValue',
- width: 100,
- checked: true,
- customRender: (text, record, index) => {
- return this.BaseTool.Amount.formatter(text)
- }
- },
- {
- title: '购置日期',
- dataIndex: 'buyDate',
- width: 120,
- checked: true
- },
- {
- title: '投用日期',
- dataIndex: 'startDate',
- width: 120,
- checked: true
- }, */
- /* {
- title: '检定日期',
- dataIndex: 'checkDate',
- width: 150,
- checked: true
- },
- {
- title: '检定周期',
- dataIndex: 'checkPeriod',
- width: 100,
- checked: true,
- customRender: (text, record, index) => {
- if (record.nextCheckDate == null) {
- return '未知'
- } else {
- return text + '月'
- }
- }
- }, */
- {
- title: '报废日期',
- dataIndex: 'scrapedDate',
- width: 120,
- checked: true
- },
- {
- title: '有效期限',
- dataIndex: 'nextCheckDate',
- width: 120,
- checked: true
- },
- /* {
- title: '检定截止',
- dataIndex: 'restDay',
- width: 100,
- checked: true,
- customRender: (text, record, index) => {
- if (record.nextCheckDate == null) {
- return '未知'
- } else {
- return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
- }
- }
- }, */
- {
- title: '检定单位',
- checked: true,
- dataIndex: 'dph',
- width: 100
- },
- {
- title: '是否强检',
- dataIndex: 'checkType',
- width: 100,
- checked: true,
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.checkTypeMap, text)
- }
- },
- {
- title: '备注',
- checked: true,
- dataIndex: 'remark',
- width: 100
- },
- {
- title: '状态',
- checked: true,
- dataIndex: 'status',
- align: 'center',
- width: 100,
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '操作',
- key: 'action',
- checked: true,
- align: 'center',
- width: 120,
- scopedSlots: { customRender: 'action' }
- }
- ],
- childColumns1: [
- {
- title: '序号',
- dataIndex: 'index',
- width: 100,
- checked: true,
- customRender: (text, record, index) => {
- return index + 1
- }
- },
- {
- title: '设备名称',
- checked: true,
- width: 200,
- dataIndex: 'sbName'
- },
- {
- title: '操作类型',
- checked: true,
- width: 200,
- dataIndex: 'otherType',
- customRender: (text, record, index) => {
- return this.BaseTool.Object.getField(this.otherTypeMap, text)
- }
- },
- {
- title: '操作人',
- checked: true,
- width: 200,
- dataIndex: 'createdUserName'
- },
- {
- title: '处理人员',
- checked: true,
- width: 200,
- dataIndex: 'updateUserName'
- },
- {
- title: '异常处理描述',
- checked: true,
- width: 200,
- dataIndex: 'exceptionDescription'
- },
- {
- title: '操作内容',
- checked: true,
- width: 200,
- dataIndex: 'content'
- },
- {
- title: '文件查看',
- checked: true,
- dataIndex: 'sbMeasureLogCredential',
- width: 120,
- scopedSlots: { customRender: 'sbMeasureLogCredential' }
- },
- {
- title: '操作时间',
- checked: true,
- width: 200,
- dataIndex: 'createdTime'
- }
- ],
- otherTypeMap: {},
- // 加载数据方法 必须为 Promise 对象
- loadData: (parameter) => {
- parameter = {
- ...parameter,
- ...this.queryParam,
- dataScope: {
- sortBy: 'asc',
- sortName: 'position_no'
- }
- }
- this.selectedRowKeys = []
- return getSbInfoPage2(Object.assign(parameter, this.queryParam)).then((res) => {
- return res.data
- })
- },
- selectedRowKeys: [],
- selectedRows: [],
- options: {
- alert: {
- show: true,
- clear: () => {
- this.selectedRowKeys = []
- }
- },
- rowSelection: {
- selectedRowKeys: this.selectedRowKeys,
- onChange: this.onSelectChange
- }
- },
- optionAlertShow: false
- }
- },
- created () {
- console.log('this.$route.query.parentId: ' + this.$route.query.parentId)
- this.queryParam.parentId = this.$route.query.parentId
- this.queryParam.parentName = this.$route.query.parentName
- this.tableOption()
- this.otherTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_MEASURE_OTHER_TYPE)
- console.log(11)
- console.log(this.otherTypeMap)
- this.checkTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_TYPE)
- this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
- this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
- this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
- this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
- this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
- this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
- this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
- this.lineMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REMOTE_LINE)
- this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
- querySbPosition().then((res) => {
- this.sbPositionData = res.data
- })
- },
- methods: {
- tableOption () {
- this.setTree()
- 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]
- }
- deleteSbInfos(ids).then((res) => {
- this.$message.info('删除成功')
- this.handleOk()
- this.$refs.table.clearSelected()
- })
- },
- batchGenerate () {
- this.confirmLoading = true
- this.$message.info('正在生成请稍后')
- generateSbCodeAll().then((res) => {
- this.confirmLoading = false
- this.$message.info('生成成功')
- this.handleOk()
- this.$refs.table.clearSelected()
- })
- },
- handleEdit (record) {
- fetchSbInfo({ id: record.id }).then((res) => {
- this.visible = false
- const modal = this.$refs.baseModal
- modal.base(res.data)
- })
- },
- handlePrint (record) {
- this.visible = false
- fetchSbInfo({ id: record.id }).then((res) => {
- const modal = this.$refs.printInSbInfoBatch
- modal.base([res.data])
- })
- },
- batchLocation () {
- let ids = []
- const length = this.selectedRows.length
- if (length === 0) {
- this.$message.info('请选择设备')
- return
- }
- ids = this.selectedRows.map((item) => item.id)
- console.log(ids)
- batchLocationList({ ids }).then((res) => {
- this.visible = false
- const modal = this.$refs.baseFormLocation
- modal.base(res.data)
- })
- },
- batchIncorrect (id) {
- let ids = []
- if (this.BaseTool.String.isBlank(id)) {
- const length = this.selectedRows.length
- if (length === 0) {
- this.$message.info('请选择要填报的设备')
- return
- }
- ids = this.selectedRows
- } else {
- ids = [id]
- }
- this.visible = false
- const modal = this.$refs.baseModalMeasure
- modal.base(ids, this.correctType)
- },
- batchIncorrectInStore (id) {
- let ids = []
- if (this.BaseTool.String.isBlank(id)) {
- const length = this.selectedRows.length
- if (length === 0) {
- this.$message.info('请选择要填报的设备')
- return
- }
- ids = this.selectedRows
- } else {
- ids = [id]
- }
- this.visible = false
- const modal = this.$refs.baseModalMeasureInStore
- modal.base(ids, this.correctType)
- },
- handleMeasureBatch () {
- const modal = this.$refs.detailSbMeasureModal
- modal.base()
- },
- handlePrintBatch () {
- this.visible = false
- let ids = []
- const length = this.selectedRows.length
- if (length === 0) {
- this.$message.info('请选择要打印的设备')
- return
- }
- ids = this.selectedRows.map((item) => item.id)
- fetchSbInfos(ids).then((res) => {
- const modal = this.$refs.printInSbInfoBatch
- modal.base(res.data)
- })
- },
- handleBackBatch (status) {
- const length = this.selectedRowKeys.length
- if (length === 0) {
- this.$message.info('请选择设备')
- return
- }
- const modal = this.$refs.backForm
- modal.base(this.selectedRowKeys, status)
- },
- handleStart (record) {
- const modal = this.$refs.baseModalStatusLog
- modal.base(null, {
- sbId: record.id,
- sbNo: record.no,
- changeUserId: this.$store.getters.userInfo.userId,
- actualUser: this.$store.getters.userInfo.realName,
- preStatus: record.status,
- afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_USE
- })
- },
- handleStop (record) {
- const modal = this.$refs.baseModalStatusLog
- modal.base(null, {
- sbId: record.id,
- sbNo: record.no,
- changeUserId: this.$store.getters.userInfo.userId,
- actualUser: this.$store.getters.userInfo.realName,
- preStatus: record.status,
- afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_STOP
- })
- },
- handleAdd () {
- this.visible = false
- this.$refs.baseModal.base()
- },
- handleView (record) {
- fetchSbInfo({ id: record.id }).then((res) => {
- this.visible = false
- const modal = this.$refs.detailModal
- modal.base(res.data)
- })
- },
- showChangeLog (record) {
- console.log(record)
- console.log(this.$refs)
- this.$refs.sbChangeRecordSelectModal.base({}, { sbId: record.id })
- },
- handleCopy (record) {
- this.visible = false
- fetchSbInfo({ id: record.id }).then((res) => {
- const modal = this.$refs.baseModal
- modal.base(res.data, 1)
- })
- },
- handleOk () {
- this.visible = true
- this.setTree()
- if (this.dateRange != null) {
- this.queryParam.nextCheckDateStart = this.dateRange[0]
- this.queryParam.nextCheckDateEnd = this.dateRange[1]
- this.queryParam.nextCheckDateStart = this.queryParam.nextCheckDateStart
- ? this.queryParam.nextCheckDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- : null
- this.queryParam.nextCheckDateEnd = this.queryParam.nextCheckDateEnd
- ? this.queryParam.nextCheckDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- : null
- }
- if (this.dateRangeCheck != null) {
- this.queryParam.checkDateStart = this.dateRangeCheck[0]
- this.queryParam.checkDateEnd = this.dateRangeCheck[1]
- this.queryParam.checkDateStart = this.queryParam.checkDateStart
- ? this.queryParam.checkDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- : null
- this.queryParam.checkDateEnd = this.queryParam.checkDateEnd
- ? this.queryParam.checkDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- : null
- }
- this.$refs.table.clearSelected()
- this.$refs.table.refresh()
- },
- onSelectChange (selectedRowKeys, selectedRows) {
- this.selectedRowKeys = selectedRowKeys
- this.selectedRows = selectedRows
- },
- resetSearchForm () {
- this.queryParam = {
- filter: this.filter,
- useType: this.useType,
- measureStatus: this.measureStatus,
- isMeasure: this.isMeasure,
- isSelf: this.isSelf,
- id: this.$route.query.id,
- typeId: this.$route.query.typeId,
- status: this.$route.query.status || this.status
- }
- this.visible = true
- this.$refs.table.refresh(true)
- },
- doExport () {
- const parameter = {
- ...this.queryParam,
- sbIds: this.selectedRowKeys,
- dataScope: {
- sortBy: 'asc',
- sortName: 'no'
- }
- }
- console.log(parameter)
- exportSbInfo2(parameter).then((file) => {
- this.BaseTool.UPLOAD.downLoadExportExcel(file)
- })
- },
- setTree (record = {}) {
- queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then((res) => {
- this.areaList = res.data
- })
- getSbPositionTree().then((res) => {
- this.positionTreeData = res.data
- })
- fetchSbTypeTree().then((res) => {
- this.treeData = res.data
- })
- },
- onSelect: function (selectedKeys, info) {
- this.selectedKeys = selectedKeys
- this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
- this.$refs.table.refresh(true)
- },
- onExpand (expanded, record) {
- // expanded判断展开or收缩操作,record当前行数据
- this.childMap = []
- getLogBySbId({ sbId: record.id }).then((res) => {
- record.childMap = res.data.rows
- this.$forceUpdate()
- })
- },
- getLogBySbId (record, createdUserName) {
- getLogBySbId({ sbId: record.id, createdUserName }).then((res) => {
- record.childMap = res.data.rows
- this.$forceUpdate()
- })
- },
- addLogBySb (record) {
- this.record = record
- this.$refs.addLogForm.base(record)
- },
- handleLogOk (val) {
- getLogBySbId({ sbId: val.sbId }).then((res) => {
- this.record.childMap = res.data.rows
- this.$forceUpdate()
- })
- },
- doImport () {
- this.$refs.importModal.base(null, null)
- },
- doImportStandard () {
- // this.$refs.importModalStandard.base()
- this.$refs.importModalUpdate2.base(null, 1, this.typeFlag)
- },
- doImportForUpdate () {
- this.$refs.importModalUpdate2.base(null, 2, 2)
- },
- doImportMeasure () {
- this.$refs.importMeasure.base()
- },
- rowClassName (record, index) {
- if (record.measureStatus === 1 && record.status !== 7) return 'orange'
- switch (record.status) {
- case 1:
- return 'green'
- case 3:
- case 4:
- return 'red'
- case 5:
- case 6:
- case 7:
- return 'gray'
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- /deep/ .green {
- background: rgb(58, 233, 58);
- }
- /deep/ .red {
- background: red;
- }
- /deep/ .gray {
- background: #666;
- }
- /deep/ .orange {
- background: rgb(245, 132, 91);
- }
- </style>
|