Commit 9a996c2a by 张权

提单接口,销售人员接口

1 parent a807664d
......@@ -149,6 +149,17 @@ const updateCarBrandApi = params => {
})
}
const getSalesPersonApi = params => {
params.method = 'entmicro.api.staff.findStaffByMerchantId'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称)
const getProListApi = params => {
params.method = `${defaultPath}select.get`
......@@ -225,7 +236,7 @@ const getOrderAttrApi = params => {
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get`
params.method = `${defaultPath}order.attachments.value.get.multiple`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
......@@ -260,7 +271,19 @@ const checkOrderApi = params => {
// 更新套菜附件属性
const updateOrderApi = params => {
params.method = `${orderPath}attachment.update`
params.method = `${orderPath}attachment.add`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//删除图片
const delImgApi = params => {
params.method = `${orderPath}attachment.delete`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
......@@ -305,4 +328,4 @@ const aduitOrderApi = params => {
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi }
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, delImgApi, getSalesPersonApi }
......@@ -159,4 +159,8 @@
align-items: center;
justify-content: center;
flex-direction: column;
}
.el-message{
z-index: 3000!important;
}
\ No newline at end of file
......@@ -47,7 +47,7 @@
</template> -->
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :filter-method="item.keydownMethod" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
......@@ -99,7 +99,7 @@
</template>
<slot name="footer"></slot>
</el-form>
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible">
<el-dialog v-if="isImgVisible" :append-to-body="true" :modal-append-to-body="true" title="查看" :visible.sync="isImgVisible">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4">
......@@ -184,6 +184,9 @@ export default {
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
remoteMethod(value){
console.log(value,111)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
......@@ -242,8 +245,10 @@ export default {
},
// 图片删除
handleImgDelete(targetItem, subIndex = -1) {
const imgUrl = this.formObj[targetItem.name][subIndex]
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
this.$emit('handleImgDelete', targetItem)
console.log(targetItem,subIndex)
this.$emit('handleImgDelete', targetItem, imgUrl)
},
// 图片查看
handleImgLook(src, targetItem) {
......
......@@ -21,10 +21,12 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$defaultStartDate = '2021-07-01'
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '02a5b9fc-3b3b-4a93-a2fc-c208a8705eec' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '02a5b9fc-3b3b-4a93-a2fc-c208a8705eec' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-c6a2e5c9-3d9d-4f3c-a677-46824e5d0e87-rop' } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: 'mini-c6a2e5c9-3d9d-4f3c-a677-46824e5d0e87-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'd986590e-22b5-436a-b6b5-5e09138d98e2' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: 'd986590e-22b5-436a-b6b5-5e09138d98e2' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......
......@@ -49,10 +49,10 @@
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p class="package-subtitle">{{ subItem.serviceItems }}</p>
<div v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<div class="sub-el-form" v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" defaultWidth="320px" formRef="editChildRefPro" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope">
<table class="table-style">
<table :style="{ marginLeft: setTableMarginLeft(subItem) + 'px'}" class="table-style">
<tbody>
<tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
......@@ -146,7 +146,9 @@ export default {
seatesNum: 5,
billingDate: new Date()
},
insurance: 'i'
actualSalesPerson:'',
actualSalesPersonId:'',
insuranceType: 'i'
},
// 车辆信息
editRuleCar: {
......@@ -362,7 +364,7 @@ export default {
],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }],
actualSalesPerson: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
},
editFormDataOther: [
{
......@@ -408,12 +410,26 @@ export default {
},
{
label: '实际销售人员',
name: 'actualSalesPerson',
type: 'select'
name: 'actualSalesPersonId',
type: 'select',
noFilter: false,
isRemote: true,
optionList: [],
optionId: 'userOneid',
optionLabel: 'staffName',
changeAttr: (userOneid, targetItem)=>{
let target = targetItem.optionList.find(item =>{
return item.userOneid = userOneid
})
this.editForm.actualSalesPerson = target.staffName
},
keydownMethod: (value)=>{
this.getSalePeople(value)
}
},
{
label: '首续保',
name: 'insurance',
name: 'insuranceType',
type: 'radio',
optionList: [
{
......@@ -517,6 +533,7 @@ export default {
created() {
this.getAllVehicleBrand()
this.getCarChildList(false, true)
// this.getSalePeople()
},
mounted() {
......@@ -544,6 +561,40 @@ export default {
},
methods: {
getSalePeople(val){
const params = {
staffName: val ? val.trim() : ''
// departmentId: ''
}
console.log(111)
this.$apis.ghBeforeSale.getSalesPersonApi(params).then(res => {
if(res.code==='0') {
const id = this.editFormDataOther.findIndex((item)=>{
return item.name == 'actualSalesPersonId'
})
this.$nextTick(() =>{
this.editFormDataOther[id].optionList = res.data
})
}
})
},
setTableMarginLeft(subItem,subItemId){
let productW = document.querySelector('.select-product').offsetWidth
let id = -1
if(subItem?.editFormData){
id = subItem.editFormData.findIndex(item => {
return item.addHtml === 'table'
})
}
let leftId = 0
if( productW < 1050){
return 20
}else if(productW < 1560){
return (id+1)%2 === 0 ? 20 : (id+1)%2*510
}else{
return (id+2)%3 === 0 ? 20 : (id+2)%3*510
}
},
setDisabled(partDisabledList = []) {
var list = ['Car', 'User', 'Pro', 'Other']
var flag = true
......@@ -646,8 +697,26 @@ export default {
})
}
},
// 舒享版只能续保,'尊享版', '优享版'只能首保
setInsuranceType(targetItem){
const targetNameList = ['尊享版', '优享版', '舒享版']
if(targetNameList.includes(targetItem.packageName)){
if(targetItem.packageName==='舒享版'){
this.editForm.insuranceType = 'c'
}else{
this.editForm.insuranceType = 'i'
}
const id = this.editFormDataOther.findIndex((item)=>{
return item.name == 'insuranceType'
})
this.editFormDataOther[id].isDisabled = true
}
},
packageAttr(recovery = false) {
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
this.setInsuranceType(targetItem)
console.log(targetItem)
this.packageToPrice(recovery)
var tempObj = this.$common.utils.deepClone(this.editFormPro)
this.editRulePro = {}
......@@ -744,6 +813,7 @@ export default {
editFormData: this.$common.utils.deepClone(tempList)
})
})
console.log(this.editFormDataPro)
this.routeInfo.addOrEdit != '1' ? this.getInfo() : ''
},
getOptionsList(formName, hasAll = true, refreshSigle) {
......@@ -833,6 +903,7 @@ export default {
},
getParams() {
var params = this.$common.utils.deepClone(this.editForm)
console.log(params,66633)
// 格式化价格
if (this.editForm.vehicle.invoicePrice) {
params.vehicle.invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(0)
......@@ -862,7 +933,9 @@ export default {
if (this.editForm.effectiveDate) {
params.effectiveDate = dayjs(this.editForm.effectiveDate).format('YYYY-MM-DD')
}
console.log(this.packageList, this.editForm)
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
console.log(targetItem,8989)
params.attributeList = []
if (targetItem) {
targetItem.groupAttributeList.forEach(item => {
......@@ -960,6 +1033,7 @@ export default {
} else {
params.contractNo = ''
}
console.log(params)
this.$apis.ghBeforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(params)
......@@ -1194,7 +1268,7 @@ export default {
color: #606266;
}
/deep/ .glsx-combi-form .no-label.el-form-item--small .el-form-item__content {
width: auto !important;
width: auto;
}
/* 表格 */
/* .edit-equity .spesc-label {
......@@ -1206,7 +1280,7 @@ export default {
padding-right: 12px;
} */
.edit-equity .table-style {
width: 50%;
width: 510px;
text-align: center;
margin-bottom: 0;
}
......@@ -1246,5 +1320,9 @@ export default {
border: 1px solid #909090;
color: #333333;
}
/deep/ .sub-el-form .no-label{
display: block;
}
/* 表格 */
</style>
......@@ -31,9 +31,9 @@
<!-- 表格区域 end -->
</div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
<glsx-dialog title="上传资料" :isVisible.sync="isFileVisible" width="547px" :noCancel="noCancel" btnOkLabel="关闭" @confirmDialog="handleUploadFileClose" @closeDialog="handleUploadFileClose">
<glsx-dialog class="upload-dialog" title="上传资料" :isVisible.sync="isFileVisible" width="710px" :noCancel="noCancel" btnOkLabel="关闭" @confirmDialog="handleUploadFileClose" @closeDialog="handleUploadFileClose">
<div class="upload-wrap" style="height: 284px; overflow-y: scroll;">
<glsx-combi-form labelWidth="300px" :isBlock="isBlock" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData">
<glsx-combi-form labelWidth="300px" :isBlock="isBlock" @handleImgDelete="handleDelImg(arguments)" ref="uploadFormRef" formRef="uploadChildRef" :formRules="uploadRule" :formObj.sync="uploadForm" :formData="uploadFormData">
<span class="upload-slot" slot="uploadSlot" slot-scope="item">
上传
<input class="upload-input" type="file" :id="item.name + 'file'" ref="file" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
......@@ -549,6 +549,19 @@ export default {
handleUploadChange(e, item){
this.$refs.uploadFormRef.handleUploadChange(e, item.scope)
},
handleDelImg(event){
const params = {
contractNo: this.uploadForm.contractNo,
attachmentFile : event[1]
}
console.log(params)
this.$apis.ghBeforeSale.delImgApi(params).then(res => {
this.$message({
message: res.code == '0' ? '删除成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
},
getCountNoData() {
this.$apis.ghBeforeSale.getCountNoDataApi({}).then(res => {
this.countNoData = res
......@@ -749,11 +762,11 @@ export default {
this.packageList.forEach(item => {
this.$set(this.uploadForm, item.attachmentCode, [])
this.uploadFormData.push({
label: item.attachmentName,
label: item.attachmentName+':',
name: item.attachmentCode,
type: 'upload',
limitSize: 20,
maxPhotoNum: 10,
maxPhotoNum: 9,
suffixSlot:'uploadSlot',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
......@@ -788,7 +801,7 @@ export default {
var idx = ''
this.packageList.forEach(item => {
idx = subRes.findIndex(i => i.attachmentCode == item.attachmentCode)
this.uploadForm[item.attachmentCode] = idx != -1 ? [subRes[idx].attachmentFile] : []
this.uploadForm[item.attachmentCode] = idx != -1 ? subRes[idx].attachmentFiles : []
})
})
this.autoGenerate()
......@@ -980,28 +993,52 @@ export default {
padding: 10px 15px 20px !important;
}
/deep/ .upload-wrap{
.el-form-item__content{
.activity-img{
display: none;
/deep/ .upload-dialog{
.upload-wrap{
.glsx-combi-form .isBlock {
display: flex !important;
}
}
.upload-slot{
position: absolute;
top: -32px;
height: 32px;
left: 300px;
color: #5f5efb;
white-space: nowrap;
cursor: pointer;
.upload-input{
opacity: 0;
.el-form-item__label{
height: 32px;
white-space: nowrap;
}
.el-form-item__content{
padding-left: 60px;
.activity-img{
display: none;
}
&:last-child{
width: 250px;
.img-btns, img{
width: 64px;
height: 64px;
}
}
}
.upload-slot{
position: absolute;
width: 100%;
top: 0;
height: 32px;
left: 0;
height: 100%;
color: #5f5efb;
white-space: nowrap;
cursor: pointer;
.upload-input{
opacity: 0;
position: absolute;
width: 100%;
left: 0;
height: 100%;
cursor: pointer;
}
}
}
.el-dialog__footer{
&>div{
display: flex;
justify-content: center;
}
}
}
</style>
......@@ -47,6 +47,7 @@ module.exports = {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
lintOnSave: false,
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!