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

drugStockOutOrder.vue 73KB

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