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

cancelStockDetail.vue 24KB

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