add 报工历史
This commit is contained in:
@@ -86,10 +86,23 @@ export default {
|
||||
dialogBomCode: "",
|
||||
overlayVisible: false,
|
||||
cachedSearchCondition: {},
|
||||
queryParams: {},
|
||||
};
|
||||
},
|
||||
inject: ["urls"],
|
||||
mounted() {
|
||||
// 如果设置了 listQueryExtra,就合并到 queryParams
|
||||
if (this.listQueryExtra && Array.isArray(this.listQueryExtra)) {
|
||||
this.listQueryExtra.map((item) => {
|
||||
if (typeof item === "string") this.$set(this.queryParams, item, "");
|
||||
else if (typeof item === "object") {
|
||||
Object.keys(item).forEach((key) => {
|
||||
this.$set(this.queryParams, key, item[key]);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.initDataWhenLoad && this.getList();
|
||||
},
|
||||
methods: {
|
||||
@@ -104,17 +117,6 @@ export default {
|
||||
limit: this.size,
|
||||
};
|
||||
|
||||
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
|
||||
this.listQueryExtra.map((nameOrObj) => {
|
||||
if (typeof nameOrObj === "string") params[nameOrObj] = "";
|
||||
else if (typeof nameOrObj === "object") {
|
||||
Object.keys(nameOrObj).forEach((key) => {
|
||||
params[key] = nameOrObj[key];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// if (this.urls.pageIsPostApi) {
|
||||
// } else {
|
||||
// 默认是 get 方式请求 page
|
||||
@@ -122,10 +124,14 @@ export default {
|
||||
this.urls.page,
|
||||
this.urls.pageIsPostApi
|
||||
? {
|
||||
...this.queryParams,
|
||||
...params,
|
||||
}
|
||||
: {
|
||||
params,
|
||||
params: {
|
||||
...this.queryParams,
|
||||
...params
|
||||
},
|
||||
}
|
||||
)
|
||||
.then(({ data: res }) => {
|
||||
@@ -253,7 +259,9 @@ export default {
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: `${type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"}成功`,
|
||||
message: `${
|
||||
type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"
|
||||
}成功`,
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
|
||||
Reference in New Issue
Block a user