|
@@ -4,6 +4,14 @@
|
|
|
<div class="top-item" :class="returnItemClass(item)" v-for="(item,index) in list" :ket="index"
|
|
|
@click="clickItem(item)">
|
|
|
<span>{{index+1}}</span>、<span>{{item.name}}</span>
|
|
|
+ <i style="margin-left: 10px;" class="el-icon-edit-outline color-warning" v-if="operationType === 'edit'"
|
|
|
+ @click.stop="edits('update', item.id)">
|
|
|
+ </i>
|
|
|
+ <i class="el-icon-delete color-danger" v-if="operationType === 'edit'" @click.stop="edits('delete', item.id)">
|
|
|
+ </i>
|
|
|
+ </div>
|
|
|
+ <div class="top-item" @click="edits('insert', -1)">
|
|
|
+ +新增
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="set-process-box">
|
|
@@ -14,6 +22,10 @@
|
|
|
<div v-if="(nowTitle.status === 1 || nowTitle.status === 4) && roleType === 2">
|
|
|
<el-button size="mini" type="primary" @click="updateStatus(nowTitle,3)">通过</el-button>
|
|
|
</div>
|
|
|
+ <div class="process-set-insert" @click="edits('insert', nowTitle ? nowTitle.id : -1, nowTitle)"
|
|
|
+ v-if="operationType === 'edit'">
|
|
|
+ 新增
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="800px"
|
|
@@ -73,7 +85,7 @@
|
|
|
this.updateParentStatus(this.list);
|
|
|
if (this.list.length > 0) {
|
|
|
let arr = this.list.filter(node => node.status === 1 || node.status === 2 || node.status === 4);
|
|
|
- this.nowTitle = arr.length > 0 ? arr[0] : this.list[0];
|
|
|
+ if (!this.nowTitle.id) this.nowTitle = arr.length > 0 ? arr[0] : this.list[0];
|
|
|
}
|
|
|
}
|
|
|
this.loading = false;
|
|
@@ -100,6 +112,13 @@
|
|
|
}
|
|
|
return str;
|
|
|
},
|
|
|
+ edits(type, id, parent) {
|
|
|
+ this.$store.dispatch('app/changeProcessSet', {
|
|
|
+ type,
|
|
|
+ id,
|
|
|
+ parent
|
|
|
+ });
|
|
|
+ },
|
|
|
edit() {
|
|
|
let data = this.$store.getters.processSet;
|
|
|
this.itemId = data.id;
|