|
|
@@ -0,0 +1,357 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>上报情况</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 115px);">
|
|
|
+ <div slot="header">
|
|
|
+ <span>
|
|
|
+ <i class="icon icon-table2"></i> 上报情况
|
|
|
+ </span>
|
|
|
+ <span style="float: right;">
|
|
|
+ <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">导入</el-button> -->
|
|
|
+ <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
|
|
|
+ </span>
|
|
|
+ <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
+ <el-form-item label="单位名称">
|
|
|
+ <el-input size="mini" clearable v-model="searchForm.SupplierName" placeholder="请输入企业名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类型" style="width: 170px">
|
|
|
+ <el-select size="mini" v-model="searchForm.Evaluate" placeholder="请选择" style="width: 100px" clearable>
|
|
|
+ <el-option label="全部" value="" key="01"></el-option>
|
|
|
+ <el-option label="物资类" value="1" key="02"></el-option>
|
|
|
+ <el-option label="服务类" value="2" key="03"></el-option>
|
|
|
+ <el-option label="基建类" value="3" key="04"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="年度">
|
|
|
+ <el-select size="mini" style="width:100px" v-model="searchForm.Year" placeholder="年度">
|
|
|
+ <el-option label="全部" value=""></el-option>
|
|
|
+ <el-option v-for="(item, index) in yearList" :key="index" :label="item" :value="item" style="width: 100%"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="合同时间">
|
|
|
+ <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
|
|
|
+ start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @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>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table id="rebateSetTable" highlight-current-row stripe size="mini" :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" v-loading="tableLoading">
|
|
|
+ <el-table-column sortable show-overflow-tooltip prop="SupplierName" header-align="center" align="center" label="单位名称"></el-table-column>
|
|
|
+ <el-table-column sortable show-overflow-tooltip prop="Score" header-align="center" label="合同总数" width="150" align="center"></el-table-column>
|
|
|
+ <el-table-column sortable show-overflow-tooltip prop="Score" header-align="center" label="已上报数" width="150" align="center"></el-table-column>
|
|
|
+ <el-table-column sortable show-overflow-tooltip prop="Score" header-align="center" label="未上报数" width="150" align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[50, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ import { mapGetters } from 'vuex'
|
|
|
+ import api from '@/api/oilcontract/contractSumScore'
|
|
|
+ import permissionApi from '@/api/oilcontract/permission'
|
|
|
+ import FileSaver from 'file-saver'
|
|
|
+ import XLSX from 'xlsx'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ }),
|
|
|
+ evaluateFun: function () {
|
|
|
+ return function (item,result) {
|
|
|
+ if (result === '0') {
|
|
|
+ return '不合格'
|
|
|
+ }
|
|
|
+ var index = Number(item)
|
|
|
+ switch (index) {
|
|
|
+ case 1:
|
|
|
+ return '优秀'
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ return '合格'
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ return '不合格'
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ return '--'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ evaluateBooleanFun: function () {
|
|
|
+ return function (item) {
|
|
|
+ var index = Number(item)
|
|
|
+ if (index > 0) {
|
|
|
+ return '是'
|
|
|
+ } else {
|
|
|
+ return '否'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ name: 'oilContractReportOverAll',
|
|
|
+
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ yearList: [],
|
|
|
+ tableLoading: false,
|
|
|
+
|
|
|
+ tableWidth: '290px',
|
|
|
+ dialogVisible: false,
|
|
|
+ // 列表数据
|
|
|
+ entityList: [],
|
|
|
+ // 分页参数
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ // 列表排序
|
|
|
+ Column: {
|
|
|
+ Order: '',
|
|
|
+ Prop: ''
|
|
|
+ },
|
|
|
+ // 查询时间new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
|
|
|
+ CreateOn: [],
|
|
|
+ // 查询项
|
|
|
+ searchFormReset: {},
|
|
|
+ searchForm: {
|
|
|
+ Id: '',
|
|
|
+ SupplierId: '',
|
|
|
+ SupplierName: '',
|
|
|
+ Evaluate: '',
|
|
|
+ Score: '',
|
|
|
+ Score1: 0,
|
|
|
+ Score2: '',
|
|
|
+ Score3: '',
|
|
|
+ Score4: '',
|
|
|
+ Score5: '',
|
|
|
+ Score6: '',
|
|
|
+ Score7: '',
|
|
|
+ Score8: '',
|
|
|
+ Remark: '',
|
|
|
+ Year: ''
|
|
|
+ },
|
|
|
+ jurisdictionBoolean: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getYearList()
|
|
|
+ // 查询条件初始值备份
|
|
|
+ Object.assign(this.searchFormReset, this.searchForm)
|
|
|
+ // 查询列表
|
|
|
+ this.initDatas()
|
|
|
+ // this.getDictOptions()
|
|
|
+ this.permissionIsauth()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getYearList () {
|
|
|
+ let now = new Date()
|
|
|
+ let nowYear = now.getFullYear()
|
|
|
+ this.yearList = [nowYear, nowYear - 1]
|
|
|
+ },
|
|
|
+ // 判断权限
|
|
|
+ permissionIsauth () {
|
|
|
+ var data = {
|
|
|
+ percode: 'oil_contract.SumStore.Add'
|
|
|
+ }
|
|
|
+ permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.message == '有权限') {
|
|
|
+ this.jurisdictionBoolean = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('判断是否有权限', res)
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initDatas () {
|
|
|
+ this.tableLoading = true
|
|
|
+ // 分页及列表条件
|
|
|
+ // <el-option label="物资类" value="01" key="01"></el-option>
|
|
|
+ // <el-option label="基建类" value="02" key="02"></el-option>
|
|
|
+ // <el-option label="技术服务" value="03" key="03"></el-option>
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ ContractClass: '02'
|
|
|
+ }
|
|
|
+ let myCreateOn = []
|
|
|
+ // 解析时间
|
|
|
+ if (this.CreateOn.length == 2) {
|
|
|
+ this.CreateOn[1].setHours(23)
|
|
|
+ this.CreateOn[1].setMinutes(59)
|
|
|
+ this.CreateOn[1].setSeconds(59)
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
|
|
|
+ }
|
|
|
+ // 查询条件
|
|
|
+ Object.assign(params, this.searchForm)
|
|
|
+ // 访问接口
|
|
|
+ api.GetComputeList(myCreateOn.join(','), params, this.$axios).then(res => {
|
|
|
+ this.tableLoading = false
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ }).catch(err => {
|
|
|
+ this.tableLoading = false
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getDictOptions () {
|
|
|
+ api.getDictList(this.$axios).then(res => {
|
|
|
+ // this.dictOptions.customerList = res.data.items['customerList']
|
|
|
+ // this.dictOptions.projectList = res.data.items['projectList']
|
|
|
+
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ searchCommand (command) {
|
|
|
+ if (command == 'search') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ } else if (command == 'clear') {
|
|
|
+ this.clearSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 列表排序功能
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+ //
|
|
|
+ renderHeader (h, { column, $index }) {
|
|
|
+ console.log(2222, h, { column, $index })
|
|
|
+ column.minWidth = column.width
|
|
|
+ let _this = this
|
|
|
+ return h('span', [h('tableHead', column.label)])
|
|
|
+ },
|
|
|
+ clearSearch () {
|
|
|
+ Object.assign(this.searchForm, this.searchFormReset)
|
|
|
+ // this.searchForm = this.searchFormReset;
|
|
|
+ this.CreateOn = ''
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSearch () {
|
|
|
+ this.currentPage = 1
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleCurrentChange (value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSizeChange (value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ deleteEntity (row, index) {
|
|
|
+ this.$refs['popover-' + `${index}`].doClose()
|
|
|
+ api.deleteEntity(row.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.initDatas()
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ exportExcel () {
|
|
|
+ /* generate workbook object from table */
|
|
|
+ let wb = XLSX.utils.table_to_book(
|
|
|
+ document.querySelector('#rebateSetTable')
|
|
|
+ )
|
|
|
+ /* get binary string as output */
|
|
|
+ let wbout = XLSX.write(wb, {
|
|
|
+ bookType: 'xlsx',
|
|
|
+ bookSST: true,
|
|
|
+ type: 'array'
|
|
|
+ })
|
|
|
+ try {
|
|
|
+ FileSaver.saveAs(
|
|
|
+ new Blob([wbout], {
|
|
|
+ type: 'application/octet-stream'
|
|
|
+ }),
|
|
|
+ 'SupplierUsedName.xlsx'
|
|
|
+ )
|
|
|
+ } catch (e) {
|
|
|
+ if (typeof console !== 'undefined') console.log(e, wbout)
|
|
|
+ }
|
|
|
+ return wbout
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ // 跳转评价
|
|
|
+ onNavigateScore (item) {
|
|
|
+ console.log('跳转', item)
|
|
|
+ this.$router.push({
|
|
|
+ path: '/oilcontract/contract-basis-year/' + item.SupplierId + '/operation',
|
|
|
+ query: {
|
|
|
+ year: this.searchForm.Year
|
|
|
+ // item: item
|
|
|
+ // SupplierId:item.SupplierId,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+</style>
|