2
3
Эх сурвалжийг харах

前端: 目录管理、查询模块 申请备案字段改为业务范围、分页条数更新,有效期起止改为有效期止

baichengfei 5 жил өмнө
parent
commit
4ffc418503

+ 174 - 37
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalog/income.vue

@@ -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>
+            &nbsp;
+            <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) {

+ 40 - 41
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalog/index.vue

@@ -51,30 +51,17 @@
       <el-table :data="entityList" border highlight-current-row 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="操作" min-width="100px" 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 width="200" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
+        <el-table-column sortable 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 width="175" align="center" show-overflow-tooltip label="有效期起止">
+        <el-table-column sortable width="125" align="center" show-overflow-tooltip label="有效期至">
           <template slot-scope="scope">
-            {{(jstimehandle(scope.row.ValidityFrom))}}--{{(jstimehandle(scope.row.ValidityTo))}}
+            {{(jsTimeHandle(scope.row.ValidityTo))}}
           </template>
         </el-table-column>
         <el-table-column sortable min-width="90" align="center" :key="Math.random()" v-if="formData.CatalogType == 4 || formData.CatalogType == 5" show-overflow-tooltip prop="DutyDept" label="责任部室"></el-table-column>
@@ -83,7 +70,7 @@
 
       </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="addShowTitle"
@@ -97,9 +84,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="有效期" prop="ValidityDate" >
-              <el-date-picker style="width: 100%" v-model="ValidityDate" type="daterange" range-separator="至"
-                              start-placeholder="有效期起" end-placeholder="有效期止" :readonly="!showBtn"></el-date-picker>
+            <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">
@@ -196,7 +182,6 @@
 
         // 查询时间
         CreateOn: null,
-        ValidityDate: null,
 
         // 列表数据
         entityList: [],
@@ -212,12 +197,6 @@
           Business: ''
 
         },
-        rules: {
-          ValidityDate: [{
-            validator: validDate,
-            trigger: 'blur'
-          }]
-        },
         formData: {
           Id: '',
           CatalogType: '',
@@ -234,7 +213,6 @@
     },
     watch: {
       $route (val) {
-        console.log('值啥啥啥', val)
         this.formData.CatalogType = parseInt(val.query.catalogType)
         if (val.query.catalogType === '1') {
           this.cardTitle = '自建项目'
@@ -388,25 +366,19 @@
         this.formData.CompanyName = ''
         this.formData.Business = ''
         this.formData.Remark = ''
-        this.ValidityDate = null
+        this.ValidityTo = null
       },
-      editOilcatalog (row) {
+      editOilCataLog (row) {
         this.addshow = true
         this.formData.Id = row.Id
         this.formData.CatalogType = row.CatalogType
         this.formData.CompanyName = row.CompanyName
         this.formData.Business = row.Business
+        this.formData.DutyDept = row.DutyDept
+        this.formData.ValidityTo = row.ValidityTo
         this.formData.Remark = row.Remark
-        this.ValidityDate = [new Date(row.ValidityFrom), new Date(row.ValidityTo)]
       },
       saveOilcatalog () {
-        if (this.ValidityDate && this.ValidityDate.length === 2) {
-          this.ValidityDate[1].setHours(23)
-          this.ValidityDate[1].setMinutes(59)
-          this.ValidityDate[1].setSeconds(59)
-          this.formData.ValidityFrom = this.ValidityDate[0]
-          this.formData.ValidityTo = this.ValidityDate[1]
-        }
         if (this.formData.Id > 0) {
           this.editEntity()
         } else {
@@ -526,6 +498,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) {
@@ -545,11 +542,13 @@
         })
       },
 
-      jstimehandle (val) {
+      jsTimeHandle (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 {

+ 27 - 76
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalogselect/income.vue

@@ -42,27 +42,31 @@
           </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="操作" min-width="100px" align="center" fixed="right">
           <template slot-scope="scope">
             <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>查看</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"
@@ -107,9 +111,14 @@
               <el-input v-model="formData.Dept" :min="1" placeholder="" readonly style="width: 100%"></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></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}" readonly style="width: 100%"></el-input>
+            <el-form-item label="业务范围" prop="Business">
+              <el-input v-model="formData.Business"  type="textarea" :autosize="{ minRows: 3}" readonly style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -148,7 +157,7 @@
         showBtn: false,
         cardTitle: '收入业务',
         catalogType: '',
-        addShowTitle: '添加目录',
+        addShowTitle: '查看目录',
         addshow: false,
         loading: false,
 
@@ -187,6 +196,7 @@
           RecordScope: '',
           IDCode: '',
           Business: '',
+          Dept: '',
           Remark: '',
           Status: '',
           FirstAudit: '',
@@ -258,14 +268,6 @@
           }
         })
       },
