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

drugStockOutOrder.vue 32KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  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. </div>
  14. <div class="app-container">
  15. <div class="cell clearfix">
  16. <el-input
  17. size="small"
  18. style="width: 400px;"
  19. class="filter-item"
  20. v-model.trim="searchKey"
  21. placeholder="单据编码/制单人/厂商"
  22. />
  23. <el-button
  24. size="small"
  25. class="filter-item"
  26. type="primary"
  27. icon="el-icon-search"
  28. @click="search"
  29. >搜索</el-button
  30. >
  31. </div>
  32. <div class="cell clearfix">
  33. <label class="title"><span class="name">出库时间</span> : </label>
  34. <el-date-picker
  35. size="small"
  36. v-model="start_time"
  37. prefix-icon="el-icon-date"
  38. :editable="false"
  39. style="width: 196px;"
  40. type="date"
  41. placeholder="选择日期时间"
  42. align="right"
  43. format="yyyy-MM-dd"
  44. value-format="yyyy-MM-dd"
  45. @change="startTimeChange"
  46. ></el-date-picker>
  47. <span class="cellLine"> - </span>
  48. <el-date-picker
  49. size="small"
  50. v-model="end_time"
  51. prefix-icon="el-icon-date"
  52. :editable="false"
  53. style="width: 196px;"
  54. type="date"
  55. placeholder="选择日期时间"
  56. align="right"
  57. format="yyyy-MM-dd"
  58. value-format="yyyy-MM-dd"
  59. @change="endTimeChange"
  60. ></el-date-picker>
  61. </div>
  62. <div class="cell clearfix">
  63. <el-checkbox
  64. style="width: 70px"
  65. v-model="checked"
  66. @change="changeAllSelected"
  67. >全选</el-checkbox
  68. >
  69. <el-button size="small" icon="el-icon-delete" @click="batchDelete"
  70. >删除</el-button
  71. >
  72. </div>
  73. <el-table
  74. @current-change="handleSearch"
  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,scope.row.warehouse_out_time,scope.row.warehouse_out_order_number)"
  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. <div v-show="tableShow" style="margin-bottom:10px">
  184. <el-table
  185. :data="tableList"
  186. :class="signAndWeighBoxPatients"
  187. style="width: 100%"
  188. border
  189. highlight-current-row
  190. ref="multipleTable"
  191. @selection-change="select"
  192. :row-style="{ color: '#303133' }"
  193. :header-cell-style="{
  194. backgroundColor: 'rgb(245, 247, 250)',
  195. color: '#606266'
  196. }"
  197. >
  198. <el-table-column type="selection" width="55" align="center"> </el-table-column>
  199. <el-table-column label="药品名称" align="center">
  200. <template slot-scope="scope">
  201. {{scope.row.drug_name}}
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="药品类型" align="center">
  205. <template slot-scope="scope">
  206. {{getDrugType(scope.row.drug_type)}}
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="规格&单位" align="center">
  210. <template slot-scope="scope">
  211. {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
  212. </template>
  213. </el-table-column>
  214. <el-table-column label="批号" align="center">
  215. <template slot-scope="scope">
  216. {{scope.row.number}}
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="出库数量" align="center">
  220. <template slot-scope="scope">
  221. {{scope.row.count}}
  222. </template>
  223. </el-table-column>
  224. <el-table-column label="进货价" align="center">
  225. <template slot-scope="scope">
  226. {{scope.row.price}}
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="总价" align="center">
  230. <template slot-scope="scope">
  231. {{scope.row.total_price}}
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="生产厂家" align="center">
  235. <template slot-scope="scope">
  236. {{getManufacturerName(scope.row.manufacturer)}}
  237. </template>
  238. </el-table-column>
  239. <el-table-column label="生产日期" align="center">
  240. <template slot-scope="scope">
  241. {{getTime(scope.row.product_date)}}
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="有效日期" align="center">
  245. <template slot-scope="scope">
  246. {{getTime(scope.row.expiry_date)}}
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="批准文号" align="center">
  250. <template slot-scope="scope">
  251. {{scope.row.number}}
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="备注" align="center">
  255. <template slot-scope="scope">
  256. {{scope.row.remark}}
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. </div>
  261. <el-dialog
  262. title="出库详细"
  263. :visible.sync="dialogVisible"
  264. width="60%"
  265. >
  266. <span>
  267. <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
  268. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  269. :span-method="merge"
  270. >
  271. <el-table-column min-width="35" align="center">
  272. <template slot="header" slot-scope="scope">
  273. <span>药品名称</span>
  274. </template>
  275. <template slot-scope="scope">
  276. <span v-if="scope.row.drug_id != 0">{{
  277. scope.row.drug.drug_name
  278. }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column min-width="35" align="center">
  282. <template slot="header" slot-scope="scope">
  283. <span>规格名称</span>
  284. </template>
  285. <template slot-scope="scope">
  286. <span v-if="scope.row.drug_id != 0">{{
  287. scope.row.drug?scope.row.drug.drug_spec:''
  288. }}</span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column min-width="23" align="center">
  292. <template slot="header" slot-scope="scope">
  293. <span>单价</span>
  294. </template>
  295. <template slot-scope="scope">
  296. <!-- <span>{{scope.row.price}}</span> -->
  297. <span>{{getRetailPrice(scope.row.drug_id)}}</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column min-width="23" align="center">
  301. <template slot="header" slot-scope="scope">
  302. <span>出库数量</span>
  303. </template>
  304. <template slot-scope="scope">
  305. <span v-if="drugConfig.is_open == 0 || drugConfig.is_open ==2 ">{{scope.row.count}}</span>
  306. <span v-if="drugConfig.is_open ==1">{{getDrugCount(scope.row.drug_id)}}</span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="总价" min-width="20" align="center">
  310. <template slot-scope="scope">
  311. <span v-if="drugConfig.is_open == 0 || drugConfig.is_open == 2">{{(scope.row.count * getRetailPrice(scope.row.drug_id)).toFixed(2)}}</span>
  312. <span v-if="drugConfig.is_open == 1">{{(getRetailPrice(scope.row.drug_id) * getDrugCount(scope.row.drug_id)).toFixed(2)}}</span>
  313. </template>
  314. </el-table-column>
  315. <el-table-column label="备注" min-width="20" align="center">
  316. <template slot-scope="scope">
  317. <el-popover placement="top-start" width="250" trigger="hover">
  318. <div>{{scope.row.remark}}</div>
  319. <span slot="reference"
  320. v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
  321. <span slot="reference" v-else>{{ scope.row.remark}}</span>
  322. </el-popover>
  323. </template>
  324. </el-table-column>
  325. <el-table-column label="" align="center" >
  326. <template slot-scope="scope" v-if="scope.row.is_sys == 1">
  327. <div style="color: #589ff8" @click="jump(scope.row.id)">使用明细</div>
  328. </template>
  329. </el-table-column>
  330. </el-table>
  331. </span>
  332. <span slot="footer" class="dialog-footer">
  333. <el-button @click="dialogVisible = false">取 消</el-button>
  334. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  335. </span>
  336. </el-dialog>
  337. <el-dialog
  338. title="出库明细"
  339. :visible.sync="dialogVisibleTwo"
  340. width="60%">
  341. <span>
  342. <div class="app-container">
  343. <div class="filter-container">
  344. <span style="font-size: 18px;color: #606266">商品使用明细</span>
  345. </div>
  346. <div class="cell clearfix">
  347. <span style="width: 300px;color: #606266" v-if="userList.length>0">商品类型: {{userList[0].drug.drug_name}} </span>
  348. <span style="width: 300px;color: #606266" v-if="userList.length>0">规格名称: {{userList[0].drug.drug_spec}}</span>
  349. </div>
  350. <el-row :gutter="12" style="margin-top: 10px">
  351. <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
  352. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  353. >
  354. <el-table-column min-width="35" align="center">
  355. <template slot="header" slot-scope="scope">
  356. <span>序号</span>
  357. </template>
  358. <template slot-scope="scope">
  359. <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
  360. <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column min-width="35" align="center">
  364. <template slot="header" slot-scope="scope">
  365. <span>使用人</span>
  366. </template>
  367. <template slot-scope="scope">
  368. <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
  369. <span v-if="scope.row.is_total == 1"></span>
  370. </template>
  371. </el-table-column>
  372. <el-table-column min-width="35" align="center">
  373. <template slot="header" slot-scope="scope">
  374. <span>使用数量</span>
  375. </template>
  376. <template slot-scope="scope">
  377. <span >{{scope.row.count}}</span>
  378. </template>
  379. </el-table-column>
  380. <el-table-column min-width="35" align="center">
  381. <template slot="header" slot-scope="scope">
  382. <span>使用时间</span>
  383. </template>
  384. <template slot-scope="scope">
  385. <span v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
  386. <span v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
  387. </template>
  388. </el-table-column>
  389. </el-table>
  390. </el-row>
  391. </div>
  392. </span>
  393. <span slot="footer" class="dialog-footer">
  394. <el-button @click="dialogVisibleTwo = false">取 消</el-button>
  395. <el-button type="primary" @click="dialogVisibleTwo = false">确 定</el-button>
  396. </span>
  397. </el-dialog>
  398. </div>
  399. </template>
  400. <script>
  401. import { uParseTime } from "@/utils/tools";
  402. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  403. import {
  404. deleteDrugWarehouseOut,
  405. GetAllConfig,
  406. getDrugWarehouseOutList,
  407. getDrugWarehouseOutInfo,
  408. getDrugWarehouseOutUser,
  409. getDrugAutoMaticList,
  410. getSinleOrderDetail
  411. } from "@/api/drug/drug_stock";
  412. import BreadCrumb from "../../components/bread-crumb";
  413. import { getInitializtion } from '@/api/stock'
  414. export default {
  415. name: "salesReturnOrder",
  416. components: { BreadCrumb },
  417. created() {
  418. var nowDate = new Date();
  419. var nowYear = nowDate.getFullYear();
  420. var nowMonth = nowDate.getMonth() + 1;
  421. var nowDay = nowDate.getDate();
  422. this.end_time =
  423. nowYear +
  424. "-" +
  425. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  426. "-" +
  427. (nowDay < 10 ? "0" + nowDay : nowDay);
  428. nowDate.setMonth(nowDate.getMonth() - 1);
  429. nowYear = nowDate.getFullYear();
  430. nowMonth = nowDate.getMonth() + 1;
  431. nowDay = nowDate.getDate();
  432. this.start_time =
  433. nowYear +
  434. "-" +
  435. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  436. "-" +
  437. (nowDay < 10 ? "0" + nowDay : nowDay);
  438. this.GetWarehouseOut();
  439. this.GetConfigInfo();
  440. this.fetchAllAdminUsers();
  441. },
  442. data() {
  443. return {
  444. searchKey: "",
  445. crumbs: [
  446. { path: false, name: "库存管理" },
  447. { path: false, name: "出库单" }
  448. ],
  449. page: 1,
  450. limit: 10,
  451. checked: false,
  452. total: 0,
  453. pageTotal: 0,
  454. pageSelect: 0,
  455. adminUserOptions: [],
  456. multipleSelection: [],
  457. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  458. start_time: "",
  459. warehouseOutDate: [],
  460. end_time: "",
  461. goodType: [],
  462. goodInfo: [],
  463. manufacturer: [],
  464. selectedTableData: [],
  465. dealer: [],
  466. type: 1,
  467. dialogVisible:false,
  468. dialogVisibleTwo:false,
  469. warehousingOutInfo: {
  470. loading: false,
  471. warehousingOutData: [],
  472. info: {}
  473. },
  474. userList:[],
  475. list:[],
  476. drugConfig:{},
  477. drugList:[],
  478. tableList:[],
  479. drugTypeList:[],
  480. tableShow:false,
  481. manufacturerList:[],
  482. };
  483. },
  484. methods: {
  485. search: function() {
  486. const Params = {
  487. page: this.page,
  488. limit: this.limit,
  489. start_time: this.start_time,
  490. end_time: this.end_time,
  491. type: this.type,
  492. keywords: this.searchKey
  493. };
  494. this.warehouseOutDate = [];
  495. getDrugWarehouseOutList(Params).then(response => {
  496. if (response.data.state == 0) {
  497. this.$message.error(response.data.msg);
  498. return false;
  499. } else {
  500. this.total = response.data.data.total;
  501. for (let i = 0; i < response.data.data.list.length; i++) {
  502. this.warehouseOutDate.push(response.data.data.list[i]);
  503. }
  504. }
  505. });
  506. },
  507. AddNewOrder: function() {
  508. this.$router.push({
  509. name: "drugStockOutOrderAdd",
  510. query: { type: this.type }
  511. });
  512. },
  513. GetWarehouseOut: function() {
  514. const Params = {
  515. page: this.page,
  516. limit: this.limit,
  517. start_time: this.start_time,
  518. end_time: this.end_time,
  519. type: this.type
  520. };
  521. this.warehouseOutDate = [];
  522. getDrugWarehouseOutList(Params).then(response => {
  523. if (response.data.state == 0) {
  524. this.$message.error(response.data.msg);
  525. return false;
  526. } else {
  527. this.total = response.data.data.total;
  528. for (let i = 0; i < response.data.data.list.length; i++) {
  529. this.warehouseOutDate.push(response.data.data.list[i]);
  530. }
  531. console.log("列表22222",this.warehouseOutDate)
  532. }
  533. });
  534. },
  535. getXuserName(id) {
  536. if (id <= 0) {
  537. return "";
  538. }
  539. var name = "";
  540. if (
  541. this.adminUserOptions == null ||
  542. typeof this.adminUserOptions.length === "undefined"
  543. ) {
  544. return name;
  545. }
  546. var leng = this.adminUserOptions.length;
  547. if (leng == 0) {
  548. return name;
  549. }
  550. for (let index = 0; index < leng; index++) {
  551. if (this.adminUserOptions[index].id == id) {
  552. name = this.adminUserOptions[index].name;
  553. break;
  554. }
  555. }
  556. return name;
  557. },
  558. fetchAllAdminUsers() {
  559. fetchAllAdminUsers().then(response => {
  560. console.log(response);
  561. if (response.data.state == 1) {
  562. this.adminUserOptions = response.data.data.users;
  563. var alen = this.adminUserOptions.length;
  564. for (let index = 0; index < alen; index++) {
  565. if (this.adminUserOptions[index].user_type == 2) {
  566. // this.doctorOptions.push(this.adminUserOptions[index]);
  567. }
  568. }
  569. }
  570. });
  571. },
  572. handleSelectionChange: function(val) {
  573. this.multipleSelection = val;
  574. },
  575. handleSizeChange(val) {
  576. this.limit = val;
  577. this.GetWarehouseOut();
  578. },
  579. handleCurrentChange(val) {
  580. this.page = val;
  581. this.GetWarehouseOut();
  582. },
  583. startTimeChange(val) {
  584. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  585. if (time > 0) {
  586. this.$message.error("结束时间不能小于开始时间");
  587. this.start_time = "";
  588. } else {
  589. this.GetWarehouseOut();
  590. }
  591. this.GetWarehouseOut();
  592. },
  593. endTimeChange(val) {
  594. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  595. if (time < 0) {
  596. this.$message.error("结束时间不能小于开始时间");
  597. this.end_time = "";
  598. } else {
  599. this.GetWarehouseOut();
  600. }
  601. },
  602. getTimestamp(time) {
  603. // 把时间日期转成时间戳
  604. return new Date(time).getTime() / 1000;
  605. },
  606. calculate: function(val) {
  607. return Math.round(parseFloat(val) * 100) / 100;
  608. },
  609. GetConfigInfo: function() {
  610. GetAllConfig().then(response => {
  611. if (response.data.state == 0) {
  612. this.$message.error(response.data.msg);
  613. return false;
  614. } else {
  615. this.manufacturer = response.data.data.manufacturer;
  616. this.dealer = response.data.data.dealer;
  617. }
  618. });
  619. },
  620. handleEdit: function(index, row) {
  621. // this.$router.push({
  622. // name: "drugStockOutDetail",
  623. // query: { id: row.id, type: this.type }
  624. // });
  625. this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type})
  626. },
  627. // handleSearch(id,time,warehouse_out_order_number){
  628. // this.warehousingOutInfo.warehousingOutData = []
  629. // this.GetOrderDetail(id)
  630. // this.list = []
  631. // this.getDrugAutoMaticList(id,time,warehouse_out_order_number)
  632. // this.dialogVisible = true
  633. // },
  634. handleSearch(val){
  635. console.log("val2222222222",val)
  636. this.getInitializtion()
  637. this.getSinleOrderDetail(val.id)
  638. this.list = []
  639. this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
  640. },
  641. GetOrderDetail(order_id) {
  642. const params = {
  643. 'id': order_id
  644. }
  645. getDrugWarehouseOutInfo(params).then(response => {
  646. if (response.data.state == 0) {
  647. this.$message.error(response.data.msg)
  648. return false
  649. } else {
  650. this.tableShow = true
  651. this.warehousingOutInfo.warehousingOutData=[]
  652. for (let i = 0; i < response.data.data.list.length; i++) {
  653. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  654. this.tableList.push(response.data.data.list[i])
  655. }
  656. console.log("详情",this.tableList)
  657. this.warehousingOutInfo.info = response.data.data.info
  658. var manulist = response.data.data.manulist
  659. this.manufacturerList = manulist
  660. console.log("厂家列表",this.manufacturerList)
  661. this.handleSpanTempArr()
  662. }
  663. })
  664. },
  665. handleDelete: function(index, row) {
  666. const ids = [];
  667. ids.push(row.id);
  668. const idStr = ids.join(",");
  669. const params = {
  670. ids: idStr
  671. };
  672. this.$confirm("确认删除出库单记录?", "删除出库单记录", {
  673. confirmButtonText: "确定",
  674. cancelButtonText: "取消",
  675. type: "warning"
  676. })
  677. .then(() => {
  678. deleteDrugWarehouseOut(params).then(response => {
  679. if (response.data.state == 0) {
  680. this.$message.error(response.data.msg);
  681. return false;
  682. } else {
  683. this.$notify({
  684. title: "成功",
  685. message: "删除成功",
  686. type: "success",
  687. duration: 2000
  688. });
  689. for (let i = 0; i < ids.length; i++) {
  690. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  691. if (ids[i] == this.warehouseOutDate[y].id) {
  692. this.warehouseOutDate.splice(y, 1);
  693. }
  694. }
  695. }
  696. }
  697. });
  698. })
  699. .catch(() => {});
  700. },
  701. changeAllSelected: function(val) {
  702. if (val) {
  703. this.$refs.multipleTable.toggleAllSelection();
  704. } else {
  705. this.$refs.multipleTable.clearSelection();
  706. }
  707. },
  708. select(selection) {
  709. this.selectedTableData = selection;
  710. },
  711. batchDelete() {
  712. if (this.selectedTableData.length <= 0) {
  713. this.$message.error("请选择要删除的记录");
  714. return;
  715. }
  716. const ids = [];
  717. for (let i = 0; i < this.selectedTableData.length; i++) {
  718. ids.push(this.selectedTableData[i].id);
  719. }
  720. const idStr = ids.join(",");
  721. const params = {
  722. ids: idStr
  723. };
  724. this.$confirm("确认删除退货单记录?", "删除退货单记录", {
  725. confirmButtonText: "确定",
  726. cancelButtonText: "取消",
  727. type: "warning"
  728. })
  729. .then(() => {
  730. deleteDrugWarehouseOut(params).then(response => {
  731. if (response.data.state == 0) {
  732. this.$message.error(response.data.msg);
  733. return false;
  734. } else {
  735. this.$notify({
  736. title: "成功",
  737. message: "删除成功",
  738. type: "success",
  739. duration: 2000
  740. });
  741. for (let i = 0; i < ids.length; i++) {
  742. for (let y = 0; y < this.warehouseOutDate.length; y++) {
  743. if (ids[i] == this.warehouseOutDate[y].id) {
  744. this.warehouseOutDate.splice(y, 1);
  745. }
  746. }
  747. }
  748. }
  749. });
  750. })
  751. .catch(() => {});
  752. },
  753. jump(id){
  754. this.GetOrderDetailTwo(id)
  755. this.userList=[]
  756. this.dialogVisibleTwo = true
  757. },
  758. GetOrderDetailTwo(order_id) {
  759. const params = {
  760. 'id': order_id
  761. }
  762. getDrugWarehouseOutUser(params).then(response => {
  763. if (response.data.state == 0) {
  764. this.$message.error(response.data.msg)
  765. return false
  766. } else {
  767. this.userList=[]
  768. var total = 0
  769. console.log("888888888888",response.data.data.list)
  770. for (let i = 0; i < response.data.data.list.length; i++) {
  771. var obj = response.data.data.list[i]
  772. obj['is_total'] = 0
  773. this.userList.push(obj)
  774. total = total + response.data.data.list[i].count
  775. }
  776. this.userList.push({
  777. is_total: 1,
  778. total: total,
  779. })
  780. }
  781. })
  782. },
  783. merge({ row, column, rowIndex, columnIndex }) {
  784. if (columnIndex === 0) {
  785. const _row = this.tempArr[rowIndex]
  786. const _col = _row > 0 ? 1 : 0
  787. return {
  788. rowspan: _row,
  789. colspan: _col
  790. }
  791. }
  792. },
  793. handleSpanTempArr(){
  794. this.tempArr = []
  795. for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
  796. if (i === 0) {
  797. this.tempArr.push(1)
  798. this.pos = 0
  799. } else {
  800. // 判断当前元素与上一个元素是否相同
  801. if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
  802. this.tempArr[this.pos] += 1
  803. this.tempArr.push(0)
  804. } else {
  805. this.tempArr.push(1)
  806. this.pos = i
  807. }
  808. }
  809. }
  810. let sameRowArr = [], sIdx = 0
  811. this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
  812. item.index = index
  813. if (index === 0) {
  814. sameRowArr.push([index])
  815. } else {
  816. if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
  817. sameRowArr[sIdx].push(index)
  818. } else {
  819. sIdx = sIdx + 1
  820. sameRowArr.push([index])
  821. }
  822. }
  823. })
  824. this.sameRowArr = sameRowArr
  825. },
  826. getDrugAutoMaticList(id,recordTime,warehouse_out_order_number){
  827. var params = {
  828. warehous_out_id:id,
  829. record_time:recordTime,
  830. warehouse_out_order_number:warehouse_out_order_number,
  831. }
  832. getDrugAutoMaticList(params).then(response=>{
  833. if(response.data.state ==1){
  834. var list = response.data.data.list
  835. console.log("list222222",list)
  836. this.list = list
  837. var drugConfig = response.data.data.drugConfig
  838. console.log("drugconfig",drugConfig)
  839. this.drugConfig = drugConfig
  840. var drugList = response.data.data.drugList
  841. console.log("药品列表",drugList)
  842. this.drugList = drugList
  843. }
  844. })
  845. },
  846. getDrugCount(id){
  847. var count = 0
  848. for(let i=0;i<this.list.length;i++){
  849. if(this.list[i].drug_id == id){
  850. count = this.list[i].Total
  851. }
  852. }
  853. return count
  854. },
  855. getRetailPrice(id){
  856. var price = 0
  857. for(let i=0;i<this.drugList.length;i++){
  858. if(id == this.drugList[i].id){
  859. price = this.drugList[i].retail_price
  860. }
  861. }
  862. return price
  863. },
  864. getTime(val) {
  865. if(val < 0){
  866. return ""
  867. }
  868. if(val == ""){
  869. return ""
  870. }else {
  871. return uParseTime(val, '{y}-{m}-{d}')
  872. }
  873. },
  874. getInitializtion(){
  875. getInitializtion().then(response=>{
  876. if(response.data.state ==1){
  877. var drugTypeList = response.data.data.drugTypeList
  878. console.log("hhhhhhh",drugTypeList)
  879. this.drugTypeList = drugTypeList
  880. }
  881. })
  882. },
  883. getDrugType(id){
  884. var name = ""
  885. for(let i=0;i<this.drugTypeList.length;i++){
  886. if(id == this.drugTypeList[i].value){
  887. name = this.drugTypeList[i].name
  888. }
  889. }
  890. return name
  891. },
  892. getManufacturerName(id){
  893. var name = ""
  894. for(let i=0;i<this.manufacturerList.length;i++){
  895. if(id == this.manufacturerList[i].id){
  896. name = this.manufacturerList[i].manufacturer_name
  897. }
  898. }
  899. return name
  900. },
  901. getSinleOrderDetail(id){
  902. var params = {
  903. id:id,
  904. }
  905. getSinleOrderDetail(params).then(response=>{
  906. if(response.data.state == 1){
  907. this.tableShow = true
  908. this.tableList = []
  909. var list = response.data.data.list
  910. console.log("list",list)
  911. this.tableList = list
  912. }
  913. })
  914. }
  915. }
  916. };
  917. </script>
  918. <style rel="stylesheet/scss" lang="scss">
  919. .app-container {
  920. // margin: 20px;
  921. font-size: 15px;
  922. .filter-container {
  923. padding-bottom: 5px;
  924. }
  925. .search-component {
  926. width: 500px;
  927. .searchBox {
  928. width: 300px;
  929. height: 36px;
  930. line-height: 36px;
  931. padding-left: 15px;
  932. border: 1px #dcdfe6 solid;
  933. border-right: none;
  934. outline: none;
  935. float: left;
  936. border-radius: 6px 0 0 6px;
  937. font-size: 14px;
  938. color: #333;
  939. background: #fff;
  940. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  941. }
  942. .searchBtn {
  943. background-color: #409eff;
  944. color: #fff;
  945. font-size: 15px;
  946. text-align: center;
  947. height: 36px;
  948. line-height: 36px;
  949. float: left;
  950. outline: none;
  951. width: 70px;
  952. border: none;
  953. border-radius: 0 6px 6px 0;
  954. font-family: "Microsoft Yahei";
  955. cursor: pointer;
  956. }
  957. }
  958. .amount {
  959. font-weight: normal;
  960. padding: 10px 0 0 0;
  961. color: #606266;
  962. font-size: 14px;
  963. span {
  964. color: #ef2525;
  965. font-family: "Arial";
  966. padding: 0 2px;
  967. }
  968. }
  969. }
  970. .el-table td,
  971. .el-table th.is-leaf,
  972. .el-table--border,
  973. .el-table--group {
  974. border-color: #d0d3da;
  975. }
  976. .el-table--border::after,
  977. .el-table--group::after,
  978. .el-table::before {
  979. background-color: #d0d3da;
  980. }
  981. </style>