Skip to content
On this page

付款申请

业务模板

对方 ELS 账号 toElsAccount

表行编辑规则

js
{
  groupName: "付款申请行",
  groupNameI18nKey: "i18n_title_payApplicationLine",
  groupCode: "paymentApplyItemList",
  groupType: "item",
  sortOrder: "2",
  extend: {
    vxeGridConfig: {
      editConfig: {
        trigger: "click", // 点击触发编辑
        mode: "cell", // 单元格编辑模式
        /**
         * @description: 表行编辑规则
         * @param {Object} pageData 页面所有数据, ref响应对象,注意在使用时须带上.value
         * @param {Object} row 表行数据
         * @param {number} rowIndex 表行索引值
         * @param {Object} column 列配置
         * @param {number} columnIndex 列索引
         * @return {boolean} 返回布尔值, 为 true 时允许编辑
         */
        beforeEditMethod(pageData, { row, rowIndex, column, columnIndex }) {
          let sourceType = row.sourceType;
          if (sourceType && sourceType === "paymentPlan") {
            const props = ["applyAmount"];
            if (props.includes(column.field)) {
              return false;
            }
          }
          return true;
        },
      },
    },
  },
}
json
{
  "groupCode": "baseForm",
  "fieldType": "remoteSelect",
  "fieldLabel": "对方ELS账号",
  "fieldName": "toElsAccount",
  "required": "1"
}
js
/**
 * @param {Object} ctx 组件实例
 * @param {String} value 当前所选值
 * @param {Array} data selectModal, remoteSelect 已选行数据 (如有)
 * @param {boolean} _isFill 填充、粘贴操作判断标识
 * @param {Object} row 表行数据 (如有)
 * @param {number} idx 表行索引值 (如有)
 * @param {Object} pageData 页面所有数据
 * @param {Object} layoutConfig 模板配置
 * @param {Object} userInfo 当前登录人信息
 * @param {(groupCode: string, fieldName: string, fn: (item: FormFieldsItem | ColumnItem) => void) => void}
 * customFormatItem 遍历模板分组配置,自定义格式化查询到的字段
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequired 自定义设置字段必填
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemDisabled 自定义设置字段置灰
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequiredOrDisabled 自定义设置字段必填/置灰
 * @param {() => void} topEmit 用于处理复杂绑定函数需求
 * @param {Constructor} Decimal构造函数, 适用于js小数位数精度计算
 * https://github.com/MikeMcl/decimal.js
 */
function callback(
  ctx,
  {
    value,
    data,
    _isFill,
    row,
    idx,
    pageData,
    layoutConfig,
    userInfo,
    customFormatItem,
    setItemRequired,
    setItemDisabled,
    setItemRequiredOrDisabled,
    topEmit,
    Decimal,
  },
) {
  if (!data || !data.length) {
    return;
  }
  s;
  pageData.toElsAccount = data[0].toElsAccount || "";
  pageData.supplierName = data[0].supplierName || "";
  pageData.receiverBankAccount = data[0].toElsAccount || "";
}
js
{
  modalColumns: [
    {
      field: "toElsAccount",
      fieldLabelI18nKey: "i18n_title_supplierAccount",
      title: "供应商账号",
      with: 150,
    },
    {
      field: "supplierName",
      fieldLabelI18nKey: "i18n_title_supplierName",
      title: "供应商名称",
      with: 150,
    },
    {
      field: "supplierCode",
      fieldLabelI18nKey: "i18n_title_supplierCode",
      title: "供应商编码",
      with: 150,
    },
  ],
  modalUrl: "/supplier/supplierMaster/list",
  modalParams(Vue, form, obj) {
    return {
      frozenFunctionValue: "4",
      companyOrg: form.company,
    };
  },
  afterClearCallBack(form, pageData) {
    form.supplierName = "";
  },
  mobileModalParams(Vue, { _pageData, _cacheAllData }) {
    return {
      frozenFunctionValue: "4",
      companyOrg: _cacheAllData.company,
    };
  },
  mobileHandleAfter(Vue, { _pageData, _form, _cacheAllData, _value }) {
    _form.supplierName = "";
  },
}

