|
@@ -281,7 +281,7 @@
|
|
|
</a-tabs>
|
|
|
<SelectDeliveryNoticeModal ref="SelectDeliveryNoticeModalRef" @add-delivery="addSonList" />
|
|
|
<BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef" />
|
|
|
- <SelectCommissionOrderModal ref="SelectCommissionOrderModalRef" />
|
|
|
+ <SelectCommissionOrderModal ref="SelectCommissionOrderModalRef" @add-commission="addCommission" />
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @select-project="addProject" />
|
|
|
</a-spin>
|
|
|
</template>
|
|
@@ -297,6 +297,7 @@
|
|
|
saveOrUpdate,
|
|
|
listHeard,
|
|
|
queryDeliverDataById,
|
|
|
+ queryCommissionDataById,
|
|
|
} from '../salesInvoiceForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import { saleInvoiceShipColumns, saleInvoiceDetailColumns } from '../salesInvoiceForm.data';
|
|
@@ -391,7 +392,7 @@
|
|
|
|
|
|
//表单验证
|
|
|
const validatorRules = reactive({
|
|
|
- projectName: [{ required: true, message: '请选择项目(select project)' }],
|
|
|
+ // projectName: [{ required: true, message: '请选择项目(select project)' }],
|
|
|
});
|
|
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
|
|
const dbData = {};
|
|
@@ -570,6 +571,43 @@
|
|
|
message.warning('发票明细只可有一条数据');
|
|
|
}
|
|
|
}
|
|
|
+ async function addCommission(data) {
|
|
|
+
|
|
|
+ var arrCommissionSon = await queryCommissionDataById(data[0].id);
|
|
|
+ arrCommissionSon.map((item) => {
|
|
|
+ item.sourceId = item.id;
|
|
|
+ item.quantity = 1;
|
|
|
+ item.taxPrice = item.commission && item.commission !== '' ? item.commission : 0;
|
|
|
+ item.taxMoney = item.commission && item.commission !== '' ? item.commission : 0;
|
|
|
+ //暂无税率字段,设置默认为0
|
|
|
+ item.taxRate = item.taxRate ? item.taxRate : 0;
|
|
|
+ item.taxAmount = ((item.taxMoney * item.taxRate) / 100).toFixed(4);
|
|
|
+ item.sourceType = '佣金业务';
|
|
|
+ });
|
|
|
+
|
|
|
+ notAllowEdit.value = true;
|
|
|
+ var xTable = saleInvoiceDetailsTableRef.value!.getXTable();
|
|
|
+ var arrSonFormCommission = xTable.data.concat(arrCommissionSon);
|
|
|
+ saleInvoiceDetailsTable.dataSource = arrSonFormCommission;
|
|
|
+ console.log("========================");
|
|
|
+ console.log(data[0]);
|
|
|
+ console.log(data[0].customerId);
|
|
|
+ formData.project = '';//data[0].project;
|
|
|
+ formData.projectName = '';//data[0].projectName;
|
|
|
+ formData.customer = data[0].customerId;
|
|
|
+ formData.customerName = data[0].customerName;
|
|
|
+ formData.sourceCode2 = data[0].billCode;
|
|
|
+ formData.invoiceHeader = data[0].invoiceHeader;
|
|
|
+ formData.invoiceAddress = data[0].invoiceAddress;
|
|
|
+ formData.currency = data[0].currency;
|
|
|
+ formData.busynessType = '佣金业务';
|
|
|
+ getCustomerOptions({ pageSize: -1, id: data[0].customerId }).then((res) => {
|
|
|
+ formData.buyerTaxNumber = res.records[0].dutyParagraph;
|
|
|
+ formData.buyerTelphone = res.records[0].phone;
|
|
|
+ formData.buyerAddress = res.records[0].invoiceAddress;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
async function addSonList(data) {
|
|
|
var arrDeliverSon = await queryDeliverDataById(data[0].id);
|
|
|
arrDeliverSon.map((item) => {
|
|
@@ -657,6 +695,7 @@
|
|
|
SelectCommissionOrderModalRef,
|
|
|
selectCommissionList,
|
|
|
addSonList,
|
|
|
+ addCommission,
|
|
|
listHeard,
|
|
|
changeSeller,
|
|
|
};
|