瀏覽代碼

销售合同 - 列表增加“到账比例”、“完成到账”按钮. 列表增加计算到账比例

lxf 1 年之前
父節點
當前提交
c0932758a2
共有 1 個文件被更改,包括 61 次插入21 次删除
  1. 61 21
      src/views/salesMange/saleContract/contract/index.vue

+ 61 - 21
src/views/salesMange/saleContract/contract/index.vue

@@ -27,9 +27,17 @@
             <span>{{ moneyFormat(item.refundMoney, 2) }}</span>
           </div>
         </template>
-        <template #advanceRatio="{ item }">
+        <template #scale="{ item }">
           <div>
-            <span>{{ item.advanceRatio }}%</span>
+            {{ computeScale(item) }}
+          </div>
+        </template>
+        <template #refundStatusNew="{ item }">
+          <div>
+            <span v-if="item.refundStatus && item.refundStatus !== 0">
+              {{ dictValueLabel(item.refundStatus, refundStatusNew) }}
+            </span>
+            <span v-else>{{ dictValueLabel(item.refundStatusNew, refundStatusNew) }}</span>
           </div>
         </template>
       </byTable>
@@ -311,7 +319,7 @@ const config = computed(() => {
       attrs: {
         label: "归属公司",
         prop: "sellCorporationId",
-        "min-width": 220,
+        "min-width": 160,
       },
       render(type) {
         let text = "";
@@ -352,7 +360,7 @@ const config = computed(() => {
       attrs: {
         label: "客户",
         prop: "buyCorporationId",
-        "min-width": 220,
+        "min-width": 180,
       },
       render(type) {
         let text = "";
@@ -369,21 +377,28 @@ const config = computed(() => {
       attrs: {
         label: "版本号",
         prop: "version",
-        width: 120,
+        width: 80,
       },
     },
     {
       attrs: {
         label: "合同金额",
         slot: "amount",
-        width: 140,
+        width: 120,
       },
     },
     {
       attrs: {
         label: "已到账金额",
         slot: "refundMoney",
-        width: 140,
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "到账比例",
+        slot: "scale",
+        width: 100,
       },
     },
     {
@@ -407,7 +422,7 @@ const config = computed(() => {
       attrs: {
         label: "审批状态",
         prop: "status",
-        width: 140,
+        width: 120,
       },
       render(type) {
         let text = "";
@@ -423,29 +438,42 @@ const config = computed(() => {
     {
       attrs: {
         label: "到款状态",
-        prop: "refundStatusNew",
-        width: 140,
-      },
-      render(type) {
-        let text = "";
-        if (refundStatusNew.value && refundStatusNew.value.length > 0) {
-          let data = refundStatusNew.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        slot: "refundStatusNew",
+        width: 120,
       },
+      // render(type) {
+      //   let text = "";
+      //   if (refundStatusNew.value && refundStatusNew.value.length > 0) {
+      //     let data = refundStatusNew.value.filter((item) => item.value == type);
+      //     if (data && data.length > 0) {
+      //       text = data[0].label;
+      //     }
+      //   }
+      //   return text;
+      // },
     },
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: "180",
         align: "center",
         fixed: "right",
       },
       renderHTML(row) {
         return [
+          !row.refundStatus && row.refundStatusNew == 10
+            ? {
+                attrs: {
+                  label: "到款完成",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickAccomplish(row);
+                },
+              }
+            : {},
           {
             attrs: {
               label: "打印",
@@ -649,6 +677,18 @@ const statisticsTwo = (label, index) => {
   }
   return num;
 };
+const computeScale = (item) => {
+  let text = 0;
+  if (item.refundMoney && Number(item.refundMoney) > 0 && item.amount && Number(item.amount) > 0) {
+    text = parseFloat(Number(item.refundMoney) / Number(item.amount)).toFixed(2);
+  }
+  return text + "%";
+};
+const clickAccomplish = (row) => {
+  proxy.post("/contract/toTheAccount", { id: row.id }).then(() => {
+    getList();
+  });
+};
 </script>
 
 <style lang="scss" scoped>