update 已完成订单独立

This commit is contained in:
lb 2023-04-11 09:32:07 +08:00
parent 9e6ec0acff
commit 84887dc9ac
4 changed files with 257 additions and 63 deletions

View File

@ -8,8 +8,6 @@
:destroy-on-close="false"
:close-on-click-modal="configs.clickModalToClose ?? true"
>
<!-- <el-button type="text" icon="el-icon-close" style="position: absolute; z-index: 100; top: 0; right: 18px" @click="handleClose">关闭</el-button> -->
<el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
<el-tab-pane name="sub" label="子订单进度">
<SubOrderDetail v-if="order !== null" :order="order" />
@ -24,18 +22,9 @@
<OrderDetail ref="order-detail-tag" :configs="configs" />
</el-tab-pane>
</el-tabs>
<!--
<div style="width: 100%; height: 76px; position: absolute; z-index: 100; bottom: 0; text-align: right;">
<el-button type="" plain @click="handleClose" style="margin-right: 18px; margin-top: 18px;">关闭</el-button>
</div> -->
<!-- footer -->
<div slot="footer" style="">
<!-- <template v-for="(operate, index) in configs.form.operations">
<el-button v-if="showButton(operate)" :key="'operation_' + index" :type="operate.type" @click="handleBtnClick(operate)">{{
operate.label
}}</el-button>
</template> -->
<el-button @click="handleClose">取消</el-button>
</div>
</el-dialog>
@ -57,7 +46,7 @@ export default {
},
fullscreen: {
type: Boolean,
default: false,
default: true,
},
},
inject: ["urls"],
@ -104,8 +93,6 @@ export default {
setTimeout(() => {
this.$emit("destroy-dialog");
// this.resetForm();
// this.$emit("update:dialogVisible", false);
}, 200);
},
},
@ -116,12 +103,6 @@ export default {
.dialog-with-menu >>> .el-dialog__body {
padding-top: 40px !important;
padding-bottom: 40px !important;
/* padding-top: 0 !important;
padding-bottom: 0 !important;
padding-left: 0 !important;
padding-right: 0 !important;
height: 100%; */
}
.el-select,
@ -132,7 +113,6 @@ export default {
.dialog-with-menu >>> .el-dialog__header {
padding: 0;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.dialog-with-menu >>> .el-dialog__body {
height: calc(100% - 72px);

View File

@ -12,8 +12,8 @@
: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>
<DialogWithMenu ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU"
:dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" />
<DialogWithMenu ref="edit-dialog" v-if="!!dialogConfigs && dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" />
<!-- :dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" /> -->
</div>
@ -22,7 +22,7 @@
<script>
import BaseListTable from "@/components/BaseListTable.vue";
import BaseSearchForm from "@/components/BaseSearchForm.vue";
import DialogWithMenu from "../../order/components/DialogWithMenu.vue";
import DialogWithMenu from "./DialogWithMenu.vue";
import moment from "moment";
@ -308,8 +308,11 @@ export default {
},
/** 打开对话框 */
openDialog(row_id, detail_mode, tag_info) {
openDialog(row, detail) {
this.dialogVisible = true;
console.log("row detail", row, detail)
let extraParams = null;
if (this.attachListQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.forEach((item) => {
@ -319,7 +322,7 @@ export default {
}
this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
this.$refs["edit-dialog"].init(/** some args... */ row, detail);
});
},
},

View File

@ -68,59 +68,271 @@ export default function () {
},
];
const dialogJustFormConfigs = {
const textOnlyComponent = {
props: {
modelValue: {
type: String | Number,
required: true,
},
useBuiltin: {
type: Boolean,
default: true,
},
},
data() {
return {
orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"],
};
},
render: function (h) {
return h(
"span",
{ style: { display: "block", marginTop: "0" } },
this.useBuiltin ? this.orderStatusMap[this.modelValue] ?? "-" : this.modelValue.toString().trim() === "" ? "-" : this.modelValue.toString()
);
},
};
const dictList = JSON.parse(localStorage.getItem("dictList"));
const dialogConfigs = {
form: {
rows: [
[
{
select: true,
label: "窑车号",
prop: "carId",
options: [],
fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
label: "订单状态",
prop: "statusDictValue",
component: textOnlyComponent,
},
{
input: true,
label: "订单号",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
disabled: true,
}
elparams: { placeholder: "请输入订单号" },
},
{
input: true,
label: "订单子号",
prop: "cate",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入订单子号" },
},
{
input: true,
label: "生产订单类型",
prop: "specifications",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入生产订单类型" },
},
{
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
}
label: "物料编号",
prop: "productId",
options: [],
optionLabel: "code",
fetchData: () => this.$http.get("/pms/product/page", { params: { limit: 999, page: 1, key: "" } }),
elparams: { placeholder: "请选择物料", filterable: true },
},
{
select: true,
label: "包装代码",
prop: "packTech",
options: [],
optionLabel: "code",
fetchData: () => this.$http.post("/pms/equipmentTech/pageView", { limit: 999, page: 1, key: "", shape: "", wsId: 5 }),
elparams: { placeholder: "请选择物料", filterable: true },
},
],
[
{
// select: true,
input: true,
label: "位置",
prop: "pos",
// options: getDictDataList(),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
// fliterable: true
}
label: "生产订单砖数",
prop: "prodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入要求生产的数量" },
},
{
label: "查看载砖详情",
button: true,
onClick: function (id) { // 必须用 function 形式
console.log(`查看载砖详情`, id)
this.$emit('emit-data', { type: 'to-car-payload', data: id })
}
input: true,
label: "已生产数",
prop: "yieldqty",
rules: [
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入已经生产的数量" },
},
{
input: true,
label: "托盘码放砖数",
prop: "pcsKilnCar",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入要求生产的数量" },
},
{
input: true,
label: "Add on",
prop: "sapParam1",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入addon" },
},
{
select: true,
label: "砖型",
prop: "shape",
optionLabel: "code",
options: [],
fetchData: () => this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1, key: "" } }),
elparams: { placeholder: "请选择砖型", filterable: true },
},
{
select: true,
label: "压机",
prop: "press",
options: [],
optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/page", { params: { limit: 999, page: 1, name: "" } }),
elparams: { placeholder: "请选择压机号", filterable: true },
},
],
[
{
select: true,
label: "牌号",
prop: "bomId",
options: [],
fetchData: () => this.$http.get("/pms/bom/page", { params: { limit: 999, page: 1, key: "", externalCode: "" } }),
elparams: { placeholder: "请选择牌号", filterable: true },
injectTo: [
['bomCode', 'code'],
['ai', 'externalCode']
]
},
{
label: "配方号代码",
prop: "bomCode",
component: textOnlyComponent,
bind: {
useBuiltin: false,
},
},
{
label: "版本号",
prop: "ai",
component: textOnlyComponent,
bind: {
useBuiltin: false,
},
},
{
select: true,
label: "混料机号",
prop: "blender",
options: [],
optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/page", { params: { limit: 999, page: 1, name: "" } }),
elparams: { placeholder: "请选择混料机号", filterable: true },
},
{
select: true,
label: "隧道窑号",
prop: "kiln",
options: [],
optionLabel: "code",
fetchData: () => this.$http.get("/pms/equipment/page", { params: { limit: 999, page: 1, name: "" } }),
elparams: { placeholder: "请选择隧道窑号", filterable: true },
},
{
input: true,
label: "烧成温度 ℃",
prop: "sapParam6",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入烧成温度" },
},
],
[
{
input: true,
label: "烧成时间 H",
prop: "sapParam7",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入烧成时间" },
},
{
input: true,
label: "销售订单号",
prop: "saleNo",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入销售订单号" },
},
{
input: true,
label: "销售订单item号",
prop: "saleOrderItem",
elparams: { placeholder: "请输入销售订单item号" },
},
{
input: true,
label: "销售订单砖数",
prop: "soqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
],
elparams: { placeholder: "请输入销售订单砖数" },
},
{
// time
datetime: true,
label: "销售时间",
prop: "deliveryTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择销售时间" },
},
{
select: true,
label: "客户",
prop: "customerId",
option: [],
optionLabel: "name",
fetchData: () => this.$http.get("/pms/customer/page", { params: { limit: 999, page: 1, name: "" } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择客户" },
},
],
[
{
label: "物料号销售文本",
prop: "shortDesc",
component: textOnlyComponent,
bind: {
useBuiltin: false,
},
},
],
// 备注
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
// { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
// { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true },
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
@ -128,7 +340,7 @@ export default function () {
return {
dialogConfigs: dialogJustFormConfigs,
dialogConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项

View File

@ -3,7 +3,6 @@
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[
/** { pos: [] } **/
]"
@ -13,7 +12,7 @@
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
import ListViewWithHead from "./components/ListViewWithHead.vue";
export default {
name: "FinishedOrderView",