liuying
2024-11-27 92055daa17b8d7f9d6e60113f17af269efcf2152
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
<template>
    <div class="wmsSubstituteGood-container">
        <el-card class="full-table" shadow="hover" style="margin-top: 5px">
            <el-form :model="queryParams" @submit.native.prevent ref="queryForm" labelWidth="100">
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="10" :xl="4" class="mb10">
                        <el-form-item label="部件条码" size="large">
                            <el-input
                                size="large"
                                v-model="queryParams.upi"
                                ref="materialCodeInput"
                                clearable=""
                                placeholder="请扫部件条码"
                                @input="handleChange"
                                @keyup.enter.prevent="handleEnter"
                                @confirm.enter.prevent="handleEnter"
                            />
                        </el-form-item>
                    </el-col>
 
                    <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
                        <el-form-item>
                            <el-button-group style="display: flex; align-items: center">
                                <el-button size="large" type="primary" icon="ele-Search" @click="handleQuery"> 查询 </el-button>
                                <el-button size="large" icon="ele-Refresh" @click="() => (queryParams = {})"> 重置 </el-button>
                                <!-- 
                        <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
                        <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button> -->
                                <!-- <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWmsSubstituteGood" v-auth="'wmsSubstituteGood:add'"> 新增 </el-button> -->
                            </el-button-group>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <br />
            <div class="detailBox">
                <ul>
                    <!-- <li>
                        <span class="text_left">是否齐包:</span>
                        <span class="text_rt"></span>
                    </li>
                    <li>
                        <span class="text_left">是否齐套:</span>
                        <span class="text_rt"></span>
                    </li> -->
 
                    <li>
                        <span class="text_left">部件条码:</span>
                        <span class="text_rt">{{ tableData.upi }}</span>
                    </li>
 
                    <li>
                        <span class="text_left">部件名称:</span>
                        <span class="text_rt">{{ tableData.detailName }}</span>
                    </li>
 
                    <li>
                        <span class="text_left">批次号:</span>
                        <span class="text_rt">{{ tableData.planNo }}</span>
                    </li>
                    <li>
                        <span class="text_left">订单号:</span>
                        <span class="text_rt">{{ tableData.orderId }}</span>
                    </li>
                    <br />    <br />    <br />    <br />    <br />    <br />
                        <br />    <br />    <br />    <br />    <br />
                    <br />    <br />    <br />    <br />    <br />    <br />    
 
 
                    <!-- <li>
                        <span class="text_left">客户名称:</span>
                        <span class="text_rt">{{ tableData.Info10 }}</span>
                    </li> -->
 
                    <!-- <li>
                        <span class="text_left">长:</span>
                        <span class="text_rt">{{ tableData.length }}</span>
                    </li>
                    <li>
                        <span class="text_left">宽:</span>
                        <span class="text_rt">{{ tableData.width }}</span>
                    </li>
                    <li>
                        <span class="text_left">厚:</span>
                        <span class="text_rt">{{ tableData.thk }}</span>
                    </li>
                    <li>
                        <span class="text_left">部件纹理:</span>
                        <span class="text_rt">{{ tableData.matgrid }}</span>
                    </li>
                    <li>
                        <span class="text_left">是否封边:</span>
                        <span class="text_rt">{{ tableData.isEB }}</span>
                    </li>
                    <li>
                        <span class="text_left">打孔设备编号:</span>
                        <span class="text_rt">{{ tableData.dRNum }}</span>
                    </li> -->
                </ul>
            </div>
            <!-- 生成form 齐套 齐包 设置ng包 -->
            <!-- 生成form 齐套 齐包 设置ng包 -->
            <!-- <el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
      <el-row :gutter="35">
        <el-form-item v-show="false">
          <el-input v-model="ruleForm.id" />
        </el-form-item>
 
        <el-form-item label="齐套" prop="completeSet">
          <el-select v-model="ruleForm.completeSet" placeholder="请选择齐套">
            <el-option label="选项1" value="option1"></el-option>
            <el-option label="选项2" value="option2"></el-option>
          </el-select>
        </el-form-item>
 
        <el-form-item label="齐包" prop="packageSetup">
          <el-input v-model="ruleForm.packageSetup" placeholder="请输入齐包设置"></el-input>
        </el-form-item>
 
        <el-form-item label="ng包" prop="ngPackage">
          <el-input v-model="ruleForm.ngPackage" placeholder="请输入ng包"></el-input>
        </el-form-item>
        
      </el-row>
    </el-form> -->
        </el-card>
    </div>
</template>
 
