|
|
@@ -8,10 +8,10 @@
|
|
|
<el-tree
|
|
|
class="filter-tree"
|
|
|
:data="treedata"
|
|
|
- node-key="value"
|
|
|
+ node-key="id"
|
|
|
highlight-current
|
|
|
- default-expand-all
|
|
|
- :expand-on-click-node="false"
|
|
|
+ :expand-on-click-node="true"
|
|
|
+ :default-expanded-keys="topItemKeys"
|
|
|
:filter-node-method="filterNode"
|
|
|
accordion
|
|
|
@node-click="clicktreenode"
|
|
|
@@ -35,7 +35,7 @@
|
|
|
>
|
|
|
<el-form-item prop="ruleItemName" label="履职项">
|
|
|
<el-input
|
|
|
- v-model="queryParams.ruleItemName"
|
|
|
+ v-model="queryParams.itemName"
|
|
|
placeholder="请输入内容"
|
|
|
maxlength="50"
|
|
|
clearable
|
|
|
@@ -67,10 +67,18 @@
|
|
|
<!-- 按纽 -->
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" @click="onEdit()">新 增</el-button>
|
|
|
- <el-button type="warning" @click="dakai">{{
|
|
|
- expandAll ? "收起所有行" : "展开所有行"
|
|
|
- }}</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="onAddItem()"
|
|
|
+ :disabled="rule ? false : true"
|
|
|
+ >新 增</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ @click="dakai"
|
|
|
+ :disabled="rule ? false : true"
|
|
|
+ >{{ expandAll ? "收起所有行" : "展开所有行" }}</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -137,16 +145,13 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="itemNum"
|
|
|
+ prop="order"
|
|
|
label="序号"
|
|
|
+ width="80"
|
|
|
v-if="columns[0].visible"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="itemName"
|
|
|
- label="履职项"
|
|
|
- v-if="columns[1].visible"
|
|
|
- >
|
|
|
+ <el-table-column prop="name" label="履职项" v-if="columns[1].visible">
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column prop="itemDesc" label="标准及要求">
|
|
|
</el-table-column> -->
|
|
|
@@ -161,15 +166,17 @@
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
- @click="showdialog(scope.row.id)"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="onEditItem(scope.row.id)"
|
|
|
>编辑</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-popconfirm
|
|
|
+ title="将删除履职项及其下所有履职内容,确定删除?"
|
|
|
+ @confirm="deldata(scope.row.id)"
|
|
|
>
|
|
|
- <k-btn-tip
|
|
|
- type="text"
|
|
|
- :tip="'将删除履职项及其下所有履职内容,确定删除?'"
|
|
|
- @click="deldata(scope.row.id)"
|
|
|
- >删除</k-btn-tip
|
|
|
- >
|
|
|
+ <el-button type="text" size="small" slot="reference" icon="el-icon-delete">删除</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -186,30 +193,37 @@
|
|
|
</el-pagination>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <dialog-edit ref="dialogEdit" :rule="rule"></dialog-edit>
|
|
|
+ <dialog-edit
|
|
|
+ ref="dialogEdit"
|
|
|
+ :rule="rule"
|
|
|
+ :pointDataSource="dict.type.point_data_source"
|
|
|
+ @success="onSuccess"
|
|
|
+ ></dialog-edit>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapState, mapMutations } from "vuex";
|
|
|
-import { list, treeData,del } from "@/api/resumption/ruleManager.js";
|
|
|
+import { page, treeData, del } from "@/api/resumption/ruleManager.js";
|
|
|
import DialogEdit from "./dialog.editItem.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "resumptionRuleManager",
|
|
|
props: [],
|
|
|
+ dicts: ["point_data_source"],
|
|
|
data() {
|
|
|
return {
|
|
|
queryParams: {
|
|
|
ruleId: null,
|
|
|
- ruleItemName: null,
|
|
|
+ itemName: null,
|
|
|
pointName: null,
|
|
|
currentPage: 1,
|
|
|
pagesize: 10,
|
|
|
},
|
|
|
- filterText:null,
|
|
|
+ filterText: null,
|
|
|
showSearch: true,
|
|
|
rule: null, //选中的内容库
|
|
|
+
|
|
|
expandAll: false,
|
|
|
fresh: true,
|
|
|
// checked: false,
|
|
|
@@ -221,7 +235,7 @@ export default {
|
|
|
tableData: [],
|
|
|
|
|
|
total: 0,
|
|
|
-
|
|
|
+ topItemKeys: [],
|
|
|
// defaultProps: {
|
|
|
// children: "children",
|
|
|
// label: "label",
|
|
|
@@ -276,14 +290,19 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
async getList() {
|
|
|
- const data = await list(this.queryParams);
|
|
|
+ if (!this.rule) {
|
|
|
+ this.$message.warning("请先选择一个履职内容库定义");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const data = await page(this.queryParams);
|
|
|
this.tableData = data.rows;
|
|
|
this.total = data.total;
|
|
|
this.expandAll = false;
|
|
|
},
|
|
|
async gettreelist() {
|
|
|
await treeData().then((v) => {
|
|
|
- this.treedata = v;
|
|
|
+ this.treedata = v.data;
|
|
|
+ this.topItemKeys = v.data.map((d) => d.id);
|
|
|
});
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
@@ -295,17 +314,20 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
clicktreenode(data) {
|
|
|
+ if (!data.isRule) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
this.expandAll = false;
|
|
|
this.fresh = false;
|
|
|
this.$nextTick(() => {
|
|
|
this.fresh = true;
|
|
|
});
|
|
|
- if (data.isRule) {
|
|
|
- this.queryParams.ruleId = data.id;
|
|
|
- this.rule = data;
|
|
|
- this.refresh();
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
+ this.queryParams.ruleId = data.id;
|
|
|
+ this.rule = data;
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
async deldata(val) {
|
|
|
await del(val);
|
|
|
this.getList();
|
|
|
@@ -317,13 +339,26 @@ export default {
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
this.tableData = [];
|
|
|
},
|
|
|
+ onAddItem() {
|
|
|
+ if (!this.rule) {
|
|
|
+ this.$message.warning("请先选择履职内容库");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.dialogEdit.show(null);
|
|
|
+ },
|
|
|
+ onEditItem(itemId) {
|
|
|
+ this.$refs.dialogEdit.show(itemId);
|
|
|
+ },
|
|
|
+ onSuccess(){
|
|
|
+ this.refresh();
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.show-ellipsis {
|
|
|
display: block;
|
|
|
- width: 150px;
|
|
|
+ width: 180px;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|