hfxc226 3 năm trước cách đây
mục cha
commit
4cf7dd2e6a

+ 52 - 52
src/components/Table/index.js

@@ -195,19 +195,19 @@ export default {
     loadData (pagination, filters, sorter) {
       this.localLoading = true
       const parameter = Object.assign({
-          pageNum: (pagination && pagination.current) ||
+        pageNum: (pagination && pagination.current) ||
             this.showPagination && this.localPagination.current || this.pageNum,
-          pageSize: (pagination && pagination.pageSize) ||
+        pageSize: (pagination && pagination.pageSize) ||
             this.showPagination && this.localPagination.pageSize || this.pageSize
-        },
-        (sorter && sorter.field && {
-          sortField: sorter.field
-        }) || {},
-        (sorter && sorter.order && {
-          sortOrder: sorter.order
-        }) || {}, {
-          ...filters
-        }
+      },
+      (sorter && sorter.field && {
+        sortField: sorter.field
+      }) || {},
+      (sorter && sorter.order && {
+        sortOrder: sorter.order
+      }) || {}, {
+        ...filters
+      }
       )
       const result = this.data(parameter)
       // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data
@@ -292,10 +292,10 @@ export default {
       if (this.selectedRowKeys.length <= 0) return null
       return (
         <a style="margin-left: 24px" onClick={() => {
-        callback()
-        this.clearSelected()
-      }}>清空</a>
-    )
+          callback()
+          this.clearSelected()
+        }}>清空</a>
+      )
     },
     /** myColumns
      * 处理交给 table 使用者去处理 clear 事件时,内部选中统计同时调用
@@ -314,38 +314,38 @@ export default {
         treeData.push({ title: item.title,
           key: item.title })
       })
-      //const choose=this.$t('m.common.choose_show_column')
+      // const choose=this.$t('m.common.choose_show_column')
       return (
         <a style="margin-left: 24px" onClick={() => {
-      }}>
+        }}>
 
-    <a-popover placement="bottom">
-        <template slot="content">
-        <a-tree
-      checkable={true}
-      onCheck={(checkedKeys) => {
-        Object.keys(this.checkCustomMap).forEach((key) => {
-          const item = this.checkCustomMap[key]
-          item.checked = false
-        })
-        checkedKeys.forEach((item) => {
-          this.checkCustomMap[item].checked = true
-        })
-        // 重新渲染render ()函数
-        this.$forceUpdate()
-      }}
-      onSelect={(selectedKeys, info) => {
-      }}
-      checkedKeys={checkedKeys}
-      treeData={treeData} />
-      </template>
-      <template slot="title">
-        <span>选择显示列</span>
-        </template>
-        <a-icon type="appstore" />
-        </a-popover>
+          <a-popover placement="bottom">
+            <template slot="content">
+              <a-tree
+                checkable={true}
+                onCheck={(checkedKeys) => {
+                  Object.keys(this.checkCustomMap).forEach((key) => {
+                    const item = this.checkCustomMap[key]
+                    item.checked = false
+                  })
+                  checkedKeys.forEach((item) => {
+                    this.checkCustomMap[item].checked = true
+                  })
+                  // 重新渲染render ()函数
+                  this.$forceUpdate()
+                }}
+                onSelect={(selectedKeys, info) => {
+                }}
+                checkedKeys={checkedKeys}
+                treeData={treeData} />
+            </template>
+            <template slot="title">
+              <span>选择显示列</span>
+            </template>
+            <a-icon type="appstore" />
+          </a-popover>
         </a>
-    )
+      )
     },
     renderAlert () {
       // 绘制统计列数据
@@ -362,18 +362,18 @@ export default {
         this.renderClear(this.alert.clear)
       ) : null
       const renderColumns = this.renderColumns()
-      //const ss = this.$t('m.common.choose_total')
+      // const ss = this.$t('m.common.choose_total')
       // 绘制 alert 组件
       return (
         <a-alert showIcon={true} style="margin-bottom: 16px">
-        <template slot="message">
-        <span style="margin-right: 12px">已选择:<a style="font-weight: 600">{this.selectedRows.length}</a></span>
-      {needTotalItems}
-      {clearItem}
-      {renderColumns}
-    </template>
-      </a-alert>
-    )
+          <template slot="message">
+            <span style="margin-right: 12px">已选择:<a style="font-weight: 600">{this.selectedRows.length}</a></span>
+            {needTotalItems}
+            {clearItem}
+            {renderColumns}
+          </template>
+        </a-alert>
+      )
     }
   },
 

+ 2 - 1
src/utils/dict.js

@@ -1227,7 +1227,8 @@ DictCache.COLOR = {
     4: 'error', // 维修
     5: 'gray', // 停用
     6: 'gray', // 丢失
-    7: 'gray' // 转出
+    7: 'gray', // 转出
+    8: 'gray' // 报废
   },
   /**
    * 改进措施状态

+ 3 - 3
src/views/repair/application-form/modules/DetailCheck.vue

@@ -142,7 +142,7 @@
       </a-table>
       <title-divider title="维修报告" width="90px"></title-divider>
       <div class="table-operator" >
-        <a-button type="primary" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))" @click="handleAddReason">
+        <a-button type="primary" v-if="$auth('repair-repair-reasons-add') && ((dataReason === null) || (dataReason.length===0))" @click="handleAddReason">
           <a-icon type="plus"/>
           添加
         </a-button>
@@ -156,10 +156,10 @@
           <template>
             <a @click="handleViewReason(record)">查看</a>
             <operation-button
-              v-if="$auth('repair-application-forms-finish')"
+              v-if="$auth('repair-repair-reasons-edit')"
               @click="handleEditReason(record)" >修改</operation-button>
             <operation-button
-              v-if="$auth('repair-application-forms-finish')"
+              v-if="$auth('repair-repair-reasons-del')"
               :type="2"
               title="确认删除该记录?"
               @confirm="batchDeleteReason(record.id)" >删除</operation-button>

+ 2 - 5
src/views/repair/application-form/modules/DetailRepair.vue

@@ -172,14 +172,11 @@
               <template>
                 <a @click="handleViewReason(record)">查看</a>
                 <operation-button
-                  v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
                   @click="handleEditReason(record)" >修改</operation-button>
-                <operation-button
+<!--                <operation-button
                   v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
-                  @click="handleCopyReason(record)" >复制</operation-button>
-
+                  @click="handleCopyReason(record)" >复制</operation-button>-->
                 <operation-button
-                  v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
                   :type="2"
                   title="确认删除该记录?"
                   @confirm="batchDeleteReason(record.id)" >删除</operation-button>

+ 7 - 0
src/views/sb/measure/MeasureSbInfo.vue

@@ -90,6 +90,7 @@
             ref="table"
             size="default"
             rowKey="id"
+            @change="onTableChange"
             :widthSpace="true"
             :columns="columns"
             :data="loadData"
@@ -212,12 +213,14 @@ export default {
           title: '测量设备编号',
           dataIndex: 'cardNo',
           width: 150,
+          sorter: (a, b) => a.cardNo - b.cardNo,
           checked: true
         },
         {
           title: '设备名称',
           checked: true,
           width: 200,
+          sorter: (a, b) => a.name - b.name,
           dataIndex: 'name'
         },
         {
@@ -519,7 +522,11 @@ export default {
       }
       this.$refs.table.refresh()
     },
+    onTableChange (pagination, filters, sorter) {
+      console.log('onTableChange', pagination, filters, sorter)
+    },
     onSelectChange (selectedRowKeys, selectedRows) {
+      console.log('onSelectChange', selectedRowKeys, selectedRows)
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
     },