Browse Source

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

zhanglei
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) { export function vehicleOutLibrary(data) {
return request({ return request({
url: '/base/v1/basevehicle/vehicleOutLibrary', url: '/base/v1/basevehicleout/vehicleOut',
method: 'post', method: 'post',
data: data, data: data,
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
}) })
} }
// 销售专员
export function getUserByOrgSid(data) {
return request({
url: '/portal/v1/sysuser/getUserByOrgSid',
method: 'get',
params: data
})
}
// 买断 // 买断
export function vehicleBuyBreak(data) { export function vehicleBuyBreak(data) {
return request({ return request({

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

@ -92,3 +92,32 @@ export function fetchVinNoAndVehSid(data) {
method: 'get' 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"/> <vehicleconfiguration v-show="viewState == 5" ref="divPeizhi" @doback="resetState"/>
<!-- <changyongpeizhi-info v-show="viewState == 5" ref="divPeizhi" @doback="resetState"></changyongpeizhi-info>--> <!-- <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"/> <cheliangtaizhang-mai v-show="viewState == 7" ref="divMai" @doback="resetState" @reloadlist="getList"/>
<!-- 买断详情 --> <!-- 买断详情 -->
@ -562,24 +562,19 @@ export default {
}, },
// //
doChuku() { doChuku() {
if (this.sids.length === 1) { if (this.sids.length === 0) {
this.viewState = 6 this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行出库操作' })
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'
})
return 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 doMaiduan() { // salesDate settlementStatus

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

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

Loading…
Cancel
Save