$(function () {
    $("#purchaseWayMethodTow").combobox({
        url: g.ctx + 'pc/sys/dict/getDicByType?type=purchase_way',
        method: 'GET',
        valueField: 'code',
        textField: 'codeWithDesc',
        prompt: '--- 请选择 ---',
        editable: false,
        panelHeight: 'auto'
    });
});

/**
 * 设置采购路径
 * @param call
 */
function savePurchaseWayMethod(call) {
    var purchaseWay = $('#purchaseWayMethodTow').combobox('getValue');
    console.log("传值" + "："+ids)
    if ( purchaseWay === null || purchaseWay === undefined || purchaseWay === '' || purchaseWay === '0'){
        layer.msg('请选择采购路径');
        return ;
    }
    let loadIndex = layer.load(2);
    $.ajax({
        url: g.ctx + 'pc/inquiry/purchase/apply/bill/detail/rest/updateDetailWayMethod',
        type: "POST",
        data: {
            ids: ids,
            purchaseWay: purchaseWay
        },
        success: function (data) {
            layer.close(loadIndex);
            call();
        },
        error: function (data) {
            layer.close(loadIndex);
            topWin.layer.alert(data.responseJSON.message, {icon: 2});
        }
    });

}

/**
 * 关闭弹框
 */
function closeLayer() {
    parent.layer.closeAll();
}
