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/equipment/base/inspection/settings.js b/src/api/equipment/base/inspection/settings.js index 306c092d..5f637a22 100644 --- a/src/api/equipment/base/inspection/settings.js +++ b/src/api/equipment/base/inspection/settings.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-11-08 15:56:52 - * @LastEditTime: 2023-11-20 16:38:18 + * @LastEditTime: 2023-11-25 16:22:49 * @LastEditors: DY * @Description: */ @@ -73,4 +73,30 @@ export function deleteCheck(id) { url: '/base/equipment-check/delete?id=' + id, method: 'delete' }) -} \ No newline at end of file +} + +// 获得设备巡检设置code +export function getCode() { + return request({ + url: '/base/equipment-check-config/getCode', + method: 'get' + }) +} + +// 创建巡检配置 +export function createCheckConfig(data) { + return request({ + url: '/base/equipment-check-config/create', + method: 'post', + data: data + }) +} + +// 更新巡检配置 +export function updateCheckConfig(data) { + return request({ + url: '/base/equipment-check-config/update', + method: 'put', + data: data + }) +} diff --git a/src/api/equipment/base/maintain/record.js b/src/api/equipment/base/maintain/record.js index 89f74906..8ca6f36f 100644 --- a/src/api/equipment/base/maintain/record.js +++ b/src/api/equipment/base/maintain/record.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-11-08 15:56:52 - * @LastEditTime: 2023-11-21 10:50:55 + * @LastEditTime: 2023-11-23 19:10:07 * @LastEditors: DY * @Description: */ @@ -32,3 +32,13 @@ export function exportMaintainMonitorExcel(query) { responseType: 'blob' }) } + +// 导出设备保养记录 +export function exportMaintainLogExcel(query) { + return request({ + url: '/base/equipment-maintain-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/equipment/base/repair.js b/src/api/equipment/base/repair.js index c8b115e2..79fb191b 100644 --- a/src/api/equipment/base/repair.js +++ b/src/api/equipment/base/repair.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-11-10 16:09:33 - * @LastEditTime: 2023-11-16 18:57:08 + * @LastEditTime: 2023-11-23 20:29:28 * @LastEditors: DY * @Description: */ @@ -31,3 +31,13 @@ export function deleteRepair(id) { method: 'delete' }) } + +// 导出设备维修 +export function exportRepairLogExcel(query) { + return request({ + url: '/base/equipment-repair-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/assets/icons/svg/return.svg b/src/assets/icons/svg/return.svg new file mode 100644 index 00000000..768c0c40 --- /dev/null +++ b/src/assets/icons/svg/return.svg @@ -0,0 +1,14 @@ + + + rollback + + + + + + + + + + + \ No newline at end of file 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/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 347d77f8..80a5c56e 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -29,10 +29,10 @@
  • - {{ getFileName(file.name) }} + {{ fileName }}
    - 删除 + 删除
  • @@ -71,6 +71,11 @@ export default { disabled: { type: Boolean, default: false + }, + //文件名称 + fName: { + type: String, + default: '' } }, data() { @@ -81,6 +86,7 @@ export default { uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址 headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部 fileList: [], + fileName: '' }; }, watch: { @@ -105,6 +111,14 @@ export default { }, deep: true, immediate: true + }, + fName: { + handler(val) { + if (val) { + console.log('11', val) + this.fileName = val + } + } } }, computed: { @@ -117,6 +131,7 @@ export default { // 上传前校检格式和大小 handleBeforeUpload(file) { // 校检文件类型 + this.fileName = file.name if (this.fileType) { let fileExtension = ""; if (file.name.lastIndexOf(".") > -1) { @@ -150,7 +165,7 @@ export default { }, // 上传失败 handleUploadError(err) { - this.$modal.msgError("上传图片失败,请重试"); + this.$modal.msgError("上传文件失败,请重试"); this.$modal.closeLoading() }, // 上传成功回调 @@ -180,8 +195,12 @@ export default { this.number = 0; this.$emit("input", this.listToString(this.fileList)); this.$modal.closeLoading(); + this.returnFileName() } }, + returnFileName() { + this.$emit('name', this.fileName) + }, // 获取文件名称 getFileName(name) { console.log('你好', name) 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/mixins/lb/basicPageMixin.js b/src/mixins/lb/basicPageMixin.js index 61d46432..51b89d80 100644 --- a/src/mixins/lb/basicPageMixin.js +++ b/src/mixins/lb/basicPageMixin.js @@ -33,6 +33,7 @@ export default { addUrl: '', pageUrl: '', infoUrl: '', + deleteUrl: '', basePath: '', form: {} }; @@ -60,7 +61,7 @@ export default { return this.$axios({ url, method, - params: method === 'get' ? payload : null, + params: (method === 'get' || method === 'delete') ? payload : null, data: method !== 'get' ? payload : null, }) }, @@ -77,6 +78,7 @@ export default { return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); }, del(payload) { + debugger; return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); }, diff --git a/src/styles/index.scss b/src/styles/index.scss index 93916ac0..6b3ebaee 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -163,7 +163,7 @@ input, textarea{ } ::-webkit-scrollbar-thumb { - background-color: rgba(144,147,153,.5); + background-color: #EDEDED; background-clip: padding-box; min-height: 28px; -webkit-border-radius: 2em; @@ -174,7 +174,7 @@ input, textarea{ } ::-webkit-scrollbar-thumb:hover { - background-color: rgba(144,147,153,.3); + background-color: #D9D9D9; } // 抽屉head区域---start diff --git a/src/views/base/coreDepartment/add-or-updata.vue b/src/views/base/coreDepartment/add-or-updata.vue index b566fae9..a4959014 100644 --- a/src/views/base/coreDepartment/add-or-updata.vue +++ b/src/views/base/coreDepartment/add-or-updata.vue @@ -2,43 +2,45 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-22 10:32:10 + * @LastEditTime: 2023-11-25 18:09:05 * @Description: --> + + 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: '请输入正确的数字值', @@ -288,10 +336,14 @@ export default { [ { input: true, - label: '产品加工时间(s)', + label: '单件产品加工时间(s)', prop: 'processingTime', rules: [ - { required: true, message: '产品加工时间不能为空', trigger: 'blur' }, + { + required: true, + message: '单件产品加工时间不能为空', + trigger: 'blur', + }, { type: 'number', message: '请输入正确的数字值', @@ -320,8 +372,21 @@ export default { }, ], [ - { input: true, label: '备注', prop: 'remark' } - ] + { + upload: true, + label: '设备资料', + prop: 'files', + }, + ], + [ + { + upload: true, + label: '设备图片', + prop: 'files2', + fileType: 1, + }, + ], + [{ input: true, label: '备注', prop: 'remark' }], // [ // { // assetUpload: true, @@ -422,7 +487,7 @@ export default { // 表单参数 form: { id: null, - files: [] + files: [], }, showUploadComponents: false, // 是否显示上传组件 }; @@ -434,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; }, }, @@ -505,7 +570,8 @@ export default { spec: undefined, description: undefined, remark: undefined, - files: [] + files: [], + files2: [], }; this.resetForm('form'); }, @@ -533,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(); @@ -543,7 +612,7 @@ export default { return; } // 添加的提交 - createEquipment(this.form).then((response) => { + createEquipment(payload).then((response) => { this.$modal.msgSuccess('新增成功'); this.open = false; this.getList(); @@ -562,7 +631,7 @@ export default { this.getList(); this.$modal.msgSuccess('删除成功'); }) - .catch(() => { }); + .catch(() => {}); }, /** 导出按钮操作 */ handleExport() { @@ -580,7 +649,7 @@ export default { this.$download.excel(response, '设备.xls'); this.exportLoading = false; }) - .catch(() => { }); + .catch(() => {}); }, // 查看详情 viewDetail(id) { diff --git a/src/views/base/coreEquipmentLineBind/index.vue b/src/views/base/coreEquipmentLineBind/index.vue index 1e08ce2d..c0874798 100644 --- a/src/views/base/coreEquipmentLineBind/index.vue +++ b/src/views/base/coreEquipmentLineBind/index.vue @@ -189,6 +189,10 @@ export default { ], label: '产线统计类型', prop: 'lineDataType', + bind: { + clearable: true, filterable: true + }, + rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }], }, { select: true, @@ -199,6 +203,10 @@ export default { ], label: '工段统计类型', prop: 'sectionDataType', + bind: { + clearable: true, filterable: true + }, + rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }], }, ], ], diff --git a/src/views/base/coreHotMaterial/add-or-updata.vue b/src/views/base/coreHotMaterial/add-or-updata.vue index 975cd5a8..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-15 16:23:49 + * @LastEditTime: 2023-11-27 20:12:00 * @Description: --> @@ -70,7 +73,8 @@ export default { code: undefined, name: undefined, unit: undefined, - dailyCost: undefined + dailyCost: undefined, + remark: undefined }, departmentlList: [], menuOptions: [], 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 2344438c..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-15 15:41:44 + * @LastEditTime: 2023-11-27 20:07:09 * @Description: -->