瀏覽代碼

胎动商城增加会员卡和积分

caojunjie 2 年之前
父節點
當前提交
3c4527ba6f

+ 43 - 0
src/api/financialManagement/financialManagement.js

@@ -40,3 +40,46 @@ export const editFinance = (params) => {
     data:params
   })
 }
+
+// 充值明细列表接口
+export const corpscechargerecordList = (params) => {
+  return request({
+    url: '/api/blade-client/corpscechargerecord/list',
+    method: 'get',
+    params: params
+  })
+}
+// 充值明细详情
+export const corpscechargerecordDetail = (id) => {
+  return request({
+    url: '/api/blade-client/corpscechargerecord/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+// 充值明细保存
+export const corpscechargerecordSubmit = (params) => {
+  return request({
+    url: '/api/blade-client/corpscechargerecord/submit',
+    method: 'post',
+    data:params
+  })
+}
+// 充值明细删除
+export const corpscechargerecordRemove = (data) => {
+  return request({
+    url: '/api/blade-client/corpscechargerecord/remove',
+    method: 'post',
+    params:data
+  })
+}
+// 充值明细提交
+export const corpscechargerecordSynchronous = (params) => {
+  return request({
+    url: '/api/blade-client/corpscechargerecord/synchronous',
+    method: 'post',
+    data:params
+  })
+}

+ 13 - 0
src/views/basicData/basicStorageDesc/configuration/mainList.json

@@ -139,6 +139,19 @@
       }]
     },
     {
+      "label": "部门",
+      "prop": "deptId",
+      "width": 150,
+      "filterable": true,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dept/lazy-list?parentId=0",
+      "props": {
+        "label": "deptName",
+        "value": "id"
+      },
+      "disabled": true
+    },
+    {
       "label": "备注",
       "prop": "remarks",
       "index": 8,

+ 5 - 0
src/views/basicData/basicStorageDesc/index.vue

@@ -97,6 +97,11 @@ export default {
     };
   },
   created() {
+      // 判断是否是admin 权限
+      let arr = localStorage.getItem('roleName').split(',')
+      if (arr.indexOf('admin') != -1) {
+          this.findObject(this.option.column, "deptId").disabled = false
+      }
     // customerList({parentId:0}).then(res => {
     //   console.log(res.data.data.records)
     //   this.dataList = res.data.data.records

+ 13 - 1
src/views/basicData/basicStorageType/configuration/mainList.json

@@ -120,6 +120,18 @@
       ]
     },
     {
+      "label": "部门",
+      "prop": "deptId",
+      "width": 150,
+      "filterable": true,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dept/lazy-list?parentId=0",
+      "props": {
+        "label": "deptName",
+        "value": "id"
+      }
+    },
+    {
       "label": "排序",
       "prop": "sort",
       "type": "number",
@@ -152,7 +164,7 @@
       "label": "备注",
       "prop": "remarks",
       "index": 8,
-      "width": 100,
+      "span": 24,
       "overHidden": true,
       "rules": [{
         "required": false,

+ 100 - 1
src/views/client/detailsInfo.vue

@@ -156,6 +156,30 @@
                         <el-col :span="4">送货地址</el-col>
                         <el-col :span="18">{{ item.detailedAddress }}</el-col>
                     </el-row>
+                    <el-row class="client_info">
+                        <el-col :span="4">积分余额</el-col>
+                        <el-col :span="4">{{ form.pointsBalance | nameFileter }}</el-col>
+                        <el-col :span="4">会员卡余额</el-col>
+                        <el-col :span="4">{{ form.balanceAmounts | nameFileter }}</el-col>
+                    </el-row>
+
+                </el-tab-pane>
+                <el-tab-pane label="充值明细" name="czmx">
+                    <avue-crud :option="czoption"
+                               :data="dataList"
+                               ref="crud"
+                               v-model="czform"
+                               :page.sync="czmxpage"
+                               :search.sync="czmxsearch"
+                               :table-loading="czmxloading"
+                               @search-change="czmxsearchChange"
+                               @size-change="czmxsizeChange"
+                               @refresh-change="czmxrefreshChange"
+                               @saveColumn="czmxsaveColumn"
+                               @resetColumn="czmxresetColumn"
+                               @on-load="czmxonLoad"
+                               @search-criteria-switch="searchCriteriaSwitch">
+                    </avue-crud>
                 </el-tab-pane>
             </el-tabs>
         </basic-container>
@@ -163,10 +187,12 @@
 </template>
 
 <script>
-import { optionList, sellOption, capitalOption } from "./js/optionList";
+import { optionList, sellOption, capitalOption, czoption } from "./js/optionList";
 import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
 import { getDetails, getSellList } from "@/api/basicData/client";
 import { validatenull } from "@/util/validate";
+import {corpscechargerecordList} from "@/api/financialManagement/financialManagement";
+
 export default {
     name: "index",
     data() {
@@ -195,6 +221,22 @@ export default {
             activeName: "first",
             search: {},
             search2: {},
+            // 充值明细的配置
+            czoption:czoption,
+            // 充值明细转圈加载动画
+            czmxloading:false,
+            // 表单搜索的变量对象
+            czmxsearch:{},
+            // 充值明细双向绑定的值
+            czform:{},
+            // 充值明细的数据
+            dataList:[],
+            // 页码
+            czmxpage: {
+                pageSize: 10,
+                pagerCount: 5,
+                total: 0,
+            },
             sellOption: {},
             capitalOption: {},
             sellList: [],
@@ -301,6 +343,63 @@ export default {
       this.getAllWorkDicts()
     },
     methods: {
+        // 充值明细点击刷新
+        czmxrefreshChange(params) {
+            this.czmxonLoad(this.czmxpage,params)
+        },
+        // 充值明细点击每页多少条
+        czmxsizeChange() {
+            console.log('点击每页多少条')
+        },
+        // 充值明细点击搜索按钮触发
+        czmxsearchChange(params, done) {
+            this.czmxpage.currentPage = 1;
+            this.czmxonLoad(this.czmxpage, params);
+            done()
+        },
+        // 充值明细的数据请求
+        czmxonLoad(page, params){
+            corpscechargerecordList({
+                currentPage:page.currentPage,
+                pageSize:page.pageSize,
+                corpId:this.detailData.id,
+                ...params
+            }).then(res =>{
+                console.log(res,367)
+                this.dataList = res.data.data.records
+                this.czmxpage.total = res.data.data.total
+                if (this.czmxpage.total) {
+                    this.czoption.height = window.innerHeight - 240;
+                }
+            }).finally(()=>{
+                this.czloading = false
+            })
+        },
+        // 充值明细列保存触发
+        async czmxsaveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(64),
+                this.option
+            );
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        // 充值明细重置列
+        async czmxresetColumn() {
+            const inSave = await this.delColumnData(
+                this.getColumnName(64),
+                option
+            );
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.option = option;
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
         getAllWorkDicts() {
             gainUser().then(res => {
                 this.findObject(this.sellOption.column, "createUser").dicData = res.data.data;

+ 47 - 0
src/views/client/detailsPage.vue

@@ -277,6 +277,45 @@ export default {
             prop: "mailbox",
             span: 8,
           },
+            {
+                label: "会员等级",
+                prop: "membershipLevel",
+                span: 8,
+                filterable: true,
+                type: "select",
+                dicUrl: "/api/blade-system/dict-biz/dictionary?code=vip_level",
+                props: {
+                    label: "dictValue",
+                    value: "dictKey"
+                },
+                value:'VIP0'
+            },
+            {
+                label: "推荐人",
+                prop: "referenceId",
+                span: 8,
+                filterable: true,
+                type: "select",
+                dicUrl: "api/blade-client/corpsdesc/corpsDescList?corpType=KH",
+                props: {
+                    label: "cname",
+                    value: "id"
+                },
+            },
+            {
+                label: "积分余额",
+                prop: "pointsBalance",
+                disabled: true,
+                value:0,
+                span: 8,
+            },
+            {
+                label: "会员余额",
+                prop: "balanceAmounts",
+                disabled: true,
+                value:0,
+                span: 8,
+            },
           {
             label: "备注",
             prop: "remarks",
@@ -329,6 +368,13 @@ export default {
     }
   },
   async created() {
+      let arr = localStorage.getItem('roleName').split(',')
+      // 权限判断是否是admin
+      if (arr.indexOf('admin') != -1) {
+          this.findObject(this.option.column, "pointsBalance").disabled = false
+          this.findObject(this.option.column, "balanceAmounts").disabled = false
+      }
+
     this.customerContact = await this.getColumnData(
         this.getColumnName(143),
         customerContact
@@ -519,6 +565,7 @@ export default {
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {
+          this.form.balanceAmount = this.form.balanceAmounts
         done();
         if (valid) {
           if (this.corpsFiles.length > 0) {

+ 141 - 0
src/views/client/js/optionList.js

@@ -562,3 +562,144 @@ export const capitalOption = {
     }
   ]
 }
+
+
+// 充值明细的配置
+export const czoption = {
+  "width": 150,
+  "delBtn": false,
+  "editBtn": false,
+  addBtn: false,
+  "border": true,
+  "resizable": true,
+  "selection": true,
+  searchMenuSpan:6,
+  menu:false,
+  "column": [
+    {
+      "label": "客户",
+      "prop": "corpId",
+      "overHidden": true,
+      "labelWidth": 120,
+      "remote": true,
+      "type": "select",
+      "dicUrl": "/api/blade-client/corpsdesc/corpsDescList?corpType=KH&cname={{key}}",
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "index": 2,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "充值方式",
+      "prop": "type",
+      "search": true,
+      "overHidden": true,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dict-biz/dictionary?code=recharge_method",
+      "props": {
+        "label": "dictKey",
+        "value": "dictValue"
+      },
+      "labelWidth": 120,
+      "index": 3,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "充值日期",
+      "prop": "time",
+      "overHidden": true,
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "addDisplay": false,
+      "editDisplay": false,
+      "width": 150,
+      "index": 6,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "实际充值金额",
+      "prop": "realityAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "width": 150,
+      "index": 9,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "赠送金额",
+      "prop": "giveAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "width": 150,
+      "index": 10,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "总计金额",
+      "prop": "totalAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "index": 11,
+      "disabled": true,
+      "editDisplay": false,
+      "addDisplay": false,
+      "width":100,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "操作人",
+      "prop": "operatorName",
+      "overHidden": true,
+      "index": 13,
+      "width":100,
+      "editDisplay": false,
+      "addDisplay": false
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true,
+      "labelWidth": 120,
+      "index": 13
+    }
+  ]
+}

+ 93 - 0
src/views/financialManagement/rechargeDetails/configuration/detailsPage.json

@@ -0,0 +1,93 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "refreshBtn": false,
+  "searchMenuSpan": 6,
+  "align": "center",
+  "delBtn":false,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "stripe": true,
+  "selection": false,
+  "menuWidth": 150,
+  "dialogClickModal": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "thisAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "srcOrderno",
+      "overHidden": true,
+      "width": 200,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "overHidden": true,
+      "width": 200,
+      "index": 3
+    },
+    {
+      "label": "费用名称",
+      "prop": "itemName",
+      "overHidden": true,
+      "width": 150,
+      "index": 4
+    },
+    {
+      "label": "金额",
+      "prop": "amount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "结算金额",
+      "prop": "settlementAmount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "本次金额",
+      "prop": "thisAmount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 7,
+      "width": 120
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true,
+      "index": 13,
+      "cell": true,
+      "width": 540
+    }
+  ]
+}

+ 137 - 0
src/views/financialManagement/rechargeDetails/configuration/mainList.json

@@ -0,0 +1,137 @@
+{
+  "width": 150,
+  "index": true,
+  "delBtn": false,
+  "editBtn": false,
+  "border": true,
+  "resizable": true,
+  "selection": true,
+  "column": [
+    {
+      "label": "客户",
+      "prop": "corpId",
+      "overHidden": true,
+      "search": true,
+      "labelWidth": 120,
+      "remote": true,
+      "type": "select",
+      "dicUrl": "/api/blade-client/corpsdesc/corpsDescList?corpType=KH&cname={{key}}",
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "index": 2,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "充值方式",
+      "prop": "type",
+      "search": true,
+      "overHidden": true,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dict-biz/dictionary?code=recharge_method",
+      "props": {
+        "label": "dictKey",
+        "value": "dictValue"
+      },
+      "labelWidth": 120,
+      "index": 3,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "充值日期",
+      "prop": "time",
+      "overHidden": true,
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "addDisplay": false,
+      "editDisplay": false,
+      "width": 150,
+      "index": 6,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "实际充值金额",
+      "prop": "realityAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "width": 150,
+      "index": 9,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "赠送金额",
+      "prop": "giveAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "width": 150,
+      "index": 10,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "总计金额",
+      "prop": "totalAmount",
+      "overHidden": true,
+      "labelWidth": 120,
+      "index": 11,
+      "disabled": true,
+      "editDisplay": false,
+      "addDisplay": false,
+      "width":100,
+      "rules": [
+        {
+          "required": true,
+          "message": "",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "操作人",
+      "prop": "operatorName",
+      "overHidden": true,
+      "index": 13,
+      "width":100,
+      "editDisplay": false,
+      "addDisplay": false
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true,
+      "labelWidth": 120,
+      "index": 13
+    }
+  ]
+}

+ 356 - 0
src/views/financialManagement/rechargeDetails/rechargeDetails.vue

@@ -0,0 +1,356 @@
+<template>
+    <basic-container v-if="show">
+        <avue-crud :option="option"
+                   :data="dataList"
+                   ref="crud"
+                   v-model="form"
+                   :page.sync="page"
+                   :search.sync="search"
+                   :table-loading="loading"
+                   :cell-style="cellStyle"
+                   @search-change="searchChange"
+                   @search-reset="searchReset"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange"
+                   @saveColumn="saveColumn"
+                   @resetColumn="resetColumn"
+                   @on-load="onLoad"
+                   @search-criteria-switch="searchCriteriaSwitch"
+                   @row-save="rowSave" @row-update="rowUpdate">
+            <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+                <el-button class="el-icon-document-copy" type="danger" size="small"
+                           :disabled="!(SelectedData.length>0 && !Selectedtype)" @click="BatchDeletefun">
+                    批量删除
+                </el-button>
+            </template>
+            <template slot-scope="scope" slot="menu">
+                <el-button
+                    type="text"
+                    size="small"
+                    icon="el-icon-delete"
+                    :disabled="scope.row.synchronous == 1"
+                    @click.stop="editBtnfun(scope.row,scope.index)"
+                >编辑
+                </el-button>
+                <el-button
+                    v-if="scope.row.synchronous != 1"
+                    type="text"
+                    size="small"
+                    icon="el-icon-delete"
+                    @click.stop="corpscechargerecordSynchronousfun(scope.row,1)"
+                >提交
+                </el-button>
+                <el-button
+                    v-else
+                    type="text"
+                    size="small"
+                    icon="el-icon-delete"
+                    style="color: #f6760a"
+                    @click.stop="corpscechargerecordSynchronousfun(scope.row,2)"
+                >撤销
+                </el-button>
+                <el-button
+                    type="text"
+                    size="small"
+                    icon="el-icon-delete"
+                    :disabled="scope.row.synchronous == 1"
+                    @click.stop="rowDel(scope.row.id, scope.index)"
+                >删除
+                </el-button>
+            </template>
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {
+    corpscechargerecordList,
+    corpscechargerecordSubmit,
+    corpscechargerecordRemove, corpscechargerecordSynchronous
+} from "@/api/financialManagement/financialManagement"
+
+
+import {getToken} from "@/util/auth";
+import {allCropList} from "@/api/basicData/customerInformation";
+import fa from "element-ui/src/locale/lang/fa";
+
+export default {
+    data() {
+        return {
+            // 客户的数据
+            corpData:[],
+            // 转圈加载动画
+            loading : false,
+            // 双向绑定的值
+            form: {},
+            // 表单搜索的变量对象
+            search:{},
+            // 表格的配置
+            option: option,
+            // 详情组件的隐藏和显示
+            show:true,
+            // 表格的数据
+            dataList: [{
+                canem:""
+            }],
+            // 页码
+            page: {
+                pageSize: 10,
+                pagerCount: 5,
+                total: 0,
+            },
+            // 当前登陆用户信息
+            content:{},
+            // 当前选中的id
+            SelectedData:[],
+            // 判断当前选中的是不是可用点击的
+            Selectedtype:false,
+
+            query:{},
+        }
+    },
+    components:{
+    },
+     created() {
+        this.allCropListfun()
+    },
+    activated() {
+
+    },
+    mounted() {
+        // 获取当前操作人的信息
+        this.content = JSON.parse(localStorage.getItem('saber-userInfo')).content
+    },
+    methods: {
+        // 获取客户的数据
+        allCropListfun(){
+            allCropList({corpType:"KH"}).then(res=>{
+                this.corpData = res.data.data
+            })
+        },
+        // 当前内容发生变化时触发
+        rowUpdate(row,index,done,loading){
+            row.totalAmount = Number(row.realityAmount) + Number(row.giveAmount)
+            console.log(row,index,done,loading,163)
+            corpscechargerecordSubmit(row).then(res=>{
+                this.$message.success('编辑成功');
+                done()
+                this.onLoad(this.page)
+            })
+        },
+        // 编辑事件
+        editBtnfun(row,index){
+            this.$refs.crud.rowEdit(row,index)
+        },
+        // 提交和撤销接口
+        corpscechargerecordSynchronousfun(row,i){
+            if (row.totalAmount <= 0) return this.$message.success('充值金额为零不能进行撤销');
+            row.synchronous = i
+            corpscechargerecordSynchronous(row).then(res=>{
+                if (i == 1) {
+                    this.$message.success('提交成功');
+                }else if (i == 2) {
+                    this.$message.success('撤销成功');
+                }
+                this.onLoad(this.page)
+            })
+        },
+        // 弹窗保存
+        rowSave(form,done,loading){
+            console.log(form,120)
+            let obj = {}
+            for(let item of this.corpData) {
+                if (item.id == form.corpId) {
+                    obj.corpName = item.cname
+                    break;
+                }
+            }
+            obj.time = this.timeDetafun()
+            obj.operatorId = this.content.dept_id
+            obj.operatorName = this.content.account
+            obj.totalAmount = Number(form.realityAmount) + Number(form.giveAmount)
+            console.log({...form, ...obj},'143')
+            obj.synchronous = 0
+            corpscechargerecordSubmit({
+                ...form,
+                ...obj,
+            }).then(res=>{
+                console.log(res,127)
+                this.$message.success('添加成功');
+                done()
+                this.onLoad(this.page)
+            })
+        },
+        // 初始化页面
+        onLoad(page, params) {
+            corpscechargerecordList({
+                currentPage:page.currentPage,
+                pageSize:page.pageSize,
+                ...params
+            }).then(res =>{
+                this.dataList = res.data.data.records
+                this.page.total = res.data.data.total
+                if (this.page.total) {
+                    this.option.height = window.innerHeight - 240;
+                }
+            }).finally(()=>{
+                this.loading = false
+            })
+        },
+
+        searchCriteriaSwitch(type){
+            if (type){
+                this.option.height = this.option.height - 90
+            }else {
+                this.option.height = this.option.height + 90
+            }
+            this.$refs.crud.getTableHeight()
+        },
+        // 批量删除
+        BatchDeletefun(){
+            let arrid = []
+            for(let item of this.SelectedData) {
+                if (item.synchronous != 1) {
+                    arrid.push(item.id)
+                }
+            }
+            this.rowDel(arrid.join())
+        },
+        // 删除
+        rowDel(ids, index, done) {
+            if(ids){
+                this.$confirm("确定将选择数据删除?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    corpscechargerecordRemove({ids:ids}).then(res =>{
+                        if(res.data.success){
+                            this.$message.success("删除成功!");
+                            this.onLoad(this.page);
+                        }
+                    })
+                });
+            }
+        },
+        //点击搜索按钮触发
+        searchChange(params, done) {
+            this.query = params;
+            this.page.currentPage = 1;
+            this.onLoad(this.page, params);
+            done()
+        },
+        // 清空搜索回调方法
+        searchReset() {
+            console.log('清空搜索回调方法')
+        },
+        // 当选择项发生变化时会触发该事件
+        selectionChange(selection) {
+            console.log('当选择项发生变化时会触发该事件')
+            console.log(selection)
+            this.SelectedData = selection
+            this.Selectedtype = this.Selectedtypefun()
+        },
+        // 判断选中的状态能不能删除
+        Selectedtypefun(){
+            let type = false
+            for(let item of this.SelectedData) {
+                if (item.synchronous == 1) {
+                    type = true
+                    break;
+                }
+            }
+            return type
+        },
+        currentChange(val) {
+            this.page.currentPage = val
+        },
+        // 点击每页多少条
+        sizeChange() {
+            console.log('点击每页多少条')
+        },
+        // 点击刷新
+        refreshChange(params) {
+            this.onLoad(this.page,params)
+        },
+        // 获取当前的时间
+        timeDetafun(){
+            var today = new Date()
+            var year = today.getFullYear();
+            var month = String(today.getMonth() + 1).padStart(2, '0');
+            var day = String(today.getDate()).padStart(2, '0');
+            var hours = String(today.getHours()).padStart(2, '0');
+            var minutes = String(today.getMinutes()).padStart(2, '0');
+            var seconds = String(today.getSeconds()).padStart(2, '0');
+            // 构建今天的日期时间字符串
+            var todayDateTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
+            return todayDateTime
+        },
+
+        goBack() {
+            this.detailData=this.$options.data().detailData
+            this.show = true;
+            this.onLoad(this.page,this.search)
+        },
+        // 条纹样式
+        cellStyle() {
+            return "padding:0;height:40px;";
+        },
+        //列保存触发
+        async saveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(64),
+                this.option
+            );
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        // 重置列
+        async resetColumn() {
+            const inSave = await this.delColumnData(
+                this.getColumnName(64),
+                option
+            );
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.option = option;
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        // 导出
+        openExport() {
+            let params = JSON.parse(JSON.stringify(this.search))
+            if (params.settlementDate &&  params.settlementDate.length !==0 ) {  //合同
+                params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
+                params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
+                this.$delete(params,'settlementDate')
+            }
+            if (params.completionTime &&  params.completionTime.length !==0 ) {
+                params.completionTimeStart = params.completionTime[0]+ " " + "00:00:00";
+                params.completionTimeEnd = params.completionTime[1] + " " + "23:59:59";
+                this.$delete(params,'completionTime')
+            }
+            params.billType = "收费"
+            params.settlementType = 1
+            const routeData = this.$router.resolve({
+                path: '/api/trade-finance/settlement/expenseExport',      //跳转目标窗口的地址
+                query: {
+                    ...params    //括号内是要传递给新窗口的参数
+                }
+            })
+            window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+        },
+    }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 49 - 0
src/views/product/detailsPage.vue

@@ -280,6 +280,46 @@ export default {
                     trigger: "blur"
                 }]
             },
+            {
+                label: "门店积分",
+                prop: "storeIntegral",
+                type: 'number',
+                minRows: 0,
+                controls: false,
+                disabled:true,
+                span: 8,
+                value:0
+            },
+            {
+                label: "推荐人积分",
+                prop: "referenceIntegral",
+                type: 'number',
+                minRows: 0,
+                controls: false,
+                disabled:true,
+                span: 8,
+                value:0
+            },
+            {
+                label: "业务员积分",
+                prop: "salesmanIntegral",
+                type: 'number',
+                minRows: 0,
+                controls: false,
+                disabled:true,
+                span: 8,
+                value:0
+            },
+            {
+                label: "商品积分",
+                prop: "integral",
+                type: 'number',
+                minRows: 0,
+                controls: false,
+                disabled:true,
+                span: 8,
+                value:0
+            },
           {
             label: "备注",
             prop: "remarks",
@@ -382,6 +422,15 @@ export default {
     }
   },
   async created() {
+      // 判断是否是admin 权限
+      let arr = localStorage.getItem('roleName').split(',')
+      if (arr.indexOf('admin') != -1) {
+          this.findObject(this.option.column, "storeIntegral").disabled = false
+          this.findObject(this.option.column, "referenceIntegral").disabled = false
+          this.findObject(this.option.column, "salesmanIntegral").disabled = false
+          this.findObject(this.option.column, "integral").disabled = false
+      }
+
     this.optionList = await this.getColumnData(
       this.getColumnName(218),
       optionList

+ 47 - 3
src/views/product/js/optionList.js

@@ -79,11 +79,55 @@ export const option = {
       }]
     },
     {
+      label: '是否为积分商品',
+      prop: 'whetherIntegral',
+      width:140,
+      filterable: true,
+      search: true,
+      type: 'select',
+      dataType: "string",
+      index: 8,
+      dicData:[{
+        label: "是",
+        value: 1
+      },{
+        label: "否",
+        value: 0
+      }]
+    },
+    {
+      label: "门店积分",
+      prop: "storeIntegral",
+      overHidden: true,
+      index: 9
+    },
+    {
+      label: "推荐人积分",
+      width:120,
+      prop: "referenceIntegral",
+      overHidden: true,
+      index: 10
+    },
+    {
+      label: "业务员积分",
+      width:120,
+      prop: "salesmanIntegral",
+      overHidden: true,
+      index: 11
+    },
+    {
+      label: "商品积分",
+      prop: "integral",
+      overHidden: true,
+      index: 12
+    },
+
+    {
       label: "备注",
       prop: "remarks",
       search: true,
       overHidden: true,
-      index: 8
+      index: 13
     },
     {
       label: "状态",
@@ -100,7 +144,7 @@ export const option = {
       hide: true,
       showColumn: false,
       overHidden: true,
-      index: 9
+      index: 14
     },
     {
       label: "标签",
@@ -117,7 +161,7 @@ export const option = {
       hide: true,
       showColumn: false,
       overHidden: true,
-      index: 10
+      index: 15
     }
   ]
 }

+ 17 - 2
src/views/salesOrder/detailsPage.vue

@@ -56,6 +56,11 @@
             <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
               placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
           </template>
+            <template slot="memberBalance">
+                <el-input-number v-model="form.memberBalance" :disabled="detailData.status == 1"
+                                 placeholder="请输入" size="small" :controls="false"></el-input-number>
+                <span style="margin-left: 10px">{{balanceAmounts}}</span>
+            </template>
         </avue-form>
         <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
           @resetColumn="resetColumn" :cell-style="cellStyle">
@@ -316,6 +321,11 @@ export default {
             prop: "thisUsedProfit",
             span: 4,
           },
+            {
+                label: "会员卡金额",
+                prop: "memberBalance",
+                span: 8,
+            },
           {
             label: "应收金额",
             prop: "balanceAmount",
@@ -342,7 +352,7 @@ export default {
               label: "dictValue",
               value: "dictKey"
             },
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=tax_rate",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=tax_rate_xin",
             span: 4,
           },
           {
@@ -464,7 +474,9 @@ export default {
       goodsoptions: [],
       settlementList: [],
       orderFilesList: [],
-      storageoptions: []
+      storageoptions: [],
+        // 会员卡余额
+        balanceAmounts:0
     };
   },
   props: {
@@ -585,6 +597,8 @@ export default {
         this.form.corpsName = row.cname
         this.form.corpTel = row.tel
         getCorpDetails({ id: row.id }).then(res => {
+            console.log(res.data.data.balanceAmounts,598)
+            this.balanceAmounts = res.data.data.balanceAmounts
           this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
         })
       } else {
@@ -599,6 +613,7 @@ export default {
     },
     getAddress(row) {
       getCorpDetails({ id: row.corpId }).then(res => {
+          this.balanceAmounts = res.data.data.balanceAmounts
         this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
       })
       if (this.form.billType == "XS"){

+ 28 - 2
src/views/system/dept.vue

@@ -160,7 +160,16 @@
                 trigger: "blur"
               }]
             },
-
+              {
+                  label: "积分余额",
+                  prop: "pointsBalance",
+                  disabled:true,
+                  hide: true, // 表格里是否可见
+                  addDisplay:false,//当前行数据在新增表单中是否可见
+                  editDisplay:false,//当前行数据在编辑表单中是否可见
+                  viewDisplay:false, // 当前行数据在查看表单中是否可见
+                  value:0
+              },
             {
               label: "排序",
               prop: "sort",
@@ -188,7 +197,24 @@
         data: []
       };
     },
-    computed: {
+      created() {
+          // 判断是否是admin 权限
+          let arr = localStorage.getItem('roleName').split(',')
+          // 根据 租户好判断是否要显示 积分余额
+          const content = JSON.parse(localStorage.getItem('saber-tenantId')).content
+          if (content == 171757) {
+              this.$nextTick(()=>{
+                  if (arr.indexOf('admin') != -1) {
+                      this.findObject(this.option.column, "pointsBalance").disabled = false
+                  }
+                  this.findObject(this.option.column, "pointsBalance").hide = false
+                  this.findObject(this.option.column, "pointsBalance").addDisplay = true
+                  this.findObject(this.option.column, "pointsBalance").editDisplay = true
+                  this.findObject(this.option.column, "pointsBalance").viewDisplay = true
+              })
+          }
+      },
+      computed: {
       ...mapGetters(["userInfo", "permission"]),
       permissionList() {
         return {

+ 43 - 1
src/views/system/user.vue

@@ -444,6 +444,17 @@
                     message: '姓名长度在2到20个字符'
                   }]
                 },
+                  {
+                      label: "积分余额",
+                      prop: "pointsBalance",
+                      overHidden: true,
+                      hide: true,
+                      disabled: true,
+                      addDisplay:false,//当前行数据在新增表单中是否可见
+                      editDisplay:false,//当前行数据在编辑表单中是否可见
+                      viewDisplay:false, // 当前行数据在查看表单中是否可见
+                      value:0
+                  },
                 {
                   label: "手机号码",
                   prop: "phone",
@@ -742,13 +753,44 @@
         return ids.join(",");
       },
     },
-    mounted() {
+      created() {
+        // 根据 租户好判断是否要显示 积分余额
+          const content = JSON.parse(localStorage.getItem('saber-tenantId')).content
+          if (content == 171757) {
+              this.$nextTick(()=>{
+                  this.refsDisplay()
+              })
+          }
+      },
+      mounted() {
       // 非租户模式默认加载管理组数据
       if (!website.tenantMode) {
         this.initData(website.tenantId);
       }
     },
     methods: {
+        // 循环实例 修改积分余额是否显示
+        refsDisplay(){
+            let arr = localStorage.getItem('roleName').split(',')
+            // 循环这个 实例
+            for(let item of this.$refs.crud.option.group) {
+                // 判断是不是详细详细里的
+                if (item.prop == "detailInfo") {
+                    for (let ite of item.column) {
+                        // 判断是不是积分余额
+                        if (ite.prop == "pointsBalance") {
+                            // 判断是否是admin 权限
+                            if (arr.indexOf('admin') != -1) {
+                                ite.disabled = false
+                            }
+                            ite.addDisplay = true
+                            ite.editDisplay = true
+                            ite.viewDisplay = true
+                        }
+                    }
+                }
+            }
+        },
       nodeClick(data) {
         this.treeDeptId = data.id;
         this.page.currentPage = 1;