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
<template>
  <div class="quotationEdit height overflow">
    <div class="width overflow height92">
      <div>
        <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>
        </div>
        <div class="flex width justify-between">
          <div class="width50 flex align-center">
            <label class="width40 textalign">计划单号:</label>
            <el-select class="width60" size="mini" clearable v-model="iqnuer.inOrderCode" placeholder="请选择">
              <el-option
                v-for="(item, index) in inOrderCodelist"
                :key="'inOrderCode' + index"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div>
            <el-button type="primary" size="mini" @click="$emit('partclick')">查询</el-button>
            <el-button type="primary" size="mini" @click="$emit('addchoose')">新增</el-button>
          </div>
        </div>
      </div>
      <div class="width height82 overflow">
        <table-container
          height="91%"
          :wipelist="wipelist"
          :tableHead="tableHead"
          :tableData="tableData"
          :operation="false"
          :selectionShow="true"
          :totle="totle"
          @handleSelectionChange="handleSelectionChange"
        />
      </div>
    </div>
    <div class="quotationEdit-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 } from '@/api/enterchoose';
const { edterchoose } = require('@/components/tableContainer/tableHead');
export default {
  data() {
    return {
      iqnuer: {},
      inOrderCodelist: [
        {
          label: '无',
          value: ''
        }
      ],
      wipelist: [],
      tableData: [],
      handlelist: [], //勾选数据
      totle: 0,
      page: 1
    };
  },
  props: {},
  components: { TableContainer },
  computed: {
    tableHead() {
      return edterchoose;
    }
  },
  mounted() {
    this.itemSearch();
  },
  methods: {
    //查询
    itemSearch() {
      this.$Loading(true);
      itemSearch(this.page).then(res => {
        if (res.code == 0) {
          this.tableData = res.data;
          this.totle = res.num;
        }
        this.$Loading();
      });
    },
    //勾选
    handleSelectionChange(e) {
      console.log(e);
      this.handlelist = e;
    },
    submitForm() {
      if (this.handlelist.length == 1) {
        this.$emit('chooseClick', 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: '只能勾选一条数据'
        });
      }
    }
  },
  watch: {}
};
</script>
 
<style lang="scss" scoped>
.quotationEdit {
  width: 98%;
  padding: 1%;
  .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;
  }
  .quotationEdit-button {
  }
  ::v-deep .el-form-item__content {
    width: 60%;
  }
  ::v-deep .el-select {
    // width: 100%;
  }
}
</style>