222
schangxiang@126.com
2024-12-18 4a68e02a9dbffe0b215ceb1d9758ccb17329e523
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
<template>
  <div class="wmsRecordUpiProcess-container">
    <el-card shadow="hover" :body-style="{ paddingBottom: '0' }"> 
      <el-form :model="queryParamsWmsRecordUpiProcess" ref="queryForm" labelWidth="90">
        <el-row>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
            <el-form-item label="关键字">
              <el-input v-model="queryParamsWmsRecordUpiProcess.searchKey" clearable="" placeholder="部件条码,包装号,生产单号,批次号,订单号,位置,部件名称,材料,备注,创建人"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="部件条码">
              <el-input v-model="queryParamsWmsRecordUpiProcess.upi" clearable="" placeholder="请输入部件条码"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="包装号">
              <el-input v-model="queryParamsWmsRecordUpiProcess.packageCode" clearable="" placeholder="请输入包装号"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="生产单号">
              <el-input v-model="queryParamsWmsRecordUpiProcess.info5" clearable="" placeholder="请输入生产单号"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="批次号">
              <el-input v-model="queryParamsWmsRecordUpiProcess.planNo" clearable="" placeholder="请输入批次号"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="订单号">
              <el-input v-model="queryParamsWmsRecordUpiProcess.orderId" clearable="" placeholder="请输入订单号"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="板料状态">
              <el-select clearable="" v-model="queryParamsWmsRecordUpiProcess.upiStatus" placeholder="请选择板料状态">
                <el-option v-for="(item,index) in getEnumUpiStatusData_Index" :key="index" :value="item.value" :label="`${item.describe}`" />
                
              </el-select>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="标记">
              <el-select clearable="" v-model="queryParamsWmsRecordUpiProcess.upiFlag" placeholder="请选择标记">
                <el-option v-for="(item,index) in getEnumUpiFlagData_Index" :key="index" :value="item.value" :label="`${item.describe}`" />
                
              </el-select>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="位置">
              <el-input v-model="queryParamsWmsRecordUpiProcess.location" clearable="" placeholder="请输入位置"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="部件名称">
              <el-input v-model="queryParamsWmsRecordUpiProcess.detailName" clearable="" placeholder="请输入部件名称"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="材料">
              <el-input v-model="queryParamsWmsRecordUpiProcess.info18" clearable="" placeholder="请输入材料"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="备注">
              <el-input v-model="queryParamsWmsRecordUpiProcess.operRemark" clearable="" placeholder="请输入备注"/>
              
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordUpiProcess">
            <el-form-item label="创建时间">
              <el-date-picker placeholder="请选择创建时间" value-format="YYYY/MM/DD  HH:mm:ss" type="datetimerange" :default-time="defaultTimeRange" v-model="queryParamsWmsRecordUpiProcess.createTimeRange" />
              
            </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 type="primary"  icon="ele-Search" @click="handleQueryWmsRecordUpiProcess" v-auth="'wmsRecordUpiProcess:page'" :disabled="disabled_btnWmsRecordUpiProcess"> 查询 </el-button>
                      <el-button icon="ele-Refresh" @click="resetWmsRecordUpiProcess"> 重置 </el-button>
                        <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUIWmsRecordUpiProcess" v-if="!showAdvanceQueryUIWmsRecordUpiProcess" style="margin-left:5px;"> 高级查询 </el-button>
                        <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUIWmsRecordUpiProcess" v-if="showAdvanceQueryUIWmsRecordUpiProcess" style="margin-left:5px;"> 隐藏 </el-button>
                <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWmsRecordUpiProcess" v-auth="'wmsRecordUpiProcess:add'"> 新增 </el-button>
                <el-button type="primary" style="margin-left:5px;" icon="ele-Download" @click="handleExportExcelWmsRecordUpiProcess"  v-auth="'wmsRecordUpiProcess:exportExcel'" > 导出 </el-button>
              </el-button-group>
            </el-form-item>
            
          </el-col>
        </el-row>
      </el-form>
    </el-card>
    <el-card class="full-table" shadow="hover" style="margin-top: 5px">
      <el-table
                ref="tableRefWmsRecordUpiProcess"
                :data="tableDataWmsRecordUpiProcess"
                style="width: 100%"
                v-loading="loadingWmsRecordUpiProcess"
                tooltip-effect="light"
                                row-key="id"
                @sort-change="sortChangeWmsRecordUpiProcess"
                border="">
        <el-table-column type="index" label="序号" width="55" align="center"/>
        <el-table-column prop="upi" label="部件条码"  show-overflow-tooltip="" />
        <el-table-column prop="packageCode" label="包装号"  show-overflow-tooltip="" />
        <el-table-column prop="info5" label="生产单号"  show-overflow-tooltip="" />
        <el-table-column prop="planNo" label="批次号"  show-overflow-tooltip="" />
        <el-table-column prop="orderId" label="订单号"  show-overflow-tooltip="" />
          <el-table-column prop="upiStatus" label="板料状态"  show-overflow-tooltip="" >
            <template #default="scope">
              <el-tag>{{ getEnumDesc(scope.row.upiStatus, getEnumUpiStatusData_Index)}}</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="upiFlag" label="标记"  show-overflow-tooltip="" >
            <template #default="scope">
              <el-tag>{{ getEnumDesc(scope.row.upiFlag, getEnumUpiFlagData_Index)}}</el-tag>
            </template>
          </el-table-column>
        <el-table-column prop="location" label="位置"  show-overflow-tooltip="" />
        <el-table-column prop="detailName" label="部件名称"  show-overflow-tooltip="" />
        <el-table-column prop="info18" label="材料"  show-overflow-tooltip="" />
        <el-table-column prop="operRemark" label="备注"  show-overflow-tooltip="" />
         <el-table-column prop="createTime" label="创建时间" width="130" :formatter="formatDate_T_Time"  show-overflow-tooltip="" />
        <el-table-column prop="createUserName" label="创建人"  show-overflow-tooltip="" />
        <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('wmsRecordUpiProcess:update') || auth('wmsRecordUpiProcess:delete')">
          <template #default="scope">
            <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWmsRecordUpiProcess(scope.row)" v-auth="'wmsRecordUpiProcess:update'"> 编辑 </el-button>
            <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWmsRecordUpiProcess(scope.row)" v-auth="'wmsRecordUpiProcess:delete'"> 删除 </el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
                v-model:currentPage="tableParamsWmsRecordUpiProcess.page"
                v-model:page-size="tableParamsWmsRecordUpiProcess.pageSize"
                :total="tableParamsWmsRecordUpiProcess.total"
                :page-sizes="[10, 20, 50, 100, 200, 500]"
                small=""
                background=""
                @size-change="handleSizeChangeWmsRecordUpiProcess"
                @current-change="handleCurrentChangeWmsRecordUpiProcess"
                layout="total, sizes, prev, pager, next, jumper"
    />
      <printDialogWmsRecordUpiProcess
        ref="printDialogRefWmsRecordUpiProcess"
        :title="printWmsRecordUpiProcessTitle"
        @reloadTable="handleQueryWmsRecordUpiProcess" />
      <editDialogWmsRecordUpiProcess
        ref="editDialogRefWmsRecordUpiProcess"
        :title="editWmsRecordUpiProcessTitle"
        @reloadTable="handleQueryWmsRecordUpiProcess"
      />
    </el-card>
  </div>
