haoxuan
2023-10-24 01cea4bc73210e43f748d82a02a432cce615be2d
src/views/sales/quotation/DetailQuotation.vue
@@ -9,34 +9,34 @@
    >
      <template slot="title">
        <div class="header">
          <span class="header-label">单据编号</span>
          <span class="header-label">报价单</span>
          <span class="header-title">{{ detailConfig.infomation.number }}</span>
        </div>
      </template>
      <div class="content">
        <div class="top">{{ "合同发起人:" + "" }}</div>
        <!-- <div class="top">{{ "合同发起人:" + "" }}</div> -->
        <div class="tab-view">
          <el-tabs v-model="activeName" @tab-click="tabsClick">
            <el-tab-pane label="详情" name="first"></el-tab-pane>
            <el-tab-pane label="报价变更单" name="changeOrder">
              <!-- <template slot="label">
            <!-- <el-tab-pane label="报价变更单" name="changeOrder"> -->
            <!-- <template slot="label">
                <div>跟进记录<el-badge type="primary" :value="2"> </el-badge></div>
              </template> -->
            </el-tab-pane>
            <el-tab-pane label="销售明细单" name="detail"></el-tab-pane>
            <!-- </el-tab-pane> -->
            <!-- <el-tab-pane label="销售明细单" name="detail"></el-tab-pane> -->
            <el-tab-pane label="服务合同" name="serviceContract"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
          <!-- 标签 -->
          <div class="basic-info">
          <!-- <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('label')">
              <i v-if="isLabelExpand" 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="isLabelExpand" class="basic-info-content"></div>
          </div>
          </div> -->
          <!-- 基本信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
@@ -49,36 +49,18 @@
                <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 }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                  <div v-if="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('termsConditions')">
              <i v-if="isTermsConditionsExpand" 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="isTermsConditionsExpand" class="basic-info-content">
              <div class="termsConditions">
                <div class="content-title">{{ "条件与条款" + ":" }}</div>
                <div class="content-termsConditions">
                  <ul>
                    <li v-for="(item, index) in Status.termsConditions" :key="index">{{ item }}</li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
          <!-- 附件信息 -->
          <div class="basic-info">
          <!-- <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('annex')">
              <i v-if="isAnnexExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
@@ -94,7 +76,7 @@
                </li>
              </ul>
            </div>
          </div>
          </div> -->
          <!-- 产品管理 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('product')">
@@ -111,6 +93,25 @@
              />
            </div>
          </div>
          <!-- 条件与条款 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('termsConditions')">
              <i v-if="isTermsConditionsExpand" 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="isTermsConditionsExpand" class="basic-info-content">
              <div class="termsConditions">
                <div class="content-title">{{ "条件与条款" + ":" }}</div>
                <div class="content-termsConditions">
                  {{ "\n" + detailConfig.infomation.conditions }}
                  <!-- <ul>
                    <li v-for="(item, index) in Status.termsConditions" :key="index">{{ item }}</li>
                  </ul> -->
                </div>
              </div>
            </div>
          </div>
          <!-- 审批日志 -->
          <!-- <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('approval')">
@@ -125,10 +126,10 @@
          <!-- <FollowupRecords :isDetail="true" /> -->
        </div>
        <div v-if="activeName === 'detail'" class="second">
          <SalesDetails :isDetail="true" />
          <SalesDetails :isDetail="true" :add-config="addConfig" />
        </div>
        <div v-if="activeName === 'serviceContract'" class="second">
          <ServiceContract :isDetail="true" />
          <ServiceContract :isDetail="true" :add-config="addConfig" />
        </div>
      </div>
    </el-drawer>
