|
|
|
@ -79,9 +79,10 @@
|
|
|
|
|
<span class="sort">{{ item.sortNo }}</span>
|
|
|
|
|
<span class="name">{{ item.showName }}</span>
|
|
|
|
|
<span class="action">
|
|
|
|
|
<a-icon type="setting" @click="handleEditStatus(item, index)"
|
|
|
|
|
style="margin-right: 10px;cursor: pointer;" />
|
|
|
|
|
<a-icon type="delete" @click="handleDelStatus(index)" style="cursor: pointer;" />
|
|
|
|
|
<i class="iconfont icon-shezhi" @click="handleEditStatus(item, index)"
|
|
|
|
|
style="margin-right: 10px;cursor: pointer;"></i>
|
|
|
|
|
<i class="iconfont icon-shanchu3" @click="handleDelStatus(index)"
|
|
|
|
|
style="cursor: pointer;"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -125,7 +126,7 @@
|
|
|
|
|
</a-modal>
|
|
|
|
|
<a-modal title="流程活动引入" :width="800" :visible="activeFlag" @cancel="activeFlag = false">
|
|
|
|
|
<div>
|
|
|
|
|
<a-form ref="activeForm" :rules="activeRules" :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }"
|
|
|
|
|
<a-form ref="activeFormRef" :rules="activeRules" :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }"
|
|
|
|
|
:model="activeForm">
|
|
|
|
|
<a-form-item name="pkId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-select show-search placeholder="请选择流程活动" v-model:value="activeForm.pkId"
|
|
|
|
@ -156,9 +157,9 @@
|
|
|
|
|
<span class="sort">{{ item.sortNo }}</span>
|
|
|
|
|
<span class="name">{{ item.showName }}</span>
|
|
|
|
|
<span class="action">
|
|
|
|
|
<a-icon type="setting" @click="handleEditSub(item, index)"
|
|
|
|
|
style="margin-right: 10px;cursor: pointer;" />
|
|
|
|
|
<a-icon type="delete" @click="handleDelSub(index)" style="cursor: pointer;" />
|
|
|
|
|
<i class="iconfont icon-shezhi" @click="handleEditSub(item, index)"
|
|
|
|
|
style="margin-right: 10px;cursor: pointer;"></i>
|
|
|
|
|
<i class="iconfont icon-shanchu3" @click="handleDelSub(index)" style="cursor: pointer;"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -232,13 +233,47 @@
|
|
|
|
|
<div v-else>暂无数据</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<a-modal title="子流程活动引入" :width="800" :visible="subActiveFlag" @cancel="subActiveFlag = false">
|
|
|
|
|
<div>
|
|
|
|
|
<a-form ref="subActiveFormRef" :rules="subActiveRules" :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }"
|
|
|
|
|
:model="subActiveForm">
|
|
|
|
|
<a-form-item name="pkId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-select show-search placeholder="请选择流程活动" v-model:value="subActiveForm.pkId"
|
|
|
|
|
style="width: 300px;margin-right: 20px;" @search="activeSearch">
|
|
|
|
|
<a-select-option v-for="item in activeList" :key="item.pkId" :value="item.pkId">
|
|
|
|
|
{{ item.showName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
<a @click="addActiveFlag = true">添加</a>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item name="sortNo" style="margin-bottom: 10px;" label="顺序号">
|
|
|
|
|
<a-input-number :precision="0" v-model:value="subActiveForm.sortNo" :min="1" :max="100" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item name="valType" label="值类型">
|
|
|
|
|
<a-select placeholder="请选择值类型" v-model:value="subActiveForm.valType"
|
|
|
|
|
style="width: 300px;margin-right: 20px;">
|
|
|
|
|
<a-select-option value="DATETIME">时间</a-select-option>
|
|
|
|
|
<a-select-option value="STRING">字符串</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button type="primary" @click="handleSaveSubActive">
|
|
|
|
|
确定
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="subActiveFlag = false">
|
|
|
|
|
关闭
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
|
|
import { ref, onMounted, defineEmits } from 'vue'
|
|
|
|
|
import {
|
|
|
|
|
projectQueryList, QueryActivitiesList, QueryListStatus, workFlowSetUnPublishRelease,
|
|
|
|
|
workFlowSetUnEnable, workFlowSaveAndEnable, GetShowTimeLine,SaveWFActivities
|
|
|
|
|
workFlowSetUnEnable, workFlowSaveAndEnable, GetShowTimeLine, SaveWFActivities, GetInfo
|
|
|
|
|
} from './api'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
@ -258,6 +293,7 @@ const wrapperCol = {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 17 }
|
|
|
|
|
}
|
|
|
|
|
const activeFormRef = ref('') as any
|
|
|
|
|
const addActiveFormRef = ref('') as any
|
|
|
|
|
const statusList = ref([]) as any
|
|
|
|
|
const addItemFlag = ref(false)
|
|
|
|
@ -275,6 +311,11 @@ const activeRules = {
|
|
|
|
|
sortNo: [{ required: true, message: '请输入顺序号', trigger: 'blur' }],
|
|
|
|
|
pkId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
}
|
|
|
|
|
const subActiveRules = {
|
|
|
|
|
valType: [{ required: true, message: '请选择值类型', trigger: 'change' }],
|
|
|
|
|
sortNo: [{ required: true, message: '请输入顺序号', trigger: 'blur' }],
|
|
|
|
|
pkId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
}
|
|
|
|
|
const serviceItem = ref('')
|
|
|
|
|
const activeFlag = ref(false)
|
|
|
|
|
const type = ref('')
|
|
|
|
@ -286,10 +327,85 @@ function activeSearch(data) {
|
|
|
|
|
activeList.value = res.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const index = ref(0)
|
|
|
|
|
function handleSaveActive() {
|
|
|
|
|
activeFormRef.value.validate().then(() => {
|
|
|
|
|
const arr = []
|
|
|
|
|
if (type.value === 'add') {
|
|
|
|
|
form.value.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.sortNo === activeForm.value.sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
form.value.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.sortNo === activeForm.value.sortNo &&
|
|
|
|
|
activeForm.value.sortNo !== form.value.statusSkuList[index.value].sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
createMessage.warning('顺序号不能重复')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
activeList.value.forEach(item => {
|
|
|
|
|
if (item.pkId == activeForm.value.pkId) {
|
|
|
|
|
activeForm.value.showName = item.showName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (type.value === 'add') {
|
|
|
|
|
form.value.statusSkuList.push(JSON.parse(JSON.stringify(activeForm.value)))
|
|
|
|
|
} else {
|
|
|
|
|
form.value.statusSkuList[index.value] = JSON.parse(JSON.stringify(activeForm.value))
|
|
|
|
|
}
|
|
|
|
|
activeFlag.value = false
|
|
|
|
|
form.value.statusSkuList.sort((a, b) => a.sortNo - b.sortNo)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const SysTenantData = ref([]) as any
|
|
|
|
|
const subActiveFormRef = ref('') as any
|
|
|
|
|
const emit = defineEmits(['handleSuccess'])
|
|
|
|
|
function handleSaveSubActive() {
|
|
|
|
|
console.log(123113)
|
|
|
|
|
subActiveFormRef.value.validate().then(() => {
|
|
|
|
|
const arr = []
|
|
|
|
|
if (subType.value === 'add') {
|
|
|
|
|
activeForm.value.subList.forEach(item => {
|
|
|
|
|
if (item.sortNo === subActiveForm.value.sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
activeForm.value.subList.forEach(item => {
|
|
|
|
|
if (item.sortNo === subActiveForm.value.sortNo &&
|
|
|
|
|
subActiveForm.value.sortNo !== activeForm.value.subList[subIndex.value].sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
createMessage.warning('顺序号不能重复')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
activeList.value.forEach(item => {
|
|
|
|
|
if (item.pkId === subActiveForm.value.pkId) {
|
|
|
|
|
subActiveForm.value.showName = item.showName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (subType.value === 'add') {
|
|
|
|
|
activeForm.value.subList.push(JSON.parse(JSON.stringify(subActiveForm.value)))
|
|
|
|
|
} else {
|
|
|
|
|
activeForm.value.subList[subIndex.value] = JSON.parse(JSON.stringify(subActiveForm.value))
|
|
|
|
|
}
|
|
|
|
|
subActiveFlag.value = false
|
|
|
|
|
activeForm.value.subList.sort((a, b) => a.sortNo - b.sortNo)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handleSubmit() {
|
|
|
|
|
formRef.value.validate().then(() => {
|
|
|
|
|
confirmLoading.value = true
|
|
|
|
|
console.log(form.value)
|
|
|
|
|
form.value.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.isContainsSubs) {
|
|
|
|
|
item.isContainsSub = 1
|
|
|
|
@ -304,12 +420,13 @@ function handleSubmit() {
|
|
|
|
|
})
|
|
|
|
|
workFlowSaveAndEnable(form.value).then((res) => {
|
|
|
|
|
confirmLoading.value = false
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
if (form.value.pkId) {
|
|
|
|
|
createMessage.success('修改成功')
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.success('新增成功')
|
|
|
|
|
}
|
|
|
|
|
emit('handleSuccess')
|
|
|
|
|
handleCancel()
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(res.data.msg)
|
|
|
|
@ -317,6 +434,8 @@ function handleSubmit() {
|
|
|
|
|
}).finally((res) => {
|
|
|
|
|
confirmLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function handlePub() {
|
|
|
|
|
workFlowSetUnPublishRelease([form.value.pkId]).then(res => {
|
|
|
|
@ -331,11 +450,11 @@ function handlePub() {
|
|
|
|
|
function handleSaveAddActive() {
|
|
|
|
|
addActiveFormRef.value.validate().then(() => {
|
|
|
|
|
SaveWFActivities(addActiveForm.value).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
createMessage.success('添加成功')
|
|
|
|
|
addActiveFlag.value = false
|
|
|
|
|
QueryActivitiesList().then(res => {
|
|
|
|
|
activeList.value = res.data.ext
|
|
|
|
|
activeList.value = res.data
|
|
|
|
|
})
|
|
|
|
|
// this.$refs.addActiveForm.resetFields()
|
|
|
|
|
}
|
|
|
|
@ -417,10 +536,10 @@ function handlePushSub() {
|
|
|
|
|
subActiveFlag.value = true
|
|
|
|
|
subType.value = 'add'
|
|
|
|
|
}
|
|
|
|
|
function handleEditStatus(item, index) {
|
|
|
|
|
function handleEditStatus(item, index1) {
|
|
|
|
|
const arr = []
|
|
|
|
|
activeList.value.forEach(ite => {
|
|
|
|
|
if (item == item.pkId) {
|
|
|
|
|
if (item.pkId == ite.pkId) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -433,9 +552,9 @@ function handleEditStatus(item, index) {
|
|
|
|
|
activeForm.value = JSON.parse(JSON.stringify(item))
|
|
|
|
|
type.value = 'edit'
|
|
|
|
|
activeFlag.value = true
|
|
|
|
|
index.value = index
|
|
|
|
|
index.value = index1
|
|
|
|
|
}
|
|
|
|
|
const subActiveForm = ref({})
|
|
|
|
|
const subActiveForm = ref({}) as any
|
|
|
|
|
const subIndex = ref(0)
|
|
|
|
|
function handleEditSub(item, index) {
|
|
|
|
|
subActiveForm.value = JSON.parse(JSON.stringify(item))
|
|
|
|
@ -443,8 +562,40 @@ function handleEditSub(item, index) {
|
|
|
|
|
subActiveFlag.value = true
|
|
|
|
|
subIndex.value = index
|
|
|
|
|
}
|
|
|
|
|
function init() {
|
|
|
|
|
function init(id) {
|
|
|
|
|
visible.value = true
|
|
|
|
|
if (id) {
|
|
|
|
|
getDetail(id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function getDetail(id) {
|
|
|
|
|
confirmLoading.value = true
|
|
|
|
|
GetInfo({ id }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
if (res.data.statusSkuList) {
|
|
|
|
|
res.data.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.isContainsSub == 1) {
|
|
|
|
|
item.isContainsSubs = true
|
|
|
|
|
} else {
|
|
|
|
|
item.isContainsSubs = false
|
|
|
|
|
}
|
|
|
|
|
if (!item.subList) {
|
|
|
|
|
item.subList = []
|
|
|
|
|
}
|
|
|
|
|
if (!item.statusTriggerList) {
|
|
|
|
|
item.statusTriggerList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
res.data.statusSkuList = []
|
|
|
|
|
}
|
|
|
|
|
form.value = res.data
|
|
|
|
|
console.log(form.vale)
|
|
|
|
|
}
|
|
|
|
|
confirmLoading.value = false
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
confirmLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const timeFlag = ref(false)
|
|
|
|
|
const timeLoading = ref(false)
|
|
|
|
@ -453,7 +604,7 @@ function handleTime() {
|
|
|
|
|
timeFlag.value = true
|
|
|
|
|
timeLoading.value = true
|
|
|
|
|
GetShowTimeLine({ pkId: form.value.pkId }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
timeForm.value = res.data.ext
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(res.data.msg)
|
|
|
|
@ -586,4 +737,7 @@ function handleCancel() {
|
|
|
|
|
.blur {
|
|
|
|
|
margin: 0 20px;
|
|
|
|
|
}
|
|
|
|
|
:deep(.ant-form-item){
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|