浏览代码

协议单位返佣(部分)

WIN-B904R0U0NNS\Administrator 2 年之前
父节点
当前提交
0ac7c47b55

+ 3 - 2
src/views/markets/modules/agreementUnit/agreementUnitDetailForm.vue

@@ -272,7 +272,7 @@
                     <contacts-list :agreementModel="model"></contacts-list>
                 </div>
                 <div v-if="activeMneu == 4">
-                    佣金
+                    <commission :agreementModel="model"></commission>
                 </div>
                 <div v-if="activeMneu == 5">
                     <check-in-list :agreementModel="model"></check-in-list>
@@ -289,10 +289,11 @@
     import CustomerList from './details/customerList'
     import ContactsList from './details/contactsList'
     import CheckInList from './details/checkInList'
+    import Commission from './details/commission'
 
     export default {
         name: 'agreementUnitDetailForm',
-        components: { CheckInList, ContactsList, CustomerList },
+        components: { Commission, CheckInList, ContactsList, CustomerList },
         computed: {
             formDisabled(){
                 return this.disabled

+ 63 - 0
src/views/markets/modules/agreementUnit/details/commission.vue

@@ -0,0 +1,63 @@
+<template>
+    <a-card :bordered="false">
+        <a-tabs v-model="activeKey" type="card" @change="tabsClick">
+            <a-tab-pane key="1" tab="未返"> </a-tab-pane>
+            <a-tab-pane key="2" tab="已返"> </a-tab-pane>
+        </a-tabs>
+
+        <div v-if="activeKey === '1'">
+            <unrefunded-commission-list  :agreementModel="agreementModel"></unrefunded-commission-list>
+        </div>
+        <div v-if="activeKey === '2'">
+            <refunded-commission-list  :agreementModel="agreementModel"></refunded-commission-list>
+        </div>
+    </a-card>
+</template>
+
+<script>
+    import UnrefundedCommissionList from './unRefundedCommissionList'
+    import RefundedCommissionList from './refundedCommissionList'
+    export default {
+        name: 'commission',
+        components: { RefundedCommissionList, UnrefundedCommissionList },
+        props: {
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
+            }
+        },
+        data(){
+            return {
+                activeKey: "1",
+                refundedList: [],//已返佣金记录
+                unRefundedList: [],//未返佣金记录
+            }
+        },
+        methods:{
+            tabsClick(e) {
+                if (e == "1") {
+                    this.loadData();
+                }
+            },
+            loadData() {
+                this.checkInBtnDis = false;
+                this.scheduleBtnDis = false;
+                getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+                    if (res.success) {
+                        res.result.forEach((row) => {
+                            this.$set(row, "collapse", 1);
+                        });
+                        this.roomList = res.result;
+                        this.oldRoomList = JSON.parse(JSON.stringify(res.result));
+                    }
+                });
+            },
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 60 - 0
src/views/markets/modules/agreementUnit/details/modules/marketAgreementRebateModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <market-agreement-rebate-modal-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></market-agreement-rebate-modal-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import marketAgreementRebateModalForm from './marketAgreementRebateModalForm'
+  export default {
+    name: 'marketAgreementRebateModal',
+    components: {
+      marketAgreementRebateModalForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 193 - 0
src/views/markets/modules/agreementUnit/details/modules/marketAgreementRebateModalForm.vue

@@ -0,0 +1,193 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accountNo">
+              <a-input disabled="disabled" v-model="agreementModel.accountNo" placeholder=""  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="客户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="customerName">
+              <a-input disabled="disabled" v-model="agreementModel.customerName" placeholder=""  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="应收金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shouldMoney">
+              <a-input disabled="disabled" v-model="model.shouldMoney"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="实收金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realMoney">
+              <a-input disabled="disabled" v-model="model.realMoney"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item :wrapperCol="wrapperCol1" prop="livingOrderNo">
+              <div id="payTypeContainer">
+                <div v-for="(item, index) in payTypes" :key="index">
+                  <div>
+                    <a-select v-model="payTypes[index].payType" placeholder="收款方式" >
+                      <a-select-option
+                              :value="item.id"
+                              v-for="item in payTypeList"
+                              :key="item.id"
+                      >
+                        {{ item.name }}
+                      </a-select-option>
+                    </a-select>
+                  </div>
+                  <div>
+                    <a-input v-model="payTypes[index].payMoney" placeholder="¥ 0.00" ></a-input>
+                    <a-button type="link" @click="addPayType" v-if="index == 0">
+                      添加收款
+                    </a-button>
+                    <a-button type="link" @click="e=>deletePayType(e,index)" v-else>
+                      删除
+                    </a-button>
+                  </div>
+                </div>
+              </div>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'BusMarketAgreementUnreturnedCommissionForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+          shouldMoney:0,
+          realMoney:0,
+         },
+        agreementModel:{},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        wrapperCol1:{
+          xs: { span: 24 },
+          sm: { span: 16, offset: 5 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           tenantId: [
+              { required: true, message: '请输入关联租户!'},
+           ],
+           hotelId: [
+              { required: true, message: '请输入关联酒店!'},
+           ],
+           agreementId: [
+              { required: true, message: '请输入关联协议!'},
+           ],
+           customerId: [
+              { required: true, message: '请输入关联客户协议!'},
+           ],
+        },
+        url: {
+          add: "/business/busMarketAgreementUnreturnedCommission/add",
+          edit: "/business/busMarketAgreementUnreturnedCommission/edit",
+          queryById: "/business/busMarketAgreementUnreturnedCommission/queryById",
+          query_payType: "/business/busRoomPayType/queryList",
+        },
+        payTypeList: [],
+        payTypes: [],
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.agreementModel));
+      getAction(this.url.query_payType,{}).then((res)=>{
+        if(res.success){
+          this.payTypeList = res.result
+        }else{
+
+        }
+      })
+      this.payTypes.push({
+        payType:'',
+        payMoney:''
+      })
+      console.log(this.payTypes)
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        console.log(record)
+        this.agreementModel = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+      addPayType(){
+        //添加收款
+        this.payTypes.push({
+          payType:'',
+          payMoney:''
+        })
+      },
+      deletePayType(e,index){
+        console.log(e,index)
+        this.payTypes.splice(index, 1)
+      }
+    }
+  }
+</script>

