|
@@ -0,0 +1,590 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <!--顶部显示-->
|
|
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
|
|
+ <el-breadcrumb-item>HSE成绩</el-breadcrumb-item>
|
|
|
|
|
+ </el-breadcrumb>
|
|
|
|
|
+
|
|
|
|
|
+ <!--内框顶部显示-->
|
|
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 115px);position:relative">
|
|
|
|
|
+ <div slot="header">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <i class="icon icon-table2"></i>
|
|
|
|
|
+ </span>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form :model="searchForm" ref="searchformRef" :inline="true" style="float: right;position:absolute;right:15px;top:10.5px">
|
|
|
|
|
+ <el-form-item label="准入证号">
|
|
|
|
|
+ <el-input size="mini" style="width:110px" v-model="searchForm.AccessCardNo" clearable placeholder="准入证号"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="工商注册号">
|
|
|
|
|
+ <el-input size="mini" style="width:122px" v-model="searchForm.CommercialNo" clearable placeholder="工商注册号"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="企业名称">
|
|
|
|
|
+ <el-input size="mini" style="width:110px" v-model="searchForm.SupplierName" clearable placeholder="企业名称"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="有效期">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="searchForm.ApplyTime"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="选择有效期"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="姓名">
|
|
|
|
|
+ <el-input size="mini" style="width:100px" v-model="searchForm.Name" clearable placeholder="姓名"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-dropdown
|
|
|
|
|
+ split-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="initDatas($event)"
|
|
|
|
|
+ @command="searchCommand"
|
|
|
|
|
+ >
|
|
|
|
|
+ 查询
|
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
|
+ <el-dropdown-item command="clear">查询重置</el-dropdown-item>
|
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
|
+ </el-dropdown>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button v-if="!disabled" type="primary" size="mini" @click="add">新增</el-button>
|
|
|
|
|
+ <el-button v-if="!disabled" type="primary" size="mini" @click="importExcel" :loading="importLoading">导入</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!--内框表格显示-->
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ id="rebateSetTable"
|
|
|
|
|
+ :data="entityList"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ v-loading="tableLoading"
|
|
|
|
|
+ border
|
|
|
|
|
+ height="calc(100vh - 243px)"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @sort-change="orderby"
|
|
|
|
|
+ @selection-change="onSelect"
|
|
|
|
|
+ highlight-current-row
|
|
|
|
|
+ stripe
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="操作" width="200px" align="center" fixed="right" show-overflow-tooltip>
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button :disabled="disabled" type="primary" plain title="修改" size="mini" @click="update(scope.row)">修改</el-button>
|
|
|
|
|
+ <el-button :disabled="disabled" type="danger" plain title="删除" size="mini" @click="deleteRow(scope.row.Id)">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <!--内框表格剩余栏显示-->
|
|
|
|
|
+ <el-table-column align="center" width="70" label="序号">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{scope.$index+(currentPage - 1) * size + 1}} </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="企业名称" min-width="300px" prop="SupplierName" sortable align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="身份证号" width="200px" prop="IdNumber" sortable align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="姓名" width="120px" prop="Name" sortable align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="有效期" width="120px" prop="ApplyTime" sortable align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ jstimehandle(scope.row.ApplyTime+'') }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="考试成绩" width="120px" prop="Score" sortable align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="培训日期" width="120px" prop="TrainTime" sortable align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ jstimehandle(scope.row.TrainTime+'') }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ style="float: right; margin-top: 10px; margin-bottom: 5px"
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
|
+ :page-sizes="[10, 50, 100, 200, 500]"
|
|
|
|
|
+ :page-size="size"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="currentItemCount"
|
|
|
|
|
+ ></el-pagination>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <!--add/update-->
|
|
|
|
|
+ <el-dialog :title="title" :close-on-click-modal="false" :visible.sync="addDialog" width="400px">
|
|
|
|
|
+ <el-form label-width="100px" :model="updateData" ref="EntityForm" :rules="rules">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="企业名称" prop="SupplierId">
|
|
|
|
|
+ <el-select ref="SupplierSelect" v-model="updateData.SupplierId" filterable placeholder="请选择企业名称" style="width: 100%">
|
|
|
|
|
+ <el-option :label="item.SupplierName" :value="item.Id" v-for="(item,index) of supplierSelectList" :key="index"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="姓名" prop="Name">
|
|
|
|
|
+ <el-input style="width:100%" v-model="updateData.Name" placeholder="请填写姓名"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="身份证号" prop="IdNumber">
|
|
|
|
|
+ <el-input style="width:100%" v-model="updateData.IdNumber" placeholder="请填写身份证号"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="考试成绩" prop="Score">
|
|
|
|
|
+ <el-input-number type="number" :min="0" :max="100" style="width:100%" v-model="updateData.Score" placeholder="请填写考试成绩"></el-input-number>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="培训日期" prop="TrainTime">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="updateData.TrainTime"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="选择培训日期"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="addDialog = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addOrUpdate()" :loading="addLoading">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <el-dialog title="上传文件" :close-on-click-modal="false" width="600px" :visible.sync="uploadshow">
|
|
|
|
|
+ <el-form label-width="100px">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-upload :limit="1" style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
|
|
+ :http-request="uploadrequest" :before-remove="beforeRemove" :before-upload="beforeAvatarUpload">
|
|
|
|
|
+ <el-button size="mini" type="primary">点击上传</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-button style="float: right;" size="mini" type="primary" @click="uploadExcel()">确定</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import hseApi from '@/api/hsescore/hsescore'
|
|
|
|
|
+import uploadajax from '@/assets/js/uploadajax.js'
|
|
|
|
|
+import {mapGetters} from "vuex"
|
|
|
|
|
+import axios from "axios";
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapGetters({
|
|
|
|
|
+ authUser: 'authUser'
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ created () {
|
|
|
|
|
+ this.getSupplierList()
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ if (this.authUser.Profile.IsCompanyUser === 1) {
|
|
|
|
|
+ this.disabled = true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ activated () {
|
|
|
|
|
+ },
|
|
|
|
|
+ data () {
|
|
|
|
|
+ const checkIdNumber = (rule, value, callback) => {
|
|
|
|
|
+ if (value === '') {
|
|
|
|
|
+ callback(new Error('请填写身份证号'))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let re1 = /(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
|
|
|
|
+ if (!re1.test(this.updateData.IdNumber)) {
|
|
|
|
|
+ callback(new Error('请输入正确格式的身份证号'))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const validDate = (rule, value, callback) => {
|
|
|
|
|
+ if (!value || !value[0] || !value[1]) {
|
|
|
|
|
+ callback(new Error('请选择培训日期'))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ disabled: false,
|
|
|
|
|
+ uploadshow: false,
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ addDialog: false,
|
|
|
|
|
+ tableLoading: false,
|
|
|
|
|
+ addLoading: false,
|
|
|
|
|
+ status: false,
|
|
|
|
|
+ importLoading: false,
|
|
|
|
|
+ entityList: [],
|
|
|
|
|
+ supplierSelectList: [], // 企业名称列表
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ SupplierId: [
|
|
|
|
|
+ {required: true, message: '请选择企业名称', trigger: 'blur'}
|
|
|
|
|
+ ],
|
|
|
|
|
+ Score: [
|
|
|
|
|
+ {required: true, message: '请填写考试成绩', trigger: 'blur'}
|
|
|
|
|
+ ],
|
|
|
|
|
+ Name: [
|
|
|
|
|
+ {required: true, message: '请填写姓名', trigger: 'blur'}
|
|
|
|
|
+ ],
|
|
|
|
|
+ TrainTime: [
|
|
|
|
|
+ {required: true, validator: validDate, trigger: 'blur'}
|
|
|
|
|
+ ],
|
|
|
|
|
+ IdNumber: [
|
|
|
|
|
+ {required: true, validator: checkIdNumber, trigger: 'change'}
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ currentPage: 1,
|
|
|
|
|
+ currentItemCount: 0,
|
|
|
|
|
+ searchForm: {
|
|
|
|
|
+ AccessCardNo: '',
|
|
|
|
|
+ SupplierName: '',
|
|
|
|
|
+ CommercialNo: '',
|
|
|
|
|
+ ApplyTime: '',
|
|
|
|
|
+ IdNumber: '',
|
|
|
|
|
+ Name: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ updateData: {
|
|
|
|
|
+ SupplierId: '',
|
|
|
|
|
+ Name: '',
|
|
|
|
|
+ IdNumber: '',
|
|
|
|
|
+ Score: 0,
|
|
|
|
|
+ TrainTime: '',
|
|
|
|
|
+ ApplyTime: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ // 列表排序
|
|
|
|
|
+ Column: {
|
|
|
|
|
+ Order: '',
|
|
|
|
|
+ Prop: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ jstimehandle (val) {
|
|
|
|
|
+ if (val === '' || val === '0001-01-01T08:00:00+08:00' || val === '0001-01-01T00:00:00Z') {
|
|
|
|
|
+ return '----'
|
|
|
|
|
+ }else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
|
|
+ return '永久'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ val = val.replace('T', ' ')
|
|
|
|
|
+ return val.substring(0, 10)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 确定
|
|
|
|
|
+ addOrUpdate() {
|
|
|
|
|
+ this.$refs['EntityForm'].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ console.log(this.updateData, 'this.updateData----')
|
|
|
|
|
+ if (this.updateData.TrainTime.length === 10) {
|
|
|
|
|
+ this.updateData.TrainTime += 'T00:00:00+08:00'
|
|
|
|
|
+ }
|
|
|
|
|
+ const timeArr = this.updateData.TrainTime.split('T')
|
|
|
|
|
+ const timeArr1 = timeArr[0].split('-')
|
|
|
|
|
+ this.updateData.ApplyTime = timeArr1[0] + '-12-31T' + timeArr[1]
|
|
|
|
|
+ this.addLoading = true
|
|
|
|
|
+ if (this.status) {
|
|
|
|
|
+ hseApi.updateHSE(this.id, this.updateData, this.$axios).then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ // 刷新列表
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ this.addDialog = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ this.addLoading = false
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ hseApi.addHSE(this.updateData, this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ // 刷新列表
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ this.addDialog = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ this.addLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ importExcel() {
|
|
|
|
|
+ this.uploadshow = true
|
|
|
|
|
+ },
|
|
|
|
|
+ // 导入
|
|
|
|
|
+ uploadExcel () {
|
|
|
|
|
+ this.importLoading = true
|
|
|
|
|
+ this.uploadshow = false
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ ExcelUrl: this.Excelurl
|
|
|
|
|
+ }
|
|
|
|
|
+ hseApi.importExcel(params, this.$axios).then(res => {
|
|
|
|
|
+ this.importLoading = false
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ add() {
|
|
|
|
|
+ this.title = '新增'
|
|
|
|
|
+ this.addDialog = true
|
|
|
|
|
+ this.status = false
|
|
|
|
|
+ this.updateData.IdNumber = ''
|
|
|
|
|
+ this.updateData.Name = ''
|
|
|
|
|
+ this.updateData.Score = 0
|
|
|
|
|
+ this.updateData.SupplierId = ''
|
|
|
|
|
+ this.updateData.TrainTime = ''
|
|
|
|
|
+ },
|
|
|
|
|
+ update(row) {
|
|
|
|
|
+ this.title = '修改'
|
|
|
|
|
+ this.addDialog = true
|
|
|
|
|
+ this.status = true
|
|
|
|
|
+ this.updateData.TrainTime = row.TrainTime
|
|
|
|
|
+ this.updateData.SupplierId = row.SupplierId
|
|
|
|
|
+ this.updateData.Score = row.Score
|
|
|
|
|
+ this.updateData.IdNumber = row.IdNumber
|
|
|
|
|
+ this.updateData.Name = row.Name
|
|
|
|
|
+ this.id = row.Id
|
|
|
|
|
+ },
|
|
|
|
|
+ deleteRow(id) {
|
|
|
|
|
+ this.$confirm('确定删除?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ hseApi.deleteHSE(id, this.$axios).then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ // 刷新列表
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ openCompanyInfo (row) {
|
|
|
|
|
+ if (!row.CertId) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '企业未准入,无法显示详细信息'
|
|
|
|
|
+ })
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (row.SupplierTypeCode === '01') { // 物资类
|
|
|
|
|
+ this.$router.push('/oilsupplier/supplier/' + row.Id + '/goodsedit?certid=' + row.CertId + '&showcy=true')
|
|
|
|
|
+ } else if (row.SupplierTypeCode === '02') { // 基建类
|
|
|
|
|
+ this.$router.push('/oilsupplier/supplier/' + row.Id + '/basisedit?certid=' + row.CertId + '&showcy=true')
|
|
|
|
|
+ } else if (row.SupplierTypeCode === '03') { // 服务类
|
|
|
|
|
+ this.$router.push('/oilsupplier/supplier/' + row.Id + '/techedit?certid=' + row.CertId + '&showcy=true')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onSelect (e) {
|
|
|
|
|
+ var list = []
|
|
|
|
|
+ e.map((item, index) => {
|
|
|
|
|
+ list.push(item.CertId)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.selectedCertIdList = String(list)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 列表排序功能
|
|
|
|
|
+ orderby (column) {
|
|
|
|
|
+ if (column.order === 'ascending') {
|
|
|
|
|
+ this.Column.Order = 'asc'
|
|
|
|
|
+ } else if (column.order === 'descending') {
|
|
|
|
|
+ this.Column.Order = 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ this.Column.Prop = column.prop
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 初始化列表方法
|
|
|
|
|
+ initDatas (event) {
|
|
|
|
|
+ if (event != null) {
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ }
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ size: this.size,
|
|
|
|
|
+ currentPage: this.currentPage,
|
|
|
|
|
+ Order: this.Column.Order,
|
|
|
|
|
+ Prop: this.Column.Prop
|
|
|
|
|
+ }
|
|
|
|
|
+ // 查询条件
|
|
|
|
|
+ Object.assign(params, this.searchForm)
|
|
|
|
|
+ this.tableLoading = true
|
|
|
|
|
+ console.log(params, 'params----')
|
|
|
|
|
+ hseApi.getHSEList(params, this.$axios).then(res => {
|
|
|
|
|
+ this.entityList = res.data.items
|
|
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
|
|
+ this.tableLoading = false
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ this.tableLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getSupplierList() {
|
|
|
|
|
+ hseApi.getSupplierList(this.$axios).then(res => {
|
|
|
|
|
+ this.supplierSelectList = res.data.items
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 分页方法
|
|
|
|
|
+ handleCurrentChange (value) {
|
|
|
|
|
+ this.currentPage = value
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSizeChange (value) {
|
|
|
|
|
+ this.size = value
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ },
|
|
|
|
|
+ searchCommand (command) {
|
|
|
|
|
+ if (command === 'search') {
|
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
|
+ } else if (command === 'clear') {
|
|
|
|
|
+ this.clearSearch()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ clearSearch () {
|
|
|
|
|
+ Object.assign(this.searchForm, this.searchFormReset)
|
|
|
|
|
+ if (process.client) {
|
|
|
|
|
+ window.localStorage.setItem('companySearchParams', '')
|
|
|
|
|
+ }
|
|
|
|
|
+ this.CityAry = []
|
|
|
|
|
+ this.SetupTime = ''
|
|
|
|
|
+ this.auditorg = ''
|
|
|
|
|
+ this.selectDept = ''
|
|
|
|
|
+ this.OperType = ''
|
|
|
|
|
+ this.hidden = true
|
|
|
|
|
+ this.Grade = ''
|
|
|
|
|
+ this.LinkCityAry = []
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeRemove () {
|
|
|
|
|
+ this.Excelurl = ''
|
|
|
|
|
+ return true
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeAvatarUpload (file) {
|
|
|
|
|
+ if (file.name.indexOf('.xlsx') < 0) {
|
|
|
|
|
+ this.$message.error({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ message: '文件格式必须为.xlsx'
|
|
|
|
|
+ })
|
|
|
|
|
+ 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}`
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(option)
|
|
|
|
|
+ uploadajax(option)
|
|
|
|
|
+ _this.Excelurl = option.action
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '未上传成功!请刷新界面重新上传!'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(res => {
|
|
|
|
|
+ console.log(res, 'error')
|
|
|
|
|
+ _this.$message({
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '未上传成功!请重新上传!'
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ formatDateTime (date) {
|
|
|
|
|
+ var y = date.getFullYear()
|
|
|
|
|
+ var m = date.getMonth() + 1
|
|
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
|
|
+ var d = date.getDate()
|
|
|
|
|
+ d = d < 10 ? ('0' + d) : d
|
|
|
|
|
+ var h = date.getHours()
|
|
|
|
|
+ var minute = date.getMinutes()
|
|
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute
|
|
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style>
|
|
|
|
|
+.eldialog .el-input__inner {
|
|
|
|
|
+ border: none;
|
|
|
|
|
+}
|
|
|
|
|
+.eldialog .el-textarea__inner {
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ resize: none;
|
|
|
|
|
+ height: 70px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|
|
|
|
|
+
|