drugStockOutOrder.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  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="AddNewOrder"
  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. class="filter-item"
  21. v-model.trim="searchKey"
  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"
  71. >删除</el-button
  72. >
  73. </div>
  74. <el-table
  75. :data="warehouseOutDate"
  76. :class="signAndWeighBoxPatients"
  77. style="width: 100%"
  78. border
  79. highlight-current-row
  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. >
  88. <el-table-column type="selection" width="55" align="center"> </el-table-column>
  89. <el-table-column label="单据日期" align="center">
  90. <template slot-scope="scope">
  91. {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="单据编号" align="center">
  95. <template slot-scope="scope">
  96. {{ scope.row.warehouse_out_order_number }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="制单人" align="center">
  100. <template slot-scope="scope">
  101. {{ getXuserName(scope.row.creater) }}
  102. </template>
  103. </el-table-column>
  104. <el-table-column min-width="35" align="center">
  105. <template slot="header" slot-scope="scope">
  106. <span>出库方式</span>
  107. </template>
  108. <template slot-scope="scope">
  109. <span v-if="scope.row.is_sys == 1">{{"自动出库"}}</span>
  110. <span v-if="scope.row.is_sys != 1">{{"手动出库"}}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="厂家" align="center">
  114. <template slot-scope="scope">
  115. {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="经销商" align="center">
  119. <template slot-scope="scope">
  120. {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="操作" align="center" width="240">
  124. <template slot-scope="scope">
  125. <el-tooltip
  126. class="item"
  127. effect="dark"
  128. content="详情"
  129. placement="top"
  130. >
  131. <el-button
  132. size="small"
  133. type="warning"
  134. icon="el-icon-document"
  135. @click="handleSearch(scope.row.id)"
  136. >
  137. </el-button>
  138. </el-tooltip>
  139. <el-tooltip
  140. class="item"
  141. effect="dark"
  142. content="编辑"
  143. placement="top"
  144. >
  145. <el-button
  146. size="mini"
  147. type="primary"
  148. icon="el-icon-edit-outline"
  149. @click="handleEdit(scope.$index, scope.row)"
  150. >
  151. </el-button>
  152. </el-tooltip>
  153. <el-tooltip
  154. class="item"
  155. effect="dark"
  156. content="删除"
  157. placement="top"
  158. >
  159. <el-button
  160. size="mini"
  161. type="danger"
  162. :disabled="scope.row.is_sys == 1"
  163. icon="el-icon-delete"
  164. @click="handleDelete(scope.$index, scope.row)"
  165. >
  166. </el-button>
  167. </el-tooltip>
  168. </template>
  169. </el-table-column>
  170. </el-table>
  171. <el-pagination
  172. @size-change="handleSizeChange"
  173. @current-change="handleCurrentChange"
  174. :page-sizes="[10, 50, 100]"
  175. :page-size="10"
  176. background
  177. style="margin-top:20px;float: right"
  178. layout="total, sizes, prev, pager, next, jumper"
  179. :total="total"
  180. >
  181. </el-pagination>
  182. </div>
  183. <el-dialog
  184. title="出库详细"
  185. :visible.sync="dialogVisible"
  186. width="60%"
  187. >
  188. <span>
  189. <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
  190. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  191. :span-method="merge"
  192. >
  193. <el-table-column min-width="35" align="center">
  194. <template slot="header" slot-scope="scope">
  195. <span>药品名称</span>
  196. </template>
  197. <template slot-scope="scope">
  198. <span v-if="scope.row.drug_id != 0">{{
  199. scope.row.drug.drug_name
  200. }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column min-width="35" align="center">
  204. <template slot="header" slot-scope="scope">
  205. <span>规格名称</span>
  206. </template>
  207. <template slot-scope="scope">
  208. <span v-if="scope.row.drug_id != 0">{{
  209. scope.row.drug?scope.row.drug.drug_spec:''
  210. }}</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column min-width="23" align="center">
  214. <template slot="header" slot-scope="scope">
  215. <span>单价</span>
  216. </template>
  217. <template slot-scope="scope">
  218. <span>{{scope.row.price}}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column min-width="23" align="center">
  222. <template slot="header" slot-scope="scope">
  223. <span>出库数量</span>
  224. </template>
  225. <template slot-scope="scope">
  226. <span>{{scope.row.count}}</span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="总价" min-width="20" align="center">
  230. <template slot-scope="scope">
  231. {{calculate(scope.row.price*scope.row.count)}}
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="备注" min-width="20" align="center">
  235. <template slot-scope="scope">
  236. <el-popover placement="top-start" width="250" trigger="hover">
  237. <div>{{scope.row.remark}}</div>
  238. <span slot="reference"
  239. v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
  240. <span slot="reference" v-else>{{ scope.row.remark}}</span>
  241. </el-popover>
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="" align="center" >
  245. <template slot-scope="scope" v-if="scope.row.is_sys == 1">
  246. <div style="color: #589ff8" @click="jump(scope.row.id)">使用明细</div>
  247. </template>
  248. </el-table-column>
  249. </el-table>
  250. </span>
  251. <span slot="footer" class="dialog-footer">
  252. <el-button @click="dialogVisible = false">取 消</el-button>
  253. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  254. </span>
  255. </el-dialog>
  256. <el-dialog
  257. title="出库明细"
  258. :visible.sync="dialogVisibleTwo"
  259. width="60%">
  260. <span>
  261. <div class="app-container">
  262. <div class="filter-container">
  263. <span style="font-size: 18px;color: #606266">商品使用明细</span>
  264. </div>
  265. <div class="cell clearfix">
  266. <span style="width: 300px;color: #606266" v-if="userList.length>0">商品类型: {{userList[0].drug.drug_name}} </span>
  267. <span style="width: 300px;color: #606266" v-if="userList.length>0">规格名称: {{userList[0].drug.drug_spec}}</span>
  268. </div>
  269. <el-row :gutter="12" style="margin-top: 10px">
  270. <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
  271. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  272. >
  273. <el-table-column min-width="35" align="center">
  274. <template slot="header" slot-scope="scope">
  275. <span>序号</span>
  276. </template>
  277. <template slot-scope="scope">
  278. <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
  279. <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
  280. </template>
  281. </el-table-column>
  282. <el-table-column min-width="35" align="center">
  283. <template slot="header" slot-scope="scope">
  284. <span>使用人</span>
  285. </template>
  286. <template slot-scope="scope">
  287. <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
  288. <span v-if="scope.row.is_total == 1"></span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column min-width="35" align="center">
  292. <template slot="header" slot-scope="scope">
  293. <span>使用数量</span>
  294. </template>
  295. <template slot-scope="scope">
  296. <span >{{scope.row.count}}</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column min-width="35" align="center">
  300. <template slot="header" slot-scope="scope">
  301. <span>使用时间</span>
  302. </template>
  303. <template slot-scope="scope">
  304. <span v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
  305. <span v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
  306. </template>
  307. </el-table-column>
  308. </el-table>
  309. </el-row>
  310. </div>
  311. </span>
  312. <span slot="footer" class="dialog-footer">
  313. <el-button @click="dialogVisibleTwo = false">取 消</el-button>
  314. <el-button type="primary" @click="dialogVisibleTwo = false">确 定</el-button>
  315. </span>
  316. </el-dialog>
  317. </div>
  318. </template>
  319. <script>
  320. import { uParseTime } from "@/utils/tools";
  321. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  322. import {
  323. deleteDrugWarehouseOut,
  324. GetAllConfig,
  325. getDrugWarehouseOutList,
  326. getDrugWarehouseOutInfo,
  327. getDrugWarehouseOutUser
  328. } from "@/api/drug/drug_stock";
  329. import BreadCrumb from "../../components/bread-crumb";
  330. export default {
  331. name: "salesReturnOrder",
  332. components: { BreadCrumb },
  333. created() {
  334. var nowDate = new Date();
  335. var nowYear = nowDate.getFullYear();
  336. var nowMonth = nowDate.getMonth() + 1;
  337. var nowDay = nowDate.getDate();
  338. this.end_time =
  339. nowYear +
  340. "-" +
  341. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  342. "-" +
  343. (nowDay < 10 ? "0" + nowDay : nowDay);
  344. nowDate.setMonth(nowDate.getMonth() - 1);
  345. nowYear = nowDate.getFullYear();
  346. nowMonth = nowDate.getMonth() + 1;
  347. nowDay = nowDate.getDate();
  348. this.start_time =
  349. nowYear +
  350. "-" +
  351. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  352. "-" +
  353. (nowDay < 10 ? "0" + nowDay : nowDay);
  354. this.GetWarehouseOut();
  355. this.GetConfigInfo();
  356. this.fetchAllAdminUsers();
  357. },
  358. data() {
  359. return {
  360. searchKey: "",
  361. crumbs: [
  362. { path: false, name: "库存管理" },
  363. { path: false, name: "出库单" }
  364. ],
  365. page: 1,
  366. limit: 10,
  367. checked: false,
  368. total: 0,
  369. pageTotal: 0,
  370. pageSelect: 0,
  371. adminUserOptions: [],
  372. multipleSelection: [],
  373. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  374. start_time: "",
  375. warehouseOutDate: [],
  376. end_time: "",
  377. goodType: [],
  378. goodInfo: [],
  379. manufacturer: [],
  380. selectedTableData: [],
  381. dealer: [],
  382. type: 1,
  383. dialogVisible:false,
  384. dialogVisibleTwo:false,
  385. warehousingOutInfo: {
  386. loading: false,
  387. warehousingOutData: [],
  388. info: {}
  389. },
  390. userList:[],
  391. };
  392. },
  393. methods: {
  394. search: function() {
  395. const Params = {
  396. page: this.page,
  397. limit: this.limit,
  398. start_time: this.start_time,
  399. end_time: this.end_time,
  400. type: this.type,
  401. keywords: this.searchKey
  402. };
  403. this.warehouseOutDate = [];
  404. getDrugWarehouseOutList(Params).then(response => {
  405. if (response.data.state == 0) {
  406. this.$message.error(response.data.msg);
  407. return false;
  408. } else {
  409. this.total = response.data.data.total;
  410. for (let i = 0; i < response.data.data.list.length; i++) {
  411. this.warehouseOutDate.push(response.data.data.list[i]);
  412. }
  413. }
  414. });
  415. },
  416. AddNewOrder: function() {
  417. this.$router.push({
  418. name: "drugStockOutOrderAdd",
  419. query: { type: this.type }
  420. });
  421. },
  422. GetWarehouseOut: function() {
  423. const Params = {
  424. page: this.page,
  425. limit: this.limit,
  426. start_time: this.start_time,
  427. end_time: this.end_time,
  428. type: this.type
  429. };
  430. this.warehouseOutDate = [];
  431. getDrugWarehouseOutList(Params).then(response => {
  432. if (response.data.state == 0) {
  433. this.$message.error(response.data.msg);
  434. return false;
  435. } else {
  436. this.total = response.data.data.total;
  437. for (let i = 0; i < response.data.data.list.length; i++) {
  438. this.warehouseOutDate.push(response.data.data.list[i]);
  439. }
  440. }
  441. });
  442. },
  443. getXuserName(id) {
  444. if (id <= 0) {
  445. return "";
  446. }
  447. var name = "";
  448. if (
  449. this.adminUserOptions == null ||
  450. typeof this.adminUserOptions.length === "undefined"
  451. ) {
  452. return name;
  453. }
  454. var leng = this.adminUserOptions.length;
  455. if (leng == 0) {
  456. return name;
  457. }
  458. for (let index = 0; index < leng; index++) {
  459. if (this.adminUserOptions[index].id == id) {
  460. name = this.adminUserOptions[index].name;
  461. break;
  462. }
  463. }
  464. return name;
  465. },
  466. fetchAllAdminUsers() {
  467. fetchAllAdminUsers().then(response => {
  468. console.log(response);
  469. if (response.data.state == 1) {
  470. this.adminUserOptions = response.data.data.users;
  471. var alen = this.adminUserOptions.length;
  472. for (let index = 0; index < alen; index++) {
  473. if (this.adminUserOptions[index].user_type == 2) {
  474. // this.doctorOptions.push(this.adminUserOptions[index]);
  475. }
  476. }
  477. }
  478. });
  479. },
  480. handleSelectionChange: function(val) {
  481. this.multipleSelection = val;
  482. },
  483. handleSizeChange(val) {
  484. this.limit = val;
  485. this.GetWarehouseOut();
  486. },
  487. handleCurrentChange(val) {
  488. this.page = val;
  489. this.GetWarehouseOut();
  490. },
  491. startTimeChange(val) {
  492. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  493. if (time > 0) {
  494. this.$message.error("结束时间不能小于开始时间");
  495. this.start_time = "";
  496. } else {
  497. this.GetWarehouseOut();
  498. }
  499. this.GetWarehouseOut();
  500. },
  501. endTimeChange(val) {
  502. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  503. if (time < 0) {
  504. this.$message.error("结束时间不能小于开始时间");
  505. this.end_time = "";
  506. } else {
  507. this.GetWarehouseOut();
  508. }
  509. },
  510. getTimestamp(time) {
  511. // 把时间日期转成时间戳
  512. return new Date(time).getTime() / 1000;
  513. },
  514. calculate: function(val) {
  515. return Math.round(parseFloat(val) * 100) / 100;
  516. },
  517. GetConfigInfo: function() {
  518. GetAllConfig().then(response => {
  519. if (response.data.state == 0) {
  520. this.$message.error(response.data.msg);
  521. return false;
  522. } else {
  523. this.manufacturer = response.data.data.manufacturer;
  524. this.dealer = response.data.data.dealer;
  525. }
  526. });
  527. },
  528. handleEdit: function(index, row) {
  529. this.$router.push({
  530. name: "drugStockOutDetail",
  531. query: { id: row.id, type: this.type }
  532. });
  533. },
  534. handleSearch(id){
  535. this.warehousingOutInfo.warehousingOutData = []
  536. this.GetOrderDetail(id)
  537. this.dialogVisible = true
  538. },
  539. GetOrderDetail(order_id) {
  540. const params = {
  541. 'id': order_id
  542. }
  543. getDrugWarehouseOutInfo(params).then(response => {
  544. if (response.data.state == 0) {
  545. this.$message.error(response.data.msg)
  546. return false
  547. } else {
  548. this.warehousingOutInfo.warehousingOutData=[]
  549. for (let i = 0; i < response.data.data.list.length; i++) {
  550. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  551. }
  552. this.warehousingOutInfo.info = response.data.data.info
  553. this.handleSpanTempArr()
  554. }
  555. })
  556. },
  557. handleDelete: function(index, row) {
  558. const ids = [];
  559. ids.push(row.id);
  560. const idStr = ids.join(",");
  561. const params = {
  562. ids: idStr
  563. };
  564. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  565. confirmButtonText: "确定",
  566. cancelButtonText: "取消",
  567. type: "warning"
  568. })
  569. .then(() => {
  570. deleteDrugWarehouseOut(params).then(response => {
  571. if (response.data.state == 0) {
  572. this.$message.error(response.data.msg);
  573. return false;
  574. } else {
  575. this.$notify({
  576. title: "成功",
  577. message: "删除成功",
  578. type: "success",
  579. duration: 2000
  580. });
  581. for (let i = 0; i < ids.length; i++) {
  582. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  583. if (ids[i] == this.warehouseOutDate[y].id) {
  584. this.warehouseOutDate.splice(y, 1);
  585. }
  586. }
  587. }
  588. }
  589. });
  590. })
  591. .catch(() => {});
  592. },
  593. changeAllSelected: function(val) {
  594. if (val) {
  595. this.$refs.multipleTable.toggleAllSelection();
  596. } else {
  597. this.$refs.multipleTable.clearSelection();
  598. }
  599. },
  600. select(selection) {
  601. this.selectedTableData = selection;
  602. },
  603. batchDelete() {
  604. if (this.selectedTableData.length <= 0) {
  605. this.$message.error("请选择要删除的记录");
  606. return;
  607. }
  608. const ids = [];
  609. for (let i = 0; i < this.selectedTableData.length; i++) {
  610. ids.push(this.selectedTableData[i].id);
  611. }
  612. const idStr = ids.join(",");
  613. const params = {
  614. ids: idStr
  615. };
  616. this.$confirm("确认删除退货单记录?", "删除退货单记录", {
  617. confirmButtonText: "确定",
  618. cancelButtonText: "取消",
  619. type: "warning"
  620. })
  621. .then(() => {
  622. deleteDrugWarehouseOut(params).then(response => {
  623. if (response.data.state == 0) {
  624. this.$message.error(response.data.msg);
  625. return false;
  626. } else {
  627. this.$notify({
  628. title: "成功",
  629. message: "删除成功",
  630. type: "success",
  631. duration: 2000
  632. });
  633. for (let i = 0; i < ids.length; i++) {
  634. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  635. if (ids[i] == this.warehouseOutDate[y].id) {
  636. this.warehouseOutDate.splice(y, 1);
  637. }
  638. }
  639. }
  640. }
  641. });
  642. })
  643. .catch(() => {});
  644. },
  645. jump(id){
  646. this.GetOrderDetailTwo(id)
  647. this.userList=[]
  648. this.dialogVisibleTwo = true
  649. },
  650. GetOrderDetailTwo(order_id) {
  651. const params = {
  652. 'id': order_id
  653. }
  654. getDrugWarehouseOutUser(params).then(response => {
  655. if (response.data.state == 0) {
  656. this.$message.error(response.data.msg)
  657. return false
  658. } else {
  659. this.userList=[]
  660. var total = 0
  661. for (let i = 0; i < response.data.data.list.length; i++) {
  662. var obj = response.data.data.list[i]
  663. obj['is_total'] = 0
  664. this.userList.push(obj)
  665. total = total + response.data.data.list[i].count
  666. }
  667. this.userList.push({
  668. is_total: 1,
  669. total: total,
  670. })
  671. console.log(this.userList)
  672. }
  673. })
  674. },
  675. merge({ row, column, rowIndex, columnIndex }) {
  676. if (columnIndex === 0) {
  677. const _row = this.tempArr[rowIndex]
  678. const _col = _row > 0 ? 1 : 0
  679. return {
  680. rowspan: _row,
  681. colspan: _col
  682. }
  683. }
  684. },
  685. handleSpanTempArr(){
  686. this.tempArr = []
  687. for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
  688. if (i === 0) {
  689. this.tempArr.push(1)
  690. this.pos = 0
  691. } else {
  692. // 判断当前元素与上一个元素是否相同
  693. if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
  694. this.tempArr[this.pos] += 1
  695. this.tempArr.push(0)
  696. } else {
  697. this.tempArr.push(1)
  698. this.pos = i
  699. }
  700. }
  701. }
  702. let sameRowArr = [], sIdx = 0
  703. this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
  704. item.index = index
  705. if (index === 0) {
  706. sameRowArr.push([index])
  707. } else {
  708. if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
  709. sameRowArr[sIdx].push(index)
  710. } else {
  711. sIdx = sIdx + 1
  712. sameRowArr.push([index])
  713. }
  714. }
  715. })
  716. this.sameRowArr = sameRowArr
  717. }
  718. }
  719. };
  720. </script>
  721. <style rel="stylesheet/scss" lang="scss">
  722. .app-container {
  723. // margin: 20px;
  724. font-size: 15px;
  725. .filter-container {
  726. padding-bottom: 5px;
  727. }
  728. .search-component {
  729. width: 500px;
  730. .searchBox {
  731. width: 300px;
  732. height: 36px;
  733. line-height: 36px;
  734. padding-left: 15px;
  735. border: 1px #dcdfe6 solid;
  736. border-right: none;
  737. outline: none;
  738. float: left;
  739. border-radius: 6px 0 0 6px;
  740. font-size: 14px;
  741. color: #333;
  742. background: #fff;
  743. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  744. }
  745. .searchBtn {
  746. background-color: #409eff;
  747. color: #fff;
  748. font-size: 15px;
  749. text-align: center;
  750. height: 36px;
  751. line-height: 36px;
  752. float: left;
  753. outline: none;
  754. width: 70px;
  755. border: none;
  756. border-radius: 0 6px 6px 0;
  757. font-family: "Microsoft Yahei";
  758. cursor: pointer;
  759. }
  760. }
  761. .amount {
  762. font-weight: normal;
  763. padding: 10px 0 0 0;
  764. color: #606266;
  765. font-size: 14px;
  766. span {
  767. color: #ef2525;
  768. font-family: "Arial";
  769. padding: 0 2px;
  770. }
  771. }
  772. }
  773. .el-table td,
  774. .el-table th.is-leaf,
  775. .el-table--border,
  776. .el-table--group {
  777. border-color: #d0d3da;
  778. }
  779. .el-table--border::after,
  780. .el-table--group::after,
  781. .el-table::before {
  782. background-color: #d0d3da;
  783. }
  784. </style>