*
lsh
2025-11-18 1351034482501073f628b87cdb6c4722a01283ba
src/main/webapp/views/taskWrkLog/taskWrkLog.html
@@ -53,16 +53,17 @@
            </el-form-item>
         </el-form>
         <el-table ref="singleTable" :data="tableData" style="width: 100%;">
<!--            <el-table-column label="操作" width="100">-->
<!--               <template slot-scope="scope">-->
<!--                  <el-dropdown @command="(command)=>{handleCommand(command, scope.row)}">-->
<!--                     <el-button icon="el-icon-more" size="mini" type="primary"></el-button>-->
<!--                     <el-dropdown-menu slot="dropdown">-->
            <el-table-column label="操作" width="100">
               <template slot-scope="scope">
                  <el-dropdown @command="(command)=>{handleCommand(command, scope.row)}">
                     <el-button icon="el-icon-more" size="mini" type="primary"></el-button>
                     <el-dropdown-menu slot="dropdown">
<!--                        <el-dropdown-item command="showCommand">查看指令</el-dropdown-item>-->
<!--                     </el-dropdown-menu>-->
<!--                  </el-dropdown>-->
<!--               </template>-->
<!--            </el-table-column>-->
                        <el-dropdown-item command="changeCommand">修改</el-dropdown-item>
                     </el-dropdown-menu>
                  </el-dropdown>
               </template>
            </el-table-column>
            <el-table-column property="taskNo" label="任务号">
            </el-table-column>
            <el-table-column property="status$" label="任务状态">
@@ -107,6 +108,22 @@
         </div>
      </el-card>
   </div>
   <el-dialog :title="taskWrkFormTitle" :visible.sync="taskWrkFormVisible">
      <el-form :model="taskWrkForm">
         <el-form-item label="起点位置" :label-width="taskWrkFormLabelWidth">
            <el-input v-model="taskWrkForm.startPoint" autocomplete="off"></el-input>
         </el-form-item>
         <el-form-item label="终点位置" :label-width="taskWrkFormLabelWidth">
            <el-input v-model="taskWrkForm.targetPoint" autocomplete="off"></el-input>
         </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
         <el-button @click="taskWrkFormVisible = false">取 消</el-button>
         <el-button type="primary" @click="taskWrkFormConfirm">确 定</el-button>
      </div>
   </el-dialog>
</div>
<script>
   var $layui = layui.config({
@@ -127,7 +144,22 @@
            status: null,
            wrk_no: null,
            datetime: null
         }
         },
         taskWrkFormVisible: false,
         addTaskFormVisible: false,
         taskWrkForm: {},
         addTaskForm: {
            taskNo:"9001",
            ioType:"0",
            taskPriority:1,
            barcode:"10000001",
            startPoint:"1000",
            targetPoint:"F-F01-01-01-01",
            memo:"cs"
         },
         taskWrkFormTitle: '',
         taskWrkFormLabelWidth: '80px',
         addTaskFormLabelWidth: '80px',
      },
      created() {
         this.init()
@@ -360,6 +392,10 @@
                  //查看指令
                  this.showCommand(row)
                  break;
               case "changeCommand":
                  //修改指令
                  this.changeCommand(row);
                  break
            }
         },
         showCommand(row) {
@@ -375,6 +411,46 @@
               success: function(layero, index) {}
            });
         },
         changeCommand(row) {
            //修改指令
            this.taskWrkFormVisible = true
            this.taskWrkFormTitle = "任务:" + row.taskNo
            this.taskWrkForm = row
         },
         taskWrkFormConfirm() {
            //修改指定任务数据
            let that = this
            $.ajax({
               url: baseUrl + "/taskWrkLog/updatePoint/auth",
               headers: {
                  'token': localStorage.getItem('token')
               },
               data: {
                  taskNo: this.taskWrkForm.taskNo,
                  wrkNo: this.taskWrkForm.wrkNo,
                  startPoint: this.taskWrkForm.startPoint,
                  targetPoint: this.taskWrkForm.targetPoint,
               },
               method: 'POST',
               success: function (res) {
                  if (res.code == 200) {
                     that.taskWrkFormVisible = false
                     that.$message({
                        message: "更新成功",
                        type: 'success'
                     });
                     that.getTableData()
                  } else if (res.code === 403) {
                     top.location.href = baseUrl + "/";
                  } else {
                     that.$message({
                        message: res.msg,
                        type: 'error'
                     });
                  }
               }
            });
         },
      }
   })
</script>