|
|
@@ -2509,7 +2509,7 @@ let CJMC=ref()
|
|
|
const sbzyData = reactive([])
|
|
|
const FPData = reactive([])
|
|
|
const CLMXData = reactive([])
|
|
|
-let JYData = reactive([])
|
|
|
+const JYData = ref([]); // 使用 ref 创建响应式数组
|
|
|
|
|
|
//工单打印
|
|
|
const pd_gdprintonClick = () => {
|
|
|
@@ -2918,42 +2918,49 @@ const setTeams = async(row) => {
|
|
|
}
|
|
|
//检验记录
|
|
|
const InspectionRecord = async () => {
|
|
|
- JYData=[]
|
|
|
- const response = await inspectionRecord({machine:JTMC,Gd_gdbh:formData.value.工单编号,team:BZMC.value});
|
|
|
- if(response.code==0){
|
|
|
- // 提取 inspectiontime 作为列名
|
|
|
- // Extract inspectiontime as columnNames
|
|
|
- columnNames = response.data.inspectiontime;
|
|
|
-
|
|
|
- // Populate drzcData with row data
|
|
|
- for (const key in response.data) {
|
|
|
- if (key !== 'inspectiontime') {
|
|
|
- const item = response.data[key];
|
|
|
- const rowData = {
|
|
|
- '工单编号': item['工单编号'],
|
|
|
- '印件号': item['印件号'],
|
|
|
- '工序名称': item['工序名称'],
|
|
|
- '检验项目': item['检验项目']
|
|
|
- };
|
|
|
-
|
|
|
- // Initialize time columns with '—'
|
|
|
- columnNames.forEach(time => {
|
|
|
- rowData[time] = '';
|
|
|
- });
|
|
|
-
|
|
|
- // Split inspectresult and fill the corresponding time columns
|
|
|
- const results = item['inspectresult'].split(',');
|
|
|
- results.forEach(result => {
|
|
|
- if (columnNames.includes(result)) {
|
|
|
- rowData[result] = '√';
|
|
|
- }else{rowData[result] = ''}
|
|
|
- });
|
|
|
-
|
|
|
- // Add the row data to drzcData
|
|
|
- JYData.push(rowData);
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(JYData);
|
|
|
+ JYData.value = []; // 重置 JYData
|
|
|
+
|
|
|
+ const response = await inspectionRecord({
|
|
|
+ machine: JTMC,
|
|
|
+ Gd_gdbh: formData.value.工单编号,
|
|
|
+ team: BZMC.value
|
|
|
+ });
|
|
|
+
|
|
|
+ if (response.code === 0) {
|
|
|
+ // 提取 inspectiontime 作为列名
|
|
|
+ columnNames = response.data.inspectiontime;
|
|
|
+
|
|
|
+ // Populate JYData with row data
|
|
|
+ for (const key in response.data) {
|
|
|
+ if (key !== 'inspectiontime') {
|
|
|
+ const item = response.data[key];
|
|
|
+ const rowData = {
|
|
|
+ '工单编号': item['工单编号'],
|
|
|
+ '印件号': item['印件号'],
|
|
|
+ '工序名称': item['工序名称'],
|
|
|
+ '检验项目': item['检验项目']
|
|
|
+ };
|
|
|
+
|
|
|
+ // Initialize time columns with ''
|
|
|
+ columnNames.forEach(time => {
|
|
|
+ rowData[time] = '';
|
|
|
+ });
|
|
|
+
|
|
|
+ // Split inspectresult and fill the corresponding time columns
|
|
|
+ const results = item['inspectresult'].split(',');
|
|
|
+ results.forEach(result => {
|
|
|
+ if (columnNames.includes(result)) {
|
|
|
+ rowData[result] = '√';
|
|
|
+ } else {
|
|
|
+ rowData[result] = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // Add the row data to JYData
|
|
|
+ JYData.value.push(rowData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(JYData.value);
|
|
|
}
|
|
|
}
|
|
|
//当班产量明细
|