Commit 565096a8 by Lin

feat(Employee, AddFiles, DetailFiles):增强员工管理与数据处理功能

- 更新 Employee 组件,新增 employeeType 和 sellerEmployeeList,以实现更完善的员工分类。
- 优化 AddFiles 组件,动态设置员工选择标题,并改进邀请日期的逻辑管理。
- 重构 DetailFiles,提升客户信息的显示效果,并确保数据处理的准确性。
1 parent 450b9d2d
......@@ -32,15 +32,15 @@ export default {
type: String,
default: 'uuid'
},
/** 转化人员(驻店零售)模式,与 OrderPopup 转化人员选择项一致 */
sellerUser: {
type: Boolean,
default: false
// default: 销售顾问;seller: 转化人员/驻店零售
employeeType: {
type: String,
default: 'default'
}
},
data () {
return {
localEmployeeList: null
sellerEmployeeList: []
}
},
watch: {
......@@ -56,21 +56,17 @@ export default {
return this.$store.state.user.historyStatus
},
selectedId () {
if (Array.isArray(this.list)) {
if (Array.isArray(this.list) || this.employeeType === 'seller') {
return this.salesPropsUuid
}
// 优先使用父组件传入的选中值,避免多表单项共用弹框时与 vuex salesUuid 冲突
if (this.salesPropsUuid) {
return this.salesPropsUuid
}
return this.$store.state.user.customerInfo.salesUuid
return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
},
displayList () {
if (Array.isArray(this.list)) {
return this.list
}
if (Array.isArray(this.localEmployeeList)) {
return this.localEmployeeList
if (this.employeeType === 'seller') {
return this.sellerEmployeeList
}
return this.$store.state.user.employeeList
}
......@@ -81,25 +77,29 @@ export default {
open () {
this.$refs.employeeBoxVisible.open()
if (Array.isArray(this.list)) return
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId, merchantId } = userInfo
const fetchType = this.employeeType
this.localEmployeeList = []
const fetchList = fetchType === 'seller'
? uni.$api.popupApi.getEmployeeList({
merchantId,
sceneList: ''
const userInfo = uni.$storage.get("userInfo")
if (this.employeeType === 'seller') {
const { merchantId } = userInfo
uni.$api.popupApi
.getEmployeeList({
merchantId,
sceneList: ''
})
.then((res) => {
this.sellerEmployeeList = res || []
})
return
}
const { shopMerchantId } = userInfo
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
: uni.$api.commonApi.getEmployeeList({
merchantId: shopMerchantId
.then((res) => {
this.$store.dispatch("setEmployeeList", res);
uni.$storage.set("employeeList", res || []);
})
fetchList.then((res) => {
if (fetchType !== this.employeeType) return
const list = res || []
this.localEmployeeList = list
this.$store.dispatch("setEmployeeList", list)
uni.$storage.set("employeeList", list)
})
},
handleSelect (item) {
this.close();
......
......@@ -130,7 +130,7 @@
></reception-sence>
<employee
ref="residentSaleVisible"
:title="employeePopupTitle"
:title="employeeSelectKey === 'sellerUserId' ? '驻店零售' : '流量来源'"
:employeeType="employeeSelectKey === 'sellerUserId' ? 'seller' : 'default'"
:salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''"
@select="handleSelect($event, 'residentSaleVisible')"
......@@ -214,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
valueKey: 'inviteDate',
key: 'inviteDate',
type: 'date'
},
{
......@@ -257,7 +257,6 @@ export default {
endDate: '',
validateState: true,
employeeSelectKey: '',
employeePopupTitle: '驻店零售',
inviteDateTouched: false
}
},
......@@ -296,8 +295,10 @@ export default {
merchantName: '',
sellerName: '',
sellerUserId: '',
inviteDate: '',
filingDate: ''
}
this.inviteDateTouched = false
if (this.customerId) this.findVisitsInfo()
},
async findVisitsInfo () {
......@@ -305,8 +306,10 @@ export default {
id: this.customerId
})
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
this.inviteDateTouched = !!res.inviteDate
},
backPage () {
uni.navigateBack({
......@@ -317,7 +320,6 @@ export default {
},
showPopup (item) {
this.employeeSelectKey = item.key
this.employeePopupTitle = item.label
this.$refs[item.popKey].open()
},
getFieldDisplayValue (field) {
......@@ -356,7 +358,14 @@ export default {
}
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
const value = e.detail.value
this.customerInfo[valueKey] = value
if (valueKey === 'arrivalDate' && !this.inviteDateTouched) {
this.customerInfo.inviteDate = value
}
if (valueKey === 'inviteDate') {
this.inviteDateTouched = true
}
},
inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo
......@@ -434,6 +443,8 @@ export default {
merchantId:params.merchantId,
employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId,
sellerUserId: params.sellerUserId,
sellerName: customerInfo.sellerName,
preliminaryOrders: [
{
sceneType:1,
......@@ -450,7 +461,7 @@ export default {
employeeName:params.employeeName,
userId:params.userId,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期
inviteDate: params.inviteDate ? params.inviteDate + ' 00:00:00' : params.inviteDate, //到店日期
createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!