设备管理-油液基础数据维护页面、设备台账增加油液信息页签
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="油液ç¼ç "> |
| | | <j-input placeholder="请è¾å
¥æ²¹æ¶²ç¼ç " v-model="queryParam.fluidCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="油液åç§°"> |
| | | <j-input placeholder="请è¾å
¥æ²¹æ¶²åç§°" v-model="queryParam.fluidName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('油液信æ¯')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <eam-fluid-modal ref="modalForm" @ok="modalFormOk"></eam-fluid-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EamFluidModal from './modules/EamFluidModal' |
| | | |
| | | export default { |
| | | name: 'EamFluidList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | EamFluidModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '油液信æ¯ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'油液ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'fluidCode' |
| | | }, |
| | | { |
| | | title:'油液åç§°', |
| | | align:"center", |
| | | dataIndex: 'fluidName' |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamFluid/list", |
| | | delete: "/eam/eamFluid/delete", |
| | | deleteBatch: "/eam/eamFluid/deleteBatch", |
| | | exportXlsUrl: "/eam/eamFluid/exportXls", |
| | | importExcelUrl: "eam/eamFluid/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'fluidName',text:'油液åç§°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'fluidCode',text:'油液ç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'remark',text:'夿³¨',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="油液ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fluidCode"> |
| | | <a-input v-model="model.fluidCode" placeholder="ç³»ç»èªå¨çæ" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="油液åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fluidName"> |
| | | <a-input v-model="model.fluidName" placeholder="请è¾å
¥æ²¹æ¶²åç§°" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-textarea v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨" ></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'EamFluidForm', |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | fluidName: [ |
| | | { required: true, message: '请è¾å
¥æ²¹æ¶²åç§°!'}, |
| | | { validator: (rule, value, callback) => validateDuplicateValue('eam_fluid', 'fluid_name', value, this.model.id, callback) } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/eam/eamFluid/add", |
| | | edit: "/eam/eamFluid/edit", |
| | | queryById: "/eam/eamFluid/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | submitForm () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | httpAction(httpurl,this.model,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <eam-fluid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-fluid-form> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import EamFluidForm from './EamFluidForm' |
| | | export default { |
| | | name: 'EamFluidModal', |
| | | components: { |
| | | EamFluidForm |
| | | }, |
| | | data () { |
| | | return { |
| | | title:'', |
| | | width:800, |
| | | visible: false, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(); |
| | | }) |
| | | }, |
| | | edit (record) { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.edit(record); |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | this.$refs.realForm.submitForm(); |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <a-tab-pane tab="设å¤ç²¾åº¦" :key="8" v-if="isOpenPrecision"> |
| | | <eam-equipment-precision-list ref="tabPaneTableListRef8" :isDisplayOperation="false"/> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="è®¾å¤æ²¹æ¶²" :key="9"> |
| | | <eam-equipment-fluid-list ref="tabPaneTableListRef9" :isDisplayOperation="false"/> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <!-- 表ååºå --> |
| | |
| | | import EamEquipmentPrecisionList from '@views/eam/equipment/modules/EamEquipmentPrecisionList.vue' |
| | | import EamSecondMaintenanceOrderList from '@views/eam/maintenance/EamSecondMaintenanceOrderList.vue' |
| | | import EamThirdMaintenanceOrderList from '@views/eam/maintenance/EamThirdMaintenanceOrderList.vue' |
| | | import EamEquipmentFluidList from '@views/eam/equipment/modules/EamEquipmentFluidList.vue' |
| | | |
| | | export default { |
| | | name: 'EamEquipmentList', |
| | |
| | | EamEquipmentProcessList, |
| | | EamEquipmentPrecisionList, |
| | | EamSecondMaintenanceOrderList, |
| | | EamThirdMaintenanceOrderList |
| | | EamThirdMaintenanceOrderList, |
| | | EamEquipmentFluidList |
| | | }, |
| | | data() { |
| | | return { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <vxe-toolbar> |
| | | <template v-slot:buttons> |
| | | <vxe-button status="primary" @click="insertEvent()">æ°å¢</vxe-button> |
| | | <vxe-button status="danger" @click="handleBatchRemove()">æ¹éå é¤</vxe-button> |
| | | </template> |
| | | </vxe-toolbar> |
| | | <vxe-table |
| | | ref="editableDetailTable" |
| | | border |
| | | resizable |
| | | show-overflow |
| | | keep-source |
| | | :height="300" |
| | | :loading="confirmLoading" |
| | | :data="dataSource" |
| | | :edit-rules="validRules" |
| | | :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}" |
| | | style="margin-top: 8px;"> |
| | | <vxe-table-column type="checkbox" width="60"></vxe-table-column> |
| | | <vxe-table-column type="seq" width="60"></vxe-table-column> |
| | | <vxe-table-column title="ID" field="id" :visible="false"></vxe-table-column> |
| | | <vxe-table-column title="equipmentId" field="equipmentId" :visible="false"></vxe-table-column> |
| | | <vxe-table-column title="油液åç§°" field="fluidId" align="center" |
| | | :edit-render="{name : '$select', options: fluidList, optionProps: {label:'fluidName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"></vxe-table-column> |
| | | <vxe-table-column title="åæ°ç¼ç " field="fluidCode" align="center"></vxe-table-column> |
| | | <vxe-table-column title="æä½" width="160"> |
| | | <template v-slot="{row}"> |
| | | <template v-if="hasEditStatus(row)"> |
| | | <vxe-button @click="saveRowEvent(row)">ä¿å</vxe-button> |
| | | <vxe-button @click="cancelRowEvent(row)">åæ¶</vxe-button> |
| | | </template> |
| | | <template v-else> |
| | | <vxe-button @click="editRowEvent(row)">ç¼è¾</vxe-button> |
| | | <vxe-button @click="handleRemove(row)">å é¤</vxe-button> |
| | | </template> |
| | | |
| | | </template> |
| | | </vxe-table-column> |
| | | </vxe-table> |
| | | <a-pagination |
| | | v-bind="ipagination" |
| | | @change="handlePageChange" |
| | | @showSizeChange="handleShowSizeChange" |
| | | /> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { deleteAction, getAction, httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'EamEquipmentFluidList', |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | confirmLoading: false, |
| | | url: { |
| | | add: '/eam/eamEquipmentFluid/add', |
| | | edit: '/eam/eamEquipmentFluid/edit', |
| | | list: '/eam/eamEquipmentFluid/list', |
| | | delete: '/eam/eamEquipmentFluid/delete', |
| | | deleteBatch: '/eam/eamEquipmentFluid/deleteBatch', |
| | | fluidList: '/eam/eamFluid/listAll' |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | size: 'small' |
| | | }, |
| | | dataSource: [], |
| | | fluidList: [], |
| | | queryParam: { |
| | | equipmentId: '-1' |
| | | }, |
| | | validRules: { |
| | | fluidId: [ |
| | | { required: true, message: 'è¯·éæ©æ²¹æ¶²ï¼' } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.loadFluidList() |
| | | }, |
| | | methods: { |
| | | handleParamSelectChange($event, value) { |
| | | console.log(value) |
| | | let parameter = this.fluidList.find(item => item.id === value.value) |
| | | if (parameter) { |
| | | $event.row.fluidCode = parameter.fluidCode |
| | | } else { |
| | | $event.row.fluidCode = undefined |
| | | } |
| | | }, |
| | | loadFluidList() { |
| | | getAction(this.url.fluidList).then(res => { |
| | | if (res.success) { |
| | | this.fluidList = [...res.result] |
| | | } |
| | | }) |
| | | }, |
| | | onClearSelected() { |
| | | this.dataSource = [] |
| | | this.queryParam.equipmentId = '-1' |
| | | this.ipagination.current = 1 |
| | | this.ipagination.total = 0 |
| | | }, |
| | | loadData(args) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | if (args === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | // å°è£
æ¥è¯¢æ¡ä»¶ |
| | | let formData = { |
| | | pageNo: args, |
| | | pageSize: this.ipagination.pageSize, |
| | | equipmentId: this.queryParam.equipmentId |
| | | } |
| | | // è°ç¨æ¥è¯¢æ°æ®æ¥å£ |
| | | this.confirmLoading = true |
| | | getAction(this.url.list, formData).then(res => { |
| | | if (res.success) { |
| | | // åå°æ¥è¯¢åæ¥ç totalï¼æ°æ®æ»æ°é |
| | | this.dataSource = res.result.records || res.result |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | // è¿éæ¯æ 论æåæå¤±è´¥é½ä¼æ§è¡çæ¹æ³ï¼å¨è¿éå
³éloading |
| | | this.confirmLoading = false |
| | | }) |
| | | }, |
| | | async insertEvent() { |
| | | let record = { equipmentId: this.queryParam.equipmentId } |
| | | let { row: newRow } = await this.$refs.editableDetailTable.insert(record) |
| | | await this.$refs.editableDetailTable.setActiveCell(newRow, 'fluidId') |
| | | }, |
| | | async saveRowEvent(row) { |
| | | let that = this |
| | | const errMap = await that.$refs.editableDetailTable.validate().catch(errMap => errMap) |
| | | if (errMap) { |
| | | that.$message.warning('æ ¡éªä¸éè¿,请补å
å¿
填项ï¼') |
| | | return |
| | | } |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!row.id) { |
| | | httpurl += that.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += that.url.edit |
| | | method = 'put' |
| | | } |
| | | let res = await httpAction(httpurl, row, method) |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData(that.ipagination.current) |
| | | await that.$refs.editableDetailTable.clearActived() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | that.confirmLoading = false |
| | | }, |
| | | handleRemove(row) { |
| | | let xTable = this.$refs.editableDetailTable |
| | | let that = this |
| | | this.$confirm({ |
| | | content: `确认è¦å é¤åï¼`, |
| | | onOk: () => { |
| | | if (row.id) { |
| | | //å端å é¤ |
| | | deleteAction(that.url.delete, { id: row.id }).then((res) => { |
| | | if (res.success) { |
| | | that.reCalculatePage(1) |
| | | that.$message.success(res.message) |
| | | that.loadData(that.ipagination.current) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } else { |
| | | //å端å é¤ |
| | | xTable.remove(row) |
| | | } |
| | | }, |
| | | onCancel: () => { |
| | | xTable.setActiveCell(row, 'fluidId') |
| | | } |
| | | }) |
| | | }, |
| | | handleBatchRemove(){ |
| | | let xTable = this.$refs.editableDetailTable |
| | | let that = this |
| | | let checkboxRecords = xTable.getCheckboxRecords(); |
| | | if(checkboxRecords && checkboxRecords.length > 0) { |
| | | let ids = checkboxRecords.map(record => record.id); |
| | | this.$confirm({ |
| | | title: "确认å é¤", |
| | | content: "æ¯å¦å é¤é䏿°æ®?", |
| | | onOk: function () { |
| | | that.confirmLoading = true; |
| | | deleteAction(that.url.deleteBatch, {ids: ids.join(',')}).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(checkboxRecords.length) |
| | | that.$message.success(res.message); |
| | | that.loadData(that.ipagination.current); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | that.$message.warning('请å
é䏿°æ®è¡ï¼'); |
| | | } |
| | | }, |
| | | editRowEvent(row) { |
| | | this.$refs.editableDetailTable.setActiveRow(row) |
| | | }, |
| | | cancelRowEvent(row) { |
| | | let xTable = this.$refs.editableDetailTable |
| | | this.$confirm({ |
| | | content: `ç¡®è®¤è¦æ¾å¼ç¼è¾åï¼`, |
| | | onOk: () => { |
| | | xTable.revertData() |
| | | }, |
| | | onCancel: () => { |
| | | xTable.setActiveCell(row, 'fluidId') |
| | | } |
| | | }) |
| | | }, |
| | | hasEditStatus(row) { |
| | | const $table = this.$refs.editableDetailTable |
| | | if ($table) { |
| | | return $table.isActiveByRow(row) |
| | | } |
| | | return false |
| | | }, |
| | | reCalculatePage(count) { |
| | | //æ»æ°é-count |
| | | let total = this.ipagination.total - count |
| | | //è·åå é¤åçåé¡µæ° |
| | | let currentIndex = Math.ceil(total / this.ipagination.pageSize) |
| | | //å é¤åçå页æ°<æå¨å½å页 |
| | | if (currentIndex < this.ipagination.current) { |
| | | this.ipagination.current = currentIndex |
| | | } |
| | | }, |
| | | handlePageChange(current, pageSize){ |
| | | this.$set(this.ipagination, 'current', current) |
| | | this.$emit('change', {current, pageSize}) |
| | | }, |
| | | handleShowSizeChange(current, pageSize){ |
| | | this.$set(this.ipagination, 'pageSize', pageSize) |
| | | this.$emit('change', {current, pageSize}) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |