|
@@ -195,7 +195,7 @@ export default {
|
|
|
this.qkrow(row)
|
|
|
if (val) {
|
|
|
row['goodsCategoryName'] = selectList.find(item => item.categoryId == val).categoryName
|
|
|
- materialNormList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.category_id", "compare": "=", "value": val }] }).then(res => {
|
|
|
+ materialNormList({ isShowStockQty: true, websitId: this.formData.websitId, "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.category_id", "compare": "=", "value": val }] }).then(res => {
|
|
|
this.materialNormList = res.data.records
|
|
|
})
|
|
|
} else {
|
|
@@ -342,7 +342,9 @@ export default {
|
|
|
onInput={(val) => {
|
|
|
row[column.columnAttributes.prop] = val
|
|
|
if (val) {
|
|
|
- row.costValue = Number(row.cost) * Number(val)
|
|
|
+ row.costValue = this.setNumber(
|
|
|
+ Number(row.cost) * Number(val)
|
|
|
+ )
|
|
|
} else {
|
|
|
row.costValue = ""
|
|
|
}
|
|
@@ -378,7 +380,9 @@ export default {
|
|
|
onInput={(val) => {
|
|
|
row[column.columnAttributes.prop] = val
|
|
|
if (val) {
|
|
|
- row.retValue = Number(row.cost) * Number(val)
|
|
|
+ row.retValue = this.setNumber(
|
|
|
+ Number(row.cost) * Number(val)
|
|
|
+ )
|
|
|
} else {
|
|
|
row.retValue = ""
|
|
|
}
|
|
@@ -496,7 +500,7 @@ export default {
|
|
|
return []
|
|
|
})(),
|
|
|
...(() => {
|
|
|
- if (this.formData.flag === "SAVE" && !!~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.pageType)) {
|
|
|
+ if (!!~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials', 'partsStorage', 'partsReturn'].indexOf(this.pageType)) {
|
|
|
return [{
|
|
|
columnAttributes: {
|
|
|
label: '库存数量',
|
|
@@ -540,7 +544,7 @@ export default {
|
|
|
item.isEditRow = false
|
|
|
}
|
|
|
if (!!~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.pageType) && row.goodsCategoryId) {
|
|
|
- materialNormList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.category_id", "compare": "=", "value": row.goodsCategoryId }] }).then(res => {
|
|
|
+ materialNormList({ isShowStockQty: true, websitId: this.formData.websitId, "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.category_id", "compare": "=", "value": row.goodsCategoryId }] }).then(res => {
|
|
|
this.materialNormList = res.data.records
|
|
|
})
|
|
|
}
|
|
@@ -735,35 +739,36 @@ export default {
|
|
|
{!!~[0, 1].indexOf(this.formDialogType) ? <div style="margin-bottom:8px">
|
|
|
<el-button onClick={() => {
|
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
- if (valid || !this.formData.items.length) {
|
|
|
- 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,
|
|
|
- })
|
|
|
+ if (invalidFields.websitId || invalidFields.venderId) {
|
|
|
+ return
|
|
|
}
|
|
|
+ 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}
|
|
@@ -908,5 +913,8 @@ export default {
|
|
|
jiaoyan() {
|
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => { }, false)
|
|
|
},
|
|
|
+ setNumber(val) {
|
|
|
+ return Number(val.toFixed(2))
|
|
|
+ }
|
|
|
},
|
|
|
}
|