YpCodgUpload.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771
  1. <template>
  2. <div class="layout_container">
  3. <header>
  4. <el-input
  5. v-model.trim="keyCode"
  6. class="w-50 m-2"
  7. style="width: 270px"
  8. placeholder="请输入批次号或者门诊号"
  9. clearable
  10. >
  11. <template #prepend>单号</template>
  12. </el-input>
  13. <el-date-picker
  14. v-model="dateRange"
  15. type="daterange"
  16. range-separator="至"
  17. start-placeholder="开始日期"
  18. :clearable="false"
  19. end-placeholder="结束日期"
  20. :shortcuts="shortcuts"
  21. style="width: 300px; margin-left: 3px"
  22. ></el-date-picker>
  23. <el-select
  24. v-model="opFlag"
  25. placeholder="请选择库存变更类型"
  26. style="width: 140px; margin-left: 3px"
  27. @change="queryItem"
  28. >
  29. <el-option
  30. v-for="item in kcList"
  31. :key="item.value"
  32. :label="item.label"
  33. :value="item.value"
  34. >
  35. </el-option>
  36. </el-select>
  37. <el-select
  38. v-model="ztFlag"
  39. placeholder="请选择销售类型"
  40. style="width: 140px; margin-left: 3px"
  41. @change="queryItem"
  42. >
  43. <el-option
  44. v-for="item in soldOptions"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value"
  48. >
  49. </el-option>
  50. </el-select>
  51. <el-select
  52. v-model="uploadGroupNoYk"
  53. placeholder="请选择药库"
  54. style="width: 140px; margin-left: 3px"
  55. @change="queryItem"
  56. >
  57. <el-option
  58. v-for="item in groupNoYkData"
  59. :key="item.value"
  60. :label="item.label"
  61. :value="item.value"
  62. >
  63. </el-option>
  64. </el-select>
  65. <el-select
  66. v-model="uploadGroupNoYf"
  67. placeholder="请选择药房"
  68. style="width: 140px; margin-left: 3px"
  69. @change="queryItem"
  70. >
  71. <el-option
  72. v-for="item in groupNoYfData"
  73. :key="item.value"
  74. :label="item.label"
  75. :value="item.value"
  76. >
  77. </el-option>
  78. </el-select>
  79. <el-select
  80. v-model="retFlag"
  81. placeholder="请选择上传状态"
  82. style="width: 140px; margin-left: 3px"
  83. >
  84. <el-option
  85. v-for="item in retOptions"
  86. :key="item.value"
  87. :label="item.label"
  88. :value="item.value"
  89. >
  90. </el-option>
  91. </el-select>
  92. <el-divider direction="vertical" />
  93. <el-button
  94. type="primary"
  95. icon="Search"
  96. @click="queryItem"
  97. style="margin-left: 5px"
  98. >查询
  99. </el-button>
  100. <el-button
  101. type="primary"
  102. icon="Upload"
  103. @click="uploadYpGoods"
  104. style="margin-left: 5px"
  105. v-show="
  106. editableTabsValue === 'ypInvinfo' ||
  107. editableTabsValue === 'ypPurchase' ||
  108. editableTabsValue === 'ypSelinfo'
  109. "
  110. >批量上传
  111. </el-button>
  112. <el-button
  113. type="primary"
  114. icon="Delete"
  115. @click="deleteYpGoods"
  116. style="margin-left: 5px"
  117. v-show="
  118. editableTabsValue === 'ypInvinfoCx' ||
  119. editableTabsValue === 'ypPurchaseCx' ||
  120. editableTabsValue === 'ypSelinfoCx'
  121. "
  122. >批量删除
  123. </el-button>
  124. </header>
  125. <div class="layout_main">
  126. <el-tabs
  127. class="el-tabs__fill"
  128. v-model="editableTabsValue"
  129. type="border-card"
  130. @tab-click="handleClick"
  131. >
  132. <el-tab-pane key="ypInvinfo" label="药品库存变更" name="ypInvinfo">
  133. <div class="layout_display_flex_y">
  134. <div class="layout_flex_1-y">
  135. <el-table
  136. :data="
  137. ypInvinfoData.slice(
  138. pageSizeInvinfo * (currentPageInvinfo - 1),
  139. pageSizeInvinfo * currentPageInvinfo
  140. )
  141. "
  142. border
  143. style="width: 100%"
  144. height="100%"
  145. stripe
  146. highlight-current-row
  147. @selection-change="handleInvinfoSelectionChange"
  148. class="normal-size"
  149. >
  150. <el-table-column type="selection" width="55" />
  151. <el-table-column type="index" label="序号" width="60" />
  152. <el-table-column
  153. prop="fixmedinsHilistId"
  154. label="id"
  155. width="100"
  156. v-if="false"
  157. />
  158. <el-table-column
  159. prop="fixmedinsHilistName"
  160. label="name"
  161. width="100"
  162. v-if="false"
  163. />
  164. <el-table-column
  165. prop="medListCodg"
  166. label="药品国家医保编码"
  167. width="220"
  168. show-overflow-tooltip
  169. ></el-table-column>
  170. <el-table-column
  171. prop="chargeCode"
  172. label="药品编码"
  173. width="80"
  174. ></el-table-column>
  175. <el-table-column
  176. prop="chargeName"
  177. label="药品名称"
  178. width="240"
  179. ></el-table-column>
  180. <el-table-column
  181. prop="invChgType"
  182. label="库存变更类型"
  183. width="100"
  184. />
  185. <el-table-column
  186. prop="invChgTypeName"
  187. label="库存变更类型名称"
  188. width="120"
  189. />
  190. <el-table-column
  191. prop="fixmedinsBchno"
  192. label="批次流水号"
  193. width="110"
  194. ></el-table-column>
  195. <el-table-column prop="pric" label="单价" width="100" />
  196. <el-table-column prop="cnt" label="数量" width="100" />
  197. <el-table-column prop="rxFlag" label="处方药标志" width="100" />
  198. <el-table-column prop="trdnFlag" label="拆零标志" width="100" />
  199. <el-table-column
  200. prop="invChgTime"
  201. label="库存变更时间"
  202. width="130"
  203. />
  204. <el-table-column
  205. prop="invChgOpterName"
  206. label="经办人姓名"
  207. width="100"
  208. />
  209. <el-table-column
  210. prop="memo"
  211. label="备注"
  212. width="120"
  213. show-overflow-tooltip
  214. />
  215. <el-table-column
  216. fixed="right"
  217. label="操作"
  218. min-width="80"
  219. width="80"
  220. center
  221. >
  222. <template #default="scope">
  223. <el-button
  224. type="primary"
  225. size="small"
  226. @click="uploadYpInvinfoSingle(scope.row)"
  227. >上传
  228. </el-button>
  229. </template>
  230. </el-table-column>
  231. </el-table>
  232. </div>
  233. <div>
  234. <el-pagination
  235. :current-page="currentPageInvinfo"
  236. :page-size="pageSizeInvinfo"
  237. :page-sizes="[10, 15, 20, 25]"
  238. :total="ypInvinfoData.length"
  239. layout="total, sizes, prev, pager, next, jumper"
  240. style="margin-top: 5px"
  241. @size-change="handleSizeChangeInvinfo"
  242. @current-change="handleCurrentChangeInvinfo"
  243. >
  244. </el-pagination>
  245. </div>
  246. </div>
  247. </el-tab-pane>
  248. <el-tab-pane
  249. key="ypInvinfoCx"
  250. label="药品库存变更上传查询"
  251. name="ypInvinfoCx"
  252. >
  253. <div class="layout_display_flex_y">
  254. <div class="layout_flex_1-y">
  255. <el-table
  256. :data="
  257. ypInvinfoUploadData.slice(
  258. pageSizeInvinfoCx * (currentPageInvinfoCx - 1),
  259. pageSizeInvinfoCx * currentPageInvinfoCx
  260. )
  261. "
  262. border
  263. style="width: 100%"
  264. height="100%"
  265. stripe
  266. highlight-current-row
  267. @selection-change="handleInvinfoSelectionChangeCx"
  268. class="normal-size"
  269. >
  270. <el-table-column type="selection" width="55" />
  271. <el-table-column type="index" label="序号" width="60" />
  272. <el-table-column
  273. prop="fixmedinsHilistId"
  274. label="id"
  275. width="100"
  276. v-if="false"
  277. />
  278. <el-table-column
  279. prop="fixmedinsHilistName"
  280. label="name"
  281. width="100"
  282. v-if="false"
  283. />
  284. <el-table-column prop="uploadFlag" label="状态" width="80">
  285. <template #default="scope">
  286. <span v-if="scope.row.uploadFlag === '1'">已上传</span>
  287. <span v-else-if="scope.row.uploadFlag === '0'"
  288. >上传失败</span
  289. >
  290. <span v-else-if="scope.row.uploadFlag === '-2'"
  291. >已删除</span
  292. >
  293. <span v-else>{{ scope.row.uploadFlag }}</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column prop="msgErr" label="上传信息" width="100">
  297. <template #default="scope">
  298. <span v-if="scope.row.msgErr">
  299. <el-popover
  300. effect="light"
  301. trigger="click"
  302. placement="top-start"
  303. width="left"
  304. >
  305. <template #default>
  306. <div>
  307. <span style="color: red">上传信息:</span>
  308. {{ scope.row.msgErr }}
  309. </div>
  310. </template>
  311. <template #reference>
  312. <el-tag>{{ scope.row.msgErr }}</el-tag>
  313. </template>
  314. </el-popover>
  315. </span>
  316. <span v-else>{{ scope.row.msgErr }}</span>
  317. </template>
  318. </el-table-column>
  319. <el-table-column
  320. prop="medListCodg"
  321. label="药品国家医保编码"
  322. width="220"
  323. show-overflow-tooltip
  324. ></el-table-column>
  325. <el-table-column
  326. prop="chargeCode"
  327. label="药品编码"
  328. width="80"
  329. ></el-table-column>
  330. <el-table-column
  331. prop="chargeName"
  332. label="药品名称"
  333. width="240"
  334. ></el-table-column>
  335. <el-table-column
  336. prop="invChgType"
  337. label="库存变更类型"
  338. width="100"
  339. />
  340. <el-table-column
  341. prop="invChgTypeName"
  342. label="库存变更类型名称"
  343. width="120"
  344. />
  345. <el-table-column
  346. prop="fixmedinsBchno"
  347. label="批次流水号"
  348. width="110"
  349. ></el-table-column>
  350. <el-table-column prop="pric" label="单价" width="100" />
  351. <el-table-column prop="cnt" label="数量" width="100" />
  352. <el-table-column prop="rxFlag" label="处方药标志" width="100" />
  353. <el-table-column prop="trdnFlag" label="拆零标志" width="100" />
  354. <el-table-column
  355. prop="invChgTime"
  356. label="库存变更时间"
  357. width="130"
  358. />
  359. <el-table-column
  360. prop="invChgOpterName"
  361. label="经办人姓名"
  362. width="100"
  363. />
  364. <el-table-column
  365. prop="memo"
  366. label="备注"
  367. width="120"
  368. show-overflow-tooltip
  369. />
  370. </el-table>
  371. </div>
  372. <div>
  373. <el-pagination
  374. :current-page="currentPageInvinfoCx"
  375. :page-size="pageSizeInvinfoCx"
  376. :page-sizes="[10, 15, 20, 25]"
  377. :total="ypInvinfoUploadData.length"
  378. layout="total, sizes, prev, pager, next, jumper"
  379. style="margin-top: 5px"
  380. @size-change="handleSizeChangeInvinfoCx"
  381. @current-change="handleCurrentChangeInvinfoCx"
  382. >
  383. </el-pagination>
  384. </div>
  385. </div>
  386. </el-tab-pane>
  387. <el-tab-pane
  388. key="ypPurchase"
  389. label="药品入库/退货上传"
  390. name="ypPurchase"
  391. v-if="false"
  392. >
  393. <div class="layout_display_flex_y">
  394. <div class="layout_flex_1-y">
  395. <el-table
  396. :data="
  397. ypPurchaseData.slice(
  398. pageSizePurchase * (currentPagePurchase - 1),
  399. pageSizePurchase * currentPagePurchase
  400. )
  401. "
  402. border
  403. style="width: 100%"
  404. height="100%"
  405. stripe
  406. highlight-current-row
  407. @selection-change="handlePurchaseSelectionChange"
  408. class="normal-size"
  409. >
  410. <el-table-column type="selection" width="55" />
  411. <el-table-column type="index" label="序号" width="60" />
  412. <el-table-column
  413. prop="fixmedinsHilistId"
  414. label="id"
  415. width="100"
  416. v-if="false"
  417. />
  418. <el-table-column
  419. prop="fixmedinsHilistName"
  420. label="name"
  421. width="100"
  422. v-if="false"
  423. />
  424. <el-table-column
  425. prop="medListCodg"
  426. label="药品编码"
  427. width="80"
  428. ></el-table-column>
  429. <el-table-column
  430. prop="chargeName"
  431. label="药品名称"
  432. width="240"
  433. ></el-table-column>
  434. <el-table-column
  435. prop="fixmedinsBchno"
  436. label="入/退库单号"
  437. width="110"
  438. ></el-table-column>
  439. <el-table-column
  440. prop="splerName"
  441. label="供应商名称"
  442. width="200"
  443. show-overflow-tooltip
  444. />
  445. <el-table-column
  446. prop="manuLotnum"
  447. label="生产批号"
  448. width="100"
  449. />
  450. <el-table-column
  451. prop="prodentpName"
  452. label="生产厂家名称"
  453. width="200"
  454. show-overflow-tooltip
  455. />
  456. <el-table-column prop="aprvno" label="批准文号" width="130" />
  457. <el-table-column prop="manuDate" label="生产日期" width="100" />
  458. <el-table-column prop="expyEnd" label="有效期止" width="100" />
  459. <el-table-column
  460. prop="finlTrnsPric"
  461. label="最终成交单价"
  462. width="100"
  463. />
  464. <el-table-column
  465. prop="purcRetnCnt"
  466. label="采购/退货数量"
  467. width="100"
  468. />
  469. <el-table-column
  470. prop="purcInvoNo"
  471. label="采购/退货发票号"
  472. width="100"
  473. />
  474. <el-table-column prop="rxFlag" label="处方药标志" width="100" />
  475. <el-table-column
  476. prop="purcRetnStoinTime"
  477. label="入/退库时间"
  478. width="130"
  479. />
  480. <el-table-column
  481. prop="purcRetnOpterName"
  482. label="经办人姓名"
  483. width="100"
  484. />
  485. <el-table-column
  486. prop="memo"
  487. label="备注"
  488. width="100"
  489. show-overflow-tooltip
  490. />
  491. <el-table-column
  492. fixed="right"
  493. label="操作"
  494. min-width="180"
  495. width="180"
  496. center
  497. >
  498. <template #default="scope">
  499. <el-button
  500. type="primary"
  501. size="small"
  502. @click="uploadYpPurchaseSingle(scope.row)"
  503. >上传
  504. </el-button>
  505. <el-button
  506. type="primary"
  507. size="small"
  508. @click="callYpInvoice(scope.row)"
  509. >更新发票号
  510. </el-button>
  511. </template>
  512. </el-table-column>
  513. </el-table>
  514. </div>
  515. <div>
  516. <el-pagination
  517. :current-page="currentPagePurchase"
  518. :page-size="pageSizePurchase"
  519. :page-sizes="[10, 15, 20, 25]"
  520. :total="ypPurchaseData.length"
  521. layout="total, sizes, prev, pager, next, jumper"
  522. style="margin-top: 5px"
  523. @size-change="handleSizeChangePurchase"
  524. @current-change="handleCurrentChangePurchase"
  525. >
  526. </el-pagination>
  527. </div>
  528. </div>
  529. </el-tab-pane>
  530. <el-tab-pane key="ypSelinfo" label="药品销售/退货上传" name="ypSelinfo">
  531. <div class="layout_display_flex_y">
  532. <div class="layout_flex_1-y">
  533. <el-table
  534. :data="
  535. ypSelinfoData.slice(
  536. pageSizeSelinfo * (currentPageSelinfo - 1),
  537. pageSizeSelinfo * currentPageSelinfo
  538. )
  539. "
  540. border
  541. style="width: 100%"
  542. height="100%"
  543. stripe
  544. highlight-current-row
  545. @selection-change="handleSelinfoSelectionChange"
  546. class="normal-size"
  547. >
  548. <el-table-column type="selection" width="55" />
  549. <el-table-column type="index" label="序号" width="60" />
  550. <el-table-column
  551. prop="fixmedinsHilistId"
  552. label="id"
  553. width="100"
  554. v-if="false"
  555. />
  556. <el-table-column
  557. prop="fixmedinsHilistName"
  558. label="name"
  559. width="100"
  560. v-if="false"
  561. />
  562. <el-table-column
  563. prop="medListCodg"
  564. label="药品国家医保编码"
  565. width="200"
  566. show-overflow-tooltip
  567. />
  568. <el-table-column
  569. prop="chargeCode"
  570. label="药品编码"
  571. width="80"
  572. />
  573. <el-table-column
  574. prop="chargeName"
  575. label="药品名称"
  576. width="240"
  577. />
  578. <el-table-column
  579. prop="fixmedinsBchno"
  580. label="销售/退货单号"
  581. width="135"
  582. />
  583. <el-table-column
  584. prop="prscDrName"
  585. label="开方医师姓名"
  586. width="100"
  587. />
  588. <el-table-column prop="pharName" label="药师姓名" width="100" />
  589. <el-table-column
  590. prop="pharPracCertNo"
  591. label="药师执业资格证号"
  592. width="120"
  593. />
  594. <el-table-column prop="setlId" label="结算ID" width="100" />
  595. <el-table-column
  596. prop="mdtrtSetlType"
  597. label="结算方式"
  598. width="100"
  599. >
  600. <template #header>
  601. <span>结算方式</span>
  602. <el-tooltip class="box-item" effect="dark" placement="top">
  603. <template #content
  604. >注:<br />1 表示医保结算;2 表示自费结算。</template
  605. >
  606. <el-icon color="red" size="14"
  607. ><QuestionFilled
  608. /></el-icon>
  609. </el-tooltip>
  610. </template>
  611. </el-table-column>
  612. <el-table-column
  613. prop="mdtrtSn"
  614. label="就医流水号"
  615. width="100"
  616. />
  617. <el-table-column
  618. prop="manuLotnum"
  619. label="生产批号"
  620. width="120"
  621. />
  622. <el-table-column prop="manuDate" label="生产日期" width="100" />
  623. <el-table-column prop="expyEnd" label="有效期止" width="100" />
  624. <el-table-column prop="rxFlag" label="处方药标志" width="100">
  625. <template #header>
  626. <span>处方药标志</span>
  627. <el-tooltip class="box-item" effect="dark" placement="top">
  628. <template #content
  629. >注:<br />0 表示非处方药;1 表示处方药。</template
  630. >
  631. <el-icon color="red" size="14"
  632. ><QuestionFilled
  633. /></el-icon>
  634. </el-tooltip>
  635. </template>
  636. </el-table-column>
  637. <el-table-column prop="trdnFlag" label="拆零标志" width="100">
  638. <template #header>
  639. <span>拆零标志</span>
  640. <el-tooltip class="box-item" effect="dark" placement="top">
  641. <template #content
  642. >注:<br />0 表示否;1 表示是。</template
  643. >
  644. <el-icon color="red" size="14"
  645. ><QuestionFilled
  646. /></el-icon>
  647. </el-tooltip>
  648. </template>
  649. </el-table-column>
  650. <el-table-column
  651. prop="finlTrnsPric"
  652. label="最终成交单价"
  653. width="100"
  654. />
  655. <el-table-column
  656. prop="rtalDocno"
  657. label="零售单据号"
  658. width="120"
  659. />
  660. <el-table-column
  661. prop="drugTracCodg"
  662. label="药品追溯码"
  663. width="145"
  664. />
  665. <el-table-column
  666. prop="drugProdBarc"
  667. label="药品条形码"
  668. width="120"
  669. />
  670. <el-table-column
  671. prop="selRetnCnt"
  672. label="销售/退货数量"
  673. width="100"
  674. />
  675. <el-table-column
  676. prop="selRetnTime"
  677. label="销售/退货时间"
  678. width="145"
  679. />
  680. <el-table-column
  681. prop="selRetnOpterName"
  682. label="经办人姓名"
  683. width="100"
  684. />
  685. <el-table-column
  686. prop="memo"
  687. label="备注"
  688. width="100"
  689. show-overflow-tooltip
  690. />
  691. </el-table>
  692. </div>
  693. <div>
  694. <el-pagination
  695. :current-page="currentPageSelinfo"
  696. :page-size="pageSizeSelinfo"
  697. :page-sizes="[10, 15, 20, 25]"
  698. :total="ypSelinfoData.length"
  699. layout="total, sizes, prev, pager, next, jumper"
  700. style="margin-top: 5px"
  701. @size-change="handleSizeChangeSelinfo"
  702. @current-change="handleCurrentChangeSelinfo"
  703. >
  704. </el-pagination>
  705. </div>
  706. </div>
  707. </el-tab-pane>
  708. <el-tab-pane
  709. key="ypPurchaseCx"
  710. label="药品入库/退货上传查询"
  711. name="ypPurchaseCx"
  712. v-if="false"
  713. >
  714. <div class="layout_display_flex_y">
  715. <div class="layout_flex_1-y">
  716. <el-table
  717. :data="
  718. ypPurchaseUploadData.slice(
  719. pageSizePurchaseCx * (currentPagePurchaseCx - 1),
  720. pageSizePurchaseCx * currentPagePurchaseCx
  721. )
  722. "
  723. border
  724. style="width: 100%"
  725. height="100%"
  726. stripe
  727. highlight-current-row
  728. @selection-change="handlePurchaseSelectionChangeCx"
  729. class="normal-size"
  730. >
  731. <el-table-column type="selection" width="55" />
  732. <el-table-column type="index" label="序号" width="60" />
  733. <el-table-column
  734. prop="fixmedinsHilistId"
  735. label="id"
  736. width="100"
  737. v-if="false"
  738. />
  739. <el-table-column
  740. prop="fixmedinsHilistName"
  741. label="name"
  742. width="100"
  743. v-if="false"
  744. />
  745. <el-table-column prop="uploadFlag" label="状态" width="80">
  746. <template #default="scope">
  747. <span v-if="scope.row.uploadFlag === '1'">已上传</span>
  748. <span v-else-if="scope.row.uploadFlag === '0'"
  749. >上传失败</span
  750. >
  751. <span v-else>{{ scope.row.uploadFlag }}</span>
  752. </template>
  753. </el-table-column>
  754. <el-table-column prop="msgErr" label="上传信息" width="100">
  755. <template #default="scope">
  756. <span v-if="scope.row.msgErr">
  757. <el-popover
  758. effect="light"
  759. trigger="click"
  760. placement="top-start"
  761. width="left"
  762. >
  763. <template #default>
  764. <div>
  765. <span style="color: red">上传信息:</span>
  766. {{ scope.row.msgErr }}
  767. </div>
  768. </template>
  769. <template #reference>
  770. <el-tag>{{ scope.row.msgErr }}</el-tag>
  771. </template>
  772. </el-popover>
  773. </span>
  774. <span v-else>{{ scope.row.msgErr }}</span>
  775. </template>
  776. </el-table-column>
  777. <el-table-column
  778. prop="medListCodg"
  779. label="药品编码"
  780. width="80"
  781. />
  782. <el-table-column
  783. prop="chargeCode"
  784. label="药品编码"
  785. width="80"
  786. />
  787. <el-table-column
  788. prop="chargeName"
  789. label="药品名称"
  790. width="240"
  791. ></el-table-column>
  792. <el-table-column
  793. prop="fixmedinsBchno"
  794. label="入/退库单号"
  795. width="110"
  796. ></el-table-column>
  797. <el-table-column
  798. prop="splerName"
  799. label="供应商名称"
  800. width="200"
  801. show-overflow-tooltip
  802. />
  803. <el-table-column
  804. prop="manuLotnum"
  805. label="生产批号"
  806. width="100"
  807. />
  808. <el-table-column
  809. prop="prodentpName"
  810. label="生产厂家名称"
  811. width="200"
  812. show-overflow-tooltip
  813. />
  814. <el-table-column prop="aprvno" label="批准文号" width="130" />
  815. <el-table-column prop="manuDate" label="生产日期" width="100" />
  816. <el-table-column prop="expyEnd" label="有效期止" width="100" />
  817. <el-table-column
  818. prop="finlTrnsPric"
  819. label="最终成交单价"
  820. width="100"
  821. />
  822. <el-table-column
  823. prop="purcRetnCnt"
  824. label="采购/退货数量"
  825. width="100"
  826. />
  827. <el-table-column
  828. prop="purcInvoNo"
  829. label="采购/退货发票号"
  830. width="100"
  831. />
  832. <el-table-column prop="rxFlag" label="处方药标志" width="100" />
  833. <el-table-column
  834. prop="purcRetnStoinTime"
  835. label="入/退库时间"
  836. width="135"
  837. />
  838. <el-table-column
  839. prop="purcRetnOpterName"
  840. label="经办人姓名"
  841. width="100"
  842. />
  843. <el-table-column
  844. prop="memo"
  845. label="备注"
  846. width="100"
  847. show-overflow-tooltip
  848. />
  849. <el-table-column
  850. fixed="right"
  851. label="操作"
  852. min-width="180"
  853. width="180"
  854. center
  855. >
  856. <template #default="scope">
  857. <el-button
  858. type="primary"
  859. size="small"
  860. v-if="scope.row.uploadFlag === '-1'"
  861. @click="uploadYpPurchaseSingle(scope.row)"
  862. >重传
  863. </el-button>
  864. <el-button
  865. type="primary"
  866. size="small"
  867. @click="callYpInvoice(scope.row)"
  868. >更新发票号
  869. </el-button>
  870. </template>
  871. </el-table-column>
  872. </el-table>
  873. </div>
  874. <div>
  875. <el-pagination
  876. :current-page="currentPagePurchaseCx"
  877. :page-size="pageSizePurchaseCx"
  878. :page-sizes="[10, 15, 20, 25]"
  879. :total="ypPurchaseUploadData.length"
  880. layout="total, sizes, prev, pager, next, jumper"
  881. style="margin-top: 5px"
  882. @size-change="handleSizeChangePurchaseCx"
  883. @current-change="handleCurrentChangePurchaseCx"
  884. >
  885. </el-pagination>
  886. </div>
  887. </div>
  888. </el-tab-pane>
  889. <el-tab-pane
  890. key="ypSelinfoCx"
  891. label="药品销售/退货上传查询"
  892. name="ypSelinfoCx"
  893. >
  894. <div class="layout_display_flex_y">
  895. <div class="layout_flex_1-y">
  896. <el-table
  897. :data="
  898. ypSelinfoUploadData.slice(
  899. pageSizeSelinfoCx * (currentPageSelinfoCx - 1),
  900. pageSizeSelinfoCx * currentPageSelinfoCx
  901. )
  902. "
  903. border
  904. style="width: 100%"
  905. height="100%"
  906. stripe
  907. highlight-current-row
  908. @selection-change="handleSelinfoSelectionChangeCx"
  909. class="normal-size"
  910. >
  911. <el-table-column type="selection" width="55" />
  912. <el-table-column type="index" label="序号" width="60" />
  913. <el-table-column
  914. prop="fixmedinsHilistId"
  915. label="id"
  916. width="100"
  917. v-if="false"
  918. />
  919. <el-table-column
  920. prop="fixmedinsHilistName"
  921. label="name"
  922. width="100"
  923. v-if="false"
  924. />
  925. <el-table-column prop="uploadFlag" label="状态" width="80">
  926. <template #default="scope">
  927. <span v-if="scope.row.uploadFlag === '1'">已上传</span>
  928. <span v-else-if="scope.row.uploadFlag === '0'"
  929. >上传失败</span
  930. >
  931. <span v-else>{{ scope.row.uploadFlag }}</span>
  932. </template>
  933. </el-table-column>
  934. <el-table-column prop="msgErr" label="上传信息" width="160">
  935. <template #default="scope">
  936. <span v-if="scope.row.msgErr">
  937. <el-popover
  938. effect="light"
  939. trigger="click"
  940. placement="top-start"
  941. width="left"
  942. >
  943. <template #default>
  944. <div>
  945. <span style="color: red">上传信息:</span>
  946. {{ scope.row.msgErr }}
  947. </div>
  948. </template>
  949. <template #reference>
  950. <el-tag>{{ scope.row.msgErr }}</el-tag>
  951. </template>
  952. </el-popover>
  953. </span>
  954. <span v-else>{{ scope.row.msgErr }}</span>
  955. </template>
  956. </el-table-column>
  957. <el-table-column
  958. prop="medListCodg"
  959. label="药品国家医保编码"
  960. width="200"
  961. show-overflow-tooltip
  962. />
  963. <el-table-column
  964. prop="chargeCode"
  965. label="药品编码"
  966. width="80"
  967. />
  968. <el-table-column
  969. prop="chargeName"
  970. label="药品名称"
  971. width="240"
  972. />
  973. <el-table-column
  974. prop="fixmedinsBchno"
  975. label="销售/退货单号"
  976. width="135"
  977. />
  978. <el-table-column
  979. prop="prscDrName"
  980. label="开方医师姓名"
  981. width="100"
  982. />
  983. <el-table-column prop="pharName" label="药师姓名" width="100" />
  984. <el-table-column
  985. prop="pharPracCertNo"
  986. label="药师执业资格证号"
  987. width="120"
  988. />
  989. <el-table-column prop="setlId" label="结算ID" width="100" />
  990. <el-table-column
  991. prop="mdtrtSetlType"
  992. label="结算方式"
  993. width="100"
  994. >
  995. <template #header>
  996. <span>结算方式</span>
  997. <el-tooltip class="box-item" effect="dark" placement="top">
  998. <template #content
  999. >注:<br />1 表示医保结算;2 表示自费结算。</template
  1000. >
  1001. <el-icon color="red" size="14"
  1002. ><QuestionFilled
  1003. /></el-icon>
  1004. </el-tooltip>
  1005. </template>
  1006. </el-table-column>
  1007. <el-table-column
  1008. prop="mdtrtSn"
  1009. label="就医流水号"
  1010. width="100"
  1011. />
  1012. <el-table-column
  1013. prop="manuLotnum"
  1014. label="生产批号"
  1015. width="120"
  1016. />
  1017. <el-table-column prop="manuDate" label="生产日期" width="100" />
  1018. <el-table-column prop="expyEnd" label="有效期止" width="100" />
  1019. <el-table-column prop="rxFlag" label="处方药标志" width="100">
  1020. <template #header>
  1021. <span>处方药标志</span>
  1022. <el-tooltip class="box-item" effect="dark" placement="top">
  1023. <template #content
  1024. >注:<br />0 表示非处方药;1 表示处方药。</template
  1025. >
  1026. <el-icon color="red" size="14"
  1027. ><QuestionFilled
  1028. /></el-icon>
  1029. </el-tooltip>
  1030. </template>
  1031. </el-table-column>
  1032. <el-table-column prop="trdnFlag" label="拆零标志" width="100">
  1033. <template #header>
  1034. <span>拆零标志</span>
  1035. <el-tooltip class="box-item" effect="dark" placement="top">
  1036. <template #content
  1037. >注:<br />0 表示否;1 表示是。</template
  1038. >
  1039. <el-icon color="red" size="14"
  1040. ><QuestionFilled
  1041. /></el-icon>
  1042. </el-tooltip>
  1043. </template>
  1044. </el-table-column>
  1045. <el-table-column
  1046. prop="finlTrnsPric"
  1047. label="最终成交单价"
  1048. width="100"
  1049. />
  1050. <el-table-column
  1051. prop="rtalDocno"
  1052. label="零售单据号"
  1053. width="120"
  1054. />
  1055. <el-table-column
  1056. prop="drugTracCodg"
  1057. label="药品追溯码"
  1058. width="145"
  1059. show-overflow-tooltip
  1060. />
  1061. <el-table-column
  1062. prop="drugProdBarc"
  1063. label="药品条形码"
  1064. width="120"
  1065. />
  1066. <el-table-column
  1067. prop="selRetnCnt"
  1068. label="销售/退货数量"
  1069. width="100"
  1070. />
  1071. <el-table-column
  1072. prop="selRetnTime"
  1073. label="销售/退货时间"
  1074. width="145"
  1075. />
  1076. <el-table-column
  1077. prop="selRetnOpterName"
  1078. label="经办人姓名"
  1079. width="100"
  1080. />
  1081. <el-table-column prop="patNo" label="门诊号" width="100" />
  1082. <el-table-column prop="times" label="门诊次数" width="80" />
  1083. <el-table-column
  1084. prop="createTime"
  1085. label="销售/退货上传时间"
  1086. width="145"
  1087. />
  1088. <el-table-column
  1089. prop="memo"
  1090. label="备注"
  1091. width="100"
  1092. show-overflow-tooltip
  1093. />
  1094. </el-table>
  1095. </div>
  1096. <div>
  1097. <el-pagination
  1098. :current-page="currentPageSelinfoCx"
  1099. :page-size="pageSizeSelinfoCx"
  1100. :page-sizes="[10, 15, 20, 25]"
  1101. :total="ypSelinfoUploadData.length"
  1102. layout="total, sizes, prev, pager, next, jumper"
  1103. style="margin-top: 5px"
  1104. @size-change="handleSizeChangeSelinfoCx"
  1105. @current-change="handleCurrentChangeSelinfoCx"
  1106. >
  1107. </el-pagination>
  1108. </div>
  1109. </div>
  1110. </el-tab-pane>
  1111. </el-tabs>
  1112. </div>
  1113. </div>
  1114. <el-dialog v-model="dialogFormVisible" title="更新发票号" width="500">
  1115. <el-form :model="formData">
  1116. <el-input v-model="formData.serial" v-show="false" />
  1117. <el-form-item label="单号" :label-width="formLabelWidth">
  1118. <el-input v-model="formData.inDocuNo" disabled />
  1119. </el-form-item>
  1120. <el-form-item label="序号" :label-width="formLabelWidth">
  1121. <el-input v-model="formData.inSeri" disabled />
  1122. </el-form-item>
  1123. <el-form-item label="药品编码" :label-width="formLabelWidth">
  1124. <el-input v-model="formData.medListCodg" disabled />
  1125. </el-form-item>
  1126. <el-form-item label="药品名称" :label-width="formLabelWidth">
  1127. <el-input v-model="formData.chargeName" disabled />
  1128. </el-form-item>
  1129. <el-form-item label="发票号" :label-width="formLabelWidth">
  1130. <el-input v-model.trim="formData.purcInvoNo" autocomplete="off" />
  1131. </el-form-item>
  1132. </el-form>
  1133. <template #footer>
  1134. <div class="dialog-footer">
  1135. <el-button @click="dialogFormVisible = false">取消</el-button>
  1136. <el-button type="primary" @click="updateYpInvoice">保存</el-button>
  1137. </div>
  1138. </template>
  1139. </el-dialog>
  1140. </template>
  1141. <script setup name="YpCodgUpload">
  1142. import { nextTick, onMounted, ref } from "vue";
  1143. import { ElMessage, ElMessageBox } from "element-plus";
  1144. import {
  1145. deleteYpUploadBatch,
  1146. saveYpInvoice,
  1147. selectYpInvinfoDetail,
  1148. selectYpInvinfoResult,
  1149. selectYpPurchaseDetail,
  1150. selectYpPurchaseResult,
  1151. selectYpSelinfoDetail,
  1152. selectYpSelinfoResult,
  1153. uploadYpInvinfoBatch,
  1154. uploadYpPurchaseBatch,
  1155. uploadYpPurchaseReturnBatch,
  1156. uploadYpSelinfoBatch,
  1157. uploadYpSelinfoReturnBatch,
  1158. } from "@/api/yp-codg/yp-codg-upload";
  1159. import { shortcuts } from "@/data/shortcuts.js";
  1160. import {
  1161. formatDate,
  1162. getDateRangeFormatDate,
  1163. subtractTime,
  1164. } from "@/utils/date.js";
  1165. import { QuestionFilled } from "@element-plus/icons-vue";
  1166. import { useYfGroupStore } from "@/pinia/use-yf-group";
  1167. import { selectGroupNoInfo } from "@/api/yp-dict/yp-comm-dict.js";
  1168. const kcList = ref([]);
  1169. const retOptions = [
  1170. { value: "", label: "全部" },
  1171. { value: "1", label: "上传成功" },
  1172. { value: "0", label: "上传失败" },
  1173. ];
  1174. const editableTabsValue = ref("ypInvinfo");
  1175. const start = formatDate(shortcuts[0].value[0]);
  1176. const end = formatDate(shortcuts[0].value[0]);
  1177. const dateRange = ref([]);
  1178. const soldOptions = [
  1179. { value: "3", label: "销售" },
  1180. { value: "4", label: "销售退货" },
  1181. ];
  1182. const queryData = ref({
  1183. startTime: "",
  1184. endTime: "",
  1185. docuNo: "",
  1186. patNo: "",
  1187. chargeCode: "",
  1188. invChgType: "",
  1189. groupNo: "",
  1190. type: "",
  1191. uploadFlag: "",
  1192. });
  1193. const pageSizeInvinfo = ref(20);
  1194. const currentPageInvinfo = ref(1);
  1195. const handleSizeChangeInvinfo = val => {
  1196. pageSizeInvinfo.value = val;
  1197. };
  1198. const handleCurrentChangeInvinfo = val => {
  1199. currentPageInvinfo.value = val;
  1200. };
  1201. const pageSizeInvinfoCx = ref(20);
  1202. const currentPageInvinfoCx = ref(1);
  1203. const handleSizeChangeInvinfoCx = val => {
  1204. pageSizeInvinfoCx.value = val;
  1205. };
  1206. const handleCurrentChangeInvinfoCx = val => {
  1207. currentPageInvinfoCx.value = val;
  1208. };
  1209. const pageSizePurchase = ref(20);
  1210. const currentPagePurchase = ref(1);
  1211. const handleSizeChangePurchase = val => {
  1212. pageSizePurchase.value = val;
  1213. };
  1214. const handleCurrentChangePurchase = val => {
  1215. currentPagePurchase.value = val;
  1216. };
  1217. const pageSizeSelinfo = ref(20);
  1218. const currentPageSelinfo = ref(1);
  1219. const handleSizeChangeSelinfo = val => {
  1220. pageSizeSelinfo.value = val;
  1221. };
  1222. const handleCurrentChangeSelinfo = val => {
  1223. currentPageSelinfo.value = val;
  1224. };
  1225. const pageSizePurchaseCx = ref(20);
  1226. const currentPagePurchaseCx = ref(1);
  1227. const handleSizeChangePurchaseCx = val => {
  1228. pageSizePurchaseCx.value = val;
  1229. };
  1230. const handleCurrentChangePurchaseCx = val => {
  1231. currentPagePurchaseCx.value = val;
  1232. };
  1233. const pageSizeSelinfoCx = ref(20);
  1234. const currentPageSelinfoCx = ref(1);
  1235. const handleSizeChangeSelinfoCx = val => {
  1236. pageSizeSelinfoCx.value = val;
  1237. };
  1238. const handleCurrentChangeSelinfoCx = val => {
  1239. currentPageSelinfoCx.value = val;
  1240. };
  1241. const ypInvinfoData = ref([]);
  1242. const ypInvinfoUploadData = ref([]);
  1243. const ypPurchaseData = ref([]);
  1244. const ypPurchaseUploadData = ref([]);
  1245. const ypSelinfoData = ref([]);
  1246. const ypSelinfoUploadData = ref([]);
  1247. const selectInvinfoDataList = ref([]);
  1248. const handleInvinfoSelectionChange = data => {
  1249. selectInvinfoDataList.value = data;
  1250. };
  1251. const selectInvinfoDataListCx = ref([]);
  1252. const handleInvinfoSelectionChangeCx = data => {
  1253. selectInvinfoDataListCx.value = data;
  1254. };
  1255. const selectPurchaseDataList = ref([]);
  1256. const handlePurchaseSelectionChange = data => {
  1257. selectPurchaseDataList.value = data;
  1258. };
  1259. const selectPurchaseDataListCx = ref([]);
  1260. const handlePurchaseSelectionChangeCx = data => {
  1261. selectPurchaseDataListCx.value = data;
  1262. };
  1263. const selectSelinfoDataList = ref([]);
  1264. const handleSelinfoSelectionChange = data => {
  1265. selectSelinfoDataList.value = data;
  1266. };
  1267. const selectSelinfoDataListCx = ref([]);
  1268. const handleSelinfoSelectionChangeCx = data => {
  1269. selectSelinfoDataListCx.value = data;
  1270. };
  1271. const keyCode = ref("");
  1272. const ztFlag = ref("3");
  1273. const retFlag = ref("");
  1274. const opFlag = ref("108");
  1275. const uploadGroupNoYk = ref("11");
  1276. const uploadGroupNoYf = ref(useYfGroupStore().getDefaultXyCode);
  1277. const groupNoYfData = ref([]);
  1278. const groupNoYkData = ref([]);
  1279. onMounted(() => {
  1280. nextTick(() => {
  1281. queryData.value.startTime = start;
  1282. queryData.value.endTime = end + " 23:59:59";
  1283. dateRange.value = [start, end];
  1284. queryGroupNoInfo();
  1285. queryCodgInvinfoUpload();
  1286. });
  1287. });
  1288. const queryGroupNoInfo = () => {
  1289. selectGroupNoInfo()
  1290. .then(res => {
  1291. groupNoYfData.value = res.yfList;
  1292. groupNoYkData.value = res.ykList;
  1293. kcList.value = res.kcList;
  1294. })
  1295. .catch(() => {
  1296. groupNoYfData.value = [];
  1297. groupNoYkData.value = [];
  1298. kcList.value = [];
  1299. });
  1300. };
  1301. // 查询药品库存变更待上传信息
  1302. const queryCodgInvinfoUpload = () => {
  1303. selectInvinfoDataList.value = [];
  1304. if (dateRange.value) {
  1305. let dateS = getDateRangeFormatDate(dateRange.value);
  1306. queryData.value.startTime = dateS.startTime;
  1307. queryData.value.endTime = dateS.endTime;
  1308. } else {
  1309. queryData.value.startTime = start;
  1310. queryData.value.endTime = end;
  1311. ElMessage({
  1312. type: "info",
  1313. message: "默认查询本月的数据",
  1314. duration: 2500,
  1315. showClose: true,
  1316. });
  1317. }
  1318. queryData.value.docuNo = keyCode.value;
  1319. queryData.value.groupNo = uploadGroupNoYk.value;
  1320. queryData.value.invChgType = opFlag.value;
  1321. queryData.value.uploadFlag = retFlag.value;
  1322. selectYpInvinfoDetail(queryData.value)
  1323. .then(res => {
  1324. ypInvinfoData.value = res;
  1325. })
  1326. .catch(() => {
  1327. ypInvinfoData.value = [];
  1328. });
  1329. };
  1330. // 查询药品库存变更上传结果信息
  1331. const queryCodgInvinfoUploadResult = () => {
  1332. selectPurchaseDataList.value = [];
  1333. if (dateRange.value) {
  1334. let dateS = getDateRangeFormatDate(dateRange.value);
  1335. queryData.value.startTime = dateS.startTime;
  1336. queryData.value.endTime = dateS.endTime;
  1337. } else {
  1338. queryData.value.startTime = start;
  1339. queryData.value.endTime = end;
  1340. ElMessage({
  1341. type: "info",
  1342. message: "默认查询本月的数据",
  1343. duration: 2500,
  1344. showClose: true,
  1345. });
  1346. }
  1347. queryData.value.docuNo = keyCode.value;
  1348. queryData.value.groupNo = uploadGroupNoYk.value;
  1349. queryData.value.invChgType = opFlag.value;
  1350. queryData.value.uploadFlag = retFlag.value;
  1351. selectYpInvinfoResult(queryData.value)
  1352. .then(res => {
  1353. ypInvinfoUploadData.value = res;
  1354. })
  1355. .catch(() => {
  1356. ypInvinfoUploadData.value = [];
  1357. });
  1358. };
  1359. // 查询药品入库/退货待上传信息
  1360. const queryCodgPurchaseUpload = () => {
  1361. selectPurchaseDataList.value = [];
  1362. if (dateRange.value) {
  1363. let dateS = getDateRangeFormatDate(dateRange.value);
  1364. queryData.value.startTime = dateS.startTime;
  1365. queryData.value.endTime = dateS.endTime;
  1366. } else {
  1367. queryData.value.startTime = start;
  1368. queryData.value.endTime = end;
  1369. ElMessage({
  1370. type: "info",
  1371. message: "默认查询本月的数据",
  1372. duration: 2500,
  1373. showClose: true,
  1374. });
  1375. }
  1376. queryData.value.docuNo = keyCode.value;
  1377. queryData.value.groupNo = uploadGroupNoYk.value;
  1378. queryData.value.type = ztFlag.value;
  1379. queryData.value.uploadFlag = retFlag.value;
  1380. selectYpPurchaseDetail(queryData.value)
  1381. .then(res => {
  1382. ypPurchaseData.value = res;
  1383. })
  1384. .catch(() => {
  1385. ypPurchaseData.value = [];
  1386. });
  1387. };
  1388. // 查询药品销售/退货待上传信息
  1389. const queryCodgSelinfoUpload = () => {
  1390. selectSelinfoDataList.value = [];
  1391. if (dateRange.value) {
  1392. let dateS = getDateRangeFormatDate(dateRange.value);
  1393. let days = subtractTime(dateS.endTime, dateS.startTime);
  1394. if (days > 1) {
  1395. ElMessage({
  1396. type: "info",
  1397. message: "查询药品销售数据请不要超过2天!",
  1398. duration: 2500,
  1399. showClose: true,
  1400. });
  1401. return false;
  1402. }
  1403. queryData.value.startTime = dateS.startTime;
  1404. queryData.value.endTime = dateS.endTime;
  1405. } else {
  1406. queryData.value.startTime = start;
  1407. queryData.value.endTime = end;
  1408. ElMessage({
  1409. type: "info",
  1410. message: "默认查询本月的数据",
  1411. duration: 2500,
  1412. showClose: true,
  1413. });
  1414. }
  1415. queryData.value.patNo = keyCode.value;
  1416. queryData.value.groupNo = uploadGroupNoYf.value;
  1417. queryData.value.type = ztFlag.value;
  1418. queryData.value.uploadFlag = retFlag.value;
  1419. selectYpSelinfoDetail(queryData.value)
  1420. .then(res => {
  1421. ypSelinfoData.value = res;
  1422. })
  1423. .catch(() => {
  1424. ypSelinfoData.value = [];
  1425. });
  1426. };
  1427. // 查询药品入库/退货上传结果信息
  1428. const queryCodgPurchaseUploadResult = () => {
  1429. selectPurchaseDataList.value = [];
  1430. if (dateRange.value) {
  1431. let dateS = getDateRangeFormatDate(dateRange.value);
  1432. queryData.value.startTime = dateS.startTime;
  1433. queryData.value.endTime = dateS.endTime;
  1434. } else {
  1435. queryData.value.startTime = start;
  1436. queryData.value.endTime = end;
  1437. ElMessage({
  1438. type: "info",
  1439. message: "默认查询本月的数据",
  1440. duration: 2500,
  1441. showClose: true,
  1442. });
  1443. }
  1444. queryData.value.docuNo = keyCode.value;
  1445. queryData.value.groupNo = uploadGroupNoYk.value;
  1446. queryData.value.type = ztFlag.value;
  1447. queryData.value.uploadFlag = retFlag.value;
  1448. selectYpPurchaseResult(queryData.value)
  1449. .then(res => {
  1450. ypPurchaseUploadData.value = res;
  1451. })
  1452. .catch(() => {
  1453. ypPurchaseUploadData.value = [];
  1454. });
  1455. };
  1456. // 查询药品销售/退货上传结果信息
  1457. const queryCodgSelinfoUploadResult = () => {
  1458. selectSelinfoDataList.value = [];
  1459. if (dateRange.value) {
  1460. let dateS = getDateRangeFormatDate(dateRange.value);
  1461. queryData.value.startTime = dateS.startTime;
  1462. queryData.value.endTime = dateS.endTime;
  1463. } else {
  1464. queryData.value.startTime = start;
  1465. queryData.value.endTime = end;
  1466. ElMessage({
  1467. type: "info",
  1468. message: "默认查询本月的数据",
  1469. duration: 2500,
  1470. showClose: true,
  1471. });
  1472. }
  1473. queryData.value.patNo = keyCode.value;
  1474. queryData.value.groupNo = uploadGroupNoYf.value;
  1475. queryData.value.type = ztFlag.value;
  1476. queryData.value.uploadFlag = retFlag.value;
  1477. selectYpSelinfoResult(queryData.value)
  1478. .then(res => {
  1479. ypSelinfoUploadData.value = res;
  1480. })
  1481. .catch(() => {
  1482. ypSelinfoUploadData.value = [];
  1483. });
  1484. };
  1485. // 查询
  1486. const queryItem = () => {
  1487. if (editableTabsValue.value === "ypInvinfo") {
  1488. queryCodgInvinfoUpload();
  1489. } else if (editableTabsValue.value === "ypPurchase") {
  1490. queryCodgPurchaseUpload();
  1491. } else if (editableTabsValue.value === "ypSelinfo") {
  1492. queryCodgSelinfoUpload();
  1493. } else if (editableTabsValue.value === "ypPurchaseCx") {
  1494. queryCodgPurchaseUploadResult();
  1495. } else if (editableTabsValue.value === "ypSelinfoCx") {
  1496. queryCodgSelinfoUploadResult();
  1497. } else if (editableTabsValue.value === "ypInvinfoCx") {
  1498. queryCodgInvinfoUploadResult();
  1499. }
  1500. };
  1501. const handleClick = (tab, event) => {
  1502. // 查询哪个tab页面
  1503. editableTabsValue.value = tab.props.name;
  1504. if (editableTabsValue.value === "ypInvinfo") {
  1505. queryCodgInvinfoUpload();
  1506. } else if (editableTabsValue.value === "ypPurchase") {
  1507. queryCodgPurchaseUpload();
  1508. } else if (editableTabsValue.value === "ypSelinfo") {
  1509. queryCodgSelinfoUpload();
  1510. } else if (editableTabsValue.value === "ypPurchaseCx") {
  1511. queryCodgPurchaseUploadResult();
  1512. } else if (editableTabsValue.value === "ypSelinfoCx") {
  1513. queryCodgSelinfoUploadResult();
  1514. } else if (editableTabsValue.value === "ypInvinfoCx") {
  1515. queryCodgInvinfoUploadResult();
  1516. }
  1517. };
  1518. // 批量上传
  1519. const uploadYpGoods = () => {
  1520. ElMessageBox.confirm("请确认是否批量上传选择的内容?", {
  1521. cancelButtonText: "取消",
  1522. confirmButtonText: "确定",
  1523. type: "warning",
  1524. distinguishCancelAndClose: true,
  1525. }).then(() => {
  1526. if ("ypInvinfo" === editableTabsValue.value) {
  1527. uploadYpInvinfoGoods(selectInvinfoDataList.value);
  1528. } else if ("ypInvinfoCx" === editableTabsValue.value) {
  1529. uploadYpInvinfoGoods(selectInvinfoDataList.value);
  1530. } else if ("ypPurchase" === editableTabsValue.value) {
  1531. uploadYpPurchaseGoods(selectPurchaseDataList.value);
  1532. } else if ("ypPurchaseCx" === editableTabsValue.value) {
  1533. uploadYpPurchaseGoods(selectPurchaseDataList.value);
  1534. } else if ("ypSelinfo" === editableTabsValue.value) {
  1535. uploadYpSelinfoGoods(selectSelinfoDataList.value);
  1536. } else if ("ypSelinfoCx" === editableTabsValue.value) {
  1537. uploadYpSelinfoGoods(selectSelinfoDataList.value);
  1538. } else {
  1539. ElMessage({
  1540. type: "warning",
  1541. message: "请选择正确的查询模式!",
  1542. duration: 2500,
  1543. showClose: true,
  1544. });
  1545. return false;
  1546. }
  1547. });
  1548. };
  1549. // 药品库存变更单个上传
  1550. const selectDataS = ref([]);
  1551. const uploadYpInvinfoSingle = row => {
  1552. selectDataS.value.push(row);
  1553. uploadYpInvinfoGoods(selectDataS.value);
  1554. selectData.value = [];
  1555. };
  1556. const uploadYpInvinfoGoods = data => {
  1557. if (data.length === 0) {
  1558. ElMessage({
  1559. type: "warning",
  1560. message: "请选择需要上传的药品库存变更数据!",
  1561. duration: 2500,
  1562. showClose: true,
  1563. });
  1564. return false;
  1565. }
  1566. uploadYpInvinfoBatch(data)
  1567. .then(res => {
  1568. ElMessage({
  1569. type: "success",
  1570. message: res.msg,
  1571. duration: 2500,
  1572. showClose: true,
  1573. });
  1574. queryItem();
  1575. })
  1576. .catch(() => {});
  1577. };
  1578. // 药品入库/退货单个上传
  1579. const selectData = ref([]);
  1580. const uploadYpPurchaseSingle = row => {
  1581. selectData.value.push(row);
  1582. uploadYpPurchaseGoods(selectData.value);
  1583. selectData.value = [];
  1584. };
  1585. const uploadYpPurchaseGoods = data => {
  1586. if (data.length === 0) {
  1587. ElMessage({
  1588. type: "warning",
  1589. message: "请选择需要上传的药品入库/退货数据!",
  1590. duration: 2500,
  1591. showClose: true,
  1592. });
  1593. return false;
  1594. }
  1595. if (ztFlag.value === "1") {
  1596. uploadYpPurchaseBatch(data)
  1597. .then(res => {
  1598. ElMessage({
  1599. type: "success",
  1600. message: res.msg,
  1601. duration: 2500,
  1602. showClose: true,
  1603. });
  1604. })
  1605. .catch(() => {});
  1606. } else if (ztFlag.value === "2") {
  1607. uploadYpPurchaseReturnBatch(data)
  1608. .then(res => {
  1609. ElMessage({
  1610. type: "success",
  1611. message: res.msg,
  1612. duration: 2500,
  1613. showClose: true,
  1614. });
  1615. })
  1616. .catch(() => {});
  1617. }
  1618. queryCodgPurchaseUpload();
  1619. };
  1620. // 删除上传信息
  1621. const deleteYpGoods = () => {
  1622. ElMessageBox.confirm("请确认是否批量删除选择的内容?", {
  1623. cancelButtonText: "取消",
  1624. confirmButtonText: "确定",
  1625. type: "warning",
  1626. distinguishCancelAndClose: true,
  1627. }).then(() => {
  1628. let uploadData = ref([]);
  1629. if ("ypInvinfoCx" === editableTabsValue.value) {
  1630. selectInvinfoDataListCx.value[0].type = "0";
  1631. uploadData.value = selectInvinfoDataListCx.value;
  1632. } else if ("ypPurchaseCx" === editableTabsValue.value) {
  1633. selectPurchaseDataListCx.value[0].type = ztFlag.value;
  1634. uploadData.value = selectPurchaseDataListCx.value;
  1635. } else if ("ypSelinfoCx" === editableTabsValue.value) {
  1636. selectSelinfoDataListCx.value[0].type = ztFlag.value;
  1637. uploadData.value = selectSelinfoDataListCx.value;
  1638. } else {
  1639. ElMessage({
  1640. type: "warning",
  1641. message: "请选择正确的查询模式!",
  1642. duration: 2500,
  1643. showClose: true,
  1644. });
  1645. return false;
  1646. }
  1647. if (uploadData.value.length === 0) {
  1648. ElMessage({
  1649. type: "warning",
  1650. message: "请选择需要删除的数据!",
  1651. duration: 2500,
  1652. showClose: true,
  1653. });
  1654. return false;
  1655. }
  1656. deleteYpUploadBatch(uploadData.value)
  1657. .then(res => {
  1658. ElMessage({
  1659. type: "success",
  1660. message: res.msg,
  1661. duration: 2500,
  1662. showClose: true,
  1663. });
  1664. queryItem();
  1665. })
  1666. .catch(() => {});
  1667. });
  1668. };
  1669. // 更新退货的发票号
  1670. const dialogFormVisible = ref(false);
  1671. const formLabelWidth = "140px";
  1672. const formData = ref({
  1673. inDocuNo: "",
  1674. inSeri: "",
  1675. medListCodg: "",
  1676. chargeName: "",
  1677. serial: "",
  1678. purcInvoNo: "",
  1679. });
  1680. const callYpInvoice = row => {
  1681. dialogFormVisible.value = true;
  1682. formData.value = row;
  1683. };
  1684. const updateYpInvoice = () => {
  1685. if (!formData.value.purcInvoNo) {
  1686. ElMessage({
  1687. type: "warning",
  1688. message: "请选择填写发票号!",
  1689. duration: 2500,
  1690. showClose: true,
  1691. });
  1692. return false;
  1693. }
  1694. saveYpInvoice(formData.value)
  1695. .then(res => {
  1696. ElMessage({
  1697. type: "success",
  1698. message: res.msg,
  1699. duration: 2500,
  1700. showClose: true,
  1701. });
  1702. queryCodgPurchaseUpload();
  1703. dialogFormVisible.value = false;
  1704. })
  1705. .catch(() => {});
  1706. };
  1707. // -------- 商品销售上传相关 -----------------
  1708. const uploadYpSelinfoGoods = data => {
  1709. if (data.length === 0) {
  1710. ElMessage({
  1711. type: "warning",
  1712. message: "请选择需要上传的药品销售/退货数据!",
  1713. duration: 2500,
  1714. showClose: true,
  1715. });
  1716. return false;
  1717. }
  1718. if (ztFlag.value === "3") {
  1719. uploadYpSelinfoBatch(data)
  1720. .then(res => {
  1721. ElMessage({
  1722. type: "success",
  1723. message: res.msg,
  1724. duration: 2500,
  1725. showClose: true,
  1726. });
  1727. queryItem();
  1728. })
  1729. .catch(() => {});
  1730. } else if (ztFlag.value === "4") {
  1731. uploadYpSelinfoReturnBatch(data)
  1732. .then(res => {
  1733. ElMessage({
  1734. type: "success",
  1735. message: res.msg,
  1736. duration: 2500,
  1737. showClose: true,
  1738. });
  1739. queryItem();
  1740. })
  1741. .catch(() => {});
  1742. }
  1743. };
  1744. </script>