+ 168 - 0
src/views/markets/modules/agreementUnit/details/refundedCommissionList.vue

@@ -0,0 +1,168 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+            <a-button type="primary" icon="download" @click="handleExportXls('已返佣记录')">导出</a-button>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
+
+                <template slot="htmlSlot" slot-scope="text,record">
+                    <div v-html="text"></div>
+                </template>
+                <template slot="paySlot" slot-scope="text,record">
+                    <a-button type="primary" @click="e=>handlePayDetail(e,record)">
+                        支付详情
+                    </a-button>
+                </template>
+                <template slot="commissionSlot" slot-scope="text,record">
+                    <a-button type="primary" @click="e=>handleCommissionDetail(e,record)">
+                        返佣详情
+                    </a-button>
+                </template>
+            </a-table>
+        </div>
+    </a-card>
+</template>
+
+<script>
+
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+    export default {
+        name: 'refundedCommissionList',
+        mixins:[JeecgListMixin, mixinDevice],
+        components: {
+        },
+        props: {
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
+            }
+        },
+        data () {
+            return {
+                description: '已返佣记录管理页面',
+                // 表头
+                columns: [
+                    {
+                        title: "返佣时间",
+                        align: "center",
+                        dataIndex: "createTime",
+                        customRender: function (text) {
+                            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+                        },
+                    },
+                    {
+                        title:'总金额',
+                        align:"center",
+                        dataIndex: 'sumMoney'
+                    },
+                    {
+                        title:'已返佣金',
+                        align:"center",
+                        dataIndex: 'returnedCommission'
+                    },
+                    {
+                        title:'支付详情',
+                        align:"center",
+                        dataIndex: 'id',
+                        scopedSlots: { customRender: "priceSlot" },
+                    },
+                    {
+                        title:'返佣详情',
+                        align:"center",
+                        dataIndex: 'agreementUnreturnedId',
+                        scopedSlots: { customRender: "priceSlot" },
+                    },
+                    {
+                        title: '操作',
+                        dataIndex: 'action',
+                        align:"center",
+                        fixed:"right",
+                        width:147,
+                        scopedSlots: { customRender: 'action' }
+                    }
+                ],
+                url: {
+                    list: "/business/busMarketAgreementReturnedCommission/list",
+                    delete: "/business/busMarketAgreementReturnedCommission/delete",
+                    deleteBatch: "/business/busMarketAgreementReturnedCommission/deleteBatch",
+                    exportXlsUrl: "/business/busMarketAgreementReturnedCommission/exportXls",
+                    importExcelUrl: "business/busMarketAgreementReturnedCommission/importExcel",
+
+                },
+                dictOptions:{},
+                superFieldList:[],
+            }
+        },
+        created() {
+            this.getSuperFieldList();
+        },
+        computed: {
+            importExcelUrl: function(){
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+            },
+        },
+        methods: {
+            initDictConfig(){
+            },
+            getSuperFieldList(){
+                let fieldList=[];
+                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+                fieldList.push({type:'string',value:'agreementId',text:'关联协议'})
+                fieldList.push({type:'string',value:'agreementUnreturnedId',text:'关联返佣记录'})
+                fieldList.push({type:'number',value:'sumMoney',text:'总金额'})
+                fieldList.push({type:'number',value:'returnedCommission',text:'已返佣金'})
+                fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+                this.superFieldList = fieldList
+            },
+            handlePayDetail(e,record){
+                console.log(e,record)
+
+                // this.$refs.modalHousePriceForm.edit(record);
+                // this.$refs.modalHousePriceForm.title = "协议房价列表";
+                // this.$refs.modalHousePriceForm.disableSubmit = false;
+            },
+            handleCommissionDetail(e,record){
+                console.log(e,record)
+
+                // this.$refs.modalHousePriceForm.edit(record);
+                // this.$refs.modalHousePriceForm.title = "协议房价列表";
+                // this.$refs.modalHousePriceForm.disableSubmit = false;
+            }
+        }
+    }
+</script>
+<style scoped>
+    @import '~@assets/less/common.less';
+</style>

