index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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 label="变更后人员名称" prop="propertyId">
  11. <el-input
  12. v-model="queryParams.propertyId"
  13. placeholder="请输入变更后人员名称"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. />
  18. </el-form-item> -->
  19. <el-form-item label="" prop="name">
  20. <el-input
  21. v-model="queryParams.name"
  22. placeholder="请输入营具名称"
  23. clearable
  24. size="small"
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <!-- <el-form-item label="营具编号" prop="rukuNumber">
  29. <el-input
  30. v-model="queryParams.rukuNumber"
  31. placeholder="请输入营具编号"
  32. clearable
  33. size="small"
  34. @keyup.enter.native="handleQuery"
  35. />
  36. </el-form-item> -->
  37. <el-form-item label="" prop="changeTime">
  38. <el-input
  39. v-model="queryParams.changeTime"
  40. placeholder="请输入变更时间"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <!-- <el-form-item label="变更前所属单位" prop="beforeUnitId">
  47. <el-input
  48. v-model="queryParams.beforeUnitId"
  49. placeholder="请输入变更前所属单位"
  50. clearable
  51. size="small"
  52. @keyup.enter.native="handleQuery"
  53. />
  54. </el-form-item>
  55. <el-form-item label="变更后所属单位" prop="afterUnitId">
  56. <el-input
  57. v-model="queryParams.afterUnitId"
  58. placeholder="请输入变更后所属单位"
  59. clearable
  60. size="small"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. <el-form-item label="变更前人员名称" prop="beforePeopleId">
  65. <el-input
  66. v-model="queryParams.beforePeopleId"
  67. placeholder="请输入变更前人员名称"
  68. clearable
  69. size="small"
  70. @keyup.enter.native="handleQuery"
  71. />
  72. </el-form-item>
  73. <el-form-item label="变更后人员名称" prop="afterPeopleId">
  74. <el-input
  75. v-model="queryParams.afterPeopleId"
  76. placeholder="请输入变更后人员名称"
  77. clearable
  78. size="small"
  79. @keyup.enter.native="handleQuery"
  80. />
  81. </el-form-item>
  82. <el-form-item label="变更后人员名称" prop="createtime">
  83. <el-input
  84. v-model="queryParams.createtime"
  85. placeholder="请输入变更后人员名称"
  86. clearable
  87. size="small"
  88. @keyup.enter.native="handleQuery"
  89. />
  90. </el-form-item>
  91. <el-form-item label="变更后人员名称" prop="updatetime">
  92. <el-input
  93. v-model="queryParams.updatetime"
  94. placeholder="请输入变更后人员名称"
  95. clearable
  96. size="small"
  97. @keyup.enter.native="handleQuery"
  98. />
  99. </el-form-item>
  100. <el-form-item label="变更前单位名称" prop="beforeUnitName">
  101. <el-input
  102. v-model="queryParams.beforeUnitName"
  103. placeholder="请输入变更前单位名称"
  104. clearable
  105. size="small"
  106. @keyup.enter.native="handleQuery"
  107. />
  108. </el-form-item>
  109. <el-form-item label="变更后单位名称" prop="afterUnitName">
  110. <el-input
  111. v-model="queryParams.afterUnitName"
  112. placeholder="请输入变更后单位名称"
  113. clearable
  114. size="small"
  115. @keyup.enter.native="handleQuery"
  116. />
  117. </el-form-item>
  118. <el-form-item label="变更前人员名称" prop="beforePeopleName">
  119. <el-input
  120. v-model="queryParams.beforePeopleName"
  121. placeholder="请输入变更前人员名称"
  122. clearable
  123. size="small"
  124. @keyup.enter.native="handleQuery"
  125. />
  126. </el-form-item>
  127. <el-form-item label="变更后人员名称" prop="afterPeopleName">
  128. <el-input
  129. v-model="queryParams.afterPeopleName"
  130. placeholder="请输入变更后人员名称"
  131. clearable
  132. size="small"
  133. @keyup.enter.native="handleQuery"
  134. />
  135. </el-form-item> -->
  136. <el-form-item>
  137. <!-- <el-button type="primary" size="btn" @click="handleQuery"
  138. >搜索</el-button
  139. > -->
  140. <el-button size="btr" @click="resetQuery">重置</el-button>
  141. </el-form-item>
  142. </el-form>
  143. <el-row :gutter="10" class="mb8">
  144. <el-col :span="1.5">
  145. <el-button
  146. type="primary"
  147. plain
  148. icon="el-icon-plus"
  149. size="mini"
  150. @click="handleAdd"
  151. v-hasPermi="['materialManagement:propertyChange:add']"
  152. >新增</el-button
  153. >
  154. </el-col>
  155. <el-col :span="1.5">
  156. <el-button
  157. type="success"
  158. plain
  159. icon="el-icon-edit"
  160. size="mini"
  161. :disabled="single"
  162. @click="handleUpdate"
  163. v-hasPermi="['materialManagement:propertyChange:edit']"
  164. >修改</el-button
  165. >
  166. </el-col>
  167. <el-col :span="1.5">
  168. <el-button
  169. type="danger"
  170. plain
  171. icon="el-icon-delete"
  172. size="mini"
  173. :disabled="multiple"
  174. @click="handleDelete"
  175. v-hasPermi="['materialManagement:propertyChange:remove']"
  176. >删除</el-button
  177. >
  178. </el-col>
  179. <el-col :span="1.5">
  180. <el-button
  181. type="warning"
  182. plain
  183. icon="el-icon-download"
  184. size="mini"
  185. :loading="exportLoading"
  186. @click="handleExport"
  187. v-hasPermi="['materialManagement:propertyChange:export']"
  188. >导出</el-button
  189. >
  190. </el-col>
  191. <!-- <right-toolbar
  192. :showSearch.sync="showSearch"
  193. @queryTable="getList"
  194. ></right-toolbar> -->
  195. </el-row>
  196. <el-table
  197. v-loading="loading"
  198. :data="propertyChangeList"
  199. @selection-change="handleSelectionChange"
  200. :header-cell-style="{ background: '#003C69', color: 'white' }"
  201. >
  202. <el-table-column type="selection" width="55" align="center" />
  203. <el-table-column label="变更后人员名称" align="center" prop="id" />
  204. <el-table-column
  205. label="变更后人员名称"
  206. align="center"
  207. prop="propertyId"
  208. />
  209. <el-table-column label="营具名称" align="center" prop="name" />
  210. <el-table-column label="营具编号" align="center" prop="rukuNumber" />
  211. <el-table-column label="变更时间" align="center" prop="changeTime" />
  212. <el-table-column
  213. label="变更前所属单位"
  214. align="center"
  215. prop="beforeUnitId"
  216. />
  217. <el-table-column
  218. label="变更后所属单位"
  219. align="center"
  220. prop="afterUnitId"
  221. />
  222. <el-table-column
  223. label="变更前人员名称"
  224. align="center"
  225. prop="beforePeopleId"
  226. />
  227. <el-table-column
  228. label="变更后人员名称"
  229. align="center"
  230. prop="afterPeopleId"
  231. />
  232. <el-table-column label="备注" align="center" prop="remark" />
  233. <el-table-column label="备注" align="center" prop="createtime" />
  234. <el-table-column label="备注" align="center" prop="updatetime" />
  235. <!-- <el-table-column
  236. label="变更前单位名称"
  237. align="center"
  238. prop="beforeUnitName"
  239. />
  240. <el-table-column
  241. label="变更后单位名称"
  242. align="center"
  243. prop="afterUnitName"
  244. />
  245. <el-table-column
  246. label="变更前人员名称"
  247. align="center"
  248. prop="beforePeopleName"
  249. />
  250. <el-table-column
  251. label="变更后人员名称"
  252. align="center"
  253. prop="afterPeopleName"
  254. /> -->
  255. <el-table-column
  256. label="操作"
  257. align="center"
  258. class-name="small-padding fixed-width"
  259. >
  260. <template slot-scope="scope">
  261. <el-button
  262. size="btu"
  263. type="text"
  264. @click="handleUpdate(scope.row)"
  265. v-hasPermi="['materialManagement:propertyChange:edit']"
  266. >修改</el-button
  267. >
  268. <el-button
  269. size="btd"
  270. type="text"
  271. @click="handleDelete(scope.row)"
  272. v-hasPermi="['materialManagement:propertyChange:remove']"
  273. >删除</el-button
  274. >
  275. </template>
  276. </el-table-column>
  277. </el-table>
  278. <pagination
  279. v-show="total > 0"
  280. :total="total"
  281. :page.sync="queryParams.pageNum"
  282. :limit.sync="queryParams.pageSize"
  283. @pagination="getList"
  284. />
  285. <!-- 添加或修改营具物资变更对话框 -->
  286. <el-dialog
  287. :title="title"
  288. :visible.sync="open"
  289. width="1016px"
  290. append-to-body
  291. :close-on-click-modal="false"
  292. >
  293. <div class="jiben">基本信息</div>
  294. <el-form
  295. ref="form"
  296. :model="form"
  297. :rules="rules"
  298. label-width="80px"
  299. :inline="true"
  300. >
  301. <!-- <el-form-item label="变更后人员名称" prop="propertyId">
  302. <el-input
  303. v-model="form.propertyId"
  304. placeholder="请输入变更后人员名称"
  305. />
  306. </el-form-item> -->
  307. <el-form-item label="物品名称" prop="name">
  308. <el-select
  309. v-model="form.name"
  310. placeholder="请选择物品名称"
  311. ></el-select>
  312. </el-form-item>
  313. <el-form-item label="营具编号" prop="rukuNumber">
  314. <el-input v-model="form.rukuNumber" placeholder="请输入营具编号" />
  315. </el-form-item>
  316. <el-form-item label="变更时间" prop="changeTime">
  317. <el-input v-model="form.changeTime" placeholder="请输入变更时间" />
  318. </el-form-item>
  319. <el-form-item label="变更前所属单位" prop="beforeUnitId">
  320. <el-select
  321. v-model="form.beforeUnitId"
  322. placeholder="请输入变更前所属单位"
  323. ></el-select>
  324. </el-form-item>
  325. <el-form-item label="变更前人员名称" prop="beforePeopleId">
  326. <el-select
  327. v-model="form.beforePeopleId"
  328. placeholder="请输入变更前人员名称"
  329. ></el-select>
  330. </el-form-item>
  331. <el-form-item label="变更后所属单位" prop="afterUnitId">
  332. <el-select
  333. v-model="form.afterUnitId"
  334. placeholder="请输入变更后所属单位"
  335. ></el-select>
  336. </el-form-item>
  337. <el-form-item label="变更后人员名称" prop="afterPeopleId">
  338. <el-select
  339. v-model="form.afterPeopleId"
  340. placeholder="请输入变更后人员名称"
  341. ></el-select>
  342. </el-form-item>
  343. <!-- <el-form-item label="变更前单位名称" prop="beforeUnitName">
  344. <el-input
  345. v-model="form.beforeUnitName"
  346. placeholder="请输入变更前单位名称"
  347. />
  348. </el-form-item>
  349. <el-form-item label="变更后单位名称" prop="afterUnitName">
  350. <el-input
  351. v-model="form.afterUnitName"
  352. placeholder="请输入变更后单位名称"
  353. />
  354. </el-form-item>
  355. <el-form-item label="变更前人员名称" prop="beforePeopleName">
  356. <el-input
  357. v-model="form.beforePeopleName"
  358. placeholder="请输入变更前人员名称"
  359. />
  360. </el-form-item>
  361. <el-form-item label="变更后人员名称" prop="afterPeopleName">
  362. <el-input
  363. v-model="form.afterPeopleName"
  364. placeholder="请输入变更后人员名称"
  365. />
  366. </el-form-item> -->
  367. <div class="jiben">备注</div>
  368. <el-form-item label="" prop="remark">
  369. <el-input
  370. v-model="form.remark"
  371. type="textarea"
  372. placeholder="请输入内容"
  373. />
  374. </el-form-item>
  375. </el-form>
  376. <div slot="footer" class="dialog-footer">
  377. <el-button type="primary" @click="submitForm">确 定</el-button>
  378. <el-button @click="cancel" size="btn">取 消</el-button>
  379. </div>
  380. </el-dialog>
  381. </div>
  382. </template>
  383. <script>
  384. import {
  385. listPropertyChange,
  386. getPropertyChange,
  387. delPropertyChange,
  388. addPropertyChange,
  389. updatePropertyChange,
  390. exportPropertyChange,
  391. } from "@/api/materialManagement/propertyChange";
  392. export default {
  393. name: "PropertyChange",
  394. data() {
  395. return {
  396. // 遮罩层
  397. loading: true,
  398. // 导出遮罩层
  399. exportLoading: false,
  400. // 选中数组
  401. ids: [],
  402. // 非单个禁用
  403. single: true,
  404. // 非多个禁用
  405. multiple: true,
  406. // 显示搜索条件
  407. showSearch: true,
  408. // 总条数
  409. total: 0,
  410. // 营具物资变更表格数据
  411. propertyChangeList: [],
  412. // 弹出层标题
  413. title: "",
  414. // 是否显示弹出层
  415. open: false,
  416. // 查询参数
  417. queryParams: {
  418. pageNum: 1,
  419. pageSize: 10,
  420. propertyId: null,
  421. name: null,
  422. rukuNumber: null,
  423. changeTime: null,
  424. beforeUnitId: null,
  425. afterUnitId: null,
  426. beforePeopleId: null,
  427. afterPeopleId: null,
  428. createtime: null,
  429. updatetime: null,
  430. beforeUnitName: null,
  431. afterUnitName: null,
  432. beforePeopleName: null,
  433. afterPeopleName: null,
  434. },
  435. // 表单参数
  436. form: {},
  437. // 表单校验
  438. rules: {
  439. name: [
  440. { required: true, message: "营具名称不能为空", trigger: "blur" },
  441. ],
  442. },
  443. };
  444. },
  445. created() {
  446. this.getList();
  447. },
  448. methods: {
  449. /** 查询营具物资变更列表 */
  450. getList() {
  451. this.loading = true;
  452. listPropertyChange(this.queryParams).then((response) => {
  453. this.propertyChangeList = response.rows;
  454. this.total = response.total;
  455. this.loading = false;
  456. });
  457. },
  458. // 取消按钮
  459. cancel() {
  460. this.open = false;
  461. this.reset();
  462. },
  463. // 表单重置
  464. reset() {
  465. this.form = {
  466. id: null,
  467. propertyId: null,
  468. name: null,
  469. rukuNumber: null,
  470. changeTime: null,
  471. beforeUnitId: null,
  472. afterUnitId: null,
  473. beforePeopleId: null,
  474. afterPeopleId: null,
  475. remark: null,
  476. createtime: null,
  477. updatetime: null,
  478. beforeUnitName: null,
  479. afterUnitName: null,
  480. beforePeopleName: null,
  481. afterPeopleName: null,
  482. };
  483. this.resetForm("form");
  484. },
  485. /** 搜索按钮操作 */
  486. handleQuery() {
  487. this.queryParams.pageNum = 1;
  488. this.getList();
  489. },
  490. /** 重置按钮操作 */
  491. resetQuery() {
  492. this.resetForm("queryForm");
  493. this.handleQuery();
  494. },
  495. // 多选框选中数据
  496. handleSelectionChange(selection) {
  497. this.ids = selection.map((item) => item.id);
  498. this.single = selection.length !== 1;
  499. this.multiple = !selection.length;
  500. },
  501. /** 新增按钮操作 */
  502. handleAdd() {
  503. this.reset();
  504. this.open = true;
  505. this.title = "添加营具物资变更";
  506. },
  507. /** 修改按钮操作 */
  508. handleUpdate(row) {
  509. this.reset();
  510. const id = row.id || this.ids;
  511. getPropertyChange(id).then((response) => {
  512. this.form = response.data;
  513. this.open = true;
  514. this.title = "修改营具物资变更";
  515. });
  516. },
  517. /** 提交按钮 */
  518. submitForm() {
  519. this.$refs["form"].validate((valid) => {
  520. if (valid) {
  521. if (this.form.id != null) {
  522. updatePropertyChange(this.form).then((response) => {
  523. this.$modal.msgSuccess("修改成功");
  524. this.open = false;
  525. this.getList();
  526. });
  527. } else {
  528. addPropertyChange(this.form).then((response) => {
  529. this.$modal.msgSuccess("新增成功");
  530. this.open = false;
  531. this.getList();
  532. });
  533. }
  534. }
  535. });
  536. },
  537. /** 删除按钮操作 */
  538. handleDelete(row) {
  539. const ids = row.id || this.ids;
  540. this.$modal
  541. .confirm('是否确认删除营具物资变更编号为"' + ids + '"的数据项?')
  542. .then(function () {
  543. return delPropertyChange(ids);
  544. })
  545. .then(() => {
  546. this.getList();
  547. this.$modal.msgSuccess("删除成功");
  548. })
  549. .catch(() => {});
  550. },
  551. /** 导出按钮操作 */
  552. handleExport() {
  553. const queryParams = this.queryParams;
  554. this.$modal
  555. .confirm("是否确认导出所有营具物资变更数据项?")
  556. .then(() => {
  557. this.exportLoading = true;
  558. return exportPropertyChange(queryParams);
  559. })
  560. .then((response) => {
  561. this.$download.name(response.msg);
  562. this.exportLoading = false;
  563. })
  564. .catch(() => {});
  565. },
  566. },
  567. };
  568. </script>
  569. <style scoped>
  570. /* 对话框背景颜色 */
  571. ::v-deep .el-dialog {
  572. width: 1016px !important;
  573. background: #004d86 !important;
  574. }
  575. ::v-deep .el-textarea__inner {
  576. width: 965px;
  577. height: 104px;
  578. }
  579. ::v-deep .el-dialog__header {
  580. border-bottom: 1px solid #718a9d;
  581. }
  582. ::v-deep .el-dialog__title {
  583. color: #fff;
  584. font: 18px;
  585. }
  586. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  587. color: #fff;
  588. }
  589. ::v-deep .el-form-item__label {
  590. font: 16px;
  591. color: #fff;
  592. width: 100px !important;
  593. }
  594. ::v-deep .el-dialog .el-input__inner {
  595. width: 200px !important;
  596. height: 36px;
  597. background: transparent;
  598. color: #fff;
  599. border: 1px solid white !important;
  600. border-color: #fff !important;
  601. }
  602. /* 单位框背景颜色 */
  603. ::v-deep .vue-treeselect__control {
  604. background: #004d86 !important;
  605. }
  606. /*调整表单间距 */
  607. ::v-deep .el-form-item__content {
  608. width: 200px;
  609. }
  610. ::v-deep .el-dialog__footer {
  611. margin-right: 6px !important;
  612. }
  613. .contents {
  614. padding: 0px 40px !important;
  615. }
  616. ::v-deep .el-form-item__label {
  617. width: 115px !important;
  618. }
  619. ::v-deep .el-dialog__body {
  620. padding: 30px 0px 30px 26px !important;
  621. }
  622. ::v-deep .el-form .el-input__inner {
  623. height: 36px !important;
  624. }
  625. </style>