- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 line
8.4 KiB
JSON
1 line
8.4 KiB
JSON
{"file":"applications-Cy7tl04a.js","mappings":";;;;;;;;;AAGa,QAAW,CAAA,CAAE;AACV,QAAI,IAAI;AACV,QAAI,KAAK;AACJ,QAAI,KAAK;AACT,QAAI,KAAK;AACf,QAAI,EAAE,WAAW,IAAI,aAAa,aAAa,SAAS,UAAU,aAAa,IAAI,cAAc,IAAI,SAAS,IAAI,YAAY,aAAa,OAAO,IAAI;;;;;;;;;;;;;","names":[],"sources":["../../../../pages/platform/applications.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, onMounted } from 'vue'\n\nconst apps = ref<any[]>([])\nconst loading = ref(true)\nconst ready = ref(false)\nconst showCreate = ref(false)\nconst submitting = ref(false)\nconst form = ref({ patientId: '', serviceType: 'HOME_CARE', channel: 'WECHAT', contactName: '', contactPhone: '', address: '', regionCode: '441402001', notes: '' })\nconst serviceTypes = [{ v:'HOME_CARE',label:'居家护理' },{ v:'REHABILITATION',label:'康复训练' },{ v:'BATH_ASSIST',label:'助浴服务' },{ v:'ASSESSMENT',label:'能力评估' }]\nconst channels = ['WECHAT','APP','PHONE','COMMUNITY','HOSPITAL']\nconst statusMap: Record<string,string> = { DRAFT:'草稿',PENDING_ACCEPTANCE:'待受理',PENDING_ASSESSMENT:'待评估',ASSESSING:'评估中',ASSESSMENT_PASSED:'已评估',RETURNED:'已退回',CANCELLED:'已取消',REVIEWING:'复核中' }\nconst statusCls: Record<string,string> = { DRAFT:'bg-gray-100',PENDING_ACCEPTANCE:'bg-yellow-50 text-yellow-700',PENDING_ASSESSMENT:'bg-blue-50 text-blue-600',ASSESSING:'bg-indigo-50 text-indigo-600',ASSESSMENT_PASSED:'bg-green-50 text-green-600',RETURNED:'bg-red-50 text-red-600' }\n\nfunction getAuthHeaders(): Record<string,string> {\n const h: Record<string,string> = { 'Content-Type':'application/json','X-Tenant-Id':'1','X-Org-Id':'1','X-User-Role':'ADMIN','X-User-Id':'1' }\n try { const u = JSON.parse(localStorage.getItem('hss_platform_user')||'{}'); if(u.userRole){h['X-User-Role']=u.userRole;h['X-User-Id']=u.userId} } catch {}\n return h\n}\n\nasync function apiFetch(path: string, opts: any = {}) {\n const h = { ...getAuthHeaders(), 'Idempotency-Key': 'web-'+Date.now()+'-'+Math.random().toString(36).slice(2,6) }\n return await $fetch('/api/hss' + path, { ...opts, headers: { ...h, ...(opts.headers||{}) } })\n}\n\nasync function loadApps() {\n try { const res = await apiFetch('/applications?page=1&size=30'); apps.value = res?.data?.records || res?.data || [] } catch {}\n}\n\nasync function createApp() {\n submitting.value = true\n try { await apiFetch('/applications', { method:'POST', body: JSON.stringify(form.value) }); showCreate.value = false; await loadApps() }\n catch(e: any) { alert(e?.data?.message || e?.message || '创建失败') }\n finally { submitting.value = false }\n}\n\nasync function doAction(id: number, action: string, body?: any) {\n try { await apiFetch(`/applications/${id}/${action}`, { method:'POST', body: body ? JSON.stringify(body) : undefined }); await loadApps() }\n catch(e: any) { alert(e?.data?.message || e?.message || '操作失败') }\n}\n\nonMounted(() => { ready.value = true; loadApps().finally(() => loading.value = false) })\n</script>\n\n<template>\n <ClientOnly>\n <div v-if=\"!ready\" class=\"min-h-screen bg-surface flex items-center justify-center\"><p class=\"text-text-secondary\">加载中...</p></div>\n <div v-else class=\"min-h-screen bg-surface flex\">\n <aside class=\"hidden lg:flex flex-col w-56 bg-white border-r shrink-0\">\n <div class=\"p-4 border-b\"><a href=\"/platform\" class=\"font-bold text-primary text-sm\">← 返回工作台</a></div>\n <div class=\"p-3\"><div class=\"text-xs text-text-secondary\">角色: {{ getAuthHeaders()['X-User-Role'] }}</div></div>\n </aside>\n <main class=\"flex-1 p-4 lg:p-8 overflow-auto\">\n <div class=\"flex items-center justify-between mb-6\"><h2 class=\"text-xl font-bold\">服务申请管理</h2><button @click=\"showCreate=!showCreate\" class=\"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-700\">+ 新建申请</button></div>\n <div v-if=\"showCreate\" class=\"bg-white rounded-2xl shadow-sm border p-6 mb-6 space-y-4\">\n <h3 class=\"font-bold\">新建服务申请</h3>\n <div class=\"grid md:grid-cols-2 gap-4\">\n <div><label class=\"text-xs text-text-secondary block mb-1\">服务对象ID</label><input v-model=\"form.patientId\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\" placeholder=\"如 2001\"/></div>\n <div><label class=\"text-xs text-text-secondary block mb-1\">服务类型</label><select v-model=\"form.serviceType\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\"><option v-for=\"s in serviceTypes\" :key=\"s.v\" :value=\"s.v\">{{s.label}}</option></select></div>\n <div><label class=\"text-xs text-text-secondary block mb-1\">渠道</label><select v-model=\"form.channel\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\"><option v-for=\"c in channels\" :key=\"c\" :value=\"c\">{{c}}</option></select></div>\n <div><label class=\"text-xs text-text-secondary block mb-1\">联系人</label><input v-model=\"form.contactName\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\" placeholder=\"姓名\"/></div>\n <div><label class=\"text-xs text-text-secondary block mb-1\">电话</label><input v-model=\"form.contactPhone\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\" placeholder=\"手机号\"/></div>\n <div><label class=\"text-xs text-text-secondary block mb-1\">区域</label><input v-model=\"form.regionCode\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\" placeholder=\"441402001\"/></div>\n <div class=\"md:col-span-2\"><label class=\"text-xs text-text-secondary block mb-1\">地址</label><input v-model=\"form.address\" class=\"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary\" placeholder=\"详细地址\"/></div>\n </div>\n <div class=\"flex gap-3\"><button @click=\"createApp\" :disabled=\"submitting\" class=\"px-6 py-2 bg-primary text-white rounded-lg text-sm font-medium disabled:opacity-50\">{{submitting?'提交中...':'提交申请'}}</button><button @click=\"showCreate=false\" class=\"px-6 py-2 border rounded-lg text-sm\">取消</button></div>\n </div>\n <div class=\"bg-white rounded-2xl shadow-sm border overflow-hidden\">\n <div v-if=\"loading\" class=\"p-8 text-center text-text-secondary\">加载中...</div>\n <table v-else class=\"w-full text-sm\"><thead><tr class=\"bg-gray-50 text-left text-xs text-text-secondary\"><th class=\"px-4 py-3\">ID</th><th class=\"px-4 py-3\">对象</th><th class=\"px-4 py-3\">类型</th><th class=\"px-4 py-3\">状态</th><th class=\"px-4 py-3\">联系人</th><th class=\"px-4 py-3\">时间</th><th class=\"px-4 py-3\">操作</th></tr></thead>\n <tbody><tr v-for=\"a in apps\" :key=\"a.id\" class=\"border-t border-gray-50 hover:bg-gray-50\">\n <td class=\"px-4 py-3 font-mono text-xs\">#{{a.id}}</td><td class=\"px-4 py-3\">{{a.patientId}}</td><td class=\"px-4 py-3 text-xs\">{{a.serviceType}}</td>\n <td class=\"px-4 py-3\"><span class=\"px-2 py-0.5 rounded-full text-xs font-medium\" :class=\"statusCls[a.status]||'bg-gray-100'\">{{statusMap[a.status]||a.status}}</span></td>\n <td class=\"px-4 py-3 text-xs\">{{a.contactName||'-'}}</td><td class=\"px-4 py-3 text-xs text-text-secondary\">{{a.createdAt?.substring(0,16)||'-'}}</td>\n <td class=\"px-4 py-3\"><div class=\"flex gap-1 flex-wrap\">\n <button v-if=\"a.status==='DRAFT'\" @click=\"doAction(a.id,'submit')\" class=\"px-2 py-1 bg-blue-50 text-blue-600 rounded text-xs hover:bg-blue-100\">提交</button>\n <button v-if=\"a.status==='PENDING_ACCEPTANCE'\" @click=\"doAction(a.id,'accept')\" class=\"px-2 py-1 bg-green-50 text-green-600 rounded text-xs hover:bg-green-100\">受理</button>\n <button v-if=\"a.status==='PENDING_ACCEPTANCE'\" @click=\"doAction(a.id,'return',{reason:'退回原因'})\" class=\"px-2 py-1 bg-red-50 text-red-600 rounded text-xs hover:bg-red-100\">退回</button>\n <button v-if=\"!['CANCELLED','RETURNED'].includes(a.status)\" @click=\"doAction(a.id,'cancel')\" class=\"px-2 py-1 bg-gray-50 text-gray-500 rounded text-xs hover:bg-gray-100\">取消</button>\n </div></td>\n </tr></tbody>\n </table>\n </div>\n </main>\n </div>\n </ClientOnly>\n</template>\n"],"version":3} |