Merge branch 'xiaozy_产品列表' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin into lixuan
commit
d55d7562b6
21 changed files with 1385 additions and 562 deletions
@ -0,0 +1,58 @@ |
||||
import request from "utils/axios.js"; |
||||
// table
|
||||
const getByPage = (params) => { |
||||
return request.postJson("/oil-user/oilCompanyInfo/getByPage", params); |
||||
}; |
||||
|
||||
//详情
|
||||
const getCompanyAccountRecord = (params) => { |
||||
return request.postJson( |
||||
"oil-finance/oilCompanyAccountRecord/getCompanyAccountRecord", |
||||
params |
||||
); |
||||
}; |
||||
//保存
|
||||
const save = (params) => { |
||||
return request.postJson("/oil-user/oilCompanyInfo/save", params); |
||||
}; |
||||
//修改
|
||||
const update = (params) => { |
||||
return request.postPut("oil-user/oilCompanyInfo/update", params); |
||||
}; |
||||
//认证信息保存
|
||||
const saveAttestation = (params) => { |
||||
return request.postJson("/oil-user/oilCompanyAuth/save", params); |
||||
}; |
||||
//认证信息修改
|
||||
const updateAttestation = (params) => { |
||||
return request.postPut("oil-user/oilCompanyAuth/update", params); |
||||
}; |
||||
//财务信息保存
|
||||
const saveFinance = (params) => { |
||||
return request.postJson("/oil-user/oilCompanyFinance/save", params); |
||||
}; |
||||
//财务信息修改
|
||||
const updateFinance = (params) => { |
||||
return request.postPut("oil-user/oilCompanyFinance/update", params); |
||||
}; |
||||
//企业负责人 远程搜索
|
||||
const liekQuery = (query) => { |
||||
return request.get(`/oil-user/sysCustomerInfo/liekQuery/${query}`); |
||||
}; |
||||
// 级联
|
||||
const getTree = () => { |
||||
return request.get("/oil-dict/areaCode/getTree"); |
||||
}; |
||||
export default { |
||||
getByPage, |
||||
getCompanyAccountRecord, |
||||
update, |
||||
liekQuery, |
||||
save, |
||||
getTree, |
||||
saveAttestation, |
||||
updateAttestation, |
||||
saveFinance, |
||||
updateFinance, |
||||
// getInfo,
|
||||
}; |
@ -0,0 +1,231 @@ |
||||
<template> |
||||
<el-dialog |
||||
:title="controlWindows.addInfo.title" |
||||
width="50%" |
||||
:visible.sync="controlWindows.add" |
||||
@opened="openDrawer" |
||||
:before-close="closeWindow" |
||||
> |
||||
<div class="add"> |
||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> |
||||
<el-row :gutter="2"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业名称" prop="name"> |
||||
<el-input v-model="form.name" placeholder="企业名称" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业简称" prop="abbreviaName"> |
||||
<el-input |
||||
v-model="form.abbreviaName" |
||||
placeholder="企业简称" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="公司级别" prop="parentMark"> |
||||
<el-select v-model="form.parentMark" placeholder="请选择"> |
||||
<el-option label="主体公司" :value="0" /> |
||||
<el-option label="分公司" :value="1" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col v-if="form.parentMark === 1" :span="12"> |
||||
<el-form-item label="上级公司" prop="parentId"> |
||||
<!-- 企业名称 --> |
||||
<autocomplete |
||||
class="mr20" |
||||
:params="form" |
||||
:config="configAutocomplete" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业性质" prop="companyNature"> |
||||
<el-select v-model="form.companyNature" placeholder="请选择"> |
||||
<el-option |
||||
v-for="(item, index) in companyNatureTypeEnum" |
||||
:key="index" |
||||
:label="item.label" |
||||
:value="+item.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="账户类型" prop="companyType"> |
||||
<el-select v-model="form.companyType" placeholder="请选择"> |
||||
<el-option label="油批账户" value="4" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业负责人" prop="businessLeader"> |
||||
<!-- 企业名称 --> |
||||
<autocomplete |
||||
class="mr20" |
||||
:params="form" |
||||
:config="configAutocompleteLeader" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="公司对接类型" prop="companyDockType"> |
||||
<el-select v-model="form.companyDockType" placeholder="请选择"> |
||||
<el-option label="对接客户" :value="0" /> |
||||
<el-option label="平台客户" :value="1" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-col :span="24" style="text-align: right"> |
||||
<el-button @click="closeWindow">取消</el-button> |
||||
<el-button type="primary" @click="submit">提交</el-button> |
||||
</el-col> |
||||
</el-form> |
||||
</div> |
||||
</el-dialog> |
||||
</template> |
||||
<script> |
||||
import serve from "api/customerManagement/companyManagement.js"; |
||||
import commonServe from "api/common.js"; |
||||
|
||||
import autocomplete from "components/autocomplete/index.vue"; |
||||
export default { |
||||
components: { |
||||
autocomplete, |
||||
}, |
||||
props: { |
||||
controlWindows: Object, |
||||
companyNatureTypeEnum: Array, |
||||
}, |
||||
data() { |
||||
let validatorParentId = (rule, value, callback) => { |
||||
if (this.form.parentId) callback(); |
||||
else callback("请选择企业"); |
||||
}; |
||||
return { |
||||
configAutocomplete: { |
||||
serveTarget: commonServe.getRefineryCompanyList, |
||||
autocompleteKey: "name", |
||||
labelKey: "name", |
||||
valueKey: "parentId", |
||||
placeholder: "上级公司", |
||||
querykey: "parentId", |
||||
echoId: "", |
||||
echoName: "", |
||||
}, |
||||
configAutocompleteLeader: { |
||||
serveTarget: serve.liekQuery, |
||||
labelKey: "nickName", |
||||
valueKey: "id", |
||||
placeholder: "企业负责人", |
||||
querykey: "businessLeader", |
||||
echoId: "", |
||||
echoName: "", |
||||
}, |
||||
form: {}, |
||||
rules: { |
||||
name: [ |
||||
{ required: true, message: "请输入企业名称", trigger: "blur" }, |
||||
{ |
||||
min: 3, |
||||
max: 50, |
||||
message: "长度在 3 到 50 个字符", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
abbreviaName: [ |
||||
{ |
||||
min: 1, |
||||
max: 50, |
||||
message: "长度在 1 到 50 个字符", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
parentMark: [ |
||||
{ required: true, message: "请选择是否主体公司", trigger: "change" }, |
||||
], |
||||
parentId: [ |
||||
{ required: true, validator: validatorParentId, trigger: "change" }, |
||||
], |
||||
companyNature: [ |
||||
{ required: true, message: "请选择企业性质", trigger: "change" }, |
||||
], |
||||
companyType: [ |
||||
{ required: true, message: "请选择账户类型", trigger: "change" }, |
||||
], |
||||
}, |
||||
}; |
||||
}, |
||||
created() {}, |
||||
methods: { |
||||
openDrawer() { |
||||
let { id } = this.controlWindows.addInfo; |
||||
if (id) { |
||||
//回显 |
||||
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); |
||||
} |
||||
// 上级公司 |
||||
let configUpdata = { |
||||
echoId: this.form.parentId || "", |
||||
echoName: this.form.name || "", |
||||
}; |
||||
// 企业负责人 |
||||
let configUpdataLeader = { |
||||
echoId: this.form.businessLeader || "", |
||||
echoName: this.form.businessLeader || "", |
||||
}; |
||||
Object.assign(this.configAutocomplete, configUpdata); |
||||
Object.assign(this.configAutocompleteLeader, configUpdataLeader); |
||||
}, |
||||
|
||||
submit() { |
||||
this.$refs["form"].validate((valid) => { |
||||
if (valid) { |
||||
let params = { |
||||
enableMark: 1, |
||||
auditMark: 0, |
||||
createSource: "REFINERY_OMS_WEB", |
||||
...this.form, |
||||
}; |
||||
this.judgeInterface(params).then((res) => { |
||||
if (res.code === 20000) { |
||||
this.$message.success(res.msg); |
||||
this.closeWindow(); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
judgeInterface(form) { |
||||
let { id } = this.controlWindows.addInfo; |
||||
if (id) return serve.update(form); |
||||
else return serve.save(form); |
||||
}, |
||||
|
||||
closeWindow() { |
||||
this.$emit("closeWindow"); |
||||
this.form = {}; |
||||
this.controlWindows.addInfo = {}; |
||||
this.$nextTick(() => { |
||||
this.$refs.form.clearValidate(); |
||||
this.controlWindows.add = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.add { |
||||
padding: 20px; |
||||
.el-input, |
||||
.el-select, |
||||
.el-textarea, |
||||
.el-autocomplete { |
||||
width: 230px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,297 @@ |
||||
<template> |
||||
<el-drawer |
||||
:title="controlWindows.addInfo.title" |
||||
direction="ltr" |
||||
size="50%" |
||||
:visible.sync="controlWindows.attestation" |
||||
@opened="openDrawer" |
||||
:before-close="closeWindow" |
||||
> |
||||
<div class="attestation"> |
||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> |
||||
<el-row :gutter="2"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业名称" prop="companyName"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.companyName" |
||||
placeholder="企业名称" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="注册省市区" prop="abbreviaName"> |
||||
<el-cascader |
||||
placeholder="注册省市区" |
||||
:options="areaTree" |
||||
:props="{ |
||||
value: 'id', |
||||
label: 'areaName', |
||||
children: 'childList', |
||||
}" |
||||
filterable |
||||
clearable |
||||
@change="changeAddress" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="详细地址" prop="address"> |
||||
<el-input |
||||
v-model="form.address" |
||||
clearable |
||||
placeholder="不包含省市区" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="注册资本" prop="registeredCapital"> |
||||
<el-input |
||||
v-model="form.registeredCapital" |
||||
clearable |
||||
placeholder="小写数字" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="经营资质" prop="businessQualia"> |
||||
<el-input |
||||
v-model="form.businessQualia" |
||||
clearable |
||||
placeholder="企业经营资质" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="联系方式" prop="contactPhone"> |
||||
<el-input |
||||
v-model="form.contactPhone" |
||||
clearable |
||||
placeholder="联系方式" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业网址" prop="website"> |
||||
<el-input |
||||
v-model="form.website" |
||||
clearable |
||||
placeholder="企业网址" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="营业执照号码" prop="businessLienceId"> |
||||
<el-input |
||||
v-model="form.businessLienceId" |
||||
clearable |
||||
placeholder="营业执照号码" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<!-- <el-col :span="24"> |
||||
<el-form-item label="营业执照照片" prop="businessLienceImg"> |
||||
<el-input |
||||
v-model="form.businessLienceId" |
||||
clearable |
||||
placeholder="营业执照号码" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> --> |
||||
<el-col :span="24"> |
||||
<el-form-item label="经营范围" prop="businessScope"> |
||||
<el-input |
||||
v-model="form.businessScope" |
||||
type="textarea" |
||||
clearable |
||||
placeholder="经营范围" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24"> |
||||
<el-form-item label="营业执照照片" prop="businessLienceImg"> |
||||
<el-upload |
||||
:action="uploadUrl" |
||||
:data="{ |
||||
ossKey: 'xingyou', |
||||
pathKey: 'other', |
||||
encrypt: 'PUBLIC', |
||||
code: 'A003', |
||||
}" |
||||
list-type="picture-card" |
||||
:on-preview="handlePictureCardPreview" |
||||
:on-remove="handleRemove" |
||||
:on-success="handleSuccess" |
||||
:before-upload="beforeHandle" |
||||
:limit="1" |
||||
:file-list="fileList" |
||||
> |
||||
<i class="el-icon-plus" /> |
||||
</el-upload> |
||||
<el-dialog :visible.sync="imgDialog" :modal="false"> |
||||
<img width="100%" :src="form.businessLienceImg" alt="" /> |
||||
</el-dialog> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
</div> |
||||
<div class="buttons"> |
||||
<el-button @click="closeWindow">取消 </el-button> |
||||
<el-button @click="submit">提交</el-button> |
||||
</div> |
||||
</el-drawer> |
||||
</template> |
||||
<script> |
||||
import serve from "api/customerManagement/companyManagement.js"; |
||||
import commonServe from "api/common.js"; |
||||
|
||||
import autocomplete from "components/autocomplete/index.vue"; |
||||
export default { |
||||
components: { |
||||
autocomplete, |
||||
}, |
||||
props: { |
||||
controlWindows: Object, |
||||
}, |
||||
data() { |
||||
let validatorParentId = (rule, value, callback) => { |
||||
if (this.form.parentId) callback(); |
||||
else callback("请选择企业"); |
||||
}; |
||||
return { |
||||
uploadUrl: |
||||
process.env.VUE_APP_ENV === "development" |
||||
? "/api/lsm/ocr/business" |
||||
: "/adminapi/oil-oss/obejct/uploadFile", |
||||
fileList: [], |
||||
imgDialog: false, |
||||
areaTree: [], |
||||
form: {}, |
||||
rules: { |
||||
parentMark: [ |
||||
{ required: true, message: "请选择是否主体公司", trigger: "change" }, |
||||
], |
||||
}, |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getTree(); |
||||
}, |
||||
methods: { |
||||
changeAddress(val) { |
||||
this.form.provinceCode = val[0] || ""; |
||||
this.form.cityCode = val[1] || ""; |
||||
this.form.areaCode = val[2] || ""; |
||||
}, |
||||
openDrawer() { |
||||
// this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); |
||||
let { auditMark, title, companyId } = this.controlWindows.addInfo; |
||||
if (auditMark != 0) { |
||||
//回显 |
||||
} else { |
||||
this.form = { auditMark, title, companyId }; |
||||
} |
||||
}, |
||||
|
||||
getTree() { |
||||
serve.getTree().then((res) => { |
||||
this.areaTree = res.data; |
||||
}); |
||||
}, |
||||
|
||||
submit() { |
||||
this.$refs["form"].validate((valid) => { |
||||
if (valid) { |
||||
let params = { |
||||
auditMark: this.form.auth ? 1 : 2, |
||||
...this.form, |
||||
}; |
||||
|
||||
this.judgeInterface(params).then((res) => { |
||||
this.$message.success(res.msg); |
||||
this.closeWindow(); |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
judgeInterface(form) { |
||||
let { auditMark } = this.controlWindows.addInfo; |
||||
if (auditMark != 0) return serve.updateAttestation(form); |
||||
else return serve.saveAttestation(form); |
||||
}, |
||||
beforeHandle(file) { |
||||
if (file.type.indexOf("image/") === -1) { |
||||
this.$message.error("上传的文件不是图片格式!"); |
||||
return false; |
||||
} else if (file.size / 1024 / 1024 > 5) { |
||||
this.$message.error("上传图片大小不能超过 5MB!"); |
||||
return false; |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
//img大图 |
||||
handlePictureCardPreview(file) { |
||||
this.form.businessLienceImg = file.url; |
||||
this.imgDialog = true; |
||||
}, |
||||
// img remove |
||||
handleRemove(file, fileList) { |
||||
this.form.businessLienceImg = ""; |
||||
}, |
||||
// 上传成功 |
||||
handleSuccess(response, file, fileList) { |
||||
if (response.code !== 20000) { |
||||
this.$message.error(response.msg); |
||||
this.fileList = []; |
||||
return; |
||||
} |
||||
console.log("response", response); |
||||
this.form.businessLienceImg = response.data.publicUrl; |
||||
}, |
||||
closeWindow() { |
||||
this.$emit("closeWindow"); |
||||
this.form = {}; |
||||
this.fileList = []; |
||||
this.controlWindows.addInfo = {}; |
||||
this.$nextTick(() => { |
||||
this.$refs.form.clearValidate(); |
||||
this.controlWindows.attestation = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.attestation { |
||||
padding: 20px; |
||||
.el-input, |
||||
.el-select, |
||||
.el-cascader, |
||||
.el-autocomplete { |
||||
width: 230px; |
||||
} |
||||
// .el-textarea { |
||||
// width: 100%; |
||||
// } |
||||
} |
||||
.buttons { |
||||
position: absolute; |
||||
left: 0; |
||||
bottom: 0; |
||||
padding-right: 40px; |
||||
width: 100%; |
||||
height: 80px; |
||||
line-height: 80px; |
||||
text-align: right; |
||||
border-top: 1px solid #f2f3f5; |
||||
.el-button { |
||||
text-align: right; |
||||
font-size: 14px; |
||||
border-radius: 5px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,273 @@ |
||||
<template> |
||||
<el-drawer |
||||
:title="controlWindows.addInfo.title" |
||||
direction="ltr" |
||||
size="50%" |
||||
:visible.sync="controlWindows.finance" |
||||
@opened="openDrawer" |
||||
:before-close="closeWindow" |
||||
> |
||||
<div class="finance"> |
||||
<el-form ref="form" :rules="rules" :model="form" label-width="160px"> |
||||
<el-row :gutter="2"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="结算方式" prop="settlementModes"> |
||||
<el-select |
||||
v-model="form.settlementModes" |
||||
style="width: 100%" |
||||
clearable |
||||
> |
||||
<el-option label="消费返利" :value="2" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="消费返利叠加费率" prop="consumptionRebate"> |
||||
<el-input |
||||
v-model="form.consumptionRebate" |
||||
placeholder="基于油站返利基础之上的返利金额" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="结账周期" prop="billingCycle"> |
||||
<el-input v-model="form.billingCycle" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="企业共享额度" prop="defaultShare"> |
||||
<el-select v-model="form.defaultShare" clearable> |
||||
<el-option label="共享" :value="1" /> |
||||
<el-option label="不共享" :value="0" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="默认单次额度上限" prop="defaultOnceUp"> |
||||
<el-input v-model="form.defaultOnceUp" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="默认单日加油额度上限" prop="defaultDayUp"> |
||||
<el-input v-model="form.defaultDayUp" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="折返策略" prop="consumRebateStrategy"> |
||||
<el-select v-model="form.consumRebateStrategy" clearable> |
||||
<el-option value="TYFL" label="统一费率" /> |
||||
<el-option value="TYSSFL" label="统一升数" /> |
||||
<el-option value="SITE_lEVEL" label="油站等级" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="折返比例" prop="contactPhone"> |
||||
<el-input |
||||
v-if=" |
||||
form.consumRebateStrategy == 'TYFL' || |
||||
form.consumRebateStrategy == 'TYSSFL' |
||||
" |
||||
v-model="form.consumRebateScale" |
||||
clearable |
||||
><template slot="append"> |
||||
{{ |
||||
form.consumRebateStrategy == "TYFL" |
||||
? "%" |
||||
: form.consumRebateStrategy == "TYSSFL" |
||||
? "元/L" |
||||
: "" |
||||
}} |
||||
</template></el-input |
||||
> |
||||
<template v-if="form.consumRebateStrategy === 'SITE_lEVEL'"> |
||||
<el-input v-checkNum v-model="siteConsumRebateScales[0]"> |
||||
<template slot="prepend">A:</template> |
||||
<template slot="append">%</template> |
||||
</el-input> |
||||
<el-input v-checkNum v-model="siteConsumRebateScales[1]"> |
||||
<template slot="prepend">B:</template> |
||||
<template slot="append">%</template> |
||||
</el-input> |
||||
<el-input v-checkNum v-model="siteConsumRebateScales[2]"> |
||||
<template slot="prepend">C:</template> |
||||
<template slot="append">%</template> |
||||
</el-input> |
||||
<el-input v-checkNum v-model="siteConsumRebateScales[3]"> |
||||
<template slot="prepend">D:</template> |
||||
<template slot="append">%</template> |
||||
</el-input> |
||||
</template> |
||||
</el-form-item> |
||||
</el-col> |
||||
<!-- <el-col v-if="form.consumRebateStrategy === 'SITE_lEVEL'" :span="12"> |
||||
|
||||
</el-col> --> |
||||
</el-row> |
||||
</el-form> |
||||
</div> |
||||
<div class="buttons"> |
||||
<el-button @click="closeWindow">取消 </el-button> |
||||
<el-button @click="submit">提交</el-button> |
||||
</div> |
||||
</el-drawer> |
||||
</template> |
||||
<script> |
||||
import serve from "api/customerManagement/companyManagement.js"; |
||||
import commonServe from "api/common.js"; |
||||
|
||||
import autocomplete from "components/autocomplete/index.vue"; |
||||
export default { |
||||
components: { |
||||
autocomplete, |
||||
}, |
||||
props: { |
||||
controlWindows: Object, |
||||
}, |
||||
data() { |
||||
let validatorParentId = (rule, value, callback) => { |
||||
if (this.form.parentId) callback(); |
||||
else callback("请选择企业"); |
||||
}; |
||||
return { |
||||
uploadUrl: |
||||
process.env.VUE_APP_ENV === "development" |
||||
? "/api/oil-oss/obejct/uploadFile" |
||||
: "/adminapi/oil-oss/obejct/uploadFile", |
||||
fileList: [], |
||||
imgDialog: false, |
||||
areaTree: [], |
||||
form: {}, |
||||
rules: { |
||||
parentMark: [ |
||||
{ required: true, message: "请选择是否主体公司", trigger: "change" }, |
||||
], |
||||
}, |
||||
siteConsumRebateScales: [3, 2, 1, 0], |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getTree(); |
||||
}, |
||||
methods: { |
||||
changeAddress(val) { |
||||
this.form.provinceCode = val[0] || ""; |
||||
this.form.cityCode = val[1] || ""; |
||||
this.form.areaCode = val[2] || ""; |
||||
}, |
||||
openDrawer() { |
||||
console.log("this.controlWindows.addInfo", this.controlWindows.addInfo); |
||||
let { currentType, companyId, id } = this.controlWindows.addInfo; |
||||
if (currentType === "update") { |
||||
//回显 |
||||
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); |
||||
} else { |
||||
this.form = { companyId: companyId || id }; |
||||
console.log(" this.form", this.form); |
||||
} |
||||
}, |
||||
|
||||
getTree() { |
||||
serve.getTree().then((res) => { |
||||
this.areaTree = res.data; |
||||
}); |
||||
}, |
||||
|
||||
submit() { |
||||
this.$refs["form"].validate((valid) => { |
||||
if (valid) { |
||||
if (this.form.consumRebateStrategy === "SITE_lEVEL") { |
||||
this.form.siteConsumRebateScales = [ |
||||
`A: ${this.siteConsumRebateScales[0]}`, |
||||
`B: ${this.siteConsumRebateScales[1]}`, |
||||
`C: ${this.siteConsumRebateScales[2]}`, |
||||
`D: ${this.siteConsumRebateScales[3]}`, |
||||
]; |
||||
} |
||||
this.judgeInterface(this.form).then((res) => { |
||||
this.$message.success(res.msg); |
||||
this.closeWindow(); |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
judgeInterface(form) { |
||||
let { currentType } = this.controlWindows.addInfo; |
||||
if (currentType === "update") return serve.updateFinance(form); |
||||
else return serve.saveFinance(form); |
||||
}, |
||||
beforeHandle(file) { |
||||
if (file.type.indexOf("image/") === -1) { |
||||
this.$message.error("上传的文件不是图片格式!"); |
||||
return false; |
||||
} else if (file.size / 1024 / 1024 > 5) { |
||||
this.$message.error("上传图片大小不能超过 5MB!"); |
||||
return false; |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
//img大图 |
||||
handlePictureCardPreview(file) { |
||||
this.form.businessLienceImg = file.url; |
||||
this.imgDialog = true; |
||||
}, |
||||
// img remove |
||||
handleRemove(file, fileList) { |
||||
this.form.businessLienceImg = ""; |
||||
}, |
||||
// 上传成功 |
||||
handleSuccess(response, file, fileList) { |
||||
if (response.code !== 20000) { |
||||
this.$message.error(response.msg); |
||||
this.fileList = []; |
||||
return; |
||||
} |
||||
console.log("response", response); |
||||
this.form.businessLienceImg = response.data.publicUrl; |
||||
}, |
||||
closeWindow() { |
||||
this.$emit("closeWindow"); |
||||
this.form = {}; |
||||
this.fileList = []; |
||||
this.controlWindows.addInfo = {}; |
||||
this.$nextTick(() => { |
||||
this.$refs.form.clearValidate(); |
||||
this.controlWindows.finance = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.finance { |
||||
padding: 20px; |
||||
.el-input, |
||||
.el-select, |
||||
.el-cascader, |
||||
.el-autocomplete { |
||||
width: 230px; |
||||
} |
||||
// .el-textarea { |
||||
// width: 100%; |
||||
// } |
||||
} |
||||
.buttons { |
||||
position: absolute; |
||||
left: 0; |
||||
bottom: 0; |
||||
padding-right: 40px; |
||||
width: 100%; |
||||
height: 80px; |
||||
line-height: 80px; |
||||
text-align: right; |
||||
border-top: 1px solid #f2f3f5; |
||||
.el-button { |
||||
text-align: right; |
||||
font-size: 14px; |
||||
border-radius: 5px; |
||||
} |
||||
} |
||||
</style> |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue