服务项目

dev
sunzehua 2 days ago
parent 29af111bcc
commit 36b4b26865

@ -14,7 +14,7 @@ VITE_PUBLIC_PATH = /
# Please note that no line breaks
# VITE_PROXY = [["/basic-api","http://60.209.125.238"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
VITE_PROXY=[["/api","http://118.190.144.189:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666cxf.com/stage-api"]] # 开发 测试环境
# Delete console
VITE_DROP_CONSOLE = false

@ -111,4 +111,12 @@ export function SaveWFActivities(parameter) {
method: 'post',
data: parameter,
})
}
export function GetInfo(parameter) {
return request({
url: '/opApi/ServiceWorkFlowBase/GetInfo',
method: 'get',
params: parameter,
})
}

@ -62,12 +62,12 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [{
title: '服务流程名称',
dataIndex: 'serviceWorkflowName',
width: '160px'
width: 160
},
{
title: '服务流程代码',
dataIndex: 'serviceWorkflowCode',
width: '200px'
width: 200
},
{
title: '状态数量',

@ -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,37 +327,115 @@ function activeSearch(data) {
activeList.value = res.data
})
}
const SysTenantData = ref([]) as any
function handleSubmit() {
confirmLoading.value = true
console.log(form.value)
form.value.statusSkuList.forEach(item => {
if (item.isContainsSubs) {
item.isContainsSub = 1
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 {
item.isContainsSub = 0
form.value.statusSkuList.forEach(item => {
if (item.sortNo === activeForm.value.sortNo &&
activeForm.value.sortNo !== form.value.statusSkuList[index.value].sortNo) {
arr.push(1)
}
})
}
})
SysTenantData.value.forEach(item => {
if (item.id === form.value.belongTenantId) {
form.value.belongTenantName = item.name
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)
})
workFlowSaveAndEnable(form.value).then((res) => {
confirmLoading.value = false
if (res.data.succ) {
if (form.value.pkId) {
createMessage.success('修改成功')
} else {
createMessage.success('新增成功')
}
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
}
handleCancel()
})
if (subType.value === 'add') {
activeForm.value.subList.push(JSON.parse(JSON.stringify(subActiveForm.value)))
} else {
createMessage.error(res.data.msg)
activeForm.value.subList[subIndex.value] = JSON.parse(JSON.stringify(subActiveForm.value))
}
}).finally((res) => {
confirmLoading.value = false
subActiveFlag.value = false
activeForm.value.subList.sort((a, b) => a.sortNo - b.sortNo)
})
}
function handleSubmit() {
formRef.value.validate().then(() => {
confirmLoading.value = true
form.value.statusSkuList.forEach(item => {
if (item.isContainsSubs) {
item.isContainsSub = 1
} else {
item.isContainsSub = 0
}
})
SysTenantData.value.forEach(item => {
if (item.id === form.value.belongTenantId) {
form.value.belongTenantName = item.name
}
})
workFlowSaveAndEnable(form.value).then((res) => {
confirmLoading.value = false
if (res.succeeded) {
if (form.value.pkId) {
createMessage.success('修改成功')
} else {
createMessage.success('新增成功')
}
emit('handleSuccess')
handleCancel()
} else {
createMessage.error(res.data.msg)
}
}).finally((res) => {
confirmLoading.value = false
})
})
}
function handlePub() {
workFlowSetUnPublishRelease([form.value.pkId]).then(res => {
@ -331,14 +450,14 @@ 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>

@ -60,7 +60,7 @@
</template>
</template>
</BasicTable>
<editForm ref="editFormRef" ></editForm>
<editForm @handleSuccess="handleSuccess" ref="editFormRef" ></editForm>
</div>
</template>
<script lang="ts" setup>
@ -111,23 +111,17 @@ const [registerTable, { reload, clearSelectedRowKeys, getSelectRows, getRawDataS
},
})
const editFormRef = ref()
const [registerForm, { resetFields, setFieldsValue, validate, getFieldsValue, }] = useForm({
labelWidth: 100,
schemas: detailForm,
showActionButtonGroup: false,
})
function GoDetailed(type, row) {
if (!type) {
editFormRef.value.init()
} else {
// open.value = true
// const newRow = JSON.parse(JSON.stringify(row))
// setTimeout(() => {
// setFieldsValue(newRow)
// }, 10)
editFormRef.value.init(row.pkId)
}
}
function handleSuccess(){
reload()
}
const loading = ref(false)
function FnDel() {

Loading…
Cancel
Save