Browse Source

完善中介人员、品牌管理

master
yunuo970428 3 years ago
parent
commit
988b4c7869
  1. 19
      anrui-base/anrui-base-ui/src/api/jichuxinxi/dictcommons.js
  2. 67
      anrui-base/anrui-base-ui/src/styles/el-form.scss
  3. 1
      anrui-base/anrui-base-ui/src/styles/index.scss
  4. 244
      anrui-base/anrui-base-ui/src/views/pinpai/pinpaiguanli/pinpaiAdd.vue
  5. 145
      anrui-base/anrui-base-ui/src/views/zhongjierenyuan/zhongjierenyuanAdd.vue

19
anrui-base/anrui-base-ui/src/api/jichuxinxi/dictcommons.js

@ -1,5 +1,4 @@
import request from '@/utils/request'
import qs from 'qs';
export function typeValues(data) {
return request({
@ -8,3 +7,21 @@ export function typeValues(data) {
params: data
})
}
// 获取经销商
export function getDistributors(data) {
return request({
url: '/base/v1/basedistributor/getDistributors',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 获取厂商--厂商分类为主机厂、使用组织为空
export function selectByZjcAndUseOrgIsNull() {
return request({
url: '/base/v1/basemanufacturer/selectByZjcAndUseOrgIsNull',
method: 'get'
})
}

67
anrui-base/anrui-base-ui/src/styles/el-form.scss

@ -0,0 +1,67 @@
.listconadd .title {
text-align: center;
font-size: 28px;
//line-height: 90px;
}
.listaddtop {
padding: 0 212px;
border-bottom: 2px solid #e0e3eb;
display: flex;
justify-content: space-between;
align-items: center;
line-height: 34px;
span {
padding: 0 15px;
}
}
.listconadd .demo-ruleForm {
padding: 22px 28px;
}
.el-collapse-item__header {
.el-icon-arrow-right:before {
content: "";
font-size: 20px;
}
}
.demo-ruleForm table {
width: 100%;
border-collapse: collapse;
border: 2px solid #e0e3eb;
border-spacing: 0;
//text-align: right;
td {
border-right: 2px solid #e0e3eb;
border-bottom: 2px solid #e0e3eb;
border-top: 2px solid #e0e3eb;
}
tr {
height: 40px;
}
.el-form-item {
display: inline-block;
}
.el-input {
display: inline-block;
}
}
.tleftb {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px !important;
font-weight: 600;
}
.icon {
color: #e84026;
margin-right: 4px;
}

1
anrui-base/anrui-base-ui/src/styles/index.scss

@ -7,6 +7,7 @@
@import './e-table.scss';
@import './element-table.scss';
@import './element-tabs.scss';
@import './el-form.scss';
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;

244
anrui-base/anrui-base-ui/src/views/pinpai/pinpaiguanli/pinpaiAdd.vue

@ -17,13 +17,13 @@
<el-col :span="12">
<el-form-item prop="brandCode">
<span slot="label">品牌编码</span>
<el-input v-model="temp.brandCode" maxlength="125" placeholder="" class="addinputw" clearable />
<el-input v-model="temp.brandCode" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="brandName">
<span slot="label">品牌名称</span>
<el-input v-model="temp.brandName" maxlength="125" placeholder="" class="addinputw" clearable />
<el-input v-model="temp.brandName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
@ -31,14 +31,14 @@
<el-col :span="12">
<el-form-item prop="brandShortName">
<span slot="label">品牌简称</span>
<el-input v-model="temp.brandShortName" maxlength="125" placeholder="" class="addinputw" clearable />
<el-input v-model="temp.brandShortName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="brandType">
<span slot="label">品牌类型</span>
<el-select v-model="temp.brandType" class="addinputw" placeholder="请选择品牌类型" @change="getleixing">
<el-option v-for="(item,index) in brand" :key="index" :label="item.dictValue" :value="item.dictKey" />
<el-option v-for="(item,index) in brand" :key="index" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
</el-col>
@ -48,7 +48,7 @@
<el-form-item prop="manufacturerSid">
<span slot="label">厂商名称</span>
<el-select v-model="temp.manufacturerSid" class="addinputw" filterable placeholder="请选择厂商名称">
<el-option v-for="item in supplierType" :key="item.sid" :label="item.manufacturerName" :value="item.sid" />
<el-option v-for="item in supplierType" :key="item.sid" :label="item.manufacturerName" :value="item.sid"/>
</el-select>
</el-form-item>
</el-col>
@ -56,7 +56,7 @@
<el-form-item prop="isValidity">
<span slot="label">是否有效</span>
<el-select v-model="temp.isValidity" class="addinputw" placeholder="请选择是否有效">
<el-option v-for="(item,index) in isValiditys" :key="index" :label="item.dictValue" :value="item.sid" />
<el-option v-for="(item,index) in isValiditys" :key="index" :label="item.dictValue" :value="item.sid"/>
</el-select>
</el-form-item>
</el-col>
@ -68,8 +68,6 @@
<el-select v-model="useOrgValue" multiple placeholder="请选择" filterable clearable class="addinputw" @change="getuseOrg">
<el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
<!-- <el-cascader v-model="useOrgArry" class="addinputw" @change="usrOrgArryChange" :options="options"-->
<!-- :props="props" />-->
</el-form-item>
</el-col>
</el-row>
@ -79,51 +77,19 @@
</template>
<script>
import {
details,
dictType,
getListOrg,
namesDown,
SaveList,
selectListOrg,
Update
} from '@/api/jichuxinxi/brandManagement'
import { details, dictType, getListOrg, SaveList, Update } from '@/api/jichuxinxi/brandManagement'
import { selectByZjcAndUseOrgIsNull } from '@/api/jichuxinxi/dictcommons'
export default {
name: 'PinpaiAdd',
data() {
var validCascader = (rule, value, callback) => {
if (this.useOrgArry.length == 0) {
callback(new Error('请填写使用组织'))
} else {
callback()
}
}
return {
// ---------
menuState: {
add: false, //
edit: false, //
delete: false, //
view: false, //
audit: false, //
input: false, //
output: false, //
upload: false, //
release: false //
},
viewTitle: '',
dataArr: [],
FormLoading: false,
listLoading: false,
temp: {}, //
useOrgArry: [],
useOrg_list: [], //
stateId: 0,
dialogFormVisible: false, //
dialogFormShowVisible: false, //
dialogStatus: '', //
fenzuOptions: [],
rules: {
brandCode: [{
required: true,
@ -149,18 +115,10 @@ export default {
required: true,
message: '请选择厂商名称',
trigger: 'blur'
}],
useOrgArry: [{
required: true,
validator: validCascader,
trigger: 'change'
}]
},
// brandType: null,
brandType: 'brandType',
brand: [],
modelValue: [],
modelValue2: [],
useOrgValue: [],
isValiditys: [{
dictValue: '是',
@ -171,43 +129,16 @@ export default {
sid: '2'
}
],
options: [],
useOrg: [],
props: {
value: 'sid',
label: 'name',
children: 'children',
// checkStrictly: true,
multiple: true
},
supplierType: []
// ------------------------------------
}
},
methods: {
init() {
this.stateId = this.$route.params.id
if (this.stateId !== '0') {
details(this.stateId).then((response) => {
if (response.code === '200') {
this.temp = response.data
// this.useOrgArry = response.data.useOrg
if (this.temp.useOrg.search(',') == '-1') {
this.useOrgValue = this.temp.useOrg.split(' ')
} else {
this.useOrgValue = this.temp.useOrg.split(',')
}
}
})
}
this.selectDict()
},
showAdd() {
this.dialogStatus = 'add'
this.viewTitle = '【新增】品牌管理信息'
this.stateId = 0
this.geTName()
this.getZuZhi()
this.getListOrgAll()
this.selectDict()
},
@ -220,7 +151,6 @@ export default {
if (response.code === '200') {
this.temp = response.data
this.temp.sid = sid
// this.useOrgArry = response.data.useOrg
if (this.temp.useOrg.search(',') == '-1') {
this.useOrgValue = this.temp.useOrg.split(' ')
} else {
@ -229,7 +159,6 @@ export default {
}
})
this.geTName()
this.getZuZhi()
this.getListOrgAll()
this.selectDict()
},
@ -239,13 +168,8 @@ export default {
if (isreload === 'true') this.$emit('reloadlist')
this.temp = {}
this.useOrgValue = ''
this.useOrgArry = []
// this.$router.go(-1)
this.$emit('doback')
},
// handleReturn() {
// this.$router.go(-1)
// },
//
getListOrgAll() {
getListOrg().then((res) => {
@ -254,22 +178,6 @@ export default {
}
})
},
// // N
// getListOrgAll() {
// const userSid = window.sessionStorage.getItem('userSid')
// getUseOrgByUserSid({userSid: userSid}).then((res) => {
// if (res.success) {
// this.getListOrgAll0(res.data.sid)
// }
// })
// },
// getListOrgAll0(useOrgSid) {
// getListOrg({sid: useOrgSid}).then((res) => {
// if (res.success) {
// this.useOrg_list = res.data
// }
// })
// },
getuseOrg(val) {
var choosetItem = []
val.forEach((ele) => {
@ -285,98 +193,20 @@ export default {
},
selectDict() {
dictType({
psid: 0,
type: 'brandType'
}).then((response) => {
if (response.code === '200') {
dictType({ psid: 0, type: 'brandType' }).then((response) => {
if (response.success) {
this.brand = response.data
}
})
},
usrOrgArryChange(e) {
console.log('选中结果:' + JSON.stringify(e))
var result = ''
if (e.length > 0) {
//
e.forEach((item) => {
var last_id = item[item.length - 1]
// console.log('options'+JSON.stringify(this.options))
//
this.select_temp = '' //
this.findOrgId(last_id, this.options)
result = result + this.select_temp + ','
})
}
if (result !== '') {
result = result.substring(0, result.length - 1)
}
this.temp.useOrgName = result
console.log('选中名称:' + this.temp.useOrgName)
},
// ---
findOrgId(id, options) {
for (var i = 0; i < options.length; i++) {
if (id == options[i].sid) {
this.select_temp = options[i].name //
return true
} else {
//
if (options[i].children !== undefined) {
//
if (this.findOrgId(id, options[i].children)) {
return true
}
}
}
}
},
//
getZuZhi() {
selectListOrg().then((res) => {
// console.log('res++++', res)
if (res.code === '200') {
this.options = res.data
this.zuzhi0(this.options)
console.log(this.options, 8888888)
}
})
},
zuzhi0(data) {
data.forEach((e) => {
if (e.children) {
if (e.children.length != 0) {
this.zuzhi0(e.children)
} else {
delete e.children
this.dataArr.push(e)
return
}
}
})
},
//
geTName() {
namesDown({
name: ''
}).then((res) => {
if (res.code === '200') {
selectByZjcAndUseOrgIsNull().then((res) => {
if (res.success) {
this.supplierType = res.data
}
})
},
//
resetTemp() {
this.useOrg = []
this.temp = {
useOrg: '',
brandCode: '',
brandName: '',
brandType: '',
isValidity: '',
manufacturerSid: ''
}
},
//
handleCreate() {
console.log('已选择的组织', this.useOrgValue)
@ -385,41 +215,6 @@ export default {
this.FormLoading = true
this.dialogStatus = 'create'
if (this.stateId === 0) {
// if (this.temp.useOrg instanceof Array) {
// let useOrg2 = ''
// if (this.temp.useOrg.length === 1) {
// console.log(this.temp.useOrg[0].toString(), 111111)
// useOrg2 = this.temp.useOrg[0].toString()
// } else {
// const abc = []
// this.temp.useOrg.forEach((e) => {
// abc.push(e[e.length - 1])
// })
// useOrg2 = abc.toString()
// console.log(abc.toString(), 222222222)
// }
// this.temp.useOrg = useOrg2
// }
// if (this.temp.useOrg instanceof Array) {
// let useOrg2 = ''
// const abc = []
// this.temp.useOrg.forEach((e) => {
// abc.push(e[e.length - 1])
// })
// console.log(abc, 222222222)
// useOrg2 = abc.toString()
// this.useOrgArry = useOrg2
// }
// if (this.useOrgArry) {
// var abc = []
// this.useOrgArry.forEach((e) => {
// console.log('77777777', e)
// abc.push(e[e.length - 1])
// })
// this.temp.useOrg = abc.toString()
// console.log('abcabc', this.temp.useOrg)
// }
console.log(123456789, this.temp)
SaveList(this.temp).then((response) => {
console.log(123)
@ -437,15 +232,6 @@ export default {
}
})
} else {
// if (this.useOrgArry) {
// var abc = []
// this.useOrgArry.forEach((e) => {
// console.log('77777777', e)
// abc.push(e[e.length - 1])
// })
// this.temp.useOrg = abc.toString()
// console.log('abcabc', this.temp.useOrg)
// }
Update(this.temp).then((response) => {
console.log('返回值:', response)
this.FormLoading = false
@ -480,10 +266,10 @@ export default {
console.log(this.temp.brandTypeValue, '结算币种value')
}
}
}
}
</script>
<style scoped>
.addinputw {
.addinputw {
width: 80% !important;
}
}
</style>

145
anrui-base/anrui-base-ui/src/views/zhongjierenyuan/zhongjierenyuanAdd.vue

@ -10,7 +10,7 @@
<div class="listconadd">
<el-form ref="dataForm" :model="temp" label-position="right" class="formadd" :rules="rules">
<el-row style="border-top: 1px solid #e0e3eb;">
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>姓名</span>
</el-col>
<el-col :span="9">
@ -18,7 +18,7 @@
<el-input v-model="temp.name" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>手机号码</span>
</el-col>
<el-col :span="9">
@ -28,7 +28,7 @@
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>开户行</span>
</el-col>
<el-col :span="9">
@ -36,28 +36,29 @@
<el-input v-model="temp.bankName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>银行账号</span>
</el-col>
<el-col :span="9">
<el-form-item>
<el-input v-model="temp.bankAccount" maxlength="20" placeholder="" class="addinputw" clearable
oninput="value=value.replace(/[^\d]/g,'')"/>
<el-input v-model="temp.bankAccount" maxlength="20" placeholder="" class="addinputw" clearable oninput="value=value.replace(/[^\d]/g,'')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>所在单位</span>
</el-col>
<el-col :span="21">
<el-form-item>
<el-input v-model="temp.company" placeholder="" clearable class="filter-item"/>
<el-select v-model="temp.company" placeholder="请选择" filterable clearable class="addinputw" @change="companyChange">
<el-option v-for="item in company_list" :key="item.sid" :label="item.name" :value="item.name"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<el-col :span="3" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="21">
@ -73,21 +74,21 @@
<script>
import { save, details } from '@/api/business/intermediaryPerson.js'
import {typeValues} from "@/api/jichuxinxi/dictcommons"
import { getDistributors } from '@/api/jichuxinxi/dictcommons'
export default {
name: "zhongjierenyuanAdd",
name: 'zhongjierenyuanAdd',
data() {
var checkMobile = (rule, value, callback) => {
const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (value) {
//
if (!mobile.test(value)) {
callback(new Error("请输入正确的手机号码"));
callback(new Error('请输入正确的手机号码'))
}
callback();
callback()
} else {
callback();
callback()
}
}
return {
@ -95,47 +96,43 @@ export default {
// ---------
sid: '',
stateId: 0,
kuwei_list: [],
createBtn:false,
company_list: [],
createBtn: false,
temp: {
bankAccount:'', //
bankName:'', //
company:'', //
createBySid:'', // sid
mobile:'', //
name:'', //
remarks:'',
sid:''
bankAccount: '', //
bankName: '', //
company: '', //
companySid: '',
createBySid: '', // sid
mobile: '', //
name: '', //
remarks: '',
sid: ''
}, //
rules: {
mobile: [{ required: true, validator: checkMobile, trigger: 'blur' }],
mobile: [{ required: true, validator: checkMobile, trigger: 'blur' }]
}
// ------------------------------------
}
},
methods: {
getType() {
// typeValues({
// type: ''
// }).then((res) => {
// if (res.code === '200') {
// this.kuwei_list = res.data
// console.log('', this.kuwei_list)
// }
// })
init() {
getDistributors({ orgName: window.sessionStorage.getItem('Orgname'), userSid: window.sessionStorage.getItem('userSid'), orgPath: window.sessionStorage.getItem('orgSidPath') }).then((resp) => {
if (resp.success) {
this.company_list = resp.data
}
})
},
//
showAdd() {
this.init()
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
this.dialogStatus = 'add'
this.temp.createBySid = window.sessionStorage.getItem('userSid')
this.viewTitle = '【新增】中介人员'
this.getType()
},
showEdit(sid) {
this.init()
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
@ -148,7 +145,18 @@ export default {
this.temp = response.data
}
})
this.getType()
},
companyChange(value) {
let bb = null
this.company_list.forEach((e) => {
if (e.name === value) {
bb = {
name: e.name,
sid: e.sid
}
}
})
this.temp.companySid = bb.sid
},
//
handleCreate() {
@ -165,7 +173,7 @@ export default {
showClose: true,
message: '添加失败!',
type: 'error'
});
})
}
})
}
@ -175,15 +183,16 @@ export default {
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.temp = {
bankAccount:'', //
bankName:'', //
company:'', //
createBySid:'', // sid
mobile:'', //
name:'', //
remarks:'',
sid:''
},
bankAccount: '', //
bankName: '', //
company: '', //
companySid: '',
createBySid: '', // sid
mobile: '', //
name: '', //
remarks: '',
sid: ''
}
this.$emit('doback')
}
}
@ -191,40 +200,4 @@ export default {
</script>
<style scoped>
/deep/ .el-autocomplete {
width: 80%;
}
.listconadd {
width: 100%;
padding: 110px 260px 0 260px !important;
}
.title {
padding: 28px 0;
}
.formadd .title {
padding: 10px !important;
}
.yancheAdd .el-row {
border: 0 !important;
}
.yancheAdd .el-col {
border: 0 !important;
}
/deep/ .el-col-3 {
text-align: right;
float: left;
font-size: 14px;
color: #606266;
line-height: 40px !important;
font-weight: 600;
}
.filter-item{
width: 93%;
}
</style>

Loading…
Cancel
Save