Commit 9e7b461d by cwq0219

修改

1 parent 82712eff
...@@ -13,6 +13,11 @@ export function getOrderDetail(data) { ...@@ -13,6 +13,11 @@ export function getOrderDetail(data) {
return request(data) return request(data)
} }
export function getOrderTotal(data) {
data.method = 'dj.api.smartcarlife.yqAdvanceOrder.total'
return request(data)
}
// 文件导入 // 文件导入
export function recordUpload(data) { export function recordUpload(data) {
data.method = `${path}advanceOrder.import` data.method = `${path}advanceOrder.import`
......
...@@ -22,18 +22,41 @@ ...@@ -22,18 +22,41 @@
v-model="form.sellerMerchantId" v-model="form.sellerMerchantId"
placeholder="请选择" placeholder="请选择"
class="el_select itd" class="el_select itd"
@change="handleSellerMerchantChange"
> >
<el-option <el-option
v-for="item in storeIdList" v-for="item in parkServiceList"
:key="item.merchantId" :key="item.merchantId"
:value="item.merchantId" :value="item.merchantId"
:label="item.merchantName" :label="item.merchantName"
/> />
</el-select> </el-select>
&nbsp;&nbsp;&nbsp;<span <!-- &nbsp;&nbsp;&nbsp;<span
class="warningFont" class="warningFont"
v-if="nostoreError" v-if="nostoreError"
>暂无服务的4S店</span> >暂无服务的4S店</span> -->
</el-form-item>
<el-form-item
id="seller"
label="预录员:"
required
v-show="userInfo.beSuper"
>
<el-radio
v-for="item in sellerList"
:key="item.userId"
v-model="form.sellerUserId"
:label="item.userId"
>{{item.name}}</el-radio>
<p
class="warningFont"
v-if="!form.sellerUserId && !hasSellError"
>请选择预录员</p>
<p
class="warningFont"
v-if="hasSellError"
>请检查是否配置员工名片!</p>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
...@@ -380,6 +403,9 @@ export default { ...@@ -380,6 +403,9 @@ export default {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
key: new Date(), key: new Date(),
form: { form: {
merchantId: '',
sellerUserId: '',
userId: '',
newCarFlag: 'Y' newCarFlag: 'Y'
}, },
storeIdList: [ storeIdList: [
...@@ -393,6 +419,7 @@ export default { ...@@ -393,6 +419,7 @@ export default {
// } // }
], ],
adviserList: [], adviserList: [],
sellerList: [],
customerTypeList: [ customerTypeList: [
{ {
id: 1, id: 1,
...@@ -414,6 +441,8 @@ export default { ...@@ -414,6 +441,8 @@ export default {
goodList: [], goodList: [],
baseGoodsIds: [], baseGoodsIds: [],
nostoreError: false, nostoreError: false,
showChooseSellError: false,
hasSellError: false,
showChooseCusError: false, showChooseCusError: false,
hasCusError: false, hasCusError: false,
showChoosePrError: false, showChoosePrError: false,
...@@ -465,6 +494,7 @@ export default { ...@@ -465,6 +494,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
// console.log(this.userInfo)
// this.form.sellerUserId = this.userInfo.detail.id // this.form.sellerUserId = this.userInfo.detail.id
// this.form.sellerName = this.userInfo.detail.merchantName // this.form.sellerName = this.userInfo.detail.merchantName
this.addOrEdit = this.$route.params.addOrEdit this.addOrEdit = this.$route.params.addOrEdit
...@@ -472,6 +502,7 @@ export default { ...@@ -472,6 +502,7 @@ export default {
this.getBaseData() this.getBaseData()
this.userInfo.beSuper && getParkStore({}).then(res => { this.userInfo.beSuper && getParkStore({}).then(res => {
this.parkServiceList = res this.parkServiceList = res
this.userInfo.beSuper && (this.form.yqMerchantId) && this.getSeller(this.form.yqMerchantId)
}) })
// this.form.sellerMerchantId = this.userInfo.detail.merchantId // this.form.sellerMerchantId = this.userInfo.detail.merchantId
if (!this.userInfo.beSuper && this.addOrEdit === 'add') { if (!this.userInfo.beSuper && this.addOrEdit === 'add') {
...@@ -480,7 +511,8 @@ export default { ...@@ -480,7 +511,8 @@ export default {
// this.getServiceStore() // this.getServiceStore()
if (this.addOrEdit === 'edit') { if (this.addOrEdit === 'edit') {
this.form = _.cloneDeep(this.$route.params.form) this.form = _.cloneDeep(this.$route.params.form)
this.form.customerSex = this.form.customerSex + '' this.form.customerSex = this.form.customerSex ? (this.form.customerSex + '') : ''
this.userInfo.beSuper && (this.form.sellerMerchantId = this.form.yqMerchantId)
console.log(this.form) console.log(this.form)
// if (this.form.carSeriesId) { // if (this.form.carSeriesId) {
// customer.carSeriesId = this.form.carSeriesId // customer.carSeriesId = this.form.carSeriesId
...@@ -498,7 +530,7 @@ export default { ...@@ -498,7 +530,7 @@ export default {
}) })
}) })
}) })
this.getServiceStore(this.userInfo.detail.merchantId, () => { this.getServiceStore(this.userInfo.beSuper ? this.form.yqMerchantId : this.userInfo.detail.merchantId, () => {
this.getAdviser(this.form.merchantId, () => { this.getAdviser(this.form.merchantId, () => {
this.form.userId = this.$route.params.form.userId this.form.userId = this.$route.params.form.userId
this.baseGoodsIds = this.$route.params.form.baseGoodsIds this.baseGoodsIds = this.$route.params.form.baseGoodsIds
...@@ -516,6 +548,18 @@ export default { ...@@ -516,6 +548,18 @@ export default {
this.productTypeList = await this.get(BaseData.productType) this.productTypeList = await this.get(BaseData.productType)
}, },
handleSellerMerchantChange(value) {
this.getServiceStore(value)
this.adviserList = []
this.sellerList = []
this.goodList = []
this.form.merchantId = ''
this.form.sellerUserId = ''
this.form.userId = ''
this.baseGoodsIds = []
this.getSeller(value)
},
/** /**
* 获取服务门店 * 获取服务门店
*/ */
...@@ -534,6 +578,23 @@ export default { ...@@ -534,6 +578,23 @@ export default {
}, },
/** /**
* 根据门店园区店获取预录员账号
*/
getSeller(merchantId) {
// console.log(this.parkServiceList)
const list = this.parkServiceList
const o = list.find(k => k.merchantId == merchantId)
const channelType = o.channelType
/** 根据门店商户号获取预录员列表 */
const params = { 'merchantId': merchantId, 'channelType': channelType }
getStaff(params).then(res => {
console.log(res)
this.sellerList = res || []
this.hasSellError = !res.length
})
},
/**
* 根据门店商户号获取员工列表 * 根据门店商户号获取员工列表
*/ */
getAdviser(merchantId, fn = () => { }) { getAdviser(merchantId, fn = () => { }) {
...@@ -702,13 +763,20 @@ export default { ...@@ -702,13 +763,20 @@ export default {
* 保存信息 * 保存信息
*/ */
handleSave() { handleSave() {
!this.userInfo.beSuper && (this.form.sellerMerchantId = this.userInfo.detail.merchantId) if (!this.userInfo.beSuper) {
this.form.sellerMerchantId = this.userInfo.detail.merchantId
this.form.sellerUserId = this.userInfo.detail.id
}
this.$refs.editCusFrom.validate((valid, opt) => { this.$refs.editCusFrom.validate((valid, opt) => {
const validAttrList = ['sellerMerchantId', 'merchantId', 'customerName', 'customerPhone', 'standNo'] const validAttrList = ['sellerMerchantId', 'merchantId', 'customerName', 'customerPhone', 'standNo']
var hasError = Object.keys(opt) var hasError = Object.keys(opt)
if (!this.form.sellerUserId) {
this.showChooseSellError = true
}
if (!this.form.userId) { if (!this.form.userId) {
this.showChooseCusError = true this.showChooseCusError = true
} }
if (this.baseGoodsIds.length === 0) { if (this.baseGoodsIds.length === 0) {
this.showChoosePrError = true this.showChoosePrError = true
} }
...@@ -728,6 +796,16 @@ export default { ...@@ -728,6 +796,16 @@ export default {
...this.form ...this.form
} }
// const goods = [] // const goods = []
// seller
/** 判断是否选择预录员 */
// console.log(this.form.userId)
if (this.form.sellerUserId) {
this.showChooseSellError = false
} else {
this.jumpScroll('seller')
this.showChooseSellError = true
return false
}
/** 判断是否选择销售顾问 */ /** 判断是否选择销售顾问 */
// console.log(this.form.userId) // console.log(this.form.userId)
if (this.form.userId) { if (this.form.userId) {
...@@ -751,8 +829,8 @@ export default { ...@@ -751,8 +829,8 @@ export default {
return false return false
} }
params.sellerMerchantId = this.form.sellerMerchantId params.sellerMerchantId = this.form.sellerMerchantId
params.sellerUserId = this.userInfo.detail.id params.sellerUserId = this.form.sellerUserId
params.sellerName = this.userInfo.detail.merchantName params.sellerName = this.userInfo.beSuper ? this.sellerList.find(item => item.userId === this.form.sellerUserId).name : this.userInfo.detail.accountName
params.merchantId = this.form.merchantId params.merchantId = this.form.merchantId
params.userId = this.form.userId params.userId = this.form.userId
// this.adviserList.find(item => item.userId === this.$route.params.form.userId).name // this.adviserList.find(item => item.userId === this.$route.params.form.userId).name
...@@ -799,7 +877,7 @@ export default { ...@@ -799,7 +877,7 @@ export default {
params.customer = customer params.customer = customer
console.log(params) console.log(params)
if (this.addOrEdit === 'add') { if (this.addOrEdit === 'add') {
params.createdBy = this.userInfo.detail.accountName params.createdBy = this.userInfo.detail.accountName
addOrder(params).then(res => { addOrder(params).then(res => {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
style="{display: inline-block}" style="{display: inline-block}"
showBtnName="['预录客户']" showBtnName="['预录客户']"
></auth-button> ></auth-button>
<span class="table-header-left-txt">已预录客户列表xx条记录。</span> <span class="table-header-left-txt">已预录客户列表{{total}}条记录。</span>
</span> </span>
<span> <span>
<span class="btn-tips"><img src="../../assets/icon-warn.png">所有号码已启用隐私号码保护功能!</span> <span class="btn-tips"><img src="../../assets/icon-warn.png">所有号码已启用隐私号码保护功能!</span>
...@@ -83,7 +83,10 @@ ...@@ -83,7 +83,10 @@
label="园区店:" label="园区店:"
prop="yqMerchantId" prop="yqMerchantId"
> >
<el-select v-model="fileForm.yqMerchantId"> <el-select
v-model="fileForm.yqMerchantId"
@change="handleSellerMerchantChange"
>
<el-option <el-option
v-for="item in baseData.parkServiceList" v-for="item in baseData.parkServiceList"
:key="item.merchantId" :key="item.merchantId"
...@@ -93,6 +96,27 @@ ...@@ -93,6 +96,27 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
id="seller"
label="预录员:"
required
v-show="userInfo.beSuper"
>
<el-radio
v-for="item in baseData.sellerList"
:key="item.userId"
v-model="fileForm.sellerUserId"
:label="item.userId"
>{{item.name}}</el-radio>
<p
class="warningFont"
v-if="!fileForm.sellerUserId && !hasSellError"
>请选择预录员</p>
<p
class="warningFont"
v-if="hasSellError"
>请检查是否配置员工名片!</p>
</el-form-item>
<el-form-item
label="导入文件:" label="导入文件:"
prop="fileName" prop="fileName"
> >
...@@ -133,7 +157,7 @@ ...@@ -133,7 +157,7 @@
</template> </template>
<script> <script>
import { getList, getOrderDetail, recordUpload } from '@api/recordList' import { getList, getOrderDetail, recordUpload, getOrderTotal } from '@api/recordList'
import { getServiceStore, getParkStore, getStaff, getGoods } from '@api/editCustomer' import { getServiceStore, getParkStore, getStaff, getGoods } from '@api/editCustomer'
import { export_json_to_excel } from '@/common/Export2Excel.js' import { export_json_to_excel } from '@/common/Export2Excel.js'
export default { export default {
...@@ -143,7 +167,10 @@ export default { ...@@ -143,7 +167,10 @@ export default {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
hideVisible: false, hideVisible: false,
fileVisible: false, fileVisible: false,
fileForm: {}, fileForm: {
sellerUserId: ''
},
total: 0,
showNum: false, showNum: false,
importNum: { importNum: {
succNum: 0, succNum: 0,
...@@ -275,6 +302,7 @@ export default { ...@@ -275,6 +302,7 @@ export default {
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
storeIdList: [], storeIdList: [],
sellerList: [],
adviserList: [], adviserList: [],
goodList: [] goodList: []
} }
...@@ -282,6 +310,10 @@ export default { ...@@ -282,6 +310,10 @@ export default {
}, },
mounted() { mounted() {
var params = this.userInfo.beSuper ? {} : { yqMerchantId: this.userInfo.detail.merchantId }
getOrderTotal(params).then(res => {
this.total = res
})
if (this.userInfo.beSuper) { if (this.userInfo.beSuper) {
getParkStore({}).then(res => { getParkStore({}).then(res => {
// console.log(res) // console.log(res)
...@@ -318,6 +350,27 @@ export default { ...@@ -318,6 +350,27 @@ export default {
} }
}) })
}, },
handleSellerMerchantChange(value) {
this.fileForm.sellerUserId = ''
this.getSeller(value)
},
/**
* 根据门店园区店获取预录员账号
*/
getSeller(merchantId) {
const list = this.baseData.parkServiceList
const o = list.find(k => k.merchantId == merchantId)
const channelType = o.channelType
/** 根据门店商户号获取预录员列表 */
const params = { 'merchantId': merchantId, 'channelType': channelType }
getStaff(params).then(res => {
console.log(res)
this.baseData.sellerList = res || []
this.hasSellError = !res.length
})
},
getServiceStore(merchantId) { getServiceStore(merchantId) {
getServiceStore({ getServiceStore({
yqMerchantId: merchantId yqMerchantId: merchantId
...@@ -350,6 +403,7 @@ export default { ...@@ -350,6 +403,7 @@ export default {
handleImport() { handleImport() {
this.fileForm = { this.fileForm = {
yqMerchantId: this.userInfo.beSuper ? '' : this.userInfo.detail.merchantId, yqMerchantId: this.userInfo.beSuper ? '' : this.userInfo.detail.merchantId,
sellerUserId: '',
fileName: '' fileName: ''
} }
this.showNum = false this.showNum = false
...@@ -372,13 +426,17 @@ export default { ...@@ -372,13 +426,17 @@ export default {
return jsonData.map(v => filterVal.map(j => v[j])) return jsonData.map(v => filterVal.map(j => v[j]))
}, },
handleConfirmImport() { handleConfirmImport() {
// console.log(this.userInfo) // console.log(this.baseData.sellerList)
this.fileForm.sellerUserId = this.userInfo.beSuper ? this.fileForm.sellerUserId : this.userInfo.detail.id
this.$refs.fileRuleForm.validate(valid => { this.$refs.fileRuleForm.validate(valid => {
if (valid) { if (valid) {
if (!this.fileForm.sellerUserId) {
return true
}
var params = { var params = {
sellerUserId: this.userInfo.detail.id, sellerUserId: this.fileForm.sellerUserId,
sellerName: this.userInfo.detail.accountName, sellerName: this.userInfo.beSuper ? this.baseData.sellerList.find(i => i.userId === this.fileForm.sellerUserId).name : this.userInfo.detail.accountName,
sellerMerchantId: this.userInfo.detail.merchantId, sellerMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.merchantId,
yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.id, yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.id,
file: this.fileInfo file: this.fileInfo
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!