|
@@ -111,7 +111,8 @@
|
|
|
v-if="consentOrRefuseVisible"
|
|
|
v-model="consentOrRefuseVisible"
|
|
|
:task-id="taskId"
|
|
|
- :current-type="currentDialog"
|
|
|
+ :current-type="currentType"
|
|
|
+ :form-data="currentFormData"
|
|
|
@success-cb="closeDetailEv"
|
|
|
></consent-or-refuse-dialog>
|
|
|
|
|
@@ -163,8 +164,10 @@ const loseSignVisible = ref(false)
|
|
|
const rollbackVisible = ref(false)
|
|
|
// 各种操作弹窗显示隐藏 end
|
|
|
const activeData = ref([])
|
|
|
-const currentDialog = ref(null)
|
|
|
-
|
|
|
+const currentType = ref(null)
|
|
|
+const currentFormData = ref({})
|
|
|
+// 当前form 表单数据字符串
|
|
|
+let cur_processForm_str = '[]'
|
|
|
const taskId = computed(() => {
|
|
|
return currentTaskRow.value.taskId || ''
|
|
|
})
|
|
@@ -193,10 +196,10 @@ const closeDetailEv = () => {
|
|
|
|
|
|
/**
|
|
|
* 详情按钮各个操作弹窗
|
|
|
- * @param type 评论 拒绝 同意等
|
|
|
+ * @param visibleType 评论 拒绝 同意等
|
|
|
*/
|
|
|
-const openComment = (type, item) => {
|
|
|
- switch (type) {
|
|
|
+const openComment = async (visibleType, item) => {
|
|
|
+ switch (visibleType) {
|
|
|
case 'reviewVisible':
|
|
|
reviewVisible.value = !reviewVisible.value
|
|
|
break
|
|
@@ -204,23 +207,28 @@ const openComment = (type, item) => {
|
|
|
addSignVisible.value = !addSignVisible.value
|
|
|
break
|
|
|
case 'consentOrRefuseVisible':
|
|
|
+ currentFormData.value = {}
|
|
|
// 点击同意
|
|
|
+ let bool = true
|
|
|
if (item === 'agree') {
|
|
|
- debugger
|
|
|
- // 验证表单 todo...
|
|
|
const api = validateForm.value.api
|
|
|
- api.validate((valid, fail) => {
|
|
|
+ bool = await api.validate((valid, fail) => {
|
|
|
if (valid) {
|
|
|
+ // 表单验证通过
|
|
|
const values = api.formData()
|
|
|
- console.warn(values, 'values')
|
|
|
- //todo 表单验证通过
|
|
|
- } else {
|
|
|
- //todo 表单验证未通过
|
|
|
+ const processForm = JSON.parse(cur_processForm_str)
|
|
|
+ processForm.forEach(v => {
|
|
|
+ // 填写的数据存储(local_: 本地数据处理标识)
|
|
|
+ v.local_value = values[v.field]
|
|
|
+ })
|
|
|
+ console.warn(processForm, 'processForm')
|
|
|
+ // 流程表单JSON内容 & local_value 保存
|
|
|
+ currentFormData.value = { processForm: JSON.stringify(processForm) }
|
|
|
}
|
|
|
})
|
|
|
- // return
|
|
|
}
|
|
|
- currentDialog.value = item
|
|
|
+ if (!bool) return
|
|
|
+ currentType.value = item
|
|
|
consentOrRefuseVisible.value = !consentOrRefuseVisible.value
|
|
|
break
|
|
|
case 'deliverToReviewVisible':
|
|
@@ -272,6 +280,7 @@ const getTaskDetail = () => {
|
|
|
}
|
|
|
})*/
|
|
|
const forms = JSON.parse(data.formContent)
|
|
|
+ cur_processForm_str = data.formContent
|
|
|
if (Array.isArray(forms)) {
|
|
|
validateForm.value.rule = forms
|
|
|
const api = validateForm.value.api
|
|
@@ -418,7 +427,7 @@ watch(
|
|
|
justify-content: flex-end;
|
|
|
height: 52px;
|
|
|
//border-top: 1px solid var(--color-neutral-3);
|
|
|
- border-top: 1px solid black;
|
|
|
+ border-top: 1px solid #e5e6ec;
|
|
|
padding: 0 20px;
|
|
|
}
|
|
|
}
|