Commit 76f7a078 authored by zhengke's avatar zhengke

1

parent 7acb3229
...@@ -10,5 +10,5 @@ export default defineComponent({ ...@@ -10,5 +10,5 @@ export default defineComponent({
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('./css/font.sass') @import url('./css/font.sass')
@import url('//at.alicdn.com/t/font_2930340_td0kzqw2z1.css') @import url('//at.alicdn.com/t/font_2930340_dn2rgl17m5t.css')
</style> </style>
<template> <template>
<q-dialog v-model="persistent" full-height maximized position="right" persistent @hide="closeShenheForm" <q-dialog v-model="persistent" full-height maximized position="right" persistent @hide="closeCutomer"
transition-show="slide-left"> transition-show="slide-left">
<div class="customMain"> <div class="customMain">
<div class="custom_Top"> <div class="custom_Top">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
</div> </div>
<div class="custom_HRight"> <div class="custom_HRight">
<q-btn color="primary" label="创建待办" /> <q-btn color="primary" size="sm" label="创建待办" />
</div> </div>
</div> </div>
<div class="custom_Bottom"> <div class="custom_Bottom">
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="customer_info_component" v-for="(item,index) in data.FiledDetailList"> <div class="customer_info_component" v-for="(item,index) in data.FiledDetailList" :key="index">
<!-- 1单行文本 2多行文本 3单选 4多选 5日期 6日期时间 7数值 --> <!-- 1单行文本 2多行文本 3单选 4多选 5日期 6日期时间 7数值 -->
<template v-if="item.Type==1"> <template v-if="item.Type==1">
<div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)"> <div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)">
...@@ -54,13 +54,13 @@ ...@@ -54,13 +54,13 @@
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
<div class="edit_content"> <div class="edit_content">
<div class="edit_info_wrap"> <div class="edit_info_wrap">
<q-input filled v-model="item.value" placeholder="请输入要修改的值"></q-input> <q-input filled v-model="item.Value" placeholder="请输入要修改的值"></q-input>
</div> </div>
</div> </div>
</div> </div>
...@@ -74,13 +74,13 @@ ...@@ -74,13 +74,13 @@
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
<div class="edit_content"> <div class="edit_content">
<div class="edit_info_wrap"> <div class="edit_info_wrap">
<q-input filled v-model="item.value" maxlength="50" placeholder="请输入要修改的值"></q-input> <q-input filled v-model="item.Value" maxlength="50" placeholder="请输入要修改的值"></q-input>
</div> </div>
</div> </div>
</div> </div>
...@@ -88,19 +88,19 @@ ...@@ -88,19 +88,19 @@
<template v-if="item.Type==3"> <template v-if="item.Type==3">
<div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)"> <div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)">
<div class="stage_label">{{item.Name}}</div> <div class="stage_label">{{item.Name}}</div>
<div class="stage_value"></div> <div class="stage_value">{{getSingle(item)}}</div>
</div> </div>
<div class="customer_info_edit" v-else> <div class="customer_info_edit" v-else>
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
<div class="edit_content"> <div class="edit_content">
<div class="edit_info_wrap"> <div class="edit_info_wrap">
<q-select filled option-value="Id" size="sm" v-model="item.value" option-label="Name" <q-select filled option-value="Id" size="sm" v-model="item.Value" option-label="Name"
:options="item.OptionsList" emit-value map-options label="请选择" /> :options="item.OptionsList" emit-value map-options label="请选择" />
</div> </div>
</div> </div>
...@@ -109,19 +109,19 @@ ...@@ -109,19 +109,19 @@
<template v-if="item.Type==4"> <template v-if="item.Type==4">
<div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)"> <div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)">
<div class="stage_label">{{item.Name}}</div> <div class="stage_label">{{item.Name}}</div>
<div class="stage_value"></div> <div class="stage_value">{{getMutipleCk(item)}}</div>
</div> </div>
<div class="customer_info_edit" v-else> <div class="customer_info_edit" v-else>
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
<div class="edit_content"> <div class="edit_content">
<div class="edit_info_wrap"> <div class="edit_info_wrap">
<q-select filled multiple use-chips option-value="Id" size="sm" v-model="item.CkValue" <q-select filled multiple use-chips option-value="Id" size="sm" v-model="data.multiArr"
option-label="Name" :options="item.OptionsList" emit-value map-options label="请选择" /> option-label="Name" :options="item.OptionsList" emit-value map-options label="请选择" />
</div> </div>
</div> </div>
...@@ -130,13 +130,14 @@ ...@@ -130,13 +130,14 @@
<template v-if="item.Type==5"> <template v-if="item.Type==5">
<div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)"> <div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)">
<div class="stage_label">{{item.Name}}</div> <div class="stage_label">{{item.Name}}</div>
<div class="stage_value"></div> <div class="stage_value">{{item.Value}}</div>
</div> </div>
<div class="customer_info_edit" v-else> <div class="customer_info_edit" v-else>
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div class=""></div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
...@@ -162,13 +163,13 @@ ...@@ -162,13 +163,13 @@
<template v-if="item.Type==6"> <template v-if="item.Type==6">
<div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)"> <div class="customer_info_Stage" v-if="!item.isShowEdit" @click="getCustomEdit(2,item)">
<div class="stage_label">{{item.Name}}</div> <div class="stage_label">{{item.Name}}</div>
<div class="stage_value"></div> <div class="stage_value">{{item.Value}}</div>
</div> </div>
<div class="customer_info_edit" v-else> <div class="customer_info_edit" v-else>
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
...@@ -200,13 +201,13 @@ ...@@ -200,13 +201,13 @@
<div class="edit_bar"> <div class="edit_bar">
<div class="item_label">{{item.Name}}</div> <div class="item_label">{{item.Name}}</div>
<div> <div>
<q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomEdit(2,item)" /> <q-btn color="white" size="sm" text-color="black" label="取消" @click="getCustomCancel(item)" />
<q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" /> <q-btn color="primary" style="margin-left:10px;" size="sm" label="确定" @click="saveCustomInfo(item)" />
</div> </div>
</div> </div>
<div class="edit_content"> <div class="edit_content">
<div class="edit_info_wrap"> <div class="edit_info_wrap">
<q-input filled v-model="item.value" maxlength="20" placeholder="数值"></q-input> <q-input filled v-model="item.Value" maxlength="20" placeholder="数值"></q-input>
</div> </div>
</div> </div>
</div> </div>
...@@ -248,11 +249,10 @@ ...@@ -248,11 +249,10 @@
</div> </div>
</div> </div>
<div class="dialog-out-close" @click="closeCutomer">
<q-icon name="iconfont icon-close" size="15px" />
</div>
</div> </div>
<!-- <div class="dialog-out-close" @click="closeProcess"
style="position:absolute;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;top:0;left:-30px;">
<q-icon name="iconfont icon-target-full" size="26px" />
</div> -->
</q-dialog> </q-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
//样式字符串 //样式字符串
CustomerId: { CustomerId: {
type: Number, type: Number,
default: '' default: 0
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
...@@ -293,6 +293,7 @@ ...@@ -293,6 +293,7 @@
customData: [], customData: [],
FiledDetailList: [], FiledDetailList: [],
isShowEdit: false, isShowEdit: false,
multiArr:[]
}) })
//获取详情数据 //获取详情数据
const getCustomInfo = (param: msgParam) => { const getCustomInfo = (param: msgParam) => {
...@@ -302,11 +303,14 @@ ...@@ -302,11 +303,14 @@
data.FiledDetailList.forEach(x => { data.FiledDetailList.forEach(x => {
x.isShowEdit = false; x.isShowEdit = false;
if(x.Type==4){ if(x.Type==4){
x.CkValue=x.Value.split(','); data.multiArr = x.Value.split(',')
x.CkValue = x.CkValue.map(item=>{ data.multiArr = data.multiArr.map(item=>{
return +item; return +item;
}) })
} }
if(x.Type==3){
x.Value = parseInt(x.Value);
}
}); });
cutomMsg.Value = data.dataList.StageId; cutomMsg.Value = data.dataList.StageId;
}) })
...@@ -314,12 +318,12 @@ ...@@ -314,12 +318,12 @@
//获取客户阶段下拉 //获取客户阶段下拉
const getCustomStage = (param: {}) => { const getCustomStage = (param: {}) => {
customer2.getCustomStageList(param).then(res => { customer2.getCustomStageList(param).then(res => {
console.log(res, '下拉数据');
data.customData = res.data.Data; data.customData = res.data.Data;
}) })
} }
//点击切换编辑和查看 //点击切换编辑和查看
const getCustomEdit = (type, e) => { const getCustomEdit = (type, e) => {
data.isShowEdit=false;
data.FiledDetailList.forEach(x => { data.FiledDetailList.forEach(x => {
x.isShowEdit = false; x.isShowEdit = false;
}); });
...@@ -328,32 +332,62 @@ ...@@ -328,32 +332,62 @@
} }
if (type == 2) { if (type == 2) {
e.isShowEdit = !e.isShowEdit; e.isShowEdit = !e.isShowEdit;
console.log(e);
} }
} }
//点击单个保存自定义客户信息 //点击单个保存自定义客户信息
const saveCustomInfo = (e) =>{ const saveCustomInfo = (e) =>{
if(e.Type==4){
e.CkValue=e.CkValue.toString();
}
cutomMsg.CustomerId = msg.CustomerId; cutomMsg.CustomerId = msg.CustomerId;
cutomMsg.CustomId = e.Id; cutomMsg.CustomId = e.Id;
cutomMsg.Type = 2; cutomMsg.Type = 2;
cutomMsg.Value = e.CkValue; if(e.Type==4){
cutomMsg.Value = data.multiArr.toString();
}else{
cutomMsg.Value = e.Value;
}
customer2.saveCustomInfo(cutomMsg).then(res => { customer2.saveCustomInfo(cutomMsg).then(res => {
getCustomInfo(msg); getCustomInfo(msg);
message.successMsg(res.data.Message); message.successMsg(res.data.Message);
}) })
} }
const getCustomCancel = (e) =>{
e.isShowEdit = !e.isShowEdit;
}
const saveCustomGate = () =>{ const saveCustomGate = () =>{
cutomMsg.CustomerId = msg.CustomerId; cutomMsg.CustomerId = msg.CustomerId;
cutomMsg.Type = 1; cutomMsg.Type = 1;
cutomMsg.CustomId=0; cutomMsg.CustomId=0;
customer2.saveCustomInfo(cutomMsg).then(res => { customer2.saveCustomInfo(cutomMsg).then(res => {
getCustomInfo(msg); getCustomInfo(msg);
data.isShowEdit = false;
message.successMsg(res.data.Message); message.successMsg(res.data.Message);
}) })
} }
//获取单选值
const getSingle = (e) =>{
if(e.Value&&e.OptionsList.length>0){
const ckedObj = e.OptionsList.find((x:any)=>{
return x.Id == e.Value
})
if(ckedObj){
return ckedObj.Name
}
}
}
//获取多选
const getMutipleCk = (e) =>{
if(e.Value&&e.OptionsList.length>0){
const ValArr = e.Value.split(',');
let myArr: any[] = [];
for(let i=0;i<ValArr.length;i++){
for(let j=0;j<e.OptionsList.length;j++){
if(ValArr[i]==e.OptionsList[j].Id){
myArr.push(e.OptionsList[j].Name);
}
}
}
return myArr.toString();
}
}
onMounted(() => { onMounted(() => {
getCustomInfo(msg); getCustomInfo(msg);
getCustomStage({}); getCustomStage({});
...@@ -365,7 +399,10 @@ ...@@ -365,7 +399,10 @@
cutomMsg, cutomMsg,
getCustomEdit, getCustomEdit,
saveCustomInfo, saveCustomInfo,
saveCustomGate saveCustomGate,
getCustomCancel,
getSingle,
getMutipleCk
} }
} }
} }
...@@ -384,7 +421,6 @@ ...@@ -384,7 +421,6 @@
height: 100 vh; height: 100 vh;
padding: 15px 17px 0 17px; padding: 15px 17px 0 17px;
background-color: #f4f4f6; background-color: #f4f4f6;
overflow: hidden;
} }
.custom_Top { .custom_Top {
...@@ -547,5 +583,17 @@ ...@@ -547,5 +583,17 @@
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
} }
.dialog-out-close{
background-color: #3470ff;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
width: 20px;
height: 26px;
color:#fff;
cursor: pointer;
position: absolute;
top: 0;
left: -20px;
text-align: center;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment