|
@@ -7,8 +7,10 @@ import {
|
|
|
AtIcon,
|
|
|
AtTextarea,
|
|
|
AtModal,
|
|
|
+ AtModalHeader,
|
|
|
AtModalContent,
|
|
|
AtModalAction,
|
|
|
+ AtRadio,
|
|
|
} from "taro-ui";
|
|
|
import Skeleton from "taro-skeleton";
|
|
|
|
|
@@ -33,6 +35,7 @@ import "taro-ui/dist/style/components/modal.scss";
|
|
|
import "taro-ui/dist/style/components/timeline.scss";
|
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
|
import "taro-ui/dist/style/components/calendar.scss";
|
|
|
+import "taro-ui/dist/style/components/radio.scss";
|
|
|
|
|
|
import Rejected from "../../image/rejected.png";
|
|
|
import Passed from "../../image/passed.png";
|
|
@@ -60,7 +63,7 @@ class EgressDetails extends Component {
|
|
|
reasonsInvalidation: "",
|
|
|
isVerify: false, //判断是否在审核中修改
|
|
|
selectArrderLocation: {},
|
|
|
- current: "",
|
|
|
+ current: this.$instance.router.params.status || "",
|
|
|
isNo: true,
|
|
|
foc: false,
|
|
|
coorderList: [],
|
|
@@ -68,23 +71,30 @@ class EgressDetails extends Component {
|
|
|
popup: false,
|
|
|
selid: "",
|
|
|
userList: [],
|
|
|
+ isSelFiles: false,
|
|
|
+ filesList: [],
|
|
|
+ uid: "",
|
|
|
+ // techStartProcess 0无需审核 1需要审核 2营销审核通过 3营销审核驳回
|
|
|
+ // assistProcess 0非协单 1协单上级未审核 2协单待审核 3协单部分审核 4协单完全审核 5协单驳回
|
|
|
+ // assist 0非协单 1主协单 2子协单 3技术助手
|
|
|
+ // publicType 公出他人企业 0不含他人客户 1待审核 2已审核 3已驳回
|
|
|
+ // status=1 0驳回 1发起 2通过
|
|
|
+ // type 0业务 1技术 2行政 3协单 4协单助手
|
|
|
};
|
|
|
this.examinePublicRelease = this.examinePublicRelease.bind(this);
|
|
|
this.getReleasetDails = this.getReleasetDails.bind(this);
|
|
|
this.oidApplication = this.oidApplication.bind(this);
|
|
|
+ this.onSelFiles = this.onSelFiles.bind(this);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
componentDidMount() {
|
|
|
- this.setState({
|
|
|
- current: this.$instance.router.params.status || "",
|
|
|
- sonType: this.$instance.router.params.sonType || "",
|
|
|
- });
|
|
|
this.getReleasetDails();
|
|
|
if (!this.isLogin()) {
|
|
|
Taro.setStorageSync('currentPage', `/pages/egressDetails/index?id=${this.$instance.router.params.id}`)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
isLogin() {
|
|
|
return !!Taro.getStorageSync('userInfor');
|
|
|
}
|
|
@@ -151,9 +161,10 @@ class EgressDetails extends Component {
|
|
|
});
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
|
- Taro.switchTab({
|
|
|
- url: "/pages/punchClock/index",
|
|
|
- });
|
|
|
+ // Taro.switchTab({
|
|
|
+ // url: "/pages/punchClock/index",
|
|
|
+ // });
|
|
|
+ Taro.navigateBack()
|
|
|
}, 1800);
|
|
|
Taro.showToast({
|
|
|
title: "您没有权限查看此公出详情",
|
|
@@ -172,7 +183,7 @@ class EgressDetails extends Component {
|
|
|
}
|
|
|
|
|
|
// 同意/驳回
|
|
|
- agree(sta) {
|
|
|
+ agree(sta, evaluateType) {
|
|
|
if (!this.state.opinion) {
|
|
|
Taro.showToast({ title: "请填写审批意见", icon: "none" });
|
|
|
return;
|
|
@@ -194,9 +205,10 @@ class EgressDetails extends Component {
|
|
|
inquiryContent: "当前公出申请已修改,请重新审核",
|
|
|
});
|
|
|
} else {
|
|
|
- sta === 2
|
|
|
- ? this.examinePublicRelease(2)
|
|
|
- : this.examinePublicRelease(0);
|
|
|
+ // sta === 2
|
|
|
+ // ? this.examinePublicRelease(2)
|
|
|
+ // : this.examinePublicRelease(0);
|
|
|
+ this.examinePublicRelease(sta, evaluateType)
|
|
|
}
|
|
|
if (v.data) {
|
|
|
let list = [];
|
|
@@ -236,19 +248,22 @@ class EgressDetails extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- examinePublicRelease(status) {
|
|
|
+ examinePublicRelease(status, evaluateType) {
|
|
|
if (!this.state.opinion) {
|
|
|
Taro.showToast({ title: "请填写审批意见", icon: "none" });
|
|
|
return;
|
|
|
}
|
|
|
// Taro.showLoading({ title: "加载中..." });
|
|
|
- let isSuperior = this.state.current == "他人公出"
|
|
|
- ? (this.state.sonType == 4 ? 2 : this.state.sonType == 5 && 3)
|
|
|
- : this.state.current == "协单审核" ? 4
|
|
|
+
|
|
|
+ let isSuperior = this.state.dtails.publicType == 1
|
|
|
+ ? (this.state.dtails.type == 0 ? 2 : this.state.dtails.type == 1 && 3)
|
|
|
+ : this.state.dtails.assistProcess == 2
|
|
|
+ ? 4
|
|
|
: 1
|
|
|
examinePublicRelease(
|
|
|
isSuperior,
|
|
|
{
|
|
|
+ evaluateType,
|
|
|
status,
|
|
|
remarks: this.state.opinion,
|
|
|
id: this.state.dtails.id,
|
|
@@ -281,7 +296,7 @@ class EgressDetails extends Component {
|
|
|
this.state.dtails.prdList[0]?.districtName +
|
|
|
"的公出"
|
|
|
: this.state.dtails.aname + "将要去" + this.state.dtails.prdList[0]?.districtName,
|
|
|
- path: "pages/egressDetails/index?id=" + this.$instance.router.params.id,
|
|
|
+ path: "/pages/egressDetails/index?id=" + this.$instance.router.params.id,
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -380,7 +395,7 @@ class EgressDetails extends Component {
|
|
|
});
|
|
|
}
|
|
|
// 技术公出逻辑判断
|
|
|
- checkOrderNoDuration() {
|
|
|
+ checkOrderNoDuration(evaluateType) {
|
|
|
const _this = this
|
|
|
checkOrderNoDuration({
|
|
|
id: this.state.dtails.id,
|
|
@@ -406,7 +421,7 @@ class EgressDetails extends Component {
|
|
|
<View>请确认是否同意本次公出?</View>
|
|
|
</View>,
|
|
|
inquiryFn: () => {
|
|
|
- _this.agree(2);
|
|
|
+ _this.agree(2, evaluateType);
|
|
|
},
|
|
|
})
|
|
|
} else {
|
|
@@ -416,7 +431,7 @@ class EgressDetails extends Component {
|
|
|
inquiryTitle: "提醒",
|
|
|
inquiryContent: "您确定要同意此申请吗?",
|
|
|
inquiryFn: () => {
|
|
|
- _this.agree(2);
|
|
|
+ _this.agree(2, evaluateType);
|
|
|
},
|
|
|
})
|
|
|
}
|
|
@@ -429,6 +444,25 @@ class EgressDetails extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ onSelFiles(data) {
|
|
|
+ let list = []
|
|
|
+ let userNames = data.userNames.split(",")
|
|
|
+ let UserIds = data.uids.split(",")
|
|
|
+ if (UserIds.length > 1) {
|
|
|
+ for (var i = 0; i < userNames.length; i++) {
|
|
|
+ list.push({ label: userNames[i], value: UserIds[i] })
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ filesList: list,
|
|
|
+ isSelFiles: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: "/pages/customerProfile/index?id=" + data.uids + "¬Required=true",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { dtails, current, cList, coorderList, popup } = this.state;
|
|
|
return (
|
|
@@ -489,54 +523,52 @@ class EgressDetails extends Component {
|
|
|
</View>
|
|
|
) : (
|
|
|
<View className="valueContent">
|
|
|
- {
|
|
|
- dtails.status != 3 && dtails.type == 3 && (current === "查看协单" || current === "我的协单")
|
|
|
- ? <View className="item">
|
|
|
- <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
|
|
|
- <View className="cassistant">
|
|
|
- {
|
|
|
- coorderList.length == 0
|
|
|
- ? <Text>无</Text>
|
|
|
- : coorderList.map((item, index) =>
|
|
|
- <View className="citems" key={index}>
|
|
|
- {item}
|
|
|
- <View className="cclose"
|
|
|
- onClick={() => {
|
|
|
- this.setState({
|
|
|
- isInquiryOpened: true,
|
|
|
- inquiryTitle: "温馨提示",
|
|
|
- inquiryContent: "您确定要移除此协单助手吗?",
|
|
|
- inquiryFn: () => {
|
|
|
- this.deleteA(dtails.id, cList[index])
|
|
|
- },
|
|
|
- });
|
|
|
- }}
|
|
|
- ><AtIcon value="close-circle" size="15" color="#bbbbbb" /></View>
|
|
|
- </View>
|
|
|
- )
|
|
|
- }
|
|
|
- {cList.length < 5 && <Button className="addbuttom" type='primary' onClick={this.popupClick.bind(this, dtails.id)}>添加协单助手</Button>}
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- : coorderList.length != 0 &&
|
|
|
- <View className="item">
|
|
|
- <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
|
|
|
- <View className="cassistant">
|
|
|
- {
|
|
|
- coorderList.map((item, index) =>
|
|
|
- <View className="citems" style={{ paddingRight: 0 }} key={index}>
|
|
|
+ {dtails.status != 3 && dtails.type == 3 && (dtails.assistProcess == 2 || dtails.assist === 1 || dtails.assist === 2)
|
|
|
+ ? <View className="item">
|
|
|
+ <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
|
|
|
+ <View className="cassistant">
|
|
|
+ {
|
|
|
+ coorderList.length == 0
|
|
|
+ ? <Text>无</Text>
|
|
|
+ : coorderList.map((item, index) =>
|
|
|
+ <View className="citems" key={index}>
|
|
|
{item}
|
|
|
+ <View className="cclose"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "温馨提示",
|
|
|
+ inquiryContent: "您确定要移除此协单助手吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.deleteA(dtails.id, cList[index])
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ ><AtIcon value="close-circle" size="15" color="#bbbbbb" /></View>
|
|
|
</View>
|
|
|
)
|
|
|
- }
|
|
|
- </View>
|
|
|
+ }
|
|
|
+ {cList.length < 5 && <Button className="addbuttom" type='primary' onClick={this.popupClick.bind(this, dtails.id)}>添加协单助手</Button>}
|
|
|
</View>
|
|
|
+ </View>
|
|
|
+ : coorderList.length != 0 &&
|
|
|
+ <View className="item">
|
|
|
+ <View className="title" style={{ color: "red" }}>协单助手(助手无成本)</View>
|
|
|
+ <View className="cassistant">
|
|
|
+ {
|
|
|
+ coorderList.map((item, index) =>
|
|
|
+ <View className="citems" style={{ paddingRight: 0 }} key={index}>
|
|
|
+ {item}
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
}
|
|
|
<View className="item">
|
|
|
<View className="title">
|
|
|
公出地点:
|
|
|
- {current !== "审核" && dtails.permission === 0
|
|
|
- && dtails.type !== 3 && dtails.type !== 4 ? (
|
|
|
+ {dtails.permission === 0 && dtails.type !== 3 && dtails.type !== 4 ? (
|
|
|
<View
|
|
|
className="edit"
|
|
|
onClick={() => {
|
|
@@ -638,7 +670,15 @@ class EgressDetails extends Component {
|
|
|
""
|
|
|
)}
|
|
|
<View className="item">
|
|
|
- <View className="title">公出企业</View>
|
|
|
+ <View className="title">
|
|
|
+ 公出企业
|
|
|
+ {dtails.viewPermission == 1 &&
|
|
|
+ <View className="tbuttom"
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation()
|
|
|
+ this.onSelFiles(dtails)
|
|
|
+ }}>查看客户档案</View>}
|
|
|
+ </View>
|
|
|
<View className="value">
|
|
|
{/* {dtails.nickname} */}
|
|
|
{
|
|
@@ -648,13 +688,16 @@ class EgressDetails extends Component {
|
|
|
}
|
|
|
</View>
|
|
|
</View>
|
|
|
- {
|
|
|
- dtails.assistAidName != null && dtails.assistAidName != "" &&
|
|
|
+ {dtails.assistAidName != null && dtails.assistAidName != "" &&
|
|
|
<View className="item">
|
|
|
<View className="title" style={{ color: "red" }}>技术协单(技术协单,将统计相关的公出成本等)</View>
|
|
|
<View className="value">{dtails.assistAidName.replace(/,/g, " ")}</View>
|
|
|
- </View>
|
|
|
- }
|
|
|
+ </View>}
|
|
|
+ {dtails.alone != 0 &&
|
|
|
+ <View className="item">
|
|
|
+ <View className="title">本人公出</View>
|
|
|
+ <View className="value">{["", "是,一同公出", "否,本人不公出"][dtails.alone]}</View>
|
|
|
+ </View>}
|
|
|
{/* 公出目标 */}
|
|
|
<View className="item">
|
|
|
<View className="title">公出目标</View>
|
|
@@ -682,11 +725,11 @@ class EgressDetails extends Component {
|
|
|
</View>
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {((dtails.status === 1 && current === "协单审核" && dtails.myExamine === 0) ||
|
|
|
- (dtails.status === 1 && current === "审核" && dtails.assistProcess === 0) ||
|
|
|
- (dtails.status === 1 && current === "审核" && dtails.assistProcess === 1) ||
|
|
|
- (dtails.myExamine === 0 && current === "他人公出" && dtails.publicType == 1) ||
|
|
|
- (dtails.myExamine === 0 && current === "他人公出" && dtails.techStartProcess == 1)) &&
|
|
|
+ {((dtails.status === 1 && dtails.myExamine === 1) ||
|
|
|
+ (dtails.status === 1 && dtails.myExamine === 1 && dtails.assistProcess === 0) ||
|
|
|
+ (dtails.status === 1 && dtails.myExamine === 1 && dtails.assistProcess === 1) ||
|
|
|
+ (dtails.myExamine === 1 && dtails.publicType == 1) ||
|
|
|
+ (dtails.myExamine === 1 && dtails.techStartProcess == 1)) &&
|
|
|
<View className="item">
|
|
|
<View className="title">
|
|
|
填写审批意见
|
|
@@ -715,8 +758,7 @@ class EgressDetails extends Component {
|
|
|
inquiryTitle: "提醒",
|
|
|
inquiryContent: "您确定要驳回此申请吗?",
|
|
|
inquiryFn: () => {
|
|
|
- this.agree(0);
|
|
|
- // this.examinePublicRelease(0);
|
|
|
+ this.agree(0, 0);
|
|
|
},
|
|
|
});
|
|
|
}}
|
|
@@ -732,23 +774,44 @@ class EgressDetails extends Component {
|
|
|
return;
|
|
|
}
|
|
|
dtails.type == 1
|
|
|
- ? this.checkOrderNoDuration()
|
|
|
+ ? this.checkOrderNoDuration(0)
|
|
|
: this.setState({
|
|
|
isInquiryOpened: true,
|
|
|
inquiryTitle: "提醒",
|
|
|
inquiryContent: "您确定要同意此申请吗?",
|
|
|
inquiryFn: () => {
|
|
|
- this.agree(2);
|
|
|
- // this.examinePublicRelease(2);
|
|
|
+ this.agree(2, 0);
|
|
|
},
|
|
|
});
|
|
|
}}
|
|
|
>
|
|
|
同意
|
|
|
</AtButton>
|
|
|
+ <AtButton
|
|
|
+ type="primary"
|
|
|
+ loading={this.state.loading}
|
|
|
+ circle
|
|
|
+ onClick={() => {
|
|
|
+ if (this.state.loading) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dtails.type == 1
|
|
|
+ ? this.checkOrderNoDuration(1)
|
|
|
+ : this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "提醒",
|
|
|
+ inquiryContent: "您确定要同意此申请,并存为指导意见吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.agree(2, 1);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 同意,并存为指导意见
|
|
|
+ </AtButton>
|
|
|
</View>
|
|
|
</View>}
|
|
|
- {current !== "审核" && dtails.permission === 0
|
|
|
+ {dtails.permission === 0
|
|
|
&& dtails.type !== 3 && dtails.type !== 4 ? (
|
|
|
<View className="item" id={"reasons"}>
|
|
|
<View className="title">修改/撤销</View>
|
|
@@ -765,7 +828,7 @@ class EgressDetails extends Component {
|
|
|
/>
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {current !== "审核" && dtails.permission === 0
|
|
|
+ {dtails.permission === 0
|
|
|
&& dtails.type !== 3 && dtails.type !== 4 ? (
|
|
|
<View className="operation">
|
|
|
<Button
|
|
@@ -930,6 +993,40 @@ class EgressDetails extends Component {
|
|
|
addClick={this.addA.bind(this)}
|
|
|
/>
|
|
|
}
|
|
|
+ <AtModal
|
|
|
+ closeOnClickOverlay={false}
|
|
|
+ isOpened={this.state.isSelFiles}
|
|
|
+ >
|
|
|
+ <AtModalHeader>请选择</AtModalHeader>
|
|
|
+ <AtModalContent>
|
|
|
+ <AtRadio
|
|
|
+ options={this.state.filesList}
|
|
|
+ value={this.state.uid}
|
|
|
+ onClick={e => {
|
|
|
+ this.setState({
|
|
|
+ uid: e
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </AtModalContent>
|
|
|
+ <AtModalAction>
|
|
|
+ <Button type='secondary'
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isSelFiles: false
|
|
|
+ })
|
|
|
+ }}>取消</Button>
|
|
|
+ <Button type='primary'
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isSelFiles: false
|
|
|
+ })
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: "/pages/customerProfile/index?id=" + this.state.uid + "¬Required=true",
|
|
|
+ });
|
|
|
+ }}>确定</Button>
|
|
|
+ </AtModalAction>
|
|
|
+ </AtModal>
|
|
|
</View>
|
|
|
);
|
|
|
}
|