|
@@ -10,12 +10,36 @@
|
|
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
|
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
|
|
<style type="text/css">
|
|
|
- .LAY-btns .layui-nav {padding-left:0;padding-right:10px;top:-4px;margin: 0 10px;border: 0;background-color: #009688;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-item{line-height: 30px;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child{top:34px;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-bar{display: none;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child dd.layui-this a{color:#333;background-color:#fff;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child dd.layui-this a:hover {background-color: #f2f2f2;color: #000;}
|
|
|
+ .LAY-btns .layui-nav {
|
|
|
+ padding-left: 0;
|
|
|
+ padding-right: 10px;
|
|
|
+ top: -4px;
|
|
|
+ margin: 0 10px;
|
|
|
+ border: 0;
|
|
|
+ background-color: #009688;
|
|
|
+ }
|
|
|
+
|
|
|
+ .LAY-btns .layui-nav .layui-nav-item {
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .LAY-btns .layui-nav .layui-nav-child {
|
|
|
+ top: 34px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .LAY-btns .layui-nav .layui-nav-bar {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .LAY-btns .layui-nav .layui-nav-child dd.layui-this a {
|
|
|
+ color: #333;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .LAY-btns .layui-nav .layui-nav-child dd.layui-this a:hover {
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -25,7 +49,10 @@
|
|
|
<div class="layui-row">
|
|
|
|
|
|
<div class="LAY-btns" style="margin-bottom: 10px;">
|
|
|
- <button class="layui-btn layui-btn-sm" id="btn_add" data-permission="purchase.add_consumable_godown_entry"><i class="layui-icon layui-icon-add-1"></i>添加</button>
|
|
|
+ <button class="layui-btn layui-btn-sm" id="btn_add"
|
|
|
+ data-permission="purchase.add_consumable_godown_entry"><i
|
|
|
+ class="layui-icon layui-icon-add-1"></i>添加
|
|
|
+ </button>
|
|
|
<button class="layui-nav" data-permission="purchase.export_consumable_godown_entry">
|
|
|
<div class="layui-nav-item">
|
|
|
<a href="javascript:;" style="color:#fff;">导出</a>
|
|
@@ -44,21 +71,32 @@
|
|
|
</dl>
|
|
|
</div>
|
|
|
</button>
|
|
|
- <button class="layui-btn layui-btn-sm" data-permission="purchase.print_consumable_godown_entry" id="btn_print"><i class="layui-icon layui-icon-form"></i>打印</button>
|
|
|
- <button class="layui-btn layui-btn-sm" id="btn_query"><i class="layui-icon layui-icon-search"></i>查询</button>
|
|
|
+ <button class="layui-btn layui-btn-sm" data-permission="purchase.print_consumable_godown_entry"
|
|
|
+ id="btn_print">
|
|
|
+ <i class="layui-icon layui-icon-form"></i>打印
|
|
|
+ </button>
|
|
|
+ <button class="layui-btn layui-btn-sm layui-hide" id="btn_pay"><i
|
|
|
+ class="layui-icon layui-icon-form"></i>付款
|
|
|
+ </button>
|
|
|
+ <button class="layui-btn layui-btn-sm" id="btn_query"><i class="layui-icon layui-icon-search"></i>查询
|
|
|
+ </button>
|
|
|
</div>
|
|
|
<table class="layui-hide" id="datagrid" lay-filter="datagrid-operate"></table>
|
|
|
<script type="text/html" id="datagrid-operate-bar">
|
|
|
<div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
|
|
|
- {{# if(d.status == 0){ }}
|
|
|
- <a class="layui-btn layui-btn-xs" data-permission="purchase.add_consumable_godown_entry" lay-event="edit">修改</a>
|
|
|
- <a class="layui-btn layui-btn-danger layui-btn-xs" data-permission="purchase.delete_consumable_godown_entry" lay-event="del">删除</a>
|
|
|
- <a class="layui-btn layui-btn-xs" data-permission="purchase.check_consumable_godown_entry" lay-event="check">审核</a>
|
|
|
- {{# } }}
|
|
|
- {{# if(d.status == 1){ }}
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="senior_edit" data-permission="purchase.edit_consumable_godown_entry">高级修改</a>
|
|
|
- {{# } }}
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
|
|
|
+ {{# if(d.status == 0){ }}
|
|
|
+ <a class="layui-btn layui-btn-xs" data-permission="purchase.add_consumable_godown_entry"
|
|
|
+ lay-event="edit">修改</a>
|
|
|
+ <a class="layui-btn layui-btn-danger layui-btn-xs"
|
|
|
+ data-permission="purchase.delete_consumable_godown_entry" lay-event="del">删除</a>
|
|
|
+ <a class="layui-btn layui-btn-xs" data-permission="purchase.check_consumable_godown_entry"
|
|
|
+ lay-event="check">审核</a>
|
|
|
+ {{# } }}
|
|
|
+ {{# if(d.status == 1){ }}
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="senior_edit"
|
|
|
+ data-permission="purchase.edit_consumable_godown_entry">高级修改</a>
|
|
|
+ {{# } }}
|
|
|
</div>
|
|
|
</script>
|
|
|
</div>
|
|
@@ -72,13 +110,15 @@
|
|
|
<div class="layui-col-xs12 layui-col-sm12">
|
|
|
<label class="layui-form-label">创建时间:</label>
|
|
|
<div class="layui-input-block">
|
|
|
- <input type="text" class="layui-input" name="create_time" id="create_time" placeholder=" - " autocomplete="off">
|
|
|
+ <input type="text" class="layui-input" name="create_time" id="create_time" placeholder=" - "
|
|
|
+ autocomplete="off">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-col-xs12 layui-col-sm12">
|
|
|
<label class="layui-form-label">审核时间:</label>
|
|
|
<div class="layui-input-block">
|
|
|
- <input type="text" class="layui-input" name="check_time" id="check_time" placeholder=" - " autocomplete="off">
|
|
|
+ <input type="text" class="layui-input" name="check_time" id="check_time" placeholder=" - "
|
|
|
+ autocomplete="off">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-col-xs12 layui-col-sm12">
|
|
@@ -99,7 +139,7 @@
|
|
|
<input type="text" name="supplier_text" class="layui-input" autocomplete="off">
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="layui-col-xs12 layui-col-sm12">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12">
|
|
|
<label class="layui-form-label">创建人:</label>
|
|
|
<div class="layui-input-block">
|
|
|
<input type="text" name="create_user_text" class="layui-input" autocomplete="off">
|
|
@@ -112,7 +152,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="display: none" >
|
|
|
+ <div style="display: none">
|
|
|
<button id="query-submit" lay-submit lay-filter="query-form-element">查询</button>
|
|
|
</div>
|
|
|
</form>
|
|
@@ -135,16 +175,16 @@
|
|
|
, laydate = layui.laydate;
|
|
|
var is_has = utils.isHasPermissions('material.view_consumable_cost');
|
|
|
var cols = [];
|
|
|
- cols.push({type: 'checkbox', width: 50});
|
|
|
+ cols.push({type: 'radio', width: 50});
|
|
|
cols.push({field: 'no', title: '入库单号', width: 140});
|
|
|
cols.push({field: 'supplier_text', title: '供应商', width: 145});
|
|
|
- cols.push({field: 'total_count', align:'right', title: '合计数量', width: 100});
|
|
|
- if (is_has){
|
|
|
- cols.push({field: 'total_amount', align:'right', title: '合计金额', width: 100});
|
|
|
- cols.push({field: 'total_invoice_amount', align:'right', title: '合计发票金额', width: 120});
|
|
|
+ cols.push({field: 'total_count', align: 'right', title: '合计数量', width: 100});
|
|
|
+ if (is_has) {
|
|
|
+ cols.push({field: 'total_amount', align: 'right', title: '合计金额', width: 100});
|
|
|
+ cols.push({field: 'total_invoice_amount', align: 'right', title: '合计发票金额', width: 120});
|
|
|
}
|
|
|
- cols.push({field: 'warehouse_text', align:'right', title: '仓别', width: 100});
|
|
|
- cols.push({field: 'purchase_order_no', align:'right', title: '合同号', width: 150});
|
|
|
+ cols.push({field: 'warehouse_text', align: 'right', title: '仓别', width: 100});
|
|
|
+ cols.push({field: 'purchase_order_no', align: 'right', title: '合同号', width: 150});
|
|
|
cols.push({field: 'create_time', title: '创建时间', width: 150});
|
|
|
cols.push({field: 'create_user_text', title: '创建人', width: 150});
|
|
|
cols.push({field: 'status_text', title: '审核状态', width: 100});
|
|
@@ -159,7 +199,7 @@
|
|
|
, page: true
|
|
|
, height: 'full-104'
|
|
|
, totalRow: true
|
|
|
- ,parseData:function(res) {
|
|
|
+ , parseData: function (res) {
|
|
|
var cols = this.cols[0];
|
|
|
for (var i in cols) {
|
|
|
if (cols[i].field == 'total_count') {
|
|
@@ -170,20 +210,28 @@
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
- "code": res.code, //解析接口状态
|
|
|
- "count": res.count, //解析数据长度
|
|
|
- "data": res.data //解析数据列表
|
|
|
+ "code": res.code, //解析接口状态
|
|
|
+ "count": res.count, //解析数据长度
|
|
|
+ "data": res.data //解析数据列表
|
|
|
};
|
|
|
}
|
|
|
, done: function () {
|
|
|
layui.index.removeNoPermButtons()
|
|
|
}
|
|
|
});
|
|
|
+ layui.admin.req({
|
|
|
+ url: '/config/get_value/?property=godownentry_process'
|
|
|
+ , done: function (res) {
|
|
|
+ if (res.data == '1') {
|
|
|
+ layui.$('#btn_pay').removeClass('layui-hide')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
//监听工具条
|
|
|
table.on('tool(datagrid-operate)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
if (obj.event === 'del') {
|
|
|
- if (data.status === "1"){
|
|
|
+ if (data.status === "1") {
|
|
|
layer.msg('入库单已审核,无法删除!');
|
|
|
return;
|
|
|
}
|
|
@@ -198,7 +246,7 @@
|
|
|
});
|
|
|
} else if (obj.event === 'edit') {
|
|
|
table.editdata = data;
|
|
|
- if (data.status === "1"){
|
|
|
+ if (data.status === "1") {
|
|
|
layer.msg('入库单已审核,无法修改!');
|
|
|
return;
|
|
|
}
|
|
@@ -210,19 +258,19 @@
|
|
|
btn: ['保存', '取消'],
|
|
|
yes: function (index, dom) {
|
|
|
layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('datagrid', {});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
},
|
|
|
btn2: function (index, layero) {
|
|
|
layer.close(index);//关闭当前按钮
|
|
|
},
|
|
|
content: 'consumable_godownentry_edit.html?id=' + data.id
|
|
|
});
|
|
|
- }else if (obj.event === 'senior_edit') {
|
|
|
+ } else if (obj.event === 'senior_edit') {
|
|
|
table.editdata = data;
|
|
|
- if (data.status === "0"){
|
|
|
+ if (data.status === "0") {
|
|
|
layer.msg('入库单未审核,无法高级修改!');
|
|
|
return;
|
|
|
}
|
|
@@ -234,37 +282,37 @@
|
|
|
btn: ['保存', '取消'],
|
|
|
yes: function (index, dom) {
|
|
|
layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('datagrid', {});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
},
|
|
|
btn2: function (index, layero) {
|
|
|
layer.close(index);//关闭当前按钮
|
|
|
},
|
|
|
content: 'consumable_godownentry_senior_edit.html?id=' + data.id
|
|
|
});
|
|
|
- }else if(obj.event === 'check'){
|
|
|
- layer.confirm('确定要审核吗?', function(index){
|
|
|
+ } else if (obj.event === 'check') {
|
|
|
+ layer.confirm('确定要审核吗?', function (index) {
|
|
|
|
|
|
layer.close(index);
|
|
|
layui.admin.req({
|
|
|
- url: '/purchase/godownentry/check/?id='+data.id
|
|
|
- ,done: function(res){
|
|
|
- table.reload('datagrid',{});
|
|
|
+ url: '/purchase/godownentry/check/?id=' + data.id
|
|
|
+ , done: function (res) {
|
|
|
+ table.reload('datagrid', {});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- }else if(obj.event === 'detail'){
|
|
|
- table.editdata = data;
|
|
|
+ } else if (obj.event === 'detail') {
|
|
|
+ table.editdata = data;
|
|
|
layer.open({
|
|
|
- type: 2,
|
|
|
- title: '查看['+ data.no + ']',
|
|
|
- shadeClose: true,
|
|
|
- area: ['70%', '80%'],
|
|
|
- content: 'consumable_godownentry_detail.html?id='+data.id
|
|
|
+ type: 2,
|
|
|
+ title: '查看[' + data.no + ']',
|
|
|
+ shadeClose: true,
|
|
|
+ area: ['70%', '80%'],
|
|
|
+ content: 'consumable_godownentry_detail.html?id=' + data.id
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
laydate.render({
|
|
|
elem: '#create_time'
|
|
@@ -292,7 +340,7 @@
|
|
|
return;
|
|
|
}
|
|
|
layui.admin.req({
|
|
|
- url: '/purchase/godownentry/export_detail/?id='+data.id,
|
|
|
+ url: '/purchase/godownentry/export_detail/?id=' + data.id,
|
|
|
data: _params,
|
|
|
done: function (res) {
|
|
|
layui.view.download(res.data.filename);
|
|
@@ -318,6 +366,34 @@
|
|
|
content: 'consumable_godownentry_edit.html'
|
|
|
});
|
|
|
});
|
|
|
+ $('#btn_pay').on('click', function () {
|
|
|
+ var data = utils.getSelectedRow('datagrid');
|
|
|
+ if (data == false) {
|
|
|
+ layer.msg('请选择一条数据!', {icon: 5});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (data.status != '1') {
|
|
|
+ layer.msg('请先审核入库单,在付款!', {icon: 5});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: '入库付款',
|
|
|
+ area: ['40%', '60%'],
|
|
|
+ btn: ['保存', '取消'],
|
|
|
+ yes: function (index, dom) {
|
|
|
+ layui.onSubmitChild = function (data) {
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('datagrid', {});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
+ },
|
|
|
+ btn2: function (index, layero) {
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ content: 'material_pay.html?id=' + data.id
|
|
|
+ });
|
|
|
+ });
|
|
|
$('#btn_query').on('click', function () {
|
|
|
layer.open({
|
|
|
type: 1,
|
|
@@ -336,7 +412,7 @@
|
|
|
_params = data.field;
|
|
|
table.reload('datagrid', {
|
|
|
where: data.field,
|
|
|
- page:{curr:1}
|
|
|
+ page: {curr: 1}
|
|
|
});
|
|
|
layer.closeAll();
|
|
|
return false
|
|
@@ -354,8 +430,8 @@
|
|
|
area: ['90%', '90%'],
|
|
|
btn: ['打印', '取消'],
|
|
|
yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function(data){
|
|
|
- layer.close(index);
|
|
|
+ layui.onSubmitChild = function (data) {
|
|
|
+ layer.close(index);
|
|
|
};
|
|
|
layui.submitChild();
|
|
|
},
|
|
@@ -393,4 +469,4 @@
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|