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

@ -62,13 +62,13 @@ export default function () {
form: {
rows: [
[
{
input: true,
label: "批次编码",
prop: "batchNo",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入批次编码" },
},
// {
// input: true,
// label: "批次编码",
// prop: "batchNo",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "请输入批次编码" },
// },
{
input: true,
label: "批次重量",

View File

@ -3,35 +3,16 @@
<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"
/>
<DialogJustForm ref="edit-dialog" v-if="!!dialogConfigs" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs"
@refreshDataList="getList" />
<!-- :bom-code="dialogBomCode" -->
</div>
</template>
@ -220,13 +201,23 @@ export default {
});
break;
}
case "detach": {
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(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.post(realUrl, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => {
if (res.code === 0) {
this.$message({
message: "下发成功",
message: `${(type === 'detach') ? '下发' : (type === 'pause-blender') ? '暂停' : '开始'}成功`,
type: "success",
duration: 1500,
onClose: () => {
@ -241,6 +232,7 @@ export default {
});
}
});
});
}
}
},

View File

@ -33,14 +33,21 @@ export default function () {
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
width: 180,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline' },
{
name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline', enable: injectData => {
const v = injectData.statusDictValue
if (v && +v === 1) return true
return false
}
},
{ name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: 'pms-blenderBatch', icon: 'document-copy' }, // 路由跳转至 pms-blenderBatch
{ name: "pause-blender", label: "暂停", color: "#f10000", icon: 'video-pause' },
{ name: "start-blender", label: "开始", color: "#0b58ff", icon: 'video-play' },
{ name: "detach", label: "下发", color: "#099", icon: 'bottom-right' },
], // , url: '/pms/trans/pressDeli' }]
// options: ["copy", { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStep:delete" }],
],
},
];
@ -271,6 +278,8 @@ export default function () {
// base: "/pms/equipmentTech",
page: "/pms/blenderOrder/pageView",
detach: "/pms/trans/blenderDeli",
pauseBlender: "/pms/trans/blenderPause",
startBlender: "/pms/trans/blenderStart",
pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
changeBlender: '/pms/order/changeBlender'
// subase: "/pms/equipmentTechParam",

View File

@ -0,0 +1,166 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
import { getDictDataList } from '@/utils';
// import StateSelect from '@/components/StateSelect.vue';
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ prop: "code", label: "流水号" },
{ prop: "carCode", label: "窑车号" },
{ prop: "orderCode", label: "订单号" },
{ prop: "realQty", label: "数量" },
{ prop: "typeDictValue", label: "类型", filter: dictFilter('pallet_type') },
{ prop: "stifling", label: "熏蒸", },
{ prop: "printTime", label: "打印时间", filter: timeFilter },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "print", label: "打印", icon: "printer" },
{ name: "view-car-record", label: "窑车记录", emitField: 'hisId', icon: "shopping-cart-1" },
],
},
];
const headFormFields = [
{
prop: "carId",
label: "窑车号",
select: [],
fn: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
bind: {
placeholder: "请选择窑车号",
filterable: true
},
},
{
prop: "orderId",
label: "订单号",
fieldOptionLabel: 'code',
// fieldOptionValue: 'id',
select: [],
fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }),
bind: {
placeholder: "请选择订单号",
filterable: true
},
},
{
button: {
type: "primary",
name: "查询",
},
},
];
const dialogJustFormConfigs = {
form: {
rows: [
[
{
select: true,
label: "窑车号",
prop: "carId",
options: [],
fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
disabled: true,
}
},
{
select: true,
label: "状态",
prop: "stateDictValue",
options: getDictDataList('car_state').map(i => ({ label: i.dictLabel, value: i.dictValue })),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
fliterable: true
}
},
],
[
{
// select: true,
input: true,
label: "位置",
prop: "pos",
// options: getDictDataList(),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
// fliterable: true
}
},
{
label: "查看载砖详情",
button: true,
onClick: function (id) { // 必须用 function 形式
console.log(`查看载砖详情`, id)
this.$emit('emit-data', { type: 'to-car-payload', data: id })
}
},
],
],
operations: [
// { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
// { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
const carPayloadDialogConfigs = {
dialogWidth: '70%',
carPayloadDialog: true,
clickModalToClose: true,
tableConfig: {
table: null,
column: [
// 窑车的 装载详情
// tableProps
{ width: 56, type: "index", label: "序号" },
{ prop: "orderCode", label: "订单号" },
{ width: 80, prop: "orderCate", label: "订单子号" },
{ prop: "bomCode", label: "配方" },
{ prop: "shapeCode", label: "砖型" },
{ width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" },
// { prop: "startTime", label: "开始时间" },
// { prop: "endTime", label: "结束时间" },
// { prop: "remark", label: "备注" },
],
},
};
return {
carPayloadDialogConfigs,
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: '/pms/carHistory',
payload: '/pms/carHandle', // hisId 查询 载砖详情
page: "/pms/pallet/pageView",
pageIsPostApi: true,
printLog: '/pms/pallet/print', // post
},
};
}

View File

@ -0,0 +1,47 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[
/** { pos: [] } **/
]"
:trigger-update="triggerUpdateKey"
/>
<!-- :car-payload-dialog-configs="carPayloadDialogConfigs" -->
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "currentCarLocationView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, carPayloadDialogConfigs, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
carPayloadDialogConfigs,
headFormConfigs,
allUrls: urls,
dialogConfigs,
triggerUpdateKey: "",
};
},
created() {},
mounted() {},
methods: {},
activated() {
this.triggerUpdateKey = Math.random().toString();
},
};
</script>
<style scoped></style>

View File

@ -43,7 +43,7 @@ export default function () {
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" },
],
finished: [
{ name: 'view-ongoing', label: '查看详情', emitFull: true },
{ name: 'view-ongoing', label: '查看详情', icon: 'view', emitFull: true },
// { name: 'view', label: '查看详情' }
// { name: 'end-order', label: '结束订单', icon: 'error', showText: true },
],