Przeglądaj źródła

feat(业务参数、业务公司权限):离职交接、组织架构...

snow 9 miesięcy temu
rodzic
commit
0ef480ff45
66 zmienionych plików z 2046 dodań i 1797 usunięć
  1. 36 0
      src/api/interest/handover/index.ts
  2. 31 0
      src/api/interest/organize/index.ts
  3. 38 0
      src/api/purchase/orderPay/index.ts
  4. 53 0
      src/api/purchase/orderRecord/index.ts
  5. 14 0
      src/api/purchase/orderRecordQuery/index.ts
  6. 13 0
      src/api/purchase/porder/index.ts
  7. 38 0
      src/api/purchase/purchPayRelive/index.ts
  8. 44 0
      src/api/purchase/ticketReturn/index.ts
  9. 34 0
      src/api/purchase/ticketReturnRelive/index.ts
  10. 13 0
      src/api/serviceParam/expressSet/index.ts
  11. 27 0
      src/api/serviceParam/orderuse/index.ts
  12. 22 0
      src/api/serviceParam/paymentChannelManage/index.ts
  13. 27 0
      src/api/serviceParam/unusualReason/index.ts
  14. 4 3
      src/components/ApprovalNode/src/default.vue
  15. 6 3
      src/components/PageContent/src/actions/action-status.tsx
  16. 4 3
      src/components/PageContent/src/page-content.tsx
  17. 1 0
      src/components/PageContent/src/types.ts
  18. 0 2
      src/components/PageSearch/src/hooks/use-page-search.ts
  19. 0 435
      src/views/interest/companyAccount-origin/addEdit.vue
  20. 0 61
      src/views/interest/companyAccount-origin/columns.tsx
  21. 0 134
      src/views/interest/companyAccount-origin/components/company-modal.vue
  22. 0 328
      src/views/interest/companyAccount-origin/index.vue
  23. 0 199
      src/views/interest/companyAccount-origin/resetPassword.vue
  24. 0 8
      src/views/interest/companyAccount-origin/types.ts
  25. 31 105
      src/views/interest/dataShare/components/share-modal.vue
  26. 1 1
      src/views/interest/group/config/content.config.ts
  27. 4 1
      src/views/interest/group/index.vue
  28. 48 0
      src/views/interest/handover/config/content.config.ts
  29. 7 0
      src/views/interest/handover/config/options.ts
  30. 36 0
      src/views/interest/handover/config/search.config.ts
  31. 98 0
      src/views/interest/handover/detail.vue
  32. 111 0
      src/views/interest/handover/form.vue
  33. 50 0
      src/views/interest/handover/index.vue
  34. 54 0
      src/views/interest/handover/modal.vue
  35. 83 0
      src/views/interest/organize/cpns/modal.vue
  36. 129 0
      src/views/interest/organize/cpns/organize-tree.vue
  37. 122 0
      src/views/interest/organize/index.vue
  38. 1 2
      src/views/interest/processPermission/components/process-list.vue
  39. 0 2
      src/views/interest/processPermission/components/role-list.vue
  40. 0 487
      src/views/interest/processPermission/config/mock.ts
  41. 17 23
      src/views/interest/processPermission/index.vue
  42. 11 0
      src/views/serviceParam/expressSet/config/_options.ts
  43. 64 0
      src/views/serviceParam/expressSet/config/content.config.ts
  44. 20 0
      src/views/serviceParam/expressSet/config/search.config.ts
  45. 26 0
      src/views/serviceParam/expressSet/index.vue
  46. 0 0
      src/views/serviceParam/expressSet/快递信息设置.md
  47. 62 0
      src/views/serviceParam/orderuse/components/modal.vue
  48. 4 0
      src/views/serviceParam/orderuse/config/_options.ts
  49. 58 0
      src/views/serviceParam/orderuse/config/content.config.ts
  50. 36 0
      src/views/serviceParam/orderuse/config/search.config.ts
  51. 66 0
      src/views/serviceParam/orderuse/index.vue
  52. 0 0
      src/views/serviceParam/orderuse/订单用途管理.md
  53. 80 0
      src/views/serviceParam/paymentChannelManage/components/modal.vue
  54. 1 0
      src/views/serviceParam/paymentChannelManage/config/_details.ts
  55. 4 0
      src/views/serviceParam/paymentChannelManage/config/_options.ts
  56. 72 0
      src/views/serviceParam/paymentChannelManage/config/content.config.ts
  57. 25 0
      src/views/serviceParam/paymentChannelManage/config/search.config.ts
  58. 70 0
      src/views/serviceParam/paymentChannelManage/index.vue
  59. 5 0
      src/views/serviceParam/paymentChannelManage/types.ts
  60. 0 0
      src/views/serviceParam/paymentChannelManage/订单用途管理.md
  61. 80 0
      src/views/serviceParam/unusualReason/components/modal.vue
  62. 16 0
      src/views/serviceParam/unusualReason/config/_options.ts
  63. 68 0
      src/views/serviceParam/unusualReason/config/content.config.ts
  64. 15 0
      src/views/serviceParam/unusualReason/config/search.config.ts
  65. 66 0
      src/views/serviceParam/unusualReason/index.vue
  66. 0 0
      src/views/serviceParam/unusualReason/原因管理.md

+ 36 - 0
src/api/interest/handover/index.ts

@@ -0,0 +1,36 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+interface ResponseType extends Promise<any> {
+  data?: object;
+  code?: number;
+  message?: string;
+}
+
+export const httpList = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}Resigninfolist`, { data });
+};
+
+
+export const httpUsers = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}userCompanyBasicList`, { data });
+};
+
+
+export const httpCreate = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}Resigninfocreate`, { data });
+};
+
+export const httpDetail = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}Resigninfoselect`, { data });
+};
+
+
+
+export const httpUpdate = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}Resigninfoedit`, { data });
+};
+
+

+ 31 - 0
src/api/interest/organize/index.ts

@@ -0,0 +1,31 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+interface ResponseType extends Promise<any> {
+  data?: object;
+  code?: number;
+  message?: string;
+}
+
+export const httpList = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}ulist`, { data });
+};
+
+
+export const httpBusinesslist = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}businesslist`, { data });
+};
+
+export const httpCreate = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}add`, { data });
+};
+
+export const httpDelete = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}itemdel`, { data });
+};
+
+export const httpUpdate = (data:object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}refresh`, { data });
+};

+ 38 - 0
src/api/purchase/orderPay/index.ts

@@ -0,0 +1,38 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+//对账付款申请列表
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}paymentlist`, { data });
+};
+
+//对账付款详情
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}dzinfo`, { data });
+};
+
+export const httpDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}dzinfo`, { data });
+};
+
+//对账单申请付款添加
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}stageadd`, { data });
+};
+
+//对账单申请删除
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}stagedel`, { data });
+};
+
+//对账单申请付款审核状态
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}stagestatus`, { data });
+};
+
+export const httpUpload = (data: object): any => {
+  return http.request("post", `${yewuApi}uploadimg`, { data });
+};

+ 53 - 0
src/api/purchase/orderRecord/index.ts

@@ -0,0 +1,53 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}paylist`, { data });
+};
+
+//对账单详情
+export const httpDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}payinfo`, { data });
+};
+
+//通用对账单详情
+export const httpCommonDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}ComonOrder/payInfo`, { data });
+};
+
+
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}payinfo`, { data });
+};
+
+//采购单列表
+export const httpCgdList = (data: object = {}): any => {
+  return http.request("post", `${yewuApi}cgdlist`, { data });
+};
+
+//创建对账单
+export const httpAdd = (data: object = {}): any => {
+  return http.request("post", `${yewuApi}payadd`, { data });
+};
+
+//对账单编辑
+export const httpUpadte = (data: object = {}): any => {
+  return http.request("post", `${yewuApi}paysave`, { data });
+};
+
+//对账单审核
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}paystatus`, { data });
+};
+
+//对账单删除
+export const httpDel = (data: object): any => {
+  return http.request("post", `${yewuApi}paydel`, { data });
+};
+
+export const httpBatch = (data: object): any => {
+  return http.request("post", `${yewuApi}cgdquery`, { data });
+};

+ 14 - 0
src/api/purchase/orderRecordQuery/index.ts

@@ -0,0 +1,14 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}paylist`, {
+    data: {
+      status: "3",
+      ...data
+    }
+  });
+};

+ 13 - 0
src/api/purchase/porder/index.ts

@@ -0,0 +1,13 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}cgdlist`, { data });
+};
+
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}cgdinfo`, { data });
+};

+ 38 - 0
src/api/purchase/purchPayRelive/index.ts

@@ -0,0 +1,38 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+//对账付款申请列表
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}stagereturnlist`, { data });
+};
+
+//对账付款解除详情
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}stagereturninfo`, { data });
+};
+
+export const httpDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}stagereturninfo`, { data });
+};
+
+//采购付款解除
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}stagereturn`, { data });
+};
+
+//对账单申请删除
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}stagedel`, { data });
+};
+
+//对账单申请付款审核状态
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}stagereturnstatus`, { data });
+};
+
+export const httpUpload = (data: object): any => {
+  return http.request("post", `${yewuApi}uploadimg`, { data });
+};

+ 44 - 0
src/api/purchase/ticketReturn/index.ts

@@ -0,0 +1,44 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+//发票回票列表
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}invlist`, { data });
+};
+
+//发票回票添加
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}invadd`, { data });
+};
+
+//发票回票审核状态
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}invstatus`, { data });
+};
+
+//发票回票详情
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinfo`, { data });
+};
+
+export const httpDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinfo`, { data });
+};
+
+//发票回票删除
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}invdel`, { data });
+};
+
+//发票回票批量审核
+export const httpBatchimport = (data: object): any => {
+  return http.request("post", `${yewuApi}hpbatchimport`, { data });
+};
+
+//发票回票批量添加
+export const httpBatchAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}invAddBatchByImport`, { data });
+};

+ 34 - 0
src/api/purchase/ticketReturnRelive/index.ts

@@ -0,0 +1,34 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+//发票回票列表
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinvreturnlist`, { data });
+};
+
+//发票回票添加
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinvreturn`, { data });
+};
+
+//发票回票审核状态
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinvreturnstatus`, { data });
+};
+
+//发票回票详情
+export const httpInfo = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinfo`, { data });
+};
+
+export const httpDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}hpinvreturninfo`, { data });
+};
+
+//发票回票删除
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}invdel`, { data });
+};

+ 13 - 0
src/api/serviceParam/expressSet/index.ts

@@ -0,0 +1,13 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}expresslist`, { data });
+};
+
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}expressuse`, { data });
+};

+ 27 - 0
src/api/serviceParam/orderuse/index.ts

@@ -0,0 +1,27 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}uselist`, { data });
+};
+
+export const httpUpdate = (data: object): any => {
+  return http.request("post", `${yewuApi}useedit`, { data });
+};
+
+
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}usecreate`, { data });
+};
+
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}usestatus`, { data });
+};
+
+
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}usedelete`, { data });
+};

+ 22 - 0
src/api/serviceParam/paymentChannelManage/index.ts

@@ -0,0 +1,22 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}channellist`, { data });
+};
+
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}channeladd`, { data });
+};
+
+export const httpUpdate = (data: object): any => {
+  return http.request("post", `${yewuApi}channeledit`, { data });
+};
+
+//发票回票审核状态
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}channelstatus`, { data });
+};

+ 27 - 0
src/api/serviceParam/unusualReason/index.ts

@@ -0,0 +1,27 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+export const httpList = (data: object): any => {
+  return http.request("post", `${yewuApi}resultlist`, { data });
+};
+
+export const httpUpdate = (data: object): any => {
+  return http.request("post", `${yewuApi}resultedit`, { data });
+};
+
+
+export const httpAdd = (data: object): any => {
+  return http.request("post", `${yewuApi}resultcreate`, { data });
+};
+
+export const httpStatus = (data: object): any => {
+  return http.request("post", `${yewuApi}resultstatu`, { data });
+};
+
+
+export const httpDelete = (data: object): any => {
+  return http.request("post", `${yewuApi}resultdel`, { data });
+};

+ 4 - 3
src/components/ApprovalNode/src/default.vue

@@ -9,6 +9,7 @@ const emit = defineEmits(["approval"]);
 const props = defineProps<{
   approveValue: string;
   rejectValue: string;
+  rejectHiddenRemark: boolean
 }>();
 
 const formRef = ref<InstanceType<typeof ElForm> | null>(null);
