Browse Source

选择审核人

shihang 6 years ago
parent
commit
1b779c61b9

+ 31 - 8
src/dashoo.cn/frontend_web/src/components/oilsupplier/chooseauditor.vue

@@ -13,6 +13,21 @@
           </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>
@@ -33,7 +48,7 @@
                 </el-row>
               </el-form>
             </el-card>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
     </el-dialog>
@@ -78,14 +93,14 @@
     data() {
       return {
         userOptions: [],
+        selectedOptions: {},
         orgtreelist: [],
         orgtreeprops: {
           value: 'id',
           label: 'Fullname',
           children: 'children'
         },
-        formData: {
-        },
+        formData: {},
         AuditorForm: {
           UserId: ''
         },
@@ -93,14 +108,13 @@
         SupplierTypeCode: ''
       }
     },
-    created() {
-    },
+    created() {},
     methods: {
       getorgtreelist(SupplierTypeCode) {
         let _this = this
         let params = {
           IsInnerOrganize: 1,
-          ParentId: 100000180,
+          // ParentId: 100000180,
         }
         _this.$axios.get('organizes/listbydeptid', {
             params
@@ -133,8 +147,17 @@
           console.error(err)
         })
       },
-      toggleSelection() {
-         this.$emit('close', this.AuditorForm.UserId) 
+      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)
       },
     }
   }

