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

drugStockInOrder.vue 36KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  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="handleWarehouse"
  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. v-model.trim="searchKey"
  38. class="filter-item"
  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="drugPrint()"
  108. >打印</el-button
  109. >
  110. <el-button size="small" type="primary" @click="toExport()" :disabled="exportLoding">导出</el-button>
  111. <div>
  112. <span>&nbsp;&nbsp;</span>
  113. <label class="title"><span class="name">审核状态</span> :</label>
  114. <el-select
  115. size="small"
  116. v-model="check_type"
  117. filterable
  118. placeholder="请选择仓库"
  119. style="width: 200px"
  120. @change="changeCheckType"
  121. >
  122. <el-option
  123. v-for="(option, index) in checkList"
  124. :key="index"
  125. :label="option.name"
  126. :value="option.id"
  127. >
  128. </el-option>
  129. </el-select>
  130. </div>
  131. </div>
  132. <el-table
  133. :data="Warehouse.warehouseDate"
  134. :class="signAndWeighBoxPatients"
  135. style="width: 100%"
  136. border
  137. highlight-current-row
  138. v-loading="Warehouse.loading"
  139. ref="multipleTable"
  140. @selection-change="select"
  141. :row-style="{ color: '#303133' }"
  142. :header-cell-style="{
  143. backgroundColor: 'rgb(245, 247, 250)',
  144. color: '#606266',
  145. }"
  146. @current-change="handleCurrentChangeOne"
  147. >
  148. <el-table-column align="center" type="selection" width="55">
  149. </el-table-column>
  150. <el-table-column label="单据日期" align="center">
  151. <template slot-scope="scope">
  152. {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="单据编号" align="center">
  156. <template slot-scope="scope">
  157. {{ scope.row.warehousing_order }}
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="仓库名称" align="center">
  161. <template slot-scope="scope">
  162. {{ getHouseName(scope.row.storehouse_id) }}
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="制单人" align="center">
  166. <template slot-scope="scope">
  167. {{ getXuserName(scope.row.creater) }}
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="入库方式" align="center">
  171. <template slot-scope="scope">
  172. <span v-if="scope.row.is_sys == 13">调拨入库</span>
  173. <span v-else>手动入库</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="审核状态" align="center">
  177. <template slot-scope="scope">
  178. <span v-if="scope.row.is_check == 1">已审核</span>
  179. <span v-if="scope.row.is_check == 2">未审核</span>
  180. </template>
  181. </el-table-column>
  182. <el-table-column label="操作" align="center" width="240">
  183. <template slot-scope="scope">
  184. <el-tooltip
  185. class="item"
  186. effect="dark"
  187. content="编辑"
  188. placement="top"
  189. >
  190. <el-button
  191. size="small"
  192. type="primary"
  193. icon="el-icon-edit-outline"
  194. @click="handleEdit(scope.$index, scope.row)"
  195. >
  196. </el-button>
  197. </el-tooltip>
  198. <el-tooltip
  199. class="item"
  200. effect="dark"
  201. content="删除"
  202. placement="top"
  203. >
  204. <el-button
  205. size="small"
  206. type="danger"
  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. <el-table
  227. v-show="showOne"
  228. :data="WarehouseInfo.warehouseInfoDate"
  229. :class="signAndWeighBoxPatients"
  230. style="width: 100%; margin-top: 10px"
  231. border
  232. highlight-current-row
  233. v-loading="Warehouse.loading"
  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. >
  242. <el-table-column label="药品名称" align="center">
  243. <template slot-scope="scope">
  244. <span v-if="scope.row.is_total == 0">
  245. {{ scope.row.drug.drug_name }}
  246. </span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="药品类型" align="center">
  250. <template slot-scope="scope">
  251. <span v-if="scope.row.is_total == 0"> {{ getDrugType(scope.row.drug.drug_type) }}</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">{{ scope.row.drug.dose }}&nbsp;{{ scope.row.drug.dose_unit }}*{{
  257. scope.row.drug.min_number
  258. }}{{ scope.row.drug.min_unit }}/{{ scope.row.drug.max_unit }}
  259. </span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column label="国家编码" align="center">
  263. <template slot-scope="scope">
  264. <span v-if="scope.row.is_total == 0">
  265. {{ scope.row.drug.medical_insurance_number }}
  266. </span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="批号" align="center">
  270. <template slot-scope="scope">
  271. <span v-if="scope.row.is_total == 0"> {{ scope.row.batch_number }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="仓库名称" align="center">
  275. <template slot-scope="scope">
  276. <span v-if="scope.row.is_total == 0">
  277. {{ getHouseName(scope.row.storehouse_id) }}
  278. </span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="入库数量" align="center">
  282. <template slot-scope="scope">
  283. <span v-if="scope.row.is_total == 0">
  284. {{ scope.row.warehousing_count }}{{ scope.row.max_unit }}
  285. </span>
  286. </template>
  287. </el-table-column>
  288. <!-- <el-table-column label="拆零零售价" align="center">
  289. <template slot-scope="scope">
  290. {{scope.row.retail_price}}
  291. </template>
  292. </el-table-column> -->
  293. <el-table-column label="进货价" align="center">
  294. <template slot-scope="scope">
  295. <span v-if="scope.row.is_total == 0">{{ scope.row.price }}</span>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="总价" align="center">
  299. <template slot-scope="scope">
  300. <!-- {{scope.row.total_price}} -->
  301. <span v-if="scope.row.is_total == 0">{{ (scope.row.warehousing_count * scope.row.price).toFixed(2) }}</span>
  302. <span v-if="scope.row.is_total == 1">
  303. {{(scope.row.total_count).toFixed(2)}}
  304. </span>
  305. </template>
  306. </el-table-column>
  307. <el-table-column label="生产厂家" align="center">
  308. <template slot-scope="scope">
  309. <span v-if="scope.row.is_total== 0">
  310. {{ getManufacturer(scope.row.manufacturer) }}
  311. </span>
  312. </template>
  313. </el-table-column>
  314. <el-table-column label="生产日期" align="center">
  315. <template slot-scope="scope">
  316. <span v-if="scope.row.is_total ==0">{{ getTime(scope.row.product_date) }} </span>
  317. </template>
  318. </el-table-column>
  319. <el-table-column label="有效日期" align="center">
  320. <template slot-scope="scope">
  321. <span v-if="scope.row.is_total == 0">
  322. {{ getTime(scope.row.expiry_date) }}
  323. </span>
  324. </template>
  325. </el-table-column>
  326. <el-table-column label="经销商" align="center">
  327. <template slot-scope="scope">
  328. <span v-if="scope.row.is_total == 0">
  329. {{ getDealer(scope.row.dealer) }}
  330. </span>
  331. </template>
  332. </el-table-column>
  333. <el-table-column label="批准文号" align="center">
  334. <template slot-scope="scope">
  335. <span v-if="scope.row.is_total == 0">
  336. {{ scope.row.number }}
  337. </span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column label="备注" align="center">
  341. <template slot-scope="scope">
  342. <span v-if="scope.row.is_total == 0">
  343. {{ scope.row.remark }}
  344. </span>
  345. </template>
  346. </el-table-column>
  347. </el-table>
  348. </div>
  349. <el-dialog title="药品详细" :visible.sync="dialogVisible" width="60%">
  350. <span>
  351. <el-table
  352. :data="WarehouseInfo.warehouseInfoDate"
  353. :class="signAndWeighBoxPatients"
  354. style="width: 100%"
  355. border
  356. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  357. >
  358. <el-table-column min-width="35" align="center">
  359. <template slot="header" slot-scope="scope">
  360. <span>药品名称</span>
  361. </template>
  362. <template slot-scope="scope">
  363. <span v-if="scope.row.drug_id != 0">{{
  364. scope.row.drug.drug_name
  365. }}</span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column min-width="35" align="center">
  369. <template slot="header" slot-scope="scope">
  370. <span>规格名称</span>
  371. </template>
  372. <template slot-scope="scope">
  373. <span v-if="scope.row.drug_id != 0">{{
  374. scope.row.drug ? scope.row.drug.drug_spec : ""
  375. }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column min-width="23" align="center">
  379. <template slot="header" slot-scope="scope">
  380. <span>单价</span>
  381. </template>
  382. <template slot-scope="scope">
  383. <span>{{ scope.row.price }}</span>
  384. </template>
  385. </el-table-column>
  386. <el-table-column min-width="23" align="center">
  387. <template slot="header" slot-scope="scope">
  388. <span>入库数量</span>
  389. </template>
  390. <template slot-scope="scope">
  391. <span>{{ scope.row.warehousing_count }}</span>
  392. </template>
  393. </el-table-column>
  394. <el-table-column label="总价" min-width="20" align="center">
  395. <template slot-scope="scope">
  396. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  397. </template>
  398. </el-table-column>
  399. <el-table-column align="center" min-width="25">
  400. <template slot="header" slot-scope="scope">
  401. <span>批号</span>
  402. </template>
  403. <template slot-scope="scope">
  404. <span>{{ scope.row.number }}</span>
  405. </template>
  406. </el-table-column>
  407. <el-table-column label="生产日期" min-width="40" align="center">
  408. <template v-if="scope.row.product_date != 0" slot-scope="scope">
  409. {{ scope.row.product_date | parseTime("{y}-{m}-{d}") }}
  410. </template>
  411. </el-table-column>
  412. <el-table-column label="有效日期" min-width="40" align="center">
  413. <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
  414. {{ scope.row.expiry_date | parseTime("{y}-{m}-{d}") }}
  415. </template>
  416. </el-table-column>
  417. <el-table-column label="备注" min-width="20" align="center">
  418. <template slot-scope="scope">
  419. <el-popover placement="top-start" width="250" trigger="hover">
  420. <div>{{ scope.row.remark }}</div>
  421. <span slot="reference" v-if="scope.row.remark.length > 20">{{
  422. scope.row.remark.substr(0, 20) + "..."
  423. }}</span>
  424. <span slot="reference" v-else>{{ scope.row.remark }}</span>
  425. </el-popover>
  426. </template>
  427. </el-table-column>
  428. </el-table>
  429. </span>
  430. <span slot="footer" class="dialog-footer">
  431. <el-button @click="dialogVisible = false">取 消</el-button>
  432. <el-button type="primary" @click="dialogVisible = false"
  433. >确 定</el-button
  434. >
  435. </span>
  436. </el-dialog>
  437. </div>
  438. </template>
  439. <script>
  440. import { uParseTime } from "@/utils/tools";
  441. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  442. import {
  443. deleteDrugWarehouseInfo,
  444. GetAllConfig,
  445. getDrugWarehouseInfoList,
  446. getDrugWarehouseList,
  447. exportDrugList,
  448. } from "@/api/drug/drug_stock";
  449. import { getAllDrugList } from "@/api/data";
  450. import { getDictionaryDataConfig } from "@/utils/data";
  451. import BreadCrumb from "../../components/bread-crumb";
  452. export default {
  453. name: "drugStockInOrder",
  454. components: { BreadCrumb },
  455. created() {
  456. if (this.$route.path == "/Pharmacy/drugs/stock/in") {
  457. this.crumbs = [
  458. { path: false, name: "药品管理" },
  459. { path: "/stock/drugs/stock/query", name: "入库单·" },
  460. ];
  461. }
  462. this.drugTypeList = getDictionaryDataConfig("system", "drug_type");
  463. var nowDate = new Date();
  464. var nowYear = nowDate.getFullYear();
  465. var nowMonth = nowDate.getMonth() + 1;
  466. var nowDay = nowDate.getDate();
  467. this.end_time =
  468. nowYear +
  469. "-" +
  470. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  471. "-" +
  472. (nowDay < 10 ? "0" + nowDay : nowDay);
  473. nowDate.setMonth(nowDate.getMonth() - 1);
  474. nowYear = nowDate.getFullYear();
  475. nowMonth = nowDate.getMonth() + 1;
  476. nowDay = nowDate.getDate();
  477. this.start_time =
  478. nowYear +
  479. "-" +
  480. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  481. "-" +
  482. (nowDay < 10 ? "0" + nowDay : nowDay);
  483. this.GetWarehouse();
  484. this.fetchAllAdminUsers();
  485. },
  486. data() {
  487. return {
  488. crumbs: [
  489. { path: false, name: "库存管理" },
  490. { path: false, name: "入库单" },
  491. ],
  492. searchKey: "",
  493. type: 1,
  494. page: 1,
  495. limit: 5,
  496. checked: false,
  497. total: 0,
  498. pageTotal: 0,
  499. pageSelect: 0,
  500. adminUserOptions: [],
  501. multipleSelection: [],
  502. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  503. start_time: "",
  504. end_time: "",
  505. selectedTableData: [],
  506. Warehouse: {
  507. loading: false,
  508. warehouseDate: [],
  509. tableCurrentIndex: "",
  510. },
  511. WarehouseInfo: {
  512. loading: false,
  513. warehouseInfoDate: [],
  514. },
  515. check_id: 0,
  516. startTime: "",
  517. dialogVisible: false,
  518. showOne: false,
  519. drugTypeList: [],
  520. manufacturerList: [],
  521. order_id: "",
  522. dealerList: [],
  523. exportList: [],
  524. houseList: [],
  525. storehouse_id: 0,
  526. check_type: 0,
  527. checkList: [
  528. { id: 0, name: "全部" },
  529. { id: 1, name: "已审核" },
  530. { id: 2, name: "未审核" },
  531. ],
  532. exportLoding:false,
  533. };
  534. },
  535. methods: {
  536. changeTypeName() {
  537. this.getlist();
  538. },
  539. getlist() {
  540. var params = {
  541. check_id: this.check_id,
  542. start_time: this.start_time,
  543. end_time: this.end_time,
  544. keyword: this.keywords,
  545. page: this.page,
  546. limit: this.limit,
  547. };
  548. getAllSecondOrderList(params).then((response) => {
  549. if (response.data.state == 1) {
  550. var list = response.data.data.list;
  551. this.tableList = list;
  552. var total = response.data.data.total;
  553. this.total = total;
  554. this.houseList = response.data.data.houseList;
  555. this.doctorList = response.data.data.doctorList;
  556. }
  557. });
  558. },
  559. search: function () {
  560. const Params = {
  561. page: this.page,
  562. limit: this.limit,
  563. start_time: this.start_time,
  564. end_time: this.end_time,
  565. type: this.type,
  566. keywords: this.searchKey,
  567. storehouse_id: this.storehouse_id,
  568. check_type: this.check_type,
  569. };
  570. this.Warehouse.warehouseDate = [];
  571. getDrugWarehouseList(Params).then((response) => {
  572. if (response.data.state == 0) {
  573. this.Warehouse.loading = false;
  574. this.$message.error(response.data.msg);
  575. return false;
  576. } else {
  577. this.Warehouse.loading = false;
  578. this.total = response.data.data.total;
  579. for (let i = 0; i < response.data.data.list.length; i++) {
  580. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  581. }
  582. }
  583. });
  584. },
  585. GetWarehouse: function () {
  586. const Params = {
  587. page: this.page,
  588. limit: this.limit,
  589. start_time: this.start_time,
  590. end_time: this.end_time,
  591. type: this.type,
  592. keywords: this.searchKey,
  593. storehouse_id: this.storehouse_id,
  594. check_type: this.check_type,
  595. };
  596. this.Warehouse.warehouseDate = [];
  597. getDrugWarehouseList(Params).then((response) => {
  598. if (response.data.state == 0) {
  599. this.Warehouse.loading = false;
  600. this.$message.error(response.data.msg);
  601. return false;
  602. } else {
  603. this.Warehouse.loading = false;
  604. this.total = response.data.data.total;
  605. for (let i = 0; i < response.data.data.list.length; i++) {
  606. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  607. }
  608. var obj = { id: 0, storehouse_name: "全部" };
  609. this.houseList = [];
  610. this.houseList.push(obj);
  611. for (let i = 0; i < response.data.data.houseList.length; i++) {
  612. this.houseList.push(response.data.data.houseList[i]);
  613. }
  614. }
  615. });
  616. },
  617. tableRowClassName({ row, rowIndex }) {
  618. // 把每一行的索引放进row
  619. row.index = rowIndex;
  620. },
  621. onRowClick(row, event, column) {
  622. this.WarehouseInfo.warehouseInfoDate = [];
  623. this.Warehouse.tableCurrentIndex = row.index;
  624. const params = {
  625. id: row.id,
  626. };
  627. this.WarehouseInfo.loading = true;
  628. getDrugWarehouseInfoList(params).then((response) => {
  629. if (response.data.state == 0) {
  630. this.WarehouseInfo.loading = false;
  631. this.$message.error(response.data.msg);
  632. return false;
  633. } else {
  634. this.WarehouseInfo.loading = false;
  635. for (let i = 0; i < response.data.data.info.length; i++) {
  636. this.WarehouseInfo.warehouseInfoDate.push(
  637. response.data.data.info[i]
  638. );
  639. }
  640. }
  641. });
  642. },
  643. getXuserName(id) {
  644. if (id <= 0) {
  645. return "";
  646. }
  647. var name = "";
  648. if (
  649. this.adminUserOptions == null ||
  650. typeof this.adminUserOptions.length === "undefined"
  651. ) {
  652. return name;
  653. }
  654. var leng = this.adminUserOptions.length;
  655. if (leng == 0) {
  656. return name;
  657. }
  658. for (let index = 0; index < leng; index++) {
  659. if (this.adminUserOptions[index].id == id) {
  660. name = this.adminUserOptions[index].name;
  661. break;
  662. }
  663. }
  664. return name;
  665. },
  666. fetchAllDoctorAndNurse() {
  667. fetchAllDoctorAndNurse().then((response) => {
  668. if (response.data.state == 1) {
  669. this.doctorOptions = response.data.data.doctors;
  670. }
  671. });
  672. },
  673. fetchAllAdminUsers() {
  674. fetchAllAdminUsers().then((response) => {
  675. if (response.data.state == 1) {
  676. this.adminUserOptions = response.data.data.users;
  677. var alen = this.adminUserOptions.length;
  678. for (let index = 0; index < alen; index++) {
  679. if (this.adminUserOptions[index].user_type == 2) {
  680. // this.doctorOptions.push(this.adminUserOptions[index]);
  681. }
  682. }
  683. }
  684. });
  685. },
  686. clicks: function () {},
  687. handleWarehouse: function () {
  688. if (this.$route.path == "/Pharmacy/drugs/stock/in") {
  689. this.$router.push({
  690. path: "/Pharmacy/in/add",
  691. query: { type: this.type },
  692. });
  693. } else {
  694. this.$router.push({
  695. path: "/drugstock/in/add",
  696. query: { type: this.type },
  697. });
  698. }
  699. },
  700. handleSelectionChange: function (val) {
  701. this.multipleSelection = val;
  702. },
  703. handleSizeChange(val) {
  704. this.limit = val;
  705. this.GetWarehouse();
  706. },
  707. handleCurrentChange(val) {
  708. this.page = val;
  709. this.GetWarehouse();
  710. },
  711. startTimeChange(val) {
  712. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  713. if (time > 0) {
  714. this.$message.error("结束时间不能小于开始时间");
  715. this.start_time = "";
  716. } else {
  717. this.startTime = this.getTimestamp(val);
  718. this.start_time = val;
  719. this.GetWarehouse();
  720. }
  721. },
  722. endTimeChange(val) {
  723. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  724. if (time < 0) {
  725. this.$message.error("结束时间不能小于开始时间");
  726. this.end_time = "";
  727. } else {
  728. this.end_time = val;
  729. this.GetWarehouse();
  730. }
  731. },
  732. getTimestamp(time) {
  733. // 把时间日期转成时间戳
  734. return new Date(time).getTime() / 1000;
  735. },
  736. calculate: function (val) {
  737. return Math.round(parseFloat(val) * 100) / 100;
  738. },
  739. // handleEdit: function(index, row) {
  740. // this.$router.push({
  741. // name: "drugStockInDetail",
  742. // query: { id: row.id, type: this.type }
  743. // });
  744. // },
  745. handleEdit: function (index, row) {
  746. this.$router.push({
  747. name: "drugStockInOrderEdit",
  748. query: {
  749. id: row.id,
  750. type: this.type,
  751. supply_warehouse_id: row.supply_warehouse_id,
  752. is_sys: row.is_sys,
  753. is_check: row.is_check,
  754. },
  755. });
  756. },
  757. handleSearch(id) {
  758. this.WarehouseInfo.warehouseInfoDate = [];
  759. this.GetOrderDetail(id);
  760. this.dialogVisible = true;
  761. },
  762. GetOrderDetail(order_id) {
  763. const params = {
  764. id: order_id,
  765. };
  766. this.WarehouseInfo.warehouseInfoDate = [];
  767. getDrugWarehouseInfoList(params).then((response) => {
  768. if (response.data.state == 0) {
  769. this.$message.error(response.data.msg);
  770. return false;
  771. } else {
  772. var obj = {total_count:0,is_total:1}
  773. for (let i = 0; i < response.data.data.info.length; i++) {
  774. response.data.data.info[i].is_total = 0
  775. this.showOne = true;
  776. this.WarehouseInfo.warehouseInfoDate.push(
  777. response.data.data.info[i]
  778. );
  779. obj.total_count += (response.data.data.info[i].warehousing_count *response.data.data.info[i].price)
  780. }
  781. this.WarehouseInfo.warehouseInfoDate.push(obj)
  782. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  783. this.getAllDrugList();
  784. }
  785. });
  786. },
  787. handleDelete: function (index, row) {
  788. if (row.is_sys == 13) {
  789. this.$message.error("调拨入库数据不能删除!");
  790. return false;
  791. }
  792. if (row.supply_warehouse_id > 0) {
  793. this.$message.error("自动入库数据不能删除!");
  794. return false;
  795. }
  796. if (row.is_check == 1) {
  797. this.$message.error("已审核的单据不能删除");
  798. return false;
  799. }
  800. const ids = [];
  801. ids.push(row.id);
  802. const idStr = ids.join(",");
  803. const params = {
  804. ids: idStr,
  805. };
  806. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  807. confirmButtonText: "确定",
  808. cancelButtonText: "取消",
  809. type: "warning",
  810. })
  811. .then(() => {
  812. deleteDrugWarehouseInfo(params).then((response) => {
  813. if (response.data.state == 0) {
  814. this.$message.error(response.data.msg);
  815. return false;
  816. } else {
  817. this.$notify({
  818. title: "成功",
  819. message: "删除成功",
  820. type: "success",
  821. duration: 2000,
  822. });
  823. for (let i = 0; i < ids.length; i++) {
  824. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  825. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  826. this.Warehouse.warehouseDate.splice(y, 1);
  827. }
  828. }
  829. }
  830. }
  831. });
  832. })
  833. .catch(() => {});
  834. },
  835. changeAllSelected: function (val) {
  836. if (val) {
  837. this.$refs.multipleTable.toggleAllSelection();
  838. } else {
  839. this.$refs.multipleTable.clearSelection();
  840. }
  841. },
  842. select(selection) {
  843. var ids = [];
  844. for (let i = 0; i < selection.length; i++) {
  845. ids.push(selection[i].id);
  846. }
  847. this.order_id = ids.join(",");
  848. this.selectedTableData = selection;
  849. this.exportDrugList();
  850. },
  851. batchDelete() {
  852. if (this.selectedTableData.length <= 0) {
  853. this.$message.error("请选择要删除的记录");
  854. return;
  855. }
  856. const ids = [];
  857. const idOne = [];
  858. for (let i = 0; i < this.selectedTableData.length; i++) {
  859. if (this.selectedTableData[i].is_check == 1) {
  860. this.$message.error("已审核单据不能删除!");
  861. return false;
  862. }
  863. if (this.selectedTableData[i].is_sys == 13) {
  864. this.$message.error("调拨入库数据不能删除!");
  865. return false;
  866. }
  867. ids.push(this.selectedTableData[i].id);
  868. if (this.selectedTableData[i].supply_warehouse_id > 0) {
  869. idOne.push(this.selectedTableData[i].supply_warehouse_id);
  870. }
  871. }
  872. for (let i = 0; i < idOne.length; i++) {
  873. if (idOne[i] > 0) {
  874. this.$message.error("自动入库数据不能删除!");
  875. return false;
  876. }
  877. }
  878. const idStr = ids.join(",");
  879. const params = {
  880. ids: idStr,
  881. };
  882. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  883. confirmButtonText: "确定",
  884. cancelButtonText: "取消",
  885. type: "warning",
  886. })
  887. .then(() => {
  888. deleteDrugWarehouseInfo(params).then((response) => {
  889. if (response.data.state == 0) {
  890. this.$message.error(response.data.msg);
  891. return false;
  892. } else {
  893. this.$notify({
  894. title: "成功",
  895. message: "删除成功",
  896. type: "success",
  897. duration: 2000,
  898. });
  899. for (let i = 0; i < ids.length; i++) {
  900. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  901. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  902. this.Warehouse.warehouseDate.splice(y, 1);
  903. }
  904. }
  905. }
  906. }
  907. });
  908. })
  909. .catch(() => {});
  910. },
  911. handleCurrentChangeOne(val) {
  912. this.GetOrderDetail(val.id);
  913. },
  914. getTime(val) {
  915. if (val < 0) {
  916. return "";
  917. }
  918. if (val == "") {
  919. return "";
  920. } else {
  921. return uParseTime(val, "{y}-{m}-{d}");
  922. }
  923. },
  924. getDrugType(id) {
  925. var name = "";
  926. for (let i = 0; i < this.drugTypeList.length; i++) {
  927. if (id == this.drugTypeList[i].id) {
  928. name = this.drugTypeList[i].name;
  929. }
  930. }
  931. return name;
  932. },
  933. getAllDrugList() {
  934. getAllDrugList().then((response) => {
  935. if (response.data.state == 1) {
  936. var manufacturerList = response.data.data.manufacturerList;
  937. this.manufacturerList = manufacturerList;
  938. this.dealerList = response.data.data.dealerList;
  939. }
  940. });
  941. },
  942. getManufacturer(id) {
  943. var name = "";
  944. for (let i = 0; i < this.manufacturerList.length; i++) {
  945. if (id == this.manufacturerList[i].id) {
  946. name = this.manufacturerList[i].manufacturer_name;
  947. }
  948. }
  949. return name;
  950. },
  951. getDealer(id) {
  952. var name = "";
  953. for (let i = 0; i < this.dealerList.length; i++) {
  954. if (id == this.dealerList[i].id) {
  955. name = this.dealerList[i].dealer_name;
  956. }
  957. }
  958. return name;
  959. },
  960. getDictionaryDataConfig(module, filed_name) {
  961. return getDictionaryDataConfig(module, filed_name);
  962. },
  963. drugPrint() {
  964. if (this.order_id == "") {
  965. this.$message.error("请选择入库单");
  966. } else {
  967. this.$router.push({
  968. path: "/stock/drugStockInOrderDetailPrint?id=" + this.order_id,
  969. });
  970. }
  971. },
  972. exportDrugList() {
  973. var params = {
  974. order_id: this.order_id,
  975. };
  976. this.exportLoding = true
  977. exportDrugList(params).then((response) => {
  978. if (response.data.state == 1) {
  979. var list = response.data.data.list;
  980. for (let i = 0; i < list.length; i++) {
  981. list[i].product_date = this.getTime(list[i].product_date);
  982. list[i].expiry_date = this.getTime(list[i].expiry_date);
  983. }
  984. this.exportList = list;
  985. this.exportLoding = false
  986. var manufacturerList = response.data.data.manufacturerList;
  987. this.manufacturerList = manufacturerList;
  988. var dealerList = response.data.data.dealerList;
  989. this.dealerList = dealerList;
  990. }
  991. });
  992. },
  993. lili(){
  994. console.log("exportList",this.exportList)
  995. },
  996. toExport() {
  997. if (this.order_id == "") {
  998. this.$message.error("请勾选入库单");
  999. }
  1000. for (let i = 0; i < this.exportList.length; i++) {
  1001. this.exportList[i].index = i + 1;
  1002. this.exportList[i].unit =
  1003. this.exportList[i].dose +
  1004. this.exportList[i].dose_unit +
  1005. "*" +
  1006. this.exportList[i].min_number +
  1007. this.exportList[i].min_unit +
  1008. "/" +
  1009. this.exportList[i].max_unit;
  1010. this.exportList[i].total_price = (
  1011. this.exportList[i].warehousing_count * this.exportList[i].price
  1012. ).toFixed(2);
  1013. for (let j = 0; j < this.manufacturerList.length; j++) {
  1014. if (this.exportList[i].manufacturer == this.manufacturerList[j].id) {
  1015. this.exportList[i].manufacturer =
  1016. this.manufacturerList[j].manufacturer_name;
  1017. }
  1018. if (this.exportList[i].manufacturer == 0) {
  1019. this.exportList[i].manufacturer = "";
  1020. }
  1021. }
  1022. for (let z = 0; z < this.dealerList.length; z++) {
  1023. if (this.exportList[i].dealer == this.dealerList[z].id) {
  1024. this.exportList[i].dealer = this.dealerList[z].dealer_name;
  1025. }
  1026. if (this.exportList[i].dealer == 0) {
  1027. this.exportList[i].dealer = "";
  1028. }
  1029. }
  1030. }
  1031. import("@/vendor/Export2Excel").then((excel) => {
  1032. for (let i = 0; i < this.exportList.length; i++) {
  1033. for (let j = 0; j < this.drugTypeList.length; j++) {
  1034. if (this.exportList[i].drug_type == this.drugTypeList[j].id) {
  1035. this.exportList[i].drug_type = this.drugTypeList[j].name;
  1036. }
  1037. }
  1038. }
  1039. const tHeader = [
  1040. "序号",
  1041. "药品名称",
  1042. "药品类型",
  1043. "规格&单位",
  1044. "批号",
  1045. "入库数量",
  1046. "进货价",
  1047. "总价",
  1048. "生产厂家",
  1049. "生产日期",
  1050. "有效日期",
  1051. "经销商",
  1052. "批注文号",
  1053. "备注",
  1054. ];
  1055. const filterVal = [
  1056. "index",
  1057. "drug_name",
  1058. "drug_type",
  1059. "unit",
  1060. "batch_number",
  1061. "warehousing_count",
  1062. "price",
  1063. "total_price",
  1064. "manufacturer",
  1065. "product_date",
  1066. "expiry_date",
  1067. "dealer",
  1068. "number",
  1069. "remark",
  1070. ];
  1071. const data = this.formatJson(filterVal, this.exportList);
  1072. excel.export_json_to_excel({
  1073. header: tHeader,
  1074. data,
  1075. filename: "药品入库单详情",
  1076. });
  1077. this.downloadLoading = false;
  1078. });
  1079. },
  1080. formatJson(filterVal, jsonData) {
  1081. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1082. },
  1083. getHouseName(id) {
  1084. var storehouse_name = "";
  1085. for (let i = 0; i < this.houseList.length; i++) {
  1086. if (id == this.houseList[i].id) {
  1087. storehouse_name = this.houseList[i].storehouse_name;
  1088. }
  1089. }
  1090. return storehouse_name;
  1091. },
  1092. changeStoreHouse() {
  1093. this.GetWarehouse();
  1094. },
  1095. changeCheckType() {
  1096. this.GetWarehouse();
  1097. },
  1098. },
  1099. };
  1100. </script>
  1101. <style rel="stylesheet/css" lang="scss" scoped>
  1102. .information {
  1103. border: 1px #dcdfe6 solid;
  1104. padding: 30px 20px 30px 20px;
  1105. .border {
  1106. border-bottom: 1px #dcdfe6 solid;
  1107. margin: 0px 0 20px 0;
  1108. }
  1109. }
  1110. .edit_separater {
  1111. border-top: 1px solid rgb(233, 233, 233);
  1112. margin-top: 15px;
  1113. margin-bottom: 15px;
  1114. }
  1115. </style>
  1116. <style>
  1117. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1118. font-size: 12px;
  1119. }
  1120. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1121. background: #6fb5fa;
  1122. }
  1123. .count {
  1124. color: #bd2c00;
  1125. }
  1126. .el-table td,
  1127. .el-table th.is-leaf,
  1128. .el-table--border,
  1129. .el-table--group {
  1130. border-color: #d0d3da;
  1131. }
  1132. .el-table--border::after,
  1133. .el-table--group::after,
  1134. .el-table::before {
  1135. background-color: #d0d3da;
  1136. }
  1137. </style>