|
@@ -67,6 +67,7 @@
|
|
|
<script setup>
|
|
|
import { nextTick, ref, watch } from 'vue'
|
|
|
import { getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
import HcTaskForm from './task-form.vue'
|
|
|
import HcTaskNotes from './task-notes.vue'
|
|
|
import mainApi from '~api/tasks/hc-data'
|
|
@@ -85,6 +86,10 @@ const props = defineProps({
|
|
|
const emit = defineEmits(['finish', 'close'])
|
|
|
const uuid = getRandom(4)
|
|
|
|
|
|
+const useAppState = useAppStore()
|
|
|
+const projectId = ref(useAppState.getProjectId || '')
|
|
|
+const contractId = ref(useAppState.getContractId || '')
|
|
|
+
|
|
|
//双向绑定
|
|
|
// eslint-disable-next-line no-undef
|
|
|
const isShow = defineModel('modelValue', {
|
|
@@ -240,7 +245,19 @@ const taskFormFinish = () => {
|
|
|
//确认审批
|
|
|
const confirmLoading = ref(false)
|
|
|
const confirmClick = async () => {
|
|
|
- //emit('finish')
|
|
|
+ confirmLoading.value = true
|
|
|
+ const { error, code, msg } = await mainApi.taskApprove({
|
|
|
+ taskId: rowInfo.value.id,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ confirmLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('审批成功')
|
|
|
+ emit('finish')
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '审批失败')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//驳回审批
|