stockInDetail.vue 24KB

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