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

stockInDetail.vue 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <div>
  3. <el-button
  4. style="float: right"
  5. size="small"
  6. icon="el-icon-printer"
  7. @click="PrintAction"
  8. type="primary"
  9. >打印
  10. </el-button>
  11. <el-button
  12. style="float: right;margin-right:10px"
  13. size="small"
  14. icon="el-icon-printer"
  15. @click="exportList"
  16. type="primary"
  17. >导出
  18. </el-button>
  19. <div class="cell clearfix">
  20. <el-input
  21. size="small"
  22. style="width: 400px;"
  23. class="filter-item"
  24. v-model.trim="searchKey"
  25. placeholder="单据编码/制单人/规格名称"
  26. />
  27. <el-button
  28. size="small"
  29. class="filter-item"
  30. type="primary"
  31. icon="el-icon-search"
  32. @click="search"
  33. >搜索</el-button
  34. >
  35. </div>
  36. <div class="cell clearfix">
  37. <label class="title"><span class="name">日期查询</span> : </label>
  38. <el-date-picker
  39. size="small"
  40. v-model="start_time"
  41. prefix-icon="el-icon-date"
  42. :editable="false"
  43. style="width: 196px;"
  44. type="date"
  45. placeholder="选择日期时间"
  46. align="right"
  47. format="yyyy-MM-dd"
  48. value-format="yyyy-MM-dd"
  49. @change="startTimeChange"
  50. ></el-date-picker>
  51. <span class="cellLine"> - </span>
  52. <el-date-picker
  53. size="small"
  54. v-model="end_time"
  55. prefix-icon="el-icon-date"
  56. :editable="false"
  57. style="width: 196px;"
  58. type="date"
  59. placeholder="选择日期时间"
  60. align="right"
  61. format="yyyy-MM-dd"
  62. value-format="yyyy-MM-dd"
  63. @change="endTimeChange"
  64. ></el-date-picker>
  65. </div>
  66. <div class="cell clearfix">
  67. <label class="title"><span class="name">单据类型</span> : </label>
  68. <el-select
  69. size="small"
  70. v-model="order_type"
  71. clearable
  72. placeholder="单据类型"
  73. @change="changeType"
  74. >
  75. <el-option
  76. v-for="item in orderTypeArr"
  77. :key="item.value"
  78. :label="item.label"
  79. :value="item.value"
  80. >
  81. </el-option>
  82. </el-select>
  83. </div>
  84. <div class="cell clearfix">
  85. <label class="title"><span class="name">其它</span> : </label>
  86. <el-select
  87. size="small"
  88. v-model="manufacturer_id"
  89. clearable
  90. placeholder="厂商"
  91. @change="changeManufacturer"
  92. >
  93. <el-option
  94. v-for="item in manufacturer"
  95. :key="item.id"
  96. :label="item.manufacturer_name"
  97. :value="item.id"
  98. >
  99. </el-option>
  100. </el-select>
  101. </div>
  102. <el-row :gutter="12" style="margin-top: 10px">
  103. <el-table
  104. :data="cancelStockDate"
  105. :class="signAndWeighBoxPatients"
  106. border
  107. highlight-current-row
  108. ref="multipleTable"
  109. @selection-change="select"
  110. :row-style="{ color: '#303133' }"
  111. :header-cell-style="{
  112. backgroundColor: 'rgb(245, 247, 250)',
  113. color: '#606266'
  114. }"
  115. >
  116. <el-table-column label="单据编号" align="center" width="200">
  117. <template slot-scope="scope">
  118. {{ scope.row.warehousing_order }}
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="耗材类型" align="center">
  122. <template slot-scope="scope">
  123. {{ typeName(scope.row.good_type_id) }}
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="耗材名称" align="center">
  127. <template slot-scope="scope">
  128. {{ typeNameOne(scope.row.good_id) }}
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="规格型号" align="center">
  132. <template slot-scope="scope">
  133. {{ specificationName(scope.row.good_id) }}
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="单据类型" align="center">
  137. <template slot-scope="scope">
  138. {{ getTypeName(scope.row) }}
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="操作时间" align="center">
  142. <template slot-scope="scope">
  143. {{ getTime(scope.row.Warehousing.warehousing_time) }}
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="制单人" align="center">
  147. <template slot-scope="scope">
  148. {{ getXuserName(scope.row.Warehousing.creater) }}
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="进货价" align="center">
  152. <template slot-scope="scope">
  153. {{ scope.row.price }}
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="数量" align="center">
  157. <template slot-scope="scope">
  158. {{ scope.row.warehousing_count }}
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="总价" align="center">
  162. <template slot-scope="scope">
  163. <span v-if="scope.row.is_total == 0">{{
  164. getTotal(scope.row.price, scope.row.warehousing_count)
  165. }}</span>
  166. <span v-else>{{ scope.row.total }}</span>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. <el-pagination
  171. @size-change="handleSizeChange"
  172. @current-change="handleCurrentChange"
  173. :page-sizes="[10, 50, 100]"
  174. :page-size="10"
  175. background
  176. style="margin-top:20px;float: right"
  177. layout="total, sizes, prev, pager, next, jumper"
  178. :total="total"
  179. >
  180. </el-pagination>
  181. </el-row>
  182. </div>
  183. </template>
  184. <script>
  185. import { uParseTime } from "@/utils/tools";
  186. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  187. import {
  188. deleteCancelStock,
  189. GetAllConfig,
  190. getStockDetail,
  191. getPrintStockGood,
  192. } from "@/api/stock";
  193. export default {
  194. name: "stockInDetail",
  195. created() {
  196. var nowDate = new Date();
  197. var nowYear = nowDate.getFullYear();
  198. var nowMonth = nowDate.getMonth() + 1;
  199. var nowDay = nowDate.getDate();
  200. this.end_time =
  201. nowYear +
  202. "-" +
  203. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  204. "-" +
  205. (nowDay < 10 ? "0" + nowDay : nowDay);
  206. nowDate.setMonth(nowDate.getMonth() - 1);
  207. nowYear = nowDate.getFullYear();
  208. nowMonth = nowDate.getMonth() + 1;
  209. nowDay = nowDate.getDate();
  210. this.start_time =
  211. nowYear +
  212. "-" +
  213. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  214. "-" +
  215. (nowDay < 10 ? "0" + nowDay : nowDay);
  216. this.GetCancelStock();
  217. this.GetConfigInfo();
  218. this.fetchAllAdminUsers();
  219. this.goodUnit = this.$store.getters.good_unit
  220. this.getPrintStockGood()
  221. },
  222. data() {
  223. return {
  224. orderTypeArr: [
  225. { value: 1, label: "耗材入库单" },
  226. { value: 2, label: "其他入库单" }
  227. ],
  228. newDate: [{ name: "合计", num: "111111" }],
  229. searchKey: "",
  230. type: 1,
  231. page: 1,
  232. limit: 10,
  233. manufacturer_id: "",
  234. dealer_id: "",
  235. order_type: "",
  236. checked: false,
  237. total: 0,
  238. pageTotal: 0,
  239. pageSelect: 0,
  240. adminUserOptions: [],
  241. multipleSelection: [],
  242. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  243. start_time: "",
  244. cancelStockDate: [],
  245. end_time: "",
  246. goodType: [],
  247. goodInfo: [],
  248. manufacturer: [],
  249. selectedTableData: [],
  250. dealer: [],
  251. tableList:[],
  252. goodUnit:[],
  253. stockTotal:[]
  254. };
  255. },
  256. methods: {
  257. changeType: function(val) {
  258. this.order_type = val;
  259. this.GetCancelStock();
  260. this.getPrintStockGood()
  261. },
  262. changeManufacturer: function(val) {
  263. this.manufacturer_id = val;
  264. this.GetCancelStock();
  265. this.getPrintStockGood()
  266. },
  267. changeDealer: function(val) {
  268. this.dealer_id = val;
  269. this.GetCancelStock();
  270. this.getPrintStockGood()
  271. },
  272. getTypeName: function(row) {
  273. let name = "";
  274. if (row.type == 1) {
  275. name = "耗材入库单";
  276. } else if (row.type == 2) {
  277. name = "其他入库单";
  278. }
  279. return name;
  280. },
  281. typeName: function(good_type_id) {
  282. let name = "";
  283. for (let i = 0; i < this.goodType.length; i++) {
  284. if (this.goodType[i].id == good_type_id) {
  285. name = this.goodType[i].type_name;
  286. }
  287. }
  288. return name;
  289. },
  290. typeNameOne:function(good_id){
  291. let name = "";
  292. for (let i = 0; i < this.goodInfo.length; i++) {
  293. if (this.goodInfo[i].id == good_id) {
  294. name = this.goodInfo[i].good_name;
  295. }
  296. }
  297. return name;
  298. },
  299. specificationName: function(good_info_id) {
  300. let name = "";
  301. for (let i = 0; i < this.goodInfo.length; i++) {
  302. if (this.goodInfo[i].id == good_info_id) {
  303. name = this.goodInfo[i].specification_name;
  304. }
  305. }
  306. return name;
  307. },
  308. search: function() {
  309. const Params = {
  310. page: this.page,
  311. limit: this.limit,
  312. start_time: this.start_time,
  313. end_time: this.end_time,
  314. type: this.type,
  315. keywords: this.searchKey
  316. };
  317. this.cancelStockDate = [];
  318. getStockDetail(Params).then(response => {
  319. if (response.data.state == 0) {
  320. this.$message.error(response.data.msg);
  321. return false;
  322. } else {
  323. this.total = response.data.data.total;
  324. for (let i = 0; i < response.data.data.list.length; i++) {
  325. var obj = response.data.data.list[i];
  326. obj["is_total"] = 0;
  327. this.cancelStockDate.push(obj);
  328. }
  329. this.cancelStockDate.push({
  330. warehousing_order: "合计",
  331. is_total: 1,
  332. total: response.data.data.total_price,
  333. Warehousing: {
  334. warehousing_time: 0
  335. }
  336. });
  337. }
  338. });
  339. },
  340. getTime: function(val) {
  341. if (val == 0) {
  342. return "";
  343. } else {
  344. return uParseTime(val, "{y}-{m}-{d}");
  345. }
  346. },
  347. AddNewOrder: function() {
  348. this.$router.push({
  349. name: "cancelStockOrderAdd",
  350. query: { type: this.type }
  351. });
  352. },
  353. GetCancelStock: function() {
  354. const Params = {
  355. page: this.page,
  356. limit: this.limit,
  357. start_time: this.start_time,
  358. end_time: this.end_time,
  359. type: this.type,
  360. manufacturer: this.manufacturer_id,
  361. order_type: this.order_type,
  362. dealer: this.dealer_id
  363. };
  364. this.cancelStockDate = [];
  365. getStockDetail(Params).then(response => {
  366. if (response.data.state == 0) {
  367. this.$message.error(response.data.msg);
  368. return false;
  369. } else {
  370. this.total = response.data.data.total;
  371. console.log("数据源头list2222222",response.data.data.list)
  372. for (let i = 0; i < response.data.data.list.length; i++) {
  373. var obj = response.data.data.list[i];
  374. obj["is_total"] = 0;
  375. this.cancelStockDate.push(obj);
  376. // this.tableList.push(obj)
  377. }
  378. this.cancelStockDate.push({
  379. warehousing_order: "合计",
  380. is_total: 1,
  381. total: response.data.data.total_price,
  382. Warehousing: {
  383. warehousing_time: 0
  384. }
  385. });
  386. }
  387. });
  388. },
  389. getXuserName(id) {
  390. if (id <= 0) {
  391. return "";
  392. }
  393. var name = "";
  394. if (
  395. this.adminUserOptions == null ||
  396. typeof this.adminUserOptions.length === "undefined"
  397. ) {
  398. return name;
  399. }
  400. var leng = this.adminUserOptions.length;
  401. if (leng == 0) {
  402. return name;
  403. }
  404. for (let index = 0; index < leng; index++) {
  405. if (this.adminUserOptions[index].id == id) {
  406. name = this.adminUserOptions[index].name;
  407. break;
  408. }
  409. }
  410. return name;
  411. },
  412. fetchAllAdminUsers() {
  413. fetchAllAdminUsers().then(response => {
  414. console.log(response);
  415. if (response.data.state == 1) {
  416. this.adminUserOptions = response.data.data.users;
  417. var alen = this.adminUserOptions.length;
  418. for (let index = 0; index < alen; index++) {
  419. if (this.adminUserOptions[index].user_type == 2) {
  420. // this.doctorOptions.push(this.adminUserOptions[index]);
  421. }
  422. }
  423. }
  424. });
  425. },
  426. handleSelectionChange: function(val) {
  427. this.multipleSelection = val;
  428. },
  429. handleSizeChange(val) {
  430. this.limit = val;
  431. this.GetCancelStock();
  432. this.getPrintStockGood()
  433. },
  434. handleCurrentChange(val) {
  435. this.page = val;
  436. this.GetCancelStock();
  437. this.getPrintStockGood()
  438. },
  439. startTimeChange(val) {
  440. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  441. if (time > 0) {
  442. this.$message.error("结束时间不能小于开始时间");
  443. this.start_time = "";
  444. } else {
  445. this.GetCancelStock();
  446. this.getPrintStockGood()
  447. }
  448. },
  449. endTimeChange(val) {
  450. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  451. if (time < 0) {
  452. this.$message.error("结束时间不能小于开始时间");
  453. this.end_time = "";
  454. } else {
  455. this.GetCancelStock();
  456. this.getPrintStockGood()
  457. }
  458. },
  459. getTimestamp(time) {
  460. // 把时间日期转成时间戳
  461. return new Date(time).getTime() / 1000;
  462. },
  463. calculate: function(val) {
  464. return Math.round(parseFloat(val) * 100) / 100;
  465. },
  466. GetConfigInfo: function() {
  467. GetAllConfig().then(response => {
  468. if (response.data.state == 0) {
  469. this.$message.error(response.data.msg);
  470. return false;
  471. } else {
  472. this.manufacturer = response.data.data.manufacturer;
  473. this.dealer = response.data.data.dealer;
  474. this.goodInfo = response.data.data.goodInfo;
  475. this.goodType = response.data.data.goodType;
  476. }
  477. });
  478. },
  479. getManufactuerName: function(manufacturer_id) {
  480. for (let i = 0; i < this.manufacturer.length; i++) {
  481. if (this.manufacturer[i].id == manufacturer_id) {
  482. return this.manufacturer[i].manufacturer_name;
  483. }
  484. }
  485. },
  486. getDealerName: function(dealer_id) {
  487. for (let i = 0; i < this.dealer.length; i++) {
  488. if (this.dealer[i].id == dealer_id) {
  489. return this.dealer[i].dealer_name;
  490. }
  491. }
  492. },
  493. handleEdit: function(index, row) {
  494. this.$router.push({
  495. name: "cancelStockDetail",
  496. query: { id: row.id, type: this.type }
  497. });
  498. },
  499. handleDelete: function(index, row) {
  500. const ids = [];
  501. ids.push(row.id);
  502. const idStr = ids.join(",");
  503. const params = {
  504. ids: idStr
  505. };
  506. this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
  507. confirmButtonText: "确定",
  508. cancelButtonText: "取消",
  509. type: "warning"
  510. })
  511. .then(() => {
  512. deleteCancelStock(params).then(response => {
  513. if (response.data.state == 0) {
  514. this.$message.error(response.data.msg);
  515. return false;
  516. } else {
  517. this.$notify({
  518. title: "成功",
  519. message: "删除成功",
  520. type: "success",
  521. duration: 2000
  522. });
  523. for (let i = 0; i < ids.length; i++) {
  524. for (let y = 0; y < this.cancelStockDate.length; y++) {
  525. if (ids[i] == this.cancelStockDate[y].id) {
  526. this.cancelStockDate.splice(y, 1);
  527. }
  528. }
  529. }
  530. }
  531. });
  532. })
  533. .catch(() => {});
  534. },
  535. changeAllSelected: function(val) {
  536. if (val) {
  537. this.$refs.multipleTable.toggleAllSelection();
  538. } else {
  539. this.$refs.multipleTable.clearSelection();
  540. }
  541. },
  542. select(selection) {
  543. this.selectedTableData = selection;
  544. },
  545. batchDelete() {
  546. if (this.selectedTableData.length <= 0) {
  547. this.$message.error("请选择要删除的记录");
  548. return;
  549. }
  550. const ids = [];
  551. for (let i = 0; i < this.selectedTableData.length; i++) {
  552. ids.push(this.selectedTableData[i].id);
  553. }
  554. const idStr = ids.join(",");
  555. const params = {
  556. ids: idStr
  557. };
  558. this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
  559. confirmButtonText: "确定",
  560. cancelButtonText: "取消",
  561. type: "warning"
  562. })
  563. .then(() => {
  564. deleteCancelStock(params).then(response => {
  565. if (response.data.state == 0) {
  566. this.$message.error(response.data.msg);
  567. return false;
  568. } else {
  569. this.$notify({
  570. title: "成功",
  571. message: "删除成功",
  572. type: "success",
  573. duration: 2000
  574. });
  575. for (let i = 0; i < ids.length; i++) {
  576. for (let y = 0; y < this.cancelStockDate.length; y++) {
  577. if (ids[i] == this.cancelStockDate[y].id) {
  578. this.cancelStockDate.splice(y, 1);
  579. }
  580. }
  581. }
  582. }
  583. });
  584. })
  585. .catch(() => {});
  586. },
  587. getTotal: function(price, total) {
  588. var m = 0,
  589. r1,
  590. r2;
  591. var s1 = price.toString();
  592. var s2 = total.toString();
  593. try {
  594. m += s1.split(".")[1].length;
  595. } catch (e) {}
  596. try {
  597. } catch (e) {
  598. m += s2.split(".")[1].length;
  599. }
  600. r1 = Number(price.toString().replace(".", ""));
  601. r2 = Number(total.toString().replace(".", ""));
  602. return (r1 * r2) / Math.pow(10, m);
  603. },
  604. PrintAction: function() {
  605. this.$router.push({
  606. path: "/stock/print",
  607. query: {
  608. type: 1,
  609. start_time: this.start_time,
  610. end_time: this.end_time
  611. }
  612. });
  613. },
  614. getPrintStockGood(){
  615. const params = {
  616. start_time:this.start_time,
  617. end_time:this.end_time,
  618. type:1,
  619. }
  620. getPrintStockGood(params).then(response=>{
  621. if(response.data.state == 1){
  622. var stockTotal = response.data.data.stockTotal
  623. this.stockTotal = stockTotal
  624. var list = response.data.data.list
  625. for(let i=0;i<list.length;i++){
  626. if (list[i].query_warehousing_info.length > 0) {
  627. this.tableList.push(list[i])
  628. }
  629. }
  630. }
  631. })
  632. },
  633. calCount(stock) {
  634. let total = 0
  635. var array = []
  636. array = stock.query_warehousing_info
  637. for (let i = 0; i < array.length; i++) {
  638. total = total + array[i].warehousing_count
  639. }
  640. return total
  641. },
  642. calTotal(stock) {
  643. var array = []
  644. array = stock.query_warehousing_info
  645. let total_price = 0.0
  646. for (let i = 0; i < array.length; i++) {
  647. total_price = total_price + array[i].warehousing_count * array[i].price
  648. }
  649. return Math.floor(total_price * 100) / 100
  650. },
  651. calTotalPrice() {
  652. var amountPrice = 0
  653. for (let i = 0; i < this.tableList.length; i++) {
  654. var obj = this.tableList[i]
  655. var len = 0
  656. len = obj.query_warehousing_info.length
  657. let total_price = 0.0
  658. for (let a = 0; a < len; a++) {
  659. total_price = total_price + obj.query_warehousing_info[a].total_price
  660. }
  661. amountPrice = amountPrice + Math.floor(total_price* 100) / 100
  662. }
  663. return Math.floor(amountPrice* 100) / 100
  664. },
  665. getStockCount(id){
  666. var count = ""
  667. for(let i=0;i<this.stockTotal.length;i++){
  668. if(id == this.stockTotal[i].good_id){
  669. count = this.stockTotal[i].count
  670. }
  671. }
  672. return count
  673. },
  674. getTotal: function(price, total) {
  675. var m = 0, r1, r2
  676. var s1 = price.toString()
  677. var s2 = total.toString()
  678. try {
  679. m += s1.split('.')[1].length
  680. } catch (e) {
  681. }
  682. try {
  683. } catch (e) {
  684. m += s2.split('.')[1].length
  685. }
  686. r1 = Number(price.toString().replace('.', ''))
  687. r2 = Number(total.toString().replace('.', ''))
  688. return r1 * r2 / Math.pow(10, m)
  689. },
  690. unique(arr) {
  691. const res = new Map();
  692. return arr.filter((arr) => !res.has(arr.specification_name) && res.set(arr.specification_name, 1));
  693. },
  694. exportList(){
  695. var obj = {index:"合计",total:0}
  696. obj.total = this.calTotalPrice()
  697. for(let i=0;i<this.tableList.length;i++){
  698. this.tableList[i].index = i+1
  699. this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
  700. this.tableList[i].count = this.calCount(this.tableList[i])
  701. this.tableList[i].total = this.calTotal(this.tableList[i])
  702. this.tableList[i].price = this.tableList[i].query_warehousing_info[0].price
  703. this.tableList[i].remark = this.tableList[i].query_warehousing_info[0].remark
  704. }
  705. var arr = this.unique(this.tableList)
  706. console.log("arrrr",arr)
  707. this.tableList = arr
  708. this.tableList.push(obj)
  709. console.log("数据222222",this.tableList)
  710. import('@/vendor/Export2Excel').then(excel => {
  711. const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
  712. const filterVal = ['index','good_name', 'specification_name', 'min_unit','count','price','total','remark']
  713. const data = this.formatJson(filterVal, this.tableList)
  714. excel.export_json_to_excel({
  715. header: tHeader,
  716. data,
  717. filename: '耗材入库明细'
  718. })
  719. this.downloadLoading = false
  720. })
  721. },
  722. formatJson(filterVal, jsonData) {
  723. return jsonData.map(v => filterVal.map(j => v[j]));
  724. },
  725. getUnit(id){
  726. var name = ""
  727. for(let i=0;i<this.goodUnit.length;i++){
  728. if(this.goodUnit[i].id == id){
  729. name = this.goodUnit[i].name
  730. }
  731. }
  732. return name
  733. },
  734. }
  735. };
  736. </script>
  737. <style rel="stylesheet/css" lang="scss" scoped>
  738. .information {
  739. border: 1px #dcdfe6 solid;
  740. padding: 30px 20px 30px 20px;
  741. .border {
  742. border-bottom: 1px #dcdfe6 solid;
  743. margin: 0px 0 20px 0;
  744. }
  745. }
  746. .edit_separater {
  747. border-top: 1px solid rgb(233, 233, 233);
  748. margin-top: 15px;
  749. margin-bottom: 15px;
  750. }
  751. </style>
  752. <style>
  753. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  754. font-size: 12px;
  755. }
  756. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  757. background: #6fb5fa;
  758. }
  759. .count {
  760. color: #bd2c00;
  761. }
  762. .el-table td,
  763. .el-table th.is-leaf,
  764. .el-table--border,
  765. .el-table--group {
  766. border-color: #d0d3da;
  767. }
  768. .el-table--border::after,
  769. .el-table--group::after,
  770. .el-table::before {
  771. background-color: #d0d3da;
  772. }
  773. </style>