split 拆分订单的完成订单为独立页面

This commit is contained in:
lb
2023-04-10 14:21:56 +08:00
parent 9773d2a9ae
commit 9ce0241a4c
6 changed files with 281 additions and 67 deletions

View File

@@ -3,36 +3,17 @@
<div class="list-view-with-head">
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
<BaseListTable
v-loading="tableLoading"
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
<BaseListTable v-loading="tableLoading" :table-config="tableConfig.table" :column-config="tableConfig.column"
:table-data="dataList" @operate-event="handleOperate" :current-page="page" :current-size="size"
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[1, 5, 10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-pagination class="mt-5 flex justify-end" @size-change="handleSizeChange" @current-change="handlePageChange"
:current-page.sync="page" :page-sizes="[1, 5, 10, 20, 50, 100]" :page-size="size" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogJustForm
ref="edit-dialog"
v-if="!!dialogConfigs"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
<!-- :bom-code="dialogBomCode" -->
<DialogJustForm ref="edit-dialog" v-if="!!dialogConfigs" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs"
@refreshDataList="getList" />
<!-- :bom-code="dialogBomCode" -->
</div>
</template>
@@ -97,9 +78,9 @@ export default {
const params = queryParams
? { ...queryParams, page: this.page, limit: this.size }
: {
page: this.page,
limit: this.size,
};
page: this.page,
limit: this.size,
};
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((nameOrObj) => {
@@ -119,11 +100,11 @@ export default {
this.urls.page,
this.urls.pageIsPostApi
? {
...params,
}
...params,
}
: {
params,
}
params,
}
)
.then(({ data: res }) => {
console.log("[http response] res is: ", res);
@@ -200,7 +181,7 @@ export default {
}
});
})
.catch((err) => {});
.catch((err) => { });
}
case "edit": {
this.openDialog(data); /** data is ==> id */
@@ -220,26 +201,37 @@ export default {
});
break;
}
case "detach": {
return this.$http
.post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => {
if (res.code === 0) {
this.$message({
message: "下发成功",
type: "success",
duration: 1500,
onClose: () => {
this.getList();
},
case "detach":
case "pause-blender":
case "start-blender": {
// 下发订单
this.$confirm(`确定${(type === 'detach') ? '下发' : (type === 'pause-blender') ? '暂停' : '开始'}该订单吗?`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
const realUrl = type === 'detach' ? this.urls.detach : type === 'pause-blender' ? this.urls.pauseBlender : this.urls.startBlender
return this.$http
.post(realUrl, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => {
if (res.code === 0) {
this.$message({
message: `${(type === 'detach') ? '下发' : (type === 'pause-blender') ? '暂停' : '开始'}成功`,
type: "success",
duration: 1500,
onClose: () => {
this.getList();
},
});
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
}
});
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
}
});
}
}