@@ -170,177 +171,55 @@
      showSummary: {
        show: true,
        total: true,
        sumProp: ["other1", "other2", "other3", "other4"],
        mergeNumber: 3
        sumProp: ["amount", "price", "total"],
        mergeNumber: 1
      },
      productTableList: {}
      productTableList: {},
      addConfig: {}
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "quotation_number",
      keywordType: "报价单",
      keyword: this.detailConfig.infomation.number,
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.name,
      client_name: this.detailConfig.infomation.client.name,
      contact_name: this.detailConfig.infomation.contact_name,
      client_id: this.detailConfig.infomation.client_id,
      contact_id: this.detailConfig.infomation.contact_id
    }
    this.setTableForm()
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      this.basicInfoList = [
        {
          leftStr: "客户名称",
          leftValue: "",
          rightStr: "销售机会编号",
          rightValue: ""
          leftValue: item.client_name,
          rightStr: "报价编号",
          rightValue: item.number
        },
        {
          leftStr: "机会名称",
          leftValue: "",
          rightStr: "联系人姓名",
          rightValue: ""
          leftStr: "报价单状态",
          leftValue: item.quotation_status.name,
          rightStr: "销售机会",
          rightValue: item.sale_chance.name
        },
        {
          leftStr: "商机来源",
          leftValue: "",
          rightStr: "商机类型",
          rightValue: ""
        },
        {
          leftStr: "销售阶段",
          leftValue: "",
          leftStr: "有效期至",
          leftValue: item.validity_date,
          rightStr: "销售负责人",
          rightValue: ""
          rightValue: item.member.username
        },
        {
          leftStr: "老客户营销",
          leftValue: "",
          rightStr: "签到",
          rightValue: ""
        },
        {
          leftStr: "审批状态",
          leftValue: "",
          rightStr: "竞争对手",
          rightValue: ""
        },
        {
          leftStr: "创建人",
          leftValue: "",
          rightStr: "创建时间",
          rightValue: ""
        }
      ]
      this.forecastList = [
        {
          leftStr: "可能性(%)",
          leftValue: "",
          rightStr: "币种",
          rightValue: ""
        },
        {
          leftStr: "预算绝对值",
          leftValue: "",
          rightStr: "预计成交日期",
          rightValue: ""
        },
        {
          leftStr: "预计合同金额",
          leftValue: "",
          rightStr: "当前状态",
          rightValue: ""
        }
      ]
      this.dynamicInfoList = [
        {
          leftStr: "未联系天数",
          leftValue: "",
          rightStr: "最新联系日期",
          rightValue: ""
        },
        {
          leftStr: "未推荐天数",
          leftValue: "",
          rightStr: "最新推进时间",
          rightValue: ""
        },
        {
          leftStr: "最新联系人",
          leftValue: "",
          rightStr: "最新更新时间",
          rightValue: ""
        }
      ]
      this.businessInfoList = [
        {
          leftStr: "客户需求或痛点(why)",
          leftValue: ""
        },
        {
          leftStr: "是否已经立项(plan)",
          leftValue: ""
        },
        {
          leftStr: "资金预算是多少(plan)",
          leftValue: ""
        },
        {
          leftStr: "关键决策人是谁(who)",
          leftValue: ""
        },
        {
          leftStr: "关键决策因素有哪些(what)",
          leftValue: ""
        },
        {
          leftStr: "决策流程是怎样的(what)",
          leftValue: ""
        },
        {
          leftStr: "竞争对手提供的方案(what)",
          leftValue: ""
        }
      ]
      this.swotInfoList = [
        {
          leftStr: "优势(S)",
          leftValue: "",
          rightStr: "劣势(W)",
          rightValue: ""
        },
        {
          leftStr: "机会(O)",
          leftValue: "",
          rightStr: "威胁(T)",
          rightValue: ""
        }
      ]
      this.addressInfoList = [
        {
          leftStr: "国家",
          leftValue: "",
          rightStr: "省份",
          rightValue: ""
        },
        {
          leftStr: "城市",
          leftValue: "",
          rightStr: "区域",
          rightValue: ""
        },
        {
          leftStr: "详细地址",
          leftStr: "创建时间",
          leftValue: "",
          rightStr: "",
          rightValue: ""
        }
      ]
      this.historyList = [
        {
          date: "2023-08-04 13:22:36",
          stage: "成功结案",
          modify: "系统管理员"
        },
        {
          date: "2023-08-04 13:22:36",
          stage: "成功结案",
          modify: "系统管理员"
        }
      ]
    },
@@ -370,33 +249,13 @@
    },
    setTableForm() {
      this.productTableList = {
        tableData: [
          {
            id: "1",
            productName: "上海有限公司",
            other0: "ZDYBD03-1",
            other1: "12",
            other2: "5.00",
            other4: "3.00",
            other3: "2.00"
          }
        ],
        tableData: this.detailConfig.infomation.products,
        tableColumn: [
          { label: "#", prop: "id", width: 40 },
          { label: "含税单价", prop: "other9", input: true },
          { label: "产品名称", prop: "productName", input: true, isRequird: true },
          { label: "产品编号", prop: "other0" },
          { label: "数量", prop: "other1", input: true, isRequird: true },
          { label: "折扣率(%)", prop: "other6", input: true },
          { label: "不含税单价", prop: "other7", input: true },
          { label: "折扣额", prop: "other2" },
          { label: "税(销售)", prop: "other7", input: true },
          { label: "实际含税单价", prop: "other3" },
          { label: "不含税金额", prop: "other4" },
          { label: "价税合计", prop: "other3", input: true },
          { label: "描述", prop: "other8" },
          { label: "源单类型", prop: "other5" },
          { label: "源单", prop: "other6" }
          { label: "产品名称", prop: "name", productName: true, isRequird: true },
          { label: "产品编号", prop: "number" },
          { label: "数量", prop: "amount", inputNumber: true, isRequird: true },
          { label: "销售单价", prop: "price", inputFloat: true },
          { label: "价税合计", prop: "total", inputFloat: true }
        ]
      }
    }
@@ -559,6 +418,7 @@
              align-items: center;
              font-size: 14px;
              font-family: PingFangSC;
              min-height: 40px;
              // padding: 5px 0;
              .content-title {
                width: 320px;
@@ -566,13 +426,14 @@
                color: #555;
              }
              .content-termsConditions {
                margin-left: 25px;
                margin: 0px 25px 15px;
                font-size: 13px;
                color: #333;
                li {
                  margin: 5px 0;
                  border-bottom: 0px solid #f9f9fb;
                }
                white-space: pre-wrap;
                // li {
                //   margin: 5px 0;
                //   border-bottom: 0px solid #f9f9fb;
                // }
              }
            }
          }