收款方账号 receiverBankAccount

json
{
  "groupCode": "baseForm",
  "fieldType": "remoteSelect",
  "fieldLabel": "收款方账号",
  "fieldName": "receiverBankAccount",
  "required": "0"
}
js
/**
 * @param {Object} ctx 组件实例
 * @param {String} value 当前所选值
 * @param {Array} data selectModal, remoteSelect 已选行数据 (如有)
 * @param {boolean} _isFill 填充、粘贴操作判断标识
 * @param {Object} row 表行数据 (如有)
 * @param {number} idx 表行索引值 (如有)
 * @param {Object} pageData 页面所有数据
 * @param {Object} layoutConfig 模板配置
 * @param {Object} userInfo 当前登录人信息
 * @param {(groupCode: string, fieldName: string, fn: (item: FormFieldsItem | ColumnItem) => void) => void}
 * customFormatItem 遍历模板分组配置,自定义格式化查询到的字段
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequired 自定义设置字段必填
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemDisabled 自定义设置字段置灰
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequiredOrDisabled 自定义设置字段必填/置灰
 * @param {() => void} topEmit 用于处理复杂绑定函数需求
 * @param {Constructor} Decimal构造函数, 适用于js小数位数精度计算
 * https://github.com/MikeMcl/decimal.js
 */
function callback(
  ctx,
  {
    value,
    data,
    _isFill,
    row,
    idx,
    pageData,
    layoutConfig,
    userInfo,
    customFormatItem,
    setItemRequired,
    setItemDisabled,
    setItemRequiredOrDisabled,
    topEmit,
    Decimal,
  },
) {
  if (!data || !data.length) {
    return;
  }
  pageData.toElsAccount = data[0].toElsAccount || "";
  pageData.supplierName = data[0].supplierName || "";
  pageData.receiverBankAccount = data[0].toElsAccount || "";
}
js
{
  modalColumns: [
    {
      field: "toElsAccount",
      fieldLabelI18nKey: "i18n_title_supplierAccount",
      title: "供应商账号",
      with: 150,
    },
    {
      field: "supplierName",
      fieldLabelI18nKey: "i18n_title_supplierName",
      title: "供应商名称",
      with: 150,
    },
    {
      field: "supplierCode",
      fieldLabelI18nKey: "i18n_title_supplierCode",
      title: "供应商编码",
      with: 150,
    },
  ],
  modalUrl: "/supplier/supplierMaster/list",
  modalParams(Vue, form, obj) {
    return {
      frozenFunctionValue: "4",
      companyOrg: form.company,
    };
  },
  afterClearCallBack(form, pageData) {
    form.supplierName = "";
  },
  mobileModalParams(Vue, { _pageData, _cacheAllData }) {
    return {
      frozenFunctionValue: "4",
      companyOrg: _cacheAllData.company,
    };
  },
  mobileHandleAfter(Vue, { _pageData, _form, _cacheAllData, _value }) {
    _form.supplierName = "";
  },
}

:::

采购负责人 purchasePrincipal

json
{
  "groupCode": "baseForm",
  "fieldType": "remoteSelect",
  "fieldLabel": "采购负责人",
  "fieldName": "purchasePrincipal",
  "required": "0"
}
js
/**
 * @param {Object} ctx 组件实例
 * @param {String} value 当前所选值
 * @param {Array} data selectModal, remoteSelect 已选行数据 (如有)
 * @param {boolean} _isFill 填充、粘贴操作判断标识
 * @param {Object} row 表行数据 (如有)
 * @param {number} idx 表行索引值 (如有)
 * @param {Object} pageData 页面所有数据
 * @param {Object} layoutConfig 模板配置
 * @param {Object} userInfo 当前登录人信息
 * @param {(groupCode: string, fieldName: string, fn: (item: FormFieldsItem | ColumnItem) => void) => void}
 * customFormatItem 遍历模板分组配置,自定义格式化查询到的字段
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequired 自定义设置字段必填
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemDisabled 自定义设置字段置灰
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequiredOrDisabled 自定义设置字段必填/置灰
 * @param {() => void} topEmit 用于处理复杂绑定函数需求
 * @param {Constructor} Decimal构造函数, 适用于js小数位数精度计算
 * https://github.com/MikeMcl/decimal.js
 */
