|
@@ -120,6 +120,26 @@
|
|
|
<el-input v-model="ruleForm.remark" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+
|
|
|
+ <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>
|
|
|
</el-scrollbar>
|
|
|
<div class="btns">
|
|
|
<el-button type="primary" @click="submit">提交</el-button>
|
|
@@ -129,7 +149,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
+<script setup lang="ts">
|
|
|
import {
|
|
|
breakReportInfoById,
|
|
|
operationListByIds,
|
|
@@ -141,10 +161,15 @@ import {
|
|
|
getList1,
|
|
|
delError,
|
|
|
getReworkList,
|
|
|
+ submitFlow,
|
|
|
} from "@/api/rework";
|
|
|
import { useProcessStore } from "@/store/modules/processView";
|
|
|
import { useDictionaryStore } from "@/store/modules/dictionary";
|
|
|
-import {getunProcessedList} from "@/api/prosteps/index.js";
|
|
|
+import {
|
|
|
+ getNextUser,
|
|
|
+ getunProcessedList,
|
|
|
+ queryFlowDataList,
|
|
|
+} from "@/api/prosteps/index.js";
|
|
|
const dictStroe = useDictionaryStore();
|
|
|
const processStore = useProcessStore();
|
|
|
const infoIndex = ref(null);
|
|
@@ -174,7 +199,7 @@ const getReworkTempList = async () => {
|
|
|
};
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
-const processList=ref([]);
|
|
|
+const processList = ref([]);
|
|
|
const toAdd = () => {
|
|
|
formStatus.value = false;
|
|
|
/*breakReportInfoById(processStore.scanInfo.id).then((res) => {
|
|
@@ -183,6 +208,7 @@ const toAdd = () => {
|
|
|
getunProcessedList(processStore.scanInfo.id).then((res) => {
|
|
|
processList.value = res.data ?? [];
|
|
|
});
|
|
|
+ getFlowList();
|
|
|
};
|
|
|
const toList = () => {
|
|
|
resetForm();
|
|
@@ -231,7 +257,7 @@ const submit = async () => {
|
|
|
};
|
|
|
|
|
|
const addTask = async () => {
|
|
|
- const { code } = await addRework({
|
|
|
+ const res1 = await addRework({
|
|
|
...ruleForm.value,
|
|
|
materialCode: processStore.scanInfo.materialCode,
|
|
|
materialName: processStore.scanInfo.materialName,
|
|
@@ -241,12 +267,15 @@ const addTask = async () => {
|
|
|
workOrderCode: processStore.odersData.workOrderCode,
|
|
|
materialModel: processStore.processInfo.materialModel,
|
|
|
});
|
|
|
- if (code == "200") {
|
|
|
- resetForm();
|
|
|
- formStatus.value = true;
|
|
|
- getPagination();
|
|
|
- ElMessage.success("操作成功!");
|
|
|
- }
|
|
|
+ let result = await submitFlow({
|
|
|
+ businessId: res1.data.id,
|
|
|
+ ...flowForm,
|
|
|
+ });
|
|
|
+
|
|
|
+ resetForm();
|
|
|
+ formStatus.value = true;
|
|
|
+ getPagination();
|
|
|
+ ElMessage.success("操作成功!");
|
|
|
};
|
|
|
|
|
|
const ruleFormRef = ref(null);
|
|
@@ -281,6 +310,31 @@ onMounted(() => {
|
|
|
getPagination();
|
|
|
getReworkTempList();
|
|
|
});
|
|
|
+
|
|
|
+// 流程定义的列表
|
|
|
+const flowDataList = ref<any[]>([]);
|
|
|
+const getFlowList = () => {
|
|
|
+ queryFlowDataList({ flowType: flowForm.flow_type }).then((res) => {
|
|
|
+ flowDataList.value = res.data;
|
|
|
+ });
|
|
|
+};
|
|
|
+const name = ref("");
|
|
|
+const nextUserList = ref<any[]>([]);
|
|
|
+const whenSelectFlow = () => {
|
|
|
+ // 选择完模板之后 下一节点人员 type 1 流程 2 任务
|
|
|
+ getNextUser("1", flowForm.definitionId).then((res) => {
|
|
|
+ name.value = res.data?.roleName ?? "";
|
|
|
+ nextUserList.value = res.data?.users ?? [];
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const flowFormRef = ref();
|
|
|
+const flowForm = reactive<any>({
|
|
|
+ flow_type: "reworkService",
|
|
|
+ definitionId: "",
|
|
|
+ users: "",
|
|
|
+ flowIns: "",
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|