谢杰标 2 жил өмнө
parent
commit
8a7e0d2ece

+ 8 - 0
src/api/financed/index.js

@@ -114,3 +114,11 @@ export function updateRemark(data) {
     data,
   });
 }
+// 订单应收应付统计
+export function countOrderNum(query) {
+  return request({
+    url: "/system/top/order/countOrderNum",
+    method: "get",
+    params: query,
+  });
+}

+ 0 - 1
src/directive/common/int.js

@@ -1,5 +1,4 @@
 import { checkNum } from "@/utils/index";
-import { set } from "nprogress";
 export default {
   inserted(el, binding, vnode) {
     el.addEventListener("keyup", (e) => {

+ 101 - 10
src/views/financed/arap/index.vue

@@ -5,9 +5,9 @@
       @change="changeSearch"
       style="margin-bottom: 10px"
     >
-      <el-radio-button label="1">应收账款</el-radio-button>
-      <el-radio-button label="2">机构分成</el-radio-button>
-      <el-radio-button label="3">业务员提成</el-radio-button>
+      <el-radio-button :label="0">应收账款</el-radio-button>
+      <el-radio-button :label="1">机构分成</el-radio-button>
+      <el-radio-button :label="2">业务员提成</el-radio-button>
     </el-radio-group>
     <search-box-new
       ref="searchBox"
@@ -16,6 +16,15 @@
       @search="search"
       @init="init"
     />
+    <div class="dis_flex_order_li">
+      <div class="list" v-for="(item, index) in showTabList[type]" :key="index">
+        <img :src="item.img" alt="" />
+        <div class="right">
+          <h4>{{ item.label }}:</h4>
+          <p>{{ countInfo[item.prop] }}{{ item.ch || "元" }}</p>
+        </div>
+      </div>
+    </div>
     <table-list
       :key="type"
       rowKey="id"
@@ -69,7 +78,7 @@
       </template>
       <template slot="btn" slot-scope="props">
         <el-button
-          v-if="type == 1"
+          v-if="type == 0"
           type="text"
           :disabled="props.scope.row.creditStatus == 1"
           @click="openDialog(props.scope.row, 1)"
@@ -129,6 +138,7 @@ import {
   sellerList,
   tenantList,
   orderExport,
+  countOrderNum,
 } from "@/api/financed/index";
 export default {
   name: "cost",
@@ -142,6 +152,39 @@ export default {
   },
   data() {
     return {
+      showTabList: [
+        [
+          {
+            label: "合同金额",
+            prop: "orderPriceTotal",
+            img: require("@/assets/images/合同金额@2x.png"),
+          },
+          {
+            label: "已收账款",
+            prop: "orderReceivedTotal",
+            img: require("@/assets/images/已收款@2x.png"),
+          },
+          {
+            label: "未收账款",
+            prop: "orderUncollectedTotal",
+            img: require("@/assets/images/未收款@2x.png"),
+          },
+        ],
+        [
+          {
+            label: "待付账款",
+            prop: "sellerPay",
+            img: require("@/assets/images/未收款@2x.png"),
+          },
+        ],
+        [
+          {
+            label: "待付账款",
+            prop: "tenantPay",
+            img: require("@/assets/images/未收款@2x.png"),
+          },
+        ],
+      ],
       loading: false, //当前表单加载是否加载动画
       navText: {
         title: "应收应付",
@@ -159,7 +202,7 @@ export default {
         pageNum: 1,
       },
       // 表单
-      tableSet1: [
+      tableSet0: [
         {
           label: "下单时间",
           prop: "buyTime",
@@ -226,7 +269,7 @@ export default {
           hidden: true,
         },
       ],
-      tableSet2: [
+      tableSet1: [
         {
           label: "下单时间",
           prop: "startTime",
@@ -271,7 +314,7 @@ export default {
           hidden: true,
         },
       ],
-      tableSet3: [
+      tableSet2: [
         {
           label: "下单时间",
           prop: "buyTime",
@@ -331,9 +374,10 @@ export default {
       tipDialogVisible: false,
       orderDialogVisible: false,
       remarkDialogVisible: false,
-      type: 1,
+      type: 0,
       activeOrderInfo: {},
       roleList: [],
+      countInfo: {},
     };
   },
   created() {
@@ -347,7 +391,7 @@ export default {
       ] = true;
     },
     batchExport() {
-      const fn = [orderExport, orderExport, orderExport][this.type - 1];
+      const fn = [orderExport, orderExport, orderExport][this.type];
       fn(this.backData()).then((res) => {
         if (res.msg) {
           exportFn(res.msg, "导出应收应付数据");
@@ -369,7 +413,7 @@ export default {
       this.search(2);
     },
     getDataList(data) {
-      const fn = [orderList, tenantList, sellerList][this.type - 1];
+      const fn = [orderList, tenantList, sellerList][this.type];
       fn(data)
         .then((res) => {
           this.tableData = res.rows;
@@ -406,6 +450,7 @@ export default {
     },
     init() {
       this.getRoleList();
+      this.getCountOrderNum();
       this.search(2);
     },
     getRoleList() {
@@ -413,6 +458,11 @@ export default {
         this.roleList = res.rows;
       });
     },
+    getCountOrderNum() {
+      countOrderNum().then((res) => {
+        this.countInfo = res.data;
+      });
+    },
   },
   computed: {
     tableSet() {
@@ -484,4 +534,45 @@ export default {
     content: ",";
   }
 }
+.dis_flex_order_li {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  & > .list {
+    user-select: none;
+    cursor: pointer;
+    transition: all 0.3s;
+    box-shadow: 0px 0px 4px 1px rgba(0, 0, 0, 0.2);
+    &:hover {
+      transform: scale(1.04);
+    }
+    width: 136px;
+    height: 44px;
+    border-radius: 6px;
+    display: flex;
+    align-items: center;
+    flex-shrink: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+    & > img {
+      margin-left: 2px;
+      width: 40px;
+      height: 40px;
+    }
+    & > .right {
+      flex: 1;
+      padding-left: 4px;
+      & > h4 {
+        color: #000;
+        margin: 0;
+        font-size: 12px;
+      }
+      & > p {
+        font-size: 12px;
+        color: red;
+        margin: 0;
+      }
+    }
+  }
+}
 </style>

+ 0 - 1
src/views/financed/components/arapRemarks.vue

@@ -27,7 +27,6 @@ export default {
     },
     orderSn: {
       type: Number,
-      default: "",
     },
     remark: {
       type: String,

+ 52 - 17
src/views/financed/cost/dislogSet.vue

@@ -138,7 +138,7 @@
           >
             <el-col :span="11">
               <el-input
-                v-int
+                v-int="{ set: 0 }"
                 placeholder="最低价"
                 v-model.number="item.minValue"
               ></el-input>
@@ -146,10 +146,10 @@
             <el-col class="line" :span="2" style="magrin: 10px">-</el-col>
             <el-col :span="11">
               <el-input
-                v-int
+                @keyup.native="regValue(item)"
                 placeholder="最高价"
                 @change="changeMaxValue('itemList.' + index + '.minValue')"
-                v-model.number="item.maxValue"
+                v-model="item.maxValue"
               ></el-input>
             </el-col>
           </el-form-item>
@@ -286,6 +286,11 @@ export default {
         Object.keys(this.form).map((key) => {
           this.form[key] = res.data[key];
         });
+        this.form.itemList.forEach((ele) => {
+          if (ele.maxValue == -1) {
+            ele.maxValue = "*";
+          }
+        });
       });
     },
     getEduList() {
@@ -313,17 +318,19 @@ export default {
       data.projectId = projectId;
     },
     add(index, data) {
-      data = data || {
-        projectId: undefined,
-        itemName: undefined,
-        itemCategory: undefined,
-        businessId: undefined,
-        educationTypeId: undefined,
-        itemType: undefined,
-        typeValue: undefined,
-        minValue: undefined,
-        maxValue: undefined,
-      };
+      data = data
+        ? JSON.parse(JSON.stringify(data))
+        : {
+            projectId: undefined,
+            itemName: undefined,
+            itemCategory: undefined,
+            businessId: undefined,
+            educationTypeId: undefined,
+            itemType: undefined,
+            typeValue: undefined,
+            minValue: undefined,
+            maxValue: undefined,
+          };
       this.itemList.splice(index + 1, 0, data);
     },
     del(index) {
@@ -361,10 +368,16 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          let form = JSON.parse(JSON.stringify(this.form));
+          form.itemList.forEach((ele) => {
+            if (ele.maxValue === "*") {
+              ele.maxValue = -1;
+            }
+          });
           if (this.type !== 1) {
-            addCost(this.form).then(this.cb);
+            addCost(form).then(this.cb);
           } else {
-            editCost(this.form).then(this.cb);
+            editCost(form).then(this.cb);
           }
         } else {
           return false;
@@ -380,7 +393,19 @@ export default {
       if (isEmpty) {
         return "非阶梯计价只能存在一个";
       }
-      list = list.sort((a, b) => a.minValue - b.minValue);
+      let maxList = list.filter((e) => e.maxValue === "*");
+      if (maxList.length > 1) {
+        return "阶梯计价存在范围冲突";
+      }
+      list.sort((a, b) => {
+        if (a.maxValue == "*") {
+          return Number.MAX_VALUE;
+        }
+        if (b.maxValue == "*") {
+          return -Number.MAX_VALUE;
+        }
+        return a.minValue - b.minValue;
+      });
       for (let i = 0, len = list.length - 1; i < len; i++) {
         if (list[i].maxValue >= list[i + 1].minValue) {
           return "阶梯计价存在范围冲突";
@@ -388,6 +413,16 @@ export default {
       }
       return;
     },
+    regValue(data) {
+      let { maxValue } = data;
+      let val;
+      if (maxValue.includes("*")) {
+        val = "*";
+      } else {
+        val = maxValue.replace(/[^0-9]/g, "");
+      }
+      data.maxValue = val;
+    },
   },
   computed: {
     isShow: {