|
|
@@ -38,45 +38,42 @@
|
|
|
</el-dropdown>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
+ <router-link :to="'/oilsupplier/oilcatalogsub/add/incomeedit?type='+formData.CatalogType">
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="formData.CatalogType == '7' || formData.CatalogType == '6'">申请</el-button>
|
|
|
+ </router-link>
|
|
|
+
|
|
|
+ <el-button type="primary" size="mini" @click="addOilCataLog" v-if="showBtn">添加</el-button>
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="importExcel" v-if="showBtn">导入</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading" :header-cell-style="{'text-align': 'center'}">
|
|
|
+ <el-table :data="entityList" border stripe height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading" :header-cell-style="{'text-align': 'center'}">
|
|
|
<el-table-column label="操作" width="180px" align="center" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>{{btnName}}</el-button>
|
|
|
- <el-popover placement="top" title="提示">
|
|
|
- <el-alert
|
|
|
- title=""
|
|
|
- description="确认要删除吗?"
|
|
|
- type="warning"
|
|
|
- :closable="false">
|
|
|
- </el-alert>
|
|
|
- <br/>
|
|
|
- <div style="text-align: right; margin: 0">
|
|
|
- <el-button type="danger" size="mini" @click="deleteEntity(scope.row)">删除</el-button>
|
|
|
- </div>
|
|
|
- <el-button slot="reference" type="danger" title="删除" style="margin-left:10px" size="mini" plain v-if="showBtn">删除</el-button>
|
|
|
- </el-popover>
|
|
|
+ <el-button type="primary" size="mini" @click="editOilCataLog(scope.row)" plain>{{btnName}}</el-button>
|
|
|
+ <el-button slot="reference" type="danger" title="删除" style="margin-left:10px" size="mini" @click="deleteClick(scope.row)" plain :disabled="!showBtn">删除</el-button>
|
|
|
</template>
|
|
|
-
|
|
|
</el-table-column>
|
|
|
<el-table-column type="index" width="50" align="center" />
|
|
|
- <!--<el-table-column sortable min-width="80" align="center" show-overflow-tooltip prop="SupplierName" label="序号"></el-table-column>-->
|
|
|
- <el-table-column sortable min-width="220" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
|
|
|
+ <el-table-column sortable min-width="250" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
|
|
|
+ <el-table-column sortable min-width="400" align="left" prop="Business" label="业务范围"></el-table-column>
|
|
|
+ <el-table-column sortable min-width="120" align="center" prop="ValidityTo" label="有效期至">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(jsTimeHandle(scope.row.ValidityTo))}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column sortable width="100" align="center" show-overflow-tooltip prop="LegalPerson" label="法人姓名"></el-table-column>
|
|
|
<el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="IDCode" label="法人身份证号"></el-table-column>
|
|
|
<el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Address" label="企业注册地址"></el-table-column>
|
|
|
<el-table-column sortable min-width="150" align="center" show-overflow-tooltip prop="USCCode" label="全国统一信用代码"></el-table-column>
|
|
|
<el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="RegCapital" label="注册资本"></el-table-column>
|
|
|
- <el-table-column sortable min-width="300" align="left" prop="RecordScope" label="申请备案范围"></el-table-column>
|
|
|
<el-table-column sortable width="120" align="center" :key="Math.random()" v-if="formData.CatalogType == 6 || formData.CatalogType == 7" show-overflow-tooltip prop="Dept" label="申报单位"></el-table-column>
|
|
|
<el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Remark" label="备注"></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">
|
|
|
+ :page-sizes="[10, 50, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
<el-dialog :title="cardTitle"
|
|
|
@@ -108,16 +105,27 @@
|
|
|
<el-form-item label="全国统一信用代码" prop="USCCode">
|
|
|
<el-input v-model="formData.USCCode" :maxlength="255" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col><el-col :span="12">
|
|
|
- <el-form-item label="注册资金" prop="RegCapital">
|
|
|
- <el-input type="number" v-model.number="formData.RegCapital" :min="1" placeholder="请输入" style="width: 100%">
|
|
|
- <template slot="append">万元</template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="注册资金" prop="RegCapital">
|
|
|
+ <el-input type="number" v-model.number="formData.RegCapital" :min="1" placeholder="请输入" style="width: 100%">
|
|
|
+ <template slot="append">万元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="formData.CatalogType == 6 || formData.CatalogType == 7">
|
|
|
+ <el-form-item label="申报单位" prop="Dept">
|
|
|
+ <el-input v-model="formData.Dept" :maxlength="100" style="width: 100%" :readonly="!showBtn"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="有效期至" prop="ValidityTo" >
|
|
|
+ <el-date-picker style="width: 100%" v-model="formData.ValidityTo" type="date" placeholder="有效期截止时间" :readonly="!showBtn"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="申请备案范围" prop="RecordScope">
|
|
|
- <el-input v-model="formData.RecordScope" type="textarea" :autosize="{ minRow: 3}" style="width: 100%"></el-input>
|
|
|
+ <el-form-item label="业务范围" prop="Business">
|
|
|
+ <el-input v-model="formData.Business" type="textarea" :autosize="{ minRows: 3}" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -134,12 +142,28 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+ <el-dialog title="上传文件" width="600px" :visible.sync="uploadshow">
|
|
|
+ <el-form label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
+ :http-request="uploadRequest" :before-upload="beforeAvatarUpload">
|
|
|
+ <el-button size="small" 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 { mapGetters } from 'vuex'
|
|
|
import api from '@/api/oilsupplier/oilcatalog'
|
|
|
+ import axios from 'axios'
|
|
|
+ import uploadAjax from '@/assets/js/uploadajax.js'
|
|
|
|
|
|
export default {
|
|
|
computed: {
|
|
|
@@ -190,6 +214,7 @@
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
+ uploadshow: false,
|
|
|
tableLoading: false,
|
|
|
btnName: '打开',
|
|
|
showBtn: false,
|
|
|
@@ -249,7 +274,7 @@
|
|
|
{ type: 'number', message: '只能输入数字', trigger: 'blur' }
|
|
|
],
|
|
|
RecordScope: [
|
|
|
- { required: true, message: '申请备案范围不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: '业务范围不能为空', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
formData: {
|
|
|
@@ -264,6 +289,7 @@
|
|
|
RecordScope: '',
|
|
|
IDCode: '',
|
|
|
Business: '',
|
|
|
+ Dept: '',
|
|
|
Remark: '',
|
|
|
Status: '',
|
|
|
FirstAudit: '',
|
|
|
@@ -335,15 +361,87 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- addOilcatalog () {
|
|
|
+ importExcel () {
|
|
|
+ this.uploadshow = 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}`
|
|
|
+ }
|
|
|
+ uploadAjax(option)
|
|
|
+ _this.Excelurl = option.action
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未上传成功!请刷新界面重新上传!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未上传成功!请重新上传!'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeAvatarUpload (file) {
|
|
|
+ if (file.name.indexOf('.xlsx') < 0) {
|
|
|
+ this.$message.error('文件格式必须为.xlsx')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ uploadExcel () {
|
|
|
+ this.importloading = true
|
|
|
+ this.uploadshow = false
|
|
|
+ let params = {
|
|
|
+ ExcelUrl: this.Excelurl,
|
|
|
+ CatalogType: this.formData.CatalogType
|
|
|
+ }
|
|
|
+ api.importExcel(params, this.$axios).then(res => {
|
|
|
+ this.importloading = false
|
|
|
+ this.initDatas()
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ } else if (res.data.code === -1) {
|
|
|
+ this.initDatas()
|
|
|
+ this.errorDialogVisible = true
|
|
|
+ this.textarea = res.data.message
|
|
|
+ } else if (res.data.code === -2) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addOilCataLog () {
|
|
|
this.addshow = true
|
|
|
this.formData.Id = ''
|
|
|
this.formData.CompanyName = ''
|
|
|
this.formData.Business = ''
|
|
|
+ this.formData.LegalPerson = ''
|
|
|
+ this.formData.IDCode = ''
|
|
|
+ this.formData.Address = ''
|
|
|
+ this.formData.USCCode = ''
|
|
|
+ this.formData.RegCapital = ''
|
|
|
+ this.formData.Dept = ''
|
|
|
this.formData.Remark = ''
|
|
|
- this.ValidityDate = null
|
|
|
+ this.formData.ValidityTo = null
|
|
|
},
|
|
|
- editOilcatalog (val) {
|
|
|
+ editOilCataLog (val) {
|
|
|
this.addshow = true
|
|
|
this.formData.Id = val.Id
|
|
|
this.formData.SubId = val.SubId
|
|
|
@@ -357,6 +455,7 @@
|
|
|
this.formData.IDCode = val.IDCode
|
|
|
this.formData.Business = val.Business
|
|
|
this.formData.ProcessKey = val.ProcessKey
|
|
|
+ this.formData.Dept = val.Dept
|
|
|
this.formData.Status = val.Status
|
|
|
this.ValidityDate = [new Date(val.ValidityFrom), new Date(val.ValidityTo)]
|
|
|
},
|
|
|
@@ -423,8 +522,7 @@
|
|
|
_size: this.size,
|
|
|
Order: this.Column.Order,
|
|
|
Prop: this.Column.Prop,
|
|
|
- CatalogType: this.formData.CatalogType,
|
|
|
- Status: '2'
|
|
|
+ CatalogType: this.formData.CatalogType
|
|
|
}
|
|
|
let myCreateOn = []
|
|
|
// 解析时间
|
|
|
@@ -447,7 +545,21 @@
|
|
|
this.tableLoading = false
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ jsTimeHandle (val) {
|
|
|
+ console.log('时间', val)
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (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)
|
|
|
+ }
|
|
|
+ },
|
|
|
searchCommand (command) {
|
|
|
if (command === 'search') {
|
|
|
this.dialogVisible = true
|
|
|
@@ -484,6 +596,31 @@
|
|
|
this.currentPage = 1
|
|
|
this.initDatas()
|
|
|
},
|
|
|
+ deleteClick (row) {
|
|
|
+ this.$confirm('此操作将彻底删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
deleteEntity (row) {
|
|
|
api.deleteEntity(row.Id, this.$axios).then(res => {
|
|
|
if (res.data.code === 0) {
|