Procházet zdrojové kódy

批量打印完成

谢杰标 před 2 roky
rodič
revize
013a83283a

+ 18 - 3
src/api/financed/index.js

@@ -116,11 +116,11 @@ export function orderNoteEdit(data) {
 }
 
 // 业务员提成列表
-export function sellerPercentageList(query) {
+export function sellerPercentageList(data) {
   return request({
     url: "/divide/log/sellerList",
-    method: "get",
-    params: query,
+    method: "post",
+    data,
     isProce: true,
   });
 }
@@ -295,3 +295,18 @@ export function monthOrderCount(query) {
     params: query,
   });
 }
+// 单据打印详情
+export function withPrint(id) {
+  return request({
+    url: "/divide/log/withPrint/" + id,
+    method: "get",
+  });
+}
+// 查询打印月份订单列表
+export function monthOrderListWithPrint(query) {
+  return request({
+    url: "/divide/log/monthOrderListWithPrint",
+    method: "get",
+    params: query,
+  });
+}

+ 2 - 2
src/utils/request.js

@@ -7,9 +7,9 @@ import { paramMate } from "@/utils/common";
 
 axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
 // 创建axios实例
-export const baseURL = process.env.VUE_APP_BASE_API
+// export const baseURL = process.env.VUE_APP_BASE_API
 // export const baseURL = 'https://ptapi.gdzzkj.net/'
-// export const baseURL = "http://192.168.1.7:7077/";
+export const baseURL = "http://192.168.1.24:7077/";
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API;
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 39 - 14
src/views/financed/accountsPayable/businessCommission/index.vue

@@ -74,12 +74,29 @@
             props.scope.row.checkStatus !== 0 ||
             getRoles(props.scope.row.roleId)
           "
-          @click="openDialog(props.scope.row, 0, 1)"
+          @click="openDialog(props.scope.row, 0)"
         >
           审核
         </el-button>
-        <el-button type="text"> 单据打印 </el-button>
-        <el-button type="text"> 明细打印 </el-button>
+        <el-button
+          type="text"
+          style="color: rgb(230, 162, 60)"
+          :style="{
+            color:
+              props.scope.row.payStatus !== 1 ? '#ccc' : 'rgb(230, 162, 60)',
+          }"
+          :disabled="props.scope.row.payStatus !== 1"
+          @click="openDialog({ ...props.scope.row, type: 2, printType: 1 }, 2)"
+        >
+          单据打印
+        </el-button>
+        <el-button
+          type="text"
+          style="color: rgb(230, 162, 60)"
+          @click="openDialog({ ...props.scope.row, type: 2, printType: 2 }, 2)"
+        >
+          明细打印
+        </el-button>
       </template>
     </table-list>
     <pagination
@@ -88,17 +105,21 @@
       :currentPage.sync="formData.pageNum"
       @search="search(3)"
     />
-    <!-- 订单详情 -->
-    <dislog-order-details
-      :orderSn="activeOrderInfo.orderSn"
-      :orderFrom="activeOrderInfo.orderFrom"
+    <!-- 订单列表 -->
+    <dislogOrderList
+      :info="activeOrderInfo"
       :dialogVisible.sync="orderDialogVisible"
     />
     <dislog-set
       :dialogVisible.sync="examineDialogVisible"
       @search="search"
       :info="activeOrderInfoArray"
-    ></dislog-set>
+    />
+    <!-- 打印 -->
+    <dislog-print
+      :activeData="activeOrderInfo"
+      :dialogVisible.sync="printDialogVisible"
+    />
   </div>
 </template>
 
@@ -107,8 +128,9 @@ import dislogSet from "../../components/audit/dislogSet.vue";
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
-import dislogOrderDetails from "../../components/dislogOrderDetails.vue";
+import dislogOrderList from "../components/dislogOrderList";
 import pictureList from "@/components/Comon/pictureList.vue";
