Explorar el Código

营销工具,订单核销样式调整

qymljy hace 2 años
padre
commit
6632181073

+ 4 - 2
src/HDrpManagement/writeoffbill/modules/order/index.vue

@@ -16,7 +16,7 @@
       <slot name="addOrder"></slot>
     </div>
     <div style="margin-top: 15px">
-      <tableLayout :layout="tablecols" height="400px" :data="list" :custom="true" :width="true" fixedName="operation writeoffamount unwriteoffamount">
+      <tableLayout :layout="tablecols"  :data="list" :custom="true" :width="true" fixedName="operation writeoffamount unwriteoffamount">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname == 'writeoffamount'">
             <el-input size="small" v-if="currentItem.sa_writeoffbill_orderid == scope.column.data.sa_writeoffbill_orderid" v-model="scope.column.data.writeoffamount"></el-input>
@@ -52,8 +52,10 @@
 
 <script>
 import { log } from '@antv/g2plot/lib/utils'
+import tableLayout from '@/components/dynamic-table/index2'
 export default {
   props:["data"],
+  components:{tableLayout},
   data () {
     return {
       tablecols:[],
@@ -148,4 +150,4 @@ export default {
 
 </script>
 <style scoped>
-</style>
+</style>

+ 1 - 1
src/HManagement/archvies_mag/modules/list.vue

@@ -186,7 +186,7 @@ export default {
   },
   watch: {
     $route() {
-      this.queryAttachment()
+      /*this.queryAttachment()*/
       // 路由发生变化的时候初始化选择数组
       this.$emit('folderChecked', [])
     }

+ 66 - 0
src/components/dynamic-table/index2.vue

@@ -0,0 +1,66 @@
+<template>
+  <div>
+    <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini" :height="height ? height : data.length <= 4?'260px':data.length <= 20?'calc(100vh - 354px)':'calc(100vh - 354px)'"  @row-click="rowClick" style="width:100%;min-height:260px;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange">
+      <el-table-column
+          type="selection"
+          width="35" fixed v-if="checkbox">
+      </el-table-column>
+      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?redirect ? redirect : 'right' :false : false">
+        <template v-slot:header="{ column,$index }" v-if="customHeader">
+          <slot name="header" :data="column"></slot>
+        </template>
+        <template slot-scope="scope">
+          <div class="table-panel">
+            <!-- 自定义表格显示内容 -->
+            <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
+            <!-- 否则就是默认 -->
+            <span v-else>{{scope.row[col.columnname]}}</span>
+            <!-- 操作结构内容 -->
+            <slot v-if="col.columnname === 'operation'" name="opreation" :data="scope.row"></slot>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from "vuex"
+export default {
+  /*
+    layout:表结构数据;
+    data:表渲染数据;
+    custom:是否启用自定义结构;
+    opwidth:操作列宽度
+  */
+  props:['layout','data','custom','height','fixedName','width','checkbox','redirect','customHeader'],
+  data () {
+    return {
+      list:[],
+    }
+  },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
+  methods:{
+    rowClick (row) {
+      this.$emit('rowClick',row)
+    },
+    tableClassName ({row,rowIndex}) {
+      row.index = rowIndex
+    },
+    selectionChange(row){
+      this.$emit('selectionChange',row)
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>