spring
4 天以前 006a2bf3bceb04a28d48a7f46c31b21cab02838e
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
<template>
  <view class="outbound-page">
    <view class="search-section">
      <wd-row>
        <wd-col :span="21">
          <wd-search
            v-model="searchKeyword"
            placeholder="请输入车牌号"
            placeholder-left
            hide-cancel
            @search="handleSearch"
            @clear="handleClear"
          ></wd-search>
        </wd-col>
        <wd-col :span="3">
          <view class="scan_box" @click="handleSearch">
            <wd-icon name="search" size="24px" color="#0D867F"></wd-icon>
          </view>
        </wd-col>
      </wd-row>
    </view>
 
    <view class="list-section">
      <z-paging
        ref="pagingRef"
        v-model="shippingList"
        :fixed="false"
        :auto-show-back-to-top="true"
        @query="getList"
      >
        <wd-card
          v-for="(item, index) in shippingList"
          :key="item.deliveryid || index"
          custom-class="card_bg"
          @click="toMaterialDetail(item)"
        >
          <template #title>
            <text class="font-medium text-[#252525]">发货单号: {{ item.vbillcode || "-" }}</text>
          </template>
          <wd-row class="my-2">
            <wd-col :span="24">
              <view class="flex">
                <view class="icon_box">
                  <wd-icon name="folder" color="#0D867F"></wd-icon>
                </view>
                <text class="text-[#646874] mx-2">
                  发货单日期:
                  <text class="text-[#252525]">{{ item.dbilldate || "-" }}</text>
                </text>
              </view>
            </wd-col>
          </wd-row>
          <wd-row class="my-2">
            <wd-col :span="24">
              <view class="flex">
                <view class="icon_box">
                  <wd-icon name="folder" color="#0D867F"></wd-icon>
                </view>
                <text class="text-[#646874] mx-2">
                  车牌号:
                  <text class="text-[#252525]">{{ item.carno || "-" }}</text>
                </text>
              </view>
            </wd-col>
          </wd-row>
          <wd-row class="my-2" v-if="item.vmemo">
            <wd-col :span="24">
              <view class="flex">
                <view class="icon_box">
                  <wd-icon name="folder" color="#0D867F"></wd-icon>
                </view>
                <text class="text-[#646874] mx-2">
                  发货单备注:
                  <text class="text-[#252525]">{{ item.vmemo || "-" }}</text>
                </text>
              </view>
            </wd-col>
          </wd-row>
        </wd-card>
      </z-paging>
    </view>
 
    <wd-toast />
  </view>
</template>
 
<script setup lang="ts">
import { ref } from "vue";
import { useToast } from "wot-design-uni";
import zPaging from "@/components/z-paging/z-paging.vue";
import OutboundApi from "@/api/product/outbound";
 
const toast = useToast();
const pagingRef = ref();
const searchKeyword = ref("");
const shippingList = ref<any[]>([]);
 
// 获取列表数据
const getList = async (pageNo: number, pageSize: number) => {
  const params: any = {
    contractNo: "",
    carNo: searchKeyword.value || "",
    current: pageNo,
    size: pageSize,
  };
 
  try {
    const { code, data, msg } = await OutboundApi.queryErpOutboundOrder(params);
    if (code === 200 && data) {
      const records = data.records || [];
      if (!records.length) {
        pagingRef.value.complete(true);
      } else {
        pagingRef.value.complete(records);
      }
    } else {
      toast.error(msg || "获取出库单列表失败");
      pagingRef.value.complete(true);
    }
  } catch (error) {
    console.error("获取出库单列表失败:", error);
    toast.error("获取出库单列表失败");
    pagingRef.value.complete(true);
  }
};
 
// 搜索处理
const handleSearch = () => {
  // 重新加载数据
  pagingRef.value.reload();
};
 
// 清空搜索
const handleClear = () => {
  searchKeyword.value = "";
  handleSearch();
};
 
// 跳转到物料详情页
const toMaterialDetail = (item: any) => {
  uni.navigateTo({
    url: `/pages/outbound/material?id=${item.deliveryid}&vbillcode=${item.vbillcode}&vsrccode=${item.vsrccode || ""}`,
  });
};
</script>
 
<style lang="scss" scoped>
.outbound-page {
  min-height: 100vh;
  background: #f3f9f8;
  padding: 10rpx;
}
 
.search-section {
  background: #fff;
  padding: 10rpx;
  margin-bottom: 10rpx;
}
 
.scan_box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 6px;
  background: #fff;
}
 
.list-section {
  padding: 0 4px;
  height: calc(100vh - 150rpx);
}
 
.card_bg {
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.05);
  padding-bottom: 10px;
  margin-bottom: 10px;
  margin-left: 6px;
  margin-right: 6px;
}
 
.shipping-card {
  margin: 0 5px;
}
 
.icon_box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #e7f4ec99;
  border-radius: 50%;
}
 
.empty_tip {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}
 
.empty_text {
  color: #999;
  font-size: 14px;
}
 
:deep(.wd-search__block) {
  border-radius: unset;
}
</style>