严智鑫
2024-09-14 f74b51190a77c560949abd4628c5f33cd7e734ac
UI-Project/src/views/Marking/marking.vue
@@ -18,12 +18,9 @@
//获取数据
const load = async() => {
  try {
    const response = await request.post('/deviceInteraction/tasking/findCraftTasking',
    const response = await request.post('/deviceInteraction/tasking/findMachineTask',
    {
      "glassId": 0,
      "state": "线上",
      "workState": "工作",
      "currentCraft": "打磨"
      "id": 11
    }); // 替换为你的API端点  
    if (response.code === 200) {
      findCraftTaskingData.value= response.data;
@@ -34,8 +31,18 @@
    // console.error('Error fetching rects :', error);  
  }
}
//修改工作状态 【失败/工作/完成】
//修改工作状态 【失败/正在工作/完工】
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('marking.tips'),
        t('delivery.prompt'),  
@@ -47,10 +54,9 @@
      )
        .then(() => {
          //开始修改
          request.post("/deviceInteraction/tasking/updateCraftTasking",
          request.post(url,
            {
              "glassId": row.glassId,
              "workState": state
              "id": 11
            }).then((res) => { // 替换为你的API端点  
              if (res.code === 200) {
                ElMessage.success(res.message);
@@ -73,7 +79,10 @@
const machineStatus = async(row,state) => {
}
//破损
const damagedTask = async(row) => {
}
//下线(拿走)
const downLine = async(row,state) => {
  ElMessageBox.confirm(
@@ -144,8 +153,9 @@
        <el-table-column prop="workState" label="状态" />
        <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
          <template #default="scope">
            <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '破损')">破损</el-button>
            <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '失败')">重发</el-button>
            <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '完工')">完工</el-button>
            <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '破损')">破损</el-button>
            <el-button size="mini" link type="primary" plain @click="downLine(scope.row, '下线')">下线</el-button>
          </template>
        </el-table-column>