From 74dfc64fee47f49bea6b070d06005e7d790ac91d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 12 十月 2023 09:52:15 +0800
Subject: [PATCH] feat: 合同管理、服务合同、客户服务单、服务回访单 自动生成编号编辑回显时显示对应编码
---
src/components/makepager/TableCommonView.vue | 250 +++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 236 insertions(+), 14 deletions(-)
diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 2e9797c..7335401 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
@@ -5,14 +6,17 @@
border
:data="tableList.tableInfomation"
tooltip-effect="dark"
+ :height="'calc(100% - 0px)'"
style="width: 100%"
:lazy="tableList.lazy"
:show-summary="showSummary.show"
:summary-method="getSummaries"
:span-method="arraySpanMethod"
@selection-change="handleSelectionChange"
- :header-cell-style="{ background: '#ECF4FF', color: '#666' }"
+ :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '12px', 'font-family': 'PingFangSC' }"
+ size="mini"
>
+ <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"
@@ -23,18 +27,20 @@
:min-width="item.min"
show-overflow-tooltip
:sortable="item.sortable"
+ v-if="item.isShowColumn"
>
<template slot-scope="scope">
<span v-if="item.price">{{ "锟�" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
<div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
<span v-else-if="item.isTime">{{
- dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 08:00:00"
+ dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 00:06:26"
? "--"
: dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop])
}}</span>
<span v-else-if="item.isClick && scope.row[item.prop]" class="sel-name" @click="selNameClick(scope.row)">{{
scope.row[item.prop]
}}</span>
+ <span v-else-if="item.isFirst">{{ scope.row[item.prop] ? "鏄�" : "鍚�" }}</span>
<span
v-else-if="item.isSalesLeadClick && scope.row[item.prop]"
class="sel-name"
@@ -60,11 +66,57 @@
>{{ scope.row[item.prop] }}</span
>
<span
+ v-else-if="item.isServiceOrder && scope.row[item.prop]"
+ class="sel-name"
+ @click="selServiceOrderClick(scope.row)"
+ >{{ scope.row[item.prop] }}</span
+ >
+ <span
v-else-if="item.isCommonClick && scope.row[item.prop]"
class="sel-name"
@click="selCommonClick(scope.row)"
>{{ scope.row[item.prop] }}</span
>
+ <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="name-view">
+ {{ item.name }}
+ </div>
+ </li>
+ </ul>
+ <div v-else class="no-product">{{ "--" }}</div>
+ </div>
+ <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="name-view">
+ {{ item.amount }}
+ </div>
+ </li>
+ </ul>
+ <div v-else class="no-product">{{ "--" }}</div>
+ </div>
+ <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="name-view">
+ {{ item.price }}
+ </div>
+ </li>
+ </ul>
+ <div v-else class="no-product">{{ "--" }}</div>
+ </div>
+ <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="name-view">
+ {{ item.total }}
+ </div>
+ </li>
+ </ul>
+ <div v-else class="no-product">{{ "--" }}</div>
+ </div>
<span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span>
</template>
</el-table-column>
@@ -73,6 +125,14 @@
<el-empty description="鏆傛棤鏁版嵁"></el-empty>
</div>
</el-table>
+
+ <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>
+ </div>
</div>
</template>
@@ -82,14 +142,16 @@
props: {
selectBox: {
type: Boolean,
- default: true
+ default: false
},
tableList: {
type: Object,
default: () => {
return {
- selectBox: true,
+ selectIndex: true,
tableInfomation: [], // 鎺ュ彛杩斿洖鏁版嵁
+ showcol: [],
+ allcol: [],
tableColumn: [
// table琛ㄥ崟
{ label: "", prop: "", min: 200, tooltip: true }
@@ -109,10 +171,30 @@
}
},
data() {
- return {}
+ return {
+ iscolopen: false,
+ showcol: []
+ }
},
computed: {},
+ watch: {
+ "tableList.showcol": {
+ handler(newVal) {
+ this.showcol = newVal
+ },
+ immediate: true
+ }
+ },
methods: {
+ onMaskClick() {
+ this.iscolopen = false
+ },
+ checkCol() {
+ this.iscolopen = !this.iscolopen
+ },
+ selectCheckBoxList(val) {
+ this.$emit("selTableCol", val)
+ },
handleReserve(row) {
return row._id ? row._id : row.id
},
@@ -129,10 +211,16 @@
.querySelector(".el-table__footer")
var cell = current.rows[0].cells
for (let i = 0; i < this.showSummary.mergeNumber; i++) {
- cell[i].style.display = "none"
+ cell[i] && cell[i].style && (cell[i].style.display = "none")
}
- cell[this.showSummary.mergeNumber].classList.remove("is-left")
- cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString()
+ 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) {
+ cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString()
+ }
+ }
}
})
}
@@ -157,6 +245,37 @@
}
}, 0)
sums[index + 1]
+ if (column.property === "taxUnitPrice") {
+ let sumPrice = 0
+ this.tableList.tableInfomation.map((item) => {
+ item.products.map((val) => {
+ console.log(val.price)
+ sumPrice += parseFloat(val.price)
+ })
+ })
+ console.log((sums[index + 1] = sumPrice))
+ console.log(sumPrice)
+ }
+ if (column.property === "priceTax") {
+ let sumPrice = 0
+ this.tableList.tableInfomation.map((item) => {
+ item.products.map((val) => {
+ console.log(val.price)
+ sumPrice += parseFloat(val.total)
+ })
+ })
+ sums[index + 1] = sumPrice
+ }
+ if (column.property === "productAmount") {
+ let sumPrice = 0
+ this.tableList.tableInfomation.map((item) => {
+ item.products.map((val) => {
+ console.log(val.price)
+ sumPrice += parseFloat(val.amount)
+ })
+ })
+ sums[index + 1] = sumPrice
+ }
}
})
// console.log(sums)
@@ -232,6 +351,10 @@
selMasterClick(row) {
this.$emit("selMasterClick", row)
},
+ // 瀹㈡埛鏈嶅姟鍗�
+ selServiceOrderClick(row) {
+ this.$emit("selServiceOrderClick", row)
+ },
// 鍏叡锛堥攢鍞満浼氥�佹姤浠峰崟銆侀攢鍞�诲崟銆侀攢鍞瓙鍗曘�傘�傘�傦級
selCommonClick(row) {
this.$emit("selCommonClick", row)
@@ -243,9 +366,8 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.table-view {
- // margin-top: 20px;
- margin-right: 10px;
- // margin-bottom: 40px;
+ position: relative;
+ height: 100%;
.blue {
width: 70px;
text-align: center;
@@ -257,11 +379,111 @@
color: $color-primary;
cursor: pointer;
}
+ .product-view {
+ // background: #cc7d7d;
+ margin-left: -10px;
+ margin-right: -11px;
+ li {
+ height: 22px;
+ line-height: 22px;
+ .name-view {
+ padding-left: 10px;
+ border-bottom: 1px solid #ebeef5;
+ }
+ .no-bottom {
+ border-bottom: 0;
+ }
+ }
+ li:last-child .name-view {
+ border-bottom: none;
+ }
+ .no-product {
+ height: 22px;
+ line-height: 22px;
+ }
+ }
}
::v-deep {
- .el-table__footer-wrapper tbody td.el-table__cell {
- background-color: #fff;
- text-align: right;
+ .el-table__footer-wrapper {
+ tbody td.el-table__cell {
+ background-color: #fff;
+ font-weight: bold;
+ }
+ }
+}
+
+::v-deep .el-table .cell {
+ font-size: 12px;
+ line-height: 17px;
+ font-family: PingFangSC;
+ color: rgba(0, 0, 0, 0.9);
+ .el-button--text {
+ width: auto;
+ height: auto;
+ font-family: PingFangSC-Medium, sans-serif;
+ }
+}
+::v-deep .el-table .el-table__cell {
+ padding: 6px 0 !important;
+ height: 35px;
+ text-align: center;
+}
+
+::v-deep {
+ .el-table .cell .el-button--text.el-button--small {
+ padding: 4px 0;
+ }
+}
+
+::v-deep .el-table .el-table__cell {
+ padding: 6px 0 !important;
+ height: 35px;
+ text-align: center;
+}
+
+.overSpread1 {
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ top: 0;
+ left: 0;
+ background: rgba(0, 0, 0, 0);
+ z-index: 10;
+}
+
+.styleBtn {
+ position: absolute;
+ width: 30px;
+ height: 36px;
+ // line-height: 26px;
+ // background: #06c062;
+ top: 0;
+ right: -6px;
+ z-index: 11;
+ .label {
+ position: absolute;
+ top: 6px;
+ font-size: 20px;
+ // line-height: 5px;
+ cursor: pointer;
+ color: #000;
+ transform: rotate(-90deg);
+ }
+ .checkbox-group {
+ width: 160px;
+ height: 300px;
+ overflow: auto;
+ display: flex;
+ flex-direction: column;
+ line-height: 25px;
+ background: #ffffff;
+ border-radius: 16px;
+ padding: 12px;
+ position: absolute;
+ right: 0;
+ top: 30px;
+ z-index: 99;
+ box-shadow: 0 0 2px 2px #f8f8f8;
}
}
</style>
--
Gitblit v1.8.0