+import dislogPrint from "../components/dislogPrint.vue";
 import { exportFn } from "@/utils/index.js";
 import {
   sellerExport,
@@ -122,9 +144,10 @@ export default {
     searchBoxNew,
     tableList,
     pagination,
-    dislogOrderDetails,
+    dislogOrderList,
     dislogSet,
     pictureList,
+    dislogPrint,
   },
   data() {
     return {
@@ -274,6 +297,7 @@ export default {
       total: 0, //一共多少条
       orderDialogVisible: false,
       examineDialogVisible: false,
+      printDialogVisible: false,
       activeOrderInfo: {},
       activeOrderInfoArray: [],
       activeList: [],
@@ -338,14 +362,13 @@ export default {
       }
       return a;
     },
-    openDialog(data, type = 0, isEdit) {
+    openDialog(data, type = 0) {
       if (type === 1) {
         this.activeOrderInfoArray = data;
       } else {
-        data.isEdit = isEdit;
         this.activeOrderInfo = data;
       }
-      this[["order", "examine"][type] + "DialogVisible"] = true;
+      this[["order", "examine", "print"][type] + "DialogVisible"] = true;
     },
     batchExport() {
       sellerExport(this.formData).then((res) => {
@@ -356,6 +379,7 @@ export default {
         }
       });
     },
+    batchAudit() {},
     getDataList() {
       sellerPercentageList(this.formData)
         .then((res) => {
@@ -404,7 +428,8 @@ export default {
           payMoneyTotal,
         } = res.data;
         this.showTabList[0].value = payMoneyTotal + unPayMoneyTotal;
-        this.showTabList[1].value = payMoneyTotal + unDeductMoneyTotal;
+        this.showTabList[1].value =
+          payMoneyTotal + unPayMoneyTotal + unDeductMoneyTotal;
         this.showTabList[2].value = deductMoneyTotal + unDeductMoneyTotal;
       });
     },

+ 9 - 8
src/views/financed/accountsPayable/components/dislogOrderList.vue

@@ -83,7 +83,7 @@
     <!-- 订单详情 -->
     <dislog-order-details
       :appendToBody="true"
-      :ShowStatus="ShowStatus"
+      :ShowStatus="3"
       :orderSn="activeOrderInfo.orderSn"
       :orderFrom="activeOrderInfo.orderFrom"
       :dialogVisible.sync="orderDialogVisible"
@@ -151,7 +151,7 @@ export default {
         addHide: true,
         dontNum: true,
         openCheckMore: false,
-        changeWidth: "220px",
+        // changeWidth: "220px",
         custom: false,
         tableColor: true,
       },
@@ -185,7 +185,7 @@ export default {
           prop: "orderType",
           scope: "type",
           hidden: true,
-          width: 100,
+          // width: 100,
           values: {
             1: "完单分成",
             2: "退款扣除",
@@ -195,28 +195,28 @@ export default {
           label: "订单金额",
           prop: "orderPrice",
           hidden: true,
-          width: 100,
+          // width: 100,
           scope: "formatPrice",
         },
         {
           label: "税前佣金",
           prop: "pretaxBrokerage",
           hidden: true,
-          width: 100,
+          // width: 100,
           scope: "formatPrice",
         },
         {
           label: "应付分成",
           prop: "payMoney",
           hidden: true,
-          width: 100,
+          // width: 100,
           scope: "formatPrice",
         },
         {
           label: "审核状态",
           prop: "divideCheckStatus",
           hidden: true,
-          width: 100,
+          // width: 100,
           scope: "solt",
           soltName: "divideCheckStatus",
         },
@@ -239,6 +239,7 @@ export default {
       return days;
     },
     init() {
+      console.log(this.info);
       this.navText.choice = !!this.isEdit;
       this.search(2);
     },
@@ -331,7 +332,7 @@ export default {
       },
     },
     isEdit() {
-      return true;
+      return false;
       return this.info.isEdit;
     },
     title() {

+ 55 - 76
src/views/financed/accountsPayable/components/dislogPrint.vue

@@ -1,19 +1,19 @@
 <template>
   <div>
     <BaseDialog
-      :width="activeData.type == 1 || type == 1 ? '1100px' : '1300px'"
+      :width="printType == 1 || type == 1 ? '1100px' : '1300px'"
       :isShow.sync="isShow"
-      :title="activeData.type == 1 ? '单据打印' : '明细打印'"
+      :title="printType == 1 ? '单据打印' : '明细打印'"
       @submit="submitForm"
       @close="close"
       @open="init"
       :confirmStatus="false"
     >
-      <div id="print">
+      <div id="print" v-loading="loading">
         <h3 style="text-align: center">
-          {{ activeData.type == 1 ? "费用支出单据" : "费用支出明细" }}
+          {{ printType == 1 ? "费用支出单据" : "费用支出明细" }}
         </h3>
-        <template v-if="activeData.type == 1">
+        <template v-if="printType == 1">
           <table
             class="table1"
             border
@@ -27,8 +27,8 @@
                   ["", "机构分成", "业务提成", "佣金结算", "供应商结算"][type]
                 }}
               </td>
-              <td>付款日期:2022-12-12 12:12:12</td>
-              <td>付款金额:¥8000.00</td>
+              <td>付款日期:{{ $methodsTools.onlyForma(formData.payTime) }}</td>
+              <td>付款金额:{{ formData.payMoney | formatPrice }}</td>
             </tr>
             <tr>
               <td>
@@ -44,7 +44,7 @@
                       ["", "月份", "季度", "半年", "年度"][formData.billType]
                     }}
                   </p>
-                  <p>账款时间:{{ formData.remark }}</p>
+                  <p>账款时间:{{ activeData.monthTime }}</p>
                 </template>
                 <template v-if="type == 3">
                   <p>订单单号:{{ formData.orderSn }}</p>
@@ -57,9 +57,9 @@
                   收款方式:{{ ["", "账号支付", "扫码支付", "现金支付"][1] }}
                 </p>
                 <template v-if="true">
-                  <p>收款账户:{{ formData.bankName }}</p>
-                  <p>收款银行:{{ formData.bank }}</p>
-                  <p>收款账号:{{ formData.bankAccount }}</p>
+                  <p>收款账户:{{ formData.toBankName }}</p>
+                  <p>收款银行:{{ formData.toBankTypeName }}</p>
+                  <p>收款账号:{{ formData.toBankAcount }}</p>
                 </template>
               </td>
               <td>
@@ -84,13 +84,14 @@
               <td colspan="3">
                 <p>审核进度:</p>
                 <el-steps
+                  style="padding-left: 30px"
                   :space="200"
-                  :active="formData.checkRoles.length"
+                  :active="checkRoles.length"
                   finish-status="success"
                   align-center
                 >
                   <el-step
-                    v-for="(item, index) in formData.checkRoles"
+                    v-for="(item, index) in checkRoles"
                     :title="item"
                     :key="index"
                   ></el-step>
@@ -99,7 +100,7 @@
             </tr>
           </table>
         </template>
-        <template v-if="activeData.type == 2">
+        <template v-if="printType == 2">
           <table
             border
             width="100%"
@@ -132,13 +133,13 @@
                   <span v-else-if="items.scope === 'type'">
                     {{ items.values[item[items.prop]] }}
                   </span>
-                  <div v-else-if="items.scope === 'businessNames'">
+                  <div v-else-if="items.scope === 'businessList'">
                     <div v-for="(bus, i) in item[items.prop]" :key="i">
                       {{ bus }}
                     </div>
                   </div>
                   <span v-else>
-                    {{ item[items.prop] }}
+                    {{ item[items.prop] || "-" }}
                   </span>
                 </td>
               </tr>
@@ -168,6 +169,7 @@
 </template>
 
 <script>
+import { withPrint, monthOrderListWithPrint } from "@/api/financed/index";
 export default {
   name: "",
   props: {
@@ -184,65 +186,39 @@ export default {
   },
   data() {
     return {
-      formData: {
-        checkRoles: [],
-      },
-      tableData: [
-        {
-          createUsername: "张三",
-          createNo: "6280305",
-          brokerage: 97,
-          businessList: null,
-          checkStatus: 2,
-          createSysUserId: null,
-          deductMoney: null,
-          divideCompanyMoney: 1065.6,
-          divideLogId: 1701,
-          divideMoney: null,
-          divideSellerMoney: 0,
-          divideType: 1,
-          id: 218,
-          orderCreateTime: 1685672071,
-          orderFrom: 3,
-          orderPrice: 1580,
-          orderSn: "10002306021014201758856",
-          orderTime: 1682905393,
-          orderType: 1,
-          payMoney: null,
-          payStatus: 0,
-          pretaxBrokerage: 100,
-          refundSn: null,
-          refundTime: null,
-          remark: null,
-          roleId: 16,
-          roleName: "出纳",
-          status: 1,
-          tenantId: null,
-          tenantName: "祥粤云学堂(旧系统)",
-          businessNames: [
-            "继续教育 / 施工现场专业人员(七大员)",
-            "考前培训 / 一级建造师",
-          ],
-          purchaseOrg: "广东南粤有限公司",
-          payType: 1,
-        },
-      ],
+      formData: {},
+      checkRoles: ["统计", "会计/财务", "总经理", "出纳"],
+      tableData: [],
+      loading: false,
     };
   },
   methods: {
     init() {
-      this.$api[
-        this.activeData.type == 1
-          ? "settlereceiptsdata"
-          : "settlereceiptsdetaildata"
-      ](this.activeData.settleId).then((res) => {
-        if (this.activeData.type == 1) {
-          this.formData = res.data;
-        }
-        if (this.activeData.type == 2) {
-          this.tableData = res.data;
-        }
-      });
+      this.loading = true;
+      let { id } = this.activeData;
+      if (this.printType == 2) {
+        id = {
+          divideLogId: id,
+        };
+      }
+      const fn = [withPrint, monthOrderListWithPrint][this.printType - 1];
+      fn(id)
+        .then((res) => {
+          console.log(
+            "🚀 ~ file: dislogPrint.vue:207 ~ .then ~ res:",
+            res.data,
+            this.activeData
+          );
+          if (this.printType == 1) {
+            this.formData = res.data;
+          }
+          if (this.printType == 2) {
+            this.tableData = res.data;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     close() {},
     submitForm() {},
@@ -262,8 +238,11 @@ export default {
         this.$emit("update:dialogVisible", false);
       },
     },
+    printType() {
+      return this.activeData.printType;
+    },
     type() {
-      return 3;
+      return this.printType;
     },
     tableSet() {
       if (this.type != 3) {
@@ -280,8 +259,8 @@ export default {
           { label: "业务号", prop: "createNo", width: "80" },
           {
             label: "业务类型",
-            prop: "businessNames",
-            scope: "businessNames",
+            prop: "businessList",
+            scope: "businessList",
             width: "160",
           },
           {
@@ -315,8 +294,8 @@ export default {
           { label: "下单企业", prop: "purchaseOrg", width: "130" },
           {
             label: "业务类型",
-            prop: "businessNames",
-            scope: "businessNames",
+            prop: "businessList",
+            scope: "businessList",
             width: "160",
           },
           {

+ 24 - 23
src/views/financed/accountsPayable/institutionDivide/index.vue

@@ -57,14 +57,10 @@
         </el-button>
         <el-button
           type="text"
-          v-if="!props.scope.row.orderSn"
-          :disabled="
-            !(
-              props.scope.row.payStatus === 0 ||
-              props.scope.row.payStatus === 4 ||
-              getRoles(props.scope.row.roleId)
-            )
+          v-if="
+            props.scope.row.payStatus === 0 || props.scope.row.payStatus === 4
           "
+          :disabled="getRoles(props.scope.row.roleId)"
           @click="openDialog([props.scope.row], 1)"
         >
           支付
@@ -73,24 +69,27 @@
           v-else
           type="text"
           :disabled="
-            props.scope.row.checkStatus !== 0 ||
-            getRoles(props.scope.row.roleId)
+            props.scope.row.payStatus !== 2 || getRoles(props.scope.row.roleId)
           "
-          @click="openDialog(props.scope.row, 0, 1)"
+          @click="batchAudit(props.scope.row)"
         >
           审核
         </el-button>
         <el-button
           type="text"
-          style="color: rgb(230, 162, 60)"
-          @click="openDialog({ ...props.scope.row, type: 1 }, 2)"
+          :style="{
+            color:
+              props.scope.row.payStatus !== 1 ? '#ccc' : 'rgb(230, 162, 60)',
+          }"
+          :disabled="props.scope.row.payStatus !== 1"
+          @click="openDialog({ ...props.scope.row, type: 1, printType: 1 }, 2)"
         >
           单据打印
         </el-button>
         <el-button
           type="text"
           style="color: rgb(230, 162, 60)"
-          @click="openDialog({ ...props.scope.row, type: 2 }, 2)"
+          @click="openDialog({ ...props.scope.row, type: 1, printType: 2 }, 2)"
         >
           明细打印
         </el-button>
@@ -169,6 +168,10 @@ export default {
         changeWidth: "280px",
         custom: false,
         tableColor: true,
+        selectableStatus: true,
+        selectableFunc: (row, rowIndex) => {
+          return row.payStatus == 2 && !this.getRoles(row.roleId);
+        },
       },
       formData: {
         pageSize: 10,
@@ -241,7 +244,7 @@ export default {
       tableData: [],
       total: 0,
       orderDialogVisible: false,
-      printDialogVisible: true,
+      printDialogVisible: false,
       examineDialogVisible: false,
       activeOrderInfo: { type: 1 },
       activeOrderInfoArray: [],
@@ -307,13 +310,11 @@ export default {
       }
       return a;
     },
-    openDialog(data, type = 0, isEdit) {
-      console.log("🚀 ~ file: index.vue:291 ~ openDialog ~ data:", data);
+    openDialog(data, type = 0) {
       if (type === 1) {
         data.forEach((e) => (e.checkFrom = 2));
         this.activeOrderInfoArray = data;
       } else {
-        data.isEdit = isEdit;
         this.activeOrderInfo = data;
       }
       this[["order", "examine", "print"][type] + "DialogVisible"] = true;
@@ -404,16 +405,16 @@ export default {
         this.statisticsList[2].value = deductMoneyTotal + unDeductMoneyTotal;
       });
     },
-    batchAudit() {
-      let selectList = this.$refs.tableList.allCheckData.filter(
-        (e) => e.checkStatus === 0 && !this.getRoles(e.roleId)
-      );
-      if (selectList.length === 0) {
+    batchAudit(e) {
+      let ids = e.id
+        ? [e.id]
+        : this.$refs.tableList.allCheckData.map((e) => e.id);
+      if (ids.length === 0) {
         this.$message.error("请先勾选待审核数据");
         return;
       }
       this.$confirm("审核通过不可撤销,确定审核通过吗?", "提示", {
-        confirmButtonText: "确定",
+        confirmButtonText: "确定通过",
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {

+ 21 - 7
src/views/financed/components/studentDetails.vue

@@ -9,13 +9,13 @@
           @search="search"
           @init="search('init')"
           ><template slot="customize">
-            <el-button
+            <!-- <el-button
               v-if="ShowStatus === 3"
               type="success"
               size="small"
               @click="orderCheck(1, '')"
               >批量审核</el-button
-            >
+            > -->
             <span style="color: rgb(110, 101, 198); margin-left: 14px"
               >共:{{
                 tableData1.length > 0 ? tableData1[0].userCount : 0
@@ -333,17 +333,31 @@ export default {
     computedTableSet: function () {
       return function (array, num) {
         if (num === 3) {
-          var ary = [
+          let data = [
+            {
+              label: "实际单价",
+              prop: "tt",
+              hidden: true,
+            },
+            {
+              label: "分成类型",
+              prop: "tt",
+              hidden: true,
+            },
             {
-              label: "随意",
+              label: "分成计算",
+              prop: "tt",
+              hidden: true,
+            },
+            {
+              label: "分成金额",
               prop: "tt",
               hidden: true,
             },
           ];
-          return [...array, ...ary];
-        } else {
-          return array;
+          array.splice(array.length - 1, 1, ...data);
         }
+        return array;
       };
     },
   },