ソースを参照

微修正

develop
sosuke.iwabuchi 1年前
コミット
e2164fe5d2
3個のファイルの変更15行の追加3行の削除
  1. +8
    -0
      src/common/kintone-event.ts
  2. +1
    -1
      src/rest-api/定期駐車場プランマスタ.ts
  3. +6
    -2
      src/rest-api/顧客マスタ.ts

+ 8
- 0
src/common/kintone-event.ts ファイルの表示

@@ -27,6 +27,14 @@ export const KintoneEvent = {
フィールドの値を変更したとき: (fieldCode: string) =>
sprintf("app.record.edit.change.%s", fieldCode),
},

追加編集: {
保存するとき: ["app.record.create.submit", "app.record.edit.submit"],
フィールドの値を変更したとき: (fieldCode: string) => [
sprintf("app.record.create.change.%s", fieldCode),
sprintf("app.record.edit.change.%s", fieldCode),
],
},
} as const;

export const 画面遷移 = (event: any, url: string) => {


+ 1
- 1
src/rest-api/定期駐車場プランマスタ.ts ファイルの表示

@@ -12,7 +12,7 @@ export const get定期駐車場プランマスタ = async (
プラン名: string
): Promise<定期駐車場プランマスタ> => {
const query = sprintf(
sprintf('%s = "%s"', 定期駐車場プランマスタフィールド名.プラン名, プラン名)
sprintf('%s = "%s"', 定期駐車場プランマスタフィールド名.KEY, プラン名)
);

const { records } = await client.record.getRecords<定期駐車場プランマスタ>({


+ 6
- 2
src/rest-api/顧客マスタ.ts ファイルの表示

@@ -4,6 +4,7 @@ import { 顧客マスタ, 顧客マスタフィールド名 } from "@/types/顧
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
import { sprintf } from "sprintf";
import { QueryBuilder } from "./query";
import { max } from "lodash";

const client = new KintoneRestAPIClient();

@@ -74,6 +75,7 @@ export const getNext顧客コード = async () => {
};

export const getNextSMBC番号 = async () => {
const min = 90000;
const query = sprintf(
"order by %s desc limit 1",
顧客マスタフィールド名.SMBC契約番号
@@ -83,7 +85,9 @@ export const getNextSMBC番号 = async () => {
query,
});
if (records.length === 0) {
return 1;
return min;
}
return Number(records[0][顧客マスタフィールド名.SMBC契約番号].value) + 1;

const num = Number(records[0][顧客マスタフィールド名.SMBC契約番号].value) + 1;
return max([min, num]);
};

読み込み中…
キャンセル
保存