2d21111e
wangming
项目初始化
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<template>
<div class="container" style="padding: 10px;">
<el-form :inline="true" :model="model" class="demo-form-inline">
<el-form-item label="关键字">
<el-input v-model="model.KeyWord" placeholder="关键字"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" @click="addorupdpartner(null)">新增</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="ID" v-if="false">
<template slot-scope="scope">
{{scope.row.id}}
</template>
</el-table-column>
<el-table-column prop="partnerName" label="合伙人姓名">
<template slot-scope="scope">
{{scope.row.partnerName}}
</template>
</el-table-column>
<el-table-column prop="remark" label="合伙人备注">
<template slot-scope="scope">
{{scope.row.remark}}
</template>
</el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<el-tag :type="scope.row.status==0?'success':'warn'">
{{scope.row.status==0?'使用中':'禁用中'}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="add_time" label="添加时间">
<template slot-scope="scope">
{{scope.row.add_time}}
</template>
</el-table-column>
|
dc36257f
wwk
后端页面
|
43
44
45
46
47
48
|
<el-table-column label="屏蔽">
<template slot-scope="scope">
<el-button type="primary" @click="ShieldPerSon(scope.row.id)">屏蔽
</el-button>
</template>
</el-table-column>
|
2d21111e
wangming
项目初始化
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
<el-table-column label="查看推广">
<template slot-scope="scope">
<el-button type="primary" @click="RedirectOrder(scope.row.id)">查看推广</el-button>
</template>
</el-table-column>
<el-table-column label="编辑">
<template slot-scope="scope">
<el-button type="success" @click="addorupdpartner(scope.row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column label="删除">
<template slot-scope="scope">
<el-button type="warning" @click="DelPartner(scope.row.id)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="添加推广(经理)">
<template slot-scope="scope">
<el-button type="primary" @click="Addsubordinate(scope.row.id)">推广用户</el-button>
</template>
</el-table-column>
</el-table>
|
dc36257f
wwk
后端页面
|
70
|
<el-pagination background layout="prev, pager, next" :total="model.TotalCount" @current-change="Pages"
|
2d21111e
wangming
项目初始化
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
style="text-align: right;margin-top: 10px;">
</el-pagination>
<el-dialog title="提示" :visible.sync="dialogVisible" width="50%">
<el-form ref="form" :model="form" label-width="80px" :rules="rulesform">
<el-form-item label="合伙人姓名" prop="partnerName">
<el-input v-model="form.partnerName" placeholder="合伙人姓名" maxlength="12"></el-input>
</el-form-item>
<el-form-item label="合伙人备注" prop="remark">
<el-input v-model="form.remark" placeholder="合伙人备注" max="20"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="SubmitPartner">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="新增推广人员" :visible.sync="dialogVisibleX" width="30%">
<el-form ref="formpartner" :model="formpartner" label-width="80px" :rules="partneruserForm">
<el-form-item label="用户ID" prop="User_id">
<el-input type="text" placeholder="请输入用户ID(编号)" v-model="formpartner.User_id"></el-input>
</el-form-item>
<el-form-item label="合伙人ID" prop="Partner_id" v-if="false">
<el-input type="text" placeholder="请输入合伙人ID" v-model="formpartner.Partner_id" disabled></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleX = false">取 消</el-button>
<el-button type="primary" @click="SubmitPartnerUser">确 定</el-button>
</span>
</el-dialog>
|
dc36257f
wwk
后端页面
|
101
102
103
104
105
106
|
<el-dialog title="外部链接" :visible.sync="dialogVisibleR" width="50%">
<span>外部链接:{{linkR}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleR = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleR = false">确 定</el-button>
</span>
|
2d21111e
wangming
项目初始化
|
107
108
109
110
111
112
113
114
|
</el-dialog>
</div>
</template>
<script>
import {
GetListPartner,
AddOrUpdatePartner,
|
dc36257f
wwk
后端页面
|
115
116
|
DelPartner,
UpdatePartner,
|
2d21111e
wangming
项目初始化
|
117
118
119
120
121
122
123
124
125
126
|
} from '../../api/Partner.js'
import {
AddOrUpdatePartnerUser
} from '../../api/partneruser.js'
import utils from '../../utils/utils.js'
export default {
data() {
return {
dialogVisibleX: false,
dialogVisible: false,
|
dc36257f
wwk
后端页面
|
127
128
129
|
dialogVisibleR: false,
ShieldTxt: true,
linkR: '',
|
2d21111e
wangming
项目初始化
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
tableData: [],
model: {
"KeyWord": "",
"TotalCount": 0,
"PageIndex": 1,
"PageSize": 20,
"Sort": [{
"Field": "",
"Type": 0
}]
},
form: {
"id": 0,
"partnerName": "",
"remark": "",
"status": 0,
"add_time": "2022-01-26T08:46:59.928Z",
"update_time": "2022-01-26T08:46:59.928Z",
},
rulesform: {
partnerName: [{
required: true,
message: '请输入合伙人姓名',
trigger: 'blur'
}]
},
// 合伙人绑定销售经理
partneruserForm: {
User_id: [{
required: true,
message: '请输入用户ID(编号)',
trigger: 'blur'
}],
Partner_id: [{
required: true,
message: '请输入合伙人ID',
trigger: 'blur'
}]
},
// 合伙人绑定销售经理
formpartner: {
"id": 0,
"User_id": 0,
"Partner_id": 0,
"status": 0
|
dc36257f
wwk
后端页面
|
175
176
177
178
179
|
},
//修改合伙人状态
statusModel: {
"id": 0,
"status": 0
|
2d21111e
wangming
项目初始化
|
180
181
182
183
184
185
186
|
}
}
},
created() {
this.ShowPartner()
},
methods: {
|
dc36257f
wwk
后端页面
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
//屏蔽合伙人
ShieldPerSon(id) {
this.statusModel.id=id
this.ShieldTxt = !this.ShieldTxt
if(this.ShieldTxt){
this.statusModel.status=0
}else{
this.statusModel.status=-99
}
UpdatePartner(this.statusModel).then(res => {
if (res.code == 200) {
this.$message.success('操作成功')
this.ShowPartner()
} else {
this.$message.error('屏蔽失败')
}
})
},
|
2d21111e
wangming
项目初始化
|
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
// 新增销售经理
Addsubordinate(id) {
console.log('id', id)
this.dialogVisibleX = true
this.formpartner.Partner_id = id
},
// 合伙人绑定销售经理提交
SubmitPartnerUser() {
this.$refs.formpartner.validate((valid) => {
if (valid) {
AddOrUpdatePartnerUser(this.formpartner).then(res => {
console.log('数', res)
if (res.data.code == 200) {
this.$message.success('绑定销售经理成功')
this.dialogVisibleX = false
} else {
this.$message.error(res.data.message)
}
})
}
})
},
|
dc36257f
wwk
后端页面
|
228
|
|
2d21111e
wangming
项目初始化
|
229
230
|
// 查看订单
RedirectOrder(id) {
|
dc36257f
wwk
后端页面
|
231
232
233
|
let links = 'https://shangten.yiqituancity.com/#/externalInfo?id=' + utils.Encrypt(id)
this.linkR = links
this.dialogVisibleR = true
|
2d21111e
wangming
项目初始化
|
234
235
236
|
// this.$router.push({
// path: '/externalInfo?id=' +id
// })
|
dc36257f
wwk
后端页面
|
237
|
|
2d21111e
wangming
项目初始化
|
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
},
Pages(e) {
this.model.PageIndex = e
this.ShowPartner()
},
// 查询所有合伙人信息
ShowPartner() {
GetListPartner(this.model).then(res => {
console.log('Shuju', res)
res.data.data.rows.forEach((item, index) => {
item.add_time = utils.formatTime(item.add_time, "yyyy-MM-dd HH:mm:ss")
})
this.tableData = res.data.data.rows
this.model.TotalCount = res.data.data.total
})
},
// 提交编辑修改
SubmitPartner() {
this.$refs.form.validate((valid) => {
if (valid) {
AddOrUpdatePartner(this.form).then(res => {
console.log('添加修改数据', res)
if (res.data.code == 200) {
this.$message.success('操作成功')
this.dialogVisible = false
this.ShowPartner()
} else {
this.$message.error('操作失败')
}
})
}
})
},
addorupdpartner(obj) {
this.dialogVisible = true
if (obj.id > 0) {
// 修改
this.form.id = obj.id
this.form.partnerName = obj.partnerName
this.form.remark = obj.remark
this.form.status = obj.status
} else {
// 新增
this.form.id = 0
this.form.partnerName = ''
this.form.remark = ''
this.form.status = 0
}
},
DelPartner(id) {
DelPartner(id).then(res => {
if (res.code == 200) {
this.$message.success('删除成功')
this.ShowPartner()
} else {
this.$message.error('删除失败')
}
})
},
// 提交查询
onSubmit() {
}
}
}
</script>
<style>
</style>
|