密炼机动作维护、日罐物料对应信息、密炼机条件维护、生产订单、金蝶对接配置
This commit is contained in:
@@ -11,6 +11,7 @@ enum Api {
|
||||
getThirdUserBindByWechat = '/sys/thirdApp/getThirdUserBindByWechat',
|
||||
deleteThirdAccount = '/sys/thirdApp/deleteThirdAccount',
|
||||
deleteThirdAppConfig = '/sys/thirdApp/deleteThirdAppConfig',
|
||||
testKingdeeConnect = '/sys/thirdApp/testKingdeeConnect',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,4 +79,11 @@ export const deleteThirdAppConfig = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteThirdAppConfig, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 测试金蝶连接
|
||||
*/
|
||||
export const testKingdeeConnect = (params) => {
|
||||
return defHttp.get({ url: Api.testKingdeeConnect, params }, { isTransformResponse: false });
|
||||
};
|
||||
@@ -16,31 +16,43 @@ export const thirdAppFormSchema: FormSchema[] = [
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: 'CorpId',
|
||||
label: 'CorpId/服务地址',
|
||||
field: 'corpId',
|
||||
component: 'Input',
|
||||
ifShow: ({ values }) => {
|
||||
return values.thirdType === 'dingtalk';
|
||||
return values.thirdType === 'dingtalk' || values.thirdType === 'kingdee';
|
||||
},
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => ({
|
||||
placeholder: formModel?.thirdType === 'kingdee' ? '请输入金蝶服务地址,例如 https://xxx.xxx.com' : '请输入CorpId',
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'Agentld',
|
||||
label: 'AgentId/账套ID',
|
||||
field: 'agentId',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => ({
|
||||
placeholder: formModel?.thirdType === 'kingdee' ? '请输入账套ID(可选业务标识)' : '请输入AgentId',
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'AppKey',
|
||||
label: 'AppKey/AppId',
|
||||
field: 'clientId',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => ({
|
||||
placeholder: formModel?.thirdType === 'kingdee' ? '请输入金蝶AppId' : '请输入AppKey',
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'AppSecret',
|
||||
field: 'clientSecret',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => ({
|
||||
placeholder: formModel?.thirdType === 'kingdee' ? '请输入金蝶AppSecret' : '请输入AppSecret',
|
||||
}),
|
||||
},{
|
||||
label: '启用',
|
||||
field: 'status',
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<ul class="ding-menu-tab">
|
||||
<li :class="activeKey === 'ding' ? 'active' : ''" @click="dingLiClick('ding')"><a>钉钉集成</a></li>
|
||||
<li :class="activeKey === 'wechat' ? 'active' : ''" @click="dingLiClick('wechat')"><a>企业微信集成</a></li>
|
||||
<li :class="activeKey === 'kingdee' ? 'active' : ''" @click="dingLiClick('kingdee')"><a>金蝶集成</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-show="activeKey === 'ding'" class="base-collapse">
|
||||
@@ -12,6 +13,9 @@
|
||||
<div v-show="activeKey === 'wechat'" class="base-collapse">
|
||||
<ThirdAppWeEnterpriseConfigForm />
|
||||
</div>
|
||||
<div v-show="activeKey === 'kingdee'" class="base-collapse">
|
||||
<ThirdAppKingdeeConfigForm />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -19,6 +23,7 @@
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import ThirdAppDingTalkConfigForm from './ThirdAppDingTalkConfigForm.vue';
|
||||
import ThirdAppWeEnterpriseConfigForm from './ThirdAppWeEnterpriseConfigForm.vue';
|
||||
import ThirdAppKingdeeConfigForm from './ThirdAppKingdeeConfigForm.vue';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -26,6 +31,7 @@
|
||||
components: {
|
||||
ThirdAppDingTalkConfigForm,
|
||||
ThirdAppWeEnterpriseConfigForm,
|
||||
ThirdAppKingdeeConfigForm,
|
||||
},
|
||||
setup() {
|
||||
const { prefixCls } = useDesign('j-dd-container');
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
setModalProps({ confirmLoading: true });
|
||||
if (data.thirdType == 'dingtalk') {
|
||||
title.value = '钉钉配置';
|
||||
} else if (data.thirdType == 'kingdee') {
|
||||
title.value = '金蝶配置';
|
||||
} else {
|
||||
title.value = '企业微信配置';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<div class="base-collapse">
|
||||
<div class="header"> 金蝶集成 </div>
|
||||
<a-collapse expand-icon-position="right" :bordered="false">
|
||||
<a-collapse-panel key="1">
|
||||
<template #header>
|
||||
<div style="font-size: 16px"> 1.配置对接信息</div>
|
||||
</template>
|
||||
<div class="base-desc">先配置金蝶服务地址、AppId、AppSecret,保存后可进行连通性测试。</div>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
<div class="sync-padding">
|
||||
<a-collapse expand-icon-position="right" :bordered="false">
|
||||
<a-collapse-panel key="2">
|
||||
<template #header>
|
||||
<div style="width: 100%; justify-content: space-between; display: flex">
|
||||
<div style="font-size: 16px"> 2.配置录入及解绑</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="flex-flow">
|
||||
<div class="base-title">服务地址</div>
|
||||
<div class="base-message">
|
||||
<a-input-password v-model:value="appConfigData.corpId" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-flow">
|
||||
<div class="base-title">账套ID</div>
|
||||
<div class="base-message">
|
||||
<a-input-password v-model:value="appConfigData.agentId" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-flow">
|
||||
<div class="base-title">AppId</div>
|
||||
<div class="base-message">
|
||||
<a-input-password v-model:value="appConfigData.clientId" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-flow">
|
||||
<div class="base-title">AppSecret</div>
|
||||
<div class="base-message">
|
||||
<a-input-password v-model:value="appConfigData.clientSecret" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px; width: 100%; text-align: right">
|
||||
<a-button @click="kingdeeEditClick">编辑</a-button>
|
||||
<a-button @click="testConnectClick" style="margin-left: 10px">连接测试</a-button>
|
||||
<a-button v-if="appConfigData.id" @click="cancelBindClick" danger style="margin-left: 10px">取消绑定</a-button>
|
||||
</div>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ThirdAppConfigModal @register="registerAppConfigModal" @success="handleSuccess" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from 'vue';
|
||||
import { deleteThirdAppConfig, getThirdConfigByTenantId, testKingdeeConnect } from './ThirdApp.api';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import ThirdAppConfigModal from './ThirdAppConfigModal.vue';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { getTenantId } from '/@/utils/auth';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ThirdAppKingdeeConfigForm',
|
||||
components: { ThirdAppConfigModal },
|
||||
setup() {
|
||||
const { createMessage } = useMessage();
|
||||
const appConfigData = ref<any>({ corpId: '', agentId: '', clientId: '', clientSecret: '' });
|
||||
const [registerAppConfigModal, { openModal }] = useModal();
|
||||
|
||||
async function kingdeeEditClick() {
|
||||
const tenantId = getTenantId();
|
||||
openModal(true, { tenantId, thirdType: 'kingdee' });
|
||||
}
|
||||
|
||||
async function initThirdAppConfigData(params) {
|
||||
const values = await getThirdConfigByTenantId(params);
|
||||
appConfigData.value = values || '';
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
const tenantId = getTenantId();
|
||||
initThirdAppConfigData({ tenantId, thirdType: 'kingdee' });
|
||||
}
|
||||
|
||||
async function testConnectClick() {
|
||||
const tenantId = getTenantId();
|
||||
const res = await testKingdeeConnect({ tenantId });
|
||||
if (res.success) {
|
||||
createMessage.success(res.message || '连接成功');
|
||||
} else {
|
||||
createMessage.warning(res.message || '连接失败');
|
||||
}
|
||||
}
|
||||
|
||||
function cancelBindClick() {
|
||||
if (!appConfigData.value.id) {
|
||||
createMessage.warning('请先绑定金蝶应用!');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '取消绑定',
|
||||
content: '是否要解除当前组织的金蝶配置绑定?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => deleteThirdAppConfig({ id: appConfigData.value.id }, handleSuccess),
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const tenantId = getTenantId();
|
||||
initThirdAppConfigData({ tenantId, thirdType: 'kingdee' });
|
||||
});
|
||||
|
||||
return {
|
||||
appConfigData,
|
||||
registerAppConfigModal,
|
||||
kingdeeEditClick,
|
||||
testConnectClick,
|
||||
cancelBindClick,
|
||||
handleSuccess,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.header {
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
height: 50px;
|
||||
justify-content: space-between;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
.flex-flow {
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.sync-padding {
|
||||
padding: 12px 0 16px;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
.base-collapse {
|
||||
margin-top: 20px;
|
||||
padding: 0 24px;
|
||||
font-size: 20px;
|
||||
|
||||
.base-desc {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.base-title {
|
||||
width: 100px;
|
||||
text-align: left;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
.base-message {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
:deep(.ant-collapse-header) {
|
||||
padding: 12px 0 16px;
|
||||
}
|
||||
|
||||
:deep(.ant-collapse-content-box) {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user