接单根据支付方式获取企业税号

This commit is contained in:
wuteng 2025-08-30 10:29:59 +08:00
parent b68e3b2c6e
commit 08ebfad92b
2 changed files with 51 additions and 28 deletions

View File

@ -606,6 +606,9 @@ export default {
text: '正在导入 ' + _index + ' ...'
})
for (let index = 0; index < results.length; index++) {
loadingInstance = this.$loading({
text: '正在导入 ' + _index + ' 数据...'
})
const element = results[index]
// 客户名称 英文简称 月结编号 联系人 手机号码 主归属网点 回款联系人 销售联系人 销售主管 销售支持 结算类型 国家 省份 城市 区县 联系地址 E-Mail 是否启用 是否开启OMS账号 首次签约时间 备注
let postData={}
@ -657,30 +660,21 @@ export default {
// postData.country= element['国家']
// postData.extJsonStr = JSON.stringify(extJsonStr)
//转时间格式
if(postData.firstSigningDay){
postData.firstSigningDay=excelDateToJSDate(postData.firstSigningDay).split(' ')[0]
}
if (this.blImport == 1) { //新增
const res = await addMonthUser(postData)
if (res.code !== 200) {
this.$modal.msgError(JSON.stringify(res.msg))
loadingInstance.close()
return
}
} else { //更新
const res = await batchImportEnterprise(postData)
if (res.code !== 200) {
this.$modal.msgError(JSON.stringify(res.msg))
loadingInstance.close()
return
}
if(postData.firstSigningDay){
postData.firstSigningDay=excelDateToJSDate(postData.firstSigningDay).split(' ')[0]
}
try {
if (this.blImport == 1) { //新增
await addMonthUser(postData)
} else { //更新
await batchImportEnterprise(postData)
}
} catch (error) {
loadingInstance.close()
loadingInstance = this.$loading({
text: '正在导入 ' + _index + ' 数据...'
})
}
loadingInstance.close()
return
}
}
loadingInstance.close()
this.handleQuery();
},

View File

@ -838,6 +838,7 @@
<script>
import { realMatchWaybill,getTotalAvailablePag } from "@/api/emis/emisCommon";
import { checkWaybillIsExists,getWaybillDetail,realSubmitOrder,calcWaybillFee,calcSetteldWeight,calcVolumeWeight} from "@/api/emis/emisWaybill";
import { listMonthUser } from "@/api/emis/emisCustomerUser";
import { parseTime } from "@/utils/custom";
import { debounce } from 'throttle-debounce'
import { getDestSite } from "@/api/emis/emisDestination";
@ -897,6 +898,8 @@ import feeItemForm from './feeItemForm.vue';
import TanexPrinterPanel from '@/views/emis/EmisBaseTools/TanexPrinterPanel.vue';
import { doScan } from "@/api/emis/emisTmsScanRecord";
import { deepClone } from '@/utils/index'
import { getEmisCustomerAddress } from "@/api/emis/emisCustomerAddress";
export default {
// name: "WaybillRecord",
@ -1506,7 +1509,7 @@ methods: {
});
},
onPaymentTypeChange(){
async onPaymentTypeChange(){
// 非月结清空月结客户选择
if(this.form.paymentType == '1' ||
this.form.paymentType == '3' ||
@ -1514,7 +1517,17 @@ methods: {
){
this.form.custNo=null;
this.form.customerCode=null;
//企业税号重新赋值
// 选中寄件人 中国且企业税号为空 根据寄件人id查询企业税号
if(this.form.sender.country == '0086' && this.selectedSenderEnterpriseName == null && this.form.sender.id){
const res = await getEmisCustomerAddress(this.form.sender.id);
if(res.data){
this.form.sender.enterpriseName = res.data.enterpriseName;
this.form.sender.enterpriseTaxId = res.data.enterpriseTaxId;
this.selectedSenderEnterpriseName = res.data.enterpriseName;
this.selectedSenderEnterpriseTaxId = res.data.enterpriseTaxId;
}
}
//企业税号重新赋值
this.form.sender.enterpriseName=this.selectedSenderEnterpriseName;
this.form.sender.enterpriseTaxId=this.selectedSenderEnterpriseTaxId;
this.calcBillFee();
@ -1622,7 +1635,7 @@ methods: {
openCollapse(index){
},
initData() {
async initData() {
console.log("====>this.action=2222=>",this.action);
console.log("====>this.billCode=2222=>",this.billCode);
@ -1632,8 +1645,8 @@ methods: {
if(this.billCode && this.billCode!=undefined) {
this.loading = true;
getWaybillDetail(this.billCode).then(response => {
// getWaybillDetail(this.billCode).then(response => {
const response = await getWaybillDetail(this.billCode);
if(this.$store.getters.ownerSiteCode!='88888'&&this.action!='got'){
if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){
this.$modal.msgError('此单归属不允许修改');
@ -1703,7 +1716,23 @@ methods: {
this.selectedSenderEnterpriseName = this.form.sender.enterpriseName;
this.selectedSenderEnterpriseTaxId = this.form.sender.enterpriseTaxId;
}
});
// });
// 获取企业税号
if(['2', '4', '5'].includes(this.form.paymentType)){ // 月结
const res = await listMonthUser({monthlyPayCode: this.form.custNo ,pageNum: 1,pageSize: 1,customerType:2});
if(res.rows.length > 0){
this.form.sender.enterpriseName = res.rows[0].enterpriseName;
this.form.sender.enterpriseTaxId = res.rows[0].enterpriseTaxId;
}
}else{ // 非月结
if (this.form.sender.id) {
const res = await getEmisCustomerAddress(this.form.sender.id);
if (res.data) {
this.form.sender.enterpriseName = res.data.enterpriseName;
this.form.sender.enterpriseTaxId = res.data.enterpriseTaxId;
}
}
}
}else{
// this.startTimer();