Browse Source

锚点修改

lucky 2 years ago
parent
commit
f08b6ccf7c
2 changed files with 165 additions and 77 deletions
  1. 164 76
      src/views/reportQuery/test/detail.vue
  2. 1 1
      src/views/reportQuery/test/index.vue

+ 164 - 76
src/views/reportQuery/test/detail.vue

@@ -1,195 +1,183 @@
 <template>
-  <div >
+  <div>
     <Anchor height="900px" :data="anchorArray">
-      <div style="width: 100%">
+      <div style="width: 100%" v-if="tableData">
         <el-collapse v-model="activeNames" style="margin: -8px 0 0 0">
-          <!-- <el-collapse-item title="商品信息" name="1">
+          <div id="detail1"  v-if="tableData.order_type">
+            <el-collapse-item title="商品信息" name="1">
               <goodsDataTable
                 :newTime="newTime"
                 v-if="newTime !== ''"
-                :type="sitem.order_type"
-                :skucode="sitem.skuCode"
-                :spucode="sitem.spuCode"
+                :type="tableData.order_type"
+                :skucode="tableData.skuCode"
+                :spucode="tableData.spuCode"
                 :iscgd="true"
               />
+            </el-collapse-item>
+          </div>
 
-              <editPrice
-                :newTime="newTime"
-                v-if="
-                  newTime !== '' &&
-                  sitem.status == '0' &&
-                  sitem.can[0].id == '6' &&
-                  cost_detailArr.is_gold_price == '1'
-                "
-                :sitem="sitem"
-                :cost_detailArr="cost_detailArr"
-                @refresh="refresh"
-              >
-              </editPrice>
-            </el-collapse-item> -->
-      
-          <div id="detail2">
-            <el-collapse-item 
+          <div id="detail2"  v-if="tableData.cgdNo">
+            <el-collapse-item
               title="采购——采购单"
               name="2"
               v-if="newTime !== ''"
             >
-              <detail2 queryId="CG2206230923441071"> </detail2>
+              <detail2 :queryId="tableData.cgdNo"> </detail2>
             </el-collapse-item>
           </div>
 
-          <div id="detail3">
+          <div id="detail3" v-if="tableData.wsm_in_code">
             <el-collapse-item
               title="采购——入库单"
               name="3"
               v-if="newTime !== ''"
             >
-              <detail3 queryId="CF2206231840116680"> </detail3>
+              <detail3 :queryId="tableData.wsm_in_code"> </detail3>
             </el-collapse-item>
           </div>
 
-          <div id="detail4">
+          <div id="detail4" v-if="tableData.cgdReturnCode">
             <el-collapse-item
               title="采购——退货单"
               name="4"
               v-if="newTime !== ''"
             >
-              <detail4 queryId="CR2206021737423153"> </detail4>
+              <detail4 :queryId="tableData.cgdReturnCode"> </detail4>
             </el-collapse-item>
           </div>
 
           <!-- 编号id -->
-          <div id="detail5">
+          <div id="detail5" v-if="tableData.cgd_diff_id">
             <el-collapse-item
               title="采购——工差单"
               name="5"
               v-if="newTime !== ''"
             >
-              <detail5 queryId="2"> </detail5>
+              <detail5 :queryId="tableData.cgd_diff_id"> </detail5>
             </el-collapse-item>
           </div>
 
-          <div id="detail6">
+          <div id="detail6" v-if="tableData.projectNo">
             <el-collapse-item title="销售——项目" name="6" v-if="newTime !== ''">
-              <detail6 queryId="PR2206011553402697"> </detail6>
+              <detail6 :queryId="tableData.projectNo"> </detail6>
             </el-collapse-item>
           </div>
-          <div id="detail7">
+          <div id="detail7" v-if="tableData.infoNo">
             <el-collapse-item
               title="销售——竞价单"
               name="7"
               v-if="newTime !== ''"
             >
-              <detail7 queryId="IF2206230925561644"> </detail7>
+              <detail7 :queryId="tableData.infoNo"> </detail7>
             </el-collapse-item>
           </div>
 
-          <div id="detail8">
+          <div id="detail8"  v-if="tableData.bargainNo">
             <el-collapse-item
               title="销售——议价单"
               name="8"
               v-if="newTime !== ''"
             >
-              <detail8 queryId="BA2206221634379104"> </detail8>
+              <detail8 :queryId="tableData.bargainNo"> </detail8>
             </el-collapse-item>
           </div>
 
           <!-- 编号id -->
-          <div id="detail9">
+          <div id="detail9" v-if="tableData.bk_code">
             <el-collapse-item
               title="销售——备货申请单"
               name="9"
               v-if="newTime !== ''"
             >
-              <detail9 queryId="149"> </detail9>
+              <detail9 :queryId="tableData.bk_code"> </detail9>
             </el-collapse-item>
           </div>
           <!-- 编号id -->
-          <div id="detail10">
+          <div id="detail10"  v-if="tableData.orderCode">
             <el-collapse-item
               title="销售——销售订单"
               name="10"
               v-if="newTime !== ''"
             >