<script lang="ts" setup="" name="wmsSubstituteGood">
import { onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { auth } from '/@/utils/authFunction';
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
import { formatDate } from '/@/utils/formatTime';
import { listMes_BatchOrderUPI_New, deleteMes_BatchOrderUPI_New, importExcelMes_BatchOrderUPI_New, downloadExcelTemplateMes_BatchOrderUPI_New } from '/@/api/main/WmsOrder/mes_BatchOrderUPI_New';
import printDialog from '/@/views/system/print/component/hiprint/preview.vue';
import editDialog from '/@/views/main/WmsBase/wmsSubstituteGood/component/editDialog.vue';
import { pageWmsSubstituteGood, deleteWmsSubstituteGood } from '/@/api/main/WmsBase/wmsSubstituteGood';
import { ShortageList } from '/@/api/main/ReportCenter/wmsStockQuan';
 
const showAdvanceQueryUI = ref(false);
const printDialogRef = ref();
const editDialogRef = ref();
const loading = ref(false);
const tableData = ref<any>([]);
const queryParams = ref<any>({
    upi: '',
});
const tableParams = ref({
    page: 1,
    pageSize: 10,
    total: 0,
});
const getIsDisabledData = [
    {
        value: true,
        text: '是',
    },
    {
        value: false,
        text: '否',
    },
];
const printWmsSubstituteGoodTitle = ref('');
const editWmsSubstituteGoodTitle = ref('');
 
// 改变高级查询的控件显示状态
const changeAdvanceQueryUI = () => {
    showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
};
// 用于引用输入框
const materialCodeInput = ref(null);
 
onMounted(() => {
    // 在组件挂载后进行聚焦
    materialCodeInput.value.$el.querySelector('input').focus();
});
 
// 查询操作 888888888
const handleQuery = async () => {
    console.log('8888888进入方法', queryParams.value);
    if (!queryParams.value.upi) {
        return;
    }
    console.log('查询');
    loading.value = true;
    var res = await ShortageList(Object.assign(queryParams.value, tableParams.value));
    if (res.data.result.length != 1) {
        ElMessage.warning('此条码不存在或不在缺料清单中!');
        tableData.value = [];
        return;
    }
    tableData.value = res.data.result[0] ?? [];
    loading.value = false;
};
 
// 列排序
const sortChange = async (column: any) => {
    queryParams.value.field = column.prop;
    queryParams.value.order = column.order;
    await handleQuery();
};
 
// 打开新增页面
const openAddWmsSubstituteGood = () => {
    editWmsSubstituteGoodTitle.value = '添加替代品管理';
    editDialogRef.value.openDialog({});
};
 
// 打开打印页面
const openPrintWmsSubstituteGood = async (row: any) => {
    printWmsSubstituteGoodTitle.value = '打印替代品管理';
};
 
// 打开编辑页面
const openEditWmsSubstituteGood = (row: any) => {
    editWmsSubstituteGoodTitle.value = '编辑替代品管理';
    editDialogRef.value.openDialog(row);
};
 
// 删除
const delWmsSubstituteGood = (row: any) => {
    ElMessageBox.confirm(`确定要删除吗?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    })
        .then(async () => {
            var ret = await deleteWmsSubstituteGood(row);
            if (ret.data.type == 'success') {
                handleQuery();
                ElMessage.success('删除成功');
            }
        })
        .catch(() => {});
};
 
// 改变页面容量
const handleSizeChange = (val: number) => {
    tableParams.value.pageSize = val;
    handleQuery();
};
 
// 改变页码序号
const handleCurrentChange = (val: number) => {
    tableParams.value.page = val;
    handleQuery();
};
 
// handleQuery();
 
const rules = {
    // 这里定义表单验证规则
    completeSet: [{ required: true, message: '请选择齐套', trigger: 'change' }],
    packageSetup: [{ required: true, message: '请输入齐包设置', trigger: 'blur' }],
    ngPackage: [{ required: true, message: '请输入ng包', trigger: 'blur' }],
};
 
const ruleForm = ref({
    id: '',
    completeSet: '',
    packageSetup: '',
    ngPackage: '',
});
 
const sourceEnum: any = ref([
    {
        value: 'id',
        text: 'ID',
    },
]);
 
const handleChange = (event: Event) => {
    console.log('77777777777');
    handleQuery();
};
 
const handleEnter = (event: Event) => {
    event.preventDefault(); // 阻止默认事件
    handleQuery();
};
</script>
<style scoped>
:deep(.el-input),
:deep(.el-select),
:deep(.el-input-number) {
    width: 100%;
}
 
.detailBox {
    width: 90%;
    margin: 0 auto;
    display: block;
    padding-bottom: 10px;
    ul {
        margin: 0;
        padding: 0;
        li {
            display: block;
            line-height: 30px;
            text-align: left;
            list-style-type: none;
            width: 25%;
            word-wrap: break-word;
        }
    }
}
.text_left {
    font-weight: 700;
}
</style>