index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item prop="durgBrand">
  11. <el-input
  12. v-model="queryParams.durgBrand"
  13. placeholder="请输入品牌"
  14. clearable
  15. size="small"
  16. @input="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item>
  20. <!-- <el-button
  21. type="primary"
  22. icon="el-icon-search"
  23. size="mini"
  24. @click="handleQuery"
  25. >搜索</el-button
  26. > -->
  27. <el-button size="btr" @click="resetQuery">重置</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <el-table
  31. v-loading="loading"
  32. :data="bdgldurgputinList"
  33. @selection-change="handleSelectionChange"
  34. :header-cell-style="{ background: '#003C69', color: 'white' }"
  35. >
  36. <el-table-column type="selection" width="55" align="center" />
  37. <el-table-column label="序号" align="center">
  38. <template scope="scope">
  39. <span>{{
  40. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  41. }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="入库编号" align="center" prop="number" />
  45. <el-table-column label="药品名称" align="center" prop="durgName" />
  46. <el-table-column label="品牌" align="center" prop="durgBrand" />
  47. <el-table-column label="生产厂商" align="center" prop="manufacturer" />
  48. <el-table-column label="规格" align="center" prop="specifications" />
  49. <el-table-column label="单位" align="center" prop="unitName" />
  50. <el-table-column label="库房" align="center" prop="storeHouse">
  51. <template slot-scope="scope">
  52. <dict-tag
  53. :options="dict.type.storage_room"
  54. :value="scope.row.storeHouse"
  55. />
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="入库位置" align="center" prop="place" />
  59. <el-table-column label="入库数量" align="center" prop="putIn" />
  60. <el-table-column label="剩余库存" align="center" prop="surplus" />
  61. <el-table-column label="药品来源" align="center" prop="source" />
  62. <!-- <el-table-column label="入库说明" align="center" prop="remarks" /> -->
  63. <el-table-column
  64. label="过期日期"
  65. align="center"
  66. prop="overduedate"
  67. width="180"
  68. >
  69. <template slot-scope="scope">
  70. <span>{{ parseTime(scope.row.overduedate, "{y}-{m}-{d}") }}</span>
  71. </template>
  72. </el-table-column>
  73. <!-- <el-table-column
  74. label="入库时间"
  75. align="center"
  76. prop="putTime"
  77. width="180"
  78. >
  79. <template slot-scope="scope">
  80. <span>{{ parseTime(scope.row.putTime, "{y}-{m}-{d}") }}</span>
  81. </template>
  82. </el-table-column> -->
  83. <!-- <el-table-column label="录入人(创建人)" align="center" prop="adminId" /> -->
  84. <!-- <el-table-column label="编号" align="center" prop="number" /> -->
  85. <!-- <el-table-column
  86. label="功能主治"
  87. align="center"
  88. prop="productIntroduction"
  89. /> -->
  90. <!-- <el-table-column label="库房" align="center" prop="unitId" /> -->
  91. <el-table-column
  92. label="操作"
  93. align="center"
  94. class-name="small-padding fixed-width"
  95. >
  96. <template slot-scope="scope">
  97. <el-button
  98. v-if="scope.row.status != '1'"
  99. size="btu"
  100. type="text"
  101. @click="handleUpdate(scope.row)"
  102. v-hasPermi="['medicalhealth:bdgldurgputin:edit']"
  103. >销毁</el-button
  104. >
  105. <el-button
  106. v-if="scope.row.status == '1'"
  107. size="btd"
  108. type="text"
  109. v-hasPermi="['medicalhealth:bdgldurgputin:remove']"
  110. >已销毁</el-button
  111. >
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <pagination
  116. v-show="total > 0"
  117. :total="total"
  118. :page.sync="queryParams.pageNum"
  119. :limit.sync="queryParams.pageSize"
  120. @pagination="getList"
  121. />
  122. <!-- 添加或修改药品入库登记对话框 -->
  123. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  124. <el-form
  125. ref="form"
  126. :model="form"
  127. :rules="rules"
  128. label-width="80px"
  129. inline
  130. >
  131. <el-form-item label="入库编号" prop="number">
  132. <el-input v-model="form.number" placeholder="请输入药品来源" />
  133. </el-form-item>
  134. <el-form-item label="药品名称" prop="durgName">
  135. <el-select v-model="form.durgName" placeholder="请选择药品名称">
  136. <el-option
  137. v-for="(item, i) in yaoList"
  138. :key="i"
  139. :value="item.id"
  140. :label="item.yaoPinName"
  141. @click.native="yapPing(item)"
  142. >
  143. </el-option>
  144. </el-select>
  145. </el-form-item>
  146. <el-form-item label="药品来源" prop="source">
  147. <el-input v-model="form.source" placeholder="请输入药品来源" />
  148. </el-form-item>
  149. <el-form-item label="入库数量" prop="putIn">
  150. <el-input v-model="form.putIn" placeholder="请输入入库数量" />
  151. </el-form-item>
  152. <el-form-item label="入库位置" prop="place">
  153. <el-input v-model="form.place" placeholder="请输入入库位置" />
  154. </el-form-item>
  155. <el-form-item label="入库时间" prop="putTime">
  156. <el-date-picker
  157. clearable
  158. size="small"
  159. v-model="form.putTime"
  160. type="date"
  161. value-format="yyyy-MM-dd"
  162. placeholder="选择入库时间"
  163. >
  164. </el-date-picker>
  165. </el-form-item>
  166. <!-- <el-form-item label="入库说明" prop="remarks">
  167. <el-input v-model="form.remarks" placeholder="请输入入库说明" />
  168. </el-form-item> -->
  169. <el-form-item label="过期日期" prop="overduedate">
  170. <el-date-picker
  171. clearable
  172. size="small"
  173. v-model="form.overduedate"
  174. type="date"
  175. value-format="yyyy-MM-dd"
  176. placeholder="选择过期日期"
  177. >
  178. </el-date-picker>
  179. </el-form-item>
  180. <div class="jiben">入库说明</div>
  181. <el-form-item prop="remarks">
  182. <el-input
  183. v-model="form.remarks"
  184. type="textarea"
  185. placeholder="请输入内容"
  186. />
  187. </el-form-item>
  188. <!-- <el-form-item label="录入人(创建人)" prop="adminId">
  189. <el-select v-model="form.adminId" placeholder="请选择录入人(创建人)">
  190. <el-option label="请选择字典生成" value="" />
  191. </el-select>
  192. </el-form-item>
  193. <el-form-item label="编号" prop="number">
  194. <el-input v-model="form.number" placeholder="请输入编号" />
  195. </el-form-item>
  196. <el-form-item label="剩余库存" prop="surplus">
  197. <el-input v-model="form.surplus" placeholder="请输入剩余库存" />
  198. </el-form-item>
  199. <el-form-item label="是否销毁">
  200. <el-radio-group v-model="form.status">
  201. <el-radio label="1">请选择字典生成</el-radio>
  202. </el-radio-group>
  203. </el-form-item>
  204. <el-form-item label="品牌" prop="durgBrand">
  205. <el-input v-model="form.durgBrand" placeholder="请输入品牌" />
  206. </el-form-item>
  207. <el-form-item label="生产厂商" prop="manufacturer">
  208. <el-input v-model="form.manufacturer" placeholder="请输入生产厂商" />
  209. </el-form-item>
  210. <el-form-item label="规格" prop="specifications">
  211. <el-input v-model="form.specifications" placeholder="请输入规格" />
  212. </el-form-item>
  213. <el-form-item label="功能主治" prop="productIntroduction">
  214. <el-input
  215. v-model="form.productIntroduction"
  216. placeholder="请输入功能主治"
  217. />
  218. </el-form-item>
  219. <el-form-item label="库房" prop="storeHouse">
  220. <el-select v-model="form.storeHouse" placeholder="请选择库房">
  221. <el-option
  222. v-for="dict in dict.type.storage_room"
  223. :key="dict.value"
  224. :label="dict.label"
  225. :value="parseInt(dict.value)"
  226. ></el-option>
  227. </el-select>
  228. </el-form-item> -->
  229. </el-form>
  230. <div slot="footer" class="dialog-footer">
  231. <el-button type="primary" @click="submitForm">确 定</el-button>
  232. <el-button @click="cancel">取 消</el-button>
  233. </div>
  234. </el-dialog>
  235. </div>
  236. </template>
  237. <script>
  238. import {
  239. listBdgldurgputin,
  240. updateBdgldurgputin,
  241. delBdgldurgputin,
  242. addBdgldurgputin,
  243. exportBdgldurgputin,
  244. exportYao,
  245. getBdgldurgputin,
  246. } from "@/api/medicalhealth/bdgldurgputin";
  247. import {
  248. exportYaoPing,
  249. exportYaoPingXiaoHui,
  250. } from "@/api/medicalhealth/consumeputin";
  251. export default {
  252. name: "Bdgldurgputin",
  253. dicts: ["storage_room"],
  254. data() {
  255. return {
  256. // 遮罩层
  257. loading: true,
  258. // 导出遮罩层
  259. exportLoading: false,
  260. // 选中数组
  261. ids: [],
  262. // 非单个禁用
  263. single: true,
  264. // 非多个禁用
  265. multiple: true,
  266. // 显示搜索条件
  267. showSearch: true,
  268. // 总条数
  269. total: 0,
  270. // 药品入库登记表格数据
  271. bdgldurgputinList: [],
  272. // 弹出层标题
  273. title: "",
  274. // 是否显示弹出层
  275. open: false,
  276. // 查询参数
  277. queryParams: {
  278. pageNum: 1,
  279. pageSize: 10,
  280. durgArchivesId: null,
  281. putIn: null,
  282. place: null,
  283. source: null,
  284. remarks: null,
  285. overduedate: null,
  286. putTime: null,
  287. adminId: null,
  288. number: null,
  289. surplus: null,
  290. status: null,
  291. durgBrand: null,
  292. manufacturer: null,
  293. specifications: null,
  294. productIntroduction: null,
  295. storeHouse: null,
  296. unitId: null,
  297. },
  298. // 表单参数
  299. form: {},
  300. // 表单校验
  301. rules: {},
  302. // 药品列表
  303. yaoList: [],
  304. // 药品销毁
  305. bdglDurgPutin: "",
  306. };
  307. },
  308. created() {
  309. this.getList();
  310. },
  311. methods: {
  312. // 药品名称触发赋值
  313. yapPing(data) {
  314. // console.log(data);
  315. this.form.unitId = data.unitId;
  316. this.form.unitName = data.unitName;
  317. this.form.manufacturer = data.manufacturer;
  318. this.form.specifications = data.specifications;
  319. this.form.storeHouse = data.storeHouse;
  320. this.form.durgArchivesId = data.id;
  321. this.form.durgBrand = data.durgBrand;
  322. },
  323. // 查询药品名称列表
  324. getYaoPing() {
  325. exportYao().then((response) => {
  326. this.yaoList = response.data;
  327. });
  328. },
  329. /** 查询药品入库登记列表 */
  330. getList() {
  331. this.loading = true;
  332. exportYaoPing(this.queryParams).then((response) => {
  333. console.log(response);
  334. this.bdgldurgputinList = response.rows;
  335. this.total = response.total;
  336. this.loading = false;
  337. });
  338. },
  339. // 取消按钮
  340. cancel() {
  341. this.open = false;
  342. this.reset();
  343. },
  344. // 表单重置
  345. reset() {
  346. this.form = {
  347. id: null,
  348. durgArchivesId: null,
  349. putIn: null,
  350. place: null,
  351. source: null,
  352. remarks: null,
  353. overduedate: null,
  354. putTime: null,
  355. adminId: null,
  356. createTime: null,
  357. updateTime: null,
  358. number: null,
  359. surplus: null,
  360. status: "0",
  361. durgBrand: null,
  362. manufacturer: null,
  363. specifications: null,
  364. productIntroduction: null,
  365. storeHouse: null,
  366. unitId: null,
  367. };
  368. this.resetForm("form");
  369. },
  370. /** 搜索按钮操作 */
  371. handleQuery() {
  372. this.queryParams.pageNum = 1;
  373. this.getList();
  374. },
  375. /** 重置按钮操作 */
  376. resetQuery() {
  377. this.resetForm("queryForm");
  378. this.handleQuery();
  379. },
  380. // 多选框选中数据
  381. handleSelectionChange(selection) {
  382. this.ids = selection.map((item) => item.id);
  383. this.single = selection.length !== 1;
  384. this.multiple = !selection.length;
  385. },
  386. /** 新增按钮操作 */
  387. handleAdd() {
  388. this.reset();
  389. this.getYaoPing();
  390. this.open = true;
  391. this.title = "添加药品入库登记";
  392. },
  393. /** 销毁按钮操作 */
  394. handleUpdate(row) {
  395. this.reset();
  396. const id = row.id || this.ids;
  397. this.$modal
  398. .confirm("是否确认销毁药品的数据项?", {
  399. confirmButtonText: "确定",
  400. cancelButtonText: "取消",
  401. })
  402. .then(() => {
  403. exportYaoPingXiaoHui(id).then((response) => {
  404. this.$modal.msgSuccess("销毁成功");
  405. this.getList();
  406. });
  407. })
  408. .catch(() => {});
  409. // exportYaoPingXiaoHui(id).then((response) => {
  410. // this.form = response.data;
  411. // this.getYaoPing();
  412. // this.open = true;
  413. // this.title = "修改药品入库登记";
  414. // });
  415. },
  416. /** 提交按钮 */
  417. submitForm() {
  418. this.$refs["form"].validate((valid) => {
  419. if (valid) {
  420. if (this.form.id != null) {
  421. updateBdgldurgputin(this.form).then((response) => {
  422. this.$modal.msgSuccess("修改成功");
  423. this.open = false;
  424. this.getList();
  425. });
  426. } else {
  427. addBdgldurgputin(this.form).then((response) => {
  428. this.$modal.msgSuccess("新增成功");
  429. this.open = false;
  430. this.getList();
  431. });
  432. }
  433. }
  434. });
  435. },
  436. /** 删除按钮操作 */
  437. handleDelete(row) {
  438. const ids = row.id || this.ids;
  439. this.$modal
  440. .confirm("是否确认删除药品入库登记的数据项?")
  441. .then(function () {
  442. return delBdgldurgputin(ids);
  443. })
  444. .then(() => {
  445. this.getList();
  446. this.$modal.msgSuccess("删除成功");
  447. })
  448. .catch(() => {});
  449. },
  450. /** 导出按钮操作 */
  451. handleExport() {
  452. const queryParams = this.queryParams;
  453. this.$modal
  454. .confirm("是否确认导出所有药品入库登记数据项?")
  455. .then(() => {
  456. this.exportLoading = true;
  457. return exportBdgldurgputin(queryParams);
  458. })
  459. .then((response) => {
  460. this.$download.name(response.msg);
  461. this.exportLoading = false;
  462. })
  463. .catch(() => {});
  464. },
  465. },
  466. };
  467. </script>
  468. <style scoped>
  469. /* 对话框背景颜色 */
  470. ::v-deep .el-dialog {
  471. background: #004d86 !important;
  472. }
  473. ::v-deep .el-textarea__inner {
  474. width: 920px;
  475. height: 104px;
  476. margin: auto;
  477. }
  478. ::v-deep .el-dialog__header {
  479. border-bottom: 1px solid #718a9d;
  480. }
  481. ::v-deep .el-dialog__title {
  482. color: #fff;
  483. font: 18px;
  484. }
  485. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  486. color: #fff;
  487. }
  488. ::v-deep .el-form-item__label {
  489. font: 16px;
  490. color: #fff;
  491. width: 100px !important;
  492. }
  493. ::v-deep .el-input__inner {
  494. /* width: 200px !important;
  495. height: 36px; */
  496. background: transparent;
  497. color: #fff;
  498. border: 1px solid white !important;
  499. }
  500. /* 单位框背景颜色 */
  501. ::v-deep .vue-treeselect__control {
  502. background: #004d86 !important;
  503. }
  504. /* 基本信息背景 */
  505. .jiben {
  506. width: 920px;
  507. height: 32px;
  508. background-image: url(../../../images/小标题底.png);
  509. margin-bottom: 25px;
  510. color: #fff;
  511. padding-left: 16px;
  512. line-height: 32px;
  513. }
  514. /*调整表单间距 */
  515. ::v-deep .el-form-item__content {
  516. width: 200px;
  517. }
  518. ::v-deep .el-input__inner {
  519. cursor: pointer !important;
  520. }
  521. /* 底部确定取消按钮 */
  522. ::v-deep .el-dialog__footer {
  523. padding: 30px 50px;
  524. }
  525. ::v-deep .el-dialog__body {
  526. margin: 10px 30px 20px 50px;
  527. padding-top: 20px !important;
  528. box-sizing: border-box;
  529. /* padding: 30px 12px 30px 28px; */
  530. }
  531. .contents {
  532. padding: 0px 40px !important;
  533. }
  534. /* 下拉菜单 */
  535. .el-dropdown-link {
  536. cursor: pointer;
  537. color: #409eff;
  538. }
  539. .el-icon-arrow-down {
  540. font-size: 12px;
  541. }
  542. /* 刷新图标 */
  543. /* .el-icon-refresh {
  544. width: 76px;
  545. height: 36px;
  546. color: #fff;
  547. background-color: #1d96ff !important;
  548. border-radius: 4px;
  549. border: none;
  550. margin-left: 20px;
  551. font-size: 14px;
  552. } */
  553. /* 下拉菜单字体/背景颜色 */
  554. .el-select-dropdown__item.hover,
  555. .el-select-dropdown__item:hover {
  556. background-color: #004d86;
  557. color: #fff;
  558. }
  559. .el-select-dropdown__item {
  560. color: #fff;
  561. }
  562. /* 时间选择 */
  563. ::v-deep .el-input--small .el-input__inner {
  564. width: 200px;
  565. height: 36px;
  566. line-height: 36px;
  567. }
  568. .el-date-editor.el-input {
  569. width: 200px;
  570. height: 36px;
  571. line-height: 36px;
  572. }
  573. ::v-deep .el-date-editor.el-input .el-input__inner {
  574. height: 36px;
  575. line-height: 36px;
  576. }
  577. /* 单位框背景颜色 */
  578. ::v-deep .vue-treeselect__control {
  579. background: #004d86 !important;
  580. color: #fff;
  581. }
  582. /* 单位下拉菜单选中字体颜色 */
  583. ::v-deep .vue-treeselect__single-value {
  584. color: #fff !important;
  585. }
  586. /* 分页按钮 */
  587. ::v-deep .el-pagination.is-background .el-pager li {
  588. background-color: #004d86;
  589. color: #fff;
  590. }
  591. ::v-deep .el-pagination.is-background .btn-next {
  592. background-color: #004d86;
  593. color: #fff;
  594. }
  595. /* 底部确定取消按钮 */
  596. ::v-deep .el-dialog__footer {
  597. padding: 18px 42px 30px 0px;
  598. margin-right: 30px;
  599. }
  600. /* 增加按钮弹框 */
  601. ::v-deep .el-dialog {
  602. width: 1060px !important;
  603. }
  604. ::v-deep .el-dialog__body {
  605. padding: none !important;
  606. }
  607. ::v-deep .box4 .el-textarea__inner {
  608. min-height: 120px !important;
  609. }
  610. /* 调整输入框提示文字颜色 */
  611. ::v-deep .vue-treeselect__placeholder {
  612. color: #bdbdbd4f !important;
  613. }
  614. ::v-deep input::-webkit-input-placeholder {
  615. color: #bdbdbd4f !important;
  616. }
  617. ::v-deep input:-moz-placeholder {
  618. color: #bdbdbd4f !important;
  619. }
  620. </style>