Pārlūkot izejas kodu

工猫项目名称点击事件

zweizhao 7 gadi atpakaļ
vecāks
revīzija
ef50b3f7ad
1 mainītis faili ar 13 papildinājumiem un 10 dzēšanām
  1. 13 10
      src/module/main/components/gongmall.vue

+ 13 - 10
src/module/main/components/gongmall.vue

@@ -17,11 +17,11 @@
           :label="tableHeaders[index]"
         >
           <template slot-scope="scope">
-            <el-button
-              type="text"
-              v-if="prop === 'ctrl'"
-              @click="clickDetail(scope.row['id'])"
-            >{{scope.row[prop]}}</el-button>
+            <a
+              v-if="prop === 'projectName'"
+              :href="scope.row | projectLink"
+              target="_blank"
+            >{{scope.row[prop]}}</a>
             <span v-else-if="prop === 'create_time'">{{scope.row[prop] | toDate}}</span>
             <template v-else-if="prop === 'state'">
               <el-button v-if="scope.row[prop] === '1'" type="primary">确认付款</el-button>
@@ -98,13 +98,16 @@ export default {
   filters: {
     toDate(val) {
       return new Date(val * 1000).toLocaleDateString()
+    },
+    projectLink(i) {
+      const type = i.entity_type
+      let link = 'javascript:void(0);'
+      if(type === '1') link = `/rooter/outsourceitem/${i.entity_id}>`
+      else if(type === '3') link = `/rooter/wagedetails?job_id=${i.entity_id}`
+      return link
     }
   },
   methods: {
-    // 点击详情
-    clickDetail(id) {
-      window.open(`/rooter/cloudjobitem/${id}`)
-    },
     // 根据状态显示图表样式
     tableRowClassName({ row, rowIndex }) {
       // console.log({row, rowIndex})
@@ -131,7 +134,7 @@ export default {
           servicePay = ((rData.periodList[i.entity_id].person_platform_fee || 0) / 100).toFixed(2)
           getPay = rData.periodList[i.entity_id].total_person_tax_fee || 0
           realGet = rData.periodList[i.entity_id].developer_fee || 0
-        }else {
+        } else {
           if(i.entity_type === '1') projectName = rData.projectList[i.entity_id].pro_name
 
           prePay = ((rData.projectList[i.entity_id].origin_price || 0) / 100).toFixed(2)