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

stockOutOrder.vue 79KB

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