From b527589e0fd3bb64e326bdef6dce223000eb1d50 Mon Sep 17 00:00:00 2001 From: helloDy <1615073571@qq.com> Date: Mon, 27 Nov 2023 20:41:45 +0800 Subject: [PATCH] ui --- src/api/base/materialProductBom.js | 10 +- src/assets/icons/svg/table_edit.svg | 14 + .../base/coreHotMaterial/add-or-updata.vue | 4 +- src/views/base/coreHotMaterial/index.vue | 2 +- src/views/base/coreProduct/add-or-updata.vue | 28 +- src/views/base/coreProduct/index.vue | 33 ++- src/views/base/coreSupplier/index.vue | 2 +- src/views/base/coreWorkOrder/addWorkOrder.vue | 82 +++--- src/views/base/coreWorkOrder/index.vue | 85 +++--- src/views/base/material/add-or-updata.vue | 36 ++- src/views/base/material/attr-add.vue | 4 +- src/views/base/materialDate/add-or-updata.vue | 5 +- src/views/base/materialDate/index.vue | 2 +- .../base/materialProductBom/add-or-updata.vue | 271 ++++++------------ .../base/materialProductBom/attr-add.vue | 197 +++++++++++++ src/views/base/materialProductBom/index.vue | 30 +- .../base/materialUseLog/add-or-updata.vue | 52 ++-- src/views/base/materialUseLog/index.vue | 2 +- .../inspection/Settings/add-or-updata.vue | 8 +- .../processEquValueBom/add-or-updata.vue | 6 +- 20 files changed, 513 insertions(+), 360 deletions(-) create mode 100644 src/assets/icons/svg/table_edit.svg create mode 100644 src/views/base/materialProductBom/attr-add.vue diff --git a/src/api/base/materialProductBom.js b/src/api/base/materialProductBom.js index 2b0474aa..4721ab2a 100644 --- a/src/api/base/materialProductBom.js +++ b/src/api/base/materialProductBom.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-10-21 11:50:46 - * @LastEditTime: 2023-10-26 20:06:29 + * @LastEditTime: 2023-11-27 17:54:28 * @LastEditors: DY * @Description: */ @@ -110,3 +110,11 @@ export function deleteMaterialPBDet(id) { method: 'delete' }) } + +// 获得产品Bom详细 +export function getMaterialPBDet(id) { + return request({ + url: '/base/material-product-bom-det/get?id=' + id, + method: 'get' + }) +} diff --git a/src/assets/icons/svg/table_edit.svg b/src/assets/icons/svg/table_edit.svg new file mode 100644 index 00000000..071dadc2 --- /dev/null +++ b/src/assets/icons/svg/table_edit.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/base/coreHotMaterial/add-or-updata.vue b/src/views/base/coreHotMaterial/add-or-updata.vue index 361e6d1e..4ffcd316 100644 --- a/src/views/base/coreHotMaterial/add-or-updata.vue +++ b/src/views/base/coreHotMaterial/add-or-updata.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-25 11:25:23 + * @LastEditTime: 2023-11-27 20:12:00 * @Description: --> @@ -11,7 +11,7 @@ :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" - label-width="100px"> + label-width="90px"> diff --git a/src/views/base/coreHotMaterial/index.vue b/src/views/base/coreHotMaterial/index.vue index 0e8a9ce6..0667b5c9 100644 --- a/src/views/base/coreHotMaterial/index.vue +++ b/src/views/base/coreHotMaterial/index.vue @@ -29,7 +29,7 @@ @cancel="handleCancel" @confirm="handleConfirm" :before-close="handleCancel" - width="50%"> + width="45%"> diff --git a/src/views/base/coreProduct/add-or-updata.vue b/src/views/base/coreProduct/add-or-updata.vue index 57f2e71d..a3cee7eb 100644 --- a/src/views/base/coreProduct/add-or-updata.vue +++ b/src/views/base/coreProduct/add-or-updata.vue @@ -2,14 +2,14 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-27 09:23:56 + * @LastEditTime: 2023-11-27 20:07:09 * @Description: --> @@ -114,14 +114,6 @@ - - - + + { + this.urlOptions.deleteURL(id).then(({ data }) => { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.getDataList(); + }, + }); + }); + }) + .catch(() => { }); + }, // 查看详情 otherMethods(val) { if (val.type === 'detail') { diff --git a/src/views/base/coreSupplier/index.vue b/src/views/base/coreSupplier/index.vue index 3da6699f..6be77494 100644 --- a/src/views/base/coreSupplier/index.vue +++ b/src/views/base/coreSupplier/index.vue @@ -105,7 +105,7 @@ export default { formConfig: [ { type: 'input', - label: '关键字', + label: '供应商', placeholder: '供应商名称', param: 'name', }, diff --git a/src/views/base/coreWorkOrder/addWorkOrder.vue b/src/views/base/coreWorkOrder/addWorkOrder.vue index 1e962c8b..a019d97d 100644 --- a/src/views/base/coreWorkOrder/addWorkOrder.vue +++ b/src/views/base/coreWorkOrder/addWorkOrder.vue @@ -1,21 +1,19 @@ - - - + + + - + - + - + - - - + - + - + + + - + - - - + + placeholder="请选择计划开始时间"> - + + placeholder="请选择计划完成时间"> - - + + - + - + - + - - - + - + - + + + - + + + + + - - - + - + - + - + - - + + - + - + - + diff --git a/src/views/base/coreWorkOrder/index.vue b/src/views/base/coreWorkOrder/index.vue index 64ea24cd..cddf0fff 100644 --- a/src/views/base/coreWorkOrder/index.vue +++ b/src/views/base/coreWorkOrder/index.vue @@ -65,7 +65,8 @@ const tableProps = [ { prop: 'createTime', label: '创建时间', - filter: parseTime + filter: parseTime, + 'show-overflow-tooltip': true }, { prop: 'name', @@ -127,48 +128,10 @@ export default { allocationVisible: false, tableProps, tableBtn: [ - this.$auth.hasPermi(`base:core-work-order:update`) - ? { - type: 'edit', - btnName: '编辑', - showParam: { - type: '&', - data: [ - { - name: 'status', - type: 'equal', - value: 1 - } - ] - } - } - : undefined, - this.$auth.hasPermi(`base:core-work-order:detail`) - ? { - type: 'detail', - btnName: '查看详情', - } - : undefined, - this.$auth.hasPermi(`base:core-work-order:delete`) - ? { - type: 'delete', - btnName: '删除', - showParam: { - type: '|', - data: [ - { - name: 'status', - type: 'equal', - value: 1 - } - ] - } - } - : undefined, - this.$auth.hasPermi(`base:core-work-order:material`) + this.$auth.hasPermi(`base:core-work-order:material`) ? { type: 'material', - btnName: '预使用原料信息', + btnName: '原料信息', } : undefined, { @@ -246,7 +209,45 @@ export default { } ] } - } + }, + this.$auth.hasPermi(`base:core-work-order:detail`) + ? { + type: 'detail', + btnName: '查看详情', + } + : undefined, + this.$auth.hasPermi(`base:core-work-order:update`) + ? { + type: 'edit', + btnName: '编辑', + showParam: { + type: '&', + data: [ + { + name: 'status', + type: 'equal', + value: 1 + } + ] + } + } + : undefined, + this.$auth.hasPermi(`base:core-work-order:delete`) + ? { + type: 'delete', + btnName: '删除', + showParam: { + type: '|', + data: [ + { + name: 'status', + type: 'equal', + value: 1 + } + ] + } + } + : undefined ].filter((v)=>v), tableData: [], formConfig: [ diff --git a/src/views/base/material/add-or-updata.vue b/src/views/base/material/add-or-updata.vue index 66df09d1..0c082ef9 100644 --- a/src/views/base/material/add-or-updata.vue +++ b/src/views/base/material/add-or-updata.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-27 09:36:44 + * @LastEditTime: 2023-11-27 15:26:12 * @Description: --> @@ -120,6 +120,7 @@ + 取消 - 确定 + { + if (!valid) { + return false; + } + // 修改的提交 + if (this.dataForm.id) { + this.urlOptions.updateURL(this.dataForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.visible = false + this.$emit("refreshDataList"); + }); + return; + } + // 添加的提交 + this.urlOptions.createURL(this.dataForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.idAttrShow = true + this.$emit("refreshDataList"); + }); + }); + }, goback() { this.$emit('refreshDataList'); this.visible = false; diff --git a/src/views/base/material/attr-add.vue b/src/views/base/material/attr-add.vue index 2106320e..a200c3a4 100644 --- a/src/views/base/material/attr-add.vue +++ b/src/views/base/material/attr-add.vue @@ -1,7 +1,7 @@ @@ -17,7 +17,7 @@ ref="dataForm" :model="dataForm" :rules="dataRule" - label-width="100px" + label-width="70px" @keyup.enter.native="dataFormSubmit()"> @@ -18,7 +18,8 @@ + @change="setMaterialCode" + style="width: 100%"> + width="40%"> diff --git a/src/views/base/materialProductBom/add-or-updata.vue b/src/views/base/materialProductBom/add-or-updata.vue index 7a9dea80..b95d06e1 100644 --- a/src/views/base/materialProductBom/add-or-updata.vue +++ b/src/views/base/materialProductBom/add-or-updata.vue @@ -2,14 +2,14 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-25 19:10:12 + * @LastEditTime: 2023-11-27 19:50:36 * @Description: --> @@ -25,7 +25,7 @@ label-width="100px" label-position="top"> - + - + + + + + + - - - @@ -60,92 +62,26 @@ BOM明细 - - 添加一行 - - - - - {{ parseTime(scope.row.createTime) }} - - - - - - - - 物料不可为空! - - - - - - - - 数量不可为空! - - - - - - - - - - - - - - - - - 保存 - - - - - - - - - - + - - + :bom-id="dataForm.id" + @refreshDataList="getList" /> @@ -179,7 +112,8 @@ import { getMaterialList } from "@/api/base/material"; import { listData } from "@/api/system/dict/data"; import SmallTitle from '../material/SmallTitle'; import { parseTime } from '../../core/mixins/code-filter'; -// import attrAdd from './attr-add'; +import attrAdd from './attr-add'; +import { publicFormatter } from '@/utils/dict'; const tableBtn = [ { @@ -198,18 +132,31 @@ const tableProps = [ filter: parseTime, }, { - prop: 'attrName', - label: '属性名', + prop: 'materialName', + label: '物料名称', }, { - prop: 'attrValue', - label: '属性值', + prop: 'materialCode', + label: '物料编码', }, + { + prop: 'unit', + label: '单位', + filter: publicFormatter('unit_dict'), + }, + { + prop: 'num', + label: '数量', + }, + { + prop: 'remark', + label: '备注', + } ]; export default { mixins: [basicAdd], - components: { SmallTitle }, + components: { SmallTitle, attrAdd }, data() { return { tableBtn, @@ -235,7 +182,6 @@ export default { }, productList: [], materialAttrList: [], - materialList: [], tableData: [], unitList: [], visible: false, @@ -250,13 +196,42 @@ export default { this.getDict() }, methods: { + handleClick(raw) { + if (raw.type === 'delete') { + this.deleteDetail(raw.data); + } else { + this.addNew(raw.data.id); + } + }, + // 表单提交 + dataFormSubmit() { + this.$refs["dataForm"].validate((valid) => { + if (!valid) { + return false; + } + // 修改的提交 + if (this.dataForm.id) { + this.urlOptions.updateURL(this.dataForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.visible = false; + this.$emit("refreshDataList"); + }); + return; + } + // 添加的提交 + this.urlOptions.createURL(this.dataForm).then(response => { + this.$modal.msgSuccess("新增成功"); + // this.visible = false; + this.idAttrShow = true; + this.dataForm.id = response.data + this.$emit("refreshDataList"); + }); + }); + }, async getDict() { // 产品列表 const proRes = await getProList(); this.productList = proRes.data; - // 物料列表 - const res = await getMaterialList(); - this.materialList = res.data; // 物料单位列表 const unitRes = await listData({ pageNo: 1, @@ -276,8 +251,7 @@ export default { }, deleteDetail(raw) { this.$confirm( - `确定删除关于物料编码为${ - raw.materialCode}的数据?`, + `是否确认删除物料名称为"${raw.materialName}"的数据项?`, '提示', { confirmButtonText: '确定', @@ -299,88 +273,13 @@ export default { }) .catch(() => {}); }, - changeNum(row) { - if (row.num !== '') { - row.isNum = false - } else { - row.isNum = true - } - }, - setCode(row) { - if (row.materialId) { - row.isShow = false - const tempM = this.materialList.filter(item => { - if (row.materialId === item.id) { - row.materialCode = item.code - } - return row.materialId === item.id - }) - if (tempM[0].unit) { - this.unitList.filter(u => { - if (tempM[0].unit === u.value) { - row.unit = u.value - row.mUnit = u.label - } - }) - } else { - row.unit = null - row.mUnit = '' - } - } else { - row.isShow = true - row.unit = null - row.mUnit = '' - } - // row.materialCode = tempList[0].code - // row.unit = tempList[0].unit - }, - edit(row) { - row.isEdit = true - }, - saveData(row) { - if (row.materialId) { - // this.$refs['dataForm'].validate((valid) => { - // if (valid) { - // 修改的提交 - if (row.id) { - updateMaterialPBDet({ - ...row - }).then((response) => { - this.$modal.msgSuccess('修改成功'); - // this.visible = false; - this.getList(); - }); - return; - } - // 添加的提交 - createMaterialPBDet({ - ...row - }).then((response) => { - this.$modal.msgSuccess('新增成功'); - // this.visible = false; - this.getList(); - }); - } else { - this.$message.warning('请选择物料!') - } - // } - // }); - }, getList() { // 获取产品Bom详细列表 getProBomList({ ...this.listQuery, bomId: this.dataForm.id }).then((response) => { - this.tableData = response.data.records.map(item => { - this.unitList.filter(u => { - if (item.unit === u.value) { - item.mUnit = u.label - } - }) - item.isEdit = false - return item - }); + this.tableData = response.data.records this.listQuery.total = response.data.total; }); }, @@ -476,7 +375,7 @@ export default { .drawer >>> .visual-part { flex: 1 auto; - max-height: 30vh; + max-height: 20vh; overflow: hidden; overflow-y: scroll; padding-right: 10px; /* 调整滚动条样式 */ @@ -492,4 +391,12 @@ export default { justify-content: flex-end; padding: 18px; } +.action_btn { + float: right; + margin: -40px 15px; + font-size: 14px; +} +.add { + color: #0b58ff; +} diff --git a/src/views/base/materialProductBom/attr-add.vue b/src/views/base/materialProductBom/attr-add.vue new file mode 100644 index 00000000..08c04d92 --- /dev/null +++ b/src/views/base/materialProductBom/attr-add.vue @@ -0,0 +1,197 @@ + + + + + + {{ !dataForm.id ? '新增' : '编辑' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + diff --git a/src/views/base/materialProductBom/index.vue b/src/views/base/materialProductBom/index.vue index d383536e..05733596 100644 --- a/src/views/base/materialProductBom/index.vue +++ b/src/views/base/materialProductBom/index.vue @@ -13,7 +13,7 @@ @@ -68,24 +68,24 @@ export default { }, tableProps, tableBtn: [ - this.$auth.hasPermi(`base:material-product-bom:update`) + this.$auth.hasPermi(`base:material-product-bom:queryMaterial`) + ? { + type: 'detail', + btnName: '查看物料', + } + : undefined, + this.$auth.hasPermi(`base:material-product-bom:update`) ? { type: 'edit', btnName: '编辑', } : undefined, - this.$auth.hasPermi(`base:material-product-bom:queryMaterial`) - ? { - type: 'search', - btnName: '查看物料', - } - : undefined, - this.$auth.hasPermi(`base:material-product-bom:editMaterial`) - ? { - type: 'editMaterial', - btnName: '编辑物料', - } - : undefined, + // this.$auth.hasPermi(`base:material-product-bom:editMaterial`) + // ? { + // type: 'editMaterial', + // btnName: '编辑物料', + // } + // : undefined, this.$auth.hasPermi(`base:material-product-bom:delete`) ? { type: 'delete', @@ -123,7 +123,7 @@ export default { created() {}, methods: { otherMethods(val) { - if (val.type === 'search') { + if (val.type === 'detail') { this.addOrUpdateVisible = true; this.addOrEditTitle = '详情'; this.$nextTick(() => { diff --git a/src/views/base/materialUseLog/add-or-updata.vue b/src/views/base/materialUseLog/add-or-updata.vue index b78c4112..2d5faf9c 100644 --- a/src/views/base/materialUseLog/add-or-updata.vue +++ b/src/views/base/materialUseLog/add-or-updata.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-22 10:40:08 + * @LastEditTime: 2023-11-27 19:57:23 * @Description: --> @@ -11,9 +11,10 @@ :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" - label-width="80px"> + label-width="80px" + label-position="top"> - + - + - - - + - + + + + placeholder="请选择使用设备" + style="width: 100%"> - - - + - + + placeholder="请选择操作员" + style="width: 100%"> - + - + - + + + + + + - - - @@ -237,13 +242,8 @@ export default { this.dataForm.source = response.data.source this.dataForm.remark = response.data.remark this.dataForm.userNames = response.data.userName.split(',') - console.log('打印', this.dataForm) }); - } else { - if (this.urlOptions.isGetCode) { - this.getCode() - } - } + } else {} }); }, setCode() { diff --git a/src/views/base/materialUseLog/index.vue b/src/views/base/materialUseLog/index.vue index 9f46be93..e491ca10 100644 --- a/src/views/base/materialUseLog/index.vue +++ b/src/views/base/materialUseLog/index.vue @@ -29,7 +29,7 @@ @cancel="handleCancel" @confirm="handleConfirm" :before-close="handleCancel" - width="50%"> + width="60%"> diff --git a/src/views/equipment/base/inspection/Settings/add-or-updata.vue b/src/views/equipment/base/inspection/Settings/add-or-updata.vue index e638c1e3..1f980d48 100644 --- a/src/views/equipment/base/inspection/Settings/add-or-updata.vue +++ b/src/views/equipment/base/inspection/Settings/add-or-updata.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-24 18:38:22 + * @LastEditTime: 2023-11-27 10:48:55 * @Description: --> @@ -176,11 +176,7 @@ export default { handleClick(raw) { if (raw.type === 'delete') { this.$confirm( - `确定对${ - raw.data.attrName - ? '[名称=' + raw.data.attrName + ']' - : '[序号=' + raw.data._pageIndex + ']' - }进行删除操作?`, + `是否确认删除巡检项目名称为"${raw.data.program}"的数据项?`, '提示', { confirmButtonText: '确定', diff --git a/src/views/extend/processEquValueBom/add-or-updata.vue b/src/views/extend/processEquValueBom/add-or-updata.vue index ad9621c7..7e24969a 100644 --- a/src/views/extend/processEquValueBom/add-or-updata.vue +++ b/src/views/extend/processEquValueBom/add-or-updata.vue @@ -1,8 +1,8 @@ @@ -53,7 +53,7 @@ -