新增global,缓存职位信息
This commit is contained in:
parent
6b50ddcfdd
commit
df52ea8f2d
@ -5,15 +5,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createNamespacedHelpers } from "vuex";
|
|
||||||
const { mapActions } = createNamespacedHelpers("global");
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
created() {
|
|
||||||
// this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
...mapActions(["init"]),
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
8
stdiet-ui/src/api/custom/global.js
Normal file
8
stdiet-ui/src/api/custom/global.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
export function getOptions() {
|
||||||
|
return request({
|
||||||
|
url: "/custom/post/options",
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
}
|
@ -1,69 +1,62 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
|
|
||||||
// 查询销售订单列表
|
// 查询销售订单列表
|
||||||
export function listOrder(params) {
|
export function listOrder(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order/list',
|
url: "/custom/order/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: params
|
params: params
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询销售订单详细
|
// 查询销售订单详细
|
||||||
export function getOrder(orderId) {
|
export function getOrder(orderId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order/' + orderId,
|
url: "/custom/order/" + orderId,
|
||||||
method: 'get'
|
method: "get"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增销售订单
|
// 新增销售订单
|
||||||
export function addOrder(data) {
|
export function addOrder(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order',
|
url: "/custom/order",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改销售订单
|
// 修改销售订单
|
||||||
export function updateOrder(data) {
|
export function updateOrder(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order',
|
url: "/custom/order",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除销售订单
|
// 删除销售订单
|
||||||
export function delOrder(orderId) {
|
export function delOrder(orderId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order/' + orderId,
|
url: "/custom/order/" + orderId,
|
||||||
method: 'delete'
|
method: "delete"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出销售订单
|
// 导出销售订单
|
||||||
export function exportOrder(query) {
|
export function exportOrder(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order/export',
|
url: "/custom/order/export",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
||||||
export function getOptions() {
|
|
||||||
return request({
|
|
||||||
url: '/custom/post/options',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询销售订单详细
|
// 查询销售订单详细
|
||||||
export function getInfoDetail(query) {
|
export function getInfoDetail(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/custom/order/getInfoDetail',
|
url: "/custom/order/getInfoDetail",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,28 +3,51 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="调理项目" prop="projectId">
|
<el-form-item label="调理项目" prop="projectId">
|
||||||
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
|
<el-select
|
||||||
<el-option v-for="dict in conditioningProjectIdOption"
|
v-model="form.projectId"
|
||||||
|
placeholder="请选择调理项目"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in conditioningProjectIdOption"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="parseInt(dict.dictValue)"/>
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--<el-form-item label="客户姓名" prop="name">
|
<!--<el-form-item label="客户姓名" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item label="金额" prop="amount" style="width: 300px;">
|
<el-form-item label="金额" prop="amount" style="width: 300px">
|
||||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0" >
|
<el-form-item
|
||||||
<el-input style="width: 200px;" v-model="form.servePromise" placeholder="请输入服务承诺"/><span style="margin-left: 5px;">斤</span>
|
label="服务承诺"
|
||||||
|
prop="servePromise"
|
||||||
|
v-show="form.projectId == 0"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
style="width: 200px"
|
||||||
|
v-model="form.servePromise"
|
||||||
|
placeholder="请输入服务承诺"
|
||||||
|
/><span style="margin-left: 5px">斤</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营养师" prop="nutritionistId">
|
<el-form-item label="营养师" prop="nutritionistId">
|
||||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
<el-select
|
||||||
<el-option v-for="dict in nutritionistIdOptions"
|
v-model="form.nutritionistId"
|
||||||
|
placeholder="请选择营养师"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="parseInt(dict.dictValue)"/>
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务时间" prop="serveTime">
|
<el-form-item label="服务时间" prop="serveTime">
|
||||||
@ -38,7 +61,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -48,20 +75,17 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { addContract } from "@/api/custom/contract";
|
||||||
import {addContract} from "@/api/custom/contract";
|
import { mapState } from "vuex";
|
||||||
import {getOptions} from "@/api/custom/order";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ContractAdd",
|
name: "ContractAdd",
|
||||||
components: {
|
components: {},
|
||||||
|
|
||||||
},
|
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
const checkServePromise = (rule, value, callback) => {
|
const checkServePromise = (rule, value, callback) => {
|
||||||
if (this.form.projectId == 0 && !value) {
|
if (this.form.projectId == 0 && !value) {
|
||||||
return callback(new Error('请输入服务承诺'))
|
return callback(new Error("请输入服务承诺"));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
@ -75,14 +99,14 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
projectId:[
|
projectId: [
|
||||||
{required: true, message: "请选择调理项目", trigger: "blur"}
|
{ required: true, message: "请选择调理项目", trigger: "blur" },
|
||||||
],
|
],
|
||||||
/*name: [
|
/*name: [
|
||||||
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
||||||
],*/
|
],*/
|
||||||
amount: [
|
amount: [
|
||||||
{required: true, message: "请输入签订金额", trigger: "blur"},
|
{ required: true, message: "请输入签订金额", trigger: "blur" },
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
@ -91,35 +115,31 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
servePromise: [
|
servePromise: [
|
||||||
{required: true, trigger: "blur", validator: checkServePromise}
|
{ required: true, trigger: "blur", validator: checkServePromise },
|
||||||
],
|
],
|
||||||
serveTime: [
|
serveTime: [
|
||||||
{required: true, message: "请选择服务时间", trigger: "blur"}
|
{ required: true, message: "请选择服务时间", trigger: "blur" },
|
||||||
],
|
],
|
||||||
nutritionistId: [
|
nutritionistId: [
|
||||||
{required: true, message: "请选择营养师", trigger: "blur"}
|
{ required: true, message: "请选择营养师", trigger: "blur" },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
conditioningProjectIdOption:[],
|
conditioningProjectIdOption: [],
|
||||||
serveTimeOptions:[],
|
serveTimeOptions: [],
|
||||||
nutritionistIdOptions:[]
|
// nutritionistIdOptions: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
nutritionistIdOptions: (state) =>
|
||||||
|
state.global.nutritionistIdOptions.slice(1),
|
||||||
|
}),
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
getOptions().then(response => {
|
this.getDicts("cus_serve_time").then((response) => {
|
||||||
const options = response.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
|
|
||||||
return opts;
|
|
||||||
}, {})
|
|
||||||
this.nutritionistIdOptions = options['nutri'] || [];
|
|
||||||
})
|
|
||||||
this.getDicts("cus_serve_time").then(response => {
|
|
||||||
this.serveTimeOptions = response.data;
|
this.serveTimeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("conditioning_project").then(response => {
|
this.getDicts("conditioning_project").then((response) => {
|
||||||
this.conditioningProjectIdOption = response.data;
|
this.conditioningProjectIdOption = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -127,29 +147,37 @@ export default {
|
|||||||
showDialog(data, callback) {
|
showDialog(data, callback) {
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.reset(data);
|
this.reset(data);
|
||||||
this.title = "新增"+`「${data.customer}」客户合同`;
|
this.title = "新增" + `「${data.customer}」客户合同`;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset(obj) {
|
reset(obj) {
|
||||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue === obj.nutritionistId);
|
const defaultNutritionist = this.nutritionistIdOptions.find(
|
||||||
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
|
(opt) => opt.dictValue === obj.nutritionistId
|
||||||
|
);
|
||||||
|
const defaultProjectIdOption = this.conditioningProjectIdOption.find(
|
||||||
|
(opt) => opt.remark === "default"
|
||||||
|
);
|
||||||
|
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
customerId: obj.customerId,
|
customerId: obj.customerId,
|
||||||
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
|
projectId: defaultProjectIdOption
|
||||||
|
? parseInt(defaultProjectIdOption.dictValue)
|
||||||
|
: null,
|
||||||
name: obj.customer,
|
name: obj.customer,
|
||||||
phone: null,
|
phone: null,
|
||||||
serveTime: null,
|
serveTime: null,
|
||||||
amount: null,
|
amount: null,
|
||||||
path: null,
|
path: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
nutritionistId: defaultNutritionist
|
||||||
|
? parseInt(defaultNutritionist.dictValue)
|
||||||
|
: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
remark: null
|
remark: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -159,13 +187,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
|
this.form.tutor = this.selectDictLabel(
|
||||||
if(this.form.projectId != 0){
|
this.nutritionistIdOptions,
|
||||||
|
this.form.nutritionistId
|
||||||
|
);
|
||||||
|
if (this.form.projectId != 0) {
|
||||||
this.form.servePromise = null;
|
this.form.servePromise = null;
|
||||||
}
|
}
|
||||||
addContract(this.form).then(response => {
|
addContract(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -174,7 +205,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,15 +14,25 @@
|
|||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="form.orderType"
|
v-model="form.orderType"
|
||||||
:options="orderTypeOptions"
|
:options="orderTypeOptions"
|
||||||
style="width: 100%">
|
style="width: 100%"
|
||||||
|
>
|
||||||
</el-cascader>
|
</el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="自动创建售后提成订单" prop="secondAfterSaleFlag" label-width="200px">
|
<el-form-item
|
||||||
<el-select v-model="form.secondAfterSaleFlag" :disabled="secondAfterSaleFlagShow" style="width: 100px" placeholder="请选择">
|
label="自动创建售后提成订单"
|
||||||
<el-option :key="0" label="否" :value="0"/>
|
prop="secondAfterSaleFlag"
|
||||||
<el-option :key="1" label="是" :value="1"/>
|
label-width="200px"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
v-model="form.secondAfterSaleFlag"
|
||||||
|
:disabled="secondAfterSaleFlagShow"
|
||||||
|
style="width: 100px"
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
|
<el-option :key="0" label="否" :value="0" />
|
||||||
|
<el-option :key="1" label="是" :value="1" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -120,7 +130,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="主营养师" prop="nutritionistIdList">
|
<el-form-item label="主营养师" prop="nutritionistIdList">
|
||||||
<el-select v-model="form.nutritionistIdList" multiple placeholder="请选择">
|
<el-select
|
||||||
|
v-model="form.nutritionistIdList"
|
||||||
|
multiple
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutritionistIdOptions"
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -132,7 +146,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="拆分比例" prop="nutritionistRate">
|
<el-form-item label="拆分比例" prop="nutritionistRate">
|
||||||
<el-select v-model="form.nutritionistRate" :disabled="orderRateOptionsShow" placeholder="请选择" >
|
<el-select
|
||||||
|
v-model="form.nutritionistRate"
|
||||||
|
:disabled="orderRateOptionsShow"
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in orderRateOptions"
|
v-for="dict in orderRateOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -264,9 +282,11 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addOrder, getOptions, updateOrder } from "@/api/custom/order";
|
import { addOrder, updateOrder } from "@/api/custom/order";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as orderTypeData from "@/utils/orderType";
|
import * as orderTypeData from "@/utils/orderType";
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OrderEdit",
|
name: "OrderEdit",
|
||||||
props: {
|
props: {
|
||||||
@ -383,16 +403,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 收款方式字典
|
// 收款方式字典
|
||||||
payTypeIdOptions: [],
|
payTypeIdOptions: [],
|
||||||
// 售前字典
|
|
||||||
preSaleIdOptions: [],
|
|
||||||
// 售后字典
|
|
||||||
afterSaleIdOptions: [],
|
|
||||||
// 主营养师字典
|
|
||||||
nutritionistIdOptions: [],
|
|
||||||
// 助理营养师字典
|
|
||||||
nutriAssisIdOptions: [],
|
|
||||||
// 策划字典
|
|
||||||
plannerIdOptions: [],
|
|
||||||
// 账号
|
// 账号
|
||||||
accountIdOptions: [],
|
accountIdOptions: [],
|
||||||
// 服务时长
|
// 服务时长
|
||||||
@ -401,54 +411,25 @@ export default {
|
|||||||
giveTimeIdOption: [],
|
giveTimeIdOption: [],
|
||||||
//调理项目
|
//调理项目
|
||||||
conditioningProjectIdOption: [],
|
conditioningProjectIdOption: [],
|
||||||
// 策划助理字典
|
|
||||||
plannerAssisIdOptions: [],
|
|
||||||
// 运营字典
|
|
||||||
operatorIdOptions: [],
|
|
||||||
// 审核状态
|
// 审核状态
|
||||||
reviewStatusOptions: [],
|
reviewStatusOptions: [],
|
||||||
//
|
|
||||||
operatorAssisIdOptions: [],
|
|
||||||
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
||||||
orderDropdownCorrespondingOptions: [],
|
orderDropdownCorrespondingOptions: [],
|
||||||
//订单类型
|
//订单类型
|
||||||
orderTypeOptions: orderTypeData['orderTypeArray'],
|
orderTypeOptions: orderTypeData["orderTypeArray"],
|
||||||
secondAfterSaleFlagShow: true,
|
secondAfterSaleFlagShow: true,
|
||||||
//分成比例
|
//分成比例
|
||||||
orderRateOptions: orderTypeData['orderRateArray'],
|
orderRateOptions: orderTypeData["orderRateArray"],
|
||||||
orderRateOptionsShow: true
|
orderRateOptionsShow: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
getOptions().then((res) => {
|
|
||||||
const options = res.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [
|
|
||||||
{ dictValue: 0, dictLabel: "无", remark: null },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({
|
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
|
||||||
this.nutritionistIdOptions = options["nutri"] || [];
|
|
||||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
|
||||||
this.plannerIdOptions = options["planner"] || [];
|
|
||||||
this.plannerAssisIdOptions = options["planner_assis"] || [];
|
|
||||||
this.operatorIdOptions = options["operator"] || [];
|
|
||||||
this.operatorAssisIdOptions = options["operator_assis"] || [];
|
|
||||||
});
|
|
||||||
this.getDicts("cus_pay_type").then((response) => {
|
this.getDicts("cus_pay_type").then((response) => {
|
||||||
this.payTypeIdOptions = response.data;
|
this.payTypeIdOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("cus_account").then((response) => {
|
this.getDicts("cus_account").then((response) => {
|
||||||
this.accountIdOptions = response.data;
|
this.accountIdOptions = response.data;
|
||||||
console.log(response.data);
|
// console.log(response.data);
|
||||||
this.accountIdOptions.splice(0, 0, {
|
this.accountIdOptions.splice(0, 0, {
|
||||||
dictLabel: "无",
|
dictLabel: "无",
|
||||||
dictValue: "0",
|
dictValue: "0",
|
||||||
@ -484,6 +465,26 @@ export default {
|
|||||||
this.orderTypeOptions = response.data;
|
this.orderTypeOptions = response.data;
|
||||||
});*/
|
});*/
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
// 售前字典
|
||||||
|
"preSaleIdOptions",
|
||||||
|
// 售后字典
|
||||||
|
"afterSaleIdOptions",
|
||||||
|
// 主营养师字典
|
||||||
|
"nutritionistIdOptions",
|
||||||
|
// 助理营养师字典
|
||||||
|
"nutriAssisIdOptions",
|
||||||
|
// 策划字典
|
||||||
|
"plannerIdOptions",
|
||||||
|
// 策划助理字典
|
||||||
|
"plannerAssisIdOptions",
|
||||||
|
// 运营字典
|
||||||
|
"operatorIdOptions",
|
||||||
|
// 运营助理字典
|
||||||
|
"operatorAssisIdOptions",
|
||||||
|
]),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showDialog(data, callback) {
|
showDialog(data, callback) {
|
||||||
// this.data = data;
|
// this.data = data;
|
||||||
@ -554,7 +555,9 @@ export default {
|
|||||||
(opt) => parseInt(opt.dictValue) === accountId
|
(opt) => parseInt(opt.dictValue) === accountId
|
||||||
);
|
);
|
||||||
|
|
||||||
const defaultOrderRate = this.orderRateOptions.find((opt) => opt.remark === "default");
|
const defaultOrderRate = this.orderRateOptions.find(
|
||||||
|
(opt) => opt.remark === "default"
|
||||||
|
);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
plannerId,
|
plannerId,
|
||||||
@ -590,7 +593,9 @@ export default {
|
|||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
nutritionistId: null,
|
nutritionistId: null,
|
||||||
nutritionistIdList: defaultNutritionist ? [parseInt(defaultNutritionist.dictValue)] : null,
|
nutritionistIdList: defaultNutritionist
|
||||||
|
? [parseInt(defaultNutritionist.dictValue)]
|
||||||
|
: null,
|
||||||
nutritionistRate: defaultOrderRate ? defaultOrderRate.dictValue : null,
|
nutritionistRate: defaultOrderRate ? defaultOrderRate.dictValue : null,
|
||||||
remark: null,
|
remark: null,
|
||||||
nutriAssisId: defaultNutriAssis
|
nutriAssisId: defaultNutriAssis
|
||||||
@ -647,9 +652,9 @@ export default {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleOrderTypeChange(){
|
handleOrderTypeChange() {
|
||||||
console.log(this.form.orderType);
|
console.log(this.form.orderType);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 监听收款账号的变化
|
// 监听收款账号的变化
|
||||||
@ -658,18 +663,18 @@ export default {
|
|||||||
},
|
},
|
||||||
"form.orderType": function (newVal, oldVal) {
|
"form.orderType": function (newVal, oldVal) {
|
||||||
//判断订单类型是否选择了二开
|
//判断订单类型是否选择了二开
|
||||||
if(newVal[1] == 1){
|
if (newVal[1] == 1) {
|
||||||
this.form.secondAfterSaleFlag = 1;
|
this.form.secondAfterSaleFlag = 1;
|
||||||
this.secondAfterSaleFlagShow = false;
|
this.secondAfterSaleFlagShow = false;
|
||||||
}else{
|
} else {
|
||||||
this.form.secondAfterSaleFlag = 0;
|
this.form.secondAfterSaleFlag = 0;
|
||||||
this.secondAfterSaleFlagShow = true;
|
this.secondAfterSaleFlagShow = true;
|
||||||
}
|
}
|
||||||
//判断是否选择了比例拆分单
|
//判断是否选择了比例拆分单
|
||||||
if(newVal[0] == 1){
|
if (newVal[0] == 1) {
|
||||||
this.orderRateOptionsShow = false;
|
this.orderRateOptionsShow = false;
|
||||||
this.form.nutritionistRate = "2,8";
|
this.form.nutritionistRate = "2,8";
|
||||||
}else{
|
} else {
|
||||||
this.orderRateOptionsShow = true;
|
this.orderRateOptionsShow = true;
|
||||||
this.form.nutritionistRate = "0,10";
|
this.form.nutritionistRate = "0,10";
|
||||||
}
|
}
|
||||||
|
@ -235,8 +235,9 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addOrder, getOptions, updateOrder } from "@/api/custom/order";
|
import { addOrder, updateOrder } from "@/api/custom/order";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OrderEdit",
|
name: "OrderEdit",
|
||||||
@ -354,16 +355,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 收款方式字典
|
// 收款方式字典
|
||||||
payTypeIdOptions: [],
|
payTypeIdOptions: [],
|
||||||
// 售前字典
|
|
||||||
preSaleIdOptions: [],
|
|
||||||
// 售后字典
|
|
||||||
afterSaleIdOptions: [],
|
|
||||||
// 主营养师字典
|
|
||||||
nutritionistIdOptions: [],
|
|
||||||
// 助理营养师字典
|
|
||||||
nutriAssisIdOptions: [],
|
|
||||||
// 策划字典
|
|
||||||
plannerIdOptions: [],
|
|
||||||
// 账号
|
// 账号
|
||||||
accountIdOptions: [],
|
accountIdOptions: [],
|
||||||
// 服务时长
|
// 服务时长
|
||||||
@ -372,42 +363,13 @@ export default {
|
|||||||
giveTimeIdOption: [],
|
giveTimeIdOption: [],
|
||||||
//调理项目
|
//调理项目
|
||||||
conditioningProjectIdOption: [],
|
conditioningProjectIdOption: [],
|
||||||
// 策划助理字典
|
|
||||||
plannerAssisIdOptions: [],
|
|
||||||
// 运营字典
|
|
||||||
operatorIdOptions: [],
|
|
||||||
// 审核状态
|
// 审核状态
|
||||||
reviewStatusOptions: [],
|
reviewStatusOptions: [],
|
||||||
//
|
|
||||||
operatorAssisIdOptions: [],
|
|
||||||
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
||||||
orderDropdownCorrespondingOptions: [],
|
orderDropdownCorrespondingOptions: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
getOptions().then((res) => {
|
|
||||||
const options = res.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [
|
|
||||||
{ dictValue: 0, dictLabel: "无", remark: null },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({
|
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
|
||||||
this.nutritionistIdOptions = options["nutri"] || [];
|
|
||||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
|
||||||
this.plannerIdOptions = options["planner"] || [];
|
|
||||||
this.plannerAssisIdOptions = options["planner_assis"] || [];
|
|
||||||
this.operatorIdOptions = options["operator"] || [];
|
|
||||||
this.operatorAssisIdOptions = options["operator_assis"] || [];
|
|
||||||
});
|
|
||||||
this.getDicts("cus_pay_type").then((response) => {
|
this.getDicts("cus_pay_type").then((response) => {
|
||||||
this.payTypeIdOptions = response.data;
|
this.payTypeIdOptions = response.data;
|
||||||
});
|
});
|
||||||
@ -435,6 +397,26 @@ export default {
|
|||||||
this.orderDropdownCorrespondingOptions = response.data;
|
this.orderDropdownCorrespondingOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
// 售前字典
|
||||||
|
"preSaleIdOptions",
|
||||||
|
// 售后字典
|
||||||
|
"afterSaleIdOptions",
|
||||||
|
// 主营养师字典
|
||||||
|
"nutritionistIdOptions",
|
||||||
|
// 助理营养师字典
|
||||||
|
"nutriAssisIdOptions",
|
||||||
|
// 策划字典
|
||||||
|
"plannerIdOptions",
|
||||||
|
// 策划助理字典
|
||||||
|
"plannerAssisIdOptions",
|
||||||
|
// 运营字典
|
||||||
|
"operatorIdOptions",
|
||||||
|
// 运营助理字典
|
||||||
|
"operatorAssisIdOptions",
|
||||||
|
]),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showDialog(data, callback) {
|
showDialog(data, callback) {
|
||||||
// this.data = data;
|
// this.data = data;
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
<hamburger
|
||||||
|
id="hamburger-container"
|
||||||
|
:is-active="sidebar.opened"
|
||||||
|
class="hamburger-container"
|
||||||
|
@toggleClick="toggleSideBar"
|
||||||
|
/>
|
||||||
|
|
||||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device !== 'mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||||
@ -21,12 +26,14 @@
|
|||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
<el-dropdown
|
||||||
|
class="avatar-container right-menu-item hover-effect"
|
||||||
|
trigger="click"
|
||||||
|
>
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="avatar" class="user-avatar">
|
<img :src="avatar" class="user-avatar" />
|
||||||
<i class="el-icon-caret-bottom" />
|
<i class="el-icon-caret-bottom" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
@ -46,14 +53,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters, mapActions } from "vuex";
|
||||||
import Breadcrumb from '@/components/Breadcrumb'
|
import Breadcrumb from "@/components/Breadcrumb";
|
||||||
import Hamburger from '@/components/Hamburger'
|
import Hamburger from "@/components/Hamburger";
|
||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from "@/components/Screenfull";
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
import SizeSelect from "@/components/SizeSelect";
|
||||||
import Search from '@/components/HeaderSearch'
|
import Search from "@/components/HeaderSearch";
|
||||||
import RuoYiGit from '@/components/RuoYi/Git'
|
import RuoYiGit from "@/components/RuoYi/Git";
|
||||||
import RuoYiDoc from '@/components/RuoYi/Doc'
|
import RuoYiDoc from "@/components/RuoYi/Doc";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -63,43 +70,43 @@ export default {
|
|||||||
SizeSelect,
|
SizeSelect,
|
||||||
Search,
|
Search,
|
||||||
RuoYiGit,
|
RuoYiGit,
|
||||||
RuoYiDoc
|
RuoYiDoc,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters(["sidebar", "avatar", "device"]),
|
||||||
'sidebar',
|
|
||||||
'avatar',
|
|
||||||
'device'
|
|
||||||
]),
|
|
||||||
setting: {
|
setting: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.showSettings
|
return this.$store.state.settings.showSettings;
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$store.dispatch('settings/changeSetting', {
|
this.$store.dispatch("settings/changeSetting", {
|
||||||
key: 'showSettings',
|
key: "showSettings",
|
||||||
value: val
|
value: val,
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions(["init"]),
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch("app/toggleSideBar");
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
this.$confirm("确定注销并退出系统吗?", "提示", {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: "取消",
|
||||||
type: 'warning'
|
type: "warning",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch("LogOut").then(() => {
|
||||||
location.href = '/index';
|
location.href = "/index";
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -108,18 +115,18 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
||||||
|
|
||||||
.hamburger-container {
|
.hamburger-container {
|
||||||
line-height: 46px;
|
line-height: 46px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
float: left;
|
float: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s;
|
transition: background 0.3s;
|
||||||
-webkit-tap-highlight-color:transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, .025)
|
background: rgba(0, 0, 0, 0.025);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,10 +158,10 @@ export default {
|
|||||||
|
|
||||||
&.hover-effect {
|
&.hover-effect {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s;
|
transition: background 0.3s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, .025)
|
background: rgba(0, 0, 0, 0.025);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
7
stdiet-ui/src/store/actions.js
Normal file
7
stdiet-ui/src/store/actions.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const actions = {
|
||||||
|
async init({ dispatch }, payload) {
|
||||||
|
dispatch("global/init", payload);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default actions;
|
@ -11,6 +11,15 @@ const getters = {
|
|||||||
roles: state => state.user.roles,
|
roles: state => state.user.roles,
|
||||||
permissions: state => state.user.permissions,
|
permissions: state => state.user.permissions,
|
||||||
userId: state => state.user.userId,
|
userId: state => state.user.userId,
|
||||||
permission_routes: state => state.permission.routes
|
permission_routes: state => state.permission.routes,
|
||||||
}
|
//
|
||||||
export default getters
|
nutritionistIdOptions: state => state.global.nutritionistIdOptions,
|
||||||
|
nutriAssisIdOptions: state => state.global.nutriAssisIdOptions,
|
||||||
|
preSaleIdOptions: state => state.global.preSaleIdOptions,
|
||||||
|
afterSaleIdOptions: state => state.global.afterSaleIdOptions,
|
||||||
|
plannerIdOptions: state => state.global.plannerIdOptions,
|
||||||
|
plannerAssisIdOptions: state => state.global.plannerAssisIdOptions,
|
||||||
|
operatorIdOptions: state => state.global.operatorIdOptions,
|
||||||
|
operatorAssisIdOptions: state => state.global.operatorAssisIdOptions
|
||||||
|
};
|
||||||
|
export default getters;
|
||||||
|
@ -9,6 +9,7 @@ import recipes from "./modules/recipes";
|
|||||||
import global from "./modules/global";
|
import global from "./modules/global";
|
||||||
|
|
||||||
import getters from "./getters";
|
import getters from "./getters";
|
||||||
|
import actions from "./actions";
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
@ -22,7 +23,8 @@ const store = new Vuex.Store({
|
|||||||
recipes,
|
recipes,
|
||||||
global
|
global
|
||||||
},
|
},
|
||||||
getters
|
getters,
|
||||||
|
actions
|
||||||
});
|
});
|
||||||
|
|
||||||
export default store;
|
export default store;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getOptions } from "@/api/custom/order";
|
import { getOptions } from "@/api/custom/global";
|
||||||
|
|
||||||
const oriState = {
|
const oriState = {
|
||||||
nutritionistIdOptions: [],
|
nutritionistIdOptions: [],
|
||||||
@ -8,7 +8,7 @@ const oriState = {
|
|||||||
plannerIdOptions: [],
|
plannerIdOptions: [],
|
||||||
plannerAssisIdOptions: [],
|
plannerAssisIdOptions: [],
|
||||||
operatorIdOptions: [],
|
operatorIdOptions: [],
|
||||||
operatorAssisIdOptions: [],
|
operatorAssisIdOptions: []
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -28,9 +28,7 @@ const actions = {
|
|||||||
const { data: optionsData } = await getOptions();
|
const { data: optionsData } = await getOptions();
|
||||||
const options = optionsData.reduce((opts, cur) => {
|
const options = optionsData.reduce((opts, cur) => {
|
||||||
if (!opts[cur.postCode]) {
|
if (!opts[cur.postCode]) {
|
||||||
opts[cur.postCode] = [
|
opts[cur.postCode] = [{ dictValue: 0, dictLabel: "无", remark: null }];
|
||||||
// { dictValue: null, dictLabel: "全部", remark: null }
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
opts[cur.postCode].push({
|
opts[cur.postCode].push({
|
||||||
dictValue: cur.userId,
|
dictValue: cur.userId,
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="岗位" prop="postId">
|
<el-form-item label="岗位" prop="postId">
|
||||||
<el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable size="small" @change="searchPostChange">
|
<el-select
|
||||||
|
v-model="queryParams.postId"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@change="searchPostChange"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in postIdOptions"
|
v-for="dict in postIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -12,7 +24,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务员" prop="userId">
|
<el-form-item label="业务员" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请选择业务员"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in searchUserIdOptions"
|
v-for="dict in searchUserIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -22,8 +39,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -70,25 +95,36 @@
|
|||||||
<!-- >导出-->
|
<!-- >导出-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="commisionList" :span-method="objectSpanMethod"
|
<el-table
|
||||||
@selection-change="handleSelectionChange">
|
v-loading="loading"
|
||||||
<el-table-column label="业务员" align="center" prop="userName"/>
|
:data="commisionList"
|
||||||
<el-table-column label="岗位" align="center" prop="postName"/>
|
:span-method="objectSpanMethod"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column label="业务员" align="center" prop="userName" />
|
||||||
|
<el-table-column label="岗位" align="center" prop="postName" />
|
||||||
<el-table-column label="金额" align="center" prop="amount">
|
<el-table-column label="金额" align="center" prop="amount">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{toThousands(scope.row.amount)}}
|
{{ toThousands(scope.row.amount) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="比例" align="center" prop="rate">
|
<el-table-column label="比例" align="center" prop="rate">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.rate + '%'}}
|
{{ scope.row.rate + "%" }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -111,7 +147,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -124,7 +160,11 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="岗位" prop="postId">
|
<el-form-item label="岗位" prop="postId">
|
||||||
<el-select v-model="form.postId" placeholder="请选择岗位" @change="postChange">
|
<el-select
|
||||||
|
v-model="form.postId"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
@change="postChange"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in postIdOptions"
|
v-for="dict in postIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -148,17 +188,21 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="金额" prop="amount">
|
<el-form-item label="金额" prop="amount">
|
||||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="分成比例" prop="rate">
|
<el-form-item label="分成比例" prop="rate">
|
||||||
<el-input v-model="form.rate" placeholder="请输入比例"/>
|
<el-input v-model="form.rate" placeholder="请输入比例" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -172,18 +216,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
listCommision,
|
listCommision,
|
||||||
getCommision,
|
getCommision,
|
||||||
delCommision,
|
delCommision,
|
||||||
addCommision,
|
addCommision,
|
||||||
updateCommision,
|
updateCommision,
|
||||||
exportCommision,
|
exportCommision,
|
||||||
} from "@/api/custom/commision";
|
} from "@/api/custom/commision";
|
||||||
|
|
||||||
import {getOptions} from "@/api/custom/order";
|
import { getOptions } from "@/api/custom/global";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CommisionConfig",
|
name: "CommisionConfig",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -229,23 +273,21 @@
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
userId: [
|
userId: [
|
||||||
{required: true, message: "业务员不能为空", trigger: "change"}
|
{ required: true, message: "业务员不能为空", trigger: "change" },
|
||||||
],
|
],
|
||||||
postId: [
|
postId: [
|
||||||
{required: true, message: "岗位不能为空", trigger: "change"}
|
{ required: true, message: "岗位不能为空", trigger: "change" },
|
||||||
],
|
|
||||||
amount: [
|
|
||||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
|
||||||
],
|
],
|
||||||
|
amount: [{ required: true, message: "金额不能为空", trigger: "blur" }],
|
||||||
rate: [
|
rate: [
|
||||||
{required: true, message: "分成比例不能为空", trigger: "blur"}
|
{ required: true, message: "分成比例不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then(response => {
|
getOptions().then((response) => {
|
||||||
this.options = response.data.reduce((opts, cur) => {
|
this.options = response.data.reduce((opts, cur) => {
|
||||||
// if (cur.postCode.startsWith('planner')) {
|
// if (cur.postCode.startsWith('planner')) {
|
||||||
// return opts;
|
// return opts;
|
||||||
@ -253,28 +295,42 @@
|
|||||||
if (!opts[cur.postId]) {
|
if (!opts[cur.postId]) {
|
||||||
opts[cur.postId] = [];
|
opts[cur.postId] = [];
|
||||||
}
|
}
|
||||||
opts[cur.postId].push({dictValue: cur.userId, dictLabel: cur.userName});
|
opts[cur.postId].push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
|
|
||||||
if (!this.postIdOptions.some(opt => opt.dictValue === cur.postId)) {
|
if (!this.postIdOptions.some((opt) => opt.dictValue === cur.postId)) {
|
||||||
this.postIdOptions.push({dictValue: cur.postId, dictLabel: cur.postName});
|
this.postIdOptions.push({
|
||||||
|
dictValue: cur.postId,
|
||||||
|
dictLabel: cur.postName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!this.totalUserIdOptions.some(opt => opt.dictValue === cur.userId)) {
|
if (
|
||||||
this.totalUserIdOptions.push({dictValue: cur.userId, dictLabel: cur.userName});
|
!this.totalUserIdOptions.some((opt) => opt.dictValue === cur.userId)
|
||||||
|
) {
|
||||||
|
this.totalUserIdOptions.push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return opts;
|
return opts;
|
||||||
}, {});
|
}, {});
|
||||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询业务提成比例列表 */
|
/** 查询业务提成比例列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listCommision(this.queryParams).then(response => {
|
listCommision(this.queryParams).then((response) => {
|
||||||
this.commisionList = response.rows.reduce((arr, cur, idx, oriArr) => {
|
this.commisionList = response.rows.reduce((arr, cur, idx, oriArr) => {
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
if (arr[i].some(e => e.userId === cur.userId && e.postId === cur.postId)) {
|
if (
|
||||||
|
arr[i].some(
|
||||||
|
(e) => e.userId === cur.userId && e.postId === cur.postId
|
||||||
|
)
|
||||||
|
) {
|
||||||
arr[i].push(cur);
|
arr[i].push(cur);
|
||||||
break;
|
break;
|
||||||
} else if (i === arr.length - 1) {
|
} else if (i === arr.length - 1) {
|
||||||
@ -287,27 +343,32 @@
|
|||||||
}
|
}
|
||||||
if (idx === oriArr.length - 1) {
|
if (idx === oriArr.length - 1) {
|
||||||
const finalArr = [];
|
const finalArr = [];
|
||||||
arr.forEach(tmpArr => {
|
arr.forEach((tmpArr) => {
|
||||||
tmpArr.sort((a, b) => a.amount - b.amount)
|
tmpArr
|
||||||
|
.sort((a, b) => a.amount - b.amount)
|
||||||
.forEach((elm, elmIdx) => {
|
.forEach((elm, elmIdx) => {
|
||||||
finalArr.push({
|
finalArr.push({
|
||||||
...elm,
|
...elm,
|
||||||
userSpan: elmIdx ? {
|
userSpan: elmIdx
|
||||||
|
? {
|
||||||
rowspan: 0,
|
rowspan: 0,
|
||||||
colspan: 0
|
colspan: 0,
|
||||||
} : {
|
|
||||||
rowspan: tmpArr.length,
|
|
||||||
colspan: 1
|
|
||||||
},
|
|
||||||
postSpan: elmIdx ? {
|
|
||||||
rowspan: 0,
|
|
||||||
colspan: 0
|
|
||||||
} : {
|
|
||||||
rowspan: tmpArr.length,
|
|
||||||
colspan: 1
|
|
||||||
}
|
}
|
||||||
})
|
: {
|
||||||
})
|
rowspan: tmpArr.length,
|
||||||
|
colspan: 1,
|
||||||
|
},
|
||||||
|
postSpan: elmIdx
|
||||||
|
? {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
rowspan: tmpArr.length,
|
||||||
|
colspan: 1,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return finalArr;
|
return finalArr;
|
||||||
}
|
}
|
||||||
@ -339,7 +400,7 @@
|
|||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
remark: null
|
remark: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -356,9 +417,9 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.ruleId)
|
this.ids = selection.map((item) => item.ruleId);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -369,8 +430,8 @@
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const ruleId = row.ruleId || this.ids
|
const ruleId = row.ruleId || this.ids;
|
||||||
getCommision(ruleId, row.postId).then(response => {
|
getCommision(ruleId, row.postId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.userIdOptions = this.options[this.form.postId];
|
this.userIdOptions = this.options[this.form.postId];
|
||||||
this.open = true;
|
this.open = true;
|
||||||
@ -379,10 +440,10 @@
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.ruleId != null) {
|
if (this.form.ruleId != null) {
|
||||||
updateCommision(this.form).then(response => {
|
updateCommision(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -390,7 +451,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addCommision(this.form).then(response => {
|
addCommision(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -404,33 +465,41 @@
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ruleIds = row.ruleId || this.ids;
|
const ruleIds = row.ruleId || this.ids;
|
||||||
this.$confirm('是否确认删除业务提成比例编号为"' + ruleIds + '"的数据项?', "警告", {
|
this.$confirm(
|
||||||
|
'是否确认删除业务提成比例编号为"' + ruleIds + '"的数据项?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
}
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delCommision(ruleIds);
|
return delCommision(ruleIds);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
this.$confirm("是否确认导出所有业务提成比例数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportCommision(queryParams);
|
return exportCommision(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
return row.userSpan;
|
return row.userSpan;
|
||||||
} else if (columnIndex === 1) {
|
} else if (columnIndex === 1) {
|
||||||
@ -447,7 +516,7 @@
|
|||||||
}
|
}
|
||||||
this.searchUserIdOptions = this.options[postId];
|
this.searchUserIdOptions = this.options[postId];
|
||||||
this.queryParams.userId = null;
|
this.queryParams.userId = null;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="岗位" prop="postId">
|
<el-form-item label="岗位" prop="postId">
|
||||||
<el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable size="small" @change="searchPostChange">
|
<el-select
|
||||||
|
v-model="queryParams.postId"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@change="searchPostChange"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in postIdOptions"
|
v-for="dict in postIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -12,7 +24,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务员" prop="userId">
|
<el-form-item label="业务员" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择业务员"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in searchUserIdOptions"
|
v-for="dict in searchUserIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -26,12 +44,21 @@
|
|||||||
v-model="month"
|
v-model="month"
|
||||||
@change="monthRangeChange"
|
@change="monthRangeChange"
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="选择月">
|
placeholder="选择月"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -46,37 +73,43 @@
|
|||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="commisionList"
|
<el-table
|
||||||
@selection-change="handleSelectionChange">
|
v-loading="loading"
|
||||||
<el-table-column label="业务员" align="center" prop="userName"/>
|
:data="commisionList"
|
||||||
<el-table-column label="岗位" align="center" prop="postName"/>
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column label="业务员" align="center" prop="userName" />
|
||||||
|
<el-table-column label="岗位" align="center" prop="postName" />
|
||||||
<el-table-column label="总金额" align="center" prop="amount">
|
<el-table-column label="总金额" align="center" prop="amount">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{toThousands(scope.row.amount)}}
|
{{ toThousands(scope.row.amount) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="比例" align="center" prop="rate">
|
<el-table-column label="比例" align="center" prop="rate">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.rate + '%'}}
|
{{ scope.row.rate + "%" }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="提成" align="center" prop="commision">
|
<el-table-column label="提成" align="center" prop="commision">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.commision.toFixed(2)}}
|
{{ scope.row.commision.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="下月应发提成" align="center" prop="commision">
|
<el-table-column label="下月应发提成" align="center" prop="commision">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.commision.toFixed(2)}}
|
{{ scope.row.commision.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -86,16 +119,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { detailCommision, exportCommision } from "@/api/custom/commision";
|
||||||
detailCommision,
|
|
||||||
exportCommision,
|
|
||||||
} from "@/api/custom/commision";
|
|
||||||
|
|
||||||
import {getOptions} from "@/api/custom/order";
|
import { getOptions } from "@/api/custom/global";
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CommisionDetail",
|
name: "CommisionDetail",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -138,7 +168,7 @@
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then(response => {
|
getOptions().then((response) => {
|
||||||
this.options = response.data.reduce((opts, cur) => {
|
this.options = response.data.reduce((opts, cur) => {
|
||||||
// if (cur.postCode.startsWith('planner')) {
|
// if (cur.postCode.startsWith('planner')) {
|
||||||
// return opts;
|
// return opts;
|
||||||
@ -146,32 +176,49 @@
|
|||||||
if (!opts[cur.postId]) {
|
if (!opts[cur.postId]) {
|
||||||
opts[cur.postId] = [];
|
opts[cur.postId] = [];
|
||||||
}
|
}
|
||||||
opts[cur.postId].push({dictValue: cur.userId, dictLabel: cur.userName});
|
opts[cur.postId].push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
|
|
||||||
if (!this.postIdOptions.some(opt => opt.dictValue === cur.postId)) {
|
if (!this.postIdOptions.some((opt) => opt.dictValue === cur.postId)) {
|
||||||
this.postIdOptions.push({dictValue: cur.postId, dictLabel: cur.postName});
|
this.postIdOptions.push({
|
||||||
|
dictValue: cur.postId,
|
||||||
|
dictLabel: cur.postName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!this.totalUserIdOptions.some(opt => opt.dictValue === cur.userId)) {
|
if (
|
||||||
this.totalUserIdOptions.push({dictValue: cur.userId, dictLabel: cur.userName});
|
!this.totalUserIdOptions.some((opt) => opt.dictValue === cur.userId)
|
||||||
|
) {
|
||||||
|
this.totalUserIdOptions.push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return opts;
|
return opts;
|
||||||
}, {});
|
}, {});
|
||||||
this.postIdOptions = this.postIdOptions.sort((a, b) => a.dictValue - b.dictValue);
|
this.postIdOptions = this.postIdOptions.sort(
|
||||||
|
(a, b) => a.dictValue - b.dictValue
|
||||||
|
);
|
||||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||||
})
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询业务提成比例列表 */
|
/** 查询业务提成比例列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')];
|
const dateRange = [
|
||||||
|
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||||
|
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||||
|
];
|
||||||
// console.log(dateRange)
|
// console.log(dateRange)
|
||||||
detailCommision(this.addDateRange(this.queryParams, dateRange)).then(response => {
|
detailCommision(this.addDateRange(this.queryParams, dateRange)).then(
|
||||||
|
(response) => {
|
||||||
this.commisionList = response.rows;
|
this.commisionList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 业务员字典翻译
|
// 业务员字典翻译
|
||||||
userIdFormat(row, column) {
|
userIdFormat(row, column) {
|
||||||
@ -195,23 +242,25 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.ruleId)
|
this.ids = selection.map((item) => item.ruleId);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
this.$confirm("是否确认导出所有业务提成比例数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportCommision(queryParams);
|
return exportCommision(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
monthRangeChange(time) {
|
monthRangeChange(time) {
|
||||||
this.month = time;
|
this.month = time;
|
||||||
@ -226,7 +275,7 @@
|
|||||||
}
|
}
|
||||||
this.searchUserIdOptions = this.options[postId];
|
this.searchUserIdOptions = this.options[postId];
|
||||||
this.queryParams.userId = null;
|
this.queryParams.userId = null;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="岗位" prop="postId">
|
<el-form-item label="岗位" prop="postId">
|
||||||
<el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable size="small" @change="searchPostChange">
|
<el-select
|
||||||
|
v-model="queryParams.postId"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@change="searchPostChange"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in postIdOptions"
|
v-for="dict in postIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -12,7 +24,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务员" prop="userId">
|
<el-form-item label="业务员" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择业务员"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in searchUserIdOptions"
|
v-for="dict in searchUserIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -26,20 +44,31 @@
|
|||||||
v-model="month"
|
v-model="month"
|
||||||
@change="monthRangeChange"
|
@change="monthRangeChange"
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="选择月份">
|
placeholder="选择月份"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div><span style="color:#E6A23C;font-family:PingFang SC">
|
<div>
|
||||||
|
<span style="color: #e6a23c; font-family: PingFang SC">
|
||||||
注意事项:
|
注意事项:
|
||||||
<br/>1、2021年1月开始的订单才开始按天计算提成,只计算已审核的订单
|
<br />1、2021年1月开始的订单才开始按天计算提成,只计算已审核的订单
|
||||||
<br/>2、发工资日期定为每月15号,若当前日期大于15号,则认定上个月的工资已发放
|
<br />2、发工资日期定为每月15号,若当前日期大于15号,则认定上个月的工资已发放
|
||||||
</span></div>
|
</span>
|
||||||
<el-row :gutter="10" class="mb8" style="margin-top:10px;">
|
</div>
|
||||||
|
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
@ -50,71 +79,113 @@
|
|||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="commisionList"
|
<el-table
|
||||||
@selection-change="handleSelectionChange" stripe :row-class-name="tableRowClassName">
|
v-loading="loading"
|
||||||
|
:data="commisionList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
stripe
|
||||||
|
:row-class-name="tableRowClassName"
|
||||||
|
>
|
||||||
<el-table-column label="业务员" align="center" prop="nickName">
|
<el-table-column label="业务员" align="center" prop="nickName">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.nickName }}</span>
|
<span>{{ scope.row.nickName }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="岗位" align="center" prop="postName"/>
|
<el-table-column label="岗位" align="center" prop="postName" />
|
||||||
<el-table-column label="总提成" align="center" prop="totalCommissionAmount">
|
<el-table-column
|
||||||
|
label="总提成"
|
||||||
|
align="center"
|
||||||
|
prop="totalCommissionAmount"
|
||||||
|
>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.totalCommissionAmount.toFixed(fixLength)}}
|
{{ scope.row.totalCommissionAmount.toFixed(fixLength) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="已发放提成" align="center" prop="totalHasSentCommissionAmount">
|
<el-table-column
|
||||||
|
label="已发放提成"
|
||||||
|
align="center"
|
||||||
|
prop="totalHasSentCommissionAmount"
|
||||||
|
>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.totalHasSentCommissionAmount.toFixed(fixLength)}}
|
{{ scope.row.totalHasSentCommissionAmount.toFixed(fixLength) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="未发放提成" align="center" prop="totalNotSentCommissionAmount">
|
<el-table-column
|
||||||
|
label="未发放提成"
|
||||||
|
align="center"
|
||||||
|
prop="totalNotSentCommissionAmount"
|
||||||
|
>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.totalNotSentCommissionAmount.toFixed(fixLength)}}
|
{{ scope.row.totalNotSentCommissionAmount.toFixed(fixLength) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="下月应发提成" align="center" prop="nextMonthCommission">
|
<el-table-column
|
||||||
|
label="下月应发提成"
|
||||||
|
align="center"
|
||||||
|
prop="nextMonthCommission"
|
||||||
|
>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.nextMonthCommission.toFixed(fixLength)}}
|
{{ scope.row.nextMonthCommission.toFixed(fixLength) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-button type="text" @click="openFormDialog('查看发放计划', scope.row)">查看发放计划</el-button>
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="openFormDialog('查看发放计划', scope.row)"
|
||||||
|
>查看发放计划</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!--<el-table-column label="提成" align="center" prop="commissionTotalAmount"></el-table-column>-->
|
<!--<el-table-column label="提成" align="center" prop="commissionTotalAmount"></el-table-column>-->
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
<el-dialog title="提成发放计划" :visible.sync="sendCommissionPlanTable" width="40%" align="center">
|
title="提成发放计划"
|
||||||
<el-table :data="sendCommissionPlan.list" show-summary :summary-method="getSummaries">
|
:visible.sync="sendCommissionPlanTable"
|
||||||
<el-table-column property="nickName" label="姓名" width="150"></el-table-column>
|
width="40%"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
:data="sendCommissionPlan.list"
|
||||||
|
show-summary
|
||||||
|
:summary-method="getSummaries"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
property="nickName"
|
||||||
|
label="姓名"
|
||||||
|
width="150"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column property="yearMonth" label="提成月份" width="200">
|
<el-table-column property="yearMonth" label="提成月份" width="200">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.yearMonth.substring(0, 4)}}年{{scope.row.yearMonth.substring(4)}}月
|
{{ scope.row.yearMonth.substring(0, 4) }}年{{
|
||||||
|
scope.row.yearMonth.substring(4)
|
||||||
|
}}月
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column property="yearMonthCommission" label="提成金额" width="100">
|
<el-table-column
|
||||||
|
property="yearMonthCommission"
|
||||||
|
label="提成金额"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
{{scope.row.yearMonthCommission.toFixed(fixLength)}}
|
{{ scope.row.yearMonthCommission.toFixed(fixLength) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -123,25 +194,24 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-table .warning-row {
|
.el-table .warning-row {
|
||||||
background: oldlace;
|
background: oldlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .success-row {
|
.el-table .success-row {
|
||||||
/*background: #1890FF;*/
|
/*background: #1890FF;*/
|
||||||
color: #1890FF
|
color: #1890ff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { detailDayCommision, exportDayCommision } from "@/api/custom/commision";
|
||||||
detailDayCommision, exportDayCommision} from "@/api/custom/commision";
|
|
||||||
|
|
||||||
import {getOptions} from "@/api/custom/order";
|
import { getOptions } from "@/api/custom/global";
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CommisionDayDetail",
|
name: "CommisionDayDetail",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -181,46 +251,63 @@
|
|||||||
postId: null,
|
postId: null,
|
||||||
},
|
},
|
||||||
sendCommissionPlanTable: false,
|
sendCommissionPlanTable: false,
|
||||||
sendCommissionPlan:{},
|
sendCommissionPlan: {},
|
||||||
fixLength: 2
|
fixLength: 2,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then(response => {
|
getOptions().then((response) => {
|
||||||
this.options = response.data.reduce((opts, cur) => {
|
this.options = response.data.reduce((opts, cur) => {
|
||||||
if (cur.postCode != ('after_sale') && cur.postCode != 'nutri') {
|
if (cur.postCode != "after_sale" && cur.postCode != "nutri") {
|
||||||
return opts;
|
return opts;
|
||||||
}
|
}
|
||||||
if (!opts[cur.postId]) {
|
if (!opts[cur.postId]) {
|
||||||
opts[cur.postId] = [];
|
opts[cur.postId] = [];
|
||||||
}
|
}
|
||||||
opts[cur.postId].push({dictValue: cur.userId, dictLabel: cur.userName});
|
opts[cur.postId].push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
|
|
||||||
if (!this.postIdOptions.some(opt => opt.dictValue === cur.postId)) {
|
if (!this.postIdOptions.some((opt) => opt.dictValue === cur.postId)) {
|
||||||
this.postIdOptions.push({dictValue: cur.postId, dictLabel: cur.postName});
|
this.postIdOptions.push({
|
||||||
|
dictValue: cur.postId,
|
||||||
|
dictLabel: cur.postName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!this.totalUserIdOptions.some(opt => opt.dictValue === cur.userId)) {
|
if (
|
||||||
this.totalUserIdOptions.push({dictValue: cur.userId, dictLabel: cur.userName});
|
!this.totalUserIdOptions.some((opt) => opt.dictValue === cur.userId)
|
||||||
|
) {
|
||||||
|
this.totalUserIdOptions.push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return opts;
|
return opts;
|
||||||
}, {});
|
}, {});
|
||||||
this.postIdOptions = this.postIdOptions.sort((a, b) => a.dictValue - b.dictValue);
|
this.postIdOptions = this.postIdOptions.sort(
|
||||||
|
(a, b) => a.dictValue - b.dictValue
|
||||||
|
);
|
||||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||||
})
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询业务提成比例列表 */
|
/** 查询业务提成比例列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')];
|
const dateRange = [
|
||||||
|
dayjs(this.month).startOf("month").format("YYYY-MM-DD"),
|
||||||
|
dayjs(this.month).endOf("month").format("YYYY-MM-DD"),
|
||||||
|
];
|
||||||
// console.log(dateRange)
|
// console.log(dateRange)
|
||||||
detailDayCommision(this.addDateRange(this.queryParams, dateRange)).then(response => {
|
detailDayCommision(this.addDateRange(this.queryParams, dateRange)).then(
|
||||||
|
(response) => {
|
||||||
this.commisionList = response.rows;
|
this.commisionList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 业务员字典翻译
|
// 业务员字典翻译
|
||||||
userIdFormat(row, column) {
|
userIdFormat(row, column) {
|
||||||
@ -244,23 +331,25 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.ruleId)
|
this.ids = selection.map((item) => item.ruleId);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
this.$confirm("是否确认导出所有业务提成比例数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportDayCommision(queryParams);
|
return exportDayCommision(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
monthRangeChange(time) {
|
monthRangeChange(time) {
|
||||||
this.month = time;
|
this.month = time;
|
||||||
@ -276,10 +365,10 @@
|
|||||||
this.searchUserIdOptions = this.options[postId];
|
this.searchUserIdOptions = this.options[postId];
|
||||||
this.queryParams.userId = null;
|
this.queryParams.userId = null;
|
||||||
},
|
},
|
||||||
openFormDialog(title, row){
|
openFormDialog(title, row) {
|
||||||
this.sendCommissionPlan = {};
|
this.sendCommissionPlan = {};
|
||||||
var total = 0;
|
var total = 0;
|
||||||
if(row.sendDetailList != null){
|
if (row.sendDetailList != null) {
|
||||||
row.sendDetailList.forEach(function (e) {
|
row.sendDetailList.forEach(function (e) {
|
||||||
e.nickName = row.nickName;
|
e.nickName = row.nickName;
|
||||||
total += e.yearMonthCommission;
|
total += e.yearMonthCommission;
|
||||||
@ -295,25 +384,25 @@
|
|||||||
const sums = [];
|
const sums = [];
|
||||||
columns.forEach((column, index) => {
|
columns.forEach((column, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
sums[index] = '合计';
|
sums[index] = "合计";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(index == 1){
|
if (index == 1) {
|
||||||
sums[index] = data.length +"个月";
|
sums[index] = data.length + "个月";
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if(index == 2){
|
if (index == 2) {
|
||||||
sums[index] = this.sendCommissionPlan.total;
|
sums[index] = this.sendCommissionPlan.total;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return sums;
|
return sums;
|
||||||
},
|
},
|
||||||
tableRowClassName({row, rowIndex}) {
|
tableRowClassName({ row, rowIndex }) {
|
||||||
if(this.commisionList.length == rowIndex+1){
|
if (this.commisionList.length == rowIndex + 1) {
|
||||||
return "success-row";
|
return "success-row";
|
||||||
}
|
}
|
||||||
return '';
|
return "";
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="合同编号" prop="id">
|
<el-form-item label="合同编号" prop="id">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.id"
|
v-model="queryParams.id"
|
||||||
@ -29,11 +35,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主营养师" prop="nutritionistId">
|
<el-form-item label="主营养师" prop="nutritionistId">
|
||||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择主营养师" clearable size="small">
|
<el-select
|
||||||
<el-option v-for="dict in nutritionistIdOptions"
|
v-model="queryParams.nutritionistId"
|
||||||
|
placeholder="请选择主营养师"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="parseInt(dict.dictValue)"/>
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同状态" prop="status">
|
<el-form-item label="合同状态" prop="status">
|
||||||
@ -47,8 +60,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -92,45 +113,103 @@
|
|||||||
<!-- v-hasPermi="['custom:contract:export']"-->
|
<!-- v-hasPermi="['custom:contract:export']"-->
|
||||||
<!-- >导出</el-button>-->
|
<!-- >导出</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="contractList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||||
<el-table-column label="合同编号" align="center" prop="id" fixed="left" width="150"/>
|
<el-table-column
|
||||||
<el-table-column label="合同状态" align="center" prop="status" width="80" fixed="left">
|
label="合同编号"
|
||||||
|
align="center"
|
||||||
|
prop="id"
|
||||||
|
fixed="left"
|
||||||
|
width="150"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="合同状态"
|
||||||
|
align="center"
|
||||||
|
prop="status"
|
||||||
|
width="80"
|
||||||
|
fixed="left"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag
|
||||||
:type="scope.row.status === 'yes' ? 'success' : 'danger'"
|
:type="scope.row.status === 'yes' ? 'success' : 'danger'"
|
||||||
disable-transitions>
|
disable-transitions
|
||||||
{{scope.row.status === 'yes' ? '已签订':'未签订'}}
|
>
|
||||||
|
{{ scope.row.status === "yes" ? "已签订" : "未签订" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="客户姓名" align="center" prop="name" fixed="left" width="200"/>
|
<el-table-column
|
||||||
<el-table-column label="证件号" align="center" prop="cusId" width="190"/>
|
label="客户姓名"
|
||||||
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
align="center"
|
||||||
<el-table-column label="服务时间" align="center" prop="serveTime" :formatter="serveTimeFormat" width="100"/>
|
prop="name"
|
||||||
<el-table-column label="服务承诺" align="center" prop="servePromise" width="100">
|
fixed="left"
|
||||||
|
width="200"
|
||||||
|
/>
|
||||||
|
<el-table-column label="证件号" align="center" prop="cusId" width="190" />
|
||||||
|
<el-table-column label="电话" align="center" prop="phone" width="120" />
|
||||||
|
<el-table-column
|
||||||
|
label="服务时间"
|
||||||
|
align="center"
|
||||||
|
prop="serveTime"
|
||||||
|
:formatter="serveTimeFormat"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="服务承诺"
|
||||||
|
align="center"
|
||||||
|
prop="servePromise"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{scope.row.servePromise ? `${scope.row.servePromise}斤`: ''}}
|
{{ scope.row.servePromise ? `${scope.row.servePromise}斤` : "" }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="金额" align="center" prop="amount" width="100"/>
|
<el-table-column label="金额" align="center" prop="amount" width="100" />
|
||||||
<el-table-column label="调理项目" align="center" prop="projectName" width="100"/>
|
<el-table-column
|
||||||
<el-table-column label="签订时间" align="center" prop="updateTime" width="180"/>
|
label="调理项目"
|
||||||
|
align="center"
|
||||||
|
prop="projectName"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="updateTime"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
<el-table-column label="合同地址" align="center" prop="path" width="80">
|
<el-table-column label="合同地址" align="center" prop="path" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" icon="el-icon-copy-document" @click="handleCopy(scope.row.path)" class="copyBtn"
|
<el-button
|
||||||
:data-clipboard-text="copyValue">复制
|
type="text"
|
||||||
|
icon="el-icon-copy-document"
|
||||||
|
@click="handleCopy(scope.row.path)"
|
||||||
|
class="copyBtn"
|
||||||
|
:data-clipboard-text="copyValue"
|
||||||
|
>复制
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" width="120"/>
|
<el-table-column label="备注" align="center" prop="remark" width="120" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
fixed="right"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.status==='yes'"
|
v-if="scope.row.status === 'yes'"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-view"
|
icon="el-icon-view"
|
||||||
@ -150,7 +229,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -161,29 +240,52 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="调理项目" prop="projectId">
|
<el-form-item label="调理项目" prop="projectId">
|
||||||
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
|
<el-select
|
||||||
<el-option v-for="dict in conditioningProjectIdOption"
|
v-model="form.projectId"
|
||||||
|
placeholder="请选择调理项目"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in conditioningProjectIdOption"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="parseInt(dict.dictValue)"/>
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="客户姓名" prop="name">
|
<el-form-item label="客户姓名" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
<el-input v-model="form.name" placeholder="请输入客户姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="金额" prop="amount">
|
<el-form-item label="金额" prop="amount">
|
||||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0">
|
<el-form-item
|
||||||
<el-input style="width: 193px; margin-right: 12px" v-model="form.servePromise" placeholder="请输入服务承诺"/>
|
label="服务承诺"
|
||||||
|
prop="servePromise"
|
||||||
|
v-show="form.projectId == 0"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
style="width: 193px; margin-right: 12px"
|
||||||
|
v-model="form.servePromise"
|
||||||
|
placeholder="请输入服务承诺"
|
||||||
|
/>
|
||||||
斤
|
斤
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营养师" prop="nutritionistId">
|
<el-form-item label="营养师" prop="nutritionistId">
|
||||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
<el-select
|
||||||
<el-option v-for="dict in nutritionistIdOptions"
|
v-model="form.nutritionistId"
|
||||||
|
placeholder="请选择营养师"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="parseInt(dict.dictValue)"/>
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务时间" prop="serveTime">
|
<el-form-item label="服务时间" prop="serveTime">
|
||||||
@ -197,7 +299,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -209,18 +315,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addContract, delContract, listContract} from "@/api/custom/contract";
|
import { addContract, delContract, listContract } from "@/api/custom/contract";
|
||||||
|
|
||||||
import {getOptions} from "@/api/custom/order";
|
import Clipboard from "clipboard";
|
||||||
|
|
||||||
import Clipboard from 'clipboard';
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Contract",
|
name: "Contract",
|
||||||
data() {
|
data() {
|
||||||
const checkServePromise = (rule, value, callback) => {
|
const checkServePromise = (rule, value, callback) => {
|
||||||
if (this.form.projectId == 0 && !value) {
|
if (this.form.projectId == 0 && !value) {
|
||||||
return callback(new Error('请输入服务承诺'))
|
return callback(new Error("请输入服务承诺"));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
@ -250,9 +356,9 @@
|
|||||||
// 签约状态字典
|
// 签约状态字典
|
||||||
signStatusOptions: [],
|
signStatusOptions: [],
|
||||||
//调理项目字典
|
//调理项目字典
|
||||||
conditioningProjectIdOption:[],
|
conditioningProjectIdOption: [],
|
||||||
//
|
//
|
||||||
copyValue: '',
|
copyValue: "",
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -266,14 +372,12 @@
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
projectId:[
|
projectId: [
|
||||||
{required: true, message: "请选择调理项目", trigger: "blur"}
|
{ required: true, message: "请选择调理项目", trigger: "blur" },
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
|
||||||
],
|
],
|
||||||
|
name: [{ required: true, message: "请输入客户姓名", trigger: "blur" }],
|
||||||
amount: [
|
amount: [
|
||||||
{required: true, message: "请输入签订金额", trigger: "blur"},
|
{ required: true, message: "请输入签订金额", trigger: "blur" },
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
@ -282,44 +386,38 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
servePromise: [
|
servePromise: [
|
||||||
{required: true, trigger: "blur", validator: checkServePromise}
|
{ required: true, trigger: "blur", validator: checkServePromise },
|
||||||
],
|
],
|
||||||
serveTime: [
|
serveTime: [
|
||||||
{required: true, message: "请选择服务时间", trigger: "blur"}
|
{ required: true, message: "请选择服务时间", trigger: "blur" },
|
||||||
],
|
],
|
||||||
nutritionistId: [
|
nutritionistId: [
|
||||||
{required: true, message: "请选择营养师", trigger: "blur"}
|
{ required: true, message: "请选择营养师", trigger: "blur" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then(response => {
|
|
||||||
const options = response.data.reduce((opts, cur) => {
|
this.getDicts("cus_serve_time").then((response) => {
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [{dictValue: 0, dictLabel: ' ', remark: null}];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
|
|
||||||
return opts;
|
|
||||||
}, {})
|
|
||||||
this.nutritionistIdOptions = options['nutri'] || [];
|
|
||||||
})
|
|
||||||
this.getDicts("cus_serve_time").then(response => {
|
|
||||||
this.serveTimeOptions = response.data;
|
this.serveTimeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("cus_sign_status").then(response => {
|
this.getDicts("cus_sign_status").then((response) => {
|
||||||
this.signStatusOptions = response.data;
|
this.signStatusOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("conditioning_project").then(response => {
|
this.getDicts("conditioning_project").then((response) => {
|
||||||
this.conditioningProjectIdOption = response.data;
|
this.conditioningProjectIdOption = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(["nutritionistIdOptions"]),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询合同列表 */
|
/** 查询合同列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listContract(this.queryParams).then(response => {
|
listContract(this.queryParams).then((response) => {
|
||||||
this.contractList = response.rows;
|
this.contractList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -339,29 +437,40 @@
|
|||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.remark === 'default');
|
const defaultNutritionist = this.nutritionistIdOptions.find(
|
||||||
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
|
(opt) => opt.remark === "default"
|
||||||
|
);
|
||||||
|
const defaultProjectIdOption = this.conditioningProjectIdOption.find(
|
||||||
|
(opt) => opt.remark === "default"
|
||||||
|
);
|
||||||
|
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
|
projectId: defaultProjectIdOption
|
||||||
|
? parseInt(defaultProjectIdOption.dictValue)
|
||||||
|
: null,
|
||||||
name: null,
|
name: null,
|
||||||
phone: null,
|
phone: null,
|
||||||
serveTime: null,
|
serveTime: null,
|
||||||
amount: null,
|
amount: null,
|
||||||
path: null,
|
path: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
nutritionistId: defaultNutritionist
|
||||||
|
? parseInt(defaultNutritionist.dictValue)
|
||||||
|
: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
remark: null
|
remark: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
// 主营养师字典翻译
|
// 主营养师字典翻译
|
||||||
nutritionistIdFormat(row, column) {
|
nutritionistIdFormat(row, column) {
|
||||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
return this.selectDictLabel(
|
||||||
|
this.nutritionistIdOptions,
|
||||||
|
row.nutritionistId
|
||||||
|
);
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
@ -375,9 +484,9 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -397,7 +506,7 @@
|
|||||||
// },
|
// },
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// if (this.form.id != null) {
|
// if (this.form.id != null) {
|
||||||
// updateContract(this.form).then(response => {
|
// updateContract(this.form).then(response => {
|
||||||
@ -408,11 +517,14 @@
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// } else {
|
// } else {
|
||||||
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
|
this.form.tutor = this.selectDictLabel(
|
||||||
if(this.form.projectId != 0){
|
this.nutritionistIdOptions,
|
||||||
|
this.form.nutritionistId
|
||||||
|
);
|
||||||
|
if (this.form.projectId != 0) {
|
||||||
this.form.servePromise = null;
|
this.form.servePromise = null;
|
||||||
}
|
}
|
||||||
addContract(this.form).then(response => {
|
addContract(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -429,14 +541,16 @@
|
|||||||
this.$confirm('是否确认删除合同编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除合同编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function () {
|
})
|
||||||
|
.then(function () {
|
||||||
return delContract(ids);
|
return delContract(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
// handleExport() {
|
// handleExport() {
|
||||||
@ -453,19 +567,19 @@
|
|||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
handleCopy(path) {
|
handleCopy(path) {
|
||||||
this.copyValue = window.location.origin.replace('manage', 'sign') + path;
|
this.copyValue = window.location.origin.replace("manage", "sign") + path;
|
||||||
const btnCopy = new Clipboard('.copyBtn');
|
const btnCopy = new Clipboard(".copyBtn");
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '拷贝成功',
|
message: "拷贝成功",
|
||||||
type: 'success'
|
type: "success",
|
||||||
});
|
});
|
||||||
// btnCopy.destroy();
|
// btnCopy.destroy();
|
||||||
},
|
},
|
||||||
handleLook(path) {
|
handleLook(path) {
|
||||||
const url = window.location.origin.replace('manage', 'sign') + path;
|
const url = window.location.origin.replace("manage", "sign") + path;
|
||||||
// const url = "http://stsign.busyinn.com" + path;
|
// const url = "http://stsign.busyinn.com" + path;
|
||||||
window.open(url, '_blank');
|
window.open(url, "_blank");
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -149,7 +149,11 @@
|
|||||||
prop="salesman"
|
prop="salesman"
|
||||||
:formatter="preSaleIdFormat"
|
:formatter="preSaleIdFormat"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="订单" align="center" v-hasPermi="['custom:order:list']">
|
<el-table-column
|
||||||
|
label="订单"
|
||||||
|
align="center"
|
||||||
|
v-hasPermi="['custom:order:list']"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -159,7 +163,11 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="合同" align="center" v-hasPermi="['custom:contract:list']">
|
<el-table-column
|
||||||
|
label="合同"
|
||||||
|
align="center"
|
||||||
|
v-hasPermi="['custom:contract:list']"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -169,7 +177,11 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="健康评估" align="center" v-hasPermi="['custom:healthy:list']">
|
<el-table-column
|
||||||
|
label="健康评估"
|
||||||
|
align="center"
|
||||||
|
v-hasPermi="['custom:healthy:list']"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -179,7 +191,11 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="外食热量统计" align="center" v-hasPermi="['custom:foodHeatStatistics:list']">
|
<el-table-column
|
||||||
|
label="外食热量统计"
|
||||||
|
align="center"
|
||||||
|
v-hasPermi="['custom:foodHeatStatistics:list']"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -189,7 +205,11 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="食谱计划" align="center" v-hasPermi="['recipes:recipesPlan:list']">
|
<el-table-column
|
||||||
|
label="食谱计划"
|
||||||
|
align="center"
|
||||||
|
v-hasPermi="['recipes:recipesPlan:list']"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -339,13 +359,11 @@ import {
|
|||||||
} from "@/api/custom/customer";
|
} from "@/api/custom/customer";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
import { getOptions } from "@/api/custom/order";
|
|
||||||
|
|
||||||
import OrderDrawer from "@/components/OrderDrawer";
|
import OrderDrawer from "@/components/OrderDrawer";
|
||||||
import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
|
import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
|
||||||
import ContractDrawer from "@/components/ContractDrawer";
|
import ContractDrawer from "@/components/ContractDrawer";
|
||||||
import HeatStatisticsDrawer from "@/components/HeatStatisticsDrawer";
|
import HeatStatisticsDrawer from "@/components/HeatStatisticsDrawer";
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Customer",
|
name: "Customer",
|
||||||
@ -353,7 +371,7 @@ export default {
|
|||||||
"order-drawer": OrderDrawer,
|
"order-drawer": OrderDrawer,
|
||||||
"physical-signs-dialog": PhysicalSignsDialog,
|
"physical-signs-dialog": PhysicalSignsDialog,
|
||||||
"contract-drawer": ContractDrawer,
|
"contract-drawer": ContractDrawer,
|
||||||
"heatStatisticsDrawer": HeatStatisticsDrawer
|
heatStatisticsDrawer: HeatStatisticsDrawer,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const userId = store.getters && store.getters.userId;
|
const userId = store.getters && store.getters.userId;
|
||||||
@ -374,13 +392,13 @@ export default {
|
|||||||
// 客户档案表格数据
|
// 客户档案表格数据
|
||||||
customerCenterList: [],
|
customerCenterList: [],
|
||||||
// 售前字典
|
// 售前字典
|
||||||
preSaleIdOptions: [],
|
// preSaleIdOptions: [],
|
||||||
// 售后字典
|
// 售后字典
|
||||||
afterSaleIdOptions: [],
|
// afterSaleIdOptions: [],
|
||||||
// 主营养师字典
|
// 主营养师字典
|
||||||
nutritionistIdOptions: [],
|
// nutritionistIdOptions: [],
|
||||||
// 助理营养师字典
|
// 助理营养师字典
|
||||||
nutriAssisIdOptions: [],
|
// nutriAssisIdOptions: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
@ -437,25 +455,14 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then((response) => {
|
},
|
||||||
const options = response.data.reduce((opts, cur) => {
|
computed: {
|
||||||
if (!opts[cur.postCode]) {
|
...mapGetters([
|
||||||
opts[cur.postCode] = [
|
"preSaleIdOptions",
|
||||||
{ dictValue: 0, dictLabel: "无", remark: null },
|
"afterSaleIdOptions",
|
||||||
];
|
"nutritionistIdOptions",
|
||||||
}
|
"nutriAssisIdOptions",
|
||||||
opts[cur.postCode].push({
|
]),
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
|
||||||
this.nutritionistIdOptions = options["nutri"] || [];
|
|
||||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询客户档案列表 */
|
/** 查询客户档案列表 */
|
||||||
@ -504,7 +511,7 @@ export default {
|
|||||||
handleOnMenuClick(row) {
|
handleOnMenuClick(row) {
|
||||||
// console.log(row);
|
// console.log(row);
|
||||||
},
|
},
|
||||||
handleClickHeatStatistics(row){
|
handleClickHeatStatistics(row) {
|
||||||
this.$refs["heatStatisticsRef"].showDrawer(row);
|
this.$refs["heatStatisticsRef"].showDrawer(row);
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
|
@ -1,16 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="进粉日期" prop="fanTime">
|
<el-form-item label="进粉日期" prop="fanTime">
|
||||||
<el-date-picker clearable style="width: 200px"
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
v-model="queryParams.fanTime"
|
v-model="queryParams.fanTime"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="选择日期">
|
placeholder="选择日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售" prop="userId" label-width="68px">
|
<el-form-item label="销售" prop="userId" label-width="68px">
|
||||||
<el-select v-model="queryParams.userId" placeholder="请选择销售" filterable clearable>
|
<el-select
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请选择销售"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -20,7 +34,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进粉渠道" prop="accountId" label-width="88px">
|
<el-form-item label="进粉渠道" prop="accountId" label-width="88px">
|
||||||
<el-select v-model="queryParams.accountId" filterable placeholder="请选择渠道" clearable>
|
<el-select
|
||||||
|
v-model="queryParams.accountId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择渠道"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in accountIdOptions"
|
v-for="dict in accountIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -30,8 +49,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="margin-left: 20px">
|
<el-form-item style="margin-left: 20px">
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -43,7 +70,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['custom:fanStatistics:add']"
|
v-hasPermi="['custom:fanStatistics:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -53,7 +81,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['custom:fanStatistics:edit']"
|
v-hasPermi="['custom:fanStatistics:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -63,7 +92,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['custom:fanStatistics:remove']"
|
v-hasPermi="['custom:fanStatistics:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -72,16 +102,30 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['custom:fanStatistics:export']"
|
v-hasPermi="['custom:fanStatistics:export']"
|
||||||
>导出</el-button>
|
>导出</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="fanStatisticsList" stripe @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="fanStatisticsList"
|
||||||
|
stripe
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="进粉日期" align="center" prop="fanTime" width="180">
|
<el-table-column
|
||||||
|
label="进粉日期"
|
||||||
|
align="center"
|
||||||
|
prop="fanTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.fanTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.fanTime, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="销售" align="center" prop="userName" />
|
<el-table-column label="销售" align="center" prop="userName" />
|
||||||
@ -94,7 +138,11 @@
|
|||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>-->
|
</el-table-column>-->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -102,43 +150,55 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['custom:fanStatistics:edit']"
|
v-hasPermi="['custom:fanStatistics:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['custom:fanStatistics:remove']"
|
v-hasPermi="['custom:fanStatistics:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
layout="total, slot, sizes, prev, pager, next, jumper"
|
layout="total, slot, sizes, prev, pager, next, jumper"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
>
|
>
|
||||||
<span style="margin-right: 12px;font-size:13px;color:rgb(134 136 140)">总计进粉量: {{totalFanNum}}</span>
|
<span style="margin-right: 12px; font-size: 13px; color: rgb(134 136 140)"
|
||||||
|
>总计进粉量: {{ totalFanNum }}</span
|
||||||
|
>
|
||||||
</pagination>
|
</pagination>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加进粉统计对话框 -->
|
<!-- 添加进粉统计对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="进粉日期" prop="fanTime">
|
<el-form-item label="进粉日期" prop="fanTime">
|
||||||
<el-date-picker clearable style="width: 200px"
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
v-model="form.fanTime"
|
v-model="form.fanTime"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="选择日期">
|
placeholder="选择日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售" prop="userId">
|
<el-form-item label="销售" prop="userId">
|
||||||
<el-select v-model="form.userId" placeholder="请选择销售" filterable clearable size="small">
|
<el-select
|
||||||
|
v-model="form.userId"
|
||||||
|
placeholder="请选择销售"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -147,53 +207,83 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<p style="margin: 20px auto 20px 40px;font-size: 16px;">请先选择销售,再填写每个微信号对应进粉数量</p>
|
<p style="margin: 20px auto 20px 40px; font-size: 16px">
|
||||||
|
请先选择销售,再填写每个微信号对应进粉数量
|
||||||
|
</p>
|
||||||
<div v-if="showWxFlag">
|
<div v-if="showWxFlag">
|
||||||
<div v-for="(item, index) in wxList" style="margin: 10px auto auto 40px;">
|
<div
|
||||||
<span>{{item.wxAccount}}</span><el-input-number controls-position="right" v-model="form.fanNum[index]" style="width: 150px;margin-left: 10px" :min="0" :max="1000000000"></el-input-number>
|
v-for="(item, index) in wxList"
|
||||||
|
style="margin: 10px auto auto 40px"
|
||||||
|
>
|
||||||
|
<span>{{ item.wxAccount }}</span
|
||||||
|
><el-input-number
|
||||||
|
controls-position="right"
|
||||||
|
v-model="form.fanNum[index]"
|
||||||
|
style="width: 150px; margin-left: 10px"
|
||||||
|
:min="0"
|
||||||
|
:max="1000000000"
|
||||||
|
></el-input-number>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer" >
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 修改进粉统计对话框 -->
|
<!-- 修改进粉统计对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="editOpen" width="500px" append-to-body>
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="editOpen"
|
||||||
|
width="500px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<el-form ref="editForm" :model="editForm" :rules="editRules">
|
<el-form ref="editForm" :model="editForm" :rules="editRules">
|
||||||
<el-form-item label="进粉日期" prop="fanTime">
|
<el-form-item label="进粉日期" prop="fanTime">
|
||||||
<el-date-picker clearable style="width: 200px"
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
v-model="editForm.fanTime"
|
v-model="editForm.fanTime"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="选择日期">
|
placeholder="选择日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进粉数量" prop="fanNum">
|
<el-form-item label="进粉数量" prop="fanNum">
|
||||||
<el-input-number controls-position="right" v-model="editForm.fanNum" :min="0" :max="1000000000"></el-input-number>
|
<el-input-number
|
||||||
|
controls-position="right"
|
||||||
|
v-model="editForm.fanNum"
|
||||||
|
:min="0"
|
||||||
|
:max="1000000000"
|
||||||
|
></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer" >
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="editSubmit">确 定</el-button>
|
<el-button type="primary" @click="editSubmit">确 定</el-button>
|
||||||
<el-button @click="editCancel">取 消</el-button>
|
<el-button @click="editCancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listFanStatistics, getFanStatistics, delFanStatistics, addFanStatistics, updateFanStatistics, exportFanStatistics, getWxByUserId } from "@/api/custom/fanStatistics";
|
import {
|
||||||
import { getOptions } from "@/api/custom/order";
|
listFanStatistics,
|
||||||
import store from "@/store";
|
getFanStatistics,
|
||||||
import dayjs from "dayjs";
|
delFanStatistics,
|
||||||
const loginUserId = store.getters && store.getters.userId;
|
addFanStatistics,
|
||||||
const nowDate = dayjs().subtract(1, 'day').format("YYYY-MM-DD");
|
updateFanStatistics,
|
||||||
export default {
|
exportFanStatistics,
|
||||||
|
getWxByUserId,
|
||||||
|
} from "@/api/custom/fanStatistics";
|
||||||
|
import store from "@/store";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
const loginUserId = store.getters && store.getters.userId;
|
||||||
|
const nowDate = dayjs().subtract(1, "day").format("YYYY-MM-DD");
|
||||||
|
export default {
|
||||||
name: "FanStatistics",
|
name: "FanStatistics",
|
||||||
data() {
|
data() {
|
||||||
const checkOrderTime = (rule, value, callback) => {
|
const checkOrderTime = (rule, value, callback) => {
|
||||||
@ -229,46 +319,54 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
fanTime: nowDate,
|
fanTime: nowDate,
|
||||||
userId: null,
|
userId: null,
|
||||||
accountId: null
|
accountId: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
fanTime: [{ required: true, trigger: "blur", message: "请选择日期" }],
|
fanTime: [{ required: true, trigger: "blur", message: "请选择日期" }],
|
||||||
userId: [{ required: true, trigger: "blur", message: "请选择销售" }]
|
userId: [{ required: true, trigger: "blur", message: "请选择销售" }],
|
||||||
},
|
},
|
||||||
showWxFlag:false,
|
showWxFlag: false,
|
||||||
//当前选择的用户被分配的微信号
|
//当前选择的用户被分配的微信号
|
||||||
wxList:[],
|
wxList: [],
|
||||||
//销售列表
|
|
||||||
preSaleIdOptions:[],
|
|
||||||
//进粉渠道列表
|
//进粉渠道列表
|
||||||
accountIdOptions:[],
|
accountIdOptions: [],
|
||||||
editOpen: false,
|
editOpen: false,
|
||||||
editForm:{},
|
editForm: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
editRules: {
|
editRules: {
|
||||||
fanTime: [{ required: true, trigger: "blur", message: "请选择日期" }],
|
fanTime: [{ required: true, trigger: "blur", message: "请选择日期" }],
|
||||||
fanNum: [{ required: true, trigger: "blur", message: "请输入进粉数量" }],
|
fanNum: [
|
||||||
|
{ required: true, trigger: "blur", message: "请输入进粉数量" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getSaleUserList();
|
|
||||||
this.getDicts("fan_channel").then((response) => {
|
this.getDicts("fan_channel").then((response) => {
|
||||||
this.accountIdOptions = response.data;
|
this.accountIdOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
//销售列表
|
||||||
|
preSaleIdOptions: (state) => state.global.preSaleIdOptions.slice(1),
|
||||||
|
}),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询进粉统计列表 */
|
/** 查询进粉统计列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listFanStatistics(this.queryParams).then(response => {
|
listFanStatistics(this.queryParams).then((response) => {
|
||||||
this.fanStatisticsList = response.rows;
|
this.fanStatisticsList = response.rows;
|
||||||
this.totalFanNum = 0;
|
this.totalFanNum = 0;
|
||||||
if(this.fanStatisticsList != null && this.fanStatisticsList.length > 0){
|
if (
|
||||||
|
this.fanStatisticsList != null &&
|
||||||
|
this.fanStatisticsList.length > 0
|
||||||
|
) {
|
||||||
this.totalFanNum = this.fanStatisticsList[0].totalFanNum;
|
this.totalFanNum = this.fanStatisticsList[0].totalFanNum;
|
||||||
}
|
}
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
@ -291,18 +389,18 @@
|
|||||||
userId: null,
|
userId: null,
|
||||||
fanTime: nowDate,
|
fanTime: nowDate,
|
||||||
wxId: [],
|
wxId: [],
|
||||||
fanNum: []
|
fanNum: [],
|
||||||
};
|
};
|
||||||
this.wxList = [];
|
this.wxList = [];
|
||||||
this.showWxFlag = false;
|
this.showWxFlag = false;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
editFormReset(){
|
editFormReset() {
|
||||||
this.editForm = {
|
this.editForm = {
|
||||||
id: null,
|
id: null,
|
||||||
wxId: null,
|
wxId: null,
|
||||||
fanTime: null,
|
fanTime: null,
|
||||||
fanNum: 0
|
fanNum: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -317,9 +415,9 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -328,7 +426,7 @@
|
|||||||
const defaultUserId = this.preSaleIdOptions.find(
|
const defaultUserId = this.preSaleIdOptions.find(
|
||||||
(opt) => opt.dictValue === loginUserId
|
(opt) => opt.dictValue === loginUserId
|
||||||
);
|
);
|
||||||
if (defaultUserId){
|
if (defaultUserId) {
|
||||||
this.form.userId = defaultUserId.dictValue;
|
this.form.userId = defaultUserId.dictValue;
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
@ -337,36 +435,34 @@
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.editFormReset();
|
this.editFormReset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids;
|
||||||
getFanStatistics(id).then(response => {
|
getFanStatistics(id).then((response) => {
|
||||||
this.editForm.id = response.data.id;
|
this.editForm.id = response.data.id;
|
||||||
this.editForm.wxId = response.data.wxId;
|
this.editForm.wxId = response.data.wxId;
|
||||||
this.editForm.fanTime = response.data.fanTime;
|
this.editForm.fanTime = response.data.fanTime;
|
||||||
this.editForm.fanNum = response.data.fanNum;
|
this.editForm.fanNum = response.data.fanNum;
|
||||||
this.editOpen = true;
|
this.editOpen = true;
|
||||||
this.title = "修改「"+row.wxAccount+"」的进粉统计";
|
this.title = "修改「" + row.wxAccount + "」的进粉统计";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if(this.form.wxId.length == 0){
|
if (this.form.wxId.length == 0) {
|
||||||
this.msgError("该销售未被分配微信");
|
this.msgError("该销售未被分配微信");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let flag = true;
|
let flag = true;
|
||||||
this.form.fanNum.forEach( (value, index) => {
|
this.form.fanNum.forEach((value, index) => {
|
||||||
if(value == null || value == undefined){
|
if (value == null || value == undefined) {
|
||||||
this.msgError("请填写进粉数量");
|
this.msgError("请填写进粉数量");
|
||||||
flag = false;
|
flag = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(flag){
|
if (flag) {
|
||||||
addFanStatistics(this.form).then(response => {
|
addFanStatistics(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -375,22 +471,22 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.msgError("数据未填写完整");
|
this.msgError("数据未填写完整");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editSubmit(){
|
editSubmit() {
|
||||||
this.$refs["editForm"].validate(valid => {
|
this.$refs["editForm"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
updateFanStatistics(this.editForm).then(response => {
|
updateFanStatistics(this.editForm).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
this.editOpen = false;
|
this.editOpen = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
this.msgError("数据未填写完整");
|
this.msgError("数据未填写完整");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -398,61 +494,54 @@
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$confirm('是否确认删除进粉统计编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm(
|
||||||
|
'是否确认删除进粉统计编号为"' + ids + '"的数据项?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function() {
|
}
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delFanStatistics(ids);
|
return delFanStatistics(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function() {});
|
})
|
||||||
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有进粉统计数据项?', "警告", {
|
this.$confirm("是否确认导出所有进粉统计数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function() {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportFanStatistics(queryParams);
|
return exportFanStatistics(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function() {});
|
})
|
||||||
},
|
.catch(function () {});
|
||||||
//获取销售用户列表
|
|
||||||
getSaleUserList(){
|
|
||||||
getOptions().then((response) => {
|
|
||||||
const options = response.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({
|
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//根据用户ID查询被分配的微信号
|
//根据用户ID查询被分配的微信号
|
||||||
getWxByUserId(userId){
|
getWxByUserId(userId) {
|
||||||
this.showWxFlag = false;
|
this.showWxFlag = false;
|
||||||
this.form.wxId = [];
|
this.form.wxId = [];
|
||||||
this.form.fanNum = [];
|
this.form.fanNum = [];
|
||||||
this.wxList = [];
|
this.wxList = [];
|
||||||
if(userId == null || userId == undefined || userId == ""){
|
if (userId == null || userId == undefined || userId == "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getWxByUserId(userId).then(response => {
|
getWxByUserId(userId).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.wxList = response.data ? response.data : [];
|
this.wxList = response.data ? response.data : [];
|
||||||
if(this.wxList.length > 0){
|
if (this.wxList.length > 0) {
|
||||||
for(let i=0; i < this.wxList.length; i++){
|
for (let i = 0; i < this.wxList.length; i++) {
|
||||||
this.form.wxId[i] = this.wxList[i].wechatAccount;
|
this.form.wxId[i] = this.wxList[i].wechatAccount;
|
||||||
this.form.fanNum[i] = 0;
|
this.form.fanNum[i] = 0;
|
||||||
}
|
}
|
||||||
@ -467,6 +556,6 @@
|
|||||||
"form.userId": function (newVal, oldVal) {
|
"form.userId": function (newVal, oldVal) {
|
||||||
this.getWxByUserId(newVal);
|
this.getWxByUserId(newVal);
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -335,7 +335,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer" />
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
<el-table-column label="手机号" align="center" prop="phone" width="100" />
|
<!-- <el-table-column label="手机号" align="center" prop="phone" width="100" /> -->
|
||||||
<el-table-column label="成交金额" align="center" prop="amount">
|
<el-table-column label="成交金额" align="center" prop="amount">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ toThousands(scope.row.amount) }}
|
{{ toThousands(scope.row.amount) }}
|
||||||
@ -455,6 +455,7 @@ import orderPause from "./orderPause";
|
|||||||
import OrderDetail from "@/components/OrderDetail";
|
import OrderDetail from "@/components/OrderDetail";
|
||||||
import OrderEdit from "@/components/OrderEdit";
|
import OrderEdit from "@/components/OrderEdit";
|
||||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
const beginTime = dayjs().startOf("month").format("YYYY-MM-DD");
|
const beginTime = dayjs().startOf("month").format("YYYY-MM-DD");
|
||||||
const endTime = dayjs().format("YYYY-MM-DD");
|
const endTime = dayjs().format("YYYY-MM-DD");
|
||||||
@ -492,16 +493,6 @@ export default {
|
|||||||
daterange: [beginTime, endTime],
|
daterange: [beginTime, endTime],
|
||||||
// 收款方式字典
|
// 收款方式字典
|
||||||
payTypeIdOptions: [],
|
payTypeIdOptions: [],
|
||||||
// 售前字典
|
|
||||||
preSaleIdOptions: [],
|
|
||||||
// 售后字典
|
|
||||||
afterSaleIdOptions: [],
|
|
||||||
// 主营养师字典
|
|
||||||
nutritionistIdOptions: [],
|
|
||||||
// 助理营养师字典
|
|
||||||
nutriAssisIdOptions: [],
|
|
||||||
// 策划字典
|
|
||||||
plannerIdOptions: [],
|
|
||||||
// 账号
|
// 账号
|
||||||
accountIdOptions: [],
|
accountIdOptions: [],
|
||||||
// 服务时长
|
// 服务时长
|
||||||
@ -510,12 +501,6 @@ export default {
|
|||||||
conditioningProjectIdOption: [],
|
conditioningProjectIdOption: [],
|
||||||
// 审核状态
|
// 审核状态
|
||||||
reviewStatusOptions: [],
|
reviewStatusOptions: [],
|
||||||
// 策划助理字典
|
|
||||||
plannerAssisIdOptions: [],
|
|
||||||
// 运营字典
|
|
||||||
operatorIdOptions: [],
|
|
||||||
//
|
|
||||||
operatorAssisIdOptions: [],
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -539,32 +524,28 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
// 售前字典
|
||||||
|
"preSaleIdOptions",
|
||||||
|
// 售后字典
|
||||||
|
"afterSaleIdOptions",
|
||||||
|
// 主营养师字典
|
||||||
|
"nutritionistIdOptions",
|
||||||
|
// 助理营养师字典
|
||||||
|
"nutriAssisIdOptions",
|
||||||
|
// 策划字典
|
||||||
|
"plannerIdOptions",
|
||||||
|
// 策划助理字典
|
||||||
|
"plannerAssisIdOptions",
|
||||||
|
// 运营字典
|
||||||
|
"operatorIdOptions",
|
||||||
|
// 运营助理字典
|
||||||
|
"operatorAssisIdOptions",
|
||||||
|
]),
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then((response) => {
|
|
||||||
const options = response.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [
|
|
||||||
// { dictValue: 0, dictLabel: "无", remark: null },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({
|
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
|
||||||
this.nutritionistIdOptions = options["nutri"] || [];
|
|
||||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
|
||||||
this.plannerIdOptions = options["planner"] || [];
|
|
||||||
this.plannerAssisIdOptions = options["planner_assis"] || [];
|
|
||||||
this.operatorIdOptions = options["operator"] || [];
|
|
||||||
this.operatorAssisIdOptions = options["operator_assis"] || [];
|
|
||||||
});
|
|
||||||
this.getDicts("cus_pay_type").then((response) => {
|
this.getDicts("cus_pay_type").then((response) => {
|
||||||
this.payTypeIdOptions = response.data;
|
this.payTypeIdOptions = response.data;
|
||||||
});
|
});
|
||||||
|
@ -330,6 +330,7 @@ import { getOptions } from "@/api/custom/order";
|
|||||||
// import BodySignDetail from "@/components/BodySignDetail";
|
// import BodySignDetail from "@/components/BodySignDetail";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
|
||||||
const nextDate = dayjs().add(1, "day").format("YYYY-MM-DD");
|
const nextDate = dayjs().add(1, "day").format("YYYY-MM-DD");
|
||||||
const weekDate = dayjs().add(6, "day").format("YYYY-MM-DD");
|
const weekDate = dayjs().add(6, "day").format("YYYY-MM-DD");
|
||||||
@ -377,7 +378,7 @@ export default {
|
|||||||
allRecipesPlanList: [],
|
allRecipesPlanList: [],
|
||||||
//订单弹窗状态
|
//订单弹窗状态
|
||||||
allRecipesPlanOpen: false,
|
allRecipesPlanOpen: false,
|
||||||
allRecipesPlanTitle: '',
|
allRecipesPlanTitle: "",
|
||||||
//订单弹窗中查询参数
|
//订单弹窗中查询参数
|
||||||
allRecipesPlanQueryParam: {
|
allRecipesPlanQueryParam: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -387,47 +388,41 @@ export default {
|
|||||||
},
|
},
|
||||||
//订单弹窗中列表数据的总条数
|
//订单弹窗中列表数据的总条数
|
||||||
allRecipesPlanTotal: 0,
|
allRecipesPlanTotal: 0,
|
||||||
//营养师
|
|
||||||
nutritionistIdOptions: [],
|
|
||||||
//营养师助理
|
|
||||||
nutriAssisIdOptions: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
// "order-dialog": OrderDetail,
|
// "order-dialog": OrderDetail,
|
||||||
// body_sign_dialog: BodySignDetail,
|
// body_sign_dialog: BodySignDetail,
|
||||||
},
|
},
|
||||||
created() {
|
computed: {
|
||||||
getOptions().then((response) => {
|
...mapState({
|
||||||
const options = response.data.reduce((opts, cur) => {
|
//营养师
|
||||||
if (!opts[cur.postCode]) {
|
nutritionistIdOptions: (state) =>
|
||||||
opts[cur.postCode] = [
|
state.global.nutritionistIdOptions.slice(1),
|
||||||
{ dictValue: null, dictLabel: "全部", remark: null },
|
//营养师助理
|
||||||
];
|
nutriAssisIdOptions: (state) => state.global.nutriAssisIdOptions.slice(1),
|
||||||
}
|
}),
|
||||||
opts[cur.postCode].push({
|
},
|
||||||
dictValue: cur.userId,
|
watch: {
|
||||||
dictLabel: cur.userName,
|
nutritionistIdOptions: function (val, oldVal) {
|
||||||
remark: cur.remark,
|
if (val.length && !oldVal.length) {
|
||||||
});
|
const tarObj = val.find((opt) => opt.dictValue == userId);
|
||||||
return opts;
|
if (tarObj) {
|
||||||
}, {});
|
|
||||||
this.nutritionistIdOptions = options["nutri"] || [];
|
|
||||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
|
||||||
const defaultNutritionist = this.nutritionistIdOptions.find(
|
|
||||||
(opt) => opt.dictValue == userId
|
|
||||||
);
|
|
||||||
const defaultNutriAssisId = this.nutriAssisIdOptions.find(
|
|
||||||
(opt) => opt.dictValue == userId
|
|
||||||
);
|
|
||||||
if (defaultNutritionist) {
|
|
||||||
this.queryParams.nutritionistId = userId;
|
this.queryParams.nutritionistId = userId;
|
||||||
}
|
}
|
||||||
if (defaultNutriAssisId) {
|
}
|
||||||
|
},
|
||||||
|
nutriAssisIdOptions: function (val, oldVal) {
|
||||||
|
if (val.length && !oldVal.length) {
|
||||||
|
const tarObj = val.find((opt) => opt.dictValue == userId);
|
||||||
|
if (tarObj) {
|
||||||
this.queryParams.nutritionistAssisId = userId;
|
this.queryParams.nutritionistAssisId = userId;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询食谱计划列表 */
|
/** 查询食谱计划列表 */
|
||||||
@ -476,7 +471,7 @@ export default {
|
|||||||
dayjs(item.endDate).format("YYYY-MM-DD");
|
dayjs(item.endDate).format("YYYY-MM-DD");
|
||||||
});
|
});
|
||||||
this.allRecipesPlanOpen = true;
|
this.allRecipesPlanOpen = true;
|
||||||
this.allRecipesPlanTitle = `「${this.allRecipesPlanList[0].customer}」食谱计划表`
|
this.allRecipesPlanTitle = `「${this.allRecipesPlanList[0].customer}」食谱计划表`;
|
||||||
this.allRecipesPlanTotal = response.total;
|
this.allRecipesPlanTotal = response.total;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="销售" prop="userId">
|
<el-form-item label="销售" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" placeholder="请选择销售" filterable clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请选择销售"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -12,7 +24,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售组别" prop="saleGroupId">
|
<el-form-item label="销售组别" prop="saleGroupId">
|
||||||
<el-select v-model="queryParams.saleGroupId" placeholder="请选择组别" filterable clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.saleGroupId"
|
||||||
|
placeholder="请选择组别"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in saleGroupOptions"
|
v-for="dict in saleGroupOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -22,7 +40,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进粉渠道" prop="accountId">
|
<el-form-item label="进粉渠道" prop="accountId">
|
||||||
<el-select v-model="queryParams.accountId" filterable placeholder="请选择渠道" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.accountId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择渠道"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in accountIdOptions"
|
v-for="dict in accountIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -41,8 +65,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -54,7 +86,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['custom:wxDistribution:add']"
|
v-hasPermi="['custom:wxDistribution:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -64,7 +97,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['custom:wxDistribution:edit']"
|
v-hasPermi="['custom:wxDistribution:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -74,7 +108,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['custom:wxDistribution:remove']"
|
v-hasPermi="['custom:wxDistribution:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -83,24 +118,42 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['custom:wxDistribution:export']"
|
v-hasPermi="['custom:wxDistribution:export']"
|
||||||
>导出</el-button>
|
>导出</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="wxDistributionList" stripe @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="wxDistributionList"
|
||||||
|
stripe
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="销售姓名" align="center" prop="userName" />
|
<el-table-column label="销售姓名" align="center" prop="userName" />
|
||||||
<el-table-column label="微信昵称" align="center" prop="wxNickName" />
|
<el-table-column label="微信昵称" align="center" prop="wxNickName" />
|
||||||
<el-table-column label="微信号" align="center" prop="wxAccount" />
|
<el-table-column label="微信号" align="center" prop="wxAccount" />
|
||||||
<el-table-column label="进粉渠道" align="center" prop="account" />
|
<el-table-column label="进粉渠道" align="center" prop="account" />
|
||||||
<el-table-column label="销售组别" align="center" prop="saleGroup" />
|
<el-table-column label="销售组别" align="center" prop="saleGroup" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -108,20 +161,22 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['custom:wxDistribution:edit']"
|
v-hasPermi="['custom:wxDistribution:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['custom:wxDistribution:remove']"
|
v-hasPermi="['custom:wxDistribution:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -132,7 +187,13 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="销售" prop="userId">
|
<el-form-item label="销售" prop="userId">
|
||||||
<el-select v-model="form.userId" placeholder="请选择销售" filterable clearable size="small">
|
<el-select
|
||||||
|
v-model="form.userId"
|
||||||
|
placeholder="请选择销售"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -142,7 +203,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售组别" prop="saleGroupId">
|
<el-form-item label="销售组别" prop="saleGroupId">
|
||||||
<el-select v-model="form.saleGroupId" placeholder="请选择组别" filterable clearable size="small">
|
<el-select
|
||||||
|
v-model="form.saleGroupId"
|
||||||
|
placeholder="请选择组别"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in saleGroupOptions"
|
v-for="dict in saleGroupOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -152,7 +219,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进粉渠道" prop="accountId">
|
<el-form-item label="进粉渠道" prop="accountId">
|
||||||
<el-select v-model="form.accountId" filterable placeholder="请选择渠道" clearable size="small">
|
<el-select
|
||||||
|
v-model="form.accountId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择渠道"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in accountIdOptions"
|
v-for="dict in accountIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -162,7 +235,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="微信号" prop="wechatAccount">
|
<el-form-item label="微信号" prop="wechatAccount">
|
||||||
<el-select v-model="form.wechatAccount" filterable placeholder="请选择微信号" clearable size="small">
|
<el-select
|
||||||
|
v-model="form.wechatAccount"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择微信号"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in wxAccountList"
|
v-for="dict in wxAccountList"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
@ -181,10 +260,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWxDistribution, getWxDistribution, delWxDistribution, addWxDistribution, updateWxDistribution, exportWxDistribution } from "@/api/custom/wxDistribution";
|
import {
|
||||||
import {getOptions} from "@/api/custom/order";
|
listWxDistribution,
|
||||||
import { listWxAccount } from "@/api/custom/wxAccount";
|
getWxDistribution,
|
||||||
export default {
|
delWxDistribution,
|
||||||
|
addWxDistribution,
|
||||||
|
updateWxDistribution,
|
||||||
|
exportWxDistribution,
|
||||||
|
} from "@/api/custom/wxDistribution";
|
||||||
|
import { getOptions } from "@/api/custom/order";
|
||||||
|
import { listWxAccount } from "@/api/custom/wxAccount";
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
export default {
|
||||||
name: "WxDistribution",
|
name: "WxDistribution",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -220,36 +307,26 @@
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
userId: [{ required: true, trigger: "blur", message: "请选择销售" }],
|
userId: [{ required: true, trigger: "blur", message: "请选择销售" }],
|
||||||
saleGroupId: [{ required: true, trigger: "blur", message: "请选择组别" }],
|
saleGroupId: [
|
||||||
accountId: [{ required: true, trigger: "blur", message: "请选择进粉账号" }],
|
{ required: true, trigger: "blur", message: "请选择组别" },
|
||||||
wechatAccount: [{ required: true, trigger: "blur", message: "请选择微信号" }]
|
],
|
||||||
|
accountId: [
|
||||||
|
{ required: true, trigger: "blur", message: "请选择进粉账号" },
|
||||||
|
],
|
||||||
|
wechatAccount: [
|
||||||
|
{ required: true, trigger: "blur", message: "请选择微信号" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
//售前
|
|
||||||
preSaleIdOptions:[],
|
|
||||||
//进粉账号列表
|
//进粉账号列表
|
||||||
accountIdOptions:[],
|
accountIdOptions: [],
|
||||||
//销售组别列表
|
//销售组别列表
|
||||||
saleGroupOptions:[],
|
saleGroupOptions: [],
|
||||||
//微信号列表
|
//微信号列表
|
||||||
wxAccountList:[]
|
wxAccountList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
getOptions().then((response) => {
|
|
||||||
const options = response.data.reduce((opts, cur) => {
|
|
||||||
if (!opts[cur.postCode]) {
|
|
||||||
opts[cur.postCode] = [];
|
|
||||||
}
|
|
||||||
opts[cur.postCode].push({
|
|
||||||
dictValue: cur.userId,
|
|
||||||
dictLabel: cur.userName,
|
|
||||||
remark: cur.remark,
|
|
||||||
});
|
|
||||||
return opts;
|
|
||||||
}, {});
|
|
||||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
|
||||||
});
|
|
||||||
this.getDicts("fan_channel").then((response) => {
|
this.getDicts("fan_channel").then((response) => {
|
||||||
this.accountIdOptions = response.data;
|
this.accountIdOptions = response.data;
|
||||||
});
|
});
|
||||||
@ -258,11 +335,17 @@
|
|||||||
});
|
});
|
||||||
this.getListWxAccount();
|
this.getListWxAccount();
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
//售前
|
||||||
|
preSaleIdOptions: (state) => state.global.preSaleIdOptions.slice(1),
|
||||||
|
}),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询微信分配管理列表 */
|
/** 查询微信分配管理列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listWxDistribution(this.queryParams).then(response => {
|
listWxDistribution(this.queryParams).then((response) => {
|
||||||
this.wxDistributionList = response.rows;
|
this.wxDistributionList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -279,7 +362,7 @@
|
|||||||
userId: null,
|
userId: null,
|
||||||
saleGroupId: null,
|
saleGroupId: null,
|
||||||
accountId: null,
|
accountId: null,
|
||||||
wechatAccount: null
|
wechatAccount: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -295,9 +378,9 @@
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map((item) => item.id);
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -308,8 +391,8 @@
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids;
|
||||||
getWxDistribution(id).then(response => {
|
getWxDistribution(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改微信分配";
|
this.title = "修改微信分配";
|
||||||
@ -317,10 +400,10 @@
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateWxDistribution(this.form).then(response => {
|
updateWxDistribution(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -328,7 +411,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addWxDistribution(this.form).then(response => {
|
addWxDistribution(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -342,35 +425,45 @@
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$confirm('是否确认删除微信号为"' + row.wxNickName + '"的数据项?', "警告", {
|
this.$confirm(
|
||||||
|
'是否确认删除微信号为"' + row.wxNickName + '"的数据项?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function() {
|
}
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delWxDistribution(ids);
|
return delWxDistribution(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function() {});
|
})
|
||||||
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有微信分配数据项?', "警告", {
|
this.$confirm("是否确认导出所有微信分配数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
}).then(function() {
|
})
|
||||||
|
.then(function () {
|
||||||
return exportWxDistribution(queryParams);
|
return exportWxDistribution(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function() {});
|
})
|
||||||
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
getListWxAccount() {
|
getListWxAccount() {
|
||||||
listWxAccount(this.queryParams).then(response => {
|
listWxAccount(this.queryParams).then((response) => {
|
||||||
this.wxAccountList = response.rows;
|
this.wxAccountList = response.rows;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user