wucl 2 years ago
parent
commit
a2382cb373

+ 21 - 0
src/api/modules/userTarget.js

@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+import { fileDown } from '../../utils/file'
+import md5 from 'js-md5'
+/*
+* 员工目标
+*/
+export default {
+
+  detail(params) {
+    return request.get(`userTarget/${params}`)
+  },
+  add(params) {
+    return request.post(`userTarget`, params)
+  },
+  edit(params) {
+    return request.put(`userTarget`, params)
+  },
+  list(){
+    return request.get(`userTarget/list`)
+  }
+}

+ 25 - 30
src/views/item/detail.vue

@@ -38,7 +38,7 @@
                       >
                         <el-select
                           v-model="postForm.belongTo"
-                          placeholder=""
+                          placeholder="请选择"
                           clearable
                           filterable
                           class="filter-item"
@@ -85,7 +85,7 @@
                       >
                         <el-select
                           v-model="postForm.cate"
-                          placeholder=""
+                          placeholder="请选择"
                           clearable
                           filterable
                           class="filter-item"
@@ -105,7 +105,7 @@
                           <el-option key="12" label="国土空间规划" value="国土空间规划"/>
                           <el-option key="13" label="自然资源资产清查信号收集" value="自然资源资产清查信号收集"/>
                           <el-option key="14" label="成片开发" value="成片开发"/>
-                          <el-option key="15" label="城乡土地增减挂钩" value="城乡土地增减挂钩"/>
+                          <el-option key="15" label="增减挂钩" value="增减挂钩"/>
                           <el-option key="16" label="司法评估" value="司法评估"/>
                           <el-option key="17" label="房地产评估" value="房地产评估"/>
                           <el-option key="18" label="规划计划类" value="规划计划类"/>
@@ -118,19 +118,20 @@
                     <el-col :xs="24" :sm="12" :lg="6" :span="6">
                       <el-form-item
                         label="客户名字:"
-                        prop="clientName"
+                        prop="customerId"
                         :rules="{required: true, message: '选择客户', trigger: 'blur'}"
                         label-width="120px"
                         class="postInfo-container-item"
                       >
-                        <el-select v-model="postForm.customerId" filterable class="filter-item" style="float: left;width: 100%;" placeholder="请选择" @change="getCustomerDetail">
+                        <el-select v-model="customerInfo" filterable class="filter-item" style="float: left;width: 100%;" placeholder="请选择" @change="getCustomerDetail">
                           <el-option
                             v-for="item in customerOptions"
                             :key="item.id"
                             :label="item.name"
-                            :value="item.id"
+                            :value="[item.id,item.name]"
                           />
                         </el-select>
+                        <el-select v-show="false" v-model="postForm.clientName" />
                       </el-form-item>
                     </el-col>
 
@@ -139,7 +140,6 @@
                       <el-form-item
                         label="委托单位:"
                         prop="clientUnit"
-                        :rules="{required: true, message: '请输入委托单位', trigger: 'blur'}"
                         label-width="120px"
                         class="postInfo-container-item"
                       >
@@ -150,7 +150,6 @@
                       <el-form-item
                         label="联系方式:"
                         prop="mobile"
-                        :rules="{required: true, message: '请输入联系方式', trigger: 'blur'}"
                         label-width="120px"
                         class="postInfo-container-item"
                       >
@@ -179,7 +178,7 @@
                       >
                         <el-select
                           v-model="postForm.businessSource"
-                          placeholder=""
+                          placeholder="请选择"
                           clearable
                           filterable
                           class="filter-item"
@@ -202,7 +201,13 @@
                       </el-form-item>
                     </el-col>
                     <el-col :xs="24" :sm="12" :lg="6" :span="6">
-                      <el-form-item label="签订日期:" label-width="120px" class="postInfo-container-item">
+                      <el-form-item
+                        label="签订日期:"
+                        prop="signDate"
+                        :rules="{required: true, message: '请选择签订日期', trigger: 'blur'}"
+                        label-width="120px"
+                        class="postInfo-container-item"
+                      >
                         <el-date-picker
                           v-model="postForm.signDate"
                           type="date"
@@ -224,7 +229,7 @@
                       >
                         <el-select
                           v-model="postForm.paymentMethod"
-                          placeholder=""
+                          placeholder="请选择"
                           clearable
                           filterable
                           class="filter-item"
@@ -243,7 +248,9 @@
                         label-width="120px"
                         class="postInfo-container-item"
                       >
-                        <el-input v-model="postForm.amount" class="filter-item"/>
+                        <el-input v-model.number="postForm.amount" class="filter-item" type="number">
+                          <i slot="suffix" style="font-size:normal;margin-right: 10px;line-height: 30px">元</i>
+                        </el-input>
                       </el-form-item>
                     </el-col>
                     <el-col :xs="24" :sm="12" :lg="6" :span="6">
@@ -255,7 +262,7 @@
                       >
                         <el-select
                           v-model="postForm.departmentId"
-                          placeholder=""
+                          placeholder="请选择"
                           clearable
                           filterable
                           class="filter-item"
@@ -338,7 +345,8 @@
         departmentsOptions:[],
         contractName:'',
         fileList:[],
-        customerOptions:[]
+        customerOptions:[],
+        customerInfo:[]
       }
     },
     created() {
@@ -350,6 +358,8 @@
     methods: {
 
       getCustomerDetail(){
+        this.postForm.clientName = this.customerInfo[1];
+        this.postForm.customerId = this.customerInfo[0];
         this.$api.customer.detail(this.postForm.customerId).then(res =>{
           this.postForm.clientUnit = res.data.department;
           this.postForm.mobile = res.data.mobile;
@@ -361,11 +371,6 @@
         })
       },
       handleAttachmentPreview(file){
-        // var a = document.createElement('a');
-        // var event = new MouseEvent('click');
-        // a.download = file.url;
-        // a.href = file.url;//路径前拼上前缀,完整路径
-        // a.dispatchEvent(event);
         window.open(file.url)
       },
       handleExceed(files, fileList) {
@@ -407,6 +412,7 @@
         if (this.dataId) {
           this.$api.item.detail(this.dataId).then(res => {
             this.postForm = res.data;
+            this.customerInfo = res.data.clientName;
             if (res.data.contractUrl){
               const arr = res.data.contractUrl.split("-");
               this.contractName = arr[1];
@@ -419,17 +425,6 @@
         }
       },
       handleCreate() {
-        if (!this.postForm.name) {
-          this.$notify({
-            title: '错误',
-            message: '请输入项目名称',
-            type: 'error',
-            duration: 2000
-          });
-          return
-        }
-        this.vLoading = true;
-
         this.$refs.postForm.validate(valid => {
           if (valid) {
             if (this.dataId) {

+ 18 - 5
src/views/item/list.vue

@@ -34,6 +34,20 @@
           style="margin-left: 20px;width: 320px;float: left;"
         >
         </el-input>
+        <el-input
+          v-model="listQuery.businessNo"
+          placeholder="流水号"
+          clearable
+          style="margin-left: 20px;width: 320px;float: left;"
+        >
+        </el-input>
+        <el-input
+          v-model="listQuery.clientManager"
+          placeholder="客户经理"
+          clearable
+          style="margin-left: 20px;width: 320px;float: left;"
+        >
+        </el-input>
         <el-button
           class="filter-item"
           style="margin-left: 10px;float: left;"
@@ -92,7 +106,7 @@
             <span>{{ row.clientUnit}}</span>
           </template>
         </el-table-column>
-        <el-table-column label="委托人" align="center" width="130">
+        <el-table-column label="客户名字" align="center" width="130">
           <template slot-scope="{row}">
             <span>{{ row.clientName}}</span>
           </template>
@@ -234,9 +248,9 @@
     },
     created() {
       const that = this;
-      // if (this.$router.currentRoute.path === '/item/list/me'){
-      //   this.listQuery.state = "进行中";
-      // }
+      if (this.$route.query.businessNo) {
+        this.listQuery.businessNo = this.$route.query.businessNo;
+      }
       that.getList()
     },
     methods: {
@@ -301,7 +315,6 @@
         this.listLoading = true
         const key = {}
         if (this.$router.currentRoute.path === '/item/list/me'){
-          this.listQuery.me = true;
           this.$api.item.mine(Object.assign({}, that.listQuery, key)).then((res) => {
             that.pageData = res.data;
             setTimeout(() => {

+ 1 - 3
src/views/log/detail.vue

@@ -74,7 +74,7 @@
                         label-width="180px"
                         class="postInfo-container-item"
                       >
-                        <el-input type="textarea" v-model="postForm.taskSituation" class="filter-item" placeholder="200字符"/>
+                        <el-input type="textarea" v-model="postForm.taskSituation" :autosize="{ minRows: 8, maxRows: 8}" class="filter-item" placeholder="200字符"/>
                       </el-form-item>
                     </el-col>
                   </el-row>
@@ -165,8 +165,6 @@
           });
           return;
         }
-        this.vLoading = true;
-
         this.$refs.postForm.validate(valid => {
           if (valid) {
             if (this.itemId) {

+ 0 - 67
src/views/market/customer/detail.vue

@@ -209,73 +209,6 @@
         }
       },
       handleCreate() {
-        // if (!this.postForm.userType) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请选择员工类型',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        // if (!this.postForm.name) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请输入姓名',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        // if (!this.postForm.sex) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请选择性别',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        // if (!this.postForm.idNo) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请输入身份证号',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        // if (this.postForm.remark && this.postForm.remark.length>200) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '备注信息长度应不超过200字符',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        // this.postForm.userPosts = this.userPosts;
-        // if (!this.postForm.userPosts || !this.postForm.userPosts.length) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请选择岗-部门',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        //
-        // if (!this.postForm.hireDate) {
-        //   this.$notify({
-        //     title: '错误',
-        //     message: '请选择入职日期',
-        //     type: 'error',
-        //     duration: 2000
-        //   });
-        //   return
-        // }
-        this.vLoading = true;
-
         this.$refs.postForm.validate(valid => {
           if (valid) {
             if (this.dataId) {

+ 4 - 2
src/views/market/customer/list.vue

@@ -121,7 +121,9 @@
         </el-table-column>
         <el-table-column label="客户等级" align="center" width="120">
           <template slot-scope="{row}">
-            <span style="color:red">{{row.level}}</span>
+            <span v-if=" row.level==='重点客户' " style="color: red">{{row.level}}</span>
+            <span v-if=" row.level==='普通客户' " style="color: sandybrown">{{row.level}}</span>
+            <span v-if=" row.level==='一般客户' " style="color: green">{{row.level}}</span>
           </template>
         </el-table-column>
         <el-table-column label="客户地址" align="center" width="120">
@@ -200,7 +202,7 @@
         name:null,
         city:null,
         county:null,
-        AllEnum:[]
+        AllEnum:[],
       }
     },
     created() {

+ 79 - 17
src/views/market/index.vue

@@ -5,10 +5,10 @@
         <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:'个'}]" ></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:'元'}]" ></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:'元'}]" ></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:'元'}]" ></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">
@@ -79,6 +79,41 @@
         :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"
@@ -86,8 +121,8 @@
           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"/>
+          <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">
@@ -141,9 +176,12 @@
         calandarList:[],
         setDialogFormVisible:false,
         temp:{
+          saleTarget:null,
+          paymentTarget:null,
           amount:null
         },
-        setName:''
+        setName:'',
+        tableData:[]
       }
     },
     created() {
@@ -155,10 +193,27 @@
         return this.currentDate +" 工作计划";
       },
     },
-    mounted() {
-
-    },
     methods: {
+      toItemPage(){
+        const date = new Date();
+        const curYear = date.getFullYear();
+        this.$router.push(`/item/list/me?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({
@@ -169,17 +224,17 @@
           });
           return
         }
-        let field = 'YEAR_SALE_TARGET';
+        if (this.setName === '本年签约目标'){
+          this.temp.saleTarget = this.temp.amount;
+        }
         if (this.setName === '本年回款目标'){
-          field = 'YEAR_PAYMENT_TARGET';
+          this.temp.paymentTarget = this.temp.amount;
         }
         let data = {
-          description:this.setName,
-          value:this.temp.amount,
-          name:'MARKET',
-          field:field
+          saleTarget:this.temp.saleTarget,
+          paymentTarget:this.temp.paymentTarget
         };
-        this.$api.globalConfig.add(data).then(data => {
+        this.$api.userTarget.add(data).then(data => {
             if (data.code === 200) {
               this.setDialogFormVisible = false;
               this.$notify({
@@ -195,6 +250,13 @@
         })
       },
       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;

+ 10 - 5
src/views/market/payment/detailList.vue

@@ -110,8 +110,13 @@
       }
     },
     created() {
-      const that = this;
-      that.getList();
+      if (this.$route.query.year) {
+        this.listQuery.year = this.$route.query.year;
+      }
+      if (this.$route.query.month) {
+        this.listQuery.month = this.$route.query.month;
+      }
+      this.getList();
     },
     methods: {
       resetSearch() {
@@ -130,11 +135,11 @@
         this.getList()
       },
       getList() {
-        const that = this
-        this.listLoading = true
+        const that = this;
+        this.listLoading = true;
         // console.log(that.listQuery)
         const key = {}
-        key[this.listQueryKey] = this.listQuery.description
+        key[this.listQueryKey] = this.listQuery.description;
         this.$api.payment
           .list(Object.assign({}, that.listQuery, key))
           .then((res) => {

+ 3 - 1
src/views/market/payment/list.vue

@@ -128,7 +128,9 @@
         </el-form-item>
 
         <el-form-item label="回款金额:" prop="amount" :rules="{required: true, message: '请填写回款金额', trigger: 'blur'}">
-          <el-input v-model.number="temp.amount" class="filter-item"/>
+          <el-input v-model.number="temp.amount" class="filter-item" type="number">
+            <i slot="suffix" style="font-size:normal;margin-right: 10px;line-height: 30px">元</i>
+          </el-input>
         </el-form-item>
         <el-form-item
           label="回款日期:"