From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/module/voucher/options.jsx | 142 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 121 insertions(+), 21 deletions(-) diff --git a/src/menu/components/module/voucher/options.jsx b/src/menu/components/module/voucher/options.jsx index df667c8..2f268e6 100644 --- a/src/menu/components/module/voucher/options.jsx +++ b/src/menu/components/module/voucher/options.jsx @@ -1,25 +1,36 @@ -import { fromJS } from 'immutable' +import React from 'react' 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 = 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) + } + }) - let menu = fromJS(window.GLOB.customMenu).toJS() - let modules = MenuUtils.getSupModules(menu.components, id) || [] - - if (roleList) { + let menulist = sessionStorage.getItem('fstMenuList') + if (menulist) { try { - roleList = JSON.parse(roleList) + menulist = JSON.parse(menulist) } catch (e) { - roleList = [] + menulist = [] } } else { - roleList = [] + menulist = [] } + + modules = modules.filter(item => !bookids.includes(item.value)) const wrapForm = [ // { @@ -30,14 +41,25 @@ // 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: 'printTemp', values: ['createVoucher', 'checkVoucher']}, + {field: 'supModule', values: ['checkTemp', 'checkVoucher']}, + {field: 'attachStatus', values: ['createVoucher', 'checkVoucher']}, ] }, { @@ -60,6 +82,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,14 +128,55 @@ 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: 'printTemps', + field: 'printTemp', + label: '鎵撳嵃妯℃澘', + initval: wrap.printTemp || '', + help: (record) => { + if (record.printTemp) { + return <span onClick={() => { + sessionStorage.setItem('mk-print-temp', record.printTemp) + window.open('#/hs') + + setTimeout(() => { + sessionStorage.removeItem('mk-print-temp') + }, 50) + }} style={{color: '#1890ff', cursor: 'pointer', fontSize: '13px'}}>#鏌ョ湅妯℃澘</span> + } + return '' + }, + required: true + }, + { + type: 'number', + field: 'space', + label: '鐣欑櫧', + initval: wrap.space || 0, + tooltip: '琛ㄦ牸涓讳綋閮ㄥ垎涓ょ鐨勭┖鐧借窛绂伙紝琛ㄦ牸鍦ㄧ紪杈戞椂涓ょ浼氭湁娣诲姞鍜屽垹闄ゅ浘鏍囥��', + required: false + }, + { + type: 'cascader', + field: 'linkmenu', + label: '鍒锋柊鑿滃崟', + initval: wrap.linkmenu || [], + tooltip: '鐐瑰嚮淇濆瓨鏃堕渶瑕佸埛鏂扮殑鑿滃崟銆�', + required: false, + allowClear: true, + options: menulist + } ] return wrapForm -- Gitblit v1.8.0