<template>
|
<div class="history-maintain-info">
|
<ProTable
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:isAutoIndex="true"
|
:list="records"
|
:header="tableHeader"
|
:loading="loading"
|
/>
|
<el-dialog
|
:title="dialogTitle"
|
:visible.sync="dialogVisible"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
:destroy-on-close="true"
|
:show-close="false"
|
custom-class="stock_dialog"
|
width="890px"
|
center
|
>
|
<MainTainDetail @closeDialog="closeDialog" :tempRecord="tempRecord" />
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import ProTable from "@/views/components/ProTable";
|
import MainTainDetail from './MainTainDetail'
|
|
import { qryChangeRecords } from "@/http/api.js";
|
export default {
|
components: {
|
ProTable,
|
MainTainDetail
|
},
|
props: {
|
tableHeader: {
|
type: [Object, Array],
|
default: () => {
|
return [];
|
}
|
},
|
screenWidth: {
|
type: Number,
|
default: () => {
|
return 1280;
|
}
|
}
|
},
|
created() {
|
this.init();
|
},
|
data() {
|
return {
|
loading: false,
|
dialogVisible: false,
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0
|
},
|
records: [],
|
dialogTitle: '维护详情',
|
tempRecord: {}
|
};
|
},
|
methods: {
|
async init() {
|
const { pageInfo, $route } = this;
|
const { query } = $route;
|
const { customerId, customerTypeCode } = query;
|
const queryType = customerTypeCode === "01" ? "0" : "1";
|
const params = {
|
customerId,
|
queryType,
|
...pageInfo
|
};
|
const { result } = await qryChangeRecords(params);
|
this.records = result.records.map(item => {
|
const newItem = { ...item };
|
// newItem.operationOption = [
|
// { key: "Maintain", label: "维护详情", value: true }
|
// ];
|
return newItem;
|
});
|
this.$set(this.pageInfo, "total", result.total);
|
},
|
handleAddCus() {},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.init();
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.init();
|
},
|
// 表单事件回调
|
async doAction(name, item, { type }) {
|
const { operationOption } = item;
|
this.tempRecord = { ...item }
|
operationOption.forEach(value => {
|
if (value.key === "Maintain") {
|
this.dialogVisible = true
|
}
|
});
|
},
|
closeDialog() {
|
this.dialogVisible = false
|
},
|
async handleClickRowBtn(type, item) {
|
// 编辑详情
|
// if (type === "EDIT") {
|
// this.$router.push({
|
// name: "clientsModify",
|
// query: { from: "edit", ...item }
|
// });
|
// }
|
// // 处理详情
|
// if (type === "DETAIL") {
|
// this.$router.push({
|
// name: "clientsDetail",
|
// query: { from: "edit", ...item }
|
// });
|
// }
|
// if (type === "DELETE") {
|
// const params = {
|
// dirno: item.dirno
|
// };
|
// const delRes = await delBusinessImageCatalog(params);
|
// if (delRes && delRes.code === "00") {
|
// this.$message.success("删除成功");
|
// this.$refs.imageTablelist.getTableList();
|
// }
|
// }
|
}
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.history-maintain-info {
|
}
|
</style>
|