提交 56e2dbef 编写于 作者: Skyeye云's avatar Skyeye云

表格插件修改

上级 f96d9846
......@@ -50,16 +50,16 @@ layui.config({
id: "productList",
cols: [
{id: 'materialId', title: '商品(型号)', formType: 'chooseInput', width: '150', iconClassName: 'chooseProductBtn', verify: 'required'},
{id: 'unitId', title: '单位', formType: 'select', width: '50', verify: 'required', layFilter: 'selectUnitProperty', saveKey: 'mUnitId'},
{id: 'mUnitId', title: '单位', formType: 'select', width: '50', verify: 'required', layFilter: 'selectUnitProperty'},
{id: 'currentTock', title: '库存', formType: 'detail', width: '80'},
{id: 'rkNum', title: '数量', formType: 'input', width: '80', className: 'change-input rkNum', verify: 'required|number', value: '1', saveKey: 'rkNum'},
{id: 'unitPrice', title: '单价', formType: 'input', width: '80', className: 'change-input unitPrice', verify: 'required|money', saveKey: 'unitPrice'},
{id: 'rkNum', title: '数量', formType: 'input', width: '80', className: 'change-input rkNum', verify: 'required|number', value: '1'},
{id: 'unitPrice', title: '单价', formType: 'input', width: '80', className: 'change-input unitPrice', verify: 'required|money'},
{id: 'amountOfMoney', title: '金额', formType: 'input', width: '80', className: 'change-input amountOfMoney', verify: 'required|money'},
{id: 'taxRate', title: '税率(%)', formType: 'input', width: '80', className: 'change-input taxRate', verify: 'required|double', value: '0.00', saveKey: 'taxRate'},
{id: 'taxMoney', title: '税额', formType: 'input', width: '80', className: 'change-input taxMoney', verify: 'required|money', saveKey: 'taxMoney'},
{id: 'taxUnitPrice', title: '含税单价', formType: 'input', width: '80', className: 'change-input taxUnitPrice', verify: 'required|money', saveKey: 'taxUnitPrice'},
{id: 'taxLastMoney', title: '合计价税', formType: 'input', width: '80', className: 'change-input taxLastMoney', verify: 'required|money', saveKey: 'taxLastMoney'},
{id: 'remark', title: '备注', formType: 'input', width: '100', saveKey: 'remark'}
{id: 'taxRate', title: '税率(%)', formType: 'input', width: '80', className: 'change-input taxRate', verify: 'required|double', value: '0.00'},
{id: 'taxMoney', title: '税额', formType: 'input', width: '80', className: 'change-input taxMoney', verify: 'required|money'},
{id: 'taxUnitPrice', title: '含税单价', formType: 'input', width: '80', className: 'change-input taxUnitPrice', verify: 'required|money'},
{id: 'taxLastMoney', title: '合计价税', formType: 'input', width: '80', className: 'change-input taxLastMoney', verify: 'required|money'},
{id: 'remark', title: '备注', formType: 'input', width: '100'}
],
deleteRowCallback: function (trId) {
allChooseProduct[trId] = undefined;
......
......@@ -16,8 +16,7 @@ var initTableChooseUtil = {
// verify: 'required|number',
// value: '默认值',
// valueKey: '回显时要展示数据里面的那个key',
// layFilter: '可以方便指定监听事件',
// saveKey: '保存数据时指定的那个key'}
// layFilter: '可以方便指定监听事件'}
deleteRowCallback: function () {trId}, // 删除行之后的回调函数
addRowCallback: function (rowIndexStr) {}, // 新增行之后的回调函数
form: null, // form表单对象
......@@ -156,19 +155,16 @@ var initTableChooseUtil = {
var rowIndexStr = trId.replace("tr", "");
var row = {};
$.each(options.cols, function (j, bean) {
if (!isNull(bean.saveKey)) {
// saveKey不为空时,指定key-value
var tdId = bean.id + rowIndexStr;
var value = "";
if (bean.formType == 'input') {
value = $("#" + tdId).val();
} else if (bean.formType == 'select') {
value = $("#" + tdId).val();
} else if (bean.formType == 'detail') {
value = $("#" + tdId).html();
}
row[bean.saveKey] = value;
var tdId = bean.id + rowIndexStr;
var value = "";
if (bean.formType == 'input') {
value = $("#" + tdId).val();
} else if (bean.formType == 'select') {
value = $("#" + tdId).val();
} else if (bean.formType == 'detail') {
value = $("#" + tdId).html();
}
row[bean.id] = value;
});
result.push(row);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册