谢杰标 2 жил өмнө
parent
commit
4ad27114f9

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

@@ -180,6 +180,7 @@ export function monthOrderList(query) {
     url: "/divide/log/monthOrderList",
     method: "get",
     params: query,
+    isProce: true,
   });
 }
 // 订单应收应付统计
@@ -285,3 +286,12 @@ export function costInstDetail(id) {
     method: "get",
   });
 }
+
+// 月份订单统计信息
+export function monthOrderCount(query) {
+  return request({
+    url: "/divide/log/monthOrderCount",
+    method: "get",
+    params: query,
+  });
+}

+ 0 - 6
src/assets/styles/index.scss

@@ -59,12 +59,6 @@ a:hover {
   text-decoration: none;
 }
 
-.currency::before {
-  content: "¥";
-  font-size: 13px;
-  margin-right: -4px;
-}
-
 div:focus {
   outline: none;
 }

+ 4 - 2
src/components/Comon/pictureList.vue

@@ -6,7 +6,7 @@
         <h4>{{ item.label }}:</h4>
         <p>
           {{ (item.value || info[item.prop] || 0) | formatPrice }}
-          {{ item.ch || "元" }}
+          <!-- {{ item.ch || "元" }} -->
         </p>
       </div>
     </div>
@@ -55,7 +55,7 @@ export default {
     &:hover {
       transform: scale(1.04);
     }
-    width: 136px;
+    width: 166px;
     height: 44px;
     border-radius: 6px;
     display: flex;
@@ -69,12 +69,14 @@ export default {
       height: 40px;
     }
     & > .right {
+      padding-top: 4px;
       flex: 1;
       padding-left: 4px;
       & > h4 {
         color: #000;
         margin: 0;
         font-size: 12px;
+        margin-bottom: 4px;
       }
       & > p {
         font-size: 12px;

+ 9 - 34
src/components/searchBoxNew.vue

@@ -545,19 +545,25 @@
             }"
             clearable
           ></el-cascader>
+          <!-- pickerOptions json处理后丢失 取原值 -->
           <el-date-picker
             v-else-if="item.scope === 'datePicker'"
             v-model="formData[item.prop]"
-            type="datetimerange"
-            :picker-options="pickerOptions"
+            :type="item.type || 'datetimerange'"
+            :picker-options="
+              item.pickerOptions ? formList[index].pickerOptions : pickerOptions
+            "
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
             align="right"
             :size="size"
+            :default-time="['00:00:00', '23:59:59']"
             value-format="timestamp"
+            :default-value="item.defaultValue"
           >
           </el-date-picker>
+
           <el-date-picker
             v-else-if="item.scope === 'datePickerA'"
             v-model="formData[item.prop]"
@@ -793,38 +799,7 @@ export default {
       newProfessional: [], //专业-筛选后的数据
       newSujectType: [], //科目-筛选后的数据
       applySiteAddressX: [], //考试地点-根据考试计划过滤而来
-      pickerOptions: {
-        //日期选择器近期功能
-        shortcuts: [
-          {
-            text: "最近一周",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近一个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近三个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
-      },
+      pickerOptions: {},
     };
   },
   computed: {

+ 2 - 2
src/components/tableList.vue

@@ -987,8 +987,8 @@
           <div v-else-if="item.scope === 'fill'">
             {{ scope.row[item.prop] || "--" }}
           </div>
-          <div v-else-if="item.scope === 'formatPrice'" class="currency">
-            {{ scope.row[item.prop] | formatPrice }}
+          <div v-else-if="item.scope === 'formatPrice'">
+            {{ scope.row[item.prop] || 0 | formatPrice }}
           </div>
           <span v-else :style="item.style">
             {{ scope.row[item.prop] }}

+ 2 - 1
src/directive/filter/index.js

@@ -1,6 +1,6 @@
 // 金额格式化
 export function formatPrice(price) {
-  return price?.toLocaleString(
+  price = price?.toLocaleString(
     "zh-CN",
     (undefined,
     {
@@ -8,4 +8,5 @@ export function formatPrice(price) {
       maximumFractionDigits: 2,
     })
   );
+  return "¥ " + price;
 }

+ 23 - 23
src/views/financed/accountsPayable/businessCommission/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="ActivityList">
     <search-box-new
+      class="search_box_page"
       ref="searchBox"
       :redIcon="false"
       :formData="formData"
@@ -10,7 +11,6 @@
     />
     <picture-list ref="pictureList" :list="showTabList"></picture-list>
     <table-list
-      :key="type"
       rowKey="id"
       ref="tableList"
       :tableSets="tableSet"
@@ -19,7 +19,7 @@
       :loading="loading"
     >
       <template slot="customize">
-        <el-button @click="exportSH" type="success"> 批量审核 </el-button>
+        <el-button @click="batchAudit" type="success"> 批量审核 </el-button>
         <el-button @click="batchExport" type="primary"> 导出excel </el-button>
       </template>
       <template slot="predictPayTime" slot-scope="props">
@@ -50,7 +50,7 @@
         </div>
       </template>
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="openDialog(props.scope.row, 1)">
+        <el-button type="text" @click="openDialog(props.scope.row)">
           详情
         </el-button>
         <el-button
@@ -58,10 +58,12 @@
           v-if="!props.scope.row.orderSn"
           :disabled="
             !(
-              props.scope.row.payStatus === 0 || props.scope.row.payStatus === 4
+              props.scope.row.payStatus === 0 ||
+              props.scope.row.payStatus === 4 ||
+              getRoles(props.scope.row.roleId)
             )
           "
-          @click="openDialog([props.scope.row])"
+          @click="openDialog([props.scope.row], 1)"
         >
           支付
         </el-button>
@@ -72,7 +74,7 @@
             props.scope.row.checkStatus !== 0 ||
             getRoles(props.scope.row.roleId)
           "
-          @click="openDialog([props.scope.row])"
+          @click="openDialog(props.scope.row, 0, 1)"
         >
           审核
         </el-button>
@@ -283,9 +285,8 @@ export default {
   methods: {
     getRoles(roleId) {
       if (
-        (this.$store.state.user.rolesId?.length > 0 &&
-          this.$store.state.user.rolesId.includes(roleId)) ||
-        this.$store.state.user.rolesId.includes(1)
+        (this.rolesId?.length > 0 && this.rolesId.includes(roleId)) ||
+        this.rolesId.includes(1)
       ) {
         return false;
       } else {
@@ -337,24 +338,14 @@ export default {
       }
       return a;
     },
-    exportSH() {
-      if (this.activeList.length === 0) {
-        this.$message.error("请勾选数据");
-        return;
-      }
-      this.openDialog(this.activeList);
-    },
-    openDialog(data, type = 0) {
+    openDialog(data, type = 0, isEdit) {
       if (type === 1) {
         this.activeOrderInfoArray = data;
-        for (let i = 0; i < this.activeOrderInfoArray.length; i++) {
-          this.activeOrderInfoArray[i].checkFrom = 3;
-        }
       } else {
+        data.isEdit = isEdit;
         this.activeOrderInfo = data;
-        this.activeOrderInfo.checkFrom = 3;
       }
-      this[["examine", "order"][type] + "DialogVisible"] = true;
+      this[["order", "examine"][type] + "DialogVisible"] = true;
     },
     batchExport() {
       sellerExport(this.formData).then((res) => {
@@ -426,4 +417,13 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.search_box_page {
+  /deep/ .el-select {
+    width: 120px;
+  }
+  /deep/ .el-form-item__content > .el-input {
+    width: 190px;
+  }
+}
+</style>

+ 196 - 76
src/views/financed/accountsPayable/components/dislogOrderList.vue

@@ -20,7 +20,11 @@
       @search="search(3)"
       @init="init"
     />
-    <picture-list ref="pictureList" :list="showStatisticsList"></picture-list>
+    <picture-list
+      ref="pictureList"
+      :list="showStatisticsList"
+      :info="statisticsInfo"
+    ></picture-list>
     <table-list
       rowKey="id"
       ref="tableList"
@@ -30,7 +34,7 @@
       :loading="loading"
     >
       <template slot="customize">
-        <el-button v-if="isEdit" @click="exportSH" type="primary">
+        <el-button v-if="isEdit" @click="batchAudit" type="primary">
           批量审核
         </el-button>
         <el-button v-else @click="batchExport" type="info" plain>
@@ -51,24 +55,14 @@
         </span>
       </template>
       <template slot="divideCheckStatus" slot-scope="props">
-        <div v-if="props.scope.row.billType != 7">
-          {{
-            divideCheckStatus(
-              props.scope.row.orderSn,
-              props.scope.row.payStatus,
-              props.scope.row.checkStatus
-            )
-          }}
-          <span style="color: #409eff" v-if="props.scope.row.roleName">
-            ({{ props.scope.row.roleName }})
-          </span>
-        </div>
+        <div>{{ props.scope.row.checkStatus > 0 ? "已通过" : "未通过" }}</div>
       </template>
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="openDialog(props.scope.row, 1)">
+        <el-button type="text" @click="handelDetail(props.scope.row)">
           详情
         </el-button>
         <el-button
+          v-if="isEdit"
           type="text"
           :disabled="
             props.scope.row.checkStatus !== 0 ||
@@ -86,11 +80,24 @@
       :currentPage.sync="formData.pageNum"
       @search="search(3)"
     />
+    <!-- 订单详情 -->
+    <dislog-order-details
+      :appendToBody="true"
+      :orderSn="activeOrderInfo.orderSn"
+      :orderFrom="activeOrderInfo.orderFrom"
+      :dialogVisible.sync="orderDialogVisible"
+    />
   </BaseDialog>
 </template>
 
 <script>
 import pictureList from "@/components/Comon/pictureList.vue";
+import dislogOrderDetails from "../../components/dislogOrderDetails.vue";
+import {
+  tenantExport,
+  monthOrderList,
+  monthOrderCount,
+} from "@/api/financed/index";
 export default {
   name: "SaasMasterPlatformDislogOrderList",
   props: {
@@ -104,6 +111,10 @@ export default {
         return {};
       },
     },
+    divideModel: {
+      type: String,
+      default: "1",
+    },
   },
   data() {
     return {
@@ -111,22 +122,22 @@ export default {
         {
           label: "订单金额",
           img: "未收款",
-          value: 0,
+          prop: "orderTotalPrice",
         },
         {
           label: "税前佣金",
           img: "已退款",
-          value: 0,
+          prop: "pretaxTotalBrokerage",
         },
         {
           label: "完单分成",
           img: "成本金额",
-          value: 0,
+          prop: "accomplishTotalMoney",
         },
         {
-          label: "应付分成",
+          label: "应付分成(不含坏账)",
           img: "成本金额",
-          value: 0,
+          prop: "divideTotalMoney",
         },
       ],
       loading: false,
@@ -139,7 +150,7 @@ export default {
         addHide: true,
         dontNum: true,
         openCheckMore: false,
-        changeWidth: "280px",
+        changeWidth: "220px",
         custom: false,
         tableColor: true,
       },
@@ -147,104 +158,87 @@ export default {
         pageSize: 10,
         pageNum: 1,
       },
-      formList: [
-        {
-          prop: "checkStatus",
-          placeholder: "审核状态",
-          scope: "select",
-          options: [
-            { label: "待审核", value: 2 },
-            { label: "已通过", value: 1 },
-          ],
-        },
-        {
-          prop: "checkStatus",
-          placeholder: "分成类型",
-          scope: "select",
-          options: [
-            { label: "退款扣除", value: 2 },
-            { label: "完单分成", value: 1 },
-          ],
-        },
-        {
-          prop: "date",
-          scope: "datePickerA",
-          placeholder: "完单时间",
-          type: "date",
-        },
-        {
-          prop: "orderSn",
-          placeholder: "输入订单号",
-        },
-      ],
       tableSet: [
         {
           label: "完单时间",
           hidden: true,
-          width: 140,
+          prop: "orderTime",
+          width: 160,
+          scope: "aTimeList",
         },
         {
           label: "订单日期",
-          prop: "orderSn",
-          width: "180",
+          prop: "orderCreateTime",
+          width: 160,
+          scope: "aTimeList",
           hidden: true,
         },
         {
           label: "订单号",
           prop: "orderSn",
-          width: "180",
+          width: 220,
           hidden: true,
         },
         {
           label: "分成类型",
-          prop: "billType",
+          prop: "orderType",
           scope: "type",
           hidden: true,
+          width: 100,
           values: {
-            1: "退款扣除",
-            2: "完单分成",
+            1: "完单分成",
+            2: "退款扣除",
           },
         },
         {
           label: "订单金额",
-          prop: "tenantName",
-          hidden: true,
-        },
-        {
-          label: "税前佣金",
-          prop: "payMoney",
+          prop: "orderPrice",
           hidden: true,
+          width: 100,
           scope: "formatPrice",
         },
         {
-          label: "完单分成",
-          prop: "closeOrderMoney",
+          label: "税前佣金",
+          prop: "pretaxBrokerage",
           hidden: true,
+          width: 100,
           scope: "formatPrice",
         },
         {
-          label: "税前佣金",
-          prop: "deductMoney",
+          label: "应付分成",
+          prop: "payMoney",
           hidden: true,
+          width: 100,
           scope: "formatPrice",
         },
         {
           label: "审核状态",
           prop: "divideCheckStatus",
           hidden: true,
+          width: 100,
           scope: "solt",
           soltName: "divideCheckStatus",
         },
       ],
       tableData: [],
       total: 0,
+      orderDialogVisible: false,
+      activeOrderInfo: {},
+      statisticsInfo: {},
     };
   },
 
   methods: {
+    getMonthDay(date) {
+      date = new Date(date);
+      date.setMonth(date.getMonth() + 1);
+      date.setDate(0);
+      var days = date.getDate();
+      return days;
+    },
     init() {
-      console.log(this.info, 789);
-      //   this.navText.choice = !!this.isEdit;
+      this.navText.choice = !!this.isEdit;
+      this.search(2);
     },
     batchExport() {
       tenantExport(this.formData).then((res) => {
@@ -255,6 +249,74 @@ export default {
         }
       });
     },
+    search(v) {
+      this.loading = true;
+      if (v === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          divideLogId: this.info.id,
+        };
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+        this.getStatistics();
+      }
+      let { accomplishTime } = this.formData;
+      if (accomplishTime) {
+        this.formData.accomplishStartTime = accomplishTime[0];
+        this.formData.accomplishEndTime = accomplishTime[1];
+      }
+      monthOrderList(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    getStatistics() {
+      monthOrderCount({ ...this.formData, divideModel: this.divideModel }).then(
+        (res) => {
+          this.statisticsInfo = res.data;
+        }
+      );
+    },
+    getRoles(roleId) {
+      if (
+        (this.rolesId?.length > 0 && this.rolesId.includes(roleId)) ||
+        this.rolesId.includes(1)
+      ) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    handelDetail(data) {
+      this.activeOrderInfo = data;
+      this.orderDialogVisible = true;
+    },
+    batchAudit() {
+      let selectList = this.$refs.tableList.allCheckData.filter(
+        (e) => e.checkStatus === 0 && !this.getRoles(e.roleId)
+      );
+      if (selectList.length === 0) {
+        this.$message.error("请先勾选待审核数据");
+        return;
+      }
+      this.$confirm("审核通过不可撤销,确定审核通过吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.$message({
+          type: "success",
+          message: "批量审核成功!",
+        });
+      });
+    },
   },
   computed: {
     isShow: {
@@ -266,20 +328,73 @@ export default {
       },
     },
     isEdit() {
+      return true;
       return this.info.isEdit;
     },
     title() {
       return this.isEdit ? "订单审核" : "订单列表";
     },
     showStatisticsList() {
-      if (this.isEdit) {
+      if (!this.isEdit) {
         this.statisticsList.splice(2, 1);
       }
       return this.statisticsList;
     },
+    rolesId() {
+      return this.$store.state.user.rolesId;
+    },
+    formList() {
+      return [
+        {
+          prop: "checkStatus",
+          placeholder: "审核状态",
+          scope: "select",
+          options: [
+            { label: "待审核", value: 0 },
+            { label: "已通过", value: 1 },
+          ],
+        },
+        {
+          prop: "orderType",
+          placeholder: "分成类型",
+          scope: "select",
+          options: [
+            { label: "退款扣除", value: 2 },
+            { label: "完单分成", value: 1 },
+          ],
+        },
+        {
+          prop: "accomplishTime",
+          scope: "datePicker",
+          type: "daterange",
+          pickerOptions: {
+            disabledDate: (time) => {
+              let timeStamp = new Date(this.info.monthTime).setHours(
+                0,
+                0,
+                0,
+                0
+              );
+              return (
+                time.getTime() < timeStamp ||
+                time.getTime() >
+                  timeStamp +
+                    (this.getMonthDay(timeStamp) - 1) * 24 * 60 * 60 * 1000
+              );
+            },
+          },
+          defaultValue: this.info.monthTime,
+        },
+        {
+          prop: "orderSn",
+          placeholder: "输入订单号",
+        },
+      ];
+    },
   },
   components: {
     pictureList,
+    dislogOrderDetails,
   },
 };
 </script>
@@ -292,11 +407,16 @@ export default {
   }
 }
 .search_box_page {
-  /deep/ .el-select {
-    width: 120px;
-  }
-  /deep/ .el-form-item__content > .el-input {
-    width: 190px;
+  /deep/ {
+    .el-date-editor {
+      width: 240px;
+    }
+    .el-select {
+      width: 120px;
+    }
+    .el-form-item__content > .el-input {
+      width: 190px;
+    }
   }
 }
 </style>

+ 7 - 18
src/views/financed/accountsPayable/institutionDivide/index.vue

@@ -60,7 +60,9 @@
           v-if="!props.scope.row.orderSn"
           :disabled="
             !(
-              props.scope.row.payStatus === 0 || props.scope.row.payStatus === 4
+              props.scope.row.payStatus === 0 ||
+              props.scope.row.payStatus === 4 ||
+              getRoles(props.scope.row.roleId)
             )
           "
           @click="openDialog([props.scope.row], 1)"
@@ -285,21 +287,10 @@ export default {
       }
       return a;
     },
-    exportSH() {
-      if (this.activeList.length === 0) {
-        this.$message.error("请勾选数据");
-        return;
-      }
-      this.openDialog(this.activeList);
-    },
     openDialog(data, type = 0, isEdit) {
       if (type === 1) {
         this.activeOrderInfoArray = data;
-        for (let i = 0; i < this.activeOrderInfoArray.length; i++) {
-          this.activeOrderInfoArray[i].checkFrom = 2;
-        }
       } else {
-        data.checkFrom = 2;
         data.isEdit = isEdit;
         this.activeOrderInfo = data;
       }
@@ -324,15 +315,13 @@ export default {
           this.tableData = res.rows;
           this.total = res.total;
           this.navText.index = res.total;
+          this.orderDialogVisible = true;
+          this.activeOrderInfo = res.rows[0];
         })
         .finally(() => {
           this.loading = false;
         });
     },
-    // 切换已付待付
-    backStatus(scope) {
-      console.log(scope, 789);
-    },
     async search(v) {
       this.loading = true;
       if (v === 2) {
@@ -340,7 +329,7 @@ export default {
         this.formData = {
           pageSize: 10,
           pageNum: 1,
-          mouth: [], // 搜送的月份
+          monthTime: [], // 搜送的月份
           months: [], // 选择的月份
           years: [],
           roleIds: this.rolesId,
@@ -375,7 +364,7 @@ export default {
           mouth.push(timestamp);
         }
       }
-      this.formData.mouth = mouth;
+      this.formData.monthTime = mouth;
     },
     getCountOrderNum() {
       var data = JSON.parse(JSON.stringify(this.formData));

+ 1 - 0
src/views/financed/accountsPayable/supplierSettlement/index.vue

@@ -341,6 +341,7 @@ export default {
           this.tableData = res.rows;
           this.total = res.total;
           this.navText.index = res.total;
+          
         })
         .finally(() => {
           this.loading = false;

+ 16 - 7
src/views/financed/components/dislogOrderDetails.vue

@@ -5,6 +5,7 @@
       :isShow.sync="isShow"
       title="订单详情"
       @close="close"
+      :appendToBody="appendToBody"
       :isShowFooter="false"
     >
       <div class="head">
@@ -51,13 +52,17 @@
               >
               <div v-if="desc.type === 'image'">
                 <el-image
-                v-if="detailInfo[desc.key] && detailInfo[desc.key].length > 0"
-                style="width: 40px; height: 20px;margin-right:10px;"
-                :src="detailInfo[desc.key][0]"
-                :preview-src-list="detailInfo[desc.key]"
-              >
-              </el-image>
-              <span>{{ detailInfo[desc.key] && detailInfo[desc.key].length > 0 ? '共'+detailInfo[desc.key].length+'张':'暂无转账凭证' }}</span>
+                  v-if="detailInfo[desc.key] && detailInfo[desc.key].length > 0"
+                  style="width: 40px; height: 20px; margin-right: 10px"
+                  :src="detailInfo[desc.key][0]"
+                  :preview-src-list="detailInfo[desc.key]"
+                >
+                </el-image>
+                <span>{{
+                  detailInfo[desc.key] && detailInfo[desc.key].length > 0
+                    ? "共" + detailInfo[desc.key].length + "张"
+                    : "暂无转账凭证"
+                }}</span>
               </div>
               <div v-if="desc.type === 'pretax'">
                 <span style="margin-right: 20px"
@@ -140,6 +145,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    appendToBody: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {