Ver código fonte

将系统中根据准入范围带出资质证书,改成先填写企业资质再选准入范围 -- 物资类

yuedefeng 5 anos atrás
pai
commit
e24006dc58

+ 30 - 3
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go

@@ -8,8 +8,8 @@ import (
 
 	"dashoo.cn/backend/api/business/oilsupplier/basisbuild"
 	"dashoo.cn/backend/api/business/oilsupplier/goodsaptitude"
-	"dashoo.cn/backend/api/business/oilsupplier/technologyservice"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
+	"dashoo.cn/backend/api/business/oilsupplier/technologyservice"
 	. "dashoo.cn/backend/api/mydb"
 
 	//"dashoo.cn/utils"
@@ -103,7 +103,7 @@ func (s *SupplierfileService) GetTechNeedFileList(classid string) (needList []Fi
 
 	return needList
 }
-//看是否为制造商
+//看是否为制造商
 func (s *SupplierfileService) CheckIsManuf(id string) (IsManufacturer string) {
 	var entity suppliercertsub.OilSupplierCertSub
 	sql := "select * from OilSupplierCertSub where id = " + id
@@ -111,4 +111,31 @@ func (s *SupplierfileService) CheckIsManuf(id string) (IsManufacturer string) {
 	IsManufacturer = strconv.Itoa(entity.IsManufacturer)
 
 	return IsManufacturer
-}
+}
+
+/** func (s *SupplierfileService) GetAllowCertItemList(supplierId, supplierTypeCode string) (goodsClassList []goodsaptitudeclass.OilGoodsAptitudeClass) {
+	// 查询出已有哪些资质
+	var tableheaderList []tableheader.BaseTableheader
+	fileSql := "SELECT b.* from OilSupplierFile a LEFT JOIN Base_TableHeader b on a.NeedFileType=b.Name AND a.SupplierTypeCode=b.CategoryCode WHERE a.SupplierId='"+ supplierId +"' AND (a.SupplierTypeCode='" + supplierTypeCode + "' or a.SupplierTypeCode='000')"
+	s.DBE.SQL(fileSql).Find(&tableheaderList)
+	var needHeaders string
+	for _, tableheader := range tableheaderList {
+		needHeaders += tableheader.Code + ","
+	}
+	// 获取符合资质的列表树
+	sql := "SELECT a.* FROM OilGoodsAptitudeClass a LEFT JOIN OilGoodsAptitude b ON a.Id=b.ClassId WHERE 1=1"
+	var i int
+	for i=1; i<=46; i++ {
+		fileNo := fmt.Sprintf("%02d", i)
+		fileNo = "F" + fileNo
+		ret := strings.ContainsAny(needHeaders, fileNo + ",")
+		if !ret {
+			sql += " AND (" + fileNo + " = '' or " + fileNo + " is null)"
+		} else {
+			sql += " AND " + fileNo + " = '1' or " + fileNo + " is null)"
+		}
+	}
+	s.DBE.SQL(sql).Find(&goodsClassList)
+
+	return goodsClassList
+} */

+ 44 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -21,9 +21,9 @@ import (
 
 	"dashoo.cn/backend/api/business/items"
 
-	"dashoo.cn/backend/api/business/workflow"
 	"dashoo.cn/backend/api/business/baseUser"
 	"dashoo.cn/backend/api/business/oilsupplier/goodsaptitude"
+	"dashoo.cn/backend/api/business/workflow"
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/business2/parameter"
 	"dashoo.cn/business2/userRole"
@@ -1013,6 +1013,49 @@ func (this *OilGoodsAptitudeController) GoodsChildLisByParentId() {
 	this.ServeJSON()
 }
 
+// @Title get 获取子类
+// @Description get SampleType by token
+// @Success 200 {object} sampletype.SampleType
+// @router /goodsclassfilterbypid/:parentid [get]
+func (this *OilGoodsAptitudeController) GoodsClassFilterByParentId() {
+	// 查询出已有哪些资质
+	supplierId := this.GetString("SupplierId")
+	supplierTypeCode := this.GetString("SupplierTypeCode")
+	var tableheaderList []tableheader.BaseTableheader
+	fileSql := "SELECT b.* from OilSupplierFile a LEFT JOIN Base_TableHeader b on a.NeedFileType=b.Name AND a.SupplierTypeCode=b.CategoryCode WHERE a.SupplierId='"+ supplierId +"' AND (a.SupplierTypeCode='" + supplierTypeCode + "' or a.SupplierTypeCode='000')"
+	svcHeader := tableheader.GetTableHeaderService(utils.DBE)
+	svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
+	var needHeaders string
+	for _, tableheader := range tableheaderList {
+		needHeaders += tableheader.Code + ","
+	}
+	ParentId := this.Ctx.Input.Param(":parentid")
+	GoodsLevel := this.GetString("GoodsLevel")
+	sqlStr := "SELECT o.Id, o.`Code`, o.`Name`, concat(o.Code, '  ', o.Name) as CodeName, o.ParentId, g.GoodsLevel," +
+		" (CASE WHEN length(Code)>=8 THEN '1' ELSE '0' END) as Leaf FROM OilGoodsAptitudeClass o " +
+		" LEFT JOIN `OilGoodsAptitude` g ON (g.ClassId = o.Id)" +
+		" WHERE IF ((LENGTH(CODE)=8 and '" + GoodsLevel + "' = 2 ) , g.GoodsLevel = '2', 1=1 ) and o.ParentId = " + ParentId
+	var i int
+	for i=1; i<=46; i++ {
+		fileNo := fmt.Sprintf("%02d", i)
+		fileNo = "F" + fileNo
+		ret := strings.ContainsAny(needHeaders, fileNo + ",")
+		if !ret {
+			sqlStr += " AND (" + fileNo + " = '' or " + fileNo + " is null)"
+		} else {
+			sqlStr += " AND " + fileNo + " = '1' or " + fileNo + " is null)"
+		}
+	}
+	sqlStr += " AND o.Edition='1' AND o.DeletionStateCode = 0 order by o.Code"
+
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	list, _ := svc.DBE.QueryString(sqlStr)
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title get 导出ex
 // @Description get SampleType by token
 // @Success 200 {object} sampletype.SampleType

+ 1 - 1
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -165,7 +165,7 @@ module.exports = {
      'pages/oilsupplier/badrecord/*.*',
     'pages/oilsupplier/basisbuild/*.*',
     'pages/oilsupplier/compayaudit/*.*',
-    'pages/oilsupplier/goodsaptitude/*.*',
+    //'pages/oilsupplier/goodsaptitude/*.*',
     'pages/oilsupplier/infochange/*.*',
     'pages/oilsupplier/infochangech/*.*',
     //'pages/oilsupplier/supplier/*.*',

+ 657 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -0,0 +1,657 @@
+<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 0px"
+                     type="text"
+                     @click="deletedata()"
+                     v-if="candelete">删除</el-button>
+          <el-button style="float: right; padding: 3px 25px"
+                     type="text"
+                     @click="showDialog"
+                     v-if="canadd || newcanadd">添加</el-button>
+        </span>
+      </div>
+      <el-table :data="goodsList"
+                v-loading="tableloading"
+                element-loading-text="正在更改请稍后..."
+                border
+                size="mini"
+                height="calc(100vh - 445px)"
+                @selection-change="handleSelectionChange">
+        <el-table-column type="selection"
+                         width="55">
+        </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="GoodsLevel"
+                         label="级别" width="80px"
+                         show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span v-if="scope.row.GoodsLevel=='1'">一级</span>
+            <span v-if="scope.row.GoodsLevel=='2'">二级</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否为制造商" width="105">
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="CertSubStatus"
+                         label="状态"
+                         show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span v-if="scope.row.CertSubStatus=='1'"
+                  style="color:#67C23A">准入</span>
+            <span v-else-if="scope.row.CertSubStatus>'1'"
+                  style="color:#E6A23C">暂停</span>
+            <span v-else>——</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="Remark"
+                         label="备注"
+                         show-overflow-tooltip></el-table-column>
+
+        <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="!candelete">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination @size-change="handleSizeChange"
+                     @current-change="handleCurrentChange"
+                     :current-page="currentPage"
+                     :page-sizes="[10, 50, 100, 200, 400]"
+                     :page-size="size"
+                     layout="total, sizes, prev, pager, next, jumper"
+                     :total="currentItemCount">
+      </el-pagination>
+    </el-card>
+
+    <el-dialog v-loading="loading"
+               element-loading-text="正在添加请稍后..."
+               title="物资类业务列表"
+               :visible.sync="goodsDialog"
+               @open="opendialog"
+               top="5vh">
+      <el-tabs v-model="tabIdx"
+               style="margin-top: -30px;">
+        <el-tab-pane label="准入编码"
+                     name="1">
+          <el-row>
+            <el-col :span="12">
+              <el-input v-if="!switchstatus"
+                        v-model="filterText"
+                        placeholder="请输入名称或代码"
+                        size="mini"
+                        style="width: 250px;"></el-input>
+              <el-input v-if="switchstatus"
+                        v-model="searchText"
+                        placeholder="请输入名称或代码"
+                        size="mini"
+                        style="width: 250px;"></el-input>
+              <el-button style="float: right;"
+                         type="primary"
+                         size="mini"
+                         @click="getsectreelist()"
+                         :disabled="!switchstatus">查询</el-button>
+              <el-switch v-model="switchstatus"
+                         size="mini"></el-switch>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20"
+                  style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
+            <el-col :span="20">
+              <el-tree v-show="!switchstatus"
+                       highlight-current
+                       :expand-on-click-node="true"
+                       node-key="CodeName"
+                       :data="orgtreelist"
+                       :props="orgtreeprops"
+                       ref="orgmanagetree"
+                       check-on-click-node
+                       show-checkbox
+                       lazy
+                       :load="getChildrens"
+                       :filter-node-method="filterNode">
+              </el-tree>
+              <el-tree v-show="switchstatus"
+                       ref="secmanagetree"
+                       :data="sectreelist"
+                       show-checkbox
+                       check-on-click-node
+                       node-key="CodeName"
+                       :props="sectreeprops">
+              </el-tree>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 30px">
+            备注信息:
+            <el-col :span="24">
+              <el-input v-model="Remark"
+                        type="textarea"
+                        :rows=3
+                        placeholder="请输入备注信息"></el-input>
+            </el-col>
+          </el-row>
+        </el-tab-pane>
+      </el-tabs>
+      <div slot="footer"
+           class="dialog-footer"
+           v-if="tabIdx==1">
+        <el-button type="primary"
+                   size="mini"
+                   @click="getChecklist()">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+
+  export default {
+    name: 'GoodsList',
+    components: {},
+    props: {
+      operType: {
+        type: String,
+        default: ''
+      },
+      canadd: {
+        type: Boolean,
+        default: false
+      },
+      newcanadd: {
+        type: Boolean,
+        default: false
+      },
+      candelete: {
+        type: Boolean,
+        default: false
+      },
+      Grade: {
+        type: String,
+        default: ''
+      }
+    },
+    created () {
+      // this.initData2019()
+    },
+    /*
+    computed: {
+      ...mapGetters({
+        session: 'session'
+      })
+    }, */
+    watch: {
+      filterText (val) {
+        this.$refs.orgmanagetree.filter(val)
+      }
+    },
+    data () {
+      return {
+        loading: false,
+        tableloading:false,
+        keyword: '',
+        Ids: [],
+        SupplierId: 0,
+        SupplierTypeCode: '',
+        SupplierCertId: 0,
+        tabIdx: '1',
+        sectionCert: [],
+        goodsList2019: [],
+        goodsList: [],
+        goodsDialog: false,
+        switchstatus: false,
+        orgtreelist: [],
+        sectreelist: [],
+        orgtreeprops: {
+          value: 'Id',
+          label: 'CodeName',
+          GoodsLevel: 'GoodsLevel',
+          children: 'children',
+          isLeaf: 'Leaf',
+          disabled: 'disabled'
+        },
+        sectreeprops: {
+          children: 'children',
+          label: 'CodeName',
+          disabled: 'disabled'
+        },
+        checkList: [],
+        Remark: '',
+        Remark1: '',
+
+        filterText: '',
+        searchText: '',
+        visible: false,
+        selfVisible: this.visible, // 避免vue双向绑定警告
+        currentPage: 1, // 分页
+        size: 10,
+        currentItemCount: 0,
+        currentPageCert: 1, // 分页
+        sizeCert: 10,
+        currentItemCountCert: 0,
+        flagId: 0, // 标记是否第一次点击
+        isFirstOpen: true,
+        node_had: {},
+        resolve_had: {}
+      }
+    },
+    methods: {
+      isDisabledBtn () {
+        if (this.operType !== '制造商') {
+          return true
+        } else {
+          if (this.canadd || this.newcanadd) {
+            return false
+          } else {
+            return true
+          }
+        }
+      },
+      opendialog () {
+        if (!this.isFirstOpen) {
+          this.node_had.childNodes = []
+          this.getChildrens(this.node_had, this.resolve_had)
+        }
+      },
+      initData2019 () {
+        let params = {
+          _currentPage: this.currentPageCert,
+          _size: this.sizeCert,
+          Name: this.keyword
+        }
+        this.$axios.get('suppliercertsub/listCert2019', { params })
+          .then(res => {
+            this.goodsList2019 = res.data.items
+            this.currentItemCountCert = res.data.currentItemCount
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      type_change(val,canadd,newcanadd){
+        if (canadd == true || newcanadd == true) {
+          if (val.IsManufacturer == 2){
+            this.tableloading = true
+            let IsManufacturer = 2
+            this.$axios.get('suppliercertsub/updatemanufacturer/' + parseInt(val.Id) +'/'+parseInt(val.SupplierId) + '/' + IsManufacturer + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+                this.tableloading = false
+              } else if (res.data.code === -2) {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+                this.initData()
+                this.tableloading = false
+              }
+            })
+              .catch(err => {
+                console.error(err)
+              })
+          } else if (val.IsManufacturer == 1){ // ---------------转换供应商与非供应商
+            this.tableloading = true
+            let IsManufacturer = 1
+            this.$axios.get('suppliercertsub/updatemanufacturer/' + parseInt(val.Id) +'/'+parseInt(val.SupplierId) + '/' + IsManufacturer + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+                this.tableloading = false
+              } else if (res.data.code === -2) {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+                this.initData()
+                this.tableloading = false
+              }
+            })
+              .catch(err => {
+                console.error(err)
+              })
+          }
+        }
+      },
+      changeCertSubStatus (row, column, cell, event) {
+        if (this.newcanadd && column.property === 'CertSubStatus') {
+          this.$confirm('确定更改此准入范围状态吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then((res) => {
+            this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+          }).catch(() => {
+          })
+        } else {
+        }
+      },
+      handleSelectionChange (val) {
+        this.Ids = []
+        for (var i = 0; i < val.length; i++) {
+          this.Ids.push(val[i].Id)
+        }
+      },
+      handleSelectionChangeCert (val) {
+        this.sectionCert = val
+      },
+      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)
+          })
+      },
+      getChecklist () {
+        let val1 = this.$refs.orgmanagetree.getCheckedNodes()
+        let val2 = this.$refs.secmanagetree.getCheckedNodes()
+        this.checkList = []
+        for (var i = 0; i < val1.length; i++) {
+          if (val1[i].Code.length == 8) {
+            this.checkList.push(val1[i])
+          }
+        }
+        for (var i = 0; i < val2.length; i++) {
+          if (val2[i].Code.length == 8) {
+            this.checkList.push(val2[i])
+          }
+        }
+        this.addBusiness()
+        this.switchstatus = false
+      },
+      addBusiness1 () {
+        if (this.sectionCert.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '请选择准入类别'
+          })
+          return
+        }
+        let params = {
+          SupplierId: parseInt(this.SupplierId),
+          SupplierCertId: parseInt(this.SupplierCertId),
+          SupplierTypeCode: '01',
+          Type: '1',
+          CertSubStatus: '-1',
+          IsManufacturer: 2,
+          Remark: this.Remark1,
+          CheckList: this.sectionCert
+        }
+        for (var i = 0; i < this.sectionCert.length; i++) {
+          this.sectionCert[i].Id = this.sectionCert[i].Id + ''
+        }
+        this.loading = true
+        this.$axios.post('/suppliercertsub/addgoodsbus', params)
+          .then(res => {
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.goodsDialog = false
+              this.loading = false
+              this.sectionCert = []
+              this.Remark1 = ''
+              this.initData()
+              this.initData2019()
+            } else {
+              this.loading = false
+              this.$message({
+                type: 'warning',
+                message: '操作失败!'
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      addBusiness () {
+        let _this = this
+        let params = {
+          SupplierId: parseInt(_this.SupplierId),
+          SupplierCertId: parseInt(_this.SupplierCertId),
+          SupplierTypeCode: '01',
+          Type: '1',
+          IsManufacturer: 2,
+          CertSubStatus: '-1',
+          Remark: _this.Remark
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
+          _this.$message({
+            type: 'warning',
+            message: '名称不能为空,请选择分类!'
+          })
+          return
+        }
+        _this.loading = true
+        _this.$axios.post('/suppliercertsub/addgoodsbus', params)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              _this.goodsDialog = false
+              _this.loading = false
+              _this.initData()
+            } else {
+              _this.loading = false
+              _this.$message({
+                type: 'warning',
+                message: '操作失败!'
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+        this.$refs.orgmanagetree.setCheckedKeys([])
+        this.$refs.secmanagetree.setCheckedKeys([])
+        this.filterText = ''
+        this.searchText = ''
+      },
+      deletedata (val) {
+        if (val != null && val != '') {
+          this.Ids = []
+          this.Ids.push(val.Id)
+        }
+
+        if (this.Ids.length == 0) {
+          this.$message({
+            type: 'warning',
+            message: '请先选择删除条目'
+          })
+          return
+        }
+
+        let _this = this
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            const delload = this.$loading({
+              lock: true,
+              text: '正在删除请稍后...'
+            })
+            let params = {
+              SupplierId: parseInt(_this.SupplierId),
+              SupplierTypeCode: '01'
+            }
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {params})
+              .then(function (response) {
+                if (response.data.code === 0) {
+                  _this.$message({
+                    type: 'success',
+                    message: response.data.message
+                  })
+                  delload.close()
+                  _this.Ids = []
+                  _this.initData()
+                } else {
+                  delload.close()
+                  _this.Ids = []
+                  _this.$message({
+                    type: 'warning',
+                    message: response.data.message
+                  })
+                }
+              })
+              .catch(function (error) {
+                console.log(error)
+              })
+          })
+          .catch(() => {
+            _this.Ids = []
+          })
+      },
+      showDialog () {
+        // this.getorgtreelist()
+        this.goodsDialog = true
+      },
+      getsectreelist () {
+        let _this = this
+        let name = _this.searchText
+        this.$axios.get('goodsaptitude/goodsparentlist/' + name)
+          .then(res => {
+            _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName,GoodsLevel')
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      // 获取下一级所有分类
+      getChildrens (val, resolve) {
+        if (this.isFirstOpen) {
+          this.node_had = val
+          this.resolve_had = resolve
+          this.isFirstOpen = false
+        }
+
+        let Id = 0
+        if (val.level === 0) {
+          Id = 0
+        } else {
+          Id = val.data.Id
+        }
+        let params = {
+          SupplierId: this.SupplierId,
+          SupplierTypeCode: '01',
+          GoodsLevel: this.Grade
+        }
+        this.$axios.get('goodsaptitude/goodsclassfilterbypid/' + Id, {params})
+          .then(res => {
+            if (!res.data.items || res.data.items.length <= 0) {
+              val.isLeaf = true
+              return resolve([])
+            }
+            for (let idx in res.data.items) {
+              if (res.data.items[idx].Code.length <= 4) {
+                res.data.items[idx].disabled = true
+              }
+              res.data.items[idx].Leaf = res.data.items[idx].Leaf === '1'
+            }
+            return resolve(res.data.items)
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      filterNode (value, data) {
+        if (!value) return true
+        return data.CodeName.indexOf(value) !== -1
+      },
+
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initData()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initData()
+      },
+      handleSizeChangeCert (value) {
+        this.sizeCert = value
+        this.currentPageCert = 1
+        this.initData2019()
+      },
+      handleCurrentChangeCert (value) {
+        this.currentPageCert = value
+        this.initData2019()
+      }
+    }
+  }
+</script>
+
+<style>
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+</style>

+ 0 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -227,7 +227,6 @@
         SupplierTypeCode: '',
         SubClassIds: [],
         SupplierCertId: 0,
-        InStyle: '1',
         IsMust: false,
         businessList: [],
         subfileList: [],

+ 740 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist2.vue

@@ -0,0 +1,740 @@
+<template>
+  <div>
+    <el-card class="box-card" style="margin-top: 10px;">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold"> 企业资质</span>
+        <el-button type="primary" size="mini" style="float: right;margin-right: 3px" @click="nextStep()"
+                   v-if="canadd && IsCompanyUser == 0">
+          提交审批
+        </el-button>
+        <el-button style="float: right; padding: 6px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加</el-button>
+      </div>
+      <el-table :data="subfileList" border size="mini">
+        <el-table-column label="操作" width="150" align="center" fixed>
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" title="上传" @click="openDialog(scope.row)" :disabled="!canadd && !newcanadd">上传
+            </el-button>
+            <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
+                       :disabled="(scope.row.FileType == '1' || !canadd) && !newcanadd" @click="deletedata(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></el-table-column>
+        <el-table-column label="贸易/制造" v-if="SupplierTypeCode == '01'" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span v-if="scope.row.IsManuf=='1'">制造商</span>
+            <span v-else-if="scope.row.IsManuf=='2'">贸易商</span>
+            <span v-else>通用</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+              <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
+                {{scope.row.FileName.split('$')[index]}}</el-link>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.EffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="OtherRemark" label="描述" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </el-card>
+
+    <el-dialog :title="Title" :visible.sync="visible" top="5vh" width="900px">
+      <el-form ref="subfileForm" :model="SubfileForm" :rules="rules" label-width="100px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="资质名称" prop="NeedFileType">
+              <!-- <el-input v-model="SubfileForm.NeedFileType" placeholder="请输文件类型"></el-input> -->
+              <el-select v-model="SubfileForm.NeedFileType" placeholder="请输文件类型" size="medium" :disabled="IsMust">
+                <el-option v-for="item in dynamicTableColumns" :key="item.prop" :label="item.label" :value="item.label">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="有效日期" prop="EffectDate">
+              <el-date-picker style="width: 100%" v-model="SubfileForm.EffectDate" type="date" placeholder="请选择有效日期" @change="pickerchange">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="描述">
+              <el-input v-model="SubfileForm.OtherRemark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="资质文件">
+              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                         :on-remove="filremove" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload" :file-list="fileList">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片
+                </div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
+        <el-button @click="visible = false">取 消</el-button>
+        <el-button type="primary" @click="makesure()">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import axios from 'axios'
+  import uploadajax from '../../assets/js/uploadajax.js'
+  import BusinessList from '../../components/oilsupplier/businesslist'
+  import setapi from '@/api/oilsupplier/oilclassorgset'
+  import api from '@/api/oilsupplier/supplierfile'
+
+  export default {
+    name: 'SubfileList',
+    components: {
+      BusinessList // 准入范围
+    },
+    props: {
+      canadd: {
+        type: Boolean,
+        default: false
+      },
+      newcanadd: {
+        type: Boolean,
+        default: false
+      },
+      flag: {
+        type: String
+      },
+      Grade: {
+        type: String,
+        default: ''
+      },
+      InStyle: {
+        type: String,
+        default: ''
+      },
+      OperType: {
+        type: String,
+        default: ''
+      },
+      isInvestigate: {
+        type: Boolean,
+        default: false
+      }
+    },
+    computed: {
+      ...mapGetters({
+        session: 'session',
+        authUser: 'authUser'
+      })
+    },
+    data () {
+      var effectDate = (rule, value, callback) => {
+        if (!value) {
+          callback(new Error('请选择有效日期'))
+        } else {
+          let date = new Date()
+          let nowdata = new Date(date.getFullYear(), date.getMonth(), date.getDate())
+          if (value < nowdata) {
+            callback(new Error('有效日期不能小于当前日期'))
+          } else {
+            callback()
+          }
+        }
+      }
+
+      return {
+        size: 10,
+        currentPage: 1,
+        currentItem_Count: 0,
+        yasuoname: '',
+        SupplierId: 0,
+        SupplierTypeCode: '',
+        SubClassIds: [],
+        SupplierCertId: 0,
+        IsMust: false,
+        businessList: [],
+        subfileList: [],
+        techList: [],
+        techTreeList: [],
+        fileList: [],
+        orgtreeprops: {
+          value: 'id',
+          label: 'Name',
+          children: 'children'
+        },
+        selectedorg: [],
+
+        Title: '',
+        SubfileForm: {
+          Id: '',
+          SupplierId: '',
+          SupplierTypeCode: '',
+          SupplierCertSubId: '',
+          CertSubName: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileType: '',
+          FileExt: '',
+          FileName: '',
+          EffectDate: new Date(),
+          FileUrl: '',
+          OtherRemark: '',
+          Remark: '',
+          IsDelete: 0,
+          FileUrlList: []
+        },
+        scenefile: {
+          Id: '',
+          SupplierId: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileUrl: '',
+          FileName: '',
+          FileExt: ''
+        },
+        visible: false,
+        selfVisible: this.visible, // 避免vue双向绑定警告
+
+        waituploads: [], // 等待上传的附件列表
+        doclist: [],
+        dynamicTableColumns: [],
+        IsCompanyUser: '',
+        rules: {
+          NeedFileType: [
+            {required: true, message: '资质名称不能为空', trigger: 'blur'}
+          ],
+          EffectDate:
+            [{ required: true, validator: effectDate, trigger: 'change' }]
+        }
+      }
+    },
+    created () {
+      this.getDictOptions()
+      this.initTableHeader()
+      this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
+    },
+    methods: {
+      pickerchange () {
+        console.log(this.SubfileForm.EffectDate)
+      },
+      getSupplierSceneFile () {
+        let params = {
+          SupplierId: this.SupplierId
+        }
+        this.$axios.get('/supplier/getscenefilelist', {params}).then(res => {
+          this.scenefile = res.data.item
+        })
+      },
+      handleSelectionChange (val) {
+        this.SubClassIds = []
+        for (var i = 0; i < val.length; i++) {
+          this.SubClassIds.push(val[i].SubClassId)
+        }
+        this.initData()
+      },
+      initTableHeader () {
+        if (this.flag == '01') {
+          setapi.initGoodTableHeader(this.$axios).then(res => {
+            this.dynamicTableColumns = res.data.items
+          })
+        } else if (this.flag == '02') {
+          setapi.initBbTableHeader(this.$axios).then(res => {
+            this.dynamicTableColumns = res.data.items
+          })
+        } else {
+          setapi.initTsTableHeader(this.$axios).then(res => {
+            this.dynamicTableColumns = res.data.items
+          })
+        }
+      },
+      getvalue (SupplierId, SupplierTypeCode, certId, inStyle) {
+        this.SupplierId = SupplierId
+        this.SupplierTypeCode = SupplierTypeCode
+        this.SupplierCertId = certId
+        this.InStyle = inStyle
+        this.initData()
+        this.getbusList()
+      },
+      initData () {
+        let _this = this
+        const params = {
+          InStyle: this.InStyle,
+          SupplierId: this.SupplierId,
+          SupplierTypeCode: this.SupplierTypeCode,
+          SubClassIds: this.SubClassIds.join(),
+          _currentPage: 1,
+          _size: 10000
+        }
+        _this.$axios.get('supplierfile/filelist', {
+          params
+        })
+          .then(res => {
+            _this.subfileList = res.data.items
+            _this.currentItemCount = res.data.currentItemCount
+            for (let idx in _this.subfileList) {
+              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+            }
+            this.getSupplierSceneFile()
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      getbusList () {
+        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.businessList = res.data.items
+            _this.currentItem_Count = res.data.currentItemCount
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      makesure () {
+        let _this = this
+        _this.$refs['subfileForm'].validate((valid) => {
+          if (valid) {
+            if (_this.Title == '新增文件') {
+              if (_this.$refs.refuploadattach.uploadFiles && _this.$refs.refuploadattach.uploadFiles.length > 0) {
+                // 上传附件是否完成判断
+                if (!_this.attachissuccess()) {
+                  _this.$message.error('有附件未成功上传!不能保存数据')
+                  return
+                }
+                _this.getattachissuccess()
+                _this.addSubfile()
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '请上传文件!'
+                })
+              }
+            } else if (_this.Title == '上传文件') {
+              if (_this.$refs.refuploadattach.uploadFiles && _this.$refs.refuploadattach.uploadFiles.length > 0) {
+                // 上传附件是否完成判断
+                if (!_this.attachissuccess()) {
+                  _this.$message.error('有附件未成功上传!不能保存数据')
+                  return
+                }
+                _this.getattachissuccess()
+                _this.editSubfile()
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '请上传文件!'
+                })
+              }
+            }
+          }
+        })
+      },
+      addSubfile () {
+        let _this = this
+        _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
+        _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
+        _this.$axios.post('/supplierfile/addsubfile/', _this.SubfileForm)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.visible = false
+              this.initData()
+              this.$refs.refuploadattach.uploadFiles = []
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      editSubfile () {
+        let _this = this
+        _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
+        _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
+        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.visible = false
+              this.initData()
+              this.$refs.refuploadattach.uploadFiles = []
+            } 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('supplierfile/subfiledelete/' + 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(() => {})
+      },
+      nextStep () {
+        if (this.businessList && this.businessList.length > 0) {
+          if (this.Grade === '2') {
+            for (let idx in this.businessList) {
+              if (this.businessList[idx].GoodsLevel === '1') {
+                this.$message({
+                  type: 'warning',
+                  message: '二级供应商不能准入一级物资!'
+                })
+                return
+              }
+            }
+          }
+          if ((this.isInvestigate) && (this.InStyle != '2')) {
+            if (this.scenefile.Id == '' || this.scenefile.Id == '0') {
+              this.$message({
+                type: 'warning',
+                message: '请上传现场考察报告!'
+              })
+              return
+            }
+          }
+          if (this.subfileList && this.subfileList.length > 0) {
+            for (var i = 0; i < this.subfileList.length; i++) {
+              if (this.subfileList[i].FileType === 1 && this.subfileList[i].FileUrl === '') {
+                this.$message({
+                  type: 'warning',
+                  message: '请上传文件' + this.subfileList[i].NeedFileType + '!'
+                })
+                return
+              }
+            }
+            this.$emit('close')
+          } else {
+            this.$emit('close')
+          }
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '请选择准入范围!'
+          })
+        }
+      },
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          this.yasuoname = res.data.items['YaSuoName']
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      showDialog () {
+        // this.doclist = []
+        this.IsMust = false
+        this.Title = '新增文件'
+        this.SubfileForm.Id = ''
+        this.SubfileForm.SupplierId = this.SupplierId
+        this.SubfileForm.SupplierTypeCode = this.SupplierTypeCode
+        this.SubfileForm.SupplierCertSubId = ''
+        this.SubfileForm.CertSubName = ''
+        this.SubfileForm.NeedFileType = ''
+        this.SubfileForm.NeedFileCode = ''
+        this.SubfileForm.FileExt = ''
+        this.SubfileForm.FileType = ''
+        this.SubfileForm.FileName = ''
+        this.SubfileForm.EffectDate = null
+        this.SubfileForm.FileUrl = ''
+        this.SubfileForm.OtherRemark = ''
+        this.SubfileForm.Remark = ''
+        this.SubfileForm.IsDelete = 0
+        this.visible = true
+      },
+      openDialog (val) {
+        this.IsMust = true
+        this.Title = '上传文件'
+        this.SubfileForm.Id = val.Id
+        this.SubfileForm.SupplierId = val.SupplierId
+        this.SubfileForm.SupplierTypeCode = val.SupplierTypeCode
+        if (val.SupplierCertSubId == 0) {
+          this.SubfileForm.SupplierCertSubId = ''
+        } else {
+          this.SubfileForm.SupplierCertSubId = val.SupplierCertSubId
+        }
+        this.SubfileForm.CertSubName = val.CertSubName
+        this.SubfileForm.NeedFileType = val.NeedFileType
+        this.SubfileForm.NeedFileCode = val.NeedFileCode
+        this.SubfileForm.FileExt = val.FileExt
+        this.SubfileForm.FileType = val.FileType
+        this.SubfileForm.FileName = val.FileName
+        this.SubfileForm.EffectDate = (this.jsEffectDate(val.EffectDate))
+        this.SubfileForm.FileUrl = val.FileUrl
+        this.fileList = []
+        if (val.FileUrl !== '') {
+          this.getwendanginfo(val.FileUrl)
+        }
+        this.SubfileForm.OtherRemark = val.OtherRemark
+        this.SubfileForm.Remark = val.Remark
+        this.SubfileForm.IsDelete = val.IsDelete
+        this.visible = true
+      },
+      // 文档列表
+      getwendanginfo (iUrl) {
+        let _this = this
+        _this.doclist = []
+        let urlArr = iUrl.split('$')
+        for (let idx in urlArr) {
+          let exArr = urlArr[idx].split('|')
+          let params = {
+            name: exArr[1],
+            url: exArr[0]
+          }
+          _this.doclist.push(params)
+          _this.fileList.push(params)
+        }
+      },
+      filremove (file, files) {
+        this.fileList = files
+      },
+      beforeAvatarUpload (file) {
+        console.log(file, '=====')
+        let isLt512K = file.size / 1024 < 512
+        if (isLt512K) {
+          this.$message.error('上传文件大小不能小于 512KB!')
+          return false
+        }
+
+        if (this.SubfileForm.NeedFileType != this.yasuoname) {
+          if (file.type.indexOf('image') < 0) {
+            this.$message.error('上传图片!')
+            return false
+          }
+          let isLt50m = file.size / 1024 / 1024 / 5 < 1
+          if (!isLt50m) {
+            this.$message.error('上传文件大小不能超过 5MB!')
+            return false
+          }
+          return true
+        } else {
+          if (file.name.indexOf('.rar') < 0 && file.name.indexOf('.zip') < 0) {
+            this.$message.error('文件格式必须为rar或zip')
+            return false
+          }
+          return true
+        }
+      },
+      uploadrequest (option) {
+        let _this = this
+        if (process.client) {
+          const myDomain = window.location.host
+          axios.post(process.env.upfilehost, {})
+            .then(function (res) {
+              if (res.data && res.data.fid && res.data.fid !== '') {
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
+                _this.waituploads.push({
+                  uid: option.file.uid,
+                  url: res.data.publicUrl,
+                  fid: res.data.fid
+                })
+                uploadajax(option)
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(function (error) {
+              _this.$message({
+                type: 'warning',
+                message: '未上传成功!请重新上传!'
+              })
+            })
+        }
+      },
+      // 判断附件是否上传成功
+      attachissuccess () {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status !== 'success') {
+              return false
+            }
+          }
+        }
+        return true
+      },
+      getattachissuccess () {
+        this.SubfileForm.FileUrl = ''
+        this.SubfileForm.FileName = ''
+        if (this.fileList != null && this.fileList.length > 0) {
+          for (let idx in this.fileList) {
+            this.SubfileForm.FileName += this.fileList[idx].name + '$'
+            this.SubfileForm.FileUrl += this.fileList[idx].url + '|' + this.fileList[idx].name + '$'
+          }
+        }
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status === 'success') {
+              for (let j = 0; j < this.waituploads.length; j++) {
+                if (this.waituploads[j].uid === this.$refs.refuploadattach.uploadFiles[i].uid) {
+                  this.SubfileForm.FileUrl +=
+                    `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.refuploadattach.uploadFiles[i].name}$`
+                  this.SubfileForm.FileName += `${this.$refs.refuploadattach.uploadFiles[i].name}$`
+                }
+              }
+            }
+          }
+        }
+      },
+      clickachment (url, uid) {
+        window.open(`http://${url}`)
+      },
+      deletefile () {
+        let _this = this
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            _this.doclist = []
+          })
+          .catch(() => {})
+      },
+
+      seachdata () {
+        this.initData()
+      },
+      fileurlcut (val, index) {
+        let fileurlall = val.split('$')[index]
+        let fileurl = fileurlall.split('|')
+        let retUrl = fileurl[0]
+        // 内网服务器专用
+        if (process.client && retUrl.indexOf('/upfile') === 0) {
+          const myDomain = window.location.host
+          retUrl = myDomain + '/' + retUrl
+        }
+        return retUrl
+      },
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T00:00:00Z') {
+          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)
+        }
+      },
+      jsEffectDate (val) {
+        if (val === '') {
+          return ''
+        } else if (val === '0001-01-01T00:00:00Z') {
+          return ''
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return ''
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return ''
+        } else {
+          return val
+        }
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.getbusList()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.getbusList()
+      }
+    }
+  }
+</script>
+
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    // margin-bottom: -17px;
+    margin-top: -15px;
+    margin-left: 20px
+  }
+
+  .attach-uploader .el-upload:hover {
+    border-color: #228B22;
+  }
+
+  .attach-uploader-icon {
+    font-size: 25px;
+    color: #63B8FF;
+    width: 50px;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+  }
+
+  .attach-uploader-icon:hover {
+    color: #228B22;
+  }
+
+</style>

