|
|
|
@ -77,12 +77,13 @@
|
|
|
|
|
>查询
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="mini" icon="search" @click="combine"
|
|
|
|
|
<el-button type="primary" size="mini" icon="search" @click="checkCombine"
|
|
|
|
|
:loading="combineLoading"
|
|
|
|
|
>选入
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="mini" icon="search" @click="combineUdiAll" v-if="relId==null"
|
|
|
|
|
<el-button type="primary" size="mini" icon="search" @click="combineUdiAll"
|
|
|
|
|
v-if="relId==null"
|
|
|
|
|
>结果全部选入
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
@ -343,245 +344,294 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getUdiInfos, filterCompany} from "../../api/basic/udiInfo";
|
|
|
|
|
import {combineUdi, combineAllUdi} from "../../api/basic/udiRelevance";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "closeDialog",
|
|
|
|
|
props: {
|
|
|
|
|
closeDialog: {
|
|
|
|
|
type: Function,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
relId: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
isImport: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
import {getUdiInfos, filterCompany} from "../../api/basic/udiInfo";
|
|
|
|
|
import {combineUdi, combineAllUdi, checkExitUdi} from "../../api/basic/udiRelevance";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "closeDialog",
|
|
|
|
|
props: {
|
|
|
|
|
closeDialog: {
|
|
|
|
|
type: Function,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
relId: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
isImport: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
unionQuery: {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
udiCode: null,
|
|
|
|
|
nameCode: "",
|
|
|
|
|
cpmctymc: "",
|
|
|
|
|
ylqxzcrbarmc: null,
|
|
|
|
|
ggxh: "",
|
|
|
|
|
zczbhhzbapzbh: "",
|
|
|
|
|
isCheck: 1
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
combineLoading: false,
|
|
|
|
|
combineQuery: {
|
|
|
|
|
thirdId: "",
|
|
|
|
|
relId: "",
|
|
|
|
|
erpName: "",
|
|
|
|
|
keys: [],
|
|
|
|
|
},
|
|
|
|
|
checked: true,
|
|
|
|
|
udidlList: [],
|
|
|
|
|
erpList: [],
|
|
|
|
|
pageTotal: 1,
|
|
|
|
|
total: 1,
|
|
|
|
|
currentRow: null,
|
|
|
|
|
fromOptions: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
erpLloading: false,
|
|
|
|
|
multipleUdiSelection: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
searchList() {
|
|
|
|
|
this.unionQuery.page = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
unionQuery: {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
udiCode: null,
|
|
|
|
|
nameCode: "",
|
|
|
|
|
cpmctymc: "",
|
|
|
|
|
ylqxzcrbarmc: null,
|
|
|
|
|
ggxh: "",
|
|
|
|
|
zczbhhzbapzbh: "",
|
|
|
|
|
isCheck: 1
|
|
|
|
|
},
|
|
|
|
|
combineLoading: false,
|
|
|
|
|
combineQuery: {
|
|
|
|
|
thirdId: "",
|
|
|
|
|
relId: "",
|
|
|
|
|
erpName: "",
|
|
|
|
|
keys: [],
|
|
|
|
|
},
|
|
|
|
|
checked: true,
|
|
|
|
|
udidlList: [],
|
|
|
|
|
erpList: [],
|
|
|
|
|
pageTotal: 1,
|
|
|
|
|
total: 1,
|
|
|
|
|
currentRow: null,
|
|
|
|
|
fromOptions: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
erpLloading: false,
|
|
|
|
|
multipleUdiSelection: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getList() {
|
|
|
|
|
if (
|
|
|
|
|
this.unionQuery.udiCode == "" &&
|
|
|
|
|
this.unionQuery.nameCode == "" &&
|
|
|
|
|
this.unionQuery.cpmctymc == "" &&
|
|
|
|
|
this.unionQuery.ylqxzcrbarmc == "" &&
|
|
|
|
|
this.unionQuery.ggxh == "" &&
|
|
|
|
|
this.unionQuery.zczbhhzbapzbh == ""
|
|
|
|
|
) {
|
|
|
|
|
this.$message.warning("请输入查询条件");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.loading = true;
|
|
|
|
|
// this.unionQuery.page = 1;
|
|
|
|
|
getUdiInfos(this.unionQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.udidlList = response.data.list || [];
|
|
|
|
|
this.total = response.data.total || 0;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchList() {
|
|
|
|
|
this.unionQuery.page = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getList() {
|
|
|
|
|
if (
|
|
|
|
|
this.unionQuery.udiCode == "" &&
|
|
|
|
|
this.unionQuery.nameCode == "" &&
|
|
|
|
|
this.unionQuery.cpmctymc == "" &&
|
|
|
|
|
this.unionQuery.ylqxzcrbarmc == "" &&
|
|
|
|
|
this.unionQuery.ggxh == "" &&
|
|
|
|
|
this.unionQuery.zczbhhzbapzbh == ""
|
|
|
|
|
) {
|
|
|
|
|
this.$message.warning("请输入查询条件");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.loading = true;
|
|
|
|
|
// this.unionQuery.page = 1;
|
|
|
|
|
getUdiInfos(this.unionQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.udidlList = response.data.list || [];
|
|
|
|
|
this.total = response.data.total || 0;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.udidlList = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.udidlList = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
combineUdiAll() {
|
|
|
|
|
this.$confirm("此操作将在后台自动下载所有查询结果, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
combineUdiAll() {
|
|
|
|
|
this.$confirm("此操作将在后台自动下载所有查询结果, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
combineAllUdi(this.unionQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$message.success(response.data);
|
|
|
|
|
this.$emit("closeUdi", true);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
combineAllUdi(this.unionQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$message.success(response.data);
|
|
|
|
|
this.$emit("closeUdi", true);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
keyup_submit(event) {
|
|
|
|
|
this.unionQuery.page = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
event.target.select();
|
|
|
|
|
},
|
|
|
|
|
keyup_submit(event) {
|
|
|
|
|
this.unionQuery.page = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
event.target.select();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
checkSelectable(row) {
|
|
|
|
|
return !row.check;
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.unionQuery.page = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
tableRowClassName({row, rowIndex}) {
|
|
|
|
|
if (row.check) return "warning-row";
|
|
|
|
|
return "";
|
|
|
|
|
},
|
|
|
|
|
handleErpChange(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
this.currentRow = val;
|
|
|
|
|
},
|
|
|
|
|
intentBack() {
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
},
|
|
|
|
|
combine() {
|
|
|
|
|
|
|
|
|
|
let selectData = this.multipleUdiSelection;
|
|
|
|
|
let selected = null;
|
|
|
|
|
if (this.multipleUdiSelection.length == 0) {
|
|
|
|
|
if (this.relId != null) {
|
|
|
|
|
this.combineQuery.relId = this.relId;
|
|
|
|
|
this.combineQuery.keys.push(this.currentRow.uuid);
|
|
|
|
|
if (this.currentRow.check) {
|
|
|
|
|
selected = this.currentRow;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
selectData.forEach((obj) => {
|
|
|
|
|
if (obj.check) {
|
|
|
|
|
selected = obj;
|
|
|
|
|
}
|
|
|
|
|
this.combineQuery.keys.push(obj.uuid);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (selected != null) {
|
|
|
|
|
this.$message.warning("UDI编码:" + selected.nameCode + "已被选入");
|
|
|
|
|
checkSelectable(row) {
|
|
|
|
|
return !row.check;
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.unionQuery.page = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
tableRowClassName({row, rowIndex}) {
|
|
|
|
|
if (row.check) return "warning-row";
|
|
|
|
|
return "";
|
|
|
|
|
},
|
|
|
|
|
handleErpChange(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
this.currentRow = val;
|
|
|
|
|
},
|
|
|
|
|
intentBack() {
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
checkCombine() {
|
|
|
|
|
let selectData = this.multipleUdiSelection;
|
|
|
|
|
let selected = null;
|
|
|
|
|
if (this.multipleUdiSelection.length == 0) {
|
|
|
|
|
if (this.relId != null) {
|
|
|
|
|
this.combineQuery.relId = this.relId;
|
|
|
|
|
this.combineQuery.keys.push(this.currentRow.uuid);
|
|
|
|
|
if (this.currentRow.check) {
|
|
|
|
|
selected = this.currentRow;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.combineLoading = true;
|
|
|
|
|
combineUdi(this.combineQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$emit("closeUdi", true);
|
|
|
|
|
} else {
|
|
|
|
|
this.$emit("closeUdi", false);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
selectData.forEach((obj) => {
|
|
|
|
|
if (obj.check) {
|
|
|
|
|
selected = obj;
|
|
|
|
|
}
|
|
|
|
|
this.combineQuery.keys.push(obj.uuid);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (selected != null) {
|
|
|
|
|
this.$message.warning("UDI编码:" + selected.nameCode + "已被选入");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.combineLoading = true;
|
|
|
|
|
checkExitUdi(this.combineQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.combine();
|
|
|
|
|
// combineUdi(this.combineQuery)
|
|
|
|
|
// .then((response) => {
|
|
|
|
|
// this.combineLoading = false;
|
|
|
|
|
// if (response.code == 20000) {
|
|
|
|
|
// this.$emit("closeUdi", true);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$emit("closeUdi", false);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
// this.combineLoading = false;
|
|
|
|
|
// this.$emit("closeUdi", false);
|
|
|
|
|
// });
|
|
|
|
|
} else if (response.code == 499) {
|
|
|
|
|
this.$confirm(response.message,{type:"warning"})
|
|
|
|
|
.then(_ => {
|
|
|
|
|
this.combine();
|
|
|
|
|
// combineUdi(this.combineQuery)
|
|
|
|
|
// .then((response) => {
|
|
|
|
|
// this.combineLoading = false;
|
|
|
|
|
// if (response.code == 20000) {
|
|
|
|
|
// this.$emit("closeUdi", true);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$emit("closeUdi", false);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
// this.combineLoading = false;
|
|
|
|
|
// this.$emit("closeUdi", false);
|
|
|
|
|
// });
|
|
|
|
|
})
|
|
|
|
|
.catch(_ => {});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
this.$emit("closeUdi", false);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
combine() {
|
|
|
|
|
|
|
|
|
|
combineUdi(this.combineQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$emit("closeUdi", true);
|
|
|
|
|
} else {
|
|
|
|
|
this.$emit("closeUdi", false);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.combineLoading = false;
|
|
|
|
|
this.$emit("closeUdi", false);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleSelectionUdiChange(val) {
|
|
|
|
|
console.log("----" + val);
|
|
|
|
|
this.multipleUdiSelection = val;
|
|
|
|
|
},
|
|
|
|
|
findMethod(query) {
|
|
|
|
|
console.log(query);
|
|
|
|
|
let cQuery = {
|
|
|
|
|
ylqxzcrbarmc: query,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
};
|
|
|
|
|
filterCompany(cQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.fromOptions = response.data || [];
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.fromOptions = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleSelectionUdiChange(val) {
|
|
|
|
|
console.log("----" + val);
|
|
|
|
|
this.multipleUdiSelection = val;
|
|
|
|
|
},
|
|
|
|
|
findMethod(query) {
|
|
|
|
|
console.log(query);
|
|
|
|
|
let cQuery = {
|
|
|
|
|
ylqxzcrbarmc: query,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
};
|
|
|
|
|
filterCompany(cQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.fromOptions = response.data || [];
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.fromOptions = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.checkitemTag {
|
|
|
|
|
float: left;
|
|
|
|
|
text-align: left;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
div /deep/ .el-table .warning-row {
|
|
|
|
|
background: #bebebe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
div /deep/ .el-table .success-row {
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-card {
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
/*transition: all .5s;*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.query-form-item {
|
|
|
|
|
display: block !important;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
}
|
|
|
|
|
.checkitemTag {
|
|
|
|
|
float: left;
|
|
|
|
|
text-align: left;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
div /deep/ .el-table .warning-row {
|
|
|
|
|
background: #bebebe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
div /deep/ .el-table .success-row {
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-card {
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
/*transition: all .5s;*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.query-form-item {
|
|
|
|
|
display: block !important;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|