diff --git a/src/pages.json b/src/pages.json index ccf0c9a..d8e5604 100644 --- a/src/pages.json +++ b/src/pages.json @@ -190,6 +190,12 @@ "style": { "navigationBarTitleText": "补卡申请" } + }, + { + "path": "detail", + "style": { + "navigationBarTitleText": "补卡审核" + } } ] } diff --git a/src/pages/make-card/components/item.vue b/src/pages/make-card/components/item.vue index a6fef9f..813f023 100644 --- a/src/pages/make-card/components/item.vue +++ b/src/pages/make-card/components/item.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/make-card/create.vue b/src/pages/make-card/create.vue index 7dd4a1c..0738bcc 100644 --- a/src/pages/make-card/create.vue +++ b/src/pages/make-card/create.vue @@ -35,7 +35,7 @@ - + @@ -63,11 +63,12 @@ import { ref, reactive, computed } from "vue" import { onLoad } from "@dcloudio/uni-app" import { http } from "@/utils/request" import { timeFormat } from "@climblee/uv-ui/libs/function/index" -const columns = [["上班打卡", "下班打卡"]] +const columns = [["上班补卡", "上班补卡"]] const formRef = ref(null) const datetimePicker = ref(null) const pickerRef = ref(null) const modalRef = ref(null) +// const value = ref(Number(new Date()) const id = ref(0) const loading = ref(false) const form = reactive({ @@ -97,6 +98,23 @@ const rules = reactive({ }) onLoad(options => { id.value = options.id + if (id.value) { + http + .request({ + url: `/hr/sign-repairs/${options.id}`, + method: "GET", + header: { + Accept: "application/json" + } + }) + .then(res => { + form.date = timeFormat(res.date, "yyyy-MM-dd hh:mm") + form.reason = res.reason + form.isOutSide = res.sign_type == 1 ? false : true + form.outside_remarks = res.outside_remarks + form.sign_time = res.sign_time == 1 ? "上班补卡" : "下班补卡" + }) + } }) const submit = () => { @@ -109,17 +127,20 @@ const onSubmit = async () => { if (loading.value) return loading.value = true try { + let url = id.value ? `/hr/sign-repairs/${id.value}` : "/hr/sign-repairs" + let method = id.value ? "PUT" : "POST" await http.request({ - url: `/hr/sign-repairs`, - method: "POST", + url: url, + method: method, header: { Accept: "application/json" }, data: { date: form.date, - sign_time: form.sign_time == "上班打卡" ? 1 : 2, + sign_time: form.sign_time == "上班补卡" ? 1 : 2, reason: form.reason, - outside_remarks: form.outside_remarks + outside_remarks: form.outside_remarks, + sign_type: form.isOutSide ? 2 : 1 } }) uni.showToast({ diff --git a/src/pages/make-card/detail.vue b/src/pages/make-card/detail.vue new file mode 100644 index 0000000..6db9752 --- /dev/null +++ b/src/pages/make-card/detail.vue @@ -0,0 +1,130 @@ + + diff --git a/src/pages/make-card/list.vue b/src/pages/make-card/list.vue index ea02605..3f01619 100644 --- a/src/pages/make-card/list.vue +++ b/src/pages/make-card/list.vue @@ -38,7 +38,7 @@ const tabList = ref([ apiUrl: "/hr/sign-repairs" }, { - name: "补卡申请" + name: "补卡审核" } ]) const mescrollItem0 = ref(null) diff --git a/src/utils/status.js b/src/utils/status.js index dc843c6..c7d401c 100644 --- a/src/utils/status.js +++ b/src/utils/status.js @@ -63,15 +63,37 @@ const data = { value: 4, name: '未完成', color: '#999999' - }] + }], + // 不卡申请 + workflow_check: [ + { + value: 1, + name: '待提审', + color: '#f56c6c' + }, { + value: 2, + name: '审核中', + color: '#f56c6c' + }, { + value: 3, + name: '已通过', + color: '#3c9cff' + }, { + value: 4, + name: '审核未通过', + color: '#999999' + }, { + value: 5, + name: '已取消', + color: '#999999' + } + ] } export default function (value, status, key) { if (!status) { return value } - const item = data[status]?.find((item) => item.value === value) - if (item && key) { return item[key] ?? value }