| | |
| | | " |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | <span v-else> |
| | | <template v-if="pageName=='quotation'&&item.prop=='profit'"> |
| | | {{ (scope.row.price&&scope.row.cost)?Number(scope.row.price)-Number(scope.row.cost)+'':'' }} |
| | | </template> |
| | | <template v-if="pageName=='quotation'&&item.prop=='margin'"> |
| | | {{ (scope.row.price&&scope.row.cost)?((Number(scope.row.price)-Number(scope.row.cost))*100/Number(scope.row.cost)).toFixed(2)+'%':'' }} |
| | | </template> |
| | | <template v-else> |
| | | {{ scope.row[item.prop] }} |
| | | </template> |
| | | </span> |
| | | </template> |
| | | <el-form-item |
| | | v-else-if="item.inputNumber && selectBox" |
| | |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="40" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteClick(scope)" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <slot name="tableButton" /> |
| | |
| | | selectBox: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | // 那个页面 用来判断计算方式 |
| | | pageName:{ |
| | | type:String, |
| | | default:'' |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | |
| | | sums[index] = "小计:" |
| | | return |
| | | } |
| | | const title = ["#", "产品名称"] |
| | | const title = ["#", "产品名称",'产品编号','单位','销售单价','成本单价'] |
| | | // 去除某些不需要计算的数据 |
| | | if (title.includes(column.label)) { |
| | | sums[index] = "" |
| | | return |
| | | } |
| | | if(this.pageName=='quotation'&&column.label=='毛利'){ |
| | | sums[index] = "" |
| | | return |
| | | } |
| | |
| | | empty() { |
| | | this.isRecalculate = false |
| | | this.$emit("emptyProductClick") |
| | | }, |
| | | // 删除 |
| | | deleteClick(scope){ |
| | | this.tableList.tableData.splice(scope.$index,1) |
| | | this.$forceUpdate(); |
| | | this.$message.success('删除除成功!') |
| | | this.$emit("deleteClick",scope) |
| | | }, |
| | | // 重算 |
| | | recalculate() { |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .page-view { |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | .custom-name { |