zhy
2023-10-30 cfed1ec2b3688352b4f708e98c04a2085c746331
admin-web/src/views/foundation/classification/index.vue
@@ -38,8 +38,7 @@
import edit from './edit'
import * as finsystenant from '@/api/baseSetting/finsystenant'
import myImport from '@/views/components/myImport'
import {updStatus} from "@/api/baseSetting/finsystenant";
import {getBaseUrl, getUploadUrl} from '@/utils/base';
import {getBaseUrl} from '@/utils/base';
export default {
  name: "index",
@@ -55,7 +54,7 @@
        tenantId: null,
        userName: null,
        userPhone: null,
        status: 1
        states: 1
      },
      // 导入
      importSetting: {
@@ -85,7 +84,7 @@
      table: {
        showIndex: true, // 是否显示序号
        expand: false, // 是否显示详情数据
        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址
        url: SettingIplatform.apiBaseURL + '/pc/base/category/list', // 请求地址
        // 工具条
        tools: {
          columnsCtrl: {// 列控制按钮
@@ -106,9 +105,9 @@
        },
        // 列信息
        columns: [
          {title: '分类名称', field: 'category_Name', align: 'center'},
          {title: '分类名称', field: 'categoryName', align: 'center'},
          {title: '类别', field: 'classification', align: 'left'},
          {title: '显示顺序', field: 'order_Number', align: 'center', width: '80px'},
          {title: '显示顺序', field: 'orderNumber', align: 'center', width: '80px'},
          {
            field: 'states',
            title: '状态',
@@ -116,7 +115,7 @@
            width: 100,
            switch: row => {
              const result = {}
              if (row.status == 1) {
              if (row.states == 1) {
                Object.assign(result, {
                  value: true, // 开
                  label: '是', // 开的描述
@@ -190,23 +189,25 @@
    // 左侧树初始化
    initTreeData() {
      finsystenant.getTree().then(res => {
        console.log(res, 'restree');
        console.log(this.importSetting,'this.importSetting');
        const content = res || []
        this.treeDataList.splice(0, this.treeDataList.length)
        // this.treeDataList.splice(0, this.treeDataList.length)
        this.treeDataList = content
        if (content.length > 0) {
          this.importSetting.fileSettings.data = {pid: content[0].id}
        }
        // if (content.length > 0) {
        //   this.importSetting.fileSettings.data = {pid: content[0].id}
        // }
      })
    },
    updState(row) {
      let vm = this
      let text = row.status == 0 ? "启用" : "禁用";
      vm.$modal.confirm('确认要' + text + '"' + row.name + '"吗?').then(function () {
      let text = row.states == 0 ? "启用" : "禁用";
      vm.$modal.confirm('确认要' + text + '"' + row.categoryName + '"吗?').then(function () {
        let params = Object.assign({}, row)
        params.status = row.status == 1 ? 0 : 1
        params.states = row.states == 1 ? 0 : 1
        finsystenant.edit(params).then(res => {
          if (res) {
            row.status = row.status === 1 ? 0 : 1
            row.states = row.states === 1 ? 0 : 1
            vm.$modal.msgSuccess(text + "成功");
            vm.search()
          }
@@ -215,7 +216,7 @@
    },
    del(row) {
      this.$modal
        .confirm('是否确认删除名称为"' + row.name + '"的机构吗?')
        .confirm('是否确认删除名称为"' + row.categoryName + '"的机构吗?')
        .then(function () {
          finsystenant.del({id: row.id}).then((res) => {
          });
@@ -244,6 +245,7 @@
      this.editSetting.show = true;
    },
    nodeClick(param) {
      console.log(param, 'param');
      param = param || {}
      this.p = Object.assign({}, {
        id: param.id,