294 行
14 KiB
HTML
可执行文件
294 行
14 KiB
HTML
可执行文件
<!DOCTYPE html>
|
|
<html>
|
|
<!--[1.3.63]-->
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui-v2.4.3/layui/css/layui.css"/>
|
|
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/layui-v2.4.3/layui/layui.js"></script>
|
|
<link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.css">
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/goodsList.css"/>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
|
<style>
|
|
.mybtn {
|
|
margin: 10px 30px;
|
|
}
|
|
|
|
.mybtn:hover {
|
|
color: white;
|
|
background-color: #3f4c73;
|
|
}
|
|
|
|
.hide {
|
|
display: none;
|
|
}
|
|
|
|
.supplier {
|
|
height: 38px;
|
|
min-width: 100px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<div class="goodsBox">
|
|
<div class="goods_title">
|
|
<div class="goods_title_inner">
|
|
调拨单管理 <span style="color:#009688">(调出单是将商品调给其他兄弟门店,调入单是其他兄弟门店将商品调给本店)</span>
|
|
</div>
|
|
</div>
|
|
<div class="goods_edit">
|
|
<form class="layui-form" id="select_serach">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" placeholder="单据号" id="ordernum">
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<select name="type" id="ordertype" lay-filter="ordertype">
|
|
<option value="1">调出单据</option>
|
|
<option value="2">调入单据</option>
|
|
</select>
|
|
</div>
|
|
<div class="layui-input-inline" style="width: 437px;">
|
|
<input type="text" name="date" id="date" lay-verify="date" placeholder="点击查询指定时间段"
|
|
autocomplete="off"
|
|
class="layui-input">
|
|
<i style="font-size: 28px;color: #009688;" class="layui-icon iconBox"></i>
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<div class="goods_edit_add" id="serach_icon">搜索</div>
|
|
<if condition="$global_store_jurisdiction && ($global_store_jurisdiction['data_export'] eq '2')">
|
|
<else/>
|
|
<if condition="$authArr['flow_allocating_export']">
|
|
<div class="goods_edit_add" id="export">导出</div>
|
|
</if>
|
|
</if>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="goods_table">
|
|
<table class="layui-hide" id="test" lay-filter="demo"></table>
|
|
<script type="text/html" id="barDemo">
|
|
<if condition="$authArr['showallocating']">
|
|
<a class="layui-btn layui-btn-xs" lay-event="showfloworder">查看</a>
|
|
</if>
|
|
<!-- <if condition="$authArr['doauditallocatingout']">
|
|
<a class="layui-btn layui-btn-xs{{d.ordertype == '2'? 'hide':''}} {{d.audit == '3'? 'hide':''}}"
|
|
lay-event="audit">审核</a>
|
|
</if>
|
|
<if condition="$authArr['cancelfloworder']">
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs {{d.ordertype == '2'? 'hide':''}} {{d.audit == '3'? 'hide':''}}"
|
|
lay-event="cancelfloworder">作废</a>
|
|
</if>
|
|
<a class="layui-btn layui-btn-xs {{d.ordertype == '1'? 'hide':''}} {{(d.toaudit == '3' || d.toaudit == '2' || d.toaudit == '4')? 'hide':''}}"
|
|
lay-event="toaudit">确认</a>
|
|
<a class="layui-btn layui-btn-xs {{d.ordertype == '1'? 'hide':''}} {{d.toaudit == '2'? '':'hide'}}"
|
|
lay-event="todoaudit">审核</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs {{d.ordertype == '1'? 'hide':''}} {{d.toaudit != '1'? 'hide':''}}"
|
|
lay-event="canceltoaudit">拒绝</a>-->
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
layui.use(['table', 'layer', 'laydate', 'form',], function () {
|
|
var table = layui.table;
|
|
var laydate = layui.laydate;
|
|
var form = layui.form;
|
|
form.render();
|
|
//日期
|
|
laydate.render({
|
|
elem: '#date',
|
|
range: '至',
|
|
value: $('#date01').val()
|
|
});
|
|
//展示已知数据
|
|
table.render({
|
|
elem: '#test',
|
|
url: "{:U('Retail/Flow/allocatingorderlist')}",
|
|
cols: [
|
|
[{
|
|
field: 'index',
|
|
title: '序号',
|
|
width: 60
|
|
}, {
|
|
field: 'ctime',
|
|
title: '制单时间',
|
|
}, {
|
|
field: 'tostoreid',
|
|
title: '调拨门店',
|
|
}, {
|
|
field: 'ordernum',
|
|
title: '单据号',
|
|
}, {
|
|
field: 'adminname',
|
|
title: '制单人',
|
|
}, {
|
|
field: 'allnum',
|
|
title: '调拨量',
|
|
}, {
|
|
field: 'allmoney',
|
|
title: '调拨总金额',
|
|
}, {
|
|
field: 'auditname',
|
|
title: '单据状态', width: 200,
|
|
fixed: 'right', align: 'center'
|
|
}, {fixed: 'right', title: '操作', align: 'center', toolbar: '#barDemo', width: 180}
|
|
]
|
|
],
|
|
page: {
|
|
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
|
}, //是否开启分页
|
|
id: 'idTest'
|
|
});
|
|
//监听工具条
|
|
table.on('tool(demo)', function (obj) {
|
|
var data = obj.data;
|
|
var mydata = data;
|
|
if (obj.event === 'showfloworder') {
|
|
layer.open({
|
|
type: 2,
|
|
content: "{:U('showallocating')}?id=" + data.id + "&type=" + data.ordertype,
|
|
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
|
offset: 'rb',
|
|
shade: 0,
|
|
end: function () {
|
|
MenuApp.refreshWindow();
|
|
//window.location.reload();
|
|
}
|
|
})
|
|
//window.location.href = "{:U('showallocating')}?id=" + data.id + "&type=" + data.ordertype;
|
|
} else if (obj.event === 'audit') {
|
|
layer.confirm('确定审核该单据吗?<br>审核后单据将提交给目标门店处理,<br>目标门店确认后才减少本店商品库存。', function () {
|
|
$.ajax({
|
|
url: "{:U('doauditallocatingout')}",//doauditallocatingout
|
|
data: {id: data.id},
|
|
type: 'post',
|
|
success: function (res) {
|
|
//console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (obj.event === 'cancelfloworder') {
|
|
layer.confirm('确定作废该单据吗?,作废后该单据将不再展示', function () {
|
|
$.ajax({
|
|
url: "{:U('cancelfloworder')}",
|
|
data: {id: data.id},
|
|
type: 'post',
|
|
success: function (res) {
|
|
// console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (obj.event === 'toaudit') {
|
|
layer.confirm('确定要确认该单据吗?<br>确认后该单据将无法拒绝,<br>发货门店将减少库存。', function () {
|
|
$.ajax({
|
|
url: "{:U('toauditallocating')}",
|
|
data: {id: data.id},
|
|
type: 'post',
|
|
success: function (res) {
|
|
// console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (obj.event === 'todoaudit') {
|
|
layer.confirm('确定要审核该单据吗?<br>请确认调入商品已入库。', function () {
|
|
$.ajax({
|
|
url: "{:U('toauditallocatingin')}",//canceltoauditallocating
|
|
data: {id: data.id},
|
|
type: 'post',
|
|
success: function (res) {
|
|
// console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (obj.event === 'canceltoaudit') {
|
|
layer.confirm('确定要拒绝该单据吗?', function () {
|
|
$.ajax({
|
|
url: "{:U('canceltoauditallocating')}",//canceltoauditallocating
|
|
data: {id: data.id},
|
|
type: 'post',
|
|
success: function (res) {
|
|
// console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 2000}, function () {
|
|
table.reload('idTest');
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
})
|
|
|
|
$("#serach_icon").click(function () {
|
|
var date = $('#date').val();
|
|
var ordernum = $('#ordernum').val();
|
|
var ordertype = $('#ordertype option:selected').val();
|
|
table.reload('idTest', {
|
|
where: { //设定异步数据接口的额外参数,任意设
|
|
ordernum: ordernum,
|
|
ordertype: ordertype,
|
|
date: date
|
|
}
|
|
, page: {
|
|
curr: 1 //重新从第 1 页开始
|
|
}
|
|
});
|
|
});
|
|
// $('#ordertype').on('change',function () {
|
|
// console.log('aaaaa');return;
|
|
// $("#serach_icon").click();
|
|
// })
|
|
// 监听select值选中事件
|
|
form.on('select(ordertype)', function (data) {
|
|
$("#serach_icon").click();
|
|
});
|
|
// 导出
|
|
$('#export').click(function () {
|
|
var date = $('#date').val();
|
|
var ordernum = $('#ordernum').val();
|
|
var ordertype = $('#ordertype option:selected').val();
|
|
layer.confirm("默认导出当日进货明细", function () {
|
|
window.location.href = "{:U('flow_allocating_export')}?date=" + date + "&ordernum=" + ordernum + "&ordertype=" + ordertype;
|
|
layer.closeAll();
|
|
})
|
|
});
|
|
});
|
|
</script> |