YpCodgUpload.vue 58 KB

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