123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- <template>
- <div class="app-container">
- <y-data-view-page-layout title="市场管理首页" class="staff-admin-index">
- <y-data-view-module>
- <div style="width: 1660px">
- <y-d-v-over-view style="width: 250px" title="本年签约目标" :typeId="1" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.yearSaleTarget,value:'元'}]" @click.native="openSet('本年签约目标')"></y-d-v-over-view>
- <y-d-v-over-view style="width: 250px" title="本年回款目标" :typeId="2" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.yearPaymentTarget,value:'元'}]" @click.native="openSet('本年回款目标')"></y-d-v-over-view>
- <y-d-v-over-view style="width: 250px" title="潜在商机" :typeId="3" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.businessNum,value:'个'}]" @click.native="toBusinessPage()"></y-d-v-over-view>
- <y-d-v-over-view style="width: 250px" title="本年已签约" :typeId="4" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.yearSaleDone,value:'元'}]" @click.native="toItemPage()"></y-d-v-over-view>
- <y-d-v-over-view style="width: 250px" title="本年已回款" :typeId="5" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.yearPaymentDone,value:'元'}]" @click.native="toPaymentPage('year')"></y-d-v-over-view>
- <y-d-v-over-view style="width: 250px" title="本月已回款" :typeId="6" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.monthPaymentDone,value:'元'}]" @click.native="toPaymentPage('month')"></y-d-v-over-view>
- </div>
- </y-data-view-module>
- <div class="calendar-class">
- <span style="margin-left: 20px">工作台历</span>
- <el-calendar v-model="value">
- <div class="cell"
- slot="dateCell"
- slot-scope="{date, data}" @click="openDrawer(data)" style="width: 100%;height: 100%">
- <span :class="data.isSelected ? 'is-selected' : ''" >
- {{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}}
- </span>
- <el-icon v-if="checkStar(data.day)" class="el-icon-star-on" style="color: #ffdf1a;font-size: 30px "/>
- </div>
- </el-calendar>
- </div>
- <el-drawer
- :title="title"
- :before-close="handleClose"
- :visible.sync="dialog"
- direction="rtl"
- custom-class="demo-drawer"
- ref="drawer"
- >
- <div class="demo-drawer__content">
- <el-form :model="form">
- <el-col :span="10" style="padding-right: 10px">
- <y-data-view-module>
- <el-button type="warning" style="position: absolute;top:20px;right:60px;font-weight: bolder;cursor: pointer" @click="dialogVisible = true" >添加内容</el-button>
- <div class="plan-class">
- <div style="width: 530px;display: flex" v-for="(item,index) in dynamicTags">
- <span style="display:inline-block;width:500px;word-break: break-all; white-space:normal;margin: 10px 10px 10px 10px;line-height: 25px;">
- {{ index+1 }}、{{ item.content }}
- </span>
- <el-icon class="el-icon-circle-close" style="color: red;cursor:pointer;" @click.native="deltag(item.id)"/>
- </div>
- <span v-if="dynamicTags.length<8 & dynamicTags.length!=0" style="display:inline-block;width:530px;height:400px;word-break: break-all; white-space:normal;margin: 10px 10px 10px 10px;line-height: 25px;" >
- </span>
- <div class="plan-class" v-if="dynamicTags.length===0">
- <span style="display:inline-block;width:530px;height:500px;word-break: break-all; white-space:normal;margin: 10px 10px 10px 10px;line-height: 25px;">
- </span>
- </div>
- </div>
- </y-data-view-module>
- <el-dialog
- title="便签内容"
- :visible.sync="dialogVisible"
- width="30%"
- custom-class="tag-class"
- >
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="textareadata"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="addtag">确 定</el-button>
- </span>
- </el-dialog>
- </el-col>
- </el-form>
- </div>
- </el-drawer>
- <el-dialog
- :title="setName"
- width="600px"
- :visible.sync="setDialogFormVisible"
- :close-on-click-modal="false"
- >
- <template>
- <el-table
- :data="tableData"
- border
- style="width: 100%">
- <el-table-column
- prop="date"
- label="姓名"
- align="center"
- width="280px">
- <template slot-scope="{row}">
- <span>{{ row.userName }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="setName==='本年签约目标' "
- prop="name"
- label="签约目标"
- align="center"
- width="278px">
- <template slot-scope="{row}">
- <span>{{ row.saleTarget }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="setName==='本年回款目标' "
- prop="name"
- label="回款目标"
- align="center"
- width="278px">
- <template slot-scope="{row}">
- <span>{{ row.paymentTarget }}</span>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <br>
- <el-form
- ref="setForm"
- :model="temp"
- label-position="right"
- label-width="110px"
- style="width: 400px; margin-left:50px;"
- >
- <el-form-item label="我的目标:" prop="amount">
- <el-input v-model.number="temp.amount" class="filter-item" type="number"/>
- </el-form-item>
- <el-form-item label="">
- <el-button @click="setDialogFormVisible = false">
- 取消
- </el-button>
- <el-button type="primary" @click="saveSet()">
- 保存
- </el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
- </y-data-view-page-layout>
- </div>
- </template>
- <script>
- import YDVOverView from '@/components/YDataViewPageLayout/YDVOverView'
- import YDataViewModule from '@/components/YDataViewPageLayout/YDataViewModule'
- import YDataViewPageLayout from '@/components/YDataViewPageLayout'
- export default {
- name: 'logIndex',
- components: {
- YDVOverView,
- YDataViewModule,
- YDataViewPageLayout
- },
- data() {
- return {
- value: new Date(),
- marketStaticsInfo:{},
- table: false,
- dialog: false,
- loading: false,
- form: {
- name: '',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: ''
- },
- formLabelWidth: '80px',
- timer: null,
- currentDate:'',
- editId:'',
- textareadata:'',
- dialogVisible:false,
- dynamicTags: [],
- calandarList:[],
- setDialogFormVisible:false,
- temp:{
- saleTarget:null,
- paymentTarget:null,
- amount:null
- },
- setName:'',
- tableData:[]
- }
- },
- created() {
- this.getCanlendarList();
- this.getMarketStat();
- },
- computed:{
- title(){
- return this.currentDate +" 工作计划";
- },
- },
- methods: {
- toItemPage(){
- const date = new Date();
- const curYear = date.getFullYear();
- this.$router.push(`/item/list/mine?businessNo=${curYear}`);
- },
- toBusinessPage() {
- this.$router.push(`/market/business`)
- },
- toPaymentPage(val) {
- const date = new Date();
- if (val === 'year'){
- const curYear = date.getFullYear();
- this.$router.push(`/market/payment/list?year=${curYear}`)
- }
- if (val === 'month'){
- const curYear = date.getFullYear();
- const curMonth = date.getMonth() +1;
- this.$router.push(`/market/payment/list?year=${curYear}&month=${curMonth}`)
- }
- },
- saveSet(){
- if (isNaN(this.temp.amount) || this.temp.amount===null){
- this.$notify({
- title: '失败',
- message: '请输入数字',
- type: 'error',
- duration: 2000
- });
- return
- }
- if (this.setName === '本年签约目标'){
- this.temp.saleTarget = this.temp.amount;
- }
- if (this.setName === '本年回款目标'){
- this.temp.paymentTarget = this.temp.amount;
- }
- let data = {
- saleTarget:this.temp.saleTarget,
- paymentTarget:this.temp.paymentTarget
- };
- this.$api.userTarget.add(data).then(data => {
- if (data.code === 200) {
- this.setDialogFormVisible = false;
- this.$notify({
- title: '成功',
- message: '修改成功',
- type: 'success',
- duration: 2000
- });
- this.getMarketStat();
- }else{
- this.$message.success(data.msg)
- }
- })
- },
- openSet(key){
- this.$api.userTarget.list().then(data=>{
- if (data.code ===200){
- this.tableData = data.data
- }else{
- this.$message.success(data.msg)
- }
- });
- this.temp.amount = null;
- this.setName = key;
- this.setDialogFormVisible = true;
- },
- getCanlendarList(){
- let userId = this.$store.getters.userInfo.id;
- this.$api.note.countByDate(userId).then(data => {
- if (data.code ===200){
- this.calandarList = data.data
- }else{
- this.$message.success(data.msg)
- }
- })
- },
- checkStar(day){
- this.flag = false;
- for(let item of this.calandarList){
- if (item.noteDate === day){
- this.flag = true;
- }
- }
- return this.flag;
- },
- addtag(){
- let data = {
- noteDate:this.currentDate,
- content:this.textareadata,
- userId: this.$store.getters.userInfo.id
- }
- this.$api.note.add(data).then(data => {
- if (data.code ===200){
- this.$message.success('保存成功')
- this.dialogVisible=false
- this.textareadata = ''
- this.tagdata()
- this.editId = ''
- this.getCanlendarList();
- }else{
- this.$message.success(data.msg)
- }
- })
- },
- tagdata(){
- let data = {
- noteDate:this.currentDate,
- userId: this.$store.getters.userInfo.id
- }
- this.$api.note.listByDate(data).then(data => {
- if (data.code ===200){
- this.dynamicTags = data.data
- }else{
- this.$message.success(data.msg)
- }
- })
- },
- deltag(val){
- console.log(val)
- this.$api.note.delete(val).then(data => {
- if (data.code ===200){
- this.$message.success('删除成功')
- this.tagdata()
- this.getCanlendarList();
- }else{
- this.$message.success(data.msg)
- }
- })
- },
- handleClose(done) {
- if (this.loading) {
- return;
- }
- done();
- // 动画关闭需要一定的时间
- setTimeout(() => {
- this.loading = false;
- }, 400);
- },
- cancelForm() {
- this.loading = false;
- this.dialog = false;
- clearTimeout(this.timer);
- },
- openDrawer(date){
- console.log(date);
- this.dialog = true
- this.currentDate = date.day;
- this.tagdata();
- },
- getMarketStat(){
- this.$api.marketStat.getMarketStat().then(res => {
- if (res.code === 200){
- this.marketStaticsInfo = res.data;
- }
- });
- },
- }
- }
- </script>
- <style lang="css" scoped>
- .calendar-class{
- margin-left: 20px;
- height: 500px;
- }
- .plan-class{
- /*width: 540px;*/
- /*border: 1px solid darkgray;*/
- /*box-shadow: 10px 10px 5px #888888;;*/
- /*border-radius: 10px;*/
- /*overflow: auto;*/
- width: 540px;
- -moz-box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
- box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
- background:
- -moz-repeating-linear-gradient(
- top,
- #fcf59b,
- #fcf59b 29px,
- #81cbbc 30px
- );
- background:
- -webkit-gradient(
- linear,
- left top, left bottom,
- from(#81cbbc),
- color-stop(2%, #fcf59b)
- );
- background:
- repeating-linear-gradient(
- top,
- #fcf59b,
- #fcf59b 29px,
- #81cbbc 30px
- );
- -webkit-background-size: 100% 30px;
- }
- .plan-class:after {
- width: 180px;
- height: 30px;
- content: " ";
- margin-left: -90px;
- border: 1px solid rgba(200, 200, 200, .8);
- background: rgba(254, 254, 254, .6);
- -moz-box-shadow: 0px 0 3px rgba(0, 0, 0, 0.1);
- -webkit-box-shadow: 0px 0 3px rgba(0, 0, 0, 0.1);
- box-shadow: 0px 0 3px rgba(0, 0, 0, 0.1);
- -moz-transform: rotate(-5deg);
- -webkit-transform: rotate(-5deg);
- -o-transform: rotate(-5deg);
- transform: rotate(-5deg);
- position: absolute;
- left: 50%;
- top: 95px;
- }
- /deep/.tag-class{
- border-radius: 20px;
- }
- div.cell{
- float: right;
- }
- </style>
|