#
1
2025-05-14 7c75c8b98bb06517bacd809e01ad29ab77b2f2dc
src/main/webapp/views/taskWrk/taskWrk.html
@@ -44,6 +44,7 @@
                <el-form-item>
                    <el-button type="primary" @click="getTableData">查询</el-button>
                    <el-button type="primary" @click="resetParam">重置</el-button>
                    <el-button type="primary" @click="addTask">手动添加任务</el-button>
                </el-form-item>
            </el-form>
            <el-table ref="singleTable" :data="tableData" style="width: 100%;">
@@ -113,6 +114,36 @@
        </div>
    </el-dialog>
    <el-dialog :title="addTaskFormTitle" :visible.sync="addTaskFormVisible">
        <el-form :model="addTaskForm">
            <el-form-item label="任务号" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.taskNo" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="任务类型=》1:出库、2:移库、3:入库" :label-width="200">
                <el-input v-model="addTaskForm.ioType" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="优先级" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.taskPriority" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="容器编码" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.barcode" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="起点位置" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.startPoint" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="终点位置" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.targetPoint" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="备注" :label-width="addTaskFormLabelWidth">
                <el-input v-model="addTaskForm.memo" autocomplete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="addTaskFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="addTaskFormConfirm">确 定</el-button>
        </div>
    </el-dialog>
</div>
<script>
    var $layui = layui.config({
@@ -135,9 +166,21 @@
                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"
            },
            taskWrkFormLabelWidth: '80px',
            taskWrkFormTitle: ''
            addTaskFormLabelWidth: '80px',
            taskWrkFormTitle: '',
            addTaskFormTitle: '手动添加任务'
        },
        created() {
            this.init()
@@ -205,6 +248,9 @@
                    wrk_no: null
                }
                this.getTableData()
            },
            addTask() {
                this.addTaskFormVisible = true
            },
            handleCommand(command, row) {
                switch (command) {
@@ -440,6 +486,35 @@
                        }
                    }
                });
            },
            addTaskFormConfirm() {
                //修改指定任务数据
                let that = this
                $.ajax({
                    url: baseUrl + "/taskWrk/addTask/auth",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    data: this.addTaskForm,
                    method: 'POST',
                    success: function (res) {
                        if (res.code == 200) {
                            that.addTaskFormVisible = 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'
                            });
                        }
                    }
                });
            }
        }
    })