Merge branch 'feature/2.10.1.2401.01-工资单模板复制以及移动端地址配置' into release/2.10.1.2401.01
This commit is contained in:
commit
5a65c42179
|
|
@ -159,9 +159,9 @@ export default class MobilePayroll extends React.Component {
|
|||
if (status) {
|
||||
const { mySalaryBillData } = this.state;
|
||||
const { salaryTemplate } = mySalaryBillData;
|
||||
const { feedbackUrl } = salaryTemplate;
|
||||
const { feedbackUrl, mobileFeedbackUrl } = salaryTemplate;
|
||||
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}`);
|
||||
} else {
|
||||
message.error(errorMsg);
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ class SalaryItemSettings extends Component {
|
|||
salarySobId: this.props.salarySobId,
|
||||
existSalaryItemIds: _.map(record.items, it => it.id),
|
||||
groupId: record.groupId,
|
||||
groupName: record.groupName,
|
||||
isReplenish: this.props.isReplenish
|
||||
};
|
||||
getAvailableSalaryItemSet(payload).then(({ status, data }) => {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ class TemplateBaseSettings extends Component {
|
|||
ackFeedbackSetting: {
|
||||
ackStatus: "0",
|
||||
autoAckDays: 7,
|
||||
feedBackUrl: ""
|
||||
feedBackUrl: "",
|
||||
mobileFeedbackUrl: ""
|
||||
},
|
||||
salaryBillViewingLimitSetting: {
|
||||
limitMonth: 0
|
||||
|
|
@ -68,8 +69,8 @@ class TemplateBaseSettings extends Component {
|
|||
};
|
||||
salaryBillBaseSetSave = () => {
|
||||
const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
|
||||
const { feedBackUrl } = ackFeedbackSetting;
|
||||
if (!feedBackUrl) {
|
||||
const { feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
|
||||
if (!feedBackUrl || !mobileFeedbackUrl) {
|
||||
Modal.warning({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "必要信息不完整,红色*为必填项!")
|
||||
|
|
@ -96,7 +97,7 @@ class TemplateBaseSettings extends Component {
|
|||
|
||||
render() {
|
||||
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
|
||||
const { ackStatus, autoAckDays, feedBackUrl } = ackFeedbackSetting;
|
||||
const { ackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
|
||||
const { limitMonth = 0 } = salaryBillViewingLimitSetting;
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
|
@ -158,7 +159,7 @@ class TemplateBaseSettings extends Component {
|
|||
style={{ marginLeft: 10 }}
|
||||
placement="top" width={200}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
<WeaFormItem label={getLabel(111, "PC端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
<WeaInput
|
||||
value={feedBackUrl} viewAttr={3}
|
||||
onChange={feedBackUrl => this.setState({
|
||||
|
|
@ -167,6 +168,15 @@ class TemplateBaseSettings extends Component {
|
|||
}
|
||||
})}/>
|
||||
</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>
|
||||
}
|
||||
</WeaSearchGroup>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,24 @@ export const copyConditions = [
|
|||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "工资单名称",
|
||||
lanId: 536726,
|
||||
lanId: 543600,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["salarySobId"],
|
||||
fieldcol: 14,
|
||||
label: "薪资账套",
|
||||
lanId: 538010,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
|
|
@ -194,8 +207,21 @@ export const tempBaseSetFbConditions = [
|
|||
conditionType: "INPUT",
|
||||
domkey: ["feedbackUrl"],
|
||||
fieldcol: 14,
|
||||
label: "反馈流程地址",
|
||||
lanId: 544096,
|
||||
label: "PC端反馈流程地址",
|
||||
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,
|
||||
value: "/",
|
||||
viewAttr: 3,
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { copyConditions } from "../conditions";
|
||||
import { duplicatePayroll } from "../../../../apis/payroll";
|
||||
import { duplicatePayroll, getPayrollTemplateLedgerList } from "../../../../apis/payroll";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
|
|
@ -20,15 +21,41 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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 = () => {
|
||||
const { payrollStore: { payrollCopyForm }, copyId: id } = this.props;
|
||||
payrollCopyForm.validateForm().then(f => {
|
||||
|
|
@ -51,16 +78,16 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { loading, conditions } = this.state;
|
||||
const { payrollStore: { payrollCopyForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480 }} initLoadCss
|
||||
{...this.props} style={{ width: 480, height: 127 }} initLoadCss
|
||||
buttons={[
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Index extends Component {
|
|||
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"],
|
||||
helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")
|
||||
};
|
||||
} else if (getKey(o) === "feedbackUrl") {
|
||||
} else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
|
||||
return {
|
||||
...o,
|
||||
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"]
|
||||
|
|
@ -298,7 +298,7 @@ class Index extends Component {
|
|||
if (it.title === getLabel(544092, "工资单确认反馈设置")) {
|
||||
return {
|
||||
...it, items: _.map(it.items, o => {
|
||||
if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl") {
|
||||
if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
|
||||
return {
|
||||
...o, hide: params[key].value === "0"
|
||||
};
|
||||
|
|
@ -312,7 +312,11 @@ class Index extends Component {
|
|||
}, () => {
|
||||
payrollTempFeedbackForm.initFormFields(this.state.fbConditions);
|
||||
const ackFeedbackStatus = payrollTempFeedbackForm.getFormParams().ackFeedbackStatus;
|
||||
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({ autoAckDays: "7", feedbackUrl: "/" });
|
||||
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({
|
||||
autoAckDays: "7",
|
||||
feedbackUrl: "/",
|
||||
mobileFeedbackUrl: "/"
|
||||
});
|
||||
});
|
||||
}
|
||||
setHasBeenModify(true);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Index extends Component {
|
|||
this.state = {
|
||||
loading: false, columns: [], dataSource: [], selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, delLoading: false,
|
||||
copyDialog: { visible: false, title: "", copyId: "" },
|
||||
copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
|
||||
tmplSlide: {
|
||||
visible: false, tmplId: "", top: 0, width: 792, height: 100,
|
||||
measureT: "%", measureX: "px", measureY: "%"
|
||||
|
|
@ -80,7 +80,7 @@ class Index extends Component {
|
|||
};
|
||||
handleOpts = ({ key }, record) => {
|
||||
const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
|
||||
const { id } = record;
|
||||
const { id, salarySobId } = record;
|
||||
switch (key) {
|
||||
case "edit":
|
||||
this.setState({
|
||||
|
|
@ -89,7 +89,10 @@ class Index extends Component {
|
|||
break;
|
||||
case "copy":
|
||||
this.setState({
|
||||
copyDialog: { ...copyDialog, visible: true, copyId: id, title: getLabel(543599, "复制工资单") }
|
||||
copyDialog: {
|
||||
...copyDialog, visible: true, copyId: id,
|
||||
salarySobId: salarySobId + "", title: getLabel(543599, "复制工资单")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "del":
|
||||
|
|
@ -175,7 +178,7 @@ class Index extends Component {
|
|||
{/*复制工资单模板*/}
|
||||
<PayrollCopyDialog {...copyDialog}
|
||||
onCancel={v => this.setState({
|
||||
copyDialog: { ...copyDialog, visible: false, copyId: "" }
|
||||
copyDialog: { ...copyDialog, visible: false, copyId: "", salarySobId: "" }
|
||||
}, () => v === "refresh" && this.getPayrollTemplateList(this.props))}
|
||||
/>
|
||||
{/* 新建编辑工资单模板*/}
|
||||
|
|
|
|||
Loading…
Reference in New Issue