From 847b2c787cc596af473e704dcf876d968bc3c72b Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 25 Aug 2023 15:21:27 +0800 Subject: [PATCH] update docs_0825 --- src/components/BaseListTable.vue | 47 +++++++++++++------ src/components/palletDialog.vue | 22 ++++++--- src/views/atomViews/ListViewWithHead.vue | 1 + .../modules/pms/carOrderReport/config.js | 34 +++++++++----- .../modules/pms/carOrderReport/index.vue | 7 --- src/views/modules/pms/pallet/config.js | 1 + 6 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/components/BaseListTable.vue b/src/components/BaseListTable.vue index 7a14ffd..7ffc74b 100644 --- a/src/components/BaseListTable.vue +++ b/src/components/BaseListTable.vue @@ -11,8 +11,7 @@ row-key="id" :cell-style="{ padding: 0 }" @selection-change="handleSelectionChange" - border - > + border> @@ -34,8 +33,7 @@ } : null " - v-bind="head.more" - > + v-bind="head.more"> + :show-overflow-tooltip="head.showOverflowTooltip ?? !(head.prop === 'operations')"> @@ -109,12 +108,16 @@ export default { type: Number, default: 0, }, + selectProps: { + type: Array, + default: null, + }, }, // inject: ["urls"], data() { return { dataList: [], - selections: [] + selections: [], }; }, watch: { @@ -129,9 +132,25 @@ export default { }, handleSelectionChange(val) { // this.selections = val; - console.log('selections change: ', val) - this.$emit('select', val.map(item => item.id)) - } + console.log("selections change: ", val); + if (this.selectProps.length == 0) + this.$emit( + "select", + val.map((item) => item.id) + ); + else { + this.$emit( + "select", + val.map((item) => { + const payload = {}; + this.selectProps.forEach((key) => { + payload[key] = item[key]; + }); + return payload; + }) + ); + } + }, }, }; @@ -145,7 +164,7 @@ export default { text-shadow: unset; } - .base-list-table >>> .no-padding-class .cell { +.base-list-table >>> .no-padding-class .cell { line-height: 1.75; padding: 0; } diff --git a/src/components/palletDialog.vue b/src/components/palletDialog.vue index ba88299..b3ae35d 100644 --- a/src/components/palletDialog.vue +++ b/src/components/palletDialog.vue @@ -76,7 +76,7 @@ export default { cate: item.cate, // 订单子号 id: item.id, // 订单 id })); - } + } else this.$message.error(res.msg); this.loading = false; }, @@ -86,12 +86,20 @@ export default { async handleConfirm() { this.loading = true; - const { data: res } = await this.$http.post("/pms/pallet/newPallet", this.dataForm); - this.loading = false; - if (res.code === 0) { - this.$message.success("提交成功"); - this.$emit("refresh-list"); - this.close(); + try { + const { data: res } = await this.$http.post("/pms/pallet/newPallet", { + ...this.dataForm, + ids: this.ids.map((item) => item.id), + }); + if (res.code === 0) { + this.$message.success("提交成功"); + this.$emit("refresh-list"); + this.close(); + this.loading = false; + } else throw new Error(res.msg); + } catch (err) { + this.$message.error('message' in err ? err.message : err); + this.loading = false; } }, diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 98a2071..e2c57dc 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -13,6 +13,7 @@ :current-page="page" :current-size="size" @select="handleTableSelect" + :select-props="tableConfig.selectProps ?? []" :refresh-layout-key="refreshLayoutKey" /> ['否', '是'][val] }, @@ -39,7 +40,7 @@ export default function () { width: 90, subcomponent: TableOperaionComponent, options: [ - { name: "edit", label: "编辑", icon: "edit-outline", enable: row => row.report == 0 }, + { name: "edit", label: "编辑", icon: "edit-outline", enable: (row) => row.report == 0 }, // { // name: "delete", // icon: "delete", @@ -81,7 +82,7 @@ export default function () { ], default: { value: "" }, bind: { - placeholder: "请输入班次", + placeholder: "请选择班次", }, }, { @@ -93,7 +94,18 @@ export default function () { ], default: { value: "0" }, bind: { - placeholder: "请输入报工状态", + placeholder: "请选择报工状态", + }, + }, + { + prop: "pos", + label: "压机", + select: [ + { label: "压机1", value: "1" }, + { label: "压机2", value: "7" }, + ], + bind: { + placeholder: "请选择压机", }, }, { @@ -239,8 +251,8 @@ export default function () { base: "/pms/carOrderReport", page: "/pms/carOrderReport/pageView", pageIsPostApi: true, - reportPre: '/pms/workReport/pressReportPre', - report: '/pms/workReport/pressReport', + reportPre: "/pms/workReport/pressReportPre", + report: "/pms/workReport/pressReport", }, }; } diff --git a/src/views/modules/pms/carOrderReport/index.vue b/src/views/modules/pms/carOrderReport/index.vue index c9bdaae..d66acb2 100644 --- a/src/views/modules/pms/carOrderReport/index.vue +++ b/src/views/modules/pms/carOrderReport/index.vue @@ -28,7 +28,6 @@ export default { dialogConfigs, }; }, - computed: { now() { const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value; @@ -36,12 +35,6 @@ export default { moment(curr[0]).format("YYYY-MM-DDTHH:mm:ss"), moment(curr[1]).format("YYYY-MM-DDTHH:mm:ss"), ] - // const start = new Date(curr[0]); - // const end = new Date(curr[1]); - // return [ - // start.toLocaleString().replace(' ', 'T').replace(/\//g, '-'), - // end.toLocaleString().replace(' ', 'T').replace(/\//g, '-'), - // ] }, }, methods: {}, diff --git a/src/views/modules/pms/pallet/config.js b/src/views/modules/pms/pallet/config.js index 398d84b..927fc15 100644 --- a/src/views/modules/pms/pallet/config.js +++ b/src/views/modules/pms/pallet/config.js @@ -167,6 +167,7 @@ export default function () { tableConfig: { table: null, // 此处可省略,el-table 上的配置项 column: tableProps, // el-column-item 上的配置项 + selectProps: ['id', 'orderCode'] }, headFormConfigs: { rules: null, // 名称是由 BaseSearchForm.vue 组件固定的