admin
10 天以前 f318c9c7c127b00f353bf45f273096d1dc4b424f
src/main/resources/static/admin/order-task-assigned-clients.html
@@ -33,12 +33,32 @@
    </div>
</div>
<!-- 修改预计评价时间弹窗 -->
<div id="updateExpectedReviewTime" style="display: none; padding: 20px;">
    <form class="layui-form" action="">
        <input type="hidden" name="id" id="detailId">
        <div class="layui-form-item">
            <label class="layui-form-label">预计评价时间</label>
            <div class="layui-input-block">
                <input type="text" name="expectedReviewTime" id="expectedReviewTime" placeholder="请选择预计评价时间" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="updateExpectedReviewTime">确定</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script src="/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="/admin/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['table', 'layer'], function () {
    layui.use(['table', 'layer', 'laydate'], function () {
        var table = layui.table;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var urlParams = new URLSearchParams(window.location.search);
        var taskId = urlParams.get('taskId');
        
@@ -81,11 +101,62 @@
                {field: 'statusDescription', title: '状态说明', width: 150},
                {field: 'orderTime', title: '下单时间', width: 160},
                {field: 'receiveTime', title: '收货时间', width: 160},
                {field: 'expectedReviewTime', title: '预估评价时间', width: 160},
                {field: 'reviewTime', title: '评价时间', width: 160},
                {field: 'createTime', title: '创建时间', width: 160},
                {field: 'updateTime', title: '更新时间', width: 160}
                {field: 'updateTime', title: '更新时间', width: 160},
                {
                    title: '操作', width: 120, align: 'center', fixed: "right", templet: function (d) {
                        return "<a href='javascript:void(0)' class='layui-table-link' onclick=\"updateExpectedReviewTime('" + d.id + "')\">设置预估时间</a>";
                    }
                },
            ]]
        });
        // 修改预计评价时间
        window.updateExpectedReviewTime = function(id, expectedReviewTime) {
            // 设置表单值
            $("#detailId").val(id);
            $("#expectedReviewTime").val(expectedReviewTime);
            // 弹出修改窗口
            layer.open({
                type: 1,
                title: "修改预计评价时间",
                content: $("#updateExpectedReviewTime"),
                area: ['500px', '300px'],
                end: function() {
                    $("#updateExpectedReviewTime").css("display", "none");
                }
            });
            // 初始化日期控件
            laydate.render({
                elem: '#expectedReviewTime',
                type: 'datetime',
                theme: '#448aff',
                value: expectedReviewTime
            });
        };
        // 监听表单提交
        layui.form.on('submit(updateExpectedReviewTime)', function(data) {
            $.post("/admin/api/ordertask/js2/updateExpectedReviewTime", data.field, function(response) {
                if (response.code == 0) {
                    layer.msg("修改成功");
                    layer.closeAll('page');
                    // 重新加载表格
                    tableIns.reload();
                } else {
                    layer.msg(response.msg);
                }
            }, 'json').fail(function(jqXHR, textStatus, errorThrown) {
                layer.msg("网络请求失败");
            });
            return false;
        });
    });
</script>
</body>