jinlin
2026-02-27 884d1457cebbda20ad2539550062c408a58709be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<template>
  <div>
    <el-row :gutter="5">
      <el-col :span="7">
        <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
          <ft-category-select ref="category" @on-selected="onCategorySelected"/>
        </div>
      </el-col>
      <el-col :span="17">
        <div class="mod-ftCategory-ftCategory fa-card-a" style="margin-left: 5px;">
          <zt-table-wraper ref="tableObj" query-url="/ftDetail/FtDetail/page" delete-url="/ftDetail/FtDetail/"
                           v-slot="{ table }">
            <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
              <el-form-item>
                <el-input v-model="dataForm.accountCode" placeholder="请输入科目编码" clearable></el-input>
 
              </el-form-item>
              <el-form-item>
                <zt-button type="query" @click="table.query()"/>
                <zt-button type="add" @click="add()"/>
                <zt-button type="delete" @click="table.deleteHandle()"/>
              </el-form-item>
            </el-form>
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
                      border @selection-change="table.selectionChangeHandle">
              <el-table-column type="selection" width="40"/>
              <el-table-column prop="accountCode" label="科目编码"/>
              <el-table-column prop="assCode" label="辅助项目编码"/>
              <el-table-column prop="assName" label="辅助项目名称"/>
              <el-table-column prop="ftExpense" label="分摊费用"/>
              <el-table-column prop="remark" label="备注"/>
              <zt-table-column-handle :table="table" :has-edit="false"/>
            </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-or-update ref="AddOrUpdate" @refreshDataList="table.query"/>
            <ft-detail-add ref="add" @refreshDataList="table.query"/>
          </zt-table-wraper>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
  import FtDetailUpdate from './ftDetail-Update.vue'
  import FtCategorySelect from '@/views/modules/ftCategory/ftCategorySelect.vue'
  import FtDetailAdd from "@/views/modules/ftDetail/ftDetail-Add.vue";
 
  export default {
    data() {
      return {
        dataForm: {
          accountCode: '',
          ftCategoryId: ''
        }
      }
    },
    components: {
      FtDetailAdd,
      FtCategorySelect,
      AddOrUpdate: FtDetailUpdate
    },
 
    methods: {
      add() {
        if (this.dataForm.ftCategoryId === '') {
          this.$alert('请选择分摊名目')
          return
        }
        this.$refs.add.$refs.dialog.init(null, this.dataForm.ftCategoryId)
      },
      onCategorySelected(row) {
        this.dataForm.ftCategoryId = row.id
        this.$refs.tableObj.query()
      }
    }
  }
</script>