NationalSiMatch.vue 24 KB

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