123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- </div>
- <div class="customer-main">
- <trade-card title="基础明细">
- <avue-crud ref="crud" :data="data" :option="tableOption" @saveColumn="saveColumn" @resetColumn="resetColumn"
- :cell-style="cellStyle">
- </avue-crud>
- </trade-card>
- </div>
- </div>
- </template>
- <script>
- import tableOption from "./config/customerContact.json";
- export default {
- name: "detailsPageEdit",
- data() {
- return {
- show: true,
- treeStyle: "height:" + (window.innerHeight - 315) + "px",
- disabled: false,
- tableOption: {},
- data: [],
- };
- },
- props: {
- detailData: {
- type: Object
- }
- },
- async created() {
- if (this.detailData.id) {
- this.getDetail(this.detailData.id);
- }
- this.tableOption = await this.getColumnData(
- this.getColumnName(179.1),
- tableOption
- );
- },
- methods: {
- cellStyle() {
- return "padding:0;height:40px;";
- },
- getDetail(id) {
- this.loading = true;
- this.pageLoading = true;
- },
- //返回列表
- backToList() {
- this.$emit("goBack");
- },
- openEdit() {
- this.detailData.status = 2;
- this.option = this.$options.data().option;
- this.$refs.crud.refreshTable();
- },
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(179.1),
- this.tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.tableOption = tableOption;
- const inSave = await this.delColumnData(
- this.getColumnName(179.1),
- tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("重置成功");
- //关闭窗口
- setTimeout(() => {
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }, 1000);
- }
- }
- },
- watch: {
- }
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .select-component {
- display: flex !important;
- }
- </style>
|