|  | @@ -0,0 +1,334 @@
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <view class="content-area">
 | 
	
		
			
				|  |  | +    <view class="content-area-title font12 mtb5 plr10">实时保存,保存时间 {{ saveTime }}</view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <view class="content-area-item p10 bg-white">
 | 
	
		
			
				|  |  | +      <view class="font14 weight mb10">工作内容</view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <u-collapse v-if="form.workContents.length > 0">
 | 
	
		
			
				|  |  | +        <u-collapse-item :title="item.projectName + ' ' + (item.workTime ? item.workTime + 'h' : '0h')" :name="item.projectId" v-for="(item, index) in form.workContents" :key="index">
 | 
	
		
			
				|  |  | +          <u-input
 | 
	
		
			
				|  |  | +            v-model="item.workTime"
 | 
	
		
			
				|  |  | +            placeholder="请输入工作耗时"
 | 
	
		
			
				|  |  | +            placeholderStyle="color:#909399;font-size:12px"
 | 
	
		
			
				|  |  | +            suffixIcon="h"
 | 
	
		
			
				|  |  | +            suffixIconStyle="color:#909399;font-size:12px;width:10px"
 | 
	
		
			
				|  |  | +            border="none"
 | 
	
		
			
				|  |  | +            type="digit"
 | 
	
		
			
				|  |  | +            style="padding: 0px; margin: 10px 0"
 | 
	
		
			
				|  |  | +            @change="realTimeSaving()"
 | 
	
		
			
				|  |  | +          />
 | 
	
		
			
				|  |  | +          <u-textarea
 | 
	
		
			
				|  |  | +            v-model="item.workContent"
 | 
	
		
			
				|  |  | +            placeholder="请输入工作内容"
 | 
	
		
			
				|  |  | +            placeholderStyle="color:#909399;font-size:12px"
 | 
	
		
			
				|  |  | +            :autoHeight="true"
 | 
	
		
			
				|  |  | +            border="none"
 | 
	
		
			
				|  |  | +            style="padding: 0px; margin: 10px 0"
 | 
	
		
			
				|  |  | +            @change="realTimeSaving()"
 | 
	
		
			
				|  |  | +          ></u-textarea>
 | 
	
		
			
				|  |  | +        </u-collapse-item>
 | 
	
		
			
				|  |  | +      </u-collapse>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <u-button class="mt20" type="primary" style="width: 100px; height: 25px" @click="addProjects()" shape="circle" icon="plus" size="mini"> 选择项目 </u-button>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +    <view class="content-area-item mt20 p10 bg-white">
 | 
	
		
			
				|  |  | +      <view class="font14 weight mb10">明日计划</view>
 | 
	
		
			
				|  |  | +      <u-textarea
 | 
	
		
			
				|  |  | +        v-model="form.tomorrowPlan"
 | 
	
		
			
				|  |  | +        placeholder="请输入"
 | 
	
		
			
				|  |  | +        placeholderStyle="color:#909399;font-size:12px"
 | 
	
		
			
				|  |  | +        :autoHeight="true"
 | 
	
		
			
				|  |  | +        border="none"
 | 
	
		
			
				|  |  | +        style="padding: 0px"
 | 
	
		
			
				|  |  | +        @change="realTimeSaving()"
 | 
	
		
			
				|  |  | +      ></u-textarea>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +    <view class="content-area-item mt20 p10 bg-white">
 | 
	
		
			
				|  |  | +      <view class="font14 weight mb10">工作协调</view>
 | 
	
		
			
				|  |  | +      <u-textarea
 | 
	
		
			
				|  |  | +        v-model="form.coordinateWork"
 | 
	
		
			
				|  |  | +        placeholder="请输入"
 | 
	
		
			
				|  |  | +        placeholderStyle="color:#909399;font-size:12px"
 | 
	
		
			
				|  |  | +        :autoHeight="true"
 | 
	
		
			
				|  |  | +        border="none"
 | 
	
		
			
				|  |  | +        style="padding: 0px"
 | 
	
		
			
				|  |  | +        @change="realTimeSaving()"
 | 
	
		
			
				|  |  | +      ></u-textarea>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +    <view class="content-area-item mt20 p10 bg-white">
 | 
	
		
			
				|  |  | +      <view class="font14 weight mb10">抄送到人</view>
 | 
	
		
			
				|  |  | +      <view class="flex flex-wrap">
 | 
	
		
			
				|  |  | +        <view class="mb10" v-for="user in userList" :key="user">
 | 
	
		
			
				|  |  | +          <u-avatar
 | 
	
		
			
				|  |  | +            class="box-list-item-user-pic-avatar mr10"
 | 
	
		
			
				|  |  | +            :src="user.avatar"
 | 
	
		
			
				|  |  | +            shape="square"
 | 
	
		
			
				|  |  | +            size="40"
 | 
	
		
			
				|  |  | +            fontSize="12"
 | 
	
		
			
				|  |  | +            color="#ffffff"
 | 
	
		
			
				|  |  | +            :bgColor="$settingStore.themeColor.color"
 | 
	
		
			
				|  |  | +            v-if="user.avatar"
 | 
	
		
			
				|  |  | +          ></u-avatar>
 | 
	
		
			
				|  |  | +          <u-avatar
 | 
	
		
			
				|  |  | +            class="box-list-item-user-pic-avatar mr10"
 | 
	
		
			
				|  |  | +            :text="user.label.length > 2 ? user.label.slice(1, 3) : user.label"
 | 
	
		
			
				|  |  | +            shape="square"
 | 
	
		
			
				|  |  | +            size="40"
 | 
	
		
			
				|  |  | +            fontSize="12"
 | 
	
		
			
				|  |  | +            color="#ffffff"
 | 
	
		
			
				|  |  | +            :bgColor="$settingStore.themeColor.color"
 | 
	
		
			
				|  |  | +            v-else
 | 
	
		
			
				|  |  | +          ></u-avatar>
 | 
	
		
			
				|  |  | +        </view>
 | 
	
		
			
				|  |  | +      </view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <u-button class="mt20" type="primary" style="width: 100px; height: 25px" @click="addUsers()" shape="circle" icon="plus" size="mini"> 选择人员 </u-button>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +  </view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <view class="content-area-item mt20 p10 bg-white">
 | 
	
		
			
				|  |  | +    <view class="flex">
 | 
	
		
			
				|  |  | +      <view class="font14 weight">同步钉钉</view>
 | 
	
		
			
				|  |  | +      <u-switch
 | 
	
		
			
				|  |  | +        style="margin-left: auto"
 | 
	
		
			
				|  |  | +        :modelValue="form.sendDingTalk == 0 ? false : true"
 | 
	
		
			
				|  |  | +        :ctiveColor="proxy.$settingStore.themeColor.color"
 | 
	
		
			
				|  |  | +        size="20"
 | 
	
		
			
				|  |  | +        @change="(event) => switchChage(event, 'sendDingTalk')"
 | 
	
		
			
				|  |  | +        asyncChange
 | 
	
		
			
				|  |  | +      ></u-switch>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +    <view class="flex"> </view>
 | 
	
		
			
				|  |  | +  </view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <view class="content-area-item mt20 p10 bg-white">
 | 
	
		
			
				|  |  | +    <view class="flex">
 | 
	
		
			
				|  |  | +      <view class="font14 weight">定时发送</view>
 | 
	
		
			
				|  |  | +      <u-switch
 | 
	
		
			
				|  |  | +        style="margin-left: auto"
 | 
	
		
			
				|  |  | +        :modelValue="form.isRegularlySend == 0 ? false : true"
 | 
	
		
			
				|  |  | +        :ctiveColor="proxy.$settingStore.themeColor.color"
 | 
	
		
			
				|  |  | +        size="20"
 | 
	
		
			
				|  |  | +        @change="(event) => switchChage(event, 'isRegularlySend')"
 | 
	
		
			
				|  |  | +        asyncChange
 | 
	
		
			
				|  |  | +      ></u-switch>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +    <view class="flex" v-if="form.isRegularlySend == 0 ? false : true" @click="timeInputClick()">
 | 
	
		
			
				|  |  | +      <u-input
 | 
	
		
			
				|  |  | +        v-model="form.timingTime"
 | 
	
		
			
				|  |  | +        placeholder="请选择时间"
 | 
	
		
			
				|  |  | +        placeholderStyle="color:#909399;font-size:12px"
 | 
	
		
			
				|  |  | +        suffixIcon="arrow-right"
 | 
	
		
			
				|  |  | +        suffixIconStyle="color:#909399;font-size:12px;width:10px"
 | 
	
		
			
				|  |  | +        border="none"
 | 
	
		
			
				|  |  | +        style="padding: 0px; margin: 10px 0"
 | 
	
		
			
				|  |  | +        @change="realTimeSaving()"
 | 
	
		
			
				|  |  | +        disabledColor="transparent"
 | 
	
		
			
				|  |  | +        disabled
 | 
	
		
			
				|  |  | +      />
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +  </view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <view class="app-button">
 | 
	
		
			
				|  |  | +    <view class="app-button-padding"></view>
 | 
	
		
			
				|  |  | +    <view class="app-button-fixed">
 | 
	
		
			
				|  |  | +      <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +  </view>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <u-datetime-picker :show="timeShow" v-model="timeValue" mode="datetime" :closeOnClickOverlay="true" @cancel="timeShow = false" @confirm="timeConfirm"></u-datetime-picker>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  <u-modal :show="modalShow" title="" :confirmText="'确定'" :cancelText="'取消'" :zoom="false" :showCancelButton="true" @confirm="modalConfirm" @cancel="modalShow = false">
 | 
	
		
			
				|  |  | +    <view class="slot-content">
 | 
	
		
			
				|  |  | +      <u-checkbox-group v-model="projectsCheck" placement="row" :size="14">
 | 
	
		
			
				|  |  | +        <u-checkbox
 | 
	
		
			
				|  |  | +          :customStyle="{ marginBottom: '8px', width: '50%' }"
 | 
	
		
			
				|  |  | +          v-for="(item, index) in projectsList"
 | 
	
		
			
				|  |  | +          :key="index"
 | 
	
		
			
				|  |  | +          :label="item.projectName"
 | 
	
		
			
				|  |  | +          :name="item.id"
 | 
	
		
			
				|  |  | +          :activeColor="proxy.$settingStore.themeColor.color"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +        </u-checkbox>
 | 
	
		
			
				|  |  | +      </u-checkbox-group>
 | 
	
		
			
				|  |  | +    </view>
 | 
	
		
			
				|  |  | +  </u-modal>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script setup>
 | 
	
		
			
				|  |  | +/*----------------------------------依赖引入-----------------------------------*/
 | 
	
		
			
				|  |  | +import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 | 
	
		
			
				|  |  | +import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 | 
	
		
			
				|  |  | +/*----------------------------------接口引入-----------------------------------*/
 | 
	
		
			
				|  |  | +import { projectApi } from "@/api/business/project.js";
 | 
	
		
			
				|  |  | +/*----------------------------------组件引入-----------------------------------*/
 | 
	
		
			
				|  |  | +/*----------------------------------store引入-----------------------------------*/
 | 
	
		
			
				|  |  | +/*----------------------------------公共方法引入-----------------------------------*/
 | 
	
		
			
				|  |  | +import { storageSystem } from "@/utils/storage"; // 公共方法引用
 | 
	
		
			
				|  |  | +/*----------------------------------公共变量-----------------------------------*/
 | 
	
		
			
				|  |  | +const { proxy } = getCurrentInstance();
 | 
	
		
			
				|  |  | +/*----------------------------------变量声明-----------------------------------*/
 | 
	
		
			
				|  |  | +const state = reactive({
 | 
	
		
			
				|  |  | +  timeShow: false,
 | 
	
		
			
				|  |  | +  timeValue: Number(new Date()),
 | 
	
		
			
				|  |  | +  modalShow: false,
 | 
	
		
			
				|  |  | +  form: {
 | 
	
		
			
				|  |  | +    reportDate: null,
 | 
	
		
			
				|  |  | +    tomorrowPlan: "",
 | 
	
		
			
				|  |  | +    ccTo: "",
 | 
	
		
			
				|  |  | +    coordinateWork: null,
 | 
	
		
			
				|  |  | +    workContents: [],
 | 
	
		
			
				|  |  | +    sendDingTalk: 0,
 | 
	
		
			
				|  |  | +    isRegularlySend: 0,
 | 
	
		
			
				|  |  | +    timingTime: null,
 | 
	
		
			
				|  |  | +    reportStatus: null,
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  projectsCheck: [],
 | 
	
		
			
				|  |  | +  projectsList: [],
 | 
	
		
			
				|  |  | +  userList: [],
 | 
	
		
			
				|  |  | +  saveTime: "",
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +const { timeShow, timeValue, modalShow, form, projectsCheck, projectsList, userList, saveTime } = toRefs(state);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * @初始化
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function init() {
 | 
	
		
			
				|  |  | +  projectApi()
 | 
	
		
			
				|  |  | +    .ProjectsList()
 | 
	
		
			
				|  |  | +    .then((requset) => {
 | 
	
		
			
				|  |  | +      state.projectsList = requset.data;
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 定时发送输入框点击事件 */
 | 
	
		
			
				|  |  | +function timeInputClick() {
 | 
	
		
			
				|  |  | +  state.timeShow = true;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 时间选择器确定按钮点击事件 */
 | 
	
		
			
				|  |  | +function timeConfirm() {
 | 
	
		
			
				|  |  | +  state.form.timingTime = proxy.$common.formatterDateTime(state.timeValue);
 | 
	
		
			
				|  |  | +  state.timeShow = false;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 开关按钮change事件 */
 | 
	
		
			
				|  |  | +function switchChage(e, key) {
 | 
	
		
			
				|  |  | +  state.form[key] = e == true ? 1 : 0;
 | 
	
		
			
				|  |  | +  if (key === "isRegularlySend") {
 | 
	
		
			
				|  |  | +    state.form.timingTime = null;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  realTimeSaving();
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 项目按钮事件 */
 | 
	
		
			
				|  |  | +function addUsers() {
 | 
	
		
			
				|  |  | +  proxy.$tab.navigateTo(`/pages/business/common/projectMange/mall/index`);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 项目按钮事件 */
 | 
	
		
			
				|  |  | +function addProjects() {
 | 
	
		
			
				|  |  | +  state.modalShow = true;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 弹窗确定 */
 | 
	
		
			
				|  |  | +function modalConfirm() {
 | 
	
		
			
				|  |  | +  var newWorkContents = JSON.parse(JSON.stringify(state.form.workContents));
 | 
	
		
			
				|  |  | +  state.form.workContents = [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  state.projectsCheck.forEach((e) => {
 | 
	
		
			
				|  |  | +    state.form.workContents.push({
 | 
	
		
			
				|  |  | +      projectId: e,
 | 
	
		
			
				|  |  | +      projectName: proxy.$common.mapping("projectName", "id", e, state.projectsList),
 | 
	
		
			
				|  |  | +      workTime: "",
 | 
	
		
			
				|  |  | +      workContent: "",
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  newWorkContents.forEach((e) => {
 | 
	
		
			
				|  |  | +    state.form.workContents.forEach((f) => {
 | 
	
		
			
				|  |  | +      if (e.projectId == f.projectId) {
 | 
	
		
			
				|  |  | +        f.workTime = e.workTime;
 | 
	
		
			
				|  |  | +        f.workContent = e.workContent;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  state.modalShow = false;
 | 
	
		
			
				|  |  | +  realTimeSaving();
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 实时保存填写数据 */
 | 
	
		
			
				|  |  | +function realTimeSaving() {
 | 
	
		
			
				|  |  | +  state.saveTime = proxy.$common.formatterDate(new Date(), "hh:mm");
 | 
	
		
			
				|  |  | +  storageSystem.set("project", state);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** 提交 */
 | 
	
		
			
				|  |  | +function handleSubmit() {
 | 
	
		
			
				|  |  | +  if (!state.form.tomorrowPlan) {
 | 
	
		
			
				|  |  | +    proxy.$modal.showToast("请输入明日计划");
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  state.form.ccTo = state.userList.map((obj) => `${obj.id}`).join(",");
 | 
	
		
			
				|  |  | +  state.form.reportDate = proxy.$common.formatterDate(new Date(), "yyyy-MM-dd");
 | 
	
		
			
				|  |  | +  state.form.workContents.forEach((e) => {
 | 
	
		
			
				|  |  | +    e.workTime = parseInt(e.workTime);
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  projectApi()
 | 
	
		
			
				|  |  | +    .Insert(state.form)
 | 
	
		
			
				|  |  | +    .then((requset) => {
 | 
	
		
			
				|  |  | +      proxy.$tab.navigateBack(1); //返回到需要执行方法的页面
 | 
	
		
			
				|  |  | +      storageSystem.remove("project");
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +onReady(() => {});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +onShow(() => {
 | 
	
		
			
				|  |  | +  //循环将缓存数据遍历
 | 
	
		
			
				|  |  | +  var storages = storageSystem.get("project");
 | 
	
		
			
				|  |  | +  Object.keys(storages).forEach((key) => {
 | 
	
		
			
				|  |  | +    state[key] = storages[key];
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  //监听组件返回数据
 | 
	
		
			
				|  |  | +  uni.$on("UserMall", function (value) {
 | 
	
		
			
				|  |  | +    state.userList = value;
 | 
	
		
			
				|  |  | +    realTimeSaving();
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +onLoad((options) => {
 | 
	
		
			
				|  |  | +  init();
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +onUnload(() => {
 | 
	
		
			
				|  |  | +  uni.$off("UserMall"); //将值删除监听器
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<style lang="scss" scoped>
 | 
	
		
			
				|  |  | +:deep(.u-cell__body) {
 | 
	
		
			
				|  |  | +  color: #000000;
 | 
	
		
			
				|  |  | +  font-size: 12px;
 | 
	
		
			
				|  |  | +  padding: 10px 0px !important;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:deep(.u-collapse-item__content__text) {
 | 
	
		
			
				|  |  | +  padding: 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:deep(.u-cell__left-icon-wrap) {
 | 
	
		
			
				|  |  | +  margin: 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.content-area {
 | 
	
		
			
				|  |  | +  &-title {
 | 
	
		
			
				|  |  | +    text-align: right;
 | 
	
		
			
				|  |  | +    color: #909399;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</style>
 |