| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680 |
- <template>
- <div class="suitable-tech">
- <!-- 搜索项 -->
- <div class="screening">
- <div class="screening-title flex-vertical-center-l">
- <img src="~@/assets/filters.png" alt />
- </div>
- <div style="flex:1">
- <div class="screening-form flex-vertical-center-l flex-wrap">
- <div class="screening-item flex-vertical-center-l">
- <span>方名:</span>
- <div class="input">
- <el-input
- size="mini"
- v-model="searchData.name"
- placeholder="请输入"
- clearable
- ></el-input>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l">
- <span>共享至:</span>
- <div class="input">
- <el-radio-group v-model="searchData.shareType" size="mini">
- <el-radio label="0">个人</el-radio>
- <el-radio label="1">科室</el-radio>
- <el-radio label="2">机构</el-radio>
- </el-radio-group>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l">
- <span>{{ userNameLabel }}:</span>
- <div class="input">
- <el-input
- size="mini"
- v-model="searchData.userName"
- placeholder="请输入"
- clearable
- ></el-input>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l">
- <span>是否统建处方:</span>
- <div class="input">
- <el-select
- size="mini"
- v-model="searchData.isUnified"
- placeholder="请选择"
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </div>
- </div>
- </div>
- <div class="screening-form flex-vertical-center-l flex-wrap">
- <div class="screening-item flex-vertical-center-l" v-if="searchData.isUnified === '1'">
- <span>医派:</span>
- <div class="input">
- <el-input
- size="mini"
- v-model="searchData.medicalSchool"
- placeholder="请输入"
- clearable
- ></el-input>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l" v-if="searchData.isUnified === '1'">
- <span>科室:</span>
- <div class="input">
- <el-input
- size="mini"
- v-model="searchData.department"
- placeholder="请输入"
- clearable
- ></el-input>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l">
- <span>涵盖项目:</span>
- <div class="input">
- <el-select
- size="mini"
- v-model="searchData.includeItem"
- placeholder="请搜索选择"
- clearable
- filterable
- :loading="projectLoading"
- loading-text="搜索中..."
- :filter-method="searchProject"
- @focus="searchProject('')"
- >
- <el-option
- v-for="(item, idx) in projectOptions"
- :key="idx"
- :label="item.itemName"
- :value="item.pid"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div class="screening-item flex-vertical-center-l">
- <span>功效与适应症:</span>
- <div class="input">
- <el-input
- size="mini"
- v-model="searchData.efficacy"
- placeholder="请输入"
- clearable
- ></el-input>
- </div>
- </div>
- <el-button type="primary" size="mini" @click="search()">搜索</el-button>
- <el-button type="warning" size="mini" @click="clearFilter()">清空</el-button>
- <el-button type="primary" size="mini" @click="openEditDialog()">新增</el-button>
- </div>
- </div>
- </div>
- <!-- 列表表格数据 -->
- <div class="table">
- <div class="today-table">
- <div class="table-container">
- <el-table
- :data="tableData"
- stripe
- style="width: 100%"
- border
- height="100%"
- row-key="pid"
- :expand-row-keys="expandRows"
- @expand-change="handleExpandChange"
- v-loading="tableLoading"
- >
- <el-table-column type="expand">
- <template slot-scope="props">
- <div class="expand-table">
- <el-table
- :data="props.row.subList"
- border
- size="mini"
- style="width: 100%"
- >
- <el-table-column
- prop="index"
- label="序号"
- width="60"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="treatItemName"
- label="项目名称"
- align="center"
- ></el-table-column>
- <el-table-column
- label="分类"
- width="120"
- align="center"
- >
- <template slot-scope="scope">
- {{ formatTreatClass(scope.row.treatClass) }}
- </template>
- </el-table-column>
- <el-table-column label="穴位/部位/耳穴/经络" align="center">
- <template slot-scope="scope">
- {{ formatDetailList(scope.row) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="isUpdate"
- label="是否可修改"
- width="100"
- align="center"
- >
- <template slot-scope="scope">
- {{ scope.row.isUpdate === "1" ? "是" : "否" }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="index"
- label="序号"
- width="60"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="name"
- label="方名"
- min-width="120"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="effect"
- label="功效与适应症"
- min-width="180"
- align="center"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- prop="provenance"
- label="处方出处"
- width="100"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="showType"
- label="共享状态"
- width="100"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{
- scope.row.showType === "0"
- ? "个人"
- : scope.row.showType === "1"
- ? "科室"
- : scope.row.showType === "2"
- ? "机构"
- : "-"
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="purposeType"
- label="是否统建处方"
- width="110"
- align="center"
- >
- <template slot-scope="scope">
- {{ scope.row.purposeType === "1" ? "是" : "否" }}
- </template>
- </el-table-column>
- <el-table-column
- prop="createUserName"
- label="创建者"
- width="100"
- align="center"
- ></el-table-column>
- <el-table-column label="操作" width="180" align="center">
- <template slot-scope="scope">
- <div class="flex-center">
- <div class="find-detail find-fill" :class="{ 'is-disabled': scope.row.createUser != currentUserId }" @click="scope.row.createUser == currentUserId && openEditDialog(scope.row)">编辑</div>
- <div class="find-detail find-fill1" :class="{ 'is-disabled': scope.row.createUser != currentUserId }" @click="scope.row.createUser == currentUserId && handleDelete(scope.row)">删除</div>
- <div class="find-detail find-fill2" @click="handleView(scope.row)">查看</div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="flex-vertical-center-r today-page">
- <el-pagination
- background
- layout=" prev, pager, next, jumper, total"
- :total="total"
- :page-size="limit"
- @current-change="sizeC($event)"
- ></el-pagination>
- </div>
- </div>
- </div>
- <!-- 新增/编辑弹窗 -->
- <popup
- distanceTop="5vh"
- fullscreen
- :showBtns="false"
- :showDialog.sync="showEditDialog"
- :loading="editLoading"
- :title="editData.pid ? '编辑适宜技术协定方' : '新增适宜技术协定方'"
- >
- <div slot="body" class="dialog-body-wrapper">
- <div class="dialog-back-btn" @click="handleEditBack">返回</div>
- <div class="dialog-scroll-area">
- <div class="dialog-form flex-wrap">
- <div class="form-item flex flex-col-center">
- <div class="name"><span style="color: red">*</span> 方名:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="editData.name"
- placeholder="请输入"
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <div class="name">中医病名:</div>
- <div class="input">
- <el-autocomplete
- size="mini"
- v-model="editData.chineseDiseaseName"
- :fetch-suggestions="queryDisease"
- value-key="disname"
- placeholder="请搜索选择"
- clearable
- :trigger-on-focus="true"
- @select="onDiseaseSelect"
- @clear="onDiseaseClear"
- >
- <template slot-scope="{ item }">
- <div :class="{ 'autocomplete-disabled': item._disabled }">
- {{ item.disname }}
- </div>
- </template>
- </el-autocomplete>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <div class="name">共享至:</div>
- <div class="input">
- <el-select
- size="mini"
- v-model="editData.showType"
- placeholder="请选择"
- >
- <el-option
- v-for="opt in shareOptions"
- :key="opt.value"
- :label="opt.label"
- :value="opt.value"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <div class="name">处方出处:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="editData.source"
- placeholder="请输入"
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center form-item-half">
- <span style="opacity:0">*</span>
- <div class="name">西医诊断:</div>
- <div class="input">
- <div class="western-disease-tags" v-if="editData.westernDisease.length">
- <el-tag
- v-for="code in editData.westernDisease"
- :key="code"
- size="mini"
- closable
- @close="removeWesternDisease(code)"
- >{{ westernDiseaseNameMap[code] || code }}</el-tag>
- </div>
- <el-autocomplete
- size="mini"
- v-model="westernDiseaseSearch"
- :fetch-suggestions="queryWesternDisease"
- value-key="westname"
- placeholder="请搜索选择"
- clearable
- :trigger-on-focus="true"
- @select="onWesternDiseaseSelect"
- >
- <template slot-scope="{ item }">
- <div :class="{ 'autocomplete-disabled': item._disabled }">
- {{ item.westname }}
- </div>
- </template>
- </el-autocomplete>
- </div>
- </div>
- <div class="form-item flex flex-col-center form-item-half">
- <span style="opacity:0">*</span>
- <div class="name">功效与适应症:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="editData.efficacy"
- placeholder="请输入"
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <div class="name">证型:</div>
- <div class="input">
- <el-autocomplete
- size="mini"
- v-model="editData.symptomName"
- :fetch-suggestions="querySymptom"
- value-key="symname"
- placeholder="请搜索选择"
- clearable
- :trigger-on-focus="true"
- @select="onSymptomSelect"
- @clear="onSymptomClear"
- >
- <template slot-scope="{ item }">
- <div :class="{ 'autocomplete-disabled': item._disabled }">
- {{ item.symname }}
- </div>
- </template>
- </el-autocomplete>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <div class="name">治法:</div>
- <div class="input">
- <el-autocomplete
- size="mini"
- v-model="editData.therapyName"
- :fetch-suggestions="queryTherapy"
- value-key="therapy"
- placeholder="请搜索选择"
- clearable
- :trigger-on-focus="true"
- @select="onTherapySelect"
- @clear="onTherapyClear"
- >
- <template slot-scope="{ item }">
- <div :class="{ 'autocomplete-disabled': item._disabled }">
- {{ item.therapy }}
- </div>
- </template>
- </el-autocomplete>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <span style="opacity:0">*</span>
- <el-checkbox v-model="editData.isUnified" class="unified-checkbox">统建处方</el-checkbox>
- </div>
- <div class="form-item flex flex-col-center" v-if="editData.isUnified">
- <div class="name"><span style="color: red">*</span> 医派:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="editData.medicalSchool"
- placeholder="请输入"
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center" v-if="editData.isUnified">
- <div class="name"><span style="color: red">*</span> 科室:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="editData.department"
- placeholder="请输入"
- ></el-input>
- </div>
- </div>
- </div>
- <!-- 配穴表格 -->
- <AcupointTable
- ref="acupointTable"
- v-model="editData.acupoints"
- :isEditable.sync="editData.isEditable"
- :detailTypes.sync="editData.detailTypes"
- :statistics.sync="editData.statistics"
- :showGuide="true"
- @save="onAcupointSave"
- />
- </div>
- </div>
- </popup>
- <!-- 查看详情弹窗 -->
- <popup
- distanceTop="5vh"
- fullscreen
- :showBtns="false"
- :showDialog.sync="showViewDialog"
- :loading="viewLoading"
- title="查看适宜技术协定方"
- >
- <div slot="body" class="dialog-body-wrapper">
- <div class="dialog-back-btn" @click="showViewDialog = false">返回</div>
- <div class="dialog-scroll-area">
- <div class="dialog-form flex-wrap">
- <div class="form-item flex flex-col-center">
- <div class="name">方名:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.name"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">中医病名:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.disName"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">证型:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.synName"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">治法:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.theName"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">西医诊断:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.westernDiag"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">功效与适应症:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.effect"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">共享至:</div>
- <div class="input">
- <el-select size="mini" v-model="viewData.showType" disabled>
- <el-option label="个人" value="0"></el-option>
- <el-option label="科室" value="1"></el-option>
- <el-option label="机构" value="2"></el-option>
- </el-select>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">处方出处:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.provenance"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">统建处方:</div>
- <div class="input">
- <el-checkbox
- v-model="viewData.isUnifiedChecked"
- true-label="1"
- false-label="0"
- disabled
- ></el-checkbox>
- </div>
- </div>
- <template v-if="viewData.purposeType === '1'">
- <div class="form-item flex flex-col-center">
- <div class="name">医派:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.sectCategory"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- <div class="form-item flex flex-col-center">
- <div class="name">科室:</div>
- <div class="input">
- <el-input
- size="mini"
- v-model="viewData.sectDept"
- placeholder="-"
- disabled
- ></el-input>
- </div>
- </div>
- </template>
- </div>
- <SuitableTechDetail ref="techDetail" :detailData="viewData" />
- </div>
- </div>
- </popup>
- </div>
- </template>
- <script>
- import popup from "@/components/Propup.vue";
- import AcupointTable from "./components/AcupointTable.vue";
- import SuitableTechDetail from "./components/SuitableTechDetail.vue";
- import {
- getDiseaseListMethod,
- getSymptomListMethod,
- getTherapyListMethod,
- } from "@/request/api.illness.js";
- import {
- getSuitableTechList,
- getSuitableTechInfo,
- saveSuitableTech,
- deleteSuitableTech,
- getMappedNondrugItemList,
- } from "@/api/technology.js";
- import { getXDiseaseName } from "@/api/knowledge.js";
- export default {
- name: "SuitableTech",
- components: { popup, AcupointTable, SuitableTechDetail },
- data() {
- return {
- searchData: {
- name: "",
- shareType: "0",
- userName: "",
- isUnified: "",
- medicalSchool: "",
- department: "",
- includeItem: "",
- efficacy: "",
- },
- // 下拉选项
- diseaseOptions: [],
- symptomOptions: [],
- therapyOptions: [],
- westernDiseaseOptions: [],
- westernDiseaseNameMap: {},
- westernDiseaseSearch: "",
- westernDiseasePage: 1,
- westernDiseaseHasMore: true,
- projectOptions: [],
- // 下拉加载状态
- diseaseLoading: false,
- symptomLoading: false,
- therapyLoading: false,
- westernDiseaseLoading: false,
- projectLoading: false,
- // 表格数据
- tableData: [],
- tableLoading: false,
- expandRows: [],
- page: 1,
- limit: 10,
- total: 0,
- // 弹窗相关
- showEditDialog: false,
- editLoading: false,
- editData: {
- statistics: {},
- westernDisease: [],
- chineseDiseaseName: "",
- symptomName: "",
- therapyName: "",
- },
- // 查看详情弹窗
- showViewDialog: false,
- viewLoading: false,
- viewData: {},
- };
- },
- computed: {
- userNameLabel() {
- const map = {
- "0": "姓名",
- "1": "科室名称",
- "2": "机构名称",
- };
- return map[this.searchData.shareType] || "姓名";
- },
- currentUserId() {
- const userInfo = this.$store.state.user.userInfo || {};
- return userInfo.pid;
- },
- shareOptions() {
- const userInfo = this.$store.state.user.userInfo || {};
- const perm = String(userInfo.prescriptionSharePerm || "");
- const permList = perm.split(/[,,]/).map(v => v.trim());
- const has = (v) => permList.includes(String(v));
- const options = [];
- if (has(0)) options.push({ label: "个人", value: "0" });
- if (has(1) || has(2)) options.push({ label: "科室", value: "1" });
- if (has(3)) options.push({ label: "医疗机构", value: "2" });
- return options;
- },
- defaultShareType() {
- const options = this.shareOptions;
- return options.length ? options[0].value : "0";
- },
- },
- created() {
- this.getList();
- },
- methods: {
- // 中医病名搜索
- async queryDisease(queryString, cb) {
- this._prevDiseaseInput = queryString;
- try {
- const { list } = await getDiseaseListMethod(1, 9999, {
- keyword: queryString || "",
- });
- if (list && list.length > 0) {
- cb(list);
- } else {
- cb([{ disname: "暂无数据", _disabled: true }]);
- }
- } catch (e) {
- console.error("搜索中医病名失败", e);
- cb([{ disname: "搜索失败,请重试", _disabled: true }]);
- }
- },
- onDiseaseSelect(item) {
- if (item._disabled) {
- // 恢复为点击前的输入文字
- this.$nextTick(() => {
- this.editData.chineseDiseaseName = this._prevDiseaseInput || "";
- });
- return;
- }
- this.editData.chineseDisease = String(item.disid);
- this.editData.chineseDiseaseName = item.disname;
- this.editData.disCode = item.disCode || "";
- // 联动加载证型
- this.editData.symptomid = "";
- this.editData.symptomName = "";
- this.symptomOptions = [];
- // 联动清空治法
- this.editData.therapyCode = "";
- this.editData.therapyName = "";
- this.therapyOptions = [];
- this.querySymptom("", () => {});
- },
- onDiseaseClear() {
- this.editData.chineseDisease = "";
- this.editData.chineseDiseaseName = "";
- this.editData.disCode = "";
- this.editData.symptomid = "";
- this.editData.symptomName = "";
- this.symptomOptions = [];
- this.editData.therapyCode = "";
- this.editData.therapyName = "";
- this.therapyOptions = [];
- },
- // ========== 证型搜索 ==========
- async querySymptom(queryString, cb) {
- this._prevSymptomInput = queryString;
- try {
- const params = { keyword: queryString || "" };
- if (this.editData.chineseDisease)
- params.disid = this.editData.chineseDisease;
- if (this.editData.disCode) params.disCode = this.editData.disCode;
- const { list } = await getSymptomListMethod(1, 9999, params);
- if (list && list.length > 0) {
- cb(list);
- } else {
- cb([{ symname: "暂无数据", _disabled: true }]);
- }
- } catch (e) {
- console.error("搜索证型失败", e);
- cb([{ symname: "搜索失败,请重试", _disabled: true }]);
- }
- },
- onSymptomSelect(item) {
- if (item._disabled) {
- this.$nextTick(() => {
- this.editData.symptomName = this._prevSymptomInput || "";
- });
- return;
- }
- this.editData.symptomid = String(item.symid);
- this.editData.symptomName = item.symname;
- this.editData.symptomCode = item.synCode || "";
- // 联动清空治法并重新加载
- this.editData.therapyCode = "";
- this.editData.therapyName = "";
- this.therapyOptions = [];
- if (item.symid) {
- this.queryTherapy("", () => {});
- }
- },
- onSymptomClear() {
- this.editData.symptomid = "";
- this.editData.symptomName = "";
- this.editData.symptomCode = "";
- // 联动清空治法
- this.editData.therapyCode = "";
- this.editData.therapyName = "";
- this.therapyOptions = [];
- },
- // ========== 治法搜索 ==========
- async queryTherapy(queryString, cb) {
- this._prevTherapyInput = queryString;
- try {
- const params = { keyword: queryString || "" };
- if (this.editData.disCode) params.disCode = this.editData.disCode;
- if (this.editData.symptomid) {
- params.symptomCode = this.editData.symptomid;
- params.symid = this.editData.symptomid;
- }
- const { list } = await getTherapyListMethod(1, 9999, params);
- if (list && list.length > 0) {
- cb(list);
- } else {
- cb([{ therapy: "暂无数据", _disabled: true }]);
- }
- } catch (e) {
- console.error("搜索治法失败", e);
- cb([{ therapy: "搜索失败,请重试", _disabled: true }]);
- }
- },
- onTherapySelect(item) {
- if (item._disabled) {
- this.$nextTick(() => {
- this.editData.therapyName = this._prevTherapyInput || "";
- });
- return;
- }
- this.editData.therapyCode = String(item.therapyCode);
- this.editData.therapyName = item.therapy;
- },
- onTherapyClear() {
- this.editData.therapyCode = "";
- this.editData.therapyName = "";
- },
- // ========== 西医诊断搜索(分页) ==========
- async searchWesternDisease(query) {
- this.westernDiseasePage = 1;
- this.westernDiseaseHasMore = true;
- this._wdQuery = query || "";
- this.westernDiseaseLoading = true;
- try {
- const pinyin = /^[A-Za-z]+$/g;
- const serchtype = query && pinyin.test(query) ? "1" : "";
- const res = await getXDiseaseName({
- pageid: 1,
- pagesize: 200,
- keyword: query || "",
- serchtype,
- });
- if (res.code == 0) {
- const list = res.data?.wests || [];
- // 保留已选中但不在搜索结果中的选项
- const selectedCodes = Array.isArray(this.editData.westernDisease)
- ? this.editData.westernDisease
- : [];
- const resultCodes = new Set(list.map((i) => i.westcode));
- const preserved = selectedCodes
- .filter((code) => !resultCodes.has(code))
- .map((code) => ({
- westcode: code,
- westname: this.westernDiseaseNameMap[code] || code,
- }));
- this.westernDiseaseOptions = [...preserved, ...list];
- this.westernDiseaseHasMore = list.length >= 200;
- list.forEach((item) => {
- if (item.westcode && item.westname) {
- this.westernDiseaseNameMap[item.westcode] = item.westname;
- }
- });
- }
- } catch (e) {
- console.error("搜索西医诊断失败", e);
- } finally {
- this.westernDiseaseLoading = false;
- }
- },
- async loadMoreWesternDisease() {
- if (this.westernDiseaseLoading || !this.westernDiseaseHasMore) return;
- this.westernDiseasePage++;
- this.westernDiseaseLoading = true;
- try {
- const query = this._wdQuery || "";
- const pinyin = /^[A-Za-z]+$/g;
- const serchtype = query && pinyin.test(query) ? "1" : "";
- const res = await getXDiseaseName({
- pageid: this.westernDiseasePage,
- pagesize: 200,
- keyword: query,
- serchtype,
- });
- if (res.code == 0) {
- const list = res.data?.wests || [];
- this.westernDiseaseOptions = this.westernDiseaseOptions.concat(list);
- this.westernDiseaseHasMore = list.length >= 200;
- list.forEach((item) => {
- if (item.westcode && item.westname) {
- this.westernDiseaseNameMap[item.westcode] = item.westname;
- }
- });
- }
- } catch (e) {
- console.error("加载更多西医诊断失败", e);
- } finally {
- this.westernDiseaseLoading = false;
- }
- },
- onWesternDiseaseVisible(show) {
- if (!show) {
- const wrap = document.querySelector(
- ".western-disease-select .el-scrollbar__wrap",
- );
- if (wrap && this._wdScroll) {
- wrap.removeEventListener("scroll", this._wdScroll);
- }
- return;
- }
- // 首次打开且无数据时加载初始列表
- if (this.westernDiseaseOptions.length === 0) {
- this.searchWesternDisease("");
- }
- this.$nextTick(() => {
- const wrap = document.querySelector(
- ".western-disease-select .el-scrollbar__wrap",
- );
- if (wrap) {
- wrap.addEventListener(
- "scroll",
- (this._wdScroll = () => {
- if (wrap.scrollHeight - wrap.scrollTop <= wrap.clientHeight + 5) {
- this.loadMoreWesternDisease();
- }
- }),
- );
- }
- });
- },
- async queryWesternDisease(queryString, cb) {
- await this.searchWesternDisease(queryString);
- if (this.westernDiseaseOptions.length > 0) {
- cb(this.westernDiseaseOptions);
- } else {
- cb([{ westname: "暂无数据", _disabled: true }]);
- }
- },
- onWesternDiseaseSelect(item) {
- if (item._disabled) {
- this.$nextTick(() => {
- this.westernDiseaseSearch = "";
- });
- return;
- }
- const code = String(item.westcode);
- if (!this.editData.westernDisease.includes(code)) {
- this.editData.westernDisease.push(code);
- this.westernDiseaseNameMap[code] = item.westname;
- this.updateWesternDiseaseName();
- }
- this.westernDiseaseSearch = "";
- this.$nextTick(() => {
- this.searchWesternDisease("");
- });
- },
- removeWesternDisease(code) {
- this.editData.westernDisease = this.editData.westernDisease.filter((c) => c !== code);
- this.updateWesternDiseaseName();
- },
- updateWesternDiseaseName() {
- const names = this.editData.westernDisease
- .map((code) => this.westernDiseaseNameMap[code] || "")
- .filter(Boolean);
- this.editData.westernDiseaseName = names.join(",");
- },
- // ========== 涵盖项目模糊搜索 ==========
- async searchProject(query) {
- this.projectLoading = true;
- try {
- const res = await getMappedNondrugItemList({
- pageNum: 1,
- pageSize: 100,
- itemName: query || undefined,
- });
- if (res.ResultCode === 0) {
- this.projectOptions = res.Data?.Items || res.Data || [];
- }
- } catch (e) {
- console.error("搜索涵盖项目失败", e);
- } finally {
- this.projectLoading = false;
- }
- },
- search() {
- this.page = 1;
- this.getList();
- },
- clearFilter() {
- this.searchData = {
- name: "",
- shareType: "0",
- userName: "",
- isUnified: "",
- medicalSchool: "",
- department: "",
- includeItem: "",
- efficacy: "",
- };
- this.getList();
- },
- sizeC(e) {
- this.page = e;
- this.getList();
- },
- handleExpandChange(row, expandedRows) {
- this.expandRows = expandedRows.map((item) => item.pid);
- },
- formatTreatClass(val) {
- const map = {
- 1: "艾灸疗法",
- 2: "非艾·灸法",
- 3: "拔罐疗法",
- 4: "针刺疗法",
- 5: "敷熨熏浴",
- 6: "推拿疗法",
- 7: "耳穴疗法",
- 8: "刮痧疗法",
- 9: "物理疗法",
- 10: "中医肛肠",
- 11: "中医微创",
- 12: "其他疗法",
- 194: "中医骨伤",
- };
- return map[val] || val || "-";
- },
- formatDetailList(row) {
- const parts = [];
- const extractNames = (arr) => {
- if (!Array.isArray(arr) || !arr.length) return "";
- return arr
- .map((item) => item.name || "")
- .filter(Boolean)
- .join("、");
- };
- const pointNames = extractNames(row.detailPoint);
- if (pointNames) parts.push("穴位: " + pointNames);
- const meridianNames = extractNames(row.detailMeridian);
- if (meridianNames) parts.push("经络: " + meridianNames);
- const earNames = extractNames(row.detailEarPoint);
- if (earNames) parts.push("耳穴: " + earNames);
- const bodyNames = extractNames(row.detailBodyPart);
- if (bodyNames) parts.push("部位: " + bodyNames);
- const otherNames = extractNames(row.detailOther);
- if (otherNames) parts.push("其他: " + otherNames);
- return parts.join(";") || "-";
- },
- handleEditBack() {
- if (!this.editData.pid) {
- this.$confirm("协定方未保存,返回则会清空当前编辑内容", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.showEditDialog = false;
- })
- .catch(() => {});
- } else {
- this.showEditDialog = false;
- }
- },
- async openEditDialog(row) {
- if (row) {
- // 调用详情接口获取完整数据
- this.editLoading = true;
- let detail = row;
- try {
- const res = await getSuitableTechInfo(row.pid);
- if (res.ResultCode === 0) {
- detail = res.Data || row;
- }
- } catch (e) {
- console.error("获取详情失败", e);
- } finally {
- this.editLoading = false;
- }
- // 用详情数据构造下拉选项,确保回显时下拉框能显示名称
- this.diseaseOptions =
- detail.disId != null
- ? [
- {
- disid: detail.disId,
- disname: detail.disName,
- disCode: detail.disCode,
- },
- ]
- : [];
- this.symptomOptions =
- detail.synCode != null
- ? [
- {
- symid: detail.synCode,
- symname: detail.synName,
- synCode: detail.synCode,
- },
- ]
- : [];
- this.therapyOptions =
- detail.theCode != null
- ? [
- {
- therapyCode: detail.theCode,
- therapy: detail.theName,
- therapyName: detail.theName,
- },
- ]
- : [];
- if (detail.westernCode) {
- const codes = String(detail.westernCode).split(",");
- const names = detail.westernDiag
- ? String(detail.westernDiag).split(",")
- : [];
- this.westernDiseaseOptions = codes.map((code, idx) => ({
- westcode: code.trim(),
- westname: (names[idx] || "").trim() || code.trim(),
- }));
- } else {
- this.westernDiseaseOptions = [];
- }
- // 同步到名称映射
- this.westernDiseaseNameMap = {};
- this.westernDiseaseOptions.forEach((item) => {
- if (item.westcode && item.westname) {
- this.westernDiseaseNameMap[item.westcode] = item.westname;
- }
- });
- this.editData = {
- ...detail,
- showType: String(detail.showType ?? "0"),
- efficacy: detail.effect || "",
- source: detail.provenance || "",
- isUnified: String(detail.purposeType) === "1",
- medicalSchool: detail.sectCategory || "",
- department: detail.sectDept || "",
- chineseDisease: detail.disId != null ? String(detail.disId) : "",
- chineseDiseaseName: detail.disName || "",
- disCode: detail.disCode || "",
- symptomid: detail.synCode != null ? String(detail.synCode) : "",
- symptomName: detail.synName || "",
- symptomCode: detail.synCode || "",
- westernDisease: detail.westernCode
- ? String(detail.westernCode)
- .split(",")
- .map((s) => s.trim())
- : [],
- westernDiseaseName: detail.westernDiag || "",
- therapyCode: detail.theCode != null ? String(detail.theCode) : "",
- therapyName: detail.theName || "",
- acupoints: detail.acupoints || [],
- detailTypes: detail.detailTypes || ["穴位"],
- statistics: detail.statistics || {},
- };
- this.showEditDialog = true;
- // 弹窗显示后回填 treatmentList 到 AcupointTable
- this.$nextTick(() => {
- if (this.$refs.acupointTable && detail.treatmentList) {
- this.$refs.acupointTable.loadFromServerData(detail.treatmentList);
- }
- });
- } else {
- this.editData = {
- name: "",
- chineseDisease: "",
- chineseDiseaseName: "",
- disCode: "",
- symptomid: "",
- symptomName: "",
- therapyCode: "",
- therapyName: "",
- westernDisease: [],
- westernDiseaseName: "",
- efficacy: "",
- showType: this.defaultShareType,
- source: "",
- isUnified: false,
- medicalSchool: "",
- department: "",
- isEditable: "1",
- detailTypes: [""],
- acupoints: [],
- statistics: {},
- };
- this.showEditDialog = true;
- }
- },
- async submitEditData() {
- // 通过 AcupointTable 的 handleSave 触发保存流程
- this.$refs.acupointTable.handleSave();
- },
- async onAcupointSave(treatmentList, institutionInfo) {
- // 从下拉选项中查找选中项的名称
- const selectedDisease = this.diseaseOptions.find(
- (o) => o.disid === this.editData.chineseDisease,
- );
- const selectedSymptom = this.symptomOptions.find(
- (o) => o.symid === this.editData.symptomid,
- );
- const selectedTherapy = this.therapyOptions.find(
- (o) => o.therapyCode === this.editData.therapyCode,
- );
- const params = {
- // 必填字段
- name: this.editData.name,
- showType: this.editData.showType || "0",
- // 基本信息
- effect: this.editData.efficacy || "",
- provenance: this.editData.source || "",
- purposeType: this.editData.isUnified ? "1" : "0",
- sectCategory: this.editData.medicalSchool || "",
- sectDept: this.editData.department || "",
- // 疾病信息
- disId: this.editData.chineseDisease || undefined,
- disName: selectedDisease
- ? selectedDisease.disname
- : this.editData.chineseDiseaseName || "",
- disCode: this.editData.disCode || "",
- // 证型信息
- synId: undefined,
- synName: selectedSymptom
- ? selectedSymptom.symname
- : this.editData.symptomName || "",
- synCode: this.editData.symptomid || "",
- // 治法信息
- theCode: this.editData.therapyCode || "",
- theName: selectedTherapy
- ? selectedTherapy.therapy
- : this.editData.therapyName || "",
- // 西医诊断
- westernCode: Array.isArray(this.editData.westernDisease)
- ? this.editData.westernDisease.join(",")
- : this.editData.westernDisease || "",
- westernDiag: this.editData.westernDiseaseName || "",
- // 总金额
- totalAmount: parseFloat(this.editData.statistics?.totalPrice) || 0,
- // 机构信息:来自 getNondrugItemDetail 接口(新增时),或 editData 回显(编辑时)
- ygtid: institutionInfo?.ygtid || this.editData.ygtid || "",
- departmentId:
- institutionInfo?.departmentId || this.editData.departmentId || "",
- stitutionsId:
- institutionInfo?.stitutionsId || this.editData.stitutionsId || "",
- stitutionsName:
- institutionInfo?.stitutionsName || this.editData.stitutionsName || "",
- // 治疗明细项列表
- treatmentList,
- };
- // 编辑时传递 pid
- if (this.editData.pid) {
- params.pid = this.editData.pid;
- }
- try {
- const res = await saveSuitableTech(params);
- if (res.ResultCode === 0) {
- this.$message.success(this.editData.pid ? "编辑成功" : "新增成功");
- this.showEditDialog = false;
- this.getList();
- }
- // 后端返回错误时,request.js 响应拦截器已弹出错误消息并 reject,
- // 这里不需要再重复弹窗;网络错误同样由拦截器处理
- } catch (e) {
- console.error("保存失败", e);
- } finally {
- if (this.$refs.acupointTable) {
- this.$refs.acupointTable.saveDone();
- }
- }
- },
- handleDelete(row) {
- this.$confirm("确认删除该条记录?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- const res = await deleteSuitableTech({ pid: row.pid });
- if (res.ResultCode === 0) {
- this.$message.success("删除成功");
- this.getList();
- } else {
- this.$message.error(res.ResultInfo || "删除失败");
- }
- } catch (e) {
- console.error("删除失败", e);
- this.$message.error("删除失败");
- }
- })
- .catch(() => {});
- },
- // 查看详情
- async handleView(row) {
- this.viewLoading = true;
- this.showViewDialog = true;
- this.viewData = {};
- try {
- const res = await getSuitableTechInfo(row.pid);
- if (res.ResultCode === 0) {
- const data = res.Data || {};
- this.viewData = {
- ...data,
- showType: String(data.showType ?? "0"),
- isUnifiedChecked: data.purposeType || "0",
- };
- }
- } catch (e) {
- console.error("获取详情失败", e);
- } finally {
- this.viewLoading = false;
- }
- },
- async getList() {
- this.tableLoading = true;
- try {
- const params = {
- pageNum: this.page,
- pageSize: this.limit,
- name: this.searchData.name || undefined,
- effect: this.searchData.efficacy || undefined,
- showType: this.searchData.shareType || undefined,
- sectCategory: this.searchData.medicalSchool || undefined,
- sectDept: this.searchData.department || undefined,
- purposeType: this.searchData.isUnified || undefined,
- coverageContent: this.searchData.includeItem || undefined,
- rangtypeName: this.searchData.userName || undefined,
- };
- const res = await getSuitableTechList(params);
- if (res.ResultCode === 0) {
- const list = res.Data?.Items || [];
- this.total = res.Data?.totalRecordCount || 0;
- this.tableData = list.map((item, index) => ({
- ...item,
- index: (this.page - 1) * this.limit + index + 1,
- subList: (item.treatmentList || []).map((sub, sIdx) => ({
- ...sub,
- index: sIdx + 1,
- })),
- }));
- }
- } catch (e) {
- console.error("获取列表失败", e);
- } finally {
- this.tableLoading = false;
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @import "../../style/common.scss";
- @import "../../style/base.scss";
- .suitable-tech {
- width: 100%;
- height: 100%;
- }
- .suitable-tech ::v-deep .screening-form {
- .screening-item {
- width: 20%;
- flex: none;
- .el-input,
- .el-select {
- width: 100%;
- }
- }
- }
- .suitable-tech ::v-deep .popup-container {
- display: flex;
- flex-direction: column;
- overflow: hidden !important;
- height: calc(100vh - 60px) !important;
- }
- .dialog-body-wrapper {
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- .dialog-back-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 14px;
- color: #333;
- background: #fff;
- border: 1px solid #ccc;
- border-radius: 4px;
- padding: 4px 16px;
- cursor: pointer;
- margin-bottom: 10px;
- width: fit-content;
- &:hover {
- opacity: 0.8;
- }
- }
- .dialog-content-box {
- flex: 1;
- min-height: 0;
- display: flex;
- flex-direction: column;
- border: 1px solid #ddd;
- border-radius: 4px;
- padding: 10px;
- overflow: hidden;
- }
- .screening-btn-group {
- display: flex;
- align-items: center;
- margin: 5px 0;
- }
- .share-badge {
- display: inline-block;
- min-width: 20px;
- height: 20px;
- line-height: 20px;
- padding: 0 6px;
- background: #ffae45;
- color: #fff;
- border-radius: 10px;
- font-size: 12px;
- text-align: center;
- }
- .expand-table {
- padding: 10px 20px;
- }
- .table {
- padding: 10px 10px;
- background: #ffffff;
- border-radius: 5px;
- margin-top: 10px;
- height: 70vh;
- .table-container {
- height: 90%;
- }
- .today-table {
- height: 100%;
- .find-detail {
- width: 60px;
- height: 24px;
- border: 1px solid #ffae45;
- border-radius: 2px;
- text-align: center;
- color: #fff;
- font-size: 14px;
- cursor: pointer;
- margin: 0 2px;
- background: #ffae45;
- }
- .find-fill {
- background: #5386f6 !important;
- color: #fff !important;
- border: 1px solid #5386f6;
- }
- .find-fill1 {
- background: #ff6245;
- color: #fff !important;
- border: 1px solid #ff6245;
- }
- .find-fill2 {
- background: #68a8ff !important;
- color: #fff !important;
- border: 1px solid #68a8ff;
- }
- .find-detail.is-disabled {
- opacity: 0.5;
- cursor: not-allowed;
- pointer-events: none;
- }
- }
- }
- .form {
- width: 50%;
- .form-item {
- margin-bottom: 10px;
- span {
- color: red;
- }
- .name {
- width: 120px;
- }
- .input {
- flex: 1;
- }
- }
- }
- .dialog-form {
- display: flex;
- flex-wrap: wrap;
- flex-shrink: 0;
- .form-item {
- width: 25%;
- box-sizing: border-box;
- padding: 0 10px;
- margin-bottom: 10px;
- &.form-item-half {
- width: 50%;
- }
- .name {
- width: 110px;
- min-width: 110px;
- font-size: 14px;
- white-space: nowrap;
- text-align: right;
- margin-right: 5px;
- }
- .input {
- flex: 1;
- min-width: 0;
- .el-input,
- .el-select {
- width: 100%;
- }
- }
- .unified-checkbox {
- margin-left: 115px;
- }
- }
- }
- .dialog-scroll-area {
- flex: 1;
- min-height: 0;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .dialog-scroll-area ::v-deep .recipe-acupoint-wrapper {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- }
- .autocomplete-disabled {
- color: #999 !important;
- cursor: not-allowed !important;
- pointer-events: none;
- }
- .western-disease-tags {
- margin-bottom: 4px;
- .el-tag {
- margin-right: 4px;
- margin-bottom: 2px;
- }
- }
- .dialog-scroll-area ::v-deep .recipe-acupoint {
- flex: 1;
- min-height: 0;
- }
- </style>
- <style lang="scss" scoped>
- @media screen and (min-width: 1681px) and (max-width: 1920px) {
- .table {
- height: 81vh;
- .table-container {
- height: 94%;
- }
- }
- .today-table::v-deep .el-table td {
- padding: 18px 0;
- }
- .today-table::v-deep .el-table th {
- padding: 18px 0;
- }
- }
- @media screen and (min-width: 1601px) and (max-width: 1680px) {
- .table {
- height: 80vh;
- .table-container {
- height: 94%;
- }
- }
- .today-table::v-deep .el-table td {
- padding: 18px 0;
- }
- .today-table::v-deep .el-table th {
- padding: 18px 0;
- }
- }
- @media screen and (min-width: 1361px) and (max-width: 1600px) {
- .table {
- height: 72vh;
- .table-container {
- height: 90%;
- }
- }
- .today-table::v-deep .el-table td {
- padding: 5px 0;
- }
- .today-table::v-deep .el-table th {
- padding: 5px 0;
- }
- }
- @media screen and (min-width: 1281px) and (max-width: 1360px) {
- .table {
- height: 72vh;
- .table-container {
- height: 90%;
- }
- }
- .today-table::v-deep .el-table td {
- padding: 5px 0;
- }
- .today-table::v-deep .el-table th {
- padding: 5px 0;
- }
- }
- </style>
|