123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <template>
- <div class="mis-pageBox">
-
- <el-container>
- <el-header height="40px">
- <el-row>
- <el-col :span="18">
- <el-input v-model="queryParams.searchText" size="small" style="width: 300px" placeholder="输入关键字" clearable
- @keyup.enter.native="clickQuery()" />
- <el-button type="primary" size="small" icon="el-icon-search" @click="clickQuery()">查询</el-button>
- </el-col>
- <el-col :span="6" class="list-opCol">
-
- <el-button type="primary" size="small" icon="el-icon-edit" @click="clickModify()"
- :disabled="disabledModify">修改</el-button>
- <el-button type="danger" size="small" icon="el-icon-delete" @click="clickDelete()"
- :disabled="disabledDelete">删除</el-button>
- </el-col>
- </el-row>
- </el-header>
- <el-main>
- <tfTable :table-data="dataList" :column="columns" :for-id="false" :pagination="false"
- :currentpage="pageInfo.current" :pagesize="pageInfo.size" :total="pageInfo.tableTotal" :border="true"
- :multiple="true" :fixed="true" :isdelete="false" :is-select="false" :stripe="true"
- @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"
- @handleSelectionChange="handleSelectionChange" @rowDblclick="showDetail" @detail="showDetail" />
- </el-main>
- </el-container>
-
- <el-dialog v-if="dialogVisible" v-dialogDrag top="20vh" :title="dialogTitle" :visible.sync="dialogVisible"
- width="800px" class="dialog">
- <tfDetail :detailData="detailData" :editState="editState" ref="dForm" />
- <template slot="footer">
- <el-button type="warning" icon="el-icon-check" @click="clickSave()" v-if="!editState">确 定</el-button>
- <el-button type="warning" icon="el-icon-close" @click="clickCancel()">关 闭</el-button>
- </template>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import "@/views/mis/common/assets/styles/misStyle.scss";
- import { DateHelper } from "@/views/mis/common/assets/scripts/utils.js";
- import { PayMode } from "@/views/mis/common/api/codingManagement.js";
- import tfTable from "@/views/mis/common/misTable/index.vue";
- import tfDetail from "./payMode-form.vue";
- export default {
- name: "payMode",
- components: { tfTable, tfDetail },
- props: ["data"],
- data() {
- return {
-
- queryParams: {
- searchText: "",
- },
- disabledModify: true,
- disabledDelete: true,
- editType: true,
- loading: false,
- pageInfo: {
- current: 1,
- size: 100,
- tableTotal: 1,
- "orders[0].asc": "true",
- "orders[0].column": "code",
- },
- columns: [
- {
- label: "编码",
- prop: "code",
- align: "center",
- sortable: true,
- },
- {
- label: "名称",
- prop: "name",
- align: "center",
- },
- {
- label: "是否启用",
- prop: "isdisabled",
- align: "center",
- formatter: function (row, column, cellValue, index) {
- return cellValue == 1 ? "是" : "否";
- },
- },
- {
- label: "档案是否启用",
- prop: "yhIsdisabled",
- align: "center",
- formatter: function (row, column, cellValue, index) {
- return cellValue == 1 ? "是" : "否";
- },
- },
- {
- label: "余额滚动标志",
- prop: "yegdbz",
- align: "center",
- formatter: function (row, column, cellValue, index) {
- return cellValue == 1 ? "参与滚动" : "不参与滚动";
- },
- },
- {
- label: "操作人员",
- prop: "oname",
- align: "center",
- },
- ],
- dataList: [],
- selectionsData: [],
- selectedRow: {},
-
- dialogTitle: "新增",
- editState: false,
- dialogVisible: false,
- detailData: {
- code: undefined,
- name: undefined,
- isdisabled: undefined,
- yhIsdisabled: undefined,
- yegdbz: undefined,
- oname: undefined,
- },
- };
- },
- watch: {
- selectionsData(value) {
- this.disabledModify = this.selectionsData.length !== 1;
- this.disabledDelete = this.selectionsData.length == 0;
- },
- dialogVisible(newVal, oldVal) {
- if (!newVal) {
- this.resetDetailData();
- }
- },
- },
- created() { },
- mounted() {
- this.bindList();
- },
- methods: {
-
-
- bindList() {
-
- let params = Object.assign({}, this.pageInfo, this.queryParams);
- this.dataList = [];
- this.loading = true;
- PayMode.query(params)
- .then((res) => {
- if (res.code !== 1) {
- this.$message.error("查询失败!");
- return;
- }
-
- this.pageInfo.tableTotal = res.result.total;
- this.dataList = res.result.records;
- })
- .catch((ex) => {
- this.$message.error("查询失败!");
- })
- .finally(() => {
- this.loading = false;
- });
- },
- resetDetailData() {
-
- for (var key in this.detailData) {
-
- this.detailData[key] = undefined;
- }
- },
- add() {
- let params = Object.assign({}, this.detailData);
- params.ocode = this.$store.state.user.userId;
- params.oname = this.$store.state.user.realName;
- PayMode.add(params).then((res) => {
- if (res.code == 1) {
- this.bindList();
- this.$message.success("添加成功!");
- this.dialogVisible = false;
- }
- });
- },
- modify() {
- let params = Object.assign({}, this.detailData);
- params.ocode = this.$store.state.user.userId;
- params.oname = this.$store.state.user.realName;
-
- PayMode.modify(params).then((res) => {
- if (res.code == 1) {
- this.bindList();
- this.$message.success("修改成功!");
- this.dialogVisible = false;
- }
- });
- },
- delete() {
- const ids = this.selectionsData.map((item) => {
- return item.code;
- });
- PayMode.delete({ ids: ids.join(",") }).then((res) => {
- if (res.code == 1) {
- this.bindList();
- this.$message.success("删除成功!");
- }
- });
- },
-
- showDetail(data) {
- this.selectedRow = data;
- this.detailData = Object.assign({}, this.selectedRow);
- this.dialogTitle = "查看";
- this.editState = true;
- this.dialogVisible = true;
- },
-
-
- clickQuery() {
- this.pageInfo.current = 1;
- this.bindList();
- },
-
- clickAdd() {
- this.detailData.oname = this.$store.state.user.realName;
- this.detailData.cdate = DateHelper.getNowFormatDate(true);
- this.editType = true;
- this.dialogTitle = "添加";
- this.editState = false;
- this.dialogVisible = true;
- },
-
- clickModify() {
- this.selectedRow = this.selectionsData[0];
- this.detailData = Object.assign({}, this.selectedRow);
- this.editType = false;
- this.dialogTitle = "修改";
- this.editState = false;
- this.dialogVisible = true;
- },
-
- clickDelete() {
- this.$confirm("确定删除?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.delete();
- });
- },
- clickCancel() {
- this.dialogVisible = false;
- },
- clickSave() {
- let flag = this.$refs.dForm.validate();
- if (flag) {
- if (this.editType) this.add();
- else this.modify();
- }
- },
-
-
- handleCurrentChange(current) {
- this.pageInfo.current = current;
- this.bindList();
- },
-
- handleSizeChange(size) {
- this.pageInfo.size = size;
- this.bindList();
- },
-
- handleSelectionChange(rows) {
- this.selectionsData = rows;
- },
- },
- };
- </script>
- <style lang="scss" scoped></style>
-
|