diff --git a/.env.development2 b/.env.development2 index 1593df2..370eaa8 100644 --- a/.env.development2 +++ b/.env.development2 @@ -25,11 +25,11 @@ VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDef # 长者标签-情绪标签默认图片 VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png' # 服务指令-服务指令图片(大)默认图片 -VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png' # 服务指令-服务指令图片(小)默认图片 -VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png' # 服务指令-即时指令图标默认图片 -VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png' # 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动) #VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3 diff --git a/.env.development3 b/.env.development3 index 28db7b3..bdcc66a 100644 --- a/.env.development3 +++ b/.env.development3 @@ -25,11 +25,11 @@ VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDef # 长者标签-情绪标签默认图片 VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png' # 服务指令-服务指令图片(大)默认图片 -VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png' # 服务指令-服务指令图片(小)默认图片 -VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png' # 服务指令-即时指令图标默认图片 -VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png' # 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动) #VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3 diff --git a/.env.production b/.env.production index 6edc81e..9cd485d 100644 --- a/.env.production +++ b/.env.production @@ -26,11 +26,11 @@ VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDef # 长者标签-情绪标签默认图片 VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png' # 服务指令-服务指令图片(大)默认图片 -VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png' # 服务指令-服务指令图片(小)默认图片 -VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png' # 服务指令-即时指令图标默认图片 -VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/default.png' +VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png' # 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动) #VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3 diff --git a/src/views/services/directivePackage/DirectivePackageList.vue b/src/views/services/directivePackage/DirectivePackageList.vue index 92d54c9..9e5e821 100644 --- a/src/views/services/directivePackage/DirectivePackageList.vue +++ b/src/views/services/directivePackage/DirectivePackageList.vue @@ -188,10 +188,11 @@ onMounted(() => { + \ No newline at end of file diff --git a/src/views/services/directivePackage/components/DirectivePackageForm.vue b/src/views/services/directivePackage/components/DirectivePackageForm.vue index adb7e8e..b837bd9 100644 --- a/src/views/services/directivePackage/components/DirectivePackageForm.vue +++ b/src/views/services/directivePackage/components/DirectivePackageForm.vue @@ -1,40 +1,112 @@ @@ -65,20 +137,47 @@ const formData = reactive>({ startTimeStr: '', endTimeStr: '', instructionTagId: '', + totalDuration: 0, }); const { createMessage } = useMessage(); - const labelCol = ref({ xs: { span: 24 }, sm: { span: 6 } }); - const wrapperCol = ref({ xs: { span: 24 }, sm: { span: 16 } }); - const labelCol2 = ref({ xs: { span: 24 }, sm: { span: 2 } }); - const wrapperCol2 = ref({ xs: { span: 24 }, sm: { span: 21 } }); +const labelCol = ref({ xs: { span: 24 }, sm: { span: 6 } }); +const wrapperCol = ref({ xs: { span: 24 }, sm: { span: 16 } }); +const labelCol2 = ref({ xs: { span: 24 }, sm: { span: 2 } }); +const wrapperCol2 = ref({ xs: { span: 24 }, sm: { span: 21 } }); const confirmLoading = ref(false); //表单验证 const validatorRules = reactive({ - // packageName: [{ required: true, message: '请输入服务指令包名称!' },], - // sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入整数!' },], + packageName: [{ required: true, message: '请输入服务指令包名称!' },], + totalDuration: [{ required: true, message: '请输入服务总时长(分钟)!' }, { + validator: (_, value) => { + if (value <= 0) { + return Promise.reject('请输入服务总时长!'); + } + return Promise.resolve(); + }, + },], + izEnabled: [{ required: true, message: '请选择是否启用!' },], }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false }); +const onDurationKeydown = (e: KeyboardEvent) => { + const key = e.key; + // 放行控制键 + if (['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'].includes(key)) return; + // 只能输数字和点 + if (!/[\d.]/.test(key)) { + e.preventDefault(); + return; + } + const input = e.target as HTMLInputElement; + const { value, selectionStart: s, selectionEnd: t } = input; + const next = value.slice(0, s!) + key + value.slice(t!); + // 整数最多5位,小数最多2位 + if (!/^\d{0,3}$/.test(next)) { + e.preventDefault(); + } +}; + // 表单禁用 const disabled = computed(() => { if (props.formBpm === true) { @@ -114,12 +213,12 @@ function edit(record) { console.log("🚀 ~ nextTick ~ tmpData:", tmpData) //赋值 Object.assign(formData, tmpData); - - if(formData.startTimeStr){ - formData.startTimeStr = dayjs(formData.startTimeStr,"YYYY-MM-DD hh:mm:ss") + + if (formData.startTimeStr) { + formData.startTimeStr = dayjs(formData.startTimeStr, "YYYY-MM-DD hh:mm:ss") } - if(formData.endTimeStr){ - formData.endTimeStr = dayjs(formData.endTimeStr,"YYYY-MM-DD hh:mm:ss") + if (formData.endTimeStr) { + formData.endTimeStr = dayjs(formData.endTimeStr, "YYYY-MM-DD hh:mm:ss") } console.log("🚀 ~ nextTick ~ formData:", formData) }); @@ -162,43 +261,43 @@ async function submitForm(directives) { if (directives.length > 0) { model.directives = directives } - if(!model.packageName){ - createMessage.warning('请填写服务指令包名称'); + // if (!model.packageName) { + // createMessage.warning('请填写服务指令包名称'); + // confirmLoading.value = false; + // return; + // } + // if (!model.startTimeStr) { + // createMessage.warning('请选择开始时间'); + // confirmLoading.value = false; + // return; + // } + // if (!model.endTimeStr) { + // createMessage.warning('请选择结束时间'); + // confirmLoading.value = false; + // return; + // } + var directivesList = model.directives; + if (!directivesList || directivesList.length == 0) { + createMessage.warning('请选择服务指令'); confirmLoading.value = false; return; + } else { + model.instructionTagId = directivesList[0].instructionTagId; } - if(!model.startTimeStr){ - createMessage.warning('请选择开始时间'); - confirmLoading.value = false; - return; - } - if(!model.endTimeStr){ - createMessage.warning('请选择结束时间'); - confirmLoading.value = false; - return; - } - var directivesList = model.directives; - if(directivesList.length == 0){ - createMessage.warning('请选择服务指令'); + console.log('model', model); + // confirmLoading.value = false; + await saveOrUpdate(model, isUpdate.value) + .then((res) => { + if (res.success) { + createMessage.success(res.message); + emit('ok'); + } else { + createMessage.warning(res.message); + } + }) + .finally(() => { confirmLoading.value = false; - return; - }else{ - model.instructionTagId = directivesList[0].instructionTagId; - } - console.log('model', model); - // confirmLoading.value = false; - await saveOrUpdate(model, isUpdate.value) - .then((res) => { - if (res.success) { - createMessage.success(res.message); - emit('ok'); - } else { - createMessage.warning(res.message); - } - }) - .finally(() => { - confirmLoading.value = false; - }); + }); } @@ -213,4 +312,18 @@ defineExpose({ .antd-modal-form { padding: 14px; } + +.card-style { + padding-top: 14px; + padding-left: 14px; + padding-right: 14px; + background-color: #fff; + border-radius: 10px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); + margin-bottom: 14px; +} + +:deep .ant-input-number-group-wrapper { + width: 100%; +} diff --git a/src/views/services/directivePackage/components/DirectivePackageModal.vue b/src/views/services/directivePackage/components/DirectivePackageModal.vue index 769e749..57e3656 100644 --- a/src/views/services/directivePackage/components/DirectivePackageModal.vue +++ b/src/views/services/directivePackage/components/DirectivePackageModal.vue @@ -3,132 +3,154 @@ --> + :footer-style="{ textAlign: 'right' }" @close="handleCancel" :bodyStyle="{ padding: '14px' }"> - - - - - - 引用服务指令包 - 选择服务指令 + + + - - -
-
- - - {{directive.instructionTagName||directive.instructionTagId_dictText}} +
+ + +
+ + 引用服务指令包 + + + 选择服务指令 + +
+
+ +
+
+ + + {{ directive.instructionTagName || directive.instructionTagId_dictText }} + + + + + + + + + +
+ +
+ +
+ + + {{ directive.directiveName + }} - - - - - + + + + + + + + + + + + + + + + + + -
- -
- -
- - - {{ directive.directiveName }} - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- 医保 -
+
+
+ + + +
+ 医保 +
+
+ +
+ {{ directive.izReimbursement == '1' ? '报销' : '不报销' }} +
+
- -
- {{directive.izReimbursement=='1'?'报销':'不报销'}} -
-
- - - - -
- 优惠 -
+ + + +
+ 优惠 +
+
+ +
+ {{ directive.izPreferential == '1' ? '参与' : '不参与' }} +
+
- -
- {{directive.izPreferential=='1'?'参与':'不参与'}} -
-
-
+
+ + + + {{ directive.typeName }} + {{ handleBodyTags('', directive, '') + }} + {{ handleEmotionTags('', directive, + '') + }} + + + 日常护理 + 周期护理 + 即时护理 + + +
- - - - {{ directive.typeName }} - {{ handleBodyTags('', directive, '') }} - {{ handleEmotionTags('', directive, '') }} - - - 日常护理 - 周期护理 - 即时护理 - - - -
-
-
+ + +
- -