|
|
@ -7,7 +7,7 @@ |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<!--start 添加修改按钮--> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="dialogStatus === 'add' ? saveAdd() : saveEdit()">保存 |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" size="small" @click="submitVehicleApply()">提交 |
|
|
|
</el-button> |
|
|
@ -24,19 +24,19 @@ |
|
|
|
<span>申请编号:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<span style="margin-left: 5px">{{ formobj.createByName }}</span> |
|
|
|
<span style="margin-left: 5px">{{ formobj.applyNo }}</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3"> |
|
|
|
<span>申请人:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<span style="margin-left: 5px">{{ formobj.createByName }}</span> |
|
|
|
<span style="margin-left: 5px">{{ formobj.applyPeoName }}</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3"> |
|
|
|
<span>申请日期:</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<span style="margin-left: 5px">{{ formobj.applicationDate }}</span> |
|
|
|
<span style="margin-left: 5px">{{ formobj.createTime }}</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row class="linetwo"> |
|
|
@ -45,7 +45,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item> |
|
|
|
<span style="margin-left: 5px">{{ formobj.name }}</span> |
|
|
|
<span style="margin-left: 5px">{{ formobj.buyerOrgName }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="el-form-item-right"> |
|
|
@ -53,7 +53,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="formobj.remarks" clearable filterable placeholder="请选择"> |
|
|
|
<el-select v-model="formobj.sellerOrgName" clearable filterable placeholder="请选择" @change="changeSellerOrg"> |
|
|
|
<el-option v-for="item in org_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -66,17 +66,17 @@ |
|
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addCommodity()">选择车型</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" :data="formobj.busVehicleApplyDetailDtoList" :index="index" border style="width: 100%"> |
|
|
|
<el-table :key="tableKey" :data="formobj.baseInternalPurchaseVehicles" :index="index" border style="width: 100%"> |
|
|
|
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/> |
|
|
|
<el-table-column fixed prop="name" label="操作" width="100px" align="center" header-align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" type="danger" @click="dataDelete(scope.$index, formobj.busVehicleApplyDetailDtoList[scope.$index])">删除 |
|
|
|
<el-button size="mini" type="danger" @click="dataDelete(scope.$index, formobj.baseInternalPurchaseVehicles[scope.$index])">删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车型名称" align="left" header-align="center" width="250"> |
|
|
|
<el-table-column label="车型" align="center" width="250"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleName }}</span> |
|
|
|
<span>{{ scope.row.vehicleAlias }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="常用配置" align="left" header-align="center"> |
|
|
@ -84,17 +84,17 @@ |
|
|
|
<span>{{ scope.row.configName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="运费" header-align="center" width="150"> |
|
|
|
<el-table-column label="运费" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.saleGuPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/> |
|
|
|
<el-input v-model="scope.row.freight" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" header-align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.saleGuPrice }}</span> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" header-align="center" width="200"> |
|
|
|
<el-table-column label="备注" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.remarks" placeholder="" class="addinputw" clearable/> |
|
|
|
</template> |
|
|
@ -109,8 +109,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/supplychain/busvehicleapply' |
|
|
|
import {getListOrg, getPathSidByUserSid } from '@/api/cheliang/dictcommons.js' |
|
|
|
import req from '@/api/supplychain/cheliangneigou' |
|
|
|
import { getListOrg, getPathSidByUserSid, fetchBySid } from '@/api/cheliang/dictcommons.js' |
|
|
|
import configuration from '@/views/supplychain/cheliangpaichan/chexingbyconfiguration' |
|
|
|
|
|
|
|
export default { |
|
|
@ -121,24 +121,23 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
|
dialogStatus: '', |
|
|
|
viewState: 1, |
|
|
|
index: 0, |
|
|
|
tableKey: 0, |
|
|
|
list1: [], |
|
|
|
org_list: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
name: '', |
|
|
|
createBySid: window.sessionStorage.getItem('userSid'), // 用户人sid |
|
|
|
createByName: window.sessionStorage.getItem('name'), // 制单人 |
|
|
|
applicationCode: '', // 申请编号 |
|
|
|
applicationDate: '', // 申请日期 |
|
|
|
schedulingType: '', // 排产类型 |
|
|
|
remarks: '', // 备注 |
|
|
|
currentAmount: '', // 当前订金金额 |
|
|
|
busVehicleApplyDetailDtoList: [] |
|
|
|
applyNo: '', |
|
|
|
applyPeoName: window.sessionStorage.getItem('name'), |
|
|
|
createTime: '', |
|
|
|
buyerOrgSid: '', |
|
|
|
buyerOrgName: '', |
|
|
|
sellerOrgSid: '', |
|
|
|
sellerOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
createOrgSid: '', |
|
|
|
baseInternalPurchaseVehicles: [] |
|
|
|
}, |
|
|
|
rules: {}, |
|
|
|
submitdisabled: false |
|
|
@ -157,7 +156,7 @@ export default { |
|
|
|
if (day < 10) { |
|
|
|
day = '0' + day |
|
|
|
} |
|
|
|
this.formobj.applicationDate = year + '-' + month + '-' + day |
|
|
|
this.formobj.createTime = year + '-' + month + '-' + day |
|
|
|
}, |
|
|
|
getListOrg() { |
|
|
|
getListOrg().then((res) => { |
|
|
@ -169,8 +168,15 @@ export default { |
|
|
|
getUseOrgByUserSid() { |
|
|
|
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.name = res.data.name |
|
|
|
console.log(res.data.name) |
|
|
|
this.formobj.buyerOrgSid = res.data |
|
|
|
this.formobj.useOrgSid = res.data |
|
|
|
this.formobj.createOrgSid = res.data |
|
|
|
fetchBySid(this.formobj.buyerOrgSid).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj.buyerOrgName = resp.data.name |
|
|
|
console.log(this.formobj.buyerOrgName, 9999) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -185,43 +191,55 @@ export default { |
|
|
|
e.target.value = parseFloat(e.target.value) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeSellerOrg(value) { |
|
|
|
let bb = null |
|
|
|
this.org_list.forEach((e) => { |
|
|
|
if (e.sid === value) { |
|
|
|
bb = { |
|
|
|
sid: e.sid, |
|
|
|
name: e.name |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formobj.sellerOrgName = bb.name |
|
|
|
this.formobj.sellerOrgSid = bb.sid |
|
|
|
}, |
|
|
|
// 明细表添加一行数据 |
|
|
|
addCommodity() { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divconfiguration'].showData(this.list1) |
|
|
|
this.$refs['divconfiguration'].showData(this.formobj.baseInternalPurchaseVehicles, this.formobj.buyerOrgSid) |
|
|
|
}, |
|
|
|
// 明细表删除一行数据 |
|
|
|
dataDelete(index, row) { |
|
|
|
this.formobj.busVehicleApplyDetailDtoList.splice(index, 1) |
|
|
|
this.list1.splice(index, 1) |
|
|
|
this.formobj.baseInternalPurchaseVehicles.splice(index, 1) |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
showAdd(userOrgSid) { |
|
|
|
this.newDate() |
|
|
|
this.getListOrg() |
|
|
|
this.getUseOrgByUserSid() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】内购申请' |
|
|
|
}, |
|
|
|
showEdit(sid, row) { |
|
|
|
showEdit(row, userOrgSid) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【编辑】内购申请' |
|
|
|
console.log('编辑回显', sid) |
|
|
|
req.fetchBySid(sid).then((resp) => { |
|
|
|
const data = resp.data |
|
|
|
this.formobj.applicationCode = data.applicationCode |
|
|
|
this.formobj.applicationDate = data.applicationDate |
|
|
|
this.formobj.schedulingType = data.schedulingType |
|
|
|
this.formobj.remarks = data.remarks |
|
|
|
this.formobj.currentAmount = data.currentAmount |
|
|
|
this.formobj.sid = sid |
|
|
|
this.formobj.busVehicleApplyDetailDtoList = data.busVehicleApplyDetailVoList |
|
|
|
this.list1 = data.busVehicleApplyDetailVoList |
|
|
|
console.log('编辑回显', row.sid) |
|
|
|
req.fetchBySid(row.sid).then((resp) => { |
|
|
|
this.formobj.sid = row.sid |
|
|
|
this.formobj.applyNo = resp.data.applyNo |
|
|
|
this.formobj.applyPeoName = resp.data.applyPeoName |
|
|
|
this.formobj.createTime = resp.data.createTime |
|
|
|
this.formobj.buyerOrgSid = resp.data.buyerOrgSid |
|
|
|
this.formobj.buyerOrgName = resp.data.buyerOrgName |
|
|
|
this.formobj.sellerOrgSid = resp.data.sellerOrgSid |
|
|
|
this.formobj.sellerOrgName = resp.data.sellerOrgName |
|
|
|
this.formobj.useOrgSid = resp.data.useOrgSid |
|
|
|
this.formobj.createOrgSid = resp.data.createOrgSid |
|
|
|
this.formobj.baseInternalPurchaseVehicles = resp.data.baseInternalPurchaseVehicles |
|
|
|
}).catch((e) => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
@ -229,39 +247,25 @@ export default { |
|
|
|
// 车型常用配置列表--新增确定返回的数据 |
|
|
|
backData(value) { |
|
|
|
this.viewState = 1 |
|
|
|
if (this.formobj.busVehicleApplyDetailDtoList.length > 0) { |
|
|
|
for (var i = 0; i < value.length; i++) { |
|
|
|
for (var u = 0; u < this.formobj.busVehicleApplyDetailDtoList.length; u++) { |
|
|
|
if (value[i].modelName === this.formobj.busVehicleApplyDetailDtoList[u].vehicleName && value[i].configName === this.formobj.busVehicleApplyDetailDtoList[u].configName) { |
|
|
|
value.splice(value[i], 1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (value.length > 0) { |
|
|
|
value.forEach((e) => { |
|
|
|
this.formobj.busVehicleApplyDetailDtoList.push({ |
|
|
|
quantity: '', |
|
|
|
applySid: '', |
|
|
|
configSid: e.configurationItemsSid, |
|
|
|
this.formobj.baseInternalPurchaseVehicles.push({ |
|
|
|
mainSid: '', |
|
|
|
modelSid: e.modelSid, |
|
|
|
vehicleAlias: e.vehicleAlias, |
|
|
|
configSid: e.configSid, |
|
|
|
configName: e.configName, |
|
|
|
// useDeposit: '', |
|
|
|
applyForDeposit: '', |
|
|
|
remarks: '', |
|
|
|
saleGuPrice: '', |
|
|
|
insideCode: e.insideCode, // 内部编码 |
|
|
|
vehicleName: e.modelName, |
|
|
|
vehicleSid: e.modelSid |
|
|
|
freight: '', |
|
|
|
vinNo: '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.list1 = this.formobj.busVehicleApplyDetailDtoList |
|
|
|
} |
|
|
|
}, |
|
|
|
saveAdd() { |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveAdd(this.formobj).then((resp) => { |
|
|
|
req.saveOrUpdate(this.formobj).then((resp) => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
@ -279,26 +283,6 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveEdit() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveEdit(this.formobj).then((resp) => { |
|
|
|
this.submitdisabled = false |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitVehicleApply() { |
|
|
|
req.submitVehicleApply(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
@ -320,15 +304,18 @@ export default { |
|
|
|
// 返回(===既判断) |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj.schedulingType = '' // 排产类型 |
|
|
|
this.formobj.remarks = '' // 备注 |
|
|
|
this.formobj.currentAmount = '' |
|
|
|
this.formobj.applicationCode = '' |
|
|
|
this.formobj.applicationDate = '' |
|
|
|
this.formobj.busVehicleApplyDetailDtoList = [] |
|
|
|
this.list1 = [] |
|
|
|
this.formobj.sid = '' |
|
|
|
this.formobj.applyNo = '' |
|
|
|
this.formobj.applyPeoName = '' |
|
|
|
this.formobj.createTime = '' |
|
|
|
this.formobj.buyerOrgSid = '' |
|
|
|
this.formobj.buyerOrgName = '' |
|
|
|
this.formobj.sellerOrgSid = '' |
|
|
|
this.formobj.sellerOrgName = '' |
|
|
|
this.formobj.useOrgSid = '' |
|
|
|
this.formobj.createOrgSid = '' |
|
|
|
this.formobj.baseInternalPurchaseVehicles = [] |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$refs['divconfiguration'].getList() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
closePage() { |
|
|
|