luobang 2 سال پیش
والد
کامیت
7221363956
2فایلهای تغییر یافته به همراه122 افزوده شده و 47 حذف شده
  1. 1 1
      build/utils.js
  2. 121 46
      src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
 
 let devModules = ['all']
-// let devModules = ['index', 'statisticalReport', 'sale']
+// let devModules = ['index', 'statisticalReport', 'inward']
 // let devModules = ['all']
 
 // let devModules = ['index', 'ADMINISTRATORS']

+ 121 - 46
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -203,7 +203,6 @@
         @filter-change="filterChange"
         :key="saleSteelKey"
         id="salesLogisticsStat_saleSteelReports_table"
-        individual-panel
         @select="selectOne"
         @selection-change="handleSelectionChange()"
         :header-cell-style="headCellStyle"
@@ -391,9 +390,9 @@
           column-key="saleRemark"
           key="saleRemark"
           label="摘要"
-          width="150px"
-          align="center"
+          width="180px"
           show-overflow-tooltip
+          align="center"
           v-if="!columnNoRoutList.includes('摘要')"
           :render-header="renderHeader"
         >
@@ -1432,21 +1431,52 @@
     <el-dialog
       title="切换列的显示与隐藏"
       :visible.sync="columnShowDialog"
-      width="30%"
+      width="50%"
       center
       class="columnShowDialogClass"
     >
-      <el-transfer
-        style="text-align: left; display: inline-block"
-        v-model="columnHiddenData"
-        :data="columnAllData"
-        :titles="['显示的列', '隐藏的列']"
-        :button-texts="['至显示列', '至隐藏列']"
-      ></el-transfer>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="columnShowDialog = false">取 消</el-button>
-        <el-button type="primary" @click="columnShowOperation">确 定</el-button>
-      </span>
+      <el-tabs
+        v-model="schemeMap.activeName"
+        type="card"
+        editable
+        @edit="handleTabsEdit"
+        @tab-click="columnShowTabClick"
+        tab-position="left"
+      >
+        <el-tab-pane
+          :key="index"
+          v-for="(item, index) in schemeMap.schemeList"
+          :label="item.title"
+          :name="item.name"
+        >
+          <el-form :inline="true">
+            <el-form-item>
+              <div style="border:2px,solid,green">
+                <div
+                  style="margin-left: 50%;margin-bottom: 15px;font-size: 16px;"
+                >
+                  {{ schemeMap.activeName }}
+                </div>
+                <el-transfer
+                  style="text-align: left; display: inline-block"
+                  v-model="item.columnHiddenData"
+                  :data="item.columnAllData"
+                  :titles="['显示的列', '隐藏的列']"
+                  :button-texts="['至显示列', '至隐藏列']"
+                ></el-transfer>
+              </div>
+            </el-form-item>
+          </el-form>
+          <el-form :inline="true">
+            <el-form-item>
+              <el-button @click="columnShowDialog = false">取 消</el-button>
+              <el-button type="primary" @click="columnShowOperation(item)"
+                >启用</el-button
+              >
+            </el-form-item>
+          </el-form>
+        </el-tab-pane>
+      </el-tabs>
     </el-dialog>
     <div class="dialog">
       <el-dialog
@@ -2092,7 +2122,8 @@ export default {
       columnAllData: [],
       columnHiddenData: [],
       consigneeCheckList: [],
-      showPopover: false
+      showPopover: false,
+      schemeMap: {}
     }
   },
   created() {
@@ -2140,18 +2171,7 @@ export default {
         })
       this.notRoutList = ['select']
     } else {
-      this.axios
-        .post('/api/v1/uc/getColumnShowHidden', {
-          userName: getCookie('loginName'),
-          orgCode: getCookie('orgCode'),
-          tableName: '销售钢材报表'
-        })
-        .then(res => {
-          this.columnNoRoutList = res.data.columnHiddenData
-        })
-        .catch(() => {
-          this.columnNoRoutList = []
-        })
+      this.getColumShowHideScheme()
     }
     if (getCookie('orgCode') == 'xiaoshouyewuyuan') {
       this.isShowOperateYeWuYuan = true
@@ -2278,6 +2298,62 @@ export default {
   },
   computed: {},
   methods: {
+    getColumShowHideScheme() {
+      this.axios
+        .post('/api/v1/uc/getColumShowHideScheme', {
+          userName: getCookie('loginName'),
+          orgCode: getCookie('orgCode'),
+          tableName: '销售钢材报表'
+        })
+        .then(res => {
+          console.log(res.data.data, 'res')
+          this.schemeMap = res.data.data
+          this.columnNoRoutList = this.schemeMap.columnHiddenData
+        })
+        .catch(() => {
+          this.columnNoRoutList = []
+        })
+    },
+    columnShowTabClick(e) {
+      console.log(e.paneName, 'e')
+      this.schemeMap.activeName = e.paneName
+    },
+    //动态渲染列的显示方案
+    handleTabsEdit(targetName, action) {
+      if (action === 'add') {
+        this.$confirm('请输入方案名称', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'info',
+          showInput: true,
+          center: true
+        })
+          .then(mes => {
+            let newTabName = mes.value
+            this.schemeMap.schemeList.push({
+              title: newTabName,
+              name: newTabName,
+              columnAllData: this.schemeMap.columnAllData,
+              columnHiddenData: []
+            })
+            this.schemeMap.activeName = newTabName
+          })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              message: '用户取消操作'
+            })
+          })
+      }
+      if (action === 'remove') {
+        console.log(targetName, 'targetName')
+        let map = {}
+        map.columnHiddenData = []
+        map.name = targetName || this.schemeMap.activeName
+        this.columnShowOperation(map)
+      }
+    },
+    //动态渲染表头
     renderHeader(h, { column }) {
       let arr = []
       let renderColumnFilterList = []
@@ -2419,27 +2495,28 @@ export default {
       )
     },
     ctrlColumnShow() {
-      this.axios
-        .post('/api/v1/uc/getColumnShowHidden', {
-          userName: getCookie('loginName'),
-          orgCode: getCookie('orgCode'),
-          tableName: '销售钢材报表'
-        })
-        .then(res => {
-          console.log(res.data.columnShowData)
-          console.log(res.data.columnHiddenData, 'columnHiddenData')
-          this.columnAllData = res.data.columnAllData
-          this.columnHiddenData = res.data.columnHiddenData
-        })
+      // this.axios
+      //   .post('/api/v1/uc/getColumnShowHidden', {
+      //     userName: getCookie('loginName'),
+      //     orgCode: getCookie('orgCode'),
+      //     tableName: '销售钢材报表'
+      //   })
+      //   .then(res => {
+      //     console.log(res.data.columnShowData)
+      //     console.log(res.data.columnHiddenData, 'columnHiddenData')
+      //     this.columnAllData = res.data.columnAllData
+      //     this.columnHiddenData = res.data.columnHiddenData
+      //   })
       this.columnShowDialog = true
     },
-    columnShowOperation() {
+    columnShowOperation(item) {
       this.axios
         .post('/api/v1/uc/updateColumnShowHidden', {
           userName: getCookie('loginName'),
           orgCode: getCookie('orgCode'),
           tableName: '销售钢材报表',
-          columnHiddenData: this.columnHiddenData
+          columnHiddenData: item.columnHiddenData,
+          schemeName: item.name
         })
         .then(res => {
           this.$message({
@@ -2447,9 +2524,7 @@ export default {
             message: '切换成功',
             offset: '250'
           })
-          this.columnNoRoutList = this.columnHiddenData
-          this.reset()
-          this.getSteelReport()
+          this.$router.go(0)
         })
       this.columnShowDialog = false
     },
@@ -5033,7 +5108,7 @@ export default {
   .table {
     margin-left: 20px;
     margin-top: 20px;
-    .el-tooltip {
+    /deep/ .el-tooltip {
       width: auto !important;
     }
     /deep/ .el-table__body {