-              <detail10 queryId="4665"> </detail10>
+              <detail10 :queryId="tableData.orderCode"> </detail10>
             </el-collapse-item>
           </div>
 
-          <div id="detail11">
+          <div id="detail11"  v-if="tableData.outCode">
             <el-collapse-item
               title="销售——发货申请单"
               name="11"
               v-if="newTime !== ''"
             >
-              <detail11 queryId="DF2206271141163031"> </detail11>
+              <detail11 :queryId="tableData.outCode"> </detail11>
             </el-collapse-item>
           </div>
-          <div id="detail12">
+          <div id="detail12" v-if="tableData.returnCode">
             <el-collapse-item
               title="销售——售后申请单"
               name="12"
               v-if="newTime !== ''"
             >
-              <detail12 queryId="RS2206220942431237"> </detail12>
+              <detail12 :queryId="tableData.returnCode"> </detail12>
             </el-collapse-item>
           </div>
-          <div id="detail13">
+          <div id="detail13" v-if="tableData.thNo">
             <el-collapse-item
               title="销售——售后退货单"
               name="13"
               v-if="newTime !== ''"
             >
-              <detail13 queryId="ST2206221024403625"> </detail13>
+              <detail13 :queryId="tableData.thNo"> </detail13>
             </el-collapse-item>
           </div>
-          <div id="detail14">
+          <div id="detail14"  v-if="tableData.returnGoodCode">
             <el-collapse-item
               title="销售——退货单"
               name="14"
               v-if="newTime !== ''"
             >
-              <detail14 queryId="RS2206222215535938"> </detail14>
+              <detail14 :queryId="tableData.returnGoodCode"> </detail14>
             </el-collapse-item>
           </div>
 
           <!-- 编号id -->
-          <div id="detail15">
+          <div id="detail15" v-if="tableData.sale_diff_id">
             <el-collapse-item
               title="销售——工差单"
               name="15"
               v-if="newTime !== ''"
             >
-              <detail15 queryId="2"> </detail15>
+              <detail15 :queryId="tableData.sale_diff_id"> </detail15>
             </el-collapse-item>
           </div>
 
-          <div id="detail16">
+          <div id="detail16" v-if="tableData.supplierNo">
             <el-collapse-item
               title="供应商详情"
               name="16"
               v-if="newTime !== ''"
             >
-              <detail16 queryId="595"> </detail16>
+              <detail16 :queryId="tableData.supplierNo"> </detail16>
             </el-collapse-item>
           </div>
 
-          <div id="detail17">
+          <div id="detail17"  v-if="tableData.companyNo">
             <el-collapse-item
               title="业务公司详情"
               name="17"
               v-if="newTime !== ''"
             >
-              <detail17 queryId="3"> </detail17>
+              <detail17 :queryId="tableData.companyNo"> </detail17>
             </el-collapse-item>
           </div>
 
-          <div id="detail18">
+          <div id="detail18"  v-if="tableData.customer_code">
             <el-collapse-item
               title="企业客户详情"
               name="18"
               v-if="newTime !== ''"
             >
-              <detail18 queryId="2033"> </detail18>
+              <detail18 :queryId="tableData.customer_code"> </detail18>
             </el-collapse-item>
           </div>
         </el-collapse>
@@ -269,26 +257,26 @@ export default {
     return {
       newTime: "",
       activeNames: [],
-
+      tableData: {},
       anchorArray: [
-
-        { tar: "#detail2", title: "采购——采购单" },
-        { tar: "#detail3", title: "采购——入库单" },
-        { tar: "#detail4", title: "采购——退货单" },
-        { tar: "#detail5", title: "采购——工差单" },
-        { tar: "#detail6", title: "销售——项目" },
-        { tar: "#detail7", title: "销售——竞价单" },
-        { tar: "#detail8", title: "销售——议价单" },
-        { tar: "#detail9", title: "销售——备货申请单" },
-        { tar: "#detail10", title: "销售——销售订单" },
-        { tar: "#detail11", title: "销售——发货申请单" },
-        { tar: "#detail12", title: "销售——售后申请单" },
-        { tar: "#detail13", title: "销售——售后退货单" },
-        { tar: "#detail14", title: "销售——退货单" },
-        { tar: "#detail15", title: "销售——工差单" },
-        { tar: "#detail16", title: "供应商详情" },
-        { tar: "#detail17", title: "业务公司详情" },
-        { tar: "#detail18", title: "企业客户详情" },
+        // { tar: "#detail1", title: "商品信息" },
+        // { tar: "#detail2", title: "采购——采购单" },
+        // { tar: "#detail3", title: "采购——入库单" },
+        // { tar: "#detail4", title: "采购——退货单" },
+        // { tar: "#detail5", title: "采购——工差单" },
+        // { tar: "#detail6", title: "销售——项目" },
+        // { tar: "#detail7", title: "销售——竞价单" },
+        // { tar: "#detail8", title: "销售——议价单" },
+        // { tar: "#detail9", title: "销售——备货申请单" },
+        // { tar: "#detail10", title: "销售——销售订单" },
+        // { tar: "#detail11", title: "销售——发货申请单" },
+        // { tar: "#detail12", title: "销售——售后申请单" },
+        // { tar: "#detail13", title: "销售——售后退货单" },
+        // { tar: "#detail14", title: "销售——退货单" },
+        // { tar: "#detail15", title: "销售——工差单" },
+        // { tar: "#detail16", title: "供应商详情" },
+        // { tar: "#detail17", title: "业务公司详情" },
+        // { tar: "#detail18", title: "企业客户详情" },
       ],
     };
   },
