|
|
@@ -6,6 +6,74 @@
|
|
|
width="1200px"
|
|
|
append-to-body
|
|
|
>
|
|
|
+ <el-form
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="formData"
|
|
|
+ :rules="formRules"
|
|
|
+ label-width="150px"
|
|
|
+ class="form-container"
|
|
|
+ >
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12"
|
|
|
+ ><el-form-item label="调拨类型" prop="transferType">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.transferType"
|
|
|
+ placeholder="请选择调拨类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in getDictDatas('erp_move_out_type')"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="调入仓库" prop="stockIdNew">
|
|
|
+ <StockSelect
|
|
|
+ :ref="`stock`"
|
|
|
+ v-model="formData.stockIdNew"
|
|
|
+ filterable
|
|
|
+ @change="
|
|
|
+ ($event) => {
|
|
|
+ stockChange($event);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="调入区域" prop="areaIdNew">
|
|
|
+ <AreaSelect
|
|
|
+ :ref="`area`"
|
|
|
+ v-model="formData.areaIdNew"
|
|
|
+ filterable
|
|
|
+ @change="
|
|
|
+ ($event) => {
|
|
|
+ areaChange($event);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="调入货位" prop="locationIdNew">
|
|
|
+ <LocationSelect
|
|
|
+ :ref="`location`"
|
|
|
+ v-model="formData.locationIdNew"
|
|
|
+ filterable
|
|
|
+ @change="
|
|
|
+ ($event) => {
|
|
|
+ locationChange($event);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
<!-- 列表 -->
|
|
|
<el-table v-loading="loading" :data="currentRows" border>
|
|
|
<el-table-column
|
|
|
@@ -51,8 +119,8 @@
|
|
|
width="120"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- label="调整后仓库"
|
|
|
+ <!-- <el-table-column
|
|
|
+ label="调入仓库"
|
|
|
align="center"
|
|
|
prop="stockIdNew"
|
|
|
width="160"
|
|
|
@@ -71,7 +139,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="调整后区域"
|
|
|
+ label="调入区域"
|
|
|
align="center"
|
|
|
prop="areaIdNew"
|
|
|
width="120"
|
|
|
@@ -90,7 +158,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="调整后货位"
|
|
|
+ label="调入货位"
|
|
|
align="center"
|
|
|
prop="locationIdNew"
|
|
|
width="120"
|
|
|
@@ -107,7 +175,7 @@
|
|
|
"
|
|
|
/>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="操作人" align="center" prop="creator" />
|
|
|
</el-table>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -143,6 +211,39 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ formData: {
|
|
|
+ transferType: undefined,
|
|
|
+ stockIdNew: undefined,
|
|
|
+ areaIdNew: undefined,
|
|
|
+ locationIdNew: undefined,
|
|
|
+ },
|
|
|
+ // 表单校验
|
|
|
+ formRules: {
|
|
|
+ transferType: [
|
|
|
+ { required: true, message: "请选择调拨类型", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ stockIdNew: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择调入仓库",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ areaIdNew: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择调入区域",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ locationIdNew: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择调入货位",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
// 遮罩层
|
|
|
loading: false,
|
|
|
// WMS库内业务-货位调整列表
|
|
|
@@ -183,8 +284,8 @@ export default {
|
|
|
this.$nextTick(async () => {
|
|
|
for (let x = 0; x < this.currentRows.length; x++) {
|
|
|
const { stockCode, stockIdOld } = this.currentRows[x];
|
|
|
- await this.$refs[`stock-${x}`].fetchStockList();
|
|
|
- this.stockChange({ id: Number(stockIdOld), code: stockCode }, x);
|
|
|
+ await this.$refs[`stock`].fetchStockList();
|
|
|
+ // this.stockChange({ id: Number(stockIdOld), code: stockCode }, x);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -216,34 +317,39 @@ export default {
|
|
|
stockChange(item, index) {
|
|
|
if (item) {
|
|
|
const { id, code } = item;
|
|
|
- this.$refs[`stock-${index}`].value = Number(id);
|
|
|
- this.currentRows[index].stockCodeNew = code;
|
|
|
- this.currentRows[index].stockIdNew = id;
|
|
|
+ this.$refs[`stock`].value = Number(id);
|
|
|
+ this.formData.stockCodeNew = code;
|
|
|
+ this.formData.stockIdNew = id;
|
|
|
|
|
|
- this.$refs[`area-${index}`].value = "";
|
|
|
- this.$refs[`area-${index}`].options = [];
|
|
|
- this.$refs[`area-${index}`].fetchAreaList(id);
|
|
|
- this.$refs[`location-${index}`].options = [];
|
|
|
- this.$refs[`location-${index}`].value = "";
|
|
|
+ this.$refs[`area`].value = "";
|
|
|
+ this.$refs[`area`].options = [];
|
|
|
+ this.$refs[`area`].fetchAreaList(id);
|
|
|
+ this.$refs[`location`].options = [];
|
|
|
+ this.$refs[`location`].value = "";
|
|
|
}
|
|
|
},
|
|
|
areaChange(item, index) {
|
|
|
if (item) {
|
|
|
const { id, code } = item;
|
|
|
- this.currentRows[index].areaCodeNew = code;
|
|
|
- this.$refs[`location-${index}`].options = [];
|
|
|
- this.$refs[`location-${index}`].fetchLocationList(id);
|
|
|
+ this.formData.areaCodeNew = code;
|
|
|
+ this.$refs[`location`].options = [];
|
|
|
+ this.$refs[`location`].fetchLocationList(id);
|
|
|
}
|
|
|
},
|
|
|
locationChange(item, index) {
|
|
|
if (item) {
|
|
|
const { code } = item;
|
|
|
- this.currentRows[index].locationCodeNew = code;
|
|
|
+ this.formData.locationCodeNew = code;
|
|
|
}
|
|
|
},
|
|
|
// 调整货位
|
|
|
- handleAdjustLocation() {
|
|
|
- const isEmpty = this.currentRows.every(
|
|
|
+ async handleAdjustLocation() {
|
|
|
+ // 校验主表
|
|
|
+ await this.$refs["ruleForm"].validate();
|
|
|
+ let data = this.currentRows.map((v) => {
|
|
|
+ return { ...v, ...this.formData };
|
|
|
+ });
|
|
|
+ const isEmpty = data.every(
|
|
|
(item) => item.stockIdNew && item.areaIdNew && item.locationIdNew
|
|
|
);
|
|
|
if (!isEmpty) {
|
|
|
@@ -252,7 +358,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.loading = true;
|
|
|
- stockTransfer(this.currentRows)
|
|
|
+ stockTransfer(data)
|
|
|
.then((res) => {
|
|
|
this.$modal.msgSuccess("调拨成功");
|
|
|
this.open = false;
|