|
@@ -14,6 +14,7 @@
|
|
|
<span>{{ `${scope.row.productLong} * ${scope.row.productWide} * ${scope.row.productHigh}` }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="可调拨数量" prop="transferQuantity" width="120" v-if="form.type == '5'" />
|
|
|
<el-table-column label="入库数量" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item :prop="'details.' + scope.$index + '.quantity'" :rules="formRules.quantity" :inline-message="true">
|
|
@@ -38,6 +39,7 @@
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import SelectBOM from '@/components/shengde/SelectBOM/index'
|
|
|
+import { getComeOrder } from '@/api/shengde/warehouse/outAndInWarehouse'
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
@@ -68,6 +70,14 @@ export default {
|
|
|
return flag
|
|
|
},
|
|
|
selectBOM() {
|
|
|
+ if (this.form.type == '5') {
|
|
|
+ if (!this.form.subsidiaryId) {
|
|
|
+ return this.msgInfo('请先选择事业部')
|
|
|
+ }
|
|
|
+ if (!this.form.oldWarehouseId) {
|
|
|
+ return this.msgInfo('请先选择原仓库')
|
|
|
+ }
|
|
|
+ }
|
|
|
this.openSelect = true
|
|
|
},
|
|
|
handleSelect(data, index) {
|
|
@@ -76,7 +86,23 @@ export default {
|
|
|
if (row && row.id) {
|
|
|
let tableData = this.form.details.filter((item) => item.businessId === row.id)
|
|
|
if (tableData && tableData.length > 0) {
|
|
|
- this.msgInfo('该物料已添加')
|
|
|
+ return this.msgInfo('该物料已添加')
|
|
|
+ }
|
|
|
+ if (this.form.type == '5') {
|
|
|
+ getComeOrder({ warehouseId: this.form.oldWarehouseId, businessId: row.id, subsidiaryId: this.form.subsidiaryId }).then((res) => {
|
|
|
+ this.form.details.push({
|
|
|
+ businessId: row.id,
|
|
|
+ quantity: undefined,
|
|
|
+ genre: 2,
|
|
|
+ productLong: row.productLong,
|
|
|
+ productWide: row.productWide,
|
|
|
+ productHigh: row.productHigh,
|
|
|
+ nameChinese: row.nameChinese,
|
|
|
+ specCode: row.specCode,
|
|
|
+ transferQuantity: Number(res.data.data),
|
|
|
+ })
|
|
|
+ return this.msgSuccess('添加成功')
|
|
|
+ })
|
|
|
} else {
|
|
|
this.form.details.push({
|
|
|
businessId: row.id,
|
|
@@ -88,13 +114,13 @@ export default {
|
|
|
nameChinese: row.nameChinese,
|
|
|
specCode: row.specCode,
|
|
|
})
|
|
|
- this.msgSuccess('添加成功')
|
|
|
+ return this.msgSuccess('添加成功')
|
|
|
}
|
|
|
} else {
|
|
|
- this.msgInfo('添加失败')
|
|
|
+ return this.msgInfo('添加失败')
|
|
|
}
|
|
|
} else {
|
|
|
- this.msgInfo('添加失败')
|
|
|
+ return this.msgInfo('添加失败')
|
|
|
}
|
|
|
},
|
|
|
clickRemove(index) {
|