+ 19 - 27
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -69,15 +69,6 @@
         </span>
       </div>
 
-      <!-- <el-steps :active="formData.Step" simple align-center finish-status="success">
-        <el-step title="填信息"></el-step>
-        <el-step title="待审批"></el-step>
-        <el-step title="已审批"></el-step>
-        <el-step title="待交费"></el-step>
-        <el-step title="待入库"></el-step>
-        <el-step title="完成"></el-step>
-      </el-steps>-->
-
       <el-tabs tab-position="top"
                v-model="activeName"
                style="margin-top: -10px">
@@ -305,9 +296,22 @@
           </el-card>
         </el-tab-pane>
 
+        <el-tab-pane label="企业资质"
+                     :disabled="(!certId) || (WorkerTotal == 0)">
+          <subfile-list2 ref="subfileList"
+                        :data.sync="subfileList"
+                        :canadd="add_flat"
+                        :flag="flag"
+                        :Grade="formData.Grade"
+                        :InStyle="formData.InStyle"
+                        :OperType="formData.OperType"
+                        :isInvestigate="isInvestigate"
+                        @close="selectAuditOrg"></subfile-list2>
+        </el-tab-pane>
+
         <el-tab-pane label="准入范围"
                      :disabled="(!certId) || (WorkerTotal == 0)">
