|
@@ -151,7 +151,7 @@
|
|
|
|
|
|
<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" v-if="projectsList.length > 0">
|
|
|
+ <u-checkbox-group v-model="projectsCheck" placement="row" :size="14" @change="checkboxChange" v-if="projectsList.length > 0">
|
|
|
<u-checkbox
|
|
|
:customStyle="{ marginBottom: '8px', width: '50%' }"
|
|
|
v-for="(item, index) in projectsList"
|
|
@@ -187,10 +187,12 @@ const props = defineProps({
|
|
|
},
|
|
|
});
|
|
|
/*----------------------------------变量声明-----------------------------------*/
|
|
|
-const state = reactive({
|
|
|
+const modal = reactive({
|
|
|
timeShow: false,
|
|
|
timeValue: Number(new Date()),
|
|
|
modalShow: false,
|
|
|
+});
|
|
|
+const state = reactive({
|
|
|
form: {
|
|
|
reportDate: null,
|
|
|
tomorrowPlan: "",
|
|
@@ -208,7 +210,8 @@ const state = reactive({
|
|
|
userDate: [],
|
|
|
saveTime: "",
|
|
|
});
|
|
|
-const { timeShow, timeValue, modalShow, form, projectsCheck, projectsList, userList, userDate, saveTime } = toRefs(state);
|
|
|
+const { timeShow, timeValue, modalShow } = toRefs(modal);
|
|
|
+const { form, projectsCheck, projectsList, userList, userDate, saveTime } = toRefs(state);
|
|
|
|
|
|
/**
|
|
|
* @初始化
|
|
@@ -225,10 +228,15 @@ function init() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function checkboxChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ state.projectsCheck = e;
|
|
|
+}
|
|
|
+
|
|
|
/** 时间选择器确定按钮点击事件 */
|
|
|
-function timeConfirm() {
|
|
|
- state.form.timingTime = proxy.$time.getFormatterDate(state.timeValue);
|
|
|
- state.timeShow = false;
|
|
|
+function timeConfirm(e) {
|
|
|
+ state.form.timingTime = proxy.$time.getFormatterDate(e.value);
|
|
|
+ modal.timeShow = false;
|
|
|
}
|
|
|
|
|
|
/** 开关按钮change事件 */
|
|
@@ -242,7 +250,7 @@ function switchChage(e, key) {
|
|
|
|
|
|
/** 添加人员按钮事件 */
|
|
|
function insertUsers() {
|
|
|
- proxy.$tab.navigateTo(`/pages/business/common/projectMange/mall/index`);
|
|
|
+ proxy.$tab.navigateTo(`/pages/business/common/projectMange/mall/index?number=200`);
|
|
|
}
|
|
|
|
|
|
/** 删除人员按钮事件 */
|
|
@@ -253,7 +261,7 @@ function deleteUsers(index) {
|
|
|
|
|
|
/** 添加项目按钮事件 */
|
|
|
function insertProjects() {
|
|
|
- state.modalShow = true;
|
|
|
+ modal.modalShow = true;
|
|
|
}
|
|
|
|
|
|
/** 实时保存填写数据 */
|
|
@@ -298,7 +306,7 @@ function handleSubmit() {
|
|
|
state.form.ccTo = state.userList.map((obj) => `${obj.id}`).join(",");
|
|
|
state.form.reportDate = proxy.$time.formatterDate(new Date(), "yyyy-MM-dd");
|
|
|
state.form.workContents.forEach((e) => {
|
|
|
- e.workTime = parseInt(e.workTime);
|
|
|
+ e.workTime = Number(e.workTime);
|
|
|
});
|
|
|
|
|
|
projectApi()
|
|
@@ -323,6 +331,10 @@ watchEffect(() => {
|
|
|
state.form[key] = props.projectList[key];
|
|
|
});
|
|
|
|
|
|
+ state.form.workContents.forEach((e) => {
|
|
|
+ state.projectsCheck.push(e.projectId);
|
|
|
+ });
|
|
|
+
|
|
|
var ccTo = state.form.ccTo.length > 0 ? state.form.ccTo.split(",").map((num) => Number(num)) : [];
|
|
|
state.userDate.forEach((e) => {
|
|
|
if (ccTo.includes(e.userId)) {
|
|
@@ -343,10 +355,6 @@ watchEffect(() => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- state.form.workContents.forEach((e) => {
|
|
|
- state.projectsCheck.push(e.projectId);
|
|
|
- });
|
|
|
-
|
|
|
storageSystem.set("project", state);
|
|
|
}
|
|
|
});
|