index.vue 17 KB

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