index.vue 17 KB

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