Commit 565096a8 by Lin

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

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