Quellcode durchsuchen

Merge branch 'Test' into 'master'

Test

See merge request crowd-2019/crowd-test-service-front!16
薛晓波 vor 6 Jahren
Ursprung
Commit
78c094056c

+ 2 - 2
config/prod.env.js

@@ -1,6 +1,6 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  API_ROOT: '"//www.callfortest.com"',
-  LOGIN_URL:'"http://user.callfortest.com/page/login?redirect=http%3a%2f%2fwww.callfortest.com%2f%23%2fmine"'
+  API_ROOT: '"//www.cofortest.com"',
+  LOGIN_URL:'"http://user.cofortest.com/page/login?redirect=http%3a%2f%2fwww.cofortest.com%2f%23%2fmine"'
 }

+ 6 - 0
config/test.env.js

@@ -0,0 +1,6 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"',
+  API_ROOT: '"//crowd.mooctest.net"',
+  LOGIN_URL:'"http://user.mooctest.net:8081/page/login?redirect=http%3a%2f%2fcrowd.mooctest.net%2f%23%2fmine"'
+}

+ 11 - 11
package-lock.json

@@ -265,7 +265,7 @@
     },
     "alphanum-sort": {
       "version": "1.0.2",
-      "resolved": "http://registry.npm.taobao.org/alphanum-sort/download/alphanum-sort-1.0.2.tgz",
+      "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz",
       "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
       "dev": true
     },
@@ -550,7 +550,7 @@
     },
     "axios": {
       "version": "0.19.0",
-      "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.19.0.tgz",
       "integrity": "sha1-jgm/89kSLhM/e4EByPvdAO09Krg=",
       "requires": {
         "follow-redirects": "1.5.10",
@@ -559,7 +559,7 @@
       "dependencies": {
         "debug": {
           "version": "3.1.0",
-          "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
+          "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
           "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
           "requires": {
             "ms": "2.0.0"
@@ -567,7 +567,7 @@
         },
         "follow-redirects": {
           "version": "1.5.10",
-          "resolved": "http://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
+          "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
           "integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
           "requires": {
             "debug": "=3.1.0"
@@ -575,7 +575,7 @@
         },
         "is-buffer": {
           "version": "2.0.3",
-          "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
+          "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
           "integrity": "sha1-Ts8/z3ScvR5HJonhCaxmJhol5yU="
         }
       }
@@ -2493,7 +2493,7 @@
     },
     "css-color-names": {
       "version": "0.0.4",
-      "resolved": "http://registry.npm.taobao.org/css-color-names/download/css-color-names-0.0.4.tgz",
+      "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
       "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=",
       "dev": true
     },
@@ -5755,7 +5755,7 @@
     },
     "is-absolute-url": {
       "version": "2.1.0",
-      "resolved": "https://registry.npm.taobao.org/is-absolute-url/download/is-absolute-url-2.1.0.tgz?cache=0&sync_timestamp=1568347933983&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-absolute-url%2Fdownload%2Fis-absolute-url-2.1.0.tgz",
+      "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz",
       "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=",
       "dev": true
     },
@@ -6351,7 +6351,7 @@
     },
     "lodash.memoize": {
       "version": "4.1.2",
-      "resolved": "http://registry.npm.taobao.org/lodash.memoize/download/lodash.memoize-4.1.2.tgz",
+      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
       "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=",
       "dev": true
     },
@@ -6363,7 +6363,7 @@
     },
     "lodash.uniq": {
       "version": "4.5.0",
-      "resolved": "http://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz",
+      "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
       "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=",
       "dev": true
     },
@@ -9122,7 +9122,7 @@
     },
     "q": {
       "version": "1.5.1",
-      "resolved": "http://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
+      "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
       "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
       "dev": true
     },
@@ -11077,7 +11077,7 @@
     },
     "uniqs": {
       "version": "2.0.0",
-      "resolved": "http://registry.npm.taobao.org/uniqs/download/uniqs-2.0.0.tgz",
+      "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz",
       "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=",
       "dev": true
     },

+ 16 - 16
src/components/Home.vue

@@ -21,9 +21,9 @@
               <span style="font-size: 30px;color: white"><i class="el-icon-user"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px; color: white;">{{systemStatistics[0].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px; color: white;">{{systemStatistics[0].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px; color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px; color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[0].name}}</el-link></span>
               </el-col>
@@ -36,9 +36,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-setting"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[1].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[1].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[1].name}}</el-link></span>
               </el-col>
