index.vue 15 KB

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