|
@@ -37,9 +37,8 @@
|
|
|
<script setup>
|
|
|
import {ref,watch,onMounted} from "vue";
|
|
|
import tasksFlowApi from '~api/tasks/flow';
|
|
|
-import {ApprovalApi} from '~api/other';
|
|
|
+import {ApprovalApi,queryFixedFlow} from '~api/other';
|
|
|
import {getArrValue,getIndex,formValidate} from "vue-utils-plus"
|
|
|
-
|
|
|
const props = defineProps({
|
|
|
show: {
|
|
|
type: Boolean,
|
|
@@ -73,6 +72,14 @@ const props = defineProps({
|
|
|
type: Object,
|
|
|
default: () => ({})
|
|
|
},
|
|
|
+ type: { //first,log,wbs
|
|
|
+ type: [String,Number],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ typeData: {
|
|
|
+ type: [String, Number, Array, Object],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
//变量
|
|
@@ -80,6 +87,8 @@ const isShow = ref(props.show)
|
|
|
const projectId = ref(props.projectId)
|
|
|
const contractId = ref(props.contractId)
|
|
|
const ApiUrl = ref(props.url)
|
|
|
+const isTypes = ref(props.type)
|
|
|
+const typeDatas = ref(props.typeData)
|
|
|
|
|
|
//表单
|
|
|
const formRef = ref(null)
|
|
@@ -115,8 +124,10 @@ watch(() => [
|
|
|
props.taskName,
|
|
|
props.ids,
|
|
|
props.url,
|
|
|
- props.addition
|
|
|
-], ([val,pid,cid,name,ids,url,addition]) => {
|
|
|
+ props.addition,
|
|
|
+ props.type,
|
|
|
+ props.typeData
|
|
|
+], ([val,pid,cid,name,ids,url,addition, type, typeData]) => {
|
|
|
isShow.value = val
|
|
|
projectId.value = pid
|
|
|
contractId.value = cid
|
|
@@ -127,13 +138,29 @@ watch(() => [
|
|
|
taskContent: '', fixedFlowId: '', batch: 1, restrictDay: 1,
|
|
|
...addition
|
|
|
}
|
|
|
+ typeDatas.value = typeData
|
|
|
+ if (type !== isTypes.value) {
|
|
|
+ isTypes.value = type
|
|
|
+ getProcessDatasApi()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
- getProcessData()
|
|
|
+ getProcessDatasApi()
|
|
|
})
|
|
|
|
|
|
+const getProcessDatasApi = () => {
|
|
|
+ if (isShow.value) {
|
|
|
+ const type = isTypes.value
|
|
|
+ if (type === 'first' || type === 'log' || type === 'wbs') {
|
|
|
+ queryFixedFlowApi(type, typeDatas.value)
|
|
|
+ } else {
|
|
|
+ getProcessData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//获取流程数据
|
|
|
const linkUserJoinString = ref('')
|
|
|
const getProcessData = async () => {
|
|
@@ -150,6 +177,31 @@ const getProcessData = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
+const queryFixedFlowApi = async (type, datas) => {
|
|
|
+ let flowJson = {}
|
|
|
+ if (type === 'first') {
|
|
|
+ flowJson['firstId'] = datas
|
|
|
+ } else if (type === 'log') {
|
|
|
+ flowJson['theLogPrimaryKeyId'] = datas
|
|
|
+ } else if (type === 'wbs') {
|
|
|
+ flowJson['privatePKeyId'] = datas
|
|
|
+ }
|
|
|
+ //请求数据
|
|
|
+ linkUserJoinString.value = ''
|
|
|
+ const { error, code, data } = await queryFixedFlow({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ ...flowJson
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ processData.value = getArrValue(data['records'])
|
|
|
+ } else {
|
|
|
+ processData.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//流程数据切换
|
|
|
const handleProcessValue = (val) => {
|
|
|
const list = processData.value
|