From 3672b83182a648733ff245bd690f170d68cc80a9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 五月 2023 17:38:27 +0800 Subject: [PATCH] 2023-05-15 --- public/options.json | 10 +- src/tabviews/custom/components/module/voucher/voucherTable/index.jsx | 12 +++ package-lock.json | 58 +++++++++++++------ src/tabviews/custom/components/module/voucher/index.jsx | 20 +++--- src/tabviews/custom/index.jsx | 6 + package.json | 1 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 15 ++-- 7 files changed, 78 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40ebbc0..ef69c52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -624,24 +624,28 @@ } }, "@antv/x6": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/@antv/x6/-/x6-1.33.0.tgz", - "integrity": "sha512-B9KkOZJrhgjwDfwUBl58YAGcnD3lpebVaGPGxFMtLcBWmM7K6aDu+TK0CbcdoTS99OyqUQkzNI4O4RFwrw+SRA==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@antv/x6/-/x6-2.10.1.tgz", + "integrity": "sha512-38Fi9Qgnp+ylTrnRnhrGsc2cxsDosULbN6toVs9GjVpOguzq3oxRUblzO6dcnJhbzXfZxIcB/IuQt3pYpXJBKA==", "requires": { - "csstype": "^3.0.3", - "jquery": "^3.5.1", - "jquery-mousewheel": "^3.1.13", - "lodash-es": "^4.17.15", - "mousetrap": "^1.6.5", + "@antv/x6-common": "^2.0.12", + "@antv/x6-geometry": "^2.0.5", "utility-types": "^3.10.0" - }, - "dependencies": { - "csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" - } } + }, + "@antv/x6-common": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@antv/x6-common/-/x6-common-2.0.12.tgz", + "integrity": "sha512-7PcvHGJ2UhrBEtsLI6MaHw6BCMhy22leCH8vCaMvmF32EEQ/491v6DKVPhcpp0dYZNERpfqvAB1w407Aw+bwLA==", + "requires": { + "lodash-es": "^4.17.15", + "utility-types": "^3.10.0" + } + }, + "@antv/x6-geometry": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@antv/x6-geometry/-/x6-geometry-2.0.5.tgz", + "integrity": "sha512-MId6riEQkxphBpVeTcL4ZNXL4lScyvDEPLyIafvWMcWNTGK0jgkK7N20XSzqt8ltJb0mGUso5s56mrk8ysHu2A==" }, "@antv/x6-react-components": { "version": "1.1.15", @@ -795,6 +799,24 @@ "d3-force": "^2.0.1", "ml-matrix": "^6.5.0" } + }, + "@antv/x6": { + "version": "1.34.13", + "resolved": "https://registry.npmjs.org/@antv/x6/-/x6-1.34.13.tgz", + "integrity": "sha512-gYFxh9Sd1UXPO0aO9LHclASacT6HKkG7AP9XQqRuuCcJYWQiZVRmTN1mYQf3lTZDdybdI6IisZp6zFoGjmFxig==", + "requires": { + "csstype": "^3.0.3", + "jquery": "^3.5.1", + "jquery-mousewheel": "^3.1.13", + "lodash-es": "^4.17.15", + "mousetrap": "^1.6.5", + "utility-types": "^3.10.0" + } + }, + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" } } }, @@ -12591,9 +12613,9 @@ "integrity": "sha512-JNAkmPeB/GS2tCRqUzRPsTOHpGDah7xP18vGJfIjZC+W2sxEHbxgJxetIjIqhjQ3yYbYNEELkM/spKLtwoOSUQ==" }, "jquery": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", - "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" }, "jquery-mousewheel": { "version": "3.1.13", diff --git a/package.json b/package.json index 2f95956..c34f77a 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@antv/g2": "^4.1.34", "@antv/g6": "^4.6.4", "@antv/util": "^2.0.17", + "@antv/x6": "^2.10.1", "@antv/xflow": "^1.0.50", "@babel/core": "7.5.5", "@svgr/webpack": "4.3.2", diff --git a/public/options.json b/public/options.json index bedcbee..4e405d0 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "202108312122504607B107A83F55B40C98CCF", - "appkey": "20210831212235413F287EC3BF489424496C8", + "appId": "201912040924165801464FF1788654BC5AC73", + "appkey": "20191106103859640976D6E924E464D029CF0", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "", "lineColor": "", "filter": "false", - "defaultApp": "mkindustry", + "defaultApp": "mk", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -17,6 +17,6 @@ "transfer": "false", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://demo.mk9h.cn", - "service": "erp_new/" + "host": "http://qingqiumarket.cn", + "service": "MKWMS/" } \ No newline at end of file diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index bd07284..d08ab38 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -220,11 +220,11 @@ }) res.logistics && res.logistics.forEach(item => { - logistics.push({value: item.suppliercode, label: item.suppliername}) + logistics.push({value: item.logistics_code, label: item.logistics_name}) }) res.lessor && res.lessor.forEach(item => { - lessor.push({value: item.suppliercode, label: item.suppliername}) + lessor.push({value: item.lessor_code, label: item.lessor_name}) }) res.customer && res.customer.forEach(item => { @@ -422,11 +422,11 @@ err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'logistics') { - if (!item.suppliercode || !item.suppliername) { + if (!item.logistics_code || !item.logistics_name) { err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'lessor') { - if (!item.suppliercode || !item.suppliername) { + if (!item.lessor_code || !item.lessor_name) { err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'customer') { @@ -606,7 +606,7 @@ supMap.delete(item.uuid + n.sup_acc_type) } - sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0`) + sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`) }) } return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.debit ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}'` @@ -629,7 +629,7 @@ }) supMap.forEach(n => { - sup_data.push(`'${n.uuid}','${n.sup_voucher_code}','${n.sup_voucher_lp}','${n.voucher_sup_lp || ''}','${n.sup_subject_code}','${n.sup_subject_name}','${n.sup_voucher_text || ''}','${n.sup_direct}',${n.sup_net_amount},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${n.sup_bid}',1`) + sup_data.push(`'${n.uuid}','${n.sup_voucher_code}','${n.sup_voucher_lp}','${n.voucher_sup_lp || ''}','${n.sup_subject_code}','${n.sup_subject_name}','${n.sup_voucher_text || ''}','${n.sup_direct}',${n.sup_net_amount},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${n.sup_bid}',1,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`) }) let attachments_data = [] @@ -724,11 +724,11 @@ err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'logistics') { - if (!item.suppliercode || !item.suppliername) { + if (!item.logistics_code || !item.logistics_name) { err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'lessor') { - if (!item.suppliercode || !item.suppliername) { + if (!item.lessor_code || !item.lessor_name) { err = `绗�${_index}琛岋紝璇烽�夋嫨杈呭姪鏍哥畻銆俙 } } else if (item.sup_acc_type === 'customer') { @@ -890,7 +890,7 @@ supMap.delete(item.uuid + n.sup_acc_type) } - sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit || 0},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0`) + sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit || 0},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`) }) } return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit || 0},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.direct ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}'` @@ -905,7 +905,7 @@ }) supMap.forEach(n => { - sup_data.push(`'${n.uuid}','${n.sup_voucher_code}','${n.sup_voucher_lp}','${n.voucher_sup_lp || ''}','${n.sup_subject_code}','${n.sup_subject_name}','${n.sup_voucher_text || ''}','${n.sup_direct}',${n.sup_net_amount},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${n.sup_bid}',1`) + sup_data.push(`'${n.uuid}','${n.sup_voucher_code}','${n.sup_voucher_lp}','${n.voucher_sup_lp || ''}','${n.sup_subject_code}','${n.sup_subject_name}','${n.sup_voucher_text || ''}','${n.sup_direct}',${n.sup_net_amount},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${n.sup_bid}',1,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`) }) param.subject_data = window.btoa(window.encodeURIComponent(subject_data.join(';un'))) diff --git a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx index 5e3b17c..914d039 100644 --- a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx +++ b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx @@ -108,8 +108,12 @@ let account = {} subAccounts.forEach(item => { - if (item.field === 'supplier' || item.field === 'logistics' || item.field === 'lessor') { + if (item.field === 'supplier') { account[item.field] = {suppliercode: item.value, suppliername: item.name} + } else if (item.field === 'logistics') { + account[item.field] = {logistics_code: item.value, logistics_name: item.name} + } else if (item.field === 'lessor') { + account[item.field] = {lessor_code: item.value, lessor_name: item.name} } else if (item.field === 'customer') { account[item.field] = {customercode: item.value, customername: item.name} } else if (item.field === 'department') { @@ -762,8 +766,12 @@ if (record.sup_accounting && record.supAccounts) { record.supAccounts.forEach(item => { - if (item.sup_acc_type === 'supplier' || item.sup_acc_type === 'logistics' || item.sup_acc_type === 'lessor') { + if (item.sup_acc_type === 'supplier') { val += item.suppliercode ? '_' + item.suppliercode + ' ' + item.suppliername : '' + } else if (item.sup_acc_type === 'logistics') { + val += item.logistics_code ? '_' + item.logistics_code + ' ' + item.logistics_name : '' + } else if (item.sup_acc_type === 'lessor') { + val += item.lessor_code ? '_' + item.lessor_code + ' ' + item.lessor_name : '' } else if (item.sup_acc_type === 'customer') { val += item.customercode ? '_' + item.customercode + ' ' + item.customername : '' } else if (item.sup_acc_type === 'department') { diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 2a2e40f..fe8a4d0 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1413,19 +1413,18 @@ let _data = edData.filter(item => item.$$uuid !== record.$$uuid) this.setState({edData: _data}) } else { - let _data = edData.map(item => { + let _data = fromJS(edData).toJS().map(item => { if (item.$$uuid === record.$$uuid) { - record.$deleted = true - record.$origin = false - record.$type = 'del' - return record - } else { - return item + item.$deleted = true + item.$origin = false + item.$type = 'del' } + + return item }) this.setState({edData: _data}, () => { - if (setting.commit === 'simple' && record.$deleted) { + if (setting.commit === 'simple') { this.submit() } }) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index ff11815..1ddc4d0 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -716,7 +716,11 @@ return group }) } else if (item.subtype === 'voucher') { - item.wrap.supModule = item.wrap.supModule.pop() + if (item.wrap.supModule && item.wrap.supModule.length > 0) { + item.wrap.supModule = item.wrap.supModule.pop() + } else { + item.wrap.supModule = '' + } } return true -- Gitblit v1.8.0