huang
2025-05-20 e5b578d2c586ca9f664e31d3759952752255fdd3
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
//报警提示
const errorInfoFuntion = async (info) => {
    let infoScancode=info;
    ElMessageBox.confirm(
      infoScancode,
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sureStart'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  
  //修改工作状态 【失败/正在工作/完工】
  const workStatus = async (row, state) => {
    let url;
    if (state == "重发") {
      url = "/deviceInteraction/tasking/loseMachineTask";
    } else if (state == "正在工作") {
      url = "/deviceInteraction/tasking/startMachineTask";
    } else if (state == "完工") {
      url = "/deviceInteraction/tasking/finishMachineTask";
    } else {
      return;
    }
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //开始修改
        request.post(url,
          {
            "id": machineId
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  
  }
  
  //开工/暂停
  const machineStatus = async (state) => {
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //下线接口
        request.post("/deviceInteraction/machine/updateMachineState",
          {
            "id": machineId,
            "state": state
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  //定制/标准
  const machineMode = async (mode) => {
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //下线接口
        request.post("/deviceInteraction/machine/toggleModeMachine",
          {
            "id": machineId,
            "mode": mode
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  //破损
  const damagedTask = async (row) => {
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //下线接口
        request.post("/deviceInteraction/tasking/damagedTask",
          {
            "glassId": row.glassId
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  //下线(拿走)
  const glassDownLine = async (row) => {
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //下线接口
        request.post("/deviceInteraction/tasking/glassDownLine",
          {
            "glassId": row.glassId,
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  const topLineShow = async () => {
    blind.value = true; 
  }
  //上线
  const topLine = async (row) => {
    ElMessageBox.confirm(
      t('functionState.tips'),
      t('delivery.prompt'),
      {
        confirmButtonText: t('functionState.sure'),
        cancelButtonText: t('functionState.cancel'),
        type: 'warning',
      }
    )
      .then(() => {
        //上线接口
        request.post("/deviceInteraction/tasking/glassTopLine",
          {
            "glassId": row.glassId,
            "lineConfigurationId": machineId
          }).then((res) => { // 替换为你的API端点  
            if (res.code === 200) {
              ElMessage.success(res.message);
            } else {n
              ElMessage.warning(res.message)
            }
          })
      })
      .catch(() => {
        ElMessage({
          type: 'info',
          message: t('functionState.cancel'),
        })
      })
  }
  const handleDialogClose = () => {  
      
  }