function callback(
  ctx,
  {
    value,
    data,
    _isFill,
    row,
    idx,
    pageData,
    layoutConfig,
    userInfo,
    customFormatItem,
    setItemRequired,
    setItemDisabled,
    setItemRequiredOrDisabled,
    topEmit,
    Decimal,
  },
) {
  if (!data || !data.length) {
    return;
  }
  pageData.purchasePrincipal = data[0].subAccount + "_" + data[0].realname;
}
js
{
  modalColumns: [
    {
      field: "subAccount",
      title: "子账号",
      fieldLabelI18nKey: "i18n_field_subAccount",
      with: 150,
    },
    {
      field: "realname",
      title: "姓名",
      fieldLabelI18nKey: "i18n_field_realname",
      with: 150,
    },
  ],
  selectModal: "single",
  modalUrl: "/account/elsSubAccount/page",
  modalParams: {
    status: "1",
  },
  handleAfter({ pageData }) {
    pageData.purchasePrincipal = "";
  },
}

销售负责人 salePrincipal

json
{
  "groupCode": "baseForm",
  "fieldType": "remoteSelect",
  "fieldLabel": "销售负责人",
  "fieldName": "salePrincipal",
  "required": "0"
}
js
/**
 * @param {Object} ctx 组件实例
 * @param {String} value 当前所选值
 * @param {Array} data selectModal, remoteSelect 已选行数据 (如有)
 * @param {boolean} _isFill 填充、粘贴操作判断标识
 * @param {Object} row 表行数据 (如有)
 * @param {number} idx 表行索引值 (如有)
 * @param {Object} pageData 页面所有数据
 * @param {Object} layoutConfig 模板配置
 * @param {Object} userInfo 当前登录人信息
 * @param {(groupCode: string, fieldName: string, fn: (item: FormFieldsItem | ColumnItem) => void) => void}
 * customFormatItem 遍历模板分组配置,自定义格式化查询到的字段
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequired 自定义设置字段必填
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemDisabled 自定义设置字段置灰
 * @param {(groupCode: string, fieldName: string, flag: boolean) => void}
 * setItemRequiredOrDisabled 自定义设置字段必填/置灰
 * @param {() => void} topEmit 用于处理复杂绑定函数需求
 * @param {Constructor} Decimal构造函数, 适用于js小数位数精度计算
 * https://github.com/MikeMcl/decimal.js
 */
function callback(
  ctx,
  {
    value,
    data,
    _isFill,
    row,
    idx,
    pageData,
    layoutConfig,
    userInfo,
    customFormatItem,
    setItemRequired,
    setItemDisabled,
    setItemRequiredOrDisabled,
    topEmit,
    Decimal,
  },
) {
  if (!data || !data.length) {
    return;
  }
  pageData.salePrincipal = data[0].subAccount + "_" + data[0].realname;
  pageData.salePrincipalPhone = data[0].phone;
}
js
{
  modalColumns: [
    {
      field: "subAccount",
      title: "账号",
      fieldLabelI18nKey: "i18n_field_subAccount",
      with: 150,
    },
    {
      field: "realname",
      title: "名称",
      fieldLabelI18nKey: "i18n_field_RJ_a88ea",
      with: 150,
    },
    {
      field: "phone",
      title: "联系电话",
      fieldLabelI18nKey: "i18n_field_contactNumber",
      with: 150,
    },
  ],
  modalUrl: "/account/elsSubAccount/getByElsAccount",
  modalParams(Vue, form, row) {
    return {
      participants: "sale",
      toElsAccount: form.toElsAccount,
      status: "1",
    };
  },
  mobileModalParams(Vue, { _pageData, _cacheAllData }) {
    return {
      participants: "sale",
      toElsAccount: _cacheAllData.toElsAccount,
      status: "1",
    };
  },
}