Commit 44784657 by chenwq

编辑sop,选择客户弹窗基本完成

1 parent 2526853b
...@@ -6,12 +6,15 @@ ...@@ -6,12 +6,15 @@
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="customerList"> <div slot="customerList">
<el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button> <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button :size="size" @click="handleResetCostomer">重置客户</el-button> <el-button :size="size" @click="handleResetCustomer">重置客户</el-button>
<div v-show="editForm.customerList.length != 0" :key="key" class="el-input-tag input-tag-wrapper m-t-10"> <div v-show="editForm.customerList.length != 0" class="customer-box m-t-10">
<el-tag v-for="(item, idx) in editForm.customerList" :key="idx" :size="size" type="info" closable :disable-transitions="false" @close="handleDeleteCustomer(idx)"> <div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerList.length }}人</div>
<i class="el-icon-user-solid"></i> <div :key="key" class="el-input-tag input-tag-wrapper">
{{ item.customerName }} <el-tag v-for="(item, idx) in editForm.customerList" :key="idx" :size="size" type="info" closable :disable-transitions="false" @close="handleDeleteCustomer(idx)">
</el-tag> <i class="el-icon-user-solid"></i>
{{ item.customerName }}
</el-tag>
</div>
</div> </div>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
...@@ -41,6 +44,11 @@ export default { ...@@ -41,6 +44,11 @@ export default {
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
editStatus: false, editStatus: false,
labelWidth: '144px', labelWidth: '144px',
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
// 标签弹窗 // 标签弹窗
isTagVisible: false, isTagVisible: false,
tagging: [], tagging: [],
...@@ -125,6 +133,7 @@ export default { ...@@ -125,6 +133,7 @@ export default {
handleSelect(obj) { handleSelect(obj) {
this.tagging = obj.selectedLabelList this.tagging = obj.selectedLabelList
this.editForm.customerList = obj.selectedCustomerList this.editForm.customerList = obj.selectedCustomerList
this.condLimitObj = obj.condLimitObj
let arr = [] let arr = []
this.tagging.forEach(item => { this.tagging.forEach(item => {
item.labelList.forEach(tag => { item.labelList.forEach(tag => {
...@@ -142,21 +151,24 @@ export default { ...@@ -142,21 +151,24 @@ export default {
// this.taggingList = obj // this.taggingList = obj
console.log(obj, '1') console.log(obj, '1')
this.key = new Date() this.key = new Date()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList')
// console.log(this.tagging, '2') // console.log(this.tagging, '2')
}, },
handleSelectCustomer() { handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ tagList: this.tagging, customerList: this.editForm.customerList }) this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerList: this.editForm.customerList })
// console.log(this.isTagVisible) // console.log(this.isTagVisible)
}, },
handleResetCostomer() { handleResetCustomer() {
this.editForm.customerList = [] this.editForm.customerList = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList')
}, },
handleDeleteCustomer(idx) { handleDeleteCustomer(idx) {
this.editForm.customerList.splice(idx, 1) this.editForm.customerList.splice(idx, 1)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerList')
}, },
handleConfirm() { handleConfirm() {
...@@ -204,30 +216,39 @@ export default { ...@@ -204,30 +216,39 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sop-base-info { .sop-base-info {
.input-tag-wrapper { .customer-box {
max-height: 227px; width: 567px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff; background-color: #fff;
background-image: none; background-image: none;
border-radius: 4px; border-radius: 4px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
box-sizing: border-box; .customer-title {
color: #666; box-sizing: border-box;
display: inline-block; height: 39px;
outline: none; line-height: 39px;
padding: 5px; padding: 0 10px;
flex-wrap: wrap; border-bottom: 1px solid #dcdfe6;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); }
width: 450px; .input-tag-wrapper {
display: flex; max-height: 227px;
align-items: center; overflow: auto;
font-size: 14px; position: relative;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px; font-size: 14px;
padding: 10px;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
display: flex;
align-items: center;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
} }
} }
} }
......
...@@ -43,6 +43,8 @@ export default { ...@@ -43,6 +43,8 @@ export default {
listName: 'data', listName: 'data',
// 行数据的key // 行数据的key
mutiSelectUniqueKey: 'oneId', mutiSelectUniqueKey: 'oneId',
checkSelectKey: 'oneId',
checkSelectVal: [],
// 多选ref的名称 // 多选ref的名称
mutiSelectName: 'list', mutiSelectName: 'list',
tableColumns: [ tableColumns: [
...@@ -120,6 +122,16 @@ export default { ...@@ -120,6 +122,16 @@ export default {
selectedCustomerList: { selectedCustomerList: {
type: Array, type: Array,
default: () => [] default: () => []
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
} }
}, },
...@@ -132,19 +144,19 @@ export default { ...@@ -132,19 +144,19 @@ export default {
} }
}, },
mounted() { mounted() { },
// this.getList()
},
methods: { methods: {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm = { this.searchForm = {
// labelStandInfoList: []
tagLists: [] tagLists: []
} }
this.selectedLabelList.length && this.selectedLabelList.length &&
this.selectedLabelList.forEach(item => { this.selectedLabelList.forEach(item => {
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
// this.searchForm.labelStandInfoList.push({
this.searchForm.tagLists.push({ this.searchForm.tagLists.push({
groupId: item.labelGroup.id, groupId: item.labelGroup.id,
groupName: item.labelGroup.name, groupName: item.labelGroup.name,
...@@ -154,13 +166,13 @@ export default { ...@@ -154,13 +166,13 @@ export default {
}) })
}) })
}) })
// console.log(this.searchForm.tagLists)
resolve() resolve()
}) })
}, },
setTableFinishFun() { setTableFinishFun() {
this.tableList = this.$refs.customerRef.data this.tableList = this.$refs.customerRef.data
this.tableList[0].customerPhone = '13099999999'
this.recoverySelected() this.recoverySelected()
//接收到的数据为空 //接收到的数据为空
this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun() this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun()
...@@ -173,14 +185,32 @@ export default { ...@@ -173,14 +185,32 @@ export default {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
} }
}) })
// 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) {
this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
this.tableParams.checkSelectVal.push(row.oneId)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
}
})
}
}, },
handleSelectionTable(val) { dealCondLimit(val) {
this.selectedCustomerList = JSON.parse(JSON.stringify(val)) this.condLimitObj.hasQw = val.isJoin
console.log(this.selectedCustomerList) this.condLimitObj.hasPhone = !!val.customerPhone
}, },
getList() { } handleSelectionTable(val) {
// 未选客户时,筛选客户条件
if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0])
}
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
this.recoverySelected()
// console.log(this.selectedCustomerList)
}
} }
} }
</script> </script>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</div> </div>
</div> </div>
</div> </div>
<select-customer v-if="activeName == 'cutomer'" ref="customerRef" :selectedLabelList="selectedLabelList" :selectedCustomerList.sync="selectedCustomerList"></select-customer> <select-customer v-if="activeName == 'cutomer'" ref="customerRef" :selectedLabelList="selectedLabelList" :condLimitObj.sync="condLimitObj" :selectedCustomerList.sync="selectedCustomerList"></select-customer>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> --> <!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.activeName = 'tag' this.activeName = 'tag'
this.selectedCustomerList = JSON.parse(JSON.stringify(item.customerList)) this.selectedCustomerList = JSON.parse(JSON.stringify(item.customerList))
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.querylabeltree(item.tagList) this.querylabeltree(item.tagList)
}, },
handleSearch() { handleSearch() {
...@@ -208,7 +209,7 @@ export default { ...@@ -208,7 +209,7 @@ export default {
return false return false
} }
// 客户 // 客户
this.$emit('tagSelected', { selectedLabelList: this.selectedLabelList, selectedCustomerList: this.$refs.customerRef.selectedCustomerList }) this.$emit('tagSelected', { selectedLabelList: this.selectedLabelList, selectedCustomerList: this.$refs.customerRef.selectedCustomerList, condLimitObj: this.$refs.customerRef.condLimitObj })
this.dialogVisible = false this.dialogVisible = false
}, },
handleReset() { handleReset() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!