AJNB 2 months ago
parent
commit
050de9c7de
5 changed files with 102 additions and 85 deletions
  1. 5 2
      src/components/BiddingTable.vue
  2. 65 48
      src/components/startBiddingT.vue
  3. 1 29
      src/http/api.js
  4. 22 0
      src/main.js
  5. 9 6
      src/store/index.js

+ 5 - 2
src/components/BiddingTable.vue

@@ -121,10 +121,13 @@ export default {
           // catch error
         })
     },
-    direct(item, arr) {
+    direct(item, arr, index) {
       this.$router.push(item.name)
       this.$store.commit("addEditableTabs", item);
       this.$store.commit("changeCurrentPath", arr)
+      this.$store.state.selectedBiddingInfo = this.tableData[index];
+      // console.log("this.$store.state.selectedBiddingInfo", this.$store.state.selectedBiddingInfo);
+      
     },
   },
   mounted() {
@@ -225,7 +228,7 @@ export default {
       <el-table-column prop="operation" label="操作" width="150%">
         <template #default="scope">
           <el-button type="primary" size="small"
-            @click="direct({ name: '/startBidding', title: '开始竞价' }, ['集团功能', '开始竞价'])">竞标详情</el-button>&nbsp;
+            @click="direct({ name: '/startBidding', title: '开始竞价' }, ['集团功能', '开始竞价'], scope.$index)">竞标详情</el-button>&nbsp;
           <el-link type="primary" size="small" @click="deleteById(scope)">删除</el-link>
         </template>
 

+ 65 - 48
src/components/startBiddingT.vue

@@ -2,30 +2,30 @@
   <div class="main">
     <div class="baseInfo bg">
       <el-h6>基础信息</el-h6>
-      <el-table :data="baseInfo.one" stripe style="width: 100%"></el-table>
-      <el-table :data="baseInfo.one" stripe style="width: 100%" >
-        <el-table-column prop="Name" label="名称" />
-        <el-table-column prop="PurchaseQuantity" label="采购数量" />
-        <el-table-column prop="PurchasingUnitOfMeasurement" label="采购计量单位" />
-        <el-table-column prop="RecruitmentStartTime" label="招采开始时间" />
+      <el-table :data="baseInfo" stripe style="width: 100%"></el-table>
+      <el-table :data="baseInfo" stripe style="width: 100%">
+        <el-table-column prop="title" label="名称" />
+        <el-table-column prop="purchase_quantity" label="采购数量" />
+        <el-table-column prop="purchase_unit" label="采购计量单位" />
+        <el-table-column prop="bidding_start_time" label="招采开始时间" />
       </el-table>
-      <el-table :data="baseInfo.two" stripe style="width: 100%" >
-        <el-table-column prop="RecruitmentEndTime" label="招采结束时间" />
-        <el-table-column prop="PurchaseType" label="采购类型" />
-        <el-table-column prop="PlaceOfSupply" label="供货地点" />
-        <el-table-column prop="LatestArrivalTime" label="最晚到货时间" />
+      <el-table :data="baseInfo" stripe style="width: 100%">
+        <el-table-column prop="bidding_end_time" label="招采结束时间" />
+        <el-table-column prop="purchase_type" label="采购类型" />
+        <el-table-column prop="supply_location" label="供货地点" />
+        <el-table-column prop="latest_delivery_time" label="最晚到货时间" />
       </el-table>
-      <el-table :data="baseInfo.three" stripe style="width: 100%" >
-        <el-table-column prop="InvoiceType" label="发票类型" />
-        <el-table-column prop="TimeOfPayment" label="付款时间" />
-        <el-table-column prop="CreationTime" label="创建时间" />
-        <el-table-column prop="Founder" label="创建人" />
+      <el-table :data="baseInfo" stripe style="width: 100%">
+        <el-table-column prop="invoice_type" label="发票类型" />
+        <el-table-column prop="payment_time" label="付款时间" />
+        <el-table-column prop="create_time" label="创建时间" />
+        <el-table-column prop="creator" label="创建人" />
       </el-table>
     </div>
     <div class="biddingInfo bg">
       <el-h6>竞价信息</el-h6>
-      <el-table :data="baseInfo.one" stripe style="width: 100%"></el-table>
-      <el-table :data="biddingInfo" stripe style="width: 100%;">
+      <el-table :data="baseInfo" stripe style="width: 100%"></el-table>
+      <el-table :data="biddingInfo" stripe style="width: 100%;" ref="table">
         <el-table-column prop="OpeningTime" label="开始时间" />
         <el-table-column prop="CurrentBiddingStatus" label="当前竞标状态" />
         <el-table-column prop="CurrentRound" label="当前轮次" />
@@ -33,7 +33,7 @@
     </div>
     <div class="ruleInfo bg">
       <el-h6>规则信息</el-h6>
-      <el-table :data="baseInfo.one" stripe style="width: 100%"></el-table>
+      <el-table :data="baseInfo" stripe style="width: 100%"></el-table>
       <el-table :data="ruleInfo" stripe style="width: 100%">
         <el-table-column prop="RuleName" label="规则名称" />
         <el-table-column prop="NumberOfRounds" label="轮次数(轮)" />
@@ -43,7 +43,7 @@
     </div>
     <div class="resultInfo bg">
       <el-h6>结果信息</el-h6>
-      <el-table :data="baseInfo.one" stripe style="width: 100%"></el-table>
+      <el-table :data="baseInfo" stripe style="width: 100%"></el-table>
       <el-table :data="resultInfo" stripe style="width: 100%">
         <el-table-column prop="WinningBidder" label="中标单位" />
         <el-table-column prop="WinningBidPrice" label="中标价格" />
@@ -54,7 +54,7 @@
     </div>
     <div class="processInfo bg">
       <el-h6>过程信息</el-h6>
-      <el-table :data="baseInfo.one" stripe style="width: 100%"></el-table>
+      <el-table :data="baseInfo" stripe style="width: 100%"></el-table>
       <el-table :data="processInfo" stripe style="width: 100%" height="180">
         <el-table-column prop="BiddingUnit" label="竞价单位" />
         <el-table-column prop="FirstTime" label="第1轮竞价时间" />
@@ -79,35 +79,25 @@
 export default {
   data() {
     return {
-      baseInfo: {
-        one: [
-          {
-            Name: 'test',
-            PurchaseQuantity: 5000,
-            PurchasingUnitOfMeasurement: '吨',
-            RecruitmentStartTime: '2024-08-28'
-          }
-        ],
-        two: [
-          {
-            RecruitmentEndTime: '2024-08-21',
-            PurchaseType: '煤炭',
-            PlaceOfSupply: '工大操场',
-            LatestArrivalTime: '2024-08-20'
-          }
-        ],
-        three: [
-          {
-            InvoiceType: '普通发票',
-            TimeOfPayment: '2024-08-21',
-            CreationTime: '2024-08-19 15:51:18',
-            Founder: 'hjj'
-          }
-        ]
-      },
+      baseInfo: [
+        {
+          title: 'test',
+          purchase_quantity: 5000,
+          purchase_unit: '吨',
+          bidding_start_time: '2024-08-28',
+          bidding_end_time: '2024-08-21',
+          purchase_type: '煤炭',
+          supply_location: '工大操场',
+          latest_delivery_time: '2024-08-20',
+          invoice_type: '普通发票',
+          payment_time: '2024-08-21',
+          create_time: '2024-08-19 15:51:18',
+          creator: 'hjj',
+        }
+      ],
       biddingInfo: [
         {
-          OpeningTime: '2024-08-19',
+          OpeningTime: '2024-08-23',
           CurrentBiddingStatus: '进行中',
           CurrentRound: 1,
         }
@@ -175,6 +165,33 @@ export default {
       ]
     }
   },
+  methods: {
+    init() {
+      this.baseInfo.pop();
+      this.baseInfo.push(this.$store.state.selectedBiddingInfo);
+      
+      this.biddingInfo.unshift({
+        OpeningTime: this.getCurrentTime(),
+        CurrentBiddingStatus: this.biddingInfo[0].CurrentBiddingStatus,
+        CurrentRound: this.biddingInfo[0].CurrentRound
+      });
+      this.biddingInfo.pop();
+    },
+    getCurrentTime() {
+      const date = new Date();
+      const yy = date.getFullYear();
+      const mm = date.getMonth() + 1;
+      const dd = date.getDate();
+      const hh = date.getHours();
+      const mf = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
+      const ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
+      return `${yy}-${mm}-${dd} ${hh}:${mf}:${ss}`;
+    }
+    
+  },
+  mounted() {
+    this.init();
+  }
 }
 </script>
 

+ 1 - 29
src/http/api.js

@@ -1,33 +1,5 @@
 import request from "./request";
-import qs from "qs";
- 
-const baseUrl = '/api'
- 
- 
-//登录
-export function authCodeLogin(params) {
-  return request({
-    url: baseUrl + "/authCodeLogin/" + params.code,
-    method: "get",
-  });
-}
-//退出
-// eslint-disable-next-line no-unused-vars
-export function authLogout(params) {
-  return request({
-    url: baseUrl + "/logout",
-    method: "get",
-  });
-}
-//获取用户数据
-export function getUserInfo(params) {
-  return request({
-    url: baseUrl + "/getUserInfo",
-    method: "get",
-    params:qs.stringify(params)
-  });
-}
-
+//测试
 export function test(params){
   let new_params = {
     url: '/BiddingProcess/ProcessInfo',

+ 22 - 0
src/main.js

@@ -26,3 +26,25 @@ app.use(ElementPlus)
 app.use(router)
 app.use(store)
 app.mount('#app')
+
+// app.vue写在script里面  main.js写在app挂在完之后
+const debounce = (fn, delay) => {
+    let timer
+     return (...args) => {
+       if (timer) {
+         clearTimeout(timer)
+       }
+       timer = setTimeout(() => {
+         fn(...args)
+       }, delay)
+     }
+  }
+    
+  const _ResizeObserver = window.ResizeObserver;
+  window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
+     constructor(callback) {
+       callback = debounce(callback, 200);
+       super(callback);
+     }
+  }
+  

+ 9 - 6
src/store/index.js

@@ -5,17 +5,20 @@ export default createStore({
         editableTabsValue: '1',
         editableTabs: [],
         tabIndex: 1,
-        currentPath:'',
-        biddingProcess:{
+        currentPath: '',
+        biddingProcess: {
             baseInfo: '',
             ruleInfo: '',
-            processInfo:'',
+            processInfo: '',
+        },
+        selectedBiddingInfo: {
+
         }
     },
     getters: {
-        getCurrentPath(state){
+        getCurrentPath(state) {
             return state.currentPath
-        }
+        },
     },
     mutations: {
         addEditableTabs(state, tab) {
@@ -29,7 +32,7 @@ export default createStore({
             }
             state.editableTabsValue = tab.name
         },
-        changeCurrentPath(state, arr){
+        changeCurrentPath(state, arr) {
             state.currentPath = '首页/' + arr.join('/');
         }
     },