2
3
shihang 6 роки тому
батько
коміт
c492cff4d3

+ 169 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/chooseorg.vue

@@ -0,0 +1,169 @@
+<template>
+  <div>
+    <el-dialog title="选择审核人员" :visible.sync="visible" top="5vh" width="800px">
+      <el-form label-width="110px" ref="EntityForm" :model="formData">
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-card style="width: 100%;height: calc(100vh - 253px);overflow: auto">
+              <div slot="header" class="clearfix">
+                <span>请选择部门</span>
+              </div>
+              <el-tree :data="orgtreelist" :props="orgtreeprops" @node-click="handleNodeClick"></el-tree>
+            </el-card>
+          </el-col>
+
+          <el-col :span="12">
+            <el-card style="width: 100%;height: calc(100vh - 253px);overflow: auto">
+              <el-table :data="userOptions" style="width: 100%" ref="multipleTable"
+                @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="55"></el-table-column>
+                <el-table-column prop="realname" label="可选用户">
+                  <template slot="header" slot-scope="scope">
+                    <el-button type="primary" style="float: right;" size="small" @click="toggleSelection">
+                      选择用户 <el-icon class="el-icon-d-arrow-right"></el-icon>
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-card>
+          </el-col>
+          <!-- <el-col :span="12">
+            <el-card style="width: 100%;height: calc(100vh - 253px);overflow: auto">
+              <div slot="header" class="clearfix">
+                <span>
+                  请选择用户
+                </span>
+                <span style="float: right;">
+                  <el-button style="float: right;margin-top: -10px" type="text" @click="toggleSelection">确定</el-button>
+                </span>
+              </div>
+              <el-form :model="AuditorForm" label-width="90px" size="mini">
+                <el-row>
+                  <el-col :span="24">
+                    <el-select v-model="AuditorForm.UserId" clearable style="width:100%" placeholder="请选择">
+                      <el-option v-for="item in userOptions" :label="item.realname" :value="item.id" :key="item.id">
+                      </el-option>
+                    </el-select>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </el-card>
+          </el-col> -->
+        </el-row>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import api from '@/api/system/auditsetting'
+  import ElCol from "../../../node_modules/element-ui/packages/col/src/col";
+  import ElIcon from "../../../node_modules/element-ui/packages/icon/src/icon";
+  export default {
+    components: {
+      ElIcon,
+      ElCol
+    },
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'chooseAuditor',
+    props: {
+      visible: {
+        type: Boolean,
+        default: false
+      }
+    },
+    watch: {
+      visible(val) {
+        this.selfVisible = val
+        if (this.visible) {
+          this.createoptions
+        }
+      },
+      selfVisible(val) {
+        this.$emit('update:visible', val)
+      }
+    },
+    data() {
+      return {
+        userOptions: [],
+        selectedOptions: {},
+        orgtreelist: [],
+        orgtreeprops: {
+          value: 'id',
+          label: 'Fullname',
+          children: 'children'
+        },
+        formData: {},
+        AuditorForm: {
+          UserId: ''
+        },
+        selfVisible: this.visible, // 避免vue双向绑定警告
+        SupplierTypeCode: ''
+      }
+    },
+    created() {},
+    methods: {
+      getorgtreelist(SupplierTypeCode) {
+        let _this = this
+        let params = {
+          IsInnerOrganize: 1,
+          ParentId: 100000180,
+        }
+        _this.$axios.get('organizes/listbydeptid', {
+            params
+          })
+          .then(res => {
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            _this.SupplierTypeCode = SupplierTypeCode
+            if (SupplierTypeCode == '01') { //物资类
+              _this.handleNodeClick(_this.orgtreelist[0].children[11])
+            } else if (SupplierTypeCode == '02') { //基建类
+              _this.handleNodeClick(_this.orgtreelist[0].children[17])
+            } else {
+              _this.handleNodeClick(_this.orgtreelist[0].children[0])
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      handleNodeClick(data) {
+        this.userOptions = []
+        api.getAuditerByDept(data.id, this.$axios).then(res => {
+          if (res.data.code === 1) {
+            this.userOptions = res.data.item
+            if (res.data.item.length > 0) {
+              this.AuditorForm.UserId = res.data.item[0].id
+            }
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      handleSelectionChange(row) {
+        this.selectedOptions = row[row.length-1]
+        if (row.length <= 1) {
+          return
+        } else {
+          this.$refs.multipleTable.clearSelection()
+          this.$refs.multipleTable.toggleRowSelection(row[row.length-1])        
+        }
+      },
+      toggleSelection(val) {
+        this.$emit('close', this.selectedOptions.id)
+      },
+    }
+  }
+
+</script>
+
+<style lang="scss">
+
+</style>