| | |
| | | <a-menu-item v-has="'equipmentAccount:add&delete&import&Edit'"> |
| | | <a @click="handleEdit(record)" >ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-has="'equipmentAccount:add&delete&import&Edit'"> |
| | | <a @click="handleEditSpareParts(record)" >ç¼è¾å¤ä»¶</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | |
| | | <a-tab-pane tab="è®¾å¤ææ¡£" key="3" forceRender> |
| | | <EquipmentDocumentList :mainId="selectedMainId" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="ABCæ è¯åæ´è®°å½" key="4" forceRender> |
| | | <a-tab-pane tab="å¤ä»¶" key="4" forceRender> |
| | | <EquipmentSpareParts :mainId="selectedMainId" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="ABCæ è¯åæ´è®°å½" key="5" forceRender> |
| | | <equipment-update-ABC-list :mainId="selectedMainId" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="è´¨ä¿æåæ´è®°å½" key="5" forceRender> |
| | | <a-tab-pane tab="è´¨ä¿æåæ´è®°å½" key="6" forceRender> |
| | | <equipment-update-warranty-list :mainId="selectedMainId" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | |
| | | <precision-edit-model ref ="precisionEditModel"></precision-edit-model> |
| | | <aBC-update-edit-model @ok="modalFormOk" :updateList="selectionRows" ref="updateABC"></aBC-update-edit-model> |
| | | <warranty-update-model :updateList="selectionRows" ref="updateWarranty"></warranty-update-model> |
| | | <EquipmentSparePartsModal ref="modalFormSpareParts" @ok="modalFormOk" /> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import PrecisionEditModel from './modules/equipmentNew/edit/PrecisionEditModel' |
| | | import EquipmentUpdateABCList from './modules/equipmentNew/EquipmentUpdateABCList.vue' |
| | | import EquipmentUpdateWarrantyList from './modules/equipmentNew/EquipmentUpdateWarrantyList.vue' |
| | | import ABCUpdateEditModel from './modules/equipmentNew/edit/ABCUpdateEditModel.vue' |
| | | import WarrantyUpdateModel from './modules/equipmentNew/edit/WarrantyUpdateModel.vue' |
| | | |
| | | |
| | | |
| | | |
| | | import ABCUpdateEditModel from './modules/equipmentNew/edit/ABCUpdateEditModel.vue' |
| | | import WarrantyUpdateModel from './modules/equipmentNew/edit/WarrantyUpdateModel.vue' |
| | | import EquipmentSpareParts from './modules/equipmentNew/EquipmentSpareParts.vue' |
| | | import EquipmentSparePartsModal from './modules/equipmentNew/EquipmentSparePartsModal' |
| | | export default { |
| | | name: "EquipmentList", |
| | | mixins:[JeecgListMixin,mixinDevice], |
| | |
| | | EquipmentPrecisionParametersList, |
| | | EquipmentModal, |
| | | EquipmentResumeDrawer, |
| | | JSearchSelectTag, |
| | | JSearchSelectTag, |
| | | ProcessEditModel, |
| | | PrecisionEditModel, |
| | | EquipmentUpdateABCList , |
| | | EquipmentUpdateWarrantyList, |
| | | ABCUpdateEditModel, |
| | | WarrantyUpdateModel, |
| | | EquipmentSpareParts, |
| | | EquipmentSparePartsModal |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | }, |
| | | handleUpdateWarranty(){ |
| | | this.$refs.updateWarranty.add(); |
| | | }, |
| | | handleEditSpareParts(record){ |
| | | this.$refs.modalFormSpareParts.edit(record); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false" :class="'cust-erp-sub-tab'"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" v-if="mainId"> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | v-if="mainId !='' && isAdd " |
| | | >æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange"> |
| | | <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" --> |
| | | |
| | | <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)" v-if="addStatus" >ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="addStatus" /> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)" > |
| | | <a v-if="addStatus">å é¤</a> |
| | | </a-popconfirm> |
| | | <a style="font-size: 12px;font-style: italic;" v-if="!addStatus">è¯¥ç¶æä¸å¯æä½</a> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | export default { |
| | | name: "EquipmentSpareParts", |
| | | mixins:[JeecgListMixin], |
| | | components: {}, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | }, |
| | | isEdit: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | isAdd: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | isDel: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | disableMixinCreated:true, |
| | | repairOrderSelectionRows:[], |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'å¤ä»¶ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'num', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'å¤ä»¶åç§°', |
| | | align:"center", |
| | | dataIndex: 'name', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'è§æ ¼', |
| | | align:"center", |
| | | dataIndex: 'specification', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'åå·', |
| | | align:"center", |
| | | dataIndex: 'model', |
| | | width:200 |
| | | |
| | | }, |
| | | // { |
| | | // title:'æ°é', |
| | | // align:"center", |
| | | // dataIndex: 'quantity', |
| | | // width:200 |
| | | // }, |
| | | { |
| | | title:'计éåä½', |
| | | align:"center", |
| | | dataIndex: 'unitId_dictText', |
| | | width:200 |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentSpares/myPage", |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="'å¤ä»¶ç¼è¾'" |
| | | :width='2000' |
| | | :visible='visible' |
| | | :maskClosable='false' |
| | | :fullscreen="true" |
| | | switchFullscreen |
| | | @ok='handleOk' |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel='handleCancel'> |
| | | <equipment-spare-parts-form ref='realForm' @ok='submitCallback' :disabled='disableSubmit' /> |
| | | </j-modal> |
| | | </template> |
| | | <script> |
| | | import EquipmentSparePartsForm from './edit/EquipmentSparePartsForm' |
| | | export default { |
| | | name: 'EquipmentSparePartsModal', |
| | | components: { |
| | | EquipmentSparePartsForm |
| | | }, |
| | | 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.handleOk() |
| | | }, |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning='confirmLoading'> |
| | | <!-- 主表ååºå --> |
| | | <a-form-model ref='form' :model='model' :rules='validatorRules'> |
| | | <a-row> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='ç»ä¸ç¼ç ' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'> |
| | | <a-input v-model='model.num' placeholder='ç³»ç»èªå¨çæ' :disabled = "true"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='设å¤åç§°' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='name'> |
| | | <a-input v-model='model.name' placeholder='ç³»ç»èªå¨çæ' :disabled = "true"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='è§æ ¼' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='specification'> |
| | | <a-input v-model='model.specification' placeholder='ç³»ç»èªå¨çæ' :disabled = "true"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='åå·' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='model'> |
| | | <a-input v-model='model.model' placeholder='ç³»ç»èªå¨çæ' :disabled = "true"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | |
| | | <!-- å表ååºå --> |
| | | <a-tabs v-model='activeKey' @change='handleChangeTabs'> |
| | | <a-tab-pane tab='å¤ä»¶' :key='refKeys[0]' :forceRender='true'> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref='refKeys[0]' |
| | | highlight-current-row |
| | | :loading='sparePartsVxeTable.loading' |
| | | :columns='sparePartsVxeTable.columns' |
| | | :dataSource='sparePartsVxeTable.dataSource' |
| | | :maxHeight='300' |
| | | :disabled='formDisabled' |
| | | :rowNumber='true' |
| | | :rowSelection='true' |
| | | @pageChange='handleTable1PageChange' |
| | | :pagination='sparePartsVxeTable.pagination' |
| | | :toolbar='true' |
| | | :toolbarConfig='toolbarConfig' |
| | | > |
| | | |
| | | <template slot='toolbarPrefix'> |
| | | <a-button type='primary' @click='equipmentSparesSelect' :disabled="formDisabled">éæ©å¤ä»¶ |
| | | </a-button> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <spare-parts-list @selectionRows='selectionRows' ref='SparePartsSelectModal' :categories="model.toolingCategoryFlag"></spare-parts-list> |
| | | </a-spin> |
| | | </template> |
| | | <script> |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' |
| | | import JFormContainer from '@/components/jeecg/JFormContainer' |
| | | import { getAction } from '@api/manage' |
| | | import { filterObj } from '@/utils/util' |
| | | import SparePartsList from '../serach/SparePartsList' |
| | | export default { |
| | | name: 'EquipmentSparePartsForm', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | JFormContainer, |
| | | SparePartsList |
| | | }, |
| | | data() { |
| | | return { |
| | | type: '', |
| | | disableSubmit: false, |
| | | documentTypeStr: '', |
| | | dataList: [], |
| | | detailList: [], |
| | | isShow: true, |
| | | company: '', |
| | | queryParam: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | toolbarConfig: { |
| | | // prefix åç¼ï¼suffix åç¼ |
| | | slot: ['prefix', 'suffix'], |
| | | // add æ°å¢æé®ï¼remove å 餿é®ï¼clearSelection æ¸
ç©ºéæ©æé® |
| | | btn: ['remove', 'clearSelection'] |
| | | }, |
| | | model: {}, |
| | | // æ°å¢æ¶å表é»è®¤æ·»å å è¡ç©ºæ°æ® |
| | | addDefaultRowNum: 0, |
| | | validatorRules: { |
| | | }, |
| | | refKeys: ['sparePartsCowsVagina'], |
| | | tableKeys: ['sparePartsCowsVagina'], |
| | | activeKey: 'sparePartsCowsVagina', |
| | | sparePartsVxeTable: { |
| | | loading: false, |
| | | pagination: { current: 1, pageSize: 1000, pageSizeOptions: ['1000', '2000'], total: 0 }, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | key: 'num', |
| | | type: JVXETypes.normal, |
| | | width: '200px', |
| | | align: 'center', |
| | | placeholder: '请è¾å
¥${title}', |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | key: 'name', |
| | | type: JVXETypes.normal, |
| | | width: '200px', |
| | | align: 'center', |
| | | placeholder: '请è¾å
¥${title}', |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | key: 'specification', |
| | | type: JVXETypes.normal, |
| | | width: '200px', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | key: 'model', |
| | | align: 'center', |
| | | type: JVXETypes.normal, |
| | | width: '150px', |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | key: 'unitName', |
| | | align: 'center', |
| | | type: JVXETypes.normal, |
| | | width: '150px', |
| | | }, |
| | | ] |
| | | }, |
| | | result: Array, |
| | | url: { |
| | | list: '/tooling/toolingStockTaking/getToolingList', |
| | | add: '/tooling/toolingStockTaking/add', |
| | | edit: '/eam/equipmentSpares/editByEquipment', |
| | | queryById: '/tooling/toolingStockTaking/queryById', |
| | | sparePartsCowsVagina: { |
| | | list: '/eam/equipmentSpares/myList' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | selectionRows(data) { |
| | | // å¢å éä¸ç设å¤å°åè¡¨ä¸ |
| | | |
| | | this.addSelectedEquipments(data) |
| | | }, |
| | | changeBtn() { |
| | | |
| | | this.addSelectedEquipments(this.dataList) |
| | | }, |
| | | |
| | | |
| | | getData() { |
| | | // å°è£
æ¥è¯¢æ¡ä»¶ |
| | | let params = { |
| | | pageNo: this.sparePartsVxeTable.pagination.current, |
| | | pageSize: this.sparePartsVxeTable.pagination.pageSize, |
| | | id: this.model.id |
| | | } |
| | | // è°ç¨æ¥è¯¢æ°æ®æ¥å£ |
| | | this.sparePartsVxeTable.loading = true |
| | | this.requestSubTableData(this.url.sparePartsCowsVagina.list, params, this.sparePartsVxeTable) |
| | | }, |
| | | handleTable1PageChange(event) { |
| | | // éæ°èµå¼ |
| | | this.sparePartsVxeTable.pagination.current = event.current |
| | | this.sparePartsVxeTable.pagination.pageSize = event.pageSize |
| | | // æ¥è¯¢æ°æ® |
| | | this.getData() |
| | | }, |
| | | |
| | | //éæ©è®¾å¤ |
| | | equipmentSparesSelect() { |
| | | let ids = [] |
| | | let tableData = this.$refs.sparePartsCowsVagina.getTableData() |
| | | let deleteData = this.$refs.sparePartsCowsVagina.getDeleteData() |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | ids.push(tableData[i].sparePartId) |
| | | } |
| | | this.$refs.SparePartsSelectModal.showModals(ids) |
| | | this.$refs.SparePartsSelectModal.title = 'éæ©å¤ä»¶' |
| | | this.$refs.SparePartsSelectModal.disableSubmit = false |
| | | }, |
| | | addSelectedEquipments(data) { |
| | | let tableData = this.$refs.sparePartsCowsVagina.getTableData() |
| | | var tableStr = JSON.stringify(tableData) |
| | | const addRows = [] |
| | | console.log(data) |
| | | console.log(tableStr) |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | var sparePartsCowsVagina = {} |
| | | if (tableStr.indexOf(data[i].id) == -1) { |
| | | sparePartsCowsVagina = { |
| | | sparePartId:data[i].id, |
| | | num : data[i].num, |
| | | name: data[i].name, |
| | | model: data[i].model, |
| | | specification: data[i].specification, |
| | | unitId:data[i].mainUnitId, |
| | | unitName: data[i].mainUnitId_dictText, |
| | | delFlag: 0 |
| | | } |
| | | } |
| | | addRows.push(sparePartsCowsVagina) |
| | | } |
| | | this.$refs.sparePartsCowsVagina.pushRows(addRows) |
| | | }, |
| | | |
| | | |
| | | addBefore() { |
| | | this.sparePartsVxeTable.dataSource = [] |
| | | }, |
| | | getAllTable() { |
| | | let values = this.tableKeys.map(key => getRefPromise(this, key)) |
| | | return Promise.all(values) |
| | | }, |
| | | /** è°ç¨å®edit()æ¹æ³ä¹åä¼èªå¨è°ç¨æ¤æ¹æ³ */ |
| | | editAfter() { |
| | | this.$nextTick(() => { |
| | | }) |
| | | // å è½½åè¡¨æ°æ® |
| | | if (this.model.id) { |
| | | let params = { |
| | | pageNo: this.sparePartsVxeTable.pagination.current, |
| | | pageSize: this.sparePartsVxeTable.pagination.pageSize, |
| | | id: this.model.id |
| | | } |
| | | this.requestSubTableData(this.url.sparePartsCowsVagina.list, params, this.sparePartsVxeTable) |
| | | |
| | | } |
| | | }, |
| | | //æ ¡éªææä¸å¯¹ä¸å表表å |
| | | validateSubForm(allValues) { |
| | | return new Promise((resolve, reject) => { |
| | | Promise.all([]).then(() => { |
| | | resolve(allValues) |
| | | }).catch(e => { |
| | | if (e.error === VALIDATE_FAILED) { |
| | | // å¦æææªéè¿è¡¨åéªè¯çå表ï¼å°±èªå¨è·³è½¬å°å®æå¨çtab |
| | | this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] |
| | | } else { |
| | | console.error(e) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | /** æ´çæformData */ |
| | | classifyIntoFormData(allValues) { |
| | | let main = Object.assign(this.model, allValues.formValue) |
| | | return { |
| | | ...main, // å±å¼ |
| | | equipmentSparesList: allValues.tablesValue[0].tableData |
| | | } |
| | | }, |
| | | |
| | | validateError(msg) { |
| | | this.$message.error(msg) |
| | | }, |
| | | requestSubTableData(url, params, tab, success) { |
| | | tab.loading = true |
| | | getAction(url, params).then(res => { |
| | | let { result } = res |
| | | let dataSource = [] |
| | | if (result) { |
| | | if (Array.isArray(result)) { |
| | | dataSource = result |
| | | } else if (Array.isArray(result.records)) { |
| | | dataSource = result.records |
| | | } |
| | | } |
| | | tab.dataSource = dataSource |
| | | if (res.result.total) { |
| | | this.sparePartsVxeTable.pagination.total = res.result.total |
| | | } else { |
| | | this.sparePartsVxeTable.pagination.total = 0 |
| | | } |
| | | typeof success === 'function' ? success(res) : '' |
| | | }).finally(() => { |
| | | tab.loading = false |
| | | }) |
| | | }, |
| | | cleanData(){ |
| | | this.$refs.sparePartsCowsVagina.remove(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <a-modal :visible='visible' :title='title' switchFullscreen @ok='handleSubmit' @cancel='close' style='top:50px' |
| | | cancelText='å
³é' :width='1950'> |
| | | <a-card :bordered='false'> |
| | | <div class='table-page-search-wrapper'> |
| | | <a-form layout='inline' @keyup.enter.native='searchQuery'> |
| | | <a-row :gutter='24'> |
| | | <a-col :md='6' :sm='4'> |
| | | <a-form-item label='å¤ä»¶ç¼ç '> |
| | | <j-input |
| | | placeholder='请è¾å
¥å¤ä»¶ç¼ç ' |
| | | v-model='queryParam.num' |
| | | @pressEnter="handlePressEnter" |
| | | > |
| | | <a-icon slot="prefix" type="barcode" /> |
| | | </j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md='6' :sm='4'> |
| | | <a-form-item label='å¤ä»¶åç§°'> |
| | | <j-input placeholder='请è¾å
¥å¤ä»¶åç§°' v-model='queryParam.name'/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md='3'> |
| | | <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'> |
| | | <a-button type='primary' @click='searchQuery' icon='search'>æ¥è¯¢</a-button> |
| | | <a-button @click='searchReset' icon='reload' style='margin-left: 10px'>éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <a-row :gutter='24'> |
| | | <a-col :md='24' :sm='12'> |
| | | <a-table ref='table' :scroll='{ x: true }' size='middle' rowKey='id' bordered :columns='columns' |
| | | :dataSource='dataSource' :pagination='ipagination' :rowSelection='rowSelection' :loading='loading' |
| | | @change='handleTableChange'> |
| | | <template slot="takingInfo" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;color: #126ee7;">/</span> |
| | | <span v-if="text" style="font-size: 12px;font-style: italic;">{{text}}</span> |
| | | </template> |
| | | </a-table> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-card> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'SparePartsList', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | props: { |
| | | categories:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | queryParam: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'å¤ä»¶ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'num', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'å¤ä»¶åç§°', |
| | | align:"center", |
| | | dataIndex: 'name', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'è§æ ¼', |
| | | align:"center", |
| | | dataIndex: 'specification', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'åå·', |
| | | align:"center", |
| | | dataIndex: 'model', |
| | | width:200 |
| | | }, |
| | | { |
| | | title:'计éåä½', |
| | | align:"center", |
| | | dataIndex: 'mainUnitId_dictText', |
| | | width:200 |
| | | }, |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSelectRows: [], |
| | | scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectSource: [], |
| | | selectionRows: [], |
| | | title: 'éæ©åå·¥é', |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['5', '10', '30', '50', '100'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter: { |
| | | column: 'num', |
| | | order: 'desc' |
| | | }, |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | list: '/eam/equipmentSpares/sparePartlist' |
| | | }, |
| | | numFake: '', |
| | | nameFake: '' |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | const { selectedRowKeys } = this |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: this.onSelectChange, |
| | | getCheckboxProps: record => ({ |
| | | props: { |
| | | disabled: record.distable |
| | | } |
| | | }), |
| | | selectedRowKeys |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | deleteSelectRowkey(key) { |
| | | this.selectedRowKeys = this.selectedRowKeys.filter(item => item != key.id) |
| | | this.selectSource = this.selectSource.filter(item => item != key) |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | if (selectedRowKeys.length === selectedRows.length) { |
| | | this.selectedRows = selectedRows |
| | | } else { |
| | | this.selectedRows = selectedRowKeys.map(key => ( |
| | | this.selectedRows.find(row => row.id === key) || selectedRows.find(row => row.id === key)//å¿
å¨ä¸¤è
ä¹ä¸ |
| | | )) |
| | | } |
| | | this.selectSource = [...this.selectedRows] |
| | | }, |
| | | |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | this.loading = true |
| | | this.queryParam.categories = this.categories; |
| | | let params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | if (this.oldSelectRows.indexOf(res.result.records[i].id) > -1) { |
| | | res.result.records[i].distable = true |
| | | } else { |
| | | res.result.records[i].distable = false |
| | | } |
| | | } |
| | | this.dataSource = res.result.records |
| | | this.$emit('change', this.dataSource); |
| | | console.log(this.dataSource) |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | showModals(oldSelectRows) { |
| | | this.oldSelectRows = oldSelectRows |
| | | this.visible = true |
| | | this.loadData(1) |
| | | }, |
| | | getQueryParams() { |
| | | let param = Object.assign({}, this.queryParam, this.isorter) |
| | | param.field = this.getQueryField() |
| | | param.pageNo = this.ipagination.current |
| | | param.pageSize = this.ipagination.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | //æ¥è¯¢æ¡ä»¶å¤ç |
| | | getQueryField() { |
| | | let str = 'id,' |
| | | for (let a = 0; a < this.columns.length; a++) { |
| | | str += ',' + this.columns[a].dataIndex |
| | | } |
| | | return str |
| | | }, |
| | | searchReset(num) { |
| | | this.queryParam = [] |
| | | this.numFake = '' |
| | | this.nameFake = '' |
| | | if (num !== 0) { |
| | | this.loadData(1) |
| | | } |
| | | this.selectborrowIds = [] |
| | | }, |
| | | close() { |
| | | this.searchReset(0) |
| | | this.selectedRowKeys = [] |
| | | this.selectSource = [] |
| | | this.visible = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //TODO çé |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$emit('selectionRows', this.selectSource) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | |
| | | searchQuery() { |
| | | this.loadData(1) |
| | | }, |
| | | handlePressEnter(event) { |
| | | that.queryParam.toolingNum = '' |
| | | const that = this |
| | | let invCode = event.target.value.trim() |
| | | if (invCode.length == 0 || invCode == '' || invCode == null || invCode == undefined) { |
| | | that.$message.warning('åè´§ç¼ç ä¸è½ä¸ºç©º'); |
| | | } |
| | | else{ |
| | | this.searchReset() |
| | | that.queryParam.toolingNum = invCode |
| | | } |
| | | }, |
| | | handlePressEnterCode(event) { |
| | | that.queryParam.toolingCode = '' |
| | | const that = this |
| | | let toolingCode = event.target.value.trim() |
| | | if (toolingCode == 0 || toolingCode == '' || toolingCode == null || toolingCode == undefined) { |
| | | that.$message.warning('éå
·æ¡ç ä¸è½ä¸ºç©º'); |
| | | } |
| | | else{ |
| | | that.queryParam.toolingCode = toolingCode |
| | | } |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | #components-layout-demo-custom-trigger .trigger { |
| | | font-size: 18px; |
| | | line-height: 64px; |
| | | padding: 0 24px; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | </style> |