Commit cf97a8dd authored by Mac's avatar Mac

客户阶段页面修改

parent 0ed441c5
...@@ -514,6 +514,47 @@ export function SetSynvEduEmployee(data) { ...@@ -514,6 +514,47 @@ export function SetSynvEduEmployee(data) {
data data
}) })
} }
/**
* 获取客户阶段流程详情
*
*/
export function getCustomerStageFlowInfo(data) {
return request({
url: '/QYCustomer/GetCustomerStageFlowInfo',
method: 'post',
data
})
}
/**
* 设置客户阶段流程状态
*/
export function setCustomerStageFlowState(data) {
return request({
url: '/QYCustomer/SetCustomerStageFlowState',
method: 'post',
data
})
}
/**
* 验证该阶段是否可以删除
*/
export function validataCustomerStageDel(data) {
return request({
url: '/QYCustomer/ValidataCustomerStageDel',
method: 'post',
data
})
}
/**
* 验证阶段输单/无效的 原因选项是否可以删除
*/
export function validataCustomerCauseDel(data) {
return request({
url: '/QYCustomer/ValidataCustomerCauseDel',
method: 'post',
data
})
}
......
...@@ -138,8 +138,7 @@ ...@@ -138,8 +138,7 @@
</q-card-actions> </q-card-actions>
</div> </div>
<!-- 人员/部门选择 --> <!-- 人员/部门选择 -->
<choiceapprovalorbranch v-if="outerVisible" @close="outerVisible = false" @success="getsuccess2" :list=showMember <choiceapprovalorbranch v-if="outerVisible" @close="outerVisible = false" @success="getsuccess2" :list=showMember cptype="1"></choiceapprovalorbranch>
:byval='defaultlist' cptype="1"></choiceapprovalorbranch>
</div> </div>
</template> </template>
...@@ -147,7 +146,8 @@ ...@@ -147,7 +146,8 @@
import choiceapprovalorbranch from './components/choiceapprovalorbranch' import choiceapprovalorbranch from './components/choiceapprovalorbranch'
import { import {
getCustomerStageList, getCustomerStageList,
setCustomerStageFlowInfo setCustomerStageFlowInfo,
getCustomerStageFlowInfo
} from '../../../../api/system/wechat'; } from '../../../../api/system/wechat';
export default { export default {
meta: { meta: {
...@@ -176,9 +176,11 @@ ...@@ -176,9 +176,11 @@
UseStageName: [], UseStageName: [],
getheight: 270, getheight: 270,
gettypeoneList: [],//跟进阶段的数量 gettypeoneList: [],//跟进阶段的数量
FlowId: 0
} }
}, },
created() { created() {
this.getCustomerStageList() this.getCustomerStageList()
}, },
methods: { methods: {
...@@ -230,7 +232,6 @@ ...@@ -230,7 +232,6 @@
} else { } else {
data.InvalidCause = '' data.InvalidCause = ''
} }
console.log(data)
this.loading = true this.loading = true
setCustomerStageFlowInfo(data).then(res => { setCustomerStageFlowInfo(data).then(res => {
this.loading = false this.loading = false
...@@ -246,6 +247,37 @@ ...@@ -246,6 +247,37 @@
} }
}) })
}, },
getdetails() {//获取详情
getCustomerStageFlowInfo({ FlowId: this.FlowId }).then(res => {
if (res.Code == 1) {
this.addMsg = res.Data
if (this.addMsg.UseStage.length !='') {
this.addMsg.UseStage = this.addMsg.UseStage.split(',').map(Number)
} else {
this.addMsg.UseStage = []
}
if (this.addMsg.LoseCause.length !='') {
this.addMsg.LoseCause = this.addMsg.LoseCause.split(',').map(Number)
} else {
this.addMsg.LoseCause = []
}
if (this.addMsg.InvalidCause.length !='') {
this.addMsg.InvalidCause = this.addMsg.InvalidCause.split(',').map(Number)
} else {
this.addMsg.InvalidCause = []
}
this.showMember = []
this.addMsg.DeptEmpList.forEach(x=>{
let obj = {
DeptId: x.Id,
DeptName: x.Name,
DataType: x.Type,
}
this.showMember.push(obj)
})
}
})
},
getCustomerStageList() { getCustomerStageList() {
getCustomerStageList({}).then(res => { getCustomerStageList({}).then(res => {
this.loading = false this.loading = false
...@@ -264,13 +296,17 @@ ...@@ -264,13 +296,17 @@
this.getheight = 71 + Number(this.gettypeoneList.length) * 40 this.getheight = 71 + Number(this.gettypeoneList.length) * 40
} }
this.getusestageName() this.getusestageName()
if (this.$route.query && this.$route.query.FlowId) {//如果有的话 调接口
this.FlowId = this.$route.query.FlowId
this.getdetails()
}
} }
}) })
}, },
getsuccess2(list, defaultlist) { getsuccess2(list) {
this.showMember = list this.showMember = list
this.outerVisible = false this.outerVisible = false
this.defaultlist = defaultlist // this.defaultlist = defaultlist
}, },
stageManagement() {//跳转到阶段管理 stageManagement() {//跳转到阶段管理
......
...@@ -42,12 +42,22 @@ ...@@ -42,12 +42,22 @@
<el-tree class='ApprovalProcessBg' :filter-node-method="filterNode" :data="memberList" <el-tree class='ApprovalProcessBg' :filter-node-method="filterNode" :data="memberList"
show-checkbox ref="treeUser" :props="defaultProps" :render-after-expand="false" show-checkbox ref="treeUser" :props="defaultProps" :render-after-expand="false"
node-key="DeptId" @check-change="handleNodeChange" @check='btncheck'> node-key="DeptId" @check-change="handleNodeChange" @check='btncheck'>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>
<i class="el-icon-folder" v-if="data.DataType==1" style="margin-right: 3px;color: var(--q-color-primary)!important;"></i>
<i class="el-icon-user-solid" v-if="data.DataType==2" style="margin-right: 3px;color: var(--q-color-primary)!important;"></i>
{{ node.label }}
</span>
</span>
</el-tree> </el-tree>
</div> </div>
<div style="width: 300px; margin: 0 20px;"> <div style="width: 300px; margin: 0 20px;">
<p style="margin: 0 0 20px 0;">已选:</p> <p style="margin: 0 0 20px 0;">已选:</p>
<div class="Approval_yxList"> <div class="Approval_yxList">
<li v-for="item in newList">{{item.DeptName}} <li v-for="item in newList">
<i v-if="item.DataType==1" class="el-icon-folder" style="margin-right: 3px;color: var(--q-color-primary)!important;"></i>
<i v-if="item.DataType==2" class="el-icon-user-solid" style="margin-right: 3px;color: var(--q-color-primary)!important;"></i>
{{item.DeptName}}
<i @click="mySetCheckedKeys(item)" <i @click="mySetCheckedKeys(item)"
class="el-icon-circle-close showMemberIcon"></i> class="el-icon-circle-close showMemberIcon"></i>
</li> </li>
...@@ -80,10 +90,10 @@ ...@@ -80,10 +90,10 @@
type: String, type: String,
default: '', default: '',
}, },
byval: { // byval: {
type: Array, // type: Array,
default: [], // default: [],
}, // },
cptype: {//1是列表上使用2 新增使用 cptype: {//1是列表上使用2 新增使用
type: String, type: String,
default: '1', default: '1',
...@@ -114,15 +124,14 @@ ...@@ -114,15 +124,14 @@
}, },
created() { created() {
this.IsShow = true this.IsShow = true
if (this.byval.length > 0) {
this.memberSetCheckedKeys = []; // if (this.byval.length > 0) {
this.showMember = JSON.parse(JSON.stringify(this.byval)) // this.memberSetCheckedKeys = [];
this.newList = JSON.parse(JSON.stringify(this.list)) // this.showMember = JSON.parse(JSON.stringify(this.byval))
// this.byval.forEach(x => {
this.byval.forEach(x => { // this.memberSetCheckedKeys.push(x.DeptId)
this.memberSetCheckedKeys.push(x.DeptId) // })
}) // }
}
this.getMember()//部门下面选择员工 this.getMember()//部门下面选择员工
}, },
mounted() { mounted() {
...@@ -134,12 +143,77 @@ ...@@ -134,12 +143,77 @@
}, },
}, },
methods: { methods: {
huoqucheckedkey(){//根据传过来的list 数据处理
let newList = this.newList;
this.memberList.forEach(x=>{
newList.forEach(z=>{
if(x.DeptId == z.DeptId){
this.memberSetCheckedKeys.push(x.DeptId)
this.showMember.push(x)
if(x.ChildList && x.ChildList.length>0){
x.ChildList.forEach(j => {
this.memberSetCheckedKeys.push(j.DeptId)
this.showMember.push(j)
if(j.ChildList && j.ChildList.length>0){
this.huoqucheckedkey_yes(j.ChildList)
}
})
}
}else{
this.huoqucheckedkey_no(x.ChildList,z.DeptId)
}
})
})
},
huoqucheckedkey_no(ChildList,id){
if(ChildList && ChildList.length>0){
ChildList.forEach(x=>{
if(x.DeptId == id){
this.memberSetCheckedKeys.push(x.DeptId)
this.showMember.push(x)
if (x.ChildList && x.ChildList.length > 0) {
x.ChildList.forEach(j => {
this.memberSetCheckedKeys.push(j.DeptId)
this.showMember.push(j)
if(j.ChildList && j.ChildList.length>0){
this.huoqucheckedkey_yes(j.ChildList)
}
})
}
}else{
this.huoqucheckedkey_no(x.ChildList,id)
}
})
}
},
huoqucheckedkey_yes(ChildList){
ChildList.forEach(j => {
this.memberSetCheckedKeys.push(j.DeptId)
this.showMember.push(j)
if(j.ChildList && j.ChildList.length>0){
this.huoqucheckedkey_yes(j.ChildList)
}
})
},
getMember() { getMember() {
let _arr = this.sysUserKeys.concat(this.memberSetCheckedKeys)
getEmployeeAddrBook({}).then(res => { getEmployeeAddrBook({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.memberList = res.Data this.memberList = res.Data
let _this = this; let _this = this;
if(this.list.length>0){
this.memberSetCheckedKeys = [];
this.showMember = []
this.newList = JSON.parse(JSON.stringify(this.list))
this.huoqucheckedkey()
console.log( this.memberSetCheckedKeys)
console.log( this.showMember)
}
let _arr = this.sysUserKeys.concat(this.memberSetCheckedKeys)
_this.$refs.treeUser.setCheckedKeys(_arr); _this.$refs.treeUser.setCheckedKeys(_arr);
} }
}).catch(() => { }).catch(() => {
...@@ -268,9 +342,13 @@ ...@@ -268,9 +342,13 @@
} }
}else{ }else{
this.qudiaoziji2(x.ChildList,id) this.qudiaoziji2(x.ChildList,id)
} }
}) })
this.memberSetCheckedKeys = this.arrayWeightRemoval(this.memberSetCheckedKeys,this.rightobj) this.memberSetCheckedKeys = this.arrayWeightRemoval(this.memberSetCheckedKeys,this.rightobj)
}, },
qudiaoziji_t(ChildList) { qudiaoziji_t(ChildList) {
...@@ -282,21 +360,24 @@ ...@@ -282,21 +360,24 @@
}) })
}, },
qudiaoziji2(ChildList,id){ qudiaoziji2(ChildList,id){
ChildList.forEach(x=>{ if(ChildList && ChildList.length>0){
if(x.DeptId == id){ ChildList.forEach(x=>{
if (x.ChildList && x.ChildList.length > 0) { if(x.DeptId == id){
x.ChildList.forEach(j => { if (x.ChildList && x.ChildList.length > 0) {
this.rightobj.push(j.DeptId) x.ChildList.forEach(j => {
if(j.ChildList && j.ChildList.length>0){ this.rightobj.push(j.DeptId)
this.qudiaoziji_t(j.ChildList) if(j.ChildList && j.ChildList.length>0){
} this.qudiaoziji_t(j.ChildList)
}) }
})
}
}else{
this.qudiaoziji2(x.ChildList,id)
} }
}else{ })
this.qudiaoziji2(x.ChildList,id) }
}
})
}, },
arrayWeightRemoval(array1,array2) { arrayWeightRemoval(array1,array2) {
//临时数组存放 //临时数组存放
...@@ -321,7 +402,7 @@ ...@@ -321,7 +402,7 @@
this.$emit('close') this.$emit('close')
}, },
saveOrderInfo() { saveOrderInfo() {
this.$emit('success', this.newList,this.showMember) this.$emit('success', this.newList)
} }
......
...@@ -27,18 +27,23 @@ ...@@ -27,18 +27,23 @@
<tr v-for="(item,index) in data" :key="index"> <tr v-for="(item,index) in data" :key="index">
<td><span>{{item.FlowName}}</span></td> <td><span>{{item.FlowName}}</span></td>
<td> <td>
<span v-for="(x,y) in item.DeptEmpList" :key='y'> <span v-if='item.DeptEmpList && item.DeptEmpList.length>0' v-for="(x,y) in item.DeptEmpList" :key='y'>
<el-tag type="danger" v-if="x.Type==0">{{x.Name}}</el-tag> <!-- <el-tag type="danger" v-if="x.Type==0">{{x.Name}}</el-tag>
<el-tag type="success" v-if="x.Type==1">{{x.Name}}</el-tag> <el-tag type="success" v-if="x.Type==1">{{x.Name}}</el-tag> -->
<el-tag v-if="x.Type==2">{{x.Name}}</el-tag> <el-tag style="margin-right: 15px;margin-bottom: 5px;" v-if="x.Type==1"><i class="el-icon-folder"
style="margin-right: 3px;"></i>{{x.Name}}</el-tag>
<el-tag style="margin-right: 15px;margin-bottom: 5px" type="success" v-if="x.Type==2"><i class="el-icon-user-solid"
style="margin-right: 3px;"></i>{{x.Name}}</el-tag>
<el-tag v-if="x.Type==0">{{x.Name}}</el-tag>
</span> </span>
<span v-else>未适配其他规则的阶段</span>
</td> </td>
<td> <td>
<q-toggle v-if="item.IsDefault==1" v-model="item.Enable" :true-value="1" :false-value="2" <q-toggle v-if="item.IsDefault==1" v-model="item.Enable" :true-value="1" :false-value="2"
icon="lock" disable /> icon="lock" disable />
<q-toggle v-else v-model="item.Enable" :true-value="1" :false-value="2" <q-toggle v-else v-model="item.Enable" :true-value="1" :false-value="2"
@input="godelete(item,1,index)" /> @input="setFiledState(item,1)" />
</td> </td>
<td> <td>
<span v-for="(x,y) in item.StageList" :key='y'> <span v-for="(x,y) in item.StageList" :key='y'>
...@@ -53,7 +58,7 @@ ...@@ -53,7 +58,7 @@
<q-btn v-if='item.IsDefault!=1' flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" <q-btn v-if='item.IsDefault!=1' flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="编辑" @click="goedit(item)" /> label="编辑" @click="goedit(item)" />
<q-btn v-if='item.IsDefault!=1' flat size="xs" icon="delete" color="negative" class="q-mr-xs" <q-btn v-if='item.IsDefault!=1' flat size="xs" icon="delete" color="negative" class="q-mr-xs"
label="删除" @click="godelete(item,3,index)" /> label="删除" @click="godelete(item)" />
</td> </td>
</tr> </tr>
...@@ -71,7 +76,7 @@ ...@@ -71,7 +76,7 @@
import addfield from "./components/addfield" import addfield from "./components/addfield"
import { import {
getCustomerStageFlowList, getCustomerStageFlowList,
setCustomerStageFlowState
} from '../../../../api/system/wechat'; } from '../../../../api/system/wechat';
//部门 //部门
import { import {
...@@ -106,31 +111,17 @@ ...@@ -106,31 +111,17 @@
this.addMsg = null this.addMsg = null
}, },
goedit(item) { goedit(item) {
this.Isadd = true; this.$router.push({
this.addMsg = JSON.parse(JSON.stringify(item)) path: '/enterprise/customer/CSChild/addPhase',
}, query: {
godelete(item, type, index) {//删除 FlowId: item.Id
let text = ''
if (type == 1) {//tyep等于1和2的时候 先让弹出提示 然后再给予掉接口 所以把原本的值暂时先赋值给本身
text = '确定修改启用状态'
if (item.Enable == 2) {
this.data[index].Enable = 1
} else {
this.data[index].Enable = 2
}
} else if (type == 2) {
text = '确定修改必填状态'
if (item.Required == 2) {
this.data[index].Required = 1
} else {
this.data[index].Required = 2
} }
} else if (type == 3) { });
text = '删除后字段不在显示,是否删除?' },
} godelete(item) {//删除
this.$q.dialog({ this.$q.dialog({
title: "提示信息", title: "提示信息",
message: text, message: '是否删除该阶段流程',
cancel: { cancel: {
label: "取消", label: "取消",
flat: true flat: true
...@@ -141,18 +132,18 @@ ...@@ -141,18 +132,18 @@
focus: true focus: true
} }
}).onOk(() => { }).onOk(() => {
this.setFiledState(item, type) this.setFiledState(item,2)
}); });
}, },
setFiledState(item, Type) { setFiledState(item,Type) {
console.log('2')
let msg = { let msg = {
Type: Type, Type: Type,
FiledId: item.Id, FlowId: item.Id,
SortFiledId: 0,
} }
setCustomerFiledState(msg).then(res => { setCustomerStageFlowState(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<q-input clearable debounce filled maxlength="10" counter v-model="x.Name" style="width:500px" <q-input clearable debounce filled maxlength="10" counter v-model="x.Name" style="width:500px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" /> @input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label="" <q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label=""
@click="followupStage.splice(y,1)" /> @click="getStageDel(x,y)" />
</li> </li>
</div> </div>
</ul> </ul>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<q-input clearable debounce filled maxlength="10" counter v-model="item.Name" style="width:500px" <q-input clearable debounce filled maxlength="10" counter v-model="item.Name" style="width:500px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" /> @input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label="" <q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label=""
@click="reasonList[y].OptionsList.splice(index,1)" /> @click="setCauseDel(y,index,x,item)" />
</li> </li>
</draggable> </draggable>
</ul> </ul>
...@@ -116,7 +116,9 @@ ...@@ -116,7 +116,9 @@
import draggable from "vuedraggable" import draggable from "vuedraggable"
import { import {
getCustomerStageList, getCustomerStageList,
setCustomerStageInfo setCustomerStageInfo,
validataCustomerStageDel,
validataCustomerCauseDel
} from '../../../../api/system/wechat'; } from '../../../../api/system/wechat';
export default { export default {
meta: { meta: {
...@@ -218,9 +220,12 @@ ...@@ -218,9 +220,12 @@
return return
break break
} }
let list = JSON.parse(JSON.stringify(x.OptionsList))
let maxnum = list.sort((a, b) => { return b.Id-a.Id })[0].Id
for (let j = 0; j < x.OptionsList.length; j++) { for (let j = 0; j < x.OptionsList.length; j++) {
let z = x.OptionsList[j] let z = x.OptionsList[j]
z.Id=j+1
if (z.Name == '') { if (z.Name == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -231,6 +236,10 @@ ...@@ -231,6 +236,10 @@
return return
break break
} }
if(z.Id==0){
z.Id = maxnum+1;
maxnum++
}
} }
} }
this.addMsg = [] this.addMsg = []
...@@ -253,6 +262,46 @@ ...@@ -253,6 +262,46 @@
this.loading = false this.loading = false
}) })
}, },
getStageDel(x,index){//判断阶段是否能删除
validataCustomerStageDel({StageId:x.Id}).then(res => {
if(res.Code==1){
if(res.Data.UseState==false){
this.followupStage.splice(index,1)
}else{
this.$q.notify({
type: 'negative',
message: '不能删除',
position: 'top'
})
}
}
}).catch((e) => {
})
},
setCauseDel(y,index,x,item){//验证阶段输单/无效的 原因选项是否可以删除
console.log(y,index,x,item)
let Type = 1
if(x.Name=='无效')Type =2
let data = {
CauseId:item.Id,
Type:Type
}
validataCustomerCauseDel(data).then(res => {
if(res.Code==1){
if(res.Data.UseState==false){
this.reasonList[y].OptionsList.splice(index,1)
}else{
this.$q.notify({
type: 'negative',
message: '不能删除',
position: 'top'
})
}
}
}).catch((e) => {
})
}
} }
} }
</script> </script>
\ No newline at end of file
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