lhl 1 vuosi sitten
vanhempi
commit
1f867aa56e
2 muutettua tiedostoa jossa 34 lisäystä ja 17 poistoa
  1. 15 3
      src/pages/agent/global/create.vue
  2. 19 14
      src/pages/agent/global/index.vue

+ 15 - 3
src/pages/agent/global/create.vue

@@ -65,7 +65,7 @@
 		brandList,
 		changeListApi
 	} from "@/api/product";
-	import { addGlobal } from '@/api/agent'
+	import { addGlobal,editGlobal } from '@/api/agent'
 	// import { formatDate } from '@/utils/validate';
 	import Setting from "@/setting";
 	export default {
@@ -114,7 +114,10 @@
 		created() {
 			console.log(this.$route.query);
 			if (this.$route.query.id) {
-				
+				this.formData.id = this.$route.query.id
+				this.formData.name  = this.$route.query.name
+					this.formData.uid  = this.$route.query.uid
+					this.formData.global_commission  = this.$route.query.global_commission
 			}
 		},
 		methods: {
@@ -218,7 +221,16 @@
 			// 创建
 			save() {
 				if (this.formData.id) {
-
+					editGlobal(this.formData).then(res => {
+						this.$Message.success(res.msg);
+						setTimeout(() => {
+							this.$router.push({
+								path: "/admin/agent/global/index",
+							});
+						}, 1000);
+					}).catch(err => {
+						
+					})
 				} else {
 					addGlobal({
 						uid: this.formData.uid,

+ 19 - 14
src/pages/agent/global/index.vue

@@ -14,10 +14,20 @@
 				<template slot-scope="{ row }" slot="avatar">
 					<viewer>
 						<div class="tabBox_img">
-							<img v-lazy="row.avatar" />
+							<img v-lazy="row.user[0].avatar" />
 						</div>
 					</viewer>
 				</template>
+				<template slot-scope="{ row }" slot="nickname">
+					<viewer>
+						<div>{{row.user[0].nickname}}</div>
+					</viewer>
+				</template>
+				<template slot-scope="{ row }" slot="phone">
+					<viewer>
+						<div>{{row.user[0].phone}}</div>
+					</viewer>
+				</template>
 				<template slot-scope="{ row, index }" slot="action">
 					<a @click="edit(row)">编辑</a>
 					<Divider type="vertical" />
@@ -181,28 +191,23 @@
 						width: 80,
 					},
 					{
-						title: "微信用户名称",
-						key: "nickname",
-						minWidth: 120,
-					},
-					{
-						title: "客服头像",
+						title: "头像",
 						slot: "avatar",
 						minWidth: 60,
 					},
 					{
-						title: "客服名称",
-						key: "wx_name",
+						title: "昵称",
+						slot: "nickname",
 						minWidth: 120,
 					},
 					{
-						title: "企微员工",
-						slot: "workMember",
+						title: "联系方式",
+						slot: "phone",
 						minWidth: 120,
 					},
 					{
-						title: "账号状态",
-						slot: "account_status",
+						title: "全局奖励",
+						key: "global_commission",
 						minWidth: 120,
 					},
 					{
@@ -280,7 +285,7 @@
 			edit(row) {
 				// this.$modalForm(kefuEditApi(row.id)).then(() => this.getList());
 				this.$router.push({
-					path: "/admin/agent/global/add?id=" + row.id + '&uid=' + row.uid + '&name=' + row.name
+					path: "/admin/agent/global/add?id=" + row.id + '&uid=' + row.uid + '&name=' + row.user[0].nickname + '&global_commission=' + row.global_commission
 				});
 			},
 			// 添加