/** * @description 串号修改记录组件 */ Vue.component('component-serial-modify-record', { template: `
`, data() { return { page: 1, //页数 limit: 6, //每页行数 total: 0, //数据总数 tableData: [], //当前页数据 dialogVisible: false //窗口显示控制 } }, methods: { /** * @description 弹出关闭 */ dialogClose() { this.page = 1 this.total = 0 this.tableData = [] }, /** * @description 分页组件切换事件 * @param {Number} currentPage 当前分页数 */ currentChange(currentPage) { this.page = currentPage this._getTableData() }, /** * @description 获取列表数据 * @private */ _getTableData() { this.sendRequest('Retail/Customer/serialModifyRecord', { data: { id: this.id, page: this.page, limit: this.limit }, success: (response) => { if (response.status == 1) { const data = response.data this.tableData = data.list this.total = data.count } else { this.$message.error(response.message) } } }) } }, watch: { /** * @description 监听父组件显示控制变量的变化 */ visible() { this.dialogVisible = this.visible this._getTableData() }, /** * @description 监听当前组件的显示控制变量的变化 */ dialogVisible() { this.$emit('update:visible', this.dialogVisible) } }, props: [ 'visible', //父组件的显示控制 'id' //修改记录ID ] })