|
@@ -170,15 +170,22 @@
|
|
<script setup>
|
|
<script setup>
|
|
/*----------------------------------依赖引入-----------------------------------*/
|
|
/*----------------------------------依赖引入-----------------------------------*/
|
|
import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
|
|
import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
|
|
-import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
|
|
|
|
|
|
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject, watchEffect } from "vue";
|
|
/*----------------------------------接口引入-----------------------------------*/
|
|
/*----------------------------------接口引入-----------------------------------*/
|
|
import { projectApi } from "@/api/business/project.js";
|
|
import { projectApi } from "@/api/business/project.js";
|
|
|
|
+import { UserList } from "@/api/system/user.js";
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
/*----------------------------------store引入-----------------------------------*/
|
|
/*----------------------------------store引入-----------------------------------*/
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
import { storageSystem } from "@/utils/storage"; // 公共方法引用
|
|
import { storageSystem } from "@/utils/storage"; // 公共方法引用
|
|
/*----------------------------------公共变量-----------------------------------*/
|
|
/*----------------------------------公共变量-----------------------------------*/
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
+const props = defineProps({
|
|
|
|
+ projectList: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: {},
|
|
|
|
+ },
|
|
|
|
+});
|
|
/*----------------------------------变量声明-----------------------------------*/
|
|
/*----------------------------------变量声明-----------------------------------*/
|
|
const state = reactive({
|
|
const state = reactive({
|
|
timeShow: false,
|
|
timeShow: false,
|
|
@@ -198,14 +205,19 @@ const state = reactive({
|
|
projectsCheck: [],
|
|
projectsCheck: [],
|
|
projectsList: [],
|
|
projectsList: [],
|
|
userList: [],
|
|
userList: [],
|
|
|
|
+ userDate: [],
|
|
saveTime: "",
|
|
saveTime: "",
|
|
});
|
|
});
|
|
-const { timeShow, timeValue, modalShow, form, projectsCheck, projectsList, userList, saveTime } = toRefs(state);
|
|
|
|
|
|
+const { timeShow, timeValue, modalShow, form, projectsCheck, projectsList, userList, userDate, saveTime } = toRefs(state);
|
|
|
|
|
|
/**
|
|
/**
|
|
* @初始化
|
|
* @初始化
|
|
*/
|
|
*/
|
|
function init() {
|
|
function init() {
|
|
|
|
+ UserList({ pageNum: "1", pageSize: "10000" }).then((res) => {
|
|
|
|
+ state.userDate = res.data.rows;
|
|
|
|
+ });
|
|
|
|
+
|
|
projectApi()
|
|
projectApi()
|
|
.ProjectsList()
|
|
.ProjectsList()
|
|
.then((requset) => {
|
|
.then((requset) => {
|
|
@@ -220,7 +232,7 @@ function timeInputClick() {
|
|
|
|
|
|
/** 时间选择器确定按钮点击事件 */
|
|
/** 时间选择器确定按钮点击事件 */
|
|
function timeConfirm() {
|
|
function timeConfirm() {
|
|
- state.form.timingTime = proxy.$common.formatterDateTime(state.timeValue);
|
|
|
|
|
|
+ state.form.timingTime = proxy.$time.getFormatterDate(state.timeValue);
|
|
state.timeShow = false;
|
|
state.timeShow = false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -251,7 +263,7 @@ function insertProjects() {
|
|
|
|
|
|
/** 实时保存填写数据 */
|
|
/** 实时保存填写数据 */
|
|
function realTimeSaving() {
|
|
function realTimeSaving() {
|
|
- state.saveTime = proxy.$common.formatterDate(new Date(), "hh:mm");
|
|
|
|
|
|
+ state.saveTime = proxy.$time.formatterDate(new Date(), "hh:mm");
|
|
storageSystem.set("project", state);
|
|
storageSystem.set("project", state);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -289,7 +301,7 @@ function handleSubmit() {
|
|
}
|
|
}
|
|
|
|
|
|
state.form.ccTo = state.userList.map((obj) => `${obj.id}`).join(",");
|
|
state.form.ccTo = state.userList.map((obj) => `${obj.id}`).join(",");
|
|
- state.form.reportDate = proxy.$common.formatterDate(new Date(), "yyyy-MM-dd");
|
|
|
|
|
|
+ state.form.reportDate = proxy.$time.formatterDate(new Date(), "yyyy-MM-dd");
|
|
state.form.workContents.forEach((e) => {
|
|
state.form.workContents.forEach((e) => {
|
|
e.workTime = parseInt(e.workTime);
|
|
e.workTime = parseInt(e.workTime);
|
|
});
|
|
});
|
|
@@ -298,15 +310,47 @@ function handleSubmit() {
|
|
.Insert(state.form)
|
|
.Insert(state.form)
|
|
.then((requset) => {
|
|
.then((requset) => {
|
|
proxy.$tab.redirectTo("/pages/business/common/projectMange/record/index"); //返回到需要执行方法的页面
|
|
proxy.$tab.redirectTo("/pages/business/common/projectMange/record/index"); //返回到需要执行方法的页面
|
|
- state.form = {
|
|
|
|
- workContents: [],
|
|
|
|
- tomorrowPlan: "",
|
|
|
|
- coordinateWork: null,
|
|
|
|
- };
|
|
|
|
|
|
+ state.form.workContents = [];
|
|
|
|
+ state.form.tomorrowPlan = "";
|
|
|
|
+ state.form.coordinateWork = null;
|
|
|
|
+ state.form.isRegularlySend = 0;
|
|
|
|
+ state.form.timingTime = null;
|
|
storageSystem.set("project", state);
|
|
storageSystem.set("project", state);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+watchEffect(() => {
|
|
|
|
+ if (JSON.stringify(props.projectList) != "{}") {
|
|
|
|
+ state.userList = [];
|
|
|
|
+
|
|
|
|
+ Object.keys(props.projectList).forEach((key) => {
|
|
|
|
+ state.form[key] = props.projectList[key];
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var ccTo = state.form.ccTo.length > 0 ? state.form.ccTo.split(",").map((num) => Number(num)) : [];
|
|
|
|
+ state.userDate.forEach((e) => {
|
|
|
|
+ if (ccTo.includes(e.userId)) {
|
|
|
|
+ state.userList.push({
|
|
|
|
+ address: e.address,
|
|
|
|
+ avatar: e.avatar,
|
|
|
|
+ deptId: e.deptId,
|
|
|
|
+ email: e.email,
|
|
|
|
+ id: e.userId,
|
|
|
|
+ label: e.nickName,
|
|
|
|
+ nickName: e.nickName,
|
|
|
|
+ phonenumber: e.phonenumber,
|
|
|
|
+ post: e.post,
|
|
|
|
+ sex: e.sex,
|
|
|
|
+ userId: e.userId,
|
|
|
|
+ userName: e.userName,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ storageSystem.set("project", state);
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
onReady(() => {});
|
|
onReady(() => {});
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|