NationalSiMatch.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <el-select v-model="queryParam.ybType" style="width: 86px;margin-left: 4px">
  5. <el-option label="国家医保" :value="1"></el-option>
  6. <el-option label="工伤医保" :value="2"></el-option>
  7. </el-select>
  8. <el-select v-model="queryParam.status" style="width: 76px;margin-left: 4px" @change="data.list = []">
  9. <el-option v-for="item in statuses" :key="item.code" :label="item.name" :value="item.code"></el-option>
  10. </el-select>
  11. <el-select v-model="queryParam.delFlag" style="width: 76px;margin-left: 4px" @change="data.list = []">
  12. <el-option v-for="item in delFlags" :key="item.code" :label="item.name" :value="item.code"></el-option>
  13. </el-select>
  14. <el-select v-model="queryParam.uploadFlag" style="width: 76px;margin-left: 4px"
  15. clearable @change="data.list = []">
  16. <el-option v-for="item in uploadFlags" :key="item.code" :label="item.name" :value="item.code"></el-option>
  17. </el-select>
  18. <el-select v-model="queryParam.type" style="width: 120px;margin-left: 4px" @change="queryTypeChanged">
  19. <el-option v-for="item in types" :key="item.code" :label="item.name" :value="item.code"></el-option>
  20. </el-select>
  21. <el-input v-model="queryParam.code" placeholder="编码" clearable style="width: 100px;margin-left: 4px"></el-input>
  22. <el-input v-model="queryParam.name" placeholder="名称" clearable style="width: 160px;margin-left: 4px"></el-input>
  23. <el-divider direction="vertical"></el-divider>
  24. <span v-if="queryParam.status === 0">
  25. 模糊查询:
  26. <el-switch v-model="fuzzy" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
  27. </span>
  28. <el-button icon="Search" type="primary" @click="search" style="margin-left: 4px">检索</el-button>
  29. <span v-if="queryParam.status === 0 && queryParam.type >= 3">
  30. <el-button icon="Refresh" type="warning" @click="syncNewServiceOrItem" style="margin-left: 4px"> 同步新增{{ queryParam.type === 3 ? '项目' : '耗材' }} </el-button>
  31. </span>
  32. <span v-if="queryParam.status === 1">
  33. <el-button icon="Upload" type="primary" @click="beforeUploadMatch" style="margin-left: 4px">上传匹配关系</el-button>
  34. <el-button icon="Download" type="primary" @click="exportExcel" style="margin-left: 4px">导出EXCEL</el-button>
  35. </span>
  36. </template>
  37. <template #main>
  38. <el-table :data="data.list" :height="tableHeight" stripe @selection-change="handleSelectionChange">
  39. <el-table-column type="selection" width="50"></el-table-column>
  40. <el-table-column label="编码" prop="code"></el-table-column>
  41. <el-table-column label="名称" prop="name"></el-table-column>
  42. <el-table-column v-if="queryParam.type === 1" label="大小包装" prop="serial"></el-table-column>
  43. <el-table-column v-if="queryParam.type < 3" label="剂型" prop="dosage"></el-table-column>
  44. <el-table-column label="单位" prop="unit"></el-table-column>
  45. <el-table-column v-if="queryParam.type !== 3" label="规格" prop="specification"></el-table-column>
  46. <el-table-column v-if="queryParam.type === 3" label="内涵" prop="discription"></el-table-column>
  47. <el-table-column v-if="queryParam.type === 3" label="标准编码" prop="standardCode"></el-table-column>
  48. <el-table-column v-if="queryParam.type === 3" label="价格" prop="price"></el-table-column>
  49. <el-table-column v-if="queryParam.type < 3" label="批准文号" prop="approvalNumber"></el-table-column>
  50. <el-table-column v-if="queryParam.type !== 3" label="生产厂家" prop="factory"></el-table-column>
  51. <el-table-column v-if="queryParam.type === 3" label="地方名称" prop="localName"></el-table-column>
  52. <el-table-column v-if="queryParam.status === 1" label="国家名称" prop="nationalName"></el-table-column>
  53. <el-table-column v-if="queryParam.status === 1" label="国家代码" prop="nationalCode"></el-table-column>
  54. <el-table-column v-if="queryParam.status === 1" label="开始时间" prop="startTime"></el-table-column>
  55. <el-table-column v-if="queryParam.status === 1" label="结束时间" prop="endTime"></el-table-column>
  56. <el-table-column v-if="queryParam.status === 1" label="是否已上传">
  57. <template #default="scope">
  58. {{ cptYesOrNo(scope.row.uploadedFlag) }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="操作">
  62. <template #default="scope">
  63. <el-button icon="Edit" text @click="modifyLocalItem(scope.row)">修改</el-button>
  64. <el-button v-if="queryParam.status === 1" icon="RefreshLeft" text @click="rvkUploadMatch(scope.row)">撤销匹配上传 </el-button>
  65. <el-button v-if="queryParam.status === 0" icon="Aim" text @click="beforeMatch(scope.row)"> 匹配 </el-button>
  66. <el-button v-else icon="Close" text @click="deleteMatch(scope.row)">取消匹配</el-button>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <el-pagination
  71. :current-page="queryParam.currentPage"
  72. :page-size="queryParam.pageSize"
  73. :page-sizes="[15, 30, 45, 70, 100]"
  74. :total="data.total"
  75. layout="total, sizes, prev, pager, next, jumper"
  76. style="margin-top: 5px"
  77. @size-change="handleSizeChange"
  78. @current-change="handleCurrentChange"
  79. ></el-pagination>
  80. <el-dialog v-model="showNationalList" width="80%">
  81. <div class="data-title">HIS数据</div>
  82. <el-descriptions :column="4" border>
  83. <el-descriptions-item>
  84. <template #label> 编码</template>
  85. {{ data.row.code }}
  86. </el-descriptions-item>
  87. <el-descriptions-item>
  88. <template #label> 名称</template>
  89. {{ data.row.name }}
  90. </el-descriptions-item>
  91. <el-descriptions-item v-if="queryParam.type !== 3">
  92. <template #label> 大小包装</template>
  93. {{ data.row.serial === '01' ? '大包装' : '小包装' }}
  94. </el-descriptions-item>
  95. <el-descriptions-item v-if="queryParam.type !== 3">
  96. <template #label> 剂型</template>
  97. {{ data.row.dosage }}
  98. </el-descriptions-item>
  99. <el-descriptions-item>
  100. <template #label> 单位</template>
  101. {{ data.row.unit }}
  102. </el-descriptions-item>
  103. <el-descriptions-item v-if="queryParam.type === 3">
  104. <template #label> 标准编码</template>
  105. {{ data.row.standardCode }}
  106. </el-descriptions-item>
  107. <el-descriptions-item v-if="queryParam.type === 3">
  108. <template #label> 价格</template>
  109. {{ data.row.price }}
  110. </el-descriptions-item>
  111. <el-descriptions-item v-if="queryParam.type !== 3">
  112. <template #label> 规格</template>
  113. {{ data.row.specification }}
  114. </el-descriptions-item>
  115. <el-descriptions-item v-if="queryParam.type === 3">
  116. <template #label> 内涵</template>
  117. {{ data.row.discription }}
  118. </el-descriptions-item>
  119. <el-descriptions-item v-if="queryParam.type !== 3">
  120. <template #label> 批准文号</template>
  121. {{ data.row.approvalNumber }}
  122. </el-descriptions-item>
  123. <el-descriptions-item v-if="queryParam.type !== 3">
  124. <template #label> 生产厂家</template>
  125. {{ data.row.factory }}
  126. </el-descriptions-item>
  127. </el-descriptions>
  128. <div class="data-title">国家数据</div>
  129. <el-input v-show="queryParam.type === 3" v-model="discription" clearable style="width: 300px">
  130. <template #prepend>内涵过滤</template>
  131. </el-input>
  132. <el-input v-show="queryParam.type === 1 || queryParam.type === 4" v-model="factory" clearable style="width: 300px">
  133. <template #prepend>厂家过滤</template>
  134. </el-input>
  135. <el-divider v-show="queryParam.type === 4" direction="vertical"></el-divider>
  136. <el-input v-show="queryParam.type === 4" v-model="certiNo" clearable style="width: 320px">
  137. <template #prepend>注册证号过滤</template>
  138. </el-input>
  139. <el-input v-model="nationalCode" clearable style="width: 320px">
  140. <template #prepend>国家代码过虑</template>
  141. </el-input>
  142. <el-table :data="cptNationalItems" :height="dialogTableHeight" stripe>
  143. <el-table-column label="国家代码" prop="nationalCode"></el-table-column>
  144. <el-table-column label="国家名称" prop="nationalName"></el-table-column>
  145. <el-table-column v-if="queryParam.type === 1" label="剂型" prop="actualDosage"></el-table-column>
  146. <el-table-column v-if="queryParam.type === 1" label="规格" prop="specifications"></el-table-column>
  147. <el-table-column v-if="queryParam.type === 1" label="包装材质" prop="packingMaterial"></el-table-column>
  148. <el-table-column v-if="queryParam.type === 1" label="生产厂家" prop="factory"></el-table-column>
  149. <el-table-column v-if="queryParam.type === 1" label="批准文号" prop="approvalNumber"></el-table-column>
  150. <el-table-column v-if="queryParam.type === 1" label="药品本位码" prop="drugStandardCode"></el-table-column>
  151. <el-table-column v-if="queryParam.type === 3" label="项目内涵" prop="projectConnotation"></el-table-column>
  152. <el-table-column v-if="queryParam.type === 3" label="除外内容" prop="exclusions"></el-table-column>
  153. <el-table-column v-if="queryParam.type === 3" label="计价单位" prop="valuationUnit"></el-table-column>
  154. <el-table-column v-if="queryParam.type === 3" label="项目说明" prop="projectDescription"></el-table-column>
  155. <el-table-column v-if="queryParam.type === 4" label="医保通用名" prop="siName"></el-table-column>
  156. <el-table-column v-if="queryParam.type === 4" label="材质" prop="material"></el-table-column>
  157. <el-table-column v-if="queryParam.type === 4" label="耗材企业" prop="factory"></el-table-column>
  158. <el-table-column label="开始时间" prop="startTime"></el-table-column>
  159. <el-table-column label="结束时间" prop="endTime"></el-table-column>
  160. <el-table-column label="状态">
  161. <template #default="scope">
  162. <div v-html="filterMatchedCount(scope.row.matchedCount)"></div>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="匹配">
  166. <template #default="scope">
  167. <el-button circle icon="Pointer" type="success" @click="doMatch(scope.row)"></el-button>
  168. </template>
  169. </el-table-column>
  170. </el-table>
  171. <div style="height: 12px"></div>
  172. </el-dialog>
  173. <el-dialog
  174. title="耗材查询"
  175. v-model="showSuppliesQueryForm"
  176. width="420px">
  177. <div style="background: lightblue; color:black; padding: 4px; border-radius: 4px">
  178. 小提示:每次查询只需填写一项条件。如果填写了多项,程序也只会根据优先级最高的一项来查询。
  179. <div style="margin-top: 8px">
  180. 优先级:国家编码 > 注册证号 > 耗材名称
  181. </div>
  182. </div>
  183. <div style="width: 300px;margin-top: 16px">
  184. 国家编码:<el-input v-model="currentSupplyRow.nationalCode" placeholder="耗材国家编码 - 精准查询" clearable style="width: 200px"></el-input>
  185. </div>
  186. <div style="width: 300px;margin-top: 8px">
  187. 注册证号:<el-input v-model="currentSupplyRow.approvalNumber" placeholder="耗材注册证号 - 精准查询" clearable style="width: 200px"></el-input>
  188. </div>
  189. <div style="width: 300px;margin-top: 8px">
  190. 耗材名称:<el-input v-model="currentSupplyRow.fuzzyName" placeholder="耗材名称 - 模糊查询" clearable style="width: 200px"></el-input>
  191. </div>
  192. <template #footer>
  193. <el-button type="info" icon="Close" @click="showSuppliesQueryForm = false">取消</el-button>
  194. <el-button type="primary" icon="Search" @click="getNationalItems">查询</el-button>
  195. </template>
  196. </el-dialog>
  197. <el-drawer v-model="showModifyLocalItem" direction="rtl" title="项目修改">
  198. <div style="padding: 20px">
  199. <el-input v-model="data.row.name" clearable size="small">
  200. <template #prepend>项目名称</template>
  201. </el-input>
  202. <div v-if="queryParam.type === 4">
  203. <el-input v-model="data.row.specification" class="mt-12" clearable size="small">
  204. <template #prepend>项目规格</template>
  205. </el-input>
  206. <el-input v-model="data.row.factory" class="mt-12" clearable size="small">
  207. <template #prepend>生产厂家</template>
  208. </el-input>
  209. </div>
  210. <div v-if="queryParam.type === 3">
  211. <el-input v-model="data.row.price" class="mt-12" clearable size="small">
  212. <template #prepend>项目金额</template>
  213. </el-input>
  214. <el-input v-model="data.row.unit" class="mt-12" clearable size="small">
  215. <template #prepend>项目单位</template>
  216. </el-input>
  217. <el-input v-model="data.row.standardCode" class="mt-12" clearable size="small">
  218. <template #prepend>标准编码</template>
  219. </el-input>
  220. <div class="m-prepend">项目内涵</div>
  221. <el-input v-model="data.row.discription" class="mt-4" clearable rows="3" size="small" type="textarea"></el-input>
  222. </div>
  223. <div class="drawer-footer">
  224. <el-button icon="Close" size="small" @click="cancelModify">取消</el-button>
  225. <el-button icon="Check" size="small" type="primary" @click="confirmModify"> 保存</el-button>
  226. </div>
  227. </div>
  228. </el-drawer>
  229. <el-dialog v-model="showUploadPrm" title="请填写以下参数" width="20%">
  230. <div style="height: 8px"></div>
  231. <el-date-picker v-model="uploadPrm.beginDate" format="YYYY-MM-DD" placeholder="开始日期" value-format="YYYY-MM-DD"></el-date-picker>
  232. <div style="height: 8px"></div>
  233. <el-date-picker v-model="uploadPrm.endDate" format="YYYY-MM-DD" placeholder="结束日期" value-format="YYYY-MM-DD"></el-date-picker>
  234. <div style="height: 16px"></div>
  235. <el-button icon="Check" type="primary" @click="executeUploadMatch">确定上传</el-button>
  236. </el-dialog>
  237. </template>
  238. </page-layer>
  239. </template>
  240. <script setup name="NationalSiMatch">
  241. import { reactive, ref } from '@vue/reactivity'
  242. import {
  243. asyncNewNameForServicesOrItems,
  244. cancelMatch,
  245. executeMatch,
  246. selectLocalItems,
  247. selectNationalItems,
  248. updateLocalItem,
  249. } from '@/api/dictionary/national-match'
  250. import store from '@/store'
  251. import { ElMessage, ElMessageBox } from 'element-plus'
  252. import { computed } from '@vue/runtime-core'
  253. import { cptYesOrNo } from '@/utils/computed'
  254. import { revokeCatalogueContrast, uploadCatalogueContrast } from '@/api/medical-insurance/si-manage'
  255. import { Export } from '@/utils/ExportExcel'
  256. import { clone } from '@/utils/clone'
  257. import PageLayer from "@/layout/PageLayer";
  258. const windowSize = store.state.app.windowSize
  259. const tableHeight = windowSize.h - 50
  260. const dialogTableHeight = tableHeight * 0.8 - 160
  261. const statuses = initStatuses()
  262. const delFlags = initDelFlags()
  263. const uploadFlags = initUploadFlags()
  264. const types = initTypes()
  265. const factory = ref('')
  266. const certiNo = ref('')
  267. const nationalCode = ref('')
  268. const discription = ref('')
  269. const fuzzy = ref(false)
  270. const data = reactive({
  271. total: 0,
  272. list: [],
  273. row: {},
  274. national: [],
  275. })
  276. const selections = ref([])
  277. const showUploadPrm = ref(false)
  278. const uploadPrm = reactive({
  279. type: '',
  280. beginDate: '',
  281. endDate: '',
  282. })
  283. const cptNationalItems = computed(() => {
  284. if (queryParam.type === 1) {
  285. return data.national.filter((item) => {
  286. return item.factory.indexOf(factory.value) !== -1 && item.nationalCode.indexOf(nationalCode.value) !== -1
  287. })
  288. } else if (queryParam.type === 3) {
  289. return data.national.filter((item) => {
  290. return item.projectConnotation.indexOf(discription.value) !== -1 && item.nationalCode.indexOf(nationalCode.value) !== -1
  291. })
  292. } else if (queryParam.type === 4) {
  293. return data.national.filter((item) => {
  294. return item.factory.indexOf(factory.value) !== -1 && item.nationalCode.indexOf(nationalCode.value) !== -1
  295. })
  296. } else {
  297. return data.national.filter((item) => {
  298. return item.nationalCode.indexOf(nationalCode.value) !== -1
  299. })
  300. }
  301. })
  302. const queryParam = reactive({
  303. ybType: 1,
  304. status: 0,
  305. delFlag: 0,
  306. uploadFlag: null,
  307. type: 1,
  308. code: null,
  309. name: null,
  310. pageSize: 30,
  311. currentPage: 1,
  312. isExport: false,
  313. })
  314. const queryTypeChanged = (val) => {
  315. data.list = []
  316. data.national = []
  317. fuzzy.value = val === 4;
  318. }
  319. const search = () => {
  320. queryParam.isExport = false
  321. selectLocalItems(queryParam)
  322. .then((res) => {
  323. data.total = res.total
  324. data.list = res.list
  325. })
  326. .catch(() => {
  327. data.list = []
  328. })
  329. }
  330. const handleSizeChange = (val) => {
  331. queryParam.pageSize = val
  332. search()
  333. }
  334. const handleCurrentChange = (val) => {
  335. queryParam.currentPage = val
  336. search()
  337. }
  338. const syncNewServiceOrItem = () => {
  339. asyncNewNameForServicesOrItems().then((res) => {
  340. ElMessage({
  341. type: 'success',
  342. message: res,
  343. duration: 2000,
  344. showClose: true,
  345. })
  346. search()
  347. })
  348. }
  349. const showModifyLocalItem = ref(false)
  350. const modifyLocalItem = (row) => {
  351. if (row.uploadedFlag === 1) {
  352. ElMessage({
  353. message: '请先撤销匹配上传再修改。',
  354. type: 'warning',
  355. showClose: true,
  356. })
  357. return
  358. }
  359. data.row = row
  360. showModifyLocalItem.value = true
  361. }
  362. const cancelModify = () => {
  363. showModifyLocalItem.value = false
  364. search()
  365. }
  366. const confirmModify = () => {
  367. updateLocalItem(data.row).then((res) => {
  368. ElMessage({
  369. type: 'success',
  370. message: res,
  371. duration: 2000,
  372. showClose: true,
  373. })
  374. showModifyLocalItem.value = false
  375. })
  376. }
  377. const showNationalList = ref(false)
  378. const showSuppliesQueryForm = ref(false)
  379. const currentSupplyRow = ref({})
  380. const beforeMatch = (row) => {
  381. if(queryParam.type === 4 && queryParam.ybType === 1) {
  382. currentSupplyRow.value = clone(row)
  383. currentSupplyRow.value.fuzzyName = null
  384. showSuppliesQueryForm.value = true
  385. } else {
  386. if (fuzzy.value) {
  387. ElMessageBox.prompt('请调整关联查询的名称:', '提示', {
  388. inputValue: row.name,
  389. confirmButtonText: '查询',
  390. cancelButtonText: '取消',
  391. }).then(({ value }) => {
  392. row.fuzzyName = value
  393. getNationalItems(row)
  394. }).catch(() => {})
  395. } else {
  396. row.fuzzyName = row.name
  397. getNationalItems(row)
  398. }
  399. }
  400. }
  401. const getNationalItems = (row) => {
  402. if (queryParam.type === 4 && queryParam.ybType === 1) {
  403. row = currentSupplyRow.value
  404. }
  405. row.ybType = queryParam.ybType
  406. selectNationalItems(row)
  407. .then((res) => {
  408. factory.value = ''
  409. data.row = row
  410. data.national = res
  411. showNationalList.value = true
  412. showSuppliesQueryForm.value = false
  413. })
  414. .catch((e) => {
  415. if (e === '没有符合条件的国家目录。') {
  416. ElMessageBox.prompt('没有符合条件的国家目录,请输入国家编码进行手动匹配:', '提示', {
  417. inputValue: null,
  418. confirmButtonText: '匹配',
  419. cancelButtonText: '取消',
  420. inputPattern: /\S/,
  421. inputErrorMessage: '国家编码不能为空',
  422. })
  423. .then(({ value }) => {
  424. data.row = row
  425. data.row.nationalCode = value
  426. executeMatch(data.row).then((res) => {
  427. search()
  428. ElMessage({
  429. type: 'success',
  430. message: res,
  431. duration: 2000,
  432. showClose: true,
  433. })
  434. })
  435. })
  436. .catch(() => {})
  437. }
  438. })
  439. }
  440. const filterMatchedCount = (count) => {
  441. return count > 0 ? '<span style="color: red">已被匹配</span>' : '<span style="color: green">未被匹配</span>'
  442. }
  443. const doMatch = (row) => {
  444. const header =
  445. '<div style="font-weight: bold">选中的数据为:</div><div style="color: #409EFF">' +
  446. '本院名称:' +
  447. data.row.name +
  448. '</div>' +
  449. '<div style="color:red">' +
  450. '<div>' +
  451. '国家名称:' +
  452. row.nationalName +
  453. '</div>' +
  454. '<div>' +
  455. '国家代码:' +
  456. row.nationalCode +
  457. '</div>' +
  458. '</div>'
  459. const medOnly =
  460. '<div style="color: #409EFF; margin-top: 8px">' +
  461. '本院规格:' +
  462. data.row.specification +
  463. '</div>' +
  464. '<div style="color:red">' +
  465. '<div>' +
  466. '注册规格:' +
  467. row.makeRegisteredSpecification +
  468. '</div>' +
  469. '<div>' +
  470. '实际规格:' +
  471. row.makeActualSpecification +
  472. '</div>' +
  473. '</div>'
  474. const srvcOnly = '<div style="color: #409EAA">' + '地方名称:' + row.localMedicalServiceName + '</div>'
  475. const supplyOnly = '<div style="color: #409EAA">' + '注册证号:' + row.registrationCertificateNo + '</div>'
  476. const end = '<div style="font-weight: bold"d>是否确认匹配?</div>'
  477. let msg = ''
  478. if (queryParam.type === 3) {
  479. msg = header + srvcOnly + end
  480. } else if (queryParam.type === 4) {
  481. msg = header + supplyOnly + end
  482. } else {
  483. msg = header + medOnly + end
  484. }
  485. ElMessageBox.confirm(msg, '提示', {
  486. dangerouslyUseHTMLString: true,
  487. type: 'warning',
  488. confirmButtonText: '确认匹配',
  489. cancelButtonText: '取消',
  490. }).then(() => {
  491. data.row.nationalCode = row.nationalCode
  492. data.row.nationalName = row.nationalName
  493. if (queryParam.ybType === 2) {
  494. data.row.ybType = 2
  495. data.row.injuryUniqueId = row.injuryUniqueId
  496. data.row.catalogueType = row.catalogueType
  497. data.row.fundType = row.fundType
  498. }
  499. executeMatch(data.row).then((res) => {
  500. search()
  501. showNationalList.value = false
  502. ElMessage({
  503. type: 'success',
  504. message: res,
  505. duration: 2000,
  506. showClose: true,
  507. })
  508. });
  509. }).catch({})
  510. }
  511. const deleteMatch = (row) => {
  512. row.ybType = queryParam.ybType
  513. if (row.uploadedFlag === 1) {
  514. ElMessage({
  515. message: '请先撤销匹配上传再取消匹配。',
  516. type: 'warning',
  517. showClose: true,
  518. })
  519. return
  520. }
  521. cancelMatch(row).then((res) => {
  522. ElMessage({
  523. type: 'success',
  524. message: res,
  525. duration: 2000,
  526. showClose: true,
  527. })
  528. search()
  529. })
  530. }
  531. const handleSelectionChange = (val) => {
  532. selections.value = val
  533. }
  534. const beforeUploadMatch = () => {
  535. if (selections.value.length === 0) {
  536. ElMessage({
  537. message: '请选择要上传的条目!',
  538. type: 'warning',
  539. showClose: true,
  540. })
  541. return
  542. }
  543. uploadPrm.type = queryParam.type
  544. uploadPrm.ybType = queryParam.ybType
  545. showUploadPrm.value = true
  546. }
  547. const executeUploadMatch = () => {
  548. if (!uploadPrm.beginDate || !uploadPrm.endDate) {
  549. ElMessage({
  550. message: '请填写开始日期和结束日期。',
  551. type: 'warning',
  552. showClose: true,
  553. })
  554. return
  555. }
  556. uploadPrm.list = selections
  557. uploadCatalogueContrast(uploadPrm).then((res) => {
  558. ElMessage({
  559. message: res,
  560. type: 'success',
  561. showClose: true,
  562. })
  563. showUploadPrm.value = false
  564. })
  565. }
  566. const rvkUploadMatch = (row) => {
  567. uploadPrm.type = queryParam.type
  568. uploadPrm.ybType = queryParam.ybType
  569. uploadPrm.chargeCode = row.code
  570. uploadPrm.nationalCode = row.nationalCode
  571. uploadPrm.list = new Array(row)
  572. revokeCatalogueContrast(uploadPrm).then((res) => {
  573. ElMessage({
  574. message: res,
  575. type: 'success',
  576. showClose: true,
  577. })
  578. })
  579. }
  580. const exportExcel = () => {
  581. queryParam.isExport = true
  582. selectLocalItems(queryParam).then((res) => {
  583. queryParam.isExport = false
  584. const fields = {
  585. code: '院内码',
  586. name: '院内名称',
  587. nationalCode: '国家编码',
  588. nationalName: '国家名称',
  589. startTime: '开始日期',
  590. endTime: '结束日期',
  591. localName: '地方编码',
  592. unit: '单位',
  593. serial: '大小包装',
  594. dosage: '剂型',
  595. specification: '规格',
  596. approvalNumber: '注册证号',
  597. factory: '厂家',
  598. discription: '内涵',
  599. standardCode: '标准编码',
  600. price: '价格',
  601. }
  602. Export(res.list, fields, '已匹配数据')
  603. })
  604. }
  605. function initStatuses() {
  606. return [
  607. { code: 0, name: '未匹配' },
  608. { code: 1, name: '已匹配' },
  609. ]
  610. }
  611. function initDelFlags() {
  612. return [
  613. { code: 0, name: '启用' },
  614. { code: 1, name: '停用' },
  615. ]
  616. }
  617. function initUploadFlags() {
  618. return [
  619. { code: 0, name: '未上传' },
  620. { code: 1, name: '已上传' },
  621. ]
  622. }
  623. function initTypes() {
  624. return [
  625. { code: 1, name: '西药/中成药' },
  626. { code: 2, name: '中草药' },
  627. { code: 3, name: '项目' },
  628. { code: 4, name: '耗材' },
  629. ]
  630. }
  631. </script>
  632. <style scoped>
  633. .data-title {
  634. padding: 8px 0;
  635. font-size: 16px;
  636. color: #333;
  637. font-weight: bold;
  638. }
  639. .mt-4 {
  640. margin-top: 4px;
  641. }
  642. .mt-12 {
  643. margin-top: 12px;
  644. }
  645. .m-prepend {
  646. margin-top: 12px;
  647. height: 28px;
  648. line-height: 28px;
  649. background-color: #f5f7fa;
  650. color: #909399;
  651. border: 1px solid #dcdfe6;
  652. border-radius: 4px;
  653. padding: 0 20px;
  654. }
  655. .drawer-footer {
  656. margin-top: 16px;
  657. width: 100%;
  658. text-align: end;
  659. }
  660. </style>