Kaynağa Gözat

资质配置修改

huahaiyan 6 yıl önce
ebeveyn
işleme
69d3c61720

+ 4 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/basisbuild.go

@@ -29,14 +29,16 @@ func (this *OilBasisBuildController) GetEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
-	orderby := "Id"
-	asc := false
+	orderby := "Code"
+	asc := true
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
 	if Order != "" && Prop != "" {
 		orderby = Prop
 		if Order == "asc" {
 			asc = true
+		}else {
+			asc = false
 		}
 	}
 

+ 9 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -28,14 +28,16 @@ func (this *OilGoodsAptitudeController) GetEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
-	orderby := "Id"
-	asc := false
+	orderby := "Code"
+	asc := true
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
 	if Order != "" && Prop != "" {
 		orderby = Prop
 		if Order == "asc" {
 			asc = true
+		}else {
+			asc = false
 		}
 	}
 
@@ -43,6 +45,7 @@ func (this *OilGoodsAptitudeController) GetEntityList() {
 	Code := this.GetString("Code")
 	Name := this.GetString("Name")
 	BigClassName := this.GetString("BigClassName")
+	BigClassCode := this.GetString("BigClassCode")
 	MiddleClassName := this.GetString("MiddleClassName")
 	SmallClassName := this.GetString("SmallClassName")
 	GoodsName := this.GetString("GoodsName")
@@ -63,6 +66,10 @@ func (this *OilGoodsAptitudeController) GetEntityList() {
 		where = where + " and Name1 like '%" + BigClassName + "%'"
 	}
 
+	if BigClassCode != "" {
+		where = where + " and Code1 like '%" + BigClassCode + "%'"
+	}
+
 	if MiddleClassName != "" {
 		where = where + " and Name2 like '%" + MiddleClassName + "%'"
 	}

+ 4 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -30,14 +30,16 @@ func (this *OilTechnologyServiceController) GetEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
-	orderby := "Id"
-	asc := false
+	orderby := "Code"
+	asc := true
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
 	if Order != "" && Prop != "" {
 		orderby = Prop
 		if Order == "asc" {
 			asc = true
+		}else {
+			asc = false
 		}
 	}
 	CreateOn := this.GetString("CreateOn")

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/basisdataopera.vue

@@ -56,7 +56,7 @@
         </el-card>
         <!-- 增项分类列表 -->
         <el-card class="box-card" style="margin-top: 10px;">
-          <el-table :data="entityList" border style="width: 100%" @sort-change="orderby">
+          <el-table :data="entityList" size="mini" border style="width: 100%" @sort-change="orderby">
             <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></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>
@@ -67,7 +67,7 @@
           <div slot="header" class="clearfix">
             <span><i class="icon icon-table2"></i> 企业资质</span>
           </div>
-          <el-table :data="subfileList" border>
+          <el-table :data="subfileList" size="mini" border>
             <el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></el-table-column>
             <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
               <template slot-scope="scope">

+ 71 - 45
src/dashoo.cn/frontend_web/src/pages/oilsupplier/basisbuild/index.vue

@@ -13,6 +13,8 @@
           <router-link :to="'/oilsupplier/basisbuild/add/operation'">
             <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
           </router-link>
+          <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="上报时间">
@@ -31,7 +33,8 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+      <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)" style="width: 100%"
+        @sort-change="orderby">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/basisbuild/' + scope.row.Id + '/operation'">
@@ -47,30 +50,30 @@
               </el-dropdown-menu>
             </el-dropdown>
             <!--<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="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
-              <!--</div>-->
-              <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--<el-alert-->
+            <!--title=""-->
+            <!--description="确认要删除吗?"-->
+            <!--type="warning"-->
+            <!--:closable="false">-->
+            <!--</el-alert>-->
+            <!--<br/>-->
+            <!--<div style="text-align: right; margin: 0">-->
+            <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
+            <!--</div>-->
+            <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
             <!--</el-popover>-->
           </template>
         </el-table-column>
 
