|
@@ -56,54 +56,31 @@
|
|
|
@click="showProExcel(rowData.id)"
|
|
|
>查看表格数据</el-button
|
|
|
>
|
|
|
- <div class="el-descriptions__title">提交申请</div>
|
|
|
- <div class="applyForm" v-if="checkList.length > 0">
|
|
|
- <template v-for="(item, index) in checkList" :key="item">
|
|
|
- <el-form :model="item" ref="applyFormRef">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12" style="display: flex">
|
|
|
- <svg-icon
|
|
|
- :icon-class="
|
|
|
- rowData.state == '3'
|
|
|
- ? 'jiantoumr'
|
|
|
- : item.sort == rowData.sort
|
|
|
- ? 'jiantou'
|
|
|
- : 'jiantoumr'
|
|
|
- "
|
|
|
- v-if="showStatus"
|
|
|
- style="margin-right: 10px"
|
|
|
- size="30"
|
|
|
- />
|
|
|
- <el-form-item
|
|
|
- style="flex: 1; align-items: start"
|
|
|
- :label="item.positionName + ':'"
|
|
|
- :rules="[{ required: true }]"
|
|
|
- prop="userName"
|
|
|
- >
|
|
|
- <el-tree-select
|
|
|
- v-model="item.userName"
|
|
|
- :data="userList"
|
|
|
- :disabled="showStatus"
|
|
|
- filterable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- style="margin-left: 20px"
|
|
|
- label="备注:"
|
|
|
- v-if="item.remark"
|
|
|
- prop="remark"
|
|
|
- >
|
|
|
- {{ item.remark }}
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
+ <div class="el-descriptions__title" v-if="!showStatus">提交申请</div>
|
|
|
+ <div class="applyForm" v-if="!showStatus">
|
|
|
+
|
|
|
+ <el-form ref="flowFormRef" v-model="flowForm" label-width="100px">
|
|
|
+ <el-form-item label="选择流程模板">
|
|
|
+ <el-tree-select
|
|
|
+ v-model="flowForm.definitionId"
|
|
|
+ :data="flowDataList"
|
|
|
+ filterable
|
|
|
+ :props="{ label: 'flowName', value: 'id' }"
|
|
|
+ @change="whenSelectFlow"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="name" v-if="name">
|
|
|
+ <el-tree-select
|
|
|
+ v-model="flowForm.users"
|
|
|
+ :data="nextUserList"
|
|
|
+ filterable
|
|
|
+ :props="{ label: 'userName', value: 'userName' }"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
<div class="btns">
|
|
|
- <el-button type="primary" @click="submit" v-if="!showStatus"
|
|
|
+ <el-button type="primary" @click="sureToSave" v-if="!showStatus"
|
|
|
>提交</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -143,6 +120,7 @@ import {
|
|
|
examineList,
|
|
|
getExcelData,
|
|
|
} from "@/api/apply";
|
|
|
+import {getNextUser, queryFlowDataList, submitFlow, submitFormDataFlow} from "@/api/flow";
|
|
|
import { getUserTree } from "@/api/system/user";
|
|
|
import ExcelDataBbox from "@/views/base/apply/excelDataBbox.vue";
|
|
|
const props = defineProps({
|
|
@@ -157,18 +135,52 @@ const dialog8 = reactive({
|
|
|
title: "表单列表",
|
|
|
visible: false,
|
|
|
});
|
|
|
+// 流程定义的列表
|
|
|
+const flowDataList = ref([]);
|
|
|
+const getFlowList = () => {
|
|
|
+ queryFlowDataList({ flowType: flowForm.flow_type }).then((res) => {
|
|
|
+ flowDataList.value = res.data;
|
|
|
+ });
|
|
|
+};
|
|
|
const showProList = ref([]);
|
|
|
const showProExcel = async (id) => {
|
|
|
const { data, code } = await getExcelData(id);
|
|
|
showProList.value = data;
|
|
|
dialog8.visible = true;
|
|
|
};
|
|
|
+
|
|
|
+const flowFormRef = ref();
|
|
|
+const flowForm = reactive({
|
|
|
+ businessId: "",
|
|
|
+ flow_type: "workFormService",
|
|
|
+ definitionId: "",
|
|
|
+ users: "",
|
|
|
+});
|
|
|
const excelShow = ref(false);
|
|
|
const ExDataObj = ref({});
|
|
|
const toShowExcel = (item) => {
|
|
|
ExDataObj.value = item;
|
|
|
excelShow.value = true;
|
|
|
};
|
|
|
+const nextUserList=ref([]);
|
|
|
+const name = ref("");
|
|
|
+const whenSelectFlow = () => {
|
|
|
+ // 选择完模板之后 下一节点人员 type 1 流程 2 任务
|
|
|
+ getNextUser("1", flowForm.definitionId).then((res) => {
|
|
|
+ name.value = res.data?.roleName ?? "";
|
|
|
+ nextUserList.value = res.data?.users ?? [];
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const sureToSave = () => {
|
|
|
+ flowForm.businessId=props.rowData.id;
|
|
|
+ submitFormDataFlow(flowForm).then(() => {
|
|
|
+ ElMessage.success("提交成功");
|
|
|
+ emits("close");
|
|
|
+ emits("dataList");
|
|
|
+
|
|
|
+ });
|
|
|
+};
|
|
|
const emits = defineEmits(["close", "dataList"]);
|
|
|
const getStatus = (val) => {
|
|
|
switch (val) {
|
|
@@ -254,12 +266,13 @@ const getExamineList = async () => {
|
|
|
};
|
|
|
onMounted(async () => {
|
|
|
await getlogList();
|
|
|
- queryUserList();
|
|
|
- if (props.showStatus == true) {
|
|
|
- await getExamineList();
|
|
|
+ //queryUserList();
|
|
|
+ getFlowList();
|
|
|
+ /*if (props.showStatus == true) {
|
|
|
+ getFlowList();
|
|
|
} else {
|
|
|
await getFormListData(props.rowData.formType);
|
|
|
- }
|
|
|
+ }*/
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|