stockOutOrder.vue 83KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650
  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. :data="warehouseOutDate"
  132. :class="signAndWeighBoxPatients"
  133. style="width: 100%"
  134. border
  135. highlight-current-row
  136. ref="multipleTable"
  137. @selection-change="select"
  138. :row-style="{ color: '#303133' }"
  139. :header-cell-style="{
  140. backgroundColor: 'rgb(245, 247, 250)',
  141. color: '#606266',
  142. }"
  143. @current-change="handleSearch"
  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 label="出库方式" align="center">
  168. <template slot-scope="scope">
  169. <span v-if="scope.row.is_sys == 1">自动出库</span>
  170. <span v-if="scope.row.is_sys == 0">手动出库</span>
  171. <span v-if="scope.row.is_sys == 12">调拨出库</span>
  172. <span v-if="scope.row.is_sys == 5">结算出库</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="审核状态" align="center">
  176. <template slot-scope="scope">
  177. <span v-if="scope.row.is_check == 1">已审核</span>
  178. <span v-if="scope.row.is_check == 2">未审核</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="操作" align="center" width="300px">
  182. <template slot-scope="scope">
  183. <el-tooltip
  184. class="item"
  185. effect="dark"
  186. content="编辑"
  187. placement="top"
  188. >
  189. <el-button
  190. size="mini"
  191. type="primary"
  192. icon="el-icon-edit-outline"
  193. @click="handleEdit(scope.$index, scope.row)"
  194. >
  195. </el-button>
  196. </el-tooltip>
  197. <el-tooltip
  198. class="item"
  199. effect="dark"
  200. content="删除"
  201. placement="top"
  202. >
  203. <el-button
  204. size="mini"
  205. type="danger"
  206. :disabled="scope.row.is_sys == 1"
  207. icon="el-icon-delete"
  208. @click="handleDelete(scope.$index, scope.row)"
  209. >
  210. </el-button>
  211. </el-tooltip>
  212. </template>
  213. </el-table-column>
  214. </el-table>
  215. <el-pagination
  216. @size-change="handleSizeChange"
  217. @current-change="handleCurrentChange"
  218. :page-sizes="[5, 10, 50, 100]"
  219. :page-size="5"
  220. background
  221. style="margin-top: 20px; text-align: right"
  222. layout="total, sizes, prev, pager, next, jumper"
  223. :total="total"
  224. >
  225. </el-pagination>
  226. <!-- 详情 -->
  227. <div v-show="tableShow" style="margin-top: 10px">
  228. <el-table
  229. :data="tableList"
  230. :class="signAndWeighBoxPatients"
  231. style="width: 100%"
  232. border
  233. highlight-current-row
  234. ref="multipleTableOne"
  235. @selection-change="select"
  236. :row-style="{ color: '#303133' }"
  237. :header-cell-style="{
  238. backgroundColor: 'rgb(245, 247, 250)',
  239. color: '#606266',
  240. }"
  241. :cell-class-name="cellStyle"
  242. >
  243. <el-table-column label="耗材名称" align="center">
  244. <template slot-scope="scope">
  245. {{ scope.row.good_name }}
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="规格&单位" align="center">
  249. <template slot-scope="scope">
  250. {{ scope.row.specification_name }} / {{ scope.row.packing_unit }}
  251. </template>
  252. </el-table-column>
  253. <el-table-column label="国家编码" align="center">
  254. <template slot-scope="scope">
  255. {{ scope.row.social_security_directory_code }}
  256. </template>
  257. </el-table-column>
  258. <!-- <el-table-column label="仓库名称" align="center">
  259. <template slot-scope="scope">
  260. {{ getHouseName(scope.row.storehouse_id) }}
  261. </template>
  262. </el-table-column> -->
  263. <!-- <el-table-column label="剩余库存" align="center" v-if="is_sys== 0">
  264. <template slot-scope="scope">
  265. <span>{{scope.row.stock_count}}</span>
  266. </template>
  267. </el-table-column> -->
  268. <el-table-column label="仓库名称" align="center">
  269. <template slot-scope="scope">
  270. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  271. <td style="border-right: none; border-inline-end: none;text-align: center">
  272. {{ getHouseName(item.storehouse_id) }}
  273. </td>
  274. </tr>
  275. </template>
  276. </el-table-column>
  277. <el-table-column label="出库数量" align="center">
  278. <template slot-scope="scope">
  279. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  280. <td style="border-right: none; border-inline-end: none;text-align: center">
  281. {{getAllStockCount(scope.row.child,item.warehousing_id,item.good_id) - getCancelInfo(item.warehousing_id,item.good_id)}}
  282. </td>
  283. </tr>
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="批次" align="center">
  287. <template slot-scope="scope">
  288. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  289. <td style="border-right: none; border-inline-end: none;text-align: center">
  290. {{getNumber(scope.row.child,item.warehousing_id)}}
  291. </td>
  292. </tr>
  293. </template>
  294. </el-table-column>
  295. <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
  296. <template slot-scope="scope">
  297. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  298. <td style="border-right: none; border-inline-end: none;text-align: center">
  299. {{ getXuserName(scope.row.admin_user_id) }}
  300. </td>
  301. </tr>
  302. </template>
  303. </el-table-column>
  304. <el-table-column label="使用患者" align="center" v-if="is_sys == 0">
  305. <template slot-scope="scope">
  306. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  307. <td style="border-right: none; border-inline-end: none;text-align: center">
  308. {{getPatientName(item.patient_id ) }}
  309. </td>
  310. </tr>
  311. </template>
  312. </el-table-column>
  313. <el-table-column label="出货价" align="center">
  314. <template slot-scope="scope">
  315. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  316. <td style="border-right: none; border-inline-end: none;text-align: center">
  317. {{getAllStockCountPrice(scope.row.child,item.warehousing_id)}}
  318. </td>
  319. </tr>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="总价" align="center">
  323. <template slot-scope="scope">
  324. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  325. <td style="border-right: none; border-inline-end: none;text-align: center">
  326. <!-- {{(getAllStockCount(scope.row.child,item.warehousing_id) * getAllStockCountPrice(scope.row.child,item.warehousing_id)).toFixed(2)}} -->
  327. {{((getAllStockCount(scope.row.child,item.warehousing_id,item.good_id) - getCancelInfo(item.warehousing_id,item.good_id)) * getAllStockCountPrice(scope.row.child,item.warehousing_id)).toFixed(2)}}
  328. </td>
  329. </tr>
  330. </template>
  331. </el-table-column>
  332. <el-table-column label="生产厂家" align="center">
  333. <template slot-scope="scope">
  334. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  335. <td style="border-right: none; border-inline-end: none;text-align: center">
  336. {{getManufactuerNameSix(scope.row.child,item.warehousing_id)}}
  337. </td>
  338. </tr>
  339. </template>
  340. </el-table-column>
  341. <el-table-column label="经销商" align="center">
  342. <template slot-scope="scope">
  343. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  344. <td style="border-right: none; border-inline-end: none;text-align: center">
  345. {{getDealerNameSix(scope.row.child,item.warehousing_id)}}
  346. </td>
  347. </tr>
  348. </template>
  349. </el-table-column>
  350. <el-table-column label="生产日期" align="center">
  351. <template slot-scope="scope">
  352. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  353. <td style="border-right: none; border-inline-end: none;text-align: center">
  354. {{getProductDate(scope.row.child,item.warehousing_id)}}
  355. </td>
  356. </tr>
  357. </template>
  358. </el-table-column>
  359. <el-table-column label="有效期" align="center">
  360. <template slot-scope="scope">
  361. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  362. <td style="border-right: none; border-inline-end: none;text-align: center">
  363. {{getExpiryDate(scope.row.child,item.warehousing_id)}}
  364. </td>
  365. </tr>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="注册编码" align="center" v-if="is_sys == 1">
  369. <template slot-scope="scope">
  370. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  371. <td style="border-right: none; border-inline-end: none;text-align: center">
  372. <span>{{getRegisterNumber(scope.row.child,item.warehousing_id)}}</span>
  373. </td>
  374. </tr>
  375. </template>
  376. </el-table-column>
  377. <el-table-column label="注册编码" align="center" v-if="is_sys == 0">
  378. <template slot-scope="scope">
  379. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  380. <td style="border-right: none; border-inline-end: none;text-align: center">
  381. <span>{{scope.row.register_number}}</span>
  382. </td>
  383. </tr>
  384. </template>
  385. </el-table-column>
  386. <el-table-column label="备注" align="center" v-if="is_sys == 1">
  387. <template slot-scope="scope">
  388. <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
  389. <td style="border-right: none; border-inline-end: none;text-align: center">
  390. {{getRemark(scope.row.child,item.warehousing_id)}}
  391. </td>
  392. </tr>
  393. </template>
  394. </el-table-column>
  395. <el-table-column label="备注" align="center" v-if="is_sys == 0">
  396. <template slot-scope="scope">
  397. {{scope.row.remark}}
  398. </template>
  399. </el-table-column>
  400. <el-table-column label="操作" align="center">
  401. <template slot-scope="scope">
  402. <span
  403. style="color: #589ff8"
  404. @click="GetOrderDetailById(scope.row)"
  405. >使用明细</span
  406. >
  407. </template>
  408. </el-table-column>
  409. <!-- <el-table-column label="自查自检" align="center">
  410. <template slot-scope="scope">
  411. <span
  412. style="color: #589ff8"
  413. @click="GetGoodPatientName(scope.row)"
  414. >自查自检</span
  415. >
  416. </template>
  417. </el-table-column> -->
  418. </el-table>
  419. </div>
  420. </div>
  421. <!-- 新增弹窗 -->
  422. <el-dialog title="提示" :visible.sync="dialogVisible" width="80%">
  423. <span>
  424. <div class="filter-container">
  425. <span style="font-size: 18px; color: #606266">出库单详情</span>
  426. <el-row style="float: right">
  427. <span style="color: #606266">{{
  428. warehousingOutInfo.info.warehouse_out_order_number
  429. }}</span>
  430. </el-row>
  431. </div>
  432. <div class="cell clearfix">
  433. <span style="width: 300px; color: #606266"
  434. >单据日期:
  435. {{
  436. warehousingOutInfo.info.warehouse_out_time
  437. | parseTime("{y}-{m}-{d}")
  438. }}
  439. </span>
  440. <span style="width: 300px; color: #606266"
  441. >厂商
  442. {{ getManufactuerName(warehousingOutInfo.info.manufacturer) }}</span
  443. >
  444. <span style="width: 300px; color: #606266"
  445. >经销商 {{ getDealerName(warehousingOutInfo.info.dealer) }}</span
  446. >
  447. </div>
  448. <div class="filter-container" style="margin-top: 10px">
  449. <el-button
  450. size="small"
  451. icon="el-icon-edit"
  452. @click="editRecord(warehousingOutInfo.info.id)"
  453. v-if="warehousingOutInfo.info.is_sys != 1"
  454. >编辑</el-button
  455. >
  456. <el-button
  457. size="small"
  458. icon="el-icon-delete"
  459. @click="deleteRecord"
  460. v-if="warehousingOutInfo.info.is_sys != 1"
  461. >删除</el-button
  462. >
  463. </div>
  464. <el-row :gutter="12" style="margin-top: 10px">
  465. <el-table
  466. :data="warehousingOutInfo.warehousingOutData"
  467. :class="signAndWeighBoxPatients"
  468. style="width: 100%"
  469. border
  470. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  471. >
  472. <el-table-column min-width="35" align="center">
  473. <template slot="header" slot-scope="scope">
  474. <span>耗材类型</span>
  475. </template>
  476. <template slot-scope="scope">
  477. <span v-if="scope.row.good_type_id != 0">{{
  478. getTypeName(scope.row.good_type_id)
  479. }}</span>
  480. </template>
  481. </el-table-column>
  482. <el-table-column min-width="35" align="center">
  483. <template slot="header" slot-scope="scope">
  484. <span>耗材名称</span>
  485. </template>
  486. <template slot-scope="scope">
  487. <span v-if="scope.row.good_id != 0">{{
  488. getTypeNameOne(scope.row.good_id)
  489. }}</span>
  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 v-if="scope.row.good_id != 0">{{
  498. getSpecificationName(scope.row.good_id)
  499. }}</span>
  500. </template>
  501. </el-table-column>
  502. <el-table-column min-width="23" align="center">
  503. <template slot="header" slot-scope="scope">
  504. <span>出货价</span>
  505. </template>
  506. <template slot-scope="scope">
  507. <span>{{ scope.row.price }}</span>
  508. </template>
  509. </el-table-column>
  510. <el-table-column min-width="23" align="center">
  511. <template slot="header" slot-scope="scope">
  512. <span>出库数量</span>
  513. </template>
  514. <template slot-scope="scope">
  515. <span v-if="scope.row.is_sys == 0">{{ scope.row.count }}</span>
  516. <span v-if="scope.row.is_sys == 1">{{
  517. getOutStockCount(scope.row.good_id)
  518. }}</span>
  519. </template>
  520. </el-table-column>
  521. <el-table-column label="总价" min-width="20" align="center">
  522. <template slot-scope="scope">
  523. {{ calculate(scope.row.price * scope.row.count) }}
  524. </template>
  525. </el-table-column>
  526. <el-table-column label="备注" min-width="20" align="center">
  527. <template slot-scope="scope">
  528. <el-popover placement="top-start" width="250" trigger="hover">
  529. <div>{{ scope.row.remark }}</div>
  530. <span slot="reference" v-if="scope.row.remark.length > 20">{{
  531. scope.row.remark.substr(0, 20) + "..."
  532. }}</span>
  533. <span slot="reference" v-else>{{ scope.row.remark }}</span>
  534. </el-popover>
  535. </template>
  536. </el-table-column>
  537. <el-table-column label="" align="center">
  538. <template slot-scope="scope" v-if="scope.row.is_sys == 1">
  539. <div
  540. style="color: #589ff8"
  541. @click="GetOrderDetailThree(scope.row.id)"
  542. >
  543. 使用明细
  544. </div>
  545. </template>
  546. </el-table-column>
  547. </el-table>
  548. </el-row>
  549. </span>
  550. <span slot="footer" class="dialog-footer">
  551. <el-button @click="dialogVisible = false">取 消</el-button>
  552. <el-button type="primary" @click="dialogVisible = false"
  553. >确 定</el-button
  554. >
  555. </span>
  556. </el-dialog>
  557. <!-- 使用明细查询 -->
  558. <el-dialog
  559. title="出库单详情"
  560. :visible.sync="editdialogVisibleTwo"
  561. width="80%"
  562. >
  563. <span>
  564. <div class="filter-container">
  565. <span style="font-size: 18px; color: #606266">耗材使用明细</span>
  566. </div>
  567. <el-row :gutter="12" style="margin-top: 10px">
  568. <el-table
  569. :data="infoList"
  570. :class="signAndWeighBoxPatients"
  571. style="width: 80%"
  572. border
  573. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  574. >
  575. <el-table-column min-width="35" align="center">
  576. <template slot="header" slot-scope="scope">
  577. <span>序号</span>
  578. </template>
  579. <template slot-scope="scope">
  580. {{ scope.$index + 1 }}
  581. </template>
  582. </el-table-column>
  583. <el-table-column min-width="35" align="center">
  584. <template slot="header" slot-scope="scope">
  585. <span>使用人</span>
  586. </template>
  587. <template slot-scope="scope">
  588. <span v-if="scope.row.is_sys == 0">系统 </span>
  589. <span v-if="scope.row.is_sys == 5"> {{getRow(scope.row)}} </span>
  590. </template>
  591. </el-table-column>
  592. <el-table-column min-width="35" align="center">
  593. <template slot="header" slot-scope="scope">
  594. <span>使用数量</span>
  595. </template>
  596. <template slot-scope="scope">
  597. {{ scope.row.count }}
  598. </template>
  599. </el-table-column>
  600. <el-table-column min-width="35" align="center">
  601. <template slot="header" slot-scope="scope">
  602. <span>使用时间</span>
  603. </template>
  604. <template slot-scope="scope">
  605. <span
  606. >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
  607. </span>
  608. </template>
  609. </el-table-column>
  610. </el-table>
  611. </el-row>
  612. </span>
  613. <span slot="footer" class="dialog-footer">
  614. <el-button @click="editdialogVisibleTwo = false">取 消</el-button>
  615. <el-button type="primary" @click="editdialogVisibleTwo = false"
  616. >确 定</el-button
  617. >
  618. </span>
  619. </el-dialog>
  620. <!-- 编辑 -->
  621. <el-dialog title="编辑出库单" :visible.sync="editDialogVisible" width="80%">
  622. <span>
  623. <div style="margin-bottom: 10px">
  624. <label class="title"><span class="name">出库时间</span> : </label>
  625. <el-date-picker
  626. size="small"
  627. v-model="warehouse_out_time"
  628. prefix-icon="el-icon-date"
  629. :editable="false"
  630. style="width: 196px"
  631. type="date"
  632. placeholder="选择日期时间"
  633. align="right"
  634. format="yyyy-MM-dd"
  635. value-format="yyyy-MM-dd"
  636. ></el-date-picker>
  637. <label class="title" style="margin-left: 10px"
  638. ><span class="name">经 销 商</span> :
  639. </label>
  640. <el-select
  641. size="small"
  642. v-model="form.dealer"
  643. clearable
  644. placeholder="请选择经销商"
  645. @change="changeDealer"
  646. >
  647. <el-option
  648. v-for="(option, index) in dealer"
  649. :key="index"
  650. :label="option.dealer_name"
  651. :value="option.id"
  652. >
  653. </el-option>
  654. </el-select>
  655. <label class="title" style="margin-left: 10px"
  656. ><span class="name">厂商</span> :
  657. </label>
  658. <el-select
  659. size="small"
  660. v-model="form.manufacturer"
  661. clearable
  662. placeholder="请选择厂商"
  663. @change="changeManufacturer"
  664. >
  665. <el-option
  666. v-for="(option, index) in manufacturer"
  667. :key="index"
  668. :label="option.manufacturer_name"
  669. :value="option.id"
  670. >
  671. </el-option>
  672. </el-select>
  673. </div>
  674. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  675. <el-table
  676. :data="recordInfo.recordData"
  677. :class="signAndWeighBoxPatients"
  678. style="width: 100%"
  679. border
  680. max-height="450"
  681. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  682. >
  683. <el-table-column min-width="35" align="center">
  684. <template slot="header" slot-scope="scope">
  685. <span>耗材类型<span style="color: red">*</span></span>
  686. </template>
  687. <template slot-scope="scope">
  688. <el-form-item style="padding-top: 15px">
  689. <el-input
  690. placeholder="请输入商品类型"
  691. v-model="scope.row.good_type_id"
  692. :value="typeName(scope.row.good_type_id)"
  693. @focus="showDialog(scope.$index, scope.row)"
  694. ></el-input>
  695. </el-form-item>
  696. </template>
  697. </el-table-column>
  698. <el-table-column min-width="35" align="center">
  699. <template slot="header" slot-scope="scope">
  700. <span>规格名称<span style="color: red">*</span></span>
  701. </template>
  702. <template slot-scope="scope">
  703. <el-form-item style="padding-top: 15px">
  704. <el-input
  705. placeholder="请输入规格名称"
  706. v-model="scope.row.good_id"
  707. :value="specificationName(scope.row.good_id)"
  708. @focus="showDialog(scope.$index, scope.row)"
  709. ></el-input>
  710. </el-form-item>
  711. </template>
  712. </el-table-column>
  713. <el-table-column min-width="23" align="center">
  714. <template slot="header" slot-scope="scope">
  715. <span>单价<span style="color: red">*</span></span>
  716. </template>
  717. <template slot-scope="scope">
  718. <el-form-item
  719. :prop="'recordData.' + scope.$index + '.price'"
  720. :rules="tableRules.price"
  721. style="padding-top: 17px"
  722. >
  723. <el-input type="number" v-model="scope.row.price"></el-input>
  724. </el-form-item>
  725. </template>
  726. </el-table-column>
  727. <el-table-column min-width="23" align="center">
  728. <template slot="header" slot-scope="scope">
  729. <span>出库数量<span style="color: red">*</span></span>
  730. </template>
  731. <template slot-scope="scope">
  732. <el-form-item
  733. :prop="'recordData.' + scope.$index + '.count'"
  734. :rules="tableRules.count"
  735. style="padding-top: 17px"
  736. >
  737. <el-input type="number" v-model="scope.row.count"></el-input>
  738. </el-form-item>
  739. </template>
  740. </el-table-column>
  741. <el-table-column label="总价" min-width="20" align="center">
  742. <template slot-scope="scope">
  743. {{ calculate(scope.row.price * scope.row.count) }}
  744. </template>
  745. </el-table-column>
  746. <el-table-column label="备注" min-width="20" align="center">
  747. <template slot-scope="scope">
  748. <el-input v-model="scope.row.remark"></el-input>
  749. </template>
  750. </el-table-column>
  751. <el-table-column label="操作" align="center" min-width="30">
  752. <template slot-scope="scope">
  753. <el-tooltip
  754. class="item"
  755. effect="dark"
  756. content="新增"
  757. placement="top"
  758. >
  759. <el-button
  760. size="mini"
  761. type="primary"
  762. icon="el-icon-circle-plus-outline"
  763. @click="handleEditOne(scope.$index, scope.row)"
  764. >
  765. </el-button>
  766. </el-tooltip>
  767. <el-tooltip
  768. class="item"
  769. effect="dark"
  770. content="删除"
  771. placement="top"
  772. >
  773. <el-button
  774. size="mini"
  775. type="danger"
  776. icon="el-icon-delete"
  777. @click="handleDeleteOne(scope.$index, scope.row)"
  778. >
  779. </el-button>
  780. </el-tooltip>
  781. </template>
  782. </el-table-column>
  783. </el-table>
  784. </el-form>
  785. </span>
  786. <span slot="footer" class="dialog-footer">
  787. <el-button @click="editDialogVisible = false">取 消</el-button>
  788. <el-button type="primary" @click="submit">确 定</el-button>
  789. </span>
  790. </el-dialog>
  791. <el-dialog
  792. title="出库明细"
  793. :visible.sync="editdialogVisibleThree"
  794. width="70%"
  795. >
  796. <span>
  797. <div class="app-container">
  798. <div class="filter-container">
  799. <span style="font-size: 18px; color: #606266">商品使用明细</span>
  800. </div>
  801. <el-row :gutter="12" style="margin-top: 10px">
  802. <el-table
  803. :data="userList"
  804. :class="signAndWeighBoxPatients"
  805. style="width: 50%"
  806. border
  807. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  808. >
  809. <el-table-column min-width="35" align="center">
  810. <template slot="header" slot-scope="scope">
  811. <span>序号</span>
  812. </template>
  813. <template slot-scope="scope">
  814. <span v-if="scope.row.is_total == 0">{{
  815. scope.$index + 1
  816. }}</span>
  817. <span v-if="scope.row.is_total == 1">{{ "合计" }}</span>
  818. </template>
  819. </el-table-column>
  820. <el-table-column min-width="35" align="center">
  821. <template slot="header" slot-scope="scope">
  822. <span>使用人</span>
  823. </template>
  824. <template slot-scope="scope">
  825. <span v-if="scope.row.is_total == 0">{{
  826. scope.row.name
  827. }}</span>
  828. <span v-if="scope.row.is_total == 1"></span>
  829. </template>
  830. </el-table-column>
  831. <el-table-column min-width="35" align="center">
  832. <template slot="header" slot-scope="scope">
  833. <span>使用数量</span>
  834. </template>
  835. <template slot-scope="scope">
  836. <span v-if="scope.row.is_total == 0">{{ scope.row.count - scope.row.cancel_count}}{{ scope.row.packing_unit }}</span>
  837. <span v-if="scope.row.is_total == 1">{{ scope.row.total}}</span>
  838. </template>
  839. </el-table-column>
  840. <el-table-column min-width="60" align="center">
  841. <template slot="header" slot-scope="scope">
  842. <span>使用时间</span>
  843. </template>
  844. <template slot-scope="scope">
  845. <span
  846. >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
  847. </span>
  848. </template>
  849. </el-table-column>
  850. </el-table>
  851. </el-row>
  852. </div>
  853. </span>
  854. <span slot="footer" class="dialog-footer">
  855. <el-button @click="editdialogVisibleThree = false">取 消</el-button>
  856. <el-button type="primary" @click="editdialogVisibleThree = false"
  857. >确 定</el-button
  858. >
  859. </span>
  860. </el-dialog>
  861. <stock-in-dialog
  862. ref="dialog"
  863. :propForm="propForm"
  864. :visibility="isVisibility"
  865. v-on:dialog-comfirm="comfirm"
  866. v-on:dialog-cancle="cancle"
  867. >
  868. </stock-in-dialog>
  869. <el-dialog
  870. title="详细"
  871. :visible.sync="AdviceDialogVisible"
  872. width="40%">
  873. <span>
  874. <el-table
  875. :data="projectList"
  876. border
  877. style="width: 100%">
  878. <el-table-column prop="date" label="序号" width="180" align="center">
  879. <template slot-scope="scope">
  880. {{scope.$index+1}}
  881. </template>
  882. </el-table-column>
  883. <el-table-column prop="date" label="患者姓名" width="100" align="center">
  884. <template slot-scope="scope">
  885. {{getPatientName(scope.row.patient_id)}}
  886. </template>
  887. </el-table-column>
  888. <el-table-column prop="name" label="耗材数量" width="100" align="center">
  889. <template slot-scope="scope">
  890. {{scope.row.count}}{{scope.row.unit}}
  891. </template>
  892. </el-table-column>
  893. <el-table-column prop="address" label="出库数量" align="center">
  894. <template slot-scope="scope">
  895. {{getGoodOutCount(scope.row.patient_id)}}
  896. </template>
  897. </el-table-column>
  898. </el-table>
  899. </span>
  900. <span slot="footer" class="dialog-footer">
  901. <el-button @click="AdviceDialogVisible = false">取 消</el-button>
  902. <el-button type="primary" @click="AdviceDialogVisible = false">确 定</el-button>
  903. </span>
  904. </el-dialog>
  905. </div>
  906. </template>
  907. <script>
  908. import { uParseTime } from "@/utils/tools";
  909. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  910. import {
  911. deleteWarehouseOut,
  912. GetAllConfig,
  913. getWarehouseOutList,
  914. getWarehouseOutInfo,
  915. getWarehouseOutUser,
  916. GetOutStockTotalCount,
  917. deleteWarehouseOutInfo,
  918. GetAllGoodInfoByID,
  919. editWarehouseoutInfo,
  920. getOrderDetailByOrderId,
  921. getOrderDetailById,
  922. getOutExportList,
  923. getGoodPatientName
  924. } from "@/api/stock";
  925. import BreadCrumb from "../components/bread-crumb";
  926. import StockInDialog from "./Dialog/stockInDialog";
  927. export default {
  928. name: "salesReturnOrder",
  929. components: { StockInDialog, BreadCrumb },
  930. created() {
  931. var nowDate = new Date();
  932. var nowYear = nowDate.getFullYear();
  933. var nowMonth = nowDate.getMonth() + 1;
  934. var nowDay = nowDate.getDate();
  935. this.end_time =
  936. nowYear +
  937. "-" +
  938. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  939. "-" +
  940. (nowDay < 10 ? "0" + nowDay : nowDay);
  941. nowDate.setMonth(nowDate.getMonth() - 1);
  942. nowYear = nowDate.getFullYear();
  943. nowMonth = nowDate.getMonth() + 1;
  944. nowDay = nowDate.getDate();
  945. this.start_time =
  946. nowYear +
  947. "-" +
  948. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  949. "-" +
  950. (nowDay < 10 ? "0" + nowDay : nowDay);
  951. this.GetConfigInfo();
  952. this.GetWarehouseOut();
  953. this.fetchAllAdminUsers();
  954. },
  955. data() {
  956. var checkGoodId = (rule, value, callback) => {
  957. setTimeout(() => {
  958. if (value == "" || value == 0) {
  959. return callback(new Error("规格名称不能为空"));
  960. }
  961. }, 2000);
  962. };
  963. return {
  964. searchKey: "",
  965. crumbs: [
  966. { path: false, name: "库存管理" },
  967. { path: false, name: "出库单" },
  968. ],
  969. page: 1,
  970. limit: 5,
  971. checked: false,
  972. total: 0,
  973. pageTotal: 0,
  974. pageSelect: 0,
  975. check_id: 0,
  976. adminUserOptions: [],
  977. multipleSelection: [],
  978. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  979. start_time: "",
  980. warehouseOutDate: [],
  981. end_time: "",
  982. goodType: [],
  983. goodInfo: [],
  984. manufacturer: [],
  985. selectedTableData: [],
  986. dealer: [],
  987. type: 1,
  988. drug_id: 0,
  989. dialogVisible: false,
  990. editdialogVisible: false,
  991. warehousingOutInfo: {
  992. loading: false,
  993. warehousingOutData: [],
  994. info: {},
  995. },
  996. userList: [],
  997. type_name: "",
  998. specification_name: "",
  999. stockCount: [],
  1000. editDialogVisible: false,
  1001. warehouse_out_time: "",
  1002. form: {
  1003. manufacturer: 0,
  1004. dealer: 0,
  1005. },
  1006. warehouseInfoList: [],
  1007. tableRules: {
  1008. price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
  1009. warehousing_count: [
  1010. { required: true, message: "数量不能为空", trigge: "blur" },
  1011. ],
  1012. good_id: [{ validator: checkGoodId, trigger: "blur" }],
  1013. },
  1014. recordInfo: {
  1015. recordData: [],
  1016. stock_in_code: "",
  1017. current_index: "",
  1018. },
  1019. propForm: {
  1020. goods: [],
  1021. goodType: [],
  1022. goodInfo: [],
  1023. goodUnit: [],
  1024. title: "入库",
  1025. manufacturer: 0,
  1026. dealer: 0,
  1027. },
  1028. isVisibility: false,
  1029. good_type_id: "",
  1030. tableShow: false,
  1031. tableList: [],
  1032. dialogVisibleTwo: false,
  1033. userList: [],
  1034. editdialogVisibleTwo: false,
  1035. editdialogVisibleThree: false,
  1036. order_id: "",
  1037. warehouse_out_time: "",
  1038. exportList: [],
  1039. is_sys: 0,
  1040. infoList: [],
  1041. stockFlowList: [],
  1042. list: [],
  1043. houselist: [],
  1044. storehouse_id: 0,
  1045. is_sys: 0,
  1046. way_type: 0,
  1047. wayList: [
  1048. { id: 0, name: "全部" },
  1049. { id: 1, name: "手动出库" },
  1050. { id: 2, name: "自动出库" },
  1051. { id: 3, name: "调拨出库" },
  1052. { id: 5, name:"结算出库" }
  1053. ],
  1054. check_type:0,
  1055. checkList:[
  1056. {id:0,name:"全部"},
  1057. {id:1,name:"已审核"},
  1058. {id:2,name:"未审核"},
  1059. ],
  1060. check_id: 0,
  1061. flowList:[],
  1062. cancelInfoList:[],
  1063. exportLoding:false,
  1064. patients:[],
  1065. projectList:[],
  1066. outList:[],
  1067. AdviceDialogVisible:false
  1068. };
  1069. },
  1070. methods: {
  1071. changeTypeName() {
  1072. this.getlist();
  1073. },
  1074. // getlist() {
  1075. // var params = {
  1076. // check_id: this.check_id,
  1077. // start_time: this.start_time,
  1078. // end_time: this.end_time,
  1079. // keyword: this.keywords,
  1080. // page: this.page,
  1081. // limit: this.limit,
  1082. // };
  1083. // getAllSecondOrderList(params).then((response) => {
  1084. // if (response.data.state == 1) {
  1085. // var list = response.data.data.list;
  1086. // this.tableList = list;
  1087. // var total = response.data.data.total;
  1088. // this.total = total;
  1089. // this.houseList = response.data.data.houseList;
  1090. // this.doctorList = response.data.data.doctorList;
  1091. // }
  1092. // });
  1093. // },
  1094. search: function () {
  1095. const Params = {
  1096. page: this.page,
  1097. limit: this.limit,
  1098. start_time: this.start_time,
  1099. end_time: this.end_time,
  1100. type: this.type,
  1101. keywords: this.searchKey,
  1102. storehouse_id: this.storehouse_id,
  1103. way_type: this.way_type,
  1104. check_type:this.check_type,
  1105. };
  1106. this.warehouseOutDate = [];
  1107. getWarehouseOutList(Params).then((response) => {
  1108. if (response.data.state == 0) {
  1109. this.$message.error(response.data.msg);
  1110. return false;
  1111. } else {
  1112. this.total = response.data.data.total;
  1113. for (let i = 0; i < response.data.data.list.length; i++) {
  1114. this.warehouseOutDate.push(response.data.data.list[i]);
  1115. }
  1116. }
  1117. });
  1118. },
  1119. AddNewOrder: function () {
  1120. this.$router.push({
  1121. name: "stockOutOrderAdd",
  1122. query: { type: this.type },
  1123. });
  1124. },
  1125. GetWarehouseOut: function () {
  1126. const Params = {
  1127. page: this.page,
  1128. limit: this.limit,
  1129. start_time: this.start_time,
  1130. end_time: this.end_time,
  1131. type: this.type,
  1132. storehouse_id: this.storehouse_id,
  1133. way_type: this.way_type,
  1134. check_type:this.check_type,
  1135. };
  1136. this.warehouseOutDate = [];
  1137. getWarehouseOutList(Params).then((response) => {
  1138. if (response.data.state == 0) {
  1139. this.$message.error(response.data.msg);
  1140. return false;
  1141. } else {
  1142. this.total = response.data.data.total;
  1143. for (let i = 0; i < response.data.data.list.length; i++) {
  1144. this.warehouseOutDate.push(response.data.data.list[i]);
  1145. }
  1146. var obj = { id: 0, storehouse_name: "全部" };
  1147. this.houselist = [];
  1148. this.houselist.push(obj);
  1149. for (let i = 0; i < response.data.data.houselist.length; i++) {
  1150. this.houselist.push(response.data.data.houselist[i]);
  1151. }
  1152. var objOne = {id:0,name:"系统"}
  1153. this.patients.push(objOne)
  1154. for(let i=0;i<response.data.data.patients.length;i++){
  1155. this.patients.push(response.data.data.patients[i])
  1156. }
  1157. }
  1158. });
  1159. },
  1160. getXuserName(id) {
  1161. if (id <= 0) {
  1162. return "";
  1163. }
  1164. var name = "";
  1165. if (
  1166. this.adminUserOptions == null ||
  1167. typeof this.adminUserOptions.length === "undefined"
  1168. ) {
  1169. return name;
  1170. }
  1171. var leng = this.adminUserOptions.length;
  1172. if (leng == 0) {
  1173. return name;
  1174. }
  1175. for (let index = 0; index < leng; index++) {
  1176. if (this.adminUserOptions[index].id == id) {
  1177. name = this.adminUserOptions[index].name;
  1178. break;
  1179. }
  1180. }
  1181. return name;
  1182. },
  1183. fetchAllAdminUsers() {
  1184. fetchAllAdminUsers().then((response) => {
  1185. if (response.data.state == 1) {
  1186. this.adminUserOptions = response.data.data.users;
  1187. var alen = this.adminUserOptions.length;
  1188. for (let index = 0; index < alen; index++) {
  1189. if (this.adminUserOptions[index].user_type == 2) {
  1190. // this.doctorOptions.push(this.adminUserOptions[index]);
  1191. }
  1192. }
  1193. }
  1194. });
  1195. },
  1196. handleSelectionChange: function (val) {
  1197. this.multipleSelection = val;
  1198. },
  1199. handleSizeChange(val) {
  1200. this.limit = val;
  1201. this.GetWarehouseOut();
  1202. },
  1203. handleCurrentChange(val) {
  1204. this.page = val;
  1205. this.GetWarehouseOut();
  1206. },
  1207. startTimeChange(val) {
  1208. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  1209. if (time > 0) {
  1210. this.$message.error("结束时间不能小于开始时间");
  1211. this.start_time = "";
  1212. } else {
  1213. this.GetWarehouseOut();
  1214. this.getlist();
  1215. }
  1216. },
  1217. endTimeChange(val) {
  1218. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  1219. if (time < 0) {
  1220. this.$message.error("结束时间不能小于开始时间");
  1221. this.end_time = "";
  1222. } else {
  1223. this.GetWarehouseOut();
  1224. this.getlist();
  1225. }
  1226. },
  1227. getTimestamp(time) {
  1228. // 把时间日期转成时间戳
  1229. return new Date(time).getTime() / 1000;
  1230. },
  1231. calculate: function (val) {
  1232. return Math.round(parseFloat(val) * 100) / 100;
  1233. },
  1234. GetConfigInfo: function () {
  1235. GetAllConfig().then((response) => {
  1236. if (response.data.state == 0) {
  1237. this.$message.error(response.data.msg);
  1238. return false;
  1239. } else {
  1240. this.manufacturer = response.data.data.manufacturer;
  1241. this.dealer = response.data.data.dealer;
  1242. this.goodInfo = response.data.data.goodInfo;
  1243. this.goodType = response.data.data.goodType;
  1244. this.list = response.data.data.list;
  1245. // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
  1246. // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
  1247. this.getlist();
  1248. }
  1249. });
  1250. },
  1251. getManufactuerName: function (manufacturer_id) {
  1252. for (let i = 0; i < this.manufacturer.length; i++) {
  1253. if (this.manufacturer[i].id == manufacturer_id) {
  1254. return this.manufacturer[i].manufacturer_name;
  1255. }
  1256. }
  1257. },
  1258. getDealerName: function (dealer_id) {
  1259. for (let i = 0; i < this.dealer.length; i++) {
  1260. if (this.dealer[i].id == dealer_id) {
  1261. return this.dealer[i].dealer_name;
  1262. }
  1263. }
  1264. },
  1265. handleEdit: function (index, row) {
  1266. this.$router.push({
  1267. path:
  1268. "/stock/stockoutorderedit?id=" +
  1269. row.id +
  1270. "&is_sys=" +
  1271. row.is_sys +
  1272. "&supply_cancel_out_id=" +
  1273. row.supply_cancel_out_id+
  1274. "&type="+row.type+"&is_check="+row.is_check,
  1275. });
  1276. },
  1277. handleDelete: function (index, row) {
  1278. if (row.is_sys == 12) {
  1279. this.$message.error("调拨出库数据不能删除!");
  1280. return false;
  1281. }
  1282. if (row.is_sys == 5) {
  1283. this.$message.error("结算出库数据不能删除!");
  1284. return false;
  1285. }
  1286. if (row.supply_cancel_out_id > 0) {
  1287. this.$message.error("采购出库数据不能删除!");
  1288. return false;
  1289. }
  1290. if(row.is_check == 1){
  1291. this.$message.error("已审核的单据不能删除!")
  1292. return false
  1293. }
  1294. const ids = [];
  1295. ids.push(row.id);
  1296. const idStr = ids.join(",");
  1297. const params = {
  1298. ids: idStr,
  1299. };
  1300. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  1301. confirmButtonText: "确定",
  1302. cancelButtonText: "取消",
  1303. type: "warning",
  1304. })
  1305. .then(() => {
  1306. deleteWarehouseOut(params).then((response) => {
  1307. if (response.data.state == 0) {
  1308. this.$message.error(response.data.msg);
  1309. return false;
  1310. } else {
  1311. this.$notify({
  1312. title: "成功",
  1313. message: "删除成功",
  1314. type: "success",
  1315. duration: 2000,
  1316. });
  1317. for (let i = 0; i < ids.length; i++) {
  1318. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  1319. if (ids[i] == this.warehouseOutDate[y].id) {
  1320. this.warehouseOutDate.splice(y, 1);
  1321. }
  1322. }
  1323. }
  1324. }
  1325. });
  1326. })
  1327. .catch(() => {});
  1328. },
  1329. changeAllSelected: function (val) {
  1330. if (val) {
  1331. this.$refs.multipleTable.toggleAllSelection();
  1332. } else {
  1333. this.$refs.multipleTable.clearSelection();
  1334. }
  1335. },
  1336. select(selection) {
  1337. var ids = [];
  1338. for (let i = 0; i < selection.length; i++) {
  1339. ids.push(selection[i].id);
  1340. }
  1341. this.exportList = [];
  1342. this.order_id = ids.join(",");
  1343. if(selection.length >0){
  1344. this.warehouse_out_time = selection[0].warehouse_out_time;
  1345. }
  1346. this.selectedTableData = selection;
  1347. this.getlist();
  1348. },
  1349. batchDelete() {
  1350. if (this.selectedTableData.length <= 0) {
  1351. this.$message.error("请选择要删除的记录");
  1352. return;
  1353. }
  1354. const ids = [];
  1355. const idOne = [];
  1356. for (let i = 0; i < this.selectedTableData.length; i++) {
  1357. if(this.selectedTableData[i].is_check == 1){
  1358. this.$message.error("已审核单据不能删除!")
  1359. return false
  1360. }
  1361. if (this.selectedTableData[i].is_sys == 1) {
  1362. this.$message.error("自动出库数据不能删除!");
  1363. return false;
  1364. }
  1365. if (this.selectedTableData[i].is_sys == 5) {
  1366. this.$message.error("结算出库数据不能删除!");
  1367. return false;
  1368. }
  1369. if (this.selectedTableData[i].is_sys == 12) {
  1370. this.$message.error("调拨出库数据不能删除!");
  1371. return false;
  1372. }
  1373. if (this.selectedTableData[i].is_sys == 0) {
  1374. ids.push(this.selectedTableData[i].id);
  1375. if(this.selectedTableData[i].supply_cancel_out_id >0){
  1376. idOne.push(this.selectedTableData[i].supply_cancel_out_id);
  1377. }
  1378. }
  1379. }
  1380. if (idOne.length > 0) {
  1381. this.$message.error("采购出库数据不能删除!");
  1382. return false;
  1383. }
  1384. const idStr = ids.join(",");
  1385. const params = {
  1386. ids: idStr,
  1387. };
  1388. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  1389. confirmButtonText: "确定",
  1390. cancelButtonText: "取消",
  1391. type: "warning",
  1392. })
  1393. .then(() => {
  1394. deleteWarehouseOut(params).then((response) => {
  1395. if (response.data.state == 0) {
  1396. this.$message.error(response.data.msg);
  1397. return false;
  1398. } else {
  1399. this.$notify({
  1400. title: "成功",
  1401. message: "删除成功",
  1402. type: "success",
  1403. duration: 2000,
  1404. });
  1405. for (let i = 0; i < ids.length; i++) {
  1406. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  1407. if (ids[i] == this.warehouseOutDate[y].id) {
  1408. this.warehouseOutDate.splice(y, 1);
  1409. }
  1410. }
  1411. }
  1412. }
  1413. });
  1414. })
  1415. .catch(() => {});
  1416. },
  1417. handleSearch(val) {
  1418. this.is_sys = val.is_sys;
  1419. this.tableList = [];
  1420. this.editdialogVisibleThree = false;
  1421. this.GetOrderDetailOne(val.id,val.warehouse_out_time);
  1422. this.GetTotalCount(val.warehouse_out_time);
  1423. },
  1424. GetOrderDetailOne(id,warehouse_out_time) {
  1425. const params = {
  1426. id: id,
  1427. warehouse_out_time:warehouse_out_time,
  1428. };
  1429. getOrderDetailByOrderId(params).then((response) => {
  1430. if (response.data.state == 1) {
  1431. this.tableShow = true;
  1432. var list = response.data.data.list;
  1433. this.flowList = response.data.data.stockFlowList
  1434. console.log("出库数据233223232323wo",this.flowList)
  1435. this.stockFlowListGroup = response.data.data.stockFlowListGroup
  1436. console.log("分组2332223233wode",this.stockFlowListGroup)
  1437. var cancelInfolist = response.data.data.cancelInfolist
  1438. this.cancelInfoList = cancelInfolist
  1439. this.tableList = [];
  1440. var tableArr = []
  1441. for (let i = 0; i < list.length; i++) {
  1442. list[i].child= []
  1443. list[i].childOne = []
  1444. list[i].childTwo= []
  1445. for(let z=0;z<this.stockFlowListGroup.length;z++){
  1446. if(list[i].good_id == this.stockFlowListGroup[z].good_id){
  1447. list[i].childTwo.push(this.stockFlowListGroup[z])
  1448. }
  1449. }
  1450. for(let j=0;j<this.flowList.length;j++){
  1451. if(list[i].good_id == this.flowList[j].good_id){
  1452. list[i].child.push(this.flowList[j])
  1453. }
  1454. }
  1455. tableArr.push(list[i]);
  1456. }
  1457. if(tableArr!=null && tableArr.length>0){
  1458. for(let i=0;i<tableArr.length;i++){
  1459. for(let j=0;j<tableArr[i].childTwo.length;j++){
  1460. tableArr[i].childTwo[j].over_count_total = this.getAllStockCount(tableArr[i].child,tableArr[i].childTwo[j].warehousing_id) - this.getCancelInfo(tableArr[i].childTwo[j].warehousing_id,tableArr[i].childTwo[j].good_id)
  1461. }
  1462. }
  1463. }
  1464. for(let i=0;i<tableArr.length;i++){
  1465. for(let j=0;j<tableArr[i].childTwo.length;j++){
  1466. if(tableArr[i].childTwo[j].over_count_total >0){
  1467. tableArr[i].childOne.push(tableArr[i].childTwo[j])
  1468. }
  1469. }
  1470. }
  1471. console.log("tableARR",tableArr)
  1472. console.log("tablielist2332323", this.tableList)
  1473. this.tableList = tableArr
  1474. }
  1475. });
  1476. },
  1477. getTypeName: function (id) {
  1478. let name = "";
  1479. for (let i = 0; i < this.goodType.length; i++) {
  1480. if (this.goodType[i].id == id) {
  1481. name = this.goodType[i].type_name;
  1482. }
  1483. }
  1484. return name;
  1485. },
  1486. getTypeNameOne: function (id) {
  1487. let name = "";
  1488. for (let i = 0; i < this.goodInfo.length; i++) {
  1489. if (this.goodInfo[i].id == id) {
  1490. name = this.goodInfo[i].good_name;
  1491. }
  1492. }
  1493. return name;
  1494. },
  1495. getSpecificationName: function (id) {
  1496. let name = "";
  1497. for (let i = 0; i < this.goodInfo.length; i++) {
  1498. if (this.goodInfo[i].id == id) {
  1499. name = this.goodInfo[i].specification_name;
  1500. }
  1501. }
  1502. return name;
  1503. },
  1504. getManufactuerName: function (manufacturer_id) {
  1505. for (let i = 0; i < this.manufacturer.length; i++) {
  1506. if (this.manufacturer[i].id == manufacturer_id) {
  1507. return this.manufacturer[i].manufacturer_name;
  1508. }
  1509. }
  1510. },
  1511. jump(id) {
  1512. this.userList = [];
  1513. this.GetOrderDetail(id);
  1514. },
  1515. GetOrderDetail: function (order_id) {
  1516. this.userList = [];
  1517. const params = {
  1518. id: order_id,
  1519. };
  1520. getWarehouseOutUser(params).then((response) => {
  1521. if (response.data.state == 0) {
  1522. this.$message.error(response.data.msg);
  1523. return false;
  1524. } else {
  1525. var total = 0;
  1526. var list = response.data.data.list;
  1527. var arrList = this.unique(list);
  1528. for (let i = 0; i < arrList.length; i++) {
  1529. var obj = arrList[i];
  1530. obj["is_total"] = 0;
  1531. this.userList.push(obj);
  1532. total = total + arrList[i].count;
  1533. }
  1534. this.userList.push({
  1535. is_total: 1,
  1536. total: total,
  1537. });
  1538. this.editdialogVisibleThree = true;
  1539. }
  1540. });
  1541. },
  1542. deleteRecord: function () {
  1543. const ids = [];
  1544. ids.push(this.warehousingOutInfo.info.id);
  1545. const idStr = ids.join(",");
  1546. const params = {
  1547. ids: idStr,
  1548. };
  1549. this.$confirm("确认删除出库单?", "删除出库单记录", {
  1550. confirmButtonText: "确定",
  1551. cancelButtonText: "取消",
  1552. type: "warning",
  1553. })
  1554. .then(() => {
  1555. deleteWarehouseOut(params).then((response) => {
  1556. if (response.data.state == 0) {
  1557. this.$message.error(response.data.msg);
  1558. return false;
  1559. } else {
  1560. this.$notify({
  1561. title: "成功",
  1562. message: "删除成功",
  1563. type: "success",
  1564. duration: 2000,
  1565. });
  1566. this.$router.back(-1);
  1567. }
  1568. });
  1569. })
  1570. .catch(() => {});
  1571. },
  1572. GetTotalCount(time) {
  1573. var params = {
  1574. warehouse_out_time: time,
  1575. };
  1576. GetOutStockTotalCount(params).then((response) => {
  1577. if (response.data.state == 1) {
  1578. var stockCount = response.data.data.stockCount;
  1579. this.stockCount = stockCount;
  1580. }
  1581. });
  1582. },
  1583. getOutStockCount(id) {
  1584. var count = 0;
  1585. for (let i = 0; i < this.stockCount.length; i++) {
  1586. if (id == this.stockCount[i].good_id) {
  1587. count = this.stockCount[i].count;
  1588. }
  1589. }
  1590. return count;
  1591. },
  1592. unique(arr) {
  1593. const res = new Map();
  1594. return arr.filter(
  1595. (arr) => !res.has(arr.patient_id) && res.set(arr.patient_id, 1)
  1596. );
  1597. },
  1598. editRecord(id) {
  1599. this.warehouseOut = [];
  1600. this.recordInfo.recordData = [];
  1601. this.GetConfigInfo();
  1602. this.GetOrderDetailTwo(id);
  1603. this.good_type_id = id;
  1604. },
  1605. GetOrderDetailTwo(order_id) {
  1606. const params = {
  1607. id: order_id,
  1608. };
  1609. getWarehouseOutInfo(params).then((response) => {
  1610. if (response.data.state == 0) {
  1611. this.$message.error(response.data.msg);
  1612. return false;
  1613. } else {
  1614. for (let i = 0; i < response.data.data.list.length; i++) {
  1615. response.data.data.list[i].price =
  1616. response.data.data.list[i].price.toString();
  1617. response.data.data.list[i].count =
  1618. response.data.data.list[i].count.toString();
  1619. this.recordInfo.recordData.push(response.data.data.list[i]);
  1620. }
  1621. this.warehouseOut = response.data.data.info;
  1622. this.warehouse_out_time = this.getTime(
  1623. this.warehouseOut.warehouse_out_time,
  1624. "{y}-{m}-{d}"
  1625. );
  1626. // this.form.manufacturer = this.warehouseOut.manufacturer
  1627. // this.form.dealer = this.warehouseOut.dealer
  1628. this.editDialogVisible = true;
  1629. }
  1630. if (this.recordInfo.recordData.length == 0) {
  1631. const tempObj = {};
  1632. tempObj["id"] = 0;
  1633. tempObj["good_type_id"] = 0;
  1634. tempObj["good_id"] = 0;
  1635. tempObj["count"] = "";
  1636. tempObj["price"] = "";
  1637. tempObj["remark"] = "";
  1638. this.recordInfo.recordData.push(tempObj);
  1639. this.editDialogVisible = true;
  1640. }
  1641. });
  1642. },
  1643. getTime(val, temp) {
  1644. if (val > 0) {
  1645. return uParseTime(val, temp);
  1646. } else {
  1647. return "";
  1648. }
  1649. },
  1650. changeManufacturer(val) {
  1651. this.propForm.manufacturer = val;
  1652. },
  1653. changeDealer(val) {
  1654. this.propForm.dealer = val;
  1655. },
  1656. typeName: function (good_type_id) {
  1657. let name = "";
  1658. for (let i = 0; i < this.goodType.length; i++) {
  1659. if (this.goodType[i].id == good_type_id) {
  1660. name = this.goodType[i].type_name;
  1661. }
  1662. }
  1663. return name;
  1664. },
  1665. specificationName: function (good_info_id) {
  1666. let name = "";
  1667. for (let i = 0; i < this.goodInfo.length; i++) {
  1668. if (this.goodInfo[i].id == good_info_id) {
  1669. name = this.goodInfo[i].specification_name;
  1670. }
  1671. }
  1672. return name;
  1673. },
  1674. handleEditOne() {
  1675. const tempObj = {};
  1676. tempObj["id"] = 0;
  1677. tempObj["good_type_id"] = 0;
  1678. tempObj["good_id"] = 0;
  1679. tempObj["count"] = "";
  1680. tempObj["price"] = "";
  1681. tempObj["remark"] = "";
  1682. this.recordInfo.recordData.push(tempObj);
  1683. },
  1684. handleDeleteOne: function (index, row) {
  1685. if (row.id == 0) {
  1686. this.recordInfo.recordData.splice(index, 1);
  1687. } else {
  1688. const params = {
  1689. id: row.id,
  1690. };
  1691. this.$confirm("确认删除该出库耗材信息记录?", "删除出库耗材信息记录", {
  1692. confirmButtonText: "确定",
  1693. cancelButtonText: "取消",
  1694. type: "warning",
  1695. })
  1696. .then(() => {
  1697. deleteWarehouseOutInfo(params).then((response) => {
  1698. if (response.data.state == 0) {
  1699. this.$message.error(response.data.msg);
  1700. return false;
  1701. } else {
  1702. this.$message.success("删除成功");
  1703. this.recordInfo.recordData.splice(index, 1);
  1704. }
  1705. });
  1706. })
  1707. .catch(() => {});
  1708. }
  1709. },
  1710. showDialog(index, row) {
  1711. this.currentIndex = index;
  1712. const loading = this.$loading({
  1713. lock: true,
  1714. text: "Loading",
  1715. spinner: "el-icon-loading",
  1716. background: "rgba(0, 0, 0, 0.7)",
  1717. });
  1718. const params = {
  1719. manufacturer_id: this.form.manufacturer,
  1720. dealer_id: this.form.dealer,
  1721. };
  1722. this.propForm.goods = [];
  1723. GetAllGoodInfoByID(params).then((response) => {
  1724. if (response.data.state == 0) {
  1725. this.$message.error(response.data.msg);
  1726. return false;
  1727. } else {
  1728. if (response.data.data.goodInfo.length <= 0) {
  1729. this.$message.error("该厂商或经销商没有物品信息");
  1730. return;
  1731. }
  1732. this.$refs.dialog.show();
  1733. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  1734. this.propForm.goodType.push(response.data.data.goodInfo[i].type);
  1735. }
  1736. const obj = {};
  1737. this.propForm.goodType = this.propForm.goodType.reduce(
  1738. (cur, next) => {
  1739. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1740. return cur;
  1741. },
  1742. []
  1743. ); // 设置cur默认类型为数组,并且初始值为空的数组
  1744. }
  1745. for (let i = 0; i < this.propForm.goodType.length; i++) {
  1746. let goodInfo = [];
  1747. let goodObj = {};
  1748. for (let a = 0; a < response.data.data.goodInfo.length; a++) {
  1749. var respObj = response.data.data.goodInfo[a];
  1750. respObj["isSelected"] = false;
  1751. if (respObj.type.id == this.propForm.goodType[i].id) {
  1752. goodInfo.push(respObj);
  1753. }
  1754. }
  1755. const obj = {};
  1756. goodInfo = goodInfo.reduce((cur, next) => {
  1757. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1758. return cur;
  1759. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  1760. this.$set(goodObj, this.propForm.goodType[i].id, goodInfo);
  1761. this.propForm.goods.push(goodObj);
  1762. }
  1763. loading.close();
  1764. });
  1765. },
  1766. comfirm: function (val) {
  1767. this.$refs.dialog.hide();
  1768. this.propForm.goodType = [];
  1769. this.propForm.goods = [];
  1770. if (val.selectedGoodInfo.length > 0) {
  1771. for (let i = val.selectedGoodInfo.length - 1; ; i--) {
  1772. if (i == 0) {
  1773. this.recordInfo.recordData[this.currentIndex].good_type_id =
  1774. val.selectedGoodInfo[i].good_type_id;
  1775. this.recordInfo.recordData[this.currentIndex].good_id =
  1776. val.selectedGoodInfo[i].id;
  1777. this.recordInfo.recordData[this.currentIndex].price =
  1778. val.selectedGoodInfo[i].buy_price.toString();
  1779. } else {
  1780. const tempForm = {};
  1781. tempForm["id"] = 0;
  1782. tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
  1783. tempForm["good_id"] = val.selectedGoodInfo[i].id;
  1784. tempForm["count"] = "";
  1785. tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
  1786. tempForm["remark"] = "";
  1787. this.recordInfo.recordData.splice(
  1788. this.currentIndex + 1,
  1789. 0,
  1790. tempForm
  1791. );
  1792. }
  1793. }
  1794. }
  1795. this.currentIndex = -1;
  1796. },
  1797. cancle: function () {
  1798. this.$refs.dialog.hide();
  1799. this.propForm.goods = [];
  1800. this.propForm.goodType = [];
  1801. },
  1802. submit() {
  1803. this.$refs["tableForm"].validate((valid) => {
  1804. if (valid) {
  1805. const array = this.recordInfo.recordData;
  1806. for (let i = 0; i < array.length; i++) {
  1807. if (array[i].good_type_id == 0) {
  1808. this.$message.error("商品类型不能为空");
  1809. return;
  1810. }
  1811. if (array[i].good_id == 0) {
  1812. this.$message.error("规格名称不能为空");
  1813. return;
  1814. }
  1815. }
  1816. const params = {
  1817. stockOut: this.recordInfo.recordData,
  1818. };
  1819. editWarehouseoutInfo(
  1820. params,
  1821. this.warehouse_out_time,
  1822. this.good_type_id,
  1823. 1,
  1824. this.form.manufacturer,
  1825. this.form.dealer
  1826. ).then((response) => {
  1827. if (response.data.state == 0) {
  1828. this.$message.error(response.data.msg);
  1829. return false;
  1830. } else {
  1831. this.$message.success("保存成功");
  1832. this.editDialogVisible = false;
  1833. this.warehousingOutInfo.info = [];
  1834. this.warehousingOutInfo.warehousingOutData = [];
  1835. this.GetOrderDetailOne(this.good_type_id);
  1836. }
  1837. });
  1838. } else {
  1839. return false;
  1840. }
  1841. });
  1842. },
  1843. GetOrderDetailById(val) {
  1844. this.userList = [];
  1845. var params = {
  1846. id: val.warehouse_out_id,
  1847. good_id: val.good_id,
  1848. record_time: val.sys_record_time,
  1849. };
  1850. getOrderDetailById(params).then((response) => {
  1851. if (response.data.state == 1) {
  1852. var total = 0;
  1853. var list = response.data.data.list;
  1854. var arrList = this.unique(list);
  1855. var info = response.data.data.info;
  1856. this.infoList = info;
  1857. var stockflowlist = response.data.data.stockFlowList;
  1858. this.stockFlowList = stockflowlist;
  1859. var cancelInfo = response.data.data.cancelInfo
  1860. console.log("哈哈哈哈哈",this.stockFlowList)
  1861. let dataInfo = {}
  1862. if(this.stockFlowList.length > 0){
  1863. this.stockFlowList.forEach((item, index) => {
  1864. let { patient_id } = item
  1865. if (!dataInfo[patient_id]) {
  1866. dataInfo[patient_id] = {
  1867. patient_id,
  1868. child: [],
  1869. name:item.name,
  1870. ctime:item.ctime,
  1871. count:0,
  1872. cancel_count:0,
  1873. is_sys:item.is_sys,
  1874. }
  1875. }
  1876. })
  1877. let arr = Object.values(dataInfo)
  1878. console.log("arr2332323232wode",arr)
  1879. if(arr!=null && arr.length > 0){
  1880. for(let i=0;i<arr.length;i++){
  1881. for(let j=0;j<this.stockFlowList.length;j++){
  1882. if(arr[i].patient_id == this.stockFlowList[j].patient_id){
  1883. arr[i].child.push(this.stockFlowList[j])
  1884. }
  1885. }
  1886. }
  1887. }
  1888. for(let i=0;i<arr.length;i++){
  1889. for(let j=0;j<arr[i].child.length;j++){
  1890. arr[i].count += arr[i].child[j].count
  1891. }
  1892. }
  1893. var newArrOne = []
  1894. if(cancelInfo!=null && cancelInfo.length > 0){
  1895. let dataInfoOne = {}
  1896. if(this.stockFlowList.length > 0){
  1897. this.stockFlowList.forEach((item, index) => {
  1898. let { patient_id } = item
  1899. if (!dataInfoOne[patient_id]) {
  1900. dataInfoOne[patient_id] = {
  1901. patient_id,
  1902. child: [],
  1903. name:item.name,
  1904. ctime:item.ctime,
  1905. count:0,
  1906. is_sys:item.is_sys,
  1907. }
  1908. }
  1909. })
  1910. }
  1911. let newArr = Object.values(dataInfoOne)
  1912. if(newArr!=null && newArr.length > 0){
  1913. for(let i=0;i<newArr.length;i++){
  1914. for(let j=0;j<cancelInfo.length;j++){
  1915. if(cancelInfo[j].patient_id > 0){
  1916. if(newArr[i].patient_id == cancelInfo[j].patient_id){
  1917. newArr[i].child.push(cancelInfo[j])
  1918. }
  1919. }
  1920. }
  1921. }
  1922. }
  1923. for(let i=0;i<newArr.length;i++){
  1924. for(let j=0;j<newArr[i].child.length;j++){
  1925. newArr[i].count+=newArr[i].child[j].count
  1926. }
  1927. }
  1928. newArrOne = newArr
  1929. }
  1930. for(let i=0;i<arr.length;i++){
  1931. for(let j=0;j<newArrOne.length;j++){
  1932. if(arr[i].patient_id == newArrOne[j].patient_id){
  1933. arr[i].cancel_count = newArrOne[j].count
  1934. }
  1935. }
  1936. }
  1937. console.log("2o32o3o3232j32oo23o2332oj2wo",arr)
  1938. var arrTwo= []
  1939. for(let i=0;i<arr.length;i++){
  1940. if((arr[i].count - arr[i].cancel_count) >0){
  1941. arrTwo.push(arr[i])
  1942. }
  1943. }
  1944. console.log("arrTwo8888888",arrTwo)
  1945. for (let i = 0; i <arrTwo.length; i++) {
  1946. var obj = arrTwo[i];
  1947. obj["is_total"] = 0;
  1948. this.userList.push(obj);
  1949. if(arrTwo[i].is_sys == 1){
  1950. total = total + arrTwo[i].count - arrTwo[i].cancel_count;
  1951. }else{
  1952. total = total + arrTwo[i].count;
  1953. }
  1954. }
  1955. this.userList.push({
  1956. is_total: 1,
  1957. total: total,
  1958. });
  1959. if (val.is_sys == 1) {
  1960. this.editdialogVisibleThree = true;
  1961. }
  1962. if (val.is_sys == 0 || val.is_sys == 5) {
  1963. this.editdialogVisibleTwo = true;
  1964. }
  1965. console.log("我的世界332323223我",this.userList)
  1966. }
  1967. }
  1968. });
  1969. },
  1970. getNumber(id) {
  1971. var str = "";
  1972. var arr = [];
  1973. var ids = [];
  1974. for (let i = 0; i < this.userList.length; i++) {
  1975. if (id == this.userList[i].id) {
  1976. arr.push(...this.userList[i].warehouseOutInfo);
  1977. }
  1978. }
  1979. if (arr.length > 0) {
  1980. for (let i = 0; i < arr.length; i++) {
  1981. ids.push(arr[i].number);
  1982. }
  1983. }
  1984. str = ids.join(",");
  1985. return str;
  1986. },
  1987. toPrint() {
  1988. if (this.order_id == "") {
  1989. this.$message.error("请选择出库单");
  1990. } else {
  1991. this.$router.push({
  1992. path:
  1993. "/stock/out/detail/print?id=" +
  1994. this.order_id +
  1995. "&warehouse_out_time=" +
  1996. this.warehouse_out_time +
  1997. "&keyword=" +
  1998. this.searchKey +
  1999. "&start_time=" +
  2000. this.start_time +
  2001. "&end_time=" +
  2002. this.end_time,
  2003. });
  2004. }
  2005. },
  2006. getlist() {
  2007. this.exportLoding = true
  2008. var params = {
  2009. id: this.order_id,
  2010. start_time: this.start_time,
  2011. end_time: this.end_time,
  2012. };
  2013. getOutExportList(params).then((response) => {
  2014. if (response.data.state == 1) {
  2015. var list = response.data.data.list;
  2016. var outCount = response.data.data.outCount;
  2017. for (let i = 0; i < list.length; i++) {
  2018. list[i].unit = list[i].specification_name + "/" + list[i].packing_unit;
  2019. list[i].total_price = (list[i].total_count * list[i].price).toFixed(2);
  2020. list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}");
  2021. list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}");
  2022. for (let j = 0; j < this.manufacturer.length; j++) {
  2023. if (list[i].manufacturer == this.manufacturer[j].id) {
  2024. list[i].manufacturer = this.manufacturer[j].manufacturer_name;
  2025. }
  2026. }
  2027. for (let z = 0; z < this.dealer.length; z++) {
  2028. if (list[i].dealer == this.dealer[z].id) {
  2029. list[i].dealer = this.dealer[z].dealer_name;
  2030. }
  2031. }
  2032. for (let a = 0; a < this.goodType.length; a++) {
  2033. if (list[i].good_type_id == this.goodType[a].id) {
  2034. list[i].good_type_id = this.goodType[a].type_name;
  2035. }
  2036. }
  2037. }
  2038. console.log("list232332232332323223",list)
  2039. this.exportList = list;
  2040. this.exportLoding = false
  2041. }
  2042. });
  2043. },
  2044. toExport() {
  2045. if (this.order_id == "") {
  2046. this.$message.error("请勾选出库单");
  2047. return;
  2048. }
  2049. console.log("时间",this.exportList)
  2050. import("@/vendor/Export2Excel").then((excel) => {
  2051. for (let i = 0; i < this.exportList.length; i++) {
  2052. this.exportList[i].total_price =
  2053. this.exportList[i].count * this.exportList[i].price;
  2054. for (let j = 0; j < this.goodType.length; j++) {
  2055. if (this.exportList[i].good_type_id == this.goodType[j].id) {
  2056. this.exportList[i].good_type_id = this.goodType[j].type_name;
  2057. }
  2058. }
  2059. if (this.exportList[i].dealer == 0) {
  2060. this.exportList[i].dealer = "";
  2061. }
  2062. if (this.exportList[i].manufacturer == 0) {
  2063. this.exportList[i].manufacturer = "";
  2064. }
  2065. if (this.exportList[i].good_type_id == 0) {
  2066. this.exportList[i].good_type_id = "";
  2067. }
  2068. this.exportList[i].ctime = this.getTime(this.exportList[i].ctime, "{y}-{m}-{d}")
  2069. this.exportList[i].warehouse_out_time = this.getTime(this.exportList[i].warehouse_out_time,"{y}-{m}-{d}")
  2070. }
  2071. const tHeader = [
  2072. "单据日期",
  2073. "耗材名称",
  2074. "耗材类型",
  2075. "规格&单位",
  2076. "出库数量",
  2077. "出货价",
  2078. "总价",
  2079. "生产厂商",
  2080. "经销商",
  2081. "生产日期",
  2082. "有效期",
  2083. "备注",
  2084. "出库时间"
  2085. ];
  2086. const filterVal = [
  2087. "warehouse_out_time",
  2088. "good_name",
  2089. "good_type_id",
  2090. "unit",
  2091. "count",
  2092. "price",
  2093. "total_price",
  2094. "manufacturer",
  2095. "dealer",
  2096. "product_date",
  2097. "expiry_date",
  2098. "remark",
  2099. "ctime",
  2100. ];
  2101. const data = this.formatJson(filterVal, this.exportList);
  2102. excel.export_json_to_excel({
  2103. header: tHeader,
  2104. data,
  2105. filename: "耗材出库单详情",
  2106. });
  2107. this.downloadLoading = false;
  2108. });
  2109. },
  2110. formatJson(filterVal, jsonData) {
  2111. return jsonData.map((v) => filterVal.map((j) => v[j]));
  2112. },
  2113. unique(arr) {
  2114. let newArr = [arr[0]];
  2115. for (let i = 1; i < arr.length; i++) {
  2116. let repeat = false;
  2117. for (let j = 0; j < newArr.length; j++) {
  2118. if (arr[i] === newArr[j]) {
  2119. repeat = true;
  2120. break;
  2121. } else {
  2122. }
  2123. }
  2124. if (!repeat) {
  2125. newArr.push(arr[i]);
  2126. }
  2127. }
  2128. return newArr;
  2129. },
  2130. getBatchNumber(patient_id, good_id) {
  2131. var arr = [];
  2132. for (let i = 0; i < this.stockFlowList.length; i++) {
  2133. if (
  2134. patient_id == this.stockFlowList[i].patient_id &&
  2135. good_id == this.stockFlowList[i].good_id
  2136. ) {
  2137. arr.push(this.stockFlowList[i].number);
  2138. }
  2139. }
  2140. arr = this.unique(arr);
  2141. return arr.join(",");
  2142. },
  2143. getHouseName(id) {
  2144. var storehouse_name = "";
  2145. for (let i = 0; i < this.houselist.length; i++) {
  2146. if (id == this.houselist[i].id) {
  2147. storehouse_name = this.houselist[i].storehouse_name;
  2148. }
  2149. }
  2150. if (storehouse_name == "全部") {
  2151. return "";
  2152. } else {
  2153. return storehouse_name;
  2154. }
  2155. },
  2156. changeStoreHouse() {
  2157. this.GetWarehouseOut();
  2158. },
  2159. changeWay() {
  2160. this.GetWarehouseOut();
  2161. },
  2162. changeCheckType(){
  2163. this.GetWarehouseOut()
  2164. },
  2165. getAllStockCount(val,warehousing_id,good_id){
  2166. var arr=[]
  2167. var total_count = 0
  2168. if(val!=null&&val.length > 0){
  2169. for(let i=0;i<val.length;i++){
  2170. if(val[i].warehousing_id == warehousing_id){
  2171. arr.push(val[i])
  2172. }
  2173. }
  2174. }
  2175. if(arr.length > 0) {
  2176. for(let j=0;j<arr.length;j++){
  2177. total_count +=arr[j].count
  2178. }
  2179. }
  2180. if(total_count > 0){
  2181. return total_count
  2182. }else{
  2183. return total_count
  2184. }
  2185. },
  2186. getAllStockCountPrice(val,warehousing_id){
  2187. var price = 0
  2188. var arr = []
  2189. if(val!=null&&val.length > 0){
  2190. for(let i=0;i<val.length;i++){
  2191. if(val[i].warehousing_id == warehousing_id){
  2192. arr.push(val[i])
  2193. }
  2194. }
  2195. }
  2196. if(arr.length > 0){
  2197. return arr[0].price
  2198. }else{
  2199. return 0
  2200. }
  2201. },
  2202. getManufactuerNameSix(val,warehousing_id){
  2203. var manufacturer_name = ""
  2204. var arr= []
  2205. if(val!=null&&val.length > 0){
  2206. for(let i=0;i<val.length;i++){
  2207. if(val[i].warehousing_id == warehousing_id){
  2208. arr.push(val[i])
  2209. }
  2210. }
  2211. }
  2212. if(arr.length > 0){
  2213. manufacturer_name = this.getManufactuerName(arr[0].manufacturer)
  2214. }
  2215. return manufacturer_name
  2216. },
  2217. getDealerNameSix(val,warehousing_id){
  2218. var dealer_name = ""
  2219. var arr= []
  2220. if(val!=null&&val.length > 0){
  2221. for(let i=0;i<val.length;i++){
  2222. if(val[i].warehousing_id == warehousing_id){
  2223. arr.push(val[i])
  2224. }
  2225. }
  2226. }
  2227. if(arr.length > 0){
  2228. dealer_name = this.getDealerName(arr[0].xt_warehouse_info.dealer)
  2229. }
  2230. return dealer_name
  2231. },
  2232. getProductDate(val,warehousing_id){
  2233. var product_date = ""
  2234. var arr= []
  2235. if(val!=null&&val.length > 0){
  2236. for(let i=0;i<val.length;i++){
  2237. if(val[i].warehousing_id == warehousing_id){
  2238. arr.push(val[i])
  2239. }
  2240. }
  2241. }
  2242. if(arr.length > 0){
  2243. product_date = this.getTime(arr[0].product_date, "{y}-{m}-{d}")
  2244. }
  2245. return product_date
  2246. },
  2247. getExpiryDate(val,warehousing_id){
  2248. var expiry_date = ""
  2249. var arr= []
  2250. if(val!=null&&val.length > 0){
  2251. for(let i=0;i<val.length;i++){
  2252. if(val[i].warehousing_id == warehousing_id){
  2253. arr.push(val[i])
  2254. }
  2255. }
  2256. }
  2257. if(arr.length > 0){
  2258. expiry_date = this.getTime(arr[0].xt_warehouse_info.expiry_date, "{y}-{m}-{d}")
  2259. }
  2260. return expiry_date
  2261. },
  2262. getRegisterNumber(val,warehousing_id){
  2263. var register_number = ""
  2264. var arr= []
  2265. if(val!=null&&val.length > 0){
  2266. for(let i=0;i<val.length;i++){
  2267. if(val[i].warehousing_id == warehousing_id){
  2268. arr.push(val[i])
  2269. }
  2270. }
  2271. }
  2272. if(arr.length > 0){
  2273. register_number = arr[0].xt_warehouse_info.register_number
  2274. }
  2275. return register_number
  2276. },
  2277. getRemark(val,warehousing_id){
  2278. var remark = ""
  2279. var arr= []
  2280. if(val!=null&&val.length > 0){
  2281. for(let i=0;i<val.length;i++){
  2282. if(val[i].warehousing_id == warehousing_id){
  2283. arr.push(val[i])
  2284. }
  2285. }
  2286. }
  2287. if(arr.length > 0){
  2288. remark = arr[0].xt_warehouse_info.remark
  2289. }
  2290. return remark
  2291. },
  2292. getNumber(val,warehousing_id){
  2293. var number = ""
  2294. var arr= []
  2295. if(val!=null&&val.length > 0){
  2296. for(let i=0;i<val.length;i++){
  2297. if(val[i].warehousing_id == warehousing_id){
  2298. arr.push(val[i])
  2299. }
  2300. }
  2301. }
  2302. if(arr.length > 0){
  2303. number = arr[0].number
  2304. }
  2305. return number
  2306. },
  2307. // 合并单元格样式
  2308. cellStyle({ row, column, rowIndex, columnIndex }) {
  2309. let arr = [3,4,5,6,7,8,9,10,11,12,13];
  2310. if (arr.indexOf(columnIndex) > -1) {
  2311. return "spanClass";
  2312. }
  2313. },
  2314. getCancelInfo(warehousing_id,good_id){
  2315. var count =0
  2316. var arr = []
  2317. for(let i=0;i<this.cancelInfoList.length;i++){
  2318. if(this.cancelInfoList[i].patient_id >0 && warehousing_id == this.cancelInfoList[i].warehousing_id && good_id == this.cancelInfoList[i].good_id){
  2319. arr.push(this.cancelInfoList[i])
  2320. }
  2321. }
  2322. if(arr.length > 0){
  2323. for(let i=0;i<arr.length;i++){
  2324. count += arr[i].count
  2325. }
  2326. }
  2327. if(count > 0){
  2328. console.log("good_id",good_id)
  2329. console.log("数量我哦哦我",count)
  2330. return count
  2331. }else{
  2332. return 0
  2333. }
  2334. },
  2335. getRow(row){
  2336. console.log("row233323232",row)
  2337. var name = ""
  2338. if(this.stockFlowList!=null && this.stockFlowList.length > 0){
  2339. for(let i=0;i<this.stockFlowList.length;i++){
  2340. if(row.patient_id == this.stockFlowList[i].patient_id){
  2341. name = this.stockFlowList[i].name
  2342. }
  2343. }
  2344. }
  2345. return name
  2346. },
  2347. getPatientName(patient_id){
  2348. var name = ""
  2349. for(let i=0;i<this.patients.length;i++){
  2350. if(patient_id == this.patients[i].id){
  2351. name = this.patients[i].name
  2352. }
  2353. }
  2354. return name
  2355. },
  2356. GetGoodPatientName(val){
  2357. var params = {
  2358. good_id:val.good_id,
  2359. sys_record_time:val.sys_record_time,
  2360. }
  2361. getGoodPatientName(params).then(response=>{
  2362. if(response.data.state == 1){
  2363. var projectList = response.data.data.projectList
  2364. this.projectList = projectList
  2365. var outList = response.data.data.outList
  2366. this.outList = outList
  2367. this.AdviceDialogVisible= true
  2368. }
  2369. })
  2370. },
  2371. getGoodOutCount(patient_id){
  2372. var count = ""
  2373. for(let i=0;i<this.outList.length;i++){
  2374. if(patient_id == this.outList[i].patient_id){
  2375. count = this.outList[i].count
  2376. }
  2377. }
  2378. return count
  2379. }
  2380. },
  2381. };
  2382. </script>
  2383. <style rel="stylesheet/scss" lang="scss">
  2384. .app-container {
  2385. // margin: 20px;
  2386. font-size: 15px;
  2387. .filter-container {
  2388. padding-bottom: 5px;
  2389. }
  2390. .search-component {
  2391. width: 500px;
  2392. .searchBox {
  2393. width: 300px;
  2394. height: 36px;
  2395. line-height: 36px;
  2396. padding-left: 15px;
  2397. border: 1px #dcdfe6 solid;
  2398. border-right: none;
  2399. outline: none;
  2400. float: left;
  2401. border-radius: 6px 0 0 6px;
  2402. font-size: 14px;
  2403. color: #333;
  2404. background: #fff;
  2405. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  2406. }
  2407. .searchBtn {
  2408. background-color: #409eff;
  2409. color: #fff;
  2410. font-size: 15px;
  2411. text-align: center;
  2412. height: 36px;
  2413. line-height: 36px;
  2414. float: left;
  2415. outline: none;
  2416. width: 70px;
  2417. border: none;
  2418. border-radius: 0 6px 6px 0;
  2419. font-family: "Microsoft Yahei";
  2420. cursor: pointer;
  2421. }
  2422. }
  2423. .amount {
  2424. font-weight: normal;
  2425. padding: 10px 0 0 0;
  2426. color: #606266;
  2427. font-size: 14px;
  2428. span {
  2429. color: #ef2525;
  2430. font-family: "Arial";
  2431. padding: 0 2px;
  2432. }
  2433. }
  2434. }
  2435. .el-table td,
  2436. .el-table th.is-leaf,
  2437. .el-table--border,
  2438. .el-table--group {
  2439. border-color: #d0d3da;
  2440. }
  2441. .el-table--border::after,
  2442. .el-table--group::after,
  2443. .el-table::before {
  2444. background-color: #d0d3da;
  2445. }
  2446. </style>
  2447. <style>
  2448. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  2449. font-size: 12px;
  2450. }
  2451. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  2452. background: #6fb5fa;
  2453. }
  2454. .count {
  2455. color: #bd2c00;
  2456. }
  2457. .el-table td,
  2458. .el-table th.is-leaf,
  2459. .el-table--border,
  2460. .el-table--group {
  2461. border-color: #d0d3da;
  2462. }
  2463. .el-table--border::after,
  2464. .el-table--group::after,
  2465. .el-table::before {
  2466. background-color: #d0d3da;
  2467. }
  2468. /* 合并表格线样式 */
  2469. .spanClass .cell {
  2470. padding: 0 !important;
  2471. }
  2472. .spanClass .cell tr {
  2473. display: inline-block;
  2474. width: 100%;
  2475. }
  2476. .spanClass .cell tr td {
  2477. padding: 10px 0;
  2478. border-bottom: 1px solid #ebeef5;
  2479. display: block;
  2480. width: 100%;
  2481. }
  2482. .spanClass .cell tr:last-of-type td {
  2483. border-bottom: none;
  2484. }
  2485. </style>