zuozhengqing
2024-03-30 b54c83388bce2d768a43415f14048fcf4f5deb01
merge branch 'dev'
1个文件已修改
141 ■■■■■ 已修改文件
src/views/sales/salesDetails/index.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesDetails/index.vue
@@ -6,14 +6,8 @@
    <div v-else class="filter">
      <div class="filter-card">
        <CommonSearch
          :show-add="false"
          :show-download="false"
          :amount-view="false"
          :show-action-btn="false"
          placeholder="请输入订单编号"
          @searchClick="onFilterSearch"
        >
        <CommonSearch :show-add="false" :show-download="false" :amount-view="false" :show-action-btn="false"
          placeholder="请输入订单编号" @searchClick="onFilterSearch">
          <template slot="leftButton">
            <el-button size="small" type="primary" @click="addBtnClick">新建</el-button>
            <!-- <el-button size="small"  @click="delClick">删除</el-button> -->
@@ -26,17 +20,9 @@
      <!-- <div class="body-card"> -->
      <div class="content-top">
        <div class="list-view">
          <TableCommonView
            ref="tableListRef"
            :show-summary="showSummary"
            :table-list="tableList"
            @selClientClick="selClientClick"
            @selCommonClick="selCommonClick"
            @getSelectArray="getSelectArray"
            @selTableCol="selTableCol"
            @tableRowClick="tableRowClick"
            :selectClassRow="selectRow"
          >
          <TableCommonView ref="tableListRef" :show-summary="showSummary" :table-list="tableList"
            @selClientClick="selClientClick" @selCommonClick="selCommonClick" @getSelectArray="getSelectArray"
            @selTableCol="selTableCol" @tableRowClick="tableRowClick" :selectClassRow="selectRow">
            <template slot="tableButton">
              <el-table-column label="操作" width="180">
                <template slot-scope="scope">
@@ -64,54 +50,34 @@
      </div>
      <div class="content-bottom">
        <div class="bottom-tabs" :class="!isDetail ? 'bgcGrey' : 'bgcWhite'">
          <div
            class="tab-pane"
            @click="getTab(0)"
            :style="{
          <div class="tab-pane" @click="getTab(0)" :style="{
              background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 0 ? '#fff' : '#666'
            }"
          >
    }">
            产品信息
          </div>
          <div
            class="tab-pane"
            @click="getTab(1)"
            :style="{
          <div class="tab-pane" @click="getTab(1)" :style="{
              background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 1 ? '#fff' : '#666'
            }"
          >
    }">
            发货信息
          </div>
          <div
            class="tab-pane"
            @click="getTab(2)"
            :style="{
          <div class="tab-pane" @click="getTab(2)" :style="{
              background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 2 ? '#fff' : '#666'
            }"
          >
    }">
            制造信息
          </div>
          <div
            class="tab-pane"
            @click="getTab(3)"
            :style="{
          <div class="tab-pane" @click="getTab(3)" :style="{
              background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 3 ? '#fff' : '#666'
            }"
          >
    }">
            采购信息
          </div>
          <div
            class="tab-pane"
            @click="getTab(4)"
            :style="{
          <div class="tab-pane" @click="getTab(4)" :style="{
              background: TabsIndex == 4 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 4 ? '#fff' : '#666'
            }"
          >
    }">
            委外信息
          </div>
        </div>
@@ -133,12 +99,8 @@
      <el-form label-width="100px" class="demo-ruleForm" ref="form" :rules="rules" :model="projects">
        <el-form-item label="选择项目" prop="projectId">
          <el-select v-model="projects.projectId" placeholder="请选择" size="mini" style="width: 100%">
            <el-option
              v-for="item in projectList"
              :key="item.projectId"
              :label="item.projectName"
              :value="item.projectId"
            >
            <el-option v-for="item in projectList" :key="item.projectId" :label="item.projectName"
              :value="item.projectId">
            </el-option>
          </el-select>
        </el-form-item>
@@ -149,17 +111,11 @@
      </span>
    </el-dialog>
    <!-- 新建/编辑 -->
    <AddSalesDetailsDialog
      v-if="editConfig.visible"
      :edit-common-config="editConfig"
      @addCollectionPlanClick="addCollectionPlanClick"
    />
    <AddSalesDetailsDialog v-if="editConfig.visible" :edit-common-config="editConfig"
      @addCollectionPlanClick="addCollectionPlanClick" />
    <!-- 发货 -->
    <ShipmentsDialog
      v-if="editShipmentsConfig.visible"
      :edit-common-config="editShipmentsConfig"
      @addCollectionPlanClick="addCollectionPlanClick"
    />
    <ShipmentsDialog v-if="editShipmentsConfig.visible" :edit-common-config="editShipmentsConfig"
      @addCollectionPlanClick="addCollectionPlanClick" />
    <!-- 销售明细详情 -->
    <DetailSpecification v-if="specificationDetail.visible" :specification-detail="specificationDetail" />
    <!-- 客户详情 -->
