From 735955be17afba088e389c85ad36145656b3d750 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 12 五月 2024 23:03:00 +0800 Subject: [PATCH] 2024-05-12 --- src/views/login/loginform.jsx | 46 ++++++- src/menu/components/module/invoice/verifycard/baseform/index.jsx | 11 + src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx | 69 +++++++++++ src/templates/zshare/verifycard/baseform/index.scss | 10 + src/templates/zshare/verifycard/customscript/index.jsx | 13 - src/tabviews/custom/components/chart/antv-X6/index.jsx | 20 ++ src/menu/components/share/actioncomponent/actionform/index.jsx | 11 + src/tabviews/custom/components/module/invoice/index.jsx | 9 + src/views/login/index.scss | 6 + src/menu/debug/index.jsx | 1 src/templates/zshare/verifycard/baseform/index.jsx | 30 +++++ src/tabviews/zshare/actionList/normalbutton/index.jsx | 18 +++ src/utils/utils.js | 72 ++++++++--- src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 1 14 files changed, 269 insertions(+), 48 deletions(-) diff --git a/src/menu/components/module/invoice/verifycard/baseform/index.jsx b/src/menu/components/module/invoice/verifycard/baseform/index.jsx index 60a80d4..27cd4c6 100644 --- a/src/menu/components/module/invoice/verifycard/baseform/index.jsx +++ b/src/menu/components/module/invoice/verifycard/baseform/index.jsx @@ -135,9 +135,14 @@ </Form.Item> </Col> : null} */} {verify.type === 'billout' ? <Col span={24}> - <Form.Item label="娴嬭瘯鍦板潃"> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="鎺ュ彛鍦板潃闇�閫氳繃nginx杞彂锛岄粯璁ゅ湴鍧�涓� /fcc/di/output/invoice/issue銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 娴嬭瘯鍦板潃 + </Tooltip> + }> {getFieldDecorator('interface', { - initialValue: verify.interface || '', + initialValue: verify.interface || '/fcc/di/output/invoice/issue', rules: [ { required: true, message: '璇疯緭鍏ユ祴璇曞湴鍧�!' } ] @@ -149,7 +154,7 @@ {verify.type === 'billout' ? <Col span={24}> <Form.Item label="姝e紡鍦板潃"> {getFieldDecorator('proInterface', { - initialValue: verify.proInterface || '', + initialValue: verify.proInterface || '/fcc/di/output/invoice/issue', })( <TextArea rows={2}/> )} diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 3faa23c..736388d 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd' +import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox, notification } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' @@ -1043,6 +1043,15 @@ values.config = card.config || null values.$fixed = card.$fixed || false + if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.Ot === 'required' && values.execError === 'never') { + notification.warning({ + top: 92, + message: '閫夋嫨澶氳鏃讹紝闇�璁剧疆澶辫触鍚庣殑鍒锋柊椤�!', + duration: 5 + }) + return + } + if (card.OpenType === 'excelOut' && values.OpenType === 'excelIn') { values.verify = {columns: [], scripts: [], sheet: 'Sheet1', default: 'true', range: 1, uniques: []} if (card.verify && card.verify.columns) { diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index d8ca06e..8304b9d 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1330,6 +1330,7 @@ _sql = _sql.replace(/@notice_type@/ig, `'鎶勯��'`) _sql = _sql.replace(/@check_userids@/ig, `''`) _sql = _sql.replace(/@notice_userids@/ig, `''`) + _sql = _sql.replace(/@works_flow_sign@/ig, `''`) _sql = _sql.replace(/@works_flow_code@/ig, `'mk'`) _sql = _sql.replace(/@works_flow_name@/ig, `'mk'`) _sql = _sql.replace(/@works_flow_param@/ig, `''`) diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx index 08990ce..83d89e4 100644 --- a/src/tabviews/custom/components/chart/antv-X6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx @@ -1035,7 +1035,9 @@ let mkdata = target.prop('mkdata') - if (target.prop('mknode') === 'end') { + if (source.prop('mknode') === 'start' && target.prop('mknode') === 'end') { + edge.prop('mknode', 'throughEdge') + } else if (target.prop('mknode') === 'end') { edge.prop('mknode', 'endEdge') } else if (target.prop('mknode') === 'start') { edge.prop('mknode', 'startEdge') @@ -1623,7 +1625,13 @@ } else if (item.mknode === 'end') { end_num++ } else if (item.shape === 'edge') { - if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { + if (item.mknode === 'throughEdge') { + if (!item.mkdata.seniorbers || item.mkdata.seniorbers.length === 0) { + unvalid = true + } + } else if (item.mkdata.seniorCondition === 'open') { + + } else if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { unvalid = true } else if (item.mknode === 'startEdge' || item.mkdata.flowType === 'reject') { if (map.has(item.source.cell)) { @@ -2091,7 +2099,13 @@ } else if (item.mknode === 'end') { end_num++ } else if (item.shape === 'edge' && !unvalidId && !rejectId && !approvalId) { - if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { + if (item.mknode === 'throughEdge') { + if (!item.mkdata.seniorbers || item.mkdata.seniorbers.length === 0) { + unvalidId = item.id + } + } else if (item.mkdata.seniorCondition === 'open') { + + } else if (item.mknode !== 'endEdge' && item.mknode !== 'startEdge' && (!item.mkdata.members || item.mkdata.members.length === 0)) { unvalidId = item.id } else if (item.mknode === 'startEdge' || item.mkdata.flowType === 'reject') { if (map.has(item.source.cell)) { diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx index 80c4e33..db2ae2f 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx @@ -500,6 +500,7 @@ {mknode.shape !== 'edge' && !mknode.mknode ? <div>鏍囪锛歿mkdata.sign || ''}</div> : null} {mknode.shape === 'edge' && mkdata.flowType ? <div>鎿嶄綔锛歿mkdata.flowType === 'reject' ? '椹冲洖' : '瀹℃壒'}</div> : null} {mkdata.members && mkdata.members.length ? <div>瀹℃壒浜猴細{mkdata.members.map(item => item.workername).join('銆�')}</div> : null} + {mkdata.seniorbers && mkdata.seniorbers.length ? <div>鐗规畩瀹℃壒浜猴細{mkdata.seniorbers.map(item => item.workername).join('銆�')}</div> : null} {mkdata.copys && mkdata.copys.length ? <div>鎶勯�佷汉锛歿mkdata.copys.map(item => item.workername).join('銆�')}</div> : null} <div>澶囨敞锛歿mkdata.remark || ''}</div> </div> : null} diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx index 92efe95..c9e04e2 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx @@ -17,6 +17,7 @@ state = { flowType: 'approval', execCondition: false, + seniorCondition: false, approvalMethod: 'orsign', readOnly: false, options: [] @@ -32,6 +33,8 @@ readOnly = true } else if (node.mknode === 'end') { + } else if (node.mknode === 'throughEdge') { + options = ['senior'] } else if (node.mknode === 'endEdge') { options = ['approvalMethod', 'execCondition'] } else if (node.mknode === 'startEdge') { @@ -41,12 +44,13 @@ } else if (node.shape !== 'edge') { // node options = ['sign'] } else { - options = ['flowType', 'approvalMethod', 'approver', 'members', 'copys', 'execCondition'] + options = ['flowType', 'approvalMethod', 'approver', 'members', 'copys', 'execCondition', 'senior'] } this.setState({ flowType: data.flowType || 'approval', - execCondition: options.includes('execCondition') && data.execCondition === 'open', + execCondition: options.includes('execCondition') ? data.execCondition === 'open' : false, + seniorCondition: options.includes('senior') ? data.seniorCondition === 'open' : false, approvalMethod: data.approvalMethod || 'orsign', options, readOnly @@ -54,9 +58,12 @@ } handleConfirm = () => { + const { node } = this.props + return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + if (values.approvalMethod === 'countersign' && values.members.length > 5) { notification.warning({ top: 92, @@ -64,6 +71,19 @@ duration: 10 }) return + } else if (node.mknode === 'throughEdge' && values.seniorCondition === false) { + notification.warning({ + top: 92, + message: '寮�濮嬩笌缁撴潫鐩磋繛鐨勫垎鏀繀椤昏缃壒娈婂鎵逛汉锛�', + duration: 10 + }) + return + } + + if (values.seniorCondition === true) { + values.seniorCondition = 'open' + } else if (values.seniorCondition === false) { + values.seniorCondition = 'close' } if (values.execCondition === true) { @@ -86,7 +106,7 @@ render() { const { orgs } = this.props const { getFieldDecorator } = this.props.form - const { flowType, execCondition, approvalMethod, readOnly, options } = this.state + const { flowType, execCondition, seniorCondition, approvalMethod, readOnly, options } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -270,6 +290,49 @@ )} </Form.Item> </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' ? <Col span={24}> + <p className="mk-split">楂樼骇璁剧疆<span style={{fontSize: '12px', color: 'rgba(0, 0, 0, 0.45)'}}>锛堝惎鐢ㄧ壒娈婂鎵逛汉鏃讹紝绗﹀悎瀹℃壒浜哄垪琛ㄦ椂锛屼紭鍏堜娇鐢ㄦ鍒嗘敮銆傦級</span></p> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' ? <Col span={12}> + <Form.Item label="鐗规畩浜哄憳"> + {getFieldDecorator('seniorCondition', { + valuePropName: 'checked', + initialValue: seniorCondition + })( + <Switch checkedChildren="鍚敤" unCheckedChildren="绂佺敤" onChange={(val) => this.setState({seniorCondition: val})} /> + )} + </Form.Item> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' && seniorCondition ? <Col span={12}> + <Form.Item label="瀹℃壒浜�"> + {getFieldDecorator('seniorbers', { + initialValue: data.seniorbers || [], + rules: [ + { required: true, message: '璇锋坊鍔犲鎵逛汉!' } + ] + })( + <MemberForm orgs={orgs} title="瀹℃壒浜�"/> + )} + </Form.Item> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' && seniorCondition ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐢ㄤ簬涓氬姟澶勭悊鏃剁殑鏍囪鍊粿works_flow_sign@銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍒嗘敮鏍囪 + </Tooltip> + }> + {getFieldDecorator('seniorSign', { + initialValue: data.seniorSign || '', + rules: [ + { required: true, message: '璇锋坊鍔犲垎鏀爣璁�!' }, + { pattern: /^[0-9a-zA-Z_]+$/, message: '鍙彲杈撳叆鑻辨枃銆佹暟瀛椾互鍙奯銆�' } + ] + })( + <Input autoComplete="off" onPressEnter={() => this.props.handleSubmit()}/> + )} + </Form.Item> + </Col> : null} </Row> </Form> ) diff --git a/src/tabviews/custom/components/module/invoice/index.jsx b/src/tabviews/custom/components/module/invoice/index.jsx index 022d1d3..efe5714 100644 --- a/src/tabviews/custom/components/module/invoice/index.jsx +++ b/src/tabviews/custom/components/module/invoice/index.jsx @@ -782,6 +782,9 @@ } else { url = config.billOutBtn.interface } + if (!/^http/.test(url)) { + url = window.location.origin + url + } let _params = { url: url, @@ -1015,7 +1018,6 @@ }) return } - // window.open('https://kgcs.kuan-gu.com:10853/thirdPlatFormLogin?userName=admin&taxCode=91120222MA07GMNW97&taxName=澶╂触鐣呬韩鏁板瓧绉戞妧鏈夐檺鍏徃') this.clearData() @@ -1025,6 +1027,10 @@ duration: 3 }) } + + // jumpSys = () => { + // window.open(`${window.location.origin}/kgcs/thirdPlatFormLogin?userName=admin&taxCode=91120222MA07GMNW97&taxName=澶╂触鐣呬韩鏁板瓧绉戞妧鏈夐檺鍏徃`) + // } render() { const { config, book, loading, invTypes, reqfields, saveType, date, timestamp, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee, details, visible, tax_type } = this.state @@ -1048,6 +1054,7 @@ } <div className="inv-action"> {config.wrap.backBtn === 'show' ? <Button className="mk-back" onClick={this.goback}><LeftOutlined />杩斿洖</Button> : null} + {/* <Button className="mk-addinv" onClick={this.jumpSys}>璺宠浆</Button> */} <Button className="mk-addinv" onClick={this.addInvice}>鏂板鍙戠エ</Button> <Button className="mk-bill" loading={saveType === 'bill'} onClick={this.saveBill}>淇濆瓨鍗曟嵁</Button> <Button className="mk-submit" loading={saveType === 'out'} onClick={this.outBill}>鎻愪氦寮�绁�</Button> diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 15a507f..d34f3eb 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2436,6 +2436,24 @@ if (btn.execSuccess === 'popclose' && btn.$tabId) { // 鏍囩鍏抽棴鍒锋柊 MKEmitter.emit('refreshPopButton', btn.$tabId) } + + if (btn.verify && btn.verify.linkEnable === 'true') { + let url = '' + if (window.GLOB.systemType === 'production') { + url = btn.verify.linkProUrl + if (!url) { + notification.warning({ + top: 92, + message: '灏氭湭娣诲姞姝e紡绯荤粺閾炬帴鍦板潃锛�', + duration: 5 + }) + return + } + } else { + url = btn.verify.linkUrl + } + window.open(url) + } } triggerNote = (res, ID) => { diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx index 8a0e086..affd4f5 100644 --- a/src/templates/zshare/verifycard/baseform/index.jsx +++ b/src/templates/zshare/verifycard/baseform/index.jsx @@ -134,6 +134,8 @@ error = '寮�鍚偖浠跺彂閫佹椂锛岄渶瑕侀�夋嫨閭欢妯℃澘锛�' } else if (verify.printEnable === 'true' && !verify.printTempId) { error = '浣跨敤鍗曟嵁鎵撳嵃鏃讹紝闇�瑕侀�夋嫨鎵撳嵃妯℃澘锛�' + } else if (verify.linkEnable === 'true' && !verify.linkUrl) { + error = '鎵撳紑閾炬帴寮�鍚椂锛岄渶瑕佹坊鍔犻摼鎺ュ湴鍧�锛�' } else if (verify.accountdate === 'true' && !verify.accountfield) { error = '寮�鍚处鏈熸椂锛岄渶瑕侀�夋嫨楠岃瘉鍏徃锛�' } else if (verify.preHandle === 'true' && !verify.pre_func) { @@ -166,6 +168,10 @@ } if (_verify.printEnable !== 'true') { _verify.printTempId = '' + } + if (_verify.linkEnable !== 'true') { + delete _verify.linkUrl + delete _verify.linkProUrl } if (_verify.accountdate !== 'true') { _verify.accountfield = '' @@ -540,6 +546,30 @@ </Form.Item> </Col> : null} <Col span={24}></Col> + <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="鎸夐挳鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勯摼鎺ュ湴鍧�銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鎵撳紑閾炬帴 + </Tooltip> + }> + <Radio.Group value={verify.linkEnable || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'linkEnable')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> + {verify.linkEnable === 'true' ? <Col span={24} className="dz-link"> + <Form.Item label="閾炬帴鍦板潃" required> + <Input.TextArea autoComplete="off" value={verify.linkUrl || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'linkUrl')}}/> + </Form.Item> + </Col> : null} + {verify.linkEnable === 'true' ? <Col span={24} className="dz-link"> + <Form.Item label="姝e紡鍦板潃"> + <Input.TextArea autoComplete="off" value={verify.linkProUrl || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'linkProUrl')}}/> + </Form.Item> + </Col> : null} + <Col span={24}></Col> {window.GLOB.process && card.intertype !== 'inner' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title="鍦ㄨ彍鍗曞紑鍚伐浣滄祦鏃舵湁鏁堛��"> diff --git a/src/templates/zshare/verifycard/baseform/index.scss b/src/templates/zshare/verifycard/baseform/index.scss index 8625b9f..aec5f58 100644 --- a/src/templates/zshare/verifycard/baseform/index.scss +++ b/src/templates/zshare/verifycard/baseform/index.scss @@ -24,4 +24,14 @@ } } } +} +.dz-link { + .ant-form-item { + .ant-form-item-label { + width: 10.8%; + } + .ant-form-item-control-wrapper { + width: 89.2%; + } + } } \ No newline at end of file diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index b57616f..05231cc 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -208,13 +208,10 @@ sql = sql.replace(/@check_type@/ig, `'瀹℃牳'`) sql = sql.replace(/@notice_type@/ig, `'鎶勯��'`) - if (flowType !== 'start') { - sql = sql.replace(/@check_userids@/ig, `'checkuserids'`) - sql = sql.replace(/@notice_userids@/ig, `'noticeuserids'`) - } else { - sql = sql.replace(/@check_userids@/ig, `''`) - sql = sql.replace(/@notice_userids@/ig, `''`) - } + sql = sql.replace(/@check_userids@/ig, `''`) + sql = sql.replace(/@notice_userids@/ig, `''`) + + sql = sql.replace(/@works_flow_sign@/ig, `''`) } if (skip) { @@ -363,7 +360,7 @@ {!_type ? <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�"><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename, datam</span></Tooltip>, - {window.GLOB.process && workFlow === 'true' ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="宸ヤ綔娴佸彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�"><span style={{color: '#26C281'}}>works_flow_code, works_flow_name, works_flow_param, works_flow_detail_id, status, statusname, work_group, work_grade, start_type, check_type, notice_type, check_userids, notice_userids, </span></Tooltip> : null} + {window.GLOB.process && workFlow === 'true' ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="宸ヤ綔娴佸彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤锛寃orks_flow_sign 涓哄垎鏀惎鐢ㄩ珮绾ц缃椂鐨勬爣璁板�笺��"><span style={{color: '#26C281'}}>works_flow_code, works_flow_name, works_flow_param, works_flow_detail_id, status, statusname, work_group, work_grade, start_type, check_type, notice_type, check_userids, notice_userids, works_flow_sign, </span></Tooltip> : null} <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��"><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address, mk_deleted</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞跺湪鍗曞彿鐢熸垚鎴栧垱寤哄嚟璇佹椂浣跨敤銆�"><span style={{color: '#13c2c2'}}>BillCode, BVoucher, FIBVoucherDate, FiYear, ModularDetailCode</span></Tooltip> {formfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="琛ㄥ崟鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��">, <span style={{color: '#8E44AD'}}>{formfields}</span></Tooltip> : ''} diff --git a/src/utils/utils.js b/src/utils/utils.js index 64d2720..39c4796 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -2149,6 +2149,7 @@ let status = 0 let statusName = '' let detailId = '' + let sign = '' let error = '' let userid = sessionStorage.getItem('UserID') || '' let checkIds = [] @@ -2197,14 +2198,31 @@ } }) if (!error) { - line = lines[0] + lines = lines.filter(cell => { + if (cell.mkdata.seniorCondition === 'open' && !line) { + cell.mkdata.seniorbers && cell.mkdata.seniorbers.forEach(per => { + if (per.worker_id === userid) { + line = cell + } + }) + + return false + } + + return true + }) + + if (!line) { + line = lines[0] + } } } else if (!_data.hasOwnProperty(branchKey)) { error = '淇℃伅涓棤娴佺▼鎺у埗瀛楁銆�' } else { - let equalLine = null - let gtOrLtLine = [] - let unEqualLine = null + let _def_lines = [] + let _equ_lines = [] + let _unequ_lines = [] + let _or_lines = [] let branchVal = _data[branchKey] if (branchVal && typeof(branchVal) === 'string' && !isNaN(branchVal)) { @@ -2213,45 +2231,58 @@ lines.forEach(item => { if (item.mkdata.execCondition !== 'open') { - line = item + _def_lines.push(item) } else { if (item.mkdata.match === '=') { if (item.mkdata.matchVal === branchVal + '') { - equalLine = item + _equ_lines.push(item) } } else if (item.mkdata.match === '!=') { if (item.mkdata.matchVal !== branchVal + '') { - unEqualLine = item + _unequ_lines.push(item) } } else { if (item.mkdata.match === '<') { if (item.mkdata.matchVal < branchVal) { - gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) + _or_lines.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) } } else if (item.mkdata.match === '>') { if (item.mkdata.matchVal > branchVal) { - gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) + _or_lines.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) } } else if (item.mkdata.match === '<=') { if (item.mkdata.matchVal <= branchVal) { - gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) + _or_lines.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) } } else if (item.mkdata.match === '>=') { if (item.mkdata.matchVal >= branchVal) { - gtOrLtLine.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) + _or_lines.push({...item, dist: Math.abs(item.mkdata.matchVal - branchVal)}) } } } } }) - if (equalLine) { - line = equalLine - } else if (gtOrLtLine.length > 0) { - gtOrLtLine.sort((a, b) => a.dist - b.dist) - line = gtOrLtLine[0] - } else if (unEqualLine) { - line = unEqualLine + _or_lines.sort((a, b) => a.dist - b.dist) + + let _lines = [..._equ_lines, ..._or_lines, ..._unequ_lines, ..._def_lines] + + _lines = _lines.filter(cell => { + if (cell.mkdata.seniorCondition === 'open' && !line) { + cell.mkdata.seniorbers && cell.mkdata.seniorbers.forEach(per => { + if (per.worker_id === userid) { + line = cell + } + }) + + return false + } + + return true + }) + + if (!line) { + line = _lines[0] } } } @@ -2264,6 +2295,7 @@ detailId = line.id status = line.mkdata.status statusName = line.mkdata.statusName + sign = line.mkdata.seniorSign || '' target = flow.cells.filter(cell => cell.id === line.target.cell)[0] line.mkdata.members && line.mkdata.members.forEach(item => { @@ -2288,7 +2320,7 @@ if (!target) { error = '鏈煡璇㈠埌宸ヤ綔娴佺洰鏍囪妭鐐�' - } else if (checkIds.length === 0 && line.mknode !== 'startEdge' && line.mknode !== 'endEdge') { + } else if (checkIds.length === 0 && !['startEdge', 'endEdge', 'throughEdge'].includes(line.mknode)) { error = '鏈幏鍙栧埌涓嬩竴姝ュ鎵逛汉' } else if (line.approvalMethod === 'countersign' && (!node.checkIds || !node.checkIds.includes(userid))) { error = '褰撳墠鐢ㄦ埛涓嶅湪瀹℃壒浜哄垪琛ㄤ腑' @@ -2453,6 +2485,8 @@ } } + _sql = _sql.replace(/@works_flow_sign@/ig, `'${sign}'`) + _sql = _sql.replace(/@check_userids@/ig, `'${checkIds.join(',')}'`) _sql = _sql.replace(/@notice_userids@/ig, `'${noticeIds.join(',')}'`) diff --git a/src/views/login/index.scss b/src/views/login/index.scss index 58f4397..a5b2e89 100644 --- a/src/views/login/index.scss +++ b/src/views/login/index.scss @@ -291,6 +291,12 @@ } } } + + .qr-wrap + img { + width: 24px; + margin-right: 5px; + vertical-align: middle; + } } } .mk-user-option { diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index 057d84b..33fca8a 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -9,6 +9,7 @@ import Utils from '@/utils/utils.js' import options from '@/store/options.js' import asyncLoadComponent from '@/utils/asyncLoadComponent' +import wxicon from '@/assets/img/wx-icon.png' import './index.scss' const { warning } = Modal @@ -71,6 +72,11 @@ item.label = '璐﹀彿鐧诲綍' _loginWays.push(item) } else if (item.type === 'app_scan') { + item.label = 'APP鎵爜' + _loginWays.push(item) + hasScan = true + } else if (item.type === 'weixin_scan') { + item.label = '寰俊鎵爜' _loginWays.push(item) hasScan = true } @@ -102,13 +108,13 @@ smsId: smsId, loginWays: _loginWays, activeKey, - scanId: activeKey === 'app_scan' ? Utils.getuuid() : '', + scanId: activeKey === 'app_scan' || activeKey === 'weixin_scan' ? Utils.getuuid() : '', timeout: false, remember, hasScan }) - if (activeKey === 'app_scan') { + if (activeKey === 'app_scan' || activeKey === 'weixin_scan') { this.splitTime = 0 this.timer = setTimeout(() => { this.checkResult() @@ -236,14 +242,20 @@ } } - onChangeTab = (activeKey) => { - this.setState({activeKey, scanId: activeKey === 'app_scan' ? Utils.getuuid() : ''}) + onChangeTab = (key) => { + const { activeKey, loginWays } = this.state - if (this.state.activeKey === 'app_scan') { + if (key === 'scan') { + key = loginWays.filter(item => item.type === 'app_scan' || item.type === 'weixin_scan')[0].type + } + + this.setState({activeKey: key, scanId: key === 'app_scan' || key === 'weixin_scan' ? Utils.getuuid() : ''}) + + if (activeKey === 'app_scan' || activeKey === 'weixin_scan') { this.timer && clearTimeout(this.timer) } - if (activeKey === 'app_scan') { + if (key === 'app_scan' || key === 'weixin_scan') { this.splitTime = 0 this.setState({timeout: false}) this.timer = setTimeout(() => { @@ -429,12 +441,12 @@ const { langList } = this.props const { getFieldDecorator } = this.props.form const { activeKey, verdisabled, delay, loginWays, remember, scanId, timeout, hasScan, users } = this.state - const wayLabels = {app_scan: '鎵爜鐧诲綍', uname_pwd: '璐﹀彿鐧诲綍', sms_vcode: '鐭俊鐧诲綍'} + const wayLabels = {app_scan: 'APP鎵爜', weixin_scan: '寰俊鎵爜', uname_pwd: '璐﹀彿鐧诲綍', sms_vcode: '鐭俊鐧诲綍'} return ( <Form className="login-form" id="login-form" onSubmit={this.handleSubmit}> <div className="login-way-title">{wayLabels[activeKey]}</div> - {hasScan && activeKey !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab('app_scan')}><QrcodeOutlined /></div> : null} + {hasScan && activeKey !== 'app_scan' && activeKey !== 'weixin_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab('scan')}><QrcodeOutlined /></div> : null} {activeKey === 'uname_pwd' ? <div className="form-item-wrap"> <Form.Item> {getFieldDecorator('username', { @@ -559,6 +571,18 @@ <a href="http://www.minkesoft.com/forgotPwd" target="_blank" rel="noopener noreferrer" className="forgot">蹇樿瀵嗙爜锛�</a> </Form.Item> : null} </div> : null} + {activeKey === 'weixin_scan' ? <div className="form-item-wrap"> + <div className="form-scan-wrap"> + <div className="qr-wrap"> + {scanId ? <QrCode card={{qrWidth: 500, color: '#000000'}} value={`https://cloud.mk9h.cn/mob/mknotice.html?originurl=${window.btoa(window.GLOB.baseurl + 'mob/index.html#/wx/' + scanId)}`}/> : null} + {timeout ? <div className="qrcode-out"> + <RedoOutlined onClick={this.reCode} /> + 浜岀淮鐮佸凡澶辨晥銆� + </div> : null} + </div> + <img src={wxicon} alt=""/>璇蜂娇鐢ㄥ井淇℃壂涓�鎵櫥褰� + </div> + </div> : null} {activeKey === 'app_scan' ? <div className="form-item-wrap"> <div className="form-scan-wrap"> <div className="qr-wrap"> @@ -571,9 +595,11 @@ 璇蜂娇鐢ㄥ鎴风鎵竴鎵櫥褰� </div> </div> : null} - <div className={'login-ways ' + (activeKey === 'app_scan' ? 'center' : '')}> + <div className={'login-ways ' + (activeKey === 'app_scan' || activeKey === 'weixin_scan' ? 'center' : '')}> {loginWays.map(item => { - if (item.type === 'app_scan' || activeKey === item.type) return null + if (activeKey === item.type) return null + if (item.type === 'app_scan' && activeKey !== 'weixin_scan') return null + if (item.type === 'weixin_scan' && activeKey !== 'app_scan') return null return (<span key={item.type} onClick={() => this.onChangeTab(item.type)}>{item.label}</span>) })} </div> -- Gitblit v1.8.0