zuozhengqing
2023-11-21 d897e9aac7689926551ae413a22430540f765846
src/views/supplierManage/supplier/RaleteSupplierList.vue
@@ -16,6 +16,8 @@
        </div>
      </div>
      <div slot="footer" class="dialog-footer"></div>
      <!-- 详情 -->
      <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" />
    </el-dialog>
  </div>
</template>
@@ -23,6 +25,7 @@
<script>
import { getProductList } from "@/api/productManage/product"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailSupplier from "@/views/supplierManage/supplier/DetailSupplier"
export default {
  name: "AddSupplierDialog",
  mixins: [pageMixin],
@@ -37,13 +40,25 @@
      }
    }
  },
  components: {},
  components: { DetailSupplier },
  computed: {},
  data() {
    return {
      dialogWidth: "80%",
      dialogWidth: "60%",
      editConfig: this.commonConfig,
      tableList: {}
      tableList: {},
      commonDetail: {
        visible: false,
        infomation: {}
      },
      showCol: ["供应商编号", "供应商名称", "采购价格", "供货天数", "物流时长(天)"],
      tableColumn: [
        { label: "供应商编号", prop: "supplierNumber", min: 190, isCommonClick: true },
        { label: "供应商名称", prop: "supplierName", min: 130 },
        { label: "采购价格", prop: "purchasePrice", min: 130 },
        { label: "供货天数", prop: "deliveryTime", min: 130 },
        { label: "物流时长(天)", prop: "shippingDuration", min: 130 }
      ]
    }
  },
  created() {
@@ -51,18 +66,36 @@
    this.getProductList()
  },
  methods: {
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "供应商编号", prop: "supplierNumber", min: 190, isCommonClick: true },
          { label: "供应商名称", prop: "supplierName", min: 130 },
          { label: "采购价格", prop: "purchasePrice", min: 130 },
          { label: "供货天数", prop: "deliveryTime", min: 130 },
          { label: "物流时长(天)", prop: "shippingDuration", min: 130 }
        ]
        highlight: true,
        ref: "tableListRef",
        showcol: this.showCol,
        allcol: [],
        tableColumn: this.setColumnVisible(this.showCol)
      }
      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
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 产品列表
    async getProductList(val, content) {
@@ -82,7 +115,7 @@
          }
        })
        this.tableList.tableInfomation = list || []
        this.tableList.totalCount = res.data.data.total
        this.pagerOptions.totalCount = res.data.data.total
      })
    },
    handleClose() {
@@ -90,8 +123,8 @@
    },
    selCommonClick(row) {
      console.log(row)
      // this.commonDetail.visible = true
      // this.commonDetail.infomation = { ...row }
      this.commonDetail.visible = true
      this.commonDetail.infomation = { ...row.supplier }
    }
  }
}