Просмотр исходного кода

1、增加交坯明细表、成型线剩余注浆次数明细表

周兴 3 лет назад
Родитель
Сommit
569459ae1e

+ 14 - 7
src/components/base/dk-perspective/dk-perspective.vue

@@ -34,7 +34,7 @@ import Sortable from "sortablejs";
 
 export default {
   name: "dk-perspective",
-  components:{DkPivot},
+  components: {DkPivot},
   data() {
     const vm = window.vm;
     return {
@@ -216,13 +216,20 @@ export default {
       if (this.columns && this.columns.length > 0) {
         this.fields = []
         this.availableFieldKeys = []
-        this.columns.forEach(it=>{
-          this.fields.push({
-            key:it.field,
-            label:it.title,
+        this.columns.forEach(it => {
+          let item = {
+            key: it.field,
+            label: it.title,
             valueFilter: true,
+            type: it.type,
             getter: item => item[it.field],
-          })
+          }
+          if (it.type === 'switch') {
+            item.sort = (a, b) => {
+              return b - a
+            }
+          }
+          this.fields.push(item);
           this.availableFieldKeys.push(it.field)
         })
         // for (let i = 0; i < this.columns.length; i++) {
@@ -232,7 +239,7 @@ export default {
         //     this.columns[i].label = this.columns[i].title
         //   }
         // }
-        console.log('333', this.fields,this.availableFieldKeys)
+        console.log('333', this.fields, this.availableFieldKeys)
       }
     },
     /**

+ 43 - 24
src/components/base/dk-perspective/dk-pivot.vue

@@ -3,9 +3,9 @@
     <DkSplit ref="toolSplit" v-model="split">
       <div slot="left">
         <!--字段-->
-        <DkButton ref="button" class="btn-class" size="small">{{'字段'}}
-            <Icon v-if="hideFlag" type="md-arrow-dropleft" @click.stop="handleTools"/>
-            <Icon v-else type="md-arrow-dropright" @click.stop="handleTools"/>
+        <DkButton ref="button" class="btn-class" size="small">{{ '字段' }}
+          <Icon v-if="hideFlag" type="md-arrow-dropleft" @click.stop="handleTools"/>
+          <Icon v-else type="md-arrow-dropright" @click.stop="handleTools"/>
         </DkButton>
         <DkSplit mode="vertical" :height="tableHeight" v-model="leftSplit">
           <div slot="top" style="display: flex; justify-content: space-between; "
@@ -126,7 +126,7 @@
                              :key="index"
                              :field="item+''"
                              width="auto" :filter="false"
-                             :title="item+''"></DkTableColumn>
+                             :title="getTitle(item)"></DkTableColumn>
             </div>
             <!--列维度(多维度)-->
             <div v-else>
@@ -143,16 +143,16 @@
                         <DkTableColumn v-for="(cItem,cIndex) in [...colFields[colFields.length - 1].valuesFiltered]"
                                        ref="col"
                                        :key="cIndex"
-                                       :field="itemTop + '_' + getTitle(groupCols,index) + cItem"
+                                       :field="itemTop + '_' + getField(groupCols,index) + cItem"
                                        width="auto" :filter="false"
-                                       :title="cItem+''"></DkTableColumn>
+                                       :title="getTitle(cItem)"></DkTableColumn>
                       </div>
                       <div v-if="gIndex === groupCols.length - 1 && dataFields.length > 1">
                         <!--子级(有多个值列)-->
                         <DkTableColumn v-for="(cItem,cIndex) in dataFields"
                                        ref="col"
                                        :key="cIndex"
-                                       :field="itemTop + '_' + getTitle(groupCols,index) + cItem.key"
+                                       :field="itemTop + '_' + getField(groupCols,index) + cItem.key"
                                        width="auto" :filter="false"
                                        :title="cItem.label"></DkTableColumn>
                       </div>
@@ -167,7 +167,7 @@
                                    :key="cIndex"
                                    :field="itemTop + '_' + cItem"
                                    width="auto" :filter="false"
-                                   :title="cItem+''"></DkTableColumn>
+                                   :title="getTitle(cItem)"></DkTableColumn>
                   </div>
                   <div v-else>
                     <!--子级(有多个值列)-->
@@ -287,15 +287,16 @@ export default {
     this.fields.filter(field => field.valueFilter).forEach(field => {
       fieldValues[field.key] = {}
     })
-
+    const vm = Window.vm
     return {
+      vm:vm,
       internal: {
         availableFieldKeys: this.availableFieldKeys,
         rowFieldKeys: this.rowFieldKeys,
         colFieldKeys: this.colFieldKeys,
         dataFieldKeys: this.dataFieldKeys,
       },
-      hideFlag:false,
+      hideFlag: false,
       split: 0.4,
       leftSplit: 0.5,
       tableHeight: 800,
@@ -340,8 +341,12 @@ export default {
         // 有过滤
         valueFilterableFields.forEach(field => {
           let value = field.getter(item);
-          if (value) {
+          if (typeof value === 'boolean') {
             fieldsWithValues[field.key].valuesSet.add(value)
+          }else{
+            if (value) {
+              fieldsWithValues[field.key].valuesSet.add(value)
+            }
           }
         })
         // 无过滤
@@ -355,6 +360,7 @@ export default {
 
       // Creates values sorted from valuesSet
       valueFilterableFields.forEach(field => {
+        console.log('bb',field.sort)
         fieldsWithValues[field.key].values = Array.from(fieldsWithValues[field.key].valuesSet).sort(field.sort || naturalSort)
         // 给optionsValue赋值
         fieldsWithValues[field.key].optionValues = fieldsWithValues[field.key].values.map(it => {
@@ -363,7 +369,7 @@ export default {
           }
         })
       })
-
+      console.log('fieldsWithValues', fieldsWithValues)
       return fieldsWithValues
     },
     // Fields selected values as set
@@ -496,10 +502,11 @@ export default {
      * @author : 周兴
      * @date   : 2023/3/23 21:32
      */
-    handleTools(){
+    handleTools() {
       this.hideFlag = !this.hideFlag;
-      if(this.hideFlag){
-        this.$refs['toolSplit'].hidePane();``
+      if (this.hideFlag) {
+        this.$refs['toolSplit'].hidePane();
+        ``
       }
     },
     /**
@@ -523,7 +530,7 @@ export default {
      * @author : 周兴
      * @date   : 2023/3/21 13:34
      */
-    getTitle(groupCols, index) {
+    getField(groupCols, index) {
       let titles = []
       if (groupCols && groupCols.length > 0) {
         groupCols.forEach(it => {
@@ -539,6 +546,19 @@ export default {
       return '';
     },
     /**
+     * @desc   : 要处理boolean的显示
+     * @author : 周兴
+     * @date   : 2023/4/6 15:36
+     */
+    getTitle(value){
+      console.log('vv',value)
+      if(typeof value === 'boolean'){
+        return value? vm.$t('yes'):vm.$t('no')
+      }else{
+        return value + '';
+      }
+    },
+    /**
      * @desc   : 更新表头列
      * @author : 周兴
      * @date   : 2023/3/21 9:02
@@ -590,7 +610,7 @@ export default {
               rowKey.push(field.getter(it) + '')
               rowColumns[field.key] = field.getter(it) + ''
             })
-            if(rowColumns && Object.keys(rowColumns).length > 0){
+            if (rowColumns && Object.keys(rowColumns).length > 0) {
               this.tableData.pushNoRepeat(rowColumns)
             }
             this.colFields.forEach(field => {
@@ -640,17 +660,17 @@ export default {
               this.$refs.col.forEach(col => {
                 let headerFields = col.field.split('_')
                 // 如果只有一个值域,是不要显示
-                if(this.dataFields.length == 1){
-                  let index = headerFields.findIndex(it=>it == this.dataFields[0].key)
+                if (this.dataFields.length == 1) {
+                  let index = headerFields.findIndex(it => it == this.dataFields[0].key)
                   // 删除掉
-                  if(index >= 0){
-                    headerFields.splice(index,1)
+                  if (index >= 0) {
+                    headerFields.splice(index, 1)
                   }
                 }
                 let key = [...rowKeys, ...headerFields]
                 let value = valuesHashTable.get(key);
                 item[col.field] = value ? value.toThousandth() : null;
-                // console.log('col.field',col.field,headerFields,valuesHashTable,key)
+                console.log('col.field',col.field,headerFields,valuesHashTable,key)
               })
             })
           }
@@ -762,7 +782,7 @@ export default {
   width: 100% !important;
 }
 
-.btn-class{
+.btn-class {
   width: 100%;
   text-align: left;
 }
@@ -790,5 +810,4 @@ export default {
 }
 
 
-
 </style>

+ 2 - 2
src/components/base/dk-table/dk-table.vue

@@ -1176,7 +1176,7 @@ export default {
       const tableColumns = this.$refs[this.name].getTableColumn()
       if (tableColumns && tableColumns.visibleColumn && data && data.length > 0) {
         let columns = [...tableColumns.visibleColumn];
-        columns = columns.filter(it => it.type != 'seq' && it.type != 'checkbox' && it.type != 'radio').filterColumns(['field', 'title'])
+        columns = columns.filter(it => it.type != 'seq' && it.type != 'checkbox' && it.type != 'radio').filterColumns(['field', 'title','type'])
         this.$Perspective({
             component: this.$refs[this.name],
             columns: columns,
@@ -1199,7 +1199,7 @@ export default {
           ok: (val) => {
             this.handleExportAll(true); // 控制不允许再次点击导出
             let params = {...this.exportCondition}
-            console.log('ttt', Object.assign({'seq': '序号'}, val))
+            // console.log('ttt', Object.assign({'seq': '序号'}, val))
             // 增加序号
             params.condition = Object.assign({'seq': '序号'}, val);
             params.ftyId = this.$store.state.user.ftyId;

+ 1 - 0
src/locale/lang/zh-CN.js

@@ -902,6 +902,7 @@ export const columns = {
   reportStatusName: '报表状态',
   describe: '描述',
   sqlErr: 'SQL中包括不合法的关键字',
+  perspective:'透视表',
 }
 
 /**

+ 2 - 0
src/view/core/factory/index.vue

@@ -220,6 +220,8 @@ export default {
   created() {
     this.primaryKey = 'factoryId'  // 设置主键Id
     this.routeObjName = 'factory'  // 设置路由名称
+    let value = [true,false];
+    console.log('fff',value.sort(((a, b) => { return b - a})))
   }
 }
 </script>

+ 13 - 0
src/view/report/delivery-blank/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+name: "delivery-blank"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/view/report/moldline-surplus-times/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+name: "moldline-surplus-times"
+}
+</script>
+
+<style scoped>
+
+</style>