diff --git a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js index 60422bf8..71b9b94f 100644 --- a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js +++ b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js @@ -37,3 +37,12 @@ export const exportSIReport = (params) => { export const genAndPreveiw = (params) => { return postFetch("/api/bs/hrmsalary/ly/PZ/genAndPreveiw", params); }; +export const pushUCAndSave = (params) => { + return postFetch("/api/bs/hrmsalary/ly/PZ/pushUCAndSave", params); +}; +export const getHistoryVoucherList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/PZ/historyVoucherList", params); +}; +export const getHistoryVoucherDetailList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/PZ/historyVoucherDetailList", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js new file mode 100644 index 00000000..6e6f9555 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js @@ -0,0 +1,26 @@ +/* + * 自定义浏览框组件 + * 单选 + * @Author: 黎永顺 + * @Date: 2024/9/3 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import AssociativeSearchMult from "./associativeSearchMult"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeSearchSingle extends Component { + + + render() { + return ( + + ); + } +} + +export default AssociativeSearchSingle; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js index d68b2af3..d55b88ed 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -1,6 +1,6 @@ /* * 自定义浏览框组件 - * + * 多选 * @Author: 黎永顺 * @Date: 2024/8/29 * @Wechat: @@ -38,14 +38,24 @@ class AssociativeSearchMult extends Component { this.getData(value); }; getData = (name = "") => { - const { completeURL = "/api/bs/hrmsalary/salarysob/listByTaxAgent" } = this.props; + const { browserConditionParam } = this.props; + const { completeURL, searchParamsKey, convertDatasource } = browserConditionParam; if (_.trim(name)) { - postFetch(completeURL, { taxAgentId: "19", name }).then(({ status, data }) => { - this.setState({ loading: false }); - if (status) { - this.setState({ data: _.map(data, o => ({ ...o, id: String(o.id) })), activeKey: this.getActiveKey(data) }); - } - }); + postFetch(completeURL, { [searchParamsKey]: name, current: 1, pageSize: 9999 }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + this.setState({ + data: convertDatasource ? convertDatasource(data.list) : data.list, + activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) + }); + } else { + this.setState({ + data: _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), + activeKey: this.getActiveKey(data) + }); + } + }); } else { this.setState({ data: [], loading: false, activeKey: "" }); } @@ -83,14 +93,34 @@ class AssociativeSearchMult extends Component { const { datas, selectedValues } = this.props; if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas); }; + isReadOnly = () => { + const { viewAttr } = this.props; + return viewAttr === 1 || viewAttr === "1"; + }; render() { const { data, dropdownWidth } = this.state; - const { viewAttr, selectedValues, datas } = this.props; + const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props; const clsname = classNames({ "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues), - "mr12": viewAttr === "3" && _.isEmpty(selectedValues) + "mr12": viewAttr === "3" && _.isEmpty(selectedValues), + "wea-associative-single": (isSingle || browserConditionParam.isSingle), + "wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle) }); + if (this.isReadOnly()) { + let arr = []; + selectedValues && selectedValues.map(v => { + let item = datas[v].name; + if (_.isString(item)) { + arr.push({item}); + } else { + arr.push( ); + } + }); + return ( + {arr} + ); + } let options = data.map(d => ); selectedValues && selectedValues.map((v) => { v && options.unshift(); @@ -116,7 +146,7 @@ class AssociativeSearchMult extends Component { {options} ; return ( -
+
{select}
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index 774b64c7..25dc8d1e 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; import { Button, Col, Row, Spin } from "antd"; import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; import CustomBrowserMutiRight from "./customBrowserMutiRight"; @@ -21,60 +21,129 @@ class CustomBrowserDialog extends Component { constructor(props) { super(props); this.state = { - loading: false, listDatas: [] + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [] }; + this.selectedData = {}; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible) this.getData(); + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(); + if (nextProps.visible !== this.props.visible && nextProps.visible) this.setState({ selectedRowKeys: nextProps.selectedValues }); } getData = (query = {}) => { - const { completeURL = "/api/bs/hrmsalary/salarysob/listByTaxAgent" } = this.props; + const { pageInfo } = this.state; + const { dialogType, completeURL, convertDatasource } = this.props; + let payload = {}; + dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query }); this.setState({ loading: true }); - postFetch(completeURL, { taxAgentId: "19", ...query }).then(({ status, data }) => { + postFetch(completeURL, payload).then(({ status, data }) => { this.setState({ loading: false }); - if (status) { - this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + this.setState({ listDatas: data }); } }); }; + handleRowClick = record => { + if (!this.props.isSingle) return; + const values = [record.id]; + const selectedData = { [record["id"]]: record }; + this.props.onCancel(); + this.props.onChange && this.props.onChange(values, selectedData); + }; + handleClear = () => { + this.props.onCancel(); + this.props.onChange && this.props.onChange([], {}); + }; + handleOk = () => { + const { selectedRowKeys } = this.state; + this.selectedData = {}; + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(selectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (id === listDatas[i].id) return listDatas[i]; + } + } + }; render() { - const { loading, listDatas } = this.state; + const { loading, listDatas, pageInfo, selectedRowKeys } = this.state; + const { dialogType, tableProps: { rowKey, columns }, isSingle } = this.props; const sheight = this.dialog ? this.dialog.state.height - 55 : 260; + const buttons = [ + , + , + ]; + let dom = +
+
+ + + +
+ + + +
+
+
+ +
+
+ +
+
+
; + if (dialogType === "table") { + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getData()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData()); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + dom = ; + } + dialogType === "table" && isSingle && buttons.splice(0, 1); return ( this.dialog = dom} title={getLabel(111, "数据选择")} className="custom_browser_dialog" style={{ width: 784, height: 460, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" - }} buttons={[ - , - , - ]}> - -
-
- - - -
- - - -
-
-
- -
-
- -
-
-
+ }} buttons={buttons}> + {dom}
); } diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index 42b8fe6f..3b9fb3ed 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -10,6 +10,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import AssociativeSearchMult from "./components/associativeSearchMult"; +import AssociativeSearchSingle from "./components/AssociativeSearchSingle"; import CustomBrowserDialog from "./components/customBrowserDialog"; import classNames from "classnames"; import "./index.less"; @@ -27,8 +28,30 @@ class Index extends Component { }; } + componentDidMount() { + const { value, fieldConfig } = this.props; + const { browserConditionParam: { replaceDatas = [] } } = fieldConfig; + if (value && replaceDatas.length > 0) { + this.setState({ + searchKeys: value.split(","), + selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {}) + }); + } + } + renderSingle = () => { - return null; + const { fieldConfig } = this.props; + const { selectedData, searchKeys } = this.state; + return (
+ +
); }; renderMult = () => { const { fieldConfig } = this.props; @@ -45,12 +68,16 @@ class Index extends Component {
); }; onBrowerChangeHandler = (values, datas) => { - const { form, fieldConfig } = this.props; - this.setState({ searchKeys: values, selectedData: datas }, () => { + const { form, fieldConfig, isSingle } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + this.setState({ + searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values, + selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas + }, () => { this.props.onChange && this.props.onChange(values.join(",")); if (form) { form.updateFields({ - [getKey(fieldConfig)]: { value: values.join(",") } + [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } }); } }); @@ -63,7 +90,7 @@ class Index extends Component { }; render() { - const { browserDialog } = this.state; + const { browserDialog, selectedData, searchKeys } = this.state; const { isSingle, viewAttr, fieldConfig = {} } = this.props; const { browserConditionParam = {} } = fieldConfig || {}; const className = classNames({ @@ -76,8 +103,9 @@ class Index extends Component { return (
{browser}
this.setState({ browserDialog: { visible: false } })}/> + {...browserDialog} {...browserConditionParam} {...this.props} onChange={this.onBrowerChangeHandler} + onCancel={() => this.setState({ browserDialog: { visible: false } })} + datas={selectedData} selectedValues={searchKeys}/>
); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/index.js b/pc4mobx/hrmSalary/pages/custom-pages/index.js index e4767f84..7fbeb7aa 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/index.js @@ -3,13 +3,16 @@ import Route from "react-router/lib/Route"; import CustomSalarySummary from "./lingyue/salarySummary"; import CustomSocialFundSummary from "./lingyue/socialFundSummary"; import VouncherSummary from "./lingyue/vouncherSummary"; +import HistoryVouncherSummary from "./lingyue/historyVouncherSummary"; const CustomRoutes = [ , , - + , + ]; export default CustomRoutes; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateVouchersDialog.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateVouchersDialog.js index 7da32878..e7555755 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateVouchersDialog.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateVouchersDialog.js @@ -26,8 +26,11 @@ class GenerateVouchersDialog extends Component { } initLYForm = () => { + const { type } = this.props; commonEnumList({ enumClass: "com.engine.salary.enums.ly.LyPZTypeEnum" }) .then(({ status, data }) => { + type === "salarySum" && (data = data.filter(item => !["SBJTPZ", "SBFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum))); + type === "socialFundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ"].includes(item.enum))); if (status) { this.setState({ conditions: _.map(vouchersConditions, item => ({ diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js index 9b2814d2..0530d832 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js @@ -36,7 +36,7 @@ class List extends Component { this.state = { dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false, - voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel } + voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel, type: props.type } }; this.handleDebounce = null; } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/historyVouncherDetail.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/historyVouncherDetail.js new file mode 100644 index 00000000..29906bac --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/historyVouncherDetail.js @@ -0,0 +1,80 @@ +/* + * 领悦汇总标 + * 历史凭证查看详情列表 + * @Author: 黎永顺 + * @Date: 2024/9/4 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSlideModal, WeaTable } from "ecCom"; +import * as API from "../../../../apis/custom-apis/lingyue"; + +const getLabel = WeaLocaleProvider.getLabel; + +class HistoryVouncherDetail extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getHistoryVoucherDetailList(nextProps.id); + } + + getHistoryVoucherDetailList = (id) => { + this.setState({ loading: true }); + API.getHistoryVoucherDetailList({ id }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) this.setState({ + dataSource: data.data, + columns: _.map(data.columns, o => { + if (["fzhsXmqsBrowser", "fzhsXmqsBrowser", "fzhsSllbBrowser", "fzhsKsBrowser"].includes(o.dataIndex)) { + return { + ...o, + render: text => ( + {text && {`${text.fzhslx}:${text.bh}/${text.mc}`}}) + }; + } else if (o.dataIndex === "fzhsOtherBrowserList") { + return { + ...o, render: text => { + let arr = []; + text && text.map(v => { + arr.push({`${v.fzhslx}:${v.bh}/${v.mc}`}); + }); + return ({arr}); + } + }; + } + return { ...o }; + }) + }); + }); + }; + renderTitle = () => { + return
+
+
+
{getLabel(111, "历史凭证明细")}
+
+
+
; + }; + + render() { + const { dataSource, columns, loading } = this.state; + return ( + } + /> + ); + } +} + +export default HistoryVouncherDetail; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/index.js new file mode 100644 index 00000000..210ab44f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/historyVouncherSummary/index.js @@ -0,0 +1,101 @@ +/* + * 领悦历史凭证汇总 + * 历史凭证列表 + * @Author: 黎永顺 + * @Date: 2024/9/4 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDatePicker, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import HistoryVouncherDetail from "./historyVouncherDetail"; +import * as API from "../../../../apis/custom-apis/lingyue"; +import moment from "moment"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + query: { salaryMonth: moment().format("YYYY-MM"), frzt: "" }, detail: { visible: false, id: "" } + }; + } + + componentDidMount() { + this.getHistoryVoucherList(); + } + + getHistoryVoucherList = () => { + const { pageInfo, query } = this.state; + const payload = { ...pageInfo, ...query }; + this.setState({ loading: true }); + API.getHistoryVoucherList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [ + ...columns, { + dataIndex: "options", title: getLabel(111, "操作"), width: 150, + render: (__, record) => ( this.setState({ + detail: { visible: true, id: record.id } + })}>{getLabel(111, "查看详情")}) + } + ] + }); + } + }); + }; + + render() { + const { query, dataSource, columns, pageInfo, loading, detail } = this.state; + const { salaryMonth, frzt } = query; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getHistoryVoucherList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getHistoryVoucherList()); + } + }; + return ( + } showDropIcon={false} + iconBgcolor="#F14A2D" className="custom_vouchers_lingyue" + buttons={[ + + this.setState({ + query: { ...query, salaryMonth: value }, + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getHistoryVoucherList())}/> + , + + this.setState({ query: { ...query, frzt: value } })} + onSearch={() => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getHistoryVoucherList())}/> + + ]}> +
+ + this.setState({ detail: { ...detail, visible: false } })}/> +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/index.less b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/index.less index e8c89c3e..4404e46e 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/index.less +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/index.less @@ -25,14 +25,65 @@ //凭证汇总表 .custom_vouchers_lingyue { + .wea-new-top { + .wea-form-item { + min-width: 250px; + } + } + .vouchers-body { height: 100%; padding: 16px 16px 0 16px; background: #F6F6F6; overflow-y: hidden; - .wea-table-edit { + .wea-table-edit, .wea-new-table { background: #FFF; } + + .history_vouncher_detail { + .wea-slide-modal-content { + height: 100%; + padding: 16px; + background: #F6F6F6; + overflow-y: hidden; + } + + .titleDialog { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 46px 0 16px; + background: #FFF; + + .titleCol { + flex: 1; + display: flex; + align-items: center; + } + + .titleLeftBox { + .titleIcon { + color: #fff; + margin: 0; + width: 40px; + height: 40px; + line-height: 40px; + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + background: #F14A2D; + border-radius: 50%; + } + + .title { + font-size: 14px; + color: #333; + padding-left: 6px; + } + } + } + } } } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js index 2777de57..62ade4d2 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js @@ -11,6 +11,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import Layout from "../layout"; import List from "../components/list"; +import * as API from "../../../../apis/custom-apis/lingyue"; const getLabel = WeaLocaleProvider.getLabel; @@ -18,19 +19,23 @@ class Index extends Component { constructor(props) { super(props); this.state = { - query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false + query: { salaryMonth: moment().format("YYYY-MM"), ffgsqc: "" }, isQuery: false, lyAuth: false }; this.listRef = null; } + componentDidMount() { + API.getLYPermission().then(({ status, data }) => this.setState({ lyAuth: !!status && !!data })); + } + handleLayoutChange = ({ isQuery, ...val }) => this.setState({ query: { ...this.state.query, ...val } }, () => this.setState({ isQuery })); render() { - const { query, isQuery } = this.state; + const { query, isQuery, lyAuth } = this.state; return ( + listRef={this.listRef} isQuery={isQuery} lyAuth={lyAuth} ffgsqcLabel={getLabel(111, "购买公司全称")}> this.listRef = dom} onInit={() => this.forceUpdate()} ffgsqcLabel={getLabel(111, "购买公司全称")}/> diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/vouncherSummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/vouncherSummary/index.js index eef1be5c..6517545b 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/vouncherSummary/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/vouncherSummary/index.js @@ -8,19 +8,20 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTableEdit, WeaTop } from "ecCom"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaTableEdit, WeaTop } from "ecCom"; +import { Button, message } from "antd"; import * as API from "../../../../apis/custom-apis/lingyue"; import { getQueryString, getURLParameters } from "../../../../util/url"; import CustomBrowser from "../../../../components/CustomBrowser"; const getLabel = WeaLocaleProvider.getLabel; -const pzlxEnum = ["0", "1", "2"]; +const pzlxEnum = ["0", "1", "2"];//非计提类型的凭证列表可编辑 class Index extends Component { constructor(props) { super(props); this.state = { - datas: [], columns: [] + datas: [], columns: [], loading: false }; } @@ -30,13 +31,13 @@ class Index extends Component { genAndPreveiw = () => { const pzlx = getQueryString("pzlx"); - this.setState({ loading: true }); const payload = { ...getURLParameters(window.location.hash), ffgsqc: decodeURI(getURLParameters(window.location.hash).ffgsqc) }; + WeaLoadingGlobal.start(); API.genAndPreveiw(payload).then(({ status, data }) => { - this.setState({ loading: false }); + WeaLoadingGlobal.destroy(); if (status) { const { columns, data: datas } = data; this.setState({ @@ -45,11 +46,38 @@ class Index extends Component { com: [ { key: col.column, otherParams: { precision: 2 }, - type: (col.column === "zy" || col.column === "kjkm") ? "INPUT" : + type: (col.column === "zy" || col.column === "kjkm") ? "TEXTAREA" : (col.column === "jfValue" || col.column === "dfValue") ? "INPUTNUMBER" : "custom", viewAttr: !pzlxEnum.includes(pzlx) ? 2 : 1, render: (text, record, index, onEdit) => { - return ; + const value = _.isArray(text) ? _.map(text, o => o.bh).join(",") : !_.isNil(text) ? text.bh : ""; + const replaceDatas = _.isArray(text) ? _.map(text, o => ({ + ...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}` + })) : !_.isNil(text) ? [{ ...text, id: text.bh, name: `${text.fzhslx}:${text.bh}/${text.mc}` }] : []; + return _.map(datas, o => ({ + ...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}` + })), + completeURL: "/api/bs/hrmsalary/ly/PZ/fzhsBrowserList" + } + }} + value={value} + onChange={(value) => onEdit({ + record: { ...record, [col["column"]]: value }, index + })} + />; } } ] @@ -58,14 +86,42 @@ class Index extends Component { } }); }; + pushNotifications = () => { + const { datas } = this.state; + const payload = { + ...getURLParameters(window.location.hash), + ffgsqc: decodeURI(getURLParameters(window.location.hash).ffgsqc), + dataSource: _.head(datas).dataSource, + details: _.map(datas, o => ({ + zy: o.zy, kjkm: o.kjkm, jfValue: o.jfValue, dfValue: o.dfValue, + fzhsXmqs: !o.fzhsXmqs ? "" : _.isString(o.fzhsXmqs) ? o.fzhsXmqs : o.fzhsXmqs.bh, + fzhsFwlb: !o.fzhsFwlb ? "" : _.isString(o.fzhsFwlb) ? o.fzhsFwlb : o.fzhsFwlb.bh, + fzhsSllb: !o.fzhsSllb ? "" : _.isString(o.fzhsSllb) ? o.fzhsSllb : o.fzhsSllb.bh, + fzhsKs: !o.fzhsKs ? "" : _.isString(o.fzhsKs) ? o.fzhsKs : o.fzhsKs.bh, + fzhsOtherBmList: !o.fzhsOther ? [] : _.isString(o.fzhsOther) ? o.fzhsOther.split(",") : _.map(o.fzhsOther, o => (o.bh)) + })) + }; + this.setState({ loading: true }); + API.pushUCAndSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + window.close(); + } else { + message.error(errormsg); + } + }); + }; render() { - const { datas, columns } = this.state; + const { datas, columns, loading } = this.state; const pzlx = getQueryString("pzlx"); return ( } buttons={[]} showDropIcon={false} - iconBgcolor="#F14A2D" className="custom_vouchers_lingyue"> + title={getLabel(111, "凭证预览汇总表")} icon={} showDropIcon={false} + iconBgcolor="#F14A2D" className="custom_vouchers_lingyue" + buttons={[]}>
this.tableEdit = el} showCopy={false} deleteConfirm