1、产品/部件/零件的新增与编辑以及根据层级查询对应文档功能已完成后端联调
2、产品结构树新增节点展开记忆功能方便新增节点后查看
| | |
| | | import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | getProductStructureTreeApi: () => getAction('/nc/product/load/tree') |
| | | //-------------------------产åç»ææ ------------------------------------------------ |
| | | getProductStructureTreeApi: () => getAction('/nc/product/load/tree'), |
| | | |
| | | } |
| | |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false |
| | | visible: false, |
| | | isAddNextLevel: false // æ¯å¦ä¸ºæ·»å ä¸çº§ï¼ä½ä¸ºæ èç¹æ¯å¦å±å¼ç夿 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | /** |
| | | * æ·»å å½å产åé¨ä»¶ |
| | | * @param modalTitle |
| | | */ |
| | | handleProductAddChild(modalTitle) { |
| | | this.title = modalTitle |
| | | handleProductAddChild() { |
| | | this.visible = true |
| | | this.isAddNextLevel = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | this.$refs.realForm.add({ productId: this.currentTreeNodeInfo.id }) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ·»å å½åé¨ä»¶çåé¨ä»¶ |
| | | * @param modalTitle |
| | | */ |
| | | handleComponentAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | handleComponentAdd() { |
| | | this.visible = true |
| | | this.isAddNextLevel = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | this.$refs.realForm.add({ |
| | | productId: this.currentTreeNodeInfo.parentId, |
| | | parentId: this.currentTreeNodeInfo.id |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | handleComponentEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | /** |
| | | * ç¼è¾é¨ä»¶ä¿¡æ¯ |
| | | */ |
| | | handleComponentEdit() { |
| | | this.visible = true |
| | | this.isAddNextLevel = false |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity }) |
| | | }) |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.$emit('submitSuccess', this.isAddNextLevel) |
| | | this.visible = false |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | console.log('methodName', methodName) |
| | | console.log('modalTitle', modalTitle) |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | add: '/nc/component/add', |
| | | edit: '/nc/component/edit' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | add(params) { |
| | | this.edit({ ...this.modelDefault, ...params }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | httpUrl += this.url.edit + `/${this.model.id}` |
| | | method = 'put' |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | |
| | | |
| | | <a-col :md="11" :sm="11"> |
| | | <a-form-item label="ä¸ä¼ æ¶é´"> |
| | | <a-range-picker placeholder="è¯·éæ©ä¸ä¼ æ¶é´" v-model="queryParam.collectTime"></a-range-picker> |
| | | <a-range-picker v-model="queryParam.collectTime"></a-range-picker> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | |
| | | export default { |
| | | name: 'NcDocumentAssignModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | |
| | | |
| | | <DocumentModal ref="modalForm" @ok="modalFormOk"/> |
| | | |
| | | <NcDocumentAssignModal ref="documentAssignModalRef"/> |
| | | <NcDocumentAssignModal :size="size" ref="documentAssignModalRef"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from './DocumentModal' |
| | | import NcDocumentAssignModal from './NcDocumentAssignModal' |
| | |
| | | components: { NcDocumentAssignModal, DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center' }, |
| | | { title: 'ä¸ä¼ æ¶é´', dataIndex: 'createTime', align: 'center' } |
| | | ], |
| | | dataSource: [ |
| | | { |
| | | 'docId': '1876099281127645185', |
| | | 'docName': 'avatar2.jpg', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'jpg', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876099281458995202', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 10:51:40', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114720452943873', |
| | | 'docName': 'color.less', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'less', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114720582967297', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:01', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114736512933889', |
| | | 'docName': 'index.html', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'html', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114736705871874', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:05', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114746621206529', |
| | | 'docName': 'logo.png', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'png', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114746818338818', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:07', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114758923100161', |
| | | 'docName': 'lxzn.png', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'png', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114759111843842', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:10', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114776241381377', |
| | | 'docName': 'v2.js', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'js', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114776438513666', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:14', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | url: { |
| | | list: '' |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = this.currentTreeNodeInfo.id |
| | | params.attributionType = this.currentTreeNodeInfo.type |
| | | params.docClassCode = 'NC' |
| | | if (!params) return false |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.page.records |
| | | if (res.page.total) { |
| | | this.ipagination.total = res.page.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from './DocumentModal' |
| | | |
| | |
| | | components: { DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center' }, |
| | | { title: 'ä¸ä¼ æ¶é´', dataIndex: 'createTime', align: 'center' } |
| | | ], |
| | | dataSource: [ |
| | | { |
| | | 'docId': '1868943615190044674', |
| | | 'docName': 'æµè¯.nc', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'nc', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868943615454285825', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 16:57:36', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1868946627732103170', |
| | | 'docName': 'nacos-config.sh', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'sh', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868946628004732930', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 17:09:34', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1868947564353740801', |
| | | 'docName': 'dir.sql', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'sql', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868947564487958530', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 17:13:17', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | url: { |
| | | list: '' |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = this.currentTreeNodeInfo.id |
| | | params.attributionType = this.currentTreeNodeInfo.type |
| | | params.docClassCode = 'OTHER' |
| | | if (!params) return false |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.page.records |
| | | if (res.page.total) { |
| | | this.ipagination.total = res.page.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false |
| | | visible: false, |
| | | isAddNextLevel: false // æ¯å¦ä¸ºæ·»å ä¸çº§ï¼ä½ä¸ºæ èç¹æ¯å¦å±å¼ç夿 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ·»å å½åé¨ä»¶é¶ä»¶ |
| | | * @param modalTitle |
| | | * æ·»å é¨ä»¶ä¸çº§é¶ä»¶ |
| | | */ |
| | | handleComponentAddChild(modalTitle) { |
| | | this.title = modalTitle |
| | | handleComponentAddChild() { |
| | | this.visible = true |
| | | this.isAddNextLevel = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | this.$refs.realForm.add({ |
| | | productId: this.currentTreeNodeInfo.rfield, |
| | | componentId: this.currentTreeNodeInfo.id |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ·»å é¶ä»¶ |
| | | * @param modalTitle |
| | | * ç¹å»é¶ä»¶å±çº§æ·»å å级é¶ä»¶ |
| | | */ |
| | | handlePartsAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | handlePartsAdd() { |
| | | this.visible = true |
| | | this.isAddNextLevel = false |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | this.$refs.realForm.add({ |
| | | productId: this.currentTreeNodeInfo.rfield, |
| | | componentId: this.currentTreeNodeInfo.parentId |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¼è¾é¶ä»¶ä¿¡æ¯ |
| | | * @param modalTitle |
| | | */ |
| | | handlePartsEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | handlePartsEdit() { |
| | | this.visible = true |
| | | this.isAddNextLevel = false |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity }) |
| | | }) |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.$emit('submitSuccess', this.isAddNextLevel) |
| | | this.visible = false |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | if (this[methodName]) { |
| | | this[methodName](modalTitle) |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | add: '/nc/parts/add', |
| | | edit: '/nc/parts/edit' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | add(params) { |
| | | this.edit({ ...this.modelDefault, ...params }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | httpUrl += this.url.edit + `/${this.model.id}` |
| | | method = 'put' |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.$emit('submitSuccess') |
| | | this.visible = false |
| | | }, |
| | | |
| | |
| | | return { |
| | | title: '', |
| | | width: 500, |
| | | visible: false |
| | | visible: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleProductAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | /** |
| | | * æ·»å 产å |
| | | */ |
| | | handleProductAdd() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | handleProductEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | |
| | | /** |
| | | * ç¼è¾äº§åä¿¡æ¯ |
| | | */ |
| | | handleProductEdit() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity }) |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.$emit('submitSuccess') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | if (this[methodName]) { |
| | | this[methodName](modalTitle) |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductModalForm', |
| | |
| | | ], |
| | | productNo: [ |
| | | { required: true, message: '请è¾å
¥äº§å代å·!' } |
| | | ], |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | add: '/nc/product/add', |
| | | edit: '/nc/product/edit' |
| | | } |
| | | } |
| | | }, |
| | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | method = 'put' |
| | | httpUrl += this.url.edit + `/${this.model.id}` |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | |
| | | <template> |
| | | <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" |
| | | <a-tabs v-model="activeTabKey" @change="handleTabChange" @contextmenu.native="e=>e.preventDefault()" |
| | | v-if="Object.keys(currentTreeNodeInfo).length!==0"> |
| | | <a-tab-pane :key="1" tab="NCææ¡£" v-if="currentTreeNodeInfo.type!==1"> |
| | | <NcDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="å
¶ä»ææ¡£"> |
| | | <OtherDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/> |
| | |
| | | components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, |
| | | data() { |
| | | return { |
| | | activeTabKey: '1', |
| | | activeTabKey: null, |
| | | hasLoadingDataTabKey: [], |
| | | tableContainerSize: 'small', |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {} |
| | |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | }, |
| | | watch: { |
| | | activeTabKey: { |
| | | handler(value) { |
| | | // tab忢æ¶å è½½å¯¹åºææ¡£å表ï¼å½åæ èç¹ä¸å·²ç»å è½½è¿çææ¡£å表ä¸åéå¤å è½½ |
| | | if (!this.hasLoadingDataTabKey.includes(value)) { |
| | | if (value === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1)) |
| | | else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1)) |
| | | this.hasLoadingDataTabKey.push(value) |
| | | } |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | /** |
| | |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | if (treeNodeInfo.type !== 1) this.activeTabKey = 1 |
| | | else this.activeTabKey = 2 |
| | | // æ¸
空ä¸ä¸èç¹å·²ç»å è½½è¿å¾ææ¡£å表tabKey |
| | | this.hasLoadingDataTabKey = [] |
| | | if (treeNodeInfo.type !== 1) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1)) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1)) |
| | | } |
| | | this.hasLoadingDataTabKey.push(this.activeTabKey) |
| | | }, |
| | | |
| | | handleTabChange(activeTabKey) { |
| | | // tab忢æ¶å è½½å¯¹åºææ¡£å表ï¼å½åæ èç¹ä¸å·²ç»å è½½è¿çææ¡£å表ä¸åéå¤å è½½ |
| | | if (!this.hasLoadingDataTabKey.includes(activeTabKey)) { |
| | | if (activeTabKey === 1) this.$nextTick(() => this.$refs.ncDocumentTableListRef.loadData(1)) |
| | | else this.$nextTick(() => this.$refs.otherDocumentTableListRef.loadData(1)) |
| | | this.hasLoadingDataTabKey.push(activeTabKey) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | <a-icon type="bars"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | <a-button type="primary" @click="$refs.productModalFormRef.handleProductAdd('æ·»å 产å')"> |
| | | <a-button type="primary" |
| | | @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'æ·»å 产å',methodName:'handleProductAdd'})"> |
| | | <a-icon type="plus"></a-icon> |
| | | 产å |
| | | </a-button> |
| | |
| | | </a-spin> |
| | | |
| | | <!--产åå¼¹çª--> |
| | | <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected"/> |
| | | <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected" |
| | | @submitSuccess="queryTreeData"/> |
| | | <!--é¨ä»¶å¼¹çª--> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected"/> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--é¶ä»¶å¼¹çª--> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected"/> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <!--å·¥åºå¼¹çª--> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected"/> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import { deleteAction } from '@/api/manage' |
| | | import ProductStructureTreeContextMenu from './modules/ProductStructureTree/ProductStructureTreeContextMenu' |
| | | import ProductModal from '../base/modules/ProductStructure/Product/ProductModal' |
| | | import ComponentModal from '../base/modules/ProductStructure/Component/ComponentModal' |
| | |
| | | currentSelected: {}, |
| | | rightClickSelected: {}, |
| | | url: { |
| | | delete: '' |
| | | delete: '/nc/product/delete' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.treeDataSource = res.list |
| | | this.generateList(this.treeDataSource) |
| | | // this.expandedKeys = this.allTreeKeys |
| | | this.expandedKeys = [this.treeDataSource[0].id] |
| | | console.log('treeDataSource', this.treeDataSource) |
| | | if (this.expandedKeys.length === 0) this.expandedKeys = [this.treeDataSource[0].id] |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | } |
| | |
| | | return |
| | | } |
| | | const that = this |
| | | // deleteAction(that.url.delete, { id: this.rightClickSelected.id }) |
| | | // .then((res) => { |
| | | // if (res.success) { |
| | | // that.queryTreeData() |
| | | // that.$notification.success({ |
| | | // message: 'æ¶æ¯', |
| | | // description: res.message |
| | | // }) |
| | | // } else { |
| | | // that.$notification.warning({ |
| | | // message: 'æ¶æ¯', |
| | | // description: res.message |
| | | // }) |
| | | // } |
| | | // }) |
| | | deleteAction(that.url.delete, { id: this.rightClickSelected.id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.queryTreeData() |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * èªå¨å±å¼æ·»å ä¸çº§èç¹çç¶èç¹ |
| | | */ |
| | | modalFormSubmitSuccess(isAddNextLevel) { |
| | | // 夿æ¯å¦ä¸ºæ·»å ä¸çº§å¹¶ä¸å¤æç¶èç¹æ¯å¦å±å¼ |
| | | if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id) |
| | | this.queryTreeData() |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |