|
@@ -15,8 +15,8 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="返佣类型(bill date)" v-bind="validateInfos.commission" id="commissionPayRequest-commission" name="commission">
|
|
|
- <JDictSelectTag v-model:value="formData.commission" placeholder="请选择" dictCode="commission_type" style="width: 100%;"/>
|
|
|
+ <a-form-item label="返佣类型(commission type)" v-bind="validateInfos.commissionType" id="commissionPayRequest-commissionType" name="commissionType">
|
|
|
+ <JDictSelectTag v-model:value="formData.commissionType" placeholder="请选择" dictCode="commission_type" style="width: 100%;"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -84,7 +84,6 @@
|
|
|
:rowNumber="true"
|
|
|
:rowSelection="true"
|
|
|
asyncRemove
|
|
|
- @valueChange="changeValues"
|
|
|
>
|
|
|
<template #action="props">
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="handleDelete1(props)">
|
|
@@ -94,7 +93,6 @@
|
|
|
</j-vxe-table>
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
- <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
<SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addDetailList"></SelectSaleOrderModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
@@ -106,7 +104,6 @@
|
|
|
import { queryPaymentDetailListByMainId,queryDataById, saveOrUpdate ,listPayee} from '../commissionPayRequestForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import { paymentDetailColumns} from '../commissionPayRequestList.data';
|
|
|
- import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
import SelectSaleOrderModal from '../../../publicComponents/SelectSaleOrderModal.vue';
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
@@ -121,7 +118,6 @@
|
|
|
JVxeTable,
|
|
|
JFormContainer,
|
|
|
JUpload,
|
|
|
- SelectProjectModal,
|
|
|
JDictSelectTag,
|
|
|
SelectSaleOrderModal,
|
|
|
ApiSelect
|
|
@@ -139,7 +135,6 @@
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
const SelectSaleOrderModalRef = ref()
|
|
|
- var SelectProjectModalRef = ref()
|
|
|
const paymentDetailsTableRef = ref();
|
|
|
const paymentDetailsTable = reactive<Record<string, any>>({
|
|
|
loading: false,
|
|
@@ -154,7 +149,7 @@
|
|
|
sourceCode:'',
|
|
|
billDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
billCode: '',
|
|
|
- commission: '',
|
|
|
+ commissionType: '',
|
|
|
payee: '',
|
|
|
expectedPaymentDate: '',
|
|
|
currency: '',
|
|
@@ -217,7 +212,7 @@
|
|
|
}
|
|
|
|
|
|
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
|
|
- 'saleQuotationProduct': paymentDetailsTableRef,
|
|
|
+ 'purCommissionRequestDetails': paymentDetailsTableRef,
|
|
|
});
|
|
|
//获取表单信息
|
|
|
async function getFormData() {
|
|
@@ -237,11 +232,11 @@
|
|
|
}
|
|
|
//保存
|
|
|
async function submitForm() {
|
|
|
- if(formData.sourceCode==''){
|
|
|
+ const mainData = await getFormData();
|
|
|
+ const subData = await getSubFormAndTableData();
|
|
|
+ if(!subData.purCommissionRequestDetailsList||subData.purCommissionRequestDetailsList.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
|
|
@@ -272,45 +267,20 @@
|
|
|
var newArray = [...paymentDetailsTable.dataSource]
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
paymentDetailsTable.dataSource = newArray
|
|
|
- // if( paymentDetailsTable.dataSource.length!==0){
|
|
|
- // var arr = []
|
|
|
- // paymentDetailsTable.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
|
|
|
- // }
|
|
|
- }
|
|
|
- //选择项目
|
|
|
- function addProject(data) {
|
|
|
- if(data.length==0){
|
|
|
- formData.project =
|
|
|
- formData.projectName = ''
|
|
|
- }else{
|
|
|
- formData.project = data[0].id
|
|
|
- formData.projectName = data[0].name
|
|
|
- // formData.customer =data[0].customerId
|
|
|
- // formData.customerName =data[0].customerId_dictText
|
|
|
- }
|
|
|
- }
|
|
|
- //选择项目
|
|
|
- function onSearchProject(){
|
|
|
- SelectProjectModalRef.value.getTable()
|
|
|
- }
|
|
|
- function changeValues(prop){
|
|
|
|
|
|
}
|
|
|
function selectOrder(){
|
|
|
SelectSaleOrderModalRef.value.getTableFromSalePayRequestForm()
|
|
|
}
|
|
|
- function addDetailList(){
|
|
|
+ function addDetailList(data){
|
|
|
+ data.map(item=>{
|
|
|
+ item.sourceId = item.childId
|
|
|
+ item.saleCode = item.billCode
|
|
|
+ item.saleId = item.id
|
|
|
+ item.orderMoney = item.taxAmount
|
|
|
+ })
|
|
|
+ var arrSonFormDelivery = data.concat(paymentDetailsTable.dataSource)
|
|
|
+ paymentDetailsTable.dataSource=arrSonFormDelivery
|
|
|
|
|
|
}
|
|
|
return {
|
|
@@ -331,10 +301,6 @@
|
|
|
edit,
|
|
|
formRef,
|
|
|
handleDelete1,
|
|
|
- SelectProjectModalRef,
|
|
|
- onSearchProject,
|
|
|
- addProject,
|
|
|
- changeValues,
|
|
|
SelectSaleOrderModalRef,
|
|
|
selectOrder,
|
|
|
addDetailList,
|