提交 96b21945 编写于 作者: doc_wei's avatar doc_wei

会计科目新增余额方向属性

上级 ba0ad7ab
......@@ -10,9 +10,13 @@ layui.config({
var $ = layui.$,
textool = layui.textool;
var selTemplate = getFileContent('tpl/template/select-option.tpl');
var radioTemplate = getFileContent('tpl/template/radio-property.tpl');
$("#type").html(getDataUseHandlebars(selTemplate, {rows: accountSubjectUtil.accountSubjectType}));
// 余额方向
$("#amountDirectionBox").html(getDataUseHandlebars(radioTemplate, {rows: sysIfsUtil.amountDirection}));
textool.init({
eleId: 'remark',
maxlength: 200,
......@@ -26,6 +30,7 @@ layui.config({
var params = {
name: $("#name").val(),
state: $("input[name='state']:checked").val(),
amountDirection: $("input[name='radioProperty']:checked").val(),
num: $("#num").val(),
type: $("#type").val(),
remark: $("#remark").val()
......
......@@ -18,6 +18,7 @@ layui.config({
template: $("#simpleTemplate").html(),
ajaxSendAfter:function(json){
$("#state").html(json.bean.state == "1" ? "<span class='state-up'>启用</span>" : "<span class='state-down'>停用</span>");
$("#amountDirectionBox").html(sysIfsUtil.getAmountDirectionById(json.bean.amountDirection));
$("#type").html(getInPoingArr(accountSubjectUtil.accountSubjectType, "id", json.bean.type, "name"));
matchingLanguage();
form.render();
......
......@@ -9,6 +9,8 @@ layui.config({
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
var selTemplate = getFileContent('tpl/template/select-option.tpl');
var radioTemplate = getFileContent('tpl/template/radio-property.tpl');
showGrid({
id: "showForm",
......@@ -27,10 +29,13 @@ layui.config({
tools: ['count', 'copy', 'reset', 'clear']
});
var selTemplate = getFileContent('tpl/template/select-option.tpl');
$("#type").html(getDataUseHandlebars(selTemplate, {rows: accountSubjectUtil.accountSubjectType}));
$("#type").val(json.bean.type);
// 余额方向
$("#amountDirectionBox").html(getDataUseHandlebars(radioTemplate, {rows: sysIfsUtil.amountDirection}));
$("input:radio[name=radioProperty][value=" + json.bean.amountDirection + "]").attr("checked", true);
$("input:radio[name=state][value=" + json.bean.state + "]").attr("checked", true);
matchingLanguage();
......@@ -41,6 +46,7 @@ layui.config({
rowId: parent.rowId,
name: $("#name").val(),
state: $("input[name='state']:checked").val(),
amountDirection: $("input[name='radioProperty']:checked").val(),
num: $("#num").val(),
type: $("#type").val(),
remark: $("#remark").val()
......
......@@ -36,7 +36,16 @@ layui.config({
{ field: 'type', title: '类型', align: 'center', width: 120, templet: function(d){
return getInPoingArr(accountSubjectUtil.accountSubjectType, "id", d.type, "name");
}},
{ field: 'state', title: '状态', align: 'center', width: 80},
{ field: 'amountDirection', title: '余额方向', align: 'center', width: 80, templet: function(d){
return sysIfsUtil.getAmountDirectionById(d.amountDirection);
}},
{ field: 'state', title: '状态', align: 'center', width: 80, templet: function(d){
if(d.state == 1){
return "<span class='state-up'>启用</span>";
}else {
return "<span class='state-down'>停用</span>";
}
}},
{ field: 'remark', title: '备注', align: 'left', width: 200},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 100 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
......
......@@ -37,6 +37,9 @@ layui.config({
{ field: 'type', title: '类型', align: 'center', width: 120, templet: function(d){
return getInPoingArr(accountSubjectUtil.accountSubjectType, "id", d.type, "name");
}},
{ field: 'amountDirection', title: '余额方向', align: 'center', width: 80, templet: function(d){
return sysIfsUtil.getAmountDirectionById(d.amountDirection);
}},
{ field: 'remark', title: '备注', align: 'left', width: 200}
]],
done: function(res, curr, count){
......@@ -89,7 +92,7 @@ layui.config({
function getTableParams(){
return {
name: $("#name").val(),
state: 1,
state: 1, // 已启用
type: $("#type").val()
};
}
......
......@@ -36,6 +36,12 @@
<input type="radio" name="state" value="2" title="禁用" />
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">余额方向<i class="red">*</i></label>
<div class="layui-input-block winui-radio" win-verify="required" id="amountDirectionBox">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
......
......@@ -39,6 +39,12 @@
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">余额方向<i class="red">*</i></label>
<div class="layui-input-block ver-center" id="amountDirectionBox">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block ver-center">
......
......@@ -42,6 +42,12 @@
<input type="radio" name="state" value="2" title="禁用" />
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">余额方向<i class="red">*</i></label>
<div class="layui-input-block winui-radio" win-verify="required" id="amountDirectionBox">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
......
......@@ -3,11 +3,13 @@ var accountSubjectUtil = {
// 会计科目所属类型JSON串
accountSubjectType: [
{"id": "1", "name": "资产类"},
{"id": "2", "name": "负债类"},
{"id": "3", "name": "权益类"},
{"id": "4", "name": "成本类"},
{"id": "5", "name": "损益类"}
{"id": "1", "name": "资产"},
{"id": "2", "name": "负债"},
{"id": "3", "name": "权益"},
{"id": "4", "name": "成本"},
{"id": "5", "name": "损益"},
{"id": "6", "name": "共同"},
{"id": "7", "name": "其他"}
]
}
\ No newline at end of file
......@@ -71,4 +71,13 @@ var sysIfsUtil = {
}});
},
// 余额方向
amountDirection: [
{"id": "1", "name": ""},
{"id": "2", "name": ""}
],
getAmountDirectionById: function (id){
return getInPoingArr(sysIfsUtil.amountDirection, "id", id, "name");
}
}
\ No newline at end of file
......@@ -443,11 +443,20 @@
$("body").append(maskReqStr);
layui.each(verifyElem, function (index, item) {
var othis = $(this), ver = othis.attr('win-verify').split('|');
var tips = '', value = othis.val();
var tips = '';
var value = othis.val();
// 如果是单选,则获取单选的值
if(othis.hasClass("winui-radio")){
value = othis.find("input:checked").val();
if(value === undefined){
value = "";
}
}
othis.removeClass(DANGER);
layui.each(ver, function (_, thisVer) {
var isFn = typeof that.verify[thisVer] === 'function';
if (that.verify[thisVer] && (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) {
if (that.verify[thisVer]
&& (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) {
layer.msg(tips || that.verify[thisVer][1], {
icon: 5,
shift: 6
......
{{#each rows}}
<input type="radio" name="radioProperty" value="{{id}}" title="{{name}}" />
{{/each}}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册