|
@@ -20,7 +20,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" id="SaleOrderForm-supplierName" name="supplierName">
|
|
|
+ <a-form-item label="供应商(supplier)" v-bind="validateInfos.supplier" id="SaleOrderForm-supplier" name="supplier">
|
|
|
<ApiSelect
|
|
|
:api="supplierOption"
|
|
|
showSearch
|
|
@@ -220,6 +220,12 @@
|
|
|
});
|
|
|
//表单验证
|
|
|
const validatorRules = reactive({
|
|
|
+ projectName: [
|
|
|
+ { required: true, message: '请选择项目(select project)' }
|
|
|
+ ],
|
|
|
+ supplier: [
|
|
|
+ { required: true, message: '请选择供应商(select supplier)' }
|
|
|
+ ],
|
|
|
});
|
|
|
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
|
|
const dbData = {};
|
|
@@ -295,17 +301,25 @@
|
|
|
}
|
|
|
|
|
|
async function submitForm() {
|
|
|
- if( formData.sourceCode==''){
|
|
|
+ var xTable = stockInTableRef.value!.getXTable()
|
|
|
+ if( xTable.data.length==0){
|
|
|
message.error('请添加入库明细!');
|
|
|
}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
|
|
|
- await saveOrUpdate(values, isUpdate);
|
|
|
- //关闭弹窗
|
|
|
- emit('success');
|
|
|
+ stockInTableRef.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
|
|
|
+ await saveOrUpdate(values, isUpdate);
|
|
|
+ //关闭弹窗
|
|
|
+ emit('success');
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -316,23 +330,14 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- function getShipList(id){
|
|
|
- let params = {id:id}
|
|
|
- let url = '/purCode/purDeliveryNote/queryPurDeliveryNodeShipByMainId'
|
|
|
- defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
|
|
|
- if(res){
|
|
|
- otherInShipTable.dataSource = res.result
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
//查看配件信息
|
|
|
function viewAccessory(prop){
|
|
|
BaseShipArchiveAccessoriesModalRef.value.getTable(prop.row)
|
|
|
}
|
|
|
//入库明细-删除行
|
|
|
function handleDelete(prop) {
|
|
|
- var newArray = [...stockInTable.dataSource]
|
|
|
+ var xTable = stockInTableRef.value!.getXTable()
|
|
|
+ var newArray = [...xTable.data]
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
stockInTable.dataSource = newArray
|
|
|
}
|
|
@@ -354,7 +359,8 @@
|
|
|
item.productCode = item.code
|
|
|
item.productId = item.id
|
|
|
})
|
|
|
- var arrProduct = data.concat(stockInTable.dataSource)
|
|
|
+ var xTable = stockInTableRef.value!.getXTable()
|
|
|
+ var arrProduct = xTable.data.concat(data)
|
|
|
stockInTable.dataSource=arrProduct
|
|
|
}
|
|
|
function selectProductList(){
|
|
@@ -365,9 +371,9 @@
|
|
|
}
|
|
|
function addShip(data){
|
|
|
data.map(item=>item.shipowner = item.relateCustomer)
|
|
|
- var arr = data.concat(otherInShipTable.dataSource)
|
|
|
+ var xTable = otherInShipTableRef.value!.getXTable()
|
|
|
+ var arr = xTable.data.concat(data)
|
|
|
otherInShipTable.dataSource=arr
|
|
|
-
|
|
|
}
|
|
|
async function changeSupplier(prop){
|
|
|
if(prop){
|
|
@@ -444,5 +450,8 @@
|
|
|
/deep/.ant-form-item{
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
-
|
|
|
+ /deep/.vxe-cell--valid-error-msg{
|
|
|
+ color: white !important;
|
|
|
+ background-color: white !important;
|
|
|
+ }
|
|
|
</style>
|