@@ -38,7 +39,7 @@ watch(
 </script>
 
 <template>
-  <ElForm ref="formRef" :model="formData" :rules="rules" label-width="100px">
+  <ElForm ref="formRef" :model="formData" :rules="rules" label-width="100px" size="small">
     <div flex flex-col style="width: 50%">
       <ElFormItem label="审核状态" prop="status">
         <el-select placeholder="请选择审核状态" v-model="formData.status">
@@ -47,7 +48,7 @@ watch(
         </el-select>
       </ElFormItem>
 
-      <ElFormItem label="备注" prop="remark">
+      <ElFormItem label="备注" prop="remark" v-if="formData.status !== rejectValue">
         <ElInput
           :rows="5"
           type="textarea"
@@ -60,7 +61,7 @@ watch(
 
     <ElFormItem>
       <div class="w-full flex justify-end">
-        <ElButton type="primary" @click="handleApproval">提交审核结果</ElButton>
+        <ElButton type="primary" @click="handleApproval" size="small">提交审核结果</ElButton>
       </div>
     </ElFormItem>
   </ElForm>

+ 6 - 3
src/components/PageContent/src/actions/action-status.tsx

@@ -18,6 +18,9 @@ const ActionStatus = defineComponent({
     },
     statusRowProp: {
       type: Function as PropType<any>
+    },
+    statusListProp:{
+      type:String
     }
   },
   emits: ["reload"],
@@ -41,7 +44,7 @@ const ActionStatus = defineComponent({
         code,
         message,
         handler: () => {
-          ElMessage.success(props.row.status === '1' ? '禁用成功!' : '启用成功')
+          ElMessage.success(props.row[props.statusListProp || 'status'] === '1' ? '禁用成功!' : '启用成功')
           emit("reload")
         }
       });
@@ -49,7 +52,7 @@ const ActionStatus = defineComponent({
 
     return () => (
       <el-popconfirm
-        title={String(props.row.status) === "1" ? "改为禁用?" : "改为启用?"}
+        title={String(props.row[props.statusListProp || 'status']) === "1" ? "改为禁用?" : "改为启用?"}
         onConfirm={handleStatus}
         v-slots={{
           reference: () => (
@@ -59,7 +62,7 @@ const ActionStatus = defineComponent({
               size="small"
               type="primary"
               icon={useRenderIcon(
-                String(props.row.status) === "1"
+                String(props.row[props.statusListProp || 'status']) === "1"
                   ? "close-circle-line"
                   : "checkbox-circle-line"
               )}

+ 4 - 3
src/components/PageContent/src/page-content.tsx

@@ -90,6 +90,7 @@ const PageContent = defineComponent({
         isRequesetArray,
         superUserNoAction,
         superUserNoPerview,
+        statusListProp
       } = contentConfig;
 
       const view = showPreview ? showPreview(row) : true;
@@ -111,10 +112,9 @@ const PageContent = defineComponent({
         ? showStatus(isSuperUser.value)
         : action.status &&
         noAction &&
-        ((powers.some(i => i == "003") && row.status + "" === "0") ||
-          (powers.some(i => i == "004") && row.status + "" === "1"));
+        ((powers.some(i => i == "003") && row[statusListProp || 'status'] + "" === "0") ||
+          (powers.some(i => i == "004") && row[statusListProp || 'status'] + "" === "1"));
 
-          console.log(powers)
 
       return (
         <>
@@ -177,6 +177,7 @@ const PageContent = defineComponent({
               row={row}
               prop={contentConfig.statusProp}
               statusRowProp={contentConfig.statusRowProp}
+              statusListProp={contentConfig.statusListProp}
               onReload={() => onSearch()}
               isRequesetArray={isRequesetArray}
               {...createActionProps("status", apis)}

+ 1 - 0
src/components/PageContent/src/types.ts

@@ -13,6 +13,7 @@ import PageContent from "./page-content";
  * @param treeProps
  */
 export interface ContentConfig {
+  statusListProp?:string
   superForceAction: boolean
   title: string;
   transformCompany: boolean;

+ 0 - 2
src/components/PageSearch/src/hooks/use-page-search.ts

@@ -50,12 +50,10 @@ export function usePageSearch(
           delete mergeParams[type_field];
         }
 
-        console.log(mergeParams)
       });
     }
 
     deleteProps.forEach(key => delete mergeParams[key]);
-
     pageContentRef.value?.getPageData(mergeParams);
   }
 

+ 0 - 435
src/views/interest/companyAccount-origin/addEdit.vue

@@ -1,435 +0,0 @@
-<script setup lang="ts">
-import {
-  httpAdd,
-  httpUpdate,
-  httpDetail
-} from "/@/api/interest/companyAccount";
-import { ElMessage, FormInstance, FormRules } from "element-plus";
-import { reactive, ref, watch, nextTick } from "vue";
-import { useNav } from "/@/layout/hooks/nav";
-import { isMobile } from "/@/utils/validate";
-import CompanyModal from "./components/company-modal.vue";
-import { type menuType } from "./types";
-import { useUserInfo } from "/@/hooks/core/useUser";
-
-const { logout } = useNav();
-const formSize = ref("default");
-const ruleFormRef = ref<FormInstance>();
-
-const props = defineProps({
-  itemId: {
-    type: String,
-    default: ""
-  },
-  showModel: {
-    type: Boolean,
-    default: false
-  },
-  isDetails: {
-    type: String,
-    default: "add"
-  },
-  sitem: {
-    type: Object as PropType<menuType>
-  }
-});
-
-const defaultCompany = ref<boolean[]>([]);
-let defaultCompanyNo = "";
-
-const showModelThis = ref(false);
-const emit = defineEmits<{
-  (e: "cancel"): void;
-  (e: "refresh"): void;
-}>();
-const id = ref("");
-const editType = ref("add");
-const formModel = {
-  id: "", //账户id
-  nickname: "", //真实姓名
-  mobile: "", //手机号
-  companyArr: []
-};
-
-const tableRef = ref<any>(null);
-const ruleForm = reactive<menuType>({ ...formModel });
-const companyModalRef = ref<InstanceType<typeof CompanyModal> | null>(null);
-const { isSuperUser } = useUserInfo();
-
-let originCompanyArr: any[] = [];
-const rules = reactive<FormRules>({
-  nickname: [
-    { required: true, message: "请输入真实姓名", trigger: "blur" },
-    { min: 2, max: 12, message: "长度在 2 到 12 个字符", trigger: "blur" }
-  ],
-  mobile: [
-    {
-      required: true,
-      validator: (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("手机号不能为空!"));
-        } else if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
-        } else {
-          callback();
-        }
-      },
-
-      trigger: "blur"
-    }
-  ],
-  companyArr: [
-    {
-      required: true,
-      validator: (rule, value, callback) => {
-        if (value.length === 0) {
-          callback(new Error("请选择业务公司"));
-        } else {
-          callback();
-        }
-      }
-    }
-  ]
-});
-
-const submitForm = async (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  if (!defaultCompanyNo) {
-    ElMessage.warning("请选择默认公司");
-    return;
-  }
-
-  await formEl.validate(async (valid, fields) => {
-    if (valid) {
-      if (loading.value === true) return;
-      const model = Object.assign({}, ruleForm);
-
-      if (editType.value === "add") delete model.id;
-      const current = model.companyArr.map(({ companyCode }) => companyCode);
-
-      const dels = originCompanyArr
-        .filter(({ companyCode }) => !current.includes(companyCode))
-        .map(({ companyCode, companyName, id }) => ({
-          id,
-          companyCode,
-          companyName,
-          is_del: 1,
-          is_main: "0"
-        }));
-
-      const orgs = originCompanyArr
-        .filter(({ companyCode }) => current.includes(companyCode))
-        .map(({ companyCode, companyName, id }) => ({
-          id,
-          companyCode,
-          companyName,
-          is_del: 0,
-          is_main: "0"
-        }));
-
-      const adds = model.companyArr
-        .filter(({ companyCode: code }) => {
-          return (
-            !dels.find(({ companyCode }) => companyCode === code) &&
-            !orgs.find(({ companyCode }) => companyCode === code)
-          );
-        })
-        .map(({ companyCode, companyName, id }) => ({
-          id,
-          companyCode,
-          companyName,
-          is_main: "0",
-          is_del: 0
-        }));
-
-      model.companyArr = [...dels, ...orgs, ...adds];
-
-      model.companyArr.forEach(item => {
-        if (item.companyCode === defaultCompanyNo) {
-          item.is_main = "1";
-        }
-      });
-
-      loading.value = true;
-      const { code, message } =
-        editType.value === "add"
-          ? await httpAdd(model)
-          : await httpUpdate(model);
-      loading.value = false;
-
-      if (code === 0) {
-        ElMessage.success(titleType.value + "成功!");
-        showModelThis.value = false;
-        emit("refresh");
-      } else if (code > 100 && code < 140) {
-        showModelThis.value = false;
-        logout();
-      } else {
-        ElMessage.error(message);
-      }
-    } else {
-      console.log("error submit!", fields);
-    }
-  });
-};
-
-const resetForm = async (formEl: FormInstance | undefined, item) => {
-  if (formEl) {
-    formEl.clearValidate();
-    formEl.resetFields();
-  }
-
-  await nextTick(async () => {
-    for (let key in ruleForm) {
-      if (key === "companyArr" && item["company_relaton"]) {
-        if (editType.value !== "add") {
-          item["company_relaton"].forEach(item => {
-            ruleForm.companyArr.push({ ...item });
-          });
-        } else {
-          ruleForm.companyArr = [];
-        }
-      } else {
-        ruleForm[key] = item[key];
-      }
-    }
-  });
-
-  originCompanyArr = item.company_relaton?.map(item => ({ ...item })) || [];
-
-  if (editType.value === "add") {
-    ruleForm.companyArr = [];
-    originCompanyArr = [];
-  }
-};
-
-const closeDialog = () => {
-  showModelThis.value = false;
-  defaultCompany.value = [];
-  ruleForm.companyArr = [];
-  defaultCompanyNo = "";
-  emit("cancel");
-};
-
-const loading = ref(true);
-const titleType = ref("");
-async function initForm(item: Object) {
-  loading.value = true;
-  switch (editType.value) {
-    case "add":
-      titleType.value = "新建账号";
-      break;
-    case "edit":
-      titleType.value = "编辑账号";
-      break;
-    case "view":
-      titleType.value = "账号详情";
-      break;
-    default:
-      titleType.value = "新建账号";
-  }
-  resetForm(ruleFormRef.value, item);
-  loading.value = false;
-}
-
-function handleDelete(index) {
-  ruleForm.companyArr.splice(index, 1);
-  if (defaultCompany.value[index]) {
-    defaultCompanyNo = "";
-  }
-  defaultCompany.value.splice(index, 1);
-
-  if (ruleForm.companyArr.length >= 1) {
-    defaultCompany.value[index] = true;
-    const current = ruleForm.companyArr[index];
-
-    if (current) {
-      defaultCompanyNo = ruleForm.companyArr[index].companyCode;
-      defaultCompany.value[index] = true;
-      return;
-    }
-
-    defaultCompanyNo = ruleForm.companyArr[index - 1].companyCode;
-    defaultCompany.value[index - 1] = true;
-  }
-
-  console.log(defaultCompanyNo, defaultCompany.value);
-}
-
-function handleChoose(companys) {
-  const codes = ruleForm.companyArr.map(({ companyCode }) => companyCode);
-
-  companys.forEach(item => {
-    if (!codes.includes(item.code)) {
-      const { code, name } = item;
-      ruleForm.companyArr.push({
-        companyCode: code,
-        companyName: name
-      });
-    }
-  });
-
-  defaultCompany.value = ruleForm.companyArr.map(() => false);
-  const index = ruleForm.companyArr.findIndex(
-    ({ companyCode }) => companyCode === defaultCompanyNo
-  );
-
-  if (index >= 0) {
-    defaultCompany.value[index] = true;
-  }
-}
-
-watch(
-  () => {
-    return props.showModel;
-  },
-  () => {
-    const { showModel, itemId, isDetails, sitem } = props as any;
-    showModelThis.value = showModel;
-    if (showModelThis.value) {
-      id.value = itemId;
-      editType.value = isDetails;
-      if (isDetails !== "add") {
-        initForm(sitem);
-      } else {
-        initForm(formModel);
-      }
-    }
-
-    if (editType.value === "edit" || editType.value === "view") {
-      const index = sitem.company_relaton.findIndex(
-        ({ is_main }) => String(is_main) === "1"
-      );
-
-      if (index >= 0) {
-        defaultCompany.value = sitem.company_relaton.map(() => false);
-        defaultCompanyNo = sitem.company_relaton[index].companyCode;
-        defaultCompany.value[index] = true;
-      }
-    }
-  }
-);
-
-function handleDefaultCompanyChange(index: number) {
-  defaultCompany.value.forEach((_, index) => {
-    defaultCompany.value[index] = false;
-  });
-
-  defaultCompanyNo = ruleForm.companyArr[index].companyCode;
-  defaultCompany.value[index] = true;
-}
-</script>
-
-<template>
-  <el-dialog
-    :close-on-press-escape="false"
-    :close-on-click-modal="false"
-    v-model="showModelThis"
-    append-to-body
-    :width="'900px'"
-    center
-    :title="titleType"
-    v-loading="loading"
-    @close="closeDialog"
-  >
-    <el-form
-      class="demo-ruleForm"
-      ref="ruleFormRef"
-      :model="ruleForm"
-      :rules="rules"
-      label-width="90px"
-      :size="formSize"
-      status-icon
-    >
-      <el-row>
-        <el-col :span="24">
-          <el-form-item label="真实姓名" prop="nickname">
-            <el-input
-              v-model="ruleForm.nickname"
-              :disabled="editType === 'view'"
-              placeholder="真实姓名"
-            /> </el-form-item
-        ></el-col>
-        <el-col :span="24">
-          <el-form-item label="手机号" prop="mobile">
-            <el-input
-              v-model="ruleForm.mobile"
-              :disabled="editType === 'view'"
-              :maxlength="11"
-              placeholder="手机号"
-            /> </el-form-item
-        ></el-col>
-        <el-col :span="24">
-          <el-form-item label="业务公司" prop="companyArr">
-            <el-table
-              :data="ruleForm.companyArr"
-              border
-              size="small"
-              row-key="companyCode"
-              reserve-selection
-              ref="tableRef"
-            >
-              <el-table-column label="默认公司" width="80px">
-                <template #="{ $index }">
-                  <div class="w-full flex justify-center">
-                    <el-checkbox
-                      :disabled="editType === 'view'"
-                      v-model="defaultCompany[$index]"
-                      @change="() => handleDefaultCompanyChange($index)"
-                    />
-                  </div>
-                </template>
-              </el-table-column>
-
-              <el-table-column label="公司编码" prop="companyCode" />
-              <el-table-column label="公司名称" prop="companyName" />
-
-              <el-table-column
-                v-if="editType !== 'view' && isSuperUser"
-                width="100px"
-                label="操作"
-              >
-                <template #header>
-                  <div class="w-full flex justify-between items-center">
-                    <div>操作</div>
-                    <ElButton
-                      text
-                      type="primary"
-                      @click="() => companyModalRef.onDisplay()"
-                      >添加</ElButton
-                    >
-                  </div>
-                </template>
-
-                <template #="{ $index }">
-                  <ElButton
-                    text
-                    type="danger"
-                    @click="() => handleDelete($index)"
-                    >删除</ElButton
-                  >
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-form-item></el-col
-        >
-      </el-row>
-      <el-col :span="24" class="clear">
-        <el-button
-          v-if="editType === 'add' || editType === 'edit'"
-          type="primary"
-          class="fr"
-          style="margin: 0 0 0 16px"
-          @click="submitForm(ruleFormRef)"
-          :loading="loading"
-          >保存</el-button
-        >
-        <el-button class="fr" style="margin: 0 0 0 16px" @click="closeDialog"
-          >关闭</el-button
-        >
-      </el-col>
-    </el-form>
-
-    <CompanyModal ref="companyModalRef" @choose="handleChoose" />
-  </el-dialog>
-</template>

+ 0 - 61
src/views/interest/companyAccount-origin/columns.tsx

@@ -1,61 +0,0 @@
-import { ref } from "vue";
-import dayjs from "dayjs";
-import { statusList } from "/@/utils/status";
-export function useColumns() {
-  const columns = ref([
-    {
-      type: "selection",
-      width: 40,
-      align: "center",
-      hide: ({ checkList }) => !checkList.includes("勾选列")
-    },
-    {
-      label: "序号",
-      type: "index",
-      width: 70,
-      hide: ({ checkList }) => !checkList.includes("序号列")
-    },
-    {
-      label: "真实姓名",
-      prop: "nickname"
-    },
-    {
-      label: "用户名称",
-      prop: "username"
-    },
-    {
-      label: "状态",
-      prop: "status",
-      width: 80,
-      cellRenderer: ({ row, props }) => (
-        <el-tag
-          size={props.size}
-          type={
-            (statusList.find(item => item.value == row.status + "") || {})
-              .type || "info"
-          }
-          effect="plain"
-        >
-          {(statusList.find(item => item.value == row.status + "") || {})
-            .label || "--"}
-        </el-tag>
-      )
-    },
-    {
-      label: "创建时间",
-      width: 305,
-      prop: "addtime",
-      formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
-    },
-    {
-      label: "操作",
-      fixed: "right",
-      width: 145,
-      slot: "operation"
-    }
-  ]);
-
-  return {
-    columns
-  };
-}

+ 0 - 134
src/views/interest/companyAccount-origin/components/company-modal.vue

@@ -1,134 +0,0 @@
-<script setup lang="ts">
-import { ElTable } from "element-plus";
-import { reactive, ref, unref } from "vue";
-import { useResponseHandle } from "/@/hooks/core/useAsync";
-import { httpList } from "/@/api/parameter/supplierPay";
-
-const paymentList = ref<Array<Record<string, string>>>([]);
-const selectOrder = ref<Array<Record<string, string>>>([]);
-
-const params = ref({
-  name: ""
-});
-
-const loading = ref(false);
-const visible = ref(false);
-
-const emit = defineEmits(["choose"]);
-const tableRef = ref<InstanceType<typeof ElTable>>(null);
-const responseHandle = useResponseHandle();
-
-const pagination = reactive({
-  currentPage: 1,
-  pageSize: 10,
-  total: 0
-});
-
-async function requestPaymentList() {
-  const { pageSize: size, currentPage: page } = pagination;
-  loading.value = true;
-  const { code, message, data } = await httpList({
-    ...params.value,
-    size,
-    page
-  });
-
-  responseHandle({
-    code,
-    message,
-    handler: () => {
-      pagination.total = data.count;
-      paymentList.value = data.list;
-    }
-  });
-
-  loading.value = false;
-}
-
-function handleConfirm() {
-  visible.value = false;
-  emit("choose", unref(selectOrder));
-}
-
-function handleSelectionChange(values) {
-  selectOrder.value = values;
-}
-
-function onSearch(_isReset = false) {
-  if (_isReset) {
-    params.value = {
-      name: ""
-    };
-  }
-
-  pagination.currentPage = 1;
-  requestPaymentList();
-}
-
-defineExpose({
-  onDisplay: () => {
-    visible.value = true;
-  }
-});
-</script>
-
-<template>
-  <el-dialog
-    :close-on-click-modal="false"
-    v-model="visible"
-    title="业务公司"
-    center
-    width="1040px"
-    @open="() => requestPaymentList()"
-    @close="() => (params.name = '')"
-  >
-    <div flex mb-2>
-      <div flex flex-1 gap="5" pr="20px">
-        <el-input placeholder="公司名称" size="small" v-model="params.name" />
-      </div>
-
-      <div flex width="120px">
-        <el-button size="small" type="primary" @click="() => onSearch()"
-          >搜索</el-button
-        >
-        <el-button size="small" @click="() => onSearch(true)">重置</el-button>
-      </div>
-    </div>
-
-    <el-table
-      v-loading="loading"
-      border
-      ref="tableRef"
-      :data="paymentList"
-      size="small"
-      row-key="id"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" align="center" width="40" />
-      <el-table-column label="公司编码" prop="code" show-overflow-tooltip />
-      <el-table-column label="公司名称" prop="name" show-overflow-tooltip />
-      <el-table-column label="公司类型" prop="nature" show-overflow-tooltip />
-    </el-table>
-
-    <div flex justify-between mt-2>
-      <el-pagination
-        v-model:current-page="pagination.currentPage"
-        v-model:page-size="pagination.pageSize"
-        :total="pagination.total"
-        @current-change="requestPaymentList"
-      />
-
-      <el-button type="primary" size="small" @click="handleConfirm"
-        >确定</el-button
-      >
-    </div>
-  </el-dialog>
-</template>
-
-<style lang="scss" scoped>
-:deep(.el-table__header) {
-  .el-checkbox {
-    display: none;
-  }
-}
-</style>

+ 0 - 328
src/views/interest/companyAccount-origin/index.vue

@@ -1,328 +0,0 @@
-<script setup lang="ts">
-import { watch } from "vue";
-import { useColumns } from "./columns";
-import { httpList, httpStatus } from "/@/api/system/account";
-import { reactive, ref, onMounted } from "vue";
-import { type FormInstance } from "element-plus";
-import { TableProBar } from "/@/components/ReTable";
-import { type PaginationProps } from "@pureadmin/table";
-import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import { useNav } from "/@/layout/hooks/nav";
-import { statusList } from "/@/utils/status";
-import addEdit from "./addEdit.vue";
-import resetPassword from "./resetPassword.vue";
-import { responseHandle } from "/@/utils/responseHandle";
-import { useUserStoreHook } from "/@/store/modules/user";
-import { useCompany } from "/@/hooks/core/useCompany";
-import { type menuType } from "./types";
-
-const { logout } = useNav();
-
-defineOptions({
-  name: "companyAccount"
-});
-
-const powers = ref([]);
-const form = reactive({
-  nickname: "",
-  username: "",
-  status: "",
-  page: 1,
-  size: 15
-});
-
-const dataList = ref([]);
-const loading = ref(true);
-const showModel = ref(false);
-const itemId = ref("");
-const isDetails = ref("add");
-
-const { columns } = useColumns();
-const { currentCompany } = useCompany();
-
-const sitem = reactive<menuType>({
-  id: "", //账户id
-  nickname: "", //真实姓名
-  mobile: "", //手机号
-  role: "", //角色,
-  companyArr: []
-});
-
-const passwordModelId = ref("");
-const passwordModel = ref(false);
-const formRef = ref<FormInstance>();
-const pagination = reactive<PaginationProps>({
-  total: 0,
-  pageSize: 15,
-  currentPage: 1,
-  background: true
-});
-
-//重置密码
-const resetRwd = async row => {
-  const { id } = row;
-  passwordModelId.value = id;
-  passwordModel.value = true;
-};
-
-//修改状态
-const handleStatus = async row => {
-  const { id, status } = row;
-  const { code, message } = await httpStatus({
-    id,
-    status: status + "" === "1" ? "0" : "1"
-  });
-  responseHandle({
-    code,
-    message,
-    logout,
-    handler: () => onSearch()
-  });
-};
-
-async function handleCurrentChange(val: number) {
-  form.page = val;
-  await onSearch();
-}
-
-async function handleSizeChange(val: number) {
-  form.size = val;
-  form.page = 1;
-  await onSearch();
-}
-
-function handleSelectionChange(val) {
-  console.log("handleSelectionChange", val);
-}
-
-async function onSearch() {
-  loading.value = true;
-
-  const { code, data, message } = await httpList({
-    ...form,
-    companyNo: currentCompany.value.companyNo,
-    noRela: currentCompany.value.companyNo === ""
-  });
-
-  responseHandle({
-    code,
-    message,
-    logout,
-    handler: () => {
-      const { list, count } = data;
-      dataList.value = list ?? [];
-      pagination.total = count ?? 0;
-      pagination.pageSize = form.size;
-      pagination.currentPage = form.page;
-    }
-  });
-  loading.value = false;
-}
-async function resetSearch() {
-  form.page = 1;
-  await onSearch();
-}
-//新建/编辑/详情弹窗
-function editItem(id, type, item) {
-  itemId.value = id;
-  isDetails.value = type;
-  for (let key in item) {
-    sitem[key] = item[key];
-  }
-  showModel.value = true;
-}
-const submitRefresh = () => {
-  showModel.value = false;
-  onSearch();
-};
-const submitCancel = () => {
-  showModel.value = false;
-};
-const resetCancel = () => {
-  passwordModel.value = false;
-};
-
-const resetForm = (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  formEl.resetFields();
-  form.page = 1;
-  onSearch();
-};
-
-watch(
-  () => currentCompany.value,
-  () => onSearch()
-);
-
-onMounted(() => {
-  powers.value = useUserStoreHook().getMenuActions("companyAccount");
-  onSearch();
-});
-</script>
-
-<template>
-  <div class="main">
-    <div v-show="powers.some(i => i == '001')">
-      <el-form
-        ref="formRef"
-        :inline="true"
-        :model="form"
-        size="small"
-        :label-width="0"
-        class="bg-white w-99/100 pl-8 pt-4"
-      >
-        <el-form-item prop="status">
-          <el-select
-            v-model="form.status"
-            style="width: 100%"
-            placeholder="账号状态"
-            clearable
-          >
-            <el-option
-              v-for="(si, sii) in statusList"
-              :key="'status' + si.value + sii"
-              :label="si.label"
-              :value="si.value"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item prop="nickname">
-          <el-input v-model="form.nickname" placeholder="真实姓名" clearable />
-        </el-form-item>
-        <el-form-item prop="username">
-          <el-input v-model="form.username" placeholder="手机号" clearable />
-        </el-form-item>
-        <el-form-item>
-          <el-button
-            type="primary"
-            :icon="useRenderIcon('search')"
-            :loading="loading"
-            @click="resetSearch"
-          >
-            搜索
-          </el-button>
-          <el-button
-            :icon="useRenderIcon('refresh')"
-            @click="resetForm(formRef)"
-          >
-            重置
-          </el-button>
-        </el-form-item>
-      </el-form>
-
-      <TableProBar
-        title="公司账号管理"
-        :loading="loading"
-        :dataList="dataList"
-        size="small"
-        @refresh="onSearch"
-      >
-        <template #buttons>
-          <el-button
-            type="primary"
-            size="small"
-            :icon="useRenderIcon('add')"
-            @click="editItem('', 'add', {})"
-          >
-            新增账号
-          </el-button>
-        </template>
-        <template v-slot="{ size, checkList }">
-          <PureTable
-            border
-            align="left"
-            showOverflowTooltip
-            table-layout="auto"
-            size="small"
-            :data="dataList"
-            :columns="columns"
-            :checkList="checkList"
-            :pagination="pagination"
-            :paginationSmall="size === 'small' ? true : false"
-            :header-cell-style="{ background: '#fafafa', color: '#606266' }"
-            @selection-change="handleSelectionChange"
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-          >
-            <template #operation="{ row }">
-              <el-popconfirm :title="'确认重置密码?'" @confirm="resetRwd(row)">
-                <template #reference>
-                  <el-button
-                    class="reset-margin"
-                    link
-                    type="primary"
-                    size="small"
-                    v-if="powers.some(i => i == '012')"
-                    :icon="useRenderIcon('refresh-right')"
-                  /> </template
-              ></el-popconfirm>
-              <el-button
-                class="reset-margin"
-                v-if="powers.some(i => i == '007')"
-                link
-                type="primary"
-                size="small"
-                @click="editItem(row.id, 'view', row)"
-                :icon="useRenderIcon('eye-view')"
-              />
-              <el-button
-                class="reset-margin"
-                link
-                v-if="powers.some(i => i == '005')"
-                type="primary"
-                size="small"
-                @click="editItem(row.id, 'edit', row)"
-                :icon="useRenderIcon('edits')"
-              />
-              <el-popconfirm
-                :title="
-                  String(row.status) === '1' ? '改为禁用?' : '改为启用?'
-                "
-                v-if="
-                  (powers.some(i => i == '004') && row.status + '' === '1') ||
-                  (powers.some(i => i == '003') && row.status + '' === '0')
-                "
-                @confirm="handleStatus(row)"
-              >
-                <template #reference>
-                  <el-button
-                    class="reset-margin"
-                    link
-                    type="primary"
-                    size="small"
-                    :icon="
-                      useRenderIcon(
-                        String(row.status) === '1'
-                          ? 'close-circle-line'
-                          : 'checkbox-circle-line'
-                      )
-                    " /></template
-              ></el-popconfirm>
-            </template>
-          </PureTable>
-        </template>
-      </TableProBar>
-      <addEdit
-        :itemId="itemId"
-        :isDetails="isDetails"
-        :show-model="showModel"
-        @refresh="submitRefresh"
-        @cancel="submitCancel"
-        :sitem="sitem"
-      />
-      <reset-password
-        :itemId="passwordModelId"
-        :show-model="passwordModel"
-        @refresh="resetCancel"
-        @cancel="resetCancel"
-      />
-    </div>
-    <NoAuth v-show="!powers.some(i => i == '001')" />
-  </div>
-</template>
-
-<style scoped lang="scss">
-:deep(.el-dropdown-menu__item i) {
-  margin: 0;
-}
-</style>

+ 0 - 199
src/views/interest/companyAccount-origin/resetPassword.vue

@@ -1,199 +0,0 @@
-<script setup lang="ts">
-import { httpSetPwd } from "/@/api/system/account";
-import { ElMessage, FormInstance, FormRules } from "element-plus";
-import { reactive, ref, watch, nextTick } from "vue";
-import { useNav } from "/@/layout/hooks/nav";
-import { isAlphanumeric, isnumber, validAlphabets } from "/@/utils/validate";
-const { logout } = useNav();
-const formSize = ref("default");
-const ruleFormRef = ref<FormInstance>();
-interface formType {
-  id?: string; //账户id
-  password?: string; //新密码
-  confirmPassword?: string; //确认密码
-}
-const props = defineProps({
-  itemId: {
-    type: String,
-    default: ""
-  },
-  showModel: {
-    type: Boolean,
-    default: false
-  }
-});
-const showModelThis = ref(false);
-const emit = defineEmits<{
-  (e: "cancel"): void;
-  (e: "refresh"): void;
-}>();
-const id = ref("");
-const formModel = {
-  id: "", //账户id
-  password: "", //新密码
-  confirmPassword: "" //确认密码
-};
-const ruleForm = reactive<formType>(formModel);
-const rules = reactive<FormRules>({
-  password: [
-    {
-      required: true,
-      validator: (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("新密码不能为空!"));
-        } else {
-          if (!isAlphanumeric(value)) {
-            callback(new Error("新密码为6-16位数字字母组合!"));
-          } else if (value.length < 6 || value.length > 16) {
-            callback(new Error("新密码为6-16位数字字母组合!"));
-          } else if (isnumber(value)) {
-            callback(new Error("新密码不能为纯数字!"));
-          } else if (validAlphabets(value)) {
-            callback(new Error("新密码不能为纯字母!"));
-          } else {
-            callback();
-          }
-        }
-      },
-      trigger: "blur"
-    }
-  ],
-  confirmPassword: [
-    {
-      required: true,
-      validator: (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("确认密码不能为空!"));
-        } else {
-          if (ruleForm.password !== value) {
-            callback(new Error("确认密码与新密码不一致!"));
-          } else {
-            callback();
-          }
-        }
-      },
-
-      trigger: "blur"
-    }
-  ]
-});
-const submitForm = async (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  await formEl.validate(async (valid, fields) => {
-    if (valid) {
-      if (loading.value === true) return;
-      loading.value = true;
-      let model = Object.assign({}, ruleForm);
-      model.id = id.value;
-      const { code, message } = await httpSetPwd(model);
-      loading.value = false;
-      if (code === 0) {
-        ElMessage.success("密码修改成功!");
-        showModelThis.value = false;
-        emit("refresh");
-      } else if (code > 100 && code < 140) {
-        showModelThis.value = false;
-        logout();
-      } else {
-        ElMessage.error(message);
-      }
-    } else {
-      console.log("error submit!", fields);
-    }
-  });
-};
-const resetForm = async (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  formEl.clearValidate();
-  formEl.resetFields();
-  await nextTick(async () => {
-    ruleForm.id = id.value;
-    ruleForm.password = ""; //新密码
-    ruleForm.confirmPassword = ""; //确认密码
-  });
-};
-const closeDialog = () => {
-  showModelThis.value = false;
-  emit("cancel");
-};
-
-const loading = ref(true);
-const titleType = ref("");
-async function initForm() {
-  loading.value = true;
-  titleType.value = "修改密码";
-
-  await resetForm(ruleFormRef.value);
-
-  console.log(ruleForm);
-  loading.value = false;
-}
-watch(
-  () => {
-    return props.showModel;
-  },
-  () => {
-    const { showModel, itemId } = props;
-    showModelThis.value = showModel;
-    if (showModelThis.value) {
-      id.value = itemId;
-      console.log(id.value);
-      initForm();
-    }
-  }
-);
-</script>
-
-<template>
-  <el-dialog
-    :close-on-press-escape="false"
-    :close-on-click-modal="false"
-    v-model="showModelThis"
-    append-to-body
-    :width="'900px'"
-    :title="titleType"
-    v-loading="loading"
-    @close="closeDialog"
-  >
-    <el-form
-      ref="ruleFormRef"
-      :model="ruleForm"
-      :rules="rules"
-      label-width="90px"
-      style="margin-top: -10px"
-      class="demo-ruleForm"
-      :size="formSize"
-      status-icon
-    >
-      <el-row>
-        <el-col :span="8">
-          <el-form-item label="新密码" prop="password">
-            <el-input
-              v-model="ruleForm.password"
-              placeholder="新密码"
-            /> </el-form-item
-        ></el-col>
-        <el-col :span="8">
-          <el-form-item label="确认密码" prop="confirmPassword">
-            <el-input
-              v-model="ruleForm.confirmPassword"
-              :maxlength="11"
-              placeholder="确认密码"
-            /> </el-form-item
-        ></el-col>
-      </el-row>
-      <el-col :span="24" class="clear">
-        <el-button
-          type="primary"
-          class="fr"
-          style="margin: 0 0 0 16px"
-          @click="submitForm(ruleFormRef)"
-          >保存</el-button
-        >
-        <el-button class="fr" style="margin: 0 0 0 16px" @click="closeDialog"
-          >关闭</el-button
-        >
-      </el-col>
-    </el-form>
-  </el-dialog>
-</template>

+ 0 - 8
src/views/interest/companyAccount-origin/types.ts

@@ -1,8 +0,0 @@
-export interface menuType {
-  id?: string; //账户id
-  nickname?: string; //真实姓名
-  mobile?: string; //手机号
-  email?: string; //邮箱
-  role?: string; //角色
-  companyArr?: any;
-}

+ 31 - 105
src/views/interest/dataShare/components/share-modal.vue

@@ -154,9 +154,9 @@ function handleConfirm() {
 defineExpose({
   onDisplay(_id = "", _readonly = false) {
     visible.value = true;
-    userlistRun(httpUserList());
-    menulistRun(httpMenuList());
-    grouplistRun(httpUserGroup());
+    userlistRun(httpUserList({size: 100}));
+    menulistRun(httpMenuList({size: 100}));
+    grouplistRun(httpUserGroup({size:100}));
     readonly.value = _readonly;
     id.value = _id;
 
@@ -168,121 +168,51 @@ defineExpose({
 </script>
 
 <template>
-  <el-dialog
-    :close-on-click-modal="false"
-    v-model="visible"
-    :title="title"
-    center
-    @close="() => (formData = { ...initalData })"
-  >
-    <el-form
-      label-width="120px"
-      ref="formRef"
-      :model="formData"
-      :disabled="readonly"
-      v-loading="initalLoading"
-      :rules="rules"
-    >
+  <el-dialog :close-on-click-modal="false" v-model="visible" :title="title" center
+    @close="() => (formData = { ...initalData })">
+    <el-form label-width="120px" ref="formRef" :model="formData" :disabled="readonly" v-loading="initalLoading"
+      :rules="rules">
       <el-form-item prop="menu_ids" label="共享的菜单数据">
         <el-select w-full v-model="formData.menu_ids" multiple>
-          <el-option
-            v-for="menu in menulist"
-            :key="menu.id"
-            :value="menu.id"
-            :label="menu.menu_name"
-          />
+          <el-option-group v-for="menu in menulist" :key="menu.id" :label="menu.menu_name">
+            <el-option v-for="(item, i) in menu.child" :key="'item' + item.menu_name + i" :label="item.menu_name"
+              :value="item.id" />
+          </el-option-group>
         </el-select>
       </el-form-item>
 
-      <el-form-item
-        label="数据源共享对象"
-        :prop="
-          shareTypes.source === '1' ? 'source_uid' : 'source_data_group_id'
-        "
-      >
-        <el-select
-          w-100px
-          v-model="shareTypes.source"
-          @change="
-            val =>
-              val === '1'
-                ? (formData.source_data_group_id = '')
-                : (formData.source_uid = '')
-          "
-        >
+      <el-form-item label="数据源共享对象" :prop="shareTypes.source === '1' ? 'source_uid' : 'source_data_group_id'
+    ">
+        <el-select w-100px v-model="shareTypes.source" @change="val =>
+      val === '1'
+        ? (formData.source_data_group_id = '')
+        : (formData.source_uid = '')
+    ">
           <el-option value="1" label="用户" />
           <el-option value="2" label="用户组" />
         </el-select>
-        <el-select
-          flex-1
-          placeholder="请选择用户"
-          v-if="shareTypes.source === '1'"
-          v-model="formData.source_uid"
-        >
-          <el-option
-            v-for="user in userlist"
-            :key="user.id"
-            :value="user.id"
-            :label="user.nickname"
-          />
+        <el-select flex-1 placeholder="请选择用户" v-if="shareTypes.source === '1'" v-model="formData.source_uid">
+          <el-option v-for="user in userlist" :key="user.id" :value="user.id" :label="user.nickname" />
         </el-select>
-        <el-select
-          flex-1
-          placeholder="请选择用户组"
-          v-else
-          v-model="formData.source_data_group_id"
-        >
-          <el-option
-            v-for="group in grouplist"
-            :key="group.id"
-            :value="group.id"
-            :label="group.title"
-          />
+        <el-select flex-1 placeholder="请选择用户组" v-else v-model="formData.source_data_group_id">
+          <el-option v-for="group in grouplist" :key="group.id" :value="group.id" :label="group.title" />
         </el-select>
       </el-form-item>
 
       <el-divider />
 
-      <el-form-item
-        label="数据共享对象"
-        :prop="shareTypes.target === '1' ? 'uid' : 'data_group_id'"
-      >
-        <el-select
-          w-100px
-          v-model="shareTypes.target"
-          @change="
-            val =>
-              val === '1' ? (formData.source_uid = '') : (formData.uid = '')
-          "
-        >
+      <el-form-item label="数据共享对象" :prop="shareTypes.target === '1' ? 'uid' : 'data_group_id'">
+        <el-select w-100px v-model="shareTypes.target" @change="val =>
+      val === '1' ? (formData.source_uid = '') : (formData.uid = '')
+    ">
           <el-option value="1" label="用户" />
           <el-option value="2" label="用户组" />
         </el-select>
-        <el-select
-          flex-1
-          placeholder="请选择用户"
-          v-if="shareTypes.target === '1'"
-          v-model="formData.uid"
-        >
-          <el-option
-            v-for="user in userlist"
-            :key="user.id"
-            :value="user.id"
-            :label="user.nickname"
-          />
+        <el-select flex-1 placeholder="请选择用户" v-if="shareTypes.target === '1'" v-model="formData.uid">
+          <el-option v-for="user in userlist" :key="user.id" :value="user.id" :label="user.nickname" />
         </el-select>
-        <el-select
-          flex-1
-          placeholder="请选择用户组"
-          v-else
-          v-model="formData.data_group_id"
-        >
-          <el-option
-            v-for="group in grouplist"
-            :key="group.id"
-            :value="group.id"
-            :label="group.title"
-          />
+        <el-select flex-1 placeholder="请选择用户组" v-else v-model="formData.data_group_id">
+          <el-option v-for="group in grouplist" :key="group.id" :value="group.id" :label="group.title" />
         </el-select>
       </el-form-item>
 
@@ -295,11 +225,7 @@ defineExpose({
 
       <el-form-item>
         <div w-full flex justify-end>
-          <el-button
-            type="primary"
-            @click="() => handleConfirm()"
-            :loading="actionLoading"
-            >提交
+          <el-button type="primary" @click="() => handleConfirm()" :loading="actionLoading">提交
           </el-button>
           <el-button @click="() => (visible = false)">取消</el-button>
         </div>

+ 1 - 1
src/views/interest/group/config/content.config.ts

@@ -75,7 +75,7 @@ const columns = [
 
 const contentConfig: ContentConfig = {
   title: "用户组",
-  powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
+  // powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
   isRequesetArray: true,
   columns,
   apis: {

+ 4 - 1
src/views/interest/group/index.vue

@@ -12,10 +12,12 @@ defineOptions({ name: "group" });
 const groupModalRef = ref<InstanceType<typeof GroupModal>>(null);
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
 
+const permissions = ref([])
+
 const { permission, contentConfigRef } = usePermission({
   contentConfig,
   pageName: "group",
-  callback: powers => (contentConfig.powers = powers)
+  callback: p => permissions.value = p 
 });
 
 </script>
@@ -31,6 +33,7 @@ const { permission, contentConfigRef } = usePermission({
         />
         <PageContent
           ref="pageContentRef"
+          :powers="permissions"
           :content-config="contentConfigRef"
           @create-btn-click="() => groupModalRef.onDisplay()"
           @update-btn-click="({ id }) => groupModalRef.onDisplay(id)"

+ 48 - 0
src/views/interest/handover/config/content.config.ts

@@ -0,0 +1,48 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/interest/handover";
+
+import { statusOptions } from "./options"
+
+const columns = [
+  {
+    prop: "resign_name",
+    label: "离职人",
+  },
+  {
+    prop: "hand_name",
+    label: "接收人",
+  },
+  {
+    prop: "status",
+    label: "状态",
+    cellRenderer({row}){
+      return (statusOptions.find((i) => i.value == row.status) || {}).label ||'--'
+    }
+  },
+  {
+    prop: "expire_date",
+    label: "生效时间",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 50,
+    slot: "operation",
+  },
+];
+
+const contentConfig: ContentConfig = {
+  title: "离职交接",
+  columns,
+  companyProp:'custom',
+  apis: {
+    httpList,
+    httpAdd: true
+  }
+};
+
+export default contentConfig;

+ 7 - 0
src/views/interest/handover/config/options.ts

@@ -0,0 +1,7 @@
+export const statusOptions = [
+  { value: "0", label: "待发起审核流程" },
+  { value: "1", label: "待离职交接审核" },
+  { value: "2", label: "审核不通过" },
+  { value: "3", label: "待系统更新数据" },
+  { value: "4", label: "离职交接已成功" },
+]

+ 36 - 0
src/views/interest/handover/config/search.config.ts

@@ -0,0 +1,36 @@
+import { statusOptions } from "./options";
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      type: "select",
+      field: "status",
+      placeholder: "审核状态",
+      options: statusOptions
+    },
+    {
+      type: "input",
+      field: "supplierName",
+      placeholder: "离职人姓名"
+    },
+    {
+      type: "input",
+      field: "supplierName_js",
+      placeholder: "接受人姓名"
+    },
+    {
+      field: "addtime",
+      type: "date_picker",
+      otherOptions: {
+        type: "daterange",
+        startProp: "start",
+        endProp: "end",
+        startPlaceholder: "创建开始时间",
+        endPlaceholder: "创建结束时间"
+      }
+    },
+  ]
+};
+
+export default searchFormConfig;

+ 98 - 0
src/views/interest/handover/detail.vue

@@ -0,0 +1,98 @@
+<script setup lang="ts">
+import { ref, onMounted } from "vue";
+import { useDetail } from "/@/hooks/core/useDetail";
+import { useAsync } from "/@/hooks/core/useAsync";
+import { useRouter } from "vue-router";
+import { useUserInfo } from "/@/hooks/core/useUser";
+import { usePermission } from "/@/hooks/core/usePermission";
+import { httpDetail, httpUpdate } from "/@/api/interest/handover";
+import { ElMessage, ElMessageBox } from "element-plus"
+
+import {
+  DefaultApprovalNode,
+} from "/@/components/ApprovalNode";
+
+import Form from "./form.vue"
+
+const pageName = "purchPayReliveDetail";
+const { hasPermissionWithCode } = usePermission(pageName);
+
+const { push } = useRouter();
+
+const { isSuperUser } = useUserInfo();
+
+const { id, isDetail, title, collapses } = useDetail({
+  baseName: "离职交接",
+  collapseLen: 5
+});
+
+const initialData = {
+  expire_date: '',
+  hand_uid: '',
+  resign_date: '',
+  resign_uid: ''
+}
+
+const { run: detail, data } = useAsync<Record<string, string>>({
+  initalData: initialData,
+  success: () => {
+    const { resign_date } = data.value
+    const chunks = resign_date.split(' ')
+    if (chunks.length === 1) data.value.resign_date += ' 00:00:00'
+  }
+});
+
+const { run: update, loading: loadUpdated } = useAsync({
+  success: () => {
+    ElMessage.success('编辑成功')
+    requestDetail()
+  }
+});
+
+const { run: approval } = useAsync({
+  success: () => requestDetail()
+});
+
+const requestDetail = () => detail(httpDetail({ id: id.value }));
+
+function onSubmit() {
+  const { expire_date, hand_uid, resign_uid, resign_date, id, companyNo } = data.value
+  update(httpUpdate({ expire_date, hand_uid, resign_uid, resign_date, id, companyNo }))
+}
+
+function handleApproval(status:string, message: string){
+  ElMessageBox.confirm(`确定要${message}?`, {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+   type: "warning",
+  }).then(() => {
+    console.log(status, message)
+  })
+}
+
+onMounted(requestDetail)
+</script>
+
+<template>
+  <div class="padding__container">
+    <ElTabs>
+      <ElTabPane :label="title">
+        <ElCollapse v-model="collapses">
+          <ElCollapseItem title="离职交接详情" name="1" v-loading="loadUpdated">
+            <Form v-model:data="data" :companyNo="data.companyNo" @submit="onSubmit" />
+          </ElCollapseItem>
+
+          <!-- TODO:流程权限 -->
+          <ElCollapseItem title="发起审核流程" name="2" v-if="data.status === '0'">
+            <ElButton class="fr mb-[10px]" size="small" type="primary" @click="handleApproval('1', '发起审核流程')">发起审核流程</ElButton>
+          </ElCollapseItem>
+
+          <!-- v-if="data.status === '1' -->
+          <ElCollapseItem title="离职交接审核" name="3">
+            <DefaultApprovalNode approve-value="3"  reject-value="2" />
+          </ElCollapseItem>
+        </ElCollapse>
+      </ElTabPane>
+    </ElTabs>
+  </div>
+</template>

+ 111 - 0
src/views/interest/handover/form.vue

@@ -0,0 +1,111 @@
+<script setup lang="ts">
+import { ref, watch } from "vue"
+import { useVModel } from "@vueuse/core"
+import { httpUsers } from "/@/api/interest/handover";
+import { ElForm } from "element-plus"
+
+const formRef = ref<InstanceType<typeof ElForm>>(null)
+
+const emit = defineEmits(['submit'])
+
+const props = withDefaults(
+  defineProps<{ data: any, modal?: boolean, companyNo: string }>(),
+  { modal: false }
+)
+
+const data = useVModel(props, 'data')
+const users = ref<any[]>([])
+
+async function requestUsers() {
+  const { data } = await httpUsers({ size: 100, companyNo: props.companyNo })
+  users.value = data.list
+}
+
+const rules = {
+  resign_uid: [
+    {
+      required: true,
+      message: "请选择离职人",
+      trigger: "change",
+    },
+  ],
+  hand_uid: [
+    {
+      required: true,
+      message: "请选择接受人",
+      trigger: "change",
+    },
+  ],
+  resign_date: [
+    {
+      required: true,
+      message: "请选择离职时间",
+      trigger: "blur",
+    },
+  ],
+  expire_date: [
+    {
+      required: true,
+      message: "请选择生效时间",
+      trigger: "blur",
+    },
+  ],
+}
+
+
+watch(() => props.companyNo, () => {
+  // if (!props.companyNo) return
+  requestUsers()
+}, {
+  immediate: true
+})
+
+async function onSubmit(){
+  try {
+    await formRef.value.validate();
+    emit("submit");
+  } catch (err) {
+    console.log(err);
+  }
+}
+</script>
+
+<template>
+  <ElForm label-width="80px" :model="data" :rules="rules" ref="formRef" size="small">
+    <ElRow>
+      <ElCol :span="modal ? 24 : 12">
+        <ElFormItem label="离职人" prop="resign_uid">
+          <ElSelect v-model="data.resign_uid" style="width:100%" placeholder="离职人">
+            <ElOption v-for="({ id, nickname }) in users" :key="id" :label="nickname" :value="id" />
+          </ElSelect>
+        </ElFormItem>
+      </ElCol>
+      <ElCol :span="modal ? 24 : 12">
+        <ElFormItem label="接受人" prop="hand_uid">
+          <ElSelect v-model="data.hand_uid" style="width:100%" placeholder="接收人">
+            <ElOption v-for="({ id, nickname }) in users" :key="id" :label="nickname" :value="id" />
+          </ElSelect>
+        </ElFormItem>
+      </ElCol>
+      <ElCol :span="modal ? 24 : 12">
+        <ElFormItem label="离职日期" prop="resign_date">
+          <ElDatePicker v-model="data.resign_date" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" style="width:100%" placeholder="离职日期" />
+        </ElFormItem>
+      </ElCol>
+      <ElCol :span="modal ? 24 : 12">
+        <ElFormItem label="生效日期" prop="expire_date">
+          <ElDatePicker v-model="data.expire_date" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" style="width:100%" placeholder="生效日期" />
+        </ElFormItem>
+      </ElCol>
+      <ElCol :span="modal ? 24 : 12">
+        <ElFormItem label="审核备注" prop="remark">
+          <ElInput v-model="data.remark" type="textarea" style="width:100%" placeholder="审核备注" />
+        </ElFormItem>
+      </ElCol>
+    </ElRow>
+
+    <div class="w-full flex justify-end">
+      <ElButton type="primary" @click="onSubmit">保存</ElButton>
+    </div>
+  </ElForm>
+</template>

+ 50 - 0
src/views/interest/handover/index.vue

@@ -0,0 +1,50 @@
+<script setup lang="ts">
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { useCompany } from "/@/hooks/core/useCompany";
+import { ElMessage } from "element-plus";
+import { shallowRef, ref } from "vue"
+import Modal from "./modal.vue"
+
+
+import { useRouter } from "vue-router"
+
+const PageName = "handover";
+const pageContentRef = ref<any>(null);
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+const visible = shallowRef(false)
+const { currentCompany } = useCompany();
+
+const { push } = useRouter()
+
+const events: PageEvents = {
+  content: {
+    create: () => {
+      if(!currentCompany.value.companyNo) {
+        ElMessage.warning('请选择一家业务公司')
+        return
+      }
+      visible.value = true
+    },
+    preview: (row) => push(`/interest/handoverDetail?id=${row.id}`)
+  },
+};
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer
+      :hooks="hooks"
+      :events="events"
+      :contentConfig="contentConfig"
+      :search-config="searchConfig"
+      :get-content-ref="ref => pageContentRef = ref"
+    />
+    <Modal v-model:visible="visible" :companyNo="currentCompany.companyNo" @refresh="pageContentRef?.onSearch()" />
+  </PageAuth>
+</template>

+ 54 - 0
src/views/interest/handover/modal.vue

@@ -0,0 +1,54 @@
+<script setup lang="ts">
+import { ref} from "vue";
+import Form from "./form.vue";
+import { useVModel } from "@vueuse/core";
+import { httpCreate } from "/@/api/interest/handover";
+import { ElMessage } from "element-plus";
+
+const props = defineProps<{ visible: boolean, companyNo: string }>()
+const emit = defineEmits(['refresh'])
+
+
+const loading = ref(false)
+const visible = useVModel(props, 'visible')
+
+const initialData = {
+  expire_date: '',
+  hand_uid: '',
+  resign_date: '',
+  resign_uid: ''
+}
+
+const data = ref<Record<string, string>>({...initialData});
+
+function handleClose(){
+  visible.value = false
+  data.value = {...initialData}
+}
+
+async function onSubmit(){
+  loading.value = true
+  const result = await httpCreate({  ...data.value, companyNo: props.companyNo})
+  loading.value = false
+  if(result.code === 0){ ElMessage.success('添加成功') } else { ElMessage.warning('添加失败')}
+  visible.value = false
+  emit('refresh')
+}
+</script>
+
+<template>
+  <ElDialog
+    v-model="visible"
+    title="添加离职交接"
+    :close-on-click-modal="false"
+    @close="handleClose"
+    center
+  >
+    <Form 
+      v-model:data="data" 
+      :companyNo="companyNo" 
+      @submit="onSubmit" 
+      :modal="true" 
+    />
+  </ElDialog>
+</template>

+ 83 - 0
src/views/interest/organize/cpns/modal.vue

@@ -0,0 +1,83 @@
+<script setup lang="ts">
+import { httpBusinesslist } from "/@/api/interest/organize";
+import { useVModel } from "@vueuse/core"
+import { computed, onMounted, ref } from "vue";
+
+import Modal from "./modal.vue"
+
+const initialData = {
+  companyNo: '',
+  name: '',
+  pid: '',
+  id: ''
+}
+
+const emit = defineEmits(['submit'])
+const props = withDefaults(
+  defineProps<{ data: any; visible: boolean; disabledBusiness:boolean }>(),
+  { data: {  companyNo: '',name: '', pid: '', id: '' } }
+)
+
+const business = ref<any[]>([])
+const title = computed(() => data.value.id ? '编辑组织' : '添加组织')
+const visible = useVModel(props, 'visible')
+const data = useVModel(props, 'data')
+
+const formRef = ref<any | null>(null)
+
+
+const rules = {
+  companyNo: [ { required: true,message: '请选择业务公司', trigger: 'change' }],
+  name: [
+    { required: true,message: '请输入组织名称',trigger: 'blur' },
+    { min: 1,max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
+  ]
+}
+
+async function requestBusiness(){
+  const res = await httpBusinesslist({ size:100 })
+  business.value = res.code === 0 ? res.data.list : []
+}
+
+function handleClose(){
+  data.value = {...initialData}
+  visible.value = false
+}
+
+async function onSubmit(){
+  try {
+    await formRef.value.validate();
+    emit("submit");
+  } catch (err) {
+    console.log(err);
+  }
+}
+
+onMounted(requestBusiness)
+</script>
+
+
+<template>
+  <ElDialog v-model="visible" :title="title" center @close="handleClose">
+    <ElForm :model="data" :rules="rules" size="small" ref="formRef">
+      <ElFormItem label="业务公司" prop="companyNo">
+        <ElSelect v-model="data.companyNo" style="width:100%" placeholder="业务公司" :disabled="disabledBusiness">
+          <ElOption 
+            v-for="item in business" 
+            :label="item.company" 
+            :value="item.companyNo" 
+            :key="item.companyNo" 
+          />
+        </ElSelect>
+      </ElFormItem>
+
+      <ElFormItem label="组织名称" prop="name">
+        <ElInput v-model="data.name" style="width:100%" placeholder="组织名称" />
+      </ElFormItem>
+
+      <div class="w-full flex justify-end">
+        <ElButton type="primary" @click="onSubmit">保存</ElButton>
+      </div>
+    </ElForm>
+  </ElDialog>
+</template>

+ 129 - 0
src/views/interest/organize/cpns/organize-tree.vue

@@ -0,0 +1,129 @@
+<script setup lang="ts">
+import { ref, shallowRef } from "vue";
+import { useAsync } from "/@/hooks/core/useAsync";
+import { httpList, httpDelete , httpUpdate } from "/@/api/interest/organize";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { ElMessageBox, ElMessage } from "element-plus"
+
+import Modal from "./modal.vue"
+
+
+const emit = defineEmits(["breadcrumbChange"]);
+const props = defineProps<{
+  otherParms: Record<string, string>;
+}>();
+
+const visible = shallowRef(false)
+const pid = ref("");
+
+
+const dataSource = ref<any>({})
+const { data, run, loading, isError } = useAsync<any>({
+  initalData: {}
+});
+
+function toNextNode(depart: any) {
+  pid.value = depart.id;
+  requesetOrganizelist();
+  emit("breadcrumbChange", depart);
+}
+
+function requesetOrganizelist() {
+  const params = { ...(pid.value ? { pid: pid.value } : {}), ...props.otherParms };
+  run(httpList(params));
+}
+
+function initalData() {
+  requesetOrganizelist();
+}
+
+
+function onDelete(id: string ) {
+  ElMessageBox.confirm('确定要删除?', {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(async () => {
+    const model = {id}
+    const res = await httpDelete(model)
+    if(res.code === 0){
+      ElMessage.success('删除成功')
+      requesetOrganizelist()
+    }else {
+      ElMessage.warning('删除失败')
+    }
+  })
+}
+
+function onEdit(row){
+  dataSource.value = row
+  visible.value = true
+}
+
+async function handleSubmit(){
+  const { name, id, companyNo } = dataSource.value
+  const model = {name, id, companyNo ,pid: pid.value}
+  const res = await httpUpdate(model)
+
+  if(res.code === 0){
+    visible.value = false
+    ElMessage.success('更新成功')
+    requesetOrganizelist()
+  }else{
+    ElMessage.warning('更新成功')
+  }
+}
+
+initalData();
+
+defineExpose({
+  changePid: (id: string) => (pid.value = id),
+  onSearch: () => requesetOrganizelist()
+});
+</script>
+
+<template>
+  <ul class="mt-[10px]" v-loading="loading" v-if="data.depart && data.item && !isError">
+    <ElTable :data="data.depart" border size="small">
+      <ElTableColumn label="组织名称" prop="name" />
+      <ElTableColumn label="公司编码" prop="companyNo" />
+      <ElTableColumn label="公司名称" prop="companyName" />
+      <ElTableColumn label="操作" width="140px">
+        <template #="{ row }">
+          <el-tooltip effect="dark" content="编辑组织" placement="top">
+            <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('edits')"
+              @click="onEdit(row)" />
+          </el-tooltip>
+
+          <el-tooltip effect="dark" content="删除组织" placement="top">
+            <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('delete')"
+              @click="onDelete(row.id)" />
+          </el-tooltip>
+
+          <el-tooltip effect="dark" content="下一级" placement="top">
+            <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('arrow-right-s-line')"
+              @click="toNextNode(row)" />
+          </el-tooltip>
+        </template>
+      </ElTableColumn>
+    </ElTable>
+
+    <li class="leading-[40px] flex gap-1 select-none cursor-pointer flex justify-between items-center"
+      v-for="item in data.item" :type="item.position + '' === '1' ? 'primary' : 'info'" :key="item.id">
+      <p>{{ item.nickname }}</p>
+
+      <ElButton>设为负责人</ElButton>
+    </li>
+
+    <Modal 
+      v-model:data="dataSource" 
+      v-model:visible="visible" 
+      :disabledBusiness="true" 
+      @submit="handleSubmit" 
+      />
+  </ul>
+
+  <div class="w-full leading-[198px] text-center border-[#ccc] border rounded-sm mt-2 color-[#ccc] font-bold" v-else>
+    暂无数据
+  </div>
+</template>

+ 122 - 0
src/views/interest/organize/index.vue

@@ -0,0 +1,122 @@
+<script setup lang="ts">
+import { ref , shallowRef, watch} from "vue";
+import { httpCreate } from "/@/api/interest/organize";
+import OrganizeTree from "./cpns/organize-tree.vue";
+import Modal from "./cpns/modal.vue"
+
+// TODO:权限
+import { ElMessage } from "element-plus"
+const pageName = "organize";
+const breadcrumb = ref<any[]>([]);
+const visible = shallowRef(false)
+const data = ref<any>({})
+const disabledBusiness = shallowRef(false)
+const params = ref<Record<string, string>>({ name: "", nickname: "" });
+
+const organizeTreeRef = ref<InstanceType<typeof OrganizeTree> | null>(null);
+
+function handleBreadcrumbChange(depart: any) {
+  breadcrumb.value.push(depart);
+}
+
+function handleOrganizeTreeSearch(index?: number) {
+  if (index === breadcrumb.value.length - 1) return;
+  const item = breadcrumb.value[index];
+  const id = item ? item.id : "";
+  organizeTreeRef.value.changePid(id);
+  organizeTreeRef.value.onSearch();
+  breadcrumb.value.splice(index + 1);
+}
+
+async function handleSubmit(){
+  const { companyNo, name, pid = 0} = data.value
+  const res = await httpCreate({ companyNo, name, pid })
+
+  if(res.code === 0) {
+    visible.value = false
+    ElMessage.success('添加成功')
+    organizeTreeRef.value.onSearch();
+  } else {
+    ElMessage.warning('添加失败')
+  }
+}
+
+watch(() => breadcrumb.value,() => {
+  disabledBusiness.value = breadcrumb.value.length !== 0
+  const business = breadcrumb.value[breadcrumb.value.length - 1]
+  data.value.companyNo = business ? business.companyNo : ''
+  data.value.pid = business ? business.id : '0'
+},{
+  immediate: true,
+  deep: true
+})
+</script>
+
+<template>
+  <PageAuth
+    class="px-[10px] h-[calc(100vh-60px)] bg-white"
+    :pageName="pageName"
+    :margin="false"
+  >
+    <!-- 面包屑 -->
+    <ul class="flex cursor-pointer" v-if="breadcrumb.length > 0">
+      <li @click="() => handleOrganizeTreeSearch()">
+        全部分类
+        <span class="mx-[5px]">/</span>
+      </li>
+
+      <li
+        :class="{
+          'cursor-pointer': true,
+          'text-[#ccc]': index === breadcrumb.length - 1
+        }"
+        v-for="(item, index) in breadcrumb"
+        :key="item.id"
+        @click="() => handleOrganizeTreeSearch(index)"
+      >
+        {{ item.name }}
+        <span class="mx-[5px]" v-if="index !== breadcrumb.length - 1">/</span>
+      </li>
+    </ul>
+
+    <div class="flex justify-between pt-[20px]">
+      <div class="flex gap-1">
+        <ElInput
+          v-model="params.name"
+          placeholder="部门名称"
+          clearable
+          size="small"
+          @change="() => organizeTreeRef.onSearch()"
+        />
+        <ElInput
+          v-model="params.nickname"
+          placeholder="员工名称"
+          clearable
+          size="small"
+          @change="() => organizeTreeRef.onSearch()"
+        />
+      </div>
+
+      <div class="flex">
+        <ElButton size="small" type="primary" @click="visible = true">添加</ElButton>
+        <ElButton size="small" @click="() => organizeTreeRef.onSearch()">刷新</ElButton>
+      </div>
+    </div>
+
+    <!-- 树节点 -->
+    <div class="flex-1">
+      <OrganizeTree
+        ref="organizeTreeRef"
+        :otherParms="params"
+        @breadcrumb-change="handleBreadcrumbChange"
+      />
+    </div>
+
+    <Modal 
+      v-model:data="data" 
+      v-model:visible="visible" 
+      :disabledBusiness="disabledBusiness" 
+      @submit="handleSubmit" 
+      />
+  </PageAuth>
+</template>

+ 1 - 2
src/views/interest/processPermission/components/process-list.vue

@@ -1,8 +1,7 @@
 <script setup lang="ts">
 import { ref, unref, watchEffect, onMounted } from "vue";
-import { useAsync } from "/@/hooks";
-import { MOCK_PROCESS_DATA } from "../config/mock";
 import { httpAllList, httpInfo } from "/@/api/interest/processPermission";
+import { useAsync } from "/@/hooks";
 
 const props = defineProps<{
   currentRole: Record<string, string>;

+ 0 - 2
src/views/interest/processPermission/components/role-list.vue

@@ -26,8 +26,6 @@ async function requesetRoleList() {
   });
 }
 
-// onMounted(() => requesetRoleList());
-
 watch(() => props.companyNo, () => {
   if (!props.companyNo) return
   requesetRoleList()

+ 0 - 487
src/views/interest/processPermission/config/mock.ts

@@ -1,487 +0,0 @@
-export const MOCK_PROCESS_DATA = [
-  { id: "9", process_name: "采购工差单流程", process_type: "CGGCD" },
-  {
-    id: "2",
-    process_name: "采购单入库流程",
-    process_type: "RKD",
-    child: [
-      { id: "76", process_id: "2", order_process: "0", status_name: "待发货" },
-      {
-        id: "77",
-        process_id: "2",
-        order_process: "1",
-        status_name: "待库管验货"
-      },
-      {
-        id: "78",
-        process_id: "2",
-        order_process: "2",
-        status_name: "待仓库主管审核"
-      },
-      {
-        id: "79",
-        process_id: "2",
-        order_process: "3",
-        status_name: "待采购主管审核"
-      },
-      {
-        id: "81",
-        process_id: "2",
-        order_process: "5",
-        status_name: "待填写物流"
-      }
-    ]
-  },
-  {
-    id: "1",
-    process_name: "采购单流程",
-    process_type: "CGD",
-    child: [
-      {
-        id: "71",
-        process_id: "1",
-        order_process: "0",
-        status_name: "待与供应商确认"
-      }
-    ]
-  },
-  {
-    id: "20",
-    process_name: "有赞订单审核流程",
-    process_type: "YZQRD",
-    child: [
-      {
-        id: "111",
-        process_id: "20",
-        order_process: "2",
-        status_name: "待产品审核"
-      },
-      {
-        id: "113",
-        process_id: "20",
-        order_process: "4",
-        status_name: "待财务审核"
-      }
-    ]
-  },
-  {
-    id: "19",
-    process_name: "有赞商品上架流程",
-    process_type: "YZSX",
-    child: [
-      {
-        id: "108",
-        process_id: "19",
-        order_process: "0",
-        status_name: "待产品审核"
-      }
-    ]
-  },
-  {
-    id: "24",
-    process_name: "竞价单流程",
-    process_type: "ZXD",
-    child: [
-      {
-        id: "138",
-        process_id: "24",
-        order_process: "2",
-        status_name: "招标已结束"
-      },
-      {
-        id: "139",
-        process_id: "24",
-        order_process: "3",
-        status_name: "待选择商品"
-      },
-      {
-        id: "140",
-        process_id: "24",
-        order_process: "4",
-        status_name: "已选商品待下单"
-      },
-      {
-        id: "143",
-        process_id: "24",
-        order_process: "7",
-        status_name: "招标已暂停"
-      }
-    ]
-  },
-  {
-    id: "14",
-    process_name: "项目单流程",
-    process_type: "PRO",
-    child: [
-      {
-        id: "18",
-        process_id: "14",
-        order_process: "1",
-        status_name: "待商品反馈"
-      },
-      {
-        id: "20",
-        process_id: "14",
-        order_process: "3",
-        status_name: "待方案制定"
-      },
-      {
-        id: "22",
-        process_id: "14",
-        order_process: "5",
-        status_name: "项目待下单"
-      }
-    ]
-  },
-  {
-    id: "13",
-    process_name: "议价单流程",
-    process_type: "YJD",
-    child: [
-      {
-        id: "24",
-        process_id: "13",
-        order_process: "0",
-        status_name: "待业务审核"
-      },
-      {
-        id: "26",
-        process_id: "13",
-        order_process: "2",
-        status_name: "待财务专员审核"
-      },
-      {
-        id: "28",
-        process_id: "13",
-        order_process: "4",
-        status_name: "待财务主管审核"
-      },
-      {
-        id: "31",
-        process_id: "13",
-        order_process: "7",
-        status_name: "待boss审核"
-      }
-    ]
-  },
-  {
-    id: "10",
-    process_name: "销售工差单流程",
-    process_type: "XSGCD",
-    child: [
-      {
-        id: "40",
-        process_id: "10",
-        order_process: "1",
-        status_name: "待业务审核"
-      }
-    ]
-  },
-  {
-    id: "8",
-    process_name: "销售退货单流程",
-    process_type: "XSTHD",
-    child: [
-      {
-        id: "64",
-        process_id: "8",
-        order_process: "1",
-        status_name: "待业务审核"
-      },
-      {
-        id: "65",
-        process_id: "8",
-        order_process: "2",
-        status_name: "待专员审核"
-      },
-      {
-        id: "66",
-        process_id: "8",
-        order_process: "3",
-        status_name: "待主管审核"
-      }
-    ]
-  },
-  {
-    id: "7",
-    process_name: "售后退货单流程",
-    process_type: "CKTHD",
-    child: [
-      {
-        id: "60",
-        process_id: "7",
-        order_process: "1",
-        status_name: "退货商品验收"
-      },
-      {
-        id: "61",
-        process_id: "7",
-        order_process: "2",
-        status_name: "退货验收审核"
-      },
-      {
-        id: "62",
-        process_id: "7",
-        order_process: "3",
-        status_name: "退货业务审核"
-      }
-    ]
-  },
-  {
-    id: "6",
-    process_name: "售后申请单流程",
-    process_type: "SHD",
-    child: [
-      {
-        id: "51",
-        process_id: "6",
-        order_process: "1",
-        status_name: "待业务审核"
-      },
-      {
-        id: "52",
-        process_id: "6",
-        order_process: "2",
-        status_name: "待采购审核"
-      },
-      {
-        id: "53",
-        process_id: "6",
-        order_process: "3",
-        status_name: "待设置仓库"
-      },
-      {
-        id: "54",
-        process_id: "6",
-        order_process: "4",
-        status_name: "待客户退货"
-      }
-    ]
-  },
-  {
-    id: "5",
-    process_name: "发货申请单流程",
-    process_type: "CKD",
-    child: [
-      {
-        id: "47",
-        process_id: "5",
-        order_process: "1",
-        status_name: "待库管发货"
-      },
-      {
-        id: "48",
-        process_id: "5",
-        order_process: "2",
-        status_name: "已发货待收货"
-      }
-    ]
-  },
-  { id: "4", process_name: "销售订单流程", process_type: "XSQRD" },
-  {
-    id: "3",
-    process_name: "备货申请单流程",
-    process_type: "BHD",
-    child: [
-      {
-        id: "36",
-        process_id: "3",
-        order_process: "1",
-        status_name: "待采购反馈"
-      }
-    ]
-  },
-  {
-    id: "22",
-    process_name: "离职交接流程",
-    process_type: "LZJJ",
-    child: [
-      {
-        id: "131",
-        process_id: "22",
-        order_process: "0",
-        status_name: "发起审核流程"
-      },
-      {
-        id: "132",
-        process_id: "22",
-        order_process: "1",
-        status_name: "待离职交接审核"
-      }
-    ]
-  },
-  {
-    id: "17",
-    process_name: "活动流程",
-    process_type: "HD",
-    child: [
-      {
-        id: "94",
-        process_id: "17",
-        order_process: "0",
-        status_name: "待产品部审核"
-      },
-      {
-        id: "95",
-        process_id: "17",
-        order_process: "1",
-        status_name: "待采购定价"
-      },
-      {
-        id: "96",
-        process_id: "17",
-        order_process: "2",
-        status_name: "待财务定售价"
-      },
-      {
-        id: "97",
-        process_id: "17",
-        order_process: "3",
-        status_name: "待活动价审核"
-      }
-    ]
-  },
-  {
-    id: "16",
-    process_name: "商品上线流程",
-    process_type: "SPSX",
-    child: [
-      {
-        id: "11",
-        process_id: "16",
-        order_process: "2",
-        status_name: "待产品审核"
-      },
-      {
-        id: "12",
-        process_id: "16",
-        order_process: "3",
-        status_name: "待财务定价"
-      },
-      {
-        id: "13",
-        process_id: "16",
-        order_process: "4",
-        status_name: "待财务审核定价"
-      },
-      { id: "14", process_id: "16", order_process: "5", status_name: "待上线" }
-    ]
-  },
-  {
-    id: "15",
-    process_name: "商品成本流程",
-    process_type: "SPCB",
-    child: [
-      {
-        id: "1",
-        process_id: "15",
-        order_process: "0",
-        status_name: "新建待审核"
-      },
-      {
-        id: "3",
-        process_id: "15",
-        order_process: "2",
-        status_name: "基础修改待审核"
-      },
-      {
-        id: "4",
-        process_id: "15",
-        order_process: "3",
-        status_name: "成本修改待审核"
-      },
-      {
-        id: "5",
-        process_id: "15",
-        order_process: "4",
-        status_name: "基础修改驳回"
-      },
-      {
-        id: "6",
-        process_id: "15",
-        order_process: "5",
-        status_name: "成本修改驳回"
-      },
-      {
-        id: "7",
-        process_id: "15",
-        order_process: "6",
-        status_name: "新建审核驳回"
-      },
-      {
-        id: "8",
-        process_id: "15",
-        order_process: "7",
-        status_name: "复制商品待编辑"
-      },
-      {
-        id: "9",
-        process_id: "15",
-        order_process: "8",
-        status_name: "竞价商品待编辑"
-      }
-    ]
-  },
-  {
-    id: "12",
-    process_name: "盘点单流程",
-    process_type: "PDD",
-    child: [
-      {
-        id: "89",
-        process_id: "12",
-        order_process: "0",
-        status_name: "待发起流程"
-      },
-      {
-        id: "90",
-        process_id: "12",
-        order_process: "1",
-        status_name: "待上传盘点结果"
-      },
-      {
-        id: "91",
-        process_id: "12",
-        order_process: "2",
-        status_name: "待审核盘点结果"
-      }
-    ]
-  },
-  {
-    id: "11",
-    process_name: "调拨单流程",
-    process_type: "DBD",
-    child: [
-      {
-        id: "83",
-        process_id: "11",
-        order_process: "0",
-        status_name: "待发起流程"
-      },
-      {
-        id: "84",
-        process_id: "11",
-        order_process: "1",
-        status_name: "待入库方同意入库"
-      },
-      {
-        id: "85",
-        process_id: "11",
-        order_process: "2",
-        status_name: "待出库方发货"
-      },
-      {
-        id: "86",
-        process_id: "11",
-        order_process: "3",
-        status_name: "待入库方验货"
-      },
-      {
-        id: "87",
-        process_id: "11",
-        order_process: "4",
-        status_name: "待验货审核"
-      }
-    ]
-  }
-];

+ 17 - 23
src/views/interest/processPermission/index.vue

@@ -1,26 +1,23 @@
 <script setup lang="ts">
 import { ref, onMounted } from "vue";
 import ProcessList from "./components/process-list.vue";
-import RoleList from "./components/role-list.vue";
 import { httpSave } from "/@/api/interest/processPermission";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import { useUserStoreHook } from "/@/store/modules/user";
 import { useCompany } from "/@/hooks/core/useCompany";
+import RoleList from "./components/role-list.vue";
 import { ElMessage } from "element-plus"
-import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 
 const currentRole = ref<Record<string, string>>({});
 const { currentCompany } = useCompany();
-const powers = ref([]);
 const loading = ref(false)
+const powers = ref([]);
 
 async function submit(actions: Array<string>) {
   const action_data = actions.filter(action => !!action)
-  const params = {
-    action_data,
-    roleid: currentRole.value.id
-  }
+  const params = { action_data, roleid: currentRole.value.id }
   loading.value = true
-  const {code,message} = await httpSave(params)
+  const {code, message } = await httpSave(params)
   loading.value = false
   if(code === 0){
     ElMessage.success('保存成功')
@@ -29,9 +26,8 @@ async function submit(actions: Array<string>) {
   }
 }
 
-onMounted(() => {
-  powers.value = useUserStoreHook().getMenuActions("action");
-});
+onMounted(() => { powers.value = useUserStoreHook().getMenuActions("action") });
+
 </script>
 
 <template>
@@ -65,20 +61,18 @@ onMounted(() => {
 </template>
 
 <style scoped lang="scss">
-:deep(.el-dropdown-menu__item i) {
-  margin: 0;
-}
+:deep(.el-dropdown-menu__item i) { margin: 0 }
 
 .warning-message {
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    font-weight: 700;
-    transform: translate(-50%, -50%);
-    font-size: 16px;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  font-weight: 700;
+  transform: translate(-50%, -50%);
+  font-size: 16px;
 
-    :deep(.el-button) {
-      padding: 0px;
-    }
+  :deep(.el-button) {
+    padding: 0px;
   }
+}
 </style>

+ 11 - 0
src/views/serviceParam/expressSet/config/_options.ts

@@ -0,0 +1,11 @@
+export const statusOptions = [
+  { id: "0", label: "禁用" },
+  { id: "1", label: "启用" },
+];
+
+
+export const expressType = [
+  { value: "0", label: "国内" },
+  { value: "1", label: "国际", },
+  { value: "2", label: "国际邮政" },
+]

+ 64 - 0
src/views/serviceParam/expressSet/config/content.config.ts

@@ -0,0 +1,64 @@
+import { ElTag } from "element-plus";
+import { httpList, httpStatus } from "/@/api/serviceParam/expressSet";
+
+import { ContentConfig } from "/@/components/PageContent";
+import { h } from "vue";
+import { expressType } from "./_options";
+
+const columns = [
+  {
+    prop: "comTypeName",
+    label: "快递类型名称",
+  },
+  {
+    prop: "name",
+    label: "快递名称",
+  },
+  {
+    prop: "shortName",
+    label: "快递简称",
+  },
+  {
+    prop: "shortNameEn",
+    label: "快递英文",
+  },
+  {
+    prop: "type",
+    label: "快递属性",
+    width: "100px",
+    cellRenderer: ({ row }) => {
+      return h( ElTag, { }, { default: () => (expressType.find(({value}) => value === String(row.type)))?.label || '--'}
+      );
+    }
+  },
+  {
+    prop: "canOrder",
+    label: "状态",
+    width: "80px",
+    cellRenderer: ({ row }) => {
+      return h( ElTag,
+        { type: String(row.canOrder) === "1" ? "success" : "danger" },
+        { default: () => (String(row.canOrder) === "1" ? "启用" : "禁用")}
+      );
+    }
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    width: "90px",
+    slot: "operation",
+  },
+];
+
+const contentConfig: ContentConfig = {
+  title: "快递信息设置",
+  columns,
+  statusListProp:'canOrder',
+  apis: {
+    httpList,
+    httpStatus,
+  }
+};
+
+export default contentConfig;

+ 20 - 0
src/views/serviceParam/expressSet/config/search.config.ts

@@ -0,0 +1,20 @@
+import { FormConfig } from "/@/components/PageSearch"
+import { expressType, statusOptions } from "./_options";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "type",
+      type: "select",
+      options: expressType,
+      placeholder:'快递属性'
+    },
+    {
+      type: "input",
+      field: "name",
+      placeholder:'快递名称'
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 26 - 0
src/views/serviceParam/expressSet/index.vue

@@ -0,0 +1,26 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+
+const PageName = "expressSet";
+const instance = ref<any>(null);
+
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer 
+      :hooks="hooks" 
+      :events="events" 
+      :contentConfig="contentConfig" 
+      :search-config="searchConfig"
+      :get-content-ref="ref => (instance = ref)" 
+    />
+  </PageAuth>
+</template>

+ 0 - 0
src/views/serviceParam/expressSet/快递信息设置.md


+ 62 - 0
src/views/serviceParam/orderuse/components/modal.vue

@@ -0,0 +1,62 @@
+<script setup lang="ts">
+import { httpBusinesslist } from "/@/api/interest/organize";
+import { useVModel } from "@vueuse/core"
+import { computed, onMounted, ref } from "vue";
+
+const initialData = {
+  order_use: '',
+  id: ''
+}
+
+const emit = defineEmits(['submit'])
+const props = withDefaults(
+  defineProps<{ data: any; visible: boolean; disabled:boolean }>(),
+  { data: {  order_use: '', id:'' } }
+)
+
+const business = ref<any[]>([])
+const title = computed(() => data.value.id ? (props.disabled ? '查看订单用途' : '编辑订单用途') : '添加订单用途')
+const visible = useVModel(props, 'visible')
+const data = useVModel(props, 'data')
+
+const formRef = ref<any | null>(null)
+
+const rules = {
+  order_use: [ { required: true,message: '请输入订单用途', trigger: 'input' }]
+}
+
+async function requestBusiness(){
+  const res = await httpBusinesslist({ size:100 })
+  business.value = res.code === 0 ? res.data.list : []
+}
+
+function handleClose(){
+  data.value = {...initialData}
+  visible.value = false
+}
+
+async function onSubmit(){
+  try {
+    await formRef.value.validate();
+    emit("submit");
+  } catch (err) {
+    console.log(err);
+  }
+}
+
+onMounted(requestBusiness)
+</script>
+
+
+<template>
+  <ElDialog v-model="visible" :title="title" center @close="handleClose">
+    <ElForm :model="data" :rules="rules" size="small" ref="formRef" :disabled="disabled">
+      <ElFormItem label="订单用途" prop="order_use">
+        <ElInput v-model="data.order_use" style="width:100%" placeholder="订单用途" />
+      </ElFormItem>
+      <div class="w-full flex justify-end">
+        <ElButton type="primary" @click="onSubmit">保存</ElButton>
+      </div>
+    </ElForm>
+  </ElDialog>
+</template>

+ 4 - 0
src/views/serviceParam/orderuse/config/_options.ts

@@ -0,0 +1,4 @@
+export const statusOptions = [
+  { id: "0", label: "禁用" },
+  { id: "1", label: "启用" },
+];

+ 58 - 0
src/views/serviceParam/orderuse/config/content.config.ts

@@ -0,0 +1,58 @@
+import { httpList, httpStatus,httpDelete } from "/@/api/serviceParam/orderuse";
+
+import { h } from "vue";
+import { ContentConfig } from "/@/components/PageContent";
+import { ElTag } from "element-plus";
+
+const columns = [
+  {
+    prop: "id",
+    label: "ID",
+    width:"80px"
+  },
+  {
+    prop: "order_use",
+    label: "订单用途名称",
+  },
+  {
+    label: "状态",
+    prop: "status",
+    width: 100,
+    cellRenderer: ({ row }) => {
+      return h( ElTag,
+        { type: String(row.status) === "1" ? "success" : "danger" },
+        { default: () => (String(row.status) === "1" ? "启用" : "禁用")}
+      );
+    }
+  },
+  {
+    prop: "creater",
+    label: "创建人",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    // ,
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    minWidth: "90px",
+    slot: "operation",
+  },
+];
+
+const contentConfig: ContentConfig = {
+  title: "订单用途管理",
+  columns,
+  apis: {
+    httpList,
+    httpAdd: true,
+    httpStatus,
+    httpUpdate: true,
+    httpDelete
+  }
+};
+
+export default contentConfig;

+ 36 - 0
src/views/serviceParam/orderuse/config/search.config.ts

@@ -0,0 +1,36 @@
+import { FormConfig } from "/@/components/PageSearch"
+import { statusOptions } from "./_options";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "create_timer",
+      type: "date_picker",
+      otherOptions: {
+        type: "daterange",
+        startProp: "start",
+        endProp: "end",
+        startPlaceholder: "开始时间",
+        endPlaceholder: "结束时间"
+      }
+    },
+    {
+      field: "status",
+      type: "select",
+      options: statusOptions,
+      placeholder:'状态'
+    },
+    {
+      type: "input",
+      field: "order_use",
+      placeholder:'用途名称'
+    },
+    {
+      type: "input",
+      field: "creater",
+      placeholder:'创建人'
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 66 - 0
src/views/serviceParam/orderuse/index.vue

@@ -0,0 +1,66 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import Modal from "./components/modal.vue";
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { httpAdd, httpUpdate } from "/@/api/serviceParam/orderuse";
+
+import { ElMessage } from "element-plus"
+
+const PageName = "orderuse";
+const instance = ref<any>(null);
+
+const disabled = ref(false)
+const visible = ref(false)
+const data = ref<any>({})
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+const events: PageEvents = {
+  content: {
+    create: () => {
+      disabled.value = false
+      visible.value = true
+    },
+    preview: _data => {
+      const { id, order_use } = _data
+      data.value = { id, order_use }
+      disabled.value = true
+      visible.value = true
+    },
+    update: _data => {
+      const { id, order_use } = _data
+      data.value = { id, order_use }
+      disabled.value = false
+      visible.value = true
+    }
+  }
+};
+
+async function onSubmit() {
+  const { id, order_use } = data.value;
+  const isCreate = id === undefined || !id
+  const params = { id, order_use }
+  if (isCreate) delete params['id']
+  const api = isCreate ? httpAdd : httpUpdate
+  const result = await api(params)
+  if (result.code === 0) {
+    visible.value = false
+    ElMessage.success(`${isCreate ? '添加' : '更新'}成功`)
+    instance.value!.onSearch()
+  } else {
+    ElMessage.warning(`${isCreate ? '添加' : '更新'}失败`)
+  }
+}
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer :hooks="hooks" :events="events" :contentConfig="contentConfig" :search-config="searchConfig"
+      :get-content-ref="ref => (instance = ref)" />
+    <Modal v-model:visible="visible" v-model:data="data" :disabled="disabled" @submit="onSubmit" />
+  </PageAuth>
+</template>

+ 0 - 0
src/views/serviceParam/orderuse/订单用途管理.md


+ 80 - 0
src/views/serviceParam/paymentChannelManage/components/modal.vue

@@ -0,0 +1,80 @@
+<script setup lang="ts">
+import { httpBusinesslist } from "/@/api/interest/organize";
+import { useVModel } from "@vueuse/core"
+import { computed, onMounted, ref } from "vue";
+
+const initialData = {
+  companyNo: '',
+  channel_name: '',
+  id: ''
+}
+
+const emit = defineEmits(['submit'])
+const props = withDefaults(
+  defineProps<{ data: any; visible: boolean; disabled:boolean }>(),
+  { data: {  companyNo: '',channel_name:'', id:'' } }
+)
+
+const business = ref<any[]>([])
+const title = computed(() => data.value.id ? (props.disabled ? '查看支付渠道' : '编辑支付渠道') : '添加支付渠道')
+const visible = useVModel(props, 'visible')
+const data = useVModel(props, 'data')
+
+const formRef = ref<any | null>(null)
+
+
+const rules = {
+  companyNo: [ { required: true,message: '请选择业务公司', trigger: 'change' }],
+  name: [
+    { required: true,message: '请输入组织名称',trigger: 'blur' },
+    { min: 1,max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
+  ]
+}
+
+async function requestBusiness(){
+  const res = await httpBusinesslist({ size:100 })
+  business.value = res.code === 0 ? res.data.list : []
+}
+
+function handleClose(){
+  data.value = {...initialData}
+  visible.value = false
+}
+
+async function onSubmit(){
+  try {
+    await formRef.value.validate();
+    emit("submit");
+  } catch (err) {
+    console.log(err);
+  }
+}
+
+onMounted(requestBusiness)
+</script>
+
+
+<template>
+  <ElDialog v-model="visible" :title="title" center @close="handleClose">
+    <ElForm :model="data" :rules="rules" size="small" ref="formRef" :disabled="disabled">
+      <ElFormItem label="业务公司" prop="companyNo">
+        <ElSelect v-model="data.companyNo" style="width:100%" placeholder="业务公司">
+          <ElOption 
+            v-for="item in business" 
+            :label="item.company" 
+            :value="item.companyNo" 
+            :key="item.companyNo" 
+          />
+        </ElSelect>
+      </ElFormItem>
+
+      <ElFormItem label="支付渠道名称" prop="channel_name">
+        <ElInput v-model="data.channel_name" style="width:100%" placeholder="支付渠道名称" />
+      </ElFormItem>
+
+      <div class="w-full flex justify-end">
+        <ElButton type="primary" @click="onSubmit">保存</ElButton>
+      </div>
+    </ElForm>
+  </ElDialog>
+</template>

+ 1 - 0
src/views/serviceParam/paymentChannelManage/config/_details.ts

@@ -0,0 +1 @@
+export { reconciliationColumns } from "/@/components/ReconciliationForm";

+ 4 - 0
src/views/serviceParam/paymentChannelManage/config/_options.ts

@@ -0,0 +1,4 @@
+export const statusOptions = [
+  { id: "0", label: "禁用" },
+  { id: "1", label: "启用" },
+];

+ 72 - 0
src/views/serviceParam/paymentChannelManage/config/content.config.ts

@@ -0,0 +1,72 @@
+import { httpList, httpStatus } from "/@/api/serviceParam/paymentChannelManage";
+
+import { h } from "vue";
+import dayjs from "dayjs";
+import { ContentConfig } from "/@/components/PageContent";
+import { ElTag } from "element-plus";
+import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
+
+const columns = [
+  {
+    prop: "id",
+    label: "ID",
+    minWidth: "60px",
+  },
+  {
+    prop: "channel_name",
+    label: "支付渠道名称",
+    width: "230px",
+  },
+  {
+    prop: "companyName",
+    label: "业务公司名称",
+    width: "230px",
+  },
+  {
+    label: "状态",
+    prop: "status",
+    width: 100,
+    cellRenderer: ({ row }) => {
+      return h(
+        ElTag,
+        {
+          type: String(row.status) === "1" ? "success" : "danger"
+        },
+        {
+          default: () => (String(row.status) === "1" ? "启用" : "禁用")
+        }
+      );
+    }
+  },
+  {
+    prop: "apply_name",
+    label: "创建人",
+    width: "230px",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    width: "260px",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    width: "140px",
+    _noset_: true,
+    slot: "operation",
+  },
+];
+
+const contentConfig: ContentConfig = {
+  title: "公司账号角色查询",
+  columns,
+  apis: {
+    httpList,
+    httpAdd: true,
+    httpStatus,
+    httpUpdate: true
+  }
+};
+
+export default contentConfig;

+ 25 - 0
src/views/serviceParam/paymentChannelManage/config/search.config.ts

@@ -0,0 +1,25 @@
+import { FormConfig } from "/@/components/PageSearch";
+import { statusOptions } from "/@/utils/details/_purchase/orderRecord";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "status",
+      type: "select",
+      options: statusOptions,
+      placeholder:'状态'
+    },
+    {
+      type: "input",
+      field: "channel_name",
+      placeholder:'渠道名称'
+    },
+    {
+      type: "input",
+      field: "apply_name",
+      placeholder:'创建人'
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 70 - 0
src/views/serviceParam/paymentChannelManage/index.vue

@@ -0,0 +1,70 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import Modal from "./components/modal.vue";
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { httpAdd, httpUpdate } from "/@/api/serviceParam/paymentChannelManage";
+
+import { ElMessage } from "element-plus"
+
+const PageName = "paymentChannelManage";
+const instance = ref<any>(null);
+
+const disabled = ref(false)
+const visible = ref(false)
+const data = ref<any>({})
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+const events: PageEvents = {
+  content: {
+    create: () => {
+      disabled.value = false
+      visible.value = true
+    },
+    preview: _data => {
+      data.value = {..._data}
+      disabled.value = true
+      visible.value = true
+    },
+    update: _data => {
+      data.value = {..._data}
+      disabled.value = false
+      visible.value = true
+    }
+  }
+};
+
+async function onSubmit() {
+  const { id, channel_name, companyNo } = data.value;
+  const isCreate = id === undefined
+  console.log(isCreate)
+  const params = { id, channel_name,companyNo  }
+  if(isCreate) delete params['id']
+  const api = isCreate ? httpAdd : httpUpdate
+  const result = await api(params)
+  if(result.code === 0){
+    visible.value = false
+    ElMessage.success(`${isCreate ? '添加' : '更新'}成功`)
+    instance.value!.onSearch()
+  }else{
+    ElMessage.warning(`${isCreate ? '添加' : '更新'}失败`)
+  }
+}
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer
+      :hooks="hooks"
+      :events="events"
+      :contentConfig="contentConfig"
+      :search-config="searchConfig"
+      :get-content-ref="ref => (instance = ref)"
+    />
+    <Modal v-model:visible="visible" v-model:data="data" :disabled="disabled" @submit="onSubmit"  />
+  </PageAuth>
+</template>

+ 5 - 0
src/views/serviceParam/paymentChannelManage/types.ts

@@ -0,0 +1,5 @@
+export enum ModalTypes {
+  update,
+  preview,
+  create
+}

+ 0 - 0
src/views/serviceParam/paymentChannelManage/订单用途管理.md


+ 80 - 0
src/views/serviceParam/unusualReason/components/modal.vue

@@ -0,0 +1,80 @@
+<script setup lang="ts">
+import { httpBusinesslist } from "/@/api/interest/organize";
+import { useVModel } from "@vueuse/core"
+import { computed, onMounted, ref } from "vue";
+
+import { options } from "./../config/_options"
+
+const initialData = {
+  id: '',
+  type: '', // 原因类型
+  result: '', // 原因标题
+  result_desc: '', // 备注
+}
+
+const emit = defineEmits(['submit'])
+const props = withDefaults(
+  defineProps<{ data: any; visible: boolean; disabled: boolean }>(),
+  { data: { order_use: '', id: '' } }
+)
+
+const business = ref<any[]>([])
+const title = computed(() => data.value.id ? (props.disabled ? '查看订单用途' : '编辑订单用途') : '添加订单用途')
+const visible = useVModel(props, 'visible')
+const data = useVModel(props, 'data')
+
+const formRef = ref<any | null>(null)
+
+const rules = {
+  type: [ {required: true,trigger: 'change',message: '请选择原因类型' }],
+  result: [ {required: true,trigger: 'blur', message: '入库异常原因不能为空'}],
+  result_desc: [{ required: true, trigger: 'blur',  message: '入库异常备注不能为空'}]
+}
+
+async function requestBusiness() {
+  const res = await httpBusinesslist({ size: 100 })
+  business.value = res.code === 0 ? res.data.list : []
+}
+
+function handleClose() {
+  data.value = { ...initialData }
+  visible.value = false
+}
+
+async function onSubmit() {
+  try {
+    await formRef.value.validate();
+    emit("submit");
+  } catch (err) {
+    console.log(err);
+  }
+}
+
+onMounted(requestBusiness)
+</script>
+
+
+<template>
+  <ElDialog v-model="visible" :title="title" center @close="handleClose">
+    <ElForm :model="data" :rules="rules" size="small" ref="formRef" :disabled="disabled">
+      <ElFormItem label="原因类型" prop="type">
+        <ElSelect v-model="data.type" style="width:100%" placeholder="原因类型">
+          <ElOption v-for="option in options" :key="option.value" :value="option.value" :label="option.label" />
+        </ElSelect>
+      </ElFormItem>
+
+      <ElFormItem label="原因标题" prop="result">
+        <ElInput v-model="data.result" style="width:100%" placeholder="原因标题" :maxlength="50" show-word-limit />
+      </ElFormItem>
+
+
+      <ElFormItem  label="原因备注" prop="result_desc">
+        <ElInput v-model="data.result_desc" style="width:100%" placeholder="原因备注" :maxlength="250" show-word-limit />
+      </ElFormItem>
+
+      <div class="flex w-full justify-end">
+        <ElButton type="primary" @click="onSubmit">保存</ElButton>
+      </div>
+    </ElForm>
+  </ElDialog>
+</template>

+ 16 - 0
src/views/serviceParam/unusualReason/config/_options.ts

@@ -0,0 +1,16 @@
+export const statusOptions = [
+  { value: "0", label: "禁用",type:'warning' },
+  { value: "1", label: "启用",type:'success' },
+];
+
+
+export const options = [
+  { value: "1", label: "入库验收异常" },
+  { value: "2", label: "退货验收异常" },
+  { value: "3", label: "售后已收到货异常" },
+  { value: "4", label: "采购退货" },
+  { value: "5", label: "销售退换货" },
+  { value: "6", label: "售后未收到货异常" },
+  { value: "7", label: "议价申请原因" },
+  { value: "8", label: "商品下线原因" }
+]

+ 68 - 0
src/views/serviceParam/unusualReason/config/content.config.ts

@@ -0,0 +1,68 @@
+import { httpList, httpStatus,httpDelete } from "/@/api/serviceParam/unusualReason";
+
+import { h } from "vue";
+import { ContentConfig } from "/@/components/PageContent";
+import { ElTag } from "element-plus";
+import { options, statusOptions } from "./_options";
+
+const columns = [
+  {
+    prop: "result_code",
+    label: "原因编号",
+    width: "120px",
+  },
+  {
+    prop: "result",
+    label: "原因标题",
+  },
+  {
+    prop: "status",
+    width: "140px",
+    label: "原因类型",
+    cellRenderer: ({ row }) => {
+      return h( ElTag, { }, { default: () => (options.find(({value}) => value === String(row.type)))?.label || '--'}
+      );
+    }
+  },
+  {
+    prop: "result_desc",
+    label: "异常描述",
+  },
+  {
+    prop: "status",
+    label: "状态",
+    width: "80px",
+    cellRenderer: ({ row }) => {
+      return h( ElTag, { 
+        type: (statusOptions.find(({value}) => value === String(row.status)))?.type || 'info'
+      }, { default: () => (statusOptions.find(({value}) => value === String(row.status)))?.label || '--'}
+      );
+    }
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    width: "140px",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    slot: "operation",
+    width: "150px",
+  },
+]
+
+const contentConfig: ContentConfig = {
+  title: "原因管理",
+  columns,
+  apis: {
+    httpList,
+    httpAdd: true,
+    httpStatus,
+    httpUpdate: true,
+    httpDelete
+  }
+};
+
+export default contentConfig;

+ 15 - 0
src/views/serviceParam/unusualReason/config/search.config.ts

@@ -0,0 +1,15 @@
+import { FormConfig } from "/@/components/PageSearch"
+import { options } from "./_options";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "type",
+      type: "select",
+      options: options,
+      placeholder:'原因类型'
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 66 - 0
src/views/serviceParam/unusualReason/index.vue

@@ -0,0 +1,66 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import Modal from "./components/modal.vue";
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { httpAdd, httpUpdate } from "/@/api/serviceParam/unusualReason";
+
+import { ElMessage } from "element-plus"
+
+const PageName = "unusualReason";
+const instance = ref<any>(null);
+
+const disabled = ref(false)
+const visible = ref(false)
+const data = ref<any>({})
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+const events: PageEvents = {
+  content: {
+    create: () => {
+      disabled.value = false
+      visible.value = true
+    },
+    preview: _data => {
+      const { id, type, result, result_desc } = _data
+      data.value = { id, type, result, result_desc }
+      disabled.value = true
+      visible.value = true
+    },
+    update: _data => {
+      const { id, type, result, result_desc } = _data
+      data.value = { id, type, result, result_desc }
+      disabled.value = false
+      visible.value = true
+    }
+  }
+};
+
+async function onSubmit() {
+  const { id, type, result, result_desc } = data.value;
+  const isCreate = id === undefined || !id
+  const params = { id, type, result, result_desc }
+  if (isCreate) delete params['id']
+  const api = isCreate ? httpAdd : httpUpdate
+  const res = await api(params)
+  if (res.code === 0) {
+    visible.value = false
+    ElMessage.success(`${isCreate ? '添加' : '更新'}成功`)
+    instance.value!.onSearch()
+  } else {
+    ElMessage.warning(`${isCreate ? '添加' : '更新'}失败`)
+  }
+}
+</script>
+
+<template>
+  <PageAuth :pageName="PageName">
+    <PageContainer :hooks="hooks" :events="events" :contentConfig="contentConfig" :search-config="searchConfig"
+      :get-content-ref="ref => (instance = ref)" />
+    <Modal v-model:visible="visible" v-model:data="data" :disabled="disabled" @submit="onSubmit" />
+  </PageAuth>
+</template>

+ 0 - 0
src/views/serviceParam/unusualReason/原因管理.md