-          <goods-list ref="goodsList"
+          <goods-list2 ref="goodsList"
                       :data.sync="goodsList"
                       @close="getbuslist"
                       :canadd="add_flat"
@@ -316,19 +320,7 @@
                       :Grade="formData.Grade"
                       height="360px"
                       @tab-click="tabclick()"
-                      style="margin-top: 20px"></goods-list>
-        </el-tab-pane>
-        <el-tab-pane label="企业资质"
-                     :disabled="(!certId) || (WorkerTotal == 0)">
-          <subfile-list ref="subfileList"
-                        :data.sync="subfileList"
-                        :canadd="add_flat"
-                        :flag="flag"
-                        :Grade="formData.Grade"
-                        :InStyle="formData.InStyle"
-                        :OperType="formData.OperType"
-                        :isInvestigate="isInvestigate"
-                        @close="selectAuditOrg"></subfile-list>
+                      style="margin-top: 20px"></goods-list2>
         </el-tab-pane>
 
         <el-tab-pane label="审批流程"
@@ -543,8 +535,8 @@ import EquipmentList from '@/components/oilsupplier/equipmentlist'
 import PerformanceList from '@/components/oilsupplier/performancelist'
 import PatentList from '@/components/oilsupplier/patentlist'
 import WinningList from '@/components/oilsupplier/winninglist'
-import GoodsList from '@/components/oilsupplier/goodslist'
-import SubfileList from '@/components/oilsupplier/subfilelist'
+import GoodsList2 from '@/components/oilsupplier/goodslist2'
+import SubfileList2 from '@/components/oilsupplier/subfilelist2'
 import GoodsInfo from '@/components/oilsupplier/goodsinfo'
 import ChooseAuditorFen from '@/components/oilsupplier/chooseauditorfenban'
 // import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
@@ -563,8 +555,8 @@ export default {
     PerformanceList, // 近三年主要业绩列表
     PatentList, // 专利及专有技术列表
     WinningList, // 近三年省部级及以上获奖项目列表
-    GoodsList, // 选择准入范围
-    SubfileList, // 选择企业资质
+    GoodsList2, // 选择准入范围
+    SubfileList2, // 选择企业资质
     GoodsInfo,
 
     // ChooseAuditor