|
@@ -11,14 +11,24 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="员工名称" prop="personnelName">
|
|
|
+ <el-form-item label="员工名称" prop="personnelId">
|
|
|
+ <el-select v-model="queryParams.personnelId" filterable clearable placeholder="请选择 / 输入员工">
|
|
|
+ <el-option
|
|
|
+ v-for="item in personnelList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="员工名称" prop="personnelName">
|
|
|
<el-input
|
|
|
v-model="queryParams.personnelName"
|
|
|
placeholder="请输入员工名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="用户昵称" prop="memberName">
|
|
|
<el-input
|
|
|
v-model="queryParams.memberName"
|
|
@@ -93,10 +103,15 @@
|
|
|
<el-form-item label="商家地区">
|
|
|
<OldSend :sendAreaProp="sendAreaProp" @changeArea="changeSendArea" ref="sendArea"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="代理商优惠包" prop="packageDiscountId" v-if="this.userType == 1">
|
|
|
+ <el-select v-model="queryParams.packageDiscountId" placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="item in packageDiscountList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
- <el-button icon="el-icon-download" @click="handleExport()" type="primary">导出</el-button>
|
|
|
+ <el-button icon="el-icon-download" @click="handleExport()" type="primary" v-hasPermi="['module:merchant:export']">导出</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -128,6 +143,12 @@
|
|
|
<span v-else>暂无代理</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="配送商" align="center" prop="dadaDspId" v-if="userType != 2">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.dadaDspName">{{scope.row.dadaDspName}}</span>
|
|
|
+ <span v-else>暂无配送商</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="所属员工" align="center" prop="personnelId">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.personnelName">{{scope.row.personnelName}}</span>
|
|
@@ -262,13 +283,29 @@
|
|
|
<el-input-number style="width:300px" controls-position="right" :min="0" :max="99999" v-model="form.bindDeliveryAmount" :precision="2" placeholder="请输入绑定运力费用" /> 元
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="绑定运力费用" prop="bindDeliveryAmount">
|
|
|
- <el-button :type="this.switch == false ? 'success' : 'danger'" @click="setUpBlock()" style="margin-bottom: 20px">
|
|
|
+ <!-- <el-button :type="this.switch == false ? 'success' : 'danger'" @click="setUpBlock()" style="margin-bottom: 20px">
|
|
|
{{ this.switch == false ? '设置' : '关闭'}}
|
|
|
</el-button>
|
|
|
- <div v-if="this.switch == true" style="color:red">如果关闭,设置 / 修改的收取费用失效!</div>
|
|
|
+ <div v-if="this.switch == true" style="color:red">如果关闭,设置 / 修改的收取费用失效!</div> -->
|
|
|
+ <div class="table">
|
|
|
+ <div class="table-header">
|
|
|
+ <div class="table-header-item">运力名称</div>
|
|
|
+ <div class="table-header-item">收取费用(单位:元)</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="table-list" v-for="(list, index) in this.form.merchantDeliveryFees" :key="index">
|
|
|
+ <div class="table-list-item">
|
|
|
+ {{ list.deliveryName }}
|
|
|
+ </div>
|
|
|
+ <div class="table-list-item">
|
|
|
+ <el-input-number class="onlyOne" :min="0" :max="99999" placeholder="请输入" :precision="2" v-model="list.amount" :controls="false">
|
|
|
+ </el-input-number>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="this.switch">
|
|
|
+ <!-- <el-form-item v-if="this.switch">
|
|
|
<div class="table">
|
|
|
<div class="table-header">
|
|
|
<div class="table-header-item">运力名称</div>
|
|
@@ -285,7 +322,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
@@ -348,9 +385,10 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// 开关
|
|
|
- switch: false,
|
|
|
date:[],
|
|
|
+ packageDiscountList: [],
|
|
|
agentList: [],
|
|
|
+ personnelList: [],
|
|
|
personnelOption: [],
|
|
|
activeName: 'first',
|
|
|
merchantTypeOption:[{
|
|
@@ -409,9 +447,11 @@ export default {
|
|
|
// 客户商家表格数据
|
|
|
merchantList: [],
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
+ title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ // 登录用户类型
|
|
|
+ userType: undefined,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -445,7 +485,8 @@ export default {
|
|
|
aId: undefined,
|
|
|
bindDeliveryAmount: undefined,
|
|
|
personnelName: undefined,
|
|
|
- personnelId: undefined
|
|
|
+ personnelId: undefined,
|
|
|
+ packageDiscountId: undefined
|
|
|
},
|
|
|
exportParams: {
|
|
|
},
|
|
@@ -511,6 +552,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.user = user.actions.getSysUser()
|
|
|
+ this.userType = localStorage.getItem("SYS_USER_TYPE")
|
|
|
this.getList();
|
|
|
getAgentList().then(response => {
|
|
|
console.log('getAgentList', response)
|
|
@@ -528,15 +570,27 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.$http.get(`/module/personnel/personnelList`).then(({data}) => {
|
|
|
+ console.log('data2', data)
|
|
|
+ if (data) {
|
|
|
+ console.log('data', data)
|
|
|
+ this.personnelList = data
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$http.get("/module/packageDiscount/getDiscountList").then(({ data }) => {
|
|
|
+ this.packageDiscountList = data
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- setUpBlock() {
|
|
|
- if(this.switch == false) {
|
|
|
- this.switch = true
|
|
|
- }else {
|
|
|
- this.switch = false
|
|
|
- }
|
|
|
- },
|
|
|
+ // setUpBlock() {
|
|
|
+ // if(this.switch == false) {
|
|
|
+ // this.switch = true
|
|
|
+ // }else {
|
|
|
+ // this.switch = false
|
|
|
+ // }
|
|
|
+ // },
|
|
|
changeAgent() {
|
|
|
this.personnelOption = [];
|
|
|
this.form.personnelId = undefined;
|
|
@@ -544,7 +598,7 @@ export default {
|
|
|
this.personnelOption = response.data
|
|
|
console.log("option2", this.personnelOption)
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
changeSendArea(e) {
|
|
@@ -578,7 +632,7 @@ export default {
|
|
|
// window.localStorage.getItem("ss")
|
|
|
// let routeData = this.$router.resolve({path: '/merchant/edit', query:{ merchantId: row.id } });
|
|
|
// window.open(routeData.href, '_blank');
|
|
|
- this.$router.push({ path: '/merchant/edit', query: { merchantId: row.id } })
|
|
|
+ this.$router.push({ path: '/merchant/merchant/edit', query: { merchantId: row.id } })
|
|
|
},
|
|
|
introChange(data) {
|
|
|
this.form.intro = data
|
|
@@ -612,7 +666,6 @@ export default {
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
- this.switch = false;
|
|
|
this.form = {
|
|
|
id: undefined,
|
|
|
merchantName: undefined,
|
|
@@ -646,8 +699,7 @@ export default {
|
|
|
status: 0,
|
|
|
bindDeliveryAmount: undefined,
|
|
|
// 客户商家运力收费集合
|
|
|
- merchantDeliveryFees: [],
|
|
|
- isInsert: false
|
|
|
+ merchantDeliveryFees: []
|
|
|
};
|
|
|
this.personnelOption = [];
|
|
|
this.resetForm("form");
|
|
@@ -728,7 +780,7 @@ export default {
|
|
|
// console.log('startArea-district', this.startArea.district)
|
|
|
// console.log('startArea-city', this.startArea.city)
|
|
|
// }else {
|
|
|
-
|
|
|
+
|
|
|
if(response.data.provinceName == undefined && response.data.districtName == undefined && response.data.cityName == undefined) {
|
|
|
this.startArea.provinceName = response.data.provinceName
|
|
|
this.startArea.districtName = response.data.districtName
|
|
@@ -746,7 +798,7 @@ export default {
|
|
|
}
|
|
|
console.log('变化前:',area)
|
|
|
console.log('变化后:',func(area))
|
|
|
-
|
|
|
+
|
|
|
// 优化的代码(等同于下面)
|
|
|
// const newAreaId = name =>(func(area).find(item => item.name === name) || {}).id
|
|
|
// this.startArea.province = newAreaId(this.startArea.provinceName)
|
|
@@ -760,12 +812,12 @@ export default {
|
|
|
console.log('this.startArea.city:', this.startArea.city)
|
|
|
|
|
|
var cityId = this.startArea.city.substr(0,4)
|
|
|
- console.log('var cityId', cityId)
|
|
|
+ console.log('var cityId', cityId)
|
|
|
this.startArea.district = (func(area).find(item => {return item.name === this.startArea.districtName && item.id.includes(cityId) && item.level === 3}) || {}).id
|
|
|
console.log('this.startArea.district:', this.startArea.district)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
// this.startArea.district = func(area).filter(item => {
|
|
|
// console.log('item', item)
|
|
|
|
|
@@ -773,14 +825,13 @@ export default {
|
|
|
// return true
|
|
|
// }
|
|
|
// }).id
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
// }
|
|
|
|
|
|
this.areaProp = JSON.parse(JSON.stringify(this.startArea))
|
|
|
this.form = Object.assign({}, { personnelId: '' }, response.data);
|
|
|
|
|
|
- this.switch = this.form.isInsert
|
|
|
console.log('form', this.form)
|
|
|
|
|
|
if (response.data.photoAlbum){
|
|
@@ -830,19 +881,43 @@ export default {
|
|
|
this.form.cityName = this.startArea.cityName
|
|
|
this.form.districtName = this.startArea.districtName
|
|
|
|
|
|
- this.form.isInsert = this.switch
|
|
|
+ console.log('form', this.form)
|
|
|
if (this.form.id != null) {
|
|
|
- updateMerchant(this.form).then(response => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ // updateMerchant(this.form).then(response => {
|
|
|
+ // this.msgSuccess("修改成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.getList();
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.$confirm("确定修改数据吗?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ updateMerchant(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
} else {
|
|
|
- addMerchant(this.form).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ // addMerchant(this.form).then(response => {
|
|
|
+ // this.msgSuccess("新增成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.getList();
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.$confirm("确定新增数据吗?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ addMerchant(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -871,9 +946,11 @@ export default {
|
|
|
this.exportParams.memberName = this.queryParams.memberName
|
|
|
this.exportParams.memberMobile = this.queryParams.memberMobile
|
|
|
this.exportParams.personnelName = this.queryParams.personnelName
|
|
|
+ this.exportParams.personnelId = this.queryParams.personnelId
|
|
|
+ this.exportParams.packageDiscountId = this.queryParams.packageDiscountId
|
|
|
if (this.date !== null && this.date !== '') {
|
|
|
if (this.date[0] !== undefined) {
|
|
|
- this.exportParams.startTime = this.date[0]
|
|
|
+ this.exportParams.startTime = this.date[0]
|
|
|
this.exportParams.endTime = this.date[1]
|
|
|
}
|
|
|
} else {
|