ke_junjie
2025-06-04 bb6e2230bb8ded3c5546bc4e4c282ee343754475
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
76
77
78
79
80
81
82
83
84
85
86
87
88
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!--选择用户-->
<template>
  <div class="choose height overflow">
    <div class="width overflow height92">
      <div class="chose-height">
        <div class="flex margintopbot justify-between">
          <div class="width50 flex align-center">
            <label class="width40 textalign">登录名:</label>
            <el-input size="mini"
                      clearable
                      v-model="iqnuer.itemName"
                      class="width60"> </el-input>
          </div>
          <div class="width50 flex align-center">
            <label class="width40 textalign">真实姓名:</label>
            <el-input size="mini"
                      clearable
                      v-model="iqnuer.itemDes"
                      class="width60"> </el-input>
          </div>
          <el-button type="primary"
                     size="mini"
                     @click="itemSearch">查询</el-button>
        </div>
        <div class="flex width justify-between"></div>
      </div>
      <div class="width chose-tebleheight margin-top2 overflow">
        <table-container height="91%"
                         :wipelist="wipelist"
                         :tableHead="tableHead"
                         :tableData="tableData"
                         :operation="false"
                         :currentPage="page"
                         :pageSize="pageSize"
                         :totle="totle"
                         :setshow="false"
                         :delShow="true"
                         :selectionShow="true"
                         @del="del"
                         @handleSelectionChange="handleSelectionChange"
                         @CurrentChange="CurrentChange" />
      </div>
    </div>
    <div class="choose-button text-right margin-right15 margin-top2">
      <el-button type="primary"
                 size="mini"
                 class="form-buttom"
                 @click="submitForm">确认选择</el-button>
      <el-button type="primary"
                 size="mini"
                 class="form-buttom"
                 @click="$emit('cancel')">取消</el-button>
    </div>
  </div>
</template>
 
<script>
import { TableContainer, Modal } from '@/components/index';
import { itemSearch, ItemDelete } from '@/api/enterchoose';
import { UserSearch, UserDelete } from '@/api/manage';
const { manage } = require('@/components/tableContainer/tableHead');
export default {
  data () {
    return {
      iqnuer: {
        IsWeldingAuditGroup: true
      },
      inOrderCodelist: [
        {
          label: '无',
          value: ''
        }
      ],
      tableData: [],
      handlelist: [], //勾选数据
      totle: 0,
      page: 1,
      pageSize: 20
    };
  },
  props: {
    wipelist: {
      type: Array,
      default: () => []
    },
    inOrderCodeShow: {
      type: Boolean,
      default: true
    },
    choice: {
      type: Boolean,
      default: true
    }
  },
  components: { TableContainer },
  computed: {
    tableHead () {
      return manage;
    }
  },
  mounted () {
    this.itemSearch();
  },
  methods: {
    //查询
    itemSearch () {
      UserSearch(this.page + '&onePageNum=' + this.pageSize, this.iqnuer).then(res => {
        if (res.code == 0) {
          let data = res.data;
          this.tableData = data;
          this.totle = res.num;
        }
      });
    },
    CurrentChange (e) {
      this.page = e;
      this.itemSearch();
    },
    //勾选
    handleSelectionChange (e) {
      console.log(e);
      this.handlelist = e;
    },
    submitForm () {
      if (this.choice) {
        if (this.handlelist.length == 1) {
          this.$emit('submitForm', this.handlelist, this.iqnuer.inOrderCode);
        } else if (this.handlelist.length == 0) {
          this.$message({
            type: 'warning',
            message: '请勾选一条数据'
          });
        } else if (this.handlelist.length > 1) {
          this.$message({
            type: 'warning',
            message: '只能勾选一条数据'
          });
        }
      } else {
        this.$emit('submitForm', this.handlelist, this.iqnuer.inOrderCode);
      }
    },
    //删除
    del (row) {
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const { itemName } = { ...row };
          ItemDelete({ itemName }).then(res => {
            if (res.code == 0) {
              this.$message({
                type: 'success',
                message: '删除成功'
              });
              this.itemSearch();
            } else {
              this.$message({
                type: 'warning',
                message: '删除失败'
              });
            }
          });
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
    }
  },
  watch: {}
};
</script>
 
<style lang="scss" scoped>
.choose {
  width: 98%;
  padding: 1%;
  .chose-height {
    height: 40px;
  }
  .chose-tebleheight {
    height: calc(100% - 60px);
  }
  .show-pwd {
    position: absolute;
    right: 10px;
    top: 3px;
    font-size: 16px;
    color: #889aa4;
    cursor: pointer;
    user-select: none;
  }
  .centent-form {
    height: 92%;
    width: 100%;
    margin: auto;
  }
  .choose-button {
  }
  ::v-deep .el-form-item__content {
    width: 60%;
  }
  ::v-deep .el-select {
    // width: 100%;
  }
}
</style>