Infsea.vue 4.8 KB
Newer Older
LiRui committed
1
<template>
LiRui committed
2 3 4 5 6
  <div class="eibs-tab">
    <c-col :span="12" style="padding-right: 20px">
      <c-col :span="24">
        <el-form-item label="样式设置" prop="cod">
          <c-input v-model="model.cod" placeholder="请输入样式设置"> </c-input>
LiRui committed
7 8
        </el-form-item>
      </c-col>
LiRui committed
9 10 11 12 13 14
    </c-col>

    <c-col :span="12" style="padding-left: 20px">
      <c-col :span="24">
        <el-form-item label="类型" prop="typ">
          <c-input v-model="model.typ" placeholder="请输入类型"> </c-input>
LiRui committed
15 16
        </el-form-item>
      </c-col>
LiRui committed
17 18 19 20
    </c-col>
    <c-col :span="24">
      <c-col :span="12" style="text-align: left">
        <el-button type="primary" size="small" @click="apfAdd">新增</el-button>
LiRui committed
21
      </c-col>
LiRui committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
      <c-col :span="12" style="text-align: right">
        <el-button size="small" @click="handleReset">重置</el-button>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="small"
          @click="onSearch()"
          >查询
        </el-button>
      </c-col>
    </c-col>
    <c-col :span="24">
      <c-paging-table
        :data="apfData"
        :columns="apfColumns"
        :pageNumber="model.pageNum"
        :pageSize="model.pageSize"
        :total="model.total"
        v-on:queryFunc="queryFunc"
        :border="true"
      >
        <c-table-column fixed="right" prop="op" label="操作" width="240px">
          <template slot-scope="{ scope }">
            <c-button
              style="margin-left: 0"
              size="small"
              @click="apfInfo(scope.$index, scope.row)"
              >详情</c-button
            >
            <c-button
              style="margin-left: 5px"
              size="small"
              type="primary"
              @click="apfEdit(scope.$index, scope.row)"
              >修改</c-button
            >
            <c-button
              size="small"
              style="margin-left: 5px"
              @click="apfDelete(scope.$index, scope.row)"
              >删除</c-button
            >
            <el-popover placement="top-start" width="50" trigger="click">
              <ul class="table-button-item-list">
                <li>
                  <c-button size="small" style="margin-left: 0">指派</c-button>
                </li>
                <li>
                  <c-button size="small" style="margin-left: 0">删除</c-button>
                </li>
              </ul>
              <a
                slot="reference"
                href="javascript:void(0)"
LiRui committed
76 77
                style="margin-left: 5px"
              >
LiRui committed
78 79 80 81 82 83 84 85 86
                <i class="el-icon-more"></i>
              </a>
            </el-popover>
          </template>
        </c-table-column>
      </c-paging-table>
    </c-col>
  </div>
</template>
LiRui committed
87 88
  
  <script>
LiRui committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
import codes from "~/config/CodeTable";

import { queryByPage } from "~/service/test/apf.js";

export default {
  name: "",
  props: ["model"],
  inject: ["root"],
  data() {
    return {
      apfData: [],
      apfColumns: [
        { label: "样式设置", prop: "cod", width: "auto" },
        { label: "类型", prop: "typ", width: "auto" },
        { label: "数量", prop: "cnt", width: "auto" },
        { label: "编辑标志", prop: "edtflg", width: "auto" },
        { label: "所用纸张类型", prop: "tef", width: "auto" },
        { label: "优先级", prop: "pri", width: "auto" },
        { label: "版本号", prop: "ver", width: "auto" },
      ],
    };
  },
  computed: {},
  activated() {
    const { update } = this.$route.params;
    if (update) {
      this.onInfapfSearch();
    }
  },
  methods: {
    handleReset() {
      this.root.$refs.modelForm.resetFields();
    },
    onSearch() {
      this.model.pageSize = 5;
      this.model.pageNum = 1;
      this.onInfapfSearch();
    },
    onInfapfSearch() {
      queryByPage(this.model).then((res) => {
        /**
         * pageNumber: 0
         * pageSize:	0
         * total: 69
         * totalPage: 0
         */
        const list = res.list;
        this.apfData = list;
        this.model.pageNum = res.pageNumber;
        this.model.pageSize = res.pageSize;
        this.model.total = res.total;
      });
    },
    queryFunc(pageNumber, pageSize) {
      this.model.pageNum = pageNumber;
      this.model.pageSize = pageSize;
      this.onInfapfSearch();
    },
    apfAdd() {
      this.$router.push(`/statics/dbaapf`);
LiRui committed
149
    },
LiRui committed
150 151
    apfInfo(index, row) {
      this.$router.push(`/statics/dbiapf/${row.inr}`);
LiRui committed
152
    },
LiRui committed
153 154
    apfEdit(index, row) {
      this.$router.push(`/statics/dbeapf/${row.inr}`);
LiRui committed
155
    },
LiRui committed
156 157
    apfDelete(index, row) {
      this.$router.push(`/statics/dbdapf/${row.inr}`);
LiRui committed
158
    },
LiRui committed
159 160 161
  },
};
</script>
LiRui committed
162 163
  
  <style scoped>
LiRui committed
164 165 166 167 168 169 170 171 172 173 174 175
.table-button-item-list {
  padding: 0;
  margin: 0;
}
.table-button-item-list li {
  list-style: none;
  padding: 5px 0;
  text-align: center;
  color: #606266;
  cursor: pointer;
}
</style>
LiRui committed
176