|
|
@ -28,22 +28,23 @@ |
|
|
|
<el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px"> |
|
|
|
<div class="invoiceadd" style="margin-top: 5px;"> |
|
|
|
<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" |
|
|
|
:value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
<el-col :span="8"> <!-- 默认为调入 --> |
|
|
|
<el-form-item prop="reason" label="调车类型"> |
|
|
|
<span>调入</span> |
|
|
|
</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-form-item prop="money" label="调入分公司"> |
|
|
|
<span>{{temp.callInOrgName}}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="money" label="调入分公司"> |
|
|
|
<el-input v-model="temp.moneyOne" placeholder="请输入" class="addinputw" clearable/> |
|
|
|
<el-form-item prop="money" label="调出分公司"> |
|
|
|
<el-select v-model="temp.callOutOrgSid" placeholder="请选择" clearable class="addinputw" |
|
|
|
@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-row> |
|
|
@ -53,7 +54,7 @@ |
|
|
|
<div class="titlename"> |
|
|
|
申请车辆列表 |
|
|
|
</div> |
|
|
|
<el-button size="medium" type="primary" @click="handleyudingcheliang" class="btntopbluebut">选择车辆 |
|
|
|
<el-button size="medium" type="primary" @click="handlediaocheliang" class="btntopbluebut">选择车辆 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
<template class="tablelist"> |
|
|
@ -68,7 +69,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="210" label="车型" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.modelName }}</span> |
|
|
|
<span>{{ scope.row.vehicleAlias }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="260" label="常用配置" align="center"> |
|
|
@ -78,7 +79,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="180" label="合格证信息" align="center"> |
|
|
|
<template slot-scope="scope" @click=""> |
|
|
|
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw"/> |
|
|
|
<el-input v-model="scope.row.certificate" placeholder="请输入" class="addinputw"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="120" label="车架号" align="center"> |
|
|
@ -88,26 +89,29 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="110" label="内销价格" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.witPinMoney }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="130" label="发票类型" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" |
|
|
|
:readonly="depositVehicleList[scope.$index].inboundDate"/> |
|
|
|
<!-- <span>{{scope.row.inboundDate}}</span>--> |
|
|
|
<span>{{ scope.row.invoiceTypeValue }}</span> |
|
|
|
<!-- <el-select v-model="temp.callOutOrgSid" placeholder="请选择" clearable class="addinputw"--> |
|
|
|
<!-- @change="callOutOrgSidChange">--> |
|
|
|
<!-- <el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name"--> |
|
|
|
<!-- :value="item.sid"/>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="110" label="开票金额" align="center"> |
|
|
|
<template slot-scope="scope"><!-- 由发票类型决定,增值税票:开票金额=内销价格 --> |
|
|
|
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" readonly |
|
|
|
<el-input v-model="scope.row.invoicinMoney" placeholder="请输入" class="addinputw" readonly |
|
|
|
@keyup.native="scope.row.inboundDate = oninput(scope.row.inboundDate,2)" |
|
|
|
:readonly="scope.row.inboundDate"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="180" label="开票单位" align="center"> |
|
|
|
<template slot-scope="scope"><!-- 由发票类型决定,增值税票:开票单位=调入公司 --> |
|
|
|
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" readonly |
|
|
|
<el-input v-model="scope.row.invoicinCompanyName" placeholder="请输入" class="addinputw" readonly |
|
|
|
:readonly="scope.row.inboundDate"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -119,7 +123,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="200" label="备注" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.inboundDate }}</span> |
|
|
|
<span>{{ scope.row.remarks }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -137,9 +141,9 @@ |
|
|
|
<script> |
|
|
|
import diaochecheliangList from '@/views/supplychain/diaochekaipiaoshenqingguanli/relation/diaochecheliangList' |
|
|
|
import Upload from '@/components/uploadFile/uploadImg.vue' |
|
|
|
import req from '@/api/supplychain/purchasereturntowarehouse' |
|
|
|
import { getPathSidByUserSid } from '@/api/cheliang/basevehiclemodel' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
import { getOrg, getPathSidByUserSid } from '@/api/cheliang/basevehiclemodel' |
|
|
|
import { fetchDetailsBySid, save } from '@/api/supplychain/diaochekaipiaoshenqing.js' |
|
|
|
import { typeValues } from '@/api/supplychain/yancheguanli' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'diaocheshenqingAdd', |
|
|
@ -154,18 +158,24 @@ export default { |
|
|
|
dialogStatus: '', |
|
|
|
index: 0, |
|
|
|
list: [], |
|
|
|
depositVehicleList: [], |
|
|
|
accadjTypeValue_list: [], |
|
|
|
branchOfficeSid:'', // 当前登录人分公司sid |
|
|
|
vehicleList: [], |
|
|
|
branchOfficeSid: '', // 当前登录人分公司sid |
|
|
|
useOrg_list: [], |
|
|
|
// 表单数据 |
|
|
|
temp: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
applicationCode: '', |
|
|
|
name: '', |
|
|
|
createTime: '', |
|
|
|
money: '', |
|
|
|
userSid: '', // 用户人sid |
|
|
|
detailsList: [] |
|
|
|
sid: '', |
|
|
|
createBySid: '', |
|
|
|
applyDate: '', |
|
|
|
accadjTypeKey: '', |
|
|
|
accadjTypeValue: '', |
|
|
|
callOutOrgSid: '', |
|
|
|
callOutOrgName: '', |
|
|
|
callInOrgSid: '', |
|
|
|
callInOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
createOrgSid: '', |
|
|
|
nodeState: '', |
|
|
|
baseShuntingInvoicinApplyeVehs: [] |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
// money: [{ required: true, message: '费用不能为空', trigger: 'blur' }] |
|
|
@ -194,39 +204,94 @@ export default { |
|
|
|
} |
|
|
|
return val |
|
|
|
}, |
|
|
|
getType(){ |
|
|
|
typeValues({ |
|
|
|
type: 'invoiceType' |
|
|
|
}).then((response) => { |
|
|
|
if (response.code === '200' && response.data) { |
|
|
|
this.accadjType_list = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询所有分公司 |
|
|
|
getListOrgAll() { |
|
|
|
getOrg().then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.useOrg_list = res.data |
|
|
|
this.getPathSid() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
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) |
|
|
|
}, |
|
|
|
// 根据登陆人sid查询分公司 |
|
|
|
getPathSid() { |
|
|
|
const userSid = window.sessionStorage.getItem('userSid') |
|
|
|
getPathSidByUserSid({ userSid: userSid }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.branchOfficeSid = res.data |
|
|
|
this.useOrg = res.data |
|
|
|
this.temp.createOrgSid = res.data |
|
|
|
this.temp.callInOrgSid = res.data |
|
|
|
const name = this.useOrg_list.filter((item) => item.sid == this.temp.callInOrgSid) |
|
|
|
this.temp.callInOrgName = name[0].name |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getType() { |
|
|
|
typeValues({}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.manPurOrderType_list = res.data |
|
|
|
} |
|
|
|
// 明细表添加一行数据 |
|
|
|
handlediaocheliang() { |
|
|
|
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.sid) |
|
|
|
}) |
|
|
|
this.$refs['xuanChe'].showCheList( this.temp.callOutOrgSid, this.temp.callInOrgSid, vinNoList) |
|
|
|
}, |
|
|
|
// 明细表删除一行数据 |
|
|
|
dataDelete(index, row) { |
|
|
|
console.log('index', index) |
|
|
|
console.log('row', row) |
|
|
|
this.list.splice(index, 1) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.isXuanche = false |
|
|
|
}, |
|
|
|
selectVehicle(vehicleList) { |
|
|
|
console.log('vehicleList', vehicleList) |
|
|
|
this.vehicleList = vehicleList |
|
|
|
for (var i = 0; i < vehicleList.length; i++) { |
|
|
|
this.list.push({}) |
|
|
|
} |
|
|
|
console.log('车辆表数据', this.list) |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}) |
|
|
|
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 |
|
|
|
}) |
|
|
|
this.temp.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】调车开票申请' |
|
|
|
this.getPathSid() |
|
|
|
this.getType() |
|
|
|
this.getListOrgAll() |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.$nextTick(() => { |
|
|
@ -234,32 +299,25 @@ export default { |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【编辑】调车开票申请' |
|
|
|
req.detailsInfo({ |
|
|
|
sid: row.sid |
|
|
|
}).then(resp => { |
|
|
|
fetchDetailsBySid(row.sid).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
const data = resp.data |
|
|
|
this.temp = data |
|
|
|
this.list = data.voList |
|
|
|
// ---修改名称 先把temp对象转化成json字符串做替换字符串操作,再转化成temp对象--- |
|
|
|
this.temp = JSON.parse(JSON.stringify(this.temp).replace(/voList/g, 'detailsList') |
|
|
|
) |
|
|
|
this.list = data.baseShuntingInvoicinApplyeVehs |
|
|
|
console.log('编辑初始化', this.temp) |
|
|
|
} |
|
|
|
}).catch(e => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
this.getPathSid() |
|
|
|
this.getType() |
|
|
|
this.getListOrgAll() |
|
|
|
}, |
|
|
|
|
|
|
|
handleCreate() { |
|
|
|
const _this = this |
|
|
|
this.$refs['dataForm'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
this.temp.detailsList = this.list |
|
|
|
req.save(this.temp).then(resp => { |
|
|
|
this.temp.baseShuntingInvoicinApplyeVehs = this.list |
|
|
|
save(this.temp).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
if (resp.success) { |
|
|
@ -279,13 +337,20 @@ export default { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.temp = { |
|
|
|
sid: '', |
|
|
|
applicationCode: '', |
|
|
|
name: '', |
|
|
|
createTime: '', |
|
|
|
userSid: '', |
|
|
|
detailsList: [] |
|
|
|
}, |
|
|
|
this.list = [] |
|
|
|
createBySid: '', |
|
|
|
applyDate: '', |
|
|
|
accadjTypeKey: '', |
|
|
|
accadjTypeValue: '', |
|
|
|
callOutOrgSid: '', |
|
|
|
callOutOrgName: '', |
|
|
|
callInOrgSid: '', |
|
|
|
callInOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
createOrgSid: '', |
|
|
|
nodeState: '', |
|
|
|
baseShuntingInvoicinApplyeVehs: [] |
|
|
|
} |
|
|
|
this.list = [] |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
@ -299,51 +364,23 @@ export default { |
|
|
|
cancelButtonText: '取消', |
|
|
|
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 |
|
|
|
}) |
|
|
|
this.temp.baseShuntingInvoicinApplyeVehs = this.list |
|
|
|
// submitVehicleReturn(this.temp).then(resp => { |
|
|
|
// this.submitdisabled = false |
|
|
|
// if (resp.success) { |
|
|
|
// if (resp.success) { |
|
|
|
// _this.handleReturn('true') |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }).catch(() => { |
|
|
|
// this.submitdisabled = false |
|
|
|
// }) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 明细表添加一行数据 |
|
|
|
handleyudingcheliang() { |
|
|
|
this.isXuanche = true |
|
|
|
const vinNoList = [] |
|
|
|
this.list.forEach(element => { |
|
|
|
vinNoList.push(element.vinNo) |
|
|
|
}) |
|
|
|
this.$refs['xuanChe'].loadVinNo(vinNoList) |
|
|
|
}, |
|
|
|
// 明细表删除一行数据 |
|
|
|
dataDelete(index, row) { |
|
|
|
console.log('index', index) |
|
|
|
console.log('row', row) |
|
|
|
this.list.splice(index, 1) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.isXuanche = false |
|
|
|
}, |
|
|
|
selectVehicle(depositVehicleList) { |
|
|
|
console.log('depositVehicleList', depositVehicleList) |
|
|
|
this.depositVehicleList = depositVehicleList |
|
|
|
for (var i = 0; i < depositVehicleList.length; i++) { |
|
|
|
this.list.push({ |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('车辆表数据', this.list) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|