@@ -227,20 +183,27 @@
        isClass: true,
        getClassName: this.getAmountClassName, 
      },
      { label: "已发货数量", prop: "deliveryAmount",
      {
        label: "已发货数量", prop: "deliveryAmount",
        isClass: true,
        getClassName: this.getAmountClassName,  },
      { label: "采购数量",
        getClassName: this.getAmountClassName,
      },
      {
        label: "采购数量",
        isClass: true,
        getClassName: this.getFinishAmountClassName, 
        prop: "purchaseAmount",
      },
      { label: "生产数量", prop: "makeAmount" ,
      {
        label: "生产数量", prop: "makeAmount",
        isClass: true,
        getClassName: this.getFinishAmountClassName, },
      { label: "委外数量", prop: "outsourcingAmount",
        getClassName: this.getFinishAmountClassName,
      },
      {
        label: "委外数量", prop: "outsourcingAmount",
        isClass: true,
        getClassName: this.getFinishAmountClassName,  },
        getClassName: this.getFinishAmountClassName,
      },
      { label: "销售单价", prop: "price", price: true },
      { label: "成本单价", prop: "cost" },
      { label: "毛利", prop: "profit" },
@@ -500,7 +463,6 @@
  },
  methods: {
    getFinishAmountClassName(val, row) {
      console.log(val,"val")
      let parts = val.split("/"); 
      let numerator = parseInt(parts[0], 10); // 分子  
      let denominator = parseInt(parts[1], 10); // 分母 
@@ -654,16 +616,15 @@
    // 获取产品/库存信息
    async getProductInventoryInfo(number) {
        if (number) {
          this.loading = true
          await getProductInventoryInfo(number)
            .then((res) => {
              console.log(res,"resss")
            if (this.TabsIndex == 1) {
              this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : []
              this.loading = false
            }
            })
            .catch(() => {
              this.productTableList.tableInfomation = []
              this.loading = false
            })
        }
    },
@@ -698,30 +659,28 @@
          this.showBottomCol = this.showOutsourceCol
          this.setBottomList()
        }
        console.log(this.isRequest,'===isRequest')
        if (this.TabsIndex != 1&&this.isRequest == false) {
          this.isRequest = true;
          this.getListValue(this.productDataBottom)
          return true;
        }
        this.loading = true
          if (this.TabsIndex == 1&&this.selectRow.status == 1) {
            this.productTableList.tableInfomation = []
          } 
          console.log(this.selectRow,"看看")
          this.getProductInventoryInfo(number)
          
          this.loading = true
          await getProductOrderInfo(number)
            .then((res) => {
              this.productDataBottom=res;
              this.getListValue(this.productDataBottom)
              this.loading = false
            })
            .catch(() => {
              this.productTableList.tableInfomation = []
              this.loading = false
            })
        this.loading = false
      }
    },
    getListValue(res){
@@ -1064,6 +1023,7 @@
  .el-table .el-table__cell {
    padding: 0;
  }
  .el-table__footer-wrapper tbody td.el-table__cell {
    height: 48px;
  }
@@ -1072,11 +1032,13 @@
.sales-details {
  height: 100%;
  overflow: hidden;
  .filter {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 12px 20px 0 20px;
    &-card {
      height: 80px;
      display: flex;
@@ -1088,27 +1050,32 @@
      background-color: #fff;
    }
  }
  .body {
    box-sizing: border-box;
    padding: 10px 20px;
    border-radius: 12px;
    height: calc(100% - 70px);
    .content-top {
      background-color: #fff;
      border-radius: 12px;
      min-height: 70px;
      height: 48%;
      position: relative;
      .list-view {
        height: calc(100% - 60px);
      }
    }
    .content-bottom {
      .bottom-tabs {
        height: 40px;
        line-height: 40px;
        background: #e6ecf2;
        display: flex;
        .tab-pane {
          width: 100px;
          margin-right: 20px;
@@ -1120,28 +1087,34 @@
          border-top-right-radius: 20px;
        }
      }
      .lable-view {
        background: #e6ecf2;
        height: 40px;
        line-height: 40px;
        .name {
          border-left: 4px solid #2a78fb;
          padding-left: 10px;
        }
      }
      background-color: #fff;
      border-radius: 12px;
      min-height: 70px;
      height: calc(52% - 60px);
      margin-top: 10px;
      // padding: 10px 20px;
      .list-view {
        height: calc(100% - 10px);
      }
    }
    .btn-pager {
      display: flex;
      margin-top: 10px;
      .page {
        margin-left: auto;
      }
@@ -1152,15 +1125,19 @@
.bgcGrey {
  background: #e6ecf2;
}
.bgcWhite {
  background: #fff !important;
}
.el-form-item {
  width: 80%;
  margin: 20px auto;
}
::v-deep .el-dialog__footer {
  text-align: right !important;
  .el-button {
    margin-right: 10px;
  }