diff --git a/.env.dev b/.env.dev index 962b91c1..3497fe49 100644 --- a/.env.dev +++ b/.env.dev @@ -16,7 +16,7 @@ VUE_APP_TITLE = MES系统 VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080' -# VUE_APP_BASE_API = 'http://192.168.1.49:48080' +# VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.56:48082' 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/api/quality/processTraceability.js b/src/api/quality/processTraceability.js index d2152584..5faac726 100644 --- a/src/api/quality/processTraceability.js +++ b/src/api/quality/processTraceability.js @@ -1,7 +1,7 @@ /* * @Author: zhp * @Date: 2023-10-31 15:05:06 - * @LastEditTime: 2023-11-03 09:05:50 + * @LastEditTime: 2023-11-28 09:28:05 * @LastEditors: zhp * @Description: */ @@ -24,6 +24,14 @@ export function getWorkOrderList(query) { params: query, }) } + +export function getCoreProduct(id) { + return request({ + url: '/base/core-product/get?id=' + id, + method: 'get' + }) +} + // 导出物料信息 // export function exportEnergyPlcExcel(query) { // return request({ 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/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index 3c92a2f4..0c4fcff1 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -76,6 +76,7 @@ class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" + :key="col.prop" v-if="col.upload"> + @delete="!disabled && handleDeleteFile(file, col.prop)" /> @@ -152,12 +158,30 @@ const uploadedFile = { handleDelete() { this.$emit('delete', this.file); }, + async handleDownload() { + const data = await this.$axios({ + url: this.file.fileUrl, + method: 'get', + responseType: 'blob', + }); + + await this.$message.success('开始下载'); + // create download link + const url = window.URL.createObjectURL(data); + const link = document.createElement('a'); + link.href = url; + link.download = this.file.fileName; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }, }, mounted() {}, render: function (h) { return (
{ + this.form[prop] = this.form[prop] ?? []; + }); + } } }, deep: true, @@ -348,7 +378,7 @@ export default { // 处理输入框数据 this.form[opt.prop] = response.data; // 更新下外部的 dataForm,防止code字段有数据也报空的bug - this.$emit('update', this.form) + this.$emit('update', this.form); } }); } @@ -377,11 +407,12 @@ export default { // 上传成功的特殊处理 beforeUpload() {}, // 上传前的验证规则可通过 bind 属性传入 - handleUploadSuccess(response, file, fileList) { - this.form.files.push({ + handleUploadSuccess(response, file, prop) { + console.log('[handleUploadSuccess]', response, file, prop); + this.form[prop].push({ fileName: file.name, fileUrl: response.data, - fileType: 2, + fileType: prop == 'files' ? 2 : 1, }); this.$modal.msgSuccess('上传成功'); this.$emit('update', this.form); @@ -395,8 +426,8 @@ export default { this.uploadOpen = !this.uploadOpen; }, - handleDeleteFile(file) { - this.form.files = this.form.files.filter( + handleDeleteFile(file, prop) { + this.form[prop] = this.form[prop].filter( (item) => item.fileUrl != file.fileUrl ); this.$emit('update', this.form); diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 7cb684f3..1b0d68c1 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -124,9 +124,9 @@ export default { this.Quill = new Quill(editor, this.options); // 取消自动聚焦 start this.$nextTick(() => { - this.Quill.blur(); + this.Quill?.blur(); if (!this.readOnly) { - this.Quill.enable(); + this.Quill?.enable(); } }); // 如果设置了上传地址则自定义图片上传事件 diff --git a/src/layout/components/DialogWithMenu.vue b/src/layout/components/DialogWithMenu.vue deleted file mode 100644 index efd6428e..00000000 --- a/src/layout/components/DialogWithMenu.vue +++ /dev/null @@ -1,978 +0,0 @@ - - - - - diff --git a/src/views/base/coreEquipment/components/AssetsUpload.vue b/src/views/base/coreEquipment/components/AssetsUpload.vue index bd19723d..a5a3319d 100644 --- a/src/views/base/coreEquipment/components/AssetsUpload.vue +++ b/src/views/base/coreEquipment/components/AssetsUpload.vue @@ -46,35 +46,36 @@ }}文件大小不超过2MB
-
- + style="width: 100%"> +
+ +
+ +
@@ -189,6 +190,32 @@ export default { }, 500); }, + async handleDownload(file) { + if (this.isPicMode) { + // this.$emit('preview', file); + const link = document.createElement('a'); + link.href = file.fileUrl; + link.target = '_blank'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + // this.$emit('download', file); + const data = await this.$axios({ + url: file.fileUrl, + method: 'get', + responseType: 'blob', + }); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(new Blob([data])); + link.download = file.fileName; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(link.href); + } + }, + emitFilelist() { this.$emit('update', this.files); }, diff --git a/src/views/base/coreEquipment/components/EquipmentDrawer.vue b/src/views/base/coreEquipment/components/EquipmentDrawer.vue index 4fd9551b..3c58a5c9 100644 --- a/src/views/base/coreEquipment/components/EquipmentDrawer.vue +++ b/src/views/base/coreEquipment/components/EquipmentDrawer.vue @@ -42,16 +42,26 @@ v-model="form" /> -
+
+
+ + + 添加属性 + +
+ 编辑 - 确定 + 保存 - + - - - - - - + ]" + @refreshDataList="getList" + @cancel="cancelEdit" + @destroy="cancelEdit" />
@@ -96,21 +132,21 @@ export default { tableBtn: [ this.$auth.hasPermi(`base:core-equipment:update`) ? { - type: 'detail', - btnName: '详情', - } + type: 'detail', + btnName: '详情', + } : undefined, this.$auth.hasPermi('base:core-equipment:update') ? { - type: 'edit', - btnName: '修改', - } + type: 'edit', + btnName: '修改', + } : undefined, this.$auth.hasPermi('base:core-equipment:delete') ? { - type: 'delete', - btnName: '删除', - } + type: 'delete', + btnName: '删除', + } : undefined, ].filter((v) => v), tableProps: [ @@ -176,14 +212,18 @@ export default { type: 'separate', }, { - type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '', + type: this.$auth.hasPermi('base:core-equipment:export') + ? 'button' + : '', btnName: '导出', name: 'export', plain: true, color: 'primary', }, { - type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '', + type: this.$auth.hasPermi('base:core-equipment:create') + ? 'button' + : '', btnName: '新增', name: 'add', plain: true, @@ -196,7 +236,9 @@ export default { input: true, label: '设备名称', prop: 'name', - rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '设备名称不能为空', trigger: 'blur' }, + ], // bind: { // disabled: this.editMode == 'detail', // some condition, like detail mode... // } @@ -225,7 +267,9 @@ export default { label: '设备类型', prop: 'equipmentTypeId', url: '/base/core-equipment-type/page?pageNo=1&pageSize=100', - rules: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '设备类型不能为空', trigger: 'blur' }, + ], bind: { filterable: true, }, @@ -235,7 +279,11 @@ export default { label: '预计生产时间(min/天)', prop: 'workTime', rules: [ - { required: true, message: '预计生产时间不能为空', trigger: 'blur' }, + { + required: true, + message: '预计生产时间不能为空', + trigger: 'blur', + }, { type: 'number', message: '请输入正确的数字值', @@ -291,7 +339,11 @@ export default { label: '单件产品加工时间(s)', prop: 'processingTime', rules: [ - { required: true, message: '单件产品加工时间不能为空', trigger: 'blur' }, + { + required: true, + message: '单件产品加工时间不能为空', + trigger: 'blur', + }, { type: 'number', message: '请输入正确的数字值', @@ -322,13 +374,19 @@ export default { [ { upload: true, - label: '上传资料', + label: '设备资料', prop: 'files', }, ], [ - { input: true, label: '备注', prop: 'remark' } + { + upload: true, + label: '设备图片', + prop: 'files2', + fileType: 1, + }, ], + [{ input: true, label: '备注', prop: 'remark' }], // [ // { // assetUpload: true, @@ -429,7 +487,7 @@ export default { // 表单参数 form: { id: null, - files: [] + files: [], }, showUploadComponents: false, // 是否显示上传组件 }; @@ -441,36 +499,36 @@ export default { computedRows() { return this.showUploadComponents ? [ - ...this.rows, - [ - { - assetUpload: true, - key: 'eq-assets', // 用于区分不同的上传组件 - label: '上传资料', - fieldName: 'assets', - subcomponent: AssetsUpload, - prop: 'uploadedAssets', - default: [], - bind: { - 'is-pic-mode': false, + ...this.rows, + [ + { + assetUpload: true, + key: 'eq-assets', // 用于区分不同的上传组件 + label: '上传资料', + fieldName: 'assets', + subcomponent: AssetsUpload, + prop: 'uploadedAssets', + default: [], + bind: { + 'is-pic-mode': false, + }, }, - }, - ], - [ - { - assetUpload: true, - key: 'eq-pics', // 用于区分不同的上传组件 - label: '上传图片', - fieldName: 'images', - subcomponent: AssetsUpload, - // prop: '', - // default: [], - bind: { - 'is-pic-mode': true, + ], + [ + { + assetUpload: true, + key: 'eq-pics', // 用于区分不同的上传组件 + label: '上传图片', + fieldName: 'images', + subcomponent: AssetsUpload, + // prop: '', + // default: [], + bind: { + 'is-pic-mode': true, + }, }, - }, - ], - ] + ], + ] : this.rows; }, }, @@ -512,7 +570,8 @@ export default { spec: undefined, description: undefined, remark: undefined, - files: [] + files: [], + files2: [], }; this.resetForm('form'); }, @@ -540,9 +599,12 @@ export default { if (!valid) { return; } + const payload = Object.assign({}, this.form); + payload.files = [...payload.files, ...payload.files2]; + delete payload.files2; // 修改的提交 if (this.form.id != null) { - updateEquipment(this.form).then((response) => { + updateEquipment(payload).then((response) => { this.$modal.msgSuccess('修改成功'); this.open = false; this.getList(); @@ -550,7 +612,7 @@ export default { return; } // 添加的提交 - createEquipment(this.form).then((response) => { + createEquipment(payload).then((response) => { this.$modal.msgSuccess('新增成功'); this.open = false; this.getList(); @@ -569,7 +631,7 @@ export default { this.getList(); this.$modal.msgSuccess('删除成功'); }) - .catch(() => { }); + .catch(() => {}); }, /** 导出按钮操作 */ handleExport() { @@ -587,7 +649,7 @@ export default { this.$download.excel(response, '设备.xls'); this.exportLoading = false; }) - .catch(() => { }); + .catch(() => {}); }, // 查看详情 viewDetail(id) { 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: -->