feature/2.10.1.2401.01-工资单模板复制以及移动端地址配置

This commit is contained in:
黎永顺 2024-01-24 16:29:27 +08:00
parent a4da6674c5
commit eb9d043d74
6 changed files with 93 additions and 23 deletions

View File

@ -159,9 +159,9 @@ export default class MobilePayroll extends React.Component {
if (status) { if (status) {
const { mySalaryBillData } = this.state; const { mySalaryBillData } = this.state;
const { salaryTemplate } = mySalaryBillData; const { salaryTemplate } = mySalaryBillData;
const { feedbackUrl } = salaryTemplate; const { feedbackUrl, mobileFeedbackUrl } = salaryTemplate;
this.getMySalaryBill(getQueryString("id")); this.getMySalaryBill(getQueryString("id"));
window.location.href = `${window.ecologyContentPath || ""}${feedbackUrl}`; window.location.href = `${window.ecologyContentPath || ""}${getQueryString("type") === "phone" ? mobileFeedbackUrl : feedbackUrl}`;
// window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); // window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`);
} else { } else {
message.error(errorMsg); message.error(errorMsg);

View File

@ -35,7 +35,8 @@ class TemplateBaseSettings extends Component {
ackFeedbackSetting: { ackFeedbackSetting: {
ackStatus: "0", ackStatus: "0",
autoAckDays: 7, autoAckDays: 7,
feedBackUrl: "" feedBackUrl: "",
mobileFeedbackUrl: ""
}, },
salaryBillViewingLimitSetting: { salaryBillViewingLimitSetting: {
limitMonth: 0 limitMonth: 0
@ -68,8 +69,8 @@ class TemplateBaseSettings extends Component {
}; };
salaryBillBaseSetSave = () => { salaryBillBaseSetSave = () => {
const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
const { feedBackUrl } = ackFeedbackSetting; const { feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
if (!feedBackUrl) { if (!feedBackUrl || !mobileFeedbackUrl) {
Modal.warning({ Modal.warning({
title: getLabel(111, "信息确认"), title: getLabel(111, "信息确认"),
content: getLabel(111, "必要信息不完整,红色*为必填项!") content: getLabel(111, "必要信息不完整,红色*为必填项!")
@ -96,7 +97,7 @@ class TemplateBaseSettings extends Component {
render() { render() {
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
const { ackStatus, autoAckDays, feedBackUrl } = ackFeedbackSetting; const { ackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
const { limitMonth = 0 } = salaryBillViewingLimitSetting; const { limitMonth = 0 } = salaryBillViewingLimitSetting;
return ( return (
<React.Fragment> <React.Fragment>
@ -158,7 +159,7 @@ class TemplateBaseSettings extends Component {
style={{ marginLeft: 10 }} style={{ marginLeft: 10 }}
placement="top" width={200}/> placement="top" width={200}/>
</WeaFormItem> </WeaFormItem>
<WeaFormItem label={getLabel(111, "反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}> <WeaFormItem label={getLabel(111, "PC端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
<WeaInput <WeaInput
value={feedBackUrl} viewAttr={3} value={feedBackUrl} viewAttr={3}
onChange={feedBackUrl => this.setState({ onChange={feedBackUrl => this.setState({
@ -167,6 +168,15 @@ class TemplateBaseSettings extends Component {
} }
})}/> })}/>
</WeaFormItem> </WeaFormItem>
<WeaFormItem label={getLabel(111, "移动端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
<WeaInput
value={mobileFeedbackUrl} viewAttr={3}
onChange={mobileFeedbackUrl => this.setState({
ackFeedbackSetting: {
...ackFeedbackSetting, mobileFeedbackUrl
}
})}/>
</WeaFormItem>
</React.Fragment> </React.Fragment>
} }
</WeaSearchGroup> </WeaSearchGroup>

View File

@ -12,6 +12,19 @@ export const copyConditions = [
value: "", value: "",
rules: "required|string", rules: "required|string",
viewAttr: 3 viewAttr: 3
},
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["salarySobId"],
fieldcol: 14,
label: "薪资账套",
lanId: 538010,
labelcol: 6,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
} }
], ],
defaultshow: true, defaultshow: true,
@ -194,8 +207,21 @@ export const tempBaseSetFbConditions = [
conditionType: "INPUT", conditionType: "INPUT",
domkey: ["feedbackUrl"], domkey: ["feedbackUrl"],
fieldcol: 14, fieldcol: 14,
label: "反馈流程地址", label: "PC端反馈流程地址",
lanId: 544096, lanId: 111,
labelcol: 6,
value: "/",
viewAttr: 3,
hide: false,
rules: "required|string"
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobileFeedbackUrl"],
fieldcol: 14,
label: "移动端反馈流程地址",
lanId: 111,
labelcol: 6, labelcol: 6,
value: "/", value: "/",
viewAttr: 3, viewAttr: 3,

View File

@ -6,13 +6,14 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider } from "ecCom"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button, message } from "antd"; import { Button, message } from "antd";
import { getSearchs } from "../../../../util"; import { getSearchs } from "../../../../util";
import { copyConditions } from "../conditions"; import { copyConditions } from "../conditions";
import { duplicatePayroll } from "../../../../apis/payroll"; import { duplicatePayroll, getPayrollTemplateLedgerList } from "../../../../apis/payroll";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("payrollStore") @inject("payrollStore")
@observer @observer
@ -20,15 +21,41 @@ class Index extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loading: false loading: false, conditions: []
}; };
} }
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) nextProps.payrollStore.payrollCopyForm.initFormFields(copyConditions); if (nextProps.visible !== this.props.visible && nextProps.visible) this.getPayrollTemplateLedgerList(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.payrollStore.initPayrollCopyForm(); if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.payrollStore.initPayrollCopyForm();
} }
getPayrollTemplateLedgerList = (props) => {
getPayrollTemplateLedgerList().then(({ status, data }) => {
if (status) {
this.setState({
conditions: _.map(copyConditions, item => {
return {
...item, items: _.map(item.items, o => {
if (getKey(o) === "salarySobId") {
return {
...o, label: getLabel(o.lanId, o.label),
options: _.map(data, d => ({ key: d.id, showname: d.content }))
};
} else {
return { ...o, label: getLabel(o.lanId, o.label) };
}
})
};
})
}, () => {
props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions);
props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } });
});
}
});
};
save = () => { save = () => {
const { payrollStore: { payrollCopyForm }, copyId: id } = this.props; const { payrollStore: { payrollCopyForm }, copyId: id } = this.props;
payrollCopyForm.validateForm().then(f => { payrollCopyForm.validateForm().then(f => {
@ -51,16 +78,16 @@ class Index extends Component {
}; };
render() { render() {
const { loading } = this.state; const { loading, conditions } = this.state;
const { payrollStore: { payrollCopyForm } } = this.props; const { payrollStore: { payrollCopyForm } } = this.props;
return ( return (
<WeaDialog <WeaDialog
{...this.props} style={{ width: 480 }} initLoadCss {...this.props} style={{ width: 480, height: 127 }} initLoadCss
buttons={[ buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button> <Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
]} ]}
> >
<div className="payroll-dialog-layout">{getSearchs(payrollCopyForm, copyConditions, 1, false)}</div> <div className="payroll-dialog-layout">{getSearchs(payrollCopyForm, conditions, 1, false)}</div>
</WeaDialog> </WeaDialog>
); );
} }

View File

@ -129,7 +129,7 @@ class Index extends Component {
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"], hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"],
helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;") helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")
}; };
} else if (getKey(o) === "feedbackUrl") { } else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
return { return {
...o, ...o,
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"] hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"]
@ -298,7 +298,7 @@ class Index extends Component {
if (it.title === getLabel(544092, "工资单确认反馈设置")) { if (it.title === getLabel(544092, "工资单确认反馈设置")) {
return { return {
...it, items: _.map(it.items, o => { ...it, items: _.map(it.items, o => {
if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl") { if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
return { return {
...o, hide: params[key].value === "0" ...o, hide: params[key].value === "0"
}; };
@ -312,7 +312,11 @@ class Index extends Component {
}, () => { }, () => {
payrollTempFeedbackForm.initFormFields(this.state.fbConditions); payrollTempFeedbackForm.initFormFields(this.state.fbConditions);
const ackFeedbackStatus = payrollTempFeedbackForm.getFormParams().ackFeedbackStatus; const ackFeedbackStatus = payrollTempFeedbackForm.getFormParams().ackFeedbackStatus;
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({ autoAckDays: "7", feedbackUrl: "/" }); if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({
autoAckDays: "7",
feedbackUrl: "/",
mobileFeedbackUrl: "/"
});
}); });
} }
setHasBeenModify(true); setHasBeenModify(true);

View File

@ -22,7 +22,7 @@ class Index extends Component {
this.state = { this.state = {
loading: false, columns: [], dataSource: [], selectedRowKeys: [], loading: false, columns: [], dataSource: [], selectedRowKeys: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }, delLoading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, delLoading: false,
copyDialog: { visible: false, title: "", copyId: "" }, copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
tmplSlide: { tmplSlide: {
visible: false, tmplId: "", top: 0, width: 792, height: 100, visible: false, tmplId: "", top: 0, width: 792, height: 100,
measureT: "%", measureX: "px", measureY: "%" measureT: "%", measureX: "px", measureY: "%"
@ -80,7 +80,7 @@ class Index extends Component {
}; };
handleOpts = ({ key }, record) => { handleOpts = ({ key }, record) => {
const { copyDialog, tmplSlide, selectedRowKeys } = this.state; const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
const { id } = record; const { id, salarySobId } = record;
switch (key) { switch (key) {
case "edit": case "edit":
this.setState({ this.setState({
@ -89,7 +89,10 @@ class Index extends Component {
break; break;
case "copy": case "copy":
this.setState({ this.setState({
copyDialog: { ...copyDialog, visible: true, copyId: id, title: getLabel(543599, "复制工资单") } copyDialog: {
...copyDialog, visible: true, copyId: id,
salarySobId: salarySobId + "", title: getLabel(543599, "复制工资单")
}
}); });
break; break;
case "del": case "del":
@ -175,7 +178,7 @@ class Index extends Component {
{/*复制工资单模板*/} {/*复制工资单模板*/}
<PayrollCopyDialog {...copyDialog} <PayrollCopyDialog {...copyDialog}
onCancel={v => this.setState({ onCancel={v => this.setState({
copyDialog: { ...copyDialog, visible: false, copyId: "" } copyDialog: { ...copyDialog, visible: false, copyId: "", salarySobId: "" }
}, () => v === "refresh" && this.getPayrollTemplateList(this.props))} }, () => v === "refresh" && this.getPayrollTemplateList(this.props))}
/> />
{/* 新建编辑工资单模板*/} {/* 新建编辑工资单模板*/}