|
@@ -2,7 +2,7 @@
|
|
|
* @Author: tengmingxue 1473375109@qq.com
|
|
* @Author: tengmingxue 1473375109@qq.com
|
|
|
* @Date: 2023-08-29 16:44:32
|
|
* @Date: 2023-08-29 16:44:32
|
|
|
* @LastEditors: tengmingxue 1473375109@qq.com
|
|
* @LastEditors: tengmingxue 1473375109@qq.com
|
|
|
- * @LastEditTime: 2023-09-21 09:17:05
|
|
|
|
|
|
|
+ * @LastEditTime: 2023-09-21 17:21:11
|
|
|
* @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\configProcess\addStepForm.vue
|
|
* @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\configProcess\addStepForm.vue
|
|
|
* @Description: 流程步骤配置表单
|
|
* @Description: 流程步骤配置表单
|
|
|
-->
|
|
-->
|
|
@@ -27,7 +27,7 @@
|
|
|
:disabled="true"
|
|
:disabled="true"
|
|
|
style="width: 50px; float: left"
|
|
style="width: 50px; float: left"
|
|
|
/>
|
|
/>
|
|
|
- <div class="btn-group">
|
|
|
|
|
|
|
+ <div class="btn-group" v-show="optType !== 3">
|
|
|
<span class="addBtn btn" @click="stepEdit(1)">+</span>
|
|
<span class="addBtn btn" @click="stepEdit(1)">+</span>
|
|
|
<span class="redBtn btn" @click="stepEdit(-1)">-</span>
|
|
<span class="redBtn btn" @click="stepEdit(-1)">-</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -42,7 +42,7 @@
|
|
|
<a-input
|
|
<a-input
|
|
|
v-model:value="formState.name"
|
|
v-model:value="formState.name"
|
|
|
@change="stepInfoChange"
|
|
@change="stepInfoChange"
|
|
|
- :disabled="formState.xh === 1"
|
|
|
|
|
|
|
+ :disabled="formState.xh === 1 || optType === 3"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -53,7 +53,11 @@
|
|
|
:labelCol="{ span: 4 }"
|
|
:labelCol="{ span: 4 }"
|
|
|
:wrapper-col="{ span: 12 }"
|
|
:wrapper-col="{ span: 12 }"
|
|
|
>
|
|
>
|
|
|
- <a-radio-group v-model:value="formState.model" @change="stepInfoChange">
|
|
|
|
|
|
|
+ <a-radio-group
|
|
|
|
|
+ v-model:value="formState.model"
|
|
|
|
|
+ @change="stepInfoChange"
|
|
|
|
|
+ :disabled="optType === 3"
|
|
|
|
|
+ >
|
|
|
<a-radio value="1">逐级</a-radio>
|
|
<a-radio value="1">逐级</a-radio>
|
|
|
<a-radio value="2">并行</a-radio>
|
|
<a-radio value="2">并行</a-radio>
|
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
@@ -78,6 +82,7 @@
|
|
|
multiple
|
|
multiple
|
|
|
tree-default-expand-all
|
|
tree-default-expand-all
|
|
|
@change="treeSelectChange"
|
|
@change="treeSelectChange"
|
|
|
|
|
+ :disabled="optType === 3"
|
|
|
>
|
|
>
|
|
|
<template #title="{ key, value }">
|
|
<template #title="{ key, value }">
|
|
|
<span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value }}</span>
|
|
<span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value }}</span>
|
|
@@ -97,6 +102,7 @@
|
|
|
placeholder="请选择处理人员"
|
|
placeholder="请选择处理人员"
|
|
|
mode="multiple"
|
|
mode="multiple"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
|
+ :disabled="optType === 3"
|
|
|
>
|
|
>
|
|
|
<template v-for="user in handlers" :key="user.userid">
|
|
<template v-for="user in handlers" :key="user.userid">
|
|
|
<a-select-option :value="user['userId']">{{ user['userName'] }}</a-select-option>
|
|
<a-select-option :value="user['userId']">{{ user['userName'] }}</a-select-option>
|
|
@@ -112,18 +118,32 @@
|
|
|
style="height: 100%"
|
|
style="height: 100%"
|
|
|
>
|
|
>
|
|
|
<template #operation="{ record }">
|
|
<template #operation="{ record }">
|
|
|
- <a
|
|
|
|
|
- v-if="record.xh !== 1"
|
|
|
|
|
- style="color: #2d74e7; margin: 10px"
|
|
|
|
|
- @click="moveClick(-1, record)"
|
|
|
|
|
- >上移</a
|
|
|
|
|
- >
|
|
|
|
|
- <a
|
|
|
|
|
- v-if="record.xh < formState.userList.length"
|
|
|
|
|
- style="color: #2d74e7; margin: 10px"
|
|
|
|
|
- @click="moveClick(1, record)"
|
|
|
|
|
- >下移</a
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <template v-if="optType !== 3">
|
|
|
|
|
+ <a
|
|
|
|
|
+ v-if="record.xh !== 1"
|
|
|
|
|
+ style="color: #2d74e7; margin: 10px"
|
|
|
|
|
+ @click="moveClick(-1, record)"
|
|
|
|
|
+ >上移</a
|
|
|
|
|
+ >
|
|
|
|
|
+ <a
|
|
|
|
|
+ v-if="record.xh < formState.userList.length"
|
|
|
|
|
+ style="color: #2d74e7; margin: 10px"
|
|
|
|
|
+ @click="moveClick(1, record)"
|
|
|
|
|
+ >下移</a
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <a
|
|
|
|
|
+ v-if="record.xh !== 1"
|
|
|
|
|
+ style="color: #9c9d9e; margin: 10px"
|
|
|
|
|
+ >上移</a
|
|
|
|
|
+ >
|
|
|
|
|
+ <a
|
|
|
|
|
+ v-if="record.xh < formState.userList.length"
|
|
|
|
|
+ style="color: #9c9d9e; margin: 10px"
|
|
|
|
|
+ >下移</a
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</a-form>
|
|
</a-form>
|
|
@@ -138,6 +158,7 @@ import { queryPersonByDepId } from '/@/api/sys/user';
|
|
|
|
|
|
|
|
const props = {
|
|
const props = {
|
|
|
currStep: { type: Object, require: true },
|
|
currStep: { type: Object, require: true },
|
|
|
|
|
+ optType: { type: Number, require: true },
|
|
|
};
|
|
};
|
|
|
interface FormState {
|
|
interface FormState {
|
|
|
xh: number;
|
|
xh: number;
|
|
@@ -153,6 +174,7 @@ export default defineComponent({
|
|
|
props,
|
|
props,
|
|
|
setup(props, { emit }) {
|
|
setup(props, { emit }) {
|
|
|
let currStep = ref(props.currStep);
|
|
let currStep = ref(props.currStep);
|
|
|
|
|
+ const optType = ref(props.optType);
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
const columns = [
|
|
const columns = [
|
|
|
{
|
|
{
|
|
@@ -215,19 +237,26 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+ watch(
|
|
|
|
|
+ () => props.optType,
|
|
|
|
|
+ (i) => {
|
|
|
|
|
+ optType.value = i;
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
watch(
|
|
watch(
|
|
|
() => formState.value.user,
|
|
() => formState.value.user,
|
|
|
(list) => {
|
|
(list) => {
|
|
|
- changeUserId(list)
|
|
|
|
|
|
|
+ changeUserId(list);
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
/**
|
|
/**
|
|
|
* 用户改变
|
|
* 用户改变
|
|
|
- */
|
|
|
|
|
- const changeUserId = async(ids) => {
|
|
|
|
|
|
|
+ */
|
|
|
|
|
+ const changeUserId = async (ids) => {
|
|
|
formState.value.userList = [];
|
|
formState.value.userList = [];
|
|
|
if (!ids || ids.length < 1) return;
|
|
if (!ids || ids.length < 1) return;
|
|
|
- if(handlers.value.length === 0) await queryUsers(formState.value.dept)
|
|
|
|
|
|
|
+ if (handlers.value.length === 0) await queryUsers(formState.value.dept);
|
|
|
ids.map((item, index) => {
|
|
ids.map((item, index) => {
|
|
|
const obj = handlers.value.find((user) => user['userId'] === item) as any;
|
|
const obj = handlers.value.find((user) => user['userId'] === item) as any;
|
|
|
if (obj) {
|
|
if (obj) {
|
|
@@ -235,6 +264,7 @@ export default defineComponent({
|
|
|
formState.value.userList.push(obj);
|
|
formState.value.userList.push(obj);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ stepInfoChange();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -311,7 +341,7 @@ export default defineComponent({
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const queryDept = async () => {
|
|
const queryDept = async () => {
|
|
|
- const res = await structureList() as any;
|
|
|
|
|
|
|
+ const res = (await structureList()) as any;
|
|
|
if (res && res.length > 0) {
|
|
if (res && res.length > 0) {
|
|
|
treeData.value = dealData(res);
|
|
treeData.value = dealData(res);
|
|
|
}
|
|
}
|
|
@@ -322,7 +352,7 @@ export default defineComponent({
|
|
|
const queryUsers = async (nodeIds) => {
|
|
const queryUsers = async (nodeIds) => {
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
|
formData.append('depId', nodeIds.toString());
|
|
formData.append('depId', nodeIds.toString());
|
|
|
- const res = await queryPersonByDepId(formData) as any;
|
|
|
|
|
|
|
+ const res = (await queryPersonByDepId(formData)) as any;
|
|
|
if (res && res.resp_code === 0) {
|
|
if (res && res.resp_code === 0) {
|
|
|
//过滤userId不存在的
|
|
//过滤userId不存在的
|
|
|
handlers.value = res?.datas ? res?.datas : [];
|
|
handlers.value = res?.datas ? res?.datas : [];
|
|
@@ -331,11 +361,12 @@ export default defineComponent({
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const treeSelectChange = async (nodeIds, nodeNames, nodes) => {
|
|
const treeSelectChange = async (nodeIds, nodeNames, nodes) => {
|
|
|
- console.log('选择部门',nodeIds,nodeNames,nodes)
|
|
|
|
|
|
|
+ console.log('选择部门', nodeIds, nodeNames, nodes);
|
|
|
if (nodeIds.length > 0) queryUsers(nodeIds);
|
|
if (nodeIds.length > 0) queryUsers(nodeIds);
|
|
|
else {
|
|
else {
|
|
|
handlers.value = [];
|
|
handlers.value = [];
|
|
|
}
|
|
}
|
|
|
|
|
+ stepInfoChange();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -379,6 +410,7 @@ export default defineComponent({
|
|
|
columns,
|
|
columns,
|
|
|
stepEdit,
|
|
stepEdit,
|
|
|
currStep,
|
|
currStep,
|
|
|
|
|
+ optType,
|
|
|
validateForm,
|
|
validateForm,
|
|
|
stepInfoChange,
|
|
stepInfoChange,
|
|
|
moveClick,
|
|
moveClick,
|