|
@@ -739,36 +739,35 @@ export default {
|
|
|
{!!~[0, 1].indexOf(this.formDialogType) ? <div style="margin-bottom:8px">
|
|
|
<el-button onClick={() => {
|
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
- if (invalidFields.websitId || invalidFields.venderId) {
|
|
|
- return
|
|
|
+ if (valid || (Object.keys(invalidFields).length == 1 && invalidFields.items)) {
|
|
|
+ this.formData.items.map((item) => { item.isEditRow = false })
|
|
|
+ this.formData.items.push({
|
|
|
+ "brand": "",
|
|
|
+ "companyWechatId": "",
|
|
|
+ "cost": "",
|
|
|
+ "costValue": "",
|
|
|
+ "goodsCategoryId": "",
|
|
|
+ "goodsCategoryName": "",
|
|
|
+ "goodsCode": "",
|
|
|
+ "goodsId": "",
|
|
|
+ "goodsName": "",
|
|
|
+ "goodsSpecification": "",
|
|
|
+ "goodsStockUnit": "",
|
|
|
+ "goodsType": "",
|
|
|
+ "note": "",
|
|
|
+ "parentCategoryId": "",
|
|
|
+ "parentCategoryName": "",
|
|
|
+ "productCategory": "",
|
|
|
+ "purchaseId": "",
|
|
|
+ "recQty": "",
|
|
|
+ "retQty": "",
|
|
|
+ "retValue": "",
|
|
|
+ "stockQty": "",
|
|
|
+ "websitId": "",
|
|
|
+ "websitName": "",
|
|
|
+ "isEditRow": true,
|
|
|
+ })
|
|
|
}
|
|
|
- this.formData.items.map((item) => { item.isEditRow = false })
|
|
|
- this.formData.items.push({
|
|
|
- "brand": "",
|
|
|
- "companyWechatId": "",
|
|
|
- "cost": "",
|
|
|
- "costValue": "",
|
|
|
- "goodsCategoryId": "",
|
|
|
- "goodsCategoryName": "",
|
|
|
- "goodsCode": "",
|
|
|
- "goodsId": "",
|
|
|
- "goodsName": "",
|
|
|
- "goodsSpecification": "",
|
|
|
- "goodsStockUnit": "",
|
|
|
- "goodsType": "",
|
|
|
- "note": "",
|
|
|
- "parentCategoryId": "",
|
|
|
- "parentCategoryName": "",
|
|
|
- "productCategory": "",
|
|
|
- "purchaseId": "",
|
|
|
- "recQty": "",
|
|
|
- "retQty": "",
|
|
|
- "retValue": "",
|
|
|
- "stockQty": "",
|
|
|
- "websitId": "",
|
|
|
- "websitName": "",
|
|
|
- "isEditRow": true,
|
|
|
- })
|
|
|
})
|
|
|
}}>添加</el-button>
|
|
|
</div> : null}
|