修改系统
This commit is contained in:
453
stdiet-ui/src/views/custom/commision/config/index.vue
Normal file
453
stdiet-ui/src/views/custom/commision/config/index.vue
Normal file
@ -0,0 +1,453 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="岗位" prop="postId">
|
||||
<el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable size="small" @change="searchPostChange">
|
||||
<el-option
|
||||
v-for="dict in postIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in searchUserIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['commision:config:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['commision:config:edit']"-->
|
||||
<!-- >修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['commision:config:remove']"-->
|
||||
<!-- >删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['commision:config:export']"-->
|
||||
<!-- >导出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="commisionList" :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">
|
||||
<template scope="scope">
|
||||
{{toThousands(scope.row.amount)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例" align="center" prop="rate">
|
||||
<template scope="scope">
|
||||
{{scope.row.rate + '%'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['commision:config:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['commision:config:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改业务提成比例对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" prop="postId">
|
||||
<el-select v-model="form.postId" placeholder="请选择岗位" @change="postChange">
|
||||
<el-option
|
||||
v-for="dict in postIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="form.userId" placeholder="请选择业务员">
|
||||
<el-option
|
||||
v-for="dict in userIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分成比例" prop="rate">
|
||||
<el-input v-model="form.rate" placeholder="请输入比例"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listCommision,
|
||||
getCommision,
|
||||
delCommision,
|
||||
addCommision,
|
||||
updateCommision,
|
||||
exportCommision,
|
||||
} from "@/api/custom/commision";
|
||||
|
||||
import {getOptions} from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: "CommisionConfig",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 业务提成比例表格数据
|
||||
commisionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 业务员字典
|
||||
userIdOptions: [],
|
||||
//
|
||||
postIdOptions: [],
|
||||
//
|
||||
totalUserIdOptions: [],
|
||||
//
|
||||
searchUserIdOptions: [],
|
||||
//
|
||||
options: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
postId: null,
|
||||
amount: null,
|
||||
rate: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userId: [
|
||||
{required: true, message: "业务员不能为空", trigger: "change"}
|
||||
],
|
||||
postId: [
|
||||
{required: true, message: "岗位不能为空", trigger: "change"}
|
||||
],
|
||||
amount: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
rate: [
|
||||
{required: true, message: "分成比例不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
getOptions().then(response => {
|
||||
this.options = response.data.reduce((opts, cur) => {
|
||||
// if (cur.postCode.startsWith('planner')) {
|
||||
// return opts;
|
||||
// }
|
||||
if (!opts[cur.postId]) {
|
||||
opts[cur.postId] = [];
|
||||
}
|
||||
opts[cur.postId].push({dictValue: cur.userId, dictLabel: cur.userName});
|
||||
|
||||
if (!this.postIdOptions.some(opt => opt.dictValue === cur.postId)) {
|
||||
this.postIdOptions.push({dictValue: cur.postId, dictLabel: cur.postName});
|
||||
}
|
||||
if (!this.totalUserIdOptions.some(opt => opt.dictValue === cur.userId)) {
|
||||
this.totalUserIdOptions.push({dictValue: cur.userId, dictLabel: cur.userName});
|
||||
}
|
||||
return opts;
|
||||
}, {});
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
/** 查询业务提成比例列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCommision(this.queryParams).then(response => {
|
||||
this.commisionList = response.rows.reduce((arr, cur, idx, oriArr) => {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].some(e => e.userId === cur.userId && e.postId === cur.postId)) {
|
||||
arr[i].push(cur);
|
||||
break;
|
||||
} else if (i === arr.length - 1) {
|
||||
arr.push([cur]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idx === 0) {
|
||||
arr.push([cur]);
|
||||
}
|
||||
if (idx === oriArr.length - 1) {
|
||||
const finalArr = [];
|
||||
arr.forEach(tmpArr => {
|
||||
tmpArr.sort((a, b) => a.amount - b.amount)
|
||||
.forEach((elm, elmIdx) => {
|
||||
finalArr.push({
|
||||
...elm,
|
||||
userSpan: elmIdx ? {
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
} : {
|
||||
rowspan: tmpArr.length,
|
||||
colspan: 1
|
||||
},
|
||||
postSpan: elmIdx ? {
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
} : {
|
||||
rowspan: tmpArr.length,
|
||||
colspan: 1
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
return finalArr;
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 业务员字典翻译
|
||||
userIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.userIdOptions, row.userId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.userIdOptions = [];
|
||||
this.form = {
|
||||
ruleId: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
amount: null,
|
||||
rate: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.ruleId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加业务提成比例";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const ruleId = row.ruleId || this.ids
|
||||
getCommision(ruleId, row.postId).then(response => {
|
||||
this.form = response.data;
|
||||
this.userIdOptions = this.options[this.form.postId];
|
||||
this.open = true;
|
||||
this.title = "修改业务提成比例";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.ruleId != null) {
|
||||
updateCommision(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addCommision(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ruleIds = row.ruleId || this.ids;
|
||||
this.$confirm('是否确认删除业务提成比例编号为"' + ruleIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delCommision(ruleIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportCommision(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
||||
if (columnIndex === 0) {
|
||||
return row.userSpan;
|
||||
} else if (columnIndex === 1) {
|
||||
return row.postSpan;
|
||||
}
|
||||
},
|
||||
postChange(postId) {
|
||||
this.userIdOptions = this.options[postId];
|
||||
},
|
||||
searchPostChange(postId) {
|
||||
if (!postId) {
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
return;
|
||||
}
|
||||
this.searchUserIdOptions = this.options[postId];
|
||||
this.queryParams.userId = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
227
stdiet-ui/src/views/custom/commision/detail/index.vue
Normal file
227
stdiet-ui/src/views/custom/commision/detail/index.vue
Normal file
@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="岗位" prop="postId">
|
||||
<el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable size="small" @change="searchPostChange">
|
||||
<el-option
|
||||
v-for="dict in postIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in searchUserIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="月份" prop="month">
|
||||
<el-date-picker
|
||||
v-model="month"
|
||||
@change="monthRangeChange"
|
||||
type="month"
|
||||
placeholder="选择月">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['commision:detail:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="commisionList"
|
||||
@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">
|
||||
<template scope="scope">
|
||||
{{toThousands(scope.row.amount)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例" align="center" prop="rate">
|
||||
<template scope="scope">
|
||||
{{scope.row.rate + '%'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提成" align="center" prop="commision">
|
||||
<template scope="scope">
|
||||
{{scope.row.commision.toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
detailCommision,
|
||||
exportCommision,
|
||||
} from "@/api/custom/commision";
|
||||
|
||||
import {getOptions} from "@/api/custom/order";
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export default {
|
||||
name: "CommisionDetail",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
//
|
||||
month: dayjs(),
|
||||
// 业务提成比例表格数据
|
||||
commisionList: [],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 业务员字典
|
||||
userIdOptions: [],
|
||||
//
|
||||
postIdOptions: [],
|
||||
//
|
||||
totalUserIdOptions: [],
|
||||
//
|
||||
searchUserIdOptions: [],
|
||||
//
|
||||
options: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
postId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
getOptions().then(response => {
|
||||
this.options = response.data.reduce((opts, cur) => {
|
||||
if (cur.postCode.startsWith('planner')) {
|
||||
return opts;
|
||||
}
|
||||
if (!opts[cur.postId]) {
|
||||
opts[cur.postId] = [];
|
||||
}
|
||||
opts[cur.postId].push({dictValue: cur.userId, dictLabel: cur.userName});
|
||||
|
||||
if (!this.postIdOptions.some(opt => opt.dictValue === cur.postId)) {
|
||||
this.postIdOptions.push({dictValue: cur.postId, dictLabel: cur.postName});
|
||||
}
|
||||
if (!this.totalUserIdOptions.some(opt => opt.dictValue === cur.userId)) {
|
||||
this.totalUserIdOptions.push({dictValue: cur.userId, dictLabel: cur.userName});
|
||||
}
|
||||
return opts;
|
||||
}, {});
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
/** 查询业务提成比例列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const dateRange = [dayjs(this.month).startOf('month').format('YYYY-MM-DD'), dayjs(this.month).endOf('month').format('YYYY-MM-DD')];
|
||||
console.log(dateRange)
|
||||
detailCommision(this.addDateRange(this.queryParams, dateRange)).then(response => {
|
||||
this.commisionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 业务员字典翻译
|
||||
userIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.userIdOptions, row.userId);
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.userIdOptions = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.ruleId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportCommision(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
monthRangeChange(time) {
|
||||
this.month = time;
|
||||
},
|
||||
postChange(postId) {
|
||||
this.userIdOptions = this.options[postId];
|
||||
},
|
||||
searchPostChange(postId) {
|
||||
if (!postId) {
|
||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||
return;
|
||||
}
|
||||
this.searchUserIdOptions = this.options[postId];
|
||||
this.queryParams.userId = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
437
stdiet-ui/src/views/custom/contract/index.vue
Normal file
437
stdiet-ui/src/views/custom/contract/index.vue
Normal file
@ -0,0 +1,437 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="合同编号" prop="id">
|
||||
<el-input
|
||||
v-model="queryParams.id"
|
||||
placeholder="请输入合同编号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入客户姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入电话"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择主营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择合同状态">
|
||||
<el-option
|
||||
v-for="dict in signStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:contract:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['custom:contract:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['custom:contract:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['custom:contract:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column 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">
|
||||
<el-tag
|
||||
:type="scope.row.status === 'yes' ? 'success' : 'danger'"
|
||||
disable-transitions>
|
||||
{{scope.row.status === 'yes' ? '已签订':'未签订'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户姓名" align="center" prop="name" 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">
|
||||
{{scope.row.servePromise ? `${scope.row.servePromise}斤`: ''}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" align="center" prop="amount" width="100"/>
|
||||
<el-table-column label="签订时间" align="center" prop="updateTime" width="180"/>
|
||||
<el-table-column label="合同地址" align="center" prop="path" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-copy-document" @click="handleCopy(scope.row.path)" class="copyBtn"
|
||||
:data-clipboard-text="copyValue">复制
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status==='yes'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleLook(scope.row.path)"
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:contract:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改合同对话框 -->
|
||||
<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-item label="客户姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务承诺" prop="servePromise">
|
||||
<el-input style="width: 193px; margin-right: 12px" v-model="form.servePromise" placeholder="请输入服务承诺"/>
|
||||
斤
|
||||
</el-form-item>
|
||||
<el-form-item label="营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务时间" prop="serveTime">
|
||||
<el-select v-model="form.serveTime" placeholder="请选择服务时间">
|
||||
<el-option
|
||||
v-for="dict in serveTimeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addContract, delContract, listContract} from "@/api/custom/contract";
|
||||
|
||||
import {getOptions} from "@/api/custom/order";
|
||||
|
||||
import Clipboard from 'clipboard';
|
||||
|
||||
export default {
|
||||
name: "Contract",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 合同表格数据
|
||||
contractList: [],
|
||||
// 营养师
|
||||
nutritionistIdOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 服务时间字典
|
||||
serveTimeOptions: [],
|
||||
// 签约状态字典
|
||||
signStatusOptions: [],
|
||||
//
|
||||
copyValue: '',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
id: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
||||
],
|
||||
amount: [
|
||||
{required: true, message: "请输入签订金额", trigger: "blur"}
|
||||
],
|
||||
servePromise: [
|
||||
{required: true, message: "请输入承诺效果", trigger: "blur"}
|
||||
],
|
||||
serveTime: [
|
||||
{required: true, message: "请选择服务时间", trigger: "blur"}
|
||||
],
|
||||
nutritionistId: [
|
||||
{required: true, message: "请选择营养师", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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.nutritionistIdOptions = options['nutri'] || [];
|
||||
})
|
||||
this.getDicts("cus_serve_time").then(response => {
|
||||
this.serveTimeOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_sign_status").then(response => {
|
||||
this.signStatusOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询合同列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listContract(this.queryParams).then(response => {
|
||||
this.contractList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 服务时间字典翻译
|
||||
serveTimeFormat(row, column) {
|
||||
return this.selectDictLabel(this.serveTimeOptions, row.serveTime);
|
||||
},
|
||||
signStatusFormat(row, column) {
|
||||
return this.selectDictLabel(this.signStatusOptions, row.serveTime);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.remark === 'default');
|
||||
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
serveTime: null,
|
||||
amount: null,
|
||||
path: null,
|
||||
createBy: null,
|
||||
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 主营养师字典翻译
|
||||
nutritionistIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "创建合同";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
// handleUpdate(row) {
|
||||
// this.reset();
|
||||
// const id = row.id || this.ids
|
||||
// getContract(id).then(response => {
|
||||
// this.form = response.data;
|
||||
// this.open = true;
|
||||
// this.title = "修改合同";
|
||||
// });
|
||||
// },
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// if (this.form.id != null) {
|
||||
// updateContract(this.form).then(response => {
|
||||
// if (response.code === 200) {
|
||||
// this.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
|
||||
addContract(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
// }
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除合同编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delContract(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
// handleExport() {
|
||||
// const queryParams = this.queryParams;
|
||||
// this.$confirm('是否确认导出所有合同数据项?', "警告", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning"
|
||||
// }).then(function () {
|
||||
// return exportContract(queryParams);
|
||||
// }).then(response => {
|
||||
// this.download(response.msg);
|
||||
// }).catch(function () {
|
||||
// });
|
||||
// },
|
||||
handleCopy(path) {
|
||||
this.copyValue = window.location.origin.replace('manage', 'sign') + path;
|
||||
const btnCopy = new Clipboard('.copyBtn');
|
||||
this.$message({
|
||||
message: '拷贝成功',
|
||||
type: 'success'
|
||||
});
|
||||
// btnCopy.destroy();
|
||||
},
|
||||
handleLook(path) {
|
||||
const url = window.location.origin.replace('manage', 'sign') + path;
|
||||
// const url = "http://stsign.busyinn.com" + path;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
819
stdiet-ui/src/views/custom/order/index.vue
Normal file
819
stdiet-ui/src/views/custom/order/index.vue
Normal file
@ -0,0 +1,819 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单编号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input
|
||||
v-model="queryParams.customer"
|
||||
placeholder="请输入客户姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="queryParams.payTypeId" placeholder="请选择收款方式" clearable size="small">
|
||||
<el-option v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="queryParams.preSaleId" placeholder="请选择售前" clearable size="small">
|
||||
<el-option v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="queryParams.afterSaleId" placeholder="请选择售后" clearable size="small">
|
||||
<el-option v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择主营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId" label-width="90px">
|
||||
<el-select v-model="queryParams.nutriAssisId" placeholder="请选择助理营养师" clearable style="width: 170px"
|
||||
size="small">
|
||||
<el-option v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="queryParams.accountId" placeholder="请选择账号" clearable
|
||||
size="small">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="queryParams.plannerId" placeholder="请选择策划" clearable
|
||||
size="small">
|
||||
<el-option v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="queryParams.plannerAssisId" placeholder="请选择策划助理"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="queryParams.operatorId" placeholder="请选择运营"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运营助理" prop="operatorAssisId">
|
||||
<el-select v-model="queryParams.operatorAssisId" placeholder="请选择运营助理"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in operatorAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="queryParams.reviewStatus" placeholder="请选择审核状态"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in reviewStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker
|
||||
v-model="daterange"
|
||||
type="daterange"
|
||||
size="small"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="pickerOptions">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item>
|
||||
<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-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:order:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:order:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" align="center" prop="orderId" width="150" fixed="left"/>
|
||||
<el-table-column label="审核状态" align="center" prop="reviewStatus" width="80" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.reviewStatus === 'yes' ? 'success' : 'danger'"
|
||||
disable-transitions>
|
||||
{{scope.row.reviewStatus === 'yes' ? '已审核':'未审核'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交时间" align="center" prop="orderTime" width="180" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/>
|
||||
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left">
|
||||
<template scope="scope">
|
||||
{{toThousands(scope.row.amount)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
||||
<el-table-column label="服务时长" align="center" prop="serveTime" width="80"/>
|
||||
<el-table-column label="收款方式" align="center" prop="payType" width="120"/>
|
||||
<el-table-column label="售前" align="center" prop="preSale" width="120"/>
|
||||
<el-table-column label="售后" align="center" prop="afterSale" width="120"/>
|
||||
<el-table-column label="主营养师" align="center" prop="nutritionist" width="120"/>
|
||||
<el-table-column label="助理营养师" align="center" prop="nutriAssis" width="120"/>
|
||||
<el-table-column label="账号" align="center" prop="account" width="120"/>
|
||||
<el-table-column label="策划" align="center" prop="planner" width="120"/>
|
||||
<el-table-column label="策划助理" align="center" prop="plannerAssis" width="120"/>
|
||||
<el-table-column label="运营" align="center" prop="operator" width="120"/>
|
||||
<el-table-column label="运营助理" align="center" prop="operatorAssis" width="120"/>
|
||||
<el-table-column label="推荐人" align="center" prop="recommender" width="120"/>
|
||||
<el-table-column label="备注" align="center" prop="remark" width="120"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['custom:order:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:order:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
layout="total, slot, sizes, prev, pager, next, jumper"
|
||||
@pagination="getList"
|
||||
>
|
||||
<span style="margin-right: 12px;">总计:{{toThousands(this.totalAmount)}} 元</span>
|
||||
</pagination>
|
||||
|
||||
<!-- 添加或修改销售订单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input v-model="form.customer" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="form.payTypeId" placeholder="请选择收款方式">
|
||||
<el-option
|
||||
v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择账号">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="服务时长" prop="serveTime">
|
||||
<el-select v-model="form.serveTimeId" placeholder="请选服务时长">
|
||||
<el-option
|
||||
v-for="dict in serveTimeIdOption"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="form.preSaleId" placeholder="请选择售前">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择售后">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择主营养师">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师">
|
||||
<el-option
|
||||
v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="form.plannerId" placeholder="请选择策划">
|
||||
<el-option
|
||||
v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理">
|
||||
<el-option
|
||||
v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="form.operatorId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营助理" prop="operatorAssisId">
|
||||
<el-select v-model="form.operatorAssisId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="推荐人" prop="recommender">
|
||||
<el-input v-model="form.recommender" placeholder="请输入推荐人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交时间" prop="orderTime">
|
||||
<el-date-picker
|
||||
style="width: 182.5px"
|
||||
v-model="form.orderTime"
|
||||
type="datetime"
|
||||
placeholder="选择成交时间"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
:picker-options="orderPickerOptions">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-hasPermi="['custom:order:review']">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="form.reviewStatus" placeholder="请选择审核状态" @change="handleOnRviewChange">
|
||||
<el-option
|
||||
v-for="dict in reviewStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addOrder, delOrder, exportOrder, getOptions, getOrder, listOrder, updateOrder} from "@/api/custom/order";
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const beginTime = dayjs().startOf('month').format('YYYY-MM-DD');
|
||||
const endTime = dayjs().format('YYYY-MM-DD');
|
||||
// const beginTime = dayjs().format('YYYY-MM-DD');
|
||||
// const endTime = dayjs().format('YYYY-MM-DD');
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
//
|
||||
review: 'no',
|
||||
//
|
||||
daterange: [beginTime, endTime],
|
||||
// 收款方式字典
|
||||
payTypeIdOptions: [],
|
||||
// 售前字典
|
||||
preSaleIdOptions: [],
|
||||
// 售后字典
|
||||
afterSaleIdOptions: [],
|
||||
// 主营养师字典
|
||||
nutritionistIdOptions: [],
|
||||
// 助理营养师字典
|
||||
nutriAssisIdOptions: [],
|
||||
// 策划字典
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 服务时长
|
||||
serveTimeIdOption: [],
|
||||
// 审核状态
|
||||
reviewStatusOptions: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
operatorIdOptions: [],
|
||||
//
|
||||
operatorAssisIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderId: null,
|
||||
customer: null,
|
||||
phone: null,
|
||||
payTypeId: null,
|
||||
preSaleId: null,
|
||||
afterSaleId: null,
|
||||
nutritionistId: null,
|
||||
nutriAssisId: null,
|
||||
accountId: null,
|
||||
plannerId: null,
|
||||
plannerAssisId: null,
|
||||
operatorId: null,
|
||||
operatorAssisId: null,
|
||||
recommender: null,
|
||||
reviewStatus: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
customer: [
|
||||
{required: true, message: "客户姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
amount: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
payTypeId: [
|
||||
{required: true, message: "收款方式不能为空", trigger: "blur"}
|
||||
],
|
||||
accountId: [
|
||||
{required: true, message: "账号不能为空", trigger: "blur"}
|
||||
],
|
||||
serveTimeId: [
|
||||
{required: true, message: "服务时长不能为空", trigger: "blur"}
|
||||
],
|
||||
// reviewStatus: [
|
||||
// {trigger: "change", validator: handleOnPreviewChange}
|
||||
// ]
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
orderPickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_serve_time").then(response => {
|
||||
this.serveTimeIdOption = response.data;
|
||||
});
|
||||
this.getDicts("cus_review_status").then(response => {
|
||||
this.reviewStatusOptions = response.data;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.addDateRange(this.queryParams, this.daterange)).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.totalAmount = response.totalAmount;
|
||||
});
|
||||
},// 收款方式字典翻译
|
||||
payTypeIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.payTypeIdOptions, row.payTypeId);
|
||||
},
|
||||
// 售前字典翻译
|
||||
preSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.preSaleIdOptions, row.preSaleId);
|
||||
},
|
||||
// 售后字典翻译
|
||||
afterSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.afterSaleIdOptions, row.afterSaleId);
|
||||
},
|
||||
// 主营养师字典翻译
|
||||
nutritionistIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
||||
},
|
||||
// 助理营养师字典翻译
|
||||
nutriAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutriAssisIdOptions, row.nutriAssisId);
|
||||
},
|
||||
// 策划字典翻译
|
||||
plannerIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerIdOptions, row.plannerId);
|
||||
},
|
||||
// 账号字典翻译
|
||||
accountIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.accountIdOptions, row.accountId);
|
||||
},
|
||||
// 策划助理字典翻译
|
||||
plannerAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerAssisIdOptions, row.plannerAssisId);
|
||||
},
|
||||
// 运营字典翻译
|
||||
operatorIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.operatorIdOptions, row.operatorId);
|
||||
},
|
||||
// 运营助理字典翻译
|
||||
operatorAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.operatorAssisIdOptions, row.operatorAssisId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.review = 'no';
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
const defaultPayType = this.payTypeIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultServeTime = this.serveTimeIdOption.find(opt => opt.remark === 'default');
|
||||
const defaultAccount = this.accountIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultOperator = this.operatorIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultOperatorAssis = this.operatorAssisIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultPresale = this.preSaleIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultAftersale = this.afterSaleIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultNutriAssis = this.nutriAssisIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultPlanner = this.plannerIdOptions.find(opt => opt.remark === 'default');
|
||||
const defaultPlannerAssis = this.plannerAssisIdOptions.find(opt => opt.remark === 'default');
|
||||
this.form = {
|
||||
orderId: null,
|
||||
customer: null,
|
||||
phone: null,
|
||||
amount: null,
|
||||
payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null,
|
||||
preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
afterSaleId: defaultAftersale ? parseInt(defaultAftersale.dictValue) : null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
||||
remark: null,
|
||||
nutriAssisId: defaultNutriAssis ? parseInt(defaultNutriAssis.dictValue) : null,
|
||||
accountId: defaultAccount ? parseInt(defaultAccount.dictValue) : null,
|
||||
plannerId: defaultPlanner ? parseInt(defaultPlanner.dictValue) : null,
|
||||
plannerAssisId: defaultPlannerAssis ? parseInt(defaultPlannerAssis.dictValue) : null,
|
||||
operatorId: defaultOperator ? parseInt(defaultOperator.dictValue) : null,
|
||||
operatorAssisId: defaultOperatorAssis ? parseInt(defaultOperatorAssis.dictValue) : null,
|
||||
recommender: null,
|
||||
orderTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
serveTimeId: defaultServeTime ? parseInt(defaultServeTime.dictValue) : null,
|
||||
reviewStatus: this.review
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterange = [beginTime, endTime];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加销售订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改销售订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
this.form.reviewStatus = this.review;
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$confirm('是否确认删除销售订单编号为"' + orderIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有销售订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportOrder(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
handleOnRviewChange(val) {
|
||||
this.review = val;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
287
stdiet-ui/src/views/custom/signContract/index.vue
Normal file
287
stdiet-ui/src/views/custom/signContract/index.vue
Normal file
@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<div v-if="show" class="sign-contract-container">
|
||||
<div class="contract-title">合同简要</div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="服务方" style="margin: 0">
|
||||
<span>深圳市胜唐科技有限公司</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="导师" style="margin: 0">
|
||||
<span>{{form.tutor}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务费" style="margin: 0">
|
||||
<span>¥{{form.amount}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务时长" style="margin: 0">
|
||||
<span>{{form.serveTimeStr}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务承诺" style="margin: 0">
|
||||
<span>健康吃瘦{{form.servePromise}}斤</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.remark" label="备注" style="margin: 0">
|
||||
<span>{{form.remark}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="signName">
|
||||
<el-input v-model="form.signName" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号" prop="cusId">
|
||||
<el-input v-model="form.cusId" placeholder="请输入证件号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-checkbox v-model="read" @change="handleRadioChange" style="margin-bottom: 12px">已阅读合同相关
|
||||
</el-checkbox>
|
||||
<span class="detail" @click="dialogVisible = true">详情</span>
|
||||
</div>
|
||||
<el-button type="primary" style="width: 100%" @click="submitForm" :disabled="!read">提交签约</el-button>
|
||||
<el-dialog
|
||||
title="营养减脂服务合同"
|
||||
:visible.sync="dialogVisible"
|
||||
width="90%"
|
||||
custom-class="contract_dialog"
|
||||
center>
|
||||
<div class="dialog-detail">
|
||||
<p>甲方:胜唐体控(深圳市胜唐科技有限公司)</p>
|
||||
<p>乙方:<b>{{form.signName}}</b></p>
|
||||
<p>甲乙双方本着诚信合作、互惠互利的原则,依据中华人民共和国有关法律,经友好协商,现就胜唐体控减肥咨询指导服务合作相关事宣达成一致协议,以兹共同遵守。
|
||||
若乙方为未成年,应由乙方法定监护人代签本合同,乙方享受同等法律权益。</p>
|
||||
<p>
|
||||
第一条 甲方资质与服务保证
|
||||
<div class="line-rule">1、甲方经由工商部门注册、合法经营的正规公司。</div>
|
||||
<div class="line-rule">2、甲方在合约期内为乙方提供体重管理专家导师 <b>{{form.tutor}}</b> 提供营养减脂服务。</div>
|
||||
<div class="line-rule">3、甲方按与乙方约定事项及服务内容为乙方提供减脂服务,通过调节一日三餐、不使用任何仪器、针药、不使用医疗类药物等。</div>
|
||||
<div class="line-rule">4、提供专业营养指导咨询服务。</div>
|
||||
<div class="line-rule">5、服务标准</div>
|
||||
<div style="margin-left: 24px">5.1、甲方为乙方每周提供一对一有效咨询时间6日,每日咨询服务时间为早10:00——晚20:30。每日服务10.5小时(法定节假日除外)</div>
|
||||
<div style="margin-left: 24px">5.2、享受营养学基础知识学习,肥胖与生活习惯知识学习,享受营养师亲自培训初级自我体重管理知识。</div>
|
||||
<div style="margin-left: 24px">5.3、甲方为乙方定制营养减脂饮食方案,7天为一期,每期结束前1——2天,更新发送下一期饮食减脂方案。</div>
|
||||
<div style="margin-left: 24px">5.4、甲方对乙方所做出的承诺不得超出力所能及的范围,不得夸大、吹嘘、作假服务效果及疗程特性。</div>
|
||||
<div style="margin-left: 24px">5.5、甲方需保证提供服务的导师具备相关的服务资质证书。</div>
|
||||
<div style="margin-left: 24px">5.6、甲方为乙方提供的服务方式主要为网络线上进行指导服务,不涉及线下服务内容。</div>
|
||||
<div style="margin-left: 24px">5.7、乙方不能在家佐餐,需要进行外食指导,甲方有责任及义务为乙方提供对应的指导。</div>
|
||||
<div style="margin-left: 24px">5.8、乙方自订购服务日起,享有单一营养师的指导及咨询服务,如需中途更换指导老师,需在当期方案执行结束至少3日内告知,以便于更换指导。</div>
|
||||
<div style="margin-left: 24px">5.9、甲方每日会敦促乙方进行服务效果反馈,一日三餐需进行打卡。</div>
|
||||
<div style="margin-left: 24px">5.10、甲方在接收到乙方发送咨询需求3.5小时内需及时为乙方解答(周日及法定节假日除外)。</div>
|
||||
</p>
|
||||
|
||||
<p>第二条 合作内容及费用
|
||||
<div class="line-rule">经甲乙双方协商确定,乙方向甲方购买 <b>{{form.serveTimeStr}}</b> “胜唐体控瘦身指导服务”(以下简称服务)。
|
||||
经甲乙双方协商一致,确定乙方向甲方支付服务费用为人民币 <b>{{form.amount}}</b>,大写:<b>{{form.amountUpper}}</b>。<b>{{form.remark ?
|
||||
`(备注:${form.remark})`:''}}</b>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<p>第三条 服务期约定
|
||||
<div class="line-rule">1、服务时间阶段(服务指导期、服务跟踪期、免费咨询期)具体安排,由甲方根据乙方的实际情况与乙方协商确定。</div>
|
||||
<div class="line-rule">2、因不可抗拒的因素(如意外怀孕等)而暂停服务指导,其后续服务期限由甲乙方协商确定。</div>
|
||||
<div class="line-rule">3、减肥需要双方的配合,在不是甲方技术问题的情况下,乙方不执行营养师的指导导致没有达到预期效果,责任由乙方承担。根据个人体质不同,在调理营养健康的前提下,健康吃瘦 <b>{{form.servePromise}}</b>
|
||||
斤
|
||||
</div>
|
||||
<div class="line-rule">
|
||||
4、乙方应按甲方制定的饮食方案来饮食,承诺在未与甲方沟通前,不得擅自吃方案之外的高热量、高油、高盐、高糖等不利于健康和减脂的饮食,服务期内擅自暴食导致体重上涨,次数超过3次视为乙方主动放弃营养减脂,且甲方无需免费延长服务时间。
|
||||
</div>
|
||||
<div class="line-rule">
|
||||
5、乙方在一个服务期内享有2次暂停服务的机会,在暂停前应与甲方沟通,确认暂停前已减重斤数,累积到总减重结果中。在暂停结束后,自新体重开始,甲方服务乙方继续完成承诺的减重斤数,即:包瘦斤数 - 暂停前已成功减重数。
|
||||
</div>
|
||||
<div class="line-rule">6、乙方隐瞒病情或身体情况误导营养师的,造成的后果由乙方承担并且甲方不予退款。</div>
|
||||
<div class="line-rule">
|
||||
7、乙方同意并且理解甲方定制营养方案付出的时间和智力成本,乙方在第一周营养方案定制交付之前申请退款的可退款90%,在第一周营养方案定制交付之后因个人原因,非不可抗力因素则不予退款。
|
||||
</div>
|
||||
<div class="line-rule">
|
||||
8、若乙方具有特殊病史、慢病疾病、食用减肥药物或产品、使用激素药物、中药及其他疗程性药物调理,需在购买减脂服务前告知甲方,以便于合理安排减脂计划,若乙方未告知甲方相关的疾病史以及药物使用情况,因此造成的负面效果由乙方自行承担。
|
||||
</div>
|
||||
<div class="line-rule">9、甲方在乙方告知所有身体情况及药物服用情况,甲方仍未做出合理安排,对乙方的身体及心理造成影响时,乙方可申请扣除已进行服务期外相应的服务款项,退还未进行服务期对应款项。
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<p>公司地址:深圳市宝安区西乡街道宝民二路缤纷时代广场3楼318</p>
|
||||
<p>联系电话:0755-23213903</p>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getFile, signContract} from "@/api/custom/contract";
|
||||
import {digitUppercase, validatorIDCard} from "../../../utils/ruoyi";
|
||||
|
||||
export default {
|
||||
name: 'sign',
|
||||
data() {
|
||||
|
||||
const checkSignName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('姓名不能为空'))
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
const checkPhone = (rule, value, callback) => {
|
||||
const phoneReg = /^1[3|4|5|6|7|8|9][0-9]{9}$/
|
||||
if (!value) {
|
||||
return callback(new Error('电话号码不能为空'))
|
||||
}
|
||||
setTimeout(() => {
|
||||
// Number.isInteger是es6验证数字是否为整数的方法,实际输入的数字总是识别成字符串
|
||||
// 所以在前面加了一个+实现隐式转换
|
||||
if (!Number.isInteger(+value)) {
|
||||
callback(new Error('请输入数字值'))
|
||||
} else {
|
||||
if (phoneReg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('电话号码格式不正确'))
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
const checkcusId = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('证件号码不能为空'))
|
||||
}
|
||||
setTimeout(() => {
|
||||
const {code, msg} = validatorIDCard(value);
|
||||
if (code === 1) {
|
||||
callback()
|
||||
} else {
|
||||
return callback(new Error(msg))
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
return {
|
||||
show: false,
|
||||
form: {},
|
||||
read: false,
|
||||
dialogVisible: false,
|
||||
serveTimeIdOption: [
|
||||
{label: '7天', value: 7},
|
||||
{label: '1个月', value: 30},
|
||||
{label: '2个月', value: 60},
|
||||
{label: '3个月', value: 90},
|
||||
{label: '4个月', value: 120},
|
||||
{label: '5个月', value: 150},
|
||||
{label: '6个月', value: 180},
|
||||
{label: '7个月', value: 210},
|
||||
{label: '8个月', value: 240},
|
||||
{label: '9个月', value: 270},
|
||||
{label: '10个月', value: 300},
|
||||
{label: '11个月', value: 330},
|
||||
{label: '12个月', value: 360},
|
||||
],
|
||||
rules: {
|
||||
signName: [
|
||||
{required: true, trigger: "blur", validator: checkSignName}
|
||||
],
|
||||
phone: [
|
||||
{required: true, trigger: "blur", validator: checkPhone}
|
||||
],
|
||||
cusId: [
|
||||
{required: true, trigger: "blur", validator: checkcusId}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = this.$route.meta.title
|
||||
},
|
||||
created() {
|
||||
this.getContract();
|
||||
},
|
||||
methods: {
|
||||
getContract() {
|
||||
const {pathname} = window.location;
|
||||
const id = pathname.substring(pathname.lastIndexOf('/') + 1);
|
||||
// console.log(id)
|
||||
getFile(id).then(result => {
|
||||
if (result.url) {
|
||||
this.$router.push(result.url);
|
||||
} else if (result.data) {
|
||||
this.form = result.data;
|
||||
this.form.amount = parseInt(result.data.amount);
|
||||
this.form.amountUpper = digitUppercase(this.form.amount);
|
||||
this.form.serveTimeStr = this.serveTimeIdOption.find(obj => obj.value === parseInt(result.data.serveTime)).label
|
||||
this.show = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
signContract(this.form).then(result => {
|
||||
if (result.code === 200) {
|
||||
window.location.href = window.location.origin + result.url;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
handleRadioChange(val) {
|
||||
this.read = val;
|
||||
},
|
||||
handleConfirm() {
|
||||
this.dialogVisible = false;
|
||||
this.read = true;
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sign-contract-container {
|
||||
font-family: Helvetica Neue, Helvetica, Arial, Microsoft Yahei, Hiragino Sans GB, Heiti SC, WenQuanYi Micro Hei, sans-serif;
|
||||
padding: 32px;
|
||||
/*background-color: rgb(240, 242, 245);*/
|
||||
position: relative;
|
||||
|
||||
.contract-title {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
|
||||
.detail {
|
||||
color: #0066cc;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.contract_dialog {
|
||||
|
||||
|
||||
.dialog-detail {
|
||||
height: 60vh;
|
||||
margin-top: -12px;
|
||||
margin-bottom: -12px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.line-rule {
|
||||
margin: 4px 0;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.chart-wrapper {
|
||||
background: #fff;
|
||||
padding: 16px 16px 0;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.chart-wrapper {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user