index.vue 15 KB

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