|
@@ -21,54 +21,55 @@
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="项目(project)" v-bind="validateInfos.projectName" id="saleInvoiceForm-projectName" name="projectName">
|
|
|
- <a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" allow-clear enter-button="Search" @search="onSearchProject"></a-input-search>
|
|
|
+ <a-input v-model:value="formData.projectName" placeholder="请输入" disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="销售订单(sale order)" v-bind="validateInfos.saleOrder" id="saleInvoiceForm-saleOrder" name="saleOrder">
|
|
|
- <a-input-search v-model:value="formData.saleOrder" placeholder="请输入" allow-clear enter-button="Search" ></a-input-search>
|
|
|
+ <a-input-search v-model:value="formData.saleOrder" placeholder="请输入" allow-clear enter-button="Search" @search="onSearchSaleOrderMianModal"></a-input-search>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="购方(buyer)" v-bind="validateInfos.buyer" id="saleInvoiceForm-buyer" name="buyer" >
|
|
|
- <JSelectInput v-model:value="formData.buyer" placeholder="请选择" :options="customerOption" ></JSelectInput>
|
|
|
+ <a-form-item label="购方(buyer)" v-bind="validateInfos.customer" id="saleInvoiceForm-customer" name="customer" >
|
|
|
+ <JSelectInput v-model:value="formData.customer" placeholder="请选择" :options="customerOption" ></JSelectInput>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="发票金额(invoice money)" v-bind="validateInfos.invoiceMoney" id="saleInvoiceForm-invoiceMoney" name="invoiceMoney">
|
|
|
- <a-input v-model:value="formData.invoiceMoney" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
+ <a-form-item label="发票金额(invoice money)" v-bind="validateInfos.invoiceAmount" id="saleInvoiceForm-invoiceAmount" name="invoiceAmount">
|
|
|
+ <a-input v-model:value="formData.invoiceAmount" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="收款金额(amount collected)" v-bind="validateInfos.amountCollected" id="saleInvoiceForm-amountCollected" name="amountCollected">
|
|
|
- <a-input v-model:value="formData.amountCollected" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
+ <a-input v-model:value="formData.amountCollected" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="预收金额(advance payment amount)" v-bind="validateInfos.advancePaymentAmount" id="saleInvoiceForm-advancePaymentAmount" name="advancePaymentAmount">
|
|
|
- <a-input v-model:value="formData.advancePaymentAmount" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
+ <a-form-item label="预收金额(advance payment amount)" v-bind="validateInfos.advanceAmount" id="saleInvoiceForm-advanceAmount" name="advanceAmount">
|
|
|
+ <a-input v-model:value="formData.advanceAmount" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="预收比例(advance payment ratio)" v-bind="validateInfos.advancePaymentRatio" id="saleInvoiceForm-advancePaymentRatio" name="advancePaymentRatio">
|
|
|
- <a-input v-model:value="formData.advancePaymentRatio" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <a-form-item label="预收比例(advance payment ratio)" v-bind="validateInfos.advanceRatio" id="saleInvoiceForm-advanceRatio" name="advanceRatio">
|
|
|
+ <a-input v-model:value="formData.advanceRatio" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</template>
|
|
|
</JFormContainer>
|
|
|
- <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
- <SelectInvoiceModal ref="SelectInvoiceModalRef"></SelectInvoiceModal>
|
|
|
+ <SelectSaleOrderMianModal ref="SelectSaleOrderMianModalModalRef" @selectSaleOrderMian="addSaleOrderMain"></SelectSaleOrderMianModal>
|
|
|
+ <SelectInvoiceModal ref="SelectInvoiceModalRef" @selectInvoice="addInvoice"></SelectInvoiceModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
+ import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
import {queryDataById, saveOrUpdate } from '../receiptOrderForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
- import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
+ import SelectSaleOrderMianModal from '../../../publicComponents/SelectSaleOrderMianModal.vue';
|
|
|
import SelectInvoiceModal from './SelectInvoiceModal.vue';
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
@@ -85,7 +86,7 @@
|
|
|
JVxeTable,
|
|
|
JFormContainer,
|
|
|
JUpload,
|
|
|
- SelectProjectModal,
|
|
|
+ SelectSaleOrderMianModal,
|
|
|
JDictSelectTag,
|
|
|
JSelectInput,
|
|
|
JSelectMultiple,
|
|
@@ -103,7 +104,7 @@
|
|
|
setup(props, {emit}) {
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
- var SelectProjectModalRef = ref()
|
|
|
+ var SelectSaleOrderMianModalModalRef = ref()
|
|
|
const SelectInvoiceModalRef = ref()
|
|
|
var customerOption =ref([]);
|
|
|
const formData = reactive<Record<string, any>>({
|
|
@@ -113,15 +114,17 @@
|
|
|
billDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
billCode: '',
|
|
|
invoice:'',
|
|
|
+ invoiceId:'',
|
|
|
project: '',
|
|
|
projectName: '',
|
|
|
saleOrder:'',
|
|
|
- buyer: '',
|
|
|
- buyerName: '',
|
|
|
- invoiceMoney: '',
|
|
|
+ saleOrderId:'',
|
|
|
+ customer: '',
|
|
|
+ customerName: '',
|
|
|
+ invoiceAmount: '',
|
|
|
amountCollected: '',
|
|
|
- advancePaymentAmount: '',
|
|
|
- advancePaymentRatio: '',
|
|
|
+ advanceAmount: '',
|
|
|
+ advanceRatio: '',
|
|
|
});
|
|
|
|
|
|
//表单验证
|
|
@@ -175,6 +178,7 @@
|
|
|
//赋值
|
|
|
Object.assign(formData,tmpData);
|
|
|
}
|
|
|
+ const {transformData} = useValidateAntFormAndTable();
|
|
|
//获取表单信息
|
|
|
async function getFormData() {
|
|
|
try {
|
|
@@ -218,15 +222,21 @@
|
|
|
function handleFormChange(key, value) {
|
|
|
formData[key] = value;
|
|
|
}
|
|
|
- //选择项目
|
|
|
- function addProject(data) {
|
|
|
- if(data.length==0){
|
|
|
- formData.project =
|
|
|
- formData.projectName = ''
|
|
|
- }else{
|
|
|
- formData.project = data[0].id
|
|
|
- formData.projectName = data[0].name
|
|
|
- }
|
|
|
+ function addSaleOrderMain(data) {
|
|
|
+ formData.saleOrder = data[0].billCode
|
|
|
+ formData.project = data[0].project
|
|
|
+ formData.projectName = data[0].projectName
|
|
|
+ formData.customer = data[0].customer
|
|
|
+ formData.customerName = data[0].customerName
|
|
|
+ formData.saleOrderId = data[0].id
|
|
|
+ }
|
|
|
+ function addInvoice(data){
|
|
|
+ debugger
|
|
|
+ formData.invoice = data[0].invoiceCode
|
|
|
+ formData.invoiceId = data[0].id
|
|
|
+ formData.invoiceAmount = data[0].taxMoney
|
|
|
+ formData.customer = data[0].customer
|
|
|
+ formData.customer = data[0].buyerTaxNumber
|
|
|
}
|
|
|
//获取客户列表
|
|
|
function getCustomerOptions(){
|
|
@@ -247,8 +257,8 @@
|
|
|
})
|
|
|
}
|
|
|
//选择项目
|
|
|
- function onSearchProject(){
|
|
|
- SelectProjectModalRef.value.getTable()
|
|
|
+ function onSearchSaleOrderMianModal(){
|
|
|
+ SelectSaleOrderMianModalModalRef.value.getTable()
|
|
|
}
|
|
|
function onSearchInvoice(){
|
|
|
SelectInvoiceModalRef.value.getTable()
|
|
@@ -267,13 +277,14 @@
|
|
|
add,
|
|
|
edit,
|
|
|
formRef,
|
|
|
- SelectProjectModalRef,
|
|
|
- onSearchProject,
|
|
|
- addProject,
|
|
|
+ SelectSaleOrderMianModalModalRef,
|
|
|
+ onSearchSaleOrderMianModal,
|
|
|
+ addSaleOrderMain,
|
|
|
getCustomerOptions,
|
|
|
customerOption,
|
|
|
onSearchInvoice,
|
|
|
- SelectInvoiceModalRef
|
|
|
+ SelectInvoiceModalRef,
|
|
|
+ addInvoice
|
|
|
}
|
|
|
}
|
|
|
});
|