hutongqing
2024-11-19 877d01790a997d4488addf09284efcf98bbd1934
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
<template>
  <div>
    <vol-box
      v-model="showDetialBox"
      :lazy="true"
      width="500px"
      :padding="15"
      title="修改货位状态"
    >
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="货位编号">
          <el-input v-model="form.locationCode" disabled></el-input>
        </el-form-item>
        <el-form-item label="货位状态">
          <el-select v-model="form.locationStatus" placeholder="请选择货位状态">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option> </el-select
        ></el-form-item>
      </el-form>
      <template #footer>
        <el-button type="primary" size="small" @click="updateLocationStatus"
          >确定</el-button
        >
        <el-button type="danger" size="small" @click="showDetialBox = false"
          >取消</el-button
        >
      </template>
    </vol-box>
  </div>
</template>
  
  <script>
import VolBox from "@/components/basic/VolBox.vue";
export default {
  components: { VolBox },
  data() {
    return {
      form: {
        locationCode: "",
        locationStatus: "",
      },
      row: {},
      showDetialBox: false,
      height: "200px",
      options: [],
      value: "",
    };
  },
  methods: {
    open(row) {
      this.row = row;
      this.showDetialBox = true;
      this.form.locationCode = row.locationCode;
      //this.form.locationStatus = row.locationStatus;
    },
    getOptions() {
      this.http
        .post("/api/LocationInfo/GetLocationStatusDic", {}, true)
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
 
          this.options = x.data;
        });
    },
    updateLocationStatus() {
      this.http
        .post(
          "/api/LocationInfo/UpdateLocationStatus?key=" +
            this.row.id +
            "&locationStatus=" +
            this.row.locationStatus,
          {},
          "数据处理中"
        )
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
        });
    },
  },
  created() {
    this.getOptions();
    console.log("created");
  },
};
</script>
  
  <style scoped>
.el-col {
  border-radius: 4px;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.content-text {
  display: flex;
  align-items: center;
  justify-content: center;
}
.right-text {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
</style>
  <style>
.el-table .warning-row {
  background: #fcf1e2;
}
 
.el-table .success-row {
  background: #f0f9eb;
}
 
.el-table .error-row {
  background: #fde2e2;
}
</style>