From 6f817bf3ae4e6f51f982c07b0713adb3caf9fac2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 二月 2023 17:14:16 +0800
Subject: [PATCH] 2023-02-02

---
 src/menu/components/module/voucher/options.jsx |   86 ++++++++++++++++++++++++++++++------------
 1 files changed, 61 insertions(+), 25 deletions(-)

diff --git a/src/menu/components/module/voucher/options.jsx b/src/menu/components/module/voucher/options.jsx
index a837e93..b453c3c 100644
--- a/src/menu/components/module/voucher/options.jsx
+++ b/src/menu/components/module/voucher/options.jsx
@@ -4,21 +4,21 @@
  * @description Wrap琛ㄥ崟閰嶇疆淇℃伅
  */
 export default function (wrap, id) {
-  let roleList = sessionStorage.getItem('sysRoles')
-  let appType = sessionStorage.getItem('appType')
-
   let menu = window.GLOB.customMenu
   let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces)
-
-  if (roleList) {
-    try {
-      roleList = JSON.parse(roleList)
-    } catch (e) {
-      roleList = []
+  let books = []
+  let bookids = []
+  menu.components.forEach(item => {
+    if (item.subtype === 'account') {
+      books.push({
+        value: item.uuid,
+        label: item.name
+      })
+      bookids.push(item.uuid)
     }
-  } else {
-    roleList = []
-  }
+  })
+
+  modules = modules.filter(item => !bookids.includes(item.value))
 
   const wrapForm = [
     // {
@@ -29,14 +29,22 @@
     //   required: false
     // },
     {
-      type: 'radio',
+      type: 'select',
       field: 'type',
       label: '绫诲瀷',
-      initval: wrap.type || 'edit',
+      initval: wrap.type || 'createVoucher',
       required: true,
       options: [
-        {value: 'edit', label: '缂栬緫'},
-        {value: 'check', label: '鏌ョ湅'},
+        {value: 'createVoucher', label: '鏂板鍑瘉'},
+        {value: 'checkVoucher', label: '鏌ョ湅鍑瘉'},
+        {value: 'createTemp', label: '鏂板妯℃澘'},
+        {value: 'checkTemp', label: '缂栬緫妯℃澘'},
+      ],
+      controlFields: [
+        {field: 'businessType', values: ['createVoucher', 'checkVoucher']},
+        {field: 'voucherType', values: ['createVoucher', 'checkVoucher']},
+        {field: 'voucherTypeText', values: ['createVoucher', 'checkVoucher']},
+        {field: 'voucherSign', values: ['createVoucher', 'checkVoucher']},
       ]
     },
     {
@@ -59,6 +67,43 @@
       required: true
     },
     {
+      type: 'select',
+      field: 'supBook',
+      label: '璐﹀',
+      initval: wrap.supBook || '',
+      required: true,
+      options: books,
+      allowClear: true
+    },
+    {
+      type: 'text',
+      field: 'businessType',
+      label: '涓氬姟绫诲瀷',
+      initval: wrap.businessType || 'fcc01',
+      required: true
+    },
+    {
+      type: 'text',
+      field: 'voucherType',
+      label: '鍑瘉绫诲瀷',
+      initval: wrap.voucherType || 'fcc_keeping',
+      required: true
+    },
+    {
+      type: 'text',
+      field: 'voucherTypeText',
+      label: '鍑瘉绫诲瀷鏂囨湰',
+      initval: wrap.voucherTypeText || '璁拌处鍑瘉',
+      required: true
+    },
+    {
+      type: 'text',
+      field: 'voucherSign',
+      label: '鍑瘉绫诲瀷鏍囪瘑',
+      initval: wrap.voucherSign || 'fcc_keeping',
+      required: true
+    },
+    {
       type: 'cascader',
       field: 'supModule',
       label: '涓婄骇缁勪欢',
@@ -66,15 +111,6 @@
       required: false,
       options: modules,
       allowClear: true,
-    },
-    {
-      type: 'multiselect',
-      field: 'blacklist',
-      label: '榛戝悕鍗�',
-      initval: wrap.blacklist || [],
-      required: false,
-      options: roleList,
-      forbid: !!appType
     },
   ]
 

--
Gitblit v1.8.0