@@ -298,6 +286,7 @@ export default {
     for (let i = 1; i < 20; i++) {
       this.activeNames.push(i + "");
     }
+
     this.initData();
   },
   methods: {
@@ -305,7 +294,106 @@ export default {
       this.newTime = new Date().valueOf();
     },
     async initData() {
-      this.getNewTime();
+      this.loading = true;
+
+      const res = await asyncRequest.standbookdetail({
+        id: this.$route.query.id,
+      });
+      if (res && res.code === 0 && res.data) {
+        console.log(res);
+        this.tableData = res.data;
+        this.anchorArrayFn(this.tableData);
+
+        this.getNewTime();
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+      }
+      this.loading = false;
+    },
+
+    anchorArrayFn(obj) {
+      let arr = [];
+      let flag = true;
+      let {
+        spuCode,
+        skuCode,
+        order_type,
+        projectNo,
+        infoNo,
+        bargainNo,
+        bk_code,
+        orderCode,
+        outCode,
+        returnCode,
+        thNo,
+        returnGoodCode,
+        sale_diff_id,
+        cgdNo,
+        wsm_in_code,
+        cgdReturnCode,
+        cgd_diff_id,
+        supplierNo,
+        companyNo,
+        customer_code,
+      } = obj;
+      (order_type ?? "") != ""
+        ? arr.push({ tar: "#detail1", title: "商品信息" })
+        : (flag = false)(cgdNo ?? "") != ""
+        ? arr.push({ tar: "#detail2", title: "采购——采购单" })
+        : (flag = false);
+      (wsm_in_code ?? "") != ""
+        ? arr.push({ tar: "#detail3", title: "采购——入库单" })
+        : (flag = false);
+      (cgdReturnCode ?? "") != ""
+        ? arr.push({ tar: "#detail4", title: "采购——退货单" })
+        : (flag = false);
+      (cgd_diff_id ?? "") != ""
+        ? arr.push({ tar: "#detail5", title: "采购——工差单" })
+        : (flag = false);
+      (projectNo ?? "") != ""
+        ? arr.push({ tar: "#detail6", title: "销售——项目" })
+        : (flag = false);
+      (infoNo ?? "") != ""
+        ? arr.push({ tar: "#detail7", title: "销售——竞价单" })
+        : (flag = false);
+      (bargainNo ?? "") != ""
+        ? arr.push({ tar: "#detail8", title: "销售——议价单" })
+        : (flag = false);
+      (bk_code ?? "") != ""
+        ? arr.push({ tar: "#detail9", title: "销售——备货申请单" })
+        : (flag = false);
+      (orderCode ?? "") != ""
+        ? arr.push({ tar: "#detail10", title: "销售——销售订单" })
+        : (flag = false);
+      (outCode ?? "") != ""
+        ? arr.push({ tar: "#detail11", title: "销售——发货申请单" })
+        : (flag = false);
+      (returnCode ?? "") != ""
+        ? arr.push({ tar: "#detail12", title: "销售——售后申请单" })
+        : (flag = false);
+      (thNo ?? "") != ""
+        ? arr.push({ tar: "#detail13", title: "销售——售后退货单" })
+        : (flag = false);
+      (returnGoodCode ?? "") != ""
+        ? arr.push({ tar: "#detail14", title: "销售——退货单" })
+        : (flag = false);
+      (sale_diff_id ?? "") != ""
+        ? arr.push({ tar: "#detail15", title: "销售——工差单" })
+        : (flag = false);
+      (supplierNo ?? "") != ""
+        ? arr.push({ tar: "#detail16", title: "供应商详情" })
+        : (flag = false);
+      (companyNo ?? "") != ""
+        ? arr.push({ tar: "#detail17", title: "业务公司详情" })
+        : (flag = false);
+      (customer_code ?? "") != ""
+        ? arr.push({ tar: "#detail18", title: "企业客户详情" })
+        : (flag = false);
+
+      
+      this.anchorArray = arr
     },
   },
 };

+ 1 - 1
src/views/reportQuery/test/index.vue

@@ -64,7 +64,7 @@
           <!-- 路由跳转参数需更改 -->
           <i
             class="el-icon-view tb-icon"
-            @click="getRouter(`testDetail`, scope.row.standBookNo)"
+            @click="getRouter(`testDetail`, scope.row.id)"
           ></i>
         </el-tooltip>
       </template>