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

stockInOrder.vue 56KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
  5. <bread-crumb :crumbs="crumbs"></bread-crumb>
  6. <el-button
  7. size="small"
  8. @click="handleWarehouse"
  9. class="filter-item"
  10. style="float:right;"
  11. type="primary"
  12. icon="el-icon-circle-plus-outline"
  13. >新增</el-button
  14. >
  15. </div>
  16. <div class="app-container">
  17. <div class="cell clearfix">
  18. <label class="title"><span class="name">仓库</span> :</label>
  19. <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
  20. <el-option
  21. v-for="(option, index) in list"
  22. :key="index"
  23. :label="option.storehouse_name"
  24. :value="option.id">
  25. </el-option>
  26. </el-select>
  27. <el-input
  28. size="small"
  29. style="width: 200px;"
  30. v-model.trim="searchKey"
  31. class="filter-item"
  32. placeholder="单据编码/制单人/耗材名称"
  33. />
  34. <el-button
  35. size="small"
  36. class="filter-item"
  37. type="primary"
  38. icon="el-icon-search"
  39. @click="search"
  40. >搜索</el-button
  41. >
  42. <div style="margin-left:10px;">
  43. <label class="title"><span class="name">入库时间</span> : </label>
  44. <el-date-picker
  45. size="small"
  46. v-model="start_time"
  47. prefix-icon="el-icon-date"
  48. :editable="false"
  49. style="width: 196px;"
  50. type="date"
  51. placeholder="选择日期时间"
  52. align="right"
  53. format="yyyy-MM-dd"
  54. value-format="yyyy-MM-dd"
  55. @change="startTimeChange"
  56. ></el-date-picker>
  57. <span class="cellLine"> - </span>
  58. <el-date-picker
  59. size="small"
  60. v-model="end_time"
  61. prefix-icon="el-icon-date"
  62. :editable="false"
  63. style="width: 196px;"
  64. type="date"
  65. placeholder="选择日期时间"
  66. align="right"
  67. format="yyyy-MM-dd"
  68. value-format="yyyy-MM-dd"
  69. @change="endTimeChange"
  70. ></el-date-picker>
  71. </div>
  72. <!-- <div style="margin-left: 10px">
  73. <span>审核状态:</span>
  74. <el-select
  75. v-model="check_id"
  76. style="width: 140px; margin-right: 10px"
  77. placeholder="请选择"
  78. @change="changeTypeName"
  79. >
  80. <el-option
  81. v-for="item in checkList"
  82. :key="item.id"
  83. :label="item.name"
  84. :value="item.id"
  85. >
  86. </el-option>
  87. </el-select>
  88. </div> -->
  89. </div>
  90. <div class="cell clearfix">
  91. <el-checkbox
  92. style="width: 70px"
  93. v-model="checkAllStatus"
  94. @change="changeCheck"
  95. >全选</el-checkbox
  96. >
  97. <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
  98. <el-button size="small" type="primary" @click="toPrint">打印</el-button>
  99. <el-button size="small" type="primary" @click="toExport" @disabled="exportLoding">导出</el-button>
  100. <span>&nbsp;&nbsp;</span>
  101. <label class="title"><span class="name">审核状态</span> :</label>
  102. <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
  103. <el-option
  104. v-for="(option, index) in checkList"
  105. :key="index"
  106. :label="option.name"
  107. :value="option.id">
  108. </el-option>
  109. </el-select>
  110. </div>
  111. <el-table
  112. ref="multipleTable"
  113. :data="Warehouse.warehouseDate"
  114. :class="signAndWeighBoxPatients"
  115. style="width: 100%"
  116. border
  117. highlight-current-row
  118. v-loading="Warehouse.loading"
  119. @selection-change="select"
  120. :row-style="{ color: '#303133' }"
  121. :header-cell-style="{
  122. backgroundColor: 'rgb(245, 247, 250)',
  123. color: '#606266'
  124. }"
  125. @current-change="handleSearch"
  126. >
  127. <el-table-column align="center" type="selection" width="55">
  128. </el-table-column>
  129. <el-table-column label="单据日期" align="center">
  130. <template slot-scope="scope">
  131. {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="单据编号" align="center">
  135. <template slot-scope="scope">
  136. {{ scope.row.warehousing_order }}
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="仓库名称" align="center">
  140. <template slot-scope="scope">
  141. {{getHouseName(scope.row.storehouse_id)}}
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="制单人" align="center">
  145. <template slot-scope="scope">
  146. {{ getXuserName(scope.row.creater) }}
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="审核人" align="center" v-if="org_id == 3877 || org_id == 10318">
  150. <template slot-scope="scope">
  151. {{ getXuserName(scope.row.checker) }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="入库方式" align="center">
  155. <template slot-scope="scope">
  156. <span v-if="scope.row.is_sys == 12">调拨入库</span>
  157. <span v-if="scope.row.is_sys == 0">手动入库</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="审核状态" align="center">
  161. <template slot-scope="scope">
  162. <span v-if="scope.row.is_check == 1">已审核</span>
  163. <span v-if="scope.row.is_check == 2">未审核</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="操作" align="center" width="260px">
  167. <template slot-scope="scope">
  168. <el-tooltip
  169. class="item"
  170. effect="dark"
  171. content="编辑"
  172. placement="top"
  173. >
  174. <el-button
  175. size="small"
  176. type="primary"
  177. icon="el-icon-edit-outline"
  178. @click="handleEdit(scope.$index, scope.row)"
  179. >
  180. </el-button>
  181. </el-tooltip>
  182. <el-tooltip
  183. class="item"
  184. effect="dark"
  185. content="删除"
  186. placement="top"
  187. >
  188. <el-button
  189. size="small"
  190. type="danger"
  191. icon="el-icon-delete"
  192. @click="handleDelete(scope.$index, scope.row)"
  193. >
  194. </el-button>
  195. </el-tooltip>
  196. </template>
  197. </el-table-column>
  198. </el-table>
  199. <el-pagination
  200. @size-change="handleSizeChange"
  201. @current-change="handleCurrentChange"
  202. :page-sizes="[5, 10, 50, 100]"
  203. :page-size="5"
  204. background
  205. style="margin-top:20px;text-align: right"
  206. layout="total, sizes, prev, pager, next, jumper"
  207. :total="total"
  208. >
  209. </el-pagination>
  210. <div v-show="tableShow" style="margin-top:10px;">
  211. <el-table
  212. :data="tableList"
  213. :class="signAndWeighBoxPatients"
  214. style="width: 100%"
  215. border
  216. highlight-current-row
  217. v-loading="Warehouse.loading"
  218. @selection-change="select"
  219. :row-style="{ color: '#303133' }"
  220. :header-cell-style="{
  221. backgroundColor: 'rgb(245, 247, 250)',
  222. color: '#606266'
  223. }"
  224. fit
  225. >
  226. <el-table-column label="耗材名称" align="center">
  227. <template slot-scope="scope">
  228. <span v-if="scope.row.is_total == 0">
  229. {{ scope.row.GoodInfo.good_name }}
  230. </span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column label="耗材类型" align="center">
  234. <template slot-scope="scope">
  235. <span v-if="scope.row.is_total ==0">
  236. {{ getTypeName(scope.row.GoodInfo.good_type_id)}}
  237. </span>
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="规格&单位" align="center">
  241. <template slot-scope="scope">
  242. <span v-if="scope.row.is_total == 0">
  243. {{ scope.row.GoodInfo.specification_name}} / {{scope.row.GoodInfo.packing_unit}}
  244. </span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="国家编码" align="center">
  248. <template slot-scope="scope">
  249. <span v-if="scope.row.is_total == 0">
  250. {{ scope.row.GoodInfo.social_security_directory_code}}
  251. </span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="批号" align="center">
  255. <template slot-scope="scope">
  256. <span v-if="scope.row.is_total== 0">
  257. {{ scope.row.number}}
  258. </span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="仓库名称" align="center">
  262. <template slot-scope="scope">
  263. <span v-if="scope.row.is_total == 0">
  264. {{getHouseName(scope.row.storehouse_id)}}
  265. </span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="入库数量" align="center">
  269. <template slot-scope="scope">
  270. <span v-if="scope.row.is_total == 0">{{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}} </span>
  271. </template>
  272. </el-table-column>
  273. <!-- <el-table-column label="零售价" align="center">
  274. <template slot-scope="scope">
  275. {{ scope.row.packing_price}}
  276. </template>
  277. </el-table-column> -->
  278. <el-table-column label="进货价" align="center">
  279. <template slot-scope="scope">
  280. <span v-if="scope.row.is_total == 0">
  281. {{ scope.row.price}}
  282. </span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="总价" align="center">
  286. <template slot-scope="scope">
  287. <span v-if="scope.row.is_total==0">
  288. {{ (scope.row.warehousing_count * scope.row.price).toFixed(2)}}
  289. </span>
  290. <span v-if="scope.row.is_total== 1">
  291. {{(scope.row.total_count).toFixed(2)}}
  292. </span>
  293. </template>
  294. </el-table-column>
  295. <el-table-column label="生产厂家" align="center">
  296. <template slot-scope="scope">
  297. <span v-if="scope.row.is_total == 0">
  298. {{ getManufactuerName(scope.row.manufacturer)}}
  299. </span>
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="生产日期" align="center">
  303. <template slot-scope="scope">
  304. <span v-if="scope.row.is_total == 0">
  305. {{ getTime(scope.row.product_date,"{y}-{m}-{d}")}}
  306. </span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="有效期" align="center">
  310. <template slot-scope="scope">
  311. <span v-if="scope.row.is_total == 0">
  312. {{ getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
  313. </span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column label="经销商" align="center">
  317. <template slot-scope="scope">
  318. <span v-if="scope.row.is_total == 0">
  319. {{ getDealerName(scope.row.dealer)}}
  320. </span>
  321. </template>
  322. </el-table-column>
  323. <el-table-column label="批准文号" align="center">
  324. <template slot-scope="scope">
  325. <span v-if="scope.row.is_total ==0"> {{ scope.row.license_number}}</span>
  326. </template>
  327. </el-table-column>
  328. <el-table-column label="注册编码" align="center">
  329. <template slot-scope="scope">
  330. <span v-if="scope.row.is_total == 0">
  331. {{ scope.row.register_number}}
  332. </span>
  333. </template>
  334. </el-table-column>
  335. <el-table-column label="备注" align="center">
  336. <template slot-scope="scope">
  337. <span v-if="scope.row.is_total == 0">
  338. {{ scope.row.remark }}
  339. </span>
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. </div>
  344. </div>
  345. <el-dialog
  346. title="详情"
  347. :visible.sync="dialogVisible"
  348. width="80%"
  349. >
  350. <span>
  351. <div>
  352. <el-row>
  353. <span style="font-size: 18px;color: #606266">入库单详情</span>
  354. </el-row>
  355. <el-row style="float:left;">
  356. <span style="color: #606266"
  357. >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
  358. >
  359. </el-row>
  360. </div>
  361. <div class="cell clearfix">
  362. <span style="width: 300px;color: #606266;float:right">单据日期:{{ WarehouseInfo.warehouse.warehousing_time | parseTime("{y}-{m}-{d}")}} </span>
  363. <span style="width: 300px;color: #606266;float:right">厂商:{{ getManufactuerName(WarehouseInfo.warehouse.manufacturer) }}</span>
  364. <span style="width: 300px;color: #606266"
  365. >经销商:{{ getDealerName(WarehouseInfo.warehouse.dealer) }} </span>
  366. </div>
  367. <div class="cell clearfix" style="margin-top: 10px">
  368. <el-button size="small" icon="el-icon-edit" @click="editRecord"
  369. >编辑</el-button
  370. >
  371. <el-button size="small" icon="el-icon-delete" @click="deleteRecord"
  372. >删除</el-button
  373. >
  374. <el-row :gutter="12" style="margin-top: 10px">
  375. <el-table
  376. :data="WarehouseInfo.warehouseInfoDate"
  377. :class="signAndWeighBoxPatients"
  378. style="width: 100%"
  379. border
  380. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  381. >
  382. <el-table-column min-width="35" align="center">
  383. <template slot="header" slot-scope="scope">
  384. <span>耗材类型</span>
  385. </template>
  386. <template slot-scope="scope">
  387. <span v-if="scope.row.good_type_id != 0">{{
  388. getTypeName(scope.row.good_type_id)
  389. }}</span>
  390. </template>
  391. </el-table-column>
  392. <el-table-column min-width="35" align="center">
  393. <template slot="header" slot-scope="scope">
  394. <span>耗材名称</span>
  395. </template>
  396. <template slot-scope="scope">
  397. <span v-if="scope.row.good_id != 0">{{
  398. getTypeNameOne(scope.row.good_id)
  399. }}</span>
  400. </template>
  401. </el-table-column>
  402. <el-table-column min-width="35" align="center">
  403. <template slot="header" slot-scope="scope">
  404. <span>规格型号</span>
  405. </template>
  406. <template slot-scope="scope">
  407. <span v-if="scope.row.good_id != 0">{{
  408. getSpecificationName(scope.row.good_id)
  409. }}</span>
  410. </template>
  411. </el-table-column>
  412. <el-table-column min-width="23" align="center">
  413. <template slot="header" slot-scope="scope">
  414. <span>进货价</span>
  415. </template>
  416. <template slot-scope="scope">
  417. <span>{{ scope.row.price }}</span>
  418. </template>
  419. </el-table-column>
  420. <el-table-column min-width="23" align="center">
  421. <template slot="header" slot-scope="scope">
  422. <span>入库数量</span>
  423. </template>
  424. <template slot-scope="scope">
  425. <span>{{ scope.row.warehousing_count }}</span>
  426. </template>
  427. </el-table-column>
  428. <el-table-column label="总价" min-width="20" align="center">
  429. <template slot-scope="scope">
  430. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  431. </template>
  432. </el-table-column>
  433. <el-table-column align="center" min-width="25">
  434. <template slot="header" slot-scope="scope">
  435. <span>批号</span>
  436. </template>
  437. <template slot-scope="scope">
  438. <span>{{ scope.row.number }}</span>
  439. </template>
  440. </el-table-column>
  441. <el-table-column label="生产日期" min-width="40" align="center">
  442. <template v-if="scope.row.product_date != 0" slot-scope="scope">
  443. {{ scope.row.product_date }}
  444. </template>
  445. </el-table-column>
  446. <el-table-column label="有效日期" min-width="40" align="center">
  447. <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
  448. {{ scope.row.expiry_date }}
  449. </template>
  450. </el-table-column>
  451. <el-table-column label="备注" min-width="20" align="center">
  452. <template slot-scope="scope">
  453. <el-popover placement="top-start" width="250" trigger="hover">
  454. <div>{{ scope.row.remark }}</div>
  455. <span slot="reference" v-if="scope.row.remark.length > 20">{{
  456. scope.row.remark.substr(0, 20) + "..."
  457. }}</span>
  458. <span slot="reference" v-else>{{ scope.row.remark }}</span>
  459. </el-popover>
  460. </template>
  461. </el-table-column>
  462. </el-table>
  463. </el-row>
  464. </div>
  465. </span>
  466. <span slot="footer" class="dialog-footer">
  467. <el-button @click="dialogVisible = false">取 消</el-button>
  468. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  469. </span>
  470. </el-dialog>
  471. <el-dialog
  472. title="新增"
  473. :visible.sync="editDialogVisible"
  474. width="80%"
  475. >
  476. <span>
  477. <div style="margin-bottom:10px">
  478. <label class="title"><span class="name">入库时间</span> : </label>
  479. <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
  480. style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  481. value-format="yyyy-MM-dd"></el-date-picker>
  482. <label class="title" style="margin-left:10px;"><span class="name">经 销 商</span> : </label>
  483. <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
  484. <el-option
  485. v-for="(option, index) in dealer"
  486. :key="index"
  487. :label="option.dealer_name"
  488. :value="option.id">
  489. </el-option>
  490. </el-select>
  491. <label class="title" style="margin-left:10px;"><span class="name">厂商</span> : </label>
  492. <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
  493. <el-option
  494. v-for="(option, index) in manufacturer"
  495. :key="index"
  496. :label="option.manufacturer_name"
  497. :value="option.id">
  498. </el-option>
  499. </el-select>
  500. </div>
  501. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  502. <el-table
  503. id="oictable"
  504. :data="recordInfo.recordData"
  505. :class="signAndWeighBoxPatients"
  506. style="width: 100%"
  507. border
  508. max-height="450"
  509. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  510. >
  511. <el-table-column align="center" width="200">
  512. <template slot="header" slot-scope="scope">
  513. <span>商品类型<span style="color: red">*</span></span>
  514. </template>
  515. <template slot-scope="scope">
  516. <el-form-item style="padding-top: 15px">
  517. <el-input
  518. placeholder="请输入商品类型"
  519. v-model="scope.row.good_type_id"
  520. :value="typeName(scope.row.good_type_id)"
  521. @focus="showDialog(scope.$index, scope.row)"
  522. ></el-input>
  523. </el-form-item>
  524. </template>
  525. </el-table-column>
  526. <el-table-column align="center" width="200">
  527. <template slot="header" slot-scope="scope">
  528. <span>规格名称<span style="color: red">*</span></span>
  529. </template>
  530. <template slot-scope="scope">
  531. <el-form-item style="padding-top: 15px">
  532. <el-input
  533. placeholder="请输入规格名称"
  534. v-model="scope.row.good_id"
  535. :value="specificationName(scope.row.good_id)"
  536. @focus="showDialog(scope.$index, scope.row)"
  537. ></el-input>
  538. </el-form-item>
  539. </template>
  540. </el-table-column>
  541. <el-table-column align="center" width="150">
  542. <template slot="header" slot-scope="scope">
  543. <span>单价<span style="color: red">*</span></span>
  544. </template>
  545. <template slot-scope="scope">
  546. <!--<el-input type="number" v-model="scope.row.price" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
  547. <el-form-item
  548. :prop="'recordData.' + scope.$index + '.price'"
  549. :rules="tableRules.price"
  550. style="padding-top: 17px"
  551. >
  552. <el-input
  553. placeholder="请输入单价"
  554. type="number"
  555. v-model="scope.row.price"
  556. ></el-input>
  557. </el-form-item>
  558. </template>
  559. </el-table-column>
  560. <el-table-column align="center" width="180">
  561. <template slot="header" slot-scope="scope">
  562. <span>入库数量<span style="color: red">*</span></span>
  563. </template>
  564. <template slot-scope="scope">
  565. <!--{{scope.row.warehousing_count}}-->
  566. <!--<el-input type="number" v-model="scope.row.warehousing_count" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
  567. <el-form-item
  568. :prop="'recordData.' + scope.$index + '.warehousing_count'"
  569. :rules="tableRules.warehousing_count"
  570. style="padding-top: 17px"
  571. >
  572. <el-input
  573. placeholder="请输入入库数量"
  574. type="number"
  575. v-model="scope.row.warehousing_count"
  576. ></el-input>
  577. </el-form-item>
  578. </template>
  579. </el-table-column>
  580. <el-table-column label="总价" align="center" width="150">
  581. <template slot-scope="scope">
  582. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  583. </template>
  584. </el-table-column>
  585. <el-table-column align="center" width="150">
  586. <template slot="header" slot-scope="scope">
  587. <span>批号</span>
  588. </template>
  589. <template slot-scope="scope">
  590. <el-form-item style="padding-top: 15px">
  591. <el-input
  592. placeholder="请输入批号"
  593. v-model="scope.row.number"
  594. ></el-input>
  595. </el-form-item>
  596. </template>
  597. </el-table-column>
  598. <el-table-column label="生产日期" width="250" align="center">
  599. <template slot-scope="scope">
  600. <el-date-picker
  601. prefix-icon="el-icon-date"
  602. style="width: 145px"
  603. v-model="scope.row.product_date"
  604. type="date"
  605. placeholder="选择日期时间"
  606. format="yyyy-MM-dd"
  607. value-format="yyyy-MM-dd"
  608. ></el-date-picker>
  609. </template>
  610. </el-table-column>
  611. <el-table-column label="有效日期" width="250" align="center">
  612. <template slot-scope="scope">
  613. <el-date-picker
  614. prefix-icon="el-icon-date"
  615. style="width: 145px"
  616. v-model="scope.row.expiry_date"
  617. type="date"
  618. placeholder="选择日期时间"
  619. format="yyyy-MM-dd"
  620. value-format="yyyy-MM-dd"
  621. ></el-date-picker>
  622. </template>
  623. </el-table-column>
  624. <el-table-column label="备注" width="150" align="center">
  625. <template slot-scope="scope">
  626. <el-input v-model="scope.row.remark"></el-input>
  627. </template>
  628. </el-table-column>
  629. <el-table-column
  630. label="操作"
  631. fixed="right"
  632. align="center"
  633. width="150"
  634. >
  635. <template slot-scope="scope">
  636. <el-tooltip
  637. class="item"
  638. effect="dark"
  639. content="新增"
  640. placement="top"
  641. >
  642. <el-button
  643. size="mini"
  644. type="primary"
  645. icon="el-icon-circle-plus-outline"
  646. @click="handleEditTwo(scope.$index, scope.row)"
  647. >
  648. </el-button>
  649. </el-tooltip>
  650. <el-tooltip
  651. class="item"
  652. effect="dark"
  653. content="删除"
  654. placement="top"
  655. >
  656. <el-button
  657. size="mini"
  658. type="danger"
  659. icon="el-icon-delete"
  660. @click="DeleteWarehouseInfoItem(scope.$index, scope.row)"
  661. >
  662. </el-button>
  663. </el-tooltip>
  664. </template>
  665. </el-table-column>
  666. </el-table>
  667. </el-form>
  668. </span>
  669. <span slot="footer" class="dialog-footer">
  670. <el-button @click="editDialogVisible = false">取 消</el-button>
  671. <el-button type="primary" @click="submit()">保 存</el-button>
  672. </span>
  673. </el-dialog>
  674. <stock-in-dialog
  675. ref="dialog"
  676. :propForm="propForm"
  677. :visibility="isVisibility"
  678. v-on:dialog-comfirm="comfirm"
  679. v-on:dialog-cancle="cancle">
  680. </stock-in-dialog>
  681. </div>
  682. </template>
  683. <script>
  684. import stockInDialog from "./Dialog/stockInDialog";
  685. import { uParseTime } from "@/utils/tools";
  686. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  687. import {
  688. deleteWarehouseInfo,
  689. GetAllConfig,
  690. GetAllGoodInfo,
  691. GetAllGoodType,
  692. getWarehouseInfoList,
  693. getWarehouseList,
  694. DeleteWarehouseInfoItem,
  695. GetAllGoodInfoByID,
  696. EditWarehouse,
  697. getExportStockList
  698. } from "@/api/stock";
  699. import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
  700. import BreadCrumb from "../components/bread-crumb";
  701. export default {
  702. name: "stockIn",
  703. components: { BreadCrumb, stockInDialog },
  704. created() {
  705. var nowDate = new Date();
  706. var nowYear = nowDate.getFullYear();
  707. var nowMonth = nowDate.getMonth() + 1;
  708. var nowDay = nowDate.getDate();
  709. this.end_time =
  710. nowYear +
  711. "-" +
  712. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  713. "-" +
  714. (nowDay < 10 ? "0" + nowDay : nowDay);
  715. nowDate.setMonth(nowDate.getMonth() - 1);
  716. nowYear = nowDate.getFullYear();
  717. nowMonth = nowDate.getMonth() + 1;
  718. nowDay = nowDate.getDate();
  719. this.start_time =
  720. nowYear +
  721. "-" +
  722. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  723. "-" +
  724. (nowDay < 10 ? "0" + nowDay : nowDay);
  725. this.org_id = this.$store.getters.xt_user.org.id
  726. this.GetWarehouse();
  727. this.GetConfigInfo();
  728. this.fetchAllAdminUsers();
  729. this.GetAllGoodType()
  730. this.GetAllGoodInfo()
  731. },
  732. data() {
  733. var checkGoodId = (rule, value, callback) => {
  734. setTimeout(() => {
  735. if (value == "" || value == 0) {
  736. return callback(new Error("规格名称不能为空"));
  737. }
  738. }, 2000);
  739. };
  740. return {
  741. crumbs: [
  742. { path: false, name: "库存管理" },
  743. { path: false, name: "入库单" }
  744. ],
  745. searchKey: "",
  746. type: 1,
  747. page: 1,
  748. limit: 5,
  749. checked: false,
  750. total: 0,
  751. pageTotal: 0,
  752. pageSelect: 0,
  753. adminUserOptions: [],
  754. multipleSelection: [],
  755. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  756. start_time: "",
  757. end_time: "",
  758. goodType: [],
  759. goodInfo: [],
  760. manufacturer: [],
  761. selectedTableData: [],
  762. dealer: [],
  763. Warehouse: {
  764. loading: false,
  765. warehouseDate: [],
  766. tableCurrentIndex: ""
  767. },
  768. WarehouseInfo: {
  769. loading: false,
  770. warehouseInfoDate: [],
  771. warehouse: {}
  772. },
  773. startTime: "",
  774. dialogVisible:false,
  775. editDialogVisible:false,
  776. recordInfo: {
  777. recordData: [],
  778. stock_in_code: "",
  779. current_index: ""
  780. },
  781. tableRules: {
  782. price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
  783. warehousing_count: [
  784. { required: true, message: "数量不能为空", trigge: "blur" }
  785. ],
  786. good_id: [{ validator: checkGoodId, trigger: "blur" }]
  787. },
  788. form: {
  789. manufacturer:0,
  790. dealer:0
  791. },
  792. warehousing_time: '',
  793. warehouse:{},
  794. propForm: {
  795. goods: [],
  796. goodType: [],
  797. goodInfo: [],
  798. goodUnit: [],
  799. title: '入库',
  800. formValue: {
  801. good_type_id: '',
  802. good_id: '',
  803. number: '',
  804. product_date: '',
  805. expiry_date: '',
  806. warehousing_count: '',
  807. price: '',
  808. remark: '',
  809. dealer: '',
  810. manufacturer: ''
  811. },
  812. isCreated: 1,
  813. isVisibility: false,
  814. drug_id:1,
  815. },
  816. drug_id:1,
  817. tableShow:false,
  818. tableList:[],
  819. isVisibility:false,
  820. order_id:0,
  821. exportList:[],
  822. checkAllStatus:false,
  823. list:[],
  824. storehouse_id:0,
  825. check_type:0,
  826. checkList:[
  827. {id:0,name:"全部"},
  828. {id:1,name:"已审核"},
  829. {id:2,name:"未审核"},
  830. ],
  831. check_id: 0,
  832. exportLoding:false,
  833. org_id:0
  834. };
  835. },
  836. methods: {
  837. changeTypeName() {
  838. this.getlist();
  839. },
  840. getlist() {
  841. var params = {
  842. check_id: this.check_id,
  843. start_time: this.start_time,
  844. end_time: this.end_time,
  845. keyword: this.keywords,
  846. page: this.page,
  847. limit: this.limit,
  848. };
  849. getAllSecondOrderList(params).then((response) => {
  850. if (response.data.state == 1) {
  851. var list = response.data.data.list;
  852. this.tableList = list;
  853. var total = response.data.data.total;
  854. this.total = total;
  855. this.houseList = response.data.data.houseList;
  856. this.doctorList = response.data.data.doctorList;
  857. }
  858. });
  859. },
  860. changeCheckType(){
  861. this.GetWarehouse()
  862. },
  863. changeCheck() {
  864. this.$refs.multipleTable.clearSelection();
  865. if (this.checkAllStatus) {
  866. this.$refs.multipleTable.toggleAllSelection();
  867. }
  868. },
  869. search: function() {
  870. const Params = {
  871. page: this.page,
  872. limit: this.limit,
  873. start_time: this.start_time,
  874. end_time: this.end_time,
  875. type: this.type,
  876. keywords: this.searchKey,
  877. storehouse_id:this.storehouse_id,
  878. check_type:this.check_type,
  879. };
  880. this.Warehouse.warehouseDate = [];
  881. getWarehouseList(Params).then(response => {
  882. if (response.data.state == 0) {
  883. this.Warehouse.loading = false;
  884. this.$message.error(response.data.msg);
  885. return false;
  886. } else {
  887. this.Warehouse.loading = false;
  888. this.total = response.data.data.total;
  889. for (let i = 0; i < response.data.data.list.length; i++) {
  890. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  891. }
  892. }
  893. });
  894. },
  895. GetWarehouse: function() {
  896. const Params = {
  897. page: this.page,
  898. limit: this.limit,
  899. start_time: this.start_time,
  900. end_time: this.end_time,
  901. type: this.type,
  902. keywords: this.searchKey,
  903. storehouse_id:this.storehouse_id,
  904. check_type:this.check_type,
  905. };
  906. this.Warehouse.warehouseDate = [];
  907. getWarehouseList(Params).then(response => {
  908. if (response.data.state == 0) {
  909. this.Warehouse.loading = false;
  910. this.$message.error(response.data.msg);
  911. return false;
  912. } else {
  913. this.Warehouse.loading = false;
  914. this.total = response.data.data.total;
  915. for (let i = 0; i < response.data.data.list.length; i++) {
  916. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  917. }
  918. this.list = []
  919. var obj = {id:0,storehouse_name:"全部"}
  920. this.list.push(obj)
  921. for(let i=0;i<response.data.data.houselist.length;i++){
  922. this.list.push(response.data.data.houselist[i])
  923. }
  924. }
  925. });
  926. },
  927. tableRowClassName({ row, rowIndex }) {
  928. // 把每一行的索引放进row
  929. row.index = rowIndex;
  930. },
  931. onRowClick(row, event, column) {
  932. this.WarehouseInfo.warehouseInfoDate = [];
  933. this.Warehouse.tableCurrentIndex = row.index;
  934. const params = {
  935. id: row.id
  936. };
  937. this.WarehouseInfo.loading = true;
  938. getWarehouseInfoList(params).then(response => {
  939. if (response.data.state == 0) {
  940. this.WarehouseInfo.loading = false;
  941. this.$message.error(response.data.msg);
  942. return false;
  943. } else {
  944. this.WarehouseInfo.loading = false;
  945. for (let i = 0; i < response.data.data.info.length; i++) {
  946. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  947. }
  948. }
  949. });
  950. },
  951. getXuserName(id) {
  952. if (id <= 0) {
  953. return "";
  954. }
  955. var name = "";
  956. if (
  957. this.adminUserOptions == null ||
  958. typeof this.adminUserOptions.length === "undefined"
  959. ) {
  960. return name;
  961. }
  962. var leng = this.adminUserOptions.length;
  963. if (leng == 0) {
  964. return name;
  965. }
  966. for (let index = 0; index < leng; index++) {
  967. if (this.adminUserOptions[index].id == id) {
  968. name = this.adminUserOptions[index].name;
  969. break;
  970. }
  971. }
  972. return name;
  973. },
  974. fetchAllDoctorAndNurse() {
  975. fetchAllDoctorAndNurse().then(response => {
  976. if (response.data.state == 1) {
  977. this.doctorOptions = response.data.data.doctors;
  978. }
  979. });
  980. },
  981. fetchAllAdminUsers() {
  982. fetchAllAdminUsers().then(response => {
  983. if (response.data.state == 1) {
  984. this.adminUserOptions = response.data.data.users;
  985. var alen = this.adminUserOptions.length;
  986. for (let index = 0; index < alen; index++) {
  987. if (this.adminUserOptions[index].user_type == 2) {
  988. // this.doctorOptions.push(this.adminUserOptions[index]);
  989. }
  990. }
  991. }
  992. });
  993. },
  994. getSpecificationName: function(id) {
  995. let name = "";
  996. for (let i = 0; i < this.goodInfo.length; i++) {
  997. if (this.goodInfo[i].id == id) {
  998. name = this.goodInfo[i].specification_name;
  999. }
  1000. }
  1001. return name;
  1002. },
  1003. getTypeName: function(id) {
  1004. let name = "";
  1005. for (let i = 0; i < this.goodType.length; i++) {
  1006. if (this.goodType[i].id == id) {
  1007. name = this.goodType[i].type_name;
  1008. }
  1009. }
  1010. return name;
  1011. },
  1012. getTypeNameOne:function(id){
  1013. let name = "";
  1014. for (let i = 0; i < this.goodInfo.length; i++) {
  1015. if (this.goodInfo[i].id == id) {
  1016. name = this.goodInfo[i].good_name;
  1017. }
  1018. }
  1019. return name;
  1020. },
  1021. GetAllGoodType: function() {
  1022. GetAllGoodType().then(response => {
  1023. if (response.data.state == 0) {
  1024. this.$message.error(response.data.msg);
  1025. return false;
  1026. } else {
  1027. for (let i = 0; i < response.data.data.goodType.length; i++) {
  1028. this.goodType.push(response.data.data.goodType[i]);
  1029. }
  1030. }
  1031. });
  1032. },
  1033. GetAllGoodInfo: function() {
  1034. GetAllGoodInfo().then(response => {
  1035. if (response.data.state == 0) {
  1036. this.$message.error(response.data.msg);
  1037. return false;
  1038. } else {
  1039. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  1040. this.goodInfo.push(response.data.data.goodInfo[i]);
  1041. }
  1042. }
  1043. });
  1044. },
  1045. clicks: function() {
  1046. },
  1047. handleWarehouse: function() {
  1048. this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
  1049. },
  1050. handleReturnSales: function() {
  1051. // this.$router.push({path:'/patients/create'}
  1052. if (this.multipleSelection.length <= 0) {
  1053. this.$message.error("请选择退货商品");
  1054. return;
  1055. }
  1056. const ids = [];
  1057. for (let i = 0; i < this.multipleSelection.length; i++) {
  1058. ids.push(this.multipleSelection[i].id);
  1059. }
  1060. this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
  1061. },
  1062. handleReturnSalesRecord: function() {
  1063. this.$router.push({ name: "salesReutrnRecord" });
  1064. },
  1065. handleWarehouseRecord: function() {
  1066. this.$router.push({ name: "warehouseRecord" });
  1067. },
  1068. handleSelectionChange: function(val) {
  1069. this.multipleSelection = val;
  1070. },
  1071. handleSizeChange(val) {
  1072. this.limit = val;
  1073. this.GetWarehouse();
  1074. },
  1075. handleCurrentChange(val) {
  1076. this.page = val;
  1077. this.GetWarehouse();
  1078. },
  1079. startTimeChange(val) {
  1080. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  1081. if (time > 0) {
  1082. this.$message.error("结束时间不能小于开始时间");
  1083. this.start_time = "";
  1084. } else {
  1085. this.startTime = this.getTimestamp(val);
  1086. this.GetWarehouse();
  1087. this.getlist()
  1088. }
  1089. },
  1090. endTimeChange(val) {
  1091. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  1092. if (time < 0) {
  1093. this.$message.error("结束时间不能小于开始时间");
  1094. this.end_time = "";
  1095. } else {
  1096. this.GetWarehouse();
  1097. this.getlist()
  1098. }
  1099. },
  1100. getTimestamp(time) {
  1101. // 把时间日期转成时间戳
  1102. return new Date(time).getTime() / 1000;
  1103. },
  1104. getTime(val, temp) {
  1105. if (val != 0) {
  1106. return uParseTime(val, temp);
  1107. } else {
  1108. return "";
  1109. }
  1110. },
  1111. calculate: function(val) {
  1112. return Math.round(parseFloat(val) * 100) / 100;
  1113. },
  1114. GetConfigInfo: function() {
  1115. GetAllConfig().then(response => {
  1116. if (response.data.state == 0) {
  1117. this.$message.error(response.data.msg);
  1118. return false;
  1119. } else {
  1120. this.manufacturer = response.data.data.manufacturer;
  1121. this.dealer = response.data.data.dealer;
  1122. // this.list = response.data.data.list
  1123. this.getlist()
  1124. }
  1125. });
  1126. },
  1127. getManufactuerName: function(manufacturer_id) {
  1128. for (let i = 0; i < this.manufacturer.length; i++) {
  1129. if (this.manufacturer[i].id == manufacturer_id) {
  1130. return this.manufacturer[i].manufacturer_name;
  1131. }
  1132. }
  1133. },
  1134. getDealerName: function(dealer_id) {
  1135. for (let i = 0; i < this.dealer.length; i++) {
  1136. if (this.dealer[i].id == dealer_id) {
  1137. return this.dealer[i].dealer_name;
  1138. }
  1139. }
  1140. },
  1141. handleEdit: function(index, row) {
  1142. this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id+"&is_sys="+row.is_sys+"&is_check="+row.is_check+"&type="+row.type})
  1143. },
  1144. handleDelete: function(index, row) {
  1145. if(row.is_sys== 12){
  1146. this.$message.error("调拨入库数据不能删除!")
  1147. return false
  1148. }
  1149. if(row.supply_warehouse_id > 0){
  1150. this.$message.error("采购入库单不能删除!")
  1151. return false
  1152. }
  1153. if(row.is_check == 1){
  1154. this.$message.error("已审核的单据不能删除!")
  1155. return false
  1156. }
  1157. const ids = [];
  1158. ids.push(row.id);
  1159. const idStr = ids.join(",");
  1160. const params = {
  1161. ids: idStr
  1162. };
  1163. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  1164. confirmButtonText: "确定",
  1165. cancelButtonText: "取消",
  1166. type: "warning"
  1167. })
  1168. .then(() => {
  1169. deleteWarehouseInfo(params).then(response => {
  1170. if (response.data.state == 0) {
  1171. this.$message.error(response.data.msg);
  1172. return false;
  1173. } else {
  1174. this.$notify({
  1175. title: "成功",
  1176. message: "删除成功",
  1177. type: "success",
  1178. duration: 2000
  1179. });
  1180. for (let i = 0; i < ids.length; i++) {
  1181. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  1182. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  1183. this.Warehouse.warehouseDate.splice(y, 1);
  1184. }
  1185. }
  1186. }
  1187. }
  1188. });
  1189. })
  1190. .catch(() => {});
  1191. },
  1192. select(selection) {
  1193. var ids= []
  1194. for(let i=0;i<selection.length;i++){
  1195. ids.push(selection[i].id)
  1196. }
  1197. this.exportList = []
  1198. var str = ids.join(",")
  1199. this.order_id = str
  1200. this.selectedTableData = selection;
  1201. this.getlist()
  1202. },
  1203. batchDelete() {
  1204. if (this.selectedTableData.length <= 0) {
  1205. this.$message.error("请选择要删除的记录");
  1206. return;
  1207. }
  1208. const ids = [];
  1209. const idOne = []
  1210. for (let i = 0; i < this.selectedTableData.length; i++) {
  1211. if(this.selectedTableData[i].is_check == 1){
  1212. this.$message.error("已审核单据不能删除!")
  1213. return false
  1214. }
  1215. if(this.selectedTableData[i].is_sys ==12){
  1216. this.$message.error("调拨入库数据不能删除!")
  1217. return false
  1218. }
  1219. ids.push(this.selectedTableData[i].id);
  1220. if(this.selectedTableData[i].supply_warehouse_id >0){
  1221. idOne.push(this.selectedTableData[i].supply_warehouse_id)
  1222. }
  1223. }
  1224. for(let i=0;i<idOne.length;i++){
  1225. if(idOne[i] >0){
  1226. this.$message.error("采购入库数据不能删除!")
  1227. return false
  1228. }
  1229. }
  1230. const idStr = ids.join(",");
  1231. const params = {
  1232. ids: idStr
  1233. };
  1234. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  1235. confirmButtonText: "确定",
  1236. cancelButtonText: "取消",
  1237. type: "warning"
  1238. }).then(() => {
  1239. deleteWarehouseInfo(params).then(response => {
  1240. if (response.data.state == 0) {
  1241. this.$message.error(response.data.msg);
  1242. return false;
  1243. } else {
  1244. this.$notify({
  1245. title: "成功",
  1246. message: "删除成功",
  1247. type: "success",
  1248. duration: 2000
  1249. });
  1250. for (let i = 0; i < ids.length; i++) {
  1251. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  1252. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  1253. this.Warehouse.warehouseDate.splice(y, 1);
  1254. }
  1255. }
  1256. }
  1257. }
  1258. });
  1259. })
  1260. .catch(() => {});
  1261. },
  1262. // handleSearch(id){
  1263. // this.WarehouseInfo.warehouseInfoDate = [];
  1264. // this.GetOrderDetail(id)
  1265. // this.drug_id = id
  1266. // this.dialogVisible = true
  1267. // },
  1268. handleSearch(val){
  1269. this.tableList= []
  1270. this.GetOrderDetail(val.id)
  1271. this.drug_id = val.id
  1272. },
  1273. GetOrderDetail: function(id) {
  1274. const params = {
  1275. id: id
  1276. };
  1277. getWarehouseInfoList(params).then(response => {
  1278. if (response.data.state == 0) {
  1279. this.$message.error(response.data.msg);
  1280. return false;
  1281. } else {
  1282. this.tableShow = true
  1283. var obj = {name:"总计",total_count:0,is_total:1}
  1284. for (let i = 0; i < response.data.data.info.length; i++) {
  1285. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  1286. response.data.data.info[i].price = response.data.data.info[i].price.toString();
  1287. response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
  1288. this.recordInfo.recordData.push(response.data.data.info[i]);
  1289. console.log("tablelist+++==+",this.tableList)
  1290. response.data.data.info[i].total_count = (response.data.data.info[i].warehousing_count * response.data.data.info[i].price).toFixed(2)
  1291. response.data.data.info[i].is_total = 0
  1292. obj.total_count += (response.data.data.info[i].warehousing_count * response.data.data.info[i].price)
  1293. this.tableList.push(response.data.data.info[i])
  1294. }
  1295. this.tableList.push(obj)
  1296. this.warehouse = response.data.data.warehousing;
  1297. this.warehousing_time = this.getTime(this.warehouse.warehousing_time,"{y}-{m}-{d}");
  1298. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  1299. }
  1300. });
  1301. },
  1302. editRecord: function() {
  1303. this.editDialogVisible = true
  1304. },
  1305. deleteRecord: function() {
  1306. const ids = [];
  1307. ids.push(this.WarehouseInfo.warehouse.id);
  1308. const idStr = ids.join(",");
  1309. const params = {
  1310. ids: idStr
  1311. };
  1312. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  1313. confirmButtonText: "确定",
  1314. cancelButtonText: "取消",
  1315. type: "warning"
  1316. })
  1317. .then(() => {
  1318. deleteWarehouseInfo(params).then(response => {
  1319. if (response.data.state == 0) {
  1320. this.$message.error(response.data.msg);
  1321. return false;
  1322. } else {
  1323. this.$notify({
  1324. title: "成功",
  1325. message: "删除成功",
  1326. type: "success",
  1327. duration: 2000
  1328. });
  1329. this.$router.back(-1);
  1330. }
  1331. });
  1332. })
  1333. .catch(() => {});
  1334. },
  1335. typeName: function(good_type_id) {
  1336. let name = "";
  1337. for (let i = 0; i < this.goodType.length; i++) {
  1338. if (this.goodType[i].id == good_type_id) {
  1339. name = this.goodType[i].type_name;
  1340. }
  1341. }
  1342. return name;
  1343. },
  1344. showDialog(index, row) {
  1345. this.currentIndex = index;
  1346. const params = {
  1347. manufacturer_id: this.form.manufacturer,
  1348. dealer_id: this.form.dealer
  1349. };
  1350. this.propForm.goods = []
  1351. GetAllGoodInfoByID(params).then(response => {
  1352. if (response.data.state == 0) {
  1353. this.$message.error(response.data.msg);
  1354. return false;
  1355. } else {
  1356. if (response.data.data.goodInfo.length <= 0) {
  1357. this.$message.error("该厂商或经销商没有物品信息");
  1358. return;
  1359. }
  1360. this.$refs.dialog.show();
  1361. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  1362. this.propForm.goodType.push(
  1363. response.data.data.goodInfo[i].type
  1364. );
  1365. }
  1366. const obj = {};
  1367. this.propForm.goodType = this.propForm.goodType.reduce(
  1368. (cur, next) => {
  1369. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1370. return cur;
  1371. },
  1372. []
  1373. ); // 设置cur默认类型为数组,并且初始值为空的数组
  1374. }
  1375. for (let i = 0; i < this.propForm.goodType.length; i++) {
  1376. let goodInfo = [];
  1377. let goodObj = {};
  1378. for (let a = 0; a < response.data.data.goodInfo.length; a++) {
  1379. var respObj = response.data.data.goodInfo[a];
  1380. respObj["isSelected"] = false;
  1381. if (respObj.type.id == this.propForm.goodType[i].id) {
  1382. goodInfo.push(respObj);
  1383. }
  1384. }
  1385. const obj = {};
  1386. goodInfo = goodInfo.reduce((cur, next) => {
  1387. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1388. return cur;
  1389. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  1390. this.$set(goodObj, this.propForm.goodType[i].id, goodInfo);
  1391. this.propForm.goods.push(goodObj);
  1392. }
  1393. });
  1394. },
  1395. specificationName: function(drug_id) {
  1396. let name = "";
  1397. for (let i = 0; i < this.goodInfo.length; i++) {
  1398. if (this.goodInfo[i].id == drug_id) {
  1399. name = this.goodInfo[i].specification_name;
  1400. }
  1401. }
  1402. return name;
  1403. },
  1404. submit() {
  1405. this.$refs["tableForm"].validate(valid => {
  1406. if (valid) {
  1407. const array = this.recordInfo.recordData;
  1408. for (let i = 0; i < array.length; i++) {
  1409. if (array[i].good_type_id == 0) {
  1410. this.$message.error("商品类型不能为空");
  1411. return;
  1412. }
  1413. if (array[i].good_id == 0) {
  1414. this.$message.error("规格名称不能为空");
  1415. return;
  1416. }
  1417. }
  1418. const params = {
  1419. stockIn: this.recordInfo.recordData
  1420. };
  1421. EditWarehouse(
  1422. params,
  1423. this.warehousing_time,
  1424. this.drug_id,
  1425. this.type,
  1426. this.form.manufacturer,
  1427. this.form.dealer
  1428. ).then(response => {
  1429. if (response.data.state == 0) {
  1430. this.$message.error(response.data.msg);
  1431. return false;
  1432. } else {
  1433. this.$message.success("保存成功");
  1434. this.dialogVisible = false
  1435. this.editDialogVisible = false
  1436. }
  1437. });
  1438. } else {
  1439. return false;
  1440. }
  1441. });
  1442. },
  1443. changeManufacturer(val) {
  1444. },
  1445. changeDealer(val) {
  1446. },
  1447. DeleteWarehouseInfoItem: function(index, row) {
  1448. if (row.id == 0) {
  1449. this.recordInfo.recordData.splice(index, 1);
  1450. } else {
  1451. const params = {
  1452. id: row.id
  1453. };
  1454. this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
  1455. confirmButtonText: "确定",
  1456. cancelButtonText: "取消",
  1457. type: "warning"
  1458. })
  1459. .then(() => {
  1460. DeleteWarehouseInfoItem(params).then(response => {
  1461. if (response.data.state == 0) {
  1462. this.$message.error(response.data.msg);
  1463. return false;
  1464. } else {
  1465. this.$message.success("删除成功");
  1466. this.recordInfo.recordData.splice(index, 1);
  1467. }
  1468. });
  1469. })
  1470. .catch(() => {});
  1471. }
  1472. },
  1473. handleEditTwo: function(index, row) {
  1474. const tempObj = {};
  1475. tempObj["id"] = 0;
  1476. tempObj["good_type_id"] = 0;
  1477. tempObj["good_id"] = 0;
  1478. tempObj["number"] = "";
  1479. tempObj["product_date"] = "";
  1480. tempObj["expiry_date"] = "";
  1481. tempObj["warehousing_count"] = "";
  1482. tempObj["price"] = "";
  1483. tempObj["remark"] = "";
  1484. tempObj["dealer"] = "";
  1485. tempObj["manufacturer"] = "";
  1486. this.recordInfo.recordData.push(tempObj);
  1487. },
  1488. comfirm: function(val) {
  1489. this.$refs.dialog.hide();
  1490. this.propForm.goodType = [];
  1491. this.propForm.goods = [];
  1492. if (val.selectedGoodInfo.length > 0) {
  1493. for (let i = val.selectedGoodInfo.length - 1; ; i--) {
  1494. if (i == 0) {
  1495. this.recordInfo.recordData[this.currentIndex].good_type_id =
  1496. val.selectedGoodInfo[i].good_type_id;
  1497. this.recordInfo.recordData[this.currentIndex].good_id =
  1498. val.selectedGoodInfo[i].id;
  1499. this.recordInfo.recordData[
  1500. this.currentIndex
  1501. ].price = val.selectedGoodInfo[i].buy_price.toString();
  1502. } else {
  1503. const tempForm = {};
  1504. tempForm["id"] = 0;
  1505. tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
  1506. tempForm["good_id"] = val.selectedGoodInfo[i].id;
  1507. tempForm["number"] = "";
  1508. tempForm["product_date"] = "";
  1509. tempForm["expiry_date"] = "";
  1510. tempForm["warehousing_count"] = "";
  1511. tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
  1512. tempForm["remark"] = "";
  1513. tempForm["dealer"] = "";
  1514. tempForm["manufacturer"] = "";
  1515. this.recordInfo.recordData.splice(
  1516. this.currentIndex + 1,
  1517. 0,
  1518. tempForm
  1519. );
  1520. }
  1521. }
  1522. }
  1523. this.currentIndex = -1;
  1524. },
  1525. cancle: function() {
  1526. this.$refs.dialog.hide();
  1527. this.propForm.goods = [];
  1528. this.propForm.goodType = [];
  1529. },
  1530. toPrint(){
  1531. if(this.order_id == ""){
  1532. this.$message.error("请勾选入库单")
  1533. }else{
  1534. this.$router.push("/stock/in/detail/print?id="+this.order_id)
  1535. }
  1536. },
  1537. getlist(){
  1538. this.exportLoding = true
  1539. var params = {
  1540. id:this.order_id,
  1541. start_time:this.start_time,
  1542. end_time:this.end_time,
  1543. storehouse_id:this.storehouse_id,
  1544. }
  1545. getExportStockList(params).then(response=>{
  1546. if(response.data.state == 1){
  1547. var list = response.data.data.list
  1548. for(let i=0;i<this.goodType.length;i++){
  1549. for(let j=0;j<list.length;j++){
  1550. if(this.goodType[i].id == list[j].good_type_id){
  1551. list[j].good_type_name = this.goodType[i].type_name
  1552. }
  1553. }
  1554. }
  1555. for(let i=0;i<list.length;i++){
  1556. list[i].unit = list[i].specification_name +"/"+ list[i].packing_unit
  1557. list[i].total_price = (list[i].warehousing_count * list[i].price).toFixed(2)
  1558. list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
  1559. list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}")
  1560. for(let j=0;j<this.manufacturer.length;j++){
  1561. if(list[i].manufacturer == this.manufacturer[j].id){
  1562. list[i].manufacturer = this.manufacturer[j].manufacturer_name
  1563. }
  1564. }
  1565. for(let z=0;z<this.dealer.length;z++){
  1566. if(list[i].dealer == this.dealer[z].id){
  1567. list[i].dealer = this.dealer[z].dealer_name
  1568. }
  1569. }
  1570. }
  1571. this.exportLoding = false
  1572. this.exportList = list
  1573. }
  1574. })
  1575. },
  1576. toExport(){
  1577. if(this.order_id == ""){
  1578. this.$message.error("请勾选入库单")
  1579. return
  1580. }
  1581. import('@/vendor/Export2Excel').then(excel => {
  1582. for(let i=0;i<this.exportList.length;i++){
  1583. for(let j=0;j<this.goodType.length;j++){
  1584. if(this.exportList[i].good_type_id == this.goodType[j].id){
  1585. this.exportList[i].good_type_id = this.goodType[j].type_name
  1586. }
  1587. }
  1588. if(this.exportList[i].dealer == 0){
  1589. this.exportList[i].dealer = ""
  1590. }
  1591. if(this.exportList[i].manufacturer == 0){
  1592. this.exportList[i].manufacturer = ""
  1593. }
  1594. if(this.exportList[i].good_type_id == 0){
  1595. this.exportList[i].good_type_id = ""
  1596. }
  1597. }
  1598. const tHeader = ['耗材名称','耗材类型', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效期','经销商','批准文号','备注']
  1599. const filterVal = ['good_name', 'good_type_id', 'unit','number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','license_number','remark']
  1600. const data = this.formatJson(filterVal, this.exportList)
  1601. excel.export_json_to_excel({
  1602. header: tHeader,
  1603. data,
  1604. filename: '耗材入库单详情'
  1605. })
  1606. this.downloadLoading = false
  1607. })
  1608. },
  1609. formatJson(filterVal, jsonData) {
  1610. return jsonData.map(v => filterVal.map(j => v[j]));
  1611. },
  1612. getHouseName(id){
  1613. var storehouse_name = ""
  1614. for(let i=0;i<this.list.length;i++){
  1615. if(id == this.list[i].id){
  1616. storehouse_name = this.list[i].storehouse_name
  1617. }
  1618. }
  1619. return storehouse_name
  1620. },
  1621. changeStoreHouse(){
  1622. this.GetWarehouse();
  1623. this.getlist()
  1624. }
  1625. }
  1626. };
  1627. </script>
  1628. <style rel="stylesheet/css" lang="scss" scoped>
  1629. .information {
  1630. border: 1px #dcdfe6 solid;
  1631. padding: 30px 20px 30px 20px;
  1632. .border {
  1633. border-bottom: 1px #dcdfe6 solid;
  1634. margin: 0px 0 20px 0;
  1635. }
  1636. }
  1637. .edit_separater {
  1638. border-top: 1px solid rgb(233, 233, 233);
  1639. margin-top: 15px;
  1640. margin-bottom: 15px;
  1641. }
  1642. </style>
  1643. <style>
  1644. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1645. font-size: 12px;
  1646. }
  1647. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1648. background: #6fb5fa;
  1649. }
  1650. .count {
  1651. color: #bd2c00;
  1652. }
  1653. .el-table td,
  1654. .el-table th.is-leaf,
  1655. .el-table--border,
  1656. .el-table--group {
  1657. border-color: #d0d3da;
  1658. }
  1659. .el-table--border::after,
  1660. .el-table--group::after,
  1661. .el-table::before {
  1662. background-color: #d0d3da;
  1663. }
  1664. </style>