</template>
 
<script lang="ts" setup="" name="wmsRecordUpiProcess">
  import { ref,onMounted } 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,formatDate_T_Date,formatDate_T_Time,defaultTimeRange } from '/@/utils/formatTime';
  import { exportPageExcel } from '/@/utils/exportPageExcel' //引入导出方法
 
 
  import printDialogWmsRecordUpiProcess from '/@/views/system/print/component/hiprint/preview.vue'
  import { pageWmsRecordUpiProcess, deleteWmsRecordUpiProcess,importExcelWmsRecordUpiProcess,downloadExcelTemplateWmsRecordUpiProcess } from '/@/api/main/ReportCenter/wmsRecordUpiProcess';
    import { getAPI } from '/@/utils/axios-utils';
    import { SysEnumApi } from '/@/api-services/api';
  import commonFunction from '/@/utils/commonFunction';
 
  const getEnumUpiStatusData_Index = ref<any>([]);
  const getEnumUpiFlagData_Index = ref<any>([]);
 
    const { getEnumDesc } = commonFunction();
  
  /***************************************************[板件过程履历操作]开始***************************************************/
  const showAdvanceQueryUIWmsRecordUpiProcess = ref(false);
  const tableRefWmsRecordUpiProcess = ref(null);
  const printDialogRefWmsRecordUpiProcess = ref();
  const editDialogRefWmsRecordUpiProcess = ref();
  const loadingWmsRecordUpiProcess = ref(false);
  const disabled_btnWmsRecordUpiProcess = ref(false);
  const tableDataWmsRecordUpiProcess = ref<any>([]);
  const queryParamsWmsRecordUpiProcess = ref<any>({});
  const tableParamsWmsRecordUpiProcess = ref({
    page: 1,
    pageSize: 10,
    total: 0,
  });
 
  const printWmsRecordUpiProcessTitle = ref("");
  const editWmsRecordUpiProcessTitle = ref("");
 
  // 改变高级查询的控件显示状态
  const changeAdvanceQueryUIWmsRecordUpiProcess = () => {
    showAdvanceQueryUIWmsRecordUpiProcess.value = !showAdvanceQueryUIWmsRecordUpiProcess.value;
  }
 
  // 查询板件过程履历
  const handleQueryWmsRecordUpiProcess = async () => {
    loadingWmsRecordUpiProcess.value = true;
    disabled_btnWmsRecordUpiProcess.value = true;
    var res = await pageWmsRecordUpiProcess(Object.assign(queryParamsWmsRecordUpiProcess.value, tableParamsWmsRecordUpiProcess.value));
    if(res.data.type=="success"){
      tableDataWmsRecordUpiProcess.value = res.data.result?.items ?? [];
      tableParamsWmsRecordUpiProcess.value.total = res.data.result?.total;
    }
    loadingWmsRecordUpiProcess.value = false;
    disabled_btnWmsRecordUpiProcess.value = false;
  };
 
  // 重置板件过程履历查询
  const resetWmsRecordUpiProcess = async () => {
    queryParamsWmsRecordUpiProcess.value = {}
  };
 
  // 板件过程履历列排序
  const sortChangeWmsRecordUpiProcess = async (column: any) => {
    queryParamsWmsRecordUpiProcess.value.field = column.prop;
    queryParamsWmsRecordUpiProcess.value.order = column.order;
    await handleQueryWmsRecordUpiProcess();
  };
 
  // 打开新增板件过程履历页面
  const openAddWmsRecordUpiProcess = () => {
    editWmsRecordUpiProcessTitle.value = '添加板件过程履历';
    editDialogRefWmsRecordUpiProcess.value.openDialog(1,{});
  };
 
  // 打开打印板件过程履历页面
  const openPrintWmsRecordUpiProcess = async (row: any) => {
    printWmsRecordUpiProcessTitle.value = '打印板件过程履历';
  }
  
  // 打开编辑板件过程履历页面
  const openEditWmsRecordUpiProcess = (row: any) => {
    editWmsRecordUpiProcessTitle.value = '编辑板件过程履历';
    editDialogRefWmsRecordUpiProcess.value.openDialog(2,row);
  };
 
  // 删除板件过程履历
  const delWmsRecordUpiProcess = (row: any) => {
    ElMessageBox.confirm(`确定要删除吗?`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
  .then(async () => {
    loadingWmsRecordUpiProcess.value = true;
    var ret = await deleteWmsRecordUpiProcess(row);
    if(ret.data.type=="success"){
        ElMessage.success("删除成功");
    }
    loadingWmsRecordUpiProcess.value = false;
    handleQueryWmsRecordUpiProcess();
  })
  .catch(() => {});
  };
 
  // 改变板件过程履历页面容量
  const handleSizeChangeWmsRecordUpiProcess = (val: number) => {
    tableParamsWmsRecordUpiProcess.value.pageSize = val;
    handleQueryWmsRecordUpiProcess();
  };
 
  // 改变板件过程履历页码序号
  const handleCurrentChangeWmsRecordUpiProcess = (val: number) => {
    tableParamsWmsRecordUpiProcess.value.page = val;
    handleQueryWmsRecordUpiProcess();
  };
 
/***************************************************[板件过程履历操作]结束***************************************************/
/***************************************************[板件过程履历导出]开始***************************************************/
//定义当前页面的方法组
const functionMapWmsRecordUpiProcess = {
      getEnumUpiStatusData_Index,
      getEnumUpiFlagData_Index,
      formatDate_T_Date,
      formatDate_T_Time
};
//点击导出按钮
const handleExportExcelWmsRecordUpiProcess = async (formData:Blob) => {
    loadingWmsRecordUpiProcess.value = true;
    disabled_btnWmsRecordUpiProcess.value = true;
    var new_tableParamsWmsRecordUpiProcess=JSON.parse(JSON.stringify(tableParamsWmsRecordUpiProcess.value));
    new_tableParamsWmsRecordUpiProcess.page = 1;
    new_tableParamsWmsRecordUpiProcess.pageSize = 100000;
    var res = await pageWmsRecordUpiProcess(Object.assign(queryParamsWmsRecordUpiProcess.value, new_tableParamsWmsRecordUpiProcess));
    if(res.data.type=="success"){
      exportExcelWmsRecordUpiProcess(res.data.result?.items ?? []);
    }
    loadingWmsRecordUpiProcess.value = false;
    disabled_btnWmsRecordUpiProcess.value = false;
};
//导出
const exportExcelWmsRecordUpiProcess  = async (exportDataList:Array) => {
  exportPageExcel(exportDataList, tableRefWmsRecordUpiProcess,"板件过程履历",functionMapWmsRecordUpiProcess);
};
/***************************************************[板件过程履历导出]结束***************************************************/
  // 板件过程履历页面加载时
  onMounted(async () => {
    getEnumUpiStatusData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('UpiStatusEnum')).data.result ?? [];
    getEnumUpiFlagData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('UpiFlagEnum')).data.result ?? [];
  });
 
  handleQueryWmsRecordUpiProcess();
</script>
<style scoped>
:deep(.el-input),
:deep(.el-select),
:deep(.el-input-number) {
    width: 100%;
}
</style>