New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | <el-form label-width="120px" > |
| | | <el-row> |
| | | <p class="el-big-title">分享设置</p> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingOne in fxkg"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingOne.paramName}}</span> |
| | | <el-col > |
| | | <el-radio-group v-model="paramSettingOne.paramValue"> |
| | | <el-radio v-model="paramSettingOne.paramValue" :label="'1'">开启分销</el-radio> |
| | | <el-radio v-model="paramSettingOne.paramValue" :label="'2'">关闭分销</el-radio> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingTwo in fxms"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingTwo.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingTwo.paramValue"> |
| | | <el-radio :label="'1'">一级分销</el-radio> |
| | | <el-radio :label="'2'">二级分销</el-radio> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingThree in sqfs"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingThree.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingThree.paramValue"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">无需申请满足条件自动成为分销员</el-radio></div> |
| | | <div style="margin-top: 20px;"><el-radio :label="'2'">需要客户主动申请</el-radio></div> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingFour in shfs"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingFour.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingFour.paramValue"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">系统自动审核</el-radio></div> |
| | | <div style="margin-top: 20px;"><el-radio :label="'2'">人工审核</el-radio></div> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingFive in sqtj"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingFive.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingFive.paramValue"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">无条件注册即可成为分销员</el-radio></div> |
| | | <div style="margin-top: 25px;"><el-radio :label="'2'">消费任意产品可成为分销员</el-radio></div> |
| | | <div style="margin-top: 25px;display:flex;align-items: center;"> |
| | | <el-radio :label="'3'">消费指定产品可成为分销员</el-radio> |
| | | <div style="display:flex;align-items: center;"> |
| | | <el-button type="primary" @click="drawer = true">设置产品</el-button> |
| | | <el-input style="width:100px;" v-model="paramSettingFive.paramValue1"></el-input> |
| | | <el-input style="width:100px;display: block;" v-model="cpid"></el-input> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 25px;display:flex;align-items: center;"> |
| | | <el-radio :label="'4'">消费指定金额可成为分销员</el-radio> |
| | | <div style="display:flex;align-items: center;"> |
| | | <el-input style="width:100px;" v-model="paramSettingFive.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | <div style="font-size: 14px;align-items: center;">元</div> |
| | | </div> |
| | | </div> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-drawer |
| | | title="业绩设置" |
| | | :visible.sync="drawer" |
| | | :direction="direction" |
| | | size="90%" |
| | | > |
| | | <el-row > |
| | | <el-col :span="24"> |
| | | <el-row class="vertical "> |
| | | <el-input class="searchInput" @input="searchGoods()" v-model="queryKey" |
| | | placeholder="搜索添加产品"></el-input> |
| | | <el-button @click="searchGoods()" type="primary">搜索</el-button> |
| | | </el-row> |
| | | |
| | | <div class="searchResultTable" style="width: 50%" v-show="showSearchTable"> |
| | | <!-- 搜索加载数据表格 --> |
| | | <el-table |
| | | ref="dataTable" |
| | | v-loading="loading" |
| | | element-loading-text="拼命加载中" |
| | | element-loading-spinner="el-icon-loading" |
| | | element-loading-background="rgba(0, 0, 0, 0.8)" |
| | | @selection-change="handleSelectionChange" |
| | | @row-click="handleClickTableRow" |
| | | :max-height="400" |
| | | :data="searchTableData" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | type="selection" |
| | | width="50"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="code" |
| | | label="产品编号" |
| | | width="100"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="name" |
| | | |
| | | label="产品名称"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="sealPice" |
| | | label="售价"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="goodType" |
| | | label="类型"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cateName" |
| | | label="分类"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | width="150" |
| | | prop="address" |
| | | label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="mini" |
| | | @click="handleEdit(scope.$index, scope.row)">选择 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-row class="btn-box"> |
| | | <el-button size="mini" type="danger" @click="closeXm()">关闭</el-button> |
| | | <el-button size="mini" type="primary" @click="chouseGoods()">确认</el-button> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <el-row class="mt-10"> |
| | | <el-table |
| | | :stripe="true" |
| | | :border="true" |
| | | :height="tableHeight" |
| | | :data="order.items" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | type="index" |
| | | width="50"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.code" |
| | | label="产品编号" |
| | | width="100"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="shoppingGoods.name" |
| | | width="280" |
| | | label="产品名称"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.goodType" |
| | | width="80" |
| | | label="产品类型"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.sealPice" |
| | | label="单价"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" v-if="order.statu!='欠款'" |
| | | size="mini" |
| | | @click="removeItem(scope.$index, scope.row)">删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </el-row> |
| | | <el-row class="mt-20 vertical"> |
| | | <el-col :span="14" class="btn-box"> |
| | | <el-button type="primary" @click="submitOrder()">保存</el-button> |
| | | <el-button type="danger" @click="drawer = false">取消</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | </el-drawer> |
| | | <el-row justify="center" type="flex"> |
| | | <el-button type="primary" @click="submit()">保存</el-button> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | |
| | | <script> |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | cpid:"", |
| | | //业绩设置框 |
| | | drawer: false, |
| | | direction: 'rtl', |
| | | order: { |
| | | items: [ |
| | | ], |
| | | }, |
| | | tableHeight: 500, |
| | | /*****搜索表格数据*********/ |
| | | //搜索关键词 |
| | | queryKey: '', |
| | | //是否展示搜索表格 |
| | | showSearchTable: false, |
| | | //搜索表格数据 |
| | | searchTableData: [], |
| | | //表格加载效果 |
| | | loading: false, |
| | | /******搜索表格数据END********/ |
| | | fxkg:[], |
| | | fxms:[], |
| | | sqfs:[], |
| | | shfs:[], |
| | | sqtj:[], |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | _this.loadParamSetting(); |
| | | }, |
| | | loadParamSetting() { |
| | | let _this = this; |
| | | //加载配置 |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: {}, |
| | | url: basePath + '/fenXiao/ruleSetting/selectFenXiaoSetting', |
| | | callback: function (data) { |
| | | _this.fxkg = data.mapInfo.fxkg; |
| | | _this.fxms = data.mapInfo.fxms; |
| | | _this.sqfs = data.mapInfo.sqfs; |
| | | _this.shfs = data.mapInfo.shfs; |
| | | _this.sqtj = data.mapInfo.sqtj; |
| | | //_this.order.items = data.mapInfo.order; |
| | | //console.log(_this.order.items); |
| | | } |
| | | }); |
| | | }, |
| | | setSelectGoods(data){ |
| | | console.log(data); |
| | | }, |
| | | |
| | | //选择产品 |
| | | handleEdit(index, row) { |
| | | this.pushToSelectGoods(row); |
| | | }, |
| | | pushToSelectGoods(goods) { |
| | | |
| | | //判断是否被选中 |
| | | let selected = false; |
| | | this.order.items.forEach(item => { |
| | | if (item.shoppingGoods.id == goods.id) { |
| | | selected = true; |
| | | return; |
| | | } |
| | | }); |
| | | if (!selected) { |
| | | //未选中产品加入列表 |
| | | let item = {}; |
| | | item.shoppingGoods = goods; |
| | | item.goodsId = goods.id; |
| | | item.count = 1; |
| | | this.order.items.push(item); |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 点击多选 |
| | | */ |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val; |
| | | }, |
| | | /** |
| | | * 提交表单订单 |
| | | * submitType 1 提交,2保存 |
| | | */ |
| | | submitOrder(submitType) { |
| | | let _this = this; |
| | | let submitDate =""; |
| | | for (let i = 0; i < _this.order.items.length; i++) { |
| | | let goods = _this.order.items[i]; |
| | | let goodsId = goods.goodsId; |
| | | submitDate = submitDate +goodsId+","; |
| | | } |
| | | _this.cpid = submitDate; |
| | | _this.drawer = false |
| | | }, |
| | | /** |
| | | * 批量选择产品 |
| | | */ |
| | | chouseGoods() { |
| | | let _this = this; |
| | | // this.multipleSelection.forEach(item => { |
| | | // _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE); |
| | | // }); |
| | | this.closeXm(); |
| | | }, |
| | | /** |
| | | * 行点击事件 |
| | | */ |
| | | handleClickTableRow(row, event, column) { |
| | | this.$refs.dataTable.toggleRowSelection(row); |
| | | }, |
| | | /** |
| | | * 删除组合产品 |
| | | */ |
| | | removeItem(index, row) { |
| | | this.order.items.splice(index, 1); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 搜索项目绑定的产品信息 |
| | | */ |
| | | searchGoods() { |
| | | let _this = this; |
| | | if (this.queryKey && this.queryKey.trim().length > 0) { |
| | | this.showSearchTable = true; |
| | | this.loading = true; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | contentType: 'application/x-www-form-urlencoded', |
| | | //TODO 优化下拉加载 |
| | | data: {name: _this.queryKey, limit: 10000}, |
| | | url: basePath + "/admin/shoppinggoods/showList", |
| | | callback: function (data) { |
| | | _this.searchTableData = data.rows; |
| | | _this.loading = false; |
| | | } |
| | | }); |
| | | } else { |
| | | this.showSearchTable = false; |
| | | } |
| | | }, |
| | | closeXm() { |
| | | this.showSearchTable = false; |
| | | }, |
| | | |
| | | submit() { |
| | | console.log("提交"); |
| | | let _this = this; |
| | | let submitDate = []; |
| | | for (let i = 0; i < _this.fxkg.length; i++) { |
| | | let paramSetting = _this.fxkg[i]; |
| | | let paramCode = paramSetting.paramCode; |
| | | let paramValue = paramSetting.paramValue; |
| | | let paramValue1 = paramSetting.paramValue1; |
| | | let paramValue2 = paramSetting.paramValue2; |
| | | |
| | | let obj = { |
| | | paramCode: paramCode, |
| | | paramValue: paramValue, |
| | | paramValue1: paramValue1, |
| | | paramValue2: paramValue2, |
| | | } |
| | | submitDate.push(obj); |
| | | } |
| | | for (let i = 0; i < _this.fxms.length; i++) { |
| | | let paramSetting = _this.fxms[i]; |
| | | let paramCode = paramSetting.paramCode; |
| | | let paramValue = paramSetting.paramValue; |
| | | let paramValue1 = paramSetting.paramValue1; |
| | | let paramValue2 = paramSetting.paramValue2; |
| | | |
| | | let obj = { |
| | | paramCode: paramCode, |
| | | paramValue: paramValue, |
| | | paramValue1: paramValue1, |
| | | paramValue2: paramValue2, |
| | | } |
| | | submitDate.push(obj); |
| | | } |
| | | for (let i = 0; i < _this.sqfs.length; i++) { |
| | | let paramSetting = _this.sqfs[i]; |
| | | let paramCode = paramSetting.paramCode; |
| | | let paramValue = paramSetting.paramValue; |
| | | let paramValue1 = paramSetting.paramValue1; |
| | | let paramValue2 = paramSetting.paramValue2; |
| | | |
| | | let obj = { |
| | | paramCode: paramCode, |
| | | paramValue: paramValue, |
| | | paramValue1: paramValue1, |
| | | paramValue2: paramValue2, |
| | | } |
| | | submitDate.push(obj); |
| | | } |
| | | for (let i = 0; i < _this.shfs.length; i++) { |
| | | let paramSetting = _this.shfs[i]; |
| | | let paramCode = paramSetting.paramCode; |
| | | let paramValue = paramSetting.paramValue; |
| | | let paramValue1 = paramSetting.paramValue1; |
| | | let paramValue2 = paramSetting.paramValue2; |
| | | |
| | | let obj = { |
| | | paramCode: paramCode, |
| | | paramValue: paramValue, |
| | | paramValue1: paramValue1, |
| | | paramValue2: paramValue2, |
| | | } |
| | | submitDate.push(obj); |
| | | } |
| | | for (let i = 0; i < _this.sqtj.length; i++) { |
| | | let paramSetting = _this.sqtj[i]; |
| | | let paramCode = paramSetting.paramCode; |
| | | let paramValue = paramSetting.paramValue; |
| | | let paramValue1; |
| | | let paramValue2; |
| | | |
| | | alert(paramValue); |
| | | if(paramValue === '3'){ |
| | | paramValue1 = _this.cpid; |
| | | }else if(paramValue === '4'){ |
| | | paramValue2 = paramSetting.paramValue2; |
| | | } |
| | | alert(paramValue1); |
| | | |
| | | alert(paramValue2); |
| | | |
| | | let obj = { |
| | | paramCode: paramCode, |
| | | paramValue: paramValue, |
| | | paramValue1: paramValue1, |
| | | paramValue2: paramValue2, |
| | | } |
| | | submitDate.push(obj); |
| | | } |
| | | |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: submitDate, |
| | | url: basePath + '/fenXiao/ruleSetting/updateFenXiaoSetting', |
| | | callback: function (data) { |
| | | _this.$message({ |
| | | message: data.info, |
| | | type: 'success', |
| | | onClose: function () { |
| | | _this.loadParamSetting(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |