Browse Source

新增跟进

shengxuefei 4 years ago
parent
commit
4375cf9460

+ 15 - 19
build/webpack.base.conf.js

@@ -2,7 +2,7 @@
 const path = require('path')
 const utils = require('./utils')
 const config = require('../config')
-const VueLoaderPlugin = require('vue-loader/lib/plugin')
+//const VueLoaderPlugin = require('vue-loader/lib/plugin')
 const vueLoaderConfig = require('./vue-loader.conf')
 
 function resolve (dir) {
@@ -32,9 +32,9 @@ module.exports = {
       ? config.build.assetsPublicPath
       : config.dev.assetsPublicPath
   },
-  plugins: [
-        new VueLoaderPlugin()
-    ],
+  // plugins: [
+  //       new VueLoaderPlugin()
+  //   ],
   resolve: {
     extensions: ['.js', '.vue', '.json'],
     alias: {
@@ -45,11 +45,7 @@ module.exports = {
   module: {
     rules: [
       //...(config.dev.useEslint ? [createLintingRule()] : []),
-      {
-            test: /\.html$/,
-            use: 'html-loader'
-        }, 
-      {
+     {
         test: /\.vue$/,
         loader: 'vue-loader',
         options: vueLoaderConfig
@@ -83,10 +79,10 @@ module.exports = {
           name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
         }
       },
-      {
-        test: /\.css$/i,
-        use: ["style-loader", "css-loader"],
-      },
+      // {
+      //   test: /\.css$/i,
+      //   use: ["style-loader", "css-loader"],
+      // },
       {
         test: /\.less$/,
         use: [
@@ -109,15 +105,15 @@ module.exports = {
         ],
       },
       {
-            test: /\.sass$/,
+            test: /\.scss$/,
             // loader: 'style-loader!css-loader!sass-loader',
             //loader 的解析从后向前解析
-            use: [ 'vue-style-loader', 'css-loader', 'sass-loader' ]
+            loader: 'sass-loader!style-loader!css-loader',
       },
-      {
-        test: / \.scss$ / ,
-        loaders: [ 'style' , 'css' , 'sass' ]
-      }
+      // {
+      //   test: / \.scss$ / ,
+      //   loaders: [ 'style' , 'css' , 'sass' ]
+      // }
     ]
   },
   node: {

File diff suppressed because it is too large
+ 1 - 0
dist/index.html


File diff suppressed because it is too large
+ 5 - 0
dist/static/css/app.05f6ec5af171392b20daa2046733b9a5.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/app.05f6ec5af171392b20daa2046733b9a5.css.map


BIN
dist/static/fonts/fontawesome-webfont.674f50d.eot


BIN
dist/static/fonts/fontawesome-webfont.af7ae50.woff2


BIN
dist/static/fonts/fontawesome-webfont.b06871f.ttf


BIN
dist/static/fonts/fontawesome-webfont.fee66e7.woff


File diff suppressed because it is too large
+ 2671 - 0
dist/static/img/fontawesome-webfont.912ec66.svg


File diff suppressed because it is too large
+ 2 - 0
dist/static/js/app.6b4200f6b59bcd46c08e.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/app.6b4200f6b59bcd46c08e.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map


File diff suppressed because it is too large
+ 19 - 0
dist/static/js/vendor.ad18a212724a6cceb68f.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/vendor.ad18a212724a6cceb68f.js.map


+ 86 - 0
package - 副本.json

@@ -0,0 +1,86 @@
+{
+  "name": "mobilesalesapp",
+  "version": "1.0.0",
+  "description": "移动销售",
+  "author": "shengxuefei <shengxuefei@365wy.top>",
+  "private": true,
+  "scripts": {
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
+    "start": "npm run dev",
+    "lint": "eslint --ext .js,.vue src",
+    "build": "node build/build.js"
+  },
+  "dependencies": {
+    "axios": "^0.21.1",
+    "css-loader": "^2.0.0",
+    "decimal.js": "^10.2.1",
+    "vant": "^2.12.9",
+    "vue": "^2.5.2",
+    "vue-router": "^3.0.1",
+    "vuex": "^3.6.2"
+  },
+  "devDependencies": {
+    "autoprefixer": "^7.1.2",
+    "babel-core": "^6.22.1",
+    "babel-eslint": "^8.2.1",
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
+    "babel-loader": "^7.1.1",
+    "babel-plugin-import": "^1.13.3",
+    "babel-plugin-syntax-jsx": "^6.18.0",
+    "babel-plugin-transform-runtime": "^6.22.0",
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
+    "babel-preset-env": "^1.3.2",
+    "babel-preset-stage-2": "^6.22.0",
+    "chalk": "^2.0.1",
+    "copy-webpack-plugin": "^4.0.1",
+    "eslint": "^4.15.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-friendly-formatter": "^3.0.0",
+    "eslint-loader": "^1.7.1",
+    "eslint-plugin-import": "^2.7.0",
+    "eslint-plugin-node": "^5.2.0",
+    "eslint-plugin-promise": "^3.4.0",
+    "eslint-plugin-standard": "^3.0.1",
+    "eslint-plugin-vue": "^4.0.0",
+    "extract-text-webpack-plugin": "^3.0.0",
+    "file-loader": "^1.1.4",
+    "font-awesome": "^4.7.0",
+    "friendly-errors-webpack-plugin": "^1.6.1",
+    "html-webpack-plugin": "4.0.0",
+    "less": "^3.13.1",
+    "less-loader": "^5.0.0",
+    "node-notifier": "^5.1.2",
+    "node-sass": "^5.0.0",
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
+    "ora": "^1.2.0",
+    "portfinder": "^1.0.13",
+    "postcss-import": "^11.0.0",
+    "postcss-loader": "^2.0.8",
+    "postcss-url": "^7.2.1",
+    "rimraf": "^2.6.0",
+    "sass": "^1.32.8",
+    "sass-loader": "^7.1.0",
+    "semver": "^5.3.0",
+    "shelljs": "^0.7.6",
+    "style-loader": "1.3.0",
+    "uglifyjs-webpack-plugin": "^1.1.1",
+    "url-loader": "^0.5.8",
+    "vue-loader": "^15.9.2",
+    "vue-style-loader": "^4.1.2",
+    "vue-template-compiler": "^2.5.2",
+    "webpack": "3.12.0",
+    "webpack-bundle-analyzer": "^2.9.0",
+    "webpack-cli": "3.1.2",
+    "webpack-dev-server": "3.1.9",
+    "webpack-merge": "^4.1.0"
+  },
+  "engines": {
+    "node": ">= 6.0.0",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 8"
+  ]
+}

File diff suppressed because it is too large
+ 1056 - 2320
package-lock.json


+ 8 - 10
package.json

@@ -12,7 +12,7 @@
   },
   "dependencies": {
     "axios": "^0.21.1",
-    "css-loader": "^3.5.3",
+    "css-loader": "^3.2.0",
     "decimal.js": "^10.2.1",
     "vant": "^2.12.9",
     "vue": "^2.5.2",
@@ -46,11 +46,10 @@
     "file-loader": "^1.1.4",
     "font-awesome": "^4.7.0",
     "friendly-errors-webpack-plugin": "^1.6.1",
-    "html-webpack-plugin": "^4.3.0",
+    "html-webpack-plugin": "^2.30.1",
     "less": "^3.13.1",
     "less-loader": "^5.0.0",
     "node-notifier": "^5.1.2",
-    "node-sass": "^5.0.0",
     "optimize-css-assets-webpack-plugin": "^3.2.0",
     "ora": "^1.2.0",
     "portfinder": "^1.0.13",
@@ -59,19 +58,18 @@
     "postcss-url": "^7.2.1",
     "rimraf": "^2.6.0",
     "sass": "^1.32.8",
-    "sass-loader": "^9.0.3",
+    "sass-loader": "^7.3.1",
     "semver": "^5.3.0",
     "shelljs": "^0.7.6",
-    "style-loader": "^1.2.1",
+    "style-loader": "^1.0.0",
     "uglifyjs-webpack-plugin": "^1.1.1",
     "url-loader": "^0.5.8",
-    "vue-loader": "^15.9.2",
-    "vue-style-loader": "^4.1.2",
+    "vue-loader": "^14.2.4",
+    "vue-style-loader": "^3.1.2",
     "vue-template-compiler": "^2.5.2",
-    "webpack": "^4.46.0",
+    "webpack": "^3.12.0",
     "webpack-bundle-analyzer": "^2.9.0",
-    "webpack-cli": "^3.3.12",
-    "webpack-dev-server": "^3.11.0",
+    "webpack-dev-server": "^2.11.5",
     "webpack-merge": "^4.1.0"
   },
   "engines": {

+ 4 - 0
src/assets/css/resetvant.css

@@ -0,0 +1,4 @@
+.van-field__label {
+    color: #aaa;
+    font-size: 15px;
+    }

+ 18 - 0
src/common/api/loginApi.js

@@ -184,4 +184,22 @@ export function AddSaClientContact(data) {
     method: 'post',
     data
   })
+}
+
+/* 取访问类型 */
+export function GetVisitTypeList(data) {
+  return request({
+    url: '/GetVisitTypeList',
+    method: 'post',
+    data
+  })
+}
+
+/* 客户修改 */
+export function ModifySaClient(data) {
+  return request({
+    url: '/ModifySaClient',
+    method: 'post',
+    data
+  })
 }

+ 22 - 0
src/common/util.js

@@ -71,4 +71,26 @@ export function persistLogin(_this) {
         //(4)数字0、00等,如果可以只输入0,则需要另外判断。
         return true;
     }
+} 
+/*获取当天日期*/
+export function getCurrentDate(){
+    var nowDate = new Date();
+    var year = nowDate.getFullYear();
+    var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1)
+    : nowDate.getMonth() + 1;
+    var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate
+    .getDate();
+    var dateStr = year + "-" + month + "-" + day;
+    return dateStr;
+} 
+/*获取特定日期*/
+export function getDate(mydate){
+    var nowDate = new Date(mydate);
+    var year = nowDate.getFullYear();
+    var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1)
+    : nowDate.getMonth() + 1;
+    var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate
+    .getDate();
+    var dateStr = year + "-" + month + "-" + day;
+    return dateStr;
 } 

+ 180 - 107
src/components/addsaclientcontact.vue

@@ -17,7 +17,7 @@
       </template>
     </van-nav-bar>
 
-    <van-form @submit="onSubmit">
+    <van-form>
       <van-field
         v-model="name"
         name="客户姓名"
@@ -38,7 +38,7 @@
         <van-picker
           show-toolbar
           title="选择访问类型"
-          value-key="keyValue"
+          value-key="name"
           :columns="visitTypeData"
           @cancel="showVisitType = false"
           @confirm="onConfirm"
@@ -60,6 +60,8 @@
           title="选择年月日"
           :min-date="minDate"
           :max-date="maxDate"
+          @cancel="showVisitDate = false"
+          @confirm="onConfirmVisitDate"
         />
       </van-popup>
       <van-cell
@@ -77,6 +79,8 @@
           title="选择时间"
           :min-hour="10"
           :max-hour="20"
+          @cancel="showTime = false"
+          @confirm="onConfirmVisitTime"
         />
       </van-popup>
       <van-cell
@@ -91,10 +95,9 @@
         <van-picker
           show-toolbar
           title="选择意向强度"
-          value-key="keyValue"
           :columns="intentionData"
           @cancel="showintention = false"
-          @confirm="onConfirmHouse"
+          @confirm="onConfirmIntention"
         />
       </van-popup>
       <van-field
@@ -120,6 +123,8 @@
           title="选择年月日"
           :min-date="minDate"
           :max-date="maxDate"
+          @cancel="showPlanVisitDate = false"
+          @confirm="onConfirmPlanVisitDate"
         />
       </van-popup>
       <van-cell
@@ -137,20 +142,18 @@
           title="选择年月日"
           :min-date="minDate"
           :max-date="maxDate"
+          @cancel="showNextReceiveDate = false"
+          @confirm="onConfirmNextReceiveDate"
         />
       </van-popup>
-      <div style="margin: 16px">
-        <van-button round block type="info" native-type="submit"
-          >提交</van-button
-        >
-      </div>
+      
 
       <van-row class="bottom">
-        <van-col span="12" class="bgGrey">
-          <van-icon name="edit" />{{ completion }}
+        <van-col span="12" class="bgGrey"  @click="cancel">
+          <van-icon name="close" />取消
         </van-col>
-        <van-col span="12" class="bgRed"
-          ><van-icon name="add-o" />新增跟进
+        <van-col span="12" class="bgRed"  @click="save"
+          ><van-icon name="passed" />保存
         </van-col>
       </van-row>
     </van-form>
@@ -159,10 +162,11 @@
 
 <script>
 import {
-  GetSaClientContactList,
-  GetSaClientInfo,
+  GetVisitTypeList,
+  AddSaClientContact 
 } from "@/common/api/loginApi.js";
 import Decimal from "decimal.js";
+import '../assets/css/resetvant.css';
 export default {
   name: "login",
   data() {
@@ -183,13 +187,13 @@ export default {
       minDate: new Date(2005, 0, 1),
       maxDate: new Date(2025, 10, 1),
       currentDate: new Date(),
-      currentTime: "",
+      currentTime: '',
       showTime: false,
-      intentionData: [],
+      intentionData: [0,1,2,3,4,5],
       showPlanVisitDate: false,
-      planVisitDateSel: "",
+      planVisitDateSel: new Date(),
       showNextReceiveDate: false,
-      nextReceiveDateSel: "",
+      nextReceiveDateSel: new Date(),
       showVisitDate: false,
       showintention: false,
     };
@@ -200,37 +204,106 @@ export default {
     this.$util.persistLogin(this);
     this.id = this.$route.query.id;
     this.name = this.$route.query.name;
-
-    //this.GetSaClientInfo();
+    let date=new Date();
+    this.visitDate=this.$util.getCurrentDate();
+    this.currentTime="10:11";
+    console.info('created currentTime',this.currentTime);
+    this.GetVisitTypeList();
   },
   computed: {
     //计算属性
     completion: function () {},
   },
   methods: {
-    //获取客户信息
-    GetSaClientInfo: function () {
-      var that = this;
+    onConfirm: function (item,index) {
+       console.info('onConfirm',item);
+       this.visitType=item.name;
+       this.showVisitType=false;
+    },
+    onConfirmVisitTime:function (time,index) {   //接待时间
+       console.info('onConfirmVisitTime',time);
+       this.visitTime=time;
+       console.info('onConfirmVisitTime visitTime',this.visitTime);
+       this.showTime=false;
+    },
+    onConfirmVisitDate: function (date,index) {  //接待日期
+        console.info('onConfirmVisitDate',date);
+        this.visitDate=this.$util.getDate(date);
+        console.info('onConfirmVisitDate visitDate',this.visitDate);
+        this.showTime=false;
+    },
+    onConfirmIntention:function (value,index) {  //意向强度
+        console.info('onConfirmIntention',value);
+        this.intention=value;
+        console.info('onConfirmIntention intention',this.intention);
+        this.showintention=false;
+    },
+    onConfirmPlanVisitDate:function (date,index) {  //来访计划日期
+        console.info('onConfirmPlanVisitDate',date);
+        this.planVisitDate=this.$util.getDate(date);
+        console.info('onConfirmPlanVisitDate visitDate',this.planVisitDate);
+        this.showPlanVisitDate=false;
+    },
+    onConfirmNextReceiveDate:function (date,index) {  //下次接待日期
+        console.info('onConfirmNextReceiveDate',date);
+        this.nextReceiveDate=this.$util.getDate(date);
+        console.info('onConfirmNextReceiveDate nextReceiveDate',this.nextReceiveDate);
+        this.showNextReceiveDate=false;
+    },
+    onSubmit(values) {
+      //提交表单
+      console.log("submit", values);
+      
+    },
+    GetVisitTypeList:function(){   //取访问类型
+     var that = this;
       var data = {
-        userCode: that.$store.state.data.userCode,
-        projectId: that.$store.state.projectId,
-        clientId: that.id,
+        projectId: that.$store.state.projectId
       };
       console.info("data", data);
-      GetSaClientInfo(data).then((res) => {
-        console.info("GetSaClientInfo", res);
+      GetVisitTypeList(data).then((res)=>{
+         console.info("GetVisitTypeList", res);
         if (!res.result) {
           that.$toast(res.msg);
           return;
         }
-        that.data2 = res.data;
+        res.data.forEach(function(item,index,array) {
+          that.visitTypeData.push(item);
+        });
       });
     },
-    onConfirm: function () {},
-    onConfirmHouse: function () {},
-    onSubmit(values) {
-      //提交表单
-      console.log("submit", values);
+    cancel:function(){
+      this.$router.go(-1);
+    },
+    save:function(){
+      let that=this;
+      let jsonData={
+        visitType:that.visitType,
+        intention:that.intention,
+        remark:that.remark,
+        planVisitDate:that.planVisitDate,
+        nextReceiveDate:that.nextReceiveDate,
+        visitDate:that.visitDate,
+        visitTime:that.visitTime,
+        actionType:''
+      };
+      let data={
+         userCode:that.$store.state.data.userCode,
+         projectId: that.$store.state.projectId,
+         clientId:that.id,
+         jsonData:JSON.stringify(jsonData)
+      };
+      console.info('save',data);
+      AddSaClientContact(data).then((res)=>{
+         console.info('AddSaClientContact',res);
+         that.$dialog.alert({
+            message: res.msg,
+          }).then(() => {
+            // on close
+            that.$router.go(-1);
+          });
+
+      }); 
     },
     onClickLeft() {
       // this.$toast('返回')
@@ -245,80 +318,80 @@ export default {
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped lang = "sass">
-.title1
-  color: #ccc
-  font-size: 15px
-
-  text-align: left
-  height: 30px
-
-.title2
-  color: #ff0000
-  text-align: left
-  font-size: 13px
-
-.infoTitle
-  color: #aaa
-  text-align: left
-
-.value1
-  color: #ff0000
-  font-size: 13px
-
-.infoValue
-  color: #0606af
-
-.size
-  font-size: 16px
-
-.header
-  margin-top: 10px
-  height: 70px
-  border-bottom: #cfcfcf solid 3px
+<style scoped >
 
-.titleClass
-  border-bottom: #000 solid 1px
+.title1{
+  color: #aaa;
+  font-size:15px;
 
-.van-tab
-  color: #ff0000
-
-.redColor
-  color: #ff0000
-
-.bgBlue
-  background: #a0a0f7
-  height: 30px
-  margin-top: 5px
-  padding-top: 5px
-
-.bgBill
-  height: 30px
-  border-bottom: #aaa solid 1px
-  padding-top: 5px
-
-.bottom
+  text-align:left;
+  height:30px;
+}
+.title2{
+  color: #ff0000;
+  text-align:left;
+  font-size: 13px;
+}
+.infoTitle{
+  color: #aaa;
+  text-align: left;
+}
+.value1{
+  color: #000;
+  font-size: 13px;
+}
+.infoValue{
+  color: #0606af;
+}
+.size{
+  font-size: 16px;
+}
+.header{
+  margin-top: 10px;
+  height: 70px;
+  border-bottom: #cfcfcf solid 3px;
+}
+.titleClass{
+  border-bottom: #000 solid 1px;
+}
+.van-tab{
+  color: #ff0000;
+}
+.redColor{
+  color: #ff0000;
+}
+.bgBlue{
+  background: #a0a0f7;
+  height: 30px;
+  margin-top: 5px;
+  padding-top: 5px;
+}
+.bgBill{
+  height: 30px;
+  border-bottom: #aaa solid 1px;
+  padding-top: 5px;
+}
+.bottom{
   /* left:0; */
-  bottom: 0px
-  position: absolute
-  width: 100%
-
-.bgGrey
-  background: #999999
-  height: 35px
-  justify-content: center
-  padding-top: 5px
-
-.bgRed
-  background: #ff0000
-  height: 35px
-  justify-content: center
-  color: #ffffff
-  font-weight: 900
-  padding-top: 5px
-
-/deep/ .van-field__label {
-  color: #ccc
-  font-size: 15px
+  bottom: 0px;
+  position: absolute;
+  width: 100%;
+}
+.bgGrey{
+  background: #999999;
+  height: 35px;
+  justify-content: center;
+  padding-top: 5px;
+}
+.bgRed{
+  background: #ff0000;
+  height: 35px;
+  justify-content: center;
+  color: #ffffff;
+  font-weight: 900;
+  padding-top: 5px;
+}
+ 
 </style>
+
  

+ 8 - 1
src/components/getsaclientcontactinfo.vue

@@ -25,7 +25,7 @@
         </van-col>
       </van-row>
      <van-row style="border-bottom: #efefef solid 3px;">
-        <van-col span="24" style="text-align:left;margin-left:15px;" >
+        <van-col span="24" class="remark">
                 {{data.Remark}}
         </van-col>
       </van-row>
@@ -162,4 +162,11 @@ export default {
     font-size:16px;
     color:orange;
 }
+.remark{
+  text-align:left;
+  padding-left:15px;
+  padding-right:15px;
+  line-height:25px;
+  justify-content: space-between;
+}
 </style>

+ 440 - 0
src/components/saclientmodify.vue

@@ -0,0 +1,440 @@
+<template>
+  <div>
+    <van-nav-bar
+      @click-left="onClickLeft"
+      @click-right="onClickRight"
+      style="background-color: #1989fa"
+    >
+      <template #title>
+        <van-col style="color: #ffffff">编辑客户信息</van-col>
+      </template>
+      <template #left>
+        <i
+          class="fa fa-arrow-circle-left"
+          aria-hidden="true"
+          style="color: #ffffff; font-size: 18px"
+        ></i>
+      </template>
+    </van-nav-bar>
+
+    <van-form>
+      <van-field
+        v-model="name"
+        name="姓名"
+        label="姓名"
+        placeholder="请输入"
+        readonly
+        input-align="right"
+      />
+      <van-cell
+        title="手机"
+        :value="phone"
+        is-link
+        title-class="title1"
+        value-class="value1"
+      ></van-cell>
+      
+
+      <van-cell
+        title="性别"
+        :value="sex"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showSex = true"
+      ></van-cell>
+      <van-popup v-model="showSex" round position="bottom">
+         <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="sexData"
+          @cancel="showSex = false"
+          @confirm="onConfirmSex"
+        />
+      </van-popup>
+      <van-cell
+        title="国籍"
+        :value="nationality"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showTime = true"
+      ></van-cell>
+      <van-popup v-model="showNationality" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="nationalityData"
+          @cancel="showNationality = false"
+          @confirm="onConfirmNationality"
+        />
+      </van-popup>
+      <van-cell
+        title="证件类型"
+        :value="credentialsType"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showCredentialsType = true"
+      ></van-cell>
+      <van-popup v-model="showCredentialsType" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="credentialsTypeData"
+          @cancel="showCredentialsType = false"
+          @confirm="onConfirmCredentialsType"
+        />
+      </van-popup>
+      <van-field
+        v-model="CredentialsId"
+        name="证件号"
+        label="证件号"
+        placeholder="请输入"       
+        input-align="right"
+      />
+      <van-cell
+        title="出生日期"
+        :value="birth"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showBirth = true"
+      ></van-cell>
+      <van-popup v-model="showBirth" round position="bottom">
+        <van-datetime-picker
+          v-model="birthSel"
+          type="date"
+          title="选择年月日"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showBirth = false"
+          @confirm="onConfirmBirth"
+        />
+      </van-popup>
+      <van-cell
+        title="婚姻状况"
+        :value="marry"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showMarry = true"
+      ></van-cell>
+      <van-popup v-model="showMarry" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="marryData"
+          @cancel="showMarry = false"
+          @confirm="onConfirmMarry"
+        />
+      </van-popup>
+      <van-field
+        v-model="household"
+        name="户籍"
+        label="户籍"
+        placeholder="请输入"       
+        input-align="right"
+      />
+      <van-field
+        v-model="address"
+        rows="1"
+        autosize
+        label="联系地址"
+        type="textarea"
+        placeholder="请输入"
+      />
+      <van-field
+        v-model="post"
+        name="邮编"
+        label="邮编"
+        placeholder="请输入"       
+        input-align="right"
+      />
+      <van-field
+        v-model="fax"
+        name="传真"
+        label="传真"
+        placeholder="请输入"       
+        input-align="right"
+      />
+      <van-field
+        v-model="email"
+        name="电子邮箱"
+        label="电子邮箱"
+        placeholder="请输入"       
+        input-align="right"
+      />
+      <van-cell
+        title="认知途径"
+        :value="cognizeWay"
+        is-link
+        title-class="title1"
+        value-class="value1"
+        @click="showCognizeWay = true"
+      ></van-cell>
+      <van-popup v-model="showCognizeWay" round position="bottom">
+        <van-picker
+          show-toolbar
+          title="请选择"
+          :columns="cognizeWayData"
+          @cancel="showCognizeWay = false"
+          @confirm="onConfirmCognizeWay"
+        />
+      </van-popup>
+      <van-field
+        v-model="remark"
+        rows="1"
+        autosize
+        label="备注"
+        type="textarea"
+        placeholder="请输入"
+      />
+
+      <van-row class="bottom">
+        <van-col span="12" class="bgGrey"  @click="cancel">
+          <van-icon name="close" />取消
+        </van-col>
+        <van-col span="12" class="bgRed"  @click="save"
+          ><van-icon name="passed" />保存
+        </van-col>
+      </van-row>
+    </van-form>
+  </div>
+</template>
+
+<script>
+import {
+  GetVisitTypeList,
+  AddSaClientContact 
+} from "@/common/api/loginApi.js";
+import Decimal from "decimal.js";
+import '../assets/css/resetvant.css';
+export default {
+  name: "login",
+  data() {
+    return {
+      id: "",
+      name: "",
+      visitType: "", //访问类型
+      showVisitType: false,
+      remark: "", //接待信息
+      intention: "", //意向强度
+      planVisitDate: "", //来访计划日期
+      nextReceiveDate: "", //下次接待日期
+      visitDate: "", //接待日期
+      visitTime: "", //接待时间
+      actionType: "",
+
+      visitTypeData: [], //访问类型数组
+      minDate: new Date(2005, 0, 1),
+      maxDate: new Date(2025, 10, 1),
+      currentDate: new Date(),
+      currentTime: '',
+      showTime: false,
+      intentionData: [0,1,2,3,4,5],
+      showPlanVisitDate: false,
+      planVisitDateSel: new Date(),
+      showNextReceiveDate: false,
+      nextReceiveDateSel: new Date(),
+      showVisitDate: false,
+      showintention: false,
+    };
+  },
+  created: function () {
+    console.info("created");
+    //console.info(this.$util);
+    this.$util.persistLogin(this);
+    this.id = this.$route.query.id;
+    this.name = this.$route.query.name;
+    let date=new Date();
+    this.visitDate=this.$util.getCurrentDate();
+    this.currentTime="10:11";
+    console.info('created currentTime',this.currentTime);
+    this.GetVisitTypeList();
+  },
+  computed: {
+    //计算属性
+    completion: function () {},
+  },
+  methods: {
+    onConfirm: function (item,index) {
+       console.info('onConfirm',item);
+       this.visitType=item.name;
+       this.showVisitType=false;
+    },
+    onConfirmVisitTime:function (time,index) {   //接待时间
+       console.info('onConfirmVisitTime',time);
+       this.visitTime=time;
+       console.info('onConfirmVisitTime visitTime',this.visitTime);
+       this.showTime=false;
+    },
+    onConfirmVisitDate: function (date,index) {  //接待日期
+        console.info('onConfirmVisitDate',date);
+        this.visitDate=this.$util.getDate(date);
+        console.info('onConfirmVisitDate visitDate',this.visitDate);
+        this.showTime=false;
+    },
+    onConfirmIntention:function (value,index) {  //意向强度
+        console.info('onConfirmIntention',value);
+        this.intention=value;
+        console.info('onConfirmIntention intention',this.intention);
+        this.showintention=false;
+    },
+    onConfirmPlanVisitDate:function (date,index) {  //来访计划日期
+        console.info('onConfirmPlanVisitDate',date);
+        this.planVisitDate=this.$util.getDate(date);
+        console.info('onConfirmPlanVisitDate visitDate',this.planVisitDate);
+        this.showPlanVisitDate=false;
+    },
+    onConfirmNextReceiveDate:function (date,index) {  //下次接待日期
+        console.info('onConfirmNextReceiveDate',date);
+        this.nextReceiveDate=this.$util.getDate(date);
+        console.info('onConfirmNextReceiveDate nextReceiveDate',this.nextReceiveDate);
+        this.showNextReceiveDate=false;
+    },
+    onSubmit(values) {
+      //提交表单
+      console.log("submit", values);
+      
+    },
+    GetVisitTypeList:function(){   //取访问类型
+     var that = this;
+      var data = {
+        projectId: that.$store.state.projectId
+      };
+      console.info("data", data);
+      GetVisitTypeList(data).then((res)=>{
+         console.info("GetVisitTypeList", res);
+        if (!res.result) {
+          that.$toast(res.msg);
+          return;
+        }
+        res.data.forEach(function(item,index,array) {
+          that.visitTypeData.push(item);
+        });
+      });
+    },
+    cancel:function(){
+      this.$router.go(-1);
+    },
+    save:function(){
+      let that=this;
+      let jsonData={
+        visitType:that.visitType,
+        intention:that.intention,
+        remark:that.remark,
+        planVisitDate:that.planVisitDate,
+        nextReceiveDate:that.nextReceiveDate,
+        visitDate:that.visitDate,
+        visitTime:that.visitTime,
+        actionType:''
+      };
+      let data={
+         userCode:that.$store.state.data.userCode,
+         projectId: that.$store.state.projectId,
+         clientId:that.id,
+         jsonData:JSON.stringify(jsonData)
+      };
+      console.info('save',data);
+      AddSaClientContact(data).then((res)=>{
+         console.info('AddSaClientContact',res);
+         that.$dialog.alert({
+            message: res.msg,
+          }).then(() => {
+            // on close
+            that.$router.go(-1);
+          });
+
+      }); 
+    },
+    onClickLeft() {
+      // this.$toast('返回')
+      console.info("left");
+      this.$router.go(-1);
+    },
+    onClickRight() {
+      this.$router.go(0);
+    },
+  },
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped >
+
+.title1{
+  color: #aaa;
+  font-size:15px;
+
+  text-align:left;
+  height:30px;
+}
+.title2{
+  color: #ff0000;
+  text-align:left;
+  font-size: 13px;
+}
+.infoTitle{
+  color: #aaa;
+  text-align: left;
+}
+.value1{
+  color: #000;
+  font-size: 13px;
+}
+.infoValue{
+  color: #0606af;
+}
+.size{
+  font-size: 16px;
+}
+.header{
+  margin-top: 10px;
+  height: 70px;
+  border-bottom: #cfcfcf solid 3px;
+}
+.titleClass{
+  border-bottom: #000 solid 1px;
+}
+.van-tab{
+  color: #ff0000;
+}
+.redColor{
+  color: #ff0000;
+}
+.bgBlue{
+  background: #a0a0f7;
+  height: 30px;
+  margin-top: 5px;
+  padding-top: 5px;
+}
+.bgBill{
+  height: 30px;
+  border-bottom: #aaa solid 1px;
+  padding-top: 5px;
+}
+.bottom{
+  /* left:0; */
+  bottom: 0px;
+  position: absolute;
+  width: 100%;
+}
+.bgGrey{
+  background: #999999;
+  height: 35px;
+  justify-content: center;
+  padding-top: 5px;
+}
+.bgRed{
+  background: #ff0000;
+  height: 35px;
+  justify-content: center;
+  color: #ffffff;
+  font-weight: 900;
+  padding-top: 5px;
+}
+ 
+</style>
+
+ 

+ 2 - 0
src/main.js

@@ -19,6 +19,7 @@ import {
 // 引入全局css
 import './assets/css/index.css'
 import 'font-awesome/css/font-awesome.min.css'
+
 // 引入全部样式
 //import '!less-loader!vant/lib/index.less';
 
@@ -52,6 +53,7 @@ Vue.use(Button)
   .use(Tabs)
   .use(Calendar)
   .use(DatetimePicker)
+  
 
 /* eslint-disable no-new */
 new Vue({

+ 6 - 0
src/router/index.js

@@ -20,6 +20,7 @@ import filterhouse from '@/components/filterhouse'
 import getsaroomlist from '@/components/getsaroomlist'
 import clientdetail from '@/components/clientdetail'
 import addsaclientcontact from '@/components/addsaclientcontact'
+import saclientmodify from '@/components/saclientmodify'
 Vue.use(Router)
 
 export default new Router({
@@ -124,5 +125,10 @@ export default new Router({
       name: 'addsaclientcontact',
       component: addsaclientcontact
     },
+    {     //客户修改
+      path: '/saclientmodify',
+      name: 'saclientmodify',
+      component: saclientmodify
+    },
   ]
 })