From eeed1f4dfe91ef67d09ec064b9a55346a80d60b9 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 18 十二月 2023 10:04:01 +0800
Subject: [PATCH] 销售明细单中产品编码参数修改
---
src/components/makepager/TableCommonView.vue | 96 ++++++++++++++++++++++++++++++-----------------
1 files changed, 61 insertions(+), 35 deletions(-)
diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 3057f95..4beb7f3 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -1,3 +1,4 @@
+<!-- eslint-disable vue/no-use-v-if-with-v-for -->
<template>
<div class="table-view">
<el-table
@@ -12,9 +13,12 @@
:summary-method="getSummaries"
:span-method="arraySpanMethod"
@selection-change="handleSelectionChange"
- :header-cell-style="{ background: '#f1f3f8', color: '#000009' , 'font-size': '12px','font-family':'PingFangSC'}"
+ :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '12px', 'font-family': 'PingFangSC' }"
size="mini"
+ @row-click="tableRowClick"
+ :row-class-name="tableRowClassName"
>
+ <el-table-column v-if="tableList.selectIndex" type="index" label="搴忓彿" width="50"></el-table-column>
<el-table-column v-if="selectBox" type="selection" width="40"> </el-table-column>
<el-table-column
v-for="(item, i) in tableList.tableColumn"
@@ -78,7 +82,7 @@
<div v-else-if="item.isProductName" class="product-view">
<ul v-if="scope.row.products && scope.row.products.length > 0">
<li v-for="(item, index) in scope.row.products" :key="index">
- <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'">
+ <div class="name-view">
{{ item.name }}
</div>
</li>
@@ -88,7 +92,7 @@
<div v-else-if="item.isProductAmount" class="product-view">
<ul v-if="scope.row.products && scope.row.products.length > 0">
<li v-for="(item, index) in scope.row.products" :key="index">
- <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'">
+ <div class="name-view">
{{ item.amount }}
</div>
</li>
@@ -98,7 +102,7 @@
<div v-else-if="item.isProductPrice" class="product-view">
<ul v-if="scope.row.products && scope.row.products.length > 0">
<li v-for="(item, index) in scope.row.products" :key="index">
- <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'">
+ <div class="name-view">
{{ item.price }}
</div>
</li>
@@ -108,12 +112,18 @@
<div v-else-if="item.isProductTotal" class="product-view">
<ul v-if="scope.row.products && scope.row.products.length > 0">
<li v-for="(item, index) in scope.row.products" :key="index">
- <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'">
+ <div class="name-view">
{{ item.total }}
</div>
</li>
</ul>
<div v-else class="no-product">{{ "--" }}</div>
+ </div>
+ <!-- 璋冪敤鏂规硶鏄剧ず鏂囧瓧 -->
+ <div v-else-if="item.isCallMethod">
+ <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
+ item.getCallMethod(scope.row[item.prop], scope.row)
+ }}</span>
</div>
<span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span>
</template>
@@ -127,15 +137,8 @@
<div class="overSpread1" v-show="iscolopen" @click="onMaskClick"></div>
<div class="styleBtn">
<i @click="checkCol()" class="label">...</i>
- <el-checkbox-group
- v-model="showcol"
- v-show="iscolopen"
- class="checkbox-group"
- @change="selectCheckBoxList"
- >
- <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item"
- >{{ item }}
- </el-checkbox>
+ <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList">
+ <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox>
</el-checkbox-group>
</div>
</div>
@@ -147,13 +150,13 @@
props: {
selectBox: {
type: Boolean,
- default: true
+ default: false
},
tableList: {
type: Object,
default: () => {
return {
- selectBox: true,
+ selectIndex: true,
tableInfomation: [], // 鎺ュ彛杩斿洖鏁版嵁
showcol: [],
allcol: [],
@@ -173,32 +176,39 @@
mergeNumber: 1
}
}
+ },
+ // 閫変腑鐨勬牱寮�
+ selectClassRow: {
+ type: Object,
+ default: () => {
+ return {}
+ }
}
},
data() {
return {
iscolopen: false,
- showcol:[]
+ showcol: []
}
},
computed: {},
watch: {
- 'tableList.showcol':{
- handler(newVal){
- this.showcol=newVal
+ "tableList.showcol": {
+ handler(newVal) {
+ this.showcol = newVal
},
- immediate:true
+ immediate: true
}
},
methods: {
onMaskClick() {
- this.iscolopen = false;
+ this.iscolopen = false
},
checkCol() {
- this.iscolopen = !this.iscolopen;
+ this.iscolopen = !this.iscolopen
},
selectCheckBoxList(val) {
- this.$emit("selTableCol", val);
+ this.$emit("selTableCol", val)
},
handleReserve(row) {
return row._id ? row._id : row.id
@@ -218,11 +228,11 @@
for (let i = 0; i < this.showSummary.mergeNumber; i++) {
cell[i] && cell[i].style && (cell[i].style.display = "none")
}
- if (cell[this.showSummary.mergeNumber]){
- if (cell[this.showSummary.mergeNumber].classList){
+ if (cell[this.showSummary.mergeNumber]) {
+ if (cell[this.showSummary.mergeNumber].classList) {
cell[this.showSummary.mergeNumber].classList.remove("is-left")
}
- if (cell[this.showSummary.mergeNumber].colSpan){
+ if (cell[this.showSummary.mergeNumber].colSpan) {
cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString()
}
}
@@ -363,6 +373,19 @@
// 鍏叡锛堥攢鍞満浼氥�佹姤浠峰崟銆侀攢鍞�诲崟銆侀攢鍞瓙鍗曘�傘�傘�傦級
selCommonClick(row) {
this.$emit("selCommonClick", row)
+ },
+ // 琛岀偣鍑�
+ tableRowClick(row, column, event) {
+ this.$emit("tableRowClick", row, column, event)
+ },
+ // 鍗曢�夎鐩稿叧
+ tableRowClassName({ row }) {
+ if (Object.keys(this.selectClassRow).length > 0) {
+ if (row.id == this.selectClassRow.id) {
+ return "onSelect"
+ }
+ }
+ this.$emit("tableRowClassName", row)
}
}
}
@@ -389,8 +412,8 @@
margin-left: -10px;
margin-right: -11px;
li {
- height: 57px;
- line-height: 57px;
+ height: 22px;
+ line-height: 22px;
.name-view {
padding-left: 10px;
border-bottom: 1px solid #ebeef5;
@@ -399,9 +422,12 @@
border-bottom: 0;
}
}
+ li:last-child .name-view {
+ border-bottom: none;
+ }
.no-product {
- height: 57px;
- line-height: 57px;
+ height: 22px;
+ line-height: 22px;
}
}
}
@@ -431,8 +457,8 @@
text-align: center;
}
-::v-deep{
- .el-table .cell .el-button--text.el-button--small{
+::v-deep {
+ .el-table .cell .el-button--text.el-button--small {
padding: 4px 0;
}
}
@@ -461,7 +487,7 @@
// background: #06c062;
top: 0;
right: -6px;
- z-index: 9999;
+ z-index: 11;
.label {
position: absolute;
top: 6px;
@@ -473,7 +499,7 @@
}
.checkbox-group {
width: 160px;
- height: 330px;
+ height: 300px;
overflow: auto;
display: flex;
flex-direction: column;
--
Gitblit v1.8.0