| | |
| | | <el-table-column label="åºå·" type="index" fixed="left" width="55" align="center"></el-table-column> |
| | | <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" |
| | | :prop="item.field" :label="item.title" :width="item.width" align="center"> |
| | | <template #default="scoped" v-if="item.type == 'icon'"> |
| | | <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom"><el-button |
| | | type="text" @click="tableButtonClick(scoped.row, item)"><i :class="item.icon" |
| | | style="font-size: 22px"></i></el-button></el-tooltip> |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip class="item" effect="dark" :content="item.title" |
| | | placement="bottom"><el-button type="text" |
| | | @click="tableButtonClick(scoped.row, item)"><i :class="item.icon" |
| | | style="font-size: 22px"></i></el-button></el-tooltip> |
| | | </div> |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | row: {}, |
| | | row: null, |
| | | tableData: [], |
| | | tableColumns: [ |
| | | { |
| | |
| | | { |
| | | field: "beforeStatus", |
| | | title: "åå¨åè´§ä½ç¶æ", |
| | | type: "string", |
| | | type: "tag", |
| | | width: 150, |
| | | align: "left", |
| | | bindKey: "locationStatusEnum" |
| | |
| | | { |
| | | field: "afterStatus", |
| | | title: "åå¨åè´§ä½ç¶æ", |
| | | type: "decimal", |
| | | type: "tag", |
| | | width: 150, |
| | | align: "left", |
| | | bindKey: "locationStatusEnum" |
| | |
| | | { |
| | | field: "changeType", |
| | | title: "åå¨ç±»å", |
| | | type: "string", |
| | | width: 90, |
| | | type: "tag", |
| | | width: 100, |
| | | align: "left", |
| | | bindKey: "stockChangeType", |
| | | }, |
| | |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "int", |
| | | width: 120, |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true, |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | |
| | | hidden: true, |
| | | }, |
| | | ], |
| | | paginations: { |
| | | sort: "CreateDate", |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | | }, |
| | | dictionaryList: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | this.getDetailData(); |
| | | getDictionaryData(); |
| | | this.getDictionaryData(); |
| | | }, |
| | | getDetailData() { |
| | | this.http |
| | |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.tableData = x.data; |
| | | console.log(this.tableData); |
| | | }); |
| | | }, |
| | | getDictionaryData() { |
| | |
| | | }); |
| | | }, |
| | | getDictionary(row, column) { |
| | | if (this.dictionaryList) { |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.prop]); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | | return row[column.prop]; |
| | | } |
| | | } else { |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if (row.isNormal) { |
| | | |
| | | } else if (row.isManual) { |
| | | return "success-row"; |
| | | if (this.dictionaryList) { |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.field]); |
| | | console.log(dicItem); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } |
| | | else { |
| | | return row[column.field]; |
| | | } |
| | | } else { |
| | | return row[column.field]; |
| | | } |
| | | } |
| | | |
| | | }, |
| | | }, |
| | | |