服务指令-指令库

This commit is contained in:
1378012178@qq.com 2025-08-04 14:50:43 +08:00
parent c184017f4f
commit 010a37d26b
16 changed files with 1288 additions and 151 deletions

View File

@ -15,10 +15,11 @@ enum Api {
getDictItems = '/sys/dict/getDictItems/',
getTableList = '/sys/user/queryUserComponentData',
getCategoryData = '/sys/category/loadAllData',
getOrgInfo = '/api/common/getOrgInfo',//根据机构编码获取机构信息
getOrgInfo = '/api/common/getOrgInfo', //根据机构编码获取机构信息
changeDirectiveMain = '/sys/sysDepart/changeDirectiveMain', //变更指令库
getDirectiveMain = '/sys/sysDepart/getDirectiveMain', //查询当前指令库机构信息
}
/**
*
*/
@ -165,3 +166,19 @@ export const uploadMyFile = (url, data) => {
export const getOrgInfo = (params) => {
return defHttp.get({ url: Api.getOrgInfo, params });
};
/**
*
* @param params
*/
export const changeDirectiveMain = (orgCode) => {
return defHttp.post({ url: `${Api.changeDirectiveMain}?orgCode=${encodeURIComponent(orgCode)}` });
};
/**
*
* @param params
*/
export const getDirectiveMain = () => {
return defHttp.get({ url: Api.getDirectiveMain });
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -31,28 +31,36 @@
<!-- 业务字段列 -->
<!-- 业务字段列 -->
<template v-if="column.dataIndex === 'dataStatus'">
<span v-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '200'"
class="status-success">
<strong>成功</strong>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'data')" class="status-error">
<strong>失败</strong>
</span>
<span v-else>-</span>
</template>
<template v-if="column.dataIndex === 'dataStatus'">
<span v-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '100'"
class="status-loading">
<span>同步中</span>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'data')?.status === '200'"
class="status-success">
<strong>成功</strong>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'data')" class="status-error">
<strong>失败</strong>
</span>
<span v-else>-</span>
</template>
<!-- 指令资源列 -->
<template v-if="column.dataIndex === 'fileStatus'">
<span v-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '200'"
class="status-success">
<strong>成功</strong>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'file')" class="status-error">
<strong>失败</strong>
</span>
<span v-else>-</span>
</template>
<!-- 指令资源列 -->
<template v-if="column.dataIndex === 'fileStatus'">
<span v-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '100'"
class="status-loading">
<span>同步中</span>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'file')?.status === '200'"
class="status-success">
<strong>成功</strong>
</span>
<span v-else-if="record.asyncStatusList?.find(item => item.code === 'file')" class="status-error">
<strong>失败</strong>
</span>
<span v-else>-</span>
</template>
</template>
</BasicTable>
<!-- 表单区域 -->
@ -60,124 +68,124 @@
</div>
</template>
<script lang="ts" name="asyncmain-asyncMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { asyncMaincolumns } from './AsyncMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AsyncMain.api';
import AsyncMainModal from './components/AsyncMainModal.vue'
<script lang="ts" name="asyncmain-asyncMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { asyncMaincolumns } from './AsyncMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AsyncMain.api';
import AsyncMainModal from './components/AsyncMainModal.vue'
const props = defineProps({
orgCode: 'orgCode',
type: '',
});
const queryParam = reactive<any>({});
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '数据同步主表',
api: list,
columns: asyncMaincolumns,
canResize: false,
useSearchForm: false,
showTableSetting: false,
showActionColumn: false,
beforeFetch: async (params) => {
queryParam.type = props.type
queryParam.orgCode = props.orgCode
return Object.assign(params, queryParam);
},
const props = defineProps({
orgCode: 'orgCode',
type: '',
});
const queryParam = reactive<any>({});
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '数据同步主表',
api: list,
columns: asyncMaincolumns,
canResize: false,
useSearchForm: false,
showTableSetting: false,
showActionColumn: false,
beforeFetch: async (params) => {
queryParam.type = props.type
queryParam.orgCode = props.orgCode
return Object.assign(params, queryParam);
},
exportConfig: {
name: "数据同步主表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
},
exportConfig: {
name: "数据同步主表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
defineExpose({
searchQuery
});
defineExpose({
searchQuery
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
:deep(.ant-table-title) {
display: none !important;
.query-group-cust {
min-width: 100px !important;
}
.status-success {
color: #27ae60; // 绿
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
:deep(.ant-table-title) {
display: none !important;
}
.status-success {
color: #27ae60;
font-weight: 600;
}
.status-error {
color: #e74c3c; //
color: #e74c3c;
font-weight: 600;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/canadddirective/canAddDirective/list',
save='/canadddirective/canAddDirective/add',
edit='/canadddirective/canAddDirective/edit',
deleteOne = '/canadddirective/canAddDirective/delete',
deleteBatch = '/canadddirective/canAddDirective/deleteBatch',
importExcel = '/canadddirective/canAddDirective/importExcel',
exportXls = '/canadddirective/canAddDirective/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,54 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '分类标签',
align: "center",
dataIndex: 'instructionTag'
},
{
title: '服务类别',
align: "center",
dataIndex: 'category'
},
{
title: '服务类型',
align: "center",
dataIndex: 'type'
},
{
title: '服务指令',
align: "center",
dataIndex: 'directiveName'
},
{
title: '周期类型 1日常护理 2周期护理 3即时护理',
align: "center",
dataIndex: 'cycleType'
},
{
title: '创建日期',
align: "center",
dataIndex: 'createTime'
},
{
title: '所属部门',
align: "center",
dataIndex: 'orgCode_dictText'
},
];
// 高级查询数据
export const superQuerySchema = {
instructionTag: {title: '分类标签',order: 0,view: 'text', type: 'string',},
category: {title: '服务类别',order: 1,view: 'text', type: 'string',},
type: {title: '服务类型',order: 2,view: 'text', type: 'string',},
directiveName: {title: '服务指令',order: 3,view: 'text', type: 'string',},
cycleType: {title: '周期类型 1日常护理 2周期护理 3即时护理',order: 4,view: 'text', type: 'string',},
createTime: {title: '创建日期',order: 5,view: 'datetime', type: 'string',},
orgCode: {title: '所属部门',order: 6,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'org_code', dictText: 'depart_name',},
};

View File

@ -0,0 +1,218 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="orgCode">
<template #label><span title="所属部门">所属部门</span></template>
<j-select-multiple placeholder="请选择所属部门" v-model:value="queryParam.orgCode"
dictCode="sys_depart,depart_name,org_code" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<CanAddDirectiveModal ref="registerModal" @success="handleSuccess"></CanAddDirectiveModal>
</div>
</template>
<script lang="ts" name="canadddirective-canAddDirective" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './CanAddDirective.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CanAddDirective.api';
import CanAddDirectiveModal from './components/CanAddDirectiveModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import { syncDirective } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
import { useMessage } from '/@/hooks/web/useMessage';
const props = defineProps({
directiveMainOrgInfo: {},
existDirectiveIds: [],
})
const { createMessage, createConfirm } = useMessage();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '可新增指令',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
queryParam.existDirectiveIds = props.existDirectiveIds.map(item => item.id)
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "可新增指令",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 镜像
*/
function handlePull(record) {
createConfirm({
iconType: 'warning',
title: '镜像确认',
content: '是否确认将服务指令【' + record.directiveName + '】同步给平台:' + props.directiveMainOrgInfo.departName,
okText: '确认',
cancelText: '取消',
onOk: () => {
syncDirective(
record.orgCode,
{
syncIds: record.directiveId,
upIds: '',
syncOrgCodes: props.directiveMainOrgInfo.orgCode,
syncOption: 'all',
}
).then(res => {
createMessage.success('已开始自动同步,可在日志中查看同步结果!')
}).catch(() => {
createMessage.error('镜像失败,请稍后再试')
})
}
});
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '镜像',
onClick: handlePull.bind(null, record),
}
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
defineExpose({
reload,
})
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,423 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer>
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="ConfigService2DirectiveForm">
<a-row v-show="isAudit">
<a-col :span="12">
<a-config-provider :disabled="false">
<a-form-item label="服务指令审核" v-bind="validateInfos.statusVal" id="ConfigServiceDirectiveForm-statusVal"
name="statusVal">
<a-select v-model:value="formData.statusVal" placeholder="请选择审核状态" style="width: 200px"
:disabled="false">
<a-select-option value="auditPass">审核通过</a-select-option>
<a-select-option value="auditFaild">审核不通过</a-select-option>
</a-select>
</a-form-item>
</a-config-provider>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<JFormContainer :disabled="disabled" style="margin-top: -30px;">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="ConfigService2DirectiveForm">
<a-row v-show="!isEditMedia">
<a-col :span="12">
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
<j-dict-select-tag v-model:value="formData.instructionTagId" :orgCode="formData?.sysOrgCode"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
name="categoryId">
<j-dict-select-tag type="list" v-model:value="formData.categoryId" :orgCode="formData?.sysOrgCode"
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
@upDictCode="upCategoryDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
name="typeId">
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode" :orgCode="formData?.sysOrgCode"
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName"
id="ConfigServiceDirectiveForm-directiveName" name="directiveName">
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="收费价格(元)" v-bind="validateInfos.tollPrice" id="ConfigServiceDirectiveForm-tollPrice"
name="tollPrice">
<a-input-number v-model:value="formData.tollPrice" placeholder="请输入收费价格" style="width: 100%"
precision="4" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="提成价格(元)" v-bind="validateInfos.comPrice" id="ConfigServiceDirectiveForm-comPrice"
name="comPrice">
<a-input-number v-model:value="formData.comPrice" placeholder="请输入提成价格" style="width: 100%"
precision="4" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="医保报销" v-bind="validateInfos.izReimbursement"
id="ConfigServiceDirectiveForm-izReimbursement" name="izReimbursement">
<j-dict-select-tag type='radio' v-model:value="formData.izReimbursement" dictCode="med_ins_reimb"
allowClear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="机构优惠" v-bind="validateInfos.izPreferential"
id="ConfigServiceDirectiveForm-izPreferential" name="izPreferential">
<j-dict-select-tag type='radio' v-model:value="formData.izPreferential"
dictCode="institutional_discount" allowClear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
name="cycleType">
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type" :orgCode="formData?.sysOrgCode"
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration"
id="ConfigServiceDirectiveForm-serviceDuration" name="serviceDuration">
<a-input-number v-model:value="formData.serviceDuration" :min="5" :max="55" :step="5"
placeholder="请输入服务时长(分钟)" allow-clear />
</a-form-item>
</a-col>
</a-row>
<a-row v-show="!isEditMedia">
<a-col :span="24">
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
:wrapperCol="wrapperCol2" name="typeId">
<JCheckbox v-model:value="formData.bodyTags" :orgCode="formData?.sysOrgCode"
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
<JCheckbox v-model:value="formData.emotionTags" :orgCode="formData?.sysOrgCode"
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
name="izEnabled">
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
placeholder="请选择是否启用"  allowClear />
</a-form-item>
</a-col>
</a-row>
<!-- <a-row> -->
<!-- <a-col :span="12">
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
<span v-if="disabled && !formData.previewFile">暂无文件</span>
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile"
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath">
</JImageUpload>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="服务指令描述" v-bind="validateInfos.serviceContent"
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
<a-textarea v-model:value="formData.serviceContent" :rows="2" placeholder="请输入服务指令描述" />
</a-form-item>
</a-col>
<!-- </a-row> -->
<!-- <a-row v-show="!disabled">
<a-col :span="12">
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
</a-form-item>
</a-col>
</a-row> -->
</a-form>
</template>
</JFormContainer>
<!-- <JFormContainer style="margin-top: -40px;">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="ConfigServiceDirectiveForm">
<a-row>
<a-col :span="12" v-if="!!formData.mp3File">
<a-form-item label="指令音频预览" id="ConfigServiceDirectiveForm-mp3File">
<audio controls disabled="false">
<source :src="getFileAccessHttpUrl(formData.mp3File)">
</audio>
</a-form-item>
</a-col>
<a-col :span="12" v-if="disabled && !formData.mp3File">
<a-form-item label="指令音频预览">
<span>暂无文件</span>
</a-form-item>
</a-col>
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
<a-form-item label="指令视频预览" id="ConfigServiceDirectiveForm-mp4File">
<video controls>
<source :src="getFileAccessHttpUrl(formData.mp4File)">
</video>
</a-form-item>
</a-col>
<a-col :span="12" v-if="disabled && !formData.mp3File">
<a-form-item label="指令视频预览">
<span>暂无文件</span>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
<span v-if="disabled && !formData.immediateFile">暂无文件</span>
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile"
:disabled="!canUploadPreviewImage || disabled" :bizPath="directiveBizPath">
</JImageUpload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer> -->
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { JCheckbox } from '/@/components/Form';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true },
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
categoryId: '',
typeId: '',
instructionTagId: '',
directiveName: '',
tollPrice: 0,
comPrice: 0,
izReimbursement: '0',
izPreferential: '0',
chargingFrequency: '',
cycleType: '',
sort: 99,
serviceContent: '',
serviceDuration: '5',
izEnabled: '0',
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
mp3File: '',
mp4File: '',
previewFile: '',
immediateFile: '',
status: '',
statusVal: undefined,
sysOrgCode: undefined,
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref<boolean>(false);
const isEditMedia = ref(false)
const isAudit = ref(false)
//
const validatorRules = reactive({
categoryId: [{ required: true, message: '请选择服务类别!' },],
typeId: [{ required: true, message: '请选择服务类型!' },],
instructionTagId: [{ required: true, message: '请选择分类标签!' },],
directiveName: [{ required: true, message: '请输入服务指令名称!' },],
tollPrice: [{ required: true, message: '请输入收费价格!' }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
comPrice: [{ required: false }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
izReimbursement: [{ required: true, message: '请选择是否参与医保报销!' },],
izPreferential: [{ required: true, message: '请选择是否参与机构优惠!' },],
// chargingFrequency: [{ required: true, message: '!' },],
cycleType: [{ required: true, message: '请选择周期类型!' },],
// sort: [{ required: true, message: '!' }, { pattern: /^\d+$/, message: '!' },],
serviceDuration: [
{ required: true, message: '请输入服务时长(分钟)!' },
{ pattern: /^\d+$/, message: '请输入正整数!' },
{
validator: (_, value) => {
if (value % 5 !== 0) {
return Promise.reject('请输入5的倍数!');
}
return Promise.resolve();
},
},
{
validator: (_, value) => {
if (value < 5 || value > 55) {
return Promise.reject('请输入5到55之间的值!');
}
return Promise.resolve();
},
},
],
izEnabled: [{ required: true, message: '请选择是否启用!' },],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
const categoryDictCode = ref('')
const typeDictCode = ref('')
//
const canUploadPreviewImage = computed(() => {
return formData.instructionTagId &&
formData.categoryId &&
formData.typeId &&
formData.directiveName &&
formData.cycleType;
});
//
const instructionComDictCode = ref([])
function upInstructionDictCode(v_) {
instructionComDictCode.value = v_
}
//
const categoryComDictCode = ref([])
function upCategoryDictCode(v_) {
categoryComDictCode.value = v_
}
//
const typeComDictCode = ref([])
function upTypeDictCode(v_) {
typeComDictCode.value = v_
}
//
const cycleTypeComDictCode = ref([])
function upCycleTypeDictCode(v_) {
cycleTypeComDictCode.value = v_
}
watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
// directiveBizPath
}, { deep: true });
const directiveBizPath = computed(() => {
if (!canUploadPreviewImage.value) return '';
//
const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.label;
//
return 'directive/' + `${instructionTagName_}/${categoryName_}/${typeName_}/${formData.directiveName}/${cycleTypeName_}`;
});
watch(
() => formData.instructionTagId,
(newInstructionTagId) => {
if (!newInstructionTagId) {
formData.categoryId = ''
formData.typeId = ''
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
} else {
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
}
}
);
watch(
() => formData.categoryId,
(newCategoryId) => {
if (!newCategoryId) {
formData.typeId = ''
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
} else {
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
}
}
);
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
* isEditMedia_是否为编辑指令资源 隐藏业务字段
* isAudit_是否为服务指令那个审核 隐藏业务字段
*/
function edit(record, isEditMedia_ = false, isAudit_ = false) {
console.log("🌊 ~ edit ~ record:", record)
isEditMedia.value = isEditMedia_
isAudit.value = isAudit_
formData.bodyTags = ''
formData.emotionTags = ''
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
defineExpose({
add,
edit,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
:maskClosable="false">
<template #footer>
<a-button @click="handleCancel">关闭</a-button>
</template>
<CanAddDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false"></CanAddDirectiveForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose, defineProps } from 'vue';
import CanAddDirectiveForm from './CanAddDirectiveForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import { queryById } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
const props = defineProps({
});
const title = ref<string>('');
const visible = ref<boolean>(false);
const auditVisible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const auditListRef = ref();
const emit = defineEmits(['register', 'success']);
const opeType = ref('')// add edit editMedia- look audit auditMedia-
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = '详情';
visible.value = true;
queryById({ dataSourceCode: record.orgCode, id: record.directiveId }).then(res => {
registerForm.value.edit(res);
})
}
/**
* 审核列表 - 审核
* @param record
*/
function audit(record) {
title.value = '审核';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record, false, true);
});
}
/**
* 打开审核列表
*/
function openAuditList() {
auditVisible.value = true;
auditListRef.value?.open();
}
/**
* 编辑指令资源
* @param record
*/
function editMedia(record) {
title.value = '编辑指令资源';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record, true);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
if (opeType.value == 'audit') {
registerForm.value.submitAudit();
} else {
registerForm.value.submitForm();
}
}
/**
* 暂存
*/
function handleSave() {
registerForm.value.submitForm();
}
/**
* 给审核对应的业务平台同步资源
*/
function handleMediaAsync() {
registerForm.value.syncMediaForBizFunc();
}
/**
* 给所有业务平台同步资源
*/
function handleMediaSyncAllPlat() {
registerForm.value.syncMediaForAllBizFunc();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
/**
* 审核列表-关闭按钮回调事件
*/
function handleAuditCancel() {
auditVisible.value = false;
emit('success')
}
defineExpose({
edit,
editMedia,
disableSubmit,
audit,
openAuditList,
opeType,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -5,8 +5,10 @@
<a-col v-for="item in orgTableList.records" :key="item.id" :xs="24" :sm="24" :md="props.layout == 'full' ? 12 : 8"
:lg="props.layout == 'full' ? 12 : 8" :xl="props.layout == 'full' ? 8 : 8" :xxl="props.layout == 'full' ? 6 : 8"
style="padding: 8px;">
<a-card :class="{ 'selected-card': selectedOrgs.some(org => org.orgCode === item.orgCode) }"
style="width: 100%; border-radius: 8px; " :headStyle="{ height: '60px', padding: '0 24px' }"
<a-card :class="{
'selected-card': selectedOrgs.some(org => org.orgCode === item.orgCode),
'directive-selected-card': directiveSelectedOrg?.orgCode === item.orgCode
}" style="width: 100%; border-radius: 8px; " :headStyle="{ height: '60px', padding: '0 24px' }"
:style="{ cursor: showChoose ? 'pointer' : 'default' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }"
@click="handleCardClick(item)">
<template #title>
@ -17,6 +19,8 @@
<!-- 如果是已选择显示"已选择" -->
<span style="color: green; font-size: 12px; margin-left: 8px;"
v-if="selectedOrgs.some(org => org.orgCode === item.orgCode)">已选择</span>
<span style="color: #d48806; font-size: 12px; margin-left: 8px;"
v-if="directiveSelectedOrg?.orgCode === item.orgCode">指令库已选择</span>
</div>
</a-col>
<a-col :span="props.layout == 'full' ? 2 : 3" style="text-align: center; padding-top: 4px;">
@ -34,6 +38,11 @@
<span class="tbClass"><img src="/@/assets/images/a14.png" style="width:20px;" /></span><br />
<span class="antTitle">详情</span>
</span>
<!-- <span v-show="showDirectiveMain" style="display:inline-block;cursor: pointer;margin-left: 10px;"
@click.stop="handleDetail(item)">
<span class="tbClass"><img src="/@/assets/images/safety.png" style="width:20px;" /></span><br />
<span class="antTitle">指令库</span>
</span> -->
<!-- 根据 showChoose 判断是否显示选择按钮 -->
<!-- <span v-if="showChoose" style="display:inline-block; cursor: pointer; margin-left: 20px;"
@click.stop="handleCardClick(item)">
@ -72,7 +81,9 @@ const props = defineProps({
title: { type: String, default: '' },
allowMultipleSelection: { type: Boolean, default: false }, //
layout: { type: String, default: 'full' }, // : 'full' 'half'
excludeOrgCode: { type: String, default: '' }//
excludeOrgCode: { type: String, default: '' },//
showDirectiveMain: { type: Boolean, default: false },//
showDirectiveChoose: { type: Boolean, default: false }, //
})
const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
@ -80,12 +91,17 @@ const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
const orgTableList = ref<any>({ records: [], total: 0 })
const queryParam = reactive<any>({})
const pageParams = ref({ pageNo: 1, pageSize: props.pageSize })
const directiveSelectedOrg = ref<any>(null)
// ID
const selectedOrgs = ref<string[]>([])
/** 点击卡片选择 */
function handleCardClick(item: any) {
if (props.showDirectiveChoose) {
directiveSelectedOrg.value = item
emit('handleOrgChoose', item)
}
if (props.showChoose) { //
if (props.allowMultipleSelection) {
//
@ -120,6 +136,14 @@ function reload() {
getOrgInfo(queryParam).then(res => {
res.records = res.records.filter(o => o.orgCode != props.excludeOrgCode)
orgTableList.value = res
// reload
if (props.showDirectiveChoose) {
const defaultSelected = res.records.find(item => item.izDirectiveMain === '0')
if (defaultSelected) {
directiveSelectedOrg.value = defaultSelected
emit('handleOrgChoose', defaultSelected)
}
}
})
}
@ -206,4 +230,9 @@ defineExpose({
border: 2px solid #1890ff;
box-shadow: 0 0 8px rgba(24, 144, 255, 0.3);
}
.directive-selected-card {
border: 2px solid #d48806;
box-shadow: 0 0 8px rgba(212, 136, 6, 0.3);
}
</style>

View File

@ -8,6 +8,7 @@ enum Api {
listByDS = '/services/serviceDirective/listByDS',
queryById = '/services/serviceDirective/queryById',
syncDirective = '/services/serviceDirective/syncDirective',
idListByDS = '/services/serviceDirective/idListByDS',
}
/**
@ -23,6 +24,13 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
*/
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, params });
/**
*
* @param params id
* @returns
*/
export const idListByDS = (params) => defHttp.get({ url: Api.idListByDS, params });
/**
*
* @param params

View File

@ -41,28 +41,28 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'bodyTagList',
ellipsis: false,
defaultHidden: true,
// format(text, record, index) {
// if (!!text) {
// return text.map((item) => item.tagName).join('、');
// } else {
// return '-';
// }
// },
defaultHidden: false,
format(text, record, index) {
if (!!text) {
return text.map((item) => item.tagName).join('、');
} else {
return '-';
}
},
},
{
title: '情绪标签',
align: 'center',
dataIndex: 'emotionTagList',
ellipsis: false,
defaultHidden: true,
// format(text, record, index) {
// if (!!text) {
// return text.map((item) => item.tagName).join('、');
// } else {
// return '-';
// }
// },
defaultHidden: false,
format(text, record, index) {
if (!!text) {
return text.map((item) => item.tagName).join('、');
} else {
return '-';
}
},
},
{
title: '收费价格',

View File

@ -1,5 +1,5 @@
<template>
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
<j-modal :title="title" width="75vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
<ConfigServiceDirectiveList ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveList>
</j-modal>
</template>

View File

@ -21,10 +21,12 @@
style="margin-right: 10px;">镜像</a-button>
<a-button type="primary" preIcon="ant-design:file-text-twotone" @click="handleViewLogs"
style="margin-right: 10px;">日志</a-button>
<a-badge :count="609" style="margin-right: 10px;">
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
@click="handleLookNewDirectives">新增指令</a-button>
</a-badge>
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleDirectiveMainFunc"
style="margin-right: 10px;">指令库</a-button>
<!-- <a-badge :count="609" style="margin-right: 10px;"> -->
<a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
@click="handleLookNewDirectives">新增指令</a-button>
<!-- </a-badge> -->
</a-col>
</a-row>
</a-form>
@ -38,16 +40,46 @@
<a-modal v-model:visible="logsVisible" title="日志" width="90vw"
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
wrapClassName="org-list-modal" @cancel="handleCancelLogs">
<a-row>
<a-col :span="2" :push="22" style="margin-top: 15px;margin-left: 60px;">
<a-button type="primary" @click="handleRefreshLogs" title="刷新">
刷新
</a-button>
</a-col>
</a-row>
<template #footer>
<a-button @click="handleCancelLogs" type="primary">关闭</a-button>
</template>
<AsyncListComponent></AsyncListComponent>
<AsyncListComponent ref="logsRef"></AsyncListComponent>
</a-modal>
<!-- 指令库 -->
<a-modal v-model:visible="directiveMainVisible" title="指令库" width="90vw"
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
wrapClassName="org-list-modal" @cancel="handleCanceldirectiveMain">
<template #footer>
<a-button @click="handleCanceldirectiveMain" type="primary">关闭</a-button>
<a-button @click="handleAsyncdirectiveMain" type="primary">确认</a-button>
</template>
<OrgListCom ref="directiveMainComRef" :showDirectiveMain=true :showDirectiveChoose="true"
@handleOrgDetail="handleDetail" :showDetail=true @handleOrgChoose="directiveMainFunc">
</OrgListCom>
</a-modal>
<!-- 新增指令 -->
<a-modal v-model:visible="newDirectiveVisible" title="新增指令" width="90vw"
:bodyStyle="{ padding: '0', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'hidden' }"
wrapClassName="org-list-modal" @cancel="handleCancelNewDirective">
<template #footer>
<a-button @click="handleCancelNewDirective" type="primary">关闭</a-button>
<!-- <a-button @click="handleAsyncNewDirective" type="primary">同步</a-button> -->
</template>
<CanAddDirectiveList ref="canAddDirectiveRef" :directiveMainOrgInfo="directiveMainOrgInfo"
:existDirectiveIds="existDirectiveIds"></CanAddDirectiveList>
</a-modal>
</div>
</template>
<script setup name="synchronization-directive2" lang="ts">
import { ref, reactive, computed, onMounted } from 'vue'
import { ref, reactive, computed, onMounted, watch } from 'vue'
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
//
import { list, asyncFunc, departList } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
@ -58,10 +90,19 @@ import SyncStepListModal from '/@/views/synchronization/directive/syncStep/SyncS
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api';
//
import OrgListCom from '/@/views/synchronization/directive/orgCom/OrgListCom.vue'
//
import CanAddDirectiveList from '/@/views/synchronization/directive/canadddirective/CanAddDirectiveList.vue'
import { useMessage } from '/@/hooks/web/useMessage';
import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
import { getDirectiveMain, changeDirectiveMain } from '/@/api/common/api'
import { idListByDS } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
const { createMessage } = useMessage();
const { createMessage } = useMessage()
const canAddDirectiveRef = ref()
const newDirectiveVisible = ref(false)
const directiveMainComRef = ref();
const newDirectiveRef = ref()
const logsRef = ref()
const formRef = ref();
const configServiceDirectiveListModal = ref();
const syncStepListModal = ref();
@ -70,6 +111,10 @@ const queryParam = reactive<any>({});
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const orgListComRef = ref()
const logsVisible = ref(false)
const directiveMainVisible = ref(false)
const { createConfirm } = useMessage();
const existDirectiveIds = ref([])//id
const directiveMainOrgInfo = ref()
const labelCol = reactive({
xs: 24,
@ -126,10 +171,11 @@ function searchReset() {
*/
function handleViewLogs() {
logsVisible.value = true
handleRefreshLogs()
}
function handleLookNewDirectives() {
createMessage.warning('功能开发中')
newDirectiveVisible.value = true
}
//
@ -137,9 +183,91 @@ function handleCancelLogs() {
logsVisible.value = false
}
//
function handleRefreshLogs() {
logsRef.value?.searchQuery()
}
/**
* 关闭新增指令
*/
function handleCancelNewDirective() {
newDirectiveVisible.value = false
}
/**
* 同步新增指令
*/
function handleAsyncNewDirective() {
// newDirectiveRef
}
/**
* 打开指令库
*/
function handleDirectiveMainFunc() {
directiveMainVisible.value = true
directiveMainComRef.value?.reload();
}
/**
* 关闭指令库
*/
function handleCanceldirectiveMain() {
directiveMainVisible.value = false
}
watch(directiveMainOrgInfo, (newValue, oldValue) => {
idListByDS({ dataSourceCode: newValue.orgCode }).then(res => {
existDirectiveIds.value = res.records
canAddDirectiveRef.value?.reload()
})
}, { deep: true })
const tempDM = ref()
/**
* 指令库对应机构信息
*/
function directiveMainFunc(orgInfo_) {
tempDM.value = orgInfo_
}
/**
* 确认指令库
*/
function handleAsyncdirectiveMain() {
createConfirm({
iconType: 'warning',
title: '指令库变更提醒',
content: '是否变更指令库为:' + tempDM.value.departName,
okText: '确认',
cancelText: '取消',
onOk: () => {
directiveMainOrgInfo.value = tempDM.value
changeDirectiveMain(directiveMainOrgInfo.value.orgCode).then(() => {
createMessage.success('指令库已变更')
handleCanceldirectiveMain()
canAddDirectiveRef.value?.reload()
}).catch(() => {
createMessage.error('指令库变更失败,请稍后再试')
})
}
});
}
//
function getDirectiveMainOrgInfo() {
getDirectiveMain().then(res => {
directiveMainOrgInfo.value = res
})
}
//
onMounted(() => {
reload();
getDirectiveMainOrgInfo()
});
</script>
@ -225,4 +353,11 @@ onMounted(() => {
overflow: hidden;
text-overflow: ellipsis;
}
.content-refresh-btn {
position: absolute;
top: 60px;
right: 20px;
z-index: 1;
}
</style>

View File

@ -1,6 +1,13 @@
<template>
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
<BasicForm @register="registerForm">
<!-- 是否标准指令库 -->
<template #izDirectiveMain="{ model, field }">
<a-radio-group v-model:value="model[field]" name="radioGroup">
<a-radio value="0"></a-radio>
<a-radio value="1"></a-radio>
</a-radio-group>
</template>
<!-- 省份 -->
<template #province="{ model, field }">
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
@ -82,6 +89,10 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
field: 'contextPath',
show: !isChild,
},
{
field: 'izDirectiveMain',
show: !isChild,
},
{
field: 'orgCategory',
componentProps: { options: categoryOptions },

View File

@ -1,6 +1,13 @@
<template>
<a-spin :spinning="loading">
<BasicForm @register="registerForm">
<!-- 是否标准指令库 -->
<template #izDirectiveMain="{ model, field }">
<a-radio-group v-model:value="model[field]" name="radioGroup">
<a-radio value="0"></a-radio>
<a-radio value="1"></a-radio>
</a-radio-group>
</template>
<!-- 省份 -->
<!-- <template #province="{ model, field }">
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"

View File

@ -62,6 +62,15 @@ export function useBasicFormSchema() {
},
},
// {
// field: 'izDirectiveMain',
// label: '是否标准指令库',
// component: 'Input',
// ifShow: (v_) => {
// return !v_.values.parentId;
// },
// slot: 'izDirectiveMain',
// },
// {
// field: 'province',
// label: '省份',
// component: 'Input',