+ 331 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -0,0 +1,331 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">准入范围</span>
+        <span style="float: right;">
+          <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" v-if="canadd">添加
+          </el-button>
+        </span>
+      </div>
+      <el-table :data="goodsList" border style="height: calc(100vh - 435px);">
+        <el-table-column label="操作" width="90" align="center" fixed>
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
+              @click="deletedata(scope.row)" :disabled="!canadd">删除</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount">
+      </el-pagination>
+    </el-card>
+
+    <el-dialog title="基建类业务列表" :visible.sync="goodsDialog" top="5vh">
+      <el-row :gutter="20" style="height: calc(100vh - 545px); overflow: auto;">
+        <el-col :span="20">
+          <el-tree highlight-current :expand-on-click-node="true" node-key="id" :data="orgtreelist"
+            :props="orgtreeprops" ref="orgmanagetree" show-checkbox @check-change="getChildrens">
+          </el-tree>
+        </el-col>
+      </el-row>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+
+  export default {
+    name: 'GoodsList',
+    components: {},
+    props: {
+      canadd: {
+        type: Boolean,
+        default: false
+      }
+    },
+    created() {
+      this.initData()
+    },
+    computed: {
+      ...mapGetters({
+        session: 'session'
+      })
+    },
+    data() {
+      return {
+        SupplierId: 0,
+        SupplierTypeCode: '',
+        SupplierCertId: 0,
+
+        Title: '',
+        goodsList: [],
+        goodsDialog: false,
+        orgtreelist: [],
+        orgtreeprops: {
+          value: 'Id',
+          label: 'Name',
+          children: 'children'
+        },
+
+        BusinessForm: {
+          Id: '',
+          SupplierId: '',
+          SupplierCertId: '',
+          SupplierTypeCode: '',
+          SubClassId: '',
+          Code: '',
+          Name: '',
+          Remark: '',
+          IsDelete: 0
+        },
+        visible: false,
+        selfVisible: this.visible, // 避免vue双向绑定警告
+        currentPage: 1, // 分页
+        size: 10,
+        currentItemCount: 0,
+        flagId: 0 //标记是否第一次点击
+      }
+    },
+    methods: {
+      getvalue(SupplierId, SupplierTypeCode, certId) {
+        this.SupplierId = SupplierId
+        this.SupplierTypeCode = SupplierTypeCode
+        this.SupplierCertId = certId
+        this.initData()
+      },
+      initData() {
+        let _this = this
+        const params = {
+          SupplierCertId: this.SupplierCertId,
+          SupplierTypeCode: this.SupplierTypeCode,
+          _currentPage: this.currentPage,
+          _size: this.size
+        }
+        this.$axios.get('suppliercertsub/list', {
+            params
+          })
+          .then(res => {
+            _this.goodsList = res.data.items
+            _this.currentItemCount = res.data.currentItemCount
+            _this.$emit('close')
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      savedata() {
+        if (this.Title === '新增准入范围') {
+          this.addGoodsBus()
+        } else if (this.Title === '编辑准入范围') {
+          this.editBusiness()
+        }
+      },
+      addGoodsBus() {
+        let _this = this
+        let arr = []
+        arr = _this.$refs['cascader'].currentLabels
+        _this.BusinessForm.Name = arr[arr.length - 1]
+        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
+        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
+        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
+        //因为表单验证不能用,所以采用提示验证
+        if (_this.selectedOptList.length < 1) {
+          _this.$message({
+            type: 'warning',
+            message: '名称不能为空,请选择分类!'
+          })
+        } else {
+          _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
+            .then(res => {
+              if (res.data.code === 0) {
+                _this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                _this.BusinessForm.Id = res.data.item + ''
+                _this.visible = false
+                _this.initData()
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+            .catch(err => {
+              console.error(err)
+            })
+        }
+      },
+      deletedata(val) {
+        let _this = this
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+            _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
+              .then(function (response) {
+                if (response.data.code === 0) {
+                  _this.$message({
+                    type: 'success',
+                    message: response.data.message
+                  })
+                  _this.initData()
+                } else {
+                  _this.$message({
+                    type: 'warning',
+                    message: response.data.message
+                  })
+                }
+              })
+              .catch(function (error) {
+                console.log(error)
+              })
+          })
+          .catch(() => {})
+      },
+      showDialog() {
+        this.getorgtreelist()
+        this.goodsDialog = true
+      },
+      getorgtreelist() {
+        let _this = this
+        this.$axios.get('goodsaptitude/goodsparentlist', {})
+          .then(res => {
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')           
+            _this.orgtreelist.forEach((item, index) => {
+              _this.$set(this.orgtreelist[index], 'children', [])
+            })
+            console.log("-----------------", _this.orgtreelist)
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      //获取下一级所有分类
+      getChildrens(val) {
+        let _this = this
+        let Id = val.id
+        if (Id != _this.flagId) { //判断是否是第一次,若不相等则为第一次
+          this.$axios.get('goodsaptitudeclass/getchildlist/' + Id, {})
+            .then(res => {
+              //获取下一级所有级联数据
+              if (res.data.items) { //判断是否有数据
+                let tempList = []
+                tempList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
+                 console.log("-j0000090------------------",this.orgtreelist)
+                //添加到上一级对应的选项中
+                console.log("-j111111111111111111----",Id)
+                for (let i = 0; i < _this.orgtreelist.length; i++) {
+                  if (_this.orgtreelist[i].id === Id) {
+                      console.log("--oooooooooooooooooo-")
+                    _this.$set(_this.orgtreelist[i], 'children', tempList)
+                    break
+                  }
+                }
+                console.log("-3333333333333333333333333---", _this.orgtreelist)
+              } else {
+                //修改上一级的children属性
+                for (let i = 0; i < _this.orgtreelist.length; i++) {
+                  if (_this.orgtreelist[i].id === Id) {
+                    _this.$set(_this.orgtreelist[i], 'children', '')
+                    break
+                  }
+                }
+              }
+              //做标记
+              _this.flagId = Id
+            })
+            .catch(err => {
+              console.error(err)
+            })
+        }
+      },
+      //获取分类级联Id
+      getGoodsCode(item) {
+        this.getCodeById(item[item.length - 1]) //根据分类Id获取Code
+      },
+      //根据分类Id获取Code
+      getCodeById(Id) {
+        let _this = this
+        this.$axios.get('goodsaptitudeclass/getcode/' + Id, {})
+          .then(res => {
+            _this.BusinessForm.SubClassId = Id
+            _this.BusinessForm.Code = res.data.items[0].Code
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+
+      //   getCode() {
+      //     this.ClassId = this.selectedorg[this.selectedorg.length - 1]
+      //     for (var i = 0; i < this.techList.length; i++) {
+      //       if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
+      //         this.BusinessForm.SubClassId = this.techList[i].Id
+      //         this.BusinessForm.Name = this.techList[i].Name
+      //         this.BusinessForm.Code = this.techList[i].Code
+      //       }
+      //     }
+      //   },
+      //   getChooseCode(val) {
+      //     this.ClassId = val.Id
+      //     this.BusinessForm.SubClassId = val.Id
+      //     this.BusinessForm.Code = val.Code
+      //     this.BusinessForm.Name = val.Name
+      //    // this.basicDialog = false
+      //   },
+
+      handleSizeChange(value) {
+        this.size = value
+        this.currentPage = 1
+        this.initData()
+      },
+      handleCurrentChange(value) {
+        this.currentPage = value
+        this.initData()
+      },
+      //   HandleSizeChange(value) {
+      //     this.Size = value
+      //     this.CurrentPage = 1
+      //     this.getbusiness()
+      //   },
+      //   HandleCurrentChange(value) {
+      //     this.CurrentPage = value
+      //     this.getbusiness()
+      //   },
+      seachdata() {
+        this.CurrentPage = -1
+        this.getbusiness()
+      },
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      }
+    }
+  }
+
+</script>
+
+<style>
+
+
+</style>

+ 8 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -179,8 +179,10 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :canadd="add_flat"
-            height="360px" style="margin-top: 20px"></business-list>
+          <goods-list ref="goodsList" :data.sync="goodsList" @close="getbuslist" :canadd="add_flat" height="360px"
+            style="margin-top: 20px"></goods-list>
+          <!-- <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :canadd="add_flat"
+            height="360px" style="margin-top: 20px"></business-list> -->
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
           <subfile-list ref="subfileList" :data.sync="subfileList" :canadd="add_flat" @close="selectAuditOrg"
@@ -250,7 +252,7 @@
   import PerformanceList from '@/components/oilsupplier/performancelist'
   import PatentList from '@/components/oilsupplier/patentlist'
   import WinningList from '@/components/oilsupplier/winninglist'
-  import BusinessList from '@/components/oilsupplier/businesslist'
+  import GoodsList from '@/components/oilsupplier/goodslist'
   import SubfileList from '@/components/oilsupplier/subfilelist'
   import GoodsInfo from '@/components/oilsupplier/goodsinfo'
 
@@ -267,7 +269,7 @@
       PerformanceList, // 近三年主要工程业绩列表
       PatentList, // 拥有专利、专有技术及工法列表
       WinningList, // 近三年获得省部级及以上主要技术、管理成果、获奖项目列表
-      BusinessList, // 选择准入范围
+      GoodsList, // 选择准入范围
       SubfileList, // 选择企业资质
       GoodsInfo,
 
@@ -292,7 +294,7 @@
         performanceList: [], // 近三年主要工程业绩
         patentList: [], // 拥有专利、专有技术及工法
         winningList: [], // 近三年获得省部级及以上主要技术、管理成果、获奖项目
-        businessList: [], // 准入业务
+        goodsList: [], // 准入业务
         subfileList: [], // 资质
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
@@ -584,7 +586,7 @@
             this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
             this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
             this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs['businessList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['goodsList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
             this.$refs['subfileList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
           }).catch(err => {
             console.error(err)