haoxuan
2023-08-24 5e89a1759a2d20e549587fc01cf6b57a3e82950a
采购管理的 前端页面开发 2023-8-24
8个文件已添加
5个文件已修改
2540 ■■■■■ 已修改文件
src/components/layout/components/AppMain.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SearchCommonView.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/purchase/index.js 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/DetailSupplier.vue 569 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/index.vue 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/quality/DetailSupplier.vue 338 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/quality/index.vue 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/returned/DetailSupplier.vue 352 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/returned/index.vue 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/warehouse/DetailSupplier.vue 345 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/warehouse/index.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/AppMain.vue
@@ -30,7 +30,7 @@
  flex: 1;
  flex-direction: column;
  // height: 100%;
  width: 100%;
  width: calc(100% - 210px);
  .app-main-content {
    width: 100%;
    overflow-y: auto;
src/components/layout/components/appsidebar/index.vue
@@ -25,10 +25,10 @@
            <i class="el-icon-phone-outline icon"></i>
            <span>采购管理</span>
          </template>
          <el-menu-item index="/sales/salesOpportunity">采购订单</el-menu-item>
          <el-menu-item index="/sales/quotation">采购质检单</el-menu-item>
          <el-menu-item index="/sales/masterOrder">采购入库单</el-menu-item>
          <el-menu-item index="/sales/subOrder">采购退货单</el-menu-item>
          <el-menu-item index="/purchaseManage/purchase">采购订单</el-menu-item>
          <el-menu-item index="/purchaseManage/quality">采购质检单</el-menu-item>
          <el-menu-item index="/purchaseManage/warehouse">采购入库单</el-menu-item>
          <el-menu-item index="/purchaseManage/returned">采购退货单</el-menu-item>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
src/components/makepager/SearchCommonView.vue
@@ -2,11 +2,13 @@
  <div class="search-list">
    <div class="search-top">
      <div class="search">
        <el-input placeholder="请输入内容" v-model="searchInput" class="input-with-select" clearable>
        <el-input v-if="inputSelect"  :placeholder="placeholder" v-model="searchInput" class="input-with-select" clearable>
          <el-select v-model="searchSelValue" slot="prepend" placeholder="请选择" class="search-sel">
            <el-option v-for="item in searchOptions" :key="item.value" :label="item.label" :value="item"> </el-option>
          </el-select>
          <!-- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> -->
        </el-input>
        <el-input v-else :placeholder="placeholder" v-model="searchInput" class="input-with-select" clearable>
        </el-input>
      </div>
      <div class="btn">
@@ -24,6 +26,14 @@
  name: "SearchCommonView",
  components: {},
  props: {
    placeholder:{
      type:String,
      default:'请输入内容',
    },
    inputSelect:{
      type:Boolean,
      default:true,
    },
    queryClass: {
      type: String,
      default: "1"
src/components/makepager/TableCommonView.vue
@@ -118,7 +118,8 @@
        return {
          show: false,
          sumProp: [],
          mergeNumber: 1
          mergeNumber: 1,
          totalName:'本页总计'
        }
      }
    }
@@ -159,7 +160,7 @@
        const sums = []
        columns.forEach((column, index) => {
          if (index === this.showSummary.mergeNumber) {
            sums[index] = "本页总计"
            sums[index] = this.showSummary.totalName
          }
          const values = data.map((item) => Number(item[column.property]))
          if (this.showSummary.sumProp.includes(column.property)) {
src/router/purchase/index.js
@@ -1,43 +1,45 @@
// const type from '@/router/deployCode'
// const salesOpportunity = (resolve) => require(["@/views/sales/salesOpportunity/index"], resolve) // 销售机会
// const quotation = (resolve) => require(["@/views/sales/quotation/index"], resolve) // 报价单
// const masterOrder = (resolve) => require(["@/views/sales/masterOrder/index"], resolve) // 销售总单
// const subOrder = (resolve) => require(["@/views/sales/subOrder/index"], resolve) // 销售子单
const purchase = (resolve) => require(["@/views/purchaseManage/purchase/index"], resolve) // 采购单
const quality = (resolve) => require(["@/views/purchaseManage/quality/index"], resolve) // 采购质检单
const warehouse = (resolve) => require(["@/views/purchaseManage/warehouse/index"], resolve) // 采购入库单
const returned= (resolve) => require(["@/views/purchaseManage/returned/index"], resolve) // 采购退货单
const appconfig = [
  // {
  //   path: "/sales/salesOpportunity",
  //   name: "salesOpportunity",
  //   component: salesOpportunity,
  //   meta: {
  //     title: "销售机会"
  //   }
  // },
  // {
  //   path: "/sales/quotation",
  //   name: "quotation",
  //   component: quotation,
  //   meta: {
  //     title: "报价单"
  //   }
  // },
  // {
  //   path: "/sales/masterOrder",
  //   name: "masterOrder",
  //   component: masterOrder,
  //   meta: {
  //     title: "销售总单"
  //   }
  // },
  // {
  //   path: "/sales/subOrder",
  //   name: "subOrder",
  //   component: subOrder,
  //   meta: {
  //     title: "销售子单"
  //   }
  // }
  {
    path: "/purchaseManage/purchase",
    name: "purchase",
    component: purchase,
    meta: {
      title: "采购管理",
      requireAuth: true
    }
  },
  {
    path: "/purchaseManage/quality",
    name: "quality",
    component: quality,
    meta: {
      title: "采购质检单",
      requireAuth: true
    }
  },
  {
    path: "/purchaseManage/warehouse",
    name: "warehouse",
    component: warehouse,
    meta: {
      title: "采购入库单",
      requireAuth: true
    }
  },
  {
    path: "/purchaseManage/returned",
    name: "returned",
    component: returned,
    meta: {
      title: "采购退货单",
      requireAuth: true
    }
  }
]
export default appconfig
src/views/purchaseManage/purchase/DetailSupplier.vue
New file
@@ -0,0 +1,569 @@
<template>
  <div class="detail-view">
    <el-drawer
      :visible.sync="detailConfig.visible"
      size="80%"
      :before-close="handleClose"
      :wrapperClosable="false"
    >
      <template slot="title">
        <div class="header">
          <span class="header-label">采购详情</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
        <div class="btn" style="float: right; margin-right: 30px">
          <el-button type="primary" size="mini" style="margin-right: 5px"
            >打印</el-button
          >
          <el-button type="primary" size="mini" @click="emailClick"
            >Email通知下单</el-button
          >
          <el-button
            type="primary"
            size="mini"
            @click="deleteClick"
            style="margin-right: 5px"
            >删除</el-button
          >
        </div>
      </template>
      <div class="content">
        <div class="info">
          <ul>
            <li v-for="(list, i) in formInfoList" :key="i">
              <span class="content-title">{{ list.str + ":" }}</span>
              <span class="content-data">{{
                list.value ? list.value : "--"
              }}</span>
            </li>
          </ul>
        </div>
        <div class="tab-view">
          <el-tabs v-model="activeName" @tab-click="tabsClick">
            <el-tab-pane label="详情" name="first"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
          <!-- 基本信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">基本信息</span>
            </div>
            <div v-show="isBasicExpand" class="basic-info-content">
              <ul>
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">
                      {{ item.leftValue ? item.leftValue : "--" }}
                    </div>
                  </div>
                  <div
                    v-if="item.rightStr && item.rightStr.length > 0"
                    class="right"
                  >
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">
                      {{ item.rightValue ? item.rightValue : "--" }}
                    </div>
                  </div>
                </li>
              </ul>
              <div class="business_scope">
                <div class="content-title">{{ "备注信息:" }}</div>
                <div class="content-data">{{ record ? record : "--" }}</div>
              </div>
            </div>
          </div>
          <!-- 财务信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('dynamic')">
              <i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">财务信息</span>
            </div>
            <div v-show="isDynamicExpand" class="basic-info-content">
              <ul>
                <li v-for="(item, i) in dynamicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">
                      {{ item.leftValue ? item.leftValue : "--" }}
                    </div>
                  </div>
                  <div
                    v-if="item.rightStr && item.rightStr.length > 0"
                    class="right"
                  >
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">
                      {{ item.rightValue ? item.rightValue : "--" }}
                    </div>
                  </div>
                </li>
              </ul>
            </div>
          </div>
          <!-- 产品信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('three')">
              <i v-if="isExpandThree" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">产品信息</span>
            </div>
            <div v-show="isExpandThree" class="basic-info-content">
              <TableCommonView
                style="margin-top: 2px"
                class="content-table"
                ref="tableListRef"
                :showSummary="showSummary"
                :table-list="tableList"
              >
              </TableCommonView>
              <div class="table-bottom">
                <div class="table-bottom-item">
                  <div class="table-bottom-l">
                    整单折扣:直接降价
                  </div>
                  <div class="table-bottom-r">0.00</div>
                </div>
                <div class="table-bottom-item">
                  <div class="table-bottom-l">
                    调整:增加
                  </div>
                  <div class="table-bottom-r">0.00</div>
                </div>
                <div class="table-bottom-item">
                  <div class="table-bottom-l">
                    合计
                  </div>
                  <div class="table-bottom-r">26000.00</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script>
import { getDeleteSalesLeads } from "@/api/client/salesLead";
export default {
  name: "DetailSupplier",
  props: {
    commonDetail: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {},
          tableList: [],
        };
      },
    },
  },
  components: {},
  data() {
    return {
      detailConfig: this.commonDetail,
      activeName: "first",
      formInfoList: [], //信息
      isBasicExpand: true, // 基本信息展开
      basicInfoList: [],
      isDynamicExpand: true, // 账户信息
      dynamicInfoList: [],
      addConfig: {},
      record: "", // 最新进展
      noContactDays: 0,
      newContactDays: "",
      isExpandThree: true, //产品信息
      tableList: {},
      showSummary:{
        show: true,
        sumProp: ["number", "total"],
        mergeNumber: 4,
        totalName:'小计'
      },
    };
  },
  created() {
    this.setData(this.detailConfig.infomation);
    this.addConfig = {
      id_name: "sales_leads_id",
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.id,
      sales_leads_name: this.detailConfig.infomation.name,
      sales_leads_id: this.detailConfig.infomation.id,
    };
  },
  mounted() {},
  computed: {},
  methods: {
    // email 通知下单
    emailClick() {},
    // 删除
    deleteClick() {
      this.$confirm("是否删除?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
            if (response.code === 200) {
              this.$message.success("删除成功");
              this.getData();
            } else {
              this.$message.warning("删除失败");
            }
          });
        })
        .catch(() => {});
    },
    setData(item) {
      if (item.FollowRecord && item.FollowRecord.length > 0) {
        this.record = item.FollowRecord[0].record;
        console.log(item.FollowRecord[0].follow_time);
        let follow_time = item.FollowRecord[0].follow_time;
        this.newContactDays = follow_time.substring(0, 10);
        this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays);
      }
      this.formInfoList = [
        {
          str: "供应商名称",
          value: "",
        },
        {
          str: "合计",
          value: "",
        },
        {
          str: "已收票金额",
          value: "",
        },
        {
          str: "已付金额",
          value: "",
        },
        {
          str: "签约日期",
          value: "",
        },
        {
          str: "采购负责人",
          value: "",
        },
        {
          str: "未收票金额",
          value: "",
        },
        {
          str: "应付金额",
          value: "",
        },
      ];
      this.basicInfoList = [
        {
          leftStr: "采购订单编号",
          leftValue: item.number,
          rightStr: "供应商名称",
          rightValue: item.name,
        },
        {
          leftStr: "采购单状态",
          leftValue: item.contact_name,
          rightStr: "采购负责人",
          rightValue: item.contact_position,
        },
        {
          leftStr: "采购联系人",
          leftValue: item.contact_phone,
          rightStr: "联系电话",
          rightValue: "18513375588",
        },
        {
          leftStr: "签约日期",
          leftValue: item.sales_resources,
          rightStr: "交付日期",
          rightValue: item.member_name,
        },
        {
          leftStr: "到货仓库",
          leftValue: item.sales_resources,
          rightStr: "",
          rightValue: "",
        },
      ];
      this.dynamicInfoList = [
        {
          leftStr: "合计",
          leftValue: this.noContactDays,
          rightStr: "已收票金额",
          rightValue: this.newContactDays,
        },
        {
          leftStr: "已付总额",
          leftValue: "",
          rightStr: "未收票金额",
          rightValue: "",
        },
        {
          leftStr: "应付金额",
          leftValue: "",
          rightStr: "",
          rightValue: "",
        },
      ];
      this.tableList = {
        tableInfomation: [
            {
            number:1,
            total:1,
          }
        ],
        selectIndex: true,
        tableColumn: [
          { label: "产品名称", prop: "number", min: 190, isCommonClick: true },
          { label: "产品编码", prop: "total", min: 130, isCommonClick: true },
          { label: "计量单位", prop: "contact_name", min: 130 },
          { label: "规格型号", prop: "contact_phone", min: 130 },
          { label: "数量", prop: "contact_phone", min: 130 },
          { label: "销售单价", prop: "sales_resources", min: 130 },
          { label: "价税合计", prop: "province", min: 130 },
          { label: "描述", prop: "province", min: 130 },
        ],
      };
    },
    handleClose() {
      this.detailConfig.visible = false;
    },
    // tab切换
    tabsClick(tab, event) {
      console.log(tab, event);
    },
    // 展开收起点击事件
    expandClick(value) {
      console.log(value);
      if (value === "basic") {
        this.isBasicExpand = !this.isBasicExpand;
      } else if (value === "dynamic") {
        this.isDynamicExpand = !this.isDynamicExpand;
      } else {
        this.isExpandThree = !this.isExpandThree;
      }
    },
    // 计算两个日期之间的差值
    getDiffDay(date_1, date_2) {
      let totalDays, diffDate;
      let myDate_1 = date_1;
      let myDate_2 = Date.parse(date_2);
      // 将两个日期都转换为毫秒格式,然后做差
      diffDate = Math.abs(myDate_1 - myDate_2); // 取相差毫秒数的绝对值
      totalDays = Math.floor(diffDate / (1000 * 3600 * 24)); // 向下取整
      // console.log(totalDays)
      return totalDays; // 相差的天数
    },
  },
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.detail-view {
  .header {
    height: 56px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    .header-label {
      padding: 5px;
      border-radius: 4px;
      background-color: #ff6600;
      color: #fff;
      font-size: 12px;
    }
    .header-title {
      color: #323232;
      font-size: 15px;
      margin-left: 10px;
      font-weight: inherit;
    }
  }
  .content {
    height: 100%;
    background-color: rgb(230, 233, 240);
    padding: 8px;
    .tab-view {
      background: #fff;
      // .tab-view-pane {
      //   position: relative;
      .item {
        position: absolute;
        top: 0px;
        right: 0px;
      }
      // }
    }
    .info {
      width: 100%;
      height: auto;
      background: #fff;
      margin-bottom:10px;
      ul {
        width: 100%;
        height: auto;
        overflow: hidden;
        li {
          width: 25%;
          float: left;
          height: 40px;
          line-height: 40px;
          font-size: 14px;
          font-family: PingFangSC;
          border-bottom: 1px solid #f9f9fb;
          .content-title {
            width: 180px;
            display: inline-block;
            text-align: right;
            color: #555;
          }
          .content-data {
            width: calc(100% - 180px - 25px);
            display: inline-block;
            text-align: left;
            margin-left: 25px;
            color: #333;
          }
        }
      }
    }
    .detail {
      height: calc(100% - 40px - 92px);
      background: #fff;
      overflow: auto;
      .basic-info {
        .basic-info-label {
          padding-left: 10px;
          height: 42px;
          line-height: 42px;
          background: #f4f8fe;
          color: #333;
          font-size: 14px;
        }
        .basic-info-content {
          background: #fff;
          overflow:hidden;
          ul {
            padding-inline-start: 0;
          }
          li {
            display: flex;
            font-size: 14px;
            font-family: PingFangSC;
            border-bottom: 1px solid #f9f9fb;
            .left,
            .right {
              width: 50%;
              display: flex;
              align-items: center;
              height: 40px;
              .content-title {
                width: 180px;
                text-align: right;
                color: #555;
              }
              .content-data {
                text-align: left;
                margin-left: 25px;
                color: #333;
              }
            }
            .remark {
              width: 100%;
            }
          }
          .business_scope {
            display: flex;
            align-items: center;
            font-size: 14px;
            min-height: 40px;
            .content-title {
              width: 180px;
              text-align: right;
              color: #555;
            }
            .content-data {
              flex: 1;
              padding: 5px;
              text-align: left;
              margin-left: 25px;
              color: #333;
            }
          }
          .table-bottom{
            width:300px;
            float:right;
            margin-right:180px;
            margin-top:10px;
            height:auto;
            line-height:30px;
            font-size:14px;
            font-weight: 700;
            color:#333;
            .table-bottom-item{
              width:100%;
              text-align:right;
              .table-bottom-l{
                width:180px;
                float:left;
              }
              .table-bottom-r{
                width:calc(100% - 180px);
                float:right;
              }
            }
          }
        }
      }
    }
    .second {
      background: #fff;
      .followup-records {
        .table-view {
          margin-top: 0 !important;
          margin-bottom: 0;
        }
      }
    }
  }
}
::v-deep {
  .el-drawer__header {
    padding: 0;
    margin-bottom: 0px;
  }
  .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
    padding-left: 20px;
  }
  .el-tabs__item.is-active {
    color: $color-primary;
  }
  .el-tabs__item:hover {
    color: $color-primary;
  }
  .el-tabs__active-bar {
    background-color: $color-primary;
  }
  .el-tabs__header {
    margin: 0;
  }
}
</style>
src/views/purchaseManage/purchase/index.vue
New file
@@ -0,0 +1,209 @@
<template>
  <div class="rightContent">
    <div class="content-box">
      <div class="supplier-search">
        <SearchCommonView
          ref="searchCommonView"
          :inputSelect="false"
          placeholder="可输入供应商,物料,采购单等搜索"
          @searchClick="searchClick"
          @resetClick="resetClick"
        />
        <div class="add-view">
          <el-button type="primary" size="mini" @click="addBtnClick">新建</el-button>
        </div>
      </div>
      <template>
        <TableCommonView
         class="content-table"
          ref="tableListRef"
          :table-list="tableList"
          @selCommonClick="selCommonClick"
        >
          <template slot="tableButton">
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button type="text"  size="small" @click="editClick"  style="margin-right: 5px"
                  >编辑</el-button
                >
                <el-button  @click="submitClick(scope.row)" type="text" size="small">提交</el-button>
              </template>
            </el-table-column>
          </template>
        </TableCommonView>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
      </template>
    </div>
    <!-- 新建/编辑销售线索 -->
    <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> -->
    <!-- 详情 -->
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" @submitClick="submitClick" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier },
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
      tableList: {}, // 列表
      selValueList: [],
      commonDetail: {
        visible: false,
        infomation: {}
      },
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "采购单号", prop: "number", min: 150, isCommonClick: true },
          { label: "采购单名称", prop: "name", min: 130,},
          { label: "单据类型", prop: "contact_name", min: 130 },
          { label: "供应商名称", prop: "contact_phone", min: 130 },
          { label: "采购数量", prop: "sales_resources", min: 130 },
          { label: "收货仓库", prop: "province", min: 130 },
          { label: "经办人", prop: "city", min: 130 },
          { label: "制单人", prop: "member_name", min: 130 },
          { label: "状态", prop: "member_name", min: 130 },
        ]
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        search_map: this.search_map,
        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
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.count
        })
        .catch((err) => {
          console.log(err)
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {},
    // 编辑
    editClick(){
    },
    // 确认发货
    submitClick() {
        this.$confirm("是否提交?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("提交成功")
                this.getData()
              } else {
                this.$message.warning("提交失败")
              }
            })
          })
          .catch(() => {})
    },
    // 详情
    selCommonClick(row) {
      console.log(row)
      this.commonDetail.visible = true
      this.commonDetail.infomation = { ...row }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.rightContent {
  width:100%;
  height:calc(100% - 10px);
  .content-box {
    height:100%;
    .supplier-search {
      display: flex;
      align-items: center;
      .add-view {
        margin-left: auto;
        margin-right: 20px;
      }
    }
    .content-table{
      // height:calc(100% - 60px - 42px);
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .bottom {
    .product-search {
      display: flex;
      align-items: center;
      .search {
        margin-left: auto;
      }
      .add-view {
        margin-left: 20px;
        margin-right: 20px;
      }
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
}
</style>
src/views/purchaseManage/quality/DetailSupplier.vue
New file
@@ -0,0 +1,338 @@
<template>
  <div class="detail-view">
    <el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
      <template slot="title">
        <div class="header">
          <span class="header-label">质检单详情</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
        <div class="btn" style="float:right;margin-right:30px;">
            <el-button type="primary" size="mini" @click="qualityClick" icon="el-icon-search" style="margin-right: 5px"
              >打印</el-button
            >
            <el-button type="primary" size="mini" icon="el-icon-refresh-left" @click="qualityClick">去质检</el-button>
          </div>
      </template>
      <div class="content">
        <div class="tab-view">
          <el-tabs v-model="activeName">
            <el-tab-pane label="详情" name="first"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
          <!-- 基本信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">基本信息</span>
            </div>
            <div v-show="isBasicExpand" class="basic-info-content">
              <ul>
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
              <div class="business_scope">
                <div class="content-title">{{ "备注信息:" }}</div>
                <div class="content-data">{{ record ? record : "--" }}</div>
              </div>
            </div>
          </div>
          <!-- 账户信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('dynamic')">
              <i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">产品信息</span>
            </div>
            <div v-show="isDynamicExpand" class="basic-info-content">
              <TableCommonView
                style='margin-top:2px;'
                 class="content-table"
                  ref="tableListRef"
                  :table-list="tableList"
                >
                </TableCommonView>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script>
export default {
  name: "DetailSupplier",
  props: {
    commonDetail: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {},
          tableList:[],
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      detailConfig: this.commonDetail,
      activeName: "first",
      isBasicExpand: true, // 基本信息展开
      basicInfoList: [],
      isDynamicExpand: true, // 产品信息
      tableList: [],
      addConfig: {},
      record: "", // 最新进展
    }
  },
  created() {
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sales_leads_id",
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.id,
      sales_leads_name: this.detailConfig.infomation.name,
      sales_leads_id: this.detailConfig.infomation.id
    }
  },
  mounted() {},
  methods: {
    // 去质检
    qualityClick(){
      this.$emit('qualityClick')
    },
    setData(item) {
      if (item.FollowRecord && item.FollowRecord.length > 0) {
        this.record = item.FollowRecord[0].record
        console.log(item.FollowRecord[0].follow_time)
      }
      this.basicInfoList = [
        {
          leftStr: "采购质检单编号",
          leftValue: item.number,
          rightStr: "质检状态",
          rightValue: item.name
        },
        {
          leftStr: "采购单编号",
          leftValue: item.contact_name,
          rightStr: "质检员",
          rightValue: item.contact_position
        },
        {
          leftStr: "供应商名称",
          leftValue: item.contact_phone,
          rightStr: "到货仓库",
          rightValue: "18513375588"
        },
        {
          leftStr: "物流公司",
          leftValue: item.sales_resources,
          rightStr: "创建时间",
          rightValue: item.member_name
        },
        {
          leftStr: "物流单号",
          leftValue: item.sales_resources,
          rightStr: "",
          rightValue: ""
        }
      ]
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "产品名称", prop: "number", min: 190, isCommonClick: true },
          { label: "产品编码", prop: "name", min: 130, isCommonClick: true},
          { label: "计量单位", prop: "contact_name", min: 130 },
          { label: "规格型号", prop: "contact_phone", min: 130 },
          { label: "到货数量", prop: "contact_phone", min: 130 },
          { label: "合格数量", prop: "sales_resources", min: 130 },
          { label: "不合格数量", prop: "province", min: 130 },
        ]
      }
    },
    handleClose() {
      this.detailConfig.visible = false
    },
    // 展开收起点击事件
    expandClick(value) {
      console.log(value)
      if (value === "basic") {
        this.isBasicExpand = !this.isBasicExpand
      } else if (value === "dynamic") {
        this.isDynamicExpand = !this.isDynamicExpand
      }
    },
    // 计算两个日期之间的差值
    getDiffDay(date_1, date_2) {
      let totalDays, diffDate
      let myDate_1 = date_1
      let myDate_2 = Date.parse(date_2)
      // 将两个日期都转换为毫秒格式,然后做差
      diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
      totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
      // console.log(totalDays)
      return totalDays // 相差的天数
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.detail-view {
  .header {
    height: 56px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    .header-label {
      padding: 5px;
      border-radius: 4px;
      background-color: #ff6600;
      color: #fff;
      font-size: 12px;
    }
    .header-title {
      color: #323232;
      font-size: 15px;
      margin-left: 10px;
      font-weight: inherit;
    }
  }
  .content {
    height:100%;
    background-color: rgb(230, 233, 240);
    padding: 8px;
    .tab-view {
      background: #fff;
      // .tab-view-pane {
      //   position: relative;
      .item {
        position: absolute;
        top: 0px;
        right: 0px;
      }
      // }
    }
    .detail {
      height:calc(100% - 40px);
      background:#fff;
      overflow:auto;
      .basic-info {
        .basic-info-label {
          padding-left: 10px;
          height: 42px;
          line-height: 42px;
          background: #f4f8fe;
          color: #333;
          font-size: 14px;
        }
        .basic-info-content {
          background: #fff;
          ul {
            padding-inline-start: 0;
          }
          li {
            display: flex;
            font-size: 14px;
            font-family: PingFangSC;
            border-bottom: 1px solid #f9f9fb;
            .left,
            .right {
              width: 50%;
              display: flex;
              align-items: center;
              height: 40px;
              .content-title {
                width: 180px;
                text-align: right;
                color: #555;
              }
              .content-data {
                text-align: left;
                margin-left: 25px;
                color: #333;
              }
            }
            .remark {
              width: 100%;
            }
          }
          .business_scope {
            display: flex;
            align-items: center;
            font-size: 14px;
            min-height: 40px;
            .content-title {
              width: 180px;
              text-align: right;
              color: #555;
            }
            .content-data {
              flex: 1;
              padding: 5px;
              text-align: left;
              margin-left: 25px;
              color: #333;
            }
          }
        }
      }
    }
    .second {
      background: #fff;
      .followup-records {
        .table-view {
          margin-top: 0 !important;
          margin-bottom: 0;
        }
      }
    }
  }
}
::v-deep .el-drawer__body{
    height:calc(100% - 60px)!important;
  }
::v-deep {
  .el-drawer__header {
    padding: 0;
    margin-bottom: 0px;
  }
  .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
    padding-left: 20px;
  }
  .el-tabs__item.is-active {
    color: $color-primary;
  }
  .el-tabs__item:hover {
    color: $color-primary;
  }
  .el-tabs__active-bar {
    background-color: $color-primary;
  }
  .el-tabs__header {
    margin: 0;
  }
}
</style>
src/views/purchaseManage/quality/index.vue
New file
@@ -0,0 +1,205 @@
<template>
  <div class="rightContent">
    <div class="content-box">
      <div class="supplier-search">
        <SearchCommonView
          ref="searchCommonView"
          :inputSelect="false"
          placeholder="可输入供应商,物料,采购单等搜索"
          @searchClick="searchClick"
          @resetClick="resetClick"
        />
      </div>
      <template>
        <TableCommonView
         class="content-table"
          ref="tableListRef"
          :table-list="tableList"
          @selCommonClick="selCommonClick"
          @getSelectArray="getSelectArray"
        >
          <template slot="tableButton">
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button  @click="qualityClick(scope.row)" type="text" size="small">去质检</el-button>
              </template>
            </el-table-column>
          </template>
        </TableCommonView>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
      </template>
    </div>
    <!-- 新建/编辑销售线索 -->
    <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> -->
    <!-- 详情 -->
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" @qualityClick="qualityClick" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import DetailSupplier from "@/views/purchaseManage/quality/DetailSupplier"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier },
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
      tableList: {}, // 列表
      selValueList: [],
      commonDetail: {
        visible: false,
        infomation: {}
      },
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "质检单编号", prop: "number", min: 190, isCommonClick: true },
          { label: "采购单编号", prop: "name", min: 130, isCommonClick: true},
          { label: "单据类型", prop: "contact_name", min: 130 },
          { label: "供应商名称", prop: "contact_phone", min: 130 },
          { 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: 150 },
        ]
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        search_map: this.search_map,
        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
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.count
        })
        .catch((err) => {
          console.log(err)
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 确认发货
    qualityClick() {
        this.$confirm("是否质检?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("确认发货成功")
                this.getData()
              } else {
                this.$message.warning("确认发货失败")
              }
            })
          })
          .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 }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.rightContent {
  width:100%;
  height:calc(100% - 10px);
  .content-box {
    height:100%;
    .supplier-search {
      display: flex;
      align-items: center;
      .add-view {
        margin-left: auto;
        margin-right: 20px;
      }
    }
    .content-table{
      // height:calc(100% - 60px - 42px);
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .bottom {
    .product-search {
      display: flex;
      align-items: center;
      .search {
        margin-left: auto;
      }
      .add-view {
        margin-left: 20px;
        margin-right: 20px;
      }
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
}
</style>
src/views/purchaseManage/returned/DetailSupplier.vue
New file
@@ -0,0 +1,352 @@
<template>
  <div class="detail-view">
    <el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
      <template slot="title">
        <div class="header">
          <span class="header-label">采购退货单</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
      </template>
      <div class="content">
        <div class="tab-view">
          <el-tabs v-model="activeName">
            <el-tab-pane label="详情" name="first"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
          <!-- 基本信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">基本信息</span>
            </div>
            <div v-show="isBasicExpand" class="basic-info-content">
              <ul>
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
              <div class="business_scope">
                <div class="content-title">{{ "退货备注:" }}</div>
                <div class="content-data">{{ record ? record : "--" }}</div>
              </div>
            </div>
          </div>
          <!-- 账户信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('dynamic')">
              <i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">产品信息</span>
            </div>
            <div v-show="isDynamicExpand" class="basic-info-content">
              <TableCommonView
                style='margin-top:2px;'
                 class="content-table"
                  ref="tableListRef"
                  :table-list="tableList"
                  :showSummary="showSummary"
                >
                </TableCommonView>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script>
export default {
  name: "DetailSupplier",
  props: {
    commonDetail: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {},
          tableList:{},
          showSummary:{
            show: true,
            sumProp: ["number", "total"],
            mergeNumber: 4,
            totalName:'小计'
          },
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      detailConfig: this.commonDetail,
      activeName: "first",
      isBasicExpand: true, // 基本信息展开
      basicInfoList: [],
      isDynamicExpand: true, // 产品信息
      tableList: [],
      addConfig: {},
      record: "", // 最新进展
    }
  },
  created() {
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sales_leads_id",
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.id,
      sales_leads_name: this.detailConfig.infomation.name,
      sales_leads_id: this.detailConfig.infomation.id
    }
  },
  mounted() {},
  methods: {
    setData(item) {
      if (item.FollowRecord && item.FollowRecord.length > 0) {
        this.record = item.FollowRecord[0].record
        console.log(item.FollowRecord[0].follow_time)
      }
      this.basicInfoList = [
        {
          leftStr: "采购退货单编号",
          leftValue: item.number,
          rightStr: "供应商名称",
          rightValue: item.name
        },
        {
          leftStr: "质检单编号",
          leftValue: item.contact_name,
          rightStr: "质检员",
          rightValue: item.contact_position
        },
        {
          leftStr: "退货单状态",
          leftValue: item.contact_phone,
          rightStr: "退货日期",
          rightValue: "18513375588"
        },
        {
          leftStr: "退货仓库",
          leftValue: item.sales_resources,
          rightStr: "经办人",
          rightValue: item.member_name
        },
        {
          leftStr: "制单人",
          leftValue: item.sales_resources,
          rightStr: "货运公司",
          rightValue: ""
        },
        {
          leftStr: "质检日期",
          leftValue: item.sales_resources,
          rightStr: "物流单号",
          rightValue: ""
        },
        {
          leftStr: "退货原因",
          leftValue: item.sales_resources,
          rightStr: "退货地址",
          rightValue: ""
        },
        {
          leftStr: "退货联系人",
          leftValue: item.sales_resources,
          rightStr: "",
          rightValue: ""
        }
      ]
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "产品名称", prop: "number", min: 190, isCommonClick: true },
          { label: "产品编码", prop: "name", min: 130, isCommonClick: true},
          { label: "计量单位", prop: "contact_name", min: 130 },
          { label: "规格型号", prop: "contact_phone", min: 130 },
          { label: "采购数量", prop: "sales_resources", min: 130 },
          { label: "退货数量", prop: "province", min: 130 },
        ]
      }
    },
    handleClose() {
      this.detailConfig.visible = false
    },
    // 展开收起点击事件
    expandClick(value) {
      console.log(value)
      if (value === "basic") {
        this.isBasicExpand = !this.isBasicExpand
      } else if (value === "dynamic") {
        this.isDynamicExpand = !this.isDynamicExpand
      }
    },
    // 计算两个日期之间的差值
    getDiffDay(date_1, date_2) {
      let totalDays, diffDate
      let myDate_1 = date_1
      let myDate_2 = Date.parse(date_2)
      // 将两个日期都转换为毫秒格式,然后做差
      diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
      totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
      // console.log(totalDays)
      return totalDays // 相差的天数
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.detail-view {
  .header {
    height: 56px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    .header-label {
      padding: 5px;
      border-radius: 4px;
      background-color: #ff6600;
      color: #fff;
      font-size: 12px;
    }
    .header-title {
      color: #323232;
      font-size: 15px;
      margin-left: 10px;
      font-weight: inherit;
    }
  }
  .content {
    height:100%;
    background-color: rgb(230, 233, 240);
    padding: 8px;
    .tab-view {
      background: #fff;
      // .tab-view-pane {
      //   position: relative;
      .item {
        position: absolute;
        top: 0px;
        right: 0px;
      }
      // }
    }
    .detail {
      height:calc(100% - 40px);
      background:#fff;
      overflow:auto;
      .basic-info {
        .basic-info-label {
          padding-left: 10px;
          height: 42px;
          line-height: 42px;
          background: #f4f8fe;
          color: #333;
          font-size: 14px;
        }
        .basic-info-content {
          background: #fff;
          ul {
            padding-inline-start: 0;
          }
          li {
            display: flex;
            font-size: 14px;
            font-family: PingFangSC;
            border-bottom: 1px solid #f9f9fb;
            .left,
            .right {
              width: 50%;
              display: flex;
              align-items: center;
              height: 40px;
              .content-title {
                width: 180px;
                text-align: right;
                color: #555;
              }
              .content-data {
                text-align: left;
                margin-left: 25px;
                color: #333;
              }
            }
            .remark {
              width: 100%;
            }
          }
          .business_scope {
            display: flex;
            align-items: center;
            font-size: 14px;
            min-height: 40px;
            .content-title {
              width: 180px;
              text-align: right;
              color: #555;
            }
            .content-data {
              flex: 1;
              padding: 5px;
              text-align: left;
              margin-left: 25px;
              color: #333;
            }
          }
        }
      }
    }
    .second {
      background: #fff;
      .followup-records {
        .table-view {
          margin-top: 0 !important;
          margin-bottom: 0;
        }
      }
    }
  }
}
::v-deep .el-drawer__body{
    height:calc(100% - 60px)!important;
  }
::v-deep {
  .el-drawer__header {
    padding: 0;
    margin-bottom: 0px;
  }
  .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
    padding-left: 20px;
  }
  .el-tabs__item.is-active {
    color: $color-primary;
  }
  .el-tabs__item:hover {
    color: $color-primary;
  }
  .el-tabs__active-bar {
    background-color: $color-primary;
  }
  .el-tabs__header {
    margin: 0;
  }
}
</style>
src/views/purchaseManage/returned/index.vue
New file
@@ -0,0 +1,207 @@
<template>
  <div class="rightContent">
    <div class="content-box">
      <div class="supplier-search">
        <SearchCommonView
          ref="searchCommonView"
          :inputSelect="false"
          placeholder="可输入采购单,供应商名称等搜索"
          @searchClick="searchClick"
          @resetClick="resetClick"
        />
      </div>
      <template>
        <TableCommonView
         class="content-table"
          ref="tableListRef"
          :table-list="tableList"
          @selCommonClick="selCommonClick"
          @getSelectArray="getSelectArray"
        >
          <template slot="tableButton">
            <el-table-column label="操作" width="120">
              <template slot-scope="scope">
                <el-button  @click="confirmClick(scope.row)" type="text" size="small">确认发货</el-button>
              </template>
            </el-table-column>
          </template>
        </TableCommonView>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
      </template>
    </div>
    <!-- 新建/编辑销售线索 -->
    <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> -->
    <!-- 详情 -->
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import DetailSupplier from "@/views/purchaseManage/returned/DetailSupplier"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier },
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
      tableList: {}, // 列表
      selValueList: [],
      commonDetail: {
        visible: false,
        infomation: {}
      },
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "退货单编号", prop: "number", min: 190, isCommonClick: true },
          { label: "采购单编号", prop: "name", min: 130, isCommonClick: true},
          { label: "单据类型", prop: "contact_name", min: 130 },
          { label: "供应商名称", prop: "contact_phone", min: 130 },
          { label: "退货仓库", prop: "sales_resources", min: 130 },
          { label: "退货理由", prop: "province", min: 180 },
          { label: "经办人", prop: "city", min: 130 },
          { label: "制单人", prop: "member_name", min: 130 },
          { label: "退货日期", prop: "member_name", min: 150 },
          { label: "状态", prop: "member_name", min: 110 }
        ]
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        search_map: this.search_map,
        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
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.count
        })
        .catch((err) => {
          console.log(err)
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 确认发货
    confirmClick() {
        this.$confirm("是否确认发货?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("确认发货成功")
                this.getData()
              } else {
                this.$message.warning("确认发货失败")
              }
            })
          })
          .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 }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.rightContent {
  width:100%;
  height:calc(100% - 10px);
  .content-box {
    height:100%;
    .supplier-search {
      display: flex;
      align-items: center;
      .add-view {
        margin-left: auto;
        margin-right: 20px;
      }
    }
    .content-table{
      // height:calc(100% - 60px - 42px);
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .bottom {
    .product-search {
      display: flex;
      align-items: center;
      .search {
        margin-left: auto;
      }
      .add-view {
        margin-left: 20px;
        margin-right: 20px;
      }
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
}
</style>
src/views/purchaseManage/warehouse/DetailSupplier.vue
New file
@@ -0,0 +1,345 @@
<template>
  <div class="detail-view">
    <el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
      <template slot="title">
        <div class="header">
          <span class="header-label">入库单详情</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
      </template>
      <div class="content">
        <div class="tab-view">
          <el-tabs v-model="activeName">
            <el-tab-pane label="详情" name="first"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
          <!-- 基本信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">基本信息</span>
            </div>
            <div v-show="isBasicExpand" class="basic-info-content">
              <ul>
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
              <div class="business_scope">
                <div class="content-title">{{ "备注信息:" }}</div>
                <div class="content-data">{{ record ? record : "--" }}</div>
              </div>
            </div>
          </div>
          <!-- 账户信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('dynamic')">
              <i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">产品信息</span>
            </div>
            <div v-show="isDynamicExpand" class="basic-info-content">
              <TableCommonView
                style='margin-top:2px;'
                 class="content-table"
                  ref="tableListRef"
                  :table-list="tableList"
                >
                </TableCommonView>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script>
export default {
  name: "DetailSupplier",
  props: {
    commonDetail: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {},
          tableList:[],
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      detailConfig: this.commonDetail,
      activeName: "first",
      isBasicExpand: true, // 基本信息展开
      basicInfoList: [],
      isDynamicExpand: true, // 产品信息
      tableList: [],
      addConfig: {},
      record: "", // 最新进展
      noContactDays: 0,
      newContactDays: ""
    }
  },
  created() {
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sales_leads_id",
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.id,
      sales_leads_name: this.detailConfig.infomation.name,
      sales_leads_id: this.detailConfig.infomation.id
    }
  },
  mounted() {},
  methods: {
    setData(item) {
      if (item.FollowRecord && item.FollowRecord.length > 0) {
        this.record = item.FollowRecord[0].record
        console.log(item.FollowRecord[0].follow_time)
        let follow_time = item.FollowRecord[0].follow_time
        this.newContactDays = follow_time.substring(0, 10)
        this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays)
      }
      this.basicInfoList = [
        {
          leftStr: "采购入库单编号",
          leftValue: item.number,
          rightStr: "入库单状态",
          rightValue: item.name
        },
        {
          leftStr: "质检单编号",
          leftValue: item.contact_name,
          rightStr: "供应商名称",
          rightValue: item.contact_position
        },
        {
          leftStr: "到货仓库",
          leftValue: item.contact_phone,
          rightStr: "采购负责人",
          rightValue: "18513375588"
        },
        {
          leftStr: "质检员",
          leftValue: item.sales_resources,
          rightStr: "仓库员",
          rightValue: item.member_name
        },
        {
          leftStr: "质检日期",
          leftValue: item.sales_resources,
          rightStr: "入库完成时间",
          rightValue: ""
        },
        {
          leftStr: "物流公司",
          leftValue: item.sales_resources,
          rightStr: "创建时间",
          rightValue: ""
        },
        {
          leftStr: "物料单号",
          leftValue: item.sales_resources,
          rightStr: "",
          rightValue: ""
        }
      ]
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "产品名称", prop: "number", min: 190, isCommonClick: true },
          { label: "产品编码", prop: "name", min: 130, isCommonClick: true},
          { label: "计量单位", prop: "contact_name", min: 130 },
          { label: "规格型号", prop: "contact_phone", min: 130 },
          { label: "供应商发货数量", prop: "sales_resources", min: 160 },
          { label: "质检合格数量", prop: "province", min: 180 },
          { label: "入库数量", prop: "city", min: 130 },
        ]
      }
    },
    handleClose() {
      this.detailConfig.visible = false
    },
    // 展开收起点击事件
    expandClick(value) {
      console.log(value)
      if (value === "basic") {
        this.isBasicExpand = !this.isBasicExpand
      } else if (value === "dynamic") {
        this.isDynamicExpand = !this.isDynamicExpand
      }
    },
    // 计算两个日期之间的差值
    getDiffDay(date_1, date_2) {
      let totalDays, diffDate
      let myDate_1 = date_1
      let myDate_2 = Date.parse(date_2)
      // 将两个日期都转换为毫秒格式,然后做差
      diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
      totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
      // console.log(totalDays)
      return totalDays // 相差的天数
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.detail-view {
  .header {
    height: 56px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    .header-label {
      padding: 5px;
      border-radius: 4px;
      background-color: #ff6600;
      color: #fff;
      font-size: 12px;
    }
    .header-title {
      color: #323232;
      font-size: 15px;
      margin-left: 10px;
      font-weight: inherit;
    }
  }
  .content {
    height:100%;
    background-color: rgb(230, 233, 240);
    padding: 8px;
    .tab-view {
      background: #fff;
      // .tab-view-pane {
      //   position: relative;
      .item {
        position: absolute;
        top: 0px;
        right: 0px;
      }
      // }
    }
    .detail {
      height:calc(100% - 40px);
      background:#fff;
      overflow:auto;
      .basic-info {
        .basic-info-label {
          padding-left: 10px;
          height: 42px;
          line-height: 42px;
          background: #f4f8fe;
          color: #333;
          font-size: 14px;
        }
        .basic-info-content {
          background: #fff;
          ul {
            padding-inline-start: 0;
          }
          li {
            display: flex;
            font-size: 14px;
            font-family: PingFangSC;
            border-bottom: 1px solid #f9f9fb;
            .left,
            .right {
              width: 50%;
              display: flex;
              align-items: center;
              height: 40px;
              .content-title {
                width: 180px;
                text-align: right;
                color: #555;
              }
              .content-data {
                text-align: left;
                margin-left: 25px;
                color: #333;
              }
            }
            .remark {
              width: 100%;
            }
          }
          .business_scope {
            display: flex;
            align-items: center;
            font-size: 14px;
            min-height: 40px;
            .content-title {
              width: 180px;
              text-align: right;
              color: #555;
            }
            .content-data {
              flex: 1;
              padding: 5px;
              text-align: left;
              margin-left: 25px;
              color: #333;
            }
          }
        }
      }
    }
    .second {
      background: #fff;
      .followup-records {
        .table-view {
          margin-top: 0 !important;
          margin-bottom: 0;
        }
      }
    }
  }
}
::v-deep .el-drawer__body{
    height:calc(100% - 60px)!important;
  }
::v-deep {
  .el-drawer__header {
    padding: 0;
    margin-bottom: 0px;
  }
  .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
    padding-left: 20px;
  }
  .el-tabs__item.is-active {
    color: $color-primary;
  }
  .el-tabs__item:hover {
    color: $color-primary;
  }
  .el-tabs__active-bar {
    background-color: $color-primary;
  }
  .el-tabs__header {
    margin: 0;
  }
}
</style>
src/views/purchaseManage/warehouse/index.vue
New file
@@ -0,0 +1,210 @@
<template>
  <div class="rightContent">
    <div class="content-box">
      <div class="supplier-search">
        <SearchCommonView
          ref="searchCommonView"
          :inputSelect="false"
          placeholder="可输入入库单号,供应商名称等搜索"
          @searchClick="searchClick"
          @resetClick="resetClick"
        />
      </div>
      <template>
        <TableCommonView
         class="content-table"
          ref="tableListRef"
          :table-list="tableList"
          @selCommonClick="selCommonClick"
          @getSelectArray="getSelectArray"
        >
          <!-- <template slot="tableButton">
            <el-table-column label="操作" width="120">
              <template slot-scope="scope">
              </template>
            </el-table-column>
          </template> -->
        </TableCommonView>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
      </template>
    </div>
    <!-- 新建/编辑销售线索 -->
    <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> -->
    <!-- 详情 -->
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import DetailSupplier from "@/views/purchaseManage/warehouse/DetailSupplier"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier },
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
      tableList: {}, // 列表
      selValueList: [],
      commonDetail: {
        visible: false,
        infomation: {}
      },
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        tableColumn: [
          { label: "入库单号", prop: "number", min: 190, isCommonClick: true },
          { label: "采购编号", prop: "name", min: 130, isCommonClick: true},
          { label: "单据类型", prop: "contact_name", min: 130 },
          { label: "供应商", prop: "contact_phone", min: 130 },
          { label: "收货仓库", prop: "sales_resources", min: 130 },
          { label: "入库时间", prop: "province", min: 180 },
          { label: "经办人", prop: "city", min: 130 },
          { label: "制单人", prop: "member_name", min: 130 },
          { label: "状态", prop: "member_name", min: 110 }
        ]
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        search_map: this.search_map,
        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
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.count
        })
        .catch((err) => {
          console.log(err)
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 删除
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    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 }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.rightContent {
  width:100%;
  height:calc(100% - 10px);
  .content-box {
    height:100%;
    .supplier-search {
      display: flex;
      align-items: center;
      .add-view {
        margin-left: auto;
        margin-right: 20px;
      }
    }
    .content-table{
      // height:calc(100% - 60px - 42px);
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .bottom {
    .product-search {
      display: flex;
      align-items: center;
      .search {
        margin-left: auto;
      }
      .add-view {
        margin-left: 20px;
        margin-right: 20px;
      }
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
}
</style>