Commit 012adecf by zhangxw

bug修复

1 parent c05d5353
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:model="form" :model="form"
:rules="formRules" :rules="formRules"
label-width="130px" label-width="130px"
v-loading="$store.state.d2admin.loading.value"> >
<p class="edit-sub-title"> <p class="edit-sub-title">
店铺设置 店铺设置
<span class="merchantName">{{ info.merchantName }} {{ info.merchantId }}</span> <span class="merchantName">{{ info.merchantName }} {{ info.merchantId }}</span>
...@@ -374,33 +374,6 @@ export default { ...@@ -374,33 +374,6 @@ export default {
} }
}, },
watch: {
sellerMerchantStaffList: {
handler() {
this.checkSelectOption()
},
deep: true
},
serviceBossList: {
handler() {
this.checkSelectOption()
},
deep: true
},
supervisionOptionsList: {
handler() {
this.checkSelectOption()
},
deep: true
},
residentManagerOptionsList: {
handler() {
this.checkSelectOption()
},
deep: true
},
},
components: {}, components: {},
computed: {}, computed: {},
...@@ -412,12 +385,12 @@ export default { ...@@ -412,12 +385,12 @@ export default {
this.nowMoth = nowDate.getMonth() + 1 this.nowMoth = nowDate.getMonth() + 1
this.nowDay = nowDate.getDate() this.nowDay = nowDate.getDate()
this.info = this.$route.params?.info this.info = this.$route.params?.info
await this.getShopSetting(this.info)
await this.findMerchantStaffList() await this.findMerchantStaffList()
await this.merchantStaffByRoleList() await this.merchantStaffByRoleList()
await this.getSelectList(this.info) await this.getSelectList(this.info)
await this.listByMerchantIdAndYear(this.year) await this.listByMerchantIdAndYear(this.year)
await this.findSellerMerchantStaffList() await this.findSellerMerchantStaffList()
await this.getShopSetting(this.info)
}, },
methods: { methods: {
...@@ -431,31 +404,35 @@ export default { ...@@ -431,31 +404,35 @@ export default {
// 获取店铺设置信息 // 获取店铺设置信息
async getShopSetting(info) { async getShopSetting(info) {
const { merchantId } = info const { merchantId } = info
getShopSetting({ merchantId }).then(res => { return new Promise((resolve, reject) => {
// this.setInfo = res getShopSetting({ merchantId }).then(res => {
this.form = deepClone(res) // this.setInfo = res
if (!this.form.serviceMerchantServiceChargeConfig) { this.form = deepClone(res)
// 未设置过时,手续费默认为打开并且费率为2 if (!this.form.serviceMerchantServiceChargeConfig) {
this.form.serviceMerchantServiceChargeConfig = { passageServiceCharge: 2, passageServiceChargeFlag: 'Y', gasCardServiceCharge: 2, gasCardServiceChargeFlag: 'Y' } // 未设置过时,手续费默认为打开并且费率为2
} this.form.serviceMerchantServiceChargeConfig = { passageServiceCharge: 2, passageServiceChargeFlag: 'Y', gasCardServiceCharge: 2, gasCardServiceChargeFlag: 'Y' }
if (!this.form.shopMerchantConfig) { }
this.form.shopMerchantConfig = { boutiqueDirectorUserId: '', quotationDirectorUserId: '', boutiqueSunshineInspiration: '', quotationSunshineInspiration: '', boutiqueMarketInspiration: '', quotationMarketInspiration: '', boutiqueServiceDirectorUserId: '', quotationServiceDirectorUserId: '' } if (!this.form.shopMerchantConfig) {
} this.form.shopMerchantConfig = { boutiqueDirectorUserId: '', quotationDirectorUserId: '', boutiqueSunshineInspiration: '', quotationSunshineInspiration: '', boutiqueMarketInspiration: '', quotationMarketInspiration: '', boutiqueServiceDirectorUserId: '', quotationServiceDirectorUserId: '' }
// 对比下拉框是否存在已选的选择项 不存在清空 }
// this.checkSelectOption() // 对比下拉框是否存在已选的选择项 不存在清空
console.log(this.form) this.checkSelectOption()
if (this.form.list && this.form.list.length > 0) { console.log(this.form)
this.form.list = this.form.list.map(item => { if (this.form.list && this.form.list.length > 0) {
const item_new = { this.form.list = this.form.list.map(item => {
id: item.id, const item_new = {
merchantName: item.subMerchantName, id: item.id,
merchantNo: item.subMerchantId merchantName: item.subMerchantName,
} merchantNo: item.subMerchantId
this.options.push(item_new) }
return item_new this.options.push(item_new)
}) return item_new
} })
}
resolve()
})
}) })
}, },
checkSelectOption() { checkSelectOption() {
...@@ -527,47 +504,57 @@ export default { ...@@ -527,47 +504,57 @@ export default {
} }
}, },
async merchantStaffByRoleList() { async merchantStaffByRoleList() {
merchantStaffByRoleList({ roleName: '区域督导' }).then((result) => { return new Promise((resolve, reject) => {
let copyResult = deepClone(result) merchantStaffByRoleList({ roleName: '区域督导' }).then((result) => {
this.supervisionOptionsList = copyResult.map((item) => { let copyResult = deepClone(result)
return { this.supervisionOptionsList = copyResult.map((item) => {
userType: 1, return {
userId: item.uuid, userType: 1,
userName: item.staffName, userId: item.uuid,
userNum: item.staffPhone userName: item.staffName,
} userNum: item.staffPhone
}
})
resolve()
}) })
}) })
}, },
// 获取全部员工 过滤出服务商负责人可选数据 // 获取全部员工 过滤出服务商负责人可选数据
async findMerchantStaffList() { async findMerchantStaffList() {
findMerchantStaffList({ merchantId: -1 }).then(res => { return new Promise((resolve, reject) => {
// 服务商负责人(根据角色名过滤) findMerchantStaffList({ merchantId: -1 }).then(res => {
let arr = [] // 服务商负责人(根据角色名过滤)
res?.map(val => { let arr = []
if (val.roleName == baseConfig.roleName) arr.push({ res?.map(val => {
userId: val.uuid, if (val.roleName == baseConfig.roleName) arr.push({
userName: val.staffName userId: val.uuid,
userName: val.staffName
})
}) })
this.serviceBossList = arr
resolve()
}) })
this.serviceBossList = arr
}) })
}, },
// 根据4s店或者园区店查询员工信息 // 根据4s店或者园区店查询员工信息
async getSelectList(info) { async getSelectList(info) {
const { merchantId } = info const { merchantId } = info
// 取园区店下所有员工 0422版本 刘世权更改 // 取园区店下所有员工 0422版本 刘世权更改
getResidentStaffList({ merchantId }).then((result) => { return new Promise((resolve, reject) => {
this.residentManagerOptionsList = result.map((item) => { getResidentStaffList({ merchantId }).then((result) => {
return { this.residentManagerOptionsList = result.map((item) => {
userType: 2, return {
userId: item.staffUuid, userType: 2,
userName: item.staffName, userId: item.staffUuid,
userNum: item.staffPhone userName: item.staffName,
} userNum: item.staffPhone
}
})
resolve()
}) })
console.log(this.residentManagerOptionsList, '======')
}) })
}, },
chooseYear() { chooseYear() {
this.listByMerchantIdAndYear(this.year) this.listByMerchantIdAndYear(this.year)
...@@ -575,15 +562,18 @@ export default { ...@@ -575,15 +562,18 @@ export default {
// 根据年份获取产值列表 // 根据年份获取产值列表
async listByMerchantIdAndYear(year) { async listByMerchantIdAndYear(year) {
const { merchantId } = this.info const { merchantId } = this.info
listByMerchantIdAndYear({ yearStr: year, merchantId: merchantId }).then((result) => { return new Promise((resolve, reject) => {
this.outputValueListByYear = result || [] listByMerchantIdAndYear({ yearStr: year, merchantId: merchantId }).then((result) => {
if (this.outputValueListByYear && this.outputValueListByYear.length > 0) { this.outputValueListByYear = result || []
this.outputValueListByYear = this.outputValueListByYear.map(item => { if (this.outputValueListByYear && this.outputValueListByYear.length > 0) {
const _flag = this.setInputDisabled(item) this.outputValueListByYear = this.outputValueListByYear.map(item => {
item.isDisabled = _flag const _flag = this.setInputDisabled(item)
return item item.isDisabled = _flag
}) return item
} })
}
resolve()
})
}) })
}, },
// 产值输入框输入限制 // 产值输入框输入限制
...@@ -772,12 +762,15 @@ export default { ...@@ -772,12 +762,15 @@ export default {
}, },
async findSellerMerchantStaffList() { async findSellerMerchantStaffList() {
findSellerMerchantStaffList({}).then((result) => { return new Promise((resolve, reject) => {
this.sellerMerchantStaffList = result.map((item) => { findSellerMerchantStaffList({}).then((result) => {
return { this.sellerMerchantStaffList = result.map((item) => {
userId: item.uuid, return {
userName: item.staffName userId: item.uuid,
} userName: item.staffName
}
})
resolve()
}) })
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!