|
@@ -137,6 +137,14 @@
|
|
|
<a-input v-model:value="formData.notes" placeholder="请输入备注(notes)" allow-clear AutoComplete="off"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="是否收取客户运费(Customer shipping fee)" v-bind="validateInfos.customerFee " id="SaleOrderForm-customerFee" name="customerFee" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-select v-model:value="formData.customerFee ">
|
|
|
+ <a-select-option value="是"> 是 </a-select-option>
|
|
|
+ <a-select-option value="否"> 否 </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</template>
|
|
@@ -297,7 +305,8 @@
|
|
|
notes: '',
|
|
|
invoiceHeader:'',
|
|
|
otherFee :'',
|
|
|
- packingDetails:''
|
|
|
+ packingDetails:'',
|
|
|
+ customerFee:''
|
|
|
});
|
|
|
|
|
|
//表单验证
|
|
@@ -305,6 +314,9 @@
|
|
|
projectName: [
|
|
|
{ required: true, message: '请选择项目(select project)' }
|
|
|
],
|
|
|
+ customerFee:[
|
|
|
+ { required: true, message: '请选择是否收取客户运费(Customer shipping fee)' }
|
|
|
+ ],
|
|
|
});
|
|
|
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
|
|
const dbData = {};
|
|
@@ -401,12 +413,23 @@
|
|
|
} 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');
|
|
|
+ var judge = false
|
|
|
+ if(mainData.customerFee=='是'){
|
|
|
+ judge = subData.saleDeliveryDetailsList.every(item => item.sourceId && item.sourceId !== undefined && item.sourceId !== '');
|
|
|
+ }else{
|
|
|
+ judge = false
|
|
|
+ }
|
|
|
+ if(!judge){
|
|
|
+ const values = Object.assign({}, dbData, mainData, subData);
|
|
|
+ console.log('表单提交数据', values)
|
|
|
+ const isUpdate = values.id ? true : false
|
|
|
+ await saveOrUpdate(values, isUpdate);
|
|
|
+ //关闭弹窗
|
|
|
+ emit('success');
|
|
|
+ }else{
|
|
|
+ message.warning('收取客户运费时,必须选择虚拟产品')
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|