소스 검색

前:准入范围列表可排序

dubch 5 년 전
부모
커밋
fd041f2775

+ 23 - 6
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -3,9 +3,9 @@
     <el-card class="box-card">
       <div slot="header" class="clearfix">
         <span>准入范围</span>
-        <span style="margin-left: 100px">
+        <span style="margin-left: 600px">
           准入编码&nbsp;
-          <el-input size="mini" v-model="Code" style="width:10%" clearable placeholder="请输入"></el-input>
+          <el-input size="mini" v-model="Code" style="width:10%" clearable placeholder="准入编码"></el-input>
           &nbsp;
           <el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
         </span>
@@ -15,10 +15,10 @@
           </el-button>
         </span>
       </div>
-      <el-table :data="businessList" border size="mini" height="calc(100vh - 435px)"  @selection-change="handleSelectionChange">
+      <el-table :data="businessList" border size="mini" height="calc(100vh - 435px)"  @selection-change="handleSelectionChange" @sort-change="orderby">
         <el-table-column type="selection"  width="55"></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>
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip sortable></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip sortable></el-table-column>
         <el-table-column
                   label="是否为制造商" width="100" v-if="SupplierTypeCode == '01'">
                   <template slot-scope="scope">
@@ -27,7 +27,7 @@
                     <span v-else>——</span>
                   </template>
         </el-table-column>
-         <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip>
+         <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip sortable>
             <template slot-scope="scope">
             <span v-if="scope.row.CertSubStatus=='1'"
                   style="color:#67C23A">准入</span>
@@ -167,6 +167,11 @@
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
         lostTableDataInfo: '',
         lostTableData: [],
         businessList: [],
@@ -264,9 +269,21 @@
         this.SupplierCertId = certId
         this.initData()
       },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order == 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order == 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initData()
+      },
       initData () {
         let _this = this
         const params = {
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
           SupplierCertId: this.SupplierCertId,
           SupplierTypeCode: this.SupplierTypeCode,
           Code: this.Code,

+ 24 - 2
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -4,9 +4,9 @@
       <div slot="header"
            class="clearfix">
         <span style="font-weight: bold">准入范围</span>
-        <span style="margin-left: 100px">
+        <span style="margin-left: 600px">
           准入编码&nbsp;
-          <el-input size="mini" v-model="Code" clearable style="width:10%" placeholder="请输入准入编码"></el-input>
+          <el-input size="mini" v-model="Code" clearable style="width:10%" placeholder="准入编码"></el-input>
           &nbsp;
           <el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
         </span>
@@ -35,6 +35,7 @@
                 border
                 size="mini"
                 height="calc(100vh - 445px)"
+                @sort-change="orderby"
                 @selection-change="handleSelectionChange">
         <el-table-column type="selection"
                          width="55">
@@ -42,11 +43,14 @@
 
         <el-table-column prop="Code"
                          label="分类编码"
+                         sortable
                          show-overflow-tooltip></el-table-column>
         <el-table-column prop="Name"
                          label="分类名称"
+                         sortable
                          show-overflow-tooltip></el-table-column>
         <el-table-column prop="GoodsLevel"
+                         sortable
                          label="级别" width="80px"
                          show-overflow-tooltip>
           <template slot-scope="scope">
@@ -68,6 +72,7 @@
           </template>
         </el-table-column>
         <el-table-column prop="CertSubStatus"
+                         sortable
                          label="状态"
                          show-overflow-tooltip>
           <template slot-scope="scope">
@@ -342,6 +347,11 @@
         sectionCert: [],
         goodsList2019: [],
         goodsList: [],
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
         goodsDialog: false,
         switchstatus: false,
         orgtreelist: [],
@@ -386,6 +396,16 @@
         this.currentPage = 1
         this.initData()
       },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order == 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order == 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initData()
+      },
       isDisabledBtn () {
         if (this.operType !== '制造商') {
           return true
@@ -534,6 +554,8 @@
       initData () {
         let _this = this
         const params = {
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
           SupplierCertId: this.SupplierCertId,
           SupplierTypeCode: this.SupplierTypeCode,
           Code: this.Code,

+ 23 - 6
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -3,9 +3,9 @@
     <el-card class="box-card">
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
-        <span style="margin-left: 100px">
+        <span style="margin-left: 600px">
           准入编码&nbsp;
-          <el-input size="mini" v-model="Code" style="width:10%" placeholder="请输入"></el-input>
+          <el-input size="mini" v-model="Code" style="width:10%" placeholder="准入编码"></el-input>
           &nbsp;
           <el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
         </span>
@@ -14,15 +14,15 @@
           <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加</el-button>
         </span>
       </div>
-      <el-table :data="techList" border height="calc(100vh - 435px)" size="mini" @selection-change="handleSelectionChange">
+      <el-table :data="techList" border height="calc(100vh - 435px)" size="mini" @selection-change="handleSelectionChange" @sort-change="orderby">
         <el-table-column
           type="selection"
           width="55">
         </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>
-         <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip>
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip sortable></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip sortable></el-table-column>
+         <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip sortable>
             <template slot-scope="scope">
             <span v-if="scope.row.CertSubStatus=='1'"
                   style="color:#67C23A">准入</span>
@@ -149,6 +149,11 @@
         loading: false,
         IsCompanyUser: '',
         Ids: [],
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
@@ -209,6 +214,16 @@
           this.Ids.push(val[i].Id)
         }
       },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order == 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order == 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initData()
+      },
       getvalue (SupplierId, SupplierTypeCode, certId) {
         this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
@@ -218,6 +233,8 @@
       initData () {
         let _this = this
         const params = {
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
           SupplierCertId: this.SupplierCertId,
           SupplierTypeCode: this.SupplierTypeCode,
           Code: this.Code,