Kaynağa Gözat

研发阶段

dev01 1 yıl önce
ebeveyn
işleme
9e888dc882

+ 2 - 1
src/pages/detail/index.jsx

@@ -14,6 +14,7 @@ import InquiryModal from "../../components/common/inquiryModal";
 import ImagePicker from "../../components/common/imagePicker";
 import HistoricalClock from '../../components/historicalClock';
 import { resourceAddress } from "../../utils/config";
+import { getStageState } from "../../utils/tools";
 import Un from "../../image/un.png";
 import Ok from "../../image/ok.png";
 import './index.less'
@@ -161,7 +162,7 @@ class Detail extends Component {
                   </View>
                   <View className="userName">
                     <View className="uNtext">
-                      研发阶段:{["调研阶段"][data.projectStatus]}
+                      研发阶段:{getStageState(data.projectStatus)}
                     </View>
                   </View>
                   <View className="userName">

+ 2 - 2
src/pages/punchClock/punchClocks.jsx

@@ -7,11 +7,11 @@ import {
 } from "taro-ui";
 import dayjs from 'dayjs';
 import Skeleton from 'taro-skeleton'
-import HistoricalClock from '../../components/historicalClock';
 import ImagePicker from '../../components/common/imagePicker';
 import { add, minus, asyncAdd } from '../../actions/counter'
 import { recordAdd, myDuration, getInfo, } from '../../utils/servers/servers';
 import Select from "../../image/dui.png";
+import { stageList } from '../../utils/tools/config';
 import './index.less';
 import 'taro-ui/dist/style/components/noticebar.scss';
 import 'taro-ui/dist/style/components/icon.scss';
@@ -40,7 +40,7 @@ class PunchClocks extends Component {
       imgs: [],
       nowTime: '00:00:00',
       loading: false,
-      selector: [{ value: 0, lable: "调研阶段" },],
+      selector: stageList,
       dateSel: dayjs().format('YYYY-MM-DD'),
       duration: "",
       selectorChecked: {},

+ 2 - 1
src/pages/reclockin/index.jsx

@@ -8,6 +8,7 @@ import Skeleton from 'taro-skeleton'
 import ImagePicker from '../../components/common/imagePicker';
 import { updateRecord, recordDetails } from '../../utils/servers/servers';
 import { resourceAddress } from "../../utils/config";
+import { stageList } from '../../utils/tools/config';
 import './index.less';
 // import '../punchClock/index.less'
 import 'taro-ui/dist/style/components/noticebar.scss';
@@ -26,7 +27,7 @@ class ReClockin extends Component {
     this.state = {
       imgs: [],
       loading: false,
-      selector: [{ value: 0, lable: "调研阶段" },],
+      selector: stageList,
       dateSel: dayjs().format('YYYY-MM-DD'),
       duration: "",
       selectorChecked: {},

+ 19 - 0
src/utils/tools/config.js

@@ -46,3 +46,22 @@ export const clockJournalState = [
   },
 ];
 
+
+export const stageList = [
+  {
+    lable: '市场调研',
+    value: 0,
+  },
+  {
+    lable: '立项阶段',
+    value: 1,
+  },
+  {
+    lable: '研发中',
+    value: 2,
+  },
+  {
+    lable: '项目验收阶段',
+    value: 3,
+  },
+];

+ 11 - 1
src/utils/tools/index.js

@@ -1,7 +1,17 @@
-import { clockState, clockJournalState } from './config';
+import { clockState, clockJournalState, stageList } from './config';
 import dayjs from "dayjs";
 import Taro from "@tarojs/taro";
 
+export const getStageState = (val) => {
+  let arr = stageList.filter(v => v.value === val);
+  if (arr.length > 0) {
+    return arr[0].lable;
+  } else {
+    return '';
+  }
+}
+
+
 export const getClockState = (id) => {
   let arr = clockJournalState.filter(v => v.id === id);
   if (arr.length > 0) {