[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)
|
const getClauseTree = (params) => getAction('/laws/bindPart/clauseTree', params)
|
||||||
// 根据标准拆分id获取条款列表
|
// 根据标准拆分id获取条款列表
|
||||||
const getClauseListByStandardInfoId = (params) => postAction('/laws/bindPart/selectClause', params)
|
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接口管理-新增
|
// ASMS接口管理-新增
|
||||||
const addAsmsInterface = (params) => postAction('/docking/asms/api/lawsAsmsOpenApi/add', params)
|
const addAsmsInterface = (params) => postAction('/docking/asms/api/lawsAsmsOpenApi/add', params)
|
||||||
@@ -235,6 +239,8 @@ export {
|
|||||||
getSplitStandardList,
|
getSplitStandardList,
|
||||||
getClauseTree,
|
getClauseTree,
|
||||||
getClauseListByStandardInfoId,
|
getClauseListByStandardInfoId,
|
||||||
|
isTreeNodeHaveBind,
|
||||||
|
useBindingRelationship,
|
||||||
|
|
||||||
getSSOUserInfo,
|
getSSOUserInfo,
|
||||||
getTodoSSOUserInfo,
|
getTodoSSOUserInfo,
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ module.exports = {
|
|||||||
clauseNumber: '条款号',
|
clauseNumber: '条款号',
|
||||||
bindingTime: '绑定时间',
|
bindingTime: '绑定时间',
|
||||||
confirmUseBindRelationship: '确认使用绑定关系',
|
confirmUseBindRelationship: '确认使用绑定关系',
|
||||||
isUseBindRelationship: '是否使用绑定关系?'
|
isUseBindRelationship: '是否使用绑定关系?',
|
||||||
|
isBringIn: '是否引入',
|
||||||
|
haveBind: '当前零部件分类结构下已有',
|
||||||
|
isBringInRelation: '绑定标准关联关系,是否引入对应关系?'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,11 +63,11 @@
|
|||||||
|
|
||||||
<div class="table-operator">
|
<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="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>
|
</div>
|
||||||
|
|
||||||
<!-- table区域-begin -->
|
<!-- table区域-begin -->
|
||||||
@@ -123,7 +123,7 @@ import JTable from '../../../components/jero/JTable'
|
|||||||
import BingingPartsModal from './modules/BingingPartsModal'
|
import BingingPartsModal from './modules/BingingPartsModal'
|
||||||
import ClauseModal from './modules/ClauseModal'
|
import ClauseModal from './modules/ClauseModal'
|
||||||
import { isHasPermission } from '../../../utils/hasPermission'
|
import { isHasPermission } from '../../../utils/hasPermission'
|
||||||
// import { postAction } from '../../../api/manage'
|
import { isTreeNodeHaveBind, useBindingRelationship } from '../../../api/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BindingParts',
|
name: 'BindingParts',
|
||||||
@@ -192,41 +192,93 @@ export default {
|
|||||||
url: {
|
url: {
|
||||||
list: '/laws/bindPart/page',
|
list: '/laws/bindPart/page',
|
||||||
deleteBatch: '/laws/bindPart/deleteBatch',
|
deleteBatch: '/laws/bindPart/deleteBatch',
|
||||||
delete: '/laws/bindPart/delete',
|
delete: '/laws/bindPart/delete'
|
||||||
useBindingRelationship: '' // 使用绑定关系
|
},
|
||||||
}
|
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: {
|
methods: {
|
||||||
isHasPermission,
|
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 () {
|
useBindingRelationship () {
|
||||||
// if (this.selectedRowKeys.length <= 0) {
|
this.$confirm({
|
||||||
// this.$message.warning(this.$t('selectARecord'))
|
title: this.$t('system.bindingParts.confirmUseBindRelationship'),
|
||||||
// } else {
|
content: this.$t('system.bindingParts.isUseBindRelationship'),
|
||||||
// const ids = this.selectedRowKeys.join(',')
|
onOk: () => {
|
||||||
// const that = this
|
this.loading = true
|
||||||
// this.$confirm({
|
useBindingRelationship().then((res) => {
|
||||||
// title: this.$t('system.bindingParts.confirmUseBindRelationship'),
|
if (res.success) {
|
||||||
// content: this.$t('system.bindingParts.isUseBindRelationship'),
|
// 重新计算分页问题
|
||||||
// onOk: () => {
|
this.reCalculatePage(this.selectedRowKeys.length)
|
||||||
// that.loading = true
|
this.$message.success(res.message)
|
||||||
// postAction(that.url.useBindingRelationship, { ids: ids }).then((res) => {
|
this.loadData()
|
||||||
// if (res.success) {
|
} else {
|
||||||
// // 重新计算分页问题
|
this.$message.warning(res.message)
|
||||||
// that.reCalculatePage(that.selectedRowKeys.length)
|
}
|
||||||
// that.$message.success(res.message)
|
}).finally(() => {
|
||||||
// that.loadData()
|
this.loading = false
|
||||||
// that.onClearSelected()
|
})
|
||||||
// } else {
|
}
|
||||||
// that.$message.warning(res.message)
|
})
|
||||||
// }
|
|
||||||
// }).finally(() => {
|
|
||||||
// that.loading = false
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
// 点击标准编号和标准名称
|
// 点击标准编号和标准名称
|
||||||
handleGoDetail (record) {
|
handleGoDetail (record) {
|
||||||
|
|||||||
Reference in New Issue
Block a user