From db731b1d8b3ed1fcce588307b8bd5eccc4f805b2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 五月 2024 11:30:39 +0800 Subject: [PATCH] 2024-05-08 --- src/views/menudesign/popview/index.jsx | 4 src/menu/components/module/invoice/index.jsx | 9 src/templates/zshare/verifycard/index.jsx | 7 src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx | 38 +++++- src/views/mobdesign/popview/index.jsx | 4 src/templates/zshare/verifycard/customscript/index.jsx | 30 ++-- src/tabviews/custom/components/module/invoice/index.scss | 17 ++ src/tabviews/custom/components/module/invoice/subTable/index.jsx | 2 src/tabviews/custom/components/module/invoice/index.jsx | 147 +++++++++++------------ src/menu/debug/index.jsx | 12 + src/templates/zshare/verifycard/baseform/index.jsx | 21 +++ src/tabviews/zshare/actionList/normalbutton/index.jsx | 5 src/menu/components/module/invoice/index.scss | 4 src/views/tabledesign/popview/index.jsx | 4 src/utils/utils.js | 27 ++- 15 files changed, 201 insertions(+), 130 deletions(-) diff --git a/src/menu/components/module/invoice/index.jsx b/src/menu/components/module/invoice/index.jsx index 0dc2570..2cd189f 100644 --- a/src/menu/components/module/invoice/index.jsx +++ b/src/menu/components/module/invoice/index.jsx @@ -109,8 +109,8 @@ ['灏忚妯$撼绋庝汉寰佹敹鐜�', 'small_tax_rate', 'Decimal(18,2)'], ['鏄惁浜彈浼樻儬鏀跨瓥', 'free_tax_mark'], ['浼樻儬鏀跨瓥绫诲瀷', 'vat_special_management'], - ['tax_item', 'tax_item'], - ['tax_method', 'tax_method'], + ['寰佺◣椤圭洰', 'tax_item'], + ['璁$◣鏂规硶', 'tax_method'], ] details.forEach((cell, index) => { @@ -156,8 +156,8 @@ ['绋庨', 'tax_amount', 'Decimal(18,2)'], ['鏄惁浜彈浼樻儬鏀跨瓥', 'free_tax_mark'], ['浼樻儬鏀跨瓥绫诲瀷', 'vat_special_management'], - ['tax_item', 'tax_item'], - ['tax_method', 'tax_method'], + ['寰佺◣椤圭洰', 'tax_item'], + ['璁$◣鏂规硶', 'tax_method'], ] cols.forEach((cell, index) => { @@ -300,6 +300,7 @@ </Popover> <div className="inv-action"> {card.wrap.backBtn === 'show' ? <Button className="mk-back"><LeftOutlined />杩斿洖</Button> : null} + <Button className="mk-addinv">鏂板鍙戠エ</Button> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <EditOutlined style={{color: '#1890ff'}} onClick={() => this.setState({btn: card.billSaveBtn})} title="缂栬緫"/> diff --git a/src/menu/components/module/invoice/index.scss b/src/menu/components/module/invoice/index.scss index 92fa62c..49cfa86 100644 --- a/src/menu/components/module/invoice/index.scss +++ b/src/menu/components/module/invoice/index.scss @@ -37,6 +37,10 @@ .mk-back::after { display: none; } + .mk-addinv, .mk-addinv:active, .mk-addinv:focus { + color: #52c41a; + border-color: #52c41a; + } .mk-bill:hover, .mk-bill:active, .mk-bill:focus { color: var(--mk-sys-color); border-color: var(--mk-sys-color); diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index 00257da..d8ca06e 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1286,18 +1286,20 @@ /* 宸ヤ綔娴侀粯璁ql */ insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ + insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) + select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' ` } else { _sql += ` /* 宸ヤ綔娴侀粯璁ql */ - update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${verify.flowRemark ? ',remark=@' + verify.flowRemark : ''} where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${verify.flowRemark ? ',remark' : ''}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${verify.flowRemark ? ',@' + verify.flowRemark : ''} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 diff --git a/src/tabviews/custom/components/module/invoice/index.jsx b/src/tabviews/custom/components/module/invoice/index.jsx index def7f66..a6c61d6 100644 --- a/src/tabviews/custom/components/module/invoice/index.jsx +++ b/src/tabviews/custom/components/module/invoice/index.jsx @@ -14,8 +14,6 @@ import SubTable from './subTable' import './index.scss' -const { confirm } = Modal - class InvoiceModule extends Component { static propTpyes = { config: PropTypes.object @@ -81,6 +79,7 @@ _config.buyer = this.formatSetting(_config.buyer, 'buyer') _config.detail = this.formatSetting(_config.detail, 'detail') + _config.detail.uuid = _config.uuid let book = null let pas = {} @@ -145,6 +144,8 @@ cell.Hide = 'true' } else if (['from_to_email', 'from_to_mob'].includes(cell.field)) { cell.Width = 80 + } else if (['from_to_name'].includes(cell.field)) { + cell.Width = 140 } return cell }) @@ -154,7 +155,7 @@ cell.field = 'tax_rate' cell.label = '绋庣巼' } - if (['Description', 'id', 'small_tax_rate', 'free_tax_mark', 'vat_special_management'].includes(cell.field)) { + if (['Description', 'id', 'small_tax_rate', 'free_tax_mark', 'vat_special_management', 'tax_item', 'tax_method'].includes(cell.field)) { cell.Hide = 'true' } else if (['spec'].includes(cell.field)) { cell.Width = 150 @@ -384,25 +385,22 @@ } clearData = () => { - const { from_to_tax_no, oriDetails, details } = this.state - - if (from_to_tax_no || oriDetails.length || details.length) { - this.setState({ - 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: '', - from_to_code: '', - business_type: '', - details: [], - oriDetails: [], - timestamp: new Date().getTime() + '', - }) - } + this.setState({ + ID: Utils.getguid(), + 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: '', + from_to_code: '', + business_type: '', + details: [], + oriDetails: [], + timestamp: new Date().getTime() + '', + }) } changeType = (val) => { @@ -490,30 +488,16 @@ saveType: '' }) if (res.status) { - const that = this - - confirm({ - title: '淇濆瓨鎴愬姛銆�', - okText: '缁х画濉紑', - cancelText: '鍏抽棴', - onOk() { - if (config.billSaveBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') - } - if (config.billSaveBtn.syncComId) { - MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) - } - that.clearData() - }, - onCancel() { - if (config.billSaveBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') - } - if (config.billSaveBtn.syncComId) { - MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) - } - MKEmitter.emit('closeTabView', config.$pageId) - } + if (config.billSaveBtn.reTabId) { + MKEmitter.emit('reloadMenuView', config.billSaveBtn.reTabId, 'table') + } + if (config.billSaveBtn.syncComId) { + MKEmitter.emit('reloadData', config.billSaveBtn.syncComId) + } + notification.success({ + top: 92, + message: '淇濆瓨鎴愬姛銆�', + duration: 5 }) } else { notification.warning({ @@ -854,11 +838,12 @@ }) keys = keys.join(',') + vals = vals.join(',') lines.push({ table: md5(tb + keys), - insert: `Insert into ${tbName} (${keys},[mk_level],[mk_id],[mk_bid])`, - select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` + insert: `Insert into ${tbName} (${keys ? keys + ',' : ''}[mk_level],[mk_id],[mk_bid])`, + select: `Select ${keys ? vals + ',' : ''}'${level}','${id}','${bid}'` }) subObjs.forEach(item => { @@ -952,40 +937,28 @@ } Api.genericInterface(param).then(res => { + this.setState({ + saveType: '' + }) if (res.status) { - const that = this + if (config.billOutBtn.reTabId) { + MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') + } + if (config.billOutBtn.syncComId) { + MKEmitter.emit('reloadData', config.billOutBtn.syncComId) + } + this.clearData() - confirm({ - title: '淇濆瓨鎴愬姛銆�', - okText: '缁х画濉紑', - cancelText: '鍏抽棴', - onOk() { - if (config.billOutBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') - } - if (config.billOutBtn.syncComId) { - MKEmitter.emit('reloadData', config.billOutBtn.syncComId) - } - that.clearData() - }, - onCancel() { - if (config.billOutBtn.reTabId) { - MKEmitter.emit('reloadMenuView', config.billOutBtn.reTabId, 'table') - } - if (config.billOutBtn.syncComId) { - MKEmitter.emit('reloadData', config.billOutBtn.syncComId) - } - MKEmitter.emit('closeTabView', config.$pageId) - } + notification.success({ + top: 92, + message: '寮�绁ㄦ垚鍔熴��', + duration: 5 }) } else { notification.warning({ top: 92, message: res.message, duration: 5 - }) - this.setState({ - saveType: '' }) } }) @@ -1031,6 +1004,27 @@ }) } + addInvice = () => { + const { saveType } = this.state + + if (saveType) { + notification.warning({ + top: 92, + message: saveType === 'bill' ? '鍗曟嵁淇濆瓨涓紝璇风◢鍚庛��' : '寮�绁ㄤ腑锛岃绋嶅悗銆�', + duration: 3 + }) + return + } + + this.clearData() + + notification.success({ + top: 92, + message: '鍗曟嵁宸叉洿鏂般��', + duration: 3 + }) + } + 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 @@ -1053,6 +1047,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.addInvice}>鏂板鍙戠エ</Button> <Button className="mk-bill" loading={saveType === 'bill'} onClick={this.saveBill}>淇濆瓨鍗曟嵁</Button> <Button className="mk-submit" loading={saveType === 'out'} onClick={this.outBill}>鎻愪氦寮�绁�</Button> </div> @@ -1073,7 +1068,7 @@ <div className="inv-buyer"> <div className="inv-label">璐拱鏂�</div> <div className="inv-content"> - <Form.Item required={reqfields.includes('from_to_name')} label={<>鍚�<span></span>绉�</>} extra={<EllipsisOutlined onClick={() => this.setState({visible: true})}/>}> + <Form.Item className="mk-name" required={reqfields.includes('from_to_name')} label={<>鍚�<span></span>绉�</>} extra={<EllipsisOutlined onClick={() => this.setState({visible: true})}/>}> <Input placeholder="璇疯緭鍏ヨ喘涔版柟鍚嶇О" allowClear value={from_to_name} autoComplete="off" onChange={(e) => this.setState({from_to_name: e.target.value})}/> </Form.Item> <Form.Item required={reqfields.includes('from_to_tax_no')} label="绾崇◣浜鸿瘑鍒彿"> @@ -1148,7 +1143,7 @@ <Modal title="瀹㈡埛淇℃伅" visible={visible} - width="70vw" + width="75vw" maskClosable={false} onCancel={() => { this.setState({ visible: false }) }} footer={null} diff --git a/src/tabviews/custom/components/module/invoice/index.scss b/src/tabviews/custom/components/module/invoice/index.scss index 987d5a5..e6ea8f7 100644 --- a/src/tabviews/custom/components/module/invoice/index.scss +++ b/src/tabviews/custom/components/module/invoice/index.scss @@ -30,6 +30,10 @@ .mk-back:hover, .mk-back:active, .mk-back:focus { color: var(--mk-sys-color); } + .mk-addinv, .mk-addinv:active, .mk-addinv:focus { + color: #52c41a; + border-color: #52c41a; + } .mk-bill:hover, .mk-bill:active, .mk-bill:focus { color: var(--mk-sys-color); border-color: var(--mk-sys-color); @@ -154,6 +158,10 @@ flex: 1; padding: 6px 0; + .mk-name .ant-input-affix-wrapper .ant-input-suffix { + right: 35px; + } + .ant-form-item { display: flex; padding: 0 5px 0 15px; @@ -266,8 +274,13 @@ } } .inv-table { - .ant-table .ant-table-tbody tr:hover td { - background-color: var(--mk-sys-color1); + .ant-table .ant-table-tbody { + td { + vertical-align: top; + } + tr:hover td { + background-color: var(--mk-sys-color1); + } } } .tb-search-wrap { diff --git a/src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx b/src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx index 154a722..d8ba877 100644 --- a/src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx +++ b/src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx @@ -27,7 +27,7 @@ }) } - onChange = (value, key) => { + onChange = (value, key, nextkey) => { let line = {...this.props.line} if (['bill_count', 'unitprice', 'amount_line'].includes(key)) { @@ -75,10 +75,32 @@ }) this.props.changeLine(line, key) + + if (nextkey) { + let node = document.getElementById(nextkey) + if (node) { + if (node.select) { + node.select() + } else if (node.focus) { + node.focus() + } + } + } + } + + onSkip = (key) => { + let node = document.getElementById(key) + if (node) { + if (node.select) { + node.select() + } else if (node.focus) { + node.focus() + } + } } render() { - const { line, delLine, trigger, field } = this.props + const { line, delLine, trigger, field, pid } = this.props const { bill_count, unitprice, amount_line } = this.state return <div className="mk-tr active"> @@ -86,19 +108,19 @@ <div className="mk-input">{line.productname || ''}<EllipsisOutlined onClick={trigger}/></div> </div> <div className="mk-td"> - <Input defaultValue={line.spec || ''} autoFocus={field === 'spec'} onChange={(e) => this.onChange(e.target.value, 'spec')}/> + <Input defaultValue={line.spec || ''} autoFocus={field === 'spec'} onChange={(e) => this.onChange(e.target.value, 'spec')} onPressEnter={() => this.onSkip(pid + 'mk-invoice-unit')}/> </div> <div className="mk-td"> - <Input defaultValue={line.unit || ''} autoFocus={field === 'unit'} onChange={(e) => this.onChange(e.target.value, 'unit')}/> + <Input id={pid + 'mk-invoice-unit'} defaultValue={line.unit || ''} autoFocus={field === 'unit'} onChange={(e) => this.onChange(e.target.value, 'unit')} onPressEnter={() => this.onSkip(pid + 'mk-invoice-billcount')}/> </div> <div className="mk-td"> - <InputNumber value={bill_count} autoFocus={field === 'bill_count'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({bill_count: val})} onBlur={() => this.onChange(bill_count, 'bill_count')}/> + <InputNumber id={pid + 'mk-invoice-billcount'} value={bill_count} autoFocus={field === 'bill_count'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({bill_count: val})} onPressEnter={() => this.onChange(bill_count, 'bill_count', pid + 'mk-invoice-unitprice')} onBlur={() => this.onChange(bill_count, 'bill_count')}/> </div> <div className="mk-td"> - <InputNumber value={unitprice} autoFocus={field === 'unitprice'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({unitprice: val})} onBlur={() => this.onChange(unitprice, 'unitprice')}/> + <InputNumber id={pid + 'mk-invoice-unitprice'} value={unitprice} autoFocus={field === 'unitprice'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({unitprice: val})} onPressEnter={() => this.onChange(unitprice, 'unitprice', pid + 'mk-invoice-amount')} onBlur={() => this.onChange(unitprice, 'unitprice')}/> </div> <div className="mk-td"> - <InputNumber value={amount_line} autoFocus={field === 'amount_line'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({amount_line: val})} onBlur={() => this.onChange(amount_line, 'amount_line')}/> + <InputNumber id={pid + 'mk-invoice-amount'} value={amount_line} autoFocus={field === 'amount_line'} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({amount_line: val})} onPressEnter={() => this.onChange(amount_line, 'amount_line')} onBlur={() => this.onChange(amount_line, 'amount_line')}/> </div> <div className="mk-td mk-right">{line.tax_name}</div> <div className="mk-td mk-right">{line.tax_amount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')} <span className="del-line" onClick={(e) => delLine(line.uuid, e)}></span> </div> @@ -399,7 +421,7 @@ </div> {data.map(item => { if (editKey === item.uuid) { - return <DetailLine key={item.uuid} line={item} field={key} changeLine={this.changeLine} delLine={this.delLine} trigger={() => this.setState({visible: true})}/> + return <DetailLine key={item.uuid} pid={config.uuid} line={item} field={key} changeLine={this.changeLine} delLine={this.delLine} trigger={() => this.setState({visible: true})}/> } return <div className="mk-tr" key={item.uuid} onClick={() => this.checkLine(item.uuid)}> diff --git a/src/tabviews/custom/components/module/invoice/subTable/index.jsx b/src/tabviews/custom/components/module/invoice/subTable/index.jsx index 953fbe3..6b966e7 100644 --- a/src/tabviews/custom/components/module/invoice/subTable/index.jsx +++ b/src/tabviews/custom/components/module/invoice/subTable/index.jsx @@ -89,7 +89,7 @@ config.columns.forEach(item => { if (item.Hide === 'true') return _columns.push({ - align: 'center', + align: 'left', dataIndex: item.field, title: item.label, sorter: false, diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 30564b9..39d9016 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1638,11 +1638,12 @@ }) keys = keys.join(',') + vals = vals.join(',') lines.push({ table: md5(tb + keys), - insert: `Insert into ${tbName} (${keys},[mk_level],[mk_id],[mk_bid])`, - select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` + insert: `Insert into ${tbName} (${keys ? keys + ',' : ''}[mk_level],[mk_id],[mk_bid])`, + select: `Select ${keys ? vals + ',' : ''}'${level}','${id}','${bid}'` }) subObjs.forEach(item => { diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx index 3e4403f..ea5f30e 100644 --- a/src/templates/zshare/verifycard/baseform/index.jsx +++ b/src/templates/zshare/verifycard/baseform/index.jsx @@ -306,6 +306,7 @@ } let _columns = [] + let remarks = [] if (window.GLOB.process && card.intertype !== 'inner') { let cols = [] fields.forEach(col => { @@ -313,6 +314,10 @@ cols.push(col.field.toLowerCase()) _columns.push(col) + + if (col.type === 'text' && col.field !== 'BID') { + remarks.push(col) + } }) columns.forEach(col => { @@ -586,6 +591,22 @@ </Select> </Form.Item> </Col> : null} + {window.GLOB.process && card.intertype !== 'inner' && verify.workFlow === 'true' && verify.flowType !== 'start' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="鍙�氳繃琛ㄥ崟瀛楁濉啓瀹℃壒鎴栭┏鍥炵殑澶囨敞淇℃伅銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 澶囨敞瀛楁 + </Tooltip> + }> + <Select allowClear value={verify.flowRemark} onChange={(val) => {this.onOptionChange(val || '', 'flowRemark')}}> + {remarks.map(option => + <Select.Option key={option.field} value={option.field}> + {option.label} + </Select.Option> + )} + </Select> + </Form.Item> + </Col> : null} <Col span={24}></Col> <Col span={8}> <Form.Item label={ diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index 6150cb5..b57616f 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -46,7 +46,7 @@ } handleConfirm = () => { - const { type, workFlow, flowType, flowSql, useDefaultSql, defaultsql } = this.props + const { type, workFlow, flowType, flowSql, flowRemark, useDefaultSql, defaultsql } = this.props const { editItem, skip } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { @@ -142,18 +142,20 @@ /* 宸ヤ綔娴侀粯璁ql */ insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ + insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) + select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' ` } else { sql += ` /* 宸ヤ綔娴侀粯璁ql */ - update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${flowRemark ? ',remark=@' + flowRemark : ''} where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${flowRemark ? ',remark' : ''}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${flowRemark ? ',@' + flowRemark : ''} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 @@ -262,7 +264,7 @@ } selectScript = (value, option) => { - const { flowType } = this.props + const { flowType, flowRemark } = this.props if (!value || !option) return @@ -280,15 +282,17 @@ if (flowType === 'start') { value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) - select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@` + select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ + insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) + select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin'` } else { - value = `update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + value = `update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${flowRemark ? ',remark=@' + flowRemark : ''} where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${flowRemark ? ',remark' : ''}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${flowRemark ? ',@' + flowRemark : ''} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 6cebcac..ee82600 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -649,12 +649,13 @@ _verify.scripts = _verify.scripts || [] _verify.cbScripts = _verify.cbScripts || [] - if (window.GLOB.process) { + if (window.GLOB.process && card.intertype !== 'inner') { _verify.workFlow = _verify.workFlow || 'false' _verify.flowType = _verify.flowType || (card.sqlType === 'insert' ? 'start' : 'approval') _verify.flowSql = _verify.flowSql || 'true' } else { delete _verify.workFlow + delete _verify.flowRemark delete _verify.flowType delete _verify.flowSql } @@ -1562,7 +1563,7 @@ // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { - if ((card.sqlType === 'custom' || verify.default === 'false') && verify.scripts.length === 0) { + if ((card.sqlType === 'custom' || verify.default === 'false') && !(verify.workFlow === 'true' && verify.flowSql === 'true') && verify.scripts.length === 0) { notification.warning({ top: 92, message: '涓嶆墽琛岄粯璁ql鏃讹紝蹇呴』璁剧疆鑷畾涔夎剼鏈紒', @@ -1778,6 +1779,7 @@ btn={this.props.card} initsql={this.state.initsql} workFlow={verify.workFlow} + flowRemark={verify.flowRemark} flowType={verify.flowType} flowSql={verify.flowSql} customScripts={verify.scripts} @@ -1794,6 +1796,7 @@ btn={this.props.card} initsql={this.state.initsql} workFlow={verify.workFlow} + flowRemark={verify.flowRemark} flowType={verify.flowType} flowSql={verify.flowSql} customScripts={verify.scripts} diff --git a/src/utils/utils.js b/src/utils/utils.js index d151843..bbee372 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -2298,10 +2298,12 @@ /* 宸ヤ綔娴侀粯璁ql */ insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@ insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid) select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@ + insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone) + select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin' ` } else if (line && line.approvalMethod === 'countersign' && (!node.checkIds || !node.checkIds.includes(userid))) { status = 0 @@ -2351,11 +2353,11 @@ if @works_flow_key_status='Y' begin - update s_my_works_flow set ${field}=${label},status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + update s_my_works_flow set ${field}=${label},status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${verify.flowRemark ? ',remark=@' + verify.flowRemark : ''} where id=@works_flow_key_id - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid,${field}) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@,${label} + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${verify.flowRemark ? ',remark' : ''},${field}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${verify.flowRemark ? ',@' + verify.flowRemark : ''},${label} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 @@ -2380,11 +2382,11 @@ end else begin - update s_my_works_flow set ${field}=${label},modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + update s_my_works_flow set ${field}=${label},modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${verify.flowRemark ? ',remark=@' + verify.flowRemark : ''} where id =@works_flow_key_id - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid,${field}) - select @ID@,@works_flow_code@,@works_flow_name@ ,@s_my_works_flow_log_param,@s_my_works_flow_log_status,@s_my_works_flow_log_statusname,@s_my_works_flow_log_detail_id,@work_group@,@work_grade@,@time_id@,${label} + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${verify.flowRemark ? ',remark' : ''},${field}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@s_my_works_flow_log_param,@s_my_works_flow_log_status,@s_my_works_flow_log_statusname,@s_my_works_flow_log_detail_id,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${verify.flowRemark ? ',@' + verify.flowRemark : ''},${label} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ @@ -2411,14 +2413,17 @@ end set @retmsg='' - update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname${verify.flowRemark ? ',remark=@' + verify.flowRemark : ''} where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 - insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid) - select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@ + insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,bid,createuserid,CreateUser,CreateStaff,upid${verify.flowRemark ? ',remark' : ''}) + select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@bid@,@UserID@,@UserName,@FullName,@time_id@${verify.flowRemark ? ',@' + verify.flowRemark : ''} update s_my_works_flow_role set deleted=10,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 + ${line.mknode === 'startEdge' ? `update s_my_works_flow_role set deleted=0,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname + where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and typecharone='begin'` : ''} + if @check_userids@ != '' begin insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid) diff --git a/src/views/menudesign/popview/index.jsx b/src/views/menudesign/popview/index.jsx index 1cf34b5..394ca23 100644 --- a/src/views/menudesign/popview/index.jsx +++ b/src/views/menudesign/popview/index.jsx @@ -72,13 +72,13 @@ const { oriConfig, config } = this.state if (!is(fromJS(oriConfig), fromJS(config))) { - const _this = this + const that = this confirm({ title: '閰嶇疆宸蹭慨鏀癸紝鏀惧純淇濆瓨鍚楋紵', content: '', onOk() { - _this.props.cancel() + that.props.cancel() }, onCancel() {} }) diff --git a/src/views/mobdesign/popview/index.jsx b/src/views/mobdesign/popview/index.jsx index bfd1bf1..15edee3 100644 --- a/src/views/mobdesign/popview/index.jsx +++ b/src/views/mobdesign/popview/index.jsx @@ -74,13 +74,13 @@ const { oriConfig, config } = this.state if (!is(fromJS(oriConfig), fromJS(config))) { - const _this = this + const that = this confirm({ title: '閰嶇疆宸蹭慨鏀癸紝鏀惧純淇濆瓨鍚楋紵', content: '', onOk() { - _this.props.cancel() + that.props.cancel() }, onCancel() {} }) diff --git a/src/views/tabledesign/popview/index.jsx b/src/views/tabledesign/popview/index.jsx index 66e3c21..05a7425 100644 --- a/src/views/tabledesign/popview/index.jsx +++ b/src/views/tabledesign/popview/index.jsx @@ -68,13 +68,13 @@ const { oriConfig, config } = this.state if (!is(fromJS(oriConfig), fromJS(config))) { - const _this = this + const that = this confirm({ title: '閰嶇疆宸蹭慨鏀癸紝鏀惧純淇濆瓨鍚楋紵', content: '', onOk() { - _this.props.cancel() + that.props.cancel() }, onCancel() {} }) -- Gitblit v1.8.0