QuKatie 3 lat temu
rodzic
commit
5842fd72fe

+ 55 - 26
src/components/price-Library/main.vue

@@ -12,32 +12,45 @@
       v-dialog-drag
     >
       <span>
-        <avue-crud
-          ref="crud"
-          :data="data"
-          :option="tableOption"
-          :page.sync="page"
-          :search.sync="search"
-          @search-change="searchChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @refresh-change="refreshChange"
-          @on-load="getList"
-          @saveColumn="saveColumn"
-          @selection-change="selectionChange"
-          :cell-style="cellStyle"
-          :table-loading="loading"
-        >
-          <template slot="cnameSearch">
-            <goods-select
-              v-model="search.cname"
-              :configuration="goodsConfiguration"
+        <el-row>
+          <el-col :span="4" >
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+              :style="treeStyle"
+              style="height:74vh"
             />
-          </template>
-          <template slot="corpId" slot-scope="{ row }">
-            <span>{{ row.corpName }}</span>
-          </template>
-        </avue-crud>
+          </el-col>
+          <el-col :span="20">
+            <avue-crud
+              ref="crud"
+              :data="data"
+              :option="tableOption"
+              :page.sync="page"
+              :search.sync="search"
+              @search-change="searchChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="getList"
+              @saveColumn="saveColumn"
+              @selection-change="selectionChange"
+              :cell-style="cellStyle"
+              :table-loading="loading"
+            >
+              <template slot="cnameSearch">
+                <goods-select
+                  v-model="search.cname"
+                  :configuration="goodsConfiguration"
+                />
+              </template>
+              <template slot="corpId" slot-scope="{ row }">
+                <span>{{ row.corpName }}</span>
+              </template>
+            </avue-crud>
+          </el-col>
+        </el-row>
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="visible = false">取 消</el-button>
@@ -60,6 +73,16 @@ import _ from "lodash";
 export default {
   data() {
     return {
+      treeOption: {
+        addBtn: false,
+        menu: false,
+        filter: false,
+        size: "small",
+        props: {
+          label: "cname",
+          value: "cname"
+        }
+      },
       visible: false,
       loading: true,
       data: [],
@@ -81,7 +104,8 @@ export default {
         clearable: true
       },
       partType: false,
-      partreData: false
+      partreData: false,
+      treeData: []
     };
   },
   props: {},
@@ -90,6 +114,7 @@ export default {
     getGoodstype(1, 500).then(res => {
       this.findObject(this.tableOption.column, "goodsTypeName").dicData =
         res.data.data.records;
+      this.treeData = res.data.data.records;
     });
   },
   methods: {
@@ -102,6 +127,10 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
+    nodeClick(data) {
+      this.search.goodsTypeName=data.cname
+      this.getList(this.page,this.search);
+    },
     importData() {
       if (this.partreData) {
         if (this.selectionList.length != 1) {

+ 4 - 4
src/views/basicData/customerInformation/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 1 - 13
src/views/basicData/customerInformation/configuration/customerContact.json

@@ -54,19 +54,7 @@
       "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入手机号",
-          "trigger": "blur"
-        },
-        {
-          "pattern": "",
-          "message": "手机号格式错误",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },{
       "label": "邮箱",
       "prop": "email",

+ 0 - 5
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -675,11 +675,6 @@ export default {
         }
       }
     }
-    this.customerContact.column.map(item => {
-      if (item.prop == "tel") {
-        item.rules[1].pattern = /^1[3-9]\d{9}$/;
-      }
-    });
     corpstypeTree({ corpType: customerParameter.code }).then(res => {
       this.dic = res.data.data;
     });

+ 4 - 4
src/views/basicData/customerManagement/companyMaterial/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 2 - 9
src/views/basicData/customerManagement/companyMaterial/configuration/customerContact.json

@@ -51,17 +51,10 @@
       ]
     },
     {
-      "label": "电话",
+      "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入电话",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },
     {
       "label": "性别",

+ 4 - 4
src/views/basicData/customerManagement/supplierMaterial/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 2 - 9
src/views/basicData/customerManagement/supplierMaterial/configuration/customerContact.json

@@ -51,17 +51,10 @@
       ]
     },
     {
-      "label": "电话",
+      "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入电话",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },
     {
       "label": "性别",

+ 448 - 0
src/views/statisticAnalysis/payment/index.vue

@@ -0,0 +1,448 @@
+<template>
+  <div>
+    <basic-container class="page-crad">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        :before-open="beforeOpen"
+        :page.sync="page"
+        :search.sync="search"
+        :cell-style="cellStyle"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+        :summary-method="summaryMethod"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+        @expand-change="expandChange"
+        @search-criteria-switch="searchCriteriaSwitch"
+      >
+        <template slot="menuLeft">
+          <el-button type="info" size="small" @click="outExport"
+            >导出</el-button
+          >
+        </template>
+        <template slot-scope="{ row }" slot="expand">
+          <avue-crud
+            :data="row.itemData"
+            :option="itemOption"
+            :table-loading="row.itemLoading"
+            :cell-style="cellStyle"
+            class="itemTable"
+          >
+            <template slot-scope="{ row }" slot="amount">
+              <span>{{ row.amount | decimalFormat }}</span>
+            </template>
+          </avue-crud>
+        </template>
+        <template slot="corpIdSearch">
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
+        </template>
+        <template slot="businesDateSearch">
+          <el-date-picker
+            v-model="search.businesDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </template>
+        <template slot-scope="{ row }" slot="purchasePrice">
+          <span>{{ row.purchasePrice | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="amount">
+          <span>{{ row.amount | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="procurementCost">
+          <span>{{ row.procurementCost | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="partsCost">
+          <span>{{ row.partsCost | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="grossProfit">
+          <span>{{ row.grossProfit | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="fd">
+          <span>{{ row.fd | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="fc">
+          <span>{{ row.fc | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="singleTicketMargin">
+          <span>{{ row.singleTicketMargin | decimalFormat }}</span>
+        </template>
+        <template slot-scope="scope" slot="orderNo">
+          <span
+            style="color: #409EFF;cursor: pointer"
+            @click.stop="editOpen(scope.row)"
+            >{{ scope.row.orderNo }}
+          </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList, getProfitItem } from "@/api/statisticAnalysis/salesProfit";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+export default {
+  name: "index",
+  data() {
+    return {
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {
+        searchShow: true,
+        searchMenuSpan: 16,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        searchIcon: true,
+        searchIndex: 2,
+        expand: true,
+        expandWidth: 55,
+        menu: false,
+        column: [
+          {
+            label: "订单号",
+            prop: "billType",
+            type: "select",
+            search: true
+          },
+          {
+            label: "订单日期",
+            prop: "businesDate",
+            overHidden: true,
+            width: 100,
+            search: true
+          },
+          {
+            label: "客户名称",
+            prop: "corpId",
+            overHidden: true,
+            width: 100,
+            search: true,
+            formatter: row => {
+              return row.corpsName;
+            }
+          },
+          {
+            label: "收费类别",
+            prop: "orderNo",
+            overHidden: true,
+            search: true,
+            width: 100
+          },
+          {
+            label: "商品名称",
+            prop: "portOfLoad",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "型号",
+            prop: "portOfDestination",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "数量",
+            prop: "transport",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "销售单价",
+            prop: "procurementCost",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "金额",
+            prop: "partsCost",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "币别",
+            prop: "purchasePrice",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "汇率",
+            prop: "amount",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "结算金额",
+            prop: "grossProfit",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "发票号",
+            prop: "grossProfitRate",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "备注",
+            prop: "fd",
+            overHidden: true,
+            width: 100
+          }
+        ]
+      },
+      itemOption: {
+        align: "center",
+        header: false,
+        menu: false,
+        column: [
+          {
+            label: "产品类别",
+            prop: "priceCategory",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品名称",
+            prop: "cname",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品成本",
+            prop: "purchaseAmount",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "原始成本",
+            prop: "purchaseCost",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "配件成本",
+            prop: "partsPrice",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "原始成本",
+            prop: "partsCost",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "销售价",
+            prop: "price",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exchangeRate",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "销售金额",
+            prop: "amount",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品毛利",
+            prop: "productGrossMargin",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品毛利率 ",
+            prop: "itemMargin",
+            width: 100,
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    // expandChange(row) {
+    //   if (!row.itemData) {
+    //     getProfitItem({ id: row.id })
+    //       .then(res => {
+    //         this.dataList[row.$index].itemData = res.data.data;
+    //       })
+    //       .finally(() => {
+    //         this.dataList[row.$index].itemLoading = false;
+    //       });
+    //   }
+    // },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      if (!params.billType) {
+        done();
+        return this.$message.error("请选择类别");
+      }
+      if (params.businesDate) {
+        params.contractStartDate = params.businesDate[0];
+        params.contractEndDate = params.businesDate[1];
+      }
+      delete params.businesDate;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params = {}) {
+      // this.loading = true;
+      // if (!this.search.billType) {
+      //   this.search.billType = "XS";
+      // }
+      // this.dataList.forEach(item => {
+      //   this.$refs.crud.toggleRowExpansion(item, false);
+      // });
+      // getList(
+      //   page.currentPage,
+      //   page.pageSize,
+      //   Object.assign(params, this.search)
+      // )
+      //   .then(res => {
+      //     if (res.data.data.records) {
+      //       res.data.data.records.forEach(e => {
+      //         e.itemLoading = true;
+      //       });
+      //     }
+      //     this.dataList = res.data.data.records ? res.data.data.records : [];
+      //     this.page.total = res.data.data.total;
+      //     if (this.page.total) {
+      //       this.option.height = window.innerHeight - 210;
+      //     }
+      //   })
+      //   .finally(() => {
+      //     this.loading = false;
+      //   });
+    },
+    editOpen(row) {
+      if (row.billType == "BJ") {
+        this.$router.push({
+          path: "/exportTrade/customerInquiry/index",
+          query: {
+            id: row.id
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/exportTrade/salesContract/index",
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    outExport() {
+      if (!this.search.billType) {
+        return this.$message.error("请选择类别");
+      }
+      window.open(
+        `/api/blade-purchase-sales/exportOrder/exportProfit?${
+          this.website.tokenHeader
+        }=${getToken()}&billType=${this.search.billType}`
+      );
+    },
+    summaryMethod({ columns, data }) {
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((item, index) => {
+          sums[0] = "合计";
+          if (item.property == "purchasePrice" || item.property == "amount") {
+            let amountSum = 0;
+            let purchaseAmountSum = 0;
+            data.forEach(e => {
+              amountSum = _.add(amountSum, Number(e.amount));
+              purchaseAmountSum = _.add(
+                purchaseAmountSum,
+                Number(e.purchasePrice)
+              );
+            });
+            //入库金额总计
+            if (item.property == "purchasePrice") {
+              sums[index] = micrometerFormat(purchaseAmountSum);
+            }
+            if (item.property == "amount") {
+              sums[index] = micrometerFormat(amountSum);
+            }
+          }
+        });
+      }
+      return sums;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0px;
+}
+.itemTable ::v-deep .el-table {
+  width: 100%;
+}
+</style>