Merge branch 'master' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
@ -3,9 +3,14 @@
|
||||
<div v-for="item in mData" :key="item">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div v-if="data.length > 3">
|
||||
<div>...</div>
|
||||
<el-popover placement="top-start" width="200" popper-class="autohideinfo_detial" trigger="hover">
|
||||
<div v-if="data.length > line">
|
||||
<div v-if="line > 0">...</div>
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
width="200"
|
||||
popper-class="autohideinfo_detial"
|
||||
trigger="hover"
|
||||
>
|
||||
<div v-for="item in data" :key="item">{{ item }}</div>
|
||||
<el-button type="text" slot="reference">详情</el-button>
|
||||
</el-popover>
|
||||
@ -14,37 +19,39 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AutoHideInfo",
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
export default {
|
||||
name: "AutoHideInfo",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: "",
|
||||
// required: true,
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: '',
|
||||
// required: true,
|
||||
},
|
||||
line: {
|
||||
type: Number,
|
||||
default: 3,
|
||||
},
|
||||
computed: {
|
||||
mData: function () {
|
||||
if (this.data instanceof Array) {
|
||||
return this.data.slice(0, 3);
|
||||
}
|
||||
return [];
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
mData: function () {
|
||||
if (this.data instanceof Array) {
|
||||
return this.data.slice(0, this.line);
|
||||
}
|
||||
return [];
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.autohideinfo_wrapper {
|
||||
<style scoped>
|
||||
.autohideinfo_wrapper {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.autohideinfo_detial {
|
||||
max-height: 240px;
|
||||
overflow: auto;
|
||||
}
|
||||
.autohideinfo_detial {
|
||||
max-height: 240px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -36,7 +36,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.autohideinfo_wrapper {
|
||||
|
||||
}
|
||||
|
@ -3,28 +3,51 @@
|
||||
<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="projectId">
|
||||
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
|
||||
<el-option v-for="dict in conditioningProjectIdOption"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"/>
|
||||
<el-select
|
||||
v-model="form.projectId"
|
||||
placeholder="请选择调理项目"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in conditioningProjectIdOption"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="客户姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="金额" prop="amount" style="width: 300px;">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
<el-form-item label="金额" prop="amount" style="width: 300px">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0" >
|
||||
<el-input style="width: 200px;" v-model="form.servePromise" placeholder="请输入服务承诺"/><span style="margin-left: 5px;">斤</span>
|
||||
<el-form-item
|
||||
label="服务承诺"
|
||||
prop="servePromise"
|
||||
v-show="form.projectId == 0"
|
||||
>
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
v-model="form.servePromise"
|
||||
placeholder="请输入服务承诺"
|
||||
/><span style="margin-left: 5px">斤</span>
|
||||
</el-form-item>
|
||||
<el-form-item 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
|
||||
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">
|
||||
@ -38,7 +61,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -48,20 +75,17 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {addContract} from "@/api/custom/contract";
|
||||
import {getOptions} from "@/api/custom/order";
|
||||
import { addContract } from "@/api/custom/contract";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ContractAdd",
|
||||
components: {
|
||||
|
||||
},
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
const checkServePromise = (rule, value, callback) => {
|
||||
if (this.form.projectId == 0 && !value) {
|
||||
return callback(new Error('请输入服务承诺'))
|
||||
return callback(new Error("请输入服务承诺"));
|
||||
}
|
||||
callback();
|
||||
};
|
||||
@ -75,14 +99,14 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
projectId:[
|
||||
{required: true, message: "请选择调理项目", trigger: "blur"}
|
||||
projectId: [
|
||||
{ required: true, message: "请选择调理项目", trigger: "blur" },
|
||||
],
|
||||
/*name: [
|
||||
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
||||
],*/
|
||||
amount: [
|
||||
{required: true, message: "请输入签订金额", trigger: "blur"},
|
||||
{ required: true, message: "请输入签订金额", trigger: "blur" },
|
||||
{
|
||||
required: true,
|
||||
trigger: "blur",
|
||||
@ -91,35 +115,31 @@ export default {
|
||||
},
|
||||
],
|
||||
servePromise: [
|
||||
{required: true, trigger: "blur", validator: checkServePromise}
|
||||
{ required: true, trigger: "blur", validator: checkServePromise },
|
||||
],
|
||||
serveTime: [
|
||||
{required: true, message: "请选择服务时间", trigger: "blur"}
|
||||
{ required: true, message: "请选择服务时间", trigger: "blur" },
|
||||
],
|
||||
nutritionistId: [
|
||||
{required: true, message: "请选择营养师", trigger: "blur"}
|
||||
]
|
||||
{ required: true, message: "请选择营养师", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
conditioningProjectIdOption:[],
|
||||
serveTimeOptions:[],
|
||||
nutritionistIdOptions:[]
|
||||
conditioningProjectIdOption: [],
|
||||
serveTimeOptions: [],
|
||||
// nutritionistIdOptions: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
nutritionistIdOptions: (state) =>
|
||||
state.global.nutritionistIdOptions.slice(1),
|
||||
}),
|
||||
},
|
||||
created() {
|
||||
getOptions().then(response => {
|
||||
const options = response.data.reduce((opts, cur) => {
|
||||
if (!opts[cur.postCode]) {
|
||||
opts[cur.postCode] = [];
|
||||
}
|
||||
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
|
||||
return opts;
|
||||
}, {})
|
||||
this.nutritionistIdOptions = options['nutri'] || [];
|
||||
})
|
||||
this.getDicts("cus_serve_time").then(response => {
|
||||
this.getDicts("cus_serve_time").then((response) => {
|
||||
this.serveTimeOptions = response.data;
|
||||
});
|
||||
this.getDicts("conditioning_project").then(response => {
|
||||
this.getDicts("conditioning_project").then((response) => {
|
||||
this.conditioningProjectIdOption = response.data;
|
||||
});
|
||||
},
|
||||
@ -127,29 +147,37 @@ export default {
|
||||
showDialog(data, callback) {
|
||||
this.callback = callback;
|
||||
this.reset(data);
|
||||
this.title = "新增"+`「${data.customer}」客户合同`;
|
||||
this.title = "新增" + `「${data.customer}」客户合同`;
|
||||
this.open = true;
|
||||
},
|
||||
// 表单重置
|
||||
reset(obj) {
|
||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue === obj.nutritionistId);
|
||||
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
|
||||
const defaultNutritionist = this.nutritionistIdOptions.find(
|
||||
(opt) => opt.dictValue === obj.nutritionistId
|
||||
);
|
||||
const defaultProjectIdOption = this.conditioningProjectIdOption.find(
|
||||
(opt) => opt.remark === "default"
|
||||
);
|
||||
|
||||
this.form = {
|
||||
id: null,
|
||||
customerId: obj.customerId,
|
||||
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
|
||||
projectId: defaultProjectIdOption
|
||||
? parseInt(defaultProjectIdOption.dictValue)
|
||||
: null,
|
||||
name: obj.customer,
|
||||
phone: null,
|
||||
serveTime: null,
|
||||
amount: null,
|
||||
path: null,
|
||||
createBy: null,
|
||||
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
||||
nutritionistId: defaultNutritionist
|
||||
? parseInt(defaultNutritionist.dictValue)
|
||||
: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -159,13 +187,16 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
|
||||
if(this.form.projectId != 0){
|
||||
this.form.tutor = this.selectDictLabel(
|
||||
this.nutritionistIdOptions,
|
||||
this.form.nutritionistId
|
||||
);
|
||||
if (this.form.projectId != 0) {
|
||||
this.form.servePromise = null;
|
||||
}
|
||||
addContract(this.form).then(response => {
|
||||
addContract(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
@ -174,7 +205,7 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -4,6 +4,7 @@
|
||||
:title="title"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="visible"
|
||||
:wrapperClosable="false"
|
||||
@closed="handleOnClosed"
|
||||
size="40%"
|
||||
>
|
||||
@ -22,22 +23,48 @@
|
||||
</el-row>
|
||||
|
||||
<el-table :data="contractList">
|
||||
<el-table-column label="合同编号" align="center" prop="id" width="150"/>
|
||||
<el-table-column label="合同状态" align="center" prop="status" width="80" >
|
||||
<el-table-column
|
||||
label="合同编号"
|
||||
align="center"
|
||||
prop="id"
|
||||
width="150"
|
||||
/>
|
||||
<el-table-column
|
||||
label="合同状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
width="80"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.status === 'yes' ? 'success' : 'danger'"
|
||||
disable-transitions>
|
||||
{{scope.row.status === 'yes' ? '已签订':'未签订'}}
|
||||
disable-transitions
|
||||
>
|
||||
{{ scope.row.status === "yes" ? "已签订" : "未签订" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户姓名" align="center" prop="name" width="200"/>
|
||||
<el-table-column
|
||||
label="客户姓名"
|
||||
align="center"
|
||||
prop="name"
|
||||
width="200"
|
||||
/>
|
||||
|
||||
<el-table-column label="合同地址" align="center" prop="path" width="80">
|
||||
<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
|
||||
type="text"
|
||||
icon="el-icon-copy-document"
|
||||
@click="handleCopy(scope.row.path)"
|
||||
class="copyBtn"
|
||||
:data-clipboard-text="copyValue"
|
||||
>复制
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -48,15 +75,15 @@
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleOnDetailClick(scope.row)"
|
||||
>详情
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status==='yes'"
|
||||
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"
|
||||
@ -64,7 +91,7 @@
|
||||
icon="el-icon-delete"
|
||||
@click="handleOnDeleteClick(scope.row)"
|
||||
v-hasPermi="['custom:contract:remove']"
|
||||
>删除
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -78,23 +105,23 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {delContract, listContract} from "@/api/custom/contract";
|
||||
import ContractDetail from "@/components/ContractDetail";
|
||||
import Clipboard from 'clipboard';
|
||||
import ContractAdd from "@/components/ContractAdd";
|
||||
import { delContract, listContract } from "@/api/custom/contract";
|
||||
import ContractDetail from "@/components/ContractDetail";
|
||||
import Clipboard from "clipboard";
|
||||
import ContractAdd from "@/components/ContractAdd";
|
||||
|
||||
export default {
|
||||
name: "CustomerContractDrawer",
|
||||
components: {
|
||||
'contract-detail': ContractDetail,
|
||||
'add-contract':ContractAdd
|
||||
"contract-detail": ContractDetail,
|
||||
"add-contract": ContractAdd,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: "",
|
||||
data: undefined,
|
||||
copyValue:"",
|
||||
copyValue: "",
|
||||
contractList: [],
|
||||
};
|
||||
},
|
||||
@ -108,7 +135,7 @@ export default {
|
||||
this.fetchContractList(data.id);
|
||||
},
|
||||
fetchContractList(cusId) {
|
||||
listContract({"customerId": cusId }).then((res) => {
|
||||
listContract({ customerId: cusId }).then((res) => {
|
||||
this.contractList = res.rows;
|
||||
this.visible = true;
|
||||
});
|
||||
@ -118,7 +145,7 @@ export default {
|
||||
{
|
||||
customer: this.data.name,
|
||||
customerId: this.data.id,
|
||||
nutritionistId: this.data.mainDietitian
|
||||
nutritionistId: this.data.mainDietitian,
|
||||
},
|
||||
() => {
|
||||
this.fetchContractList(this.data.id);
|
||||
@ -131,9 +158,7 @@ export default {
|
||||
handleOnDetailClick(data) {
|
||||
this.$refs.contractDetailRef.showDialog(data.id);
|
||||
},
|
||||
handleOnEditClick(data) {
|
||||
|
||||
},
|
||||
handleOnEditClick(data) {},
|
||||
handleOnDeleteClick(data) {
|
||||
const contractIds = data.id;
|
||||
this.$confirm(
|
||||
@ -155,18 +180,18 @@ export default {
|
||||
.catch(function () {});
|
||||
},
|
||||
handleCopy(path) {
|
||||
this.copyValue = window.location.origin.replace('manage', 'sign') + path;
|
||||
const btnCopy = new Clipboard('.copyBtn');
|
||||
this.copyValue = window.location.origin.replace("manage", "sign") + path;
|
||||
const btnCopy = new Clipboard(".copyBtn");
|
||||
this.$message({
|
||||
message: '拷贝成功',
|
||||
type: 'success'
|
||||
message: "拷贝成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
handleLook(path) {
|
||||
const url = window.location.origin.replace('manage', 'sign') + path;
|
||||
const url = window.location.origin.replace("manage", "sign") + path;
|
||||
// const url = "http://stsign.busyinn.com" + path;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
window.open(url, "_blank");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -113,7 +113,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.editor, .ql-toolbar {
|
||||
white-space: pre-wrap!important;
|
||||
line-height: normal !important;
|
||||
@ -192,4 +192,4 @@ export default {
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -14,15 +14,25 @@
|
||||
<el-cascader
|
||||
v-model="form.orderType"
|
||||
:options="orderTypeOptions"
|
||||
style="width: 100%">
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="自动创建售后提成订单" prop="secondAfterSaleFlag" label-width="200px">
|
||||
<el-select v-model="form.secondAfterSaleFlag" :disabled="secondAfterSaleFlagShow" style="width: 100px" placeholder="请选择">
|
||||
<el-option :key="0" label="否" :value="0"/>
|
||||
<el-option :key="1" label="是" :value="1"/>
|
||||
<el-form-item
|
||||
label="自动创建售后提成订单"
|
||||
prop="secondAfterSaleFlag"
|
||||
label-width="200px"
|
||||
>
|
||||
<el-select
|
||||
v-model="form.secondAfterSaleFlag"
|
||||
:disabled="secondAfterSaleFlagShow"
|
||||
style="width: 100px"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option :key="0" label="否" :value="0" />
|
||||
<el-option :key="1" label="是" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -120,7 +130,11 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="主营养师" prop="nutritionistIdList">
|
||||
<el-select v-model="form.nutritionistIdList" multiple placeholder="请选择">
|
||||
<el-select
|
||||
v-model="form.nutritionistIdList"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -132,7 +146,11 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拆分比例" prop="nutritionistRate">
|
||||
<el-select v-model="form.nutritionistRate" :disabled="orderRateOptionsShow" placeholder="请选择" >
|
||||
<el-select
|
||||
v-model="form.nutritionistRate"
|
||||
:disabled="orderRateOptionsShow"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in orderRateOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -264,9 +282,11 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { addOrder, getOptions, updateOrder } from "@/api/custom/order";
|
||||
import { addOrder, updateOrder } from "@/api/custom/order";
|
||||
import dayjs from "dayjs";
|
||||
import * as orderTypeData from "@/utils/orderType";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OrderEdit",
|
||||
props: {
|
||||
@ -383,16 +403,6 @@ export default {
|
||||
},
|
||||
// 收款方式字典
|
||||
payTypeIdOptions: [],
|
||||
// 售前字典
|
||||
preSaleIdOptions: [],
|
||||
// 售后字典
|
||||
afterSaleIdOptions: [],
|
||||
// 主营养师字典
|
||||
nutritionistIdOptions: [],
|
||||
// 助理营养师字典
|
||||
nutriAssisIdOptions: [],
|
||||
// 策划字典
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 服务时长
|
||||
@ -401,54 +411,25 @@ export default {
|
||||
giveTimeIdOption: [],
|
||||
//调理项目
|
||||
conditioningProjectIdOption: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
operatorIdOptions: [],
|
||||
// 审核状态
|
||||
reviewStatusOptions: [],
|
||||
//
|
||||
operatorAssisIdOptions: [],
|
||||
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
||||
orderDropdownCorrespondingOptions: [],
|
||||
//订单类型
|
||||
orderTypeOptions: orderTypeData['orderTypeArray'],
|
||||
orderTypeOptions: orderTypeData["orderTypeArray"],
|
||||
secondAfterSaleFlagShow: true,
|
||||
//分成比例
|
||||
orderRateOptions: orderTypeData['orderRateArray'],
|
||||
orderRateOptionsShow: true
|
||||
orderRateOptions: orderTypeData["orderRateArray"],
|
||||
orderRateOptionsShow: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
getOptions().then((res) => {
|
||||
const options = res.data.reduce((opts, cur) => {
|
||||
if (!opts[cur.postCode]) {
|
||||
opts[cur.postCode] = [
|
||||
{ dictValue: 0, dictLabel: "无", remark: null },
|
||||
];
|
||||
}
|
||||
opts[cur.postCode].push({
|
||||
dictValue: cur.userId,
|
||||
dictLabel: cur.userName,
|
||||
remark: cur.remark,
|
||||
});
|
||||
return opts;
|
||||
}, {});
|
||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
||||
this.nutritionistIdOptions = options["nutri"] || [];
|
||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
||||
this.plannerIdOptions = options["planner"] || [];
|
||||
this.plannerAssisIdOptions = options["planner_assis"] || [];
|
||||
this.operatorIdOptions = options["operator"] || [];
|
||||
this.operatorAssisIdOptions = options["operator_assis"] || [];
|
||||
});
|
||||
this.getDicts("cus_pay_type").then((response) => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then((response) => {
|
||||
this.accountIdOptions = response.data;
|
||||
console.log(response.data);
|
||||
// console.log(response.data);
|
||||
this.accountIdOptions.splice(0, 0, {
|
||||
dictLabel: "无",
|
||||
dictValue: "0",
|
||||
@ -484,6 +465,26 @@ export default {
|
||||
this.orderTypeOptions = response.data;
|
||||
});*/
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
// 售前字典
|
||||
"preSaleIdOptions",
|
||||
// 售后字典
|
||||
"afterSaleIdOptions",
|
||||
// 主营养师字典
|
||||
"nutritionistIdOptions",
|
||||
// 助理营养师字典
|
||||
"nutriAssisIdOptions",
|
||||
// 策划字典
|
||||
"plannerIdOptions",
|
||||
// 策划助理字典
|
||||
"plannerAssisIdOptions",
|
||||
// 运营字典
|
||||
"operatorIdOptions",
|
||||
// 运营助理字典
|
||||
"operatorAssisIdOptions",
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
showDialog(data, callback) {
|
||||
// this.data = data;
|
||||
@ -554,7 +555,9 @@ export default {
|
||||
(opt) => parseInt(opt.dictValue) === accountId
|
||||
);
|
||||
|
||||
const defaultOrderRate = this.orderRateOptions.find((opt) => opt.remark === "default");
|
||||
const defaultOrderRate = this.orderRateOptions.find(
|
||||
(opt) => opt.remark === "default"
|
||||
);
|
||||
|
||||
const [
|
||||
plannerId,
|
||||
@ -590,7 +593,9 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
nutritionistId: null,
|
||||
nutritionistIdList: defaultNutritionist ? [parseInt(defaultNutritionist.dictValue)] : null,
|
||||
nutritionistIdList: defaultNutritionist
|
||||
? [parseInt(defaultNutritionist.dictValue)]
|
||||
: null,
|
||||
nutritionistRate: defaultOrderRate ? defaultOrderRate.dictValue : null,
|
||||
remark: null,
|
||||
nutriAssisId: defaultNutriAssis
|
||||
@ -647,9 +652,9 @@ export default {
|
||||
};
|
||||
}
|
||||
},
|
||||
handleOrderTypeChange(){
|
||||
console.log(this.form.orderType);
|
||||
}
|
||||
handleOrderTypeChange() {
|
||||
console.log(this.form.orderType);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听收款账号的变化
|
||||
@ -657,22 +662,22 @@ export default {
|
||||
this.initPlanningAndOperation();
|
||||
},
|
||||
"form.orderType": function (newVal, oldVal) {
|
||||
//判断订单类型是否选择了二开
|
||||
if(newVal[1] == 1){
|
||||
this.form.secondAfterSaleFlag = 1;
|
||||
this.secondAfterSaleFlagShow = false;
|
||||
}else{
|
||||
this.form.secondAfterSaleFlag = 0;
|
||||
this.secondAfterSaleFlagShow = true;
|
||||
}
|
||||
//判断是否选择了比例拆分单
|
||||
if(newVal[0] == 1){
|
||||
this.orderRateOptionsShow = false;
|
||||
this.form.nutritionistRate = "2,8";
|
||||
}else{
|
||||
this.orderRateOptionsShow = true;
|
||||
this.form.nutritionistRate = "0,10";
|
||||
}
|
||||
//判断订单类型是否选择了二开
|
||||
if (newVal[1] == 1) {
|
||||
this.form.secondAfterSaleFlag = 1;
|
||||
this.secondAfterSaleFlagShow = false;
|
||||
} else {
|
||||
this.form.secondAfterSaleFlag = 0;
|
||||
this.secondAfterSaleFlagShow = true;
|
||||
}
|
||||
//判断是否选择了比例拆分单
|
||||
if (newVal[0] == 1) {
|
||||
this.orderRateOptionsShow = false;
|
||||
this.form.nutritionistRate = "2,8";
|
||||
} else {
|
||||
this.orderRateOptionsShow = true;
|
||||
this.form.nutritionistRate = "0,10";
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -4,6 +4,7 @@
|
||||
:title="title"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="visible"
|
||||
:wrapperClosable="false"
|
||||
@closed="handleOnClosed"
|
||||
size="40%"
|
||||
>
|
||||
|
@ -235,8 +235,9 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { addOrder, getOptions, updateOrder } from "@/api/custom/order";
|
||||
import { addOrder, updateOrder } from "@/api/custom/order";
|
||||
import dayjs from "dayjs";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OrderEdit",
|
||||
@ -354,16 +355,6 @@ export default {
|
||||
},
|
||||
// 收款方式字典
|
||||
payTypeIdOptions: [],
|
||||
// 售前字典
|
||||
preSaleIdOptions: [],
|
||||
// 售后字典
|
||||
afterSaleIdOptions: [],
|
||||
// 主营养师字典
|
||||
nutritionistIdOptions: [],
|
||||
// 助理营养师字典
|
||||
nutriAssisIdOptions: [],
|
||||
// 策划字典
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 服务时长
|
||||
@ -372,42 +363,13 @@ export default {
|
||||
giveTimeIdOption: [],
|
||||
//调理项目
|
||||
conditioningProjectIdOption: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
operatorIdOptions: [],
|
||||
// 审核状态
|
||||
reviewStatusOptions: [],
|
||||
//
|
||||
operatorAssisIdOptions: [],
|
||||
//下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理)
|
||||
orderDropdownCorrespondingOptions: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
getOptions().then((res) => {
|
||||
const options = res.data.reduce((opts, cur) => {
|
||||
if (!opts[cur.postCode]) {
|
||||
opts[cur.postCode] = [
|
||||
{ dictValue: 0, dictLabel: "无", remark: null },
|
||||
];
|
||||
}
|
||||
opts[cur.postCode].push({
|
||||
dictValue: cur.userId,
|
||||
dictLabel: cur.userName,
|
||||
remark: cur.remark,
|
||||
});
|
||||
return opts;
|
||||
}, {});
|
||||
this.preSaleIdOptions = options["pre_sale"] || [];
|
||||
this.afterSaleIdOptions = options["after_sale"] || [];
|
||||
this.nutritionistIdOptions = options["nutri"] || [];
|
||||
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
||||
this.plannerIdOptions = options["planner"] || [];
|
||||
this.plannerAssisIdOptions = options["planner_assis"] || [];
|
||||
this.operatorIdOptions = options["operator"] || [];
|
||||
this.operatorAssisIdOptions = options["operator_assis"] || [];
|
||||
});
|
||||
this.getDicts("cus_pay_type").then((response) => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
@ -435,6 +397,26 @@ export default {
|
||||
this.orderDropdownCorrespondingOptions = response.data;
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
// 售前字典
|
||||
"preSaleIdOptions",
|
||||
// 售后字典
|
||||
"afterSaleIdOptions",
|
||||
// 主营养师字典
|
||||
"nutritionistIdOptions",
|
||||
// 助理营养师字典
|
||||
"nutriAssisIdOptions",
|
||||
// 策划字典
|
||||
"plannerIdOptions",
|
||||
// 策划助理字典
|
||||
"plannerAssisIdOptions",
|
||||
// 运营字典
|
||||
"operatorIdOptions",
|
||||
// 运营助理字典
|
||||
"operatorAssisIdOptions",
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
showDialog(data, callback) {
|
||||
// this.data = data;
|
||||
|
@ -472,7 +472,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="aspect">指标</div>
|
||||
<div class="recipes">
|
||||
<el-table :data="mData" border :span-method="spanMethod" size="mini">
|
||||
<el-table-column :label="`${name}第${num}天`"></el-table-column>
|
||||
<el-table-column label="菜品" prop="name"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "RecipesCom",
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: [],
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
num: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
mounted() {
|
||||
// console.log(this.data);
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
mData() {
|
||||
if (!this.data.dishes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const mData = this.data.dishes.reduce((arr, cur) => {
|
||||
if (cur.id > 0) {
|
||||
cur.igdList.forEach((igd) => {
|
||||
if (igd.id > 0) {
|
||||
const tarDetail = cur.detail.find((det) => det.id == igd.id);
|
||||
arr.push({
|
||||
id: cur.id,
|
||||
name: cur.name,
|
||||
type: cur.type,
|
||||
isMain: cur.isMain,
|
||||
methods: cur.methods,
|
||||
igdId: igd.id,
|
||||
igdName: igd.name,
|
||||
proteinRatio: igd.proteinRatio,
|
||||
fatRatio: igd.fatRatio,
|
||||
carbonRatio: igd.carbonRatio,
|
||||
rec: igd.rec,
|
||||
notRec: igd.notRec,
|
||||
weight: tarDetail ? tarDetail.weight : igd.weight,
|
||||
cusWeight: tarDetail ? tarDetail.cus_weight : igd.cusWeight,
|
||||
cusUnit: tarDetail ? tarDetail.cus_unit : igd.cusUnit,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
// console.log(mData);
|
||||
return mData;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
spanMethod({ row, column, rowIndex, columnIndex }) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.main {
|
||||
.aspect {
|
||||
}
|
||||
|
||||
.recipies {
|
||||
}
|
||||
}
|
||||
</style>
|
52
stdiet-ui/src/components/TextInfo/index.vue
Normal file
52
stdiet-ui/src/components/TextInfo/index.vue
Normal file
@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div :class="classname">
|
||||
<span class="info_title">{{ title }}:</span>
|
||||
<span v-if="newLine">
|
||||
<div v-for="value in mValue" :key="value">{{ value }}</div>
|
||||
</span>
|
||||
<span v-else class="info_value">{{ mValue }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "TextInfo",
|
||||
data() {
|
||||
return {
|
||||
classname: `text_info_wrapper ${this.extraclass || ""}`,
|
||||
newLine: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mValue: function () {
|
||||
if (
|
||||
this.value &&
|
||||
typeof this.value === "string" &&
|
||||
this.value.includes("</br>")
|
||||
) {
|
||||
this.newLine = true;
|
||||
return this.value.split("</br>");
|
||||
}
|
||||
return this.value;
|
||||
},
|
||||
},
|
||||
props: ["title", "value", "extraclass"],
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" >
|
||||
.text_info_wrapper {
|
||||
display: flex;
|
||||
margin-right: 24px;
|
||||
min-width: 120px;
|
||||
font-size: 14px;
|
||||
|
||||
.info_title {
|
||||
color: #8c8c8c;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.info_value {
|
||||
/* color: #696969; */
|
||||
flex: 1 1 0;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user