33
schangxiang@126.com
2024-12-07 9597b1df912c1ca4401a74970d9472e268b3a9c2
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
<template>
  <el-dialog  v-model="dialogVisible" width="95%"  @close="closeDialog"  :close-on-click-modal="false">
    <template #header>
      <div style="color: #fff">
        <span> 分配详情 </span>
      </div>
    </template>
    <el-form :model="materialForm" label-width="70px">
      <el-row>
        <!-- <el-col :span="4">
          <el-form-item label="单号">
            <el-input v-model="materialForm.movementNo" placeholder="请输入单号" disabled clearable></el-input>
          </el-form-item>
        </el-col> -->
        <el-col :span="4">
          <el-form-item label="物料编号">
            <el-input v-model="materialForm.materialCode" placeholder="请输入物料编号" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="20px">
            <el-button type="primary" icon="el-icon-search" @click="getOrderMaterialList1">查询</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="msi-content" style="margin-top: 10px">
      <el-table
        :data="warehousOrderDetails"  border
        style="width: 100%"
        row-key="setRowKey"
        ref="tableRef"
       
        max-height="480"
      >
        <el-table-column label="序号" align="center" width="60" type="index" />
        <el-table-column prop="materialCode" label="物料编号" show-overflow-tooltip="" />
        <el-table-column prop="materialName" label="物料名称" show-overflow-tooltip="" />
        <el-table-column prop="movementLineNumber" label="行号" show-overflow-tooltip="" />
        <el-table-column prop="pdRecordStatusName" min-width="60px" label="状态" show-overflow-tooltip="" >
          <template #default="scope">
            {{ scope.row.pdRecordStatusName }}
          </template>
        </el-table-column>
        <!-- <el-table-column prop="unit" label="单位" show-overflow-tooltip="" />
        <el-table-column label="客户编号" prop="custCode" align="center" min-width="110" /> -->
        <!-- <el-table-column prop="quantity1" label="已出库数" show-overflow-tooltip="" /> -->
        <!-- <el-table-column prop="quantity" label="订单数" show-overflow-tooltip="" />
        <el-table-column prop="predetermineQuantity" label="已预配数" show-overflow-tooltip="" /> -->
        <el-table-column prop="quantity" label="已分配数" show-overflow-tooltip="" />
      </el-table>
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <!-- <el-button type="primary" :disabled="warehousOrderDetails.length == 0" @click="confirm">指定分配</el-button> -->
      </span>
    </template>
  </el-dialog>
 
 
</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 { getAPI } from "/@/utils/axios-utils";
import { SysEnumApi } from "/@/api-services/api";
import commonFunction from "/@/utils/commonFunction";
 
import {  pageFpWmsOrderMovementDetails,} from "/@/api/main/WmsOrder/wmsOrderMovementDetails";
import { handleSlectDataWmsArea } from "/@/utils/selectData";
const { proxy }: any = getCurrentInstance(); // 访问实例上下文 proxy同时支持开发 线上环境
const getEnumBusinessTypeData = ref<any>([]);
const { getEnumDesc } = commonFunction();
const emits = defineEmits(["getTabelData"]);
 
const getEnumDockData = ref<any>([]);
const props = defineProps({
  hexiao: {
    type: Number,
    default: 1,
    required: true,
  },
});
const loading = ref(false);
const dialogVisible = ref(false);
 
// 禁止之前的日期
const disabledDate = (time: Date) => {
  return time.getTime() + 3600 * 1000 * 24 < Date.now();
};
 
//物料基础数据form
const materialForm = ref({
    materialCode: '',
  PDRecordType:1,
  PDRecordStatus: 2, // 只查询 状态是“已分配”的数据 【Editby shaocx,2024-07-11】
  MovementNo:'',
    // page: 1,
    // pageSize: 10000,
});
//添加编辑窗口物料列表
const warehousOrderDetails = ref<any[]>([]);
//打开
const openDialog = async (type?: number, scope?: any = {}) => {
  //debugger
  console.log('scope',scope)
  materialForm.value.materialCode = scope.materialCode;
  materialForm.value.MovementNo = scope.movementNo;
  getOrderMaterialList1();
  dialogVisible.value = true;
};
 
const getOrderMaterialList1 = async () => {
 
    //下架单入口-分配-下架单明细
    loading.value = true;
    var res = await pageFpWmsOrderMovementDetails(
      Object.assign(materialForm.value)
    );
 
    var listD = res.data.result?? [];
    listD.forEach((item: any) => {
      item.sendQuantity = Number(item.quantity - item.dispenseQuantity).toFixed(3); //订单数-已分配
    });
    warehousOrderDetails.value = listD;
    loading.value = false;
 
};
 
//物料详情的table ref
const tableRef = ref();
const setRowKey = (row: any) => {
  return row.id + row.asnLineNumber;
};
//关闭窗口
const closeDialog = () => {
  materialForm.value = {
    materialCode: '',
    PDRecordType:1,
    PDRecordStatus: 2, // 只查询 状态是“已分配”的数据 【Editby shaocx,2024-07-11】
    // 移动单号
    page: 1,
    pageSize: 10000,
  };
  dialogVisible.value = false
  warehousOrderDetails.value = [];
  tableRef.value.clearSelection();
};
 
 
 
 
 
// 页面加载时
onMounted(async () => {});
 
//================
 
// 暴露方法
defineExpose({ openDialog });
</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>