drugStockInOrder.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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. <el-input
  18. size="small"
  19. style="width: 400px;"
  20. v-model.trim="searchKey"
  21. class="filter-item"
  22. placeholder="单据编码/制单人/厂商"
  23. />
  24. <el-button
  25. size="small"
  26. class="filter-item"
  27. type="primary"
  28. icon="el-icon-search"
  29. @click="search"
  30. >搜索</el-button
  31. >
  32. </div>
  33. <div class="cell clearfix">
  34. <label class="title"><span class="name">入库时间</span> : </label>
  35. <el-date-picker
  36. size="small"
  37. v-model="start_time"
  38. prefix-icon="el-icon-date"
  39. :editable="false"
  40. style="width: 196px;"
  41. type="date"
  42. placeholder="选择日期时间"
  43. align="right"
  44. format="yyyy-MM-dd"
  45. value-format="yyyy-MM-dd"
  46. @change="startTimeChange"
  47. ></el-date-picker>
  48. <span class="cellLine"> - </span>
  49. <el-date-picker
  50. size="small"
  51. v-model="end_time"
  52. prefix-icon="el-icon-date"
  53. :editable="false"
  54. style="width: 196px;"
  55. type="date"
  56. placeholder="选择日期时间"
  57. align="right"
  58. format="yyyy-MM-dd"
  59. value-format="yyyy-MM-dd"
  60. @change="endTimeChange"
  61. ></el-date-picker>
  62. </div>
  63. <div class="cell clearfix">
  64. <el-checkbox
  65. style="width: 70px"
  66. v-model="checked"
  67. @change="changeAllSelected"
  68. >全选</el-checkbox
  69. >
  70. <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
  71. <el-button size="small" type="primary" @click="drugPrint()">打印</el-button>
  72. </div>
  73. <el-table
  74. :data="Warehouse.warehouseDate"
  75. :class="signAndWeighBoxPatients"
  76. style="width: 100%"
  77. border
  78. highlight-current-row
  79. v-loading="Warehouse.loading"
  80. ref="multipleTable"
  81. @selection-change="select"
  82. :row-style="{ color: '#303133' }"
  83. :header-cell-style="{
  84. backgroundColor: 'rgb(245, 247, 250)',
  85. color: '#606266'
  86. }"
  87. @current-change="handleCurrentChangeOne"
  88. >
  89. <el-table-column align="center" type="selection" width="55">
  90. </el-table-column>
  91. <el-table-column label="单据日期" align="center">
  92. <template slot-scope="scope">
  93. {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="单据编号" align="center">
  97. <template slot-scope="scope">
  98. {{ scope.row.warehousing_order }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="制单人" align="center">
  102. <template slot-scope="scope">
  103. {{ getXuserName(scope.row.creater) }}
  104. </template>
  105. </el-table-column>
  106. <!-- <el-table-column label="厂家" align="center">
  107. <template slot-scope="scope">
  108. {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="经销商" align="center">
  112. <template slot-scope="scope">
  113. {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
  114. </template>
  115. </el-table-column> -->
  116. <el-table-column label="操作" align="center" width="240">
  117. <template slot-scope="scope">
  118. <!-- <el-tooltip
  119. class="item"
  120. effect="dark"
  121. content="详情"
  122. placement="top"
  123. >
  124. <el-button
  125. size="small"
  126. type="warning"
  127. icon="el-icon-document"
  128. @click="handleSearch(scope.row.id)"
  129. >
  130. </el-button>
  131. </el-tooltip> -->
  132. <el-tooltip
  133. class="item"
  134. effect="dark"
  135. content="编辑"
  136. placement="top"
  137. >
  138. <el-button
  139. size="small"
  140. type="primary"
  141. icon="el-icon-edit-outline"
  142. @click="handleEdit(scope.$index, scope.row)"
  143. >
  144. </el-button>
  145. </el-tooltip>
  146. <el-tooltip
  147. class="item"
  148. effect="dark"
  149. content="删除"
  150. placement="top"
  151. >
  152. <el-button
  153. size="small"
  154. type="danger"
  155. icon="el-icon-delete"
  156. @click="handleDelete(scope.$index, scope.row)"
  157. >
  158. </el-button>
  159. </el-tooltip>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <el-pagination
  164. @size-change="handleSizeChange"
  165. @current-change="handleCurrentChange"
  166. :page-sizes="[5, 10, 50, 100]"
  167. :page-size="5"
  168. background
  169. style="margin-top:20px;text-align: right"
  170. layout="total, sizes, prev, pager, next, jumper"
  171. :total="total"
  172. >
  173. </el-pagination>
  174. <el-table
  175. v-show="showOne"
  176. :data="WarehouseInfo.warehouseInfoDate"
  177. :class="signAndWeighBoxPatients"
  178. style="width: 100%;margin-top:10px;"
  179. border
  180. highlight-current-row
  181. v-loading="Warehouse.loading"
  182. ref="multipleTable"
  183. @selection-change="select"
  184. :row-style="{ color: '#303133' }"
  185. :header-cell-style="{
  186. backgroundColor: 'rgb(245, 247, 250)',
  187. color: '#606266'
  188. }"
  189. >
  190. <el-table-column label="药品名称" align="center">
  191. <template slot-scope="scope">
  192. {{scope.row.drug.drug_name}}
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="药品类型" align="center">
  196. <template slot-scope="scope">
  197. {{getDrugType(scope.row.drug.drug_type)}}
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="规格&单位" align="center">
  201. <template slot-scope="scope">
  202. {{scope.row.drug.dose}}&nbsp;{{scope.row.drug.dose_unit}}*{{scope.row.drug.min_number}}{{scope.row.drug.min_unit}}/{{scope.row.drug.max_unit}}
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="批号" align="center">
  206. <template slot-scope="scope">
  207. {{scope.row.number}}
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="入库数量" align="center">
  211. <template slot-scope="scope">
  212. {{scope.row.warehousing_count}}
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="进货价" align="center">
  216. <template slot-scope="scope">
  217. {{scope.row.price}}
  218. </template>
  219. </el-table-column>
  220. <el-table-column label="总价" align="center">
  221. <template slot-scope="scope">
  222. {{scope.row.total_price}}
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="生产厂家" align="center">
  226. <template slot-scope="scope">
  227. {{getManufacturer(scope.row.drug.manufacturer)}}
  228. </template>
  229. </el-table-column>
  230. <el-table-column label="生产日期" align="center">
  231. <template slot-scope="scope">
  232. {{getTime(scope.row.product_date)}}
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="有效日期" align="center">
  236. <template slot-scope="scope">
  237. {{getTime(scope.row.expiry_date)}}
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="批准文号" align="center">
  241. <template slot-scope="scope">
  242. {{scope.row.number}}
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="备注" align="center">
  246. <template slot-scope="scope">
  247. {{scope.row.remark}}
  248. </template>
  249. </el-table-column>
  250. </el-table>
  251. </div>
  252. <el-dialog
  253. title="药品详细"
  254. :visible.sync="dialogVisible"
  255. width="60%">
  256. <span>
  257. <el-table
  258. :data="WarehouseInfo.warehouseInfoDate"
  259. :class="signAndWeighBoxPatients"
  260. style="width: 100%"
  261. border
  262. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  263. >
  264. <el-table-column min-width="35" align="center">
  265. <template slot="header" slot-scope="scope">
  266. <span>药品名称</span>
  267. </template>
  268. <template slot-scope="scope">
  269. <span v-if="scope.row.drug_id != 0">{{
  270. scope.row.drug.drug_name
  271. }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column min-width="35" align="center">
  275. <template slot="header" slot-scope="scope">
  276. <span>规格名称</span>
  277. </template>
  278. <template slot-scope="scope">
  279. <span v-if="scope.row.drug_id != 0">{{
  280. scope.row.drug?scope.row.drug.drug_spec:''
  281. }}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column min-width="23" align="center">
  285. <template slot="header" slot-scope="scope">
  286. <span>单价</span>
  287. </template>
  288. <template slot-scope="scope">
  289. <span>{{ scope.row.price }}</span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column min-width="23" align="center">
  293. <template slot="header" slot-scope="scope">
  294. <span>入库数量</span>
  295. </template>
  296. <template slot-scope="scope">
  297. <span>{{ scope.row.warehousing_count }}</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="总价" min-width="20" align="center">
  301. <template slot-scope="scope">
  302. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  303. </template>
  304. </el-table-column>
  305. <el-table-column align="center" min-width="25">
  306. <template slot="header" slot-scope="scope">
  307. <span>批号</span>
  308. </template>
  309. <template slot-scope="scope">
  310. <span>{{ scope.row.number }}</span>
  311. </template>
  312. </el-table-column>
  313. <el-table-column label="生产日期" min-width="40" align="center">
  314. <template v-if="scope.row.product_date != 0" slot-scope="scope">
  315. {{ scope.row.product_date | parseTime("{y}-{m}-{d}") }}
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="有效日期" min-width="40" align="center">
  319. <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
  320. {{ scope.row.expiry_date | parseTime("{y}-{m}-{d}") }}
  321. </template>
  322. </el-table-column>
  323. <el-table-column label="备注" min-width="20" align="center">
  324. <template slot-scope="scope">
  325. <el-popover placement="top-start" width="250" trigger="hover">
  326. <div>{{ scope.row.remark }}</div>
  327. <span slot="reference" v-if="scope.row.remark.length > 20">{{
  328. scope.row.remark.substr(0, 20) + "..."
  329. }}</span>
  330. <span slot="reference" v-else>{{ scope.row.remark }}</span>
  331. </el-popover>
  332. </template>
  333. </el-table-column>
  334. </el-table>
  335. </span>
  336. <span slot="footer" class="dialog-footer">
  337. <el-button @click="dialogVisible = false">取 消</el-button>
  338. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  339. </span>
  340. </el-dialog>
  341. <!-- <el-pagination
  342. @size-change="handleSizeChange"
  343. @current-change="handleCurrentChange"
  344. :page-sizes="[10, 50, 100]"
  345. :page-size="10"
  346. background
  347. style="margin-top:20px;float: right"
  348. layout="total, sizes, prev, pager, next, jumper"
  349. :total="total"
  350. >
  351. </el-pagination> -->
  352. </div>
  353. </template>
  354. <script>
  355. import { uParseTime } from "@/utils/tools";
  356. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  357. import {
  358. deleteDrugWarehouseInfo,
  359. GetAllConfig,
  360. getDrugWarehouseInfoList,
  361. getDrugWarehouseList,
  362. } from "@/api/drug/drug_stock";
  363. import {getAllDrugList}from "@/api/data"
  364. import {getDictionaryDataConfig } from "@/utils/data";
  365. import BreadCrumb from "../../components/bread-crumb";
  366. export default {
  367. name: "drugStockInOrder",
  368. components: { BreadCrumb },
  369. created() {
  370. this.drugTypeList = getDictionaryDataConfig('system','drug_type')
  371. var nowDate = new Date();
  372. var nowYear = nowDate.getFullYear();
  373. var nowMonth = nowDate.getMonth() + 1;
  374. var nowDay = nowDate.getDate();
  375. this.end_time =
  376. nowYear +
  377. "-" +
  378. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  379. "-" +
  380. (nowDay < 10 ? "0" + nowDay : nowDay);
  381. nowDate.setMonth(nowDate.getMonth() - 1);
  382. nowYear = nowDate.getFullYear();
  383. nowMonth = nowDate.getMonth() + 1;
  384. nowDay = nowDate.getDate();
  385. this.start_time =
  386. nowYear +
  387. "-" +
  388. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  389. "-" +
  390. (nowDay < 10 ? "0" + nowDay : nowDay);
  391. this.GetWarehouse();
  392. this.fetchAllAdminUsers();
  393. },
  394. data() {
  395. return {
  396. crumbs: [
  397. { path: false, name: "库存管理" },
  398. { path: false, name: "入库单" }
  399. ],
  400. searchKey: "",
  401. type: 1,
  402. page: 1,
  403. limit: 5,
  404. checked: false,
  405. total: 0,
  406. pageTotal: 0,
  407. pageSelect: 0,
  408. adminUserOptions: [],
  409. multipleSelection: [],
  410. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  411. start_time: "",
  412. end_time: "",
  413. selectedTableData: [],
  414. Warehouse: {
  415. loading: false,
  416. warehouseDate: [],
  417. tableCurrentIndex: ""
  418. },
  419. WarehouseInfo: {
  420. loading: false,
  421. warehouseInfoDate: []
  422. },
  423. startTime: "",
  424. dialogVisible:false,
  425. showOne:false,
  426. drugTypeList:[],
  427. manufacturerList:[],
  428. order_id:""
  429. };
  430. },
  431. methods: {
  432. search: function() {
  433. const Params = {
  434. page: this.page,
  435. limit: this.limit,
  436. start_time: this.start_time,
  437. end_time: this.end_time,
  438. type: this.type,
  439. keywords: this.searchKey
  440. };
  441. this.Warehouse.warehouseDate = [];
  442. getDrugWarehouseList(Params).then(response => {
  443. if (response.data.state == 0) {
  444. this.Warehouse.loading = false;
  445. this.$message.error(response.data.msg);
  446. return false;
  447. } else {
  448. this.Warehouse.loading = false;
  449. this.total = response.data.data.total;
  450. for (let i = 0; i < response.data.data.list.length; i++) {
  451. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  452. }
  453. }
  454. });
  455. },
  456. GetWarehouse: function() {
  457. const Params = {
  458. page: this.page,
  459. limit: this.limit,
  460. start_time: this.start_time,
  461. end_time: this.end_time,
  462. type: this.type
  463. };
  464. console.log("params",Params)
  465. this.Warehouse.warehouseDate = [];
  466. getDrugWarehouseList(Params).then(response => {
  467. if (response.data.state == 0) {
  468. this.Warehouse.loading = false;
  469. this.$message.error(response.data.msg);
  470. return false;
  471. } else {
  472. this.Warehouse.loading = false;
  473. this.total = response.data.data.total;
  474. for (let i = 0; i < response.data.data.list.length; i++) {
  475. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  476. }
  477. console.log("列表",this.warehouse.warehouseDate)
  478. }
  479. });
  480. },
  481. tableRowClassName({ row, rowIndex }) {
  482. // 把每一行的索引放进row
  483. row.index = rowIndex;
  484. },
  485. onRowClick(row, event, column) {
  486. this.WarehouseInfo.warehouseInfoDate = [];
  487. this.Warehouse.tableCurrentIndex = row.index;
  488. const params = {
  489. id: row.id
  490. };
  491. this.WarehouseInfo.loading = true;
  492. getDrugWarehouseInfoList(params).then(response => {
  493. if (response.data.state == 0) {
  494. this.WarehouseInfo.loading = false;
  495. this.$message.error(response.data.msg);
  496. return false;
  497. } else {
  498. this.WarehouseInfo.loading = false;
  499. for (let i = 0; i < response.data.data.info.length; i++) {
  500. this.WarehouseInfo.warehouseInfoDate.push(
  501. response.data.data.info[i]
  502. );
  503. }
  504. }
  505. });
  506. },
  507. getXuserName(id) {
  508. if (id <= 0) {
  509. return "";
  510. }
  511. var name = "";
  512. if (
  513. this.adminUserOptions == null ||
  514. typeof this.adminUserOptions.length === "undefined"
  515. ) {
  516. return name;
  517. }
  518. var leng = this.adminUserOptions.length;
  519. if (leng == 0) {
  520. return name;
  521. }
  522. for (let index = 0; index < leng; index++) {
  523. if (this.adminUserOptions[index].id == id) {
  524. name = this.adminUserOptions[index].name;
  525. break;
  526. }
  527. }
  528. return name;
  529. },
  530. fetchAllDoctorAndNurse() {
  531. fetchAllDoctorAndNurse().then(response => {
  532. if (response.data.state == 1) {
  533. this.doctorOptions = response.data.data.doctors;
  534. }
  535. });
  536. },
  537. fetchAllAdminUsers() {
  538. fetchAllAdminUsers().then(response => {
  539. console.log(response);
  540. if (response.data.state == 1) {
  541. this.adminUserOptions = response.data.data.users;
  542. console.log("制单人2222222",this.adminUserOptions)
  543. var alen = this.adminUserOptions.length;
  544. for (let index = 0; index < alen; index++) {
  545. if (this.adminUserOptions[index].user_type == 2) {
  546. // this.doctorOptions.push(this.adminUserOptions[index]);
  547. }
  548. }
  549. }
  550. });
  551. },
  552. clicks: function() {
  553. console.log(this.WarehouseInfo.warehouseInfoDate);
  554. },
  555. handleWarehouse: function() {
  556. this.$router.push({ path: "/drugstock/in/add", query: { type: this.type } });
  557. },
  558. handleSelectionChange: function(val) {
  559. this.multipleSelection = val;
  560. },
  561. handleSizeChange(val) {
  562. this.limit = val;
  563. this.GetWarehouse();
  564. },
  565. handleCurrentChange(val) {
  566. this.page = val;
  567. this.GetWarehouse();
  568. },
  569. startTimeChange(val) {
  570. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  571. if (time > 0) {
  572. this.$message.error("结束时间不能小于开始时间");
  573. this.start_time = "";
  574. } else {
  575. this.startTime = this.getTimestamp(val);
  576. this.start_time = val
  577. this.GetWarehouse();
  578. }
  579. },
  580. endTimeChange(val) {
  581. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  582. if (time < 0) {
  583. this.$message.error("结束时间不能小于开始时间");
  584. this.end_time = "";
  585. } else {
  586. this.end_time = val
  587. this.GetWarehouse();
  588. }
  589. },
  590. getTimestamp(time) {
  591. // 把时间日期转成时间戳
  592. return new Date(time).getTime() / 1000;
  593. },
  594. calculate: function(val) {
  595. return Math.round(parseFloat(val) * 100) / 100;
  596. },
  597. // handleEdit: function(index, row) {
  598. // this.$router.push({
  599. // name: "drugStockInDetail",
  600. // query: { id: row.id, type: this.type }
  601. // });
  602. // },
  603. handleEdit:function(index,row){
  604. this.$router.push({
  605. name:"drugStockInOrderEdit",
  606. query:{id:row.id,type:this.type}
  607. })
  608. },
  609. handleSearch(id){
  610. this.WarehouseInfo.warehouseInfoDate=[]
  611. this.GetOrderDetail(id);
  612. this.dialogVisible = true
  613. },
  614. GetOrderDetail(order_id) {
  615. const params = {
  616. id: order_id
  617. };
  618. console.log("parasm222222222",params)
  619. this.WarehouseInfo.warehouseInfoDate = []
  620. getDrugWarehouseInfoList(params).then(response => {
  621. if (response.data.state == 0) {
  622. this.$message.error(response.data.msg);
  623. return false;
  624. } else {
  625. console.log("hhhhhhhhhh",response.data.data.info)
  626. for (let i = 0; i < response.data.data.info.length; i++) {
  627. this.showOne = true
  628. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  629. console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
  630. }
  631. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  632. this.getAllDrugList()
  633. }
  634. });
  635. },
  636. handleDelete: function(index, row) {
  637. const ids = [];
  638. ids.push(row.id);
  639. const idStr = ids.join(",");
  640. const params = {
  641. ids: idStr
  642. };
  643. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  644. confirmButtonText: "确定",
  645. cancelButtonText: "取消",
  646. type: "warning"
  647. })
  648. .then(() => {
  649. deleteDrugWarehouseInfo(params).then(response => {
  650. if (response.data.state == 0) {
  651. this.$message.error(response.data.msg);
  652. return false;
  653. } else {
  654. this.$notify({
  655. title: "成功",
  656. message: "删除成功",
  657. type: "success",
  658. duration: 2000
  659. });
  660. for (let i = 0; i < ids.length; i++) {
  661. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  662. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  663. this.Warehouse.warehouseDate.splice(y, 1);
  664. }
  665. }
  666. }
  667. }
  668. });
  669. })
  670. .catch(() => {});
  671. },
  672. changeAllSelected: function(val) {
  673. if (val) {
  674. this.$refs.multipleTable.toggleAllSelection();
  675. } else {
  676. this.$refs.multipleTable.clearSelection();
  677. }
  678. },
  679. select(selection) {
  680. console.log("selection",selection)
  681. this.order_id = selection[0].id
  682. this.selectedTableData = selection;
  683. },
  684. batchDelete() {
  685. if (this.selectedTableData.length <= 0) {
  686. this.$message.error("请选择要删除的记录");
  687. return;
  688. }
  689. const ids = [];
  690. for (let i = 0; i < this.selectedTableData.length; i++) {
  691. ids.push(this.selectedTableData[i].id);
  692. }
  693. const idStr = ids.join(",");
  694. const params = {
  695. ids: idStr
  696. };
  697. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  698. confirmButtonText: "确定",
  699. cancelButtonText: "取消",
  700. type: "warning"
  701. })
  702. .then(() => {
  703. deleteDrugWarehouseInfo(params).then(response => {
  704. if (response.data.state == 0) {
  705. this.$message.error(response.data.msg);
  706. return false;
  707. } else {
  708. this.$notify({
  709. title: "成功",
  710. message: "删除成功",
  711. type: "success",
  712. duration: 2000
  713. });
  714. for (let i = 0; i < ids.length; i++) {
  715. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  716. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  717. this.Warehouse.warehouseDate.splice(y, 1);
  718. }
  719. }
  720. }
  721. }
  722. });
  723. })
  724. .catch(() => {});
  725. },
  726. handleCurrentChangeOne(val){
  727. this.GetOrderDetail(val.id)
  728. },
  729. getTime(val) {
  730. if(val < 0){
  731. return ""
  732. }
  733. if(val == ""){
  734. return ""
  735. }else {
  736. return uParseTime(val, '{y}-{m}-{d}')
  737. }
  738. },
  739. getDrugType(id){
  740. var name = ""
  741. for(let i=0;i<this.drugTypeList.length;i++){
  742. if(id == this.drugTypeList[i].id){
  743. name = this.drugTypeList[i].name
  744. }
  745. }
  746. return name
  747. },
  748. getAllDrugList(){
  749. getAllDrugList().then(response=>{
  750. if(response.data.state == 1){
  751. var manufacturerList = response.data.data.manufacturerList
  752. this.manufacturerList = manufacturerList
  753. }
  754. })
  755. },
  756. getManufacturer(id){
  757. var name = ""
  758. for(let i=0;i<this.manufacturerList.length;i++){
  759. if(id == this.manufacturerList[i].id){
  760. name = this.manufacturerList[i].manufacturer_name
  761. }
  762. }
  763. return name
  764. },
  765. getDictionaryDataConfig(module, filed_name) {
  766. return getDictionaryDataConfig(module, filed_name)
  767. },
  768. drugPrint(){
  769. if(this.order_id == 0){
  770. this.$message.error("请选择入库单")
  771. }else{
  772. this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})
  773. }
  774. }
  775. }
  776. };
  777. </script>
  778. <style rel="stylesheet/css" lang="scss" scoped>
  779. .information {
  780. border: 1px #dcdfe6 solid;
  781. padding: 30px 20px 30px 20px;
  782. .border {
  783. border-bottom: 1px #dcdfe6 solid;
  784. margin: 0px 0 20px 0;
  785. }
  786. }
  787. .edit_separater {
  788. border-top: 1px solid rgb(233, 233, 233);
  789. margin-top: 15px;
  790. margin-bottom: 15px;
  791. }
  792. </style>
  793. <style>
  794. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  795. font-size: 12px;
  796. }
  797. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  798. background: #6fb5fa;
  799. }
  800. .count {
  801. color: #bd2c00;
  802. }
  803. .el-table td,
  804. .el-table th.is-leaf,
  805. .el-table--border,
  806. .el-table--group {
  807. border-color: #d0d3da;
  808. }
  809. .el-table--border::after,
  810. .el-table--group::after,
  811. .el-table::before {
  812. background-color: #d0d3da;
  813. }
  814. </style>