Преглед на файлове

业务公出增加项目类型和项目内容

dev01 преди 1 седмица
родител
ревизия
d7ec5fbee5
променени са 3 файла, в които са добавени 29 реда и са изтрити 20 реда
  1. 13 6
      src/pages/applyDepart/publicContent.jsx
  2. 3 3
      src/pages/egressDetails/index.jsx
  3. 13 11
      src/pages/egressDetails/publicContent.jsx

+ 13 - 6
src/pages/applyDepart/publicContent.jsx

@@ -179,8 +179,16 @@ class PublicContent extends Component {
       assistAid: this.state.coorderList.length === 0 ? "" : this.state.coorderList.join(","),
       assistAidName: this.state.coorderList.length === 0 ? "" : getNameList(this.state.coorderList, this.state.cList).join(","),
     };
-    if (this.props.enterpriseInfor.type == 0 && this.props.uaiIdList.length) {
-      datas.uais = this.props.uaiIdList.join(',');
+    if (this.props.enterpriseInfor.type == 0) {
+      if (this.props.uaiIdList.length) {
+        datas.uais = this.props.uaiIdList.join(',');
+      }
+      if (this.state.cList.length) {
+        datas.assistType = this.state.assistType
+        datas.assistContentType = this.state.assistContentType
+        // 协单类型内容补充
+        datas.assistContent = this.state.assistContent
+      }
     } else if (this.props.enterpriseInfor.type == 2) {
       datas = { ...datas, remarks: this.state.reason };
     } else if (this.props.enterpriseInfor.type == 5) {
@@ -801,7 +809,7 @@ class PublicContent extends Component {
           </View>
         }
 
-        { this.props.enterpriseInfor.type == 5 ? (
+        { this.props.enterpriseInfor.type == 5 || (this.props.enterpriseInfor.type == 0 && this.state.cList.length >= 1 ) ? (
           <Fragment>
             <View className="formItem">
               <View className="formName"><Text style={{ color: "red" }}>*</Text>协单类型:</View>
@@ -984,18 +992,17 @@ class PublicContent extends Component {
                 return;
               }
 
-              console.log(this.state.cList.length, this.state.coorderList.length)
               if (type == 5 && !this.state.cList.length) {
                 Taro.showToast({ title: "请选择协单人", icon: "none" });
                 return;
               }
 
-              if (type == 5 && !this.state.assistType) {
+              if ((type == 5 || (type == 0 && this.state.cList.length)) && !this.state.assistType) {
                 Taro.showToast({ title: "请选择协单类型", icon: "none" });
                 return
               }
 
-              if (type == 5 && !this.state.assistContentType) {
+              if ((type == 5 || (type == 0 && this.state.cList.length)) && !this.state.assistContentType) {
                 Taro.showToast({ title: "请选择协单内容", icon: "none" });
                 return
               }

+ 3 - 3
src/pages/egressDetails/index.jsx

@@ -162,7 +162,8 @@ class EgressDetails extends Component {
 
             let assistTypeName = ''
             let assistContentTypeName = ''
-            if (v.data.type == 5) {
+            console.log(v.data.assistantName)
+            if ([5, 6].indexOf(v.data.type) > -1 || (v.data.type == 0 && v.data.assistAidName)) {
       
               const assistType = v.data.assistType || ''
               const assistContentType = v.data.assistContentType || ''
@@ -745,8 +746,7 @@ class EgressDetails extends Component {
                 <View className="title">本人公出</View>
                 <View className="value">{["", "是,一同公出", "否,本人不公出"][dtails.alone]}</View>
               </View>}
-            
-            { [5, 6].indexOf(dtails.type) > -1 ? (
+            { [5, 6].indexOf(dtails.type) > -1 || (dtails.type == 0 && dtails.assistAidName) ? (
               <Fragment>
                 <View className="item">
                   <View className="title">协单类型</View>

+ 13 - 11
src/pages/egressDetails/publicContent.jsx

@@ -127,10 +127,7 @@ class PublicContent extends Component {
       let rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD HH:mm:ss")
       let assistTypeName = ''
       let assistContentTypeName = ''
-      if ([5, 6].indexOf(this.props.dtails.type) > -1) {
-        rangeStartMinuteVal = dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD")
-        rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD")
-
+      if ([5, 6].indexOf(this.props.dtails.type) > -1 || this.props.dtails.type == 0 && list.length) {
         const assistType = this.props.dtails.assistType || ''
         const assistContentType = this.props.dtails.assistContentType || ''
 
@@ -281,6 +278,11 @@ class PublicContent extends Component {
         assistAid: this.state.coorderList.length === 0 ? "" : this.state.coorderList.join(","),
         assistAidName: this.state.coorderList.length === 0 ? "" : getNameList(this.state.coorderList, this.state.cList).join(","),
       };
+      if (this.state.cList.length) {
+        datas.assistType = this.state.assistType
+        datas.assistContentType = this.state.assistContentType
+        datas.assistContent = this.state.assistContent
+      }
     } else if (this.props.dtails.type == 2) {
       datas = {
         id: this.props.dtails.id,
@@ -844,7 +846,7 @@ class PublicContent extends Component {
             <timePicker
               config={{
                 endDate: true,
-                column: dtails.type == 5 ? "day" : "minute",
+                column: [5, 6].indexOf(dtails.type) > -1 ? "day" : "minute",
                 dateLimit: false,
                 initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
                 initEndTime: this.state.rangeEndMinuteVal, //默认结束时间
@@ -1056,7 +1058,7 @@ class PublicContent extends Component {
           以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可
         </View>
 
-        { dtails.type == 5 ? (
+        { [5, 6].indexOf(dtails.type) > -1 || (dtails.type == 0 && this.state.cList.length) ? (
           <Fragment>
             <View className="formItem">
               <View className="formName">协单类型:</View>
@@ -1106,7 +1108,7 @@ class PublicContent extends Component {
           style={{ display: "block", paddingTop: "15px" }}
         >
           {/* 公出目标 */}
-          {dtails.type != 0 && (<View className="formName">
+          {[1, 2, 5, 6].indexOf(dtails.type) > -1 && (<View className="formName">
             <Text>
               <Text style={{ color: "red" }}>*</Text>
               公出目标:</Text>
@@ -1132,7 +1134,7 @@ class PublicContent extends Component {
             </View>
           </View>)}
           {/* 公出计划 */}
-          {(dtails.type != 2 || dtails.type != 0) && (
+          {[1, 5, 6].indexOf(dtails.type) > -1 && (
             <View className="formName">
               <Text>
                 <Text style={{ color: "red" }}>*</Text>
@@ -1156,7 +1158,7 @@ class PublicContent extends Component {
             </View>
           )}
           {/* 预计效果 */}
-          {(dtails.type != 2 || dtails.type != 0) && (
+          {[1, 5, 6].indexOf(dtails.type) > -1 && (
             <View className="formName">
               <Text>
                 <Text style={{ color: "red" }}>*</Text>
@@ -1288,12 +1290,12 @@ class PublicContent extends Component {
                     return;
                   }
 
-                  if ([5, 6].indexOf(this.props.dtails.type) > -1 && !this.state.assistType) {
+                  if (([5, 6].indexOf(this.props.dtails.type) > -1 || (this.props.dtails.type == 0 && this.state.cList.length)) && !this.state.assistType) {
                     Taro.showToast({ title: "请选择协单类型", icon: "none" });
                     return;
                   }
 
-                  if ([5, 6].indexOf(this.props.dtails.type) > -1 && !this.state.assistContentType) {
+                  if (([5, 6].indexOf(this.props.dtails.type) > -1 || (this.props.dtails.type == 0 && this.state.cList.length)) && !this.state.assistContentType) {
                     Taro.showToast({ title: "请选择协单内容", icon: "none" });
                     return;
                   }