|
@@ -16,6 +16,8 @@
|
|
|
</div>
|
|
|
<div class="bottomButton">
|
|
|
<van-button type="warning" class="w-full block" @click="showDialogCli()">转移联系人</van-button>
|
|
|
+ <van-button type="default" class="w-full block" v-permission="[routingInformation.jurisdiction.edit]" @click="jumpEdit()">编辑联系人</van-button>
|
|
|
+ <van-button type="danger" class="w-full block" v-permission="[routingInformation.jurisdiction.delete]" @click="deleteRow()">删除联系人</van-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- 转移弹窗 -->
|
|
@@ -38,13 +40,18 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref } from 'vue';
|
|
|
+import { showConfirmDialog } from 'vant';
|
|
|
import { useLifecycle } from '@hooks/useCommon.js';
|
|
|
import { TRANSFER_CONTACT_PERSON } from '@hooks/useApi'
|
|
|
import requests from "@common/requests";
|
|
|
import useShowToast from '@hooks/useToast'
|
|
|
import useInfoStore from '@store/useInfoStore'
|
|
|
import useRouterStore from "@store/useRouterStore.js";
|
|
|
+import { routingInfos } from "@utility/generalVariables"
|
|
|
+import { resetListData, getListFieldKey } from '@components/common/formForm/formCorrespondenceProcessing'
|
|
|
+import useFixedData from "@store/useFixedData.js"
|
|
|
|
|
|
+const fixedData = useFixedData()
|
|
|
const router = useRouterStore()
|
|
|
const userInfo = useInfoStore()
|
|
|
const { toastSuccess, toastFail, toastText } = useShowToast()
|
|
@@ -56,10 +63,52 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const routingInformation = routingInfos['contacts']
|
|
|
const showDialog = ref(false);
|
|
|
const showSelect = ref(false);
|
|
|
const dialogSelection = ref({});
|
|
|
|
|
|
+function deleteRow() {
|
|
|
+ const { name = '', searchFiled = {}, deteleFiled = '' } = routingInformation
|
|
|
+ const row = props.info
|
|
|
+ const foemVal = { [routingInformation.key == 'tasks' ? 'taskIds' : 'ids']: row.id }
|
|
|
+ showConfirmDialog({
|
|
|
+ title: `删除${name}`,
|
|
|
+ message: `确定删除【${row[searchFiled?.search]}】${name}吗?`,
|
|
|
+ }).then(() => {
|
|
|
+ requests.post(deteleFiled, { ...foemVal }).then((res) => {
|
|
|
+ toastSuccess('删除成功')
|
|
|
+ router.navigateBack({
|
|
|
+ success: () => {
|
|
|
+ router.emit('moduleListDetailParameter', {
|
|
|
+ row: JSON.stringify(routingInformation)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ toastFail(err.msg ? err.msg : '删除失败')
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function jumpEdit() {
|
|
|
+ const formJson = fixedData.formJson[routingInformation.key] || []
|
|
|
+ const formList = resetListData(formJson?.list)
|
|
|
+ const filedObj = getListFieldKey(formList, props.info)
|
|
|
+ const formVal = { ...filedObj, id: props.info.id }
|
|
|
+
|
|
|
+ router.navigateTo({
|
|
|
+ pathName: 'addEditor',
|
|
|
+ success: () => {
|
|
|
+ router.emit('addEditorParameter', {
|
|
|
+ routerInfo: JSON.stringify(routingInformation),
|
|
|
+ filedValue: JSON.stringify(formVal)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
function confirmTransfer() {
|
|
|
if (!dialogSelection.value.label) {
|
|
|
return toastText('请选择要转移的人员')
|