|
|
@ -39,11 +39,11 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="money" label="调出分公司"> |
|
|
|
<el-select v-model="temp.callOutOrgSid" placeholder="请选择" clearable class="addinputw" |
|
|
|
<el-select v-model="temp.callOutOrgName" placeholder="请选择" clearable class="addinputw" |
|
|
|
@change="callOutOrgSidChange" |
|
|
|
:disabled="dialogStatus == 'edit'"> |
|
|
|
<el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name" |
|
|
|
:value="item.sid"/> |
|
|
|
:value="item.name"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -164,7 +164,7 @@ |
|
|
|
<script> |
|
|
|
import diaochecheliangList from '@/views/supplychain/diaochekaipiaoshenqingguanli/relation/diaochecheliangList' |
|
|
|
import upload_diaoche from '@/components/uploadFile/upload_diaoche' |
|
|
|
import { getOrg, getPathSidByUserSid } from '@/api/cheliang/basevehiclemodel' |
|
|
|
import { getPathSidByUserSid, fetchBySid, getListOrgByBrand } from '@/api/cheliang/dictcommons' |
|
|
|
import { fetchDetailsBySid, save, selByLinkSid, submitSunInv } from '@/api/supplychain/diaochekaipiaoshenqing.js' |
|
|
|
import { typeValues } from '@/api/supplychain/yancheguanli' |
|
|
|
import req from '@/api/kucunguanli/changjiachuku' |
|
|
@ -183,6 +183,7 @@ export default { |
|
|
|
dialogVisible: false, |
|
|
|
dialogUrl: [], |
|
|
|
useOrg: '', |
|
|
|
useOrgName: '', |
|
|
|
index: 0, |
|
|
|
list: [], |
|
|
|
vehicleList: [], |
|
|
@ -227,17 +228,17 @@ export default { |
|
|
|
var one = window.location.href.indexOf('&data') + 6 |
|
|
|
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|
|
|
const obj = JSON.parse(decodeURIComponent(data)) |
|
|
|
this.showEdit(obj.businessSid,obj.instanceId,obj.taskId) |
|
|
|
this.showEdit(obj.businessSid, obj.instanceId, obj.taskId) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 输入数字正则 |
|
|
|
oninput(val, limit = 0) { |
|
|
|
val = val.replace(/[^\d.]/g, '') //保留数字 |
|
|
|
val = val.replace(/^00/, '0.') //开头不能有两个0 |
|
|
|
val = val.replace(/^\./g, '0.') //开头为小数点转换为0. |
|
|
|
val = val.replace(/\.{2,}/g, '.') //两个以上的小数点转换成一个 |
|
|
|
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //只保留一个小数点 |
|
|
|
/^0\d+/.test(val) ? val = val.slice(1) : '' //两位以上数字开头不能为0 |
|
|
|
val = val.replace(/[^\d.]/g, '') // 保留数字 |
|
|
|
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|
|
|
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|
|
|
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 reg = new RegExp(str) |
|
|
|
if (limit === 0) { |
|
|
@ -261,22 +262,14 @@ export default { |
|
|
|
invoiceTypeChange(row, val) { |
|
|
|
console.log('215545', row, val) |
|
|
|
if (val) { |
|
|
|
const choosetItem = this.invoiceType_list.filter((item) => item.dictKey == val) |
|
|
|
const choosetItem = this.invoiceType_list.filter((item) => item.dictKey === val) |
|
|
|
row.invoiceTypeValue = choosetItem[0].dictValue |
|
|
|
} |
|
|
|
}, |
|
|
|
// 查询所有分公司 |
|
|
|
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) |
|
|
|
const choosetItem = this.useOrg_list.filter((item) => item.name === val) |
|
|
|
this.temp.callOutOrgName = choosetItem[0].name |
|
|
|
this.temp.callOutOrgSid = choosetItem[0].sid |
|
|
|
console.log('name:', this.temp.callOutOrgName, 'key:', this.temp.callOutOrgSid) |
|
|
|
}, |
|
|
|
// 根据登陆人sid查询分公司 |
|
|
@ -287,8 +280,17 @@ export default { |
|
|
|
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 |
|
|
|
fetchBySid(this.useOrg).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.useOrgName = resp.data.name |
|
|
|
this.temp.callInOrgName = this.useOrgName |
|
|
|
} |
|
|
|
}) |
|
|
|
getListOrgByBrand(this.useOrg).then((respsone) => { |
|
|
|
if (respsone.success) { |
|
|
|
this.useOrg_list = respsone.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -320,7 +322,7 @@ export default { |
|
|
|
}, |
|
|
|
// 明细表添加一行数据 |
|
|
|
handlediaocheliang() { |
|
|
|
if (this.temp.callOutOrgSid == '') { |
|
|
|
if (this.temp.callOutOrgSid === '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择调出分公司', |
|
|
@ -328,7 +330,7 @@ export default { |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.temp.callInOrgSid == '') { |
|
|
|
if (this.temp.callInOrgSid === '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '请选择调入分公司', |
|
|
@ -341,7 +343,7 @@ export default { |
|
|
|
this.list.forEach(element => { |
|
|
|
vinNoList.push(element.purchaseSid) |
|
|
|
}) |
|
|
|
this.$refs['xuanChe'].showCheList( this.temp.callOutOrgSid, this.temp.callInOrgSid, vinNoList) |
|
|
|
this.$refs['xuanChe'].showCheList(this.temp.callOutOrgSid, this.temp.callInOrgSid, vinNoList) |
|
|
|
}, |
|
|
|
// 明细表删除一行数据 |
|
|
|
dataDelete(row, index) { |
|
|
@ -382,22 +384,10 @@ export default { |
|
|
|
remarks: vehicleList[i].remarks, |
|
|
|
isAvailable: isAvailable |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
console.log('车辆表数据', this.list) |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}) |
|
|
|
this.temp.name = window.sessionStorage.getItem('name') |
|
|
|
this.temp.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】调车开票申请' |
|
|
|
this.getListOrgAll() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
showEdit(businessSid,instanceId,taskId) { |
|
|
|
showEdit(businessSid, instanceId, taskId) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}) |
|
|
@ -416,13 +406,12 @@ export default { |
|
|
|
}).catch(e => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
this.getListOrgAll() |
|
|
|
this.getPathSid() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
handleCreate() { |
|
|
|
const _this = this |
|
|
|
for (var i = 0; i < this.list.length; i++) { |
|
|
|
if (this.list[i].invoiceTypeKey == '02') { |
|
|
|
if (this.list[i].invoiceTypeKey === '02') { |
|
|
|
this.list[i].invoicinMoney = this.list[i].witPinMoney // 增值税票:开票金额=内销价格 |
|
|
|
this.list[i].invoicinCompanyName = this.temp.callInOrgName // 增值税票:开票单位=调入公司 |
|
|
|
this.list[i].invoicinCompanySid = this.temp.callInOrgSid // 增值税票:开票单位=调入公司 |
|
|
@ -464,9 +453,8 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
const _this = this |
|
|
|
for (var i = 0; i < this.list.length; i++) { |
|
|
|
if (this.list[i].invoiceTypeKey == '02') { |
|
|
|
if (this.list[i].invoiceTypeKey === '02') { |
|
|
|
this.list[i].invoicinMoney = this.list[i].witPinMoney // 增值税票:开票金额=内销价格 |
|
|
|
this.list[i].invoicinCompanyName = this.temp.callInOrgName // 增值税票:开票单位=调入公司 |
|
|
|
this.list[i].invoicinCompanySid = this.temp.callInOrgSid // 增值税票:开票单位=调入公司 |
|
|
@ -512,8 +500,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|