|
|
|
@ -8,29 +8,29 @@
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
:confirmLoading="confirmLoading">
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
<a-form-model class="main" :model="form">
|
|
|
|
|
<a-form-model ref="form" :rules="formRule" class="main" :model="form">
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-model-item label="服务流程名称" :wrapperCol="wrapperCol" :labelCol="labelCol">
|
|
|
|
|
<a-input placeholder="服务流程名称" v-model="form.statusSKUName" />
|
|
|
|
|
<a-form-model-item prop="serviceWorkflowName" label="服务流程名称" :wrapperCol="wrapperCol" :labelCol="labelCol">
|
|
|
|
|
<a-input placeholder="服务流程名称" v-model="form.serviceWorkflowName" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-model-item label="服务流程代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
|
|
<a-input placeholder="服务流程代码" v-model="form.statusSKUName" />
|
|
|
|
|
<a-form-model-item prop="serviceWorkflowCode" label="服务流程代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
|
|
<a-input placeholder="服务流程代码" v-model="form.serviceWorkflowCode" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-model-item label="所属租户" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
|
|
<a-select
|
|
|
|
|
show-search
|
|
|
|
|
v-model="form.tenantName"
|
|
|
|
|
v-model="form.belongTenantId"
|
|
|
|
|
@search="TenantHandleSearch"
|
|
|
|
|
:default-active-first-option="false"
|
|
|
|
|
:show-arrow="false"
|
|
|
|
|
:filter-option="false"
|
|
|
|
|
:not-found-content="null">
|
|
|
|
|
<a-select-option v-for="item in SysTenantData" :key="item.id" :value="item.name">
|
|
|
|
|
<a-select-option v-for="item in SysTenantData" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
@ -80,26 +80,26 @@
|
|
|
|
|
<div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
<span>服务信息</span>
|
|
|
|
|
<a v-if="!form.serviceWorkflowName" @click="addItemFlag = true">添加</a>
|
|
|
|
|
<a v-if="!form.serviceProject.serviceProjectName" @click="addItemFlag = true">添加</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="form.serviceWorkflowName">
|
|
|
|
|
<span style="margin-right: 30px;">服务名称:{{ form.serviceWorkflowName }}</span>
|
|
|
|
|
<span style="margin-right: 30px;">服务代码:{{ form.serviceWorkflowCode }}</span>
|
|
|
|
|
<div v-if="form.serviceProject.serviceProjectName">
|
|
|
|
|
<span style="margin-right: 30px;">服务名称:{{ form.serviceProject.serviceProjectName }}</span>
|
|
|
|
|
<span style="margin-right: 30px;">服务代码:{{ form.serviceProject.serviceProjectCode }}</span>
|
|
|
|
|
<a @click="addItemFlag = true">修改</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
<span>状态</span>
|
|
|
|
|
<a @click="activeFlag = true">添加</a>
|
|
|
|
|
<a @click="handleAddStatus">添加</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="statBox" v-if="form.statusList.length > 0">
|
|
|
|
|
<div class="status" v-for="(item,index) in form.statusList" :key="item.sortNo">
|
|
|
|
|
<div class="statBox" v-if="form.statusSkuList.length > 0">
|
|
|
|
|
<div class="status" v-for="(item,index) in form.statusSkuList" :key="item.sortNo">
|
|
|
|
|
<span class="sort">{{ item.sortNo }}</span>
|
|
|
|
|
<span class="name">{{ item.showName }}</span>
|
|
|
|
|
<span class="action">
|
|
|
|
|
<a-icon type="setting" style="margin-right: 10px;cursor: pointer;" />
|
|
|
|
|
<a-icon type="delete" @click="handleDelAct(index)" style="cursor: pointer;" />
|
|
|
|
|
<a-icon type="setting" @click="handleEditStatus(item,index)" style="margin-right: 10px;cursor: pointer;" />
|
|
|
|
|
<a-icon type="delete" @click="handleDelStatus(index)" style="cursor: pointer;" />
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -123,7 +123,7 @@
|
|
|
|
|
<span>服务项目:</span>
|
|
|
|
|
<a-select
|
|
|
|
|
show-search
|
|
|
|
|
placeholder="请选择租户名称"
|
|
|
|
|
placeholder="请选择服务项目"
|
|
|
|
|
v-model="serviceItem"
|
|
|
|
|
style="width: 300px;margin-right: 20px;"
|
|
|
|
|
@search="projectSearch"
|
|
|
|
@ -151,11 +151,11 @@
|
|
|
|
|
:labelCol="{ span: 3 }"
|
|
|
|
|
:wrapperCol="{ span: 21 }"
|
|
|
|
|
:model="activeForm">
|
|
|
|
|
<a-form-model-item prop="statusSKUId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-form-model-item prop="pkId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-select
|
|
|
|
|
show-search
|
|
|
|
|
placeholder="请选择流程活动"
|
|
|
|
|
v-model="activeForm.statusSKUId"
|
|
|
|
|
v-model="activeForm.pkId"
|
|
|
|
|
style="width: 300px;margin-right: 20px;"
|
|
|
|
|
@search="activeSearch"
|
|
|
|
|
:default-active-first-option="false"
|
|
|
|
@ -181,8 +181,8 @@
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item style="margin-bottom: 10px;" label="包含子状态">
|
|
|
|
|
<a-checkbox v-model="activeForm.isContainsSub"></a-checkbox>
|
|
|
|
|
<a v-if="activeForm.isContainsSub" style="margin-left: 10px;" @click="handlePushSub">添加子状态</a>
|
|
|
|
|
<a-checkbox v-model="activeForm.isContainsSubs"></a-checkbox>
|
|
|
|
|
<a v-if="activeForm.isContainsSubs" style="margin-left: 10px;" @click="handlePushSub">添加子状态</a>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<p>说明:包含子状态,可指定多个子状态,启用一个状态触发后,当前状态触发</p>
|
|
|
|
|
<div class="statBox" v-if="activeForm.subList.length > 0">
|
|
|
|
@ -214,11 +214,11 @@
|
|
|
|
|
:labelCol="{ span: 3 }"
|
|
|
|
|
:wrapperCol="{ span: 21 }"
|
|
|
|
|
:model="subActiveForm">
|
|
|
|
|
<a-form-model-item prop="statusSKUId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-form-model-item prop="pkId" style="margin-bottom: 10px;" label="流程活动">
|
|
|
|
|
<a-select
|
|
|
|
|
show-search
|
|
|
|
|
placeholder="请选择流程活动"
|
|
|
|
|
v-model="subActiveForm.statusSKUId"
|
|
|
|
|
v-model="subActiveForm.pkId"
|
|
|
|
|
style="width: 300px;margin-right: 20px;"
|
|
|
|
|
@search="activeSearch"
|
|
|
|
|
:default-active-first-option="false"
|
|
|
|
@ -274,13 +274,13 @@
|
|
|
|
|
:show-arrow="false"
|
|
|
|
|
:filter-option="false"
|
|
|
|
|
:not-found-content="null">
|
|
|
|
|
<a-select-option v-for="item in activeList" :key="item.pkId" :value="item.pkId">
|
|
|
|
|
{{ item.showName }}
|
|
|
|
|
<a-select-option v-for="item in statusList" :key="item.pkId" :value="item.pkId">
|
|
|
|
|
{{ item.statusSKUName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item style="margin-bottom: 10px;" label="状态代码">
|
|
|
|
|
123
|
|
|
|
|
{{ statusSKUCode }}
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item prop="showName" style="margin-bottom: 10px;" label="活动名称">
|
|
|
|
|
<a-input v-model="addActiveForm.showName" />
|
|
|
|
@ -299,7 +299,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { StatusSkuBaseSave, StatusSkuBaseSavAndEnable, projectQueryList, QueryActivitiesList, QueryListStatus, SaveWFActivities } from '@/api/modular/system/appManage'
|
|
|
|
|
import { workFlowGetInfo, StatusSkuBaseSavAndEnable, projectQueryList, QueryActivitiesList, QueryListStatus, SaveWFActivities, workFlowSave } from '@/api/modular/system/appManage'
|
|
|
|
|
import { SysTenantPage } from '@/api/modular/main/bookingprinttemplate'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -319,9 +319,14 @@ export default {
|
|
|
|
|
activeForm: {
|
|
|
|
|
sortNo: 1,
|
|
|
|
|
subList: [],
|
|
|
|
|
isContainsSub: false
|
|
|
|
|
isContainsSubs: false
|
|
|
|
|
},
|
|
|
|
|
subActiveFlag: false,
|
|
|
|
|
formRule: {
|
|
|
|
|
belongTenantId: [{ required: true, message: '请选择租户', trigger: 'change' }],
|
|
|
|
|
serviceWorkflowCode: [{ required: true, message: '请输入服务代码', trigger: 'blur' }],
|
|
|
|
|
serviceWorkflowName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }]
|
|
|
|
|
},
|
|
|
|
|
addRules: {
|
|
|
|
|
statusSKUId: [{ required: true, message: '请选择状态名称', trigger: 'change' }],
|
|
|
|
|
showName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }]
|
|
|
|
@ -329,24 +334,28 @@ export default {
|
|
|
|
|
activeRules: {
|
|
|
|
|
valType: [{ required: true, message: '请选择值类型', trigger: 'change' }],
|
|
|
|
|
sortNo: [{ required: true, message: '请输入顺序号', trigger: 'blur' }],
|
|
|
|
|
statusSKUId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
pkId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
},
|
|
|
|
|
subActiveRules: {
|
|
|
|
|
valType: [{ required: true, message: '请选择值类型', trigger: 'change' }],
|
|
|
|
|
sortNo: [{ required: true, message: '请输入顺序号', trigger: 'blur' }],
|
|
|
|
|
statusSKUId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
pkId: [{ required: true, message: '请选择流程活动', trigger: 'change' }]
|
|
|
|
|
},
|
|
|
|
|
addItemFlag: false,
|
|
|
|
|
visible: false,
|
|
|
|
|
subType: 'add',
|
|
|
|
|
type: 'add',
|
|
|
|
|
index: '',
|
|
|
|
|
activeFlag: false,
|
|
|
|
|
statusSKUCode: '',
|
|
|
|
|
addActiveFlag: false,
|
|
|
|
|
addActiveForm: {},
|
|
|
|
|
projectList: [],
|
|
|
|
|
statusSkuList: [],
|
|
|
|
|
statusList: [],
|
|
|
|
|
activeList: [],
|
|
|
|
|
form: {
|
|
|
|
|
statusList: []
|
|
|
|
|
statusSkuList: [],
|
|
|
|
|
serviceProject: {}
|
|
|
|
|
},
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
SysTenantData: []
|
|
|
|
@ -371,16 +380,43 @@ export default {
|
|
|
|
|
add() {
|
|
|
|
|
this.visible = true
|
|
|
|
|
},
|
|
|
|
|
edit(record) {
|
|
|
|
|
this.visible = true
|
|
|
|
|
workFlowGetInfo({ pkId: record.pkId }).then(res => {
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.form = res.data.ext
|
|
|
|
|
if (!this.form.serviceProject) {
|
|
|
|
|
this.form.serviceProject = {}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.data.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleDelSub(index) {
|
|
|
|
|
this.activeForm.subList.splice(index, 1)
|
|
|
|
|
},
|
|
|
|
|
handleDelAct(index) {
|
|
|
|
|
this.form.activeList.splice(index, 1)
|
|
|
|
|
handleDelStatus(index) {
|
|
|
|
|
this.form.statusSkuList.splice(index, 1)
|
|
|
|
|
},
|
|
|
|
|
handleAddStatus() {
|
|
|
|
|
this.activeFlag = true
|
|
|
|
|
this.activeForm = {
|
|
|
|
|
sortNo: 1,
|
|
|
|
|
subList: [],
|
|
|
|
|
isContainsSubs: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handlePushSub() {
|
|
|
|
|
this.subActiveFlag = true
|
|
|
|
|
this.subType = 'add'
|
|
|
|
|
},
|
|
|
|
|
handleEditStatus(item, index) {
|
|
|
|
|
this.activeForm = JSON.parse(JSON.stringify(item))
|
|
|
|
|
this.type = 'edit'
|
|
|
|
|
this.activeFlag = true
|
|
|
|
|
this.index = index
|
|
|
|
|
},
|
|
|
|
|
handleEditSub(item, index) {
|
|
|
|
|
this.subActiveForm = JSON.parse(JSON.stringify(item))
|
|
|
|
|
this.subType = 'edit'
|
|
|
|
@ -423,7 +459,7 @@ export default {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.activeList.forEach(item => {
|
|
|
|
|
if (item.pkId === this.subActiveForm.statusSKUId) {
|
|
|
|
|
if (item.pkId === this.subActiveForm.pkId) {
|
|
|
|
|
this.subActiveForm.showName = item.showName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -443,23 +479,37 @@ export default {
|
|
|
|
|
this.$refs.activeForm.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
const arr = []
|
|
|
|
|
this.form.statusList.forEach(item => {
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
this.form.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.sortNo === this.activeForm.sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.form.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.sortNo === this.activeForm.sortNo &&
|
|
|
|
|
this.activeForm.sortNo !== this.form.statusSkuList[this.index].sortNo) {
|
|
|
|
|
arr.push(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
this.$message.warning('顺序号不能重复')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.activeList.forEach(item => {
|
|
|
|
|
if (item.pkId === this.activeForm.statusSKUId) {
|
|
|
|
|
console.log(item.pkId, this.activeForm.pkId)
|
|
|
|
|
if (item.pkId == this.activeForm.pkId) {
|
|
|
|
|
this.activeForm.showName = item.showName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.form.statusList.push(JSON.parse(JSON.stringify(this.activeForm)))
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
this.form.statusSkuList.push(JSON.parse(JSON.stringify(this.activeForm)))
|
|
|
|
|
} else {
|
|
|
|
|
this.$set(this.form.statusSkuList, this.index, JSON.parse(JSON.stringify(this.activeForm)))
|
|
|
|
|
}
|
|
|
|
|
this.activeFlag = false
|
|
|
|
|
this.form.statusList.sort((a, b) => a.sortNo - b.sortNo)
|
|
|
|
|
this.form.statusSkuList.sort((a, b) => a.sortNo - b.sortNo)
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -485,8 +535,12 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleChangeStatus() {
|
|
|
|
|
|
|
|
|
|
handleChangeStatus(val) {
|
|
|
|
|
this.statusList.forEach(item => {
|
|
|
|
|
if (item.pkId === val) {
|
|
|
|
|
this.statusSKUCode = item.statusSKUCode
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleInto() {
|
|
|
|
|
if (!this.serviceItem) {
|
|
|
|
@ -495,25 +549,35 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
this.projectList.forEach(item => {
|
|
|
|
|
if (item.pkId === this.serviceItem) {
|
|
|
|
|
this.form.serviceWorkflowCode = item.serviceProjectCode
|
|
|
|
|
this.form.serviceWorkflowName = item.serviceProjectName
|
|
|
|
|
this.form.serviceProject.serviceProjectCode = item.serviceProjectCode
|
|
|
|
|
this.form.serviceProject.serviceProjectName = item.serviceProjectName
|
|
|
|
|
this.form.serviceProject.pkId = item.pkId
|
|
|
|
|
this.addItemFlag = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const { form: { validateFields } } = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
values.pkId = null
|
|
|
|
|
StatusSkuBaseSave(values).then((res) => {
|
|
|
|
|
this.$refs.form.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
this.form.statusSkuList.forEach(item => {
|
|
|
|
|
if (item.isContainsSubs) {
|
|
|
|
|
item.isContainsSub = 1
|
|
|
|
|
} else {
|
|
|
|
|
item.isContainsSub = 2
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.SysTenantData.forEach(item => {
|
|
|
|
|
if (item.id === this.form.belongTenantId) {
|
|
|
|
|
this.form.belongTenantName = item.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
workFlowSave(this.form).then((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('新增失败:' + res.data.msg)
|
|
|
|
|
}
|
|
|
|
|