yangfeng
2023-11-14 02b7655966b254a1c2b9f59006d52deb71aff3f4
src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
@@ -31,7 +31,9 @@
        >
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
          <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
          <div class="btn-pager">
            <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
          </div>
        </div>
      </div>
    </el-dialog>
@@ -40,8 +42,11 @@
<script>
import { getSupplierList } from "@/api/supplierManage/supplier"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
export default {
  name: "EditSelClientDialog",
  mixins: [pageMixin],
  props: {
    editCommonConfig: {
      type: Object,
@@ -58,7 +63,7 @@
  computed: {},
  data() {
    return {
      dialogWidth: "50%",
      dialogWidth: "40%",
      editConfig: this.editCommonConfig,
      queryInput: "",
      select: "1",
@@ -69,8 +74,8 @@
      tableList: {},
      search_map: {},
      tableColumn: [
        { label: "供应商编号", prop: "number", min: 190, isCommonClick: true },
        { label: "供应商名称", prop: "name", min: 130 },
        { label: "供应商编号", prop: "number", min: 190 },
        { label: "供应商名称", prop: "name", min: 130, isCommonClick: true },
        { label: "供应商类型", prop: "supplierType", min: 130 },
        { label: "所属行业", prop: "industry", min: 130 },
        { label: "联系人", prop: "contact", min: 130 },
@@ -78,25 +83,23 @@
        { label: "状态", prop: "status_name", min: 130 },
        { label: "创建时间", prop: "member_name", min: 130 }
      ],
      showCol: ['供应商编号', '供应商名称', '供应商类型', '所属行业', '联系人', '联系电话','状态','创建时间']
      showCol: ["供应商编号", "供应商名称", "供应商类型", "联系人", "联系电话", "状态"]
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  mounted(){
  },
  mounted() {},
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn:this.setColumnVisible(this.showCol),
        tableColumn: this.setColumnVisible(this.showCol),
        showcol: this.showCol,
        allcol:[]
        allcol: []
      }
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
@@ -105,14 +108,14 @@
      }
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
@@ -122,22 +125,23 @@
    // 请求数据
    async getData(val, content) {
      this.loading = true
      await getSupplierList({
        [val]: content,
        page:1,
        pageSize: 10
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          if (res.data.code == 200) {
            if (res.data.data.list && res.data.data.list.length > 0) {
              const list = res.data.data.list.map((item) => {
          if (res.code == 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item,
                  status_name: item.status === 0 ? "未启用" : "启用"
                }
              })
              // this.tableList.tableInfomation = list.slice(0, 5) || []
              this.tableList.tableInfomation = list
              this.pagerOptions.totalCount = res.data.total
            } else {
              this.tableList.tableInfomation = []
            }
@@ -192,9 +196,16 @@
  cursor: pointer;
}
.dialog-footer {
  height: 40px;
  line-height: 40px;
  height: 50px;
  line-height: 50px;
  color: red;
  .btn-pager {
    display: flex;
    margin-top: 0px;
    .page {
      margin-left: auto;
    }
  }
}
::v-deep {
  .input-with-select .el-input-group__prepend {