|
@@ -2,7 +2,7 @@
|
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" width="95%" @ok="handleSubmit">
|
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" width="95%" @ok="handleSubmit">
|
|
<BasicForm @register="registerForm" ref="formRef" name="SaleContractForm">
|
|
<BasicForm @register="registerForm" ref="formRef" name="SaleContractForm">
|
|
<template #quotationProjectName="props">
|
|
<template #quotationProjectName="props">
|
|
- <a-input-search v-model:value="props.values.quotationProjectName" :disabled="saleContractProductTable.dataSource.length!==0" allow-clear enter-button="Search" @search="onSearchProject( props)"></a-input-search>
|
|
|
|
|
|
+ <a-input-search v-model:value="props.values.quotationProjectName" :disabled="notAllowEdit" allow-clear enter-button="Search" @search="onSearchProject( props)"></a-input-search>
|
|
</template>
|
|
</template>
|
|
</BasicForm>
|
|
</BasicForm>
|
|
<!-- 子表单区域 -->
|
|
<!-- 子表单区域 -->
|
|
@@ -55,7 +55,7 @@
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
- <BaseShipArchiveAccessoriesList ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesList>
|
|
|
|
|
|
+ <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
|
|
<SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct="addProduct"></SelectPrpductModal>
|
|
<SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct="addProduct"></SelectPrpductModal>
|
|
<SelectQuotationModal ref="SelectQuotationModalRef" @selectQuotation="addQuotation"></SelectQuotationModal>
|
|
<SelectQuotationModal ref="SelectQuotationModalRef" @selectQuotation="addQuotation"></SelectQuotationModal>
|
|
</BasicModal>
|
|
</BasicModal>
|
|
@@ -70,12 +70,13 @@
|
|
import {formSchema,saleContractShipColumns,saleContractProductColumns} from '../SaleContract.data';
|
|
import {formSchema,saleContractShipColumns,saleContractProductColumns} from '../SaleContract.data';
|
|
import {saveOrUpdate,saleContractShipList,saleContractProductList,querysaleVersonFormShipListByMainId,querySaleVersonProductListByMainId,queryVersonHistoryById} from '../SaleContract.api';
|
|
import {saveOrUpdate,saleContractShipList,saleContractProductList,querysaleVersonFormShipListByMainId,querySaleVersonProductListByMainId,queryVersonHistoryById} from '../SaleContract.api';
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
- import SelectProjectModal from './SelectProjectModal.vue';
|
|
|
|
|
|
+ import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
import SelectQuotationModal from '../../../publicComponents/SelectQuotationModal.vue';
|
|
import SelectQuotationModal from '../../../publicComponents/SelectQuotationModal.vue';
|
|
- import BaseShipArchiveAccessoriesList from './BaseShipArchiveAccessoriesModal.vue';
|
|
|
|
- import SelectPrpductModal from './SelectPrpductModal.vue';
|
|
|
|
|
|
+ import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
|
|
+ import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
+ import { message } from 'ant-design-vue';
|
|
// Emits声明
|
|
// Emits声明
|
|
const emit = defineEmits(['register','success']);
|
|
const emit = defineEmits(['register','success']);
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
@@ -84,6 +85,7 @@
|
|
var title = ref('');
|
|
var title = ref('');
|
|
const formDisabled = ref(false);
|
|
const formDisabled = ref(false);
|
|
const refKeys = ref(['saleContractShip', 'saleContractProduct', ]);
|
|
const refKeys = ref(['saleContractShip', 'saleContractProduct', ]);
|
|
|
|
+ var notAllowEdit = ref(false);
|
|
const activeKey = ref('saleContractShip');
|
|
const activeKey = ref('saleContractShip');
|
|
const saleContractShip = ref();
|
|
const saleContractShip = ref();
|
|
const saleContractProduct = ref();
|
|
const saleContractProduct = ref();
|
|
@@ -132,6 +134,7 @@
|
|
});
|
|
});
|
|
requestSubTableData(saleContractShipList, {id:data?.record?.id}, saleContractShipTable)
|
|
requestSubTableData(saleContractShipList, {id:data?.record?.id}, saleContractShipTable)
|
|
requestSubTableData(saleContractProductList, {id:data?.record?.id}, saleContractProductTable)
|
|
requestSubTableData(saleContractProductList, {id:data?.record?.id}, saleContractProductTable)
|
|
|
|
+ notAllowEdit.value=true
|
|
}else{
|
|
}else{
|
|
await setFieldsValue({ billDate: moment(new Date()).format('YYYY-MM-DD')});
|
|
await setFieldsValue({ billDate: moment(new Date()).format('YYYY-MM-DD')});
|
|
await setFieldsValue({ salesman: userStore.getUserInfo.username });
|
|
await setFieldsValue({ salesman: userStore.getUserInfo.username });
|
|
@@ -153,13 +156,18 @@
|
|
saleContractProductTable.dataSource = [];
|
|
saleContractProductTable.dataSource = [];
|
|
}
|
|
}
|
|
function classifyIntoFormData(allValues) {
|
|
function classifyIntoFormData(allValues) {
|
|
- let main = Object.assign({}, allValues.formValue)
|
|
|
|
- return {
|
|
|
|
- ...main, // 展开
|
|
|
|
- saleContractShipList: allValues.tablesValue[0].tableData,
|
|
|
|
- saleContractProductList: allValues.tablesValue[1].tableData,
|
|
|
|
|
|
+ if(allValues.formValue.sourceCode==''||!allValues.formValue.sourceCode){
|
|
|
|
+ message.error('请选择报价单');
|
|
|
|
+ }else{
|
|
|
|
+ let main = Object.assign({}, allValues.formValue)
|
|
|
|
+ return {
|
|
|
|
+ ...main, // 展开
|
|
|
|
+ saleContractShipList: allValues.tablesValue[0].tableData,
|
|
|
|
+ saleContractProductList: allValues.tablesValue[1].tableData,
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
//表单提交事件
|
|
//表单提交事件
|
|
async function requestAddOrEdit(values) {
|
|
async function requestAddOrEdit(values) {
|
|
try {
|
|
try {
|
|
@@ -179,15 +187,21 @@
|
|
SelectProjectModalRef.value.getTable()
|
|
SelectProjectModalRef.value.getTable()
|
|
}
|
|
}
|
|
async function addProject(data) {
|
|
async function addProject(data) {
|
|
- await setFieldsValue({ quotationProjectName: data[0].name });
|
|
|
|
- await setFieldsValue({ quotationProject: data[0].id });
|
|
|
|
- await setFieldsValue({ quotationCustomerName: data[0].customerId_dictText });
|
|
|
|
- await setFieldsValue({ quotationCustomer: data[0].customerId });
|
|
|
|
- customerOption.value.map(item=>{
|
|
|
|
- if(item.value==data[0].customerId){
|
|
|
|
- setFieldsValue({ priority:item.priority});
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if(data.length==0){
|
|
|
|
+ await setFieldsValue({ quotationProjectName: '' });
|
|
|
|
+ await setFieldsValue({ quotationProject: '' });
|
|
|
|
+ }else{
|
|
|
|
+ await setFieldsValue({ quotationProjectName: data[0].name });
|
|
|
|
+ await setFieldsValue({ quotationProject: data[0].id });
|
|
|
|
+ await setFieldsValue({ quotationCustomerName: data[0].customerId_dictText });
|
|
|
|
+ await setFieldsValue({ quotationCustomer: data[0].customerId });
|
|
|
|
+ customerOption.value.map(item=>{
|
|
|
|
+ if(item.value==data[0].customerId){
|
|
|
|
+ setFieldsValue({ priority:item.priority});
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
function getCustomerOptions(){
|
|
function getCustomerOptions(){
|
|
let params = {pageSize:'-1',status:1}
|
|
let params = {pageSize:'-1',status:1}
|
|
@@ -235,6 +249,21 @@
|
|
var newArray = [...saleContractProductTable.dataSource]
|
|
var newArray = [...saleContractProductTable.dataSource]
|
|
newArray.splice(prop.rowIndex, 1)
|
|
newArray.splice(prop.rowIndex, 1)
|
|
saleContractProductTable.dataSource = newArray
|
|
saleContractProductTable.dataSource = newArray
|
|
|
|
+ if( saleContractProductTable.dataSource.length!==0){
|
|
|
|
+ var arr = []
|
|
|
|
+ saleContractProductTable.dataSource.map(item=>{
|
|
|
|
+ if(item.sourceId){
|
|
|
|
+ arr.push(item.sourceId)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(arr.length==0){
|
|
|
|
+ setFieldsValue({sourceCode:'',})
|
|
|
|
+ notAllowEdit.value=false
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ setFieldsValue({sourceCode:'',})
|
|
|
|
+ notAllowEdit.value=false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
function addQuotation(data){
|
|
function addQuotation(data){
|
|
var arrProduct = data.concat(saleContractProductTable.dataSource)
|
|
var arrProduct = data.concat(saleContractProductTable.dataSource)
|
|
@@ -243,6 +272,7 @@
|
|
item.sourceId = item.childId
|
|
item.sourceId = item.childId
|
|
})
|
|
})
|
|
saleContractProductTable.dataSource=arrProduct
|
|
saleContractProductTable.dataSource=arrProduct
|
|
|
|
+ notAllowEdit.value=true
|
|
setFieldsValue({
|
|
setFieldsValue({
|
|
sourceCode:data[0].billCode,
|
|
sourceCode:data[0].billCode,
|
|
quotationProjectName:data[0].quotationProjectName,
|
|
quotationProjectName:data[0].quotationProjectName,
|