| | |
| | | <el-option label="周六" value="SAT"/> |
| | | <el-option label="周日" value="SUN"/> |
| | | </el-select> |
| | | <el-time-picker v-model="form.frequencyDetail" placeholder="选择时间" format="HH:mm" |
| | | <el-time-picker v-model="form.time" placeholder="选择时间" format="HH:mm" |
| | | value-format="HH:mm" style="width: 50%"/> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {reactive, ref, computed} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import {addOrEditTimingTask} from "@/api/inspectionManagement/index.js"; |
| | | import {userListAll} from "@/api/publicApi/index.js"; |
| | |
| | | }) |
| | | if (type === 'edit') { |
| | | form.value = {...row} |
| | | form.value.inspector = form.value.inspectorIds.split(',').map(Number) |
| | | } |
| | | } |
| | | |
| | |
| | | dialogVisitable.value = false |
| | | emit('closeDia') |
| | | } |
| | | const selectedDateTime = ref(null) |
| | | |
| | | // 计算星期几 |
| | | const dayOfWeek = computed(() => { |
| | | if (!selectedDateTime.value) return '' |
| | | |
| | | const date = new Date(selectedDateTime.value) |
| | | const dayIndex = date.getDay() |
| | | |
| | | const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] |
| | | return weekDays[dayIndex] |
| | | }) |
| | | // 提交合并表单 |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | proxy.$refs["formRef"].validate(async valid => { |
| | | if (valid) { |
| | | form.value.inspectorIds = form.value.inspector.join(',') |
| | | if (form.value.frequencyType === 'WEEKLY') { |
| | | form.value.frequencyDetail = form.value.week + ',' + form.value.frequencyDetail |
| | | let frequencyDetail = '' |
| | | frequencyDetail = form.value.week + ',' + form.value.time |
| | | form.value.frequencyDetail = frequencyDetail |
| | | } |
| | | let res = await userStore.getInfo() |
| | | form.value.registrantId = res.user.userId |
| | | addOrEditTimingTask(form.value).then(() => { |
| | | cancel() |
| | | proxy.$modal.msgSuccess('提交成功') |