import { XhUserCell } from '@/components/CreateCom'
import {
- crmCustomerSettingTeamSaveAPI,
- crmCustomerSettingTeamDeleteAPI
+ crmCustomerSettingTeamSaveAPI
+ // crmCustomerSettingTeamDeleteAPI
} from '@/api/crm/customer'
-import {
- crmContractSettingTeamSaveAPI,
- crmContractSettingTeamDeleteAPI
-} from '@/api/crm/contract'
+// import {
+// crmContractSettingTeamSaveAPI,
+// crmContractSettingTeamDeleteAPI
+// } from '@/api/crm/contract'
-import {
- crmBusinessSettingTeamSaveAPI,
- crmBusinessSettingTeamDeleteAPI
-} from '@/api/crm/business'
+// import {
+// crmBusinessSettingTeamSaveAPI,
+// crmBusinessSettingTeamDeleteAPI
+// } from '@/api/crm/business'
export default {
/** 客户管理 的 勾选后的 团队成员 操作 移除操作不可移除客户负责人*/
@@ -84,10 +115,10 @@ export default {
required: true,
default: false
},
- title: {
- type: String,
- default: ''
- },
+ // title: {
+ // type: String,
+ // default: ''
+ // },
/** 没有值就是全部类型 有值就是当个类型 */
crmType: {
type: String,
@@ -99,19 +130,48 @@ export default {
default: () => {
return []
}
- }
+ },
+ // add 添加 delete 移除
+ type: {
+ type: String,
+ default: ''
+ },
+ // 选择的成员,该字段存在,将不展示员工选择
+ members: Array
},
data() {
return {
loading: false, // 加载动画
visible: false,
-
+ pickerOptions: {
+ disabledDate(time) {
+ // 当前0点时间戳
+ return time.getTime() < new Date(new Date().toLocaleDateString()).getTime()
+ }
+ },
usersList: [], // 变更负责人
handleType: 1, // 操作类型
- addsTypes: [] // 添加至
+ addsTypes: [], // 添加至
+ validType: '', // 有效类型
+ target_time: '' // 有效时间
+ }
+ },
+ computed: {
+ // 客户允许同时添加至联系人
+ addsTypesShow() {
+ return this.crmType === 'customer'
+ },
+ // 是新建
+ isCreate() {
+ return this.type === 'add'
+ },
+ title() {
+ return {
+ add: '添加团队成员',
+ delete: '移除团队成员'
+ }[this.type]
}
},
- computed: {},
watch: {
dialogVisible: {
handler(val) {
@@ -150,39 +210,57 @@ export default {
},
handleConfirm() {
// 移除操作不可移除客户负责人
- if (this.usersList.length === 0) {
+ if (!this.members && this.usersList.length === 0) {
this.$message.error('请选择团队成员')
+ } else if (this.validType === 'end' && !this.target_time) {
+ this.$message.error('请选择截止日期')
} else {
const params = {
types_id: this.selectionList.map(item => item[this.crmType + '_id']),
user_id: this.usersList.map(item => item.id)
}
- if (this.crmType === 'customer' && this.title == '添加团队成员') {
+ // 如果有传入成员,替换选择成员
+ if (this.members) {
+ params.user_id = this.members.map(item => item.id)
+ }
+ // if (this.addsTypesShow) {
+ // // 只有客户下面同时添加到
+ // params.changeType = this.addsTypes.map(function(i) {
+ // return parseInt(i)
+ // })
+ // }
+ // if (this.crmType === 'customer' && this.title == '添加团队成员') {
+ // // 只有客户下面同时添加到
+ // params.module = this.addsTypes
+ // }
+ if (this.addsTypesShow) {
// 只有客户下面同时添加到
params.module = this.addsTypes
}
- let request
- if (this.title == '添加团队成员') {
+ params.target_time = this.validType === 'end' ? this.target_time : ''
+
+ // let request
+ if (this.isCreate) {
// 1只读,2读写
params.type = this.handleType
- request = {
- customer: crmCustomerSettingTeamSaveAPI,
- contract: crmContractSettingTeamSaveAPI,
- business: crmBusinessSettingTeamSaveAPI
- }[this.crmType]
+ // request = {
+ // customer: crmCustomerSettingTeamSaveAPI,
+ // contract: crmContractSettingTeamSaveAPI,
+ // business: crmBusinessSettingTeamSaveAPI
+ // }[this.crmType]
} else {
- request = {
- customer: crmCustomerSettingTeamDeleteAPI,
- contract: crmContractSettingTeamDeleteAPI,
- business: crmBusinessSettingTeamDeleteAPI
- }[this.crmType]
+ // request = {
+ // customer: crmCustomerSettingTeamDeleteAPI,
+ // contract: crmContractSettingTeamDeleteAPI,
+ // business: crmBusinessSettingTeamDeleteAPI
+ // }[this.crmType]
params.is_del = 1
}
this.loading = true
params.types = 'crm_' + this.crmType
- request(params)
+ crmCustomerSettingTeamSaveAPI(params)
.then(res => {
this.$message({
type: 'success',
@@ -191,7 +269,7 @@ export default {
this.loading = false
this.handleCancel()
this.$emit('handle', {
- type: this.title == '添加团队成员' ? 'add_user' : 'delete_user'
+ type: this.isCreate ? 'add_user' : 'delete_user'
})
})
.catch(() => {
diff --git a/src/views/crm/contacts/Create.vue b/src/views/crm/contacts/Create.vue
index 4601923..b1adfca 100644
--- a/src/views/crm/contacts/Create.vue
+++ b/src/views/crm/contacts/Create.vue
@@ -5,25 +5,32 @@
@close="close"
@save="saveClick">
-
-
-
-
-
+
+
+
+
+
+
@@ -34,7 +41,8 @@ import { crmContactsSaveAPI } from '@/api/crm/contacts'
import XrCreate from '@/components/XrCreate'
import CreateSections from '@/components/CreateSections'
-import WkForm from '@/components/NewCom/WkForm'
+import WkFormItems from '@/components/NewCom/WkForm/WkFormItems'
+
import {
CrmRelativeCell
} from '@/components/CreateCom'
@@ -50,7 +58,7 @@ export default {
XrCreate,
CreateSections,
CrmRelativeCell,
- WkForm
+ WkFormItems
},
mixins: [CustomFieldsMixin],
@@ -106,7 +114,8 @@ export default {
types: 'crm_contacts',
module: 'crm',
controller: 'contacts',
- action: this.action.type
+ action: this.action.type,
+ format: 2
}
if (this.action.type == 'update') {
@@ -118,57 +127,64 @@ export default {
const list = res.data || []
if (!isEmpty(this.phone)) {
list.forEach(item => {
- if (item.formType === 'mobile') {
- item.defaultValue = this.phone
+ if (item.form_type === 'mobile') {
+ item.default_value = this.phone
}
})
}
+ const assistIds = this.getFormAssistIds(list)
+ const baseFields = []
+
const fieldList = []
const fieldRules = {}
const fieldForm = {}
- list.forEach(item => {
- const temp = {}
- temp.field = item.field
- temp.formType = item.form_type
- temp.fieldId = item.fieldId
- temp.inputTips = item.input_Tips
- temp.name = item.name
- temp.setting = item.setting
- // temp.value = item.value
- const canEdit = this.getItemIsCanEdit(item, this.action.type)
- // 是否能编辑权限
- if (canEdit) {
- fieldRules[temp.field] = this.getRules(item)
- }
-
- // 是否可编辑
- temp.disabled = !canEdit
-
- // 禁止某些业务组件选择
- if (temp.formType == 'customer') {
- if (this.action.type == 'relative') {
- const relativeDisInfos = {
- customer: { customer: true },
- business: { customer: true }
- }
- // 在哪个类型下添加
- const relativeTypeDisInfos = relativeDisInfos[this.action.crmType]
- if (relativeTypeDisInfos) {
+ list.forEach(children => {
+ const fields = []
+ children.forEach(item => {
+ const temp = this.getFormItemDefaultProperty(item)
+ temp.show = !assistIds.includes(item.formAssistId)
+
+ const canEdit = this.getItemIsCanEdit(item, this.action.type)
+ // 是否能编辑权限
+ if (temp.show && canEdit) {
+ fieldRules[temp.field] = this.getRules(item)
+ }
+
+ // 是否可编辑
+ temp.disabled = !canEdit
+
+ // 禁止某些业务组件选择
+ if (temp.form_type == 'customer') {
+ if (this.action.type == 'relative') {
+ const relativeDisInfos = {
+ customer: { customer: true },
+ business: { customer: true }
+ }
+
+ // 在哪个类型下添加
+ const relativeTypeDisInfos = relativeDisInfos[this.action.crmType]
+ if (relativeTypeDisInfos) {
// 包含的字段值
- temp.disabled = relativeTypeDisInfos[item.form_type] || false
+ temp.disabled = relativeTypeDisInfos[item.form_type] || false
+ }
}
}
- }
- // 特殊字段允许多选
- this.getItemRadio(item, temp)
- // 获取默认值
- fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
- fieldList.push(temp)
+ // 特殊字段允许多选
+ this.getItemRadio(item, temp)
+
+ // 获取默认值
+ if (temp.show) {
+ fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
+ }
+ fields.push(temp)
+ baseFields.push(item)
+ })
+ fieldList.push(fields)
})
- this.baseFields = list
+ this.baseFields = baseFields
this.fieldList = fieldList
this.fieldForm = fieldForm
this.fieldRules = fieldRules
@@ -186,7 +202,7 @@ export default {
*/
saveClick() {
this.loading = true
- const crmForm = this.$refs.crmForm.instance
+ const crmForm = this.$refs.crmForm
crmForm.validate(valid => {
if (valid) {
const params = this.getSubmiteParams(this.baseFields, this.fieldForm)
@@ -248,14 +264,25 @@ export default {
/**
* change
*/
- formChange(item, index, value, valueList) {},
+ formChange(field, index, value, valueList) {
+ if ([
+ 'select',
+ 'checkbox'
+ ].includes(field.formType) &&
+ field.remark === 'options_type' &&
+ field.optionsData) {
+ const { fieldForm, fieldRules } = this.getFormContentByOptionsChange(this.fieldList, this.fieldForm)
+ this.fieldForm = fieldForm
+ this.fieldRules = fieldRules
+ }
+ },
/**
* 地址change
*/
otherChange(data, field) {
this.$set(this.fieldForm, field.field, data.value)
- this.$refs.crmForm.instance.validateField(field.field)
+ this.$refs.crmForm.validateField(field.field)
},
/**
diff --git a/src/views/crm/contacts/Detail.vue b/src/views/crm/contacts/Detail.vue
index 9470cb3..ed6ed15 100644
--- a/src/views/crm/contacts/Detail.vue
+++ b/src/views/crm/contacts/Detail.vue
@@ -22,7 +22,9 @@
:detail="detailData"
:head-details="headDetails"
:id="id"
+ :page-list="pageList"
:crm-type="crmType"
+ @pageChange="pageChange"
@handle="detailHeadHandle"
@close="hideView">
@@ -51,7 +53,8 @@
:type-list="logTyps"
:id="id"
:handle="activityHandle"
- :crm-type="crmType" />
+ :crm-type="crmType"
+ @handle="detailHeadHandle" />
@@ -94,6 +97,7 @@ import Activity from '../components/Activity' // 活动
import ContactsImport from './components/ContactsImport' // 重要信息
import CRMEditBaseInfo from '../components/CRMEditBaseInfo' // 联系人基本信息
+import RelativeTeam from '../components/RelativeTeam' // 团队成员
import RelativeBusiness from '../components/RelativeBusiness' // 相关商机
import RelativeHandle from '../components/RelativeHandle' // 相关操作
import RelativeFiles from '../components/RelativeFiles' // 相关附件
@@ -112,7 +116,8 @@ export default {
RelativeHandle,
RelativeFiles,
CRMAllCreate,
- ContactsImport
+ ContactsImport,
+ RelativeTeam
},
mixins: [DetailMixin],
props: {
@@ -197,6 +202,7 @@ export default {
if (this.crm.contacts && this.crm.contacts.read) {
tempsTabs.push({ label: '详细资料', name: 'CRMEditBaseInfo' })
}
+ tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
if (this.crm.business && this.crm.business.index) {
tempsTabs.push({ label: this.getTabName('商机', this.tabsNumber.businessCount), name: 'RelativeBusiness' })
}
diff --git a/src/views/crm/contacts/index.vue b/src/views/crm/contacts/index.vue
index 9db85ee..f6f95ec 100644
--- a/src/views/crm/contacts/index.vue
+++ b/src/views/crm/contacts/index.vue
@@ -54,7 +54,19 @@
:width="item.width"
:formatter="fieldFormatter"
sortable="custom"
- show-overflow-tooltip/>
+ show-overflow-tooltip>
+
+
+
+ {{ fieldFormatter(row, column, row[column.property], item) }}
+
+
+
+
+
diff --git a/src/views/crm/contract/Create.vue b/src/views/crm/contract/Create.vue
index d96cf09..99bca68 100644
--- a/src/views/crm/contract/Create.vue
+++ b/src/views/crm/contract/Create.vue
@@ -6,38 +6,45 @@
@close="close"
@save="saveClick">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
{
const list = res.data || []
+ const assistIds = this.getFormAssistIds(list)
+ const baseFields = []
const fieldList = []
const fieldRules = {}
const fieldForm = {}
- list.forEach(item => {
- const temp = {}
- temp.field = item.field
- temp.formType = item.form_type
- temp.fieldId = item.fieldId
- temp.inputTips = item.input_tips
- temp.name = item.name
- temp.setting = item.setting
- temp.value = item.value
- const canEdit = this.getItemIsCanEdit(item, this.action.type)
- // 是否能编辑权限
- if (canEdit) {
+ list.forEach(children => {
+ const fields = []
+ children.forEach(item => {
+ const temp = this.getFormItemDefaultProperty(item)
+ temp.show = !assistIds.includes(item.formAssistId)
+
+ const canEdit = this.getItemIsCanEdit(item, this.action.type)
+ // 是否能编辑权限
+ if (canEdit) {
// 自动生成编号
- if (item.autoGeneNumber == 1) {
- temp.placeholder = '根据编号规则自动生成,支持手动输入'
- const copyItem = objDeepCopy(item)
- copyItem.isNull = 0
- fieldRules[temp.field] = this.getRules(copyItem)
- } else {
- fieldRules[temp.field] = this.getRules(item)
+ if (item.autoGeneNumber == 1) {
+ temp.placeholder = '根据编号规则自动生成,支持手动输入'
+ const copyItem = objDeepCopy(item)
+ copyItem.isNull = 0
+ fieldRules[temp.field] = this.getRules(copyItem)
+ } else {
+ fieldRules[temp.field] = this.getRules(item)
+ }
}
- }
- // 是否可编辑
- temp.disabled = !canEdit
-
- // 禁止某些业务组件选择
- if (temp.formType == 'contacts' ||
- temp.formType == 'customer' ||
- temp.formType == 'business'
- ) {
- if (this.action.type == 'relative') {
- const relativeDisInfos = {
- contacts: { customer: true },
- customer: { customer: true },
- business: { customer: true, business: true }
- }
+ // 是否可编辑
+ temp.disabled = !canEdit
+
+ // 禁止某些业务组件选择
+ if (temp.form_type == 'contacts' ||
+ temp.form_type == 'customer' ||
+ temp.form_type == 'business'
+ ) {
+ if (this.action.type == 'relative') {
+ const relativeDisInfos = {
+ contacts: { customer: true },
+ customer: { customer: true },
+ business: { customer: true, business: true }
+ }
- // 在哪个类型下添加
- const relativeTypeDisInfos = relativeDisInfos[this.action.crmType]
- if (relativeTypeDisInfos) {
+ // 在哪个类型下添加
+ const relativeTypeDisInfos = relativeDisInfos[this.action.crmType]
+ if (relativeTypeDisInfos) {
// 包含的字段值
- temp.disabled = relativeTypeDisInfos[item.form_type] || false
+ temp.disabled = relativeTypeDisInfos[item.form_type] || false
+ }
+ } else if (this.action.type != 'update') {
+ temp.disabled = item.form_type === 'business' || item.form_type === 'contacts'
}
- } else if (this.action.type != 'update') {
- temp.disabled = item.form_type === 'business' || item.form_type === 'contacts'
}
- }
- // 处理关联
- if ((this.action.type == 'relative' || this.action.type == 'update') && (item.form_type == 'business' || item.form_type == 'contacts' || item.form_type == 'contract'
- )) {
- const customerItem = this.getItemRelatveInfo(list, 'customer')
- if (customerItem) {
- if (item.form_type == 'business' || item.form_type == 'contacts') {
- customerItem['moduleType'] = 'customer'
- temp['relation'] = customerItem
- } else if (item.formType == 'contract') {
- customerItem['moduleType'] = 'customer'
- customerItem['params'] = { checkStatus: 2 }
- temp['relation'] = customerItem
+ // 处理关联
+ if ((this.action.type == 'relative' || this.action.type == 'update') && (item.form_type == 'business' || item.form_type == 'contacts' || item.form_type == 'contract'
+ )) {
+ const customerItem = this.getItemRelatveInfo(list, 'customer')
+ if (customerItem) {
+ if (item.form_type == 'business' || item.form_type == 'contacts') {
+ customerItem['moduleType'] = 'customer'
+ temp['relation'] = customerItem
+ } else if (item.form_type == 'contract') {
+ customerItem['moduleType'] = 'customer'
+ customerItem['params'] = { checkStatus: 2 }
+ temp['relation'] = customerItem
+ }
}
}
- }
- // 特殊字段允许多选
- this.getItemRadio(item, temp)
+ // 特殊字段允许多选
+ this.getItemRadio(item, temp)
- // 获取默认值
- // 非编辑情况下 填充默认值
- if (this.action.type != 'update' && item.field === 'order_date') {
- fieldForm[temp.field] = this.$moment().format('YYYY-MM-DD')
- } else {
- fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
- }
- fieldList.push(temp)
+ // 获取默认值
+ // 非编辑情况下 填充默认值
+ if (this.action.type != 'update' && item.field === 'order_date') {
+ fieldForm[temp.field] = this.$moment().format('YYYY-MM-DD')
+ } else {
+ fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
+ }
+ fields.push(temp)
+ baseFields.push(item)
+ })
+ fieldList.push(fields)
})
@@ -286,7 +294,7 @@ export default {
}
}
- this.baseFields = list
+ this.baseFields = baseFields
this.fieldList = fieldList
this.fieldForm = fieldForm
this.fieldRules = fieldRules
@@ -304,7 +312,7 @@ export default {
*/
saveClick(isDraft = false) {
this.loading = true
- const crmForm = this.$refs.crmForm.instance
+ const crmForm = this.$refs.crmForm
crmForm.validate(valid => {
if (valid) {
if (this.isOpenExamine) {
@@ -410,86 +418,102 @@ export default {
* change
*/
formChange(field, index, value, valueList) {
+ // 审批流逻辑
+ // this.debouncedGetWkFlowList(field.field, this.fieldForm)
+
+ if ([
+ 'select',
+ 'checkbox'
+ ].includes(field.form_type) &&
+ field.remark === 'options_type' &&
+ field.optionsData) {
+ const { fieldForm, fieldRules } = this.getFormContentByOptionsChange(this.fieldList, this.fieldForm)
+ this.fieldForm = fieldForm
+ this.fieldRules = fieldRules
+ }
},
/**
* 地址change
*/
otherChange(data, field) {
- if (field.formType === 'customer') {
+ if (field.form_type === 'customer') {
let contractForCount = 0
- for (let index = 0; index < this.fieldList.length; index++) {
- const element = this.fieldList[index]
- // 需要处理 需关联客户信息或客户下信息
- const handleFields = [
- 'business_id',
- 'contacts_id',
- 'order_user_id'
- ]
-
- // 添加请求关联
- const addRelation = ['business_id', 'contacts_id']
-
- // 需要disabled
- const addDisabled = ['business_id', 'contacts_id']
-
- // 复制
- const getValueObj = {
- contacts_id: data => {
- if (!data.contacts_id) {
- return []
- }
- return [
- {
- name: data.contactsName || '',
- contacts_id: data.contacts_id
+ for (let mainIndex = 0; mainIndex < this.fieldList.length; mainIndex++) {
+ const children = this.fieldList[mainIndex]
+ for (let index = 0; index < children.length; index++) {
+ const element = children[index]
+ // 需要处理 需关联客户信息或客户下信息
+ const handleFields = [
+ 'business_id',
+ 'contacts_id',
+ 'order_user_id'
+ ]
+
+ // 添加请求关联
+ const addRelation = ['business_id', 'contacts_id']
+
+ // 需要disabled
+ const addDisabled = ['business_id', 'contacts_id']
+
+ // 复制
+ const getValueObj = {
+ contacts_id: data => {
+ if (!data.contacts_id) {
+ return []
}
- ]
- },
- order_user_id: data => {
- if (!data.ownerUserId) {
- return []
- }
- return [
- {
- realname: data.owner_user_name || '',
- id: data.owner_user_id
+ return [
+ {
+ name: data.contactsName || '',
+ contacts_id: data.contacts_id
+ }
+ ]
+ },
+ order_user_id: data => {
+ if (!data.ownerUserId) {
+ return []
}
- ]
+ return [
+ {
+ realname: data.owner_user_name || '',
+ id: data.owner_user_id
+ }
+ ]
+ }
}
- }
- if (handleFields.includes(element.field)) {
- if (data.value.length > 0) {
- element.disabled = false
+ if (handleFields.includes(element.field)) {
+ if (data.value.length > 0) {
+ element.disabled = false
- // 增加关联信息
- const customerItem = data.value[0]
- if (addRelation.includes(element.field)) {
- customerItem['moduleType'] = 'customer'
- element['relation'] = customerItem
- }
+ // 增加关联信息
+ const customerItem = data.value[0]
+ if (addRelation.includes(element.field)) {
+ customerItem['moduleType'] = 'customer'
+ element['relation'] = customerItem
+ }
- // 填充值
- if (getValueObj[element.field]) {
- this.fieldForm[element.field] = getValueObj[element.field](customerItem)
+ // 填充值
+ if (getValueObj[element.field]) {
+ this.fieldForm[element.field] = getValueObj[element.field](customerItem)
+ } else {
+ this.fieldForm[element.field] = []
+ }
} else {
- this.fieldForm[element.field] = []
- }
- } else {
// 禁用
- element.disabled = !!addDisabled.includes(element.field)
+ element.disabled = !!addDisabled.includes(element.field)
- if (addRelation.includes(element.field)) {
- element['relation'] = {}
- }
+ if (addRelation.includes(element.field)) {
+ element['relation'] = {}
+ }
- this.fieldForm[element.field] = []
- }
+ this.fieldForm[element.field] = []
+ }
- contractForCount++
- if (contractForCount == handleFields.length) {
- break
+ contractForCount++
+ if (contractForCount == handleFields.length) {
+ break
+ }
}
}
}
@@ -501,7 +525,7 @@ export default {
discount_rate: ''
}
this.fieldForm.money = ''
- } else if (field.formType === 'business') {
+ } else if (field.form_type === 'business') {
if (data.value.length > 0) {
this.getBusinessProduct(data.value[0].business_id).then(resData => {
const businessData = resData || {}
@@ -513,11 +537,11 @@ export default {
this.fieldForm.money = businessData.total_price || ''
}).catch(() => {})
}
- } else if (field.formType === 'product') {
+ } else if (field.form_type === 'product') {
this.fieldForm.money = data.value.total_price || ''
}
this.$set(this.fieldForm, field.field, data.value)
- this.$refs.crmForm.instance.validateField(field.field)
+ this.$refs.crmForm.validateField(field.field)
},
/**
diff --git a/src/views/crm/contract/Detail.vue b/src/views/crm/contract/Detail.vue
index 0ec5880..2d59280 100644
--- a/src/views/crm/contract/Detail.vue
+++ b/src/views/crm/contract/Detail.vue
@@ -23,6 +23,8 @@
:head-details="headDetails"
:id="id"
:crm-type="crmType"
+ :page-list="pageList"
+ @pageChange="pageChange"
@handle-click="deadHandleClick"
@handle="detailHeadHandle"
@close="hideView">
@@ -58,7 +60,7 @@
:id="id"
:handle="activityHandle"
:crm-type="crmType"
- @on-handle="detailHeadHandle" />
+ @handle="detailHeadHandle" />
diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue
index 9cfc754..e41c3ce 100644
--- a/src/views/crm/contract/index.vue
+++ b/src/views/crm/contract/index.vue
@@ -54,14 +54,21 @@
:width="item.width"
sortable="custom"
show-overflow-tooltip>
-
+
-
- {{ getCRMStatusName(scope.row.check_status) }}
-
-
- {{ fieldFormatter(scope.row, scope.column) }}
+
+ {{ getCRMStatusName(row.check_status) }}
+
+
+ {{ fieldFormatter(row, column, row[column.property], item) }}
+
+
@@ -77,6 +84,14 @@
@change="setSave"/>
+
diff --git a/src/views/crm/customer/Create.vue b/src/views/crm/customer/Create.vue
index 360e756..5456e84 100644
--- a/src/views/crm/customer/Create.vue
+++ b/src/views/crm/customer/Create.vue
@@ -5,27 +5,35 @@
@close="close"
@save="saveClick">
-
-
-
-
-
+
+
+
+
+
+
{
- if (item.formType === 'mobile') {
- item.defaultValue = this.phone
+ if (item.form_type === 'mobile') {
+ item.default_value = this.phone
}
})
}
+ const assistIds = this.getFormAssistIds(list)
+ const baseFields = []
const fieldList = []
const fieldRules = {}
const fieldForm = {}
- list.forEach(item => {
- const temp = {}
- temp.field = item.field
- temp.formType = item.form_type
- temp.fieldId = item.fieldId
- temp.inputTips = item.input_tips
- temp.name = item.name
- temp.setting = item.setting
- temp.value = item.value
- const canEdit = this.getItemIsCanEdit(item, this.action.type)
- // 是否能编辑权限
- if (canEdit) {
- fieldRules[temp.field] = this.getRules(item)
- }
+ list.forEach(children => {
+ const fields = []
+ children.forEach(item => {
+ const temp = this.getFormItemDefaultProperty(item)
+ temp.show = !assistIds.includes(item.formAssistId)
+
+
+ const canEdit = this.getItemIsCanEdit(item, this.action.type)
+ // 是否能编辑权限
+ if (temp.show && canEdit) {
+ fieldRules[temp.field] = this.getRules(item)
+ }
- // 是否可编辑
- temp.disabled = !canEdit
+ // 是否可编辑
+ temp.disabled = !canEdit
- // 特殊字段允许多选
- this.getItemRadio(item, temp)
+ // 特殊字段允许多选
+ this.getItemRadio(item, temp)
- // 获取默认值
- fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
- fieldList.push(temp)
+ // 获取默认值
+ if (temp.show) {
+ fieldForm[temp.field] = this.getItemValue(item, this.action.data, this.action.type)
+ }
+ fields.push(temp)
+ baseFields.push(item)
+ })
+ fieldList.push(fields)
})
- this.baseFields = list
+ this.baseFields = baseFields
this.fieldList = fieldList
this.fieldForm = fieldForm
this.fieldRules = fieldRules
-
this.loading = false
})
- .catch(() => {
+ .catch((e) => {
this.loading = false
})
},
@@ -196,7 +215,7 @@ export default {
*/
saveClick(createContacts = false) {
this.loading = true
- const crmForm = this.$refs.crmForm.instance
+ const crmForm = this.$refs.crmForm
crmForm.validate(valid => {
if (valid) {
const params = this.getSubmiteParams(this.baseFields, this.fieldForm)
@@ -220,7 +239,7 @@ export default {
if (this.action.type == 'update') {
// params.entity.customerId = this.action.id
// params.entity.batchId = this.action.batchId
- params.action_id = this.action.id
+ params.id = this.action.id
}
// 相关添加时候的多余提交信息
@@ -272,14 +291,25 @@ export default {
/**
* change
*/
- formChange(item, index, value, valueList) {},
+ formChange(field, index, value, valueList) {
+ if ([
+ 'select',
+ 'checkbox'
+ ].includes(field.form_type) &&
+ field.remark === 'options_type' &&
+ field.optionsData) {
+ const { fieldForm, fieldRules } = this.getFormContentByOptionsChange(this.fieldList, this.fieldForm)
+ this.fieldForm = fieldForm
+ this.fieldRules = fieldRules
+ }
+ },
/**
* 地址change
*/
otherChange(data, field) {
this.$set(this.fieldForm, field.field, data.value)
- this.$refs.crmForm.instance.validateField(field.field)
+ this.$refs.crmForm.validateField(field.field)
},
/**
diff --git a/src/views/crm/customer/Detail.vue b/src/views/crm/customer/Detail.vue
index 3641563..1f694eb 100644
--- a/src/views/crm/customer/Detail.vue
+++ b/src/views/crm/customer/Detail.vue
@@ -26,6 +26,8 @@
:pool_id="seasPoolId"
:pool-auth="poolAuth"
:crm-type="crmType"
+ :page-list="pageList"
+ @pageChange="pageChange"
@handle="detailHeadHandle"
@close="hideView">
@@ -61,7 +63,7 @@
:is-seas="isSeasDetail"
:crm-type="crmType"
:contacts-id.sync="firstContactsId"
- @on-handle="detailHeadHandle" />
+ @handle="detailHeadHandle" />
@@ -182,7 +184,7 @@ export default {
tabCurrentName: 'Activity',
// 编辑操作
createActionInfo: null,
- createCRMType: '',
+ createCRMType: 'customer',
isCreate: false,
// 活动操作
// 展示重要信息
@@ -441,29 +443,21 @@ export default {
}
this.isCreate = true
},
-
/**
* 顶部头 操作
* @param {*} data
*/
- detailHeadHandle(data) {
+ detailHeadHandleClick(data) {
if (data.type === 'edit') {
this.createCRMType = 'customer'
this.createActionInfo = {
type: 'update',
- action_id: this.id,
+ id: this.id,
batchId: this.detailData.batchId
}
this.isCreate = true
- } else if (data.type === 'delete' || data.type === 'exit-team') {
- this.hideView()
- }
-
- if (data.type === 'edit' || data.type === 'deal_status') {
- this.getDetial()
+ return false
}
-
- this.$emit('handle', data)
}
}
}
diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue
index 5f7f349..6f0d9d4 100644
--- a/src/views/crm/customer/index.vue
+++ b/src/views/crm/customer/index.vue
@@ -104,17 +104,26 @@
:width="item.width"
:sortable="item.prop != 'pool_day' ? 'custom' : false"
show-overflow-tooltip>
-
+
-
- {{ scope.row[item.prop] | dealName }}
+
+ {{ row[item.prop] | dealName }}
- {{ fieldFormatter(scope.row, scope.column) }}
+
+
+ {{ fieldFormatter(row, column, row[column.property], item) }}
+
+
@@ -144,6 +153,14 @@
@change="setSave"/>
+
diff --git a/src/views/crm/invoice/Create.vue b/src/views/crm/invoice/Create.vue
index 38cdec7..7f9451e 100644
--- a/src/views/crm/invoice/Create.vue
+++ b/src/views/crm/invoice/Create.vue
@@ -8,30 +8,48 @@
-
-
- {{ item.name }}
-
- {{ item.tips || '' }}
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,12 +67,12 @@
:show="showPopover"
:action="titleAction"
radio
- crm-type="invoiceTitle"
+ crm-type="invoice_title"
@close="showPopover=false"
@changeCheckout="titleSelectChange"/>
选择发票信息
@@ -76,11 +94,11 @@
@@ -105,11 +123,11 @@
@@ -134,18 +152,24 @@
diff --git a/src/views/workLog/components/LogItem.vue b/src/views/workLog/components/LogItem.vue
index 5a6629d..d93300e 100644
--- a/src/views/workLog/components/LogItem.vue
+++ b/src/views/workLog/components/LogItem.vue
@@ -95,6 +95,13 @@