|
@@ -54,8 +54,8 @@
|
|
|
<fm-generate-form
|
|
|
v-show="
|
|
|
currentNode.hideTpls === undefined ||
|
|
|
- currentNode.hideTpls === null ||
|
|
|
- currentNode.hideTpls.indexOf(tplItem.id) === -1
|
|
|
+ currentNode.hideTpls === null ||
|
|
|
+ currentNode.hideTpls.indexOf(tplItem.id) === -1
|
|
|
"
|
|
|
:key="tplIndex"
|
|
|
:ref="'generateForm-' + tplItem.id"
|
|
@@ -79,8 +79,8 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <hr style="background-color: #d9d9d9; border:0; height:1px;" />
|
|
|
- <div class="text item" style="text-align: center;margin-top:18px">
|
|
|
+ <hr style="background-color: #d9d9d9; border: 0; height: 1px" />
|
|
|
+ <div class="text item" style="text-align: center; margin-top: 18px">
|
|
|
<el-button
|
|
|
v-for="(item, index) in btn_group"
|
|
|
:key="index"
|
|
@@ -105,7 +105,8 @@ import {
|
|
|
createWorkOrder,
|
|
|
checkCourseReturnFee,
|
|
|
queryAllOrgan,
|
|
|
- queryUserInfo
|
|
|
+ queryTeacherOrgan,
|
|
|
+ queryUserInfo,
|
|
|
} from "@/api/process/work-order";
|
|
|
import { listUser } from "@/api/system/sysuser";
|
|
|
export default {
|
|
@@ -120,6 +121,7 @@ export default {
|
|
|
socialId: null, // 是否是社保分部
|
|
|
userId: null,
|
|
|
tenantId: 1,
|
|
|
+ userType: "SYSTEM",
|
|
|
ruleForm: {
|
|
|
priority: 1,
|
|
|
deptId: null, // 社保部分
|
|
@@ -131,17 +133,17 @@ export default {
|
|
|
process_method: "",
|
|
|
tpls: {
|
|
|
form_structure: [],
|
|
|
- form_data: []
|
|
|
+ form_data: [],
|
|
|
},
|
|
|
- tasks: []
|
|
|
+ tasks: [],
|
|
|
},
|
|
|
rules: {
|
|
|
deptId: [
|
|
|
- { required: true, message: "请选择申请部门", trigger: "change" }
|
|
|
+ { required: true, message: "请选择申请部门", trigger: "change" },
|
|
|
],
|
|
|
priority: [
|
|
|
- { required: true, message: "请选择工单优先级", trigger: "blur" }
|
|
|
- ]
|
|
|
+ { required: true, message: "请选择工单优先级", trigger: "blur" },
|
|
|
+ ],
|
|
|
},
|
|
|
deptList: [], // 分部列表
|
|
|
btn_group: [],
|
|
@@ -149,13 +151,13 @@ export default {
|
|
|
// 获取用户列表
|
|
|
userList(resolve) {
|
|
|
listUser({
|
|
|
- pageSize: 999999
|
|
|
- }).then(response => {
|
|
|
+ pageSize: 999999,
|
|
|
+ }).then((response) => {
|
|
|
const options = response.data.list;
|
|
|
resolve(options);
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -165,48 +167,57 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async getUserInfo() {
|
|
|
- await queryUserInfo().then(res => {
|
|
|
+ await queryUserInfo().then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.userId = res.data.id;
|
|
|
this.tenantId = res.data.tenantId;
|
|
|
+ this.userType = res.data.userType;
|
|
|
} else {
|
|
|
this.$message.error(res.data);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- async getAllOrgan() {
|
|
|
+ getAllOrgan() {
|
|
|
// 获取分部
|
|
|
- await queryAllOrgan({ tenantId: this.tenantId }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- const result = res.data;
|
|
|
- const filterOrganId = [
|
|
|
- 36,
|
|
|
- 39,
|
|
|
- 41,
|
|
|
- 42,
|
|
|
- 43,
|
|
|
- 44,
|
|
|
- 45,
|
|
|
- 46,
|
|
|
- 47,
|
|
|
- 48,
|
|
|
- 49,
|
|
|
- 50,
|
|
|
- 52,
|
|
|
- 54,
|
|
|
- 55,
|
|
|
- 56
|
|
|
- ];
|
|
|
- let tempOrgan = [];
|
|
|
- // 过滤不会显示的分部
|
|
|
- result.forEach(item => {
|
|
|
- if (!filterOrganId.includes(item.id)) {
|
|
|
- tempOrgan.push(item);
|
|
|
- }
|
|
|
- });
|
|
|
- this.organList = tempOrgan;
|
|
|
- }
|
|
|
- });
|
|
|
+ console.log(this.tenantId, "tenantId");
|
|
|
+ if (this.userType.indexOf("SYSTEM") != -1) {
|
|
|
+ queryAllOrgan({ tenantId: this.tenantId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const result = res.data;
|
|
|
+ const filterOrganId = [
|
|
|
+ 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
|
|
|
+ ];
|
|
|
+ let tempOrgan = [];
|
|
|
+ // 过滤不会显示的分部
|
|
|
+ result.forEach((item) => {
|
|
|
+ if (!filterOrganId.includes(item.id)) {
|
|
|
+ tempOrgan.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.organList = tempOrgan;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ queryTeacherOrgan({ tenantId: this.tenantId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const result = res.data;
|
|
|
+ const filterOrganId = [
|
|
|
+ 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
|
|
|
+ ];
|
|
|
+ let tempOrgan = [];
|
|
|
+ // 过滤不会显示的分部
|
|
|
+ result.forEach((item) => {
|
|
|
+ if (!filterOrganId.includes(item.key)) {
|
|
|
+ tempOrgan.push({
|
|
|
+ id: item.key,
|
|
|
+ name: item.value,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.organList = tempOrgan;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
getProcessNodeList() {
|
|
|
const processId = this.$route.query.processId;
|
|
@@ -215,8 +226,8 @@ export default {
|
|
|
}
|
|
|
processStructure({
|
|
|
processId: this.$route.query.processId,
|
|
|
- userId: this.userId
|
|
|
- }).then(response => {
|
|
|
+ userId: this.userId,
|
|
|
+ }).then((response) => {
|
|
|
let tempData = response.data.tpls;
|
|
|
console.log(response);
|
|
|
// 获取对应模板中,下拉框的key, value
|
|
@@ -232,7 +243,7 @@ export default {
|
|
|
|
|
|
tempData.forEach((temp, index) => {
|
|
|
let tempList = temp.form_structure.list || [];
|
|
|
- tempList.forEach(item => {
|
|
|
+ tempList.forEach((item) => {
|
|
|
if (hiddenFormList[index].length > 0) {
|
|
|
if (item.type != "text" && !item.options.relationStatus) {
|
|
|
item.hidden = true;
|
|
@@ -250,9 +261,9 @@ export default {
|
|
|
if (item.type == "subform") {
|
|
|
let childList = item.columns || [];
|
|
|
let subFormStatus = true;
|
|
|
- childList.forEach(child => {
|
|
|
+ childList.forEach((child) => {
|
|
|
let childList = child.list || [];
|
|
|
- childList.forEach(c => {
|
|
|
+ childList.forEach((c) => {
|
|
|
if (hiddenFormList[index].length > 0) {
|
|
|
if (c.type != "text" && !c.options.relationStatus) {
|
|
|
c.hidden = true;
|
|
@@ -298,7 +309,7 @@ export default {
|
|
|
|
|
|
const psv = response.data.edges || [];
|
|
|
const btn_group = [];
|
|
|
- psv.forEach(item => {
|
|
|
+ psv.forEach((item) => {
|
|
|
if (item.source === this.currentNode.id && item.flowProperties == 1) {
|
|
|
if (item.flowProperties == 1) {
|
|
|
item.className = "primary";
|
|
@@ -320,7 +331,7 @@ export default {
|
|
|
// })
|
|
|
this.$alert("您当前暂未设置所属部门,请联系管理员", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
- callback: action => {}
|
|
|
+ callback: (action) => {},
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -332,7 +343,7 @@ export default {
|
|
|
let tempList = temp.form_structure.list || [];
|
|
|
let tempSelectList = tplValues[index] || [];
|
|
|
let listArray = [];
|
|
|
- tempList.forEach(list => {
|
|
|
+ tempList.forEach((list) => {
|
|
|
if (list.type == "select") {
|
|
|
if (type == "value") {
|
|
|
const result = this.getFormDataDetail(temp.form_data, list.model);
|
|
@@ -342,13 +353,13 @@ export default {
|
|
|
} else {
|
|
|
let selectOptions = [];
|
|
|
let selectValue = [];
|
|
|
- tempSelectList.forEach(tsl => {
|
|
|
+ tempSelectList.forEach((tsl) => {
|
|
|
if (tsl.model == list.model) {
|
|
|
selectOptions = list.options.options || [];
|
|
|
selectValue = tsl.value || [];
|
|
|
}
|
|
|
});
|
|
|
- selectOptions.forEach(so => {
|
|
|
+ selectOptions.forEach((so) => {
|
|
|
if (selectValue.includes(so.value)) {
|
|
|
let tempRo = so.relationOptions || [];
|
|
|
listArray.push(...tempRo);
|
|
@@ -358,9 +369,9 @@ export default {
|
|
|
}
|
|
|
if (list.type == "subform") {
|
|
|
let childList = list.columns || [];
|
|
|
- childList.forEach(child => {
|
|
|
+ childList.forEach((child) => {
|
|
|
let childList = child.list || [];
|
|
|
- childList.forEach(c => {
|
|
|
+ childList.forEach((c) => {
|
|
|
if (c.type == "select") {
|
|
|
if (type == "value") {
|
|
|
const originObj = JSON.parse(JSON.stringify(c));
|
|
@@ -374,13 +385,13 @@ export default {
|
|
|
} else {
|
|
|
let selectOptions = [];
|
|
|
let selectValue = [];
|
|
|
- tempSelectList.forEach(tsl => {
|
|
|
+ tempSelectList.forEach((tsl) => {
|
|
|
if (tsl.model == c.model) {
|
|
|
selectOptions = c.options.options || [];
|
|
|
selectValue = tsl.value || [];
|
|
|
}
|
|
|
});
|
|
|
- selectOptions.forEach(so => {
|
|
|
+ selectOptions.forEach((so) => {
|
|
|
if (selectValue.includes(so.value)) {
|
|
|
let tempRo = so.relationOptions || [];
|
|
|
listArray.push(...tempRo);
|
|
@@ -400,7 +411,7 @@ export default {
|
|
|
getFormDataDetail(formData, model) {
|
|
|
let modelStatus = {
|
|
|
status: false,
|
|
|
- value: null
|
|
|
+ value: null,
|
|
|
};
|
|
|
for (let data in formData) {
|
|
|
if (typeof formData[data] == "object") {
|
|
@@ -412,7 +423,7 @@ export default {
|
|
|
model: child,
|
|
|
value: formData[data][child]
|
|
|
? formData[data][child].split(",")
|
|
|
- : []
|
|
|
+ : [],
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -421,7 +432,7 @@ export default {
|
|
|
modelStatus = {
|
|
|
status: true,
|
|
|
model: data,
|
|
|
- value: formData[data] ? formData[data].split(",") : []
|
|
|
+ value: formData[data] ? formData[data].split(",") : [],
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -429,16 +440,15 @@ export default {
|
|
|
return modelStatus;
|
|
|
},
|
|
|
submitAction(target) {
|
|
|
- this.$refs["ruleForm"].validate(valid => {
|
|
|
+ this.$refs["ruleForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.submitDisabled = true;
|
|
|
var stateMap = {};
|
|
|
this.ruleForm.process = parseInt(this.$route.query.processId);
|
|
|
this.ruleForm.classify = this.processStructureValue.process.classify;
|
|
|
stateMap["id"] = target;
|
|
|
- this.ruleForm.source_state = this.processStructureValue.nodes[
|
|
|
- this.active
|
|
|
- ].label;
|
|
|
+ this.ruleForm.source_state =
|
|
|
+ this.processStructureValue.nodes[this.active].label;
|
|
|
for (var v of this.processStructureValue.nodes) {
|
|
|
if (v.id === target) {
|
|
|
if (v.assignType !== undefined) {
|
|
@@ -455,7 +465,7 @@ export default {
|
|
|
|
|
|
this.ruleForm.tpls = {
|
|
|
form_structure: [],
|
|
|
- form_data: []
|
|
|
+ form_data: [],
|
|
|
};
|
|
|
// 绑定流程任务
|
|
|
this.ruleForm.tasks =
|
|
@@ -482,10 +492,9 @@ export default {
|
|
|
promiseList.push(this.$refs["generateForm-" + tpl.id][0].getData());
|
|
|
}
|
|
|
Promise.all(promiseList)
|
|
|
- .then(async values => {
|
|
|
- this.ruleForm.source = this.processStructureValue.nodes[
|
|
|
- this.active
|
|
|
- ].id;
|
|
|
+ .then(async (values) => {
|
|
|
+ this.ruleForm.source =
|
|
|
+ this.processStructureValue.nodes[this.active].id;
|
|
|
this.ruleForm.tpls.form_data = values;
|
|
|
const formData = values[0];
|
|
|
const tplInfo = this.processStructureValue.tpls[0]; // 默认只用第一个模板
|
|
@@ -493,11 +502,11 @@ export default {
|
|
|
// 校验数据
|
|
|
const res = await checkCourseReturnFee({
|
|
|
tplInfoId: tplInfo.id,
|
|
|
- formData
|
|
|
+ formData,
|
|
|
});
|
|
|
if (res.code == 200) {
|
|
|
await createWorkOrder(this.ruleForm)
|
|
|
- .then(response => {
|
|
|
+ .then((response) => {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success("工单申请成功");
|
|
|
this.$router.push({ path: "/process/my-create" });
|
|
@@ -516,7 +525,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|