|
@@ -1,4 +1,4 @@
|
|
|
-import React, { Component } from "react";
|
|
|
|
|
|
|
+import React, { Component, Fragment } from "react";
|
|
|
import Taro from "@tarojs/taro";
|
|
import Taro from "@tarojs/taro";
|
|
|
import { Text, View, Button, Icon, Radio, RadioGroup } from "@tarojs/components";
|
|
import { Text, View, Button, Icon, Radio, RadioGroup } from "@tarojs/components";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
@@ -35,6 +35,8 @@ import "taro-ui/dist/style/components/calendar.scss";
|
|
|
import "./publicContent.less";
|
|
import "./publicContent.less";
|
|
|
import InquiryModal from "../../components/common/inquiryModal";
|
|
import InquiryModal from "../../components/common/inquiryModal";
|
|
|
import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
|
|
import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
|
|
|
|
|
+import CheckboxPicker from "../../components/common/CheckboxPicker";
|
|
|
|
|
+import { assistTypeList, assistContentList } from "../../utils/tools/config";
|
|
|
|
|
|
|
|
class PublicContent extends Component {
|
|
class PublicContent extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
@@ -59,6 +61,17 @@ class PublicContent extends Component {
|
|
|
cList: [],
|
|
cList: [],
|
|
|
isNewshow: false,
|
|
isNewshow: false,
|
|
|
alone: 1,
|
|
alone: 1,
|
|
|
|
|
+
|
|
|
|
|
+ assistType: '',
|
|
|
|
|
+ assistTypeName: '',
|
|
|
|
|
+ assistContentType: '',
|
|
|
|
|
+ assistContentTypeName: '',
|
|
|
|
|
+
|
|
|
|
|
+ multiplePickerShow: false,
|
|
|
|
|
+ multiplePickerType: '',
|
|
|
|
|
+ multiplePickerTitle: '',
|
|
|
|
|
+ multiplePickerOptions: [],
|
|
|
|
|
+ multiplePickerCheckedList: [],
|
|
|
};
|
|
};
|
|
|
this.onSubmit = this.onSubmit.bind(this);
|
|
this.onSubmit = this.onSubmit.bind(this);
|
|
|
this.selectArrder = this.selectArrder.bind(this);
|
|
this.selectArrder = this.selectArrder.bind(this);
|
|
@@ -68,6 +81,8 @@ class PublicContent extends Component {
|
|
|
this.onPickerHide = this.onPickerHide.bind(this);
|
|
this.onPickerHide = this.onPickerHide.bind(this);
|
|
|
this.onSetPickerTime = this.onSetPickerTime.bind(this);
|
|
this.onSetPickerTime = this.onSetPickerTime.bind(this);
|
|
|
this.getNumHourse = this.getNumHourse.bind(this);
|
|
this.getNumHourse = this.getNumHourse.bind(this);
|
|
|
|
|
+ this.handleOpenMultiplePicker = this.handleOpenMultiplePicker.bind(this)
|
|
|
|
|
+ this.handleMultipleConfirm = this.handleMultipleConfirm.bind(this)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
@@ -107,21 +122,43 @@ class PublicContent extends Component {
|
|
|
alone: this.props.dtails.alone,
|
|
alone: this.props.dtails.alone,
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let rangeStartMinuteVal = dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD HH:mm:ss")
|
|
|
|
|
+ let rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD HH:mm:ss")
|
|
|
|
|
+ let assistTypeName = ''
|
|
|
|
|
+ let assistContentTypeName = ''
|
|
|
|
|
+ if (this.props.dtails.type == 5) {
|
|
|
|
|
+ rangeStartMinuteVal = dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD")
|
|
|
|
|
+ rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD")
|
|
|
|
|
+
|
|
|
|
|
+ const assistType = this.props.dtails.assistType || ''
|
|
|
|
|
+ const assistContentType = this.props.dtails.assistContentType || ''
|
|
|
|
|
+
|
|
|
|
|
+ let currAssistTypeOption = assistTypeList.filter(item => assistType.indexOf(item.id) > -1)
|
|
|
|
|
+ assistTypeName = currAssistTypeOption.map(item => item.title).join(',')
|
|
|
|
|
+
|
|
|
|
|
+ let currAssistContentTypeOption = assistContentList.filter(item => assistContentType.indexOf(item.id) > -1)
|
|
|
|
|
+ assistContentTypeName = currAssistContentTypeOption.map(item => item.title).join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 编辑详情
|
|
// 编辑详情
|
|
|
this.setState({
|
|
this.setState({
|
|
|
imgs: arr,
|
|
imgs: arr,
|
|
|
totalDuration: this.props.dtails.duration,
|
|
totalDuration: this.props.dtails.duration,
|
|
|
- reason: this.props.dtails.remarks,
|
|
|
|
|
|
|
+ reason: this.props.dtails.remarks || '',
|
|
|
validDates: JSON.parse(this.props.dtails.validDate),
|
|
validDates: JSON.parse(this.props.dtails.validDate),
|
|
|
rangeEndVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD"),
|
|
rangeEndVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD"),
|
|
|
- rangeEndMinuteVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
|
|
+ rangeEndMinuteVal,
|
|
|
rangeStartVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD"),
|
|
rangeStartVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD"),
|
|
|
- rangeStartMinuteVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
|
|
+ rangeStartMinuteVal,
|
|
|
plan: this.props.dtails.plan || "",
|
|
plan: this.props.dtails.plan || "",
|
|
|
expectedEffect: this.props.dtails.expectedEffect || "",
|
|
expectedEffect: this.props.dtails.expectedEffect || "",
|
|
|
cList: list,
|
|
cList: list,
|
|
|
coorderList: !dtails.assistAid ? [] : dtails.assistAid.split(","),
|
|
coorderList: !dtails.assistAid ? [] : dtails.assistAid.split(","),
|
|
|
alone: this.props.dtails.alone,
|
|
alone: this.props.dtails.alone,
|
|
|
|
|
+ assistType: this.props.dtails.assistType,
|
|
|
|
|
+ assistTypeName,
|
|
|
|
|
+ assistContentType: this.props.dtails.assistContentType,
|
|
|
|
|
+ assistContentTypeName,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -293,6 +330,11 @@ class PublicContent extends Component {
|
|
|
if (isVerify) {
|
|
if (isVerify) {
|
|
|
datas = { ...datas, ...{ reason: this.props.reason, objectType, } };
|
|
datas = { ...datas, ...{ reason: this.props.reason, objectType, } };
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if(this.props.dtails.type == 5) {
|
|
|
|
|
+ datas.assistType = this.state.assistType
|
|
|
|
|
+ datas.assistContentTypeType = this.state.assistContentType
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
for (let key in datas) {
|
|
for (let key in datas) {
|
|
|
if (datas[key] === undefined || datas[key] === 'undefined' || datas[key] === null || datas[key] === 'null') {
|
|
if (datas[key] === undefined || datas[key] === 'undefined' || datas[key] === null || datas[key] === 'null') {
|
|
@@ -623,6 +665,59 @@ class PublicContent extends Component {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ handleOpenMultiplePicker(type) {
|
|
|
|
|
+ let multiplePickerOptions = [];
|
|
|
|
|
+ let multiplePickerTitle = '';
|
|
|
|
|
+ let multiplePickerCheckedList = [];
|
|
|
|
|
+ const { assistType, assistContentType } = this.state;
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case 'assistType':
|
|
|
|
|
+ // 协单项目类型
|
|
|
|
|
+ multiplePickerOptions = assistTypeList;
|
|
|
|
|
+ multiplePickerCheckedList = assistType ? assistType.toString().split(',') : []
|
|
|
|
|
+ multiplePickerTitle = '请选择协单项目类型';
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'assistContentType':
|
|
|
|
|
+ // 协单项目内容
|
|
|
|
|
+ multiplePickerOptions = assistContentList;
|
|
|
|
|
+ multiplePickerCheckedList = assistContentType ? assistContentType.toString().split(',') : []
|
|
|
|
|
+ multiplePickerTitle = '请选择协单项目内容';
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ multiplePickerShow: true,
|
|
|
|
|
+ multiplePickerType: type,
|
|
|
|
|
+ multiplePickerTitle,
|
|
|
|
|
+ multiplePickerOptions,
|
|
|
|
|
+ multiplePickerCheckedList: multiplePickerCheckedList
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ handleMultipleConfirm(selectedIds, selectedLabels) {
|
|
|
|
|
+ const { multiplePickerType } = this.state;
|
|
|
|
|
+ switch (multiplePickerType) {
|
|
|
|
|
+ case "assistType":
|
|
|
|
|
+ // 协单项目类型
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ assistType: selectedIds.join(','),
|
|
|
|
|
+ assistTypeName: selectedLabels.join(',')
|
|
|
|
|
+ })
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "assistContentType":
|
|
|
|
|
+ // 协单项目内容
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ assistContentType: selectedIds.join(','),
|
|
|
|
|
+ assistContentTypeName: selectedLabels.join(',')
|
|
|
|
|
+ })
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { dtails, userList, type, again = false } = this.props;
|
|
const { dtails, userList, type, again = false } = this.props;
|
|
|
const { cList, coorderList, popup, } = this.state;
|
|
const { cList, coorderList, popup, } = this.state;
|
|
@@ -657,7 +752,8 @@ class PublicContent extends Component {
|
|
|
? "业务公出" : dtails.type == 1
|
|
? "业务公出" : dtails.type == 1
|
|
|
? "技术公出" : dtails.type == 2
|
|
? "技术公出" : dtails.type == 2
|
|
|
? "行政公出" : dtails.type == 3
|
|
? "行政公出" : dtails.type == 3
|
|
|
- ? "技术协单" : ""}
|
|
|
|
|
|
|
+ ? "技术协单" : dtails.type == 5
|
|
|
|
|
+ ? "非公出协单" : ""}
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
{dtails.contractNo && dtails.type == 1 ? (
|
|
{dtails.contractNo && dtails.type == 1 ? (
|
|
@@ -668,41 +764,45 @@ class PublicContent extends Component {
|
|
|
) : (
|
|
) : (
|
|
|
""
|
|
""
|
|
|
)}
|
|
)}
|
|
|
- <View className="formItem">
|
|
|
|
|
- <View className="formName">作息时间类型:</View>
|
|
|
|
|
- <View className="formValue">
|
|
|
|
|
- <picker
|
|
|
|
|
- onChange={(e) => {
|
|
|
|
|
- this.setState({
|
|
|
|
|
- workType: e.detail.value,
|
|
|
|
|
- });
|
|
|
|
|
- if (this.state.workTypeList[e.detail.value]) {
|
|
|
|
|
- let obj = Taro.getStorageSync("userInfor");
|
|
|
|
|
- obj.workTimeInfor = this.state.workTypeList[e.detail.value];
|
|
|
|
|
- Taro.setStorageSync("userInfor", obj);
|
|
|
|
|
- this.setState({
|
|
|
|
|
- rangeStartVal: "",
|
|
|
|
|
- rangeStartMinuteVal: "",
|
|
|
|
|
- rangeEndMinuteVal: "",
|
|
|
|
|
- rangeEndVal: "",
|
|
|
|
|
- validDates: [],
|
|
|
|
|
- totalDuration: 0,
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }}
|
|
|
|
|
- value={this.state.workType}
|
|
|
|
|
- rangeKey="name"
|
|
|
|
|
- range={this.state.workTypeList}
|
|
|
|
|
- >
|
|
|
|
|
- <view style={{ display: "flex", alignItems: "center" }}>
|
|
|
|
|
- {this.state.workTypeList[this.state.workType]
|
|
|
|
|
- ? this.state.workTypeList[this.state.workType].name
|
|
|
|
|
- : ""}
|
|
|
|
|
- <AtIcon value="chevron-right" size="20" color="#bbbbbb" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </picker>
|
|
|
|
|
- </View>
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ dtails.type != 5 ? (
|
|
|
|
|
+ <View className="formItem">
|
|
|
|
|
+ <View className="formName">作息时间类型:</View>
|
|
|
|
|
+ <View className="formValue">
|
|
|
|
|
+ <picker
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ workType: e.detail.value,
|
|
|
|
|
+ });
|
|
|
|
|
+ if (this.state.workTypeList[e.detail.value]) {
|
|
|
|
|
+ let obj = Taro.getStorageSync("userInfor");
|
|
|
|
|
+ obj.workTimeInfor = this.state.workTypeList[e.detail.value];
|
|
|
|
|
+ Taro.setStorageSync("userInfor", obj);
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ rangeStartVal: "",
|
|
|
|
|
+ rangeStartMinuteVal: "",
|
|
|
|
|
+ rangeEndMinuteVal: "",
|
|
|
|
|
+ rangeEndVal: "",
|
|
|
|
|
+ validDates: [],
|
|
|
|
|
+ totalDuration: 0,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ value={this.state.workType}
|
|
|
|
|
+ rangeKey="name"
|
|
|
|
|
+ range={this.state.workTypeList}
|
|
|
|
|
+ >
|
|
|
|
|
+ <view style={{ display: "flex", alignItems: "center" }}>
|
|
|
|
|
+ {this.state.workTypeList[this.state.workType]
|
|
|
|
|
+ ? this.state.workTypeList[this.state.workType].name
|
|
|
|
|
+ : ""}
|
|
|
|
|
+ <AtIcon value="chevron-right" size="20" color="#bbbbbb" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ ) : null
|
|
|
|
|
+ }
|
|
|
<View className="formItem">
|
|
<View className="formItem">
|
|
|
<View className="formName">公出时间:</View>
|
|
<View className="formName">公出时间:</View>
|
|
|
<View className="formValue">
|
|
<View className="formValue">
|
|
@@ -727,7 +827,7 @@ class PublicContent extends Component {
|
|
|
<timePicker
|
|
<timePicker
|
|
|
config={{
|
|
config={{
|
|
|
endDate: true,
|
|
endDate: true,
|
|
|
- column: "minute",
|
|
|
|
|
|
|
+ column: dtails.type == 5 ? "day" : "minute",
|
|
|
dateLimit: false,
|
|
dateLimit: false,
|
|
|
initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
|
|
initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
|
|
|
initEndTime: this.state.rangeEndMinuteVal, //默认结束时间
|
|
initEndTime: this.state.rangeEndMinuteVal, //默认结束时间
|
|
@@ -776,10 +876,14 @@ class PublicContent extends Component {
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
- <View className="formItem">
|
|
|
|
|
- <View className="formName">总时长:</View>
|
|
|
|
|
- <View className="formValue">{this.state.totalDuration}小时</View>
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ dtails.type != 5 && (
|
|
|
|
|
+ <View className="formItem">
|
|
|
|
|
+ <View className="formName">总时长:</View>
|
|
|
|
|
+ <View className="formValue">{this.state.totalDuration}小时</View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
{
|
|
{
|
|
|
dtails.type === 0 &&
|
|
dtails.type === 0 &&
|
|
|
<View className="formItem" style={{ alignItems: "flex-start" }}>
|
|
<View className="formItem" style={{ alignItems: "flex-start" }}>
|
|
@@ -934,6 +1038,30 @@ class PublicContent extends Component {
|
|
|
<View className="tips">
|
|
<View className="tips">
|
|
|
以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可
|
|
以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+
|
|
|
|
|
+ { dtails.type == 5 ? (
|
|
|
|
|
+ <Fragment>
|
|
|
|
|
+ <View className="formItem">
|
|
|
|
|
+ <View className="formName">协单类型:</View>
|
|
|
|
|
+ <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistType')}>
|
|
|
|
|
+ <Text className="formValueText">
|
|
|
|
|
+ { this.state.assistTypeName }
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className="formItem">
|
|
|
|
|
+ <View className="formName">协单内容:</View>
|
|
|
|
|
+ <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistContentType')}>
|
|
|
|
|
+ <Text className="formValueText">
|
|
|
|
|
+ { this.state.assistContentTypeName }
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </Fragment>
|
|
|
|
|
+ ) : null }
|
|
|
|
|
+
|
|
|
<View
|
|
<View
|
|
|
className="formItem"
|
|
className="formItem"
|
|
|
style={{ display: "block", paddingTop: "15px" }}
|
|
style={{ display: "block", paddingTop: "15px" }}
|
|
@@ -965,7 +1093,7 @@ class PublicContent extends Component {
|
|
|
</View>
|
|
</View>
|
|
|
</View>)}
|
|
</View>)}
|
|
|
{/* 公出计划 */}
|
|
{/* 公出计划 */}
|
|
|
- {dtails.type != 2 || dtails.type != 0 && (
|
|
|
|
|
|
|
+ {(dtails.type != 2 || dtails.type != 0) && (
|
|
|
<View className="formName">
|
|
<View className="formName">
|
|
|
<Text>
|
|
<Text>
|
|
|
<Text style={{ color: "red" }}>*</Text>
|
|
<Text style={{ color: "red" }}>*</Text>
|
|
@@ -989,7 +1117,7 @@ class PublicContent extends Component {
|
|
|
</View>
|
|
</View>
|
|
|
)}
|
|
)}
|
|
|
{/* 预计效果 */}
|
|
{/* 预计效果 */}
|
|
|
- {dtails.type != 2 || dtails.type != 0 && (
|
|
|
|
|
|
|
+ {(dtails.type != 2 || dtails.type != 0) && (
|
|
|
<View className="formName">
|
|
<View className="formName">
|
|
|
<Text>
|
|
<Text>
|
|
|
<Text style={{ color: "red" }}>*</Text>
|
|
<Text style={{ color: "red" }}>*</Text>
|
|
@@ -1266,6 +1394,16 @@ class PublicContent extends Component {
|
|
|
</View>
|
|
</View>
|
|
|
</InquiryModal>
|
|
</InquiryModal>
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ {/* 多选框 */}
|
|
|
|
|
+ <CheckboxPicker
|
|
|
|
|
+ isOpened={this.state.multiplePickerShow}
|
|
|
|
|
+ title={this.state.multiplePickerTitle}
|
|
|
|
|
+ options={this.state.multiplePickerOptions}
|
|
|
|
|
+ checkedList={this.state.multiplePickerCheckedList}
|
|
|
|
|
+ onClose={() => { this.setState({ multiplePickerShow: false, multiplePickerCheckedList: [] }) }}
|
|
|
|
|
+ onConfirm={this.handleMultipleConfirm}
|
|
|
|
|
+ ></CheckboxPicker>
|
|
|
</View>
|
|
</View>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|