@@ -52,9 +52,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-user-solid"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[2].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[2].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[2].name}}</el-link></span>
               </el-col>
@@ -67,9 +67,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-cpu"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[3].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[3].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[3].name}}</el-link></span>
               </el-col>
@@ -84,9 +84,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-coin"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[4].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[4].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[4].name}}</el-link></span>
               </el-col>
@@ -99,9 +99,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-bank-card"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[5].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[5].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[5].name}}</el-link></span>
               </el-col>
@@ -115,9 +115,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-notebook-1"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[6].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[6].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[6].name}}</el-link></span>
               </el-col>
@@ -130,9 +130,9 @@
               <span style="font-size: 30px;color: white;"><i class="el-icon-notebook-2"></i></span>
             </div>
             <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
-              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px;color: white;">{{systemStatistics[7].value}}</span>
+              <el-col :span="18" type="flex" align="middle" justify="start" style="text-align: right"><span style="font-size: 50px;color: white;">{{systemStatistics[7].value}}</span>
               </el-col>
-              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 16px;color: white;"
+              <el-col :span="20" type="flex" align="bottom" justify="end" style="text-align: left;padding-left: 20px"><span> <el-link style="font-size: 16px;color: white;"
                                                                                           type="success"
                                                                                           :underline="false">{{systemStatistics[7].name}}</el-link></span>
               </el-col>

+ 31 - 3
src/components/authen/AgencyAuthentication.vue

