From afb39f8ab004b2607bb718edab02e99c7a010114 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 三月 2023 14:36:44 +0800 Subject: [PATCH] 2023-03-22 --- src/menu/components/module/voucher/options.jsx | 109 +++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 83 insertions(+), 26 deletions(-) diff --git a/src/menu/components/module/voucher/options.jsx b/src/menu/components/module/voucher/options.jsx index df667c8..bd1bee2 100644 --- a/src/menu/components/module/voucher/options.jsx +++ b/src/menu/components/module/voucher/options.jsx @@ -1,25 +1,24 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ export default function (wrap, id) { - let roleList = sessionStorage.getItem('sysRoles') - let appType = sessionStorage.getItem('appType') - - let menu = fromJS(window.GLOB.customMenu).toJS() - let modules = MenuUtils.getSupModules(menu.components, id) || [] - - if (roleList) { - try { - roleList = JSON.parse(roleList) - } catch (e) { - roleList = [] + let menu = window.GLOB.customMenu + let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) + 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 = [ // { @@ -30,14 +29,24 @@ // 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']}, + {field: 'supModule', values: ['checkTemp', 'checkVoucher']}, + {field: 'attachStatus', values: ['createVoucher', 'checkVoucher']}, ] }, { @@ -60,6 +69,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: '涓婄骇缁勪欢', @@ -69,13 +115,24 @@ allowClear: true, }, { - type: 'multiselect', - field: 'blacklist', - label: '榛戝悕鍗�', - initval: wrap.blacklist || [], - required: false, - options: roleList, - forbid: !!appType + type: 'radio', + field: 'attachStatus', + label: '闄勪欢鐘舵��', + initval: wrap.attachStatus || 0, + tooltip: '娣诲姞鎴栦慨鏀瑰嚟璇佹椂锛屼笂浼犻檮浠剁殑鐘舵�併��', + required: true, + options: [ + {value: 0, label: '寰呭鏍�'}, + {value: 10, label: '宸插鏍�'}, + ] + }, + { + type: 'number', + field: 'space', + label: '鐣欑櫧', + initval: wrap.space || 0, + tooltip: '琛ㄦ牸涓讳綋閮ㄥ垎涓ょ鐨勭┖鐧借窛绂伙紝琛ㄦ牸鍦ㄧ紪杈戞椂涓ょ浼氭湁娣诲姞鍜屽垹闄ゅ浘鏍囥��', + required: false }, ] -- Gitblit v1.8.0