wangxinhui
2026-02-10 25d4333015921e7a2445564e7099c1503e0a2eac
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
<template>
    <div>
      <vol-box
        v-model="showDetialBox"
        :lazy="true"
        width="600px"
        :padding="15"
        title="手动107请求"
      >
        <div style="margin-bottom: 20px;">
            获取到纸卷条码查询ERP库存
            <br>
            <br>
            <el-input
                v-model="requestBarCode"
                style="width: 180px"
                label="纸卷条码"
              ></el-input>
              &nbsp;&nbsp;
            <el-descriptions title="ERP库存" v-if="showStock">
                <el-descriptions-item label="重量">{{ searchStock.weight ? searchStock.weight : "无库存"}}</el-descriptions-item>
                <el-descriptions-item label="直径">{{ searchStock.thicknes ? searchStock.thicknes : "无库存" }}</el-descriptions-item>
                <el-descriptions-item label="幅宽">{{ searchStock.wide ?  searchStock.wide : "无库存"}}</el-descriptions-item>
            </el-descriptions>
            <el-button type="primary" size="small" @click="search">查询</el-button>
        </div>
        <div>
          <el-form>
            <el-form-item label="请输RFID:"
              ><el-input
                v-model="requestStock.rfId"
                style="width: 180px"
                label="请输RFID"
              ></el-input>
            </el-form-item>
            <el-form-item label="请输重量:"
              ><el-input
                v-model="requestStock.weight"
                style="width: 180px"
                label="请输重量"
              ></el-input>
            </el-form-item>
            <el-form-item label="请输直径:"
              ><el-input
                v-model="requestStock.thicknes"
                style="width: 180px"
                label="请输直径"
              ></el-input>
            </el-form-item>
            <el-form-item label="请输幅宽:"
              ><el-input
                v-model="requestStock.wide"
                style="width: 180px"
                label="请输幅宽"
              ></el-input>
            </el-form-item>
          </el-form>
        </div>
        <template #footer>
          <el-button type="primary" size="small" @click="submit">确认</el-button>
          <el-button type="danger" size="small" @click="close">关闭</el-button>
        </template>
      </vol-box>
    </div>
  </template>
      
      <script>
  import VolBox from "@/components/basic/VolBox.vue";
  export default {
    components: { VolBox },
    data() {
      return {
        showDetialBox: false,
        showStock: false,
        requestBarCode:null,
        searchStock: {
          weight: null,
          thicknes: null,
          wide: null
        },
        requestStock: {
          rfId: null,
          weight: null,
          thicknes: null,
          wide: null
        },
      };
    },
    methods: {
      open() {
        this.showDetialBox = true;
      },
      close() {
        this.showDetialBox = false;
        this.requestStock = {
          rfId: null,
          weight: null,
          thicknes: null,
          wide: null
        };
        this.showStock = false;
        this.requestBarCode = null;
        this.searchStock = {
          weight: null,
          thicknes: null,
          wide: null
        };
      },
      search(){
        this.http
          .post(
            "api/ERPBST/BSTStockAsync?barCode=" + this.requestBarCode,
            null,
            "数据处理中"
          )
          .then((x) => {
            if(x.code==200){
                this.showStock = true;
                this.searchStock.weight= x.data.qty ==0 ? null:x.data.qty;
                this.searchStock.thicknes= x.data.thick ==0 ? null:x.data.thick;
                this.searchStock.wide= x.data.w  ==0 ? null:x.data.w;
                console.log(this.searchStock);
            }else{
                this.$message.error(x.message);
            }
          });
      },
      submit() {
        if (this.showStock == false) return this.$message.error("请先查询ERP库存");
        if (this.requestStock.rfId == null) return this.$message.error("请输入RFID");
        if (this.requestStock.weight == null) return this.$message.error("请输入重量");
        if (this.requestStock.thicknes == null) return this.$message.error("请输入直径");
        if (this.requestStock.wide == null) return this.$message.error("请输入幅宽");
        this.http
          .post(
            "api/Task/YLPurchaseBoxing?palletCode=" + this.requestStock.rfId + "&weight=" + this.requestStock.weight + "&thickness=" + this.requestStock.thicknes + "&wide=" + this.requestStock.wide+ "&stationCode=107",
            null,
            "数据处理中"
          )
          .then((x) => {
            if (!x.status) return this.$message.error(x.message);
            this.$message.success("操作成功");
            this.$parent.refresh();
            this.close();
          });
      },
    },
    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: #e6a23c;
  }
  
  .el-table .success-row {
    background: #f0f9eb;
  }
  
  .el-table .error-row {
    background: #f56c6c;
  }
  
  canvas {
    display: block;
    margin: auto;
  }
  </style>