123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <div class="flow-index">
- <div class="flow" v-if="type === 'insert'">
- <div class="flow-button">
- <el-button size="medium" type="primary" @click="visible = true">
- <i class="iconfont huifont-xinzeng"></i>添加审核人员
- </el-button>
- </div>
- <div class="flow-box">
- <div class="flow-item" v-for="(item,index) in list" :key="index">
- <div class="user-avatar">
- <avatar :user="item" :size="12"></avatar>
- </div>
- <div class="user-name">
- <div>{{item.name}}</div>
- <p>{{item.partName}}</p>
- </div>
- <div class="user-line" v-if="index < list.length-1"></div>
- </div>
- </div>
- <el-dialog title="审核人选择" :visible.sync="visible" width="880px" :append-to-body="true">
- <select-user @callback="callBack" v-if="visible" :list="list"></select-user>
- </el-dialog>
- </div>
- <div class="flow-list" v-else>
- <div class="flow-box">
- <div class="flow-item" v-for="(item,index) in flowlist" :key="index">
- <div class="user-avatar-box">
- <div class="user-avatar">
- <avatar :user="item" :size="12"></avatar>
- </div>
- <div :class="'user-avatar-status '+ returnStatus(item.status).className">
- <i :class="'iconfont '+returnStatus(item.status).icon"></i>
- </div>
- </div>
- <div class="flow-content">
- <div class="user-name">
- <div>{{item.name}}</div>
- <p><span>{{item.partName}}</span><span>{{item.date}}</span></p>
- </div>
- <div class="user-content" v-if="item.remark">
- <div class="remark">
- {{item.remark}}
- </div>
- <div class="remark-file" v-if="item.file && item.file.length > 0">
- <upload :list="item.file" type="preview"></upload>
- </div>
- </div>
- </div>
- <div class="user-line" v-if="index < flowlist.length-1"></div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import selectUser from '@/components/common/selectUser'
- import avatar from '@/components/common/avatar'
- import upload from '@/components/common/upload'
- export default {
- props: ['type', 'flowlist'],
- data() {
- return {
- list: [],
- visible: false
- }
- },
- created() {
- if (!!this.flowlist && this.type == 'insert') this.list = this.flowlist;
- },
- methods: {
- callBack(data) {
- this.visible = false;
- if (data) this.list = data;
- },
- returnStatus(state) {
- let className = '',
- icon = '';
- switch (state) {
- case 0:
- className = 'info';
- icon = 'huifont-jinhangzhong';
- break;
- case 1:
- className = 'success'
- icon = 'huifont-tongguo';
- break;
- case 2:
- className = 'failed'
- icon = 'huifont-a-butongguojujue';
- break;
- case 3:
- className = 'waiting'
- icon = 'huifont-jinhangzhong';
- break;
- default:
- className = 'info'
- icon = 'huifont-jinhangzhong';
- break;
- }
- return {
- className: className,
- icon: icon
- };
- }
- },
- watch: {
- flowlist() {
- if (!!this.flowlist && this.type == 'insert') this.list = this.flowlist;
- }
- },
- components: {
- selectUser,
- avatar,
- upload
- },
- }
- </script>
- <style lang="scss">
- .flow-index {
- width: 100%;
- height: 100%;
- .flow-list {
- padding: 10px 20px;
- .flow-item {
- position: relative;
- display: flex;
- .user-avatar-box {
- position: relative;
- .user-avatar {
- width: 32px;
- height: 32px;
- background: #4958de;
- border-radius: 50%;
- margin-right: 10px;
- margin-top: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- i {
- font-size: 20px;
- }
- }
- .user-avatar-status {
- width: 12px;
- height: 12px;
- border-radius: 50%;
- border: 1px solid #fff;
- position: absolute;
- top: 30px;
- right: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- i {
- font-size: 8px;
- color: #fff;
- }
- }
- .user-avatar-status.success {
- background: $--color-green;
- }
- .user-avatar-status.failed {
- background: $--color-red;
- }
- .user-avatar-status.waiting {
- background: $--color-orange;
- }
- .user-avatar-status.info {
- background: #4C4F59;
- }
- }
- .flow-content {
- flex: 1;
- width: 0;
- .user-name {
- height: 48px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- p {
- font-size: 12px;
- opacity: 0.6;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- }
- .user-content {
- background: rgba(50, 56, 68, 0.2);
- border-radius: 8px;
- padding: 13px;
- .remark {
- font-size: 12px;
- line-height: 17px;
- }
- .remark-file {
- margin-top: 12px;
- }
- }
- }
- .user-line {
- width: 1px;
- border-left: 1px dashed #374156;
- position: absolute;
- top: 40px;
- bottom: -8px;
- left: 15px;
- }
- }
- }
- .flow {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- .flow-button {
- padding: 0 20px 10px 20px;
- .el-button {
- padding-left: 12px;
- span {
- display: flex;
- align-items: center;
- }
- .huifont-xinzeng {
- padding-right: 10px;
- }
- }
- }
- .flow-box {
- flex: 1;
- height: 0;
- padding: 10px 20px 0px 20px;
- overflow-y: auto;
- }
- .flow-item {
- height: 48px;
- display: flex;
- align-items: center;
- position: relative;
- .user-avatar {
- width: 32px;
- height: 32px;
- background: #4958de;
- border-radius: 50%;
- margin-right: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- i {
- font-size: 20px;
- }
- }
- .user-name {
- flex: 1;
- width: 0;
- p {
- font-size: 12px;
- opacity: 0.6;
- }
- }
- .user-line {
- width: 2px;
- background-color: #374156;
- position: absolute;
- top: 40px;
- bottom: -8px;
- left: 15px;
- }
- }
- }
- }
- </style>
|