@@ -145,6 +145,7 @@ export default {
         ],
         bankAccount: [
           {required: true, message: '请输入银行卡账户', trigger: 'blur'},
+          {min: 16, max: 19, message: '银行卡账户输入有误', trigger: 'blur'},
           {
             validator: (rule, value, callback) => {
               if (!this.checkNumber(value)) {
@@ -307,7 +308,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -318,13 +337,22 @@ export default {
       }
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
-        console.log('上传成功')
+        this.hideLoading()
         this.authentication.agencyPhoto = res.data
         console.log(res.data)
         notify('success', '上传成功')
         this.$refs['authentication'].validateField('agencyPhoto');
       }).catch(error => {
-        notify('error', error.data)
+        this.hideLoading()
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //设置服务类型

+ 29 - 2
src/components/authen/AgencyAuthenticationCreate.vue

@@ -127,6 +127,7 @@ export default {
         ],
         bankAccount: [
           {required: true, message: '请输入银行卡账户', trigger: 'blur'},
+          {min: 16, max: 19, message: '银行卡账户输入有误', trigger: 'blur'},
           {
             validator: (rule, value, callback) => {
               if (!this.checkNumber(value)) {
@@ -276,7 +277,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -295,7 +314,15 @@ export default {
         this.$refs['authentication'].validateField('agencyPhoto');
       }).catch(error => {
         this.hideLoading()
-        notify('error', error.data)
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //设置服务类型

+ 30 - 3
src/components/authen/EnterpriseAuthentication.vue

@@ -123,6 +123,7 @@ export default {
             ],
             bankAccount: [
                 {required: true, message: '请输入对公账户', trigger: 'blur'},
+                {min: 16, max: 19, message: '对公账户输入有误', trigger: 'blur'},
                 {
                     validator: (rule, value, callback) => {
                         if (!this.checkNumber(value)) {
@@ -259,7 +260,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -277,8 +296,16 @@ export default {
         console.log(res.data)
         notify('success', '上传成功')
       }).catch(error => {
-        this.hideLoading();
-        notify('error', error.data)
+        this.hideLoading()
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //

+ 29 - 2
src/components/authen/EnterpriseAuthenticationCreate.vue

@@ -104,6 +104,7 @@ export default {
         ],
         bankAccount: [
           {required: true, message: '请输入对公账户', trigger: 'blur'},
+          {min: 16, max: 19, message: '对公账户输入有误', trigger: 'blur'},
           {
             validator: (rule, value, callback) => {
               if (!this.checkNumber(value)) {
@@ -230,7 +231,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -250,7 +269,15 @@ export default {
         this.$refs['authentication'].validateField('businessLicensePhoto')
       }).catch(error => {
         this.hideLoading()
-        notify('error', error.data)
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //

+ 29 - 2
src/components/authen/IndividualAuthentication.vue

@@ -119,6 +119,7 @@ export default {
         ],
         bankAccount: [
           {required: true, message: '请输入银行卡账户', trigger: 'blur'},
+          {min: 16, max: 19, message: '银行卡账户输入有误', trigger: 'blur'},
           {
               validator: (rule, value, callback) => {
                   if (!this.checkNumber(value)) {
@@ -249,7 +250,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -270,7 +289,15 @@ export default {
 
       }).catch(error => {
         this.hideLoading()
-        notify('error', error.data)
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //

+ 30 - 4
src/components/authen/IndividualAuthenticationCreate.vue

@@ -12,6 +12,7 @@
             class="avatar-uploader"
             action=""
             :show-file-list="false"
+            accept=".jpg,.png"
             :http-request="uploadFile"
             :before-upload="beforeFileUpload">
             <img v-if="authentication.IDCardPhoto" :src="authentication.IDCardPhoto" class="avatar">
@@ -104,6 +105,7 @@ export default {
         ],
         bankAccount: [
           {required: true, message: '请输入银行卡账户', trigger: 'blur'},
+          {min: 16, max: 19, message: '银行卡账户输入有误', trigger: 'blur'},
           {
               validator: (rule, value, callback) => {
                   if (!this.checkNumber(value)) {
@@ -209,7 +211,25 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     //文件上传前的响应函数
-    beforeFileUpload () {
+    beforeFileUpload (file) {
+      // 文件大小不能超过10M
+      if (file.size > 10 * 1000 * 1000){
+        notify('error', '单个文件大小不能超过10M')
+        return false;
+      }
+      let fileName = file.name
+      let index = fileName.lastIndexOf('.');
+      // 文件不能没有后缀
+      if (index <= 0){
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
+      let fileSuffix = fileName.substr(index)
+      // 文件后缀必须是.png或者.jpg
+      if (fileSuffix !== '.jpg' && fileSuffix !== '.png') {
+        notify('error', '只能上传png/jpg格式的文件')
+        return false;
+      }
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
@@ -222,14 +242,20 @@ export default {
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         this.hideLoading()
-        console.log('上传成功')
         this.authentication.IDCardPhoto = res.data
-        console.log(res.data)
         notify('success', '上传成功')
         this.$refs['authentication'].validateField('IDCardPhoto');
       }).catch(error => {
         this.hideLoading()
-        notify('error', error.data)
+        try {
+          if (error.response.status === 413){
+            notify('error', '文件过大,请选择小于20M的图片')
+          }else if (error.response.status === 500){
+            notify('error', '上传文件发生错误,请稍后重试')
+          }
+        }catch (e) {
+          notify('error', error.data)
+        }
       })
     },
     //

+ 2 - 2
src/components/commons/Footer.vue

@@ -25,8 +25,8 @@
         </ul>
       </nav>
       <div class="copyright pull-right">
-        ©{{time}} 慕测  
-        <a target="_blank" href="http://www.miibeian.gov.cn">  苏ICP备14002894号-3</a>
+        ©{{time}} 慕测
+        <a target="_blank" href="http://www.miibeian.gov.cn">  粤ICP备09019504号-6</a>
       </div>
     </div>
   </div>

+ 35 - 8
src/components/project/Project.vue

@@ -284,7 +284,8 @@ import {
   receiveProjectRequest,
   rejectProject,
   storageGet,
-  submitProjectRequest
+  submitProjectRequest,
+  deleteTask
 } from '@/js/index'
 
 export default {
@@ -348,6 +349,9 @@ export default {
       progress: [],
       reportList: [],
       pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() <= Date.now();
+        },
         shortcuts: [
           {
             text: '今天',
@@ -356,18 +360,18 @@ export default {
             }
           },
           {
-            text: '天',
+            text: '天',
             onClick (picker) {
               const date = new Date()
-              date.setTime(date.getTime() - 3600 * 1000 * 24)
+              date.setTime(date.getTime() + 3600 * 1000 * 24)
               picker.$emit('pick', date)
             }
           },
           {
-            text: '一周',
+            text: '一周',
             onClick (picker) {
               const date = new Date()
-              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+              date.setTime(date.getTime() + 3600 * 1000 * 24 * 7)
               picker.$emit('pick', date)
             }
           }
@@ -384,7 +388,16 @@ export default {
         ],
         contactPhone: [
           {required: true, message: '请输入手机号', trigger: 'blur'},
-          //{min: 11, max: 11, message: '请输入正确的手机号', trigger: 'blur'}
+          {min: 11, max: 11, message: '请输入正确的手机号', trigger: 'blur'},
+          {
+            validator: (rule, value, callback) => {
+              if (!this.checkPhoneNumber(value)) {
+                callback(new Error('手机号输入有误'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur'
+          },
         ],
         type: [
           {
@@ -565,7 +578,6 @@ export default {
             usage: this.project.usage,
           }
           Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
-            console.log('bb')
             console.log(res)
             this.projectId = res.projectDetails.id
             this.project.name = res.projectDetails.name
@@ -752,13 +764,23 @@ export default {
       this.$confirm('确认删除该任务?')
         .then(_ => {
           //done()
-          notify('success', '删除成功')
+          //id->taskid
+          console.log(id)
+          console.log(this.projectId)
+          //deleteTask(this.projectId,id,this.deleteTaskSuccess,this.deleteTaskFail)
         })
         .catch(_ => {
           notify('error', '删除失败')
         })
       //this.task.splice(index, 1)
     },
+    deleteTaskSuccess(res){
+      notify('success', '删除成功')
+    },
+    deleteTaskFail(error){
+      console.log(error)
+      notify('error', '删除失败:'+error)
+    },
     beforeApkUpload (file) {
       const isAPK = file.type === 'application/vnd.android.package-archive'
       const isDMG = file.type === 'application/octet-stream'
@@ -868,6 +890,7 @@ export default {
         notify('success', '需求文档上传成功')
       }).catch((error) => {
         this.hideLoading()
+        this.project.doc = []
         notify('error', '需求文档上传失败:' + error.data)
       })
     },
@@ -885,6 +908,7 @@ export default {
         notify('success', '文件上传成功')
       }).catch((error) => {
         this.hideLoading()
+        this.project.file = []
         notify('error', '文件上传失败')
       })
     },
@@ -908,6 +932,9 @@ export default {
     setUserInfo () {
       this.user = storageGet('user')
     },
+    checkPhoneNumber(phoneNumber){
+      return /^1[3456789]\d{9}$/.test(phoneNumber)
+    },
     showLoading () {
       this.loading = true
     },

+ 24 - 5
src/components/project/ProjectCreate.vue

@@ -188,6 +188,9 @@ export default {
         budget: ''
       },
       pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() <= Date.now();
+        },
         shortcuts: [
           {
             text: '今天',
@@ -196,18 +199,18 @@ export default {
             }
           },
           {
-            text: '天',
+            text: '天',
             onClick (picker) {
               const date = new Date()
-              date.setTime(date.getTime() - 3600 * 1000 * 24)
+              date.setTime(date.getTime() + 3600 * 1000 * 24)
               picker.$emit('pick', date)
             }
           },
           {
-            text: '一周',
+            text: '一周',
             onClick (picker) {
               const date = new Date()
-              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+              date.setTime(date.getTime() + 3600 * 1000 * 24 * 7)
               picker.$emit('pick', date)
             }
           }
@@ -224,7 +227,16 @@ export default {
         ],
         contactPhone: [
           {required: true, message: '请输入手机号', trigger: 'blur'},
-          //{min: 11, max: 11, message: '请输入正确的手机号', trigger: 'blur'}
+          {min: 11, max: 11, message: '请输入正确的手机号', trigger: 'blur'},
+          {
+            validator: (rule, value, callback) => {
+              if (!this.checkPhoneNumber(value)) {
+                callback(new Error('手机号输入有误'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur'
+          },
         ],
         type: [
           {
@@ -371,11 +383,13 @@ export default {
             // }
           }).catch(error => {
             //console.log(error)
+            this.hideLoading()
             notify('error', error.data)
 
           })
         } else {
           console.log(valid)
+          this.hideLoading()
           notify('error','表单填写错误!')
           return false
         }
@@ -448,6 +462,7 @@ export default {
         //console.log(res.data)
       }).catch((error) => {
         this.hideLoading()
+        this.project.doc = []
         notify('error', '需求文档上传失败:' + error.data)
       })
 
@@ -467,6 +482,7 @@ export default {
         console.log(res)
       }).catch((error) => {
         this.hideLoading()
+        this.project.file = []
         notify('error', '文件上传失败:' + error.data)
       })
     },
@@ -499,6 +515,9 @@ export default {
         }
       })
     },
+    checkPhoneNumber(phoneNumber){
+      return /^1[3456789]\d{9}$/.test(phoneNumber)
+    },
     showLoading () {
       this.loading = true
     },