| | |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | align="right" |
| | | align="center" |
| | | > |
| | | <!-- 表头样式 --> |
| | | <template slot="header"> |
| | |
| | | </template> |
| | | <!-- column样式 --> |
| | | <template slot-scope="scope"> |
| | | <el-form-item |
| | | v-if="item.input" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="item.date" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <!-- <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini"></el-input> --> |
| | | <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px" disabled> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <template v-if="!detailEnter"> |
| | | <el-form-item |
| | | v-if="item.input" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <el-input |
| | | v-model.trim="scope.row[item.prop]" |
| | | maxlength="50" |
| | | size="mini" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="item.date" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <!-- <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini"></el-input> --> |
| | | <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <div style="margin: 10px"> |
| | | <el-button size="small" type="primary" disabled>新增</el-button> |
| | | <el-button size="small" type="primary" disabled>导入明细</el-button> |
| | | <el-button size="small" type="primary" disabled>清空</el-button> |
| | | <el-button size="small" type="primary" disabled>重算</el-button> |
| | | <div v-if="!detailEnter" style="margin: 10px"> |
| | | <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">清空</el-button> |
| | | <el-button size="small" type="primary">重算</el-button> |
| | | </div> |
| | | <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px"> |
| | | <el-row :gutter="10"> |
| | |
| | | export default { |
| | | name: "CommmonFormTableView", |
| | | props: { |
| | | detailEnter: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | | default: () => { |
| | |
| | | data() { |
| | | return {} |
| | | }, |
| | | computed: { |
| | | maxHeight() { |
| | | if (this.productTableList.height) { |
| | | return `calc(100vh - ${this.productTableList.height})` |
| | | } |
| | | return undefined |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | handleReserve(row) { |
| | | return row._id ? row._id : row.id |
| | |
| | | s[1] = s[1].substring(0, prec) //小数点位数超出长度时截取前面的位数 |
| | | } |
| | | return s.join(dec) |
| | | }, |
| | | add() { |
| | | this.$emit("addProductClick") |
| | | }, |
| | | commonInputChange(val, prop, row) { |
| | | console.log(val, prop) |
| | | console.log(row) |
| | | this.$emit("inputContent", val, prop, row) |
| | | } |
| | | } |
| | | } |