|
@@ -256,7 +256,7 @@ import {
|
|
|
setPosRange,
|
|
|
} from 'js-fast-way'
|
|
|
import ossApi from '~api/oss'
|
|
|
-import { HcUploadFileApi } from 'hc-vue3-ui'
|
|
|
+import { HcDelMsg, HcUploadFileApi } from 'hc-vue3-ui'
|
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
|
|
|
|
//初始
|
|
@@ -853,24 +853,54 @@ const delClick = async ({ pKeyId }, index) => {
|
|
|
const pkeyIds = getValString(pKeyId)
|
|
|
if (pkeyIds) {
|
|
|
delClickLoading.value = true
|
|
|
- const { error, code, msg } = await dataApi.removeBussTabInfo({
|
|
|
+ const { error, code, msg, data } = await dataApi.removeBussTabCheck({
|
|
|
pKeyId: pkeyIds,
|
|
|
})
|
|
|
- if (!error && code === 200) {
|
|
|
- window?.$message?.success('操作成功')
|
|
|
- listDatas.value.splice(index, 1)
|
|
|
- formData.value.splice(index, 1)
|
|
|
- chageOrinData()
|
|
|
+ if (error || code !== 200) {
|
|
|
+ window.$message.error(msg)
|
|
|
delClickLoading.value = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = getObjValue(data)
|
|
|
+ if (isNullES(res.pkeyId)) {
|
|
|
+ window?.$message?.warning('pkeyId为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.isForceDelete) {
|
|
|
+ //isForceDelete 为ture直接调 为false就提示
|
|
|
+ await removeBussTabForceApi(res.pkeyId, index)
|
|
|
} else {
|
|
|
- window.$message.error(msg)
|
|
|
delClickLoading.value = false
|
|
|
+ HcDelMsg({
|
|
|
+ text: res.msg ?? '确认要删除吗?',
|
|
|
+ }, async (resolve) => {
|
|
|
+ await removeBussTabForceApi(res.pkeyId, index)
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
window?.$message?.warning('pkeyId为空')
|
|
|
delClickLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//确定删除
|
|
|
+const removeBussTabForceApi = async (pkeyIds, index) => {
|
|
|
+ const { error, code, msg } = await dataApi.removeBussTabForce({
|
|
|
+ pKeyId: pkeyIds,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('操作成功')
|
|
|
+ listDatas.value.splice(index, 1)
|
|
|
+ formData.value.splice(index, 1)
|
|
|
+ chageOrinData()
|
|
|
+ delClickLoading.value = false
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg)
|
|
|
+ delClickLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const copyClickLoading = ref(false)
|
|
|
//复制本表
|
|
|
const copyClick = async (item, index) => {
|