Browse Source

供应商管理

master
yunuo970428 3 years ago
parent
commit
40fb7cc38b
  1. 10
      anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js
  2. 47
      anrui-scm/anrui-scm-ui/src/api/gongyingshang/gongyingshang.js
  3. 15
      anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js
  4. 433
      anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshangAdd.vue
  5. 210
      anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshangInfo.vue
  6. 341
      anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshanggaunli.vue
  7. 231
      anrui-scm/anrui-scm-ui/src/views/gongyingshang/relation/gongyingshangBank.vue

10
anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js

@ -26,6 +26,16 @@ export function getListOrg(data) {
})
}
// 获取厂商
export function getNamesDownes(data) {
return request({
url: '/base/v1/basemanufacturer/namesDown',
method: 'get',
params: data,
data: qs.stringify(data),
})
}
// 根据登陆人sid查询分公司 (孟哲写的接口)
export function getPathSidByUserSid(data) {
return request({

47
anrui-scm/anrui-scm-ui/src/api/gongyingshang/gongyingshang.js

@ -0,0 +1,47 @@
import request from '@/utils/request'
import qs from 'qs'
export default {
// 查询分页列表
gysPagerList: function(params) {
return request({
url: '/base/v1/basemanufacturer/gysPagerList',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 保存修改记录
save: function(params) {
return request({
url: '/base/v1/basemanufacturer/save',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 保存修改记录
update: function(params, sid) {
return request({
url: '/base/v1/basemanufacturer/update/' + sid,
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 通过sid查询一条记录
fetchBySid: function(sid) {
return request({
url: '/base/v1/basemanufacturer/details/' + sid,
method: 'get'
})
},
// 通过sid删除一条或多条记录
delBySids: function(data) {
return request({
url: '/base/v1/basemanufacturer/deleteBySids?sids=' + data,
method: 'DELETE',
data: qs.stringify(data)
})
}
}

15
anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js

@ -613,6 +613,21 @@ const codemenu = [
meta: { title: '验车检查项目管理', noCache: true }
}]
},
// 车辆检查
{
path: '/gongyingshang',
component: Layout,
redirect: '/gongyingshang',
meta: {
title: '供应商管理'
},
children: [{
path: '/gongyingshang',
component: () => import('@/views/gongyingshang/gongyingshanggaunli.vue'),
name: 'gongyingshanggaunli',
meta: { title: '供应商管理', noCache: true }
}]
},
// 流程审批
// 入账管理编辑

433
anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshangAdd.vue

@ -0,0 +1,433 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveEdit()">保存
</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="baseManufacturerDto" :rules="rules" class="formadd">
<div class="title">
<div>基本信息</div>
</div>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>厂商名称</span>
</el-col>
<el-col :span="8">
<el-form-item prop="manufacturerName">
<el-input v-model="baseManufacturerDto.manufacturerName" maxlength="20" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>简称</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="baseManufacturerDto.manufacturerAs" maxlength="20" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>编码</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="baseManufacturerDto.manufacturerCode" maxlength="20" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>分类</span>
</el-col>
<el-col :span="8">
<el-form-item prop="supplierTypeValue">
<el-select v-model="baseManufacturerDto.supplierTypeValue" class="addinputw" placeholder="" @change="changeSupplierType">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue" :disabled="item.dictValue === '主机厂'"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>通讯地址</span>
</el-col>
<el-col :span="20">
<el-form-item prop="manufacturerAddress">
<el-input v-model="baseManufacturerDto.manufacturerAddress" maxlength="80" placeholder="" class="addinputw addinputw01"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>厂商办公电话</span>
</el-col>
<el-col :span="8">
<el-form-item prop="manufacturerTelePhone">
<el-input v-model="baseManufacturerDto.manufacturerTelePhone" maxlength="20" placeholder="例:010-88888888" class="addinputw"
clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>传真</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="baseManufacturerDto.manufacturerFax" maxlength="20" placeholder="例:010-88888888" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人姓名</span>
</el-col>
<el-col :span="8">
<el-form-item prop="contactName">
<el-input v-model="baseManufacturerDto.contactName" maxlength="5" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人手机号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="contactMobile">
<el-input v-model="baseManufacturerDto.contactMobile" maxlength="11" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>联系人办公电话</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="baseManufacturerDto.contactTelePhone" maxlength="14" placeholder="例:010-88888888" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>微信号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="weChatID">
<el-input v-model="baseManufacturerDto.weChatID" maxlength="100" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>邮编</span>
</el-col>
<el-col :span="8">
<el-form-item prop="">
<el-input v-model="baseManufacturerDto.zipCode" maxlength="20" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>邮箱</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="baseManufacturerDto.email" maxlength="20" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<div class="divStyle">
<div>开户行信息</div>
<div>
<el-button type="primary" size="mini" icon="el-icon-plus" class="btntopblueline" @click="addBank()">新增
</el-button>
</div>
</div>
<el-table :key="tableKey" :data="baseManufacturerBankDto" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column fixed label="操作" align="center" width="130px">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="handleDel(baseManufacturerBankDto[scope.$index])">删除</el-button>
<el-button size="mini" type="primary" @click="handleEdit(baseManufacturerBankDto[scope.$index],scope.$index)">编辑
</el-button>
</template>
</el-table-column>
<el-table-column prop="dueBankValue" width="140px" label="账户类型" align="center"/>
<el-table-column prop="depositBank" width="180px" label="开户银行" align="center"/>
<el-table-column prop="bankAccount" width="160px" label="银行账号" align="center"/>
<el-table-column prop="accountName" width="130px" label="账号名称" align="center"/>
<el-table-column prop="bankingOutlets" width="180px" label="银行网点" align="center"/>
<el-table-column prop="bankAddress" width="260px" label="开户行地址" align="center"/>
<el-table-column prop="paymentLines" width="160px" label="联行号" align="center"/>
<el-table-column prop="swiftCode" width="200px" label="swiftcode(银行代码)" align="center"/>
<el-table-column prop="currency" width="130px" label="币种" align="center"/>
<el-table-column prop="remarks" width="240px" label="描述" align="center"/>
</el-table>
</el-form>
</div>
</div>
<gongyingshangBank v-show="viewState == 2 || viewState == 3" ref="divBank" @doback="resetState" @handleBank="backData"/>
</div>
</template>
<script>
import req from '@/api/gongyingshang/gongyingshang'
import { typeValues } from '@/api/cheliang/dictcommons'
import gongyingshangBank from './relation/gongyingshangBank'
export default {
name: 'gongyingshangAdd',
components: {
gongyingshangBank
},
data() {
var checkSubmit = (rule, value, callback) => {
const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (Submit.test(value)) {
return callback()
}
callback(new Error('请输入手机号'))
}
var checkChuanzhen = (rule, value, callback) => {
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/
if (value) {
//
if (!BanGongDianHua.test(value)) {
callback(new Error('请输入正确的传真格式'))
}
callback()
} else {
callback()
}
}
var checkBanGongDianHua = (rule, value, callback) => {
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/
if (BanGongDianHua.test(value)) {
return callback()
}
callback(new Error('请输入办公电话'))
}
return {
tableKey: 0,
index: 0,
viewState: 1,
viewTitle: '',
dialogStatus: '',
sid: '',
supplierType_list: [],
baseManufacturerDto: {
manufacturerName: '',
manufacturerAs: '',
manufacturerCode: '',
supplierType: '',
supplierTypeValue: '',
manufacturerAddress: '',
manufacturerTelePhone: '',
manufacturerFax: '',
contactName: '',
contactMobile: '',
contactTelePhone: '',
weChatID: '',
zipCode: '',
email: '',
createOrg: '',
useOrg: ''
},
baseManufacturerBankDto: [],
rules: {
manufacturerName: [{
required: true,
message: '请填写厂商名称',
trigger: 'blur'
}],
supplierTypeValue: [{
required: true,
message: '请选择分类',
trigger: 'change'
}],
manufacturerAddress: [{
required: true,
message: '请填写厂商通讯地址',
trigger: 'blur'
}],
manufacturerTelePhone: [{
required: true,
validator: checkBanGongDianHua,
trigger: 'blur'
}],
manufacturerFax: [{
required: true,
validator: checkChuanzhen,
trigger: 'blur'
}],
contactName: [{
required: true,
message: '请填写联系人名字',
trigger: 'blur'
}],
contactMobile: [{
required: true,
validator: checkSubmit,
trigger: 'blur'
}]
},
submitdisabled: false
}
},
methods: {
init() {
typeValues({ type: 'supplierType' }).then((res) => {
if (res.success) {
this.supplierType_list = res.data
}
})
},
changeSupplierType(value) {
let bb = null
this.supplierType_list.forEach((e) => {
if (e.dictValue === value) {
bb = {
key: e.dictKey,
value: e.dictValue
}
}
})
this.baseManufacturerDto.supplierType = bb.key
},
addBank() {
this.viewState = 2
this.$refs['divBank'].showAdd()
},
backData(info, index) {
this.viewState = 1
if (index === '') {
this.baseManufacturerBankDto.push({
country: info.country,
dueBankValue: info.dueBankValue,
dueBankKey: info.dueBankKey,
depositBank: info.depositBank,
bankAccount: info.bankAccount,
accountName: info.accountName,
bankingOutlets: info.bankingOutlets,
bankAddress: info.bankAddress,
paymentLines: info.paymentLines,
swiftCode: info.swiftCode,
currency: info.currency,
remarks: info.remarks
})
return
}
if (index >= 0) {
this.baseManufacturerBankDto[index] = {
country: info.country,
dueBankValue: info.dueBankValue,
dueBankKey: info.dueBankKey,
depositBank: info.depositBank,
bankAccount: info.bankAccount,
accountName: info.accountName,
bankingOutlets: info.bankingOutlets,
bankAddress: info.bankAddress,
paymentLines: info.paymentLines,
swiftCode: info.swiftCode,
currency: info.currency,
remarks: info.remarks
}
return
}
},
handleDel(index) {
this.baseManufacturerBankDto.splice(this.baseManufacturerBankDto.indexOf(index), 1)
},
handleEdit(row, index) {
this.viewState = 3
const bankInfo = row
this.$refs['divBank'].showEdit(bankInfo, index)
},
showAdd(createOrgSid) {
this.init()
this.dialogStatus = 'add'
this.viewTitle = '【新增】供应商'
this.baseManufacturerDto.createOrg = createOrgSid
this.baseManufacturerDto.useOrg = createOrgSid
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.dialogStatus = 'edit'
req.fetchBySid(row.sid).then(resp => {
this.sid = row.sid
this.baseManufacturerDto = resp.data.baseManufacturerDto
this.baseManufacturerBankDto = resp.data.baseManufacturerBankDto
}).catch(e => {
this.formobj = row
})
},
saveEdit() {
this.$refs['form_obj'].validate(valid => {
if (valid) {
this.submitdisabled = true
const formobj = {
baseManufacturerBankDto: this.baseManufacturerBankDto,
baseManufacturerDto: this.baseManufacturerDto
}
if (this.dialogStatus === 'add') {
req.save(formobj).then(resp => {
this.submitdisabled = false
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else if (this.dialogStatus === 'edit') {
req.update(formobj, this.sid).then(resp => {
this.submitdisabled = false
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
}
} else {
return false
}
})
},
handleLook(sid) {
this.viewState = 2
this.$refs['divPaiChan'].showInfo(sid)
},
resetState() {
this.viewState = 1
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.dialogStatus = ''
this.sid = ''
this.baseManufacturerDto = {}
this.baseManufacturerBankDto = []
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.divStyle {
padding: 7px;
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
text-align: left;
color: #ffffff;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>

210
anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshangInfo.vue

@ -0,0 +1,210 @@
<template>
<div class="app-container">
<div>
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="baseManufacturerDto" :rules="rules" class="formadd">
<div class="title">
<div>基本信息</div>
</div>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>厂商名称</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerName }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>简称</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerAs }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>编码</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerCode }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>分类</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.supplierTypeValue }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>通讯地址</span>
</el-col>
<el-col :span="20">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerAddress }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>厂商办公电话</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerTelePhone }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>传真</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.manufacturerFax }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人姓名</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.contactName }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人手机号</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.contactMobile }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>联系人办公电话</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.contactTelePhone }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>微信号</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.weChatID }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>邮编</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.zipCode }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>邮箱</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ baseManufacturerDto.email }}</span>
</el-form-item>
</el-col>
</el-row>
<div class="title">
<div>开户行信息</div>
</div>
<el-table :key="tableKey" :data="baseManufacturerBankDto" :index="index" border style="width: 100%">
<el-table-column fixed width="60px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="dueBankValue" width="140px" label="账户类型" align="center"/>
<el-table-column prop="depositBank" width="180px" label="开户银行" align="center"/>
<el-table-column prop="bankAccount" width="160px" label="银行账号" align="center"/>
<el-table-column prop="accountName" width="130px" label="账号名称" align="center"/>
<el-table-column prop="bankingOutlets" width="180px" label="银行网点" align="center"/>
<el-table-column prop="bankAddress" width="260px" label="开户行地址" align="center"/>
<el-table-column prop="paymentLines" width="160px" label="联行号" align="center"/>
<el-table-column prop="swiftCode" width="200px" label="swiftcode(银行代码)" align="center"/>
<el-table-column prop="currency" width="130px" label="币种" align="center"/>
<el-table-column prop="remarks" width="240px" label="描述" align="center"/>
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/gongyingshang/gongyingshang'
export default {
name: 'gongyingshangInfo',
data() {
return {
tableKey: 0,
index: 0,
viewTitle: '',
supplierType_list: [],
baseManufacturerDto: {
manufacturerName: '',
manufacturerAs: '',
manufacturerCode: '',
supplierType: '',
supplierTypeValue: '',
manufacturerAddress: '',
manufacturerTelePhone: '',
manufacturerFax: '',
contactName: '',
contactMobile: '',
contactTelePhone: '',
weChatID: '',
zipCode: '',
email: '',
createOrg: '',
useOrg: ''
},
baseManufacturerBankDto: [],
rules: {},
submitdisabled: false
}
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '供应商详情'
req.fetchBySid(row.sid).then(resp => {
this.baseManufacturerDto = resp.data.baseManufacturerDto
this.baseManufacturerBankDto = resp.data.baseManufacturerBankDto
}).catch(e => {
this.formobj = row
})
},
handleReturn() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

341
anrui-scm/anrui-scm-ui/src/views/gongyingshang/gongyingshanggaunli.vue

@ -0,0 +1,341 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar view-title="供应商管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header">
<el-form-item label="厂商名称">
<el-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="厂商分类">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择厂商分类">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" :disabled="item.dictValue === '主机厂'"/>
</el-select>
</el-form-item>
<el-form-item label="厂商办公电话">
<el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/>
</el-form-item>
<el-form-item label="联系人">
<el-input v-model="listQuery.params.contactName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-form>
<div class="btn">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">供应商信息列表</div>
<!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center"/>
<el-table-column label="操作" fixed align="center" width="90px" class-name="small-padding fixed-width">
<template slot-scope="{row}">
<el-button size="mini" type="primary" @click="handleEdit(row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column prop="jc" label="厂商名称" width="220" header-align="center" align="left">
<template slot-scope="scope">
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.manufacturerName }}</span>
</template>
</el-table-column>
<el-table-column label="厂商分类" width="110" align="center">
<template slot-scope="scope">
<span>{{ scope.row.supplierTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="厂商通讯地址" width="" header-align="center" align="left">
<template slot-scope="scope">
<span>{{ scope.row.manufacturerAddress }}</span>
</template>
</el-table-column>
<el-table-column label="厂商办公电话" width="180" align="center">
<template slot-scope="scope">
<span>{{ scope.row.manufacturerTelePhone }}</span>
</template>
</el-table-column>
<el-table-column label="联系人姓名" width="120" align="center">
<template slot-scope="scope">
<span>{{ scope.row.contactName }}</span>
</template>
</el-table-column>
<el-table-column label="联系人手机号码" width="140" align="center">
<template slot-scope="scope">
<span>{{ scope.row.contactMobile }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<gongyingshangAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="handleFilter"/>
<gongyingshangInfo v-show="viewState == 4" ref="divinfo" @doback="resetState"/>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { typeValues, getPathSidByUserSid } from '@/api/cheliang/dictcommons'
import gongyingshangAdd from './gongyingshangAdd'
import gongyingshangInfo from './gongyingshangInfo'
import req from '@/api/gongyingshang/gongyingshang'
export default {
name: 'gongyingshangguanli',
components: {
Pagination,
pageye,
ButtonBar,
gongyingshangAdd,
gongyingshangInfo
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
viewState: 1,
isSearchShow: false,
searchxianshitit: '显示查询条件',
sids: [],
// -----------
tableKey: 0,
list: [],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 0
},
supplierType_list: [],
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
this.init()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
init() {
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
this.listQuery.params.createOrgSid = res.data
this.getType()
this.getList()
}
})
},
getType() {
typeValues({
type: 'supplierType'
}).then((res) => {
if (res.code === '200') {
this.supplierType_list = res.data
console.log('厂商分类', this.supplierType_list)
}
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
req.gysPagerList(this.listQuery).then((response) => {
this.listLoading = false
if (response.code === '200' && response.data && response.data.total > 0) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5
}
this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
},
// ID
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.delBySids(this.sids.toString()).then(resp => {
if (resp.success) {
loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList()
} else {
loading.close()
}
}).catch(e => {
loading.close()
})
}).catch(() => {
})
} else {
this.$message({ type: 'error', message: '没有选择厂商!!', showClose: true })
return
}
},
handleEdit(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
//
handleCheck(row) {
this.viewState = 4
this.$refs['divinfo'].showInfo(row)
},
//
// doExport() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel'
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// duration: 2000
// })
// })
// },
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>

231
anrui-scm/anrui-scm-ui/src/views/gongyingshang/relation/gongyingshangBank.vue

@ -0,0 +1,231 @@
<template>
<div class="app-container">
<div class="tab-header webtop">
<div>
<div>{{ viewTitle }}</div>
</div>
<div>
<el-button type="primary" size="small" @click="handleCreate()">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="bankInfo" class="formadd" :rules="rules">
<el-row style="border-top: 1px solid #e0e3eb ">
<el-col :span="4" class="tleftb">
<span>国家</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="bankInfo.country" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>账户类型</span>
</el-col>
<el-col :span="8">
<el-form-item prop="dueBank"> <!--dueBankKey dueBankValue-->
<el-select v-model="bankInfo.dueBankValue" class="addinputw" placeholder="" @change="receiptBankChange">
<el-option v-for="item in receiptBank_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>开户银行</span>
</el-col>
<el-col :span="8">
<el-form-item prop="depositBank">
<el-input v-model="bankInfo.depositBank" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>银行账号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="bankAccount">
<!--@keyup.native="bankInfo.bankAccount = oninput(bankInfo.bankAccount,2)"-->
<el-input v-model="bankInfo.bankAccount" maxlength="125" placeholder="" class="addinputw" clearable
onkeyup="value=value.replace(/[^\d]/g,'')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>账户名称</span>
</el-col>
<el-col :span="8">
<el-form-item prop="accountName">
<el-input v-model="bankInfo.accountName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>银行网点</span>
</el-col>
<el-col :span="8">
<el-form-item prop="bankingOutlets">
<el-input v-model="bankInfo.bankingOutlets" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>开户行地址</span>
</el-col>
<el-col :span="8">
<el-form-item prop="bankAddress">
<el-input v-model="bankInfo.bankAddress" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>联行号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="paymentLines">
<el-input v-model="bankInfo.paymentLines" maxlength="125" placeholder="" class="addinputw" clearable
onkeyup="value=value.replace(/[^\d]/g,'')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>Swiftcode(银行代码)</span>
</el-col>
<el-col :span="8">
<el-form-item prop="swiftCode">
<el-input v-model="bankInfo.swiftCode" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>币种</span>
</el-col>
<el-col :span="8">
<el-form-item prop="currency">
<el-input v-model="bankInfo.currency" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>描述</span>
</el-col>
<el-col :span="20">
<el-form-item>
<el-input v-model="bankInfo.remarks" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import { typeValues } from '@/api/cheliang/dictcommons'
export default {
name: 'gongyingshangBank',
data() {
return {
bankInfo_index: '',
viewTitle: '',
dialogStatus: '',
receiptBank_list: [],
bankInfo: {
country: '中国',
dueBankValue: '',
depositBank: '',
bankAccount: '',
accountName: '',
bankingOutlets: '',
bankAddress: '',
paymentLines: '',
swiftCode: '',
currency: '人民币',
remarks: ''
},
rules: {}
}
},
methods: {
getType() {
typeValues({ type: 'dueBank' }).then((res) => {
if (res.success) {
this.receiptBank_list = res.data
}
})
},
receiptBankChange(val) {
if (val) {
const choosetItem = this.receiptBank_list.filter((item) => item.dictValue === val)
this.bankInfo.dueBankKey = choosetItem[0].dictKey
}
},
showAdd() {
this.bankInfo = {
country: '中国',
dueBankValue: '',
depositBank: '',
bankAccount: '',
accountName: '',
bankingOutlets: '',
bankAddress: '',
paymentLines: '',
swiftCode: '',
currency: '人民币',
remarks: ''
}
this.bankInfo_index = ''
this.dialogStatus = 'add'
this.viewTitle = '【新增】开户行信息'
this.getType()
},
showEdit(bankInfo, index) {
this.dialogStatus = 'edit'
this.viewTitle = '【编辑】开户行信息'
this.bankInfo = bankInfo
this.bankInfo_index = index
this.getType()
},
handleCreate() {
if (this.dialogStatus === 'add') {
if (JSON.stringify(this.bankInfo) !== '{}') {
this.$emit('handleBank', this.bankInfo, this.bankInfo_index)
} else {
this.$message({
showClose: true,
message: '请填写开户行信息!',
type: 'error'
})
}
}
if (this.dialogStatus === 'edit') {
this.$emit('handleBank', this.bankInfo, this.bankInfo_index)
}
},
handleReturn() {
this.dialogStatus = ''
this.bankInfo = {
country: '中国',
dueBankValue: '',
depositBank: '',
bankAccount: '',
accountName: '',
bankingOutlets: '',
bankAddress: '',
paymentLines: '',
swiftCode: '',
currency: '人民币',
remarks: ''
}
this.bankInfo_index = ''
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save