zhangherong
14 小时以前 7282d4b49f4577c6807a78bdd6e705feb2fe0e2c
src/views/base/WarehouseList.vue
@@ -11,18 +11,18 @@
        <a-row :gutter="30">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库编号">
            <a-form-item label="线边库编号">
              <j-input
                placeholder="请输入仓库编号检索"
                placeholder="请输入线边库编号检索"
                v-model="queryParam.warehouseCode"
              ></j-input>
            </a-form-item>
          </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库名称">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="线边库名称">
              <j-input
                placeholder="请输入仓库名称检索"
                placeholder="请输入线边库名称检索"
                v-model="queryParam.warehouseName"
              ></j-input>
            </a-form-item>
@@ -44,7 +44,8 @@
        @click="handleAdd"
        type="primary"
        icon="plus"
      >新增</a-button>
      >新增
      </a-button>
    </div>
    <!-- table区域-begin -->
@@ -60,6 +61,7 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <!--状态栏个性展示-->
        <span
@@ -89,8 +91,8 @@
        >
          <a
            href="javascript:;"
            @click="handleDetail(record)"
          >详情</a>
            @click="handleEdit(record)"
          >编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
@@ -98,19 +100,10 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item v-if="record.warehouseStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.warehouseStatus == 0">
               <a-menu-item v-if="record.warehouseStatus == 0">
                <a-popconfirm
                  title="确定启用吗?"
                  @confirm="() => handleActive(record.id)"
@@ -126,6 +119,16 @@
                  <a>禁用</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
@@ -146,7 +149,7 @@
//按需引入 组件
import WarehouseModel from './modules/warehouse/WarehouseModel'
import { deleteAction, requestPut, getAction } from '@/api/manage'
import { getAction, requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import JInput from '@/components/jeecg/JInput'
@@ -157,7 +160,7 @@
  components: {
    WarehouseModel,
    JEllipsis,
    JInput,
    JInput
  },
  data() {
    return {
@@ -165,12 +168,19 @@
      /* 分页参数 */
      ipagination: {
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['5', '10', '20'],
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " 共" + total + "条"
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      /* 排序参数 */
      isorter:{
        column: 'warehouseCode',
        order: 'asc',
      },
      // 表头
      columns: [
@@ -179,19 +189,19 @@
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '线边库编号',
          align: "center",
          align: 'center',
          dataIndex: 'warehouseCode'
        },
        {
          title: '线边库名称',
          align: "center",
          align: 'center',
          dataIndex: 'warehouseName'
        },
        {
@@ -204,7 +214,7 @@
          title: '状态',
          align: 'center',
          scopedSlots: {
            customRender: 'status',
            customRender: 'status'
          },
          dataIndex: 'warehouseStatus'
        },
@@ -213,78 +223,83 @@
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/base/lineSideWarehouse/list',
        delete: '/base/lineSideWarehouse/delete',
        active: '/base/lineSideWarehouse/active',
      },
        active: '/base/lineSideWarehouse/active'
      }
    }
  },
  mounted() {
  },
  methods: {
    loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1;
        this.ipagination.current = 1
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      var params = this.getQueryParams()//查询条件
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records;
          this.ipagination.total = res.result.total;
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false;
        this.loading = false
      })
    },
    //禁用状态样式
    tableRowClass(record, index) {
      if (record.warehouseStatus != "1") {
        return "frozenRowClass";
      if (record.warehouseStatus != '1') {
        return 'frozenRowClass'
      }
      return "";
      return ''
    },
    //启用禁用
    handleActive(id) {
      if (!this.url.active) {
        this.$message.error("请设置url.active!")
        this.$message.error('请设置url.active!')
        return
      }
      let that = this;
      let that = this
      requestPut(that.url.active, {}, { id: id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message);
          that.loadData();
          that.$message.success(res.message)
          that.loadData()
        } else {
          that.$message.warning(res.message);
          that.$message.warning(res.message)
        }
      });
    },
  },
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
.fontweight {
  font-weight: bold;
}
.ant-card-body .table-operator {
  margin-bottom: 18px;
}
@@ -298,7 +313,7 @@
  margin: 0 5px;
}
/deep/.ant-btn-danger {
/deep/ .ant-btn-danger {
  background-color: #ffffff;
}