huanghongfeng
3 天以前 5ffc36a1db18d3112a9b50a9cf3953d7fcf21bae
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
<template>
  <div class="container">
    <div class="input-group">
      <span class="label">站台:</span>
      <el-select v-model="value1" placeholder="请选择" style="width: 40%;">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
    </div>
    <div class="input-group" style="width:50%;">
      <span class="label">条码:</span>
      <el-input v-model="input2" placeholder="请输入内容"></el-input>
    </div>
    <div class="input-group">
      <el-button type="primary" style="width: 50%;" @click="setBorot()">写入</el-button>
    </div>
 
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      options: [{
        value: '1010',
        label: '1010'
      }, {
        value: '2015',
        label: '2015'
      }, {
        value: '2017',
        label: '2017'
      }, {
        value: '2021',
        label: '2021'
      }],
      value1: '',
      input2: '',
    }
  },
  methods: {
    setBorot() {
      if (this.value1 == "") {
        this.$message.error("请选择要写入的站台");
      }
      if (this.input2 == "") {
        this.$message.error("请选择要写入的条码");
      }
      this.$confirm("是否确定需要对该站台写入条码信息!!!", "提示", {
        // iconClass:"el-icon-success",//el-icon-remove自定义图标样式
        confirmButtonText: "确认",//确认按钮文字更换
        cancelButtonText: "取消",//取消按钮文字更换
        // cancelBtn:"取消",//取消按钮文字更换
        showClose: true,//是否显示右上角关闭按钮
        type: "warning",//提示类型 success:成功/info:信息/warning:警告/error:报错
      }).then(() => {
        var param = {
          DelKeys: [this.value1,this.input2], 
          Extra: true
        }
        this.http
          .post("api/Task/SetPlcPalletCode",param, "数据处理中...")
          .then((x) => {
            if (x.status) {
              this.$Message.success('成功.');
              this.refresh();
            } else {
              return this.$error(x.message);
            }
          });
      })
    }
  }
}
</script>
 
<style scoped>
.container {
  font-size: 22px;
  margin-top: 20px;
  width: 50%;
}
 
.input-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}
 
.label {
  min-width: 60px;
  /* 为标签设置最小宽度保持对齐 */
  margin-right: 10px;
}
 
.el-input {
  flex: 1;
  /* 输入框占据剩余空间 */
}
</style>