|
|
@ -14,22 +14,32 @@ |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="right" class="formadd"> |
|
|
|
<div class="wlInfo" style="text-align: right;"><span style="font-size:14px;">金额单位:元</span></div> |
|
|
|
<el-row class="first_row"> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span>分公司名称</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item>{{ formobj.useOrgName }}</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>采购系统</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item prop="purchaseSystemName"> |
|
|
|
<el-select v-model="formobj.purchaseSystemName" placeholder="请选择" @change="changeOrgDept" clearable> |
|
|
|
<el-option v-for="item in orgDept_list" :key="item.orgDeptSid" :label="item.orgDeptName" :value="item.orgDeptName"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span>申请人</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item>{{ formobj.createByName }}</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-col :span="2" class="tleftb"> |
|
|
|
<span>申请日期</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item>{{ formobj.applicationDate }}</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -43,10 +53,20 @@ |
|
|
|
</el-col> |
|
|
|
</el-row>--> |
|
|
|
<el-row> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>品牌</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item prop="carBrandName"> |
|
|
|
<el-select v-model="formobj.carBrandName" filterable placeholder="请选择" @change="carBrandChange"> |
|
|
|
<el-option v-for="item in carBrand_list" :key="item.sid" :label="item.brandName" :value="item.brandName"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>车型</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="19"> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-form-item>{{ formobj.modelName }}</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2"> |
|
|
@ -91,7 +111,7 @@ |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>外采供应商</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="13"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item prop="purchasingUnitName"> |
|
|
|
<el-select v-model="formobj.purchasingUnitName" filterable placeholder="请选择" @change="changeWcgys"> |
|
|
|
<el-option v-for="item in wcgys_list" :key="item.sid" :label="item.manufacturerName" :value="item.manufacturerName"></el-option> |
|
|
@ -107,6 +127,16 @@ |
|
|
|
<el-radio v-model="formobj.isBeforePayment" label="0">否</el-radio> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span v-show="formobj.isBeforePayment == '0'"><span class="icon">*</span>订金使用规则</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-show="formobj.isBeforePayment == '0'" v-model="formobj.depositUseRuleValue" filterable placeholder="请选择" @change="depositUseRuleChange"> |
|
|
|
<el-option v-for="item in depositUseRule_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
@ -147,7 +177,7 @@ |
|
|
|
<span>剩余车款</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item prop="deposit"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ ShengYuMoney() }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -246,18 +276,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="21"> |
|
|
|
<el-form-item> |
|
|
|
<el-upload |
|
|
|
:action="uploadAction" |
|
|
|
:data="requestData" |
|
|
|
:headers="accessToken" |
|
|
|
:accept="filType" |
|
|
|
:multiple="false" |
|
|
|
:on-success="uploadSuccessHetong" |
|
|
|
:limit="1" |
|
|
|
:file-list="fileList" |
|
|
|
:on-preview='handleDown' |
|
|
|
class="upload-demo" |
|
|
|
> |
|
|
|
<el-upload :action="uploadAction" :data="requestData" :headers="accessToken" :accept="filType" :multiple="false" :on-success="uploadSuccessHetong" :limit="1" :file-list="fileList" :on-preview='handleDown' class="upload-demo"> |
|
|
|
<el-button size="small" type="primary">合同上传</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
@ -293,7 +312,7 @@ import modellibrary from '@/views/baseoutsourcingapplication/relation/modellibra |
|
|
|
import req from '@/api/baseoutsourcingapplication/baseoutsourcingapplication' |
|
|
|
import configuration from './chexingbyconfiguration' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
import { getPathSidByUserSid } from '@/api/cheliang/basevehiclemodel' |
|
|
|
import { getPathSidByUserSid, brandDown, selectOrgLists, typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'BaseOutsourcingApplicationAdd', |
|
|
@ -320,11 +339,15 @@ export default { |
|
|
|
uploadAction: process.env.VUE_APP_BASE_API + '/base/file/upload', |
|
|
|
filType: '.pdf,.docx,.doc', |
|
|
|
fileList: [], |
|
|
|
orgDept_list: [], |
|
|
|
carBrand_list: [], |
|
|
|
depositUseRule_list: [], |
|
|
|
wcgys_list: [], // 外采供应商 |
|
|
|
account_list: [], |
|
|
|
formobj: { |
|
|
|
remarks: '', |
|
|
|
useOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
accountName: '', |
|
|
|
depositBankName: '', |
|
|
|
bankAccount: '', |
|
|
@ -362,11 +385,20 @@ export default { |
|
|
|
businessSid: '', |
|
|
|
taskId: '', |
|
|
|
instanceId: '', |
|
|
|
modelId: '' |
|
|
|
modelId: '', |
|
|
|
carBrandName: '', |
|
|
|
carBrandSid: '', |
|
|
|
purchaseSystemSid: '', |
|
|
|
purchaseSystemName: '', |
|
|
|
depositUseRuleValue: '', |
|
|
|
depositUseRuleKey: '', |
|
|
|
vehicleTypeKey: '' |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
purchaseSystemName: [{ required: true, message: '采购系统不能为空', trigger: 'change' }], // 采购系统名称 |
|
|
|
purchasingUnitName: [{ required: true, message: '外采供应商不能为空', trigger: 'change' }], // 采购单位名称 |
|
|
|
accountName: [{ required: true, message: '车款账户不能为空', trigger: 'blur' }], // 车款账户 |
|
|
|
carBrandName: [{ required: true, message: '品牌不能为空', trigger: 'change' }], // 品牌名称 |
|
|
|
accountName: [{ required: true, message: '车款账户不能为空', trigger: 'change' }], // 车款账户 |
|
|
|
purchasePrice: [{ required: true, message: '采购价格不能为空', trigger: 'blur' }], // 采购价格 |
|
|
|
num: [{ required: true, message: '台数不能为空', trigger: 'blur' }], // 台数 |
|
|
|
deposit: [{ required: true, message: '订金不能为空', trigger: 'blur' }] // 订金 |
|
|
@ -409,13 +441,29 @@ export default { |
|
|
|
xhr.send() |
|
|
|
}, |
|
|
|
init() { |
|
|
|
typeValues({ type: 'depositUseRule' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.depositUseRule_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
selectOrgLists({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.orgDept_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.useOrgSid = res.data |
|
|
|
req.fetchOrgBySid(res.data).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj.useOrgName = resp.data.name |
|
|
|
} |
|
|
|
}) |
|
|
|
brandDown({ useOrg: res.data }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.carBrand_list = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
req.wcgysNamesDown(res.data).then((response) => { |
|
|
|
if (response.success) { |
|
|
|
this.wcgys_list = response.data |
|
|
@ -435,8 +483,12 @@ export default { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|
selectModel() { |
|
|
|
if (this.formobj.carBrandName === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请先选择品牌' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divconfiguration'].showData(this.formobj.baseOutsourcingApplicationVehicleDtos) |
|
|
|
this.$refs['divconfiguration'].showData(this.formobj.baseOutsourcingApplicationVehicleDtos, this.formobj.carBrandSid) |
|
|
|
}, |
|
|
|
selectChexing(info) { |
|
|
|
this.viewState = '1' |
|
|
@ -444,8 +496,9 @@ export default { |
|
|
|
this.formobj.modelName = info[0].vehicleAlias // 车型名称 |
|
|
|
this.formobj.configName = info[0].configName // 常用配置名称 |
|
|
|
this.formobj.configSid = info[0].configSid // 常用配置sid |
|
|
|
this.formobj.guidedPrice = info[0].guidedPrice// 销售指导价 |
|
|
|
this.formobj.insideCode = info[0].insideCode// 内部编码 |
|
|
|
this.formobj.guidedPrice = info[0].guidedPrice // 销售指导价 |
|
|
|
this.formobj.insideCode = info[0].insideCode // 内部编码 |
|
|
|
this.formobj.vehicleTypeKey = info[0].vehicleTypeKey // 车辆类型Key |
|
|
|
}, |
|
|
|
selectVehicleDialog() { |
|
|
|
var objs = this.formobj.baseOutsourcingApplicationVehicleDtos |
|
|
@ -532,12 +585,27 @@ export default { |
|
|
|
this.formobj.expenseName = vdata.expenseName // 费用名称 |
|
|
|
this.formobj.totalExpenseAmount = vdata.totalExpenseAmount // 费用金额合计 |
|
|
|
this.formobj.orgSid = vdata.orgSid // 部门sid |
|
|
|
this.formobj.carBrandName = vdata.carBrandName |
|
|
|
this.formobj.carBrandSid = vdata.carBrandSid |
|
|
|
this.formobj.purchaseSystemName = vdata.purchaseSystemName |
|
|
|
this.formobj.purchaseSystemSid = vdata.purchaseSystemSid |
|
|
|
this.formobj.depositUseRuleValue = vdata.depositUseRuleValue |
|
|
|
this.formobj.depositUseRuleKey = vdata.depositUseRuleKey |
|
|
|
this.formobj.vehicleTypeKey = vdata.vehicleTypeKey |
|
|
|
this.formobj.baseOutsourcingApplicationVehicleDtos = vdata.baseOutsourcingApplicationVehicleVos // 部门sid |
|
|
|
} |
|
|
|
}).catch(e => { |
|
|
|
console.log(e) |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeOrgDept(value) { |
|
|
|
const choosetItem = this.orgDept_list.filter((item) => item.orgDeptName === value) |
|
|
|
this.formobj.purchaseSystemSid = choosetItem[0].orgDeptSid |
|
|
|
}, |
|
|
|
carBrandChange(value) { |
|
|
|
const choosetItem = this.carBrand_list.filter((item) => item.brandName === value) |
|
|
|
this.formobj.carBrandSid = choosetItem[0].sid |
|
|
|
}, |
|
|
|
changeWcgys(value) { |
|
|
|
let bb = null |
|
|
|
this.wcgys_list.forEach((e) => { |
|
|
@ -561,6 +629,10 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
depositUseRuleChange(value) { |
|
|
|
const choosetItem = this.depositUseRule_list.filter((item) => item.dictValue === value) |
|
|
|
this.formobj.depositUseRuleKey = choosetItem[0].dictKey |
|
|
|
}, |
|
|
|
changeAccountName(value) { |
|
|
|
let bb = null |
|
|
|
this.account_list.forEach((e) => { |
|
|
@ -596,15 +668,20 @@ export default { |
|
|
|
saveOrUpdate() { |
|
|
|
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
this.formobj.orgSid = this.$store.getters.orgSid |
|
|
|
if (this.formobj.externalMiningTypeKey == '1') { |
|
|
|
if (this.formobj.externalMiningTypeKey === '1') { |
|
|
|
this.formobj.externalMiningTypeValue = '直接外采' |
|
|
|
} else if (this.formobj.externalMiningTypeKey == '2') { |
|
|
|
} else if (this.formobj.externalMiningTypeKey === '2') { |
|
|
|
this.formobj.externalMiningTypeValue = '政策外采' |
|
|
|
} |
|
|
|
if (this.formobj.modelName === '' || this.formobj.modelName === null) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '车型不能为空,请选择车型' }) |
|
|
|
return |
|
|
|
} |
|
|
|
console.log((parseInt(this.formobj.deposit) - parseInt(this.formobj.purchasePrice))) |
|
|
|
if ((parseInt(this.formobj.deposit) - parseInt(this.formobj.purchasePrice)) > 0 && this.formobj.depositUseRuleKey !== '002') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因其中订金大于采购单价,订金使用规则请选择均分使用' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
@ -638,6 +715,11 @@ export default { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '车型不能为空,请选择车型' }) |
|
|
|
return |
|
|
|
} |
|
|
|
console.log((parseInt(this.formobj.deposit) - parseInt(this.formobj.purchasePrice))) |
|
|
|
if ((parseInt(this.formobj.deposit) - parseInt(this.formobj.purchasePrice)) > 0 && this.formobj.depositUseRuleKey !== '002') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '因其中订金大于采购单价,订金使用规则请选择均分使用' }) |
|
|
|
return |
|
|
|
} |
|
|
|
// 提交的代码 |
|
|
|
// this.submitdisabled = true |
|
|
|
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
|
|
@ -681,6 +763,7 @@ export default { |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj.id = '' |
|
|
|
this.formobj.useOrgSid = '' |
|
|
|
this.formobj.insideCode = '' |
|
|
|
this.formobj.accountName = '' |
|
|
|
this.formobj.depositBankName = '' |
|
|
@ -709,6 +792,13 @@ export default { |
|
|
|
this.formobj.modelBankAccount = '' |
|
|
|
this.formobj.modelAccountName = '' |
|
|
|
this.formobj.remarks = '' |
|
|
|
this.formobj.carBrandName = '' |
|
|
|
this.formobj.carBrandSid = '' |
|
|
|
this.formobj.purchaseSystemName = '' |
|
|
|
this.formobj.purchaseSystemSid = '' |
|
|
|
this.formobj.depositUseRuleValue = '' |
|
|
|
this.formobj.depositUseRuleKey = '' |
|
|
|
this.formobj.vehicleTypeKey = '' |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|