|
@@ -5,8 +5,8 @@
|
|
|
<a-form v-bind="formItemLayout" name="saleInvoiceForm" ref="formRef">
|
|
|
<a-row>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="发票编号(bill code)" v-bind="validateInfos.billCode" id="saleInvoiceForm-billCode" name="billCode" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
- <a-input v-model:value="formData.billCode" placeholder="自动生成" disabled></a-input>
|
|
|
+ <a-form-item label="发票编号(invoice code)" v-bind="validateInfos.invoiceCode" id="saleInvoiceForm-invoiceCode" name="invoiceCode" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.invoiceCode" placeholder="自动生成" disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -19,34 +19,49 @@
|
|
|
<a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" allow-clear enter-button="Search" :disabled="notAllowEdit" @search="onSearchProject"></a-input-search>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="业务类型(busymess type)" v-bind="validateInfos.busynessType" id="saleInvoiceForm-busynessType" name="busynessType">
|
|
|
+ <JDictSelectTag v-model:value="formData.busynessType" placeholder="请选择" dictCode=" busyness_type" style="width: 100%;" :disabled="notAllowEdit"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="购方(buyer)" v-bind="validateInfos.buyer" id="saleInvoiceForm-buyer" name="buyer" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
- <JSelectInput v-model:value="formData.buyer" placeholder="请选择" :options="customerOption" disabled></JSelectInput>
|
|
|
+ <a-form-item label="购方(buyer)" v-bind="validateInfos.customer" id="saleInvoiceForm-customer" name="customer" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <ApiSelect
|
|
|
+ :api="getCustomerOptions"
|
|
|
+ showSearch
|
|
|
+ v-model:value="formData.customer"
|
|
|
+ optionFilterProp="label"
|
|
|
+ resultField="records"
|
|
|
+ labelField="name"
|
|
|
+ valueField="id"
|
|
|
+ :params='{pageSize:-1}'
|
|
|
+ disabled
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="购方税号(buyer's tax number)" v-bind="validateInfos.buyerTaxNumber" id="saleInvoiceForm-buyerTaxNumber" name="buyerTaxNumber">
|
|
|
- <a-input v-model:value="formData.buyerTaxNumber" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-input v-model:value="formData.buyerTaxNumber" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="购方电话(buyer's telphone)" v-bind="validateInfos.buyerTelphone" id="saleInvoiceForm-buyerTelphone" name="buyerTelphone">
|
|
|
- <a-input v-model:value="formData.buyerTelphone" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-input v-model:value="formData.buyerTelphone" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="购方地址(buyer's addres)" v-bind="validateInfos.buyerAddres" id="saleInvoiceForm-buyerAddres" name="buyerAddres">
|
|
|
- <a-input v-model:value="formData.buyerAddres" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="购方地址(buyer's address)" v-bind="validateInfos.buyerAddress" id="saleInvoiceForm-buyerAddress" name="buyerAddress">
|
|
|
+ <a-input v-model:value="formData.buyerAddress" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="购方银行(buyer's bank)" v-bind="validateInfos.buyerBank" id="saleInvoiceForm-buyerBank" name="buyerBank">
|
|
|
- <a-input v-model:value="formData.buyerBank" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-input v-model:value="formData.buyerBank" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="购方银行账户(buyer's bank account)" v-bind="validateInfos.buyerBankAccount" id="saleInvoiceForm-buyerBankAccount" name="buyerBankAccount">
|
|
|
- <a-input v-model:value="formData.buyerBankAccount" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="购方银行账户(buyer's bank account)" v-bind="validateInfos.buyerAccount" id="saleInvoiceForm-buyerAccount" name="buyerAccount">
|
|
|
+ <a-input v-model:value="formData.buyerAccount" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -60,44 +75,54 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方(saller)" v-bind="validateInfos.saller" id="saleInvoiceForm-saller" name="saller" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
- <JSelectInput v-model:value="formData.saller" placeholder="请选择" :options="customerOption" ></JSelectInput>
|
|
|
- </a-form-item>
|
|
|
+ <a-form-item label="销方(seller)" v-bind="validateInfos.seller" id="saleInvoiceForm-seller" name="saller" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <ApiSelect
|
|
|
+ :api="listHeard"
|
|
|
+ showSearch
|
|
|
+ v-model:value="formData.seller"
|
|
|
+ optionFilterProp="label"
|
|
|
+ resultField="records"
|
|
|
+ labelField="name"
|
|
|
+ valueField="id"
|
|
|
+ :params='{pageSize:-1}'
|
|
|
+ @change="changeSeller"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方税号(saller's tax number)" v-bind="validateInfos.sallerTaxNumber" id="saleInvoiceForm-sallerTaxNumber" name="sallerTaxNumber">
|
|
|
- <a-input v-model:value="formData.sallerTaxNumber" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="销方税号(seller's tax number)" v-bind="validateInfos.sellerTaxNumber" id="saleInvoiceForm-sellerTaxNumber" name="sellerTaxNumber">
|
|
|
+ <a-input v-model:value="formData.sellerTaxNumber" placeholder="请输入" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方电话(saller's telphone)" v-bind="validateInfos.sallerTelphone" id="saleInvoiceForm-sallerTelphone" name="sallerTelphone">
|
|
|
- <a-input v-model:value="formData.sallerTelphone" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="销方电话(seller's telphone)" v-bind="validateInfos.sellerTelphone" id="saleInvoiceForm-sellerTelphone" name="sellerTelphone">
|
|
|
+ <a-input v-model:value="formData.sellerTelphone" placeholder="请输入" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方地址(saller's address)" v-bind="validateInfos.invoiceAddress" id="saleInvoiceForm-sallerAddress" name="sallerAddress">
|
|
|
- <a-input v-model:value="formData.sallerAddress" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="销方地址(seller's address)" v-bind="validateInfos.sellerAddress" id="saleInvoiceForm-sellerAddress" name="sellerAddress">
|
|
|
+ <a-input v-model:value="formData.sellerAddress" placeholder="请输入" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方银行(saller's bank)" v-bind="validateInfos.sallerBank" id="saleInvoiceForm-sallerBank" name="sallerBank">
|
|
|
- <a-input v-model:value="formData.sallerBank" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="销方银行(seller's bank)" v-bind="validateInfos.sellerBank" id="saleInvoiceForm-sellerBank" name="sellerBank">
|
|
|
+ <a-input v-model:value="formData.sellerBank" placeholder="请输入" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销方银行账户(saller's bank account)" v-bind="validateInfos.sallerBankAccount" id="saleInvoiceForm-sallerBankAccount" name="sallerBankAccount">
|
|
|
- <a-input v-model:value="formData.sallerBankAccount" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="销方银行账户(seller's bank account)" v-bind="validateInfos.sellerBankAccount" id="saleInvoiceForm-sellerBankAccount" name="sellerBankAccount">
|
|
|
+ <a-input v-model:value="formData.sellerBankAccount" placeholder="请输入" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="F号(F number)" v-bind="validateInfos.fnumber" id="saleInvoiceForm-fnumber" name="fnumber">
|
|
|
- <a-input v-model:value="formData.fnumber" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-input v-model:value="formData.fnumber" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="备注(notes)" v-bind="validateInfos.quotationNotes" id="saleInvoiceForm-notes" name="notes" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
- <a-input v-model:value="formData.notes" placeholder="请输入报价备注(quotation notes)" allow-clear AutoComplete="off"></a-input>
|
|
|
+ <a-form-item label="备注(notes)" v-bind="validateInfos.notes" id="saleInvoiceForm-notes" name="notes" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.notes" placeholder="请输入备注(notes)" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -108,7 +133,7 @@
|
|
|
<!-- 子表单区域 -->
|
|
|
<a-tabs v-model:activeKey="activeKey" animated style=" padding: 24px;padding-top: 0px;">
|
|
|
<a-tab-pane tab="销售发票 - 发票明细(invoice details)" key="saleInvoiceDetails" :forceRender="true">
|
|
|
- <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectDeliveryList"> 选择发货通知单(select delevery notice)</a-button>
|
|
|
+ <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectDeliveryList" > 选择发货通知单(select delevery notice)</a-button>
|
|
|
<a-button type="primary" @click="selectCommissionList"> 选择佣金订单(selete commission order)</a-button>
|
|
|
<j-vxe-table
|
|
|
:keep-source="true"
|
|
@@ -151,7 +176,7 @@
|
|
|
</a-tab-pane>
|
|
|
|
|
|
</a-tabs>
|
|
|
- <SelectDeliveryNoticeModal ref="SelectDeliveryNoticeModalRef"></SelectDeliveryNoticeModal>
|
|
|
+ <SelectDeliveryNoticeModal ref="SelectDeliveryNoticeModalRef" @addDelivery="addSonList"></SelectDeliveryNoticeModal>
|
|
|
<BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
|
|
|
<SelectCommissionOrderModal ref="SelectCommissionOrderModalRef"></SelectCommissionOrderModal>
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
@@ -162,7 +187,7 @@
|
|
|
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
- import { querysaleInvoiceFormShipListByMainId,querySaleInvoiceDetailListByMainId,queryDataById, saveOrUpdate } from '../salesInvoiceForm.api';
|
|
|
+ import { querysaleInvoiceFormShipListByMainId,querySaleInvoiceDetailListByMainId,queryDataById, saveOrUpdate,listHeard } from '../salesInvoiceForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import {saleInvoiceShipColumns, saleInvoiceDetailColumns} from '../salesInvoiceForm.data';
|
|
|
import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
@@ -172,7 +197,7 @@
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
import { JDictSelectTag,JSelectMultiple} from '/@/components/Form';
|
|
|
- import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
|
|
|
+ import { ApiSelect, } from '/@/components/Form/index';
|
|
|
import { Form,message } from 'ant-design-vue';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
import moment from 'moment';
|
|
@@ -187,10 +212,10 @@
|
|
|
JUpload,
|
|
|
SelectProjectModal,
|
|
|
JDictSelectTag,
|
|
|
- JSelectInput,
|
|
|
JSelectMultiple,
|
|
|
SelectDeliveryNoticeModal,
|
|
|
- SelectCommissionOrderModal
|
|
|
+ SelectCommissionOrderModal,
|
|
|
+ ApiSelect
|
|
|
},
|
|
|
props:{
|
|
|
formDisabled:{
|
|
@@ -229,24 +254,28 @@
|
|
|
delFlag: undefined,
|
|
|
sourceCode:'',
|
|
|
billDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
- billCode: '',
|
|
|
+ invoiceCode: '',
|
|
|
project: '',
|
|
|
projectName: '',
|
|
|
- buyer: '',
|
|
|
- buyerName: '',
|
|
|
- buyerTelphone: '',
|
|
|
- buyerAddres: '',
|
|
|
+ customer: '',
|
|
|
+ customerName: '',
|
|
|
+ buyerTaxNumber: '',
|
|
|
+ buyerTelphone:'',
|
|
|
+ buyerAddress: '',
|
|
|
buyerBank: '',
|
|
|
- buyerBankAccount: '',
|
|
|
+ buyerAccount: '',
|
|
|
invoiceHeader: '',
|
|
|
invoiceAddress:"",
|
|
|
- sallerTaxNumber: '',
|
|
|
- sallerTelphone: '',
|
|
|
- sallerAddress: '',
|
|
|
- sallerBank: '',
|
|
|
- sallerBankAccount: '',
|
|
|
+ seller:'',
|
|
|
+ sellerName:'',
|
|
|
+ sellerTaxNumber: '',
|
|
|
+ sellerTelphone: '',
|
|
|
+ sellerAddress: '',
|
|
|
+ sellerBank: '',
|
|
|
+ sellerBankAccount: '',
|
|
|
fnumber:'',
|
|
|
notes:'',
|
|
|
+ busynessType:''
|
|
|
});
|
|
|
|
|
|
//表单验证
|
|
@@ -310,8 +339,8 @@
|
|
|
}
|
|
|
|
|
|
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
|
|
- 'saleQuotationShip': saleInvoiceFormShipTableRef,
|
|
|
- 'saleQuotationProduct': saleInvoiceDetailsTableRef,
|
|
|
+ 'saleInvoiceShip': saleInvoiceFormShipTableRef,
|
|
|
+ 'saleInvoiceProduct': saleInvoiceDetailsTableRef,
|
|
|
});
|
|
|
//获取表单信息
|
|
|
async function getFormData() {
|
|
@@ -331,11 +360,11 @@
|
|
|
}
|
|
|
//保存
|
|
|
async function submitForm() {
|
|
|
- if(formData.sourceCode==''){
|
|
|
- message.warning('请选择发票明细')
|
|
|
+ const mainData = await getFormData();
|
|
|
+ const subData = await getSubFormAndTableData();
|
|
|
+ if(!subData.saleInvoiceProductList||subData.saleInvoiceProductList.lenght==0){
|
|
|
+ message.warning('请添加发票明细')
|
|
|
}else{
|
|
|
- const mainData = await getFormData();
|
|
|
- const subData = await getSubFormAndTableData();
|
|
|
const values = Object.assign({}, dbData, mainData, subData);
|
|
|
console.log('表单提交数据', values)
|
|
|
const isUpdate = values.id ? true : false
|
|
@@ -366,21 +395,11 @@
|
|
|
var newArray = [...saleInvoiceDetailsTable.dataSource]
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
saleInvoiceDetailsTable.dataSource = newArray
|
|
|
- // if( saleInvoiceDetailsTable.dataSource.length!==0){
|
|
|
- // var arr = []
|
|
|
- // saleInvoiceDetailsTable.dataSource.map(item=>{
|
|
|
- // if(item.sourceId){
|
|
|
- // arr.push(item.sourceId)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // if(arr.length==0){
|
|
|
- // formData.sourceCode=''
|
|
|
- // notAllowEdit.value=false
|
|
|
- // }
|
|
|
- // }else{
|
|
|
- // formData.sourceCode=''
|
|
|
- // notAllowEdit.value=false
|
|
|
- // }
|
|
|
+ if( saleInvoiceDetailsTable.dataSource.length!==0){
|
|
|
+ notAllowEdit.value=true
|
|
|
+ }else{
|
|
|
+ notAllowEdit.value=false
|
|
|
+ }
|
|
|
}
|
|
|
//选择项目
|
|
|
function addProject(data) {
|
|
@@ -390,27 +409,13 @@
|
|
|
}else{
|
|
|
formData.project = data[0].id
|
|
|
formData.projectName = data[0].name
|
|
|
- // formData.customer =data[0].customerId
|
|
|
- // formData.customerName =data[0].customerId_dictText
|
|
|
+ formData.customer =data[0].customerId
|
|
|
+ formData.customerName =data[0].customerId_dictText
|
|
|
}
|
|
|
}
|
|
|
//获取客户列表
|
|
|
- function getCustomerOptions(){
|
|
|
- let params = {pageSize:'-1',status:1}
|
|
|
- defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params}, { isTransformResponse: false }).then(res=>{
|
|
|
- if(res){
|
|
|
- customerOption.value = []
|
|
|
- res.result.records.forEach(item=>{
|
|
|
- customerOption.value.push({
|
|
|
- label: item.name,
|
|
|
- value: item.id,
|
|
|
- priority:item.priority,
|
|
|
- intermediatorCommission:item.intermediatorCommission,
|
|
|
- commission:item.commission
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ function getCustomerOptions(params){
|
|
|
+ return defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params});
|
|
|
}
|
|
|
//查看配件信息
|
|
|
function viewAccessory(prop){
|
|
@@ -421,13 +426,80 @@
|
|
|
SelectProjectModalRef.value.getTable()
|
|
|
}
|
|
|
function changeValues(prop){
|
|
|
-
|
|
|
+ if(prop.col.key=='taxPrice'||prop.col.key=='quantity'){
|
|
|
+ prop.row.taxPrice = prop.row.taxPrice&&prop.row.taxPrice!==''?prop.row.taxPrice:0
|
|
|
+ prop.row.quantity = prop.row.quantity&&prop.row.quantity!==''?prop.row.quantity:0
|
|
|
+ var num= Number(prop.row.taxPrice)*Number(prop.row.quantity)
|
|
|
+ prop.row.taxMoney = num.toFixed(2)
|
|
|
+ prop.row.taxRate = prop.row.taxRate?prop.row.taxRate:0
|
|
|
+ prop.row.taxAmount = Number(prop.row.taxMoney)* Number(prop.row.taxRate)/100
|
|
|
+ }
|
|
|
}
|
|
|
function selectDeliveryList(){
|
|
|
- SelectDeliveryNoticeModalRef.value.getTable()
|
|
|
+ if(formData.busynessType=='佣金业务'){
|
|
|
+ message.warning('佣金业务不能选择发货通知单')
|
|
|
+ }else if(saleInvoiceDetailsTable.dataSource==0||saleInvoiceDetailsTable.dataSource==undefined){
|
|
|
+ SelectDeliveryNoticeModalRef.value.getTable(formData)
|
|
|
+ }else{
|
|
|
+ message.warning('发票明细只可有一条数据')
|
|
|
+ }
|
|
|
}
|
|
|
function selectCommissionList(){
|
|
|
- SelectCommissionOrderModalRef.value.getTable()
|
|
|
+ if(formData.busynessType=='普通业务'){
|
|
|
+ message.warning('普通业务不能选择佣金订单')
|
|
|
+ }else if(saleInvoiceDetailsTable.dataSource==0||saleInvoiceDetailsTable.dataSource==undefined){
|
|
|
+ SelectCommissionOrderModalRef.value.getTable()
|
|
|
+ }else{
|
|
|
+ message.warning('发票明细只可有一条数据')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function addSonList(data){
|
|
|
+ data.map(item=>{
|
|
|
+ item.sourceId = item.childId
|
|
|
+ item.quantity = item.quantity&& item.quantity!==''?item.quantity:0
|
|
|
+ item.taxPrice = item.taxPrice&& item.taxPrice!==''?item.taxPrice:0
|
|
|
+ item.taxMoney = item.money&& item.money!==''?item.money:0
|
|
|
+ //暂无税率字段,设置默认为1
|
|
|
+ item.taxRate = item.taxRate?item.taxRate:0
|
|
|
+ item.taxAmount =item.taxMoney*item.taxRate/100
|
|
|
+ })
|
|
|
+ notAllowEdit.value=true
|
|
|
+ var arrSonFormDelivery = data.concat(saleInvoiceDetailsTable.dataSource)
|
|
|
+ saleInvoiceDetailsTable.dataSource=arrSonFormDelivery
|
|
|
+ formData.project = data[0].project
|
|
|
+ formData.projectName = data[0].projectName
|
|
|
+ formData.customer = data[0].customer
|
|
|
+ formData.customerName = data[0].customerName
|
|
|
+ formData.sourceCode =data[0].billCode
|
|
|
+ formData.invoiceHeader=data[0].invoiceHeader
|
|
|
+ formData.invoiceAddress=data[0].invoiceAddress
|
|
|
+ formData.busynessType = '普通业务'
|
|
|
+ getCustomerOptions({pageSize:-1,id:data[0].customer}).then(res=>{
|
|
|
+ formData.buyerTaxNumber = res.records[0].dutyParagraph
|
|
|
+ formData.buyerTelphone = res.records[0].phone
|
|
|
+ formData.buyerAddress = res.records[0].invoiceAddress
|
|
|
+ })
|
|
|
+
|
|
|
+ getShipDetail(data[0].headId,'delivery')
|
|
|
+ }
|
|
|
+ function getShipDetail(id,status){
|
|
|
+ let params = {id:id}
|
|
|
+ let url = status=='delivery'?'/saleCode/saleDelivery/querySaleDeliveryShipByMainId':'/saleCode/saleDelivery/querySaleContractShipByMainId'
|
|
|
+ defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
|
|
|
+ if(res){
|
|
|
+ saleInvoiceFormShipTable.dataSource = res.result
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ async function changeSeller(value){
|
|
|
+ var param={id:value}
|
|
|
+ var result=await listHeard(param)
|
|
|
+ formData.sellerName =result.records[0].name
|
|
|
+ formData.sellerTaxNumber =result.records[0].taxcode
|
|
|
+ formData.sellerTelphone =result.records[0].telphone
|
|
|
+ formData.sellerAddress =result.records[0].address
|
|
|
+ formData.sellerBank =result.records[0].bank
|
|
|
+ formData.sellerBankAccount =result.records[0].bankAccount
|
|
|
}
|
|
|
return {
|
|
|
saleInvoiceFormShipTableRef,
|
|
@@ -461,7 +533,10 @@
|
|
|
SelectDeliveryNoticeModalRef,
|
|
|
selectDeliveryList,
|
|
|
SelectCommissionOrderModalRef,
|
|
|
- selectCommissionList
|
|
|
+ selectCommissionList,
|
|
|
+ addSonList,
|
|
|
+ listHeard,
|
|
|
+ changeSeller
|
|
|
}
|
|
|
}
|
|
|
});
|