|
@@ -168,8 +168,6 @@
|
|
|
<a-tab-pane tab="采购订单 - 产品明细(product details)" key="purOrderFormShipFormProduct" :forceRender="true">
|
|
|
<a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectSaleOrderList"> 选择销售订单(select saleorder)</a-button>
|
|
|
<a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectVirtualProducts"> 选择虚拟产品(select virtual products)</a-button>
|
|
|
- <!-- <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="SelectSupplierQuotationList">选择供应商报价选定(select supplier quotation selection)</a-button> -->
|
|
|
- <!-- <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectProductList"> 选择产品(select product)</a-button> -->
|
|
|
<j-vxe-table
|
|
|
:keep-source="true"
|
|
|
resizable
|
|
@@ -214,7 +212,6 @@
|
|
|
<SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
<BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
|
|
|
- <SelectSupplierQuotation ref="SelectSupplierQuotationRef" @selectSupplierQuatationConfirm="addFromQuotation"></SelectSupplierQuotation>
|
|
|
<SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
@@ -229,7 +226,6 @@
|
|
|
import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
|
|
|
import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
import SelectSaleOrderModal from '../../../publicComponents/SelectSaleOrderModal.vue';
|
|
|
- import SelectSupplierQuotation from '../../../publicComponents/SelectSupplierQuotation.vue';
|
|
|
import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
@@ -250,7 +246,6 @@
|
|
|
JSelectInput,
|
|
|
SelectProjectModal,
|
|
|
BaseShipArchiveAccessoriesModal,
|
|
|
- SelectSupplierQuotation,
|
|
|
SelectSaleOrderModal,
|
|
|
ApiSelect
|
|
|
},
|
|
@@ -271,7 +266,6 @@
|
|
|
const SelectPrpductModalRef = ref()
|
|
|
const SelectProjectModalRef = ref()
|
|
|
const BaseShipArchiveAccessoriesModalRef = ref();
|
|
|
- const SelectSupplierQuotationRef = ref();
|
|
|
const SelectSaleOrderModalRef = ref();
|
|
|
const PurOrderFormShipFormShipTable = reactive<Record<string, any>>({
|
|
|
loading: false,
|
|
@@ -327,6 +321,12 @@
|
|
|
|
|
|
//表单验证
|
|
|
const validatorRules = reactive({
|
|
|
+ projectName: [
|
|
|
+ { required: true, message: '请选择报价项目(select project)' }
|
|
|
+ ],
|
|
|
+ currency:[
|
|
|
+ { required: true, message: '请选择币种(currency)' }
|
|
|
+ ],
|
|
|
});
|
|
|
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
|
|
const dbData = {};
|
|
@@ -465,19 +465,26 @@
|
|
|
}
|
|
|
|
|
|
async function submitForm() {
|
|
|
- if(formData.sourceCode==''&&formData.sourceCode2==''){
|
|
|
- message.warning('请选择销售订单或报价单')
|
|
|
+ var xTable = purOrderFormShipFormProductTableRef.value!.getXTable()
|
|
|
+ if(xTable.data.length==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
|
|
|
- const isRevise = values.submit=='1' ? true : false
|
|
|
- await saveOrUpdate(values, isUpdate,isRevise);
|
|
|
- //关闭弹窗
|
|
|
- emit('success');
|
|
|
- }
|
|
|
+ purOrderFormShipFormProductTableRef.value!.validateTable().then(async (errMap) => {
|
|
|
+ if (errMap) {
|
|
|
+ console.log('表单验证未通过:', { errMap });
|
|
|
+ } 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
|
|
|
+ const isRevise = values.submit=='1' ? true : false
|
|
|
+ await saveOrUpdate(values, isUpdate,isRevise);
|
|
|
+ //关闭弹窗
|
|
|
+ emit('success');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function setFieldsValue(values) {
|
|
@@ -509,32 +516,6 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- function addFromQuotation(data){
|
|
|
- data.map(item=>{
|
|
|
- item.fatherModel = item.model
|
|
|
- item.model = item.childModel
|
|
|
- item.sourceId = item.childId
|
|
|
- item.sourceType = 'Quo'+item.childId
|
|
|
- item.sourceCode =item.billCode
|
|
|
- })
|
|
|
- var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
|
|
|
- purOrderFormShipFormProductTable.dataSource=arrProduct
|
|
|
- notAllowEdit.value=true
|
|
|
- formData.sourceCode =data[0].billCode
|
|
|
- if(formData.sourceCode2==''){
|
|
|
- formData.project = data[0].inquiryProject
|
|
|
- formData.projectName = data[0].projectName
|
|
|
- formData.supplier= data[0].selectionSupplier
|
|
|
- formData.supplierName= data[0].selectionSupplier_dictText
|
|
|
- formData.priority =data[0].priority
|
|
|
- formData.productionClass =data[0].productionClass
|
|
|
- formData.model =data[0].fatherModel
|
|
|
- formData.maker =data[0].maker
|
|
|
- formData.exchangeRate = data[0].exchangeRateUsd
|
|
|
- formData.currency = data[0].currency
|
|
|
- getShipList(data[0].headId,'quotation')
|
|
|
- }
|
|
|
- }
|
|
|
function addFormSaleOrder(data){
|
|
|
data.map(item=>{
|
|
|
item.model = item.childModel
|
|
@@ -585,7 +566,8 @@
|
|
|
}
|
|
|
//产品明细-删除行
|
|
|
function handleDelete(prop) {
|
|
|
- var newArray = [...purOrderFormShipFormProductTable.dataSource]
|
|
|
+ var xTable = purOrderFormShipFormProductTableRef.value!.getXTable()
|
|
|
+ var newArray = [...xTable.data]
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
purOrderFormShipFormProductTable.dataSource = newArray
|
|
|
if( purOrderFormShipFormProductTable.dataSource.length!==0){
|
|
@@ -616,10 +598,7 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- //选择供应商报价单选定
|
|
|
- function SelectSupplierQuotationList (){
|
|
|
- SelectSupplierQuotationRef.value.getTable(formData,'purOrder')
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
// 选择销售订单
|
|
|
function selectSaleOrderList(){
|
|
@@ -655,7 +634,6 @@
|
|
|
PurOrderFormShipFormShipTable,
|
|
|
purOrderFormShipFormProductTableRef,
|
|
|
purOrderFormShipFormProductTable,
|
|
|
- SelectSupplierQuotationRef,
|
|
|
SelectSaleOrderModalRef,
|
|
|
validatorRules,
|
|
|
validateInfos,
|
|
@@ -681,8 +659,6 @@
|
|
|
BaseShipArchiveAccessoriesModalRef,
|
|
|
viewAccessory,
|
|
|
VersionDetail,
|
|
|
- SelectSupplierQuotationList,
|
|
|
- addFromQuotation,
|
|
|
notAllowEdit,
|
|
|
selectSaleOrderList,
|
|
|
addFormSaleOrder,
|
|
@@ -713,5 +689,8 @@
|
|
|
/deep/.ant-form-item{
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
-
|
|
|
+ /deep/.vxe-cell--valid-error-msg{
|
|
|
+ color: white !important;
|
|
|
+ background-color: white !important;
|
|
|
+ }
|
|
|
</style>
|