schangxiang@126.com
2024-11-21 60735779c303c2dd10feea45d7fd761103b225e0
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
<template>
  <!-- 单详情 -->
  <el-drawer v-model="drawerVisible" :title="`订单详情`" direction="rtl" size="80%" @close="handleDrawerClose">
    <template #title>
      <div class="slot_title">
        <div class="title_orderNo">{{ title }}</div>
        <div>物料详情</div>
      </div>
    </template>
 
    <div class="detailBoxWrap">
      <!-- 详情组件 -->
      <!-- <open-details ref="propDetailRef"></open-details> -->
      <div class="msi-form">
        <el-form :model="detailForm">
          <el-row>
            <el-col :span="6">
              <el-form-item label="跟踪码">
                <el-input v-model="detailForm.snCode" clearable placeholder="请输入跟踪码" />
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-form-item label-width="20px">
                <el-button type="primary" icon="ele-Search" @click="getDetail">查询</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <div class="msi-content">
        <!-- <p style="margin-bottom: 10px">物料明细</p> -->
        <el-table :data="drawerList" border striped :max-height="480">
          <el-table-column fixed="left" type="index" label="序号" width="55" align="center" />
          <el-table-column fixed="left" prop="materialCode" min-width="120px" label="物料编号" show-overflow-tooltip="" />
          <el-table-column prop="materialName" label="物料名称" show-overflow-tooltip="" />
          <el-table-column prop="quantity" label="库存数" show-overflow-tooltip="" />
          <el-table-column prop="snCode" width="180" label="跟踪码" show-overflow-tooltip="" />
          <el-table-column prop="containerCode" width="100" label="容器编号" show-overflow-tooltip="" />
          <el-table-column prop="placeName" width="100" label="所在库位" show-overflow-tooltip="" />
          <el-table-column prop="areaName" width="100" label="所在库区" show-overflow-tooltip="" />
          <el-table-column prop="stockStatus" label="库存状态" show-overflow-tooltip="">
            <template #default="scope">
              {{ getEnumDesc(scope.row.stockStatus, getEnumStockStatusData_Index) }}
            </template>
          </el-table-column>
          <el-table-column prop="containerIsDisabled" label="容器是否禁用" min-width="110px" show-overflow-tooltip="">
            <template #default="scope">
              {{ scope.row.containerIsDisabled ? "是" : "否" }}
            </template>
          </el-table-column>
          <el-table-column prop="placeStatus" label="库位属性" show-overflow-tooltip="">
            <template #default="scope">
              {{ getEnumDesc(scope.row.placeStatus, getEnumPlaceStatusData_Index) }}
            </template>
          </el-table-column>
 
          <el-table-column prop="qcStatus" label="质检状态" show-overflow-tooltip="">
            <template #default="scope">
              {{ getEnumDesc(scope.row.qcStatus, getEnumQCStatusData_Index) }}
            </template>
          </el-table-column>
 
          <el-table-column prop="materialUnit" label="库存单位" show-overflow-tooltip="" />
          <el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
          <el-table-column prop="relationNo" label="关联单号" min-width="150px" show-overflow-tooltip="" />
          <el-table-column prop="recordInsertTime" label="收货时间" width="140px" :formatter="formatDate_T_Time"
            show-overflow-tooltip="" />
          <el-table-column prop="supplierCode" label="供应商编号" width="100" show-overflow-tooltip="" />
          <el-table-column prop="supplierName" label="供应商名称" width="140" show-overflow-tooltip="" />
          <el-table-column prop="supplierBatch" label="供应商批次" width="80" show-overflow-tooltip="" />
          <el-table-column prop="erpCode" width="100" label="ERP库存地" show-overflow-tooltip="" />
 
          <el-table-column prop="erpVoucher" width="120" label="ERP凭证" show-overflow-tooltip="" />
 
        </el-table>
        <Pagination :total="detailCount" v-model:page="detailForm.Page" v-model:limit="detailForm.PageSize"
          @pagination="getDetail" style="margin-top: 20px; text-align: center"></Pagination>
 
        <div></div>
      </div>
    </div>
  </el-drawer>
</template>
<script lang="ts" setup>
import Pagination from "/@/components/Pagination/index.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import {
  ref,
  nextTick,
  computed,
  getCurrentInstance,
  watch,
  defineExpose,
  defineProps,
  onMounted,
} from "vue";
import {
  getTypeStatus
} from "/@/utils/formate";
 
