drugStockOutOrder.vue 73KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. size="small"
  7. @click="AddNewOrder"
  8. class="filter-item"
  9. style="float: right"
  10. type="primary"
  11. icon="el-icon-circle-plus-outline"
  12. >新增</el-button
  13. >
  14. </div>
  15. <div class="app-container">
  16. <div class="cell clearfix">
  17. <label class="title"><span class="name">仓库</span> :</label>
  18. <el-select
  19. size="small"
  20. v-model="storehouse_id"
  21. filterable
  22. placeholder="请选择仓库"
  23. style="width: 200px"
  24. @change="changeStoreHouse"
  25. >
  26. <el-option
  27. v-for="(option, index) in houseList"
  28. :key="index"
  29. :label="option.storehouse_name"
  30. :value="option.id"
  31. >
  32. </el-option>
  33. </el-select>
  34. <el-input
  35. size="small"
  36. style="width: 200px"
  37. class="filter-item"
  38. v-model.trim="searchKey"
  39. placeholder="单据编码/制单人/厂商"
  40. />
  41. <el-button
  42. size="small"
  43. class="filter-item"
  44. type="primary"
  45. icon="el-icon-search"
  46. @click="search"
  47. >搜索</el-button
  48. >
  49. <div style="margin-left: 10px">
  50. <label class="title"><span class="name">出库时间</span> : </label>
  51. <el-date-picker
  52. size="small"
  53. v-model="start_time"
  54. prefix-icon="el-icon-date"
  55. :editable="false"
  56. style="width: 196px"
  57. type="date"
  58. placeholder="选择日期时间"
  59. align="right"
  60. format="yyyy-MM-dd"
  61. value-format="yyyy-MM-dd"
  62. @change="startTimeChange"
  63. ></el-date-picker>
  64. <span class="cellLine"> - </span>
  65. <el-date-picker
  66. size="small"
  67. v-model="end_time"
  68. prefix-icon="el-icon-date"
  69. :editable="false"
  70. style="width: 196px"
  71. type="date"
  72. placeholder="选择日期时间"
  73. align="right"
  74. format="yyyy-MM-dd"
  75. value-format="yyyy-MM-dd"
  76. @change="endTimeChange"
  77. ></el-date-picker>
  78. </div>
  79. <!-- <div style="margin-left: 10px">
  80. <span>审核状态:</span>
  81. <el-select
  82. v-model="check_id"
  83. style="width: 140px; margin-right: 10px"
  84. placeholder="请选择"
  85. @change="changeTypeName"
  86. >
  87. <el-option
  88. v-for="item in checkList"
  89. :key="item.id"
  90. :label="item.name"
  91. :value="item.id"
  92. >
  93. </el-option>
  94. </el-select>
  95. </div> -->
  96. </div>
  97. <div class="cell clearfix">
  98. <el-checkbox
  99. style="width: 70px"
  100. v-model="checked"
  101. @change="changeAllSelected"
  102. >全选</el-checkbox
  103. >
  104. <el-button size="small" icon="el-icon-delete" @click="batchDelete"
  105. >删除</el-button
  106. >
  107. <el-button size="small" type="primary" @click="toPrint">打印</el-button>
  108. <el-button size="small" type="primary" @click="toExport" :disabled="exportLoding">导出</el-button>
  109. <span>&nbsp;&nbsp;</span>
  110. <label class="title"><span class="name">出库方式</span> :</label>
  111. <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
  112. <el-option
  113. v-for="(option, index) in wayList"
  114. :key="index"
  115. :label="option.name"
  116. :value="option.id">
  117. </el-option>
  118. </el-select>
  119. <span>&nbsp;&nbsp;</span>
  120. <label class="title"><span class="name">审核状态</span> :</label>
  121. <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
  122. <el-option
  123. v-for="(option, index) in checkList"
  124. :key="index"
  125. :label="option.name"
  126. :value="option.id">
  127. </el-option>
  128. </el-select>
  129. </div>
  130. <el-table
  131. @current-change="handleSearch"
  132. :data="warehouseOutDate"
  133. :class="signAndWeighBoxPatients"
  134. style="width: 100%"
  135. border
  136. highlight-current-row
  137. ref="multipleTable"
  138. @selection-change="select"
  139. :row-style="{ color: '#303133' }"
  140. :header-cell-style="{
  141. backgroundColor: 'rgb(245, 247, 250)',
  142. color: '#606266',
  143. }"
  144. >
  145. <el-table-column type="selection" width="55" align="center">
  146. </el-table-column>
  147. <el-table-column label="单据日期" align="center">
  148. <template slot-scope="scope">
  149. {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="单据编号" align="center">
  153. <template slot-scope="scope">
  154. {{ scope.row.warehouse_out_order_number }}
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="仓库名称" align="center">
  158. <template slot-scope="scope">
  159. {{ getHouseName(scope.row.storehouse_id) }}
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="制单人" align="center">
  163. <template slot-scope="scope">
  164. {{ getXuserName(scope.row.creater) }}
  165. </template>
  166. </el-table-column>
  167. <el-table-column min-width="40" align="center">
  168. <template slot="header" slot-scope="scope">
  169. <span>出库方式</span>
  170. </template>
  171. <template slot-scope="scope">
  172. <span v-if="scope.row.is_sys == 1">{{ "自动出库" }}</span>
  173. <span v-if="scope.row.is_sys == 0">{{ "手动出库" }}</span>
  174. <span v-if="scope.row.is_sys == 12">{{ "调拨出库" }}</span>
  175. <span v-if="scope.row.is_sys == 5">{{ "结算出库" }}</span>
  176. </template>
  177. </el-table-column>
  178. <el-table-column min-width="40" align="center">
  179. <template slot="header" slot-scope="scope">
  180. <span>审核状态</span>
  181. </template>
  182. <template slot-scope="scope">
  183. <span v-if="scope.row.is_check == 1">已审核</span>
  184. <span v-if="scope.row.is_check == 2">未审核</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="操作" align="center" width="240">
  188. <template slot-scope="scope">
  189. <el-tooltip
  190. class="item"
  191. effect="dark"
  192. content="编辑"
  193. placement="top"
  194. >
  195. <el-button
  196. size="mini"
  197. type="primary"
  198. icon="el-icon-edit-outline"
  199. @click="handleEdit(scope.$index, scope.row)"
  200. >
  201. </el-button>
  202. </el-tooltip>
  203. <el-tooltip
  204. class="item"
  205. effect="dark"
  206. content="删除"
  207. placement="top"
  208. >
  209. <el-button
  210. size="mini"
  211. type="danger"
  212. :disabled="scope.row.is_sys == 1"
  213. icon="el-icon-delete"
  214. @click="handleDelete(scope.$index, scope.row)"
  215. >
  216. </el-button>
  217. </el-tooltip>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. <el-pagination
  222. @size-change="handleSizeChange"
  223. @current-change="handleCurrentChange"
  224. :page-sizes="[5, 10, 50, 100]"
  225. :page-size="5"
  226. background
  227. style="margin-top: 20px; text-align: right"
  228. layout="total, sizes, prev, pager, next, jumper"
  229. :total="total"
  230. >
  231. </el-pagination>
  232. <!-- 使用详情 -->
  233. <div v-show="tableShow" style="margin-top: 10px">
  234. <el-table
  235. :data="tableList"
  236. :class="signAndWeighBoxPatients"
  237. style="width: 100%"
  238. border
  239. highlight-current-row
  240. ref="multipleTableOne"
  241. @selection-change="select"
  242. :row-style="{ color: '#303133' }"
  243. :header-cell-style="{
  244. backgroundColor: 'rgb(245, 247, 250)',
  245. color: '#606266',
  246. }"
  247. :cell-class-name="cellStyle"
  248. >
  249. <el-table-column label="药品名称" align="center">
  250. <template slot-scope="scope">
  251. {{ scope.row.drug_name }}
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="药品类型" align="center">
  255. <template slot-scope="scope">
  256. {{ getDrugType(scope.row.drug_type) }}
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="规格&单位" align="center">
  260. <template slot-scope="scope">
  261. {{ scope.row.dose }}&nbsp;{{ scope.row.dose_unit }}*{{
  262. scope.row.min_number
  263. }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
  264. </template>
  265. </el-table-column>
  266. <el-table-column label="国家编码" align="center">
  267. <template slot-scope="scope">
  268. {{ scope.row.medical_insurance_number }}
  269. </template>
  270. </el-table-column>
  271. <!-- <el-table-column label="仓库名称" align="center">
  272. <template slot-scope="scope">
  273. {{ getHouseName(scope.row.storehouse_id) }}
  274. </template>
  275. </el-table-column> -->
  276. <el-table-column label="仓库名称" align="center">
  277. <template slot-scope="scope">
  278. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  279. <td style="border-right: none; border-inline-end:none;text-align: center">
  280. {{ getHouseName(item.storehouse_id) }}
  281. </td>
  282. </tr>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="出库数量" align="center">
  286. <template slot-scope="scope">
  287. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  288. <td style="border-right: none; border-inline-end:none;text-align: center">
  289. <span v-if="is_sys==1 || is_sys == 5">{{getOutCountSix(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_id)}}</span>
  290. <span v-if="is_sys == 12">{{getOutCountTen(item.count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  291. <span v-if="is_sys == 0"> {{getOutCountOne(item.batch_number,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_id)}} </span>
  292. </td>
  293. </tr>
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="批次" align="center">
  297. <template slot-scope="scope">
  298. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  299. <td style="border-right: none; border-inline-end:none;text-align: center">
  300. <span v-if="is_sys == 1 || is_sys == 5">
  301. {{getBatchNumber(item.warehousing_detail_id)}}
  302. </span>
  303. <span v-if="is_sys == 12">{{getBatchNumber(item.warehousing_detail_id)}}</span>
  304. <span v-if="is_sys == 0">{{getBatchNumberOne(item.batch_number)}}</span>
  305. </td>
  306. </tr>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
  310. <template slot-scope="scope">
  311. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  312. <td style="border-right: none; border-inline-end: none;text-align: center">
  313. {{getXuserName(scope.row.admin_user_id)}}
  314. </td>
  315. </tr>
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="单价" align="center">
  319. <template slot-scope="scope">
  320. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  321. <td style="border-right: none; border-inline-end: none;text-align: center">
  322. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12">{{getPrice(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  323. <span v-if="is_sys == 0">
  324. <span v-if="scope.row.child.length == 1">
  325. {{getPriceTwo(item.warehouse_out_id,item.drug_id)}}
  326. </span>
  327. <span v-if="scope.row.child.length > 1">
  328. {{item.price}}
  329. </span>
  330. </span>
  331. </td>
  332. </tr>
  333. </template>
  334. </el-table-column>
  335. <el-table-column label="总价" align="center">
  336. <template slot-scope="scope">
  337. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  338. <td style="border-right: none; border-inline-end: none;text-align: center">
  339. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12">{{getTotalPrice(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}} </span>
  340. <span v-if="is_sys == 0">
  341. <span v-if="scope.row.child.length == 1">{{item.retail_price}}</span>
  342. <span v-if="scope.row.child.length > 1">{{item.count * item.price}}</span>
  343. </span>
  344. </td>
  345. </tr>
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="生产厂家" align="center">
  349. <template slot-scope="scope">
  350. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  351. <td style="border-right: none; border-inline-end: none;text-align: center">
  352. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12"> {{getAllManufacturerName(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  353. <span v-if="is_sys == 0"> {{getManufacturerName(scope.row.manufacturer)}}</span>
  354. </td>
  355. </tr>
  356. </template>
  357. </el-table-column>
  358. <el-table-column label="生产日期" align="center">
  359. <template slot-scope="scope">
  360. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  361. <td style="border-right: none; border-inline-end: none;text-align: center">
  362. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12"> {{getProductDate(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  363. <span v-if="is_sys == 0"> {{getTime(scope.row.product_date)}}</span>
  364. </td>
  365. </tr>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="有效日期" align="center">
  369. <template slot-scope="scope">
  370. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  371. <td style="border-right: none; border-inline-end: none;text-align: center">
  372. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12"> {{getExpiryDate(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  373. <span v-if="is_sys == 0"> {{getTime(scope.row.expiry_date)}}</span>
  374. </td>
  375. </tr>
  376. </template>
  377. </el-table-column>
  378. <el-table-column label="经销商" align="center">
  379. <template slot-scope="scope">
  380. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  381. <td style="border-right: none; border-inline-end: none;text-align: center">
  382. <span v-if="is_sys ==1 || is_sys ==5 || is_sys ==12">{{getDealer(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  383. <span v-if="is_sys ==0">{{getDealerName(scope.row.dealer)}}</span>
  384. </td>
  385. </tr>
  386. </template>
  387. </el-table-column>
  388. <el-table-column label="批准文号" align="center">
  389. <template slot-scope="scope">
  390. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  391. <td style="border-right: none; border-inline-end: none;text-align: center">
  392. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12">{{getNumber(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  393. <span v-if="is_sys == 0">{{scope.row.number}}</span>
  394. </td>
  395. </tr>
  396. </template>
  397. </el-table-column>
  398. <el-table-column label="备注" align="center">
  399. <template slot-scope="scope">
  400. <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
  401. <td style="border-right: none; border-inline-end: none;text-align: center">
  402. <span v-if="is_sys == 1 || is_sys == 5 || is_sys == 12">{{getRemark(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  403. <span v-if="is_sys == 0">{{scope.row.remark}}</span>
  404. </td>
  405. </tr>
  406. </template>
  407. </el-table-column>
  408. <el-table-column label="操作" align="center">
  409. <template slot-scope="scope">
  410. <span style="color: #589ff8" @click="toDetail(scope.row)"
  411. >使用明细</span
  412. >
  413. </template>
  414. </el-table-column>
  415. </el-table>
  416. </div>
  417. </div>
  418. <el-dialog title="提示" :visible.sync="drugDialogVisible" width="90%">
  419. <span>
  420. <el-table
  421. :data="userList"
  422. :class="signAndWeighBoxPatients"
  423. style="width: 50%"
  424. border
  425. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  426. >
  427. <el-table-column min-width="35" align="center">
  428. <template slot="header" slot-scope="scope">
  429. <span>序号</span>
  430. </template>
  431. <template slot-scope="scope">
  432. {{ scope.$index + 1 }}
  433. </template>
  434. </el-table-column>
  435. <el-table-column min-width="35" align="center">
  436. <template slot="header" slot-scope="scope">
  437. <span>使用人</span>
  438. </template>
  439. <template slot-scope="scope">
  440. {{ scope.row.user.name }}
  441. </template>
  442. </el-table-column>
  443. <el-table-column min-width="35" align="center">
  444. <template slot="header" slot-scope="scope">
  445. <span>使用数量</span>
  446. </template>
  447. <template slot-scope="scope">
  448. <span>{{ scope.row.count }}{{ scope.row.count_unit }}</span>
  449. </template>
  450. </el-table-column>
  451. <el-table-column min-width="35" align="center">
  452. <template slot="header" slot-scope="scope">
  453. <span>使用时间</span>
  454. </template>
  455. <template slot-scope="scope">
  456. <span
  457. >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
  458. </span>
  459. </template>
  460. </el-table-column>
  461. </el-table>
  462. </span>
  463. <span slot="footer" class="dialog-footer">
  464. <el-button @click="drugDialogVisible = false">取 消</el-button>
  465. <el-button type="primary" @click="drugDialogVisible = false"
  466. >确 定</el-button
  467. >
  468. </span>
  469. </el-dialog>
  470. <el-dialog title="提示" :visible.sync="drugDialogVisibleTwo" width="90%">
  471. <span>
  472. <el-table
  473. :data="userListOne"
  474. :class="signAndWeighBoxPatients"
  475. style="width: 50%"
  476. border
  477. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  478. >
  479. <el-table-column min-width="35" align="center">
  480. <template slot="header" slot-scope="scope">
  481. <span>序号</span>
  482. </template>
  483. <template slot-scope="scope">
  484. {{ scope.$index + 1 }}
  485. </template>
  486. </el-table-column>
  487. <el-table-column min-width="35" align="center">
  488. <template slot="header" slot-scope="scope">
  489. <span>使用人</span>
  490. </template>
  491. <template slot-scope="scope">
  492. <span>系统</span>
  493. </template>
  494. </el-table-column>
  495. <el-table-column min-width="35" align="center">
  496. <template slot="header" slot-scope="scope">
  497. <span>使用数量</span>
  498. </template>
  499. <template slot-scope="scope">
  500. {{ scope.row.count }}{{ scope.row.count_unit }}
  501. </template>
  502. </el-table-column>
  503. <el-table-column min-width="35" align="center">
  504. <template slot="header" slot-scope="scope">
  505. <span>使用时间</span>
  506. </template>
  507. <template slot-scope="scope">
  508. <span
  509. >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
  510. </span>
  511. </template>
  512. </el-table-column>
  513. </el-table>
  514. </span>
  515. <span slot="footer" class="dialog-footer">
  516. <el-button @click="drugDialogVisibleTwo = false">取 消</el-button>
  517. <el-button type="primary" @click="drugDialogVisibleTwo = false"
  518. >确 定</el-button
  519. >
  520. </span>
  521. </el-dialog>
  522. </div>
  523. </template>
  524. <script>
  525. import { uParseTime } from "@/utils/tools";
  526. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  527. import {
  528. deleteDrugWarehouseOut,
  529. GetAllConfig,
  530. getDrugWarehouseOutList,
  531. getDrugWarehouseOutUser,
  532. getDrugAutoMaticList,
  533. getSinleOrderDetail,
  534. getAutoDrugDetail,
  535. getDrugCountList,
  536. getExportOutOrderDrugList,
  537. } from "@/api/drug/drug_stock";
  538. import BreadCrumb from "../../components/bread-crumb";
  539. import { getInitializtion } from "@/api/stock";
  540. export default {
  541. name: "salesReturnOrder",
  542. components: { BreadCrumb },
  543. created() {
  544. if (this.$route.path == "/Pharmacy/drugs/stock/out") {
  545. this.crumbs = [
  546. { path: false, name: "药品管理" },
  547. { path: "/stock/drugs/stock/query", name: "出库单·" },
  548. ];
  549. }
  550. this.org_id = this.$store.getters.xt_user.org.id;
  551. var nowDate = new Date();
  552. var nowYear = nowDate.getFullYear();
  553. var nowMonth = nowDate.getMonth() + 1;
  554. var nowDay = nowDate.getDate();
  555. this.end_time =
  556. nowYear +
  557. "-" +
  558. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  559. "-" +
  560. (nowDay < 10 ? "0" + nowDay : nowDay);
  561. nowDate.setMonth(nowDate.getMonth() - 1);
  562. nowYear = nowDate.getFullYear();
  563. nowMonth = nowDate.getMonth() + 1;
  564. nowDay = nowDate.getDate();
  565. this.start_time =
  566. nowYear +
  567. "-" +
  568. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  569. "-" +
  570. (nowDay < 10 ? "0" + nowDay : nowDay);
  571. this.GetWarehouseOut();
  572. this.fetchAllAdminUsers();
  573. this.getDrugCountList();
  574. this.getInitializtion();
  575. },
  576. data() {
  577. return {
  578. searchKey: "",
  579. crumbs: [
  580. { path: false, name: "库存管理" },
  581. { path: false, name: "出库单" },
  582. ],
  583. page: 1,
  584. limit: 5,
  585. check_id: 0,
  586. checked: false,
  587. total: 0,
  588. pageTotal: 0,
  589. pageSelect: 0,
  590. adminUserOptions: [],
  591. multipleSelection: [],
  592. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  593. start_time: "",
  594. warehouseOutDate: [],
  595. end_time: "",
  596. goodType: [],
  597. goodInfo: [],
  598. manufacturer: [],
  599. selectedTableData: [],
  600. dealer: [],
  601. type: 1,
  602. dialogVisible: false,
  603. dialogVisibleTwo: false,
  604. warehousingOutInfo: {
  605. loading: false,
  606. warehousingOutData: [],
  607. info: {},
  608. },
  609. userList: [],
  610. list: [],
  611. drugConfig: {},
  612. drugList: [],
  613. tableList: [],
  614. drugTypeList: [],
  615. tableShow: false,
  616. manufacturerList: [],
  617. drugDialogVisible: false,
  618. drugDialogVisibleTwo: false,
  619. order_id: 0,
  620. dealerList: [],
  621. countList: [],
  622. outCountList: [],
  623. autoCountList: [],
  624. keyword: "",
  625. drug_type: 0,
  626. minCount: [],
  627. drugOutList: [],
  628. outList: [],
  629. userListOne: [],
  630. exportList: [],
  631. batchNumberList: [],
  632. drugFlowList: [],
  633. houseList: [],
  634. storehouse_id: 0,
  635. is_sys: 0,
  636. org_id: 0,
  637. way_type: 0,
  638. wayList: [
  639. { id: 0, name: "全部" },
  640. { id: 1, name: "手动出库" },
  641. { id: 2, name: "自动出库" },
  642. { id: 3, name: "调拨出库" },
  643. { id: 4, name: "结算出库" },
  644. ],
  645. check_type:0,
  646. checkList:[
  647. {id:0,name:"全部"},
  648. {id:1,name:"已审核"},
  649. {id:2,name:"未审核"},
  650. ],
  651. tabList:[],
  652. tabListOne:[],
  653. drugOutInfo:[],
  654. warehouseOutList:[],
  655. exportLoding:false,
  656. outInfoList:[],
  657. };
  658. },
  659. methods: {
  660. changeTypeName() {
  661. this.getlist();
  662. },
  663. getlist() {
  664. var params = {
  665. check_id: this.check_id,
  666. start_time: this.start_time,
  667. end_time: this.end_time,
  668. keyword: this.keywords,
  669. page: this.page,
  670. limit: this.limit,
  671. };
  672. getAllSecondOrderList(params).then((response) => {
  673. if (response.data.state == 1) {
  674. var list = response.data.data.list;
  675. this.tableList = list;
  676. var total = response.data.data.total;
  677. this.total = total;
  678. this.houseList = response.data.data.houseList;
  679. this.doctorList = response.data.data.doctorList;
  680. }
  681. });
  682. },
  683. search: function () {
  684. const Params = {
  685. page: this.page,
  686. limit: this.limit,
  687. start_time: this.start_time,
  688. end_time: this.end_time,
  689. type: this.type,
  690. keywords: this.searchKey,
  691. storehouse_id: this.storehouse_id,
  692. way_type: this.way_type,
  693. check_type:this.check_type,
  694. };
  695. this.warehouseOutDate = [];
  696. getDrugWarehouseOutList(Params).then((response) => {
  697. if (response.data.state == 0) {
  698. this.$message.error(response.data.msg);
  699. return false;
  700. } else {
  701. this.total = response.data.data.total;
  702. for (let i = 0; i < response.data.data.list.length; i++) {
  703. this.warehouseOutDate.push(response.data.data.list[i]);
  704. }
  705. var obj = { id: 0, storehouse_name: "全部" };
  706. this.houseList = [];
  707. this.houseList.push(obj);
  708. for (let i = 0; i < response.data.data.houseList.length; i++) {
  709. this.houseList.push(response.data.data.houseList[i]);
  710. }
  711. }
  712. });
  713. },
  714. AddNewOrder: function () {
  715. if (this.$route.path == "/Pharmacy/drugs/stock/out") {
  716. this.$router.push({
  717. name: "drugStockOutOrderAdd_Pharmacy",
  718. query: { type: this.type },
  719. });
  720. } else {
  721. this.$router.push({
  722. name: "drugStockOutOrderAdd",
  723. query: { type: this.type },
  724. });
  725. }
  726. },
  727. GetWarehouseOut: function () {
  728. const Params = {
  729. page: this.page,
  730. limit: this.limit,
  731. start_time: this.start_time,
  732. end_time: this.end_time,
  733. type: this.type,
  734. keywords: this.searchKey,
  735. storehouse_id: this.storehouse_id,
  736. way_type: this.way_type,
  737. check_type:this.check_type,
  738. };
  739. this.warehouseOutDate = [];
  740. getDrugWarehouseOutList(Params).then((response) => {
  741. if (response.data.state == 0) {
  742. this.$message.error(response.data.msg);
  743. return false;
  744. } else {
  745. this.total = response.data.data.total;
  746. for (let i = 0; i < response.data.data.list.length; i++) {
  747. this.warehouseOutDate.push(response.data.data.list[i]);
  748. }
  749. var obj = { id: 0, storehouse_name: "全部" };
  750. this.houseList = [];
  751. this.houseList.push(obj);
  752. for (let i = 0; i < response.data.data.houseList.length; i++) {
  753. this.houseList.push(response.data.data.houseList[i]);
  754. }
  755. }
  756. });
  757. },
  758. getXuserName(id) {
  759. if (id <= 0) {
  760. return "";
  761. }
  762. var name = "";
  763. if (
  764. this.adminUserOptions == null ||
  765. typeof this.adminUserOptions.length === "undefined"
  766. ) {
  767. return name;
  768. }
  769. var leng = this.adminUserOptions.length;
  770. if (leng == 0) {
  771. return name;
  772. }
  773. for (let index = 0; index < leng; index++) {
  774. if (this.adminUserOptions[index].id == id) {
  775. name = this.adminUserOptions[index].name;
  776. break;
  777. }
  778. }
  779. return name;
  780. },
  781. fetchAllAdminUsers() {
  782. fetchAllAdminUsers().then((response) => {
  783. if (response.data.state == 1) {
  784. this.adminUserOptions = response.data.data.users;
  785. var alen = this.adminUserOptions.length;
  786. for (let index = 0; index < alen; index++) {
  787. if (this.adminUserOptions[index].user_type == 2) {
  788. // this.doctorOptions.push(this.adminUserOptions[index]);
  789. }
  790. }
  791. }
  792. });
  793. },
  794. handleSelectionChange: function (val) {
  795. this.multipleSelection = val;
  796. },
  797. handleSizeChange(val) {
  798. this.limit = val;
  799. this.GetWarehouseOut();
  800. },
  801. handleCurrentChange(val) {
  802. this.page = val;
  803. this.GetWarehouseOut();
  804. },
  805. startTimeChange(val) {
  806. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  807. if (time > 0) {
  808. this.$message.error("结束时间不能小于开始时间");
  809. this.start_time = "";
  810. } else {
  811. this.GetWarehouseOut();
  812. }
  813. },
  814. endTimeChange(val) {
  815. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  816. if (time < 0) {
  817. this.$message.error("结束时间不能小于开始时间");
  818. this.end_time = "";
  819. } else {
  820. this.GetWarehouseOut();
  821. }
  822. },
  823. getTimestamp(time) {
  824. // 把时间日期转成时间戳
  825. return new Date(time).getTime() / 1000;
  826. },
  827. calculate: function (val) {
  828. return Math.round(parseFloat(val) * 100) / 100;
  829. },
  830. GetConfigInfo: function () {
  831. GetAllConfig().then((response) => {
  832. if (response.data.state == 0) {
  833. this.$message.error(response.data.msg);
  834. return false;
  835. } else {
  836. this.manufacturer = response.data.data.manufacturer;
  837. this.dealer = response.data.data.dealer;
  838. }
  839. });
  840. },
  841. handleEdit: function (index, row) {
  842. this.$router.push({
  843. path:
  844. "/drug/out/drugstockoutorderedit?id=" +
  845. row.id +
  846. "&type=" +
  847. this.type +
  848. "&is_sys=" +
  849. row.is_sys +
  850. "&supply_cancel_out_id=" +
  851. row.supply_cancel_out_id+"&is_check="+row.is_check
  852. });
  853. },
  854. handleSearch(val) {
  855. this.is_sys = val.is_sys;
  856. this.getInitializtion();
  857. this.getSinleOrderDetail(val.id, val.warehouse_out_time, val.is_sys);
  858. this.list = [];
  859. },
  860. handleDelete: function (index, row) {
  861. if (row.is_sys == 5) {
  862. this.$message.error("结算出库数据不能删除!");
  863. return;
  864. }
  865. if (row.is_sys == 12) {
  866. this.$message.error("调拨出库数据不能删除!");
  867. return;
  868. }
  869. if (row.supply_cancel_out_id > 0) {
  870. this.$message.error("采购出库数据不能删除!");
  871. return;
  872. }
  873. if(row.is_check == 1){
  874. this.$message.error("已审核的单据不能删除!")
  875. return false
  876. }
  877. const ids = [];
  878. ids.push(row.id);
  879. const idStr = ids.join(",");
  880. const params = {
  881. ids: idStr,
  882. };
  883. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  884. confirmButtonText: "确定",
  885. cancelButtonText: "取消",
  886. type: "warning",
  887. })
  888. .then(() => {
  889. deleteDrugWarehouseOut(params).then((response) => {
  890. if (response.data.state == 0) {
  891. this.$message.error(response.data.msg);
  892. return false;
  893. } else {
  894. this.$notify({
  895. title: "成功",
  896. message: "删除成功",
  897. type: "success",
  898. duration: 2000,
  899. });
  900. for (let i = 0; i < ids.length; i++) {
  901. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  902. if (ids[i] == this.warehouseOutDate[y].id) {
  903. this.warehouseOutDate.splice(y, 1);
  904. }
  905. }
  906. }
  907. }
  908. });
  909. })
  910. .catch(() => {});
  911. },
  912. changeAllSelected: function (val) {
  913. if (val) {
  914. this.$refs.multipleTable.toggleAllSelection();
  915. } else {
  916. this.$refs.multipleTable.clearSelection();
  917. }
  918. },
  919. select(selection) {
  920. var ids = [];
  921. for (let i = 0; i < selection.length; i++) {
  922. ids.push(selection[i].id);
  923. }
  924. this.order_id = ids.join(",");
  925. this.selectedTableData = selection;
  926. this.getExportOutOrderDrugList();
  927. },
  928. batchDelete() {
  929. console.log("232322323", this.selectedTableData);
  930. if (this.selectedTableData.length <= 0) {
  931. this.$message.error("请选择要删除的记录");
  932. return;
  933. }
  934. const ids = [];
  935. const idsOne = [];
  936. for (let i = 0; i < this.selectedTableData.length; i++) {
  937. if(this.selectedTableData[i].is_check == 1){
  938. this.$message.error("已审核单据不能删除!")
  939. return false
  940. }
  941. if (this.selectedTableData[i].is_sys == 1) {
  942. this.$message.error("自动出库数据不能删除!");
  943. return false;
  944. }
  945. if (this.selectedTableData[i].is_sys == 12) {
  946. this.$message.error("调拨出库数据不能删除!");
  947. return false;
  948. }
  949. if (this.selectedTableData[i].is_sys == 5) {
  950. this.$message.error("结算出库数据不能删除!");
  951. return false;
  952. }
  953. if (this.selectedTableData[i].is_sys == 0) {
  954. ids.push(this.selectedTableData[i].id);
  955. if(this.selectedTableData[i].supply_cancel_out_id >0){
  956. idsOne.push(this.selectedTableData[i].supply_cancel_out_id);
  957. }
  958. }
  959. }
  960. if (idsOne.length > 0) {
  961. this.$message.error("采购出库数据不能删除!");
  962. return;
  963. }
  964. const idStr = ids.join(",");
  965. const params = {
  966. ids: idStr,
  967. };
  968. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  969. confirmButtonText: "确定",
  970. cancelButtonText: "取消",
  971. type: "warning",
  972. })
  973. .then(() => {
  974. deleteDrugWarehouseOut(params).then((response) => {
  975. if (response.data.state == 0) {
  976. this.$message.error(response.data.msg);
  977. return false;
  978. } else {
  979. this.$notify({
  980. title: "成功",
  981. message: "删除成功",
  982. type: "success",
  983. duration: 2000,
  984. });
  985. for (let i = 0; i < ids.length; i++) {
  986. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  987. if (ids[i] == this.warehouseOutDate[y].id) {
  988. this.warehouseOutDate.splice(y, 1);
  989. }
  990. }
  991. }
  992. }
  993. });
  994. })
  995. .catch(() => {});
  996. },
  997. jump(id) {
  998. this.GetOrderDetailTwo(id);
  999. this.userList = [];
  1000. this.dialogVisibleTwo = true;
  1001. },
  1002. GetOrderDetailTwo(order_id) {
  1003. const params = {
  1004. id: order_id,
  1005. };
  1006. getDrugWarehouseOutUser(params).then((response) => {
  1007. if (response.data.state == 0) {
  1008. this.$message.error(response.data.msg);
  1009. return false;
  1010. } else {
  1011. this.userList = [];
  1012. var total = 0;
  1013. for (let i = 0; i < response.data.data.list.length; i++) {
  1014. var obj = response.data.data.list[i];
  1015. obj["is_total"] = 0;
  1016. this.userList.push(obj);
  1017. total = total + response.data.data.list[i].count;
  1018. }
  1019. this.userList.push({
  1020. is_total: 1,
  1021. total: total,
  1022. });
  1023. }
  1024. });
  1025. },
  1026. merge({ row, column, rowIndex, columnIndex }) {
  1027. if (columnIndex === 0) {
  1028. const _row = this.tempArr[rowIndex];
  1029. const _col = _row > 0 ? 1 : 0;
  1030. return {
  1031. rowspan: _row,
  1032. colspan: _col,
  1033. };
  1034. }
  1035. },
  1036. handleSpanTempArr() {
  1037. this.tempArr = [];
  1038. for (
  1039. let i = 0;
  1040. i < this.warehousingOutInfo.warehousingOutData.length;
  1041. i++
  1042. ) {
  1043. if (i === 0) {
  1044. this.tempArr.push(1);
  1045. this.pos = 0;
  1046. } else {
  1047. // 判断当前元素与上一个元素是否相同
  1048. if (
  1049. this.warehousingOutInfo.warehousingOutData[i].drug_id ===
  1050. this.warehousingOutInfo.warehousingOutData[i - 1].drug_id
  1051. ) {
  1052. this.tempArr[this.pos] += 1;
  1053. this.tempArr.push(0);
  1054. } else {
  1055. this.tempArr.push(1);
  1056. this.pos = i;
  1057. }
  1058. }
  1059. }
  1060. let sameRowArr = [],
  1061. sIdx = 0;
  1062. this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
  1063. item.index = index;
  1064. if (index === 0) {
  1065. sameRowArr.push([index]);
  1066. } else {
  1067. if (
  1068. item.drug_id ===
  1069. this.warehousingOutInfo.warehousingOutData[index - 1].drug_id
  1070. ) {
  1071. sameRowArr[sIdx].push(index);
  1072. } else {
  1073. sIdx = sIdx + 1;
  1074. sameRowArr.push([index]);
  1075. }
  1076. }
  1077. });
  1078. this.sameRowArr = sameRowArr;
  1079. },
  1080. // getDrugAutoMaticList(id, recordTime, warehouse_out_order_number) {
  1081. // var params = {
  1082. // warehous_out_id: id,
  1083. // record_time: recordTime,
  1084. // warehouse_out_order_number: warehouse_out_order_number,
  1085. // };
  1086. // getDrugAutoMaticList(params).then((response) => {
  1087. // if (response.data.state == 1) {
  1088. // var list = response.data.data.list;
  1089. // this.list = list;
  1090. // var drugConfig = response.data.data.drugConfig;
  1091. // this.drugConfig = drugConfig;
  1092. // var drugList = response.data.data.drugList;
  1093. // this.drugList = drugList;
  1094. // var manulist = response.data.data.manufacturerList;
  1095. // this.manufacturerList = manulist;
  1096. // }
  1097. // });
  1098. // },
  1099. getDrugCount(id) {
  1100. var count = 0;
  1101. for (let i = 0; i < this.list.length; i++) {
  1102. if (this.list[i].drug_id == id) {
  1103. count = this.list[i].Total;
  1104. }
  1105. }
  1106. return count;
  1107. },
  1108. getRetailPrice(id) {
  1109. var price = 0;
  1110. for (let i = 0; i < this.drugList.length; i++) {
  1111. if (id == this.drugList[i].id) {
  1112. price = this.drugList[i].retail_price;
  1113. }
  1114. }
  1115. return price;
  1116. },
  1117. getTime(val) {
  1118. if (val < 0) {
  1119. return "";
  1120. }
  1121. if (val == "") {
  1122. return "";
  1123. } else {
  1124. return uParseTime(val, "{y}-{m}-{d}");
  1125. }
  1126. },
  1127. getInitializtion() {
  1128. getInitializtion().then((response) => {
  1129. if (response.data.state == 1) {
  1130. var drugTypeList = response.data.data.drugTypeList;
  1131. this.drugTypeList = drugTypeList;
  1132. }
  1133. });
  1134. },
  1135. getDrugType(id) {
  1136. var name = "";
  1137. for (let i = 0; i < this.drugTypeList.length; i++) {
  1138. if (id == this.drugTypeList[i].value) {
  1139. name = this.drugTypeList[i].name;
  1140. }
  1141. }
  1142. return name;
  1143. },
  1144. getManufacturerName(id) {
  1145. var name = "";
  1146. for (let i = 0; i < this.manufacturerList.length; i++) {
  1147. if (id == this.manufacturerList[i].id) {
  1148. name = this.manufacturerList[i].manufacturer_name;
  1149. }
  1150. }
  1151. return name;
  1152. },
  1153. getDealerName(id) {
  1154. var name = "";
  1155. for (let i = 0; i < this.dealerList.length; i++) {
  1156. if (id == this.dealerList[i].id) {
  1157. name = this.dealerList[i].dealer_name;
  1158. }
  1159. }
  1160. return name;
  1161. },
  1162. getSinleOrderDetail(id, start_time, is_sys) {
  1163. var params = {
  1164. id: id,
  1165. start_time: start_time,
  1166. };
  1167. getSinleOrderDetail(params).then((response) => {
  1168. if (response.data.state == 1) {
  1169. this.tableShow = true;
  1170. this.tableList = [];
  1171. var list = response.data.data.list;
  1172. console.log("listwowowowoow",list)
  1173. this.warehouseOutList = list
  1174. this.manufacturerList = response.data.data.manufacturerList;
  1175. this.dealerList = response.data.data.dealerList;
  1176. var drugFlowList = response.data.data.drugFlowList;
  1177. var drugList = response.data.data.drugList
  1178. this.tabList = drugList
  1179. var drugListOne = response.data.data.drugListFlow
  1180. console.log("drugListOne----------",drugListOne)
  1181. //按批号分组
  1182. var drugListTwo= response.data.data.drugListOne
  1183. console.log("drugListTwo9922wo",drugListTwo)
  1184. var drugoutlist = response.data.data.drugoutlist
  1185. this.outList = drugoutlist
  1186. this.drugOutInfo = drugoutlist
  1187. if (is_sys == 1) {
  1188. if (drugFlowList.length > 0) {
  1189. for (let i = 0; i < drugFlowList.length; i++) {
  1190. drugFlowList[i].childOne = []
  1191. drugFlowList[i].child = []
  1192. if (drugFlowList[i].count_unit ==drugFlowList[i].XtBaseDrug.max_unit) {
  1193. drugFlowList[i].count =drugFlowList[i].count * drugFlowList[i].XtBaseDrug.min_number;
  1194. }
  1195. if (drugFlowList[i].count_unit ==drugFlowList[i].XtBaseDrug.min_unit) {
  1196. drugFlowList[i].count = drugFlowList[i].count;
  1197. }
  1198. for(let j=0;j<drugListOne.length;j++){
  1199. if(drugFlowList[i].drug_id == drugListOne[j].drug_id){
  1200. drugFlowList[i].childOne.push(drugListOne[j])
  1201. }
  1202. }
  1203. if(drugFlowList[i].drug_id == 1154){
  1204. console.log("drugflowlist------",drugFlowList[i].count)
  1205. }
  1206. }
  1207. }
  1208. this.drugFlowList = drugFlowList;
  1209. }
  1210. if (is_sys == 0 || is_sys == 12 || is_sys == 5) {
  1211. var flowlist = response.data.data.flowlist;
  1212. this.drugFlowList = [];
  1213. for (let i = 0; i < flowlist.length; i++) {
  1214. flowlist[i].childOne = []
  1215. flowlist[i].child = []
  1216. if (flowlist[i].count_unit == flowlist[i].max_unit) {
  1217. flowlist[i].count = flowlist[i].count * flowlist[i].min_number;
  1218. flowlist[i].count_unit = flowlist[i].min_unit;
  1219. }
  1220. if (flowlist[i].count_unit == flowlist[i].min_unit) {
  1221. flowlist[i].count = flowlist[i].count;
  1222. }
  1223. }
  1224. this.drugFlowList = flowlist;
  1225. }
  1226. for (let i = 0; i < list.length; i++) {
  1227. if (list[i].batch_number == "0" || list[i].batch_number == 0) {
  1228. list[i].batch_number = "";
  1229. }
  1230. if (list[i].number == "0" || list[i].number == 0) {
  1231. list[i].number = "";
  1232. }
  1233. list[i].child = []
  1234. list[i].childOne = []
  1235. if(list[i].is_sys == 1 ){
  1236. for(let j=0;j<drugListOne.length;j++){
  1237. if(list[i].drug_id == drugListOne[j].drug_id){
  1238. list[i].childOne.push(drugListOne[j])
  1239. }
  1240. }
  1241. }
  1242. if(list[i].is_sys == 0 || list[i].is_sys == 5 || list[i].is_sys == 12){
  1243. for(let j=0;j<drugListTwo.length;j++){
  1244. if(list[i].drug_id == drugListTwo[j].drug_id){
  1245. list[i].childOne.push(drugListTwo[j])
  1246. }
  1247. }
  1248. }
  1249. }
  1250. if(is_sys == 1 || is_sys == 5){
  1251. for(let i=0;i<list.length;i++){
  1252. for(let j=0;j<list[i].childOne.length;j++){
  1253. list[i].childOne[j].over_count_total = this.getOutCountSix(list[i].childOne[j].warehousing_detail_id,list[i].max_unit,list[i].min_unit,list[i].min_number,list[i].drug_id)
  1254. }
  1255. }
  1256. for(let i=0;i<list.length;i++){
  1257. for(let j=0;j<list[i].childOne.length;j++){
  1258. if(list[i].childOne[j].over_count_total !=""){
  1259. list[i].child.push(list[i].childOne[j])
  1260. }
  1261. }
  1262. }
  1263. console.log("list表格---------",list)
  1264. this.tableList = list;
  1265. }
  1266. if(is_sys == 12){
  1267. for(let i=0;i<list.length;i++){
  1268. for(let j=0;j<list[i].childOne.length;j++){
  1269. list[i].childOne[j].over_count_total = this.getOutCountSeven(list[i].childOne[j].warehousing_detail_id,list[i].max_unit,list[i].min_unit,list[i].min_number,list[i].drug_id)
  1270. }
  1271. }
  1272. for(let i=0;i<list.length;i++){
  1273. for(let j=0;j<list[i].childOne.length;j++){
  1274. if(list[i].childOne[j].over_count_total !=""){
  1275. list[i].child.push(list[i].childOne[j])
  1276. }
  1277. }
  1278. }
  1279. // for(let i=0;i<list.length;i++){
  1280. // for(let j=0;j<list[i].child.length;j++){
  1281. // list[i].child[j].outInfo = []
  1282. // for(let z=0;z<this.drugOutInfo.length;z++){
  1283. // if(list[i].child[j].warehousing_detail_id == this.drugOutInfo[z].warehouse_info_id&&list[i].child[j].drug_id == this.drugOutInfo[z].drug_id){
  1284. // list[i].child[j].outInfo.push(this.drugOutInfo[z])
  1285. // }
  1286. // }
  1287. // }
  1288. // }
  1289. // console.log("list23322332233wo",list)
  1290. this.tableList = list;
  1291. }
  1292. if(is_sys == 0){
  1293. console.log("list999992332232323",list)
  1294. for(let i=0;i<list.length;i++){
  1295. for(let j=0;j<list[i].childOne.length;j++){
  1296. console.log("hhhahhawiiw",this.getOutCountOne(list[i].childOne[j].batch_number,list[i].max_unit,list[i].min_unit,list[i].min_number,list[i].drug_id))
  1297. list[i].childOne[j].over_count_total = this.getOutCountOne(list[i].childOne[j].batch_number,list[i].max_unit,list[i].min_unit,list[i].min_number,list[i].drug_id)
  1298. }
  1299. }
  1300. for(let i=0;i<list.length;i++){
  1301. for(let j=0;j<list[i].childOne.length;j++){
  1302. if(list[i].childOne[j].over_count_total !=""){
  1303. list[i].child.push(list[i].childOne[j])
  1304. }
  1305. }
  1306. }
  1307. this.tableList = list;
  1308. }
  1309. }
  1310. });
  1311. },
  1312. toDetail(val) {
  1313. this.userList = [];
  1314. this.userListOne = [];
  1315. var params = {
  1316. warehouse_out_id: val.warehouse_out_id,
  1317. drug_id: val.drug_id,
  1318. record_time: val.sys_record_time,
  1319. };
  1320. // console.log("使用明细",params)
  1321. getAutoDrugDetail(params).then((response) => {
  1322. if (response.data.state == 1) {
  1323. this.userList = response.data.data.list;
  1324. // console.log("自动出库数据", this.userList);
  1325. if (val.is_sys == 1) {
  1326. this.drugDialogVisible = true;
  1327. }
  1328. if (val.is_sys == 0 || val.is_sys == 12 || val.is_sys == 5) {
  1329. this.drugDialogVisibleTwo = true;
  1330. }
  1331. var userListOne = response.data.data.outList;
  1332. // console.log("手动出库2232332",userListOne)
  1333. this.userListOne = userListOne;
  1334. var batchNumber = response.data.data.batchNumber;
  1335. // console.log("出库详情",batchNumber)
  1336. this.batchNumberList = batchNumber;
  1337. }
  1338. });
  1339. },
  1340. toPrint() {
  1341. if (this.order_id == 0) {
  1342. this.$message.error("请选择出库单");
  1343. } else {
  1344. this.$router.push({
  1345. path: "/stock/drugStockOutOrderDetailPrint?id=" + this.order_id,
  1346. });
  1347. }
  1348. },
  1349. getDrugCountList() {
  1350. var params = {
  1351. keyword: this.keywords,
  1352. start_time: this.start_time,
  1353. end_time: this.end_time,
  1354. };
  1355. getDrugCountList(params).then((response) => {
  1356. if (response.data.state == 1) {
  1357. var countlist = response.data.data.countList;
  1358. // console.log("入库数据",countlist)
  1359. this.countList = countlist;
  1360. var outcountlist = response.data.data.outCountList;
  1361. // console.log("出库数据",outcountlist)
  1362. this.outCountList = outcountlist;
  1363. var aucountlist = response.data.data.auCountList;
  1364. // console.log("自动数据",aucountlist)
  1365. this.autoCountList = aucountlist;
  1366. var minCount = response.data.data.minCount;
  1367. // console.log("minCount",minCount)
  1368. this.minCount = minCount;
  1369. var info = response.data.data.info;
  1370. for (let i = 0; i < info.length; i++) {
  1371. if (info[i].count_unit == info[i].max_unit) {
  1372. info[i].count = info[i].count * info[i].min_number;
  1373. }
  1374. }
  1375. // console.log("info2222222",info)
  1376. this.drugOutList = info;
  1377. }
  1378. });
  1379. },
  1380. getCount(drug_id, min_number, max_unit, min_unit) {
  1381. var count = 0;
  1382. var str = "";
  1383. var min_str = "";
  1384. for (let i = 0; i < this.drugOutList.length; i++) {
  1385. if (drug_id == this.drugOutList[i].drug_id) {
  1386. count += parseInt(this.drugOutList[i].count);
  1387. }
  1388. }
  1389. if (parseInt(count / min_number) != 0) {
  1390. str = parseInt(count / min_number) + max_unit;
  1391. }
  1392. if (count % min_number != 0) {
  1393. min_str = (count % min_number) + min_unit;
  1394. }
  1395. return str + min_str;
  1396. },
  1397. getTotalCount(drug_id, min_number, max_unit, min_unit) {
  1398. var str = "";
  1399. var min_str = "";
  1400. var arr = [];
  1401. var total = 0;
  1402. for (let i = 0; i < this.outList.length; i++) {
  1403. if (this.outList[i].drug_id == drug_id) {
  1404. total += this.outList[i].count;
  1405. }
  1406. }
  1407. if (total >= min_number) {
  1408. if (parseInt(total / min_number) != 0) {
  1409. str = parseInt(total / min_number) + max_unit;
  1410. }
  1411. if (total % min_number != 0) {
  1412. min_str = (total % min_number) + min_unit;
  1413. }
  1414. }
  1415. if (total < min_number) {
  1416. str = "";
  1417. min_str = total + min_unit;
  1418. }
  1419. return str + min_str;
  1420. },
  1421. getTotalCountOne(id, min_number, max_unit, min_unit) {
  1422. var arr = [];
  1423. for (let i = 0; i < this.drugFlowList.length; i++) {
  1424. if (id == this.drugFlowList[i].drug_id) {
  1425. arr.push(this.drugFlowList[i]);
  1426. }
  1427. }
  1428. var str = "";
  1429. var min_str = "";
  1430. var total = 0;
  1431. if (arr.length > 0) {
  1432. for (let i = 0; i < arr.length; i++) {
  1433. total += arr[i].count;
  1434. }
  1435. if (parseInt(total / min_number) != 0) {
  1436. str = parseInt(total / min_number) + max_unit;
  1437. }
  1438. if (total % min_number != 0) {
  1439. min_str = (total % min_number) + min_unit;
  1440. }
  1441. }
  1442. return str + min_str;
  1443. },
  1444. getAllPrice(drug_id, price, min_price) {
  1445. var strprice = 0;
  1446. var minstrprice = 0;
  1447. var str = "";
  1448. var min_str = "";
  1449. var total_price = 0;
  1450. for (let i = 0; i < this.outList.length; i++) {
  1451. if (this.outList[i].drug_id == drug_id) {
  1452. if (
  1453. parseInt(this.outList[i].count / this.outList[i].min_number) != 0
  1454. ) {
  1455. str = parseInt(this.outList[i].count / this.outList[i].min_number);
  1456. }
  1457. if (this.outList[i].count % this.outList[i].min_number != 0) {
  1458. min_str = this.outList[i].count % this.outList[i].min_number;
  1459. }
  1460. }
  1461. }
  1462. strprice = str * price;
  1463. minstrprice = min_str * min_price;
  1464. total_price = strprice + minstrprice;
  1465. return total_price;
  1466. },
  1467. getDrugBatchNumber(drugid, count) {
  1468. var arr = [];
  1469. for (let i = 0; i < this.batchNumberList.length; i++) {
  1470. if (
  1471. drugid == this.batchNumberList[i].drug_id &&
  1472. count == this.batchNumberList[i].count
  1473. ) {
  1474. arr.push(this.batchNumberList[i].batch_number);
  1475. }
  1476. }
  1477. return arr.join(",");
  1478. },
  1479. getExportOutOrderDrugList() {
  1480. var params = {
  1481. order_id: this.order_id,
  1482. };
  1483. this.exportLoding = true
  1484. getExportOutOrderDrugList(params).then((response) => {
  1485. if (response.data.state == 1) {
  1486. var list = response.data.data.list;
  1487. this.exportList = list;
  1488. this.exportLoding = false
  1489. this.manufacturerList = response.data.data.manufacturerList;
  1490. this.dealerList = response.data.data.dealerList;
  1491. this.outInfoList = response.data.data.outInfoList
  1492. }
  1493. });
  1494. },
  1495. toExport() {
  1496. if (this.order_id == "") {
  1497. this.$message.error("请勾选出库单");
  1498. return;
  1499. }
  1500. for (let i = 0; i < this.exportList.length; i++) {
  1501. this.exportList[i].retail_price_one = 0
  1502. if(this.outInfoList.length!=null){
  1503. for(let j=0;j<this.outInfoList.length;j++){
  1504. if(this.exportList[i].warehouse_out_id == this.outInfoList[j].warehouse_out_id && this.exportList[i].drug_id == this.outInfoList[j].drug_id){
  1505. this.exportList[i].retail_price_one = this.outInfoList[j].price
  1506. }
  1507. }
  1508. }
  1509. if (this.exportList[i].dealer == 0) {
  1510. this.exportList[i].dealer = "";
  1511. }
  1512. if (this.exportList[i].manufacturer == 0) {
  1513. this.exportList[i].manufacturer = "";
  1514. }
  1515. this.exportList[i].unit =
  1516. this.exportList[i].dose +
  1517. this.exportList[i].dose_unit +
  1518. "*" +
  1519. this.exportList[i].min_number +
  1520. this.exportList[i].min_unit +
  1521. "/" +
  1522. this.exportList[i].max_unit;
  1523. // this.exportList[i].total_price = (this.exportList[i].count * this.exportList[i].price).toFixed(2);
  1524. this.exportList[i].out_count = this.getAllOut(this.exportList[i].count,this.exportList[i].max_unit,this.exportList[i].min_unit,this.exportList[i].min_number)
  1525. this.exportList[i].expiry_date = this.getTime(
  1526. this.exportList[i].expire_date
  1527. );
  1528. this.exportList[i].product_date = this.getTime(
  1529. this.exportList[i].product_date
  1530. );
  1531. for (let j = 0; j < this.manufacturerList.length; j++) {
  1532. if (this.exportList[i].manufacturer == this.manufacturerList[j].id) {
  1533. this.exportList[i].manufacturer = this.manufacturerList[j].manufacturer_name;
  1534. }
  1535. }
  1536. for (let z = 0; z < this.dealerList.length; z++) {
  1537. if (this.exportList[i].dealer == this.dealerList[z].id) {
  1538. this.exportList[i].dealer = this.dealerList[z].dealer_name;
  1539. }
  1540. }
  1541. this.exportList[i].ctime = this.getTime(this.exportList[i].ctime)
  1542. }
  1543. import("@/vendor/Export2Excel").then((excel) => {
  1544. for (let i = 0; i < this.exportList.length; i++) {
  1545. for (let j = 0; j < this.drugTypeList.length; j++) {
  1546. if (this.exportList[i].drug_type == this.drugTypeList[j].value) {
  1547. this.exportList[i].drug_type = this.drugTypeList[j].name;
  1548. }
  1549. }
  1550. }
  1551. const tHeader = [
  1552. "药品名称",
  1553. "药品类型",
  1554. "规格&单位",
  1555. "批号",
  1556. "出库数量",
  1557. "单价",
  1558. "拆零零售价",
  1559. "总价",
  1560. "生产厂家",
  1561. "生产日期",
  1562. "有效日期",
  1563. "经销商",
  1564. "批准文号",
  1565. "出库时间",
  1566. "备注",
  1567. ];
  1568. const filterVal = [
  1569. "drug_name",
  1570. "drug_type",
  1571. "unit",
  1572. "batch_number",
  1573. "out_count",
  1574. "retail_price_one",
  1575. "price",
  1576. "retail_price",
  1577. "manufacturer",
  1578. "product_date",
  1579. "expiry_date",
  1580. "dealer",
  1581. "number",
  1582. "ctime",
  1583. "remark",
  1584. ];
  1585. // console.log("table",this.exportList)
  1586. const data = this.formatJson(filterVal, this.exportList);
  1587. excel.export_json_to_excel({
  1588. header: tHeader,
  1589. data,
  1590. filename: "药品出库单详情",
  1591. });
  1592. this.downloadLoading = false;
  1593. });
  1594. },
  1595. formatJson(filterVal, jsonData) {
  1596. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1597. },
  1598. getAllPriceOne(
  1599. drug_id,
  1600. price,
  1601. min_price,
  1602. max_unit,
  1603. count_unit,
  1604. min_number,
  1605. is_sys
  1606. ) {
  1607. var total = 0;
  1608. var all_price = 0;
  1609. for (let i = 0; i < this.drugFlowList.length; i++) {
  1610. if (drug_id == this.drugFlowList[i].drug_id) {
  1611. total += this.drugFlowList[i].count;
  1612. }
  1613. }
  1614. if (max_unit == count_unit && is_sys != 0 && is_sys != 12) {
  1615. total = total * min_number;
  1616. }
  1617. all_price = (total / min_number) * price;
  1618. return all_price;
  1619. },
  1620. getHouseName(id) {
  1621. var storehouse_name = "";
  1622. for (let i = 0; i < this.houseList.length; i++) {
  1623. if (id == this.houseList[i].id) {
  1624. storehouse_name = this.houseList[i].storehouse_name;
  1625. }
  1626. }
  1627. return storehouse_name;
  1628. },
  1629. changeStoreHouse() {
  1630. this.GetWarehouseOut();
  1631. },
  1632. changeWay() {
  1633. this.GetWarehouseOut();
  1634. },
  1635. changeCheckType(){
  1636. this.GetWarehouseOut();
  1637. },
  1638. // 合并单元格样式
  1639. cellStyle({ row, column, rowIndex, columnIndex }) {
  1640. let arr = [4,5,6, 7, 8, 9,10,11,12,13,14];
  1641. if (arr.indexOf(columnIndex) > -1) {
  1642. return "spanClass";
  1643. }
  1644. },
  1645. getOutCountSix(warehouse_info_id,max_unit,min_unit,min_number,drug_id){
  1646. var arr = []
  1647. var total = 0
  1648. var max_str = ""
  1649. var min_str = ""
  1650. for(let j=0;j<this.outList.length;j++){
  1651. if(warehouse_info_id == this.outList[j].warehouse_info_id && drug_id == this.outList[j].drug_id){
  1652. arr.push(this.outList[j])
  1653. }
  1654. }
  1655. if(arr.length > 0){
  1656. for(let i=0;i<arr.length;i++){
  1657. total +=arr[i].count
  1658. }
  1659. }
  1660. if (total < min_number) {
  1661. min_str = total + min_unit;
  1662. }
  1663. if (total == 0) {
  1664. min_str = "";
  1665. max_str = "";
  1666. }
  1667. if (total >= min_number) {
  1668. if (parseInt(total / min_number) != 0) {
  1669. max_str = parseInt(total / min_number) + max_unit;
  1670. }
  1671. if (total % min_number != 0) {
  1672. min_str = (total % min_number) + min_unit;
  1673. }
  1674. }
  1675. return max_str + min_str;
  1676. },
  1677. getOutCountSeven(warehouse_info_id,max_unit,min_unit,min_number,drug_id){
  1678. var arr = []
  1679. var total = 0
  1680. var max_str = ""
  1681. var min_str = ""
  1682. for(let j=0;j<this.outList.length;j++){
  1683. if(this.outList[j].count_unit == max_unit){
  1684. this.outList[j].count = this.outList[j].count * min_number
  1685. }
  1686. if(warehouse_info_id == this.outList[j].warehouse_info_id && drug_id == this.outList[j].drug_id){
  1687. arr.push(this.outList[j])
  1688. }
  1689. }
  1690. if(arr.length > 0){
  1691. for(let i=0;i<arr.length;i++){
  1692. total +=arr[i].count
  1693. }
  1694. }
  1695. if (total < min_number) {
  1696. min_str = total + min_unit;
  1697. }
  1698. if (total == 0) {
  1699. min_str = "";
  1700. max_str = "";
  1701. }
  1702. if (total >= min_number) {
  1703. if (parseInt(total / min_number) != 0) {
  1704. max_str = parseInt(total / min_number) + max_unit;
  1705. }
  1706. if (total % min_number != 0) {
  1707. min_str = (total % min_number) + min_unit;
  1708. }
  1709. }
  1710. return max_str + min_str;
  1711. },
  1712. getOutCount(warehouse_info_id,max_unit,min_unit,min_number){
  1713. var arr = []
  1714. var total = 0
  1715. var max_str = ""
  1716. var min_str = ""
  1717. for(let j=0;j<this.tabList.length;j++){
  1718. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1719. arr.push(this.tabList[j])
  1720. }
  1721. }
  1722. if(arr.length > 0){
  1723. for(let i=0;i<arr.length;i++){
  1724. total +=arr[i].count
  1725. }
  1726. }
  1727. if (total < min_number) {
  1728. min_str = total + min_unit;
  1729. }
  1730. if (total == 0) {
  1731. min_str = "";
  1732. max_str = "";
  1733. }
  1734. if (total >= min_number) {
  1735. if (parseInt(total / min_number) != 0) {
  1736. max_str = parseInt(total / min_number) + max_unit;
  1737. }
  1738. if (total % min_number != 0) {
  1739. min_str = (total % min_number) + min_unit;
  1740. }
  1741. }
  1742. return max_str + min_str;
  1743. },
  1744. getOutCountOne(batch_number,max_unit,min_unit,min_number,drug_id){
  1745. console.log("drug_id-----",drug_id)
  1746. var arr = []
  1747. var total = 0
  1748. var max_str = ""
  1749. var min_str = ""
  1750. console.log("tablelost----",this.tabList)
  1751. for(let j=0;j<this.tabList.length;j++){
  1752. if(batch_number == this.tabList[j].batch_number && drug_id == this.tabList[j].drug_id){
  1753. arr.push(this.tabList[j])
  1754. }
  1755. }
  1756. if(arr.length > 0){
  1757. for(let i=0;i<arr.length;i++){
  1758. total +=arr[i].count
  1759. }
  1760. }
  1761. if (total < min_number) {
  1762. min_str = total + min_unit;
  1763. }
  1764. if (total == 0) {
  1765. min_str = "";
  1766. max_str = "";
  1767. }
  1768. if (total >= min_number) {
  1769. if (parseInt(total / min_number) != 0) {
  1770. max_str = parseInt(total / min_number) + max_unit;
  1771. }
  1772. if (total % min_number != 0) {
  1773. min_str = (total % min_number) + min_unit;
  1774. }
  1775. }
  1776. return max_str + min_str;
  1777. },
  1778. getBatchNumber(warehouse_info_id){
  1779. var arr = []
  1780. var batch_number = 0
  1781. for(let j=0;j<this.tabList.length;j++){
  1782. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1783. arr.push(this.tabList[j])
  1784. }
  1785. }
  1786. if(arr.length > 0){
  1787. batch_number = arr[0].batch_number
  1788. }
  1789. return batch_number
  1790. },
  1791. getBatchNumberOne(number){
  1792. var arr = []
  1793. var batch_number = 0
  1794. for(let j=0;j<this.tabList.length;j++){
  1795. if(number == this.tabList[j].batch_number){
  1796. arr.push(this.tabList[j])
  1797. }
  1798. }
  1799. if(arr.length > 0){
  1800. batch_number = arr[0].batch_number
  1801. }
  1802. return batch_number
  1803. },
  1804. getPrice(warehouse_info_id,max_unit,min_unit,min_number){
  1805. var arr = []
  1806. var price = 0
  1807. for(let j=0;j<this.tabList.length;j++){
  1808. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1809. arr.push(this.tabList[j])
  1810. }
  1811. }
  1812. if(arr.length > 0){
  1813. price = arr[0].price
  1814. }
  1815. return price
  1816. },
  1817. getPriceOne(number,max_unit,min_unit,min_number){
  1818. var arr = []
  1819. var price = 0
  1820. for(let j=0;j<this.tabList.length;j++){
  1821. if(number == this.tabList[j].batch_number){
  1822. arr.push(this.tabList[j])
  1823. }
  1824. }
  1825. if(arr.length > 0){
  1826. price = arr[0].price
  1827. }
  1828. return price
  1829. },
  1830. getTotalPrice(warehouse_info_id,max_unit,min_unit,min_number){
  1831. var arr = []
  1832. var total = 0
  1833. var max_str = 0
  1834. var min_str = 0
  1835. var price = 0
  1836. var all_price = 0
  1837. for(let j=0;j<this.tabList.length;j++){
  1838. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1839. arr.push(this.tabList[j])
  1840. }
  1841. }
  1842. if(arr.length > 0){
  1843. for(let i=0;i<arr.length;i++){
  1844. total +=arr[i].count
  1845. price = arr[0].price
  1846. }
  1847. }
  1848. if (total < min_number) {
  1849. min_str = total
  1850. }
  1851. if (total == 0) {
  1852. min_str = 0;
  1853. max_str = 0;
  1854. }
  1855. if (total >= min_number) {
  1856. if (parseInt(total / min_number) != 0) {
  1857. max_str = parseInt(total / min_number)
  1858. }
  1859. if (total % min_number != 0) {
  1860. min_str = (total % min_number)
  1861. }
  1862. }
  1863. if(max_unit!=min_unit){
  1864. all_price = max_str * min_number * price + min_str * price
  1865. }
  1866. if(max_unit == min_unit){
  1867. all_price = max_str * price + min_str * price
  1868. }
  1869. console.log("all_pricewowo",all_price)
  1870. if(all_price > 0){
  1871. return all_price.toFixed(2)
  1872. }else{
  1873. return 0
  1874. }
  1875. },
  1876. getTotalPriceOne(number,max_unit,min_unit,min_number,retail_price){
  1877. var arr = []
  1878. var total = 0
  1879. var max_str = 0
  1880. var min_str = 0
  1881. var price = 0
  1882. var all_price = 0
  1883. for(let j=0;j<this.tabList.length;j++){
  1884. if(number == this.tabList[j].batch_number){
  1885. arr.push(this.tabList[j])
  1886. }
  1887. }
  1888. if(arr.length > 0){
  1889. for(let i=0;i<arr.length;i++){
  1890. total +=arr[i].count
  1891. }
  1892. }
  1893. price = retail_price
  1894. if (total < min_number) {
  1895. min_str = total
  1896. }
  1897. if (total == 0) {
  1898. min_str = 0;
  1899. max_str = 0;
  1900. }
  1901. if (total >= min_number) {
  1902. if (parseInt(total / min_number) != 0) {
  1903. max_str = parseInt(total / min_number)
  1904. }
  1905. if (total % min_number != 0) {
  1906. min_str = (total % min_number)
  1907. }
  1908. }
  1909. if(max_unit!=min_unit){
  1910. all_price = max_str * price + min_str * price
  1911. }
  1912. if(max_unit == min_unit){
  1913. all_price = max_str * price + min_str * price
  1914. }
  1915. if(all_price > 0){
  1916. return all_price.toFixed(2)
  1917. }else{
  1918. return 0
  1919. }
  1920. },
  1921. getAllManufacturerName(warehouse_info_id,max_unit,min_unit,min_number){
  1922. var arr = []
  1923. var manufacture_id = 0
  1924. var manufacturer_name = ""
  1925. for(let j=0;j<this.tabList.length;j++){
  1926. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1927. arr.push(this.tabList[j])
  1928. }
  1929. }
  1930. if(arr.length >0){
  1931. manufacture_id = arr[0].manufacturer
  1932. }
  1933. manufacturer_name = this.getManufacturerName(manufacture_id)
  1934. return manufacturer_name
  1935. },
  1936. getAllManufacturerNameOne(number,max_unit,min_unit,min_number){
  1937. var arr = []
  1938. var manufacture_id = 0
  1939. var manufacturer_name = ""
  1940. for(let j=0;j<this.tabList.length;j++){
  1941. if(number == this.tabList[j].number){
  1942. arr.push(this.tabList[j])
  1943. }
  1944. }
  1945. if(arr.length >0){
  1946. manufacture_id = arr[0].manufacturer
  1947. }
  1948. manufacturer_name = this.getManufacturerName(manufacture_id)
  1949. return manufacturer_name
  1950. },
  1951. getProductDate(warehouse_info_id,max_unit,min_unit,min_number){
  1952. var arr = []
  1953. var product_date = 0
  1954. for(let j=0;j<this.tabList.length;j++){
  1955. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1956. arr.push(this.tabList[j])
  1957. }
  1958. }
  1959. if(arr.length >0){
  1960. product_date = arr[0].product_date
  1961. }
  1962. return this.getTime(product_date)
  1963. },
  1964. getProductDateOne(number,max_unit,min_unit,min_number){
  1965. var arr = []
  1966. var product_date = 0
  1967. for(let j=0;j<this.tabList.length;j++){
  1968. if(number == this.tabList[j].number){
  1969. arr.push(this.tabList[j])
  1970. }
  1971. }
  1972. if(arr.length >0){
  1973. product_date = arr[0].product_date
  1974. }
  1975. return this.getTime(product_date)
  1976. },
  1977. getExpiryDate(warehouse_info_id,max_unit,min_unit,min_number){
  1978. var arr = []
  1979. var expiry_date = 0
  1980. for(let j=0;j<this.tabList.length;j++){
  1981. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  1982. arr.push(this.tabList[j])
  1983. }
  1984. }
  1985. if(arr.length >0){
  1986. expiry_date = arr[0].expire_date
  1987. }
  1988. return this.getTime(expiry_date)
  1989. },
  1990. getExpiryDateOne(number,max_unit,min_unit,min_number){
  1991. var arr = []
  1992. var expiry_date = 0
  1993. for(let j=0;j<this.tabList.length;j++){
  1994. if(number == this.tabList[j].number){
  1995. arr.push(this.tabList[j])
  1996. }
  1997. }
  1998. if(arr.length >0){
  1999. expiry_date = arr[0].expire_date
  2000. }
  2001. return this.getTime(expiry_date)
  2002. },
  2003. getDealer(warehouse_info_id,max_unit,min_unit,min_number){
  2004. var arr = []
  2005. var dealer = 0
  2006. for(let j=0;j<this.tabList.length;j++){
  2007. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  2008. arr.push(this.tabList[j])
  2009. }
  2010. }
  2011. if(arr.length >0){
  2012. dealer = arr[0].dealer
  2013. }
  2014. return this.getDealerName(dealer)
  2015. },
  2016. getDealerOne(number,max_unit,min_unit,min_number){
  2017. var arr = []
  2018. var dealer = 0
  2019. for(let j=0;j<this.tabList.length;j++){
  2020. if(number == this.tabList[j].number){
  2021. arr.push(this.tabList[j])
  2022. }
  2023. }
  2024. if(arr.length >0){
  2025. dealer = arr[0].dealer
  2026. }
  2027. return this.getDealerName(dealer)
  2028. },
  2029. getNumber(warehouse_info_id,max_unit,min_unit,min_number){
  2030. var arr = []
  2031. var number = ""
  2032. for(let j=0;j<this.tabList.length;j++){
  2033. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  2034. arr.push(this.tabList[j])
  2035. }
  2036. }
  2037. if(arr.length >0){
  2038. number = arr[0].number
  2039. }
  2040. return number
  2041. },
  2042. getNumberOne(number,max_unit,min_unit,min_number){
  2043. var arr = []
  2044. var number = ""
  2045. for(let j=0;j<this.tabList.length;j++){
  2046. if(number == this.tabList[j].number){
  2047. arr.push(this.tabList[j])
  2048. }
  2049. }
  2050. if(arr.length >0){
  2051. number = arr[0].number
  2052. }
  2053. return number
  2054. },
  2055. getRemark(warehouse_info_id,max_unit,min_unit,min_number){
  2056. var arr = []
  2057. var remark = ""
  2058. for(let j=0;j<this.tabList.length;j++){
  2059. if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
  2060. arr.push(this.tabList[j])
  2061. }
  2062. }
  2063. if(arr.length >0){
  2064. if(arr[0].DrugWarehouseInfoOne!=null){
  2065. remark = arr[0].DrugWarehouseInfoOne.remark
  2066. }
  2067. }
  2068. return remark
  2069. },
  2070. getAllOut(count,max_unit,min_unit,min_number){
  2071. var total = 0
  2072. var max_str = ""
  2073. var min_str = ""
  2074. total = count
  2075. if (total < min_number) {
  2076. min_str = total + min_unit
  2077. }
  2078. if (total == 0) {
  2079. min_str = 0;
  2080. max_str = 0;
  2081. }
  2082. if (total >= min_number) {
  2083. if (parseInt(total / min_number) != 0) {
  2084. max_str = parseInt(total / min_number) + max_unit
  2085. }
  2086. if (total % min_number != 0) {
  2087. min_str = (total % min_number)+ min_unit
  2088. }
  2089. }
  2090. return max_str + min_str
  2091. },
  2092. getPriceTwo(warehouse_out_id,drug_id){
  2093. var price = 0
  2094. for(let i=0;i<this.warehouseOutList.length;i++){
  2095. if(drug_id == this.warehouseOutList[i].drug_id){
  2096. price = this.warehouseOutList[i].price
  2097. }
  2098. }
  2099. return price
  2100. },
  2101. getOutCountTen(total,max_unit,min_unit,min_number){
  2102. var max_str = ""
  2103. var min_str = ""
  2104. console.log("total",total)
  2105. if (total < min_number) {
  2106. min_str = total + min_unit;
  2107. }
  2108. if (total == 0) {
  2109. min_str = "";
  2110. max_str = "";
  2111. }
  2112. if (total >= min_number) {
  2113. if (parseInt(total / min_number) != 0) {
  2114. max_str = parseInt(total / min_number) + max_unit;
  2115. }
  2116. if (total % min_number != 0) {
  2117. min_str = (total % min_number) + min_unit;
  2118. }
  2119. }
  2120. return max_str + min_str;
  2121. },
  2122. },
  2123. };
  2124. </script>
  2125. <style rel="stylesheet/scss" lang="scss">
  2126. .app-container {
  2127. // margin: 20px;
  2128. font-size: 15px;
  2129. .filter-container {
  2130. padding-bottom: 5px;
  2131. }
  2132. .search-component {
  2133. width: 500px;
  2134. .searchBox {
  2135. width: 300px;
  2136. height: 36px;
  2137. line-height: 36px;
  2138. padding-left: 15px;
  2139. border: 1px #dcdfe6 solid;
  2140. border-right: none;
  2141. outline: none;
  2142. float: left;
  2143. border-radius: 6px 0 0 6px;
  2144. font-size: 14px;
  2145. color: #333;
  2146. background: #fff;
  2147. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  2148. }
  2149. .searchBtn {
  2150. background-color: #409eff;
  2151. color: #fff;
  2152. font-size: 15px;
  2153. text-align: center;
  2154. height: 36px;
  2155. line-height: 36px;
  2156. float: left;
  2157. outline: none;
  2158. width: 70px;
  2159. border: none;
  2160. border-radius: 0 6px 6px 0;
  2161. font-family: "Microsoft Yahei";
  2162. cursor: pointer;
  2163. }
  2164. }
  2165. .amount {
  2166. font-weight: normal;
  2167. padding: 10px 0 0 0;
  2168. color: #606266;
  2169. font-size: 14px;
  2170. span {
  2171. color: #ef2525;
  2172. font-family: "Arial";
  2173. padding: 0 2px;
  2174. }
  2175. }
  2176. }
  2177. .el-table td,
  2178. .el-table th.is-leaf,
  2179. .el-table--border,
  2180. .el-table--group {
  2181. border-color: #d0d3da;
  2182. }
  2183. .el-table--border::after,
  2184. .el-table--group::after,
  2185. .el-table::before {
  2186. background-color: #d0d3da;
  2187. }
  2188. </style>
  2189. <style>
  2190. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  2191. font-size: 12px;
  2192. }
  2193. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  2194. background: #6fb5fa;
  2195. }
  2196. .count {
  2197. color: #bd2c00;
  2198. }
  2199. .el-table td,
  2200. .el-table th.is-leaf,
  2201. .el-table--border,
  2202. .el-table--group {
  2203. border-color: #d0d3da;
  2204. }
  2205. .el-table--border::after,
  2206. .el-table--group::after,
  2207. .el-table::before {
  2208. background-color: #d0d3da;
  2209. }
  2210. /* 合并表格线样式 */
  2211. .spanClass .cell {
  2212. padding: 0 !important;
  2213. }
  2214. .spanClass .cell tr {
  2215. display: inline-block;
  2216. width: 100%;
  2217. }
  2218. .spanClass .cell tr td {
  2219. padding: 10px 0;
  2220. border-bottom: 1px solid #ebeef5;
  2221. display: block;
  2222. width: 100%;
  2223. }
  2224. .spanClass .cell tr:last-of-type td {
  2225. border-bottom: none;
  2226. }
  2227. </style>