linwenxin hai 1 ano
pai
achega
2700c1f5e4
Modificáronse 1 ficheiros con 14 adicións e 13 borrados
  1. 14 13
      src/views/salesPurchasing/goodsSaleMachineAccount/index.vue

+ 14 - 13
src/views/salesPurchasing/goodsSaleMachineAccount/index.vue

@@ -26,7 +26,8 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: true,
+        'row-class-name': this.tableRowClassName
       },
       // 表格事件
       tableEvents: {
@@ -75,17 +76,6 @@ export default {
     exportList: pageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-      defaultData.render = (h, { row, index, column }) => {
-        return (
-          <div style={{
-            padding: '0 6px',
-            cursor: 'pointer',
-            color: Number(row.refundNum) > 0 ? 'red' : ''
-          }}>
-            {row[column.columnAttributes.prop]}
-          </div>
-        )
-      }
       return defaultData
     },
     // 监听勾选变化
@@ -101,7 +91,14 @@ export default {
       this.formVisible = false
       this.$refs?.formRef?.resetFields()
       this.$data.formData = this.$options.data().formData
-    }
+    },
+    tableRowClassName({row, rowIndex}){
+      if(Number(row.refundNum) > 0){
+        return 'redbackground'
+      }else{
+        return ''
+      }
+    },
   }
 }
 </script>
@@ -110,4 +107,8 @@ export default {
 .tab {
   padding: 20px 20px 0 20px;
 }
+.redbackground {
+	background: rgb(248, 185, 185) !important;
+}
+
 </style>