| 12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0f50e2fa"],{"1dd1":function(t,e,a){},"3aeb":function(t,e,a){"use strict";a("4192")},4192:function(t,e,a){},"856d":function(t,e,a){"use strict";a.r(e);a("7f7f");var o=function(){var t=this,e=t._self._c;return e("section",{staticClass:"content data"},[e("h4",[t._v("数据统计")]),e("el-divider"),e("el-form",{staticClass:"filter-form",attrs:{"label-width":"80px"}},[e("el-row",[e("el-col",{attrs:{span:4}},[e("el-form-item",{attrs:{label:"比赛名称",prop:"match_id"}},[e("el-select",{attrs:{placeholder:"请选择比赛",size:"mini"},on:{change:function(e){return t.getData()}},model:{value:t.queryParams.match_id,callback:function(e){t.$set(t.queryParams,"match_id",e)},expression:"queryParams.match_id"}},t._l(t.matchList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),e("el-col",{attrs:{span:3}},[e("el-form-item",{attrs:{label:"选手名字"}},[e("el-input",{attrs:{clearable:"",placeholder:"请输入选手名字/代码",size:"mini"},on:{clear:function(e){return t.getData()}},model:{value:t.queryParams.username,callback:function(e){t.$set(t.queryParams,"username",e)},expression:"queryParams.username"}})],1)],1),e("el-col",{attrs:{span:3}},[e("el-form-item",{attrs:{label:"持股日期"}},[e("el-date-picker",{attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",size:"mini"},model:{value:t.queryParams.stock_date,callback:function(e){t.$set(t.queryParams,"stock_date",e)},expression:"queryParams.stock_date"}})],1)],1),e("el-col",{attrs:{span:3}},[e("el-form-item",{attrs:{label:"比赛分组"}},[e("el-select",{attrs:{clearable:"",placeholder:"请选择比赛分组",size:"mini"},on:{clear:function(e){return t.getData()},change:function(e){return t.getData()}},model:{value:t.queryParams.groupId,callback:function(e){t.$set(t.queryParams,"groupId",e)},expression:"queryParams.groupId"}},t._l(t.groupList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),e("el-col",{attrs:{span:3}},[e("el-form-item",{attrs:{label:"是否请假"}},[e("el-select",{attrs:{clearable:"",placeholder:"请选择",size:"mini"},on:{clear:function(e){return t.getData()},change:function(e){return t.getData()}},model:{value:t.queryParams.auto_complete,callback:function(e){t.$set(t.queryParams,"auto_complete",e)},expression:"queryParams.auto_complete"}},t._l(t.missDayList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),e("el-col",{attrs:{span:4}},[e("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.getData}},[t._v("筛选")]),e("el-button",{attrs:{type:"normal",size:"mini"},on:{click:function(e){t.queryParams={},t.getData()}}},[t._v("重置")]),e("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("上传数据")])],1)],1),e("el-col",{attrs:{span:2}},[e("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[e("el-button",{attrs:{icon:"el-icon-download",type:"primary",size:"mini"},on:{click:t.downloadExcel}},[t._v("导出Excel")])],1)],1),e("el-col",{attrs:{span:2}},[e("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[e("el-button",{attrs:{icon:"el-icon-plus",type:"warning",size:"mini"},on:{click:t.autoCompleteData}},[t._v("补全数据")])],1)],1),e("el-col",{attrs:{span:2}},[e("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[e("el-button",{attrs:{icon:"el-icon-refresh",type:"danger",size:"mini"},on:{click:t.updateRank}},[t._v("刷新排名")])],1)],1)],1),e("el-row",{attrs:{gutter:10}},[e("el-col",{attrs:{span:6}})],1)],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:t.list,height:"55vh"}},[e("el-table-column",{attrs:{prop:"group_rank",label:"排名"}}),e("el-table-column",{attrs:{prop:"username",label:"选手"}}),e("el-table-column",{attrs:{prop:"stock_date",label:"持股日期",width:"150"}}),e("el-table-column",{attrs:{prop:"init_fund",label:"初始资产(万元)"}}),e("el-table-column",{attrs:{prop:"yesterday_fund",label:"昨日资产(万元)"}}),e("el-table-column",{attrs:{prop:"today_fund",label:"今日资产(万元)"}}),e("el-table-column",{attrs:{prop:"today_income",label:"今日盈亏"}}),e("el-table-column",{attrs:{prop:"total_income",label:"总盈亏",width:"100"}}),e("el-table-column",{attrs:{prop:"yesterday_stock",label:"昨日持股",width:"150"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.yesterday_auto_complete>0?e("div",{staticStyle:{color:"red"}},[t._v("请假")]):e("div",[1==a.row.yesterday_is_markt?e("div",{staticStyle:{color:"#409EFF"}},[t._v("开超市")]):t._e(),0==a.row.yesterday_is_markt&&0==a.row.yesterday_stock.length?e("div",{staticStyle:{color:"#E6A23C"}},[t._v("空仓")]):t._e(),0!=a.row.yesterday_stock.length?e("div",t._l(a.row.yesterday_stock,(function(a,o){return e("p",{key:o},[a.fund>0?e("span",[t._v(t._s(a.name)+"("+t._s(a.fund)+"万元)")]):e("span",[t._v(t._s(a.name))])])})),0):t._e()])]}}])}),e("el-table-column",{attrs:{prop:"today_stock",label:"今日持股",width:"150"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.auto_complete>0?e("div",{staticStyle:{color:"red"}},[t._v("请假")]):e("div",[1==a.row.is_markt?e("div",{staticStyle:{color:"#409EFF"}},[t._v("开超市")]):t._e(),0==a.row.is_markt&&0==a.row.today_stock.length?e("div",{staticStyle:{color:"#E6A23C"}},[t._v("空仓")]):t._e(),0!=a.row.today_stock.length?e("div",t._l(a.row.today_stock,(function(a,o){return e("p",{key:o},[a.fund>0?e("span",[t._v(t._s(a.name)+"("+t._s(a.fund)+"万元)")]):e("span",[t._v(t._s(a.name))])])})),0):t._e()])]}}])}),e("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"prop",label:"资金出入"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.fund_inout?e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.showFundInOut(a.row)}}},[t._v("查看")]):e("span",[t._v("无")])]}}])}),e("el-table-column",{attrs:{prop:"experience",label:"操盘总结",width:"160","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{prop:"wanzhu_comment",label:"顽主点评",width:"160","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{prop:"ctime",label:"创建时间",width:"160"}}),e("el-table-column",{attrs:{prop:"date",label:"操作",fixed:"right",width:"220"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){return t.editComment(a.row)}}},[t._v("点评")]),e("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(e){return t.edit(a.row)}}},[t._v("编辑")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.del(a.row)}}},[t._v("删除")])]}}])})],1),e("Page",{ref:"pageButton",attrs:{current:t.form.page,page_size:t.form.page_size,total:t.total},on:{pageChange:t.gopage}}),e("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[e("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"赛事名称",prop:"match_id"}},[e("el-select",{attrs:{placeholder:"请选择比赛"},model:{value:t.form.match_id,callback:function(e){t.$set(t.form,"match_id",e)},expression:"form.match_id"}},t._l(t.matchList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),e("el-form-item",{attrs:{label:"参赛选手",prop:"player_id"}},[t.form.id?e("el-input",{attrs:{placeholder:"",value:t.form.username,disabled:""},model:{value:t.form.user_id,callback:function(e){t.$set(t.form,"user_id",e)},expression:"form.user_id"}}):t._e(),t.form.id?e("span",[t._v(t._s(t.form.username))]):e("el-select",{attrs:{filterable:"",remote:"",placeholder:"请选择用户代码","reserve-keyword":"","remote-method":t.remoteMethod,loading:t.loading},model:{value:t.form.player_id,callback:function(e){t.$set(t.form,"player_id",e)},expression:"form.player_id"}},t._l(t.playerList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.label,value:t.id}})})),1)],1),e("el-form-item",{attrs:{label:"持仓日期",prop:"stock_date"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:t.form.stock_date,callback:function(e){t.$set(t.form,"stock_date",e)},expression:"form.stock_date"}})],1),e("el-form-item",{attrs:{label:"今日资产",prop:"today_fund"}},[e("el-input",{attrs:{clearable:"",placeholder:"请输入今日资产",type:"number"},model:{value:t.form.today_fund,callback:function(e){t.$set(t.form,"today_fund",e)},expression:"form.today_fund"}},[e("template",{slot:"append"},[t._v("万元")])],2)],1),t.form.id?e("el-form-item",{attrs:{label:"昨日资产",prop:"yesterday_fund"}},[e("el-input",{attrs:{clearable:"",placeholder:"请输入昨日资产",type:"number"},model:{value:t.form.yesterday_fund,callback:function(e){t.$set(t.form,"yesterday_fund",e)},expression:"form.yesterday_fund"}},[e("template",{slot:"append"},[t._v("万元")])],2)],1):t._e(),t.form.id?e("el-form-item",{attrs:{label:"初始资产",prop:"init_fund"}},[e("el-input",{attrs:{clearable:"",placeholder:"请输入初始资产",type:"number"},model:{value:t.form.init_fund,callback:function(e){t.$set(t.form,"init_fund",e)},expression:"form.init_fund"}},[e("template",{slot:"append"},[t._v("万元")])],2)],1):t._e(),e("el-form-item",{attrs:{label:"开超市",prop:"is_markt"}},[e("el-switch",{model:{value:t.form.is_markt,callback:function(e){t.$set(t.form,"is_markt",e)},expression:"form.is_markt"}})],1),e("el-form-item",{attrs:{label:"股票名称",prop:"today_stock"}},[t._l(t.form.today_stock,(function(a,o){return e("div",{key:o,staticStyle:{"margin-bottom":"5px"}},[e("el-input",{staticStyle:{width:"48%",display:"inline-block"},attrs:{placeholder:"请输入股票名称",disabled:1==t.form.is_markt},model:{value:a.name,callback:function(e){t.$set(a,"name",e)},expression:"item.name"}}),t._v("\n "),e("el-input",{staticStyle:{width:"39%"},attrs:{clearable:"",placeholder:"资金",disabled:1==t.form.is_markt},model:{value:a.fund,callback:function(e){t.$set(a,"fund",e)},expression:"item.fund"}},[e("template",{slot:"append"},[t._v("万元")])],2),e("i",{staticClass:"el-icon-circle-close del",staticStyle:{"margin-top":"5px"},on:{click:function(e){return t.form.today_stock.splice(o,1)}}})],1)})),e("el-button",{attrs:{type:"primary",size:"small",plain:""},on:{click:t.addCode}},[t._v("新增股票")])],2),e("el-form-item",{attrs:{label:"股票截图",prop:"today_stock_img"}},[t._l(t.form.today_stock_img,(function(a,o){return e("div",{key:o,staticClass:"imgs"},[e("img",{attrs:{width:"150",src:a,alt:""}}),e("i",{staticClass:"el-icon-circle-close del",on:{click:function(e){return t.form.today_stock_img.splice(o,1)}}})])})),e("el-upload",{staticClass:"upload-demo",attrs:{"show-file-list":!1,"on-success":t.handleSuccess,action:"/api/admin/uploadfile"}},[e("el-button",{attrs:{size:"small",type:"primary",plain:""}},[t._v("上传股票截图")])],1)],2)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),e("el-button",{on:{click:function(e){t.open=!1}}},[t._v("取 消")])],1)],1),e("el-dialog",{attrs:{title:t.title,visible:t.open1,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open1=e}}},[e("el-form",{ref:"form1",attrs:{model:t.form1,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"顽主点评"}},[e("el-input",{attrs:{placeholder:"",type:"textarea",rows:"10"},model:{value:t.form1.wanzhu_comment,callback:function(e){t.$set(t.form1,"wanzhu_comment",e)},expression:"form1.wanzhu_comment"}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.saveComment}},[t._v("确 定")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){t.open1=!1}}},[t._v("取 消")])],1)],1),e("el-dialog",{attrs:{title:t.title,visible:t.open2,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open2=e}}},[e("el-form",{ref:"form2",attrs:{model:t.form1,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"资金转出"}},[e("el-input",{attrs:{placeholder:"",disabled:""},model:{value:t.form2.fundout,callback:function(e){t.$set(t.form2,"fundout",e)},expression:"form2.fundout"}})],1),e("el-form-item",{attrs:{label:"资金转入"}},[e("el-input",{attrs:{placeholder:"",disabled:""},model:{value:t.form2.fundin,callback:function(e){t.$set(t.form2,"fundin",e)},expression:"form2.fundin"}})],1),e("el-form-item",{attrs:{label:"账号截图"}},[e("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.form2.account_img}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{type:"danger",size:"mini"},on:{click:t.delFundInOut}},[t._v("删除")]),e("el-button",{attrs:{size:"mini"},on:{click:function(e){t.open1=!1}}},[t._v("取 消")])],1)],1)],1)},i=[],n=(a("28a5"),a("c5f6"),a("9973")),l={components:{Page:n["a"]},data:function(){return{loading:!1,queryParams:{match_id:0,page:1,stock_date:this.getNowDate()},form:{stock_date:this.getNowDate()},form1:{},list:[{},{}],total:0,title:"新增用户",open:!1,open1:!1,rules:{match_id:[{required:!0,message:"请选择比赛",trigger:"change"}],stock_date:[{required:!0,message:"请选择持仓日期",trigger:"blur"}],today_fund:[{required:!0,message:"请输入今日资产",trigger:"blur"}],is_markt:[{required:!1,message:"请选择",trigger:"change"}]},matchList:[],playerList:[],groupList:[],stockList:[],missDayList:[{id:0,name:"否"},{id:1,name:"是"}],open2:!1,form2:{}}},methods:{updateRank:function(){var t=this;this.loading=!0,this.$api.updateRank(this.queryParams).then((function(e){t.loading=!1,t.$message({message:"更新成功!",type:"success"})}))},getNowDate:function(){var t=(new Date).getFullYear(),e=Number((new Date).getMonth()+1),a=(new Date).getDate();return e=e>9?e:"0"+e,a=a>9?a:"0"+a,t+"-"+e+"-"+a},autoCompleteData:function(){var t=this;this.loading=!0,this.$api.autoCompleteData(this.queryParams).then((function(e){t.getData(),t.loading=!1}))},downloadExcel:function(){var t=this;this.$api.downloadRecords(this.queryParams).then((function(e){var a=document.createElement("a"),o=new Blob([e.data],{type:"application/vnd.ms-excel,charset=UTF-8"}),i=URL.createObjectURL(o),n=decodeURIComponent(e.headers["content-disposition"].split("=")[1]);console.log(n),a.download="参赛数据",a.style.display="none",a.href=i,document.body.appendChild(a),a.click(),document.body.removeChild(a),t.download_loading=!1}))},del:function(t){var e=this;this.$confirm("确定删除吗?","提示",{type:"warning"}).then((function(){e.$api.delFundInOut(t.fund_inout).then((function(t){})),e.$api.delRecord({id:t.id,match_id:t.match_id}).then((function(t){e.$message({message:"删除成功",type:"success"}),e.getData()}))}))},gopage:function(t){t&&(this.queryParams.page_size=t),this.queryParams.page=this.$refs.pageButton.page,this.getData()},getData:function(){var t=this;this.loading=!0,this.$api.getPlayerRecord(this.queryParams).then((function(e){t.list=e.data.data.list,t.total=e.data.data.total,t.loading=!1}))},edit:function(t){var e=this;this.title="编辑数据",this.$api.getRecordInfo({id:t.id,match_id:t.match_id}).then((function(t){e.form=t.data.data,e.open=!0}))},editComment:function(t){var e=this;this.title="顽主点评",this.$api.getRecordInfo({id:t.id,match_id:t.match_id}).then((function(t){e.form1=t.data.data,e.open1=!0}))},saveComment:function(){var t=this;this.$api.updateComment({id:this.form1.id,wanzhu_comment:this.form1.wanzhu_comment,match_id:this.form1.match_id}).then((function(e){0==e.data.code?(t.msgSuccess("修改成功"),t.open1=!1,t.getData()):t.msgError(e.data.message)}))},handleAdd:function(){this.open=!0,this.title="新增数据",this.form={match_id:this.matchList[0].id,today_stock:[{code:"",name:"",fund:""}],today_stock_img:[],stock_date:this.getNowDate()}},showFundInOut:function(t){var e=this;this.open2=!0,this.$api.getFundInOut({id:t.fund_inout.id}).then((function(t){e.form2=t.data.data}))},delFundInOut:function(){var t=this;this.$api.delFundInOut(this.form2).then((function(e){t.open2=!1,t.getData()}))},addCode:function(){this.form.today_stock.push({code:"",name:"",fund:""})},handleSuccess:function(t,e){console.log(t),this.form.today_stock_img.push(t.data.url)},remoteMethod:function(t){var e=this;""!==t?(this.loading=!0,this.$api.getPlayerList({usercode:t}).then((function(t){e.playerList=t.data.data,e.$set(e.playerList,t.data.data),e.loading=!1}))):this.playerList=[]},submitForm:function(){var t=this;console.log(this.form),this.$refs["form"].validate((function(e){e&&(null!=t.form.id?t.$api.editRecord(t.form).then((function(e){0==e.data.code?(t.msgSuccess("修改成功"),t.open=!1,t.getData()):t.msgError(e.data.message)})):t.$api.addRecord(t.form).then((function(e){0==e.data.code?(t.msgSuccess("新增成功"),t.open=!1,t.getData()):t.msgError(e.data.message)})))}))}},created:function(){var t=this;this.$api.getMatchList().then((function(e){t.matchList=e.data.data,t.queryParams.match_id=t.matchList[0].id,t.getData()})),this.$api.getPlayerList().then((function(e){t.playerList=e.data.data})),this.$api.getGroupList().then((function(e){t.groupList=e.data.data})),this.$api.getStockList().then((function(e){t.stockList=e.data.data}))}},r=l,s=(a("f189"),a("2877")),c=Object(s["a"])(r,o,i,!1,null,null,null);e["default"]=c.exports},9973:function(t,e,a){"use strict";var o=function(){var t=this,e=t._self._c;return e("el-pagination",{attrs:{background:"","page-size":t.page_size?t.page_size:20,"current-page":t.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:t.total},on:{"current-change":t.getData,"size-change":t.handleSizeChange}})},i=[],n={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(t){this.page=t,this.$emit("pageChange")},handleSizeChange:function(t){this.$emit("pageChange",t)}},created:function(){}},l=n,r=(a("3aeb"),a("2877")),s=Object(r["a"])(l,o,i,!1,null,null,null);e["a"]=s.exports},f189:function(t,e,a){"use strict";a("1dd1")}}]);
- //# sourceMappingURL=chunk-0f50e2fa.9ff1ce4e.js.map
|