Merge branch 'xiaozy_产品列表' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin into xiaozy_产品列表

pull/1/head
xiaozhiyong 2 years ago
commit 39bfdfcd1c
  1. 219
      src/views/customerManagement/companyManagement/OilCompanyInfoUpdate.vue
  2. 31
      src/views/customerManagement/companyManagement/index.vue

@ -0,0 +1,219 @@
<template>
<div>
<el-row>
<el-form ref="form" :rules="rules" :model="updateOilCompanyInfo" label-width="100px" :size="$store.getters.size">
<el-row :gutter="gridNum.row.gutter">
<el-col :span="12">
<el-form-item label="企业名称" prop="name">
<el-input v-model="updateOilCompanyInfo.name" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业简称" prop="abbreviaName">
<el-input v-model="updateOilCompanyInfo.abbreviaName" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司级别" prop="parentMark">
<el-select v-model="updateOilCompanyInfo.parentMark" placeholder="请选择">
<el-option label="主体公司" :value="0" />
<el-option label="分公司" :value="1" />
</el-select>
</el-form-item>
</el-col>
<el-col v-if="updateOilCompanyInfo.parentMark === 1" :span="12">
<el-form-item label="上级公司" prop="parentId">
<el-select v-model="updateOilCompanyInfo.parentId" remote filterable :remote-method="companyOrginQuery" style="width: 100%" placeholder="请输入公司名称">
<el-option
v-for="item in queryCompanyList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业性质" prop="companyNature">
<el-select v-model="updateOilCompanyInfo.companyNature" placeholder="请选择">
<el-option label="零售客户" :value="0" />
<el-option label="外请客户" :value="1" />
<el-option label="渠道客户" :value="2" />
<el-option label="存量客户" :value="3" />
<el-option label="批发客户" :value="4" />
<el-option label="LNG客户" :value="5" />
<el-option label="推广业务" :value="6" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="账户类型" prop="companyType">
<el-select v-model="updateOilCompanyInfo.companyType" :disabled="updateOilCompanyInfo.auditMark === 1 ? true : false" placeholder="请选择">
<el-option label="柴油账户" value="0" />
<el-option label="LNG账户" value="2" />
<el-option label="汽油账户" value="1" />
<el-option label="尿素账户" value="3" />
<el-option label="油批账户" value="4" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业负责人" prop="businessLeader">
<el-select
v-model="updateOilCompanyInfo.businessLeader"
clearable
filterable
remote
reserve-keyword
placeholder="企业负责人姓名或联系方式"
:remote-method="userRemoteMethod"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.phone+'('+(item.nickName?item.nickName+'-':'')+item.userCode+')'"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司对接类型" prop="companyDockType">
<el-select v-model="updateOilCompanyInfo.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="close">取消</el-button>
<el-button
type="primary"
@click="submit"
>提交</el-button>
</el-col>
</el-form>
</el-row>
</div>
</template>
<script>
import oilCompanyInfoApi from '@/api/customerManagement/oilCompanyInfo'
import sysCustomerInfoApi from '@/api/user/sysCustomerInfo'
export default {
props: {
oilCompanyInfo: {
type: Object,
default() {
}
}
},
data() {
return {
queryCompanyList: [], //
updateOilCompanyInfo: {
id: undefined,
name: undefined,
abbreviaName: undefined,
parentMark: undefined,
parentId: undefined,
companyNature: undefined,
updateSource: 'WEBM',
businessLeader: ''
},
userList: [],
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' }
],
companyNature: [
{ required: true, message: '请选择企业性质', trigger: 'change' }
],
companyType: [
{ required: true, message: '请选择账户类型', trigger: 'change' }
],
parentId: [
{ required: true, message: '请选择上级公司', trigger: 'change' }
]
},
gridNum: {
row: {
gutter: 2
},
cols: {
xs: 24,
sm: 24,
md: 12,
lg: 12,
xl: 6
}
}
}
},
created() {
this.updateOilCompanyInfo = { ...this.oilCompanyInfo }
console.log('修改值')
console.log(this.updateOilCompanyInfo)
sysCustomerInfoApi.getByBusinessLeader(this.updateOilCompanyInfo.businessLeader).then(res => {
if (res && res.data != null) {
this.userList = [res.data]
} else {
this.userList = []
}
})
if (this.oilCompanyInfo.parentMark === 1) {
oilCompanyInfoApi.getLikeByName({ 'id': this.updateOilCompanyInfo.parentId }).then(res => {
this.queryCompanyList = res.data
})
}
},
methods: {
companyOrginQuery(value) { //
if (value) {
oilCompanyInfoApi.getLikeByNameAndId({ name: value, id: this.updateOilCompanyInfo.id }).then(res => {
this.queryCompanyList = res.data
})
}
},
userRemoteMethod(value) { //
if (value) {
sysCustomerInfoApi.liekQuery(value).then(res => {
this.userList = res.data
})
}
},
submit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.update(this.updateOilCompanyInfo)
}
})
},
update() {
if (this.updateOilCompanyInfo.parentMark === 0) {
this.updateOilCompanyInfo.parentId = 0
}
//
oilCompanyInfoApi.update(this.updateOilCompanyInfo).then(res => {
this.$message.success(res.msg)
this.$emit('closeDialog')
this.$emit('getByPage')
})
},
close() {
this.$emit('closeDialog')
}
}
}
</script>

@ -345,10 +345,8 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="toUpdate(scope.row.id)">
<el-button
v-permission="['company:info:base']"
:size="$store.getters.size"
type="text"
>
type="text">
<svg-icon icon-class="iconicon-" />
基础资料
</el-button>
@ -433,13 +431,19 @@
</general-details>
</el-drawer>
<!-- 修改弹窗 -->
<el-dialog v-el-drag-dialog title="修改" :visible.sync="updateDialog" width="55%">
<OilCompanyInfoUpdate v-if="updateDialog" :oil-company-info="oilCompanyInfo" @getByPage="getByPage" @closeDialog="closeDialog" />
</el-dialog>
<!-- 添加弹窗 -->
<el-dialog
v-el-drag-dialog
title="添加"
:visible.sync="addDialog"
width="55%"
>
width="55%">
<OilCompanyInfoAdd
v-if="addDialog"
@getByPage="getByPage"
@ -463,7 +467,7 @@
import OilCompanyInfoAdd from "@/views/customerManagement/companyManagement/OilCompanyInfoAdd";
import serve from "api/financialCenter/enterpriseRechargeDetails.js";
import commonServe from "api/common.js";
import OilCompanyInfoUpdate from "@/views/customerManagement/companyManagement/OilCompanyInfoUpdate";
import oilCompanyInfoApi from "@/api/customerManagement/oilCompanyInfo";
import autocomplete from "components/autocomplete/index.vue";
@ -478,6 +482,7 @@ import {
export default {
components: {
OilCompanyInfoUpdate,
OilCompanyInfoAdd,
pagination,
autocomplete,
@ -697,8 +702,6 @@ export default {
methods: {
search() {
this.parameter.currentPage = 1;
console.log("111111111111111111111");
console.log(this.parameter);
this.getByPage();
},
closeDialog() {
@ -752,7 +755,6 @@ export default {
// },
//
enableMarkClike(row) {
console.log("111111111111111111111");
const data = [row];
oilCompanyInfoApi.updateBatchEnable(data).then((res) => {
if (res.code === 20000) {
@ -825,6 +827,17 @@ export default {
this.oilCompanyInfo = {};
this.addDialog = true;
},
toUpdate(id) {
console.log(id)
console.log(this.updateDialog)
//
oilCompanyInfoApi.get(id).then(res => {
console.log(res)
this.oilCompanyInfo = res.data
this.updateDialog = true
console.log(this.updateDialog)
});
},
toAddAuth(id) {
//
oilCompanyInfoApi.get(id).then((res) => {

Loading…
Cancel
Save