pda
liuying
2024-12-11 9d1e44b4d1458822a8bc20a71efc231ead070cbc
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<template>
  <view class="overflow" style="padding-bottom: 150rpx">
    <cu-custom bgColor="bg-white" :isBack="true">
      <block slot="backText"> </block>
      <block slot="content">整包查看</block>
    </cu-custom>
    <u-form
      labelPosition="left"
      label-width="250rpx"
      :model="warehouse"
      ref="warehouseRef"
    >
      <u-row
        class="border_bottom margin_top10rpx padding_left25rpx"
        style="background-color: #fff"
      >
        <u-col span="12">
          <u-form-item
            label="包装号/部件条码:"
            prop="upi"
            required
            class="uFormItem"
          >
            <u-input
              v-model.trim="warehouse.upi"
              @focus="warehouse.upi = ''"
              @confirm="getContainerData(1)"
              placeholder="请录入或扫码"
              class="width"
              :focus="curFoucus"
            >
            </u-input>
          </u-form-item>
        </u-col>
      </u-row>
      <!-- <u-row
        class="border_bottom margin_top10rpx padding_left25rpx"
        style="background-color: #fff"
      >
        <u-col span="12">
          <u-form-item label=":" class="uFormItem">
            <u-input
              v-model="warehouse.upi"
              ref="materialRef"
              placeholder="请扫码录入"
              @focus="warehouse.upi = ''"
              @confirm="getContainerData"
              style="font-weight: bolder; margin-left: 15rpx"
              class="width padding_left25rpx"
            >
            </u-input>
          </u-form-item>
        </u-col>
      </u-row> -->
    </u-form>
    
    <!-- 列表 -->
    <view class="margin_top10rpx">
      <u-swipe-action
        :show="item.show"
        :index="eindex"
        v-for="(item, eindex) in singlist"
        :key="eindex"
        :options="options"
        @click="longpress"
        @open="open"
        @close="close"
        class="margin_bottom10rpx"
      >
        <view class="item u-border-bottom">
          <!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
          <view class="title-wrap">
            <view
              :class="item.checked ? 'bg_item' : ''"
              class="fontSize32rpx width margin_auto background_fff padding10 relative box_sizing transition"
            >
              <u-row>
                <u-col span="12" class="flex align-center">
                  <!-- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> -->
                  <view
                    class="flex justify-center align-center"
                    style="
                      background-color: #f18202;
                      color: #fff;
                      border-radius: 50vh;
                      width: 40rpx;
                      height: 40rpx;
                    "
                  >
                    {{ eindex + 1 }}
                  </view>
                  <text class="color_f18202 padding_left10rpx">
                    {{ item.upi }}
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    部件名称: {{ item.detailName }}
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    位置:{{ getAreaCodeEnumName(item.areaCode) }}
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    材料:{{ item.info18 }}
                  </text>
                </u-col>
              </u-row>
 
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    <text class="color_80"> 尺寸:{{ item.info16 }} </text>
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    板件状态:{{ getEnumName(item.upiStatus) }}
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    <text class="color_80"> 次序:{{ item.shelf }} </text>
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    <text class="color_80"> 生产单号:{{ item.info5 }} </text>
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    <text class="color_80">
                      包装编号:{{ item.packageCode }}</text
                    >
                  </text>
                </u-col>
              </u-row>
              <u-row>
                <u-col span="12">
                  <text class="color_80 padding_left25rpx">
                    <text class="color_80"> 批次号:{{ item.planNo }}</text>
                  </text>
                </u-col>
              </u-row>
            </view>
          </view>
        </view>
      </u-swipe-action>
    </view>
    <modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" />
    <u-popup
      v-model="detailshow"
      border-radius="14"
      @close="detailshow = false"
      mode="bottom"
    >
      <h2 class="text_align_center padding_bottom18 padding15">信息</h2>
      <div style="height: 400px; overflow-y: auto; padding: 0 15rpx">
        <view class="line flex justify-between">
          <text class="text-gray">订单号</text>
          <text>{{ materlist.orderId }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">长</text>
          <text>{{ materlist.length }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">宽</text>
          <text>{{ materlist.width }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">厚</text>
          <text>{{ materlist.thk }}</text>
        </view>
        <!-- <view class="line flex justify-between">
          <text class="text-gray">行号</text>
          <text>{{ materlist.lineNumber }}</text>
        </view> -->
        <!-- <view class="line flex justify-between">
        <text class="text-gray">部件纹理</text>
        <text>{{ materlist.Matgrid }}</text>
      </view> -->
        <!-- <view class="line flex justify-between">
        <text class="text-gray">打孔设备编号</text>
        <text>{{ materlist.DRNum }}</text>
      </view> -->
 
        <!-- <view class="line flex justify-between">
          <text class="text-gray">锯切图号</text>
          <text>{{ materlist.materialIndex }}</text>
        </view> -->
 
        <view class="line flex justify-between">
          <text class="text-gray">包装X坐标</text>
          <text>{{ materlist.machineXCenter }}</text>
        </view>
 
        <view class="line flex justify-between">
          <text class="text-gray">包装Y坐标</text>
          <text>{{ materlist.machineYCenter }}</text>
        </view>
 
        <view class="line flex justify-between">
          <text class="text-gray">包装Z坐标</text>
          <text>{{ materlist.machineZCenter }}</text>
        </view>
        <!-- <view class="line flex justify-between">
          <text class="text-gray">转向角度</text>
          <text>{{ materlist.rotation }}</text>
        </view> -->
        <view class="line flex justify-between">
          <text class="text-gray">层数</text>
          <text>{{ materlist.sequence }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">销售合同单号</text>
          <text>{{ materlist.info4 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">生产单号</text>
          <text>{{ materlist.info5 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">第几包</text>
          <text>{{ materlist.info6 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">经销店名称</text>
          <text>{{ materlist.info7 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">产品名称</text>
          <text>{{ materlist.info8 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">包装编码</text>
          <text>{{ materlist.info9 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">客户名称</text>
          <text>{{ materlist.info10 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">自提或发货</text>
          <text>{{ materlist.info11 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">包装部件总数量</text>
          <text>{{ materlist.info12 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">包装面积</text>
          <text>{{ materlist.info13 }}</text>
        </view>
        <!-- <view class="line flex justify-between">
          <text class="text-gray">部件名称</text>
          <text>{{ materlist.info14 }}</text>
        </view> -->
        <view class="line flex justify-between">
          <text class="text-gray">部件数量</text>
          <text>{{ materlist.info15 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">部件尺寸</text>
          <text>{{ materlist.info16 }}</text>
        </view>
        <view class="line flex justify-between">
          <text class="text-gray">包装机械手旋转</text>
          <text>{{ materlist.info17 }}</text>
        </view>
      </div>
    </u-popup>
    <button-modal
      :subShow="true"
      garmenTitle="重置"
      @submit="rest"
      @reset="rest"
    />
  </view>
</template>
<script>
import { getContainerMaterial, unbindOrder } from "@/api/putIn/untie.js";
import BluePrint from "@/pages/print/bluePrint.js";
import ButtonModal from "../../components/buttonModal.vue";
import ModalCode from "../../components/ModalCode.vue";
import { getAttrValue } from "@/utils/tool.js";
import {
  getContainDetail,
  onlyUpdateDutyCycle,
  getBhbMaterialList,
  getenumDataList,
} from "../../api/putIn/artificial.js";
export default {
  data() {
    return {
      operator: "",
      warehouse: {
        upi: "",
        materialCode: "",
        dutyCycle: "",
        gridNumber: 1,
        useNumber: 0,
        exitNumber: 0,
      },
      singlist: [
        // {}
      ], //详情列表
      ordersId: 0, //当前容器绑定的上架单
      rescode: 0,
      resmessage: "",
      options: [
        {
          text: "详情",
          style: {
            backgroundColor: "#fc9f35",
          },
        },
      ],
      detailshow: false,
      materlist: {},
      curFoucus: true,
      timer: null,
      timerSm: null,
      detailableZb: false,
      detailable: false,
      gridFocus: false,
      gridable: true,
      kwbhAllowed: false,
      enumList: [],
      areaCodeEnum: [],
    };
  },
  components: {
    ButtonModal,
    ModalCode,
  },
  created() {
    getenumDataList({
      EnumName: "UpiStatusEnum",
    }).then((res) => {
      this.enumList = res.result || [];
    });
 
    getenumDataList({
      EnumName: "AreaCodeEnum",
    }).then((res) => {
      this.areaCodeEnum = res.result || [];
    });
 
  },
  onLoad() {
    this.operator = JSON.parse(uni.getStorageSync("userInfo")).name;
  },
  mounted() {},
 
  methods: {
    getEnumName(value) {
      const name = this.enumList.find((item) => item.value === value);
      return name ? name.name : "";
    },
    getAreaCodeEnumName(value) {
      const name = this.areaCodeEnum.find((item) => item.value === value);
      return name ? name.name : "";
    },
    // 如果打开一个的时候,不需要关闭其他,则无需实现本方法
    open(index) {
      // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
      // 原本为'false',再次设置为'false'会无效
      this.singlist[index].show = true;
      this.singlist.map((val, idx) => {
        if (index != idx) this.singlist[idx].show = false;
      });
    },
    close(index) {
      this.singlist[index].show = false;
    },
    //物料详情
    longpress(index, eindex) {
      this.materlist = this.singlist[index];
      this.detailshow = true;
    },
 
    rest() {
      this.warehouse.upi = "";
      this.warehouse.upi = "";
      this.singlist = [];
    },
    //检查容器栅格数
    checkGrid() {},
    //获取容器的信息
    getContainerData(param) {
      if (!this.warehouse.upi) {
        uni.showToast({
          title: "请扫包装号",
          icon: "none",
          duration: 2000,
        });
        return;
      }
      getBhbMaterialList({
        upi: this.warehouse.upi,
      }).then((res) => {
        const result = res.result;
        if (Array.isArray(result) && result.length == 0) {
          uni.showToast({
            title: "没有查到数据",
            icon: "none",
            duration: 5000,
          });
          this.singlist = [];
          return;
        }
        this.singlist = result;
      });
    },
 
    //全部取消
    back() {
      this.ordersId = 0;
      this.singlist = [];
      this.$refs.warehouseRef.resetFields();
      this.warehouse.upi = "";
    },
  },
};
</script>
<style lang="scss">
.content {
  height: 500rpx;
  overflow-y: scroll;
  width: 100%;
  padding: 15rpx;
  box-sizing: border-box;
 
  .content-item {
    padding: 15rpx;
    background-color: #fff;
    margin-bottom: 15rpx;
    border-radius: 8rpx;
    font-size: 32rpx;
  }
}
 
.bg_item {
  background: #ffebcd !important;
}
</style>