From bbc0f06f17c9c3c9ed325af581dfdfc9b9dcaa82 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 18 三月 2024 15:16:03 +0800
Subject: [PATCH] 完成检验下单模板功能
---
src/components/tool/value-table.vue | 46 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 8d82289..bd3a83f 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -36,6 +36,26 @@
}
</style>
<style>
+ .value-table .highlight-warning-row-border td{
+ border-top: 2px solid #ffcd29;
+ border-bottom: 2px solid #ffcd29;
+ }
+ .value-table .highlight-warning-row-border td:first-child{
+ border-left: 2px solid #ffcd29;
+ }
+ .value-table .highlight-warning-row-border td:last-child{
+ border-right: 2px solid #ffcd29;
+ }
+ .value-table .highlight-danger-row-border td{
+ border-top: 2px solid red;
+ border-bottom: 2px solid red;
+ }
+ .value-table .highlight-danger-row-border td:first-child{
+ border-left: 2px solid red;
+ }
+ .value-table .highlight-danger-row-border td:last-child{
+ border-right: 2px solid red;
+ }
.value-table .el-upload {
width: 100%;
}
@@ -51,13 +71,13 @@
<el-table ref="eltable" :data="tableData" style="width: 100%;" height="100%" tooltip-effect="dark" border
@selection-change="selectChange" @select="select" v-loading="loading" @sort-change="sortChange"
@row-click="rowClick" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0"
- :summary-method="getSummaries" :key="Math.random()">
+ :summary-method="getSummaries" :row-class-name="tableRowClassName">
<el-table-column type="selection" width="65" v-if="data.showSelect" :key="Math.random()">
</el-table-column>
<el-table-column type="index" align="center" label="搴忓彿" width="70" v-if="data.isIndex" :key="Math.random()">
</el-table-column>
<el-table-column :prop="a.label" :label="a.value" sortable="custom" v-for="(a, ai) in tableHead" :key="ai"
- show-overflow-tooltip min-width="160">
+ show-overflow-tooltip min-width="160">
<template slot-scope="scope">
<div v-if="showType(a.label, data.tagField) != null">
<el-tag v-for="(b, bi) in data.tagField[a.label].select" :key="bi" v-if="b.value == scope.row[a.label]"
@@ -68,10 +88,11 @@
<span v-else>{{scope.row[a.label]}}</span>
</template>
</el-table-column>
- <el-table-column fixed="right" align="center" label="鎿嶄綔" :width="60 + data.do.length * 40"
+ <el-table-column fixed="right" align="center" label="鎿嶄綔" :width="getWidth()"
v-if="data.do.length > 0">
<template slot-scope="scope">
<el-button v-for="(a, ai) in data.do" :key="ai" :type="a.type"
+ :disabled="a.disabFun ? a.disabFun(scope.row,scope.$index) : false"
@click="main(scope.row, a)">{{a.font}}</el-button>
</template>
</el-table-column>
@@ -195,6 +216,9 @@
} from 'iview';
export default {
props: {
+ tableRowClassName:{
+ type: Function
+ },
url: {
type: String,
default: () => null
@@ -471,7 +495,8 @@
}
} else {
delete row.orderBy
- this.$emit(val.method, row)
+ this.$parent[val.method](row)
+ // this.$emit(val.method, row)
}
},
saveUpData() {
@@ -480,7 +505,7 @@
return
}
for (var i = 0; i < this.data.requiredUp.length; i++) {
- if (this.upData[this.data.requiredUp[i]] == null || this.upData[this.data.requiredUp[i]] == '') {
+ if (this.upData[this.data.requiredUp[i]] === null || this.upData[this.data.requiredUp[i]] === '') {
var list = this.upHead.filter(a => {
if (a.label == this.data.requiredUp[i]) return a
})
@@ -551,7 +576,7 @@
return
}
for (var i = 0; i < this.data.requiredAdd.length; i++) {
- if (this.upData[this.data.requiredAdd[i]] == null || this.upData[this.data.requiredAdd[i]] == '') {
+ if (this.upData[this.data.requiredAdd[i]] === null || this.upData[this.data.requiredAdd[i]] === '') {
var list = this.upHead.filter(a => {
if (a.label == this.data.requiredAdd[i]) return a
})
@@ -708,9 +733,16 @@
if(val.method=='doDiy'){
this.main(row,val)
}else{
- this.$emit(val.method,row)
+ this.$parent[val.method](row)
}
},
+ getWidth(){
+ let count = 0
+ this.data.do.forEach(a=>{
+ count += a.font.length
+ })
+ return count * 15 + 60 + 'px'
+ }
}
}
</script>
--
Gitblit v1.9.3