销售明细单新建的表头配置功能问题修改+可编辑表格组件的样式调整+可配置表头之后小计功能的显示逻辑修改
| | |
| | | :summary-method="getSummaries" |
| | | :span-method="arraySpanMethod" |
| | | style="width: 100%" |
| | | :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px', 'font-family': 'PingFangSC' }" |
| | | @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.productId" |
| | | > |
| | |
| | | </el-table-column> |
| | | <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | v-if="item.isShowColumn" |
| | | align="center" |
| | | > |
| | | > |
| | | <!-- 表头样式 --> |
| | | <template slot="header"> |
| | | <span v-if="item.isRequird" style="color: #f56c6c">*</span> |
| | |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="40" v-if="!detailEnter" align="center"> |
| | | <el-table-column label="操作" width="70" v-if="!detailEnter" align="center" fixed='right'> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">删除</el-button> |
| | | </template> |
| | |
| | | productIndex: 0, |
| | | isRecalculate: true, |
| | | iscolopen: false, |
| | | showcol: [] |
| | | showcol: [], |
| | | mergeNumber:1 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | "productTableList.showcol": { |
| | | handler(newVal) { |
| | | this.showcol = newVal |
| | | this.getMergeNumber() |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | getMergeNumber(){ |
| | | let pattern=new RegExp("[0-9]+"); |
| | | if(pattern.test(this.showSummary.mergeNumber)){ |
| | | this.mergeNumber=this.showSummary.mergeNumber |
| | | }else{ |
| | | for(let i in this.showcol){ |
| | | if(this.showcol[i]==this.showSummary.mergeNumber){ |
| | | this.mergeNumber=Number(i)+1; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | checkCol() { |
| | | this.iscolopen = !this.iscolopen |
| | | }, |
| | | selectCheckBoxList(val) { |
| | | this.getMergeNumber() |
| | | this.$emit("selTableCol", val) |
| | | }, |
| | | getTableInfo(){ |
| | |
| | | if (this.$refs.table) { |
| | | var current = this.$refs.table.querySelector(".el-table__footer-wrapper").querySelector(".el-table__footer") |
| | | var cell = current.rows[0].cells |
| | | for (let i = 0; i < this.showSummary.mergeNumber; i++) { |
| | | for (let i = 0; i < this.mergeNumber; i++) { |
| | | cell[i].style.display = "none" |
| | | } |
| | | cell[this.showSummary.mergeNumber].classList.remove("is-left") |
| | | cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString() |
| | | cell[this.mergeNumber].classList.remove("is-left") |
| | | cell[this.mergeNumber].colSpan = this.mergeNumber.toString() |
| | | } |
| | | }) |
| | | } |
| | |
| | | const sums = [] |
| | | columns.forEach((column, index) => { |
| | | // // 更改行名称 |
| | | if (index === this.showSummary.mergeNumber) { |
| | | if (index === this.mergeNumber) { |
| | | sums[index] = "小计:" |
| | | return |
| | | } |
| | |
| | | .el-table th.el-table__cell > .cell { |
| | | padding: 0 5px; |
| | | } |
| | | .el-table__fixed-footer-wrapper tbody td.el-table__cell{ |
| | | background:#fff; |
| | | } |
| | | .el-input__inner { |
| | | // text-align: left; |
| | | text-align: center !important; |
| | |
| | | .styleBtn { |
| | | position: absolute; |
| | | width: 30px; |
| | | height: 36px; |
| | | height: 48px; |
| | | // line-height: 26px; |
| | | // background: #06c062; |
| | | top: 0; |
| | |
| | | z-index: 11; |
| | | .label { |
| | | position: absolute; |
| | | top: 6px; |
| | | top: 11px; |
| | | font-size: 20px; |
| | | // line-height: 5px; |
| | | cursor: pointer; |
| | |
| | | } |
| | | .checkbox-group { |
| | | width: 160px; |
| | | height: 300px; |
| | | height: 180px; |
| | | overflow: auto; |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | wechatOrderStatusOptions: [], // 微信订单状态 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | productTableList: { |
| | | allcol: [], |
| | | showcol: ["产品名称", "规格", "型号", "产品编号", "单位", "销售单价", "成本单价","毛利","毛利率(%)","数量","价税合计"], |
| | | tableData: [], |
| | | tableColumn: [] |
| | | }, |
| | | showSummary: { |
| | | show: true, |
| | | total: true, |
| | | sumProp: ["Amount", "total"], |
| | | mergeNumber: 7 |
| | | mergeNumber: "成本单价" |
| | | }, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | |
| | | isBjdRequird : false, |
| | | tableColumn: [ |
| | | // { label: "#", prop: "productId", width: 40 }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true, min: 110 }, |
| | | { label: "规格", prop: "specs" , }, |
| | | { label: "型号", prop: "type" }, |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "销售单价", prop: "price", inputFloat: !this.isBjdRequird, }, |
| | | { label: "成本单价", prop: "cost", input: !this.isBjdRequird }, |
| | | { label: "毛利", prop: "profit" }, |
| | | { label: "毛利率(%)", prop: "margin", min: 90 }, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "价税合计", prop: "total" } |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true, min: 110,}, |
| | | { label: "规格", prop: "specs" , }, |
| | | { label: "型号", prop: "type", }, |
| | | { label: "产品编号", prop: "number", }, |
| | | { label: "单位", prop: "unit" ,}, |
| | | { label: "销售单价", prop: "price", inputFloat: !this.isBjdRequird,}, |
| | | { label: "成本单价", prop: "cost", input: !this.isBjdRequird, }, |
| | | { label: "毛利", prop: "profit", }, |
| | | { label: "毛利率(%)", prop: "margin", min: 90,}, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true,}, |
| | | { label: "价税合计", prop: "total", } |
| | | ], |
| | | showCol: ["产品名称", "规格", "型号", "产品编号", "单位", "销售单价", "成本单价","毛利","毛利率(%)","数量","价税合计"], |
| | | } |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.getSaleChanceList() |
| | |
| | | watch: { |
| | | "editClientManageConfig.visible"(val) { |
| | | if (val) { |
| | | this.setTableForm() |
| | | this.formInfo() |
| | | } |
| | | } |
| | |
| | | }) |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.productTableList.tableColumn = this.setColumnVisible(val, this.tableColumn) |
| | | this.productTableList.showcol = val |
| | | this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | }, |
| | | checkValueById(data, id) { |
| | | for (const key in data) { |
| | |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | isReturn: true, |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | // tableColumn: [ |
| | | // // { label: "#", prop: "productId", width: 40 }, |
| | | // { label: "产品名称", prop: "name", productName: true, isRequird: true, min: 110 }, |
| | |
| | | // { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | // { label: "价税合计", prop: "total" } |
| | | // ], |
| | | tableColumn: this.setColumnVisible(this.showCol, this.tableColumn) |
| | | tableColumn: [] |
| | | } |
| | | this.setTableList(this.productTableList) |
| | | this.productTableList.showcol= ["产品名称", "规格", "型号", "产品编号", "单位", "销售单价", "成本单价","毛利","毛利率(%)","数量","价税合计"], |
| | | this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | this.productTableList.allcol=["规格", "型号", "产品编号", "单位", "毛利",] |
| | | }, |
| | | setTableList(productTableList) { |
| | | productTableList.allcol = productTableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | setTableList(tableList) { |
| | | tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < productTableList.tableColumn.length; i++) { |
| | | const label = productTableList.tableColumn[i].label |
| | | const value = productTableList.tableColumn[i].prop |
| | | for (let i = 0; i < tableList.tableColumn.length; i++) { |
| | | const label = tableList.tableColumn[i].label |
| | | const value = tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | |
| | | const productColumn = [ |
| | | { label: "产品编号", prop: "number", isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount", isShowColumn:true,}, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "订单数量", prop: "orderAmount",min:110, isShowColumn:true,}, |
| | | { label: "订单完成数量", min:120,prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | { label: "未发货数量", prop: "leftAmount", isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount",isShowColumn:true,}, |
| | | { label: "未发货数量", prop: "leftAmount", min:120,isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", min:120,inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount",min:120,isShowColumn:true,}, |
| | | ] |
| | | return { |
| | | dialogWidth: "60%", |
| | |
| | | { label: "产品编号", prop: "number", isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount", isShowColumn:true,}, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, } |
| | | { label: "订单完成数量", min:120, prop: "finishAmount",isShowColumn:true, } |
| | | ] |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | |
| | | { label: "产品编号", prop: "number",isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount",isShowColumn:true, }, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "订单完成数量", min:120, prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | ] |
| | | this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | |
| | | { label: "产品编号", prop: "number",isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name", min: 110 ,isShowColumn:true,}, |
| | | { label: "订单数量", prop: "orderAmount",isShowColumn:true, }, |
| | | { label: "订单完成数量", prop: "finishAmount" ,isShowColumn:true,}, |
| | | { label: "订单完成数量", min:120, prop: "finishAmount" ,isShowColumn:true,}, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | { label: "未发货数量", prop: "leftAmount", isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount",isShowColumn:true,}, |
| | | { label: "未发货数量", prop: "leftAmount", min:120, isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", min:120,inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount", min:120,isShowColumn:true,}, |
| | | ] |
| | | this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | let portion=0 |