石广澎
2024-01-05 b2429057ae17e9f5b357435b0bff5f6cc0040b69
admin-web/src/views/foundation/store/index.vue
@@ -15,6 +15,7 @@
          </el-row>
          <!--添加/编辑弹窗-->
          <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/>
          <person v-if="personSetting.show" :setting="personSetting" @close="personSetting.show = false" @search="search"/>
        </el-card>
      </el-container>
    </el-container>
@@ -31,27 +32,28 @@
import MyButton from "@/components/myButton/myButton";
import SettingIplatform from '@/utils/settingIplatform';
import edit from './edit'
import person from './person'
import * as finsystenant from '@/api/baseSetting/finsystenant'
import myImport from '@/views/components/myImport'
import {getBaseUrl} from '@/utils/base';
export default {
  name: "index",
  components: {MyButton, MyTableV2, edit, myImport},
  components: {MyButton, MyTableV2, edit, myImport, person},
  data() {
    return {
      // 搜索框
      items: [
        {
          type: 'text',
          dataIndex: 'name',
          dataIndex: 'warehouseName',
          label: '仓库名称',
          placeholder: '请输入',
          defaultValue: ''
        },
        {
          type: 'select',
          dataIndex: 'status',
          dataIndex: 'states',
          label: '状态',
          placeholder: '请选择',
          defaultValue: '1',
@@ -100,11 +102,17 @@
        orgId: '',
        show: false,
      },
      personSetting: {
        title: '',
        id: '',
        orgId: '',
        show: false,
      },
      // 表格数据
      table: {
        showIndex: true, // 是否显示序号
        expand: false, // 是否显示详情数据
        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址
        url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/list', // 请求地址
        // 工具条
        tools: {
          columnsCtrl: {// 列控制按钮
@@ -125,19 +133,19 @@
        },
        // 列信息
        columns: [
          {title: '名称仓库', field: 'name', align: 'left',},
          {title: '编号', field: 'code', align: 'center'},
          {title: '类型', field: 'lv', align: 'center', },
          {title: '地址', field: 'lv', align: 'center', },
          {title: '所属机构', field: 'summary', align: 'left',},
          {title: '仓库名称', field: 'warehouseName', align: 'left', minWidth: 140},
          {title: '编号', field: 'warehouseCode', align: 'center', width: 120},
          {title: '类型', field: 'classificationName', align: 'center', width: 120 },
          {title: '地址', field: 'adress', align: 'left', minWidth: 140 },
          {title: '所属机构', field: 'agencyName', align: 'left',minWidth: 140 },
          {
            field: 'belongProvince',
            field: 'states',
            title: '状态',
            align: 'center',
            width: 100,
            switch: row => {
              const result = {}
              if (row.status == 1) {
              if (row.states == 1) {
                Object.assign(result, {
                  value: true, // 开
                  label: '是', // 开的描述
@@ -161,7 +169,7 @@
        // 操作信息
        operation: {
          show: true, // 显示操作列
          width: '150', // 列宽
          width: 240, // 列宽
          attr: [
            {
              title: '编辑',
@@ -176,9 +184,10 @@
              },
            },
            {
              title: '仓库员',
              title: '库管员',
              type:'primary',
              events: (row) => {
                this.showAudit(row);
                this.showPerson(row);
              },
            }
          ],
@@ -227,13 +236,13 @@
    },
    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.warehouseName + '"吗?').then(function () {
        let params = Object.assign({}, row)
        params.status = row.status == 1 ? 0 : 1
        finsystenant.edit(params).then(res => {
        params.states = row.states == 1 ? 0 : 1
        finsystenant.editstore(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()
          }
@@ -242,9 +251,9 @@
    },
    del(row) {
      this.$modal
        .confirm('是否确认删除名称为"' + row.name + '"的机构吗?')
        .confirm('是否确认删除名称为"' + row.warehouseName + '"的机构吗?')
        .then(function () {
          finsystenant.del({id: row.id}).then((res) => {
          finsystenant.delstore({id: row.id}).then((res) => {
          });
        })
        .then((res) => {
@@ -270,6 +279,12 @@
      this.editSetting.title = '编辑';
      this.editSetting.show = true;
    },
    showPerson(row) {
      this.personSetting.id = row.id;
      this.personSetting.info = JSON.stringify(row);
      this.personSetting.title = '选择库管员';
      this.personSetting.show = true;
    },
    nodeClick(param) {
      param = param || {}
      this.p = Object.assign({}, {
@@ -289,7 +304,7 @@
    // 查询table列表
    search(pageNum) {
      if (pageNum != undefined) {
        this.$refs.myTable.search(pageNum)
        this.$refs.myTable.search({pageNum})
      } else {
        this.$refs.myTable.search()
      }