ken_nogi/Pleasanter/営業積算システム/docs/新・営業積算システム仕様書_分割/052_新・営業積算システム仕様書_別記資料スクリプト(22/28).md
Kenichiro NOGI ce58cb4be4 初回コミット: dev配下(NodeSrv/Pleasanter等)をGitea管理下に統合
GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。
NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは
別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter
インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 15:37:06 +09:00

4.4 KiB
Raw Permalink Blame History

別記資料 スクリプトScripts全文 2228

// ...(前ファイルからの続き)
//社内確認中へ・問い合わせ不要・差戻しボタン作成(状況(Status)欄の右横に一列で配置)
$p.ex.statusRowButtons = function () {
    if ($('#sendInternalConfirmRow').length) {
        return; //二重生成防止
    }
    let defs = [
        { id: 'sendInternalConfirm', label: '社内確認中へ', process: '社内確認中へ' },
        { id: 'sendInquiryUnnecessary', label: '問い合わせ不要', process: '問い合わせ不要' },
        { id: 'sendReturnRequest', label: '差戻し', process: '差戻し' },
    ];
    let visibleDefs = defs.filter(function (d) { return $p.ex.processButtonExists(d.process); });
    if (visibleDefs.length === 0) {
        return;
    }

    let div = document.createElement('div');
    div.id = 'sendInternalConfirmRow';
    div.style.textAlign = 'right';
    div.style.float = 'right';
    visibleDefs.forEach(function (d) {
        let button = document.createElement('button');
        button.type = 'button';
        button.id = d.id;
        button.innerHTML = d.label;
        button.setAttribute('onclick', "$p.ex.clickProcessByName('" + d.process + "')");
        button.style.margin = '0px 10px 5px 5px';
        button.style.fontSize = '1.3em';
        div.append(button);
    });
    $('#Results_StatusField').after(div);
    visibleDefs.forEach(function (d) {
        $('#' + d.id).button({
            icon: 'ui-icon-mail-closed'
        });
    });
}

//一部回答・見積回答ボタン作成(返信者(Class103)欄の右横に、一部回答を上段・見積回答を下段で縦に配置)
//いずれも対応するプロセスボタンが実在する場合のみ表示。Depts・View条件にそのまま追従。
//活性/非活性のクライアント側制御は行わず、実行可否もProcess側のView条件(Status)にのみ委ねる
$p.ex.partialAnswerButton = function () {
    if ($p.ex.processButtonExists('一部回答') && !$('#sendPartialAnswer').length) {
        let div = document.createElement('div');
        div.style.textAlign = 'right';
        div.style.float = 'right';
        let button = document.createElement('button');
        button.type = 'button';
        button.id = 'sendPartialAnswer';
        button.innerHTML = '一部回答';
        button.setAttribute('onclick', "$p.ex.clickProcessByName('一部回答')");
        button.style.margin = '0px 10px 5px 5px';
        button.style.fontSize = '1.3em';
        div.append(button);
        $('#Results_Class103Field').after(div);
        $('#sendPartialAnswer').button({
            icon: 'ui-icon-mail-closed'
        });
    }
}

$p.ex.estimateReplyButton = function () {
    if ($p.ex.processButtonExists('見積回答') && !$('#sendEstimateReply').length) {
        let div6 = document.createElement('div');
        div6.style.textAlign = 'right';
        div6.style.float = 'right';
        let button6 = document.createElement('button');
        button6.type = 'button';
        button6.id = 'sendEstimateReply';
        button6.innerHTML = '見積回答';
        button6.setAttribute('onclick', "$p.ex.clickProcessByName('見積回答')");
        button6.style.margin = '0px 10px 5px 5px';
        button6.style.fontSize = '1.3em';
        div6.append(button6);
        //一部回答ボタン(#sendPartialAnswer)が生成済みならその直後、無ければClass103Fieldの直後に配置し、
        //一部回答の真下(画面上は右寄せの縦並びで一部回答が上段)になるようにする
        let $anchor = $('#sendPartialAnswer').closest('div');
        if ($anchor.length) {
            $anchor.after(div6);
        } else {
            $('#Results_Class103Field').after(div6);
        }
        $('#sendEstimateReply').button({
            icon: 'ui-icon-mail-closed'
        });
    }
}

//見積回答ボタン押下時、営業積算タブ添付ファイル(Attachments101)を問い合わせタブ(Description062)へ転記する
//単一項目からの転記のため「■■■項目名■■■」の見出しは付けない
$p.ex.transcribeEstimateAttachments = function () {
    let attachData = [];
    try {
        attachData = JSON.parse($p.getControl('Attachments101').val());
    } catch (e) {
        attachData = [];
    }

    let lines = attachData.map(function (file) {
// ...(次ファイルへ続く)