[update] 绑定零部件
This commit is contained in:
@@ -144,6 +144,10 @@ const getSplitStandardList = (params) => getAction('/laws/bindPart/selectStandar
|
||||
const getClauseTree = (params) => getAction('/laws/bindPart/clauseTree', params)
|
||||
// 根据标准拆分id获取条款列表
|
||||
const getClauseListByStandardInfoId = (params) => postAction('/laws/bindPart/selectClause', params)
|
||||
// 绑定零部件-判断分类树下有没有绑定关系
|
||||
const isTreeNodeHaveBind = (params) => getAction('/laws/bindPart/isShowUseBindRelation', params)
|
||||
// 绑定零部件-使用绑定关系
|
||||
const useBindingRelationship = (params) => postAction('/laws/bindPart/useBindRelation', params)
|
||||
|
||||
// ASMS接口管理-新增
|
||||
const addAsmsInterface = (params) => postAction('/docking/asms/api/lawsAsmsOpenApi/add', params)
|
||||
@@ -235,6 +239,8 @@ export {
|
||||
getSplitStandardList,
|
||||
getClauseTree,
|
||||
getClauseListByStandardInfoId,
|
||||
isTreeNodeHaveBind,
|
||||
useBindingRelationship,
|
||||
|
||||
getSSOUserInfo,
|
||||
getTodoSSOUserInfo,
|
||||
|
||||
@@ -103,6 +103,9 @@ module.exports = {
|
||||
clauseNumber: '条款号',
|
||||
bindingTime: '绑定时间',
|
||||
confirmUseBindRelationship: '确认使用绑定关系',
|
||||
isUseBindRelationship: '是否使用绑定关系?'
|
||||
isUseBindRelationship: '是否使用绑定关系?',
|
||||
isBringIn: '是否引入',
|
||||
haveBind: '当前零部件分类结构下已有',
|
||||
isBringInRelation: '绑定标准关联关系,是否引入对应关系?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@
|
||||
|
||||
<div class="table-operator">
|
||||
<!-- 新增 -->
|
||||
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'sys:bindingPart:add'">{{ $t('newlyAdded') }}</a-button>
|
||||
<a-button v-if="isCanAdd" icon="plus" type="primary" @click="handleAdd" v-has="'sys:bindingPart:add'">{{ $t('newlyAdded') }}</a-button>
|
||||
<!-- 批量删除 -->
|
||||
<a-button icon="delete" type="primary" ghost @click="batchDel" v-has="'sys:bindingPart:batchDel'">{{ $t('batchDelete') }}</a-button>
|
||||
<!-- 使用绑定关系 -->
|
||||
<!--<a-button icon="setting" type="primary" ghost @click="useBindingRelationship">{{ $t('system.bindingParts.useBindingRelationship') }}</a-button>-->
|
||||
<a-button v-if="isCanUseBind" icon="setting" type="primary" ghost @click="useBindingRelationship">{{ $t('system.bindingParts.useBindingRelationship') }}</a-button>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
@@ -123,7 +123,7 @@ import JTable from '../../../components/jero/JTable'
|
||||
import BingingPartsModal from './modules/BingingPartsModal'
|
||||
import ClauseModal from './modules/ClauseModal'
|
||||
import { isHasPermission } from '../../../utils/hasPermission'
|
||||
// import { postAction } from '../../../api/manage'
|
||||
import { isTreeNodeHaveBind, useBindingRelationship } from '../../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'BindingParts',
|
||||
@@ -192,41 +192,93 @@ export default {
|
||||
url: {
|
||||
list: '/laws/bindPart/page',
|
||||
deleteBatch: '/laws/bindPart/deleteBatch',
|
||||
delete: '/laws/bindPart/delete',
|
||||
useBindingRelationship: '' // 使用绑定关系
|
||||
}
|
||||
delete: '/laws/bindPart/delete'
|
||||
},
|
||||
disableMixinCreated: true,
|
||||
isCanAdd: false, // 是否可以新增
|
||||
isCanUseBind: false // 是否有使用绑定关系按钮
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// 判断分类树下有没有绑定关系
|
||||
const partNo = this.$route.query.partNo || ''
|
||||
const partName = this.$route.query.partName || ''
|
||||
const partCategoryNum = this.$route.query.partCategoryNum || ''
|
||||
this.judgmentTreeIsHaveBind(partNo, partName, partCategoryNum)
|
||||
// 如果路径中有零部件号,设置查询条件零部件号默认值
|
||||
if (partNo) {
|
||||
this.queryParam.partNo = partNo
|
||||
}
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
isHasPermission,
|
||||
/**
|
||||
* 判断分类树下有没有绑定关系,传入零部件分类内部码
|
||||
* @param partCategoryNum 分类内部码
|
||||
* @param noBindCallback 没有绑定的callback
|
||||
* @param bindCallback 绑定过的callback
|
||||
*/
|
||||
judgmentTreeIsHaveBind (partNo, partName, partCategoryNum) {
|
||||
this.loading = true
|
||||
isTreeNodeHaveBind({ partNo, partName, partCategoryNum }).then(res => {
|
||||
if (res.success) {
|
||||
if (res.result) {
|
||||
// 已有绑定标准关联关系
|
||||
// 在零部件分类下,弹框提示【当前零部件分类结构下已有XXXX绑定标准关联关系,是否引入对应关系?】(XXXX指第一次绑定的零部件名称+编号)
|
||||
this.$confirm({
|
||||
title: this.$t('system.bindingParts.isBringIn'),
|
||||
content: this.$t('system.bindingParts.haveBind') + res.result.bindPartName + res.result.bindPartNumber + this.$t('system.bindingParts.isBringInRelation'),
|
||||
onOk: () => {
|
||||
// 确定引入对应关系,调用使用绑定关系
|
||||
useBindingRelationship().then(res => {
|
||||
if (res.success) {
|
||||
// 重新计算分页问题
|
||||
this.reCalculatePage(this.selectedRowKeys.length)
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
// 不引入对应关系
|
||||
this.isCanAdd = false
|
||||
this.isCanUseBind = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 还没有绑定标准关联关系,可以新增
|
||||
this.isCanAdd = true
|
||||
this.isCanUseBind = true
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 使用绑定关系
|
||||
useBindingRelationship () {
|
||||
// if (this.selectedRowKeys.length <= 0) {
|
||||
// this.$message.warning(this.$t('selectARecord'))
|
||||
// } else {
|
||||
// const ids = this.selectedRowKeys.join(',')
|
||||
// const that = this
|
||||
// this.$confirm({
|
||||
// title: this.$t('system.bindingParts.confirmUseBindRelationship'),
|
||||
// content: this.$t('system.bindingParts.isUseBindRelationship'),
|
||||
// onOk: () => {
|
||||
// that.loading = true
|
||||
// postAction(that.url.useBindingRelationship, { ids: ids }).then((res) => {
|
||||
// if (res.success) {
|
||||
// // 重新计算分页问题
|
||||
// that.reCalculatePage(that.selectedRowKeys.length)
|
||||
// that.$message.success(res.message)
|
||||
// that.loadData()
|
||||
// that.onClearSelected()
|
||||
// } else {
|
||||
// that.$message.warning(res.message)
|
||||
// }
|
||||
// }).finally(() => {
|
||||
// that.loading = false
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
this.$confirm({
|
||||
title: this.$t('system.bindingParts.confirmUseBindRelationship'),
|
||||
content: this.$t('system.bindingParts.isUseBindRelationship'),
|
||||
onOk: () => {
|
||||
this.loading = true
|
||||
useBindingRelationship().then((res) => {
|
||||
if (res.success) {
|
||||
// 重新计算分页问题
|
||||
this.reCalculatePage(this.selectedRowKeys.length)
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击标准编号和标准名称
|
||||
handleGoDetail (record) {
|
||||
|
||||
Reference in New Issue
Block a user