优化代码
This commit is contained in:
parent
73b36a1a8b
commit
e1d9d96244
@ -138,7 +138,7 @@ token:
|
||||
# 令牌密钥
|
||||
secret: shengtangdiet
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 120
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
|
@ -138,7 +138,7 @@ token:
|
||||
# 令牌密钥
|
||||
secret: shengtangdiet
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 120
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
|
@ -138,7 +138,7 @@ token:
|
||||
# 令牌密钥
|
||||
secret: shengtangdiet
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 120
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
|
@ -29,6 +29,11 @@ public class SysCustomer extends BaseEntity
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
/** 进粉日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "进粉日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date fansTime;
|
||||
|
||||
/** 邮箱 */
|
||||
@Excel(name = "邮箱")
|
||||
private String email;
|
||||
@ -237,6 +242,14 @@ public class SysCustomer extends BaseEntity
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Date getFansTime() {
|
||||
return fansTime;
|
||||
}
|
||||
|
||||
public void setFansTime(Date fansTime) {
|
||||
this.fansTime = fansTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
@ -12,6 +12,7 @@
|
||||
<result property="address" column="address" />
|
||||
<result property="payDate" column="pay_date" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="fansTime" column="fans_time" />
|
||||
<result property="purchaseNum" column="purchase_num" />
|
||||
<result property="payTotal" column="pay_total" />
|
||||
<result property="mainDietitian" column="main_dietitian" />
|
||||
@ -27,7 +28,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCustomerVo">
|
||||
select id, name, phone, email, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer
|
||||
select id, name, phone, email, fans_time, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
||||
@ -48,6 +49,7 @@
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="fansTime != null">fans_time,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="payDate != null">pay_date,</if>
|
||||
@ -68,6 +70,7 @@
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="fansTime != null">#{fansTime},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="payDate != null">#{payDate},</if>
|
||||
@ -92,6 +95,7 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="fansTime != null">fans_time = #{fansTime},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="payDate != null">pay_date = #{payDate},</if>
|
||||
|
138
stdiet-ui/src/components/OrderDetail/index.vue
Normal file
138
stdiet-ui/src/components/OrderDetail/index.vue
Normal file
@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="订单详情"
|
||||
:visible.sync="visible"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
@closed="onClosed"
|
||||
>
|
||||
<el-table
|
||||
:show-header="false"
|
||||
:data="orderDetailList"
|
||||
border
|
||||
:cell-style="columnStyle"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column width="120" prop="attr_name_one"> </el-table-column>
|
||||
<el-table-column prop="value_one">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
v-if="scope.row.attr_name_one === '审核状态'"
|
||||
:type="scope.row.value_one === 'yes' ? 'success' : 'danger'"
|
||||
>
|
||||
{{ scope.row.value_one === "yes" ? "已审核" : "未审核" }}
|
||||
</el-tag>
|
||||
<auto-hide-message
|
||||
v-else
|
||||
:data="scope.row.value_one == null ? '' : scope.row.value_one + ''"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_two"></el-table-column>
|
||||
<el-table-column prop="value_two">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message
|
||||
:data="scope.row.value_two == null ? '' : scope.row.value_two + ''"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_three"></el-table-column>
|
||||
<el-table-column prop="value_three">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message
|
||||
:data="
|
||||
scope.row.value_three == null ? '' : scope.row.value_three + ''
|
||||
"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
import { getInfoDetail } from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: "OrderDialog",
|
||||
components: {
|
||||
"auto-hide-message": AutoHideMessage,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
orderDetailList: [],
|
||||
visible: false,
|
||||
//订单详情的标题,按竖显示
|
||||
orderTitleData: [
|
||||
["审核状态", "成交时间", "调理项目"],
|
||||
["姓名", "手机号", "金额"],
|
||||
["收款方式", "收款账号", "服务时长"],
|
||||
["赠送时长", "售前", "售后"],
|
||||
["营养师", "助理营养师", "策划"],
|
||||
["策划助理", "运营", "运营助理"],
|
||||
["开始时间", "结束时间", "备注"],
|
||||
],
|
||||
//订单详情的属性名称,与标题对应,按竖显示
|
||||
orderValueData: [
|
||||
["reviewStatus", "orderTime", "conditioningProject"],
|
||||
["customer", "phone", "amount"],
|
||||
["payType", "account", "serveTime"],
|
||||
["giveServeDay", "preSale", "afterSale"],
|
||||
["nutritionist", "nutriAssis", "planner"],
|
||||
["plannerAssis", "operator", "operatorAssis"],
|
||||
["startTime", "serverEndTime", "remark"],
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 自定义列背景色
|
||||
columnStyle({ row, column, rowIndex, columnIndex }) {
|
||||
if (
|
||||
columnIndex == 0 ||
|
||||
columnIndex == 2 ||
|
||||
columnIndex == 4 ||
|
||||
columnIndex == 6
|
||||
) {
|
||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||
return "background:#f3f6fc;font-weight:bold";
|
||||
} else {
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
showDialog(orderId) {
|
||||
getInfoDetail({ orderId }).then((response) => {
|
||||
response.data.weight =
|
||||
response.data.weight != null ? response.data.weight + "斤" : "";
|
||||
response.data.giveServeDay =
|
||||
response.data.giveServeDay != null
|
||||
? response.data.giveServeDay + "天"
|
||||
: "";
|
||||
for (let i = 0; i < this.orderTitleData.length; i++) {
|
||||
this.orderDetailList.push({
|
||||
attr_name_one: this.orderTitleData[i][0],
|
||||
value_one: response.data[this.orderValueData[i][0]],
|
||||
attr_name_two: this.orderTitleData[i][1],
|
||||
value_two: response.data[this.orderValueData[i][1]],
|
||||
attr_name_three: this.orderTitleData[i][2],
|
||||
value_three: response.data[this.orderValueData[i][2]],
|
||||
});
|
||||
}
|
||||
this.visible = true;
|
||||
});
|
||||
},
|
||||
onClosed() {
|
||||
this.orderDetailList = [];
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// visible: function (val, oldVal) {
|
||||
// console.log({val, oldVal})
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
@ -65,9 +65,23 @@
|
||||
v-if="scope.row.orderType === 'main'"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleOnMenuClick(scope.row)"
|
||||
@click="handleOnDetailClick(scope.row)"
|
||||
>详情</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.orderType === 'main'"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleOnEditClick(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.orderType === 'main'"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleOnDeleteClick(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -75,16 +89,20 @@
|
||||
</el-drawer>
|
||||
|
||||
<create-order-dialog ref="cusCreateOrderDialogRef" />
|
||||
|
||||
<order-detail ref="orderDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listOrder } from "@/api/custom/order";
|
||||
import CreateOrderDialog from "./createOrderDialog";
|
||||
import { listOrder, delOrder } from "@/api/custom/order";
|
||||
import OrderEdit from "@/components/OrderEdit";
|
||||
import OrderDetail from "@/components/OrderDetail";
|
||||
|
||||
export default {
|
||||
name: "CustomerOrderDrawer",
|
||||
components: {
|
||||
"create-order-dialog": CreateOrderDialog,
|
||||
"create-order-dialog": OrderEdit,
|
||||
"order-detail": OrderDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -145,6 +163,34 @@ export default {
|
||||
handleOnClosed() {
|
||||
this.data = undefined;
|
||||
},
|
||||
handleOnDetailClick(data) {
|
||||
this.$refs.orderDetailRef.showDialog(data.orderId);
|
||||
},
|
||||
handleOnEditClick(data) {
|
||||
this.$refs.cusCreateOrderDialogRef.showDialog(data, () => {
|
||||
this.fetchOrderList(this.data.id);
|
||||
});
|
||||
},
|
||||
handleOnDeleteClick(data) {
|
||||
const orderIds = data.orderId || this.ids;
|
||||
this.$confirm(
|
||||
'是否确认删除销售订单编号为"' + orderIds + '"的数据项?',
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
return delOrder(orderIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.fetchOrderList(this.data.id);
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function () {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -239,7 +239,7 @@ import { addOrder, getOptions, updateOrder } from "@/api/custom/order";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
name: "OrderDialog",
|
||||
name: "OrderEdit",
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
@ -437,11 +437,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
showDialog(data, callback) {
|
||||
this.data = data;
|
||||
// this.data = data;
|
||||
this.callback = callback;
|
||||
this.reset(data);
|
||||
|
||||
this.title = `创建「${data.customer}」客户订单`;
|
||||
this.title = `${data.orderId ? "修改" : "创建"}「${
|
||||
data.customer
|
||||
}」客户订单`;
|
||||
this.visible = true;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -457,7 +459,6 @@ export default {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.form.status = "0";
|
||||
addOrder(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
@ -113,7 +113,17 @@
|
||||
prop="createTime"
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column label="名字" align="center" prop="name" />
|
||||
<el-table-column
|
||||
label="进粉时间"
|
||||
align="center"
|
||||
prop="fansTime"
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.fansTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户姓名" align="center" prop="name" />
|
||||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column
|
||||
label="主营养师"
|
||||
@ -159,16 +169,6 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="体征" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleOnBodySignClick(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="健康评估" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -226,9 +226,9 @@
|
||||
<!-- 添加或修改客户档案对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="520px" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-form-item label="客户名字" prop="customer">
|
||||
<el-input v-model="form.name" placeholder="请输入名字" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -237,6 +237,30 @@
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="salesman">
|
||||
<el-select v-model="form.salesman" 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="afterDietitian">
|
||||
<el-select v-model="form.afterDietitian" 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="mainDietitian">
|
||||
<el-select v-model="form.mainDietitian" placeholder="请选择">
|
||||
@ -262,27 +286,16 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterDietitian">
|
||||
<el-select v-model="form.afterDietitian" 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="salesman">
|
||||
<el-select v-model="form.salesman" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="进粉时间" prop="fansTime">
|
||||
<el-date-picker
|
||||
v-model="form.fansTime"
|
||||
type="date"
|
||||
placeholder="选择进粉时间"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="fanPickerOptions"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
@ -293,7 +306,11 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 订单抽屉 -->
|
||||
<order-drawer ref="cusOrderDrawerRef" />
|
||||
<!-- 合同抽屉 -->
|
||||
<!-- 健康评估弹窗 -->
|
||||
<!-- 食谱计划抽屉 -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -306,10 +323,11 @@ import {
|
||||
listCustomer,
|
||||
updateCustomer,
|
||||
} from "@/api/custom/customer";
|
||||
import store from "@/store";
|
||||
|
||||
import { getOptions } from "@/api/custom/order";
|
||||
|
||||
import OrderDrawer from "./orderDrawer";
|
||||
import OrderDrawer from "@/components/OrderDrawer";
|
||||
|
||||
export default {
|
||||
name: "Customer",
|
||||
@ -317,7 +335,9 @@ export default {
|
||||
"order-drawer": OrderDrawer,
|
||||
},
|
||||
data() {
|
||||
const userId = store.getters && store.getters.userId;
|
||||
return {
|
||||
userId,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@ -358,7 +378,40 @@ export default {
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
rules: {
|
||||
customer: [
|
||||
{ required: true, message: "客户姓名不能为空", trigger: "blur" },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
{
|
||||
required: true,
|
||||
trigger: "blur",
|
||||
pattern: /^[0-9]{5,11}$/,
|
||||
message: "手机号格式不正确",
|
||||
},
|
||||
],
|
||||
salesman: [
|
||||
{ required: true, message: "售前不能为空", trigger: "blur" },
|
||||
],
|
||||
afterDietitian: [
|
||||
{ required: true, message: "售后不能为空", trigger: "blur" },
|
||||
],
|
||||
mainDietitian: [
|
||||
{ required: true, message: "主营养师不能为空", trigger: "blur" },
|
||||
],
|
||||
assistantDietitian: [
|
||||
{ required: true, message: "营养师助理不能为空", trigger: "blur" },
|
||||
],
|
||||
fansTime: [
|
||||
{ required: true, message: "进粉时间不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
fanPickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -482,6 +535,12 @@ export default {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加客户档案";
|
||||
|
||||
// 选择默认销售
|
||||
const tarSale = this.preSaleIdOptions.find(
|
||||
(obj) => parseInt(obj.dictValue) === this.userId
|
||||
);
|
||||
this.form.salesman = tarSale ? tarSale.dictValue : null;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -227,8 +227,8 @@
|
||||
<script>
|
||||
import {exportRecipesPlan, getRecipesPlan, listRecipesPlan, updateRecipesPlan} from "@/api/custom/recipesPlan";
|
||||
import {getOptions} from "@/api/custom/order";
|
||||
import OrderDialog from './orderDialog';
|
||||
import BodySignDialog from './bodySignDialog';
|
||||
import OrderDetail from '@/components/OrderDetail';
|
||||
import BodySignDetail from '@/components/BodySignDetail';
|
||||
import dayjs from 'dayjs';
|
||||
import store from "@/store";
|
||||
|
||||
@ -295,8 +295,8 @@
|
||||
|
||||
},
|
||||
components: {
|
||||
"order-dialog": OrderDialog,
|
||||
"body_sign_dialog": BodySignDialog
|
||||
"order-dialog": OrderDetail,
|
||||
"body_sign_dialog": BodySignDetail
|
||||
},
|
||||
created() {
|
||||
getOptions().then(response => {
|
||||
|
@ -1,110 +0,0 @@
|
||||
<template>
|
||||
<el-dialog title="订单详情" :visible.sync="visible" width="1000px" append-to-body @closed="onClosed">
|
||||
<el-table :show-header="false" :data="orderDetailList" border :cell-style="columnStyle" style="width: 100%;">
|
||||
<el-table-column width="120" prop="attr_name_one">
|
||||
</el-table-column>
|
||||
<el-table-column prop="value_one">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.attr_name_one === '订单状态'"
|
||||
:type="scope.row.value_two === '2' ? 'success' : scope.row.value_one === '0'? '': 'danger'"
|
||||
disable-transitions>
|
||||
{{scope.row.value_two === '2' ? '已完成': scope.row.value_one ==='0'? '进行中': '已暂停'}}
|
||||
</el-tag>
|
||||
<auto-hide-message v-else :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')"
|
||||
:maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_two"></el-table-column>
|
||||
<el-table-column prop="value_two">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.attr_name_two === '审核状态'"
|
||||
:type="scope.row.value_two === 'yes' ? 'success' : 'danger'">
|
||||
{{scope.row.value_two === 'yes' ? '已审核' : '未审核'}}
|
||||
</el-tag>
|
||||
<auto-hide-message v-else :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')"
|
||||
:maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_three"></el-table-column>
|
||||
<el-table-column prop="value_three">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
import {getInfoDetail} from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: 'OrderDialog',
|
||||
components: {
|
||||
"auto-hide-message": AutoHideMessage
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
orderDetailList: [],
|
||||
visible: false,
|
||||
//订单详情的标题,按竖显示
|
||||
orderTitleData: [["订单状态", "审核状态", "成交时间"],
|
||||
["姓名", "金额", "体重"],
|
||||
["手机号", "服务时长", "赠送时长"],
|
||||
["调理项目", "收款方式", "售前"],
|
||||
["售后", "营养师", "助理营养师"],
|
||||
["账号", "策划", "策划助理"],
|
||||
["运营", "运营助理", "进粉时间"],
|
||||
["开始时间", "结束时间", "备注"]],
|
||||
//订单详情的属性名称,与标题对应,按竖显示
|
||||
orderValueData: [["status", "reviewStatus", "orderTime"],
|
||||
["customer", "amount", "weight"],
|
||||
["phone", "serveTime", "giveServeDay"],
|
||||
["conditioningProject", "payType", "preSale"],
|
||||
["afterSale", "nutritionist", "nutriAssis"],
|
||||
["account", "planner", "plannerAssis"],
|
||||
["operator", "operatorAssis", "becomeFanTime"],
|
||||
["startTime", "serverEndTime", "serverEndTime"]],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 自定义列背景色
|
||||
columnStyle({row, column, rowIndex, columnIndex}) {
|
||||
if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) {
|
||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||
return "background:#f3f6fc;font-weight:bold";
|
||||
} else {
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
showDialog(orderId) {
|
||||
getInfoDetail({orderId}).then(response => {
|
||||
response.data.weight = response.data.weight != null ? (response.data.weight + "斤") : "";
|
||||
response.data.giveServeDay = response.data.giveServeDay != null ? (response.data.giveServeDay + "天") : "";
|
||||
for (let i = 0; i < this.orderTitleData.length; i++) {
|
||||
this.orderDetailList.push({
|
||||
"attr_name_one": this.orderTitleData[i][0],
|
||||
"value_one": response.data[this.orderValueData[i][0]],
|
||||
"attr_name_two": this.orderTitleData[i][1],
|
||||
"value_two": response.data[this.orderValueData[i][1]],
|
||||
"attr_name_three": this.orderTitleData[i][2],
|
||||
"value_three": response.data[this.orderValueData[i][2]]
|
||||
});
|
||||
}
|
||||
this.visible = true;
|
||||
});
|
||||
},
|
||||
onClosed() {
|
||||
this.orderDetailList = [];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// visible: function (val, oldVal) {
|
||||
// console.log({val, oldVal})
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user