|
|
@@ -11,13 +11,13 @@
|
|
|
<el-form-item prop="nickname" label="昵称">
|
|
|
<el-input v-model="formData.nickname"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="formData.id" label="密码">
|
|
|
- <el-button type="primary" plain @click="resetPassword">重置
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-else prop="password" label="密码">
|
|
|
- <el-input v-model="formData.password"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <!-- <el-form-item v-if="formData.id" label="密码">
|
|
|
+ <el-button type="primary" plain @click="resetPassword">重置
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>-->
|
|
|
+ <!-- <el-form-item v-else prop="password" label="密码">
|
|
|
+ <el-input v-model="formData.password"></el-input>
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item prop="phone" label="手机">
|
|
|
<el-input v-model="formData.phone"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -30,48 +30,64 @@
|
|
|
</el-select>
|
|
|
</el-form-item>-->
|
|
|
<el-form-item>
|
|
|
- <el-button @click="onSave" :loading="$store.state.fetchingData"
|
|
|
- type="primary">保存</el-button>
|
|
|
+ <!-- <el-button @click="onSave" :loading="$store.state.fetchingData"
|
|
|
+ type="primary">保存
|
|
|
+ </el-button>-->
|
|
|
<!-- <el-button @click="del" :loading="$store.state.fetchingData"
|
|
|
type="danger" v-if="formData.id">删除
|
|
|
</el-button>-->
|
|
|
- <el-button @click="showSetLogistics=true"
|
|
|
+ <el-button @click="moveRow"
|
|
|
type="danger" v-if="formData.id && !formData.blacklist">移入黑名单
|
|
|
</el-button>
|
|
|
<el-button @click=""
|
|
|
type="danger" v-if="formData.id && formData.blacklist">移出黑名单
|
|
|
</el-button>
|
|
|
- <el-button @click="" :loading="$store.state.fetchingData"
|
|
|
+ <el-button @click="showCoupon" :loading="$store.state.fetchingData"
|
|
|
type="primary" v-if="formData.id">发送优惠券
|
|
|
</el-button>
|
|
|
+ <el-button @click="showOrder" :loading="$store.state.fetchingData"
|
|
|
+ type="primary" v-if="formData.id">订单
|
|
|
+ </el-button>
|
|
|
<el-button @click="$router.go(-1)">返回</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
<el-dialog
|
|
|
- title="填写理由"
|
|
|
+ title="优惠券列表"
|
|
|
center
|
|
|
- width="400px"
|
|
|
- :visible.sync="showSetLogistics"
|
|
|
+ :visible.sync="dislogTableCoupon"
|
|
|
>
|
|
|
- <el-form :model="formData">
|
|
|
- <el-form-item>
|
|
|
- <el-input type="textarea"
|
|
|
- placeholder="请输入拉入黑名单理由"
|
|
|
- v-model="reason"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="moveRow(formData.id)" size="mini">确认</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <el-table :data="coupons" ref="table">
|
|
|
+ <el-table-column align="center" type="selection"
|
|
|
+ width="50">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" label="优惠券名称"></el-table-column>
|
|
|
+ <el-table-column prop="amount" label="金额"></el-table-column>
|
|
|
+ <el-table-column prop="fullAmount" label="限制"></el-table-column>
|
|
|
+ <el-table-column prop="endDate" label="结束时间"></el-table-column>
|
|
|
+ <!-- <el-table-column label="操作" align="center" fixed="right">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-button @click="issue(row)">发放</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+ <div class="pagination-wrapper">
|
|
|
+ <el-button @click="operation1">确定</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
- <el-dialog>
|
|
|
- <el-table>
|
|
|
-
|
|
|
+ <el-dialog
|
|
|
+ title="订单列表"
|
|
|
+ center
|
|
|
+ :visible.sync="dislogTableOrder"
|
|
|
+ >
|
|
|
+ <el-table :data="orders" ref="table">
|
|
|
+ <el-table-column prop="remark" label="备注"></el-table-column>
|
|
|
+ <el-table-column prop="merchantId" label="商家"></el-table-column>
|
|
|
+ <el-table-column prop="riderId" label="骑手"></el-table-column>
|
|
|
+ <el-table-column prop="realAmount" label="实付金额"></el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+ <div class="pagination-wrapper">
|
|
|
+<!-- <el-button @click="operation1">确定</el-button>-->
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -89,14 +105,7 @@
|
|
|
this.$message.error(e.error);
|
|
|
});
|
|
|
}
|
|
|
- /* this.$http
|
|
|
- .get('/authority/all')
|
|
|
- .then(res => {
|
|
|
- this.authorities = res;
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- });*/
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -135,11 +144,19 @@
|
|
|
{ required: true, message: '请选择角色', trigger: 'blur' },
|
|
|
],*/
|
|
|
},
|
|
|
- showSetLogistics: false,
|
|
|
+ dislogTableCoupon: false,
|
|
|
+ coupons: [],
|
|
|
// authorities: [],
|
|
|
- reason: "",
|
|
|
+ dislogTableOrder: false,
|
|
|
+ orders: [],
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ selection() {
|
|
|
+ return this.$refs.table.selection.map(i => i.id);
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
onSave() {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
@@ -152,7 +169,7 @@
|
|
|
},
|
|
|
submit() {
|
|
|
this.$http
|
|
|
- .post('/user/save', this.formData, { body: 'json' })
|
|
|
+ .post('/user/save', this.formData, {body: 'json'})
|
|
|
.then(res => {
|
|
|
this.$message.success('成功');
|
|
|
this.formData = res;
|
|
|
@@ -167,7 +184,7 @@
|
|
|
this.$message.error(e.error);
|
|
|
});
|
|
|
},
|
|
|
- del(){
|
|
|
+ del() {
|
|
|
this.$confirm('确认删除吗?', '提示', {type: 'warning'})
|
|
|
.then(() => {
|
|
|
this.$http
|
|
|
@@ -189,43 +206,32 @@
|
|
|
.catch(() => {
|
|
|
});
|
|
|
},
|
|
|
- moveRow(id) {
|
|
|
- /*this.$confirm('确认移入黑名单吗?', '提示', {type: 'warning'})
|
|
|
- .then(() => {
|
|
|
- this.$http
|
|
|
- .post({
|
|
|
- url: '/blacklist/move',
|
|
|
- data: {
|
|
|
- id: this.formData.id,
|
|
|
- reason: this.reason,
|
|
|
- },
|
|
|
+ moveRow() {
|
|
|
+ this.$prompt('请输入理由', '提示', {
|
|
|
+ inputType: 'textarea'
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ // console.log(res);
|
|
|
+ if (res.value) {
|
|
|
+ this.$alert('确定拉入黑名单?', '提示', {
|
|
|
+ showCancelButton: true
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success('成功');
|
|
|
+ .then(() => {
|
|
|
+ return this.$http.post('/blackList/move', {
|
|
|
+ userId: this.formData.id,
|
|
|
+ reason: res.value
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('拉入黑名单成功');
|
|
|
this.$router.go(-1);
|
|
|
- } else {
|
|
|
- this.$message.warning('失败');
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.error(res.error || '拉入黑名单失败');
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- });*/
|
|
|
- this.$http
|
|
|
- .post({
|
|
|
- url: "/blacklist/move", data: {
|
|
|
- id: id,
|
|
|
- reason: this.reason,
|
|
|
- },
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.$message.success("成功");
|
|
|
- this.showSetLogistics = false;
|
|
|
- this.$router.go(0);
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- this.$message.error(e.error);
|
|
|
});
|
|
|
},
|
|
|
resetPassword() {
|
|
|
@@ -253,6 +259,73 @@
|
|
|
.catch(() => {
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ issue(row) {
|
|
|
+ this.$http
|
|
|
+ .post("/userCoupon/issue", {
|
|
|
+ userId: this.formData.id,
|
|
|
+ couponId: row.id,
|
|
|
+ },
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("发放成功");
|
|
|
+ this.showSetLogistics = false;
|
|
|
+ this.$router.go(0);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error || '发放失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation1() {
|
|
|
+ /*this.$notify({
|
|
|
+ title: '发放',
|
|
|
+ message: this.selection
|
|
|
+ });*/
|
|
|
+ this.$http
|
|
|
+ .post("/userCoupon/issue", {
|
|
|
+ userId: this.formData.id,
|
|
|
+ couponId: this.selection.toString(),
|
|
|
+
|
|
|
+ },
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("发放成功");
|
|
|
+ //this.showSetLogistics = false;
|
|
|
+ this.$router.go(0);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error || '发放失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showCoupon() {
|
|
|
+ this.dislogTableCoupon = true;
|
|
|
+ this.$http
|
|
|
+ .get('/coupon/all')
|
|
|
+ .then(res => {
|
|
|
+ this.coupons = res.content;
|
|
|
+ //console.log(this.coupons)
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showOrder() {
|
|
|
+ this.dislogTableOrder = true;
|
|
|
+ this.$http
|
|
|
+ .post('/orderInfo/list', {
|
|
|
+ id: this.formData.id,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.orders = res.content;
|
|
|
+ console.log(this.orders)
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|