|
|
@ -30,20 +30,31 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="reason" label="调账类型"> |
|
|
|
<el-select v-model="temp.accadjTypeValue" placeholder="请选择" clearable class="addinputw"> |
|
|
|
<el-option v-for="item in accadjTypeValue_list" :key="item.dictKey" :label="item.dictValue" |
|
|
|
<el-select v-model="temp.accadjTypeKey" placeholder="请选择" clearable class="addinputw" |
|
|
|
@change="accadjTypeKeyChange"> |
|
|
|
<el-option v-for="item in accadjType_list" :key="item.dictKey" :label="item.dictValue" |
|
|
|
:value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"><!-- :readonly="depositVehicleList[scope.$index].inboundDate" --> |
|
|
|
<el-col :span="8"><!-- :readonly="vehicleList[scope.$index].inboundDate" --> |
|
|
|
<el-form-item prop="money" label="调出分公司"> |
|
|
|
<el-input v-model="temp.money" placeholder="请输入" class="addinputw" clearable/> |
|
|
|
<el-select v-model="temp.callOutOrgSid" placeholder="请选择" clearable class="addinputw" |
|
|
|
:disabled="temp.accadjTypeKey == '02'" |
|
|
|
@change="callOutOrgSidChange"> |
|
|
|
<el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name" |
|
|
|
:value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="money" label="调入分公司"> |
|
|
|
<el-input v-model="temp.money" placeholder="请输入" class="addinputw" clearable/> |
|
|
|
<el-select v-model="temp.callInOrgSid" placeholder="请选择" clearable class="addinputw" |
|
|
|
:disabled="temp.accadjTypeKey == '01'" |
|
|
|
@change="callInOrgSidChange"> |
|
|
|
<el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name" |
|
|
|
:value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -59,58 +70,58 @@ |
|
|
|
<template class="tablelist"> |
|
|
|
<el-table :data="list" border style="width: 100%" :index="index"> |
|
|
|
<el-table-column align="center" fixed label="序号" type="index" width="50"/> |
|
|
|
<el-table-column label="操作" fixed align="center" width="250px" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column label="操作" fixed align="center" width="80" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" type="danger" |
|
|
|
@click="dataDelete(scope.row,scope.$index,list[scope.$index])">删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车型名称" align="center"> |
|
|
|
<el-table-column label="车型名称" align="center" width="190px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.modelName }}</span> |
|
|
|
<span>{{ scope.row.vehicleAlias }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="常用配置" align="center"> |
|
|
|
<el-table-column label="常用配置" align="center" width="360"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.configName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" align="center"> |
|
|
|
<el-table-column label="车架号" align="center" width="120"> |
|
|
|
<template slot-scope="scope" @click=""> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="库存地点" align="center"> |
|
|
|
<el-table-column label="库存地点" align="center" width="200"> |
|
|
|
<template slot-scope="scope" @click=""> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
<span>{{ scope.row.inventoryLocationName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="内销价格" align="center"> |
|
|
|
<el-table-column label="内销价格" align="center" width="90"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.witPinMoney }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="发票类型" align="center"> |
|
|
|
<el-table-column label="发票类型" align="center" width="140"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" |
|
|
|
:readonly="depositVehicleList[scope.$index].inboundDate"/> |
|
|
|
<!-- <span>{{scope.row.inboundDate}}</span>--> |
|
|
|
<!-- <el-input v-model="scope.row.invoiceTypeValue" placeholder="请输入" class="addinputw"--> |
|
|
|
<!-- :readonly="vehicleList[scope.$index].inboundDate"/>--> |
|
|
|
<span>{{ scope.row.invoiceTypeValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="运费" align="center"> |
|
|
|
<el-table-column label="运费" align="center" width="90"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.freight }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="运费承担方" align="center"> |
|
|
|
<el-table-column label="运费承担方" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.freightUndertakerName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="center"> |
|
|
|
<el-table-column label="备注" align="left" header-align="center" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.remarks }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -127,8 +138,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import tiaozhangcheliangList from '@/views/supplychain/tiaozhangshenqingguanli/relation/tiaozhangcheliangList' |
|
|
|
import req from '@/api/supplychain/purchasereturntowarehouse' |
|
|
|
import {fetchDetailsBySid,save} from '@/api/supplychain/tiaozhangshenqing.js' |
|
|
|
import { fetchDetailsBySid, save } from '@/api/supplychain/tiaozhangshenqing.js' |
|
|
|
import { getOrg, getPathSidByUserSid } from '@/api/cheliang/basevehiclemodel' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
@ -144,9 +154,7 @@ export default { |
|
|
|
dialogStatus: '', |
|
|
|
index: 0, |
|
|
|
list: [], |
|
|
|
depositVehicleList: [], |
|
|
|
accadjTypeValue_list: [], |
|
|
|
// ========== |
|
|
|
vehicleList: [], |
|
|
|
useOrg: '', |
|
|
|
accadjType_list: [], |
|
|
|
useOrg_list: [], |
|
|
@ -167,7 +175,7 @@ export default { |
|
|
|
accSids: [] // 调账车辆类型sid |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
// money: [{ required: true, message: '费用不能为空', trigger: 'blur' }] |
|
|
|
|
|
|
|
}, |
|
|
|
submitdisabled: false, // 保存按钮 |
|
|
|
disabled: false // 提交按钮 |
|
|
@ -199,13 +207,12 @@ export default { |
|
|
|
getPathSidByUserSid({ userSid: userSid }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.useOrg = res.data |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getType() { |
|
|
|
typeValues({ |
|
|
|
type: 'accadjType ' |
|
|
|
type: 'accadjType' |
|
|
|
}).then((response) => { |
|
|
|
if (response.code === '200' && response.data) { |
|
|
|
this.accadjType_list = response.data |
|
|
@ -219,39 +226,103 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 明细表添加一行数据 |
|
|
|
accadjTypeKeyChange(val) { |
|
|
|
if (val) { |
|
|
|
const choosetItem = this.accadjType_list.filter((item) => item.dictKey == val) |
|
|
|
this.temp.accadjTypeValue = choosetItem[0].dictValue |
|
|
|
console.log('name:', this.temp.accadjTypeValue, 'key:', this.temp.accadjTypeKey) |
|
|
|
// 调入 |
|
|
|
if (this.temp.accadjTypeKey == '01') { |
|
|
|
this.temp.callInOrgSid = this.useOrg |
|
|
|
const name = this.useOrg_list.filter((item) => item.sid == this.temp.callInOrgSid) |
|
|
|
this.temp.callInOrgName = name[0].name |
|
|
|
console.log('name:', this.temp.callInOrgName, 'sid:', this.temp.callInOrgSid) |
|
|
|
this.temp.callOutOrgName = '' |
|
|
|
this.temp.callOutOrgSid = '' |
|
|
|
} |
|
|
|
// 调出 |
|
|
|
if (this.temp.accadjTypeKey == '02') { |
|
|
|
this.temp.callOutOrgSid = this.useOrg |
|
|
|
const name = this.useOrg_list.filter((item) => item.sid == this.temp.callOutOrgSid) |
|
|
|
this.temp.callOutOrgName = name[0].name |
|
|
|
console.log('name:', this.temp.callOutOrgName, 'sid:', this.temp.callOutOrgSid) |
|
|
|
this.temp.callInOrgName = '' |
|
|
|
this.temp.callInOrgSid = '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
callOutOrgSidChange(val) { |
|
|
|
const choosetItem = this.useOrg_list.filter((item) => item.sid == val) |
|
|
|
this.temp.callOutOrgName = choosetItem[0].name |
|
|
|
console.log('name:', this.temp.callOutOrgName, 'key:', this.temp.callOutOrgSid) |
|
|
|
}, |
|
|
|
callInOrgSidChange(val) { |
|
|
|
const choosetItem = this.useOrg_list.filter((item) => item.sid == val) |
|
|
|
this.temp.callInOrgName = choosetItem[0].name |
|
|
|
console.log('name:', this.temp.callInOrgName, 'key:', this.temp.callInOrgSid) |
|
|
|
}, |
|
|
|
handletiaozhangcheliang() { |
|
|
|
if (this.temp.accadjTypeKey == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择调账类型', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.temp.callOutOrgSid == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择调出分公司', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.temp.callInOrgSid == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择调入分公司', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.isXuanche = true |
|
|
|
const vinNoList = [] |
|
|
|
this.list.forEach(element => { |
|
|
|
vinNoList.push(element.vinNo) |
|
|
|
vinNoList.push(element.sid) |
|
|
|
}) |
|
|
|
this.$refs['xuanChe'].loadVinNo(vinNoList) |
|
|
|
this.$refs['xuanChe'].showCheList(this.temp.accadjTypeKey, this.temp.callOutOrgSid, this.temp.callInOrgSid, vinNoList) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.isXuanche = false |
|
|
|
}, |
|
|
|
selectVehicle(depositVehicleList) { |
|
|
|
console.log('depositVehicleList', depositVehicleList) |
|
|
|
this.depositVehicleList = depositVehicleList |
|
|
|
for (var i = 0; i < depositVehicleList.length; i++) { |
|
|
|
// 明细表添加一行数据 |
|
|
|
selectVehicle(vehicleList) { |
|
|
|
console.log('vehicleList', vehicleList) |
|
|
|
this.vehicleList = vehicleList |
|
|
|
for (var i = 0; i < vehicleList.length; i++) { |
|
|
|
this.list.push({ |
|
|
|
configName: depositVehicleList[i].configName, |
|
|
|
configSid: depositVehicleList[i].configSid, |
|
|
|
inboundDate: depositVehicleList[i].priceDate, |
|
|
|
modelName: depositVehicleList[i].vehicleAlias, |
|
|
|
vinNo: depositVehicleList[i].vinNo |
|
|
|
sid: vehicleList[i].sid, |
|
|
|
vinNo: vehicleList[i].vinNo, |
|
|
|
vehicleAlias: vehicleList[i].vehicleAlias, |
|
|
|
modelSid: vehicleList[i].modelSid, |
|
|
|
configName: vehicleList[i].configName, |
|
|
|
configSid: vehicleList[i].configSid, |
|
|
|
inventoryLocationName: vehicleList[i].inventoryLocationName, |
|
|
|
witPinMoney: vehicleList[i].witPinMoney, |
|
|
|
invoiceTypeValue: vehicleList[i].invoiceTypeValue, |
|
|
|
freight: vehicleList[i].freight, |
|
|
|
freightUndertakerName: vehicleList[i].freightUndertakerName, |
|
|
|
remarks: vehicleList[i].remarks |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('车辆表数据', this.list) |
|
|
|
}, |
|
|
|
// 明细表删除一行数据 |
|
|
|
dataDelete(index, row) { |
|
|
|
console.log('index', index) |
|
|
|
console.log('row', row) |
|
|
|
dataDelete(row, index) { |
|
|
|
console.log('index', index, 'row', row) |
|
|
|
this.list.splice(index, 1) |
|
|
|
}, |
|
|
|
|
|
|
|
// 返回(===既判断又赋值) |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
@ -281,13 +352,13 @@ export default { |
|
|
|
}) |
|
|
|
this.temp.name = window.sessionStorage.getItem('name') |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
req.detailsInfo(this.temp.sid).then(resp => { |
|
|
|
const data = resp.data |
|
|
|
this.temp.applicationCode = data.applicationCode |
|
|
|
this.temp.createTime = data.createTime |
|
|
|
}).catch(e => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
// req.detailsInfo(this.temp.sid).then(resp => { |
|
|
|
// const data = resp.data |
|
|
|
// this.temp.applicationCode = data.applicationCode |
|
|
|
// this.temp.createTime = data.createTime |
|
|
|
// }).catch(e => { |
|
|
|
// this.submitdisabled = false |
|
|
|
// }) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】分公司间调账申请' |
|
|
|
this.getPathSid() |
|
|
@ -325,7 +396,9 @@ export default { |
|
|
|
this.$refs['dataForm'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
this.temp.detailsList = this.list |
|
|
|
this.list.forEach(element => { |
|
|
|
this.temp.accSids.push(element.sid) |
|
|
|
}) |
|
|
|
save(this.temp).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
@ -372,16 +445,16 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.temp.detailsList = this.list |
|
|
|
req.submitVehicleReturn(this.temp).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
if (resp.success) { |
|
|
|
_this.handleReturn('true') |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
// req.submitVehicleReturn(this.temp).then(resp => { |
|
|
|
// this.submitdisabled = false |
|
|
|
// if (resp.success) { |
|
|
|
// if (resp.success) { |
|
|
|
// _this.handleReturn('true') |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }).catch(() => { |
|
|
|
// this.submitdisabled = false |
|
|
|
// }) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|