import { formatDecimalData } from "/@/utils/formate";
import { expandMore } from "/@/hooks/expandMore";
import cache from "/@/utils/cache";
import { pageWmsMaterial } from "/@/api/main/WmsBase/wmsMaterial";
import { getAPI } from "/@/utils/axios-utils";
import { SysEnumApi } from "/@/api-services/api";
import OpenDetails from "/@/components/openDetails/openDetails.vue";
import { formatDate, formatDate_T_Date, formatDate_T_Time, defaultTimeRange } from '/@/utils/formatTime';
import commonFunction from "/@/utils/commonFunction";
import { handleSlectDataWmsBusinessType } from "/@/utils/selectData";
import { pageWmsStockQuan } from "/@/api/main/ReportCenter/wmsStockQuan";
const { proxy }: any = getCurrentInstance(); // 访问实例上下文 proxy同时支持开发 线上环境
const getEnumStockStatusData_Index = ref<any>([]);
const getContainerIsDisabled_Index = ref<any>([]);
const getEnumPlaceState_Index = ref<any>([]);
const getEnumQCStatusData_Index = ref<any>([]);
  const getEnumPlaceStatusData_Index = ref<any>([]);
const { getEnumDesc } = commonFunction();
const emits = defineEmits(["getTabelData"]);
const props = defineProps({
  titleAuthor: {
    type: Number,
    required: true,
  },
  hexiao: {
    type: Number,
    default: 1,
    required: true,
  },
});
 
// -------------------获取PO单下物料详情-----------------------------------
//入库单下物料详情请求
const detailForm = ref({
  materialCode: "",
  snCode:"",
  Page: 1,
  PageSize: 10,
});
 
// 物料详情抽屉
const drawerVisible = ref(false);
const drawerType = ref("drawerAll");
// const
//单号
const purchaseNo = ref("");
 
//打开抽屉
const openDrawer = async (type: number, scope: any = {}, entozhExcell?: any) => {
 
  detailForm.value.Page = 1; //bug:点编辑-再点详情
  detailForm.value.PageSize = 10; //bug:点编辑-再点详情
 
  if (scope.materialCode) {
    title.value = `${scope.materialCode}`;
  }
  drawerType.value = "drawerAll";
  drawerVisible.value = true;
  purchaseNo.value = scope.materialCode;
  detailForm.value.materialCode = scope.materialCode;
 
  //------------------获取物料列表物料明细
  getDetail();
  //------------------获取物料列表物料明细
 
  getEnumStockStatusData_Index.value =
    (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ??
    [];
  getContainerIsDisabled_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ?? [];
  getEnumPlaceState_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ?? [];
  getEnumQCStatusData_Index.value =
    (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockQcStatusEnum")).data
      .result ?? [];
      getEnumPlaceStatusData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('PlaceStatusEnum')).data.result ?? [];
  // //----------------物料明细
  // // 根据状态转中文 保留3位小数
  // let scopetrans = JSON.parse(JSON.stringify(scope));
  // // scopetrans.totalquantity = Number(scopetrans.totalquantity).toFixed(3);
  // nextTick(() => {
  //   scopetrans.poStatus = getEnumDesc(scopetrans.poStatus, getEnumPoDetailStatusData_Index.value);
  //   scopetrans.businessType = getEnumDesc(scopetrans.businessType, getBusinessTypeData_Index.value);
  //   scopetrans.orderType = getEnumDesc(scopetrans.orderType, getEnumOrderTypeData_Index.value);
  //   proxy.$refs["propDetailRef"].openADialog(scopetrans, entozhExcell);
  // });
};
 
//关闭抽屉
const handleDrawerClose = () => {
  detailForm.value = {
    materialCode: "",
    snCode:"",
    Page: 1,
    PageSize: 10,
  };
  deltailList.value = [];
  detailCount.value = 0;
  drawerList.value = [];
  detailCount.value = 0;
};
 
//物料详情类型
interface DetailType {
  id: number;
}
 
//入库单详情列表
const deltailList = ref<DetailType[]>([]);
//弹出层数据
const drawerList = ref<DetailType[]>([]);
 
//入库单详情列表数据条数
const detailCount = ref(0);
const loading = ref(false)
//弹出层标题
let title = ref("");
//获取入库单下物料详情
const getDetail = async (callback?: any) => {
  loading.value = true;
 
  var res = await pageWmsStockQuan(Object.assign(detailForm.value));
  if (res.data.type == "success") {
 
    drawerList.value = res.data.result?.items ?? [];
    detailCount.value = res.data.result?.total;
 
  }
  loading.value = false;
};
 
// 页面加载时
onMounted(async () => {
 
});
 
 
// 暴露方法
defineExpose({ openDrawer });
</script>
<style lang="less" scoped>
.detailBoxWrap {
  margin: 10px;
}
 
.msi-form {
  margin-top: 10px;
}
 
.msi-form {
  margin-bottom: 10px;
}
 
.slot_title {
  display: flex;
  align-items: center;
 
  // margin-left: 20px;
  .title_orderNo {
    font-size: 18px;
    color: #F18201;
    font-weight: bold;
    margin-right: 5px;
  }
}
</style>