Merge remote-tracking branch 'origin/master'
# Conflicts:
# src/views/tms/modules/outBound/OutboundOrderModal.vue
| | |
| | | import HasSentDocumentTableList from './Document/HasSentDocumentTableList' |
| | | import HasReceivedDocumentTableList from './Document/HasReceivedDocumentTableList' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import { postAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'DeviceStructureMainTop', |
| | |
| | | tableContainerSize: 'small', |
| | | currentTypeOfDevice: 7,// 产åç»ææ ä¸å®ä¹ç设å¤å±çº§type为7 |
| | | currentRightClickedTableRowInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | | hasLoadedDataTabKeyArray: [], |
| | | url:{ |
| | | submitProccess:'/dncFlow/dispatchFile/submitProccess' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleAppoint(){ |
| | | const that = this |
| | | const { docId, param, attributionId,attributionType,publishFileId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认å®ååï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | let dispatchFile = { |
| | | 'docId':docId, |
| | | 'attributionId':attributionId, |
| | | 'attributionType':attributionType, |
| | | 'fileId':publishFileId |
| | | } |
| | | postAction(this.url.submitProccess,dispatchFile) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$message.success('æµç¨åèµ·æå') |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | |
| | | deviceCustomTypeList: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | sm: { span: 7 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import { deleteAction } from '@api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DeviceCustomTypeModal |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import { getAction, deleteAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeTableList', |
| | | components: { DeviceCustomTypeModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | // { |
| | | // title: '车é´', |
| | | // dataIndex: 'productionId_dictText', |
| | | // align: 'center' |
| | | // }, |
| | | { |
| | | title: 'è½´æ°', |
| | | dataIndex: 'deviceManagementCode_dictText', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ°æ§ç³»ç»ç±»å«', |
| | | dataIndex: 'deviceManagementId_dictText', |
| | | align: 'center' |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedTypeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | url: { |
| | | list: '/nc/deviceType/getByBusinessId', |
| | | delete: '/nc/deviceType/delete' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | currentTreeNodeInfo: { |
| | | handler(value) { |
| | | this.currentClickedTypeInfo = {} |
| | | export default { |
| | | name: 'DeviceCustomTypeTableList', |
| | | components: { DeviceCustomTypeModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.$bus.$on('deviceCustomTypeAddSubmitSuccess', this.loadData) |
| | | }, |
| | | methods: { |
| | | setQueryParamAndLoadData() { |
| | | console.log('currentLevelInfo', this.currentTreeNodeInfo) |
| | | const { id, type } = this.currentTreeNodeInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | this.dataSource = [] |
| | | this.loadData() |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | |
| | | customRow(record) { |
| | | data() { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedTypeInfo.id === record.id ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedTypeInfo = Object.assign({ param: 'deviceCustomType' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedTypeInfo) |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | // { |
| | | // title: '车é´', |
| | | // dataIndex: 'productionId_dictText', |
| | | // align: 'center' |
| | | // }, |
| | | { |
| | | title: 'è½´æ°', |
| | | dataIndex: 'deviceManagementCode_dictText', |
| | | align: 'center' |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedTypeInfo.id === record.id) return |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.$bus.$emit('sendCurrentClickedTypeInfo', record) |
| | | { |
| | | title: 'æ°æ§ç³»ç»ç±»å«', |
| | | dataIndex: 'deviceManagementId_dictText', |
| | | align: 'center' |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedTypeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | url: { |
| | | list: '/nc/deviceType/getByBusinessId', |
| | | delete: '/nc/deviceType/delete' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | /** |
| | | * å é¤å·¥åºæå·¥æ¥å±çº§æ·»å ç设å¤ç±» |
| | | * @param tableRowInfo |
| | | */ |
| | | handleTypeDelete(tableRowInfo) { |
| | | const { id } = tableRowInfo |
| | | const { $confirm, url, loadData, $notification, $destroyAll } = this |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | |
| | | deleteAction(url.delete, { id: id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | loadData() |
| | | } else { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | $destroyAll() |
| | | }) |
| | | watch: { |
| | | currentTreeNodeInfo: { |
| | | handler(value) { |
| | | this.currentClickedTypeInfo = {} |
| | | }, |
| | | onCancel: () => { |
| | | $destroyAll() |
| | | } |
| | | }) |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.$bus.$on('deviceCustomTypeAddSubmitSuccess', this.loadData) |
| | | }, |
| | | methods: { |
| | | setQueryParamAndLoadData() { |
| | | const { id, type } = this.currentTreeNodeInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | this.dataSource = [] |
| | | this.loadData() |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'deviceCustomType') this[methodName](tableRowInfo, modalTitle) |
| | | loadData() { |
| | | const params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | getAction(this.url.list, params) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records || res.result |
| | | const { autoClickedLevelInfo } = this.currentTreeNodeInfo |
| | | if (autoClickedLevelInfo) { |
| | | const tableRowRecord = this.dataSource.find(item => item.id === autoClickedLevelInfo.attributionId) |
| | | this.handleTableRowClick(tableRowRecord) |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * èªå®ä¹è¡¨æ ¼è¡åè½ |
| | | * @param record è¡¨æ ¼è¡è®°å½ |
| | | */ |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedTypeInfo.id === record.id ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedTypeInfo = Object.assign({ param: 'deviceCustomType' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedTypeInfo) |
| | | }, |
| | | click: () => { |
| | | this.handleTableRowClick(record) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼è¡ç¹å»äºä»¶ |
| | | * @param record è¡¨æ ¼è¡è®°å½ |
| | | */ |
| | | handleTableRowClick(record) { |
| | | if (this.currentClickedTypeInfo.id === record.id) return |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.$bus.$emit('sendCurrentClickedTypeInfo', record) |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | /** |
| | | * å é¤å·¥åºæå·¥æ¥å±çº§æ·»å ç设å¤ç±» |
| | | * @param tableRowInfo |
| | | */ |
| | | handleTypeDelete(tableRowInfo) { |
| | | const { id } = tableRowInfo |
| | | const { $confirm, url, loadData, $notification, $destroyAll } = this |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | |
| | | deleteAction(url.delete, { id: id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | loadData() |
| | | } else { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | $destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | $destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'deviceCustomType') this[methodName](tableRowInfo, modalTitle) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="11" :sm="11"> |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="ä¸ä¼ æ¶é´"> |
| | | <a-range-picker v-model="date" value-format="YYYY-MM-DD" |
| | | @change="handleDateChange" allow-clear></a-range-picker> |
| | |
| | | |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys,selectedRows:selectionRows, onChange: onSelectChange}" |
| | | @change="handleTableChange" |
| | | @change="handleTableChange" :customRow="customRow" |
| | | :scroll="{y:456}" :size="size" rowKey="docId"> |
| | | |
| | | <!-- å符串è¶
é¿æªåçç¥å·æ¾ç¤º--> |
| | |
| | | </a-tabs> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction } from '@/api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'NcDocumentSearchNcModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentDocumentInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | visible: false, |
| | | title: '', |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'èç¹åç§°', |
| | | dataIndex: 'nodeName', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'èç¹ä»£å·', |
| | | dataIndex: 'nodeCode', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'æ°æ§ç³»ç»ç±»å«', |
| | | dataIndex: 'deviceName', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'è½´æ°', |
| | | dataIndex: 'deviceCode', |
| | | align: 'center', |
| | | width: 50, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'docName' }, |
| | | width: 240, |
| | | sorter: true |
| | | }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | width: 80, |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docDispatchStatus_dictText', |
| | | key: 'docDispatchStatus', |
| | | align: 'center', |
| | | width: 60, |
| | | filters: [ |
| | | { text: 'ç¼å¶', value: 1 }, |
| | | { text: 'æ ¡å¯¹', value: 2 }, |
| | | { text: 'æ¹å', value: 3 }, |
| | | { text: 'è¯å', value: 4 }, |
| | | { text: 'å®å', value: 5 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 150, |
| | | sorter: true |
| | | } |
| | | ], |
| | | searchValue: '', |
| | | searchInput: '', |
| | | spinning: false, |
| | | treeDataSource: [], |
| | | allTreeKeys: [], |
| | | checkedKeys: [], |
| | | expandedKeys: [], |
| | | autoExpandParent: true, |
| | | isExpandAllTreeNode: true, |
| | | date: [], |
| | | url: { |
| | | list: '/nc/product/query/nc' |
| | | export default { |
| | | name: 'NcDocumentSearchNcModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentDocumentInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.resetData() |
| | | this.loadData() |
| | | this.getDocumentAssignDeviceTreeByApi() |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | visible: false, |
| | | title: '', |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'èç¹åç§°', |
| | | dataIndex: 'nodeName', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'èç¹ä»£å·', |
| | | dataIndex: 'nodeCode', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'æ°æ§ç³»ç»ç±»å«', |
| | | dataIndex: 'deviceName', |
| | | align: 'center', |
| | | width: 80, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'è½´æ°', |
| | | dataIndex: 'deviceCode', |
| | | align: 'center', |
| | | width: 50, |
| | | sorter: false |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'docName' }, |
| | | width: 240, |
| | | sorter: true |
| | | }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | width: 80, |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docDispatchStatus_dictText', |
| | | key: 'docDispatchStatus', |
| | | align: 'center', |
| | | width: 60, |
| | | filters: [ |
| | | { text: 'ç¼å¶', value: 1 }, |
| | | { text: 'æ ¡å¯¹', value: 2 }, |
| | | { text: 'æ¹å', value: 3 }, |
| | | { text: 'è¯å', value: 4 }, |
| | | { text: 'å®å', value: 5 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 150, |
| | | sorter: true |
| | | } |
| | | ], |
| | | searchValue: '', |
| | | searchInput: '', |
| | | spinning: false, |
| | | fullScreenSpinning: false, |
| | | treeDataSource: [], |
| | | allTreeKeys: [], |
| | | checkedKeys: [], |
| | | expandedKeys: [], |
| | | autoExpandParent: true, |
| | | isExpandAllTreeNode: true, |
| | | date: [], |
| | | url: { |
| | | list: '/nc/product/query/nc' |
| | | } |
| | | } |
| | | }, |
| | | isExpandAllTreeNode: { |
| | | handler(value) { |
| | | if (value) this.expandedKeys = this.allTreeKeys |
| | | else this.expandedKeys = [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleSearchNc() { |
| | | this.visible = true |
| | | }, |
| | | // è·åå½åå¯¹åºææ¡£å表 |
| | | loadData() { |
| | | this.dataSource = [] |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) return false |
| | | params.attributionType = this.currentDocumentInfo.type |
| | | params.attributionId = this.currentDocumentInfo.key |
| | | this.loading = true |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) this.dataSource = res.result |
| | | else this.$message.warning(res.message) |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | // è·åDNCè®¾å¤æ |
| | | getDocumentAssignDeviceTreeByApi() { |
| | | this.spinning = true |
| | | this.treeDataSource = [] |
| | | dncApi.getDeviceTreeDataApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | this.expandedKeys = this.allTreeKeys |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.resetData() |
| | | this.loadData() |
| | | this.getDocumentAssignDeviceTreeByApi() |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | // æ¶é´éæ©å¨éæ©å®æå触å |
| | | handleDateChange(value) { |
| | | this.queryParam.startTime = value[0] |
| | | this.queryParam.endTime = value[1] |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | }, |
| | | isExpandAllTreeNode: { |
| | | handler(value) { |
| | | if (value) this.expandedKeys = this.allTreeKeys |
| | | else this.expandedKeys = [] |
| | | } |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.loadData() |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleSearchNc() { |
| | | this.visible = true |
| | | }, |
| | | |
| | | // ææ´¾å°è®¾å¤çªå£ç¹å»ç¡®å®ææ´¾è®¾å¤å触å |
| | | handleAssignDocumentToDevice() { |
| | | const { |
| | | checkedKeys, |
| | | selectedRowKeys, |
| | | selectionRows, |
| | | dataList, |
| | | $confirm, |
| | | $notification, |
| | | currentDocumentInfo, |
| | | queryParam: { applyReason }, |
| | | $destroyAll, |
| | | $bus |
| | | } = this |
| | | const { attributionId, attributionType } = currentDocumentInfo |
| | | const paramsArray = [] |
| | | // è¿æ»¤è½¦é´keyä»
æ¾å
¥è®¾å¤key |
| | | const treeCheckedDeviceKeys = [] |
| | | checkedKeys.forEach(checkedKey => { |
| | | const device = dataList.find(item => item.key === checkedKey && item.type === 2) |
| | | if (device) treeCheckedDeviceKeys.push(device.key) |
| | | }) |
| | | |
| | | if (treeCheckedDeviceKeys.length === 0 || selectedRowKeys.length === 0) { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©è®¾å¤æææ¡£' |
| | | // è·åå½åå¯¹åºææ¡£å表 |
| | | loadData() { |
| | | this.dataSource = [] |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) return false |
| | | params.attributionType = this.currentDocumentInfo.type |
| | | params.attributionId = this.currentDocumentInfo.key |
| | | this.loading = true |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) this.dataSource = res.result |
| | | else this.$message.warning(res.message) |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | return |
| | | } |
| | | }, |
| | | |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认æäº¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | // åé循ç¯ç¡®å®æ¯ä¸ç»è®¾å¤ä¸ææ¡£çåæ° |
| | | treeCheckedDeviceKeys.forEach(deviceId => { |
| | | selectionRows.forEach(({ docId, publishFileId ,attributionId,attributionType}) => { |
| | | paramsArray.push({ |
| | | docId, |
| | | deviceId, |
| | | fileId: publishFileId, |
| | | attributionId, |
| | | attributionType, |
| | | applyReason |
| | | }) |
| | | }) |
| | | /** |
| | | * å表èªå®ä¹è¡ |
| | | * @param record å表è¡è®°å½ |
| | | */ |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | cursor: 'pointer' |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | let selectedRowKeys = [...this.selectedRowKeys] |
| | | let selectionRows = [...this.selectionRows] |
| | | if (selectedRowKeys.includes(record.docId)) { |
| | | selectedRowKeys = selectedRowKeys.filter(item => item !== record.docId) |
| | | selectionRows = selectionRows.filter(item => item.docId !== record.docId) |
| | | } else { |
| | | selectedRowKeys.push(record.docId) |
| | | selectionRows.push(record) |
| | | } |
| | | this.onSelectChange(selectedRowKeys, selectionRows) |
| | | }, |
| | | dblclick: () => { |
| | | this.$emit('searchTreeNode', record) |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // è·åDNCè®¾å¤æ |
| | | getDocumentAssignDeviceTreeByApi() { |
| | | this.spinning = true |
| | | this.treeDataSource = [] |
| | | dncApi.getDeviceTreeDataApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | this.expandedKeys = this.allTreeKeys |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | paramsArray.forEach(item => { |
| | | dncApi.assignDocumentToDeviceApi(item) |
| | | .then(res => { |
| | | if (res.success) { |
| | | $bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment') |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | // æ¶é´éæ©å¨éæ©å®æå触å |
| | | handleDateChange(value) { |
| | | this.queryParam.startTime = value[0] |
| | | this.queryParam.endTime = value[1] |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.loadData() |
| | | }, |
| | | |
| | | // ææ´¾å°è®¾å¤çªå£ç¹å»ç¡®å®ææ´¾è®¾å¤å触å |
| | | handleAssignDocumentToDevice() { |
| | | const { |
| | | checkedKeys, |
| | | selectedRowKeys, |
| | | selectionRows, |
| | | dataList, |
| | | $confirm, |
| | | $notification, |
| | | currentDocumentInfo, |
| | | queryParam: { applyReason }, |
| | | $destroyAll, |
| | | $bus |
| | | } = this |
| | | const { attributionId, attributionType } = currentDocumentInfo |
| | | const paramsArray = [] |
| | | // è¿æ»¤è½¦é´keyä»
æ¾å
¥è®¾å¤key |
| | | const treeCheckedDeviceKeys = [] |
| | | checkedKeys.forEach(checkedKey => { |
| | | const device = dataList.find(item => item.key === checkedKey && item.type === 2) |
| | | if (device) treeCheckedDeviceKeys.push(device.key) |
| | | }) |
| | | |
| | | if (treeCheckedDeviceKeys.length === 0 || selectedRowKeys.length === 0) { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©è®¾å¤æææ¡£' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认æäº¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | // åé循ç¯ç¡®å®æ¯ä¸ç»è®¾å¤ä¸ææ¡£çåæ° |
| | | treeCheckedDeviceKeys.forEach(deviceId => { |
| | | selectionRows.forEach(({ docId, publishFileId, attributionId, attributionType }) => { |
| | | paramsArray.push({ |
| | | docId, |
| | | deviceId, |
| | | fileId: publishFileId, |
| | | attributionId, |
| | | attributionType, |
| | | applyReason |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | $destroyAll() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | $destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | |
| | | /* è¾å
¥æ¥è¯¢å
容ååæ¶è§¦å */ |
| | | handleSearchInputChange() { |
| | | let search = this.searchInput |
| | | console.log('data', this.dataList) |
| | | console.log('search', search) |
| | | let expandedKeys = this.dataList |
| | | .map(item => { |
| | | if (item.title != null) { |
| | | if (item.title.indexOf(search) > -1) { |
| | | return this.getParentKey(item.key, this.treeDataSource) |
| | | } |
| | | return null |
| | | paramsArray.forEach(item => { |
| | | dncApi.assignDocumentToDeviceApi(item) |
| | | .then(res => { |
| | | if (res.success) { |
| | | $bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment') |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | $destroyAll() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | $destroyAll() |
| | | } |
| | | }) |
| | | .filter((item, i, self) => item && self.indexOf(item) === i) |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | | autoExpandParent: true |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |
| | | handleTreeNodeExpand(expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | /* è¾å
¥æ¥è¯¢å
容ååæ¶è§¦å */ |
| | | handleSearchInputChange() { |
| | | let search = this.searchInput |
| | | console.log('data', this.dataList) |
| | | console.log('search', search) |
| | | let expandedKeys = this.dataList |
| | | .map(item => { |
| | | if (item.title != null) { |
| | | if (item.title.indexOf(search) > -1) { |
| | | return this.getParentKey(item.key, this.treeDataSource) |
| | | } |
| | | return null |
| | | } |
| | | }) |
| | | .filter((item, i, self) => item && self.indexOf(item) === i) |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | | autoExpandParent: true |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å¤éæ¡é䏿¶è§¦å |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeNodeCheck(checkedKeys, { node }) { |
| | | let record = node.dataRef |
| | | this.checkedKeys = checkedKeys |
| | | }, |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |
| | | handleTreeNodeExpand(expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹é䏿¶è§¦åï¼æ¨¡ææ èç¹å¤éæ¡é䏿¶çææï¼ |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeNodeSelect(selectedKeys, { node }) { |
| | | node.$el.childNodes[1].click() |
| | | }, |
| | | /** |
| | | * æ èç¹å¤éæ¡é䏿¶è§¦å |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeNodeCheck(checkedKeys, { node }) { |
| | | let record = node.dataRef |
| | | this.checkedKeys = checkedKeys |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çç¶çº§key |
| | | * @param key å项key |
| | | * @param tree å项 |
| | | */ |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === key)) { |
| | | parentKey = node.key |
| | | console.log('parentKey', parentKey) |
| | | } else if ( |
| | | this.getParentKey(key, node.children)) { |
| | | parentKey = this.getParentKey(key, node.children) |
| | | /** |
| | | * æ èç¹é䏿¶è§¦åï¼æ¨¡ææ èç¹å¤éæ¡é䏿¶çææï¼ |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeNodeSelect(selectedKeys, { node }) { |
| | | node.$el.childNodes[1].click() |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çç¶çº§key |
| | | * @param key å项key |
| | | * @param tree å项 |
| | | */ |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === key)) { |
| | | parentKey = node.key |
| | | console.log('parentKey', parentKey) |
| | | } else if ( |
| | | this.getParentKey(key, node.children)) { |
| | | parentKey = this.getParentKey(key, node.children) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return parentKey |
| | | }, |
| | | return parentKey |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data è®¾å¤æ æ°æ® |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | | const key = node.key |
| | | const title = node.title |
| | | const type = node.type |
| | | this.dataList.push({ key, title, type }) |
| | | this.allTreeKeys.push(key) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data è®¾å¤æ æ°æ® |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | | const key = node.key |
| | | const title = node.title |
| | | const type = node.type |
| | | this.dataList.push({ key, title, type }) |
| | | this.allTreeKeys.push(key) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | resetData() { |
| | | this.searchInput = '' |
| | | this.expandedKeys = [] |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = {} |
| | | this.checkedKeys = [] |
| | | this.filters = {} |
| | | this.isorter = Object.assign({}, this.defaultSorter) |
| | | }, |
| | | resetData() { |
| | | this.searchInput = '' |
| | | this.expandedKeys = [] |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.checkedKeys = [] |
| | | this.filters = {} |
| | | this.isorter = Object.assign({}, this.defaultSorter) |
| | | }, |
| | | |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-modal { |
| | | .tabs-container { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | /deep/ .ant-modal { |
| | | .tabs-container { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ::-webkit-scrollbar { |
| | | width: 8px; |
| | | } |
| | | ::-webkit-scrollbar { |
| | | width: 8px; |
| | | } |
| | | </style> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from '../../../../common/DocumentModal' |
| | | import NcDocumentAssignModal from './NcDocumentAssignModal' |
| | | import dncApi from '@api/dnc' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from '../../../../common/DocumentModal' |
| | | import NcDocumentAssignModal from './NcDocumentAssignModal' |
| | | import dncApi from '@api/dnc' |
| | | |
| | | export default { |
| | | name: 'NcDocumentTableList', |
| | | components: { NcDocumentAssignModal, DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentNCDocumentAttributionInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | scopedSlots: {customRender: 'docName'}, |
| | | width: 500, |
| | | sorter: true |
| | | }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ], |
| | | width: 100 |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | dataIndex: 'docDispatchStatus_dictText', |
| | | key: 'docDispatchStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'ç¼å¶', value: 1 }, |
| | | { text: 'æ ¡å¯¹', value: 2 }, |
| | | { text: 'æ¹å', value: 3 }, |
| | | { text: 'è¯å', value: 4 }, |
| | | { text: 'å®å', value: 5 } |
| | | ], |
| | | width: 70 |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 120 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 150, |
| | | sorter: true |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedDocumentInfo: {}, |
| | | currentClickedDocumentInfo: {}, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | currentNCDocumentAttributionInfo: { |
| | | handler(value) { |
| | | this.currentClickedDocumentInfo = this.currentRightClickedDocumentInfo = {} |
| | | export default { |
| | | name: 'NcDocumentTableList', |
| | | components: { NcDocumentAssignModal, DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentNCDocumentAttributionInfo: { |
| | | type: Object |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | size: { |
| | | type: String |
| | | } |
| | | console.log('currentNCDocumentAttributionInfo', this.currentNCDocumentAttributionInfo) |
| | | const { attributionId, attributionType, docClassCode } = this.currentNCDocumentAttributionInfo |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = attributionId |
| | | params.attributionType = attributionType |
| | | params.docClassCode = docClassCode |
| | | if (!params) return false |
| | | this.dataSource = [] |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | customRow(record) { |
| | | data() { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo) |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedDocumentInfo.docId === record.docId) return |
| | | this.currentClickedDocumentInfo = Object.assign({}, record) |
| | | this.$bus.$emit('sendCurrentClickedDocumentInfo', record) |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'docName' }, |
| | | width: 500, |
| | | sorter: true |
| | | }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ], |
| | | width: 100 |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | dataIndex: 'docDispatchStatus_dictText', |
| | | key: 'docDispatchStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'ç¼å¶', value: 1 }, |
| | | { text: 'æ ¡å¯¹', value: 2 }, |
| | | { text: 'æ¹å', value: 3 }, |
| | | { text: 'è¯å', value: 4 }, |
| | | { text: 'å®å', value: 5 } |
| | | ], |
| | | width: 70 |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 120 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 150, |
| | | sorter: true |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedDocumentInfo: {}, |
| | | currentClickedDocumentInfo: {}, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | watch: { |
| | | currentNCDocumentAttributionInfo: { |
| | | handler(value) { |
| | | this.currentClickedDocumentInfo = this.currentRightClickedDocumentInfo = {} |
| | | }, |
| | | immediate: true |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | handleDocumentEdit(record, modalTitle) { |
| | | if (!this.$refs.modalForm) return |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = modalTitle |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | const { attributionId, attributionType, docClassCode, autoClickedLevelInfo } = this.currentNCDocumentAttributionInfo |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = attributionId |
| | | params.attributionType = attributionType |
| | | params.docClassCode = docClassCode |
| | | if (!params) return false |
| | | this.dataSource = [] |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (autoClickedLevelInfo) { |
| | | const tableRowRecord = this.dataSource.find(item => item.docId === autoClickedLevelInfo.docId) |
| | | this.handleTableRowClick(tableRowRecord) |
| | | this.$bus.$emit('searchNcFinished') |
| | | } |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | handleDocumentAssign(record, modalTitle) { |
| | | if (!this.$refs.documentAssignModalRef) return |
| | | this.$refs.documentAssignModalRef.title = modalTitle |
| | | this.$refs.documentAssignModalRef.visible = true |
| | | }, |
| | | /** |
| | | * èªå®ä¹è¡¨æ ¼è¡åè½ |
| | | * @param record è¡¨æ ¼è¡è®°å½ |
| | | */ |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo) |
| | | }, |
| | | click: () => { |
| | | this.handleTableRowClick(record) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleDocumentExtract(record){ |
| | | const that = this |
| | | const { docId,attributionId, attributionType } = record |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认æååå
·åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.extractToolsApi({ docId, attributionId, attributionType }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `æåæå` |
| | | }) |
| | | } else { |
| | | /** |
| | | * è¡¨æ ¼è¡ç¹å»äºä»¶ |
| | | * @param record è¡¨æ ¼è¡è®°å½ |
| | | */ |
| | | handleTableRowClick(record) { |
| | | if (this.currentClickedDocumentInfo.docId === record.docId) return |
| | | this.currentClickedDocumentInfo = Object.assign({}, record) |
| | | this.$bus.$emit('sendCurrentClickedDocumentInfo', record) |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | handleDocumentEdit(record, modalTitle) { |
| | | if (!this.$refs.modalForm) return |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = modalTitle |
| | | }, |
| | | |
| | | handleDocumentAssign(record, modalTitle) { |
| | | if (!this.$refs.documentAssignModalRef) return |
| | | this.$refs.documentAssignModalRef.title = modalTitle |
| | | this.$refs.documentAssignModalRef.visible = true |
| | | }, |
| | | |
| | | handleDocumentExtract(record) { |
| | | const that = this |
| | | const { docId, attributionId, attributionType } = record |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认æååå
·åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.extractToolsApi({ docId, attributionId, attributionType }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `æåæå` |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle) |
| | | triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import DeviceCustomTypeTableList |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue' |
| | | import { getAction } from '@api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import DeviceCustomTypeTableList |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue' |
| | | import { getAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { |
| | | DeviceCustomTypeTableList, |
| | | DocumentBatchDeleteModal, |
| | | TableContextMenu, |
| | | OtherDocumentTableList, |
| | | NcDocumentTableList |
| | | }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | isProcessHasDeviceTypeList: false, |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | currentNCDocumentAttributionInfo: {},//å½åNCææ¡£çæå±çº§å³ç¶çº§ç详ç»ä¿¡æ¯ï¼å¼å
¥è®¾å¤ç±»åNCæè½½è³è®¾å¤ç±»ä¸åä¹åæè½½å¨å·¥åºåå·¥æ¥ä¸ï¼ |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList') |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$off('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·å设å¤ç±»åå表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getDeviceTypeListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | } |
| | | }) |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { |
| | | DeviceCustomTypeTableList, |
| | | DocumentBatchDeleteModal, |
| | | TableContextMenu, |
| | | OtherDocumentTableList, |
| | | NcDocumentTableList |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | console.log('treeNodeInfo', treeNodeInfo) |
| | | const { id, type } = treeNodeInfo |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶å¹¶éç½®æ°æ® |
| | | this.currentClickedTypeInfo = this.currentRightClickedTableRowInfo = {} |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType: type, |
| | | docClassCode: 'NC' |
| | | }) |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | |
| | | if (+type === 5 || +type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.deviceCustomTypeTableList) { |
| | | this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() |
| | | // 忢æ ä¹åæ¸
空NCç¨åºå表 |
| | | if (this.$refs.ncDocumentTableListRef && this.$refs.ncDocumentTableListRef.dataSource.length > 0) this.$refs.ncDocumentTableListRef.dataSource = [] |
| | | } else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥åå½åç¹å»ç设å¤ç±»ä¿¡æ¯ |
| | | * @param record å½åç¹å»ç设å¤ç±»è¡ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentClickedTypeInfo(record) { |
| | | const { id, attributionType } = record |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType, |
| | | docClassCode: 'NC' |
| | | }) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | isProcessHasDeviceTypeList: false, |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | currentNCDocumentAttributionInfo: {},//å½åNCææ¡£çæå±çº§å³ç¶çº§ç详ç»ä¿¡æ¯ï¼å¼å
¥è®¾å¤ç±»åNCæè½½è³è®¾å¤ç±»ä¸åä¹åæè½½å¨å·¥åºåå·¥æ¥ä¸ï¼ |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList') |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$off('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·å设å¤ç±»åå表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getDeviceTypeListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åº/åæ¶åºåº/åå¸/彿¡£æåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionType ææ¡£ç¶çº§typeç±»å |
| | | * @param attributionId ææ¡£ç¶çº§Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionType, attributionId }) { |
| | | console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId) |
| | | // 卿¤å¤è®¾å¤NCææ¡£ç¶çº§åæ°æ¯å¯æ¤æ¹æ³æ¯ç»ææ 以å设å¤ç±»ä¸¤ç§ä¸å导å
¥æ¹å¼çå
±ååºå£ |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType }) |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | const { id, type, autoClickedLevelInfo } = treeNodeInfo |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶å¹¶éç½®æ°æ® |
| | | this.currentClickedTypeInfo = this.currentRightClickedTableRowInfo = {} |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType: type, |
| | | docClassCode: 'NC', |
| | | autoClickedLevelInfo |
| | | }) |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | |
| | | // 夿å½åå³ä¾§å±ç¤ºçææ¡£çæå±æ¯å¦æ¯å½åå·¦é®é䏿 èç¹æè®¾å¤ç±»ï¼è¥ä¸æ¯å½åå·¦é®éä¸çåå¨å¯¼å
¥åä¸å·æ°å³ä¾§çææ¡£å表(é¿å
æ æå·æ°) |
| | | // 夿æ¯å¦æ¯å¨ææ¡£å表ä¸è¿è¡åºåº/å
¥åº/åå¸/彿¡£çæä½,è¥æ¯å¨ææ¡£åè¡¨ä¸æä½åæä½æååç´æ¥å·æ°ææ¡£å表 |
| | | if (!this.currentRightClickedTableRowInfo.hasOwnProperty('docId')) { |
| | | if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) { |
| | | // æ¤ç§æ
嵿¯å¨å¼å
¥è®¾å¤ç±»å¹¶å¨è®¾å¤ç±»å表ä¸è¿è¡NCææ¡£å¯¼å
¥ |
| | | if (this.currentClickedTypeInfo.id !== attributionId) return |
| | | if (+type === 5 || +type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.deviceCustomTypeTableList) { |
| | | this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() |
| | | // 忢æ ä¹åæ¸
空NCç¨åºå表 |
| | | if (this.$refs.ncDocumentTableListRef && this.$refs.ncDocumentTableListRef.dataSource.length > 0) this.$refs.ncDocumentTableListRef.dataSource = [] |
| | | } |
| | | else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | // æ¤ç§æ
嵿¯å¨ç»ææ èç¹ä¸è¿è¡ææ¡£å¯¼å
¥ |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | } |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | if (docClassCode === 'NC') { |
| | | /** |
| | | * æ¥åå½åç¹å»ç设å¤ç±»ä¿¡æ¯ |
| | | * @param record å½åç¹å»ç设å¤ç±»è¡ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentClickedTypeInfo(record) { |
| | | const { id, attributionType } = record |
| | | const { autoClickedLevelInfo } = this.currentTreeNodeInfo |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType, |
| | | docClassCode: 'NC', |
| | | autoClickedLevelInfo |
| | | }) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (!res.success) { |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åº/åæ¶åºåº/åå¸/彿¡£æåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionType ææ¡£ç¶çº§typeç±»å |
| | | * @param attributionId ææ¡£ç¶çº§Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionType, attributionId }) { |
| | | console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId) |
| | | // 卿¤å¤è®¾å¤NCææ¡£ç¶çº§åæ°æ¯å¯æ¤æ¹æ³æ¯ç»ææ 以å设å¤ç±»ä¸¤ç§ä¸å导å
¥æ¹å¼çå
±ååºå£ |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType }) |
| | | |
| | | // 夿å½åå³ä¾§å±ç¤ºçææ¡£çæå±æ¯å¦æ¯å½åå·¦é®é䏿 èç¹æè®¾å¤ç±»ï¼è¥ä¸æ¯å½åå·¦é®éä¸çåå¨å¯¼å
¥åä¸å·æ°å³ä¾§çææ¡£å表(é¿å
æ æå·æ°) |
| | | // 夿æ¯å¦æ¯å¨ææ¡£å表ä¸è¿è¡åºåº/å
¥åº/åå¸/彿¡£çæä½,è¥æ¯å¨ææ¡£åè¡¨ä¸æä½åæä½æååç´æ¥å·æ°ææ¡£å表 |
| | | if (!this.currentRightClickedTableRowInfo.hasOwnProperty('docId')) { |
| | | if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) { |
| | | // æ¤ç§æ
嵿¯å¨å¼å
¥è®¾å¤ç±»å¹¶å¨è®¾å¤ç±»å表ä¸è¿è¡NCææ¡£å¯¼å
¥ |
| | | if (this.currentClickedTypeInfo.id !== attributionId) return |
| | | } else { |
| | | // æ¤ç§æ
嵿¯å¨ç»ææ èç¹ä¸è¿è¡ææ¡£å¯¼å
¥ |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | } |
| | | } |
| | | |
| | | if (docClassCode === 'NC') { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | | }, |
| | | |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (!res.success) { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi({ docId, attributionType, attributionId }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi({docId,attributionType,attributionId}) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | /** |
| | | * 彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | description: err.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | 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() |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | | <div style="display: flex;flex-direction: column;height: 100%"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <a-input placeholder="è¾å
¥å
³é®åè¿è¡æç´¢" allowClear v-model="searchInput" |
| | | @change="handleSearchInputChange" /> |
| | | @change="handleSearchInputChange"/> |
| | | <!-- <a-tooltip title="å·æ°">--> |
| | | <!-- <a-button icon="reload" @click="handleTreeReload" style="width: 18%;margin-left: 8px"></a-button>--> |
| | | <!-- </a-tooltip>--> |
| | |
| | | @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick"> |
| | | <template slot="title" slot-scope="{ label, parentId, key:treeKey,type}"> |
| | | <ProductStructureTreeContextMenu ref="contextMenuRef" |
| | | :treeParams="{label,treeKey,searchValue,type}" /> |
| | | :treeParams="{label,treeKey,searchValue,type}"/> |
| | | </template> |
| | | |
| | | <a-icon slot="switcherIcon" type="down" /> |
| | | <a-icon slot="product" type="shopping" /> |
| | | <a-icon slot="component" type="camera" /> |
| | | <a-icon slot="part" type="hdd" /> |
| | | <a-icon slot="processSpecVersion" type="tag" /> |
| | | <a-icon slot="process" type="apartment" /> |
| | | <a-icon slot="processStep" type="tool" /> |
| | | <a-icon slot="switcherIcon" type="down"/> |
| | | <a-icon slot="product" type="shopping"/> |
| | | <a-icon slot="component" type="camera"/> |
| | | <a-icon slot="part" type="hdd"/> |
| | | <a-icon slot="processSpecVersion" type="tag"/> |
| | | <a-icon slot="process" type="apartment"/> |
| | | <a-icon slot="processStep" type="tool"/> |
| | | </a-tree> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <!--产åå¼¹çª--> |
| | | <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected" |
| | | @submitSuccess="getTreeDataByApi" /> |
| | | @submitSuccess="getTreeDataByApi"/> |
| | | <!--é¨ä»¶å¼¹çª--> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--é¶ä»¶å¼¹çª--> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--å·¥èºè§ç¨çæ¬å¼¹çª--> |
| | | <ProcessSpecVersionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <ProcessSpecVersionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--å·¥åºå¼¹çª--> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--å·¥æ¥å¼¹çª--> |
| | | <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--æéé
置弹çª--> |
| | | <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--æ£ç´¢çµå模æ¿å¼¹çª--> |
| | | <NcDocumentSearchModal :currentDocumentInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <NcDocumentSearchModal :currentDocumentInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--æ£ç´¢NCæä»¶å¼¹çª--> |
| | | <NcDocumentSearchNcModal :currentDocumentInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <NcDocumentSearchNcModal :currentDocumentInfo="rightClickSelected" @searchTreeNode="searchTreeNode" |
| | | @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--å¼ç¨é¨ä»¶--> |
| | | <NcComponentBorrowModal :currentBorrowInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <NcComponentBorrowModal :currentBorrowInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--产åç»ææ åºæ¬å³é®èå(空ç½å¤è§¦å)--> |
| | | <ProductStructureBaseContextMenu ref="baseContextmenuRef" /> |
| | | <ProductStructureBaseContextMenu ref="baseContextmenuRef"/> |
| | | |
| | | <div class="full-screen-container" v-if="fullScreenSpinning"> |
| | | <a-spin :spinning="fullScreenSpinning" size="large" tip="NCæä»¶æ£ç´¢ä¸..."/> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import { deleteAction } from '@/api/manage' |
| | | import ProductStructureTreeContextMenu from './ProductStructureTreeContextMenu' |
| | | import ProductModal from './Product/ProductModal' |
| | | import ComponentModal from './Component/ComponentModal' |
| | | import PartModal from './Part/PartModal' |
| | | import ProcessSpecVersionModal from './ProcessSpecVersion/ProcessSpecVersionModal' |
| | | import ProcessModal from './Process/ProcessModal' |
| | | import ProcessStepModal from './ProcessStep/ProcessStepModal' |
| | | import AssignPermissionModal from './Permission/AssignPermissionModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import ProductStructureBaseContextMenu |
| | | from '@views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue' |
| | | import NcDocumentSearchModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentSearchModal.vue' |
| | | import NcDocumentSearchNcModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentSearchNcModal.vue' |
| | | import NcComponentBorrowModal from '@views/dnc/base/modules/ProductStructure/Document/NcComponentBorrowModal.vue' |
| | | import dncApi from '@/api/dnc' |
| | | import { deleteAction } from '@/api/manage' |
| | | import ProductStructureTreeContextMenu from './ProductStructureTreeContextMenu' |
| | | import ProductModal from './Product/ProductModal' |
| | | import ComponentModal from './Component/ComponentModal' |
| | | import PartModal from './Part/PartModal' |
| | | import ProcessSpecVersionModal from './ProcessSpecVersion/ProcessSpecVersionModal' |
| | | import ProcessModal from './Process/ProcessModal' |
| | | import ProcessStepModal from './ProcessStep/ProcessStepModal' |
| | | import AssignPermissionModal from './Permission/AssignPermissionModal' |
| | | import DeviceCustomTypeModal |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import ProductStructureBaseContextMenu |
| | | from '@views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue' |
| | | import NcDocumentSearchModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentSearchModal.vue' |
| | | import NcDocumentSearchNcModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentSearchNcModal.vue' |
| | | import NcComponentBorrowModal from '@views/dnc/base/modules/ProductStructure/Document/NcComponentBorrowModal.vue' |
| | | |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | | components: { |
| | | ProductStructureBaseContextMenu, |
| | | DeviceCustomTypeModal, |
| | | AssignPermissionModal, |
| | | ProcessStepModal, |
| | | ProcessModal, |
| | | ProcessSpecVersionModal, |
| | | PartModal, |
| | | ComponentModal, |
| | | ProductModal, |
| | | ProductStructureTreeContextMenu, |
| | | NcDocumentSearchModal, |
| | | NcDocumentSearchNcModal, |
| | | NcComponentBorrowModal |
| | | }, |
| | | data() { |
| | | return { |
| | | searchInput: '', |
| | | cardLoading: false, |
| | | loading: false, |
| | | treeDataSource: [], |
| | | selectedKeys: [], |
| | | expandedKeys: [], |
| | | beforeSearchExpandedKeys: [], |
| | | searchValue: '', |
| | | dataList: [], |
| | | autoExpandParent: true, |
| | | checkStrictly: true, |
| | | allTreeKeys: [], |
| | | rightClickSelected: {}, |
| | | url: { |
| | | delete: '/nc/product/delete' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeDataByApi() |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | // è°ç¨æ¥å£è·åæ çæ°æ® |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getProductStructureTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | // this.expandedKeys = this.allTreeKeys |
| | | if (this.expandedKeys.length === 0) this.expandedKeys = this.beforeSearchExpandedKeys = [this.treeDataSource[0].id] |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | this.cardLoading = false |
| | | }) |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | | components: { |
| | | ProductStructureBaseContextMenu, |
| | | DeviceCustomTypeModal, |
| | | AssignPermissionModal, |
| | | ProcessStepModal, |
| | | ProcessModal, |
| | | ProcessSpecVersionModal, |
| | | PartModal, |
| | | ComponentModal, |
| | | ProductModal, |
| | | ProductStructureTreeContextMenu, |
| | | NcDocumentSearchModal, |
| | | NcDocumentSearchNcModal, |
| | | NcComponentBorrowModal |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹é䏿¶è§¦å |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeSelect(selectedKeys, { node }) { |
| | | const that = this |
| | | let record = node.dataRef |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | let currentSelectedNodeInfo |
| | | if (res.result.length > 0) { |
| | | currentSelectedNodeInfo = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | currentSelectedNodeInfo = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', currentSelectedNodeInfo) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (selectedKeys.length === 0) return |
| | | this.selectedKeys = selectedKeys |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å³é®åå»èç¹æ¶è§¦å |
| | | * @param node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeRightClick({ node }) { |
| | | if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false |
| | | const that = this |
| | | const record = node.dataRef |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (res.result.length > 0) { |
| | | that.rightClickSelected = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | that.rightClickSelected = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹å³é®åå»èåä¸å 餿鮿¶è§¦å |
| | | handleDelete() { |
| | | const that = this |
| | | const { rightClickSelected: { id, type }, $confirm, url, $notification } = that |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | deleteAction(url.delete + `/${id}/${type}`) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.getTreeDataByApi() |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | data() { |
| | | return { |
| | | searchInput: '', |
| | | cardLoading: false, |
| | | loading: false, |
| | | treeDataSource: [], |
| | | selectedKeys: [], |
| | | expandedKeys: [], |
| | | beforeSearchExpandedKeys: [], |
| | | searchValue: '', |
| | | dataList: [], |
| | | autoExpandParent: true, |
| | | checkStrictly: true, |
| | | allTreeKeys: [], |
| | | rightClickSelected: {}, |
| | | fullScreenSpinning: false, |
| | | url: { |
| | | delete: '/nc/product/delete' |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * èªå¨å±å¼æ·»å ä¸çº§èç¹çç¶èç¹ |
| | | * @param isAddNextLevel æ¯å¦éè¦å±å¼ä¸çº§ |
| | | */ |
| | | modalFormSubmitSuccess(isAddNextLevel) { |
| | | // 夿æ¯å¦ä¸ºæ·»å ä¸çº§å¹¶ä¸å¤æç¶èç¹æ¯å¦å±å¼ |
| | | if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id) |
| | | created() { |
| | | this.getTreeDataByApi() |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.$bus.$on('searchNcFinished', () => this.fullScreenSpinning = false) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |
| | | handleTreeExpand(expandedKeys) { |
| | | this.expandedKeys = this.beforeSearchExpandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | beforeDestroy() { |
| | | this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | // è°ç¨æ¥å£è·åæ çæ°æ® |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getProductStructureTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | // this.expandedKeys = this.allTreeKeys |
| | | if (this.expandedKeys.length === 0) this.expandedKeys = this.beforeSearchExpandedKeys = [this.treeDataSource[0].id] |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | this.cardLoading = false |
| | | }) |
| | | }, |
| | | |
| | | // è¾å
¥æ¥è¯¢å
容ååæ¶è§¦åï¼å¢å 鲿æºå¶ï¼ |
| | | handleSearchInputChange() { |
| | | const that = this |
| | | let timer |
| | | if (timer) clearTimeout(timer) |
| | | timer = setTimeout(function() { |
| | | that.searchAndExpandTreeNode() // å å°æ¬å·è°ç¨å½æ° |
| | | }, 1000) |
| | | }, |
| | | |
| | | // 鲿彿°ä¸è§¦åæç´¢å¹¶å±å¼æ èç¹ |
| | | searchAndExpandTreeNode() { |
| | | let search = this.searchInput |
| | | let expandedKeys |
| | | let autoExpandParent |
| | | if (search !== '') { |
| | | expandedKeys = this.dataList |
| | | .map(item => { |
| | | if (item.title != null) { |
| | | if (item.title.indexOf(search) > -1) { |
| | | return this.getParentKey(item.key, this.treeDataSource) |
| | | /** |
| | | * æ èç¹é䏿¶è§¦å |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param eventOrRecord èç¹å¯¹è±¡æè
æå¨ä¼ å
¥record |
| | | */ |
| | | handleTreeSelect(selectedKeys, eventOrRecord) { |
| | | const that = this |
| | | let record = eventOrRecord.node ? eventOrRecord.node.dataRef : eventOrRecord |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | let currentSelectedNodeInfo |
| | | if (res.result.length > 0) { |
| | | currentSelectedNodeInfo = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | currentSelectedNodeInfo = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | return null |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', currentSelectedNodeInfo) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .filter((item, i, self) => item && self.indexOf(item) === i) |
| | | autoExpandParent = true |
| | | } else { |
| | | expandedKeys = this.beforeSearchExpandedKeys |
| | | autoExpandParent = false |
| | | } |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | | autoExpandParent |
| | | }) |
| | | }, |
| | | if (selectedKeys.length === 0) return |
| | | this.selectedKeys = selectedKeys |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çç¶çº§key |
| | | * @param key å项key |
| | | * @param tree å项 |
| | | */ |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === key)) { |
| | | parentKey = node.key |
| | | } else if ( |
| | | this.getParentKey(key, node.children)) { |
| | | parentKey = this.getParentKey(key, node.children) |
| | | /** |
| | | * æ èç¹å³é®åå»èç¹æ¶è§¦å |
| | | * @param node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeRightClick({ node }) { |
| | | if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false |
| | | const that = this |
| | | const record = node.dataRef |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (res.result.length > 0) { |
| | | that.rightClickSelected = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | that.rightClickSelected = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹å³é®åå»èåä¸å 餿鮿¶è§¦å |
| | | handleDelete() { |
| | | const that = this |
| | | const { rightClickSelected: { id, type }, $confirm, url, $notification } = that |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | deleteAction(url.delete + `/${id}/${type}`) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.getTreeDataByApi() |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * èªå¨å±å¼æ·»å ä¸çº§èç¹çç¶èç¹ |
| | | * @param isAddNextLevel æ¯å¦éè¦å±å¼ä¸çº§ |
| | | */ |
| | | modalFormSubmitSuccess(isAddNextLevel) { |
| | | // 夿æ¯å¦ä¸ºæ·»å ä¸çº§å¹¶ä¸å¤æç¶èç¹æ¯å¦å±å¼ |
| | | if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id) |
| | | this.getTreeDataByApi() |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |
| | | handleTreeExpand(expandedKeys) { |
| | | this.expandedKeys = this.beforeSearchExpandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | |
| | | /** |
| | | * æ£ç´¢NCæä»¶å¼¹çªä¸åå»è¡è®°å½å触åæç´¢NCæä»¶å¯¹åºæ èç¹å¹¶æ¨¡æé䏿 èç¹æ¥è¯¢å¯¹åºè®¾å¤ç±»æNCæä»¶ |
| | | * @param searchNcRecord æ£ç´¢NCæä»¶å¼¹çªä¸åå»è·å¾çNCæä»¶å表è¡è®°å½ |
| | | */ |
| | | searchTreeNode(searchNcRecord) { |
| | | this.fullScreenSpinning = true |
| | | const { attributionId, nodeCode, nodeName, nodeId, docId } = searchNcRecord |
| | | this.searchInput = `[${nodeCode}]${nodeName}` |
| | | this.searchAndExpandTreeNode() |
| | | const treeNodeRecord = Object.assign({ |
| | | autoClickedLevelInfo: { |
| | | attributionId, |
| | | docId |
| | | } |
| | | }, this.getTreeNodeRecord(nodeId, this.treeDataSource)) |
| | | this.handleTreeSelect([treeNodeRecord.id], treeNodeRecord) |
| | | }, |
| | | |
| | | // è¾å
¥æ¥è¯¢å
容ååæ¶è§¦åï¼å¢å 鲿æºå¶ï¼ |
| | | handleSearchInputChange() { |
| | | const that = this |
| | | let timer |
| | | if (timer) clearTimeout(timer) |
| | | timer = setTimeout(function() { |
| | | that.searchAndExpandTreeNode() // å å°æ¬å·è°ç¨å½æ° |
| | | }, 1000) |
| | | }, |
| | | |
| | | // 鲿彿°ä¸è§¦åæç´¢å¹¶å±å¼æ èç¹ |
| | | searchAndExpandTreeNode() { |
| | | let search = this.searchInput |
| | | let expandedKeys |
| | | let autoExpandParent |
| | | if (search !== '') { |
| | | expandedKeys = this.dataList |
| | | .map(item => { |
| | | if (item.title != null) { |
| | | if (item.title.indexOf(search) > -1) { |
| | | return this.getParentKey(item.key, this.treeDataSource) |
| | | } |
| | | return null |
| | | } |
| | | }) |
| | | .filter((item, i, self) => item && self.indexOf(item) === i) |
| | | autoExpandParent = true |
| | | } else { |
| | | expandedKeys = this.beforeSearchExpandedKeys |
| | | autoExpandParent = false |
| | | } |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | | autoExpandParent |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çç¶çº§key |
| | | * @param key å项key |
| | | * @param tree å项 |
| | | */ |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === key)) { |
| | | parentKey = node.key |
| | | } else if ( |
| | | this.getParentKey(key, node.children)) { |
| | | parentKey = this.getParentKey(key, node.children) |
| | | } |
| | | } |
| | | } |
| | | return parentKey |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çrecord对象 |
| | | * @param key record对象keyå¼ |
| | | * @param tree æ èç¹ |
| | | */ |
| | | getTreeNodeRecord(key, tree) { |
| | | let treeNodeRecord |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.findIndex(item => item.key === key) > -1) { |
| | | treeNodeRecord = node.children.find(item => item.key === key) |
| | | } else if (this.getTreeNodeRecord(key, node.children)) { |
| | | treeNodeRecord = this.getTreeNodeRecord(key, node.children) |
| | | } |
| | | } |
| | | } |
| | | return treeNodeRecord |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | data[i].key = data[i].id |
| | | const node = data[i] |
| | | const key = node.id |
| | | const title = node.label |
| | | this.dataList.push({ key, title }) |
| | | this.allTreeKeys.push(key) |
| | | this.setTreeNodeIcon(node) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * æ æå¨ç¶å
ç´ çå³é®äºä»¶ |
| | | * @param event äºä»¶å¯¹è±¡ |
| | | */ |
| | | openBaseContextMenu(event) { |
| | | event.preventDefault() |
| | | if (event.target.id !== 'tree-container') return |
| | | this.$refs.baseContextmenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.baseContextmenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.baseContextmenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleBaseContextMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * 设置æ èç¹å¾æ |
| | | * @param treeNode |
| | | */ |
| | | setTreeNodeIcon(treeNode) { |
| | | switch (+treeNode.type) { |
| | | case 1: |
| | | treeNode.slots = { icon: 'product' } |
| | | break |
| | | case 2: |
| | | treeNode.slots = { icon: 'component' } |
| | | break |
| | | case 3: |
| | | treeNode.slots = { icon: 'part' } |
| | | break |
| | | case 4: |
| | | treeNode.slots = { icon: 'processSpecVersion' } |
| | | break |
| | | case 5: |
| | | treeNode.slots = { icon: 'process' } |
| | | break |
| | | case 6: |
| | | treeNode.slots = { icon: 'processStep' } |
| | | break |
| | | default: |
| | | } |
| | | }, |
| | | |
| | | // æ§å¶åºç¡å³é®èåå
³é |
| | | handleBaseContextMenuClose() { |
| | | if (this.$refs.baseContextmenuRef) this.$refs.baseContextmenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleBaseContextMenuClose) |
| | | }, |
| | | |
| | | // å·æ°éæ°è·åæ çæ°æ® |
| | | handleTreeReload() { |
| | | this.getTreeDataByApi() |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName }) { |
| | | if (this[methodName]) this[methodName]() |
| | | } |
| | | return parentKey |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | data[i].key = data[i].id |
| | | const node = data[i] |
| | | const key = node.id |
| | | const title = node.label |
| | | this.dataList.push({ key, title }) |
| | | this.allTreeKeys.push(key) |
| | | this.setTreeNodeIcon(node) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * æ æå¨ç¶å
ç´ çå³é®äºä»¶ |
| | | * @param event äºä»¶å¯¹è±¡ |
| | | */ |
| | | openBaseContextMenu(event) { |
| | | event.preventDefault() |
| | | if (event.target.id !== 'tree-container') return |
| | | this.$refs.baseContextmenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.baseContextmenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.baseContextmenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleBaseContextMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * 设置æ èç¹å¾æ |
| | | * @param treeNode |
| | | */ |
| | | setTreeNodeIcon(treeNode) { |
| | | switch (+treeNode.type) { |
| | | case 1: |
| | | treeNode.slots = { icon: 'product' } |
| | | break |
| | | case 2: |
| | | treeNode.slots = { icon: 'component' } |
| | | break |
| | | case 3: |
| | | treeNode.slots = { icon: 'part' } |
| | | break |
| | | case 4: |
| | | treeNode.slots = { icon: 'processSpecVersion' } |
| | | break |
| | | case 5: |
| | | treeNode.slots = { icon: 'process' } |
| | | break |
| | | case 6: |
| | | treeNode.slots = { icon: 'processStep' } |
| | | break |
| | | default: |
| | | } |
| | | }, |
| | | |
| | | // æ§å¶åºç¡å³é®èåå
³é |
| | | handleBaseContextMenuClose() { |
| | | if(this.$refs.baseContextmenuRef)this.$refs.baseContextmenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleBaseContextMenuClose) |
| | | }, |
| | | |
| | | // å·æ°éæ°è·åæ çæ°æ® |
| | | handleTreeReload() { |
| | | this.getTreeDataByApi() |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName }) { |
| | | if (this[methodName]) this[methodName]() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | /deep/ .ant-card-body { |
| | | padding: 0 12px 0 0; |
| | | } |
| | | |
| | | /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container { |
| | | height: 100%; |
| | | } |
| | | |
| | | /deep/ .ant-tree-title, .ant-tree-title .ant-dropdown-trigger { |
| | | display: inline-block; |
| | | width: calc(100% - 24px) !important; |
| | | } |
| | | |
| | | ::-webkit-scrollbar { |
| | | width: 8px; |
| | | } |
| | | |
| | | @media screen and (min-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | /deep/ .ant-card-body { |
| | | padding: 0 12px 0 0; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container { |
| | | height: 100%; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px) { |
| | | .tree_con { |
| | | height: 600px !important; |
| | | /deep/ .ant-tree-title, .ant-tree-title .ant-dropdown-trigger { |
| | | display: inline-block; |
| | | width: calc(100% - 24px) !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | ::-webkit-scrollbar { |
| | | width: 8px; |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 1280px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | .full-screen-container { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-color: rgba(0, 0, 0, .8); |
| | | z-index: 9999; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px) { |
| | | .tree_con { |
| | | height: 600px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 1280px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | { label: 'ä¸è½½', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æ¹éå é¤', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, |
| | | { label: 'å®å', code: 'document_appoint', subMenu: [], icon: 'swap-right', isCommonMethod: true }, |
| | | { |
| | | label: 'çå½å¨æ', |
| | | subMenu: [ |
| | |
| | | :selectShenpiData='selectDispatchFileXqData' |
| | | @searchReset='searchReset' |
| | | ></DispatchFileHandle> |
| | | <StandardizedProcessHandle |
| | | ref='StandardizedProcessHandle' |
| | | :selectShenpiData='selectDispatchFileXqData' |
| | | @searchReset='searchReset' |
| | | ></StandardizedProcessHandle> |
| | | <DispatchFileBachHandleStyle |
| | | ref='modalFormDispatchFileBatch' |
| | | @ok='modalFormOk' |
| | |
| | | import lossBoundHandle from '@views/flowable/workflow/lossBound/lossBoundHandle.vue' |
| | | import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue' |
| | | import SparePartApplyHandle from '@views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue' |
| | | import StandardizedProcessHandle from '@views/flowable/workflow/standardizedProcess/StandardizedProcessHandle.vue' |
| | | |
| | | export default { |
| | | name: 'NcDeviceCharactersList', |
| | |
| | | InboundOrderHandle, |
| | | EquipmentTransferApprovalModal, |
| | | EquipmentScrapApprovalModal, |
| | | SparePartApplyHandle |
| | | SparePartApplyHandle, |
| | | StandardizedProcessHandle |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | case 'ggApproval': |
| | | this.handDispatchFileDetial(item) |
| | | break |
| | | case 'standardized_approval': |
| | | this.handStandardizedDetial(item) |
| | | break |
| | | case 'sbdjApproval': |
| | | this.handInspectionOrder(item) |
| | | break |
| | |
| | | this.$refs.modalFormDispatchFileXq.clearTableSource() |
| | | this.$refs.modalFormDispatchFileXq.getAllApproveData(item) |
| | | }, |
| | | //å®å审æ¹é¡µé¢ |
| | | handStandardizedDetial(item){ |
| | | this.selectDispatchFileXqData = item |
| | | this.$refs.StandardizedProcessHandle.clearTableSource() |
| | | this.$refs.StandardizedProcessHandle.getAllApproveData(item) |
| | | }, |
| | | |
| | | handInspectionOrder(record) { |
| | | console.log('record----->', record) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | Description: 工使µ-NC审ç¾å¤çé¡µé¢ List |
| | | Author: ä½è
liuyh |
| | | Date: 2025-02-27 |
| | | --> |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :footer="null" |
| | | @cancel="handCancel" |
| | | > |
| | | <a-card :bordered="false"> |
| | | <div> |
| | | <b>{{ selectShenpiData.description }}</b> |
| | | <br> |
| | | <br> |
| | | <a-tag color="blue"> |
| | | å½åå¤ç人 {{ selectShenpiData.assignee_dictText }} |
| | | </a-tag> |
| | | <a-tag color="blue"> |
| | | ä»»å¡å建æ¶é´ {{ selectShenpiData.createTime }} |
| | | </a-tag> |
| | | <br> |
| | | <br> |
| | | <button @click="fetchAndShowBmp" class="btn-custom">æå¼æµç¨å¾</button> |
| | | <div v-if="imageSrc"> |
| | | <img :src="imageSrc" alt="Fetched Image" /> |
| | | </div> |
| | | <hr class="shallow-hr"> |
| | | </div> |
| | | <div> |
| | | <b>审ç¾è¯¦æ
</b> |
| | | <br> |
| | | <a-form :form='form'> |
| | | <a-spin :spinning="spinning"> |
| | | <a-tabs default-active-key='1' @change='callback'> |
| | | <a-tab-pane key='1' tab='åºæ¬ä¿¡æ¯'> |
| | | <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'> |
| | | <a-row> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='ææ¡£åç§°' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='docName'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.docName'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='ææ¡£çæ¬' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='publishVersion'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.publishVersion'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='ææ¡£åç¼' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='docSuffix'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.docSuffix'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='ç³»ç»æå®çæ¬' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='componentId'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.componentName'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='åºåºç¶æ' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='pullStatus_dictText'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.pullStatus_dictText'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='span'> |
| | | <a-form-model-item label='åºåºäºº' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='pullUser_dictText'> |
| | | <a-input :disabled='coldisabled' v-model='tableRowRecord.pullUser_dictText'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-tab-pane> |
| | | <a-tab-pane key='2' tab='æµç¨èç¹'> |
| | | <a-card> |
| | | <a-timeline style="padding:0 1% 0 12%" > |
| | | <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1"> |
| | | <div class="bottom"> |
| | | <p>å¤ç人ï¼{{item.assignee_dictText}}</p> |
| | | <p v-if="index1 !==0">å¤çæ¶é¿ï¼{{item.duration}}</p> |
| | | <p v-if="item.name !== 'æäº¤ç³è¯·'">å¤çç±»åï¼{{item.sequenceFlowName}}</p> |
| | | <p v-if="item.description != null">å¤çæè§ï¼{{item.description}}</p> |
| | | <div class="left_qiu"><span>{{item.taskName}}</span></div> |
| | | </div> |
| | | </a-timeline-item> |
| | | </a-timeline> |
| | | </a-card> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-spin> |
| | | </a-form> |
| | | </div> |
| | | <div> |
| | | <hr class="shallow-hr"> |
| | | <br> |
| | | <b>审æ¹è¯¦æ
</b> |
| | | <br> |
| | | <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col ::span='span' v-if="selectShenpiData.taskDefKey ==='task_proofread'" class="btxx"> |
| | | <a-form-model-item label="å¤çç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='status'> |
| | | <j-dict-select-tag type='list' v-model='assignFileStream.status' dictCode='nc_sq_handle_type_jd' placeholder="è¯·éæ©å¤çç±»å" /> |
| | | </a-form-model-item > |
| | | </a-col> |
| | | <a-col ::span='span' v-if="selectShenpiData.taskDefKey ==='task_approve' || selectShenpiData.taskDefKey ==='Activity_0ocot6b'|| selectShenpiData.taskDefKey ==='task_cut' || selectShenpiData.taskDefKey ==='task_finalize'" class="btxx"> |
| | | <a-form-model-item label="å¤çç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='status'> |
| | | <j-dict-select-tag type='list' v-model='assignFileStream.status' dictCode='nc_sq_handle_type' placeholder="è¯·éæ©å¤çç±»å" /> |
| | | </a-form-model-item > |
| | | </a-col> |
| | | <a-col :span="24" class="btxx"> |
| | | <a-form-model-item label="å¤çæè§" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-textarea v-model="assignFileStream.approveContent" rows="4" placeholder="请è¾å
¥å¤çæè§"/> |
| | | </a-form-model-item > |
| | | </a-col> |
| | | </a-row> |
| | | <div class="table-operator" style="text-align: right;"> |
| | | <a-button @click="handleQueXiaoTask" type="primary" icon="close">åæ¶</a-button> |
| | | <a-button @click="submitForm">æ 交</a-button> |
| | | </div> |
| | | </a-form-model> |
| | | </div> |
| | | </a-card> |
| | | |
| | | |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' |
| | | export default { |
| | | name: 'FlowShenPi', |
| | | mixins: [mixinDevice], |
| | | props: { |
| | | selectShenpiData: { |
| | | type: Object, |
| | | required: true |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | span: 12, |
| | | span1: 8, |
| | | coldisabled: true, |
| | | spinning: false, |
| | | tableRowRecord: {}, |
| | | assignFileStream:{}, |
| | | tableDataSource: [], |
| | | usageDataSource: [], |
| | | hitaskDataSource:[], |
| | | bomForm: {}, |
| | | approveContent:"", |
| | | imageSrc: null, |
| | | drawerVisible: true, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 30 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | validatorRules: { |
| | | status: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©å®¡æ¹ç¶æ!'}, |
| | | ] |
| | | }, |
| | | }, |
| | | approveData: {}, |
| | | flowData: {}, |
| | | title: '详æ
页é¢', |
| | | width: 1000, |
| | | visible: false, |
| | | // 表头 |
| | | url: { |
| | | diagramView: '/assign/flow/diagramView', |
| | | queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList', |
| | | approve:"/dncFlow/dispatchFile/approval", |
| | | saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile", |
| | | queryDocInfoByFlowDataId:'/dncFlow/dispatchFile/queryDocInfoByFlowDataId' |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [], |
| | | workflowSource: [] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | callback() { |
| | | }, |
| | | handCancel() { |
| | | this.visible = false |
| | | }, |
| | | clearTableSource() { |
| | | this.tableDataSource = [] |
| | | this.usageDataSource = [] |
| | | }, |
| | | fetchAndShowBmp() { |
| | | console.log('flowData----->', this.flowData) |
| | | try { |
| | | let parm = { |
| | | processDefinitionId: this.flowData.processDefinitionId, |
| | | processInstanceId:this.flowData.processInstanceId, |
| | | TaskDefinitionKey:this.flowData.processDefinitionKey |
| | | } |
| | | downFile(this.url.diagramView,parm,'get').then((res=>{ |
| | | console.log('Pica------>',res) |
| | | const urlObject = window.URL.createObjectURL(new Blob([res])) |
| | | this.imageSrc = urlObject |
| | | })) |
| | | } catch (error) { |
| | | console.error('Error fetching image blob:', error) |
| | | alert('æ æ³å è½½å¾çï¼è¯·ç¨ååè¯ã') |
| | | } |
| | | }, |
| | | handleQueXiaoTask(){ |
| | | this.visible = false |
| | | this.routeReload() |
| | | }, |
| | | submitForm () { |
| | | const that = this; |
| | | console.log('selectShenpiData---->',that.selectShenpiData) |
| | | if (that.selectShenpiData.taskDefKey ==='task_prepare'){ |
| | | // 触å表åéªè¯-éæ°å¯å¨ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let url=this.url.saveDispatchFile; |
| | | let method = 'post'; |
| | | let flowTaskVo = {} |
| | | flowTaskVo.comment =that.assignFileStream.approveContent; |
| | | flowTaskVo.dataId = this.selectShenpiData.dataId |
| | | flowTaskVo.instanceId = this.selectShenpiData.procInstId |
| | | flowTaskVo.taskId = this.selectShenpiData.id |
| | | console.log("表åæäº¤æ°æ®",flowTaskVo) |
| | | httpAction(url,flowTaskVo,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.visible = false |
| | | //å·æ°è¡¨æ ¼ |
| | | that.$emit('searchReset') |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | } |
| | | }) |
| | | //è·³åºæ¹æ³ |
| | | return false; |
| | | }else { |
| | | if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){ |
| | | this.$message.warning('è¯·éæ©å¤çç±»åï¼') |
| | | return false; |
| | | } |
| | | } |
| | | if (!that.assignFileStream.approveContent==null || that.assignFileStream.approveContent===undefined) { |
| | | this.$message.warning('请è¾å
¥å¤çæè§ï¼') |
| | | return false; |
| | | } |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let url=this.url.approve |
| | | let method = 'post'; |
| | | let handle =that.assignFileStream.status === '1'; |
| | | let flowTaskVo = {} |
| | | switch (that.selectShenpiData.taskDefKey){ |
| | | case "task_approve": |
| | | flowTaskVo.ratify=handle; |
| | | break; |
| | | case "task_cut": |
| | | flowTaskVo.cut=handle; |
| | | break; |
| | | case "task_finalize": |
| | | flowTaskVo.stereotype=handle; |
| | | break; |
| | | } |
| | | if (that.selectShenpiData.taskDefKey ==='task_proofread'){ |
| | | flowTaskVo.proofreadStatus =that.assignFileStream.status; |
| | | } |
| | | flowTaskVo.comment =that.assignFileStream.approveContent; |
| | | flowTaskVo.dataId = this.selectShenpiData.dataId |
| | | flowTaskVo.taskId = this.selectShenpiData.id |
| | | flowTaskVo.userId = this.selectShenpiData.assignee |
| | | flowTaskVo.instanceId = this.selectShenpiData.procInstId |
| | | flowTaskVo.values = this.selectShenpiData.variables |
| | | console.log("表åæäº¤æ°æ®",flowTaskVo) |
| | | httpAction(url,flowTaskVo,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.visible = false |
| | | //å·æ°è¡¨æ ¼ |
| | | that.$emit('searchReset') |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | async getAllApproveData(item) { |
| | | console.log('selectShenpiData----->', this.selectShenpiData) |
| | | this.flowData = item |
| | | let param = { |
| | | 'dataId': item.dataId |
| | | } |
| | | let parmhis={ |
| | | 'procInstId': item.procInstId |
| | | } |
| | | const hitaskDataList = await getAction(this.url.queryHisTaskList,parmhis) |
| | | if(hitaskDataList.success){ |
| | | this.hitaskDataSource=hitaskDataList.result |
| | | } |
| | | const docInforResult = await getAction(this.url.queryDocInfoByFlowDataId,param) |
| | | if(docInforResult.success){ |
| | | this.tableRowRecord = docInforResult.result |
| | | this.visible=true |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .shallow-hr { |
| | | border: 0; |
| | | height: 1px; /* åç线çé«åº¦ */ |
| | | background-color: rgba(0, 0, 0, 0.1); /* ä½¿ç¨ RGBA é¢è²ï¼å¹¶è®¾ç½®è¾ä½çéæåº¦ */ |
| | | margin: 20px 0; /* åç线ä¸ä¸çå¤è¾¹è· */ |
| | | } |
| | | .btn-custom { |
| | | background-color: #4CAF50; /* 绿è²èæ¯ */ |
| | | color: white; /* ç½è²æå */ |
| | | border: none; /* æ è¾¹æ¡ */ |
| | | padding: 5px 15px; /* å
è¾¹è· */ |
| | | text-align: center; /* æåå±
ä¸ */ |
| | | text-decoration: none; /* æ ä¸å线 */ |
| | | display: inline-block; /* è¡å
åå
ç´ */ |
| | | font-size: 12px; /* åä½å¤§å° */ |
| | | margin: 4px 2px; /* å¤è¾¹è· */ |
| | | cursor: pointer; /* é¼ æ æ¬åæ¶æ¾ç¤ºæå */ |
| | | border-radius: 4px; /* åè§è¾¹æ¡ */ |
| | | } |
| | | |
| | | .bold-large-label { |
| | | font-weight: bold; |
| | | font-size: 20px; /* æä½ éè¦çä»»ä½å¤§å° */ |
| | | } |
| | | .left_qiu{ |
| | | position: absolute; |
| | | left: -74px; |
| | | top: 0; |
| | | width:54px; |
| | | border-radius: 50%; |
| | | height:54px; |
| | | font-size: 13px; |
| | | margin: auto; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: #0099ff; |
| | | transform: translate(0, 0); |
| | | } |
| | | /deep/ .ant-timeline-item-tail{ |
| | | left: -29px !important; |
| | | } |
| | | .left_qiu span{ |
| | | width: 3em; |
| | | display: block; |
| | | color: #fff; |
| | | text-align: center; |
| | | } |
| | | .img{ |
| | | width: 75%; |
| | | } |
| | | |
| | | .wrap{ |
| | | clear: both; |
| | | width: 100%; |
| | | display: flex; |
| | | height: 50px; |
| | | border: 1px solid #ccc; |
| | | /* background-color: aqua; */ |
| | | } |
| | | .box{ |
| | | width:21%; |
| | | height:50px; |
| | | border-right: 1px solid #ccc; |
| | | line-height: 50px; |
| | | /* background: red; */ |
| | | text-align:center; |
| | | margin: auto; |
| | | } |
| | | |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | this.$refs.paraCommonToolModal.edit(record); |
| | | this.$refs.paraCommonToolModal.title="详æ
"; |
| | | this.$refs.paraCommonToolModal.disableSubmit = true; |
| | | this.$refs.paraCommonToolModal.disSeach = true; |
| | | if(this.$refs.paraCommonToolModal.removeValidate) { |
| | | this.$refs.paraCommonToolModal.removeValidate() |
| | | } |
| | | |
| | | }else if(record.paramaTableName === "2"){ |
| | | this.$refs.paraHoleToolsModal.edit(record); |
| | | this.$refs.paraHoleToolsModal.title="详æ
"; |
| | | this.$refs.paraHoleToolsModal.disableSubmit = true; |
| | | this.$refs.paraHoleToolsModal.disSeach = true; |
| | | if(this.$refs.paraHoleToolsModal.removeValidate) { |
| | | this.$refs.paraHoleToolsModal.removeValidate() |
| | | } |
| | | |
| | | }else if(record.paramaTableName === "3"){ |
| | | this.$refs.paraThreadingToolModal.edit(record); |
| | | this.$refs.paraThreadingToolModal.title="详æ
"; |
| | | this.$refs.paraThreadingToolModal.disableSubmit = true; |
| | | this.$refs.paraThreadingToolModal.disSeach = true; |
| | | if(this.$refs.paraThreadingToolModal.removeValidate) { |
| | | this.$refs.paraThreadingToolModal.removeValidate() |
| | | } |
| | | |
| | | }else if(record.paramaTableName === "4"){ |
| | | this.$refs.paraMillToolModal.edit(record); |
| | | this.$refs.paraMillToolModal.title="详æ
"; |
| | | this.$refs.paraMillToolModal.disableSubmit = true; |
| | | this.$refs.paraMillToolModal.disSeach = true; |
| | | if(this.$refs.paraMillToolModal.removeValidate) { |
| | | this.$refs.paraMillToolModal.removeValidate() |
| | | } |
| | | |
| | | }else if(record.paramaTableName === "5"){ |
| | | this.$refs.paraTurningToolsModal.edit(record); |
| | | this.$refs.paraTurningToolsModal.title="详æ
"; |
| | | this.$refs.paraTurningToolsModal.disableSubmit = true; |
| | | this.$refs.paraTurningToolsModal.disSeach = true; |
| | | if(this.$refs.paraTurningToolsModal.removeValidate) { |
| | | this.$refs.paraTurningToolsModal.removeValidate() |
| | | } |
| | | |
| | | }else if(record.paramaTableName === "6"){ |
| | | this.$refs.paraBladeModal.edit(record); |
| | | this.$refs.paraBladeModal.title="详æ
"; |
| | | this.$refs.paraBladeModal.disableSubmit = true; |
| | | this.$refs.paraBladeModal.disSeach = true; |
| | | if(this.$refs.paraBladeModal.removeValidate) { |
| | | this.$refs.paraBladeModal.removeValidate() |
| | | } |
| | | |
| | | } |
| | | }, |
| | | //ç¦ç¨ç¶ææ ·å¼ |
| | |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
| | | @change="handleTableChange"> |
| | | |
| | | <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> |
| | | <div :key="col.dataIndex"> |
| | | |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'ratedLife'" |
| | | :disabled="record.accuracyClass != '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'useLife'" |
| | | :disabled="record.accuracyClass != '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleOutbound(record)">åºåº</a> |
| | | </span> |
| | |
| | | align:"left", |
| | | dataIndex: 'outboundQuantity' |
| | | }, |
| | | { |
| | | title:'é¢å®å¯¿å½', |
| | | align:"center", |
| | | dataIndex: 'ratedLife', |
| | | scopedSlots: { customRender: 'ratedLife' }, |
| | | }, |
| | | { |
| | | title:'使ç¨å¯¿å½', |
| | | align:"center", |
| | | dataIndex: 'useLife', |
| | | scopedSlots: { customRender: 'useLife' }, |
| | | }, |
| | | // { |
| | | // title:'å·²åºåºæ°é', |
| | | // align:"left", |
| | |
| | | { |
| | | outBoundOrderId: this.mainId, |
| | | outboundDetailId: record.id, |
| | | outboundQuantity: record.outboundQuantity |
| | | outboundQuantity: record.outboundQuantity, |
| | | ratedLife:record.ratedLife, |
| | | useLife:record.useLife |
| | | } |
| | | ] |
| | | postAction(this.url.outbound, params).then(res=>{ |
| | |
| | | this.$message |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | console.log(value, key, column, index) |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'outboundQuantity'" |
| | | :disabled="record.quantity <= 1" |
| | | :disabled="record.accuracyClass === '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'ratedLife'" |
| | | :disabled="record.accuracyClass != '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'useLife'" |
| | | :disabled="record.accuracyClass != '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | |
| | | align:"center", |
| | | dataIndex: 'outboundLocation' |
| | | }, |
| | | { |
| | | title:'é¢å®å¯¿å½', |
| | | align:"center", |
| | | dataIndex: 'ratedLife', |
| | | scopedSlots: { customRender: 'ratedLife' }, |
| | | }, |
| | | { |
| | | title:'使ç¨å¯¿å½', |
| | | align:"center", |
| | | dataIndex: 'useLife', |
| | | scopedSlots: { customRender: 'useLife' }, |
| | | }, |
| | | // { |
| | | // title:'åºåºç¶æ;1.æªåºåºï¼2.é¨ååºåºï¼3.åºåºå®æ', |
| | | // align:"center", |
| | |
| | | outboundQuantity: data[i].quantity, |
| | | storageLocation: data[i].warehouseId, |
| | | warehouseName: data[i].warehouseName, |
| | | outboundLocation: data[i].positionCode |
| | | outboundLocation: data[i].positionCode, |
| | | accuracyClass:data[i].accuracyClass |
| | | }) |
| | | } |
| | | this.ipagination.total = this.dataSource.length |
| | |
| | | toolId: item.toolId, |
| | | outboundQuantity: item.outboundQuantity, |
| | | outStorehouseType: this.model.outStorehouseType, |
| | | storageLocation: item.storageLocation |
| | | storageLocation: item.storageLocation, |
| | | ratedLife:item.ratedLife, |
| | | useLife:item.useLife |
| | | } |
| | | }) |
| | | this.confirmLoading = true; |
| | |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'outboundQuantity'" |
| | | :disabled="record.quantity <= 1" |
| | | :disabled="record.accuracyClass === '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'ratedLife'" |
| | | :disabled="record.quantity > 1" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'useLife'" |
| | | :disabled="record.quantity > 1" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | |
| | | align:"center", |
| | | dataIndex: 'outboundLocation' |
| | | }, |
| | | // { |
| | | // title:'é¢å®å¯¿å½', |
| | | // align:"center", |
| | | // dataIndex: 'ratedLife', |
| | | // scopedSlots: { customRender: 'ratedLife' }, |
| | | // }, |
| | | // { |
| | | // title:'使ç¨å¯¿å½', |
| | | // align:"center", |
| | | // dataIndex: 'useLife', |
| | | // scopedSlots: { customRender: 'useLife' }, |
| | | // }, |
| | | // { |
| | | // title:'åºåºç¶æ;1.æªåºåºï¼2.é¨ååºåºï¼3.åºåºå®æ', |
| | | // align:"center", |
| | |
| | | outboundQuantity: data[i].quantity, |
| | | storageLocation: data[i].warehouseId, |
| | | warehouseName: data[i].warehouseName, |
| | | outboundLocation: data[i].positionCode |
| | | outboundLocation: data[i].positionCode, |
| | | accuracyClass:data[i].accuracyClass |
| | | }) |
| | | } |
| | | this.ipagination.total = this.dataSource.length |
| | |
| | | return { |
| | | outBoundOrderId: this.selectedMainId, |
| | | outboundDetailId: item.id, |
| | | outboundQuantity: item.outboundQuantity |
| | | outboundQuantity: item.outboundQuantity, |
| | | ratedLife:item.ratedLife, |
| | | useLife:item.useLife |
| | | } |
| | | }) |
| | | postAction(this.url.outbound, params).then(res=>{ |
| | |
| | | align:"center", |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title:'åå
·åç§°', |
| | | align:"center", |
| | | dataIndex: 'typeName' |
| | | }, |
| | | |
| | | // { |
| | | // title:'åå
·åç§°', |
| | | // align:"center", |
| | | // dataIndex: 'typeName' |
| | | // }, |
| | | { |
| | | title:'åå®¶', |
| | | align:"center", |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue' |
| | | import pick from 'lodash.pick' |
| | | import DeviceListModel from '@views/mdc/base/modules/EquipmentList/DeviceListModal.vue' |
| | | |
| | | import { requestPut, postAction, httpAction } from '@/api/manage' |
| | | export default { |
| | | name: 'ToolsSharpeningModal', |
| | | mixins: [JVxeTableModelMixin], |
| | |
| | | lastSelectionData: null, |
| | | url: { |
| | | add: '/tms/toolSharpening/add', |
| | | edit: '/tms/toolSharpening/edit', |
| | | // queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | edit: '/tms/toolSharpening/edit' |
| | | } |
| | | } |
| | | }, |
| | |
| | | let that = this |
| | | that.visible = true |
| | | that.model = Object.assign({}, record) |
| | | // this.$nextTick(() => { |
| | | // this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', |
| | | // 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue')) |
| | | // }) |
| | | }, |
| | | // edit(record) { |
| | | // let that = this |
| | | // that.visible = true |
| | | // that.model = Object.assign({}, record) |
| | | // |
| | | // // 妿æ selectionRows æ°æ®ï¼åéæ°èµå¼ |
| | | // if (this.lastSelectionData && this.lastSelectionData.length > 0) { |
| | | // this.assignModelFromSelection(this.lastSelectionData[0]) |
| | | // console.log('this.model',this.assignModelFromSelection(this.lastSelectionData[0])) |
| | | // } |
| | | // }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | that.confirmLoading = true |
| | | |
| | | // â
触å表åéªè¯ |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let formData = Object.assign(this.model) |
| | | |
| | | let obj |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | obj = postAction(this.url.add, formData) |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | obj = requestPut(this.url.edit, formData, { id: this.model.id }) |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | |
| | | obj.then((res) => { |
| | | httpAction(httpurl, this.model, method,formData).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } else { |
| | | that.$message.warning('请填åå¿
å¡«åæ®µ') |
| | | that.confirmLoading = false |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | // handleOk() { |
| | | // const that = this |
| | | // that.confirmLoading = true |
| | | // |
| | | // // â
触å表åéªè¯ |
| | | // this.$refs.form.validate(valid => { |
| | | // if (valid) { |
| | | // let formData = Object.assign(this.model) |
| | | // |
| | | // let obj |
| | | // if (!this.model.id) { |
| | | // obj = postAction(this.url.add, formData) |
| | | // } else { |
| | | // obj = requestPut(this.url.edit, formData, { id: this.model.id }) |
| | | // } |
| | | // |
| | | // obj.then((res) => { |
| | | // if (res.success) { |
| | | // that.$message.success(res.message) |
| | | // that.$emit('ok') |
| | | // that.close() |
| | | // } else { |
| | | // that.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // that.confirmLoading = false |
| | | // }) |
| | | // } else { |
| | | // that.$message.warning('请填åå¿
å¡«åæ®µ') |
| | | // that.confirmLoading = false |
| | | // return false |
| | | // } |
| | | // }) |
| | | // }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | |
| | | |
| | | |
| | | { |
| | | title: 'åå
·ç¼å·', |
| | | dataIndex: 'toolCode', |
| | | title: 'åå
·ç¼ç ', |
| | | dataIndex: 'toolId', |
| | | align: 'center' |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: 'å·¥å
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'toolCode' |
| | | dataIndex: 'toolId', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '䏿åç§°', |
| | | align: 'center', |
| | | dataIndex: 'chineseName' |
| | | dataIndex: 'chineseName', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'åå·/å¾å·', |
| | | align: 'center', |
| | | dataIndex: 'toolModel' |
| | | dataIndex: 'toolModel', |
| | | width: 150 |
| | | } |
| | | ], |
| | | selectedRowKeys: [], |
| | |
| | | }, |
| | | { |
| | | title: 'åå
·ç¼å·', |
| | | dataIndex: 'toolCode', |
| | | dataIndex: 'toolId', |
| | | align: 'center', |
| | | width: 150 |
| | | width: 180 |
| | | }, |
| | | |
| | | { |
| | | title: 'å·¥å
፱Ȍ', |
| | | dataIndex: 'applicationType', |
| | | dataIndex: 'applicationType_dictText', |
| | | align: 'center', |
| | | width: 150 |
| | | }, |
| | |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | toolId: data[i].id, |
| | | toolId: data[i].toolId, |
| | | toolCode: data[i].toolCode, |
| | | classifyId: data[i].classifyId, |
| | | applicationType: data[i].applicationType_dictText, |
| | | applicationType_dictText: data[i].applicationType_dictText, |
| | | chineseName: data[i].chineseName, |
| | | availableQuantity:data[i].availableCount, |
| | | toolModel: data[i].toolModel, |
| | | material: data[i].material, |
| | | toolMaterial: data[i].toolMaterial, |