+ 162 - 0
src/views/markets/modules/agreementUnit/details/unRefundedCommissionList.vue

@@ -0,0 +1,162 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleRebate" type="primary" icon="plus">返佣</a-button>
+            <a-button type="primary" icon="download" @click="handleExportXls('未返佣记录')">导出</a-button>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
+
+                <template slot="commissionSlot" slot-scope="text,record">
+                    <a-tag v-if="text == 1" color="green">是</a-tag>
+                    <a-tag v-else color="red">否</a-tag>
+                </template>
+                <template slot="imgSlot" slot-scope="text,record">
+                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+                </template>
+            </a-table>
+        </div>
+
+        <market-agreement-rebate-modal ref="modalForm" @ok="modalFormOk"></market-agreement-rebate-modal>
+    </a-card>
+</template>
+
+<script>
+
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import MarketAgreementRebateModal from './modules/marketAgreementRebateModal'
+
+    export default {
+        name: 'unrefundedCommissionList',
+        mixins:[JeecgListMixin, mixinDevice],
+        components: {
+            MarketAgreementRebateModal
+        },
+        props: {
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
+            }
+        },
+        data () {
+            return {
+                description: '未返佣记录管理页面',
+                // 表头
+                columns: [
+                    {
+                        title:'房间号',
+                        align:"center",
+                        dataIndex: 'roomNumber'
+                    },
+                    {
+                        title:'记佣时间',
+                        align:"center",
+                        dataIndex: 'commissionDate',
+                        // customRender:function (text) {
+                        //     return !text?"":(text.length>10?text.substr(0,10):text)
+                        // }
+                    },
+                    {
+                        title:'需返佣金',
+                        align:"center",
+                        dataIndex: 'refundedCommission'
+                    },
+                    {
+                        title:'单据号',
+                        align:"center",
+                        dataIndex: 'livingOrderNo'
+                    },
+                    {
+                        title:'是否每日记佣金',
+                        align:"center",
+                        dataIndex: 'commission',
+                        scopedSlots: { customRender: "commissionSlot" },
+                    },
+                    {
+                        title: "创建时间",
+                        align: "center",
+                        dataIndex: "createTime",
+                        // customRender: function (text) {
+                        //     return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+                        // },
+                    }
+                ],
+                url: {
+                    list: "/business/busMarketAgreementUnreturnedCommission/list?agreementId="+this.agreementModel.id,
+                    delete: "/business/busMarketAgreementUnreturnedCommission/delete",
+                    deleteBatch: "/business/busMarketAgreementUnreturnedCommission/deleteBatch",
+                    exportXlsUrl: "/business/busMarketAgreementUnreturnedCommission/exportXls",
+                    importExcelUrl: "business/busMarketAgreementUnreturnedCommission/importExcel",
+
+                },
+                dictOptions:{},
+                superFieldList:[],
+            }
+        },
+        created() {
+            this.getSuperFieldList();
+        },
+        computed: {
+            importExcelUrl: function(){
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+            },
+        },
+        methods: {
+            initDictConfig(){
+            },
+            handleRebate: function () {
+                this.$refs.modalForm.edit(this.agreementModel);
+                this.$refs.modalForm.title = "返佣";
+                this.$refs.modalForm.disableSubmit = false;
+            },
+            getSuperFieldList(){
+                let fieldList=[];
+                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+                fieldList.push({type:'string',value:'agreementId',text:'关联协议'})
+                fieldList.push({type:'string',value:'customerId',text:'关联客户协议'})
+                fieldList.push({type:'string',value:'livingOrderNo',text:'单据号'})
+                fieldList.push({type:'string',value:'roomId',text:'房间号'})
+                fieldList.push({type:'date',value:'businessDay',text:'入住时间'})
+                fieldList.push({type:'number',value:'refundedCommission',text:'需返佣金'})
+                fieldList.push({type:'int',value:'commission',text:'每日记佣(0-否;1-是)'})
+                fieldList.push({type:'date',value:'commissionDate',text:'记佣时间'})
+                fieldList.push({type:'int',value:'rebate',text:'是否已返佣(0-否;1-是)'})
+                fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+                this.superFieldList = fieldList
+            }
+        }
+    }
+</script>
+<style scoped>
+    @import '~@assets/less/common.less';
+</style>