-      addOilcatalog () {
-        this.addshow = true
-        this.formData.Id = ''
-        this.formData.CompanyName = ''
-        this.formData.Business = ''
-        this.formData.Remark = ''
-        this.ValidityDate = null
-      },
       editOilcatalog (val) {
         this.addshow = true
         this.formData.Id = val.Id
@@ -276,68 +278,15 @@
         this.formData.Address = val.Address
         this.formData.USCCode = val.USCCode
         this.formData.RegCapital = val.RegCapital
+        this.formData.Dept = val.Dept
+        this.formData.DutyDept = val.DutyDept
         this.formData.RecordScope = val.RecordScope
         this.formData.IDCode = val.IDCode
         this.formData.Business = val.Business
         this.formData.ProcessKey = val.ProcessKey
         this.formData.Status = val.Status
-        this.ValidityDate = [new Date(val.ValidityFrom), new Date(val.ValidityTo)]
-      },
-      saveOilcatalog () {
-        if (this.ValidityDate && this.ValidityDate.length === 2) {
-          this.ValidityDate[1].setHours(23)
-          this.ValidityDate[1].setMinutes(59)
-          this.ValidityDate[1].setSeconds(59)
-          this.formData.ValidityFrom = this.ValidityDate[0]
-          this.formData.ValidityTo = this.ValidityDate[1]
-        }
-        if (this.formData.Id > 0) {
-          this.editEntity()
-        } else {
-          this.addEntity()
-        }
-      },
-      editEntity () {
-        this.$refs['EntityForm'].validate((valid) => {
-          if (valid) {
-            api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.addshow = false
-                this.initDatas()
-              } else {
-                this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-          }
-        })
-      },
-      addEntity () {
-        this.$refs['EntityForm'].validate((valid) => {
-          if (valid) {
-            api.addEntity(this.formData, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.addshow = false
-                this.initDatas()
-              } else {
-                this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-          }
-        })
+        this.formData.Remark = val.Remark
+        this.formData.ValidityTo = val.ValidityTo
       },
       initDatas () {
         // 分页及列表条件
@@ -346,8 +295,7 @@
           _size: this.size,
           Order: this.Column.Order,
           Prop: this.Column.Prop,
-          CatalogType: this.formData.CatalogType,
-          Status: '2'
+          CatalogType: this.formData.CatalogType
         }
         let myCreateOn = []
         // 解析时间
@@ -426,11 +374,14 @@
         })
       },
 
-      jstimehandle (val) {
+      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 {

+ 15 - 189
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalogselect/index.vue

@@ -49,17 +49,16 @@
       <el-table :data="entityList" border highlight-current-row 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="操作" min-width="60px" align="center" fixed="right">
           <template slot-scope="scope">
-            <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>查看</el-button>
+            <el-button type="primary" size="mini" @click="editOilCataLog(scope.row)" plain>查看</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 width="200" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
+        <el-table-column sortable 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 width="175" align="center" show-overflow-tooltip label="有效期起止">
+        <el-table-column sortable width="125" align="center" show-overflow-tooltip label="有效期至">
           <template slot-scope="scope">
-            {{(jstimehandle(scope.row.ValidityFrom))}}--{{(jstimehandle(scope.row.ValidityTo))}}
+            {{(jsTimeHandle(scope.row.ValidityTo))}}
           </template>
         </el-table-column>
         <el-table-column sortable min-width="90" align="center" :key="Math.random()" v-if="formData.CatalogType == 4 || formData.CatalogType == 5" show-overflow-tooltip prop="DutyDept" label="责任部室"></el-table-column>
@@ -67,7 +66,7 @@
 
       </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="addShowTitle"
@@ -81,9 +80,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="有效期" prop="ValidityDate" >
-              <el-date-picker style="width: 100%" v-model="ValidityDate" type="daterange" range-separator="至"
-                              start-placeholder="有效期起" end-placeholder="有效期止" readonly></el-date-picker>
+            <el-form-item label="有效期至" prop="ValidityTo" >
+              <el-date-picker style="width: 100%" v-model="formData.ValidityTo" type="date" placeholder="有效期截止时间" readonly></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -115,33 +113,11 @@
         </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>
-    <el-dialog title="导入完成" :visible.sync="errorDialogVisible" :close-on-click-modal = "false" width="720px">
-      <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea"></el-input>
-    </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: {
       ...mapGetters({
@@ -158,7 +134,7 @@
         showBtn: false,
         cardTitle: '',
         catalogType: '',
-        addShowTitle: '添加目录',
+        addShowTitle: '查看目录',
         addshow: false,
         loading: false,
         uploadshow: false,
@@ -172,7 +148,6 @@
 
         // 查询时间
         CreateOn: null,
-        ValidityDate: null,
 
         // 列表数据
         entityList: [],
@@ -196,7 +171,6 @@
           Business: '',
           DutyDept: '', // 责任部室
           Dept: '', // 申报单位
-          ValidityFrom: null,
           ValidityTo: null,
           Remark: ''
         }
@@ -204,7 +178,6 @@
     },
     watch: {
       $route (val) {
-        console.log('值啥啥啥', val)
         this.formData.CatalogType = parseInt(val.query.catalogType)
         if (val.query.catalogType === '1') {
           this.cardTitle = '自建项目'
@@ -244,74 +217,6 @@
     },
 
     methods: {
-      // excel导入
-      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
-            })
-          }
-        })
-      },
-
       isAccess () {
         let params = {
           RoleId: '10000203'
@@ -352,78 +257,16 @@
           }
         })
       },
-      addOilcatalog () {
-        this.addshow = true
-        this.formData.Id = ''
-        this.formData.CompanyName = ''
-        this.formData.Business = ''
-        this.formData.Remark = ''
-        this.ValidityDate = null
-      },
-      editOilcatalog (row) {
+      // 查看
+      editOilCataLog (row) {
         this.addshow = true
         this.formData.Id = row.Id
         this.formData.CatalogType = row.CatalogType
         this.formData.CompanyName = row.CompanyName
         this.formData.Business = row.Business
+        this.formData.DutyDept = row.DutyDept
         this.formData.Remark = row.Remark
-        this.ValidityDate = [new Date(row.ValidityFrom), new Date(row.ValidityTo)]
-      },
-      saveOilcatalog () {
-        if (this.ValidityDate && this.ValidityDate.length === 2) {
-          this.ValidityDate[1].setHours(23)
-          this.ValidityDate[1].setMinutes(59)
-          this.ValidityDate[1].setSeconds(59)
-          this.formData.ValidityFrom = this.ValidityDate[0]
-          this.formData.ValidityTo = this.ValidityDate[1]
-        }
-        if (this.formData.Id > 0) {
-          this.editEntity()
-        } else {
-          this.addEntity()
-        }
-      },
-      editEntity () {
-        this.$refs['EntityForm'].validate((valid) => {
-          if (valid) {
-            api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.addshow = false
-                this.initDatas()
-              } else {
-                this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-          }
-        })
-      },
-      addEntity () {
-        this.$refs['EntityForm'].validate((valid) => {
-          if (valid) {
-            api.addEntity(this.formData, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.addshow = false
-                this.initDatas()
-              } else {
-                this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-          }
-        })
+        this.formData.ValidityTo = row.ValidityTo
       },
       initDatas () {
         // 分页及列表条件
@@ -496,30 +339,13 @@
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity (row) {
-        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) {
+      jsTimeHandle (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 {

+ 8 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalogsub/_opera/incomeedit.vue

@@ -78,6 +78,11 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="申报单位" prop="Dept">
+              <el-input v-model="formData.Dept" :readonly="true" placeholder="请输入" style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item label="备注" prop="Remark">
               <el-input  type="textarea" v-model="formData.Remark"
@@ -124,7 +129,7 @@
         <el-table-column sortable width="120" align="center" show-overflow-tooltip prop="Address" label="企业注册地址"></el-table-column>
         <el-table-column sortable width="150" align="center" show-overflow-tooltip prop="USCCode" label="全国统一信用代码"></el-table-column>
         <el-table-column sortable width="100" align="center" show-overflow-tooltip prop="RegCapital" label="注册资本"></el-table-column>
-        <el-table-column sortable width="655" align="center" show-overflow-tooltip prop="RecordScope" label="申请备案范围"></el-table-column>
+        <el-table-column sortable width="655" align="center" show-overflow-tooltip prop="RecordScope" label="业务范围"></el-table-column>
         <el-table-column sortable width="100" align="center" show-overflow-tooltip prop="Remark" label="备注"></el-table-column>
 
       </el-table>
@@ -228,7 +233,7 @@
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="申请备案范围" prop="RecordScope">
+            <el-form-item label="业务范围" prop="RecordScope">
               <el-input v-model="incomeData.RecordScope"  type="textarea" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
@@ -367,13 +372,6 @@
           }
         }
       }
-      var validDate = (rule, value, callback) => {
-        if (!value || !value[0] || !value[1]) {
-          callback(new Error('请选择时间'))
-        } else {
-          callback()
-        }
-      }
 
       return {
         formDataType: '',
@@ -484,7 +482,7 @@
             { type: 'number', message: '只能输入数字', trigger: 'blur' }
           ],
           RecordScope: [
-            { required: true, message: '申请备案范围不能为空', trigger: 'blur' }
+            { required: true, message: '业务范围不能为空', trigger: 'blur' }
           ]
         },
         rules1: {
@@ -506,7 +504,6 @@
         this.formDataType = '收入业务'
         this.cardType = '7'
       }
-      console.log(this.$route.query.type, 'params.opera')
       Object.assign(this.incomeDataTmp, this.incomeData)
       this.formData.SubmitterId = this.authUser.Profile.Id
       this.formData.Submitter = this.authUser.Profile.Realname
@@ -831,7 +828,6 @@
         })
       },
       addEntity () {
-        console.log(this.formData, '参数')
         api.addEntity(this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
             this.formData.Id = res.data.item