-        <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable
-          :min-width="column.width" :label="column.label" :key="column.Id" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :min-width="column.width"
+          :label="column.label" :key="column.Id" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
         </el-table-column>
         <!--动态显示的表头-->
-        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable
-          :width="300" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable :width="300"
+          :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
@@ -122,17 +125,14 @@
         <el-col :span="12">
           审批步骤:
           <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
-            <el-option
-              v-for="item in AuditStepOptions"
-              :key="item.Id"
-              :label="item.Key"
-              :value="item.Value">
+            <el-option v-for="item in AuditStepOptions" :key="item.Id" :label="item.Key" :value="item.Value">
             </el-option>
           </el-select>
         </el-col>
         <el-col :span="12">
           审批部门:
-          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
+            ref="operationOriganizeTree">
           </el-tree>
         </el-col>
       </el-row>
@@ -150,6 +150,8 @@
   } from 'vuex'
   import api from '@/api/oilsupplier/basisbuild'
   import setapi from '@/api/oilsupplier/oilclassorgset'
+  import FileSaver from "file-saver";
+  import XLSX from "xlsx";
 
   export default {
     computed: {
@@ -159,7 +161,7 @@
     },
     name: 'oilbasisbuild',
 
-    data () {
+    data() {
       return {
         deptsetVisible: false,
         dialogVisible: false,
@@ -231,7 +233,7 @@
           AuditStepCode: '',
           AuditStepName: ''
         },
-        dynamicTableColumns:[],
+        dynamicTableColumns: [],
         tableColumns: [
 
           {
@@ -244,7 +246,7 @@
           {
             prop: 'Name',
             label: '名称',
-            width: 100,
+            width: 260,
             sort: true
           }
         ],
@@ -257,7 +259,7 @@
         AuditStepOptions: []
       }
     },
-    created () {
+    created() {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
       this.initTableHeader()
@@ -266,13 +268,13 @@
       this.getDictOptions()
     },
     methods: {
-       initTableHeader(){ 
+      initTableHeader() {
         setapi.initBbTableHeader(this.$axios).then(res => {
           console.log(res)
-          this.dynamicTableColumns=res.data.items
+          this.dynamicTableColumns = res.data.items
         })
       },
-      saveApprovalDept () {
+      saveApprovalDept() {
         let organizeids = []
         let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
         organize.forEach(row => {
@@ -297,7 +299,7 @@
           console.log(err)
         })
       },
-      deptSet (val) {
+      deptSet(val) {
         let stcode = this.setForm.SupplierTypeCode
         this.deptsetVisible = true
         this.selecteclassid = val.Id
@@ -316,20 +318,20 @@
             console.log(err)
           })
       },
-      MoreCmdClick (cmd) {
+      MoreCmdClick(cmd) {
         if (cmd.Command === 'Set') {
           this.deptSet(cmd.row)
         } else if (cmd.Command === 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
-      GetCommand (cmdType, row) {
+      GetCommand(cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
-      initDatas () {
+      initDatas() {
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -339,7 +341,7 @@
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn!=null&&this.CreateOn.length === 2) {
+        if (this.CreateOn != null && this.CreateOn.length === 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)
@@ -357,7 +359,7 @@
         })
       },
 
-      getDictOptions () {
+      getDictOptions() {
         api.getDictList(this.$axios).then(res => {
           // this.dictOptions.customerList = res.data.items['customerList']
           // this.dictOptions.projectList = res.data.items['projectList']
@@ -366,8 +368,31 @@
           console.error(err)
         })
       },
+      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"
+            }),
+            "BasisBuild.xlsx"
+          );
+        } catch (e) {
+          if (typeof console !== "undefined") console.log(e, wbout);
+        }
+        return wbout;
+      },
 
-      searchCommand (command) {
+      searchCommand(command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -375,7 +400,7 @@
         }
       },
       // 列表排序功能
-      orderby (column) {
+      orderby(column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -384,27 +409,27 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch () {
+      clearSearch() {
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch () {
+      handleSearch() {
         this.currentPage = 1
         this.dialogVisible = false
         this.initDatas()
       },
-      handleCurrentChange (value) {
+      handleCurrentChange(value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange (value) {
+      handleSizeChange(value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity (row) {
+      deleteEntity(row) {
         this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -431,7 +456,7 @@
         })
       },
 
-      transferStr (val) {
+      transferStr(val) {
         if (val === '1') {
           return '是'
         }
@@ -442,7 +467,7 @@
         }
       },
 
-      jstimehandle (val) {
+      jstimehandle(val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -455,7 +480,7 @@
         }
       },
 
-      formatDateTime (date) {
+      formatDateTime(date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -468,4 +493,5 @@
       }
     }
   }
+
 </script>

+ 88 - 55
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/index.vue

@@ -13,6 +13,8 @@
           <router-link :to="'/oilsupplier/goodsaptitude/add/operation'">
             <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
           </router-link>
+          <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">
 
@@ -33,7 +35,8 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+      <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)" style="width: 100%"
+        @sort-change="orderby">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/goodsaptitude/' + scope.row.Id + '/operation'">
@@ -49,34 +52,34 @@
               </el-dropdown-menu>
             </el-dropdown>
             <!--<el-button size="small" type="text" style="margin-left:3px" title="审批部门" @click="deptSet(scope.row)">-->
-              <!--<i class="icon icon-users"></i>-->
+            <!--<i class="icon icon-users"></i>-->
             <!--</el-button>-->
             <!--<el-popover placement="top" title="提示" v-model="scope.row.deleteConfirmFlag">-->
-              <!--<el-alert-->
-                <!--title=""-->
-                <!--description="确认要删除吗?"-->
-                <!--type="warning"-->
-                <!--:closable="false">-->
-              <!--</el-alert>-->
-              <!--<br/>-->
-              <!--<div style="text-align: right; margin: 0">-->
-                <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
-              <!--</div>-->
-              <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--<el-alert-->
+            <!--title=""-->
+            <!--description="确认要删除吗?"-->
+            <!--type="warning"-->
+            <!--:closable="false">-->
+            <!--</el-alert>-->
+            <!--<br/>-->
+            <!--<div style="text-align: right; margin: 0">-->
+            <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
+            <!--</div>-->
+            <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
             <!--</el-popover>-->
           </template>
         </el-table-column>
 
-        <el-table-column v-for="column in tableColumns"  :prop="column.prop" sortable
-          :width="column.width" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :width="column.width"
+          :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
         </el-table-column>
 
         <!--动态显示的表头-->
-        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable
-          :width="300" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable :width="320"
+          :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
@@ -89,7 +92,7 @@
         </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"
+        :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount">
       </el-pagination>
     </el-card>
@@ -123,6 +126,12 @@
             </el-form-item>
           </el-col>
 
+          <el-col :span="12">
+            <el-form-item label="大类编码">
+              <el-input size="mini" v-model="searchForm.BigClassCode" style="width:100%" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+
           <el-col :span="12">
             <el-form-item label="中类名称">
               <el-input size="mini" v-model="searchForm.MiddleClassName" style="width:100%" placeholder="请输入">
@@ -175,19 +184,16 @@
     <el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
       <el-row>
         <el-col :span="12">
-            审批步骤:
-            <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
-              <el-option
-                v-for="item in AuditStepOptions"
-                :key="item.Id"
-                :label="item.Key"
-                :value="item.Value">
-              </el-option>
-            </el-select>
+          审批步骤:
+          <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
+            <el-option v-for="item in AuditStepOptions" :key="item.Id" :label="item.Key" :value="item.Value">
+            </el-option>
+          </el-select>
         </el-col>
         <el-col :span="12">
           审批部门:
-          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
+            ref="operationOriganizeTree">
           </el-tree>
         </el-col>
       </el-row>
@@ -199,9 +205,13 @@
   </div>
 </template>
 <script>
-  import { mapGetters } from 'vuex'
+  import {
+    mapGetters
+  } from 'vuex'
   import api from '@/api/oilsupplier/goodsaptitude'
   import setapi from '@/api/oilsupplier/oilclassorgset'
+  import FileSaver from "file-saver";
+  import XLSX from "xlsx";
 
   export default {
     computed: {
@@ -211,7 +221,7 @@
     },
     name: 'oilgoodsaptitude',
 
-    data () {
+    data() {
       return {
         classid: '',
         deptsetVisible: false,
@@ -236,6 +246,7 @@
           Code: '',
           Name: '',
           BigClassName: '',
+          BigClassCode: '',
           MiddleClassName: '',
           SmallClassName: '',
           GoodsName: '',
@@ -405,7 +416,7 @@
           }
 
         ],
-        dynamicTableColumns:[],
+        dynamicTableColumns: [],
         organizeProps: {
           value: 'id',
           label: 'name',
@@ -415,10 +426,10 @@
         AuditStepOptions: []
       }
     },
-    created () {
+    created() {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
-       //初始化部分表头
+      //初始化部分表头
       this.initTableHeader()
 
       // 查询列表
@@ -427,14 +438,35 @@
       this.getDictOptions()
     },
     methods: {
-      initTableHeader(){
+      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" }),
+          "Goods.xlsx"
+        );
+      } catch (e) {
+        if (typeof console !== "undefined") console.log(e, wbout);
+      }
+      return wbout;
+    },
+      initTableHeader() {
 
         setapi.initGoodTableHeader(this.$axios).then(res => {
           console.log(res)
-          this.dynamicTableColumns=res.data.items
+          this.dynamicTableColumns = res.data.items
         })
       },
-      saveApprovalDept () {
+      saveApprovalDept() {
         let organizeids = []
         let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
         organize.forEach(row => {
@@ -460,7 +492,7 @@
           console.log(err)
         })
       },
-      deptSet (val) {
+      deptSet(val) {
         let stcode = this.setForm.SupplierTypeCode
         this.deptsetVisible = true
         this.selecteclassid = val.Id
@@ -480,7 +512,7 @@
             console.log(err)
           })
       },
-      initDatas () {
+      initDatas() {
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -491,18 +523,16 @@
         let myCreateOn = []
         // 解析时间
 
-        if (this.CreateOn!=null&&this.CreateOn.length === 2) {
+        if (this.CreateOn != null && 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]))
         }
-         console.log(myCreateOn)
         // 查询条件
         Object.assign(params, this.searchForm)
         // 访问接口
-        console.log("dasdasdasd")
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -511,7 +541,7 @@
         })
       },
 
-      getDictOptions () {
+      getDictOptions() {
         api.getDictList(this.$axios).then(res => {
           this.AuditStepOptions = res.data.items['AuditStep']
           // this.dictOptions.customerList = res.data.items['customerList']
@@ -521,21 +551,21 @@
         })
       },
 
-      MoreCmdClick (cmd) {
+      MoreCmdClick(cmd) {
         if (cmd.Command === 'Set') {
           this.deptSet(cmd.row)
         } else if (cmd.Command === 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
-      GetCommand (cmdType, row) {
+      GetCommand(cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
 
-      searchCommand (command) {
+      searchCommand(command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -543,7 +573,7 @@
         }
       },
       // 列表排序功能
-      orderby (column) {
+      orderby(column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -552,27 +582,27 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch () {
+      clearSearch() {
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch () {
+      handleSearch() {
         this.currentPage = 1
         this.dialogVisible = false
         this.initDatas()
       },
-      handleCurrentChange (value) {
+      handleCurrentChange(value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange (value) {
+      handleSizeChange(value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity (row) {
+      deleteEntity(row) {
         // row.deleteConfirmFlag = false
         this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -600,17 +630,18 @@
         })
       },
 
-      transferStr (val) {
+      transferStr(val) {
         if (val === '1') {
           return '是'
-        } if (val === '0') {
+        }
+        if (val === '0') {
           return ''
         } else {
           return val
         }
       },
 
-      jstimehandle (val) {
+      jstimehandle(val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -623,7 +654,7 @@
         }
       },
 
-      formatDateTime (date) {
+      formatDateTime(date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -636,10 +667,12 @@
       }
     }
   }
+
 </script>
 
 <style>
   .el-col {
     margin-bottom: 5px;
   }
+
 </style>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierfile/index.vue

@@ -33,7 +33,7 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+      <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
         <el-table-column label="操作" min-width="100" align="center" fixed>
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/supplierfile/' + scope.row.Id + '/operation'">

+ 88 - 53
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/index.vue

@@ -13,11 +13,13 @@
           <router-link :to="'/oilsupplier/technologyservice/add/operation'">
             <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
           </router-link>
+          <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-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
-                            start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
+              start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
           </el-form-item>
 
           <el-form-item>
@@ -31,7 +33,8 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+      <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
+        style="width: 100%" @sort-change="orderby">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/technologyservice/' + scope.row.Id + '/operation'">
@@ -47,22 +50,23 @@
               </el-dropdown-menu>
             </el-dropdown>
             <!--<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="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
-              <!--</div>-->
-              <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--<el-alert-->
+            <!--title=""-->
+            <!--description="确认要删除吗?"-->
+            <!--type="warning"-->
+            <!--:closable="false">-->
+            <!--</el-alert>-->
+            <!--<br/>-->
+            <!--<div style="text-align: right; margin: 0">-->
+            <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
+            <!--</div>-->
+            <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
             <!--</el-popover>-->
           </template>
         </el-table-column>
 
-        <el-table-column v-for="column in tableColumns" :key="column.Id" :prop="column.prop" sortable :width="column.width" :label="column.label" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in tableColumns" :key="column.Id" :prop="column.prop" sortable
+          :width="column.width" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
@@ -70,8 +74,8 @@
 
 
         <!--动态显示的表头-->
-        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable
-          :width="300" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
+        <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable :width="320"
+          :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ transferStr(scope.row[column.prop]) }}
           </template>
@@ -84,7 +88,8 @@
         </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, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount">
       </el-pagination>
     </el-card>
 
@@ -95,7 +100,7 @@
           <el-col :span="12">
             <el-form-item label="生成时间">
               <el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
-                              start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
+                start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
             </el-form-item>
           </el-col>
 
@@ -177,17 +182,14 @@
         <el-col :span="12">
           审批步骤:
           <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
-            <el-option
-              v-for="item in AuditStepOptions"
-              :key="item.Id"
-              :label="item.Key"
-              :value="item.Value">
+            <el-option v-for="item in AuditStepOptions" :key="item.Id" :label="item.Key" :value="item.Value">
             </el-option>
           </el-select>
         </el-col>
         <el-col :span="12">
           审批部门:
-          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+          <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
+            ref="operationOriganizeTree">
           </el-tree>
         </el-col>
       </el-row>
@@ -200,9 +202,13 @@
   </div>
 </template>
 <script>
-  import { mapGetters } from 'vuex'
+  import {
+    mapGetters
+  } from 'vuex'
   import api from '@/api/oilsupplier/technologyservice'
   import setapi from '@/api/oilsupplier/oilclassorgset'
+  import FileSaver from "file-saver";
+  import XLSX from "xlsx";
 
   export default {
     computed: {
@@ -212,7 +218,7 @@
     },
     name: 'oiltechnologyservice',
 
-    data () {
+    data() {
       return {
         deptsetVisible: false,
         dialogVisible: false,
@@ -293,9 +299,8 @@
           AuditStepCode: '',
           AuditStepName: ''
         },
-        dynamicTableColumns:[],
-        tableColumns: [
-          {
+        dynamicTableColumns: [],
+        tableColumns: [{
             prop: 'Code',
             label: '编码',
             width: 120,
@@ -305,7 +310,7 @@
           {
             prop: 'Name',
             label: '名称',
-            width: 150,
+            width: 260,
             sort: true
           },
 
@@ -388,7 +393,7 @@
         AuditStepOptions: []
       }
     },
-    created () {
+    created() {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
       this.initTableHeader()
@@ -397,13 +402,41 @@
       this.getDictOptions()
     },
     methods: {
-        initTableHeader(){ 
+      initTableHeader() {
         setapi.initTsTableHeader(this.$axios).then(res => {
           console.log(res)
-          this.dynamicTableColumns=res.data.items
+          this.dynamicTableColumns = res.data.items
         })
       },
-      saveApprovalDept () {
+      exportExcel() {
+        this.size = this.currentItemCount; //表格长度变长
+        this.$nextTick(function () {
+          /* 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"
+              }),
+              "Technology.xlsx"
+            );
+          } catch (e) {
+            if (typeof console !== "undefined") console.log(e, wbout);
+          }
+          this.size = '10'; //表格还原
+          return wbout
+        })
+
+      },
+      saveApprovalDept() {
         let organizeids = []
         let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
         organize.forEach(row => {
@@ -428,7 +461,7 @@
           console.log(err)
         })
       },
-      deptSet (val) {
+      deptSet(val) {
         let stcode = this.setForm.SupplierTypeCode
         this.deptsetVisible = true
         this.selecteclassid = val.Id
@@ -447,20 +480,20 @@
             console.log(err)
           })
       },
-      MoreCmdClick (cmd) {
+      MoreCmdClick(cmd) {
         if (cmd.Command === 'Set') {
           this.deptSet(cmd.row)
         } else if (cmd.Command === 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
-      GetCommand (cmdType, row) {
+      GetCommand(cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
-      initDatas () {
+      initDatas() {
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -468,15 +501,15 @@
           Order: this.Column.Order,
           Prop: this.Column.Prop
         }
-         let myCreateOn = []
+        let myCreateOn = []
         // 解析时间
-         if (this.CreateOn!=null&&this.CreateOn.length == 2) {
+        if (this.CreateOn != null && 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)
         // 访问接口
@@ -488,7 +521,7 @@
         })
       },
 
-      getDictOptions () {
+      getDictOptions() {
         api.getDictList(this.$axios).then(res => {
           this.AuditStepOptions = res.data.items['AuditStep']
           // this.dictOptions.customerList = res.data.items['customerList']
@@ -498,7 +531,7 @@
         })
       },
 
-      searchCommand (command) {
+      searchCommand(command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -506,7 +539,7 @@
         }
       },
       // 列表排序功能
-      orderby (column) {
+      orderby(column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -515,27 +548,27 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch () {
+      clearSearch() {
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch () {
+      handleSearch() {
         this.currentPage = 1
         this.dialogVisible = false
         this.initDatas()
       },
-      handleCurrentChange (value) {
+      handleCurrentChange(value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange (value) {
+      handleSizeChange(value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity (row) {
+      deleteEntity(row) {
         this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -561,17 +594,18 @@
           console.error(err)
         })
       },
-      transferStr (val) {
+      transferStr(val) {
         if (val === '1') {
           return '是'
-        } if (val === '0') {
+        }
+        if (val === '0') {
           return ''
         } else {
           return val
         }
       },
 
-      jstimehandle (val) {
+      jstimehandle(val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -584,7 +618,7 @@
         }
       },
 
-      formatDateTime (date) {
+      formatDateTime(date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -597,4 +631,5 @@
       }
     }
   }
+
 </script>