| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import React, { Component } from "react";
- import { View, Image, Button, Input, Textarea } from "@tarojs/components";
- import Taro, { getCurrentInstance } from "@tarojs/taro";
- import {
- AtButton,
- AtCalendar,
- AtIcon,
- AtTextarea,
- AtModal,
- AtModalContent,
- AtModalAction,
- } from "taro-ui";
- import Skeleton from "taro-skeleton";
- import InquiryModal from "../../components/common/inquiryModal";
- import {
- projectAdd,
- } from "../../utils/servers/servers";
- import { resourceAddress } from "../../utils/config";
- import "./index.less";
- import "taro-ui/dist/style/components/icon.scss";
- import "taro-ui/dist/style/components/textarea.scss";
- 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 { getClockState, unique } from "../../utils/tools";
- class ProjectAdd extends Component {
- $instance = getCurrentInstance();
- constructor(props) {
- super(props);
- this.state = {
- };
- }
- componentDidMount() {
- }
- componentDidShow() {
- }
- // 新增
- Add(sta) {
- if (!this.state.opinion) {
- Taro.showToast({ title: "请填写审批意见", icon: "none" });
- return;
- }
- projectAdd({
- name: "",
- adminName:"",
- })
- .then((v) => {
- if (v.error.length === 0) {
- //如果在审核期间修改过
- if (
- v.data.updateTime != null &&
- this.state.dtails.updateTime !== v.data.updateTime
- ) {
- this.setState({
- isInquiryOpened: true,
- isNo: false,
- inquiryTitle: "提醒",
- inquiryContent: "当前公出申请已修改,请重新审核",
- });
- } else {
- sta === 2
- ? this.examinePublicRelease(2)
- : this.examinePublicRelease(0);
- }
- if (v.data) {
- let list = [];
- for (let i of v.data.annexUrl.split(",")) {
- if (i) {
- list.push({ url: resourceAddress + i });
- }
- }
- v.data.annexUrl = list;
- this.setState({
- dtails: v.data,
- selectArrderLocation: {
- longitude: parseFloat(v.data.prdList[0]?.longitude),
- latitude: parseFloat(v.data.prdList[0]?.latitude),
- name: v.data.prdList[0]?.districtName,
- },
- });
- } else {
- setTimeout(() => {
- Taro.switchTab({
- url: "/pages/punchClock/index",
- });
- }, 1800);
- Taro.showToast({
- title: "您没有权限查看此公出详情",
- icon: "none",
- duration: 1800,
- });
- }
- } else {
- Taro.showToast({ title: v.error[0].message, icon: "none" });
- }
- })
- .catch((err) => {
- Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
- // console.log(err);
- });
- }
- render() {
- const { } = this.state;
- return (
- <View className="add">
- <View className="count">
- <View className="inputItem">
- <View className="title">项目名称</View>
- <Input />
- </View>
- <View className="inputItem">
- <View className="title">项目负责人</View>
- </View>
- <View className="inputItem">
- <View className="title">研发人员</View>
- </View>
- <View className="inputItem">
- <View className="title">项目说明</View>
- <Textarea />
- </View>
- </View>
- </View>
- );
- }
- }
- export default ProjectAdd;
|