347617796@qq.com пре 3 година
родитељ
комит
6eacddb17c
6 измењених фајлова са 144 додато и 47 уклоњено
  1. 2 2
      src/api/axios.js
  2. 0 19
      src/hint.vue
  3. 1 1
      src/main.js
  4. 10 0
      src/router/index.js
  5. 90 0
      src/views/set/buy.vue
  6. 41 25
      src/views/set/log.vue

+ 2 - 2
src/api/axios.js

@@ -9,7 +9,7 @@ import qs from 'qs'
 const service = axios.create({
 	baseURL: process.env.VUE_APP_BASE_API, 
 	// baseURL:'https://ding.insys.g107.com/',
-	timeout: 2000,
+	timeout: 20000,
 	headers: {
 		'Content-Type': 'application/x-www-form-urlencoded',
 	},
@@ -82,7 +82,7 @@ service.interceptors.response.use(
 			// })
 			console.log('网络异常,请检查网络是否畅通,再重新进入应用')
 			return Promise.reject(error.message)
-		}else if(error.message=='timeout of 2000ms exceeded'){
+		}else if(error.message=='timeout of 20000ms exceeded'){
 			if(url=='/api/integral/review/a/entry'||url=='/api/integral/point/entry'){
 				let sum=0;
 				if(data){

+ 0 - 19
src/hint.vue

@@ -23,7 +23,6 @@ export default {
 		};
 	},
 	created() {
-		console.log(this.IsPC())
 		this.width = document.body.clientWidth + 'px';
 	},
 	mounted() {
@@ -45,24 +44,6 @@ export default {
 		}
 	},
 	methods: {
-		getSku() {
-			var that = this;
-			// this.$axios('get', 'api/order/goods/sku', { callback: 'https://test-ding.g107.com/#/index', goods_code: 'DT_GOODS_881607043109331' }).then(res => {});
-			this.$dd.biz.util.openSlidePanel({
-			    url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7', //打开侧边栏的url
-			    title: 'title', //侧边栏顶部标题
-			    onSuccess : function(result) {
-			       /*
-			            调用biz.navigation.quit接口进入onSuccess, result为调用biz.navigation.quit传入的数值
-			        */
-			    },
-			    onFail : function() {
-			        /*
-			            tips:点击右上角上角关闭按钮会进入onFail
-			         */
-			    }
-			})
-		},
 		IsPC() {
 		    var userAgentInfo = navigator.userAgent;
 		    var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];

+ 1 - 1
src/main.js

@@ -21,7 +21,7 @@ import userImage from '@/components/UserImage'
 Vue.component('userImage', userImage)
 Vue.use(ElementUI);
 if (process.env.NODE_ENV === 'development') {
-  // new VConsole()
+  new VConsole()
 }
 
 Vue.prototype.$echarts = echarts

+ 10 - 0
src/router/index.js

@@ -279,6 +279,16 @@ const routes = [{
 					jurisdiction: ['dept_manager', 'employee']
 				}
 			},
+			{
+				path: '/buy',
+				name: '内购',
+				component: () => import( /* webpackChunkName: "buy" */ '@/views/set/buy.vue'),
+				meta: {
+					icon: 'icon-shezhi_xitongpeizhi',
+					groupCode: 'set',
+					jurisdiction: ['dept_manager', 'employee']
+				}
+			},
 			{
 				path: '/update_notice',
 				name: '公告列表',

+ 90 - 0
src/views/set/buy.vue

@@ -0,0 +1,90 @@
+<template>
+	<div class="all">
+		<div style="margin-bottom: 30px;">
+				<div class="initia_title">工作日志积分</div>
+				<div class="initia_title_1">
+					1、启用后,在钉钉发布工作日志,系统自动按“日志积分规则”奖分
+					<br />
+					2、日志名称必须与“钉钉日志模板名称”一致,否则奖分不会生效
+					<br />
+					3、日志支持每月、每周、每次汇报,可自行根据需要设置“日志积分规则
+				</div>
+				<div class="flex-box-end" style="margin-top: 20px;">
+					<el-button size="small" plain @click="add()">购买</el-button>
+				</div>
+			</div>
+	</div>
+</template>
+
+<script>
+import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
+export default {
+	data() {
+		return {
+			loading: false,
+		};
+	},
+	watch:{
+	},
+	mounted() {
+		this.init();
+	},
+	methods: {
+		init() {
+			this.$dd.biz.util.openSlidePanel({
+			    url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7', //打开侧边栏的url
+			    title: 'title', //侧边栏顶部标题
+			    onSuccess : function(result) {
+
+			    },
+			    onFail : function() {
+
+			    }
+			})
+		 },
+		 add(){
+			this.$axios('get', 'api/order/goods/sku', { callback: 'https://test-ding.g107.com/#/index', goods_code: 'DT_GOODS_881607043109331' }).then(res => {
+				
+			});
+		 }
+	}
+};
+</script>
+<style scoped lang="scss">
+.all{
+	padding: 20px;
+}
+.widthInput {
+	width: 150px;
+}
+.title {
+	margin: 10px 0;
+	margin-top: 0;
+	font-size: 14px;
+	font-weight: 700;
+	padding-left: 13px;
+}
+.initia_title {
+	font-size: 20px;
+	color: rgba(48, 49, 51, 1);
+	font-family: PingFangSC-Regular;
+}
+.initia_title_1 {
+	color: #e6a23c;
+	font-size: 14px;
+	margin-top: 10px;
+}
+.lookQrcode {
+	color: #606266;
+	cursor: pointer;
+	transition: all 0.3s;
+	font-weight: 700;
+}
+.lookQrcode:hover {
+	color: #2490fd;
+}
+.name {
+	max-width: 200px;
+	margin-right: 10px;
+}
+</style>

+ 41 - 25
src/views/set/log.vue

@@ -10,7 +10,7 @@
 					<br />
 					3、日志支持每月、每周、每次汇报,可自行根据需要设置“日志积分规则
 				</div>
-				<div class="flex-box-end" style="margin-top: 20px;">
+				<div class="flex-box-end" style="margin-top: 20px;">	
 					<el-button size="small" plain @click="add()">添加日志模板</el-button>
 				</div>
 			</div>
@@ -31,6 +31,7 @@
 				<el-table-column label="操作">
 					<template slot-scope="scope">
 						<div class="flex-box-ce">
+							<div class="blue" @click="refresh(scope.row)" style="margin-right: 10px;cursor: pointer;">刷新汇报记录</div>
 							<div @click.stop="openSet(scope.row)" style="margin-right: 10px;"><span class="lookQrcode">编辑</span></div>
 							<div @click.stop="deleteSet(scope.row)"><span class="lookQrcode red">删除</span></div>
 						</div>
@@ -38,7 +39,10 @@
 				</el-table-column>
 				<template slot="empty">
 					<noData :isSolt="true">
-						<div>您当前没有日志模板,去添加<span style="cursor: pointer;margin-left: 10px;" @click="add()" class="blue">添加</span></div>
+						<div>
+							您当前没有日志模板,去添加
+							<span style="cursor: pointer;margin-left: 10px;" @click="add()" class="blue">添加</span>
+						</div>
 					</noData>
 				</template>
 			</el-table>
@@ -146,16 +150,16 @@ export default {
 			],
 			isShowName: false,
 			nameVal: '',
-			
+
 			// 添加模板
-			isAdd:false,
+			isAdd: false
 		};
 	},
-	watch:{
-		dialogVisible(val){
-			if(!val){
-				this.isAdd=false;
-				this.selectItem={
+	watch: {
+		dialogVisible(val) {
+			if (!val) {
+				this.isAdd = false;
+				this.selectItem = {
 					config: { point: 0, upper_limit: 0 },
 					enable: true,
 					id: '',
@@ -171,28 +175,40 @@ export default {
 		this.getList();
 	},
 	methods: {
-		deleteSet(e){
+		refresh() {
+			this.$axios('post', '/api/ding/report_sync', data)
+				.then(res => {
+					if (res.data.code == 1) {
+						this.$message.success(res.data.msg);
+						this.getList();
+						this.dialogVisible = false;
+					}
+				})
+				.finally(() => {
+					this.setLoading = false;
+				});
+		},
+		deleteSet(e) {
 			this.$confirm('确定要删除该日志模板吗?', '提示', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
 				type: 'warning'
 			}).then(() => {
-				this.$axios('DELETE', '/api/integral/report/templates', { id: e.id })
-					.then(res => {
-						if (res.data.code == 1) {
-							this.$message.success("删除成功");
-							this.getList();
-						}
-					})
+				this.$axios('DELETE', '/api/integral/report/templates', { id: e.id }).then(res => {
+					if (res.data.code == 1) {
+						this.$message.success('删除成功');
+						this.getList();
+					}
+				});
 			});
 		},
-		add(){
-			if(this.list.length==20){
+		add() {
+			if (this.list.length == 20) {
 				this.$message.warning('日志模板最多有20个');
 				return false;
 			}
-			this.isAdd=true;
-			this.dialogVisible=true;
+			this.isAdd = true;
+			this.dialogVisible = true;
 		},
 		// 最大值不能大于100
 		checkCountry(e, id) {
@@ -222,13 +238,13 @@ export default {
 			this.isShowName = true;
 		},
 		submit(fromName) {
-			if(this.isAdd){
+			if (this.isAdd) {
 				if (!this.selectItem.name) {
 					this.$message.error('请输入日志名称');
 					return false;
 				}
 			}
-			if(this.selectItem.enable){
+			if (this.selectItem.enable) {
 				if (this.selectItem.config.point == 0) {
 					this.$message.error('汇报奖励不能为0');
 					return false;
@@ -246,8 +262,8 @@ export default {
 					data.enable = data.enable ? 1 : 0;
 					data.point = data.config.point;
 					data.upper_limit = data.config.upper_limit;
-					if(this.isAdd){
-						data.type='other'
+					if (this.isAdd) {
+						data.type = 'other';
 					}
 					this.$axios('post', '/api/integral/report/templates', data)
 						.then(res => {