|
@@ -22,14 +22,16 @@
|
|
|
<el-option :label="'启用'" :value="1"></el-option>
|
|
|
<el-option :label="'停用'" :value="0"></el-option>
|
|
|
</el-select>
|
|
|
- <!-- <el-input
|
|
|
- v-model="listQuery.name"
|
|
|
- placeholder="请输入流程名称"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- style="width: 240px"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- /> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="可用分部">
|
|
|
+ <el-select v-model="listQuery.orgId" clearable @change="getList">
|
|
|
+ <el-option
|
|
|
+ v-for="item in organList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
@@ -89,23 +91,32 @@
|
|
|
:show-overflow-tooltip="true"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ label="可用分部"
|
|
|
+ prop="orgNames"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
label="创建者"
|
|
|
prop="create_name"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="150"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- label="创建时间"
|
|
|
+ label="操作时间"
|
|
|
align="center"
|
|
|
prop="create_time"
|
|
|
- width="180"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
+ width="240"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ 创建时间:{{ row.create_time }}<br />
|
|
|
+ 更新时间:{{ row.update_time }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
label="更新时间"
|
|
|
align="center"
|
|
|
prop="update_time"
|
|
|
width="180"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<el-table-column
|
|
|
label="排序"
|
|
|
align="center"
|
|
@@ -171,6 +182,14 @@
|
|
|
@click="handleDelete(scope.row)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ v-permisaction="['process:admin:manager:orgIds']"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-setting"
|
|
|
+ @click="handleSetting(scope.row)"
|
|
|
+ >设置分部</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -357,6 +376,55 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="'设置分部'" :visible.sync="openOrgin" width="500px">
|
|
|
+ <div class="tpl-create-content">
|
|
|
+ <el-form
|
|
|
+ ref="ruleOrganForm"
|
|
|
+ :model="ruleOrganForm"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="可用分部"
|
|
|
+ style="width: 95%"
|
|
|
+ prop="orgIds"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择可用分部',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <div class="select-all">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleOrganForm.orgIds"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择可用分部"
|
|
|
+ style="width: 100%"
|
|
|
+ multiple
|
|
|
+ class="select"
|
|
|
+ collapse-tags
|
|
|
+ ref="select"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in organList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button class="btn" @click="selectAll">全选</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer" style="text-align: right">
|
|
|
+ <el-button type="primary" @click="setOrgIdsForm('ruleOrganForm')"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="openOrgin = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -371,7 +439,10 @@ import {
|
|
|
cloneProcess,
|
|
|
statusProcess,
|
|
|
sortProcess,
|
|
|
+ orgIdsProcess,
|
|
|
} from "@/api/process/admin/process";
|
|
|
+
|
|
|
+import { queryUserInfo, queryAllToOrgan } from "@/api/process/work-order";
|
|
|
import SaveForm from "@/components/save-form";
|
|
|
import { classifyList } from "@/api/process/admin/classify";
|
|
|
import { templateList } from "@/api/process/admin/template";
|
|
@@ -420,6 +491,7 @@ export default {
|
|
|
listQuery: {
|
|
|
status: null,
|
|
|
page: 1,
|
|
|
+ orgId: "",
|
|
|
per_page: 10,
|
|
|
},
|
|
|
lang: "zh",
|
|
@@ -444,12 +516,33 @@ export default {
|
|
|
id: null,
|
|
|
sortNo: 0,
|
|
|
},
|
|
|
+ openOrgin: false,
|
|
|
+ tenantId: 1,
|
|
|
+ organList: [],
|
|
|
+ ruleOrganForm: {
|
|
|
+ id: null,
|
|
|
+ orgIds: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getList();
|
|
|
+ this.getUserInfo();
|
|
|
+ this.getAllOrgan();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getUserInfo() {
|
|
|
+ await queryUserInfo().then((res) => {
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.userIds = res.data.id;
|
|
|
+ this.tenantId = res.data.tenantId;
|
|
|
+ this.userType = res.data.userType;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 获取任务列表
|
|
|
async getTaskList() {
|
|
|
await taskList({
|
|
@@ -690,7 +783,7 @@ export default {
|
|
|
// else if (e.label === undefined || e.label === null || e.label === '') {
|
|
|
// return '流转标题不能为空'
|
|
|
// }
|
|
|
- console.log(structureValue);
|
|
|
+ // console.log(structureValue);
|
|
|
for (var e of structureValue.edges) {
|
|
|
if (e.sort === undefined || e.sort === null || e.sort === "") {
|
|
|
return "流转顺序不能为空";
|
|
@@ -799,6 +892,56 @@ export default {
|
|
|
this.queryParams.pageSize = 10;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ selectAll() {
|
|
|
+ const { options } = this.$refs.select;
|
|
|
+ const values = options
|
|
|
+ .filter((item) => !item.disabled && item.value)
|
|
|
+ .map((item) => item.value);
|
|
|
+ this.ruleOrganForm.orgIds = values;
|
|
|
+ },
|
|
|
+ async getAllOrgan() {
|
|
|
+ // 获取分部
|
|
|
+ queryAllToOrgan({ tenantId: this.tenantId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const result = res.data;
|
|
|
+ let filterOrganId = [
|
|
|
+ 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
|
|
+ 23, 25, 26, 27, 28, 34, 37, 40, 71, 72, 124, 125,
|
|
|
+ ];
|
|
|
+
|
|
|
+ let tempOrgan = [];
|
|
|
+ // 过滤不会显示的分部
|
|
|
+ result.forEach((item) => {
|
|
|
+ if (filterOrganId.includes(item.id)) {
|
|
|
+ tempOrgan.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.organList = tempOrgan;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSetting(row) {
|
|
|
+ this.ruleOrganForm.id = row.id;
|
|
|
+ this.ruleOrganForm.orgIds = row.org_ids
|
|
|
+ ? row.org_ids.split(",").map((item) => Number(item))
|
|
|
+ : [];
|
|
|
+ this.openOrgin = true;
|
|
|
+ },
|
|
|
+ setOrgIdsForm(formName) {
|
|
|
+ this.$refs[formName].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ try {
|
|
|
+ await orgIdsProcess(
|
|
|
+ this.ruleOrganForm.id,
|
|
|
+ this.ruleOrganForm.orgIds.join(",")
|
|
|
+ );
|
|
|
+ this.$message.success("设置成功");
|
|
|
+ this.getList();
|
|
|
+ this.openOrgin = false;
|
|
|
+ } catch {}
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
handleDelete(row) {
|
|
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -880,4 +1023,41 @@ export default {
|
|
|
:deep(.el-drawer__body) {
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
+
|
|
|
+.select-all {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.select-all .select {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.select-all .select :deep(.el-input__inner) {
|
|
|
+ min-height: 37px !important;
|
|
|
+ border-radius: 4px 0 0 4px;
|
|
|
+}
|
|
|
+.btn {
|
|
|
+ border-left: none;
|
|
|
+ border-radius: 0 4px 4px 0;
|
|
|
+ min-height: 37px;
|
|
|
+}
|
|
|
+.item {
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 1000;
|
|
|
+ min-height: 40px;
|
|
|
+}
|
|
|
+.item .showDev {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+/* .select-all ::v-deep .el-select__tags {
|
|
|
+ flex-wrap: nowrap !important;
|
|
|
+ }
|
|
|
+
|
|
|
+.selectWrap {
|
|
|
+ ::v-deep .el-select__tags {
|
|
|
+ flex-wrap: wrap !important;
|
|
|
+ }
|
|
|
+} */
|
|
|
</style>
|