Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

drugStockOutOrder.vue 75KB

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