| | |
| | | title: (mData ? '修改' : '添加') + '甲方单位', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | let loadNameXml = loadNameXmlSel() |
| | | if (mData) { |
| | | $('#cascaderVal').val(mData.pcd); |
| | | if (mData.name) { loadNameXml.setValue([{name: mData.name, value: mData.name}]); } |
| | | } |
| | | form.verify({ |
| | | name: function(value, item){ |
| | | var min = item.getAttribute('lay-min'); |
| | |
| | | cascaderRender(); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | data.field.name = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].name : null; |
| | | if (!data.field.name) { |
| | | layer.msg("客户名称不能为空", {icon: 2}); |
| | | return false; |
| | | } |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/cstmr/"+(mData?'update':'add')+"/auth", |
| | |
| | | }); |
| | | } |
| | | |
| | | window.loadNameXmlSel = function () { |
| | | return xmSelect.render({ |
| | | el: '#nameXmlSel', |
| | | autoRow: true, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | radio: true, |
| | | remoteMethod: function (val, cb, show) { |
| | | $.ajax({ |
| | | url: baseUrl + "/cstmrSearch/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | condition: val |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |