Browse Source

中间合同

asd26269546 1 year ago
parent
commit
79f16444e1

+ 6 - 3
src/components/byTable/index.vue

@@ -14,10 +14,11 @@
       </el-button>
     </div>
   </div>
+  <!-- statWarpHeight > 200 &&  -->
   <div
     class="stat-warp"
     v-if="statConfig.length != 0"
-    :class="statWarpHeight > 200 && isMore ? 'show-more' : ''"
+    :class="isMore ? 'show-more' : ''"
   >
     <div class="title">
       <select
@@ -31,7 +32,8 @@
       </select>
       <div v-if="statConfig.length === 1">{{ statConfig[0].label }}</div>
     </div>
-    <div class="more-btn"  @click="isMore = !isMore" v-if="statWarpHeight > 200">
+    <!-- v-if="statWarpHeight > 200" -->
+    <div class="more-btn"  @click="isMore = !isMore" >
       <span>
         <i v-if="!isMore" class="iconfont icon-btn_xiala22"></i>
         <i v-else class="iconfont icon-btn_shouqi22"></i>
@@ -358,6 +360,7 @@ export default defineComponent({
     const changeStatData = () => {
       statWarpHeight.value = document.getElementById("statWarp").offsetHeight;
     };
+    
     let statWarpHeight = ref(0);
     watch(
       proxy.statConfig,
@@ -367,7 +370,7 @@ export default defineComponent({
           statWarpHeight.value =
             document.getElementById("statWarp").offsetHeight;
         }, 500);
-      },
+      }, 
       { immediate: true }
     );
     let statSelectVal = ref(0);

+ 12 - 7
src/views/salesMange/saleContract/contract/index.vue

@@ -584,14 +584,12 @@ const getList = async (req) => {
     }, 200);
   });
 };
-const statConfig = computed(() => {
-  return [
-    {
+const statConfig = ref(
+  [{
       label: "合计",
       data: [],
-    },
-  ];
-});
+    }]
+)
 getDict();
 if (route.query.code) {
   sourceList.value.pagination.keyword = route.query.code;
@@ -601,7 +599,12 @@ onMounted(() => {
 })
 const getTotal = () => {
   proxy.post("/contract/getHeadCustomerStatistics",sourceList.value.pagination).then((res) => {
-    
+    statConfig.value = [
+      {
+        label: "合计",
+        data: [],
+      },
+    ];
     statConfig.value[0].data.push({
       label: "合计",
       data: [
@@ -643,7 +646,9 @@ const getTotal = () => {
           },
         ],
       });
+      
     }
+    console.log(statConfig.value)
     console.log(res);
   });
 };

+ 13 - 11
src/views/salesMange/saleContract/middle/index.vue

@@ -19,12 +19,14 @@
 						text: '生成中间合同',
 						plain: true,
 						type: 'warning',
+            disabled: selection.data.length === 0,
 						action: () => openModal('add'),
 					},
 				]"
         :table-events="{
           //element talbe事件都能传
           select: select,
+          selectAll: select,
         }"
         @get-list="getList">
         <template #code="{ item }">
@@ -181,7 +183,7 @@
           <div class="baseRow" style="display: flex">
             <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">FREIGHT COST:</div>
             <div class="contentRow" style="width: 100px; text-align: center">
-              {{( printDetails.amount -  statisticsTwo("amount", 2)).toFixed(2) }}
+              {{statisticsTwo("amount", 2) }}
             </div>
           </div>
           <div class="baseRow" style="display: flex">
@@ -305,11 +307,11 @@ const selectConfig = computed(() => {
       prop: "sellCorporationId",
       data: corporationList.value,
     },
-    {
-      label: "采购方",
-      prop: "buyCorporationId",
-      data: corporationList.value,
-    },
+    // {
+    //   label: "采购方",
+    //   prop: "buyCorporationId",
+    //   data: corporationList.value,
+    // },
   ];
 });
 
@@ -355,7 +357,7 @@ const config2 = computed(() => {
     {
       attrs: {
         label: "创建人",
-        prop: "opUserName",
+        prop: "userName",
         width: 180,
       },
     },
@@ -466,14 +468,14 @@ const config = computed(() => {
     {
       attrs: {
         label: "归属公司",
-        slot: "sellCorporationName",
+        slot: "buyCorporationName",
         "min-width": 200,
       },
     },
     {
       attrs: {
         label: "客户名称",
-        slot: "buyCorporationName",
+        slot: "sellCorporationName",
         "min-width": 200,
       },
     },
@@ -599,8 +601,8 @@ const statistics = (label, index) => {
 };
 const statisticsTwo = (label, index) => {
   let num = 0;
-  if (printDetails.value.contractMap.contractProductList && printDetails.value.contractMap.contractProductList.length > 0) {
-    printDetails.value.contractMap.contractProductList.map((item) => {
+  if (printDetails.value.contractMap.contractProjectList && printDetails.value.contractMap.contractProjectList.length > 0) {
+    printDetails.value.contractMap.contractProjectList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
       }