Browse Source

完善车辆台账--车辆出库

master
yunuo970428 3 years ago
parent
commit
d52a8cf293
  1. 11
      anrui-scm/anrui-scm-ui/src/api/cheliang/basevehicle.js
  2. 29
      anrui-scm/anrui-scm-ui/src/api/cheliang/dictcommons.js
  3. 29
      anrui-scm/anrui-scm-ui/src/views/cheliang/cheliangtaizhang/cheliangtaizhang.vue
  4. 307
      anrui-scm/anrui-scm-ui/src/views/cheliang/cheliangtaizhang/relation/cheliangtaizhangChu.vue

11
anrui-scm/anrui-scm-ui/src/api/cheliang/basevehicle.js

@ -139,22 +139,13 @@ export function fetchByUseOrgSid(data) {
// 出库
export function vehicleOutLibrary(data) {
return request({
url: '/base/v1/basevehicle/vehicleOutLibrary',
url: '/base/v1/basevehicleout/vehicleOut',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 销售专员
export function getUserByOrgSid(data) {
return request({
url: '/portal/v1/sysuser/getUserByOrgSid',
method: 'get',
params: data
})
}
// 买断
export function vehicleBuyBreak(data) {
return request({

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

@ -92,3 +92,32 @@ export function fetchVinNoAndVehSid(data) {
method: 'get'
})
}
// 根据当前登录用户sid获取本分公司下的销售部门和销售专员
export function selectOrgList(data) {
return request({
url: '/portal/v1/sysorganization/selectOrgList',
method: 'get',
params: data
})
}
// 根据选择的销售专员获取客户
export function selectCustomerList(data) {
return request({
url: '/crm/v1/crmcustomertemp/selectCustomerList',
method: 'get',
params: data
})
}
// 获取本分公司下的二级经销商
export function selectDisList(data) {
return request({
url: '/base/v1/basedistributor/selectDisList',
method: 'get',
params: data
})
}

29
anrui-scm/anrui-scm-ui/src/views/cheliang/cheliangtaizhang/cheliangtaizhang.vue

@ -152,7 +152,7 @@
<vehicleconfiguration v-show="viewState == 5" ref="divPeizhi" @doback="resetState"/>
<!-- <changyongpeizhi-info v-show="viewState == 5" ref="divPeizhi" @doback="resetState"></changyongpeizhi-info>-->
<!-- 出库 -->
<cheliangtaizhang-chu v-show="viewState == 6" ref="divChu" @doback="resetState"/>
<cheliangtaizhang-chu v-show="viewState == 6" ref="divChu" @doback="resetState" @reloadlist="getList"/>
<!-- 买断 -->
<cheliangtaizhang-mai v-show="viewState == 7" ref="divMai" @doback="resetState" @reloadlist="getList"/>
<!-- 买断详情 -->
@ -562,24 +562,19 @@ export default {
},
//
doChuku() {
if (this.sids.length === 1) {
this.viewState = 6
const sid = this.sids[0]
this.$refs['divChu'].showChu(sid)
} else if (this.sids.length > 1) {
this.$message({
showClose: true,
message: '请选择一台车辆进行出库!',
type: 'error'
})
} else {
this.$message({
showClose: true,
message: '仅可选择一台车辆进行出库!',
type: 'error'
})
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行出库操作' })
return
}
for (var i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].vehicleStateValue !== '库存' && this.multipleSelection[i].vehicleStateValue !== '调入' && this.multipleSelection[i].isProblemVeh !== '无问题') {
const tip = '因车架号' + this.multipleSelection[i].vinNo + '的车辆不满足出库条件,出库操作失败'
this.$message({ showClose: true, type: 'error', message: tip })
return
}
}
this.viewState = 6
this.$refs['divChu'].showChu(this.multipleSelection)
},
//
doMaiduan() { // salesDate settlementStatus

307
anrui-scm/anrui-scm-ui/src/views/cheliang/cheliangtaizhang/relation/cheliangtaizhangChu.vue

@ -11,115 +11,141 @@
<div class="titwu">车辆出库</div>
<el-form ref="dataForm" :model="temp" label-position="right" class="formadd" :rules="rules">
<el-row class="first_row">
<el-col :span="4">
<el-form-item>
<span>出库类型</span>
</el-form-item>
<el-col :span="4" class="tleftb">
<span>车架号</span>
</el-col>
<el-col :span="8">
<el-form-item><span>{{ temp.vinNo }}</span></el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>出库类型</span>
</el-col>
<el-col :span="8">
<el-form-item prop="outLibraryValue">
<el-select ref="config" v-model="temp.outLibraryValue" class="addinputw" clearable placeholder=""
filterable
@change="outLibraryChange">
<el-option v-for="(item,index) in payType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictValue"/>
<el-form-item prop="type">
<el-select v-model="temp.type" class="addinputw" placeholder="" filterable @change="outLibraryChange">
<el-option v-for="item in payType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<span>销售专员</span>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>销售部门</span>
</el-col>
<el-col :span="8">
<el-form-item prop="orgName">
<el-select v-model="temp.orgName" class="addinputw" placeholder="" @change="changeOrg">
<el-option v-for="item in org_list" :key="item.orgDeptSid" :label="item.orgDeptName" :value="item.orgDeptName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>销售专员</span>
</el-col>
<el-col :span="8">
<el-form-item prop="person">
<el-select ref="config" v-model="temp.person" class="addinputw" clearable placeholder="">
<el-option v-for="(item,index) in person_list" :key="item.sid" :label="item.namePath"
:value="item.sid"/>
<el-form-item prop="staffName">
<el-select v-model="temp.staffName" class="addinputw" placeholder="" @change="changeStaff">
<el-option v-for="item in staff_list" :key="item.staffSid" :label="item.staffName" :value="item.staffName"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-form-item>
<span>合同编号</span>
</el-form-item>
<el-col :span="4" class="tleftb">
<span>合同编号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="contractNo">
<el-input v-model="temp.contractNo" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<span>成交价()</span>
</el-form-item>
<el-col :span="4" class="tleftb">
<span>成交价()</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="temp.salePrice" maxlength="125" placeholder="" class="addinputw" clearable
@keyup.native="temp.salePrice = oninput(temp.salePrice,2)"/>
<el-input v-model="temp.price" maxlength="125" placeholder="" class="addinputw" clearable @keyup.native="temp.price = oninput(temp.price,2)"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-form-item prop="">
<span>客户类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="customerTypeKey">
<el-select v-model="temp.customerTypeKey" class="addinputw" clearable placeholder=""
@change="customertypeChange">
<el-option v-for="(item,index) in customertype_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"/>
</el-select>
</el-form-item>
<el-col :span="4" class="tleftb">
<span>是否为终端客户</span>
</el-col>
<el-col :span="4">
<el-col :span="20">
<el-form-item>
<span>客户姓名</span>
<el-radio v-model="temp.isTerminal" label="1"></el-radio>
<el-radio v-model="temp.isTerminal" label="0"></el-radio>
</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="customerName">
<el-input v-model="temp.customerName" maxlength="125" placeholder="" class="addinputw" clearable/>
<el-select v-model="temp.customerName" class="addinputw" clearable placeholder="" @change="changeCustomer">
<el-option v-for="item in customer_list" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-form-item>
<span>手机号码</span>
</el-form-item>
<el-col :span="4" class="tleftb">
<span>手机号码</span>
</el-col>
<el-col :span="8">
<el-form-item prop="mobile">
<el-input v-model="temp.mobile" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<span>身份证号码</span>
</el-row>
<el-row v-show="temp.isTerminal == '0'">
<el-col :span="4" class="tleftb">
<span>实际购车人名称</span>
</el-col>
<el-col :span="8">
<el-form-item prop="actualCustomer">
<el-select v-model="temp.actualCustomer" class="addinputw" clearable placeholder="" @change="ChangeActualCustomer">
<el-option v-for="item in actualCustomer_list" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>手机号码</span>
</el-col>
<el-col :span="8">
<el-form-item prop="idnumber">
<el-input v-model="temp.idnumber" maxlength="125" placeholder="" class="addinputw" clearable/>
<el-form-item prop="actualMobile">
<el-input v-model="temp.actualMobile" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-col :span="4" class="tleftb">
<span>赠品说明</span>
</el-col>
<el-col :span="20">
<el-form-item>
<span>联系地址</span>
<el-input v-model="temp.giftsDescription" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item prop="address">
<el-input v-model="temp.address" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>二级经销商</span>
</el-col>
<el-col :span="8">
<el-form-item prop="distributorName">
<el-select v-model="temp.distributorName" class="addinputw" clearable placeholder="" @change="changeDistributor">
<el-option v-for="item in distributor_list" :key="item.sid" :label="item.name" :value="item.name"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>返利金额()</span>
</el-col>
<el-col :span="8">
<el-form-item prop="mobile">
<el-input v-model="temp.rebateAmount" maxlength="125" placeholder="" class="addinputw" clearable @keyup.native="temp.rebateAmount = oninput(temp.rebateAmount,2)"/>
</el-form-item>
</el-col>
</el-row>
@ -129,7 +155,8 @@
</template>
<script>
import { getUserByOrgSid, vehicleOutLibrary } from '@/api/cheliang/basevehicle'
import { vehicleOutLibrary } from '@/api/cheliang/basevehicle'
import { selectOrgList, selectCustomerList, selectDisList } from '@/api/cheliang/dictcommons'
import { typeValues } from '@/api/cheliang/dictcommons'
export default {
@ -148,53 +175,44 @@ export default {
callback()
}
}
var identitycard = (rules, value, callback) => {
const card =
/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
if (value) {
//
if (!card.test(value)) {
callback(new Error('请输入正确的身份证号'))
}
callback()
} else {
callback()
}
}
return {
temp: {
person:'',
address: '',//
contractNo: '',//
customerName: '',//
customerType: '',// value
customerTypeKey: '',// key
idnumber: '', //
mobile: '',//
outLibraryValue: '',// value
salePrice: '',//
userSid: '',// userSid
vehicleSid: '',// sid
vehicleStateValue: '' // value
vinNo: '',
contractNo: '', //
distributorName: '', //
distributorSid: '',
giftsDescription: '', //
isTerminal: '', //
customerName: '', //
customerSid: '',
mobile: '', //
actualCustomer: '', //
actualSid: '',
actualMobile: '', //
orgName: '', //
orgSid: '', // Sid
price: '', //
rebateAmount: '', //
staffName: '', //
staffSid: '', // sid
type: '', //
typeKey: '', // Key
queryList: [] //
},
payType_list:[],
customertype_list:[],
person_list:[],
payType_list: [], //
org_list: [], //
staff_list: [], //
customer_list: [], //
actualCustomer_list: [], //
distributor_list: [], //
dialogFormVisible: false,
rules: {
mobile: [
{
required: true,
validator: checkSubmit,
trigger: 'blur',
},
],
idnumber: [
{
required: true,
validator: identitycard,
trigger: 'blur',
},
trigger: 'blur'
}
]
}
}
@ -202,12 +220,9 @@ export default {
methods: {
//
oninput(val, limit = 0) {
val = val.replace(/[^\d.]/g, ""); //
val = val.replace(/^00/, "0."); //0
val = val.replace(/^\./g, "0."); //0.
val = val.replace(/\.{2,}/g, "."); //
val = val.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); //
/^0\d+/.test(val) ? val = val.slice(1) : ''; //0
val = val.replace(/[^\d]/g, '') //
val = val.replace(/^00/, '0'); // 0
/^0\d+/.test(val) ? val = val.slice(1) : '' //
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
@ -220,52 +235,72 @@ export default {
return val
},
getType() {
typeValues({
type:'payType'
}).then((res) => {
if (res.success){
typeValues({type: 'payType'}).then((res) => {
if (res.success) {
this.payType_list = res.data
}
})
typeValues({
type:'customertype'
}).then((res) => {
if (res.success){
this.customertype_list = res.data
selectOrgList({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => {
if (resp.success) {
this.org_list = resp.data
}
})
selectDisList({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
this.distributor_list = res.data
}
})
},
//
outLibraryChange(val) {
if (val) {
const choosetItem = this.payType_list.filter((item) => item.dictValue == val)
const choosetItem = this.payType_list.filter((item) => item.dictValue === val)
this.temp.outLibraryKey = choosetItem[0].dictKey
console.log('name:', this.temp.outLibraryValue, 'key:', this.temp.outLibraryKey)
}
},
//
customertypeChange(val) {
if (val) {
const choosetItem = this.customertype_list.filter((item) => item.dictKey == val)
this.temp.customerType = choosetItem[0].dictValue
console.log('name:', this.temp.customerType, 'key:', this.temp.customerTypeKey)
}
changeOrg(value) {
const choosetItem = this.org_list.filter((item) => item.orgDeptName === value)
this.temp.orgSid = choosetItem[0].orgDeptSid
this.staff_list = choosetItem[0].staffinfoVoList
},
getUser() {
const data = {
orgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid')
}
getUserByOrgSid(data).then((res) => {
if (res.success){
this.person_list = res.data
changeStaff(value) {
const choosetItem = this.staff_list.filter((item) => item.staffName === value)
this.temp.staffSid = choosetItem[0].staffSid
selectCustomerList({ staffSid: this.temp.staffSid, userSid: window.sessionStorage.getItem('userSid') }).then((resp) => {
if (resp.success) {
this.customer_list = resp.data
this.actualCustomer_list = resp.data
}
})
},
showChu(sid){
this.temp.vehicleSid = sid
changeCustomer(value) {
const choosetItem = this.customer_list.filter((item) => item.name === value)
this.temp.customerSid = choosetItem[0].sid
this.temp.mobile = choosetItem[0].mobile
},
ChangeActualCustomer(value) {
const choosetItem = this.actualCustomer_list.filter((item) => item.name === value)
this.temp.actualSid = choosetItem[0].sid
this.temp.actualMobile = choosetItem[0].mobile
},
changeDistributor(value) {
const choosetItem = this.distributor_list.filter((item) => item.name === value)
this.temp.distributorSid = choosetItem[0].sid
},
showChu(multipleSelection) {
const aa = []
const bb = []
multipleSelection.forEach((e) => {
aa.push({
vinNo: e.vinNo,
vinSid: e.sid
})
bb.push(e.vinNo)
})
this.temp.queryList = aa
this.temp.vinNo = bb.join(',')
this.getType()
this.getUser()
},
//
handleCreate() {
@ -273,14 +308,14 @@ export default {
vehicleOutLibrary(this.temp).then((response) => {
if (response.code === '200') {
this.dialogFormVisible = false
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn('true')
}else {
} else {
this.dialogFormVisible = false
}
}).catch(e => {
this.dialogFormVisible = false
})
.catch(e => {
this.dialogFormVisible = false
})
},
//
handleReturn(isreload) {

Loading…
Cancel
Save