From 534533425b15b183cea60fa162d9884e5d3c6243 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 13 十月 2026 17:55:50 +0800
Subject: [PATCH] Merge branch 'dev_海西州_北京同仁堂' into dev_海西州_惠牧

---
 src/views/erp/finance/intangible-asset/data.ts |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 341 insertions(+), 0 deletions(-)

diff --git a/src/views/erp/finance/intangible-asset/data.ts b/src/views/erp/finance/intangible-asset/data.ts
new file mode 100644
index 0000000..ee27bd3
--- /dev/null
+++ b/src/views/erp/finance/intangible-asset/data.ts
@@ -0,0 +1,341 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { FinIntangibleAssetApi } from '#/api/erp/finance/intangible-asset';
+
+import { DICT_TYPE } from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
+
+import { z } from '#/adapter/form';
+import { getRangePickerDefaultProps } from '#/utils';
+
+import dayjs from 'dayjs';
+
+/** 璧勪骇鐘舵�侊細1鍦ㄧ敤 2宸插け鏁� 3宸叉憡閿�瀹� */
+export const INTANGIBLE_STATUS_IN_USE = 1;
+export const INTANGIBLE_STATUS_INVALID = 2;
+export const INTANGIBLE_STATUS_AMORTIZED = 3;
+
+/** 鍙鎻愭憡閿�鐨勭姸鎬侊紙浠呫�屽湪鐢ㄣ�嶇殑璧勪骇鎽婇攢锛屽凡澶辨晥/宸叉憡瀹屼笉鍐嶈鎻愶級 */
+export const AMORTIZABLE_INTANGIBLE_STATUS = [INTANGIBLE_STATUS_IN_USE];
+
+/** 鏂板/淇敼鐨勮〃鍗� */
+export function useFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      component: 'Input',
+      fieldName: 'id',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'assetCode',
+      label: '璧勪骇缂栫爜',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜х紪鐮侊紝濡� WX2026100001',
+        allowClear: true,
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'assetName',
+      label: '璧勪骇鍚嶇О',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜у悕绉�',
+        allowClear: true,
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'category',
+      label: '璧勪骇绫诲埆',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜х被鍒紝濡� 杞欢钁椾綔鏉�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'certificateNo',
+      label: '璇佷功缂栧彿',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ瘉涔︾紪鍙�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'acquisitionDate',
+      label: '鍙栧緱鏃ユ湡',
+      component: 'DatePicker',
+      componentProps: {
+        placeholder: '璇烽�夋嫨鍙栧緱鏃ユ湡',
+        showTime: false,
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        class: 'w-full',
+      },
+      rules: 'required',
+      defaultValue: dayjs().format('YYYY-MM-DD'),
+    },
+    {
+      fieldName: 'validityDate',
+      label: '鏈夋晥鏈熻嚦',
+      component: 'DatePicker',
+      componentProps: {
+        placeholder: '璇烽�夋嫨鏈夋晥鏈熸埅姝㈡棩鏈�',
+        showTime: false,
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        class: 'w-full',
+      },
+    },
+    {
+      fieldName: 'originalValue',
+      label: '璧勪骇鍘熷��',
+      component: 'InputNumber',
+      componentProps: {
+        class: 'w-full',
+        placeholder: '璇疯緭鍏ヨ祫浜у師鍊�',
+        min: 0,
+        precision: 2,
+      },
+      rules: z.number().min(0).default(0),
+    },
+    {
+      fieldName: 'amortizationPeriod',
+      label: '鎽婇攢骞撮檺锛堝勾锛�',
+      component: 'InputNumber',
+      componentProps: {
+        class: 'w-full',
+        placeholder: '璇疯緭鍏ユ憡閿�骞撮檺',
+        min: 1,
+        precision: 0,
+      },
+      defaultValue: 10,
+      rules: z.number().min(1).default(10),
+    },
+    {
+      fieldName: 'residualRate',
+      label: '娈嬪�肩巼锛�%锛�',
+      component: 'InputNumber',
+      componentProps: {
+        class: 'w-full',
+        placeholder: '璇疯緭鍏ユ畫鍊肩巼',
+        min: 0,
+        max: 100,
+        precision: 2,
+      },
+      defaultValue: 0,
+      rules: z.number().min(0).max(100).default(0),
+      help: '鏈堟憡閿�棰� =锛堝師鍊� 脳锛�1 - 娈嬪�肩巼锛夛級梅锛堟憡閿�骞撮檺 脳 12锛�',
+    },
+    {
+      fieldName: 'status',
+      label: '璧勪骇鐘舵��',
+      component: 'RadioGroup',
+      componentProps: {
+        options: getDictOptions(
+          DICT_TYPE.FINANCE_INTANGIBLE_ASSET_STATUS,
+          'number',
+        ),
+        buttonStyle: 'solid',
+        optionType: 'button',
+      },
+      defaultValue: INTANGIBLE_STATUS_IN_USE,
+      rules: 'selectRequired',
+    },
+    {
+      fieldName: 'description',
+      label: '璧勪骇鎻忚堪',
+      component: 'Textarea',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜ф弿杩�',
+        rows: 2,
+      },
+      formItemClass: 'md:col-span-2',
+    },
+    {
+      fieldName: 'remark',
+      label: '澶囨敞',
+      component: 'Textarea',
+      componentProps: {
+        placeholder: '璇疯緭鍏ュ娉�',
+        rows: 2,
+      },
+      formItemClass: 'md:col-span-2',
+    },
+  ];
+}
+
+/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
+export function useGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'assetCode',
+      label: '璧勪骇缂栫爜',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜х紪鐮�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'assetName',
+      label: '璧勪骇鍚嶇О',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜у悕绉�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'category',
+      label: '璧勪骇绫诲埆',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ祫浜х被鍒�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'certificateNo',
+      label: '璇佷功缂栧彿',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ瘉涔︾紪鍙�',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'acquisitionDate',
+      label: '鍙栧緱鏃ユ湡',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
+        showTime: false,
+        format: 'YYYY-MM-DD',
+        valueFormat: 'YYYY-MM-DD',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'status',
+      label: '璧勪骇鐘舵��',
+      component: 'Select',
+      componentProps: {
+        options: getDictOptions(
+          DICT_TYPE.FINANCE_INTANGIBLE_ASSET_STATUS,
+          'number',
+        ),
+        placeholder: '璇烽�夋嫨璧勪骇鐘舵��',
+        allowClear: true,
+      },
+    },
+  ];
+}
+
+/** 鍒楄〃鐨勫瓧娈� */
+export function useGridColumns(): VxeTableGridOptions<FinIntangibleAssetApi.IntangibleAsset>['columns'] {
+  return [
+    { type: 'checkbox', width: 40 },
+    {
+      field: 'assetCode',
+      title: '璧勪骇缂栫爜',
+      minWidth: 150,
+      fixed: 'left',
+    },
+    {
+      field: 'assetName',
+      title: '璧勪骇鍚嶇О',
+      minWidth: 160,
+    },
+    {
+      field: 'category',
+      title: '璧勪骇绫诲埆',
+      minWidth: 120,
+    },
+    {
+      field: 'certificateNo',
+      title: '璇佷功缂栧彿',
+      minWidth: 140,
+      showOverflow: 'tooltip',
+    },
+    {
+      field: 'acquisitionDate',
+      title: '鍙栧緱鏃ユ湡',
+      minWidth: 120,
+      formatter: 'formatDate',
+    },
+    {
+      field: 'validityDate',
+      title: '鏈夋晥鏈熻嚦',
+      minWidth: 120,
+      formatter: 'formatDate',
+    },
+    {
+      field: 'originalValue',
+      title: '璧勪骇鍘熷��',
+      minWidth: 130,
+      align: 'right',
+      formatter: 'formatAmount2',
+    },
+    {
+      field: 'amortizationPeriod',
+      title: '鎽婇攢骞撮檺',
+      minWidth: 100,
+      align: 'right',
+    },
+    {
+      field: 'residualRate',
+      title: '娈嬪�肩巼(%)',
+      minWidth: 110,
+      align: 'right',
+    },
+    {
+      field: 'monthlyAmortization',
+      title: '鏈堟憡閿�棰�',
+      minWidth: 130,
+      align: 'right',
+      formatter: 'formatAmount2',
+    },
+    {
+      field: 'accumulatedAmortization',
+      title: '绱鎽婇攢',
+      minWidth: 130,
+      align: 'right',
+      formatter: 'formatAmount2',
+    },
+    {
+      field: 'netValue',
+      title: '鍑�鍊�',
+      minWidth: 130,
+      align: 'right',
+      formatter: 'formatAmount2',
+    },
+    {
+      field: 'status',
+      title: '璧勪骇鐘舵��',
+      minWidth: 110,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.FINANCE_INTANGIBLE_ASSET_STATUS },
+      },
+    },
+    {
+      field: 'createTime',
+      title: '鍒涘缓鏃堕棿',
+      minWidth: 180,
+      formatter: 'formatDateTime',
+    },
+    {
+      title: '鎿嶄綔',
+      width: 200,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}

--
Gitblit v1.9.3