|
@@ -106,7 +106,7 @@
|
|
|
<script setup>
|
|
|
import { nextTick, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
-import { getStore, setStore } from 'hc-vue3-ui'
|
|
|
+import { HcFirmMsg, getStore, setStore } from 'hc-vue3-ui'
|
|
|
import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
import wbsTreeApi from '~api/wbs/tree'
|
|
@@ -290,9 +290,46 @@ const treeMenuClick = async ({ key, node, data }) => {
|
|
|
await nextTick()
|
|
|
isTreeNodeEditShow.value = true
|
|
|
} else if (key === 'sync1') {
|
|
|
+ const { primaryKeyId, pKeyId } = data
|
|
|
+ const pid = primaryKeyId ? primaryKeyId : pKeyId
|
|
|
+ if (isNullES(pid)) {
|
|
|
+ window.$message.warning('参数异常,请稍后重试')
|
|
|
+ return
|
|
|
+ }
|
|
|
//同步新增元素表单
|
|
|
+ await HcFirmMsg({
|
|
|
+ text: `是否同步节点【${data.title}】?`,
|
|
|
+ loadingText: '数据同步中...',
|
|
|
+ }, (resolve) => {
|
|
|
+ const { error, code, msg } = mainApi.syncNodeTable(pid)
|
|
|
+ resolve()
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('同步成功')
|
|
|
+ getInfoTableData()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '同步失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
} else if (key === 'sync3') {
|
|
|
+ const { id } = projectInfo.value
|
|
|
+ if (isNullES(id)) {
|
|
|
+ window.$message.warning('参数异常,请稍后重试')
|
|
|
+ return
|
|
|
+ }
|
|
|
//同步元素表单排序到合同段
|
|
|
+ await HcFirmMsg({
|
|
|
+ text: '同步元素表单排序到合同段?',
|
|
|
+ loadingText: '数据同步中...',
|
|
|
+ }, (resolve) => {
|
|
|
+ const { error, code, msg } = mainApi.syncContractTabSort(id)
|
|
|
+ resolve()
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('同步成功')
|
|
|
+ getInfoTableData()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '同步失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
} else if (key === 'sync2') {
|
|
|
//同步节点基础信息及表单URL
|
|
|
} else if (key === 'sort') {
|