|
@@ -4,6 +4,7 @@
|
|
|
:visible.sync="uploadVisible"
|
|
|
width="70%"
|
|
|
:close-on-click-modal="false"
|
|
|
+ @close="handleClose"
|
|
|
>
|
|
|
<span>
|
|
|
<div style="display: flex; justify-content: space-between">
|
|
@@ -46,7 +47,6 @@
|
|
|
:prop="item.label"
|
|
|
align="center"
|
|
|
:fixed="item.fixed"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
sortable
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
@@ -97,16 +97,13 @@
|
|
|
placeholder="请填写属性描述"
|
|
|
/>
|
|
|
</span>
|
|
|
- <span v-else-if="item.label == 'fWarehouselocid'">
|
|
|
- <treeselect
|
|
|
- v-model="scope.row.fWarehouselocid"
|
|
|
- @select="getAlltree"
|
|
|
- :options="fWarehouseidOptions"
|
|
|
- :show-count="true"
|
|
|
- :disable-branch-nodes="true"
|
|
|
- placeholder="请选择库区"
|
|
|
- style="z-index:10"
|
|
|
- />
|
|
|
+ <span v-else-if="item.label == 'fWarehouseInformation'">
|
|
|
+ <el-input
|
|
|
+ placeholder="请选择"
|
|
|
+ v-model="scope.row.fWarehouseInformation"
|
|
|
+ @focus="getTreeselect(scope)"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</span>
|
|
|
<span v-else-if="item.label == 'fQty'">
|
|
|
<el-input
|
|
@@ -145,6 +142,7 @@
|
|
|
style="width: 100%"
|
|
|
placeholder="箱号"
|
|
|
v-Alphabet
|
|
|
+ @change="unRepeat(scope.row.fCntrno, scope.$index)"
|
|
|
/>
|
|
|
</span>
|
|
|
<span v-else-if="item.label == 'fTruckno'">
|
|
@@ -237,8 +235,29 @@
|
|
|
</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="uploadVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="uploadVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="importData">导 入</el-button>
|
|
|
</span>
|
|
|
+ <el-dialog
|
|
|
+ title="选择库位"
|
|
|
+ :data="treeselectList"
|
|
|
+ :visible.sync="choiceWarehouse"
|
|
|
+ width="30%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <treeselect
|
|
|
+ v-model="treeselectList.fWarehouselocid"
|
|
|
+ @select="getAlltree"
|
|
|
+ :options="fWarehouseidOptions"
|
|
|
+ :show-count="true"
|
|
|
+ :disable-branch-nodes="true"
|
|
|
+ placeholder="请选择归属库区"
|
|
|
+ />
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="choiceWarehouse = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirm">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
@@ -308,7 +327,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
surface: "5",
|
|
|
- label: "fWarehouselocid",
|
|
|
+ label: "fWarehouseInformation",
|
|
|
name: "库区",
|
|
|
checked: 0,
|
|
|
width: 100,
|
|
@@ -360,6 +379,11 @@ export default {
|
|
|
goodsOptions: [],
|
|
|
fStorageTypeOptions: [],
|
|
|
fWarehouseidOptions: [],
|
|
|
+ treeselectList: {
|
|
|
+ fWarehouselocid: null,
|
|
|
+ },
|
|
|
+ choiceWarehouse: false,
|
|
|
+ oldList: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -374,7 +398,10 @@ export default {
|
|
|
this.getRow();
|
|
|
},
|
|
|
methods: {
|
|
|
- init(fWarehouseid) {
|
|
|
+ init(fWarehouseid, rows) {
|
|
|
+ this.oldList = [];
|
|
|
+ this.excelList = [];
|
|
|
+ this.oldList = rows;
|
|
|
treeselect(fWarehouseid).then((response) => {
|
|
|
this.fWarehouseidOptions = response.data;
|
|
|
});
|
|
@@ -459,10 +486,110 @@ export default {
|
|
|
this.drag = false;
|
|
|
},
|
|
|
getAlltree(tree) {
|
|
|
- this.importList.fWarehouseInformation = tree.fWarehouseInformation;
|
|
|
+ this.information = tree.fWarehouseInformation;
|
|
|
+ },
|
|
|
+ importData() {
|
|
|
+ if (this.excelList.length == 0) {
|
|
|
+ return this.$message.error("请上传Excel文件,并完善数据");
|
|
|
+ }
|
|
|
+ for (let item in this.excelList) {
|
|
|
+ if (this.excelList[item].fBsdate == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请选择第" + (Number(item) + 1) + "行的入库日期"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fGoodsid == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请选择第" + (Number(item) + 1) + "行的品名"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fBusinessType == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请选择第" + (Number(item) + 1) + "行的货物属性"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fMarks == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的属性详情"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fWarehouseInformation == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请选择第" + (Number(item) + 1) + "行的库区"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fQty == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的件数"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fGrossweight == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的毛重"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fNetweight == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的净重"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fPackagespecs == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的包装规格"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fCntrno == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的箱号"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.excelList[item].fTruckno == null) {
|
|
|
+ return this.$message.error(
|
|
|
+ "请输入第" + (Number(item) + 1) + "行的车号"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$emit("adddetailList", this.excelList)
|
|
|
+ this.uploadVisible=false
|
|
|
+ },
|
|
|
+ unRepeat(row, index) {
|
|
|
+ this.oldList.map((e) => {
|
|
|
+ if (row == e.fCntrno) {
|
|
|
+ this.excelList[index].fCntrno = null;
|
|
|
+ this.$message.error("该箱号和明细表上的存在重复");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.excelList.map((e, i) => {
|
|
|
+ if (index != i) {
|
|
|
+ if (row && row == e.fCntrno) {
|
|
|
+ this.excelList[index].fCntrno = null;
|
|
|
+ this.$message.error("该箱号存在重复");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
handleClose() {
|
|
|
- this.$emit("changeShow", "false");
|
|
|
+ this.$emit("changeShow", false);
|
|
|
+ },
|
|
|
+ getTreeselect(row) {
|
|
|
+ this.treeselectList.fWarehouselocid = row.row.fWarehouselocid
|
|
|
+ ? row.row.fWarehouselocid
|
|
|
+ : null;
|
|
|
+ this.TreeIndex = row.$index;
|
|
|
+ this.choiceWarehouse = true;
|
|
|
+ },
|
|
|
+ confirm() {
|
|
|
+ this.$set(
|
|
|
+ this.excelList[this.TreeIndex],
|
|
|
+ "fWarehouseInformation",
|
|
|
+ this.information
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.excelList[this.TreeIndex],
|
|
|
+ "fWarehouselocid",
|
|
|
+ this.treeselectList.fWarehouselocid
|
|
|
+ );
|
|
|
+ this.choiceWarehouse = false;
|
|
|
},
|
|
|
},
|
|
|
watch: {
|