| | |
| | | :span-method="arraySpanMethod" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | |
| | | v-else-if="item.productName" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '产品名称不能为空' }]" |
| | | > |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | |
| | | <div class="common-select-btn" @click="selClientClick(scope.row, item.prop)"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient(scope.row)"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | <div |
| | | v-if="scope.row[item.prop] && scope.row[item.prop].length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient(scope.row)" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | <el-button size="small" type="primary" @click="add">新增</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> --> |
| | | <el-button size="small" type="primary" @click="empty">清空</el-button> |
| | | <el-button size="small" type="primary" @click="recalculate">重算</el-button> |
| | | <el-button size="small" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true" |
| | | >重算</el-button |
| | | > |
| | | </div> |
| | | <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px"> |
| | | <el-row :gutter="10"> |
| | |
| | | default: () => { |
| | | return { |
| | | tableData: [], // 接口返回数据 |
| | | isReturn: false, |
| | | tableColumn: [ |
| | | // table表单 |
| | | { label: "", prop: "", min: 200, tooltip: true } |
| | |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | productIndex: 0 |
| | | productIndex: 0, |
| | | isRecalculate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.getProductList() |
| | | this.tableList = this.productTableList |
| | | if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") { |
| | | this.isRecalculate = false |
| | | } else { |
| | | this.isRecalculate = true |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | |
| | | sums[index] = "小计:" |
| | | return |
| | | } |
| | | const title = ["#"] |
| | | const title = ["#", "产品名称"] |
| | | // 去除某些不需要计算的数据 |
| | | if (title.includes(column.label)) { |
| | | sums[index] = "" |
| | |
| | | commonInputChange(val, prop, row) { |
| | | console.log(val, prop) |
| | | console.log(row) |
| | | if (prop === "amount") { |
| | | this.tableList.tableData.map((ite) => { |
| | | if (ite.name === row.name) { |
| | | ite.total = row.amount * row.price |
| | | } |
| | | }) |
| | | } |
| | | this.$emit("inputContent", val, prop, row) |
| | | }, |
| | | // 清空 |
| | | empty() { |
| | | this.isRecalculate = false |
| | | this.$emit("emptyProductClick") |
| | | }, |
| | | // 重算 |
| | |
| | | }, |
| | | handleSelectClient(item, prop, row) { |
| | | // this.clientId = item.id |
| | | this.isRecalculate = true |
| | | console.log(item, prop, row) |
| | | this.tableList.tableData.map((ite) => { |
| | | if (ite.name === item.name) { |
| | |
| | | selClient(item) { |
| | | console.log(item) |
| | | console.log(this.tableList.tableData) |
| | | this.isRecalculate = true |
| | | // this.editConfig.infomation.client_name = row.name |
| | | this.tableList.tableData.map((ite, index) => { |
| | | if (index === this.productIndex) { |