<!DOCTYPE html>
|
<html lang="zh">
|
<head>
|
<meta charset="UTF-8">
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
|
<title>已分配设备列表</title>
|
<link rel="stylesheet" type="text/css" href="/admin/layui/css/layui.css"/>
|
<link rel="stylesheet" type="text/css" href="/admin/css/admin.css"/>
|
<script src="js/http_api.js"></script>
|
<style>
|
.layui-table-cell {
|
height: 50px;
|
white-space: normal;
|
max-height: 50px;
|
}
|
|
/* 添加横向滚动样式 */
|
.scroll-x {
|
overflow: hidden !important;
|
overflow-x: auto !important;
|
white-space: nowrap;
|
outline: none;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="page-content-wrap">
|
|
<div class="scroll-x">
|
<table class="layui-table" lay-even lay-skin="nob" id="clientsTable" style="height: 100%"></table>
|
</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', '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');
|
|
// 渲染表格
|
var tableIns = table.render({
|
elem: '#clientsTable',
|
url: '/admin/api/ordertask/js2/assignedClients',
|
where: {
|
taskId: taskId
|
},
|
parseData: function(res) {
|
return {
|
"code": res.code,
|
"msg": res.msg,
|
"count": res.data.count,
|
"data": res.data.list
|
}
|
},
|
page: true,
|
cols: [[
|
{field: 'clientId', title: '客户端ID', width: 100},
|
{field: 'orderNo', title: '订单号', width: 150},
|
{field: 'productName', title: '商品名称', width: 150},
|
{field: 'shopName', title: '店铺名称', width: 120},
|
{field: 'couponCode', title: '券码', width: 120},
|
{
|
field: 'executionStatus', title: '执行状态', width: 120, templet: function (d) {
|
switch (d.executionStatus) {
|
case 0: return '<span style="color: #999">未下单</span>';
|
case 1: return '<span style="color: #009900">已下单</span>';
|
case -1: return '<span style="color: #ff0000">下单失败</span>';
|
case 2: return '<span style="color: #009900">确认收货成功</span>';
|
case -2: return '<span style="color: #ff0000">确认收货失败</span>';
|
case 3: return '<span style="color: #009900">评价成功</span>';
|
case -3: return '<span style="color: #ff0000">评价失败</span>';
|
default: return '未知状态';
|
}
|
}
|
},
|
{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},
|
{
|
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>
|
</html>
|