haoxuan
2023-08-29 87f7f7a7588e926c6535eea2910ae98ca4101994
src/views/purchaseManage/quality/index.vue
@@ -16,9 +16,13 @@
          ref="tableListRef"
          :table-list="tableList"
          @selCommonClick="selCommonClick"
          @getSelectArray="getSelectArray"
        >
          <template slot="tableButton">
            <el-table-column label="状态" width="120">
              <template slot-scope="scope">
               {{ getQualityStatus(scope.row.member_name) }}
              </template>
            </el-table-column>
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button  @click="qualityClick(scope.row)" type="text" size="small">去质检</el-button>
@@ -41,9 +45,11 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import {
  getPurchaseList,getPurchaseInfo,submitPurchase,
} from "@/api/purchaseManage/purchase";
import DetailSupplier from "@/views/purchaseManage/quality/DetailSupplier"
import { getDataByType } from "@/api/data";
export default {
  name: "SupplierManage",
  props: {},
@@ -58,7 +64,8 @@
        visible: false,
        infomation: {}
      },
      search_map: {}
      search: {},
      qualityStatusList:getDataByType('qualityStatus'),
    }
  },
  created() {
@@ -66,6 +73,17 @@
    this.getData()
  },
  methods: {
    getQualityStatus(val) {
      if (val) {
        for (let i in this.qualityStatusList) {
          if (this.qualityStatusList[i].id == val) {
            return this.qualityStatusList[i].name;
          }
        }
      } else {
        return "--";
      }
    },
    setTable() {
      this.tableList = {
        tableInfomation: [],
@@ -78,30 +96,22 @@
          { label: "到货仓库", prop: "sales_resources", min: 130 },
          { label: "质检数量", prop: "province", min: 130 },
          { label: "检验员", prop: "city", min: 130 },
          { label: "状态", prop: "member_name", min: 110 },
          // { label: "状态", prop: "member_name", min: 110 },
          { label: "质检时间", prop: "member_name", min: 150 },
        ]
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        search_map: this.search_map,
      await getPurchaseList({
        keyword: this.search,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          const list = res.data.list.map((item) => {
            return {
              ...item,
              province: item.Province.name,
              city: item.City.name,
              sales_resources: item.sales_sources.name,
              member_name: item.member.username
            }
          })
          const list = res.data.data.list
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.count
          this.pagerOptions.totalCount = res.data.data.total
        })
        .catch((err) => {
          console.log(err)
@@ -110,13 +120,11 @@
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.search = content
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.search = ''
      this.getData()
    },
   
@@ -129,7 +137,7 @@
        })
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
            submitPurchase({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("确认发货成功")
                this.getData()
@@ -140,18 +148,21 @@
          })
          .catch(() => {})
    },
    getSelectArray(val) {
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 详情
    selCommonClick(row) {
      console.log(row)
      this.commonDetail.visible = true
      this.commonDetail.infomation = { ...row }
      getPurchaseInfo({id:row.ID}).then((res) => {
        if (res.code == 200) {
          this.commonDetail.visible = true
          this.commonDetail.infomation = {
            productList:res.data.productList,
            ...res.data.purchase
           }
        }else{
          this.$message.error(res.msg?res.msg+',':''+'获取信息失败!')
        }
      })
    }
  }
}