¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="åå
·ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥åå
·ç¼å·" v-model="queryParam.cutterCode" allow-clear/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="åå
·åç§°"> |
| | | <a-input placeholder="请è¾å
¥åå
·åç§°" v-model="queryParam.cutterName" allow-clear/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="handleAdd" icon="plus" v-has="'cutter_add'">æ°å¢</a-button> |
| | | <a-button type="primary" @click="handleSend()" icon="export">åéåå
·ç³»ç»</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :size="size" rowKey="id" |
| | | @change="handleTableChange" :scroll="{y:189}"> |
| | | <template slot="action" slot-scope="text, record"> |
| | | |
| | | <a @click="handleChoose(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 href="javascript:;" @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> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <CutterModal ref="cutterModalRef" :currentTreeNodeInfo="currentLevelInfo" @submitSuccess="loadData"/> |
| | | |
| | | <DncToolsSelectModal ref="dncToolsSelectModal" @submitSuccess="loadData"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CutterModal from '@views/dnc/base/modules/ProductStructure/Cutter/CutterModal.vue' |
| | | import DncToolsSelectModal from '@views/tms/modules/baseTools/DncToolsSelectModal.vue' |
| | | import { getAction, httpAction } from '@api/manage' |
| | | import dncApi from '@api/dnc' |
| | | |
| | | export default { |
| | | name: 'CutterTableList', |
| | | components: { DncToolsSelectModal, CutterModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentLevelInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: 'åå
·ç¼å·', dataIndex: 'cutterCode', width: 200, align: 'center' }, |
| | | { title: 'åå
·åç§°', dataIndex: 'cutterName', width: 100, align: 'center' }, |
| | | { title: 'åå
·ç®ç§°', dataIndex: 'cutterType', width: 80, align: 'center' }, |
| | | { title: 'åå
·è§æ ¼', dataIndex: 'cutterSpec', align: 'center' }, |
| | | { title: 'é¢å®å¯¿å½', dataIndex: 'lifetime', width: 150, align: 'center' }, |
| | | { title: 'åä½', dataIndex: 'cutterSpacing', width: 50, align: 'center' }, |
| | | { title: 'åå
·æ°é', dataIndex: 'quantity', width: 80, align: 'center' }, |
| | | { title: 'æè¿°', dataIndex: 'description', width: 200, align: 'center' }, |
| | | { title: 'æä½', dataIndex: 'action', scopedSlots: { customRender: 'action' }, align: 'center', width: 150 } |
| | | ], |
| | | url: { |
| | | list: '/nc/cutter/getByBusinessId', |
| | | delete: '/nc/cutter/delete', |
| | | exportXlsUrl: '/nc/cutter/exportXls', |
| | | importExcelUrl: '/nc/cutter/importExcel', |
| | | sendCutterUrl: '/nc/cutter/sendCutterUrl', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | setQueryParamAndLoadData(pageNo = 1) { |
| | | if (this.currentLevelInfo.classificationId_dictText==='nc'){ |
| | | const {docId,attributionType,attributionId} = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, { docId:docId,attributionType:attributionType,attributionId:attributionId }) |
| | | } |
| | | if (this.currentLevelInfo.deviceManagementId !== null && this.currentLevelInfo.deviceManagementId !== undefined){ |
| | | const {attributionType,id} = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, {attributionType:attributionType,attributionId:id }) |
| | | } |
| | | if (this.currentLevelInfo.id !== null && this.currentLevelInfo.type !== null && this.currentLevelInfo.type !== undefined && this.currentLevelInfo.id !== undefined){ |
| | | const { id, type } = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | } |
| | | this.loadData(pageNo) |
| | | }, |
| | | searchQuery(pageNo = 1) { |
| | | if (this.currentLevelInfo.classificationId_dictText==='nc'){ |
| | | const {docId,attributionType,attributionId} = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, { docId:docId,attributionType:attributionType,attributionId:attributionId }) |
| | | } |
| | | if (this.currentLevelInfo.deviceManagementId !== null && this.currentLevelInfo.deviceManagementId !== undefined){ |
| | | const {attributionType,id} = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, {attributionType:attributionType,attributionId:id }) |
| | | } |
| | | if (this.currentLevelInfo.id !== null && this.currentLevelInfo.type !== null && this.currentLevelInfo.type !== undefined && this.currentLevelInfo.id !== undefined){ |
| | | const { id, type } = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | } |
| | | this.loadData(pageNo) |
| | | }, |
| | | |
| | | handleAdd() { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'æ·»å åå
·' |
| | | this.$refs.cutterModalRef.disableSubmit = false |
| | | this.$refs.cutterModalRef.handleCutterAdd() |
| | | }, |
| | | |
| | | /** |
| | | * ç¼è¾è¡¨æ ¼è¡ä¿¡æ¯ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleEdit(record) { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'ç¼è¾åå
·ä¿¡æ¯' |
| | | this.$refs.cutterModalRef.disableSubmit = false |
| | | this.$refs.cutterModalRef.handleCutterEdit(record) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥çè¡¨æ ¼å®æ´è¡ä¿¡æ¯ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleDetail: function(record) { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'åå
·è¯¦æ
' |
| | | this.$refs.cutterModalRef.disableSubmit = true |
| | | this.$refs.cutterModalRef.handleCutterEdit(record) |
| | | }, |
| | | /** |
| | | * éæ©åå
· |
| | | */ |
| | | handleChoose(record){ |
| | | if (record.cutterName.match(/\d+(\.\d+)?/g) !== null) { |
| | | record.cutterName = record.cutterName.match(/\d+(\.\d+)?/g)[0] |
| | | } |
| | | const param = { |
| | | aliasLabel: record.cutterType, |
| | | diameter: record.cutterName, |
| | | cutterId: record.id |
| | | } |
| | | this.$refs.dncToolsSelectModal.open(param) |
| | | this.$refs.dncToolsSelectModal.title = 'éæ©åå
·' |
| | | }, |
| | | /** |
| | | * åéåå
·ç³»ç» |
| | | */ |
| | | handleSend(){ |
| | | const that = this |
| | | const { docId,attributionId, attributionType } = this.currentLevelInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认åéåå
·ç³»ç»åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.sendToolsApi({ docId, attributionId, attributionType }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |