Compare commits

..

No commits in common. "9b20252e27c30d1eba95eadc54ace5dff2ffb44c" and "3e9540bcc9b79bfc82b73df5552c43c3f41b9a30" have entirely different histories.

159 changed files with 5432 additions and 7571 deletions

View File

@ -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.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080' # 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.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.49:48080'
# VUE_APP_BASE_API = 'http://192.168.1.8: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.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48082' # VUE_APP_BASE_API = 'http://192.168.1.56:48082'
@ -31,6 +31,9 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 多租户的开关 # 多租户的开关
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -14,6 +14,9 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 多租户的开关 # 多租户的开关
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -28,6 +28,9 @@ VUE_APP_APP_NAME ='yudao-admin'
# 多租户的开关 # 多租户的开关
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@ -15,6 +15,9 @@ PUBLIC_PATH = 'http://static.yudao.iocoder.cn/'
# 多租户的开关 # 多租户的开关
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@ -17,6 +17,9 @@ VUE_APP_APP_NAME ='/admin-ui-vue2/'
# 多租户的开关 # 多租户的开关
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -1,8 +1,8 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2024-07-08 14:35:17 * @LastEditTime: 2023-11-04 10:42:50
* @LastEditors: zwq * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -61,7 +61,7 @@ export function getCoreProductPage(query) {
// 获得所有列表 // 获得所有列表
export function getCoreProductList(query) { export function getCoreProductList(query) {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/core-product/listAll',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -18,15 +18,6 @@ export function deliveryProgressPage(data) {
}) })
} }
// 获取订单列表
export function listOrderList(query) {
return request({
url: '/extend/delivery-log/listOrderList',
method: 'get',
params: query
})
}
// 获取发货进度分页 // 获取发货进度分页
export function deliveryLogDetPage(data) { export function deliveryLogDetPage(data) {
return request({ return request({

View File

@ -51,13 +51,6 @@ export function getCode() {
}) })
} }
// 获得可用的班次列表
export function listClassesEnabled() {
return request({
url: '/base/group-classes/listEnable',
method: 'get'
})
}
// 导出班次基础信息 Excel // 导出班次基础信息 Excel
export function exportGroupClassesExcel(query) { export function exportGroupClassesExcel(query) {
return request({ return request({

View File

@ -1,125 +0,0 @@
import request from '@/utils/request'
// 创建排班计划配置基础信息
export function createGroupPlan(data) {
return request({
url: '/base/group-scheduling-plan/create',
method: 'post',
data: data
})
}
// 更新排班计划配置基础信息
export function updateGroupPlan(data) {
return request({
url: '/base/group-scheduling-plan/update',
method: 'put',
data: data
})
}
// 删除排班计划配置基础信息
export function deleteGroupPlan(id) {
return request({
url: '/base/group-scheduling-plan/delete?id=' + id,
method: 'delete'
})
}
// 获得排班计划配置基础信息
export function getGroupPlan(id) {
return request({
url: '/base/group-scheduling-plan/get?id=' + id,
method: 'get'
})
}
// 获得排班计划配置基础信息分页
export function getGroupPlanPage(query) {
return request({
url: '/base/group-scheduling-plan/page',
method: 'get',
params: query
})
}
// 获得所有排班计划列表
export function groupPlanList() {
return request({
url: '/base/group-scheduling-plan/listAll',
method: 'get'
})
}
// 获得排班计划相关班组列表
export function groupPlanTeamList(id) {
return request({
url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id,
method: 'get'
})
}
// 获得排班计划相关班次列表
export function groupPlanClassesList(id) {
return request({
url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id,
method: 'get'
})
}
// 获取code
export function getCode() {
return request({
url: '/base/group-scheduling-plan/getCode',
method: 'get'
})
}
// 导出排班计划配置基础信息 Excel
export function exportGroupPlanExcel(query) {
return request({
url: '/base/group-scheduling-plan/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 获得产线工段树形结构
export function getGroupPlanTree() {
return request({
url: '/base/group-scheduling-plan/getLineSectionTree',
method: 'get'
})
}
// 创建排班计划产线工段
export function createGroupPlanLine(data) {
return request({
url: '/base/group-scheduling-plan-line-section/createPlanLineSection',
method: 'post',
data: data
})
}
// 更新排班计划产线工段
export function updateGroupPlanLine(data) {
return request({
url: '/base/group-scheduling-plan-line-section/updatePlanLineSection',
method: 'put',
data: data
})
}
// 获得排班计划配置基础信息
export function getGroupPlanLine(id) {
return request({
url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id,
method: 'get'
})
}
// 获得当前登录用户所在部门id
export function getLoginUserDeptId() {
return request({
url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId',
method: 'get'
})
}

View File

@ -1,54 +0,0 @@
import request from '@/utils/request'
// 创建排班规则基础信息
export function createGroupRule(data) {
return request({
url: '/base/group-scheduling-rule/create',
method: 'post',
data: data
})
}
// 更新排班规则基础信息
export function updateGroupRule(data) {
return request({
url: '/base/group-scheduling-rule/update',
method: 'put',
data: data
})
}
// 删除排班规则基础信息
export function deleteGroupRule(id) {
return request({
url: '/base/group-scheduling-rule/delete?id=' + id,
method: 'delete'
})
}
// 获得排班规则基础信息
export function getGroupRule(id) {
return request({
url: '/base/group-scheduling-rule/get?id=' + id,
method: 'get'
})
}
// 获得排班规则基础信息分页
export function getGroupRulePage(query) {
return request({
url: '/base/group-scheduling-rule/page',
method: 'get',
params: query
})
}
// 导出排班规则基础信息 Excel
export function exportGroupRuleExcel(query) {
return request({
url: '/base/group-scheduling-rule/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -8,14 +8,7 @@ export function getPreset(query) {
params: query params: query
}) })
} }
// 获取某月预排班
export function getScheduling(query) {
return request({
url: '/base/group-team-scheduling/getScheduling',
method: 'get',
params: query
})
}
// 批量创建-更新排班信息 // 批量创建-更新排班信息
export function createOrUpdateList(data) { export function createOrUpdateList(data) {
return request({ return request({

View File

@ -1,8 +1,8 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2024-07-05 10:09:18 * @LastEditTime: 2023-10-24 11:22:28
* @LastEditors: zwq * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -61,7 +61,7 @@ export function getMaterialPage(query) {
// 获得物料列表 // 获得物料列表
export function getMaterialList(query) { export function getMaterialList(query) {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/material/listbyfilter',
method: 'get', method: 'get',
params: query params: query
}) })
@ -119,84 +119,3 @@ export function getMaterialAttr(query) {
params: query params: query
}) })
} }
// 获得物料树结构
export function getMaterialTree() {
return request({
url: '/base/core-product-material-type/listTree',
method: 'get'
})
}
// 创建物料树
export function createMaterialTree(data) {
return request({
url: '/base/core-product-material-type/create',
method: 'post',
data: data
})
}
// 更新物料树
export function updateMaterialTree(data) {
return request({
url: '/base/core-product-material-type/update',
method: 'put',
data: data
})
}
// 删除物料树
export function deleteMaterialTree(id) {
return request({
url: '/base/core-product-material-type/delete?id=' + id,
method: 'delete'
})
}
// 获得产品物料分页
export function getProductMaterialPage(query) {
return request({
url: '/base/core-product-material/page',
method: 'get',
params: query
})
}
// 删除产品物料
export function deleteProductMaterial(id) {
return request({
url: '/base/core-product-material/delete?id=' + id,
method: 'delete'
})
}
// 创建产品物料
export function createProductMaterial(data) {
return request({
url: '/base/core-product-material/create',
method: 'post',
data: data
})
}
// 更新产品物料
export function updateProductMaterial(data) {
return request({
url: '/base/core-product-material/update',
method: 'put',
data: data
})
}
// 获得产品物料
export function getProductMaterial(id) {
return request({
url: '/base/core-product-material/get?id=' + id,
method: 'get'
})
}
// 获得产品物料code
export function getProductMaterialCode() {
return request({
url: '/base/core-product-material/getCode',
method: 'POST'
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-27 17:54:28 * @LastEditTime: 2023-10-26 20:06:29
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -70,7 +70,7 @@ export function getMaterialPBList(query) {
// 获得产品列表 // 获得产品列表
export function getProList(query) { export function getProList(query) {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/core-product/listAll',
method: 'get', method: 'get',
params: query params: query
}) })
@ -110,11 +110,3 @@ export function deleteMaterialPBDet(id) {
method: 'delete' method: 'delete'
}) })
} }
// 获得产品Bom详细
export function getMaterialPBDet(id) {
return request({
url: '/base/material-product-bom-det/get?id=' + id,
method: 'get'
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 获得产品列表 // 获得产品列表
export function getProductAll() { export function getProductAll() {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/core-product/listAll',
method: 'get' method: 'get'
}) })
} }

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-25 16:22:49 * @LastEditTime: 2023-11-20 16:38:18
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -74,29 +74,3 @@ export function deleteCheck(id) {
method: 'delete' method: 'delete'
}) })
} }
// 获得设备巡检设置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
})
}

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-07 19:47:48 * @Date: 2023-11-07 19:47:48
* @LastEditTime: 2024-07-08 14:33:12 * @LastEditTime: 2023-11-23 13:57:41
* @LastEditors: zwq * @LastEditors: zhp
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -99,7 +99,7 @@ export function getProcessEquMaterialBomDet(data) {
export function getMaterialList(data) { export function getMaterialList(data) {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/material/listbyfilter',
method: 'get', method: 'get',
data: data data: data
}) })

View File

@ -25,7 +25,7 @@ export function getWorkOrderList(query) {
} }
export function getProductList(query) { export function getProductList(query) {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/core-product/listAll',
method: 'get', method: 'get',
params: query, params: query,
}) })

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-10-31 15:05:06 * @Date: 2023-10-31 15:05:06
* @LastEditTime: 2023-11-28 09:28:05 * @LastEditTime: 2023-11-03 09:05:50
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -24,14 +24,6 @@ export function getWorkOrderList(query) {
params: query, params: query,
}) })
} }
export function getCoreProduct(id) {
return request({
url: '/base/core-product/get?id=' + id,
method: 'get'
})
}
// 导出物料信息 // 导出物料信息
// export function exportEnergyPlcExcel(query) { // export function exportEnergyPlcExcel(query) {
// return request({ // return request({

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="1_基础资料" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1-1工厂信息" transform="translate(-1834.000000, -253.000000)">
<g id="icon/界面内/编辑" transform="translate(1834.000000, 253.000000)">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="常用购票人编辑32" fill-rule="nonzero">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M13.5,7.8285 C13.5,7.55235763 13.7238576,7.3285 14,7.3285 C14.2761424,7.3285 14.5,7.55235763 14.5,7.8285 L14.5,12 C14.5,13.3807119 13.3807119,14.5 12,14.5 L4,14.5 C2.61928813,14.5 1.5,13.3807119 1.5,12 L1.5,4 C1.5,2.61928813 2.61928813,1.5 4,1.5 L8.759,1.5 C8.9376328,1.5 9.10269631,1.59529946 9.19201271,1.75 C9.28132911,1.90470054 9.28132911,2.09529946 9.19201271,2.25 C9.10269631,2.40470054 8.9376328,2.5 8.759,2.5 L4,2.5 C3.17157288,2.5 2.5,3.17157288 2.5,4 L2.5,12 C2.5,12.8284271 3.17157288,13.5 4,13.5 L12,13.5 C12.8284271,13.5 13.5,12.8284271 13.5,12 L13.5,7.8285 Z M13.284,2.312 C13.4738226,2.11757837 13.784168,2.11034095 13.9828473,2.2957025 C14.1815266,2.48106405 14.1958051,2.79116533 14.015,2.994 L8.56,8.845 C8.43817243,8.97566989 8.25588756,9.03141962 8.08181033,8.9912488 C7.90773311,8.95107798 7.76830999,8.82108951 7.71606033,8.65024879 C7.66381067,8.47940808 7.70667243,8.29366989 7.8285,8.163 L13.284,2.312 Z" id="形状" stroke="#0B58FF" stroke-width="0.1" fill="#0B58FF"></path>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -76,7 +76,6 @@
class="upload-area" class="upload-area"
:class="uploadOpen ? '' : 'height-48'" :class="uploadOpen ? '' : 'height-48'"
ref="uploadArea" ref="uploadArea"
:key="col.prop"
v-if="col.upload"> v-if="col.upload">
<span class="close-icon" :class="uploadOpen ? 'open' : ''"> <span class="close-icon" :class="uploadOpen ? 'open' : ''">
<el-button <el-button
@ -88,18 +87,13 @@
<el-upload <el-upload
class="upload-in-dialog" class="upload-in-dialog"
v-if="col.upload" v-if="col.upload"
:key="col.prop + '__el-upload'"
:action="uploadUrl" :action="uploadUrl"
:headers="uploadHeaders" :headers="uploadHeaders"
:show-file-list="false" :show-file-list="false"
icon="el-icon-upload2" icon="el-icon-upload2"
:disabled="disabled" :disabled="disabled"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success=" :on-success="handleUploadSuccess"
(response, file, fileList) => {
handleUploadSuccess(response, file, col.prop);
}
"
v-bind="col.bind"> v-bind="col.bind">
<el-button size="mini" :disabled="col.bind?.disabled || false"> <el-button size="mini" :disabled="col.bind?.disabled || false">
<svg-icon <svg-icon
@ -114,10 +108,10 @@
<uploadedFile <uploadedFile
class="file" class="file"
v-for="file in form[col.prop]" v-for="file in form[col.prop] || []"
:file="file" :file="file"
:key="file.fileUrl" :key="file.fileUrl"
@delete="!disabled && handleDeleteFile(file, col.prop)" /> @delete="!disabled && handleDeleteFile(file)" />
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -142,9 +136,6 @@ function findMaxLabelWidth(rows) {
if (!opt.label) return 0; if (!opt.label) return 0;
if (opt.label.length > max) { if (opt.label.length > max) {
max = opt.label.length; max = opt.label.length;
if (opt.label.includes('(')) {
max = max - 3
}
} }
}); });
}); });
@ -161,30 +152,12 @@ const uploadedFile = {
handleDelete() { handleDelete() {
this.$emit('delete', this.file); 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() {}, mounted() {},
render: function (h) { render: function (h) {
return ( return (
<div <div
title={this.file.fileName} title={this.file.fileName}
onClick={this.handleDownload}
style={{ style={{
background: `url(${tupleImg}) no-repeat`, background: `url(${tupleImg}) no-repeat`,
backgroundSize: '14px', backgroundSize: '14px',
@ -232,7 +205,7 @@ export default {
default: false, default: false,
}, },
hasFiles: { hasFiles: {
type: Boolean | Array, type: Boolean,
default: false, default: false,
}, },
labelPosition: { labelPosition: {
@ -242,7 +215,7 @@ export default {
size: { size: {
type: String, type: String,
default: '', default: '',
} },
}, },
data() { data() {
return { return {
@ -278,13 +251,7 @@ export default {
handler(val) { handler(val) {
this.form = JSON.parse(JSON.stringify(val)); this.form = JSON.parse(JSON.stringify(val));
if (this.hasFiles) { if (this.hasFiles) {
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
this.form.files = this.form.files ?? []; this.form.files = this.form.files ?? [];
} else if (Array.isArray(this.hasFiles)) {
this.hasFiles.forEach((prop) => {
this.form[prop] = this.form[prop] ?? [];
});
}
} }
}, },
deep: true, deep: true,
@ -381,7 +348,7 @@ export default {
// //
this.form[opt.prop] = response.data; this.form[opt.prop] = response.data;
// dataFormcodebug // dataFormcodebug
this.$emit('update', this.form); this.$emit('update', this.form)
} }
}); });
} }
@ -410,12 +377,11 @@ export default {
// //
beforeUpload() {}, beforeUpload() {},
// bind // bind
handleUploadSuccess(response, file, prop) { handleUploadSuccess(response, file, fileList) {
console.log('[handleUploadSuccess]', response, file, prop); this.form.files.push({
this.form[prop].push({
fileName: file.name, fileName: file.name,
fileUrl: response.data, fileUrl: response.data,
fileType: prop == 'files' ? 2 : 1, fileType: 2,
}); });
this.$modal.msgSuccess('上传成功'); this.$modal.msgSuccess('上传成功');
this.$emit('update', this.form); this.$emit('update', this.form);
@ -429,8 +395,8 @@ export default {
this.uploadOpen = !this.uploadOpen; this.uploadOpen = !this.uploadOpen;
}, },
handleDeleteFile(file, prop) { handleDeleteFile(file) {
this.form[prop] = this.form[prop].filter( this.form.files = this.form.files.filter(
(item) => item.fileUrl != file.fileUrl (item) => item.fileUrl != file.fileUrl
); );
this.$emit('update', this.form); this.$emit('update', this.form);

View File

@ -83,7 +83,7 @@ export default {
], ],
}, },
placeholder: '请输入内容', placeholder: '请输入内容',
// readOnly: false, readOnly: true,
}, },
}; };
}, },
@ -123,13 +123,11 @@ export default {
const editor = this.$refs.editor; const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options); this.Quill = new Quill(editor, this.options);
// start // start
this.Quill?.enable(false);
this.$nextTick(() => { this.$nextTick(() => {
this.Quill?.enable(true); this.Quill.blur();
this.Quill?.blur(); if (!this.readOnly) {
// if (!this.readOnly) { this.Quill.enable();
// this.Quill?.enable(); }
// }
}); });
// //
if (this.type === 'url') { if (this.type === 'url') {
@ -198,7 +196,7 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style>
.editor-wrapper { .editor-wrapper {
position: relative; position: relative;
cursor: not-allowed; cursor: not-allowed;

View File

@ -29,10 +29,10 @@
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList"> <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
<el-link :href="`${file.url}`" :underline="false" target="_blank"> <el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ fileName }} </span> <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link> </el-link>
<div class="ele-upload-list__item-content-action"> <div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link> <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div> </div>
</li> </li>
</transition-group> </transition-group>
@ -71,11 +71,6 @@ export default {
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
},
//
fName: {
type: String,
default: ''
} }
}, },
data() { data() {
@ -86,7 +81,6 @@ export default {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, // headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: [], fileList: [],
fileName: ''
}; };
}, },
watch: { watch: {
@ -111,14 +105,6 @@ export default {
}, },
deep: true, deep: true,
immediate: true immediate: true
},
fName: {
handler(val) {
if (val) {
console.log('11', val)
this.fileName = val
}
}
} }
}, },
computed: { computed: {
@ -131,7 +117,6 @@ export default {
// //
handleBeforeUpload(file) { handleBeforeUpload(file) {
// //
this.fileName = file.name
if (this.fileType) { if (this.fileType) {
let fileExtension = ""; let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) { if (file.name.lastIndexOf(".") > -1) {
@ -165,7 +150,7 @@ export default {
}, },
// //
handleUploadError(err) { handleUploadError(err) {
this.$modal.msgError("上传文件失败,请重试"); this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading() this.$modal.closeLoading()
}, },
// //
@ -195,12 +180,8 @@ export default {
this.number = 0; this.number = 0;
this.$emit("input", this.listToString(this.fileList)); this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading(); this.$modal.closeLoading();
this.returnFileName()
} }
}, },
returnFileName() {
this.$emit('name', this.fileName)
},
// //
getFileName(name) { getFileName(name) {
console.log('你好', name) console.log('你好', name)

View File

@ -0,0 +1,978 @@
<template>
<el-dialog class="dialog-with-menu" :visible="dialogVisible" :destroy-on-close="false" @close="handleClose"
:close-on-click-modal="configs.clickModalToClose ?? true">
<!-- title -->
<div slot="title" class="dialog-title">
<h1 class="">
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
</h1>
</div>
<div class="dialog-body__inner relative">
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
<el-button v-if="configs.allowAdd ?? (dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu))" plain
type="primary" size="small" class="at-right-top" style="margin-bottom: 16px" @click="handleAddParam()">+
添加</el-button>
<template v-if="dataForm.id && !detailMode && /附件/.test(activeMenu)">
<el-upload style="position: absolute; width: 100%; height: 0" name="files" :action="uploadUrl"
:show-file-list="false" :headers="uploadHeaders" :on-success="handleUploadSuccess"
:before-upload="handleUploadCheck">
<el-button plain type="primary" size="small" class="at-right-top" style=""> <i class="el-icon-upload"></i> 上传
</el-button>
</el-upload>
</template>
<!-- menu -->
<el-tabs v-model="activeMenu" type="card" @tab-click="handleTabClick">
<!-- <el-tab-pane v-for="(tab, index) in configs.menu" :key="index" :label="tab.name" :name="tab.name"> -->
<el-tab-pane v-for="(tab, index) in actualMenus" :key="index" :name="tab.name">
<span class="slot" slot="label">
<i :class="{
'el-icon-edit': tab.key === 'info',
'el-icon-s-data': tab.key === 'attr',
'el-icon-folder-opened': tab.key === 'attachment',
}"></i>
{{ tab.name }}
</span>
<!-- 表单标签页 -->
<div v-if="tab.key === 'info'">
<!-- form -->
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null"
v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)">
<div v-if="col.forceDisabled && dataForm.id" class="force-disabled">
<el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
</div>
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable
:disabled="disableCondition(col.prop)" v-bind="col.elparams" />
<el-cascader v-if="col.cascader" v-model="dataForm[col.prop]" :options="col.options"
:disabled="detailMode" v-bind="col.elparams"></el-cascader>
<el-select v-if="col.select" v-model="dataForm[col.prop]" clearable
:disabled="disableCondition(col.prop)" v-bind="col.elparams"
@change="handleSelectChange(col, $event)">
<el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label"
:value="opt.value" />
</el-select>
<el-switch v-if="col.switch" v-model="dataForm[col.prop]" :active-value="1" :inactive-value="0"
@change="handleSwitchChange" :disabled="disableCondition(col.prop)" />
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]"
:disabled="disableCondition(col.prop)" v-bind="col.elparams" />
<quillEditor v-if="col.richInput" ref="quill-editor" v-model="dataForm[col.prop]"
:options="col.quillConfig ?? defaultQuillConfig" style="margin-top: 42px"
:disabled="disableCondition(col.prop)" />
<div class="" v-if="col.component" style="margin: 42px 0 0">
<!-- 下面这个 component 几乎是为 富文本 quill 定制的了... TODO后续可能会根据业务需求创建新的版本 -->
<component :is="col.component" :key="'component_' + col.prop"
@update:modelValue="handleComponentModelUpdate(col.prop, $event)" :modelValue="dataForm[col.prop]"
:mode="detailMode ? 'detail' : dataForm.id ? 'edit' : 'create'" />
</div>
<!-- add more... -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 表格标签页 -->
<div v-if="dataForm.id && tab.key === 'attr'" key="attr-list">
<BaseListTable :table-config="null" :column-config="filteredTableProps" :table-data="subList"
@operate-event="handleTableRowOperate" :current-page="attrPage" :current-size="attrSize"
:refresh-layout-key="Math.random()" v-loading="loadingStatus" />
<!-- paginator -->
<el-pagination class="" style="text-align: left" background @size-change="handleSizeChange"
@current-change="handlePageChange" :current-page.sync="attrPage" :page-sizes="[5, 10, 20]"
:page-size="attrSize" :total="attrTotal" layout="total, sizes, prev, next"></el-pagination>
</div>
<!-- 附件标签页 -->
<div v-if="dataForm.id && tab.key === 'attachment'" key="attachment">
<div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">文件大小不要超过 2MB</div>
<!-- 附件列表 -->
<div class="" v-loading="loadingStatus">
<ul class="file-list">
<li v-for="(file, index) in fileList" :key="index">
<span class="file-name">{{ file.name }}</span>
<span class="file-operations">
<span class="file-icon preview" @click="handleFileClick('view', file)">
<i class="el-icon-view" style="cursor: pointer"></i>
</span>
<span class="file-icon download" @click="handleFileClick('download', file)">
<i class="el-icon-download" style="color: #0b58ff; cursor: pointer"></i>
</span>
<span class="file-icon delete" @click="handleFileClick('delete', file)">
<i class="el-icon-delete" style="color: red; cursor: pointer"></i>
</span>
</span>
</li>
</ul>
</div>
<!-- img preview dialog -->
<el-dialog key="image-preview-dialog" class="image-preview-dialog" :visible.sync="imgPreviewDialogVisible"
:append-to-body="true">
<div class="img-container">
<img width="100%" :src="currentImgUrl" alt="" />
</div>
</el-dialog>
</div>
</el-tab-pane>
</el-tabs>
</div>
<!-- sub dialog -->
<small-dialog :append-to-body="true" v-if="showSubDialog" ref="subDialog" :url="urls.subase"
:configs="configs.subDialog" :related-id="dataForm.id" @refreshDataList="getSubList"></small-dialog>
<!-- footer -->
<div slot="footer">
<template v-for="(operate, index) in configs.form.operations">
<el-button v-if="showButton(operate)" :key="'operation_' + index" :type="operate.type"
@click="handleBtnClick(operate)"
:loading="(operate.name === 'add' || operate.name === 'update') && btnLoading">{{ operate.label }}</el-button>
</template>
<el-button @click="handleBtnClick({ name: 'cancel' })">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { pick as __pick } from "@/utils/filters";
import SmallDialog from "@/components/SmallDialog.vue";
import BaseListTable from "@/components/BaseListTable.vue";
import Cookies from "js-cookie";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import { quillEditor } from "vue-quill-editor";
function reConstructTreeData(listObj) {
const entry = [];
Object.keys(listObj).map((key) => {
const currentNode = listObj[key];
currentNode.label = currentNode.name;
currentNode.value = currentNode.id;
if (currentNode.parentId === "0") {
entry.push(listObj[key]);
return; // return { label: currentNode.name, value: currentNode.id, children: currentNode.children ?? [] };
}
const parentNode = listObj[currentNode.parentId];
if (!parentNode.children) {
parentNode.children = [];
}
parentNode.children.push(currentNode);
});
return entry;
}
export default {
name: "DialogWithMenu",
components: { SmallDialog, BaseListTable, quillEditor },
props: {
configs: {
type: Object,
default: () => ({}),
},
dialogVisible: {
type: Boolean,
default: false,
},
},
inject: ["urls"],
data() {
const dataForm = {};
const autoDisabledQueue = [];
const watingToRefreshQueue = [];
const cached = {}
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if (col.upload) dataForm[col.prop] = col.default ?? [];
else dataForm[col.prop] = col.default ?? null;
if (col.autoDisabled) autoDisabledQueue.push(col.prop);
if (!!col.refreshOptionsAfterConfirm) watingToRefreshQueue.push(col);
if (col.fetchData)
col.fetchData().then(({ data: res }) => {
console.log("[Fetch Data]", "list" in res.data, res.data, res.data.list);
if (res.code === 0) {
if (col.cacheFetchedData) {
// cache fetched data
cached[col.prop] = 'list' in res.data ? res.data.list : (Array.isArray(res.data) ? res.data : [])
}
if (!col.options || !col.options.length) {
this.$set(
col,
"options",
"list" in res.data
? res.data.list.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
: res.data.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
);
}
// col.options = res.data.list;
else if (col.options.length) {
"list" in res.data ? res.data.list.unshift(...col.options) : res.data.unshift(...col.options);
this.$set(
col,
"options",
"list" in res.data
? res.data.list.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
: res.data.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
);
}
} else {
col.options.splice(0);
}
// dataForm[col.prop] = col.default ?? null; // not perfect!
});
else if (col.fetchTreeData) {
// parentId 0
col.fetchTreeData().then(({ data: res }) => {
console.log("[Fetch Tree Data]", res.data);
if (res.code === 0) {
//
const obj = {};
if ("list" in res.data) {
res.data.list.map((item) => {
obj[item.id] = item;
});
} else if (Array.isArray(res.data)) {
res.data.map((item) => {
obj[item.id] = item;
});
}
//
let filteredList = reConstructTreeData(obj);
console.log("** filteredList **", filteredList);
// options
this.$set(col, "options", filteredList);
} else {
col.options.splice(0);
this.$message.error(res.msg);
}
});
}
});
});
return {
// configs,
btnLoading: false,
loadingStatus: false,
activeMenu: this.configs.menu[0].name,
dataForm,
detailMode: false,
autoDisabledQueue,
watingToRefreshQueue,
cached,
showBaseDialog: false,
baseDialogConfig: null,
subList: [],
showSubDialog: false,
disableXXX: false,
defaultQuillConfig: {
modules: {
toolbar: [
[{ font: [] }],
[{ size: ["small", false, "large", "huge"] }], // custom dropdown
["bold", "italic", "underline", "strike"], // toggled buttons
[{ color: [] }, { background: [] }], // dropdown with defaults from theme
["blockquote", "code-block"],
[{ header: 1 }, { header: 2 }], // custom button values
[{ list: "ordered" }, { list: "bullet" }],
// [{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
[{ indent: "-1" }, { indent: "+1" }], // outdent/indent
// [{ 'direction': 'rtl' }], // text direction
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'align': [] }],
// ['clean'] // remove formatting button
],
},
theme: "snow",
readOnly: false,
placeholder: "在这里输入描述信息...",
scrollingContainer: null,
},
attrPage: 1,
attrSize: 10,
attrTotal: 0,
fileList: [],
imgPreviewDialogVisible: false,
currentImgUrl: "",
};
},
mounted() {
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if (col.changeReflects && typeof col.changeReflects === 'object' && 'fromKey' in col.changeReflects && 'toProp' in col.changeReflects) {
this.$watch(
() => this.dataForm[col.prop],
val => {
if (val && (col.prop in this.cached)) {
console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop])
if (typeof col.changeReflects.fromKey === 'string') {
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)?.[col.changeReflects.fromKey]
} else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
const foundItem = this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)
if (foundItem) {
const values = col.changeReflects.fromKey.map(key => foundItem[key])
this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter)
} else {
this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter
console.log("[DialogWithMenu] mounted() 没找到对应数据")
}
}
}
},
{
immediate: false
}
)
}
});
});
},
watch: {
dialogVisible: function (val) {
if (!!val) {
this.attrPage = 1
this.attrSize = 10
}
},
},
computed: {
actualMenus() {
return this.configs.menu.filter((m) => {
if (m.onlyEditMode && !this.dataForm.id) {
return false;
}
return true;
});
},
filteredTableProps() {
return this.detailMode ? this.configs.table.props.filter((v) => v.prop !== "operations") : this.configs.table.props;
},
uploadHeaders() {
return {
token: Cookies.get("token") || "",
};
},
uploadUrl() {
return this.configs.menu.find((item) => item.key === "attachment")?.actionUrl || "#";
},
},
methods: {
disableCondition(prop) {
return this.detailMode || (this.disableXXX && this.autoDisabledQueue.indexOf(prop) !== -1);
},
/** utitilities */
showButton(operate) {
const notDetailMode = !this.detailMode;
const showAlways = operate.showAlways ?? false;
const editMode = operate.showOnEdit && this.dataForm.id;
const addMode = !operate.showOnEdit && !this.dataForm.id;
const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key;
return notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info";
},
resetForm(excludeId = false, immediate = false) {
setTimeout(
() => {
Object.keys(this.dataForm).forEach((key) => {
if (excludeId && key === "id") return;
if ("files" in this.dataForm) this.dataForm.files = [];
if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
else this.dataForm[key] = null;
if (Array.isArray(this.fileList)) {
this.fileList = [];
}
});
this.activeMenu = this.configs.menu[0].name;
this.$refs.dataForm[0].clearValidate();
},
immediate ? 0 : 200
);
},
updateOptions() {
return new Promise((resolve, reject) => {
if (this.watingToRefreshQueue.length) {
this.watingToRefreshQueue.forEach((opt) => {
console.log("[刷新数据, ", opt, "]");
if ("fetchData" in opt) {
opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => {
if (res.code === 0) {
this.$set(
opt,
"options",
"list" in res.data
? res.data.list.map((i) => ({ label: i.code, value: i.id }))
: res.data.map((i) => ({ label: i.code, value: i.id }))
);
resolve({ done: true });
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
resolve({ done: false });
}
});
}
});
} else resolve(null);
});
},
/** init **/
init(id, detailMode, menu) {
// this.dialogVisible = true;
if (this.$refs.dataForm && this.$refs.dataForm.length) {
// dialog dataForm [0]
this.$refs.dataForm[0].clearValidate();
}
console.log("[dialog] DialogWithHead init():", id, detailMode);
this.detailMode = detailMode ?? false;
this.$nextTick(() => {
this.dataForm.id = id || null;
if (this.dataForm.id) {
//
this.loadingStatus = true;
//
this.getSubList();
//
this.updateOptions().then((result) => {
if (result === null || (typeof result === "object" && result.done)) {
this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => {
if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm);
this.dataForm = __pick(res.data, dataFormKeys);
if ("files" in res.data) {
console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList);
/** 返回的文件列表 */
this.fileList = res.data.files
? res.data.files.map((file) => ({
id: file.id,
name: file.fileUrl.split("/").pop(),
url: file.fileUrl,
typeCode: file.typeCode,
}))
: [];
}
}
this.loadingStatus = false;
//
if (menu && menu.key) {
this.activeMenu = this.configs.menu.find((item) => item.key === menu.key)?.name;
}
});
}
});
} else {
//
this.updateOptions();
}
});
},
/** handlers */
handleFileClick(type, file) {
switch (type) {
case "view": {
//
this.$http
.get("/pms/attachment/downloadFile", {
params: {
attachmentId: file.id,
type: 0, // 0 1
},
responseType: "blob",
})
.then(({ data: res }) => {
console.log("preivew", res);
if (/image/i.test(res.type)) {
//
this.currentImgUrl = URL.createObjectURL(res);
this.imgPreviewDialogVisible = true;
} else if (/pdf/i.test(res.type)) {
// pdf
let a = document.createElement('a')
a.setAttribute('target', '_blank')
a.href = URL.createObjectURL(res)
a.click()
console.log('before remove a ', a)
a.remove()
console.log('removed a ', a)
} else {
this.$message({
message: "非图片和PDF文件请下载后预览",
type: "error",
duration: 1500,
});
}
});
break;
}
case "download": {
//
this.$http
.get("/pms/attachment/downloadFile", {
params: {
attachmentId: file.id,
type: 1, // 0 1
},
responseType: "blob",
})
.then(({ data: res }) => {
const blob = new Blob([res]);
/** 通知 */
this.$notify({
title: "成功",
message: "开始下载",
type: "success",
duration: 1200,
});
if ("download" in document.createElement("a")) {
const alink = document.createElement("a");
alink.download = file.name;
alink.style.display = "none";
alink.target = "_blank";
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
document.body.removeChild(alink);
} else {
navigator.msSaveBlob(blob, fileName);
}
});
break;
}
case "delete": {
return this.$confirm(`确定删除图片: ${file.name}`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
this.loadingStatus = true;
const newFilelist = this.fileList.filter((f) => f.id !== file.id);
this.updateRemoteFiles(newFilelist).then((msg) => {
if (msg && msg === "success") {
this.fileList = newFilelist;
this.loadingStatus = false;
/** 通知 */
this.$notify({
title: "成功",
message: "已删除",
type: "success",
duration: 1200,
});
}
});
})
.catch((err) => { });
}
}
},
handleUploadSuccess(response, file, fileList) {
console.log("[DialogWithMenu] uploadedFileList", response, file, fileList);
if (response.code === 0) {
const uploadedFile = response.data[0];
const fileItem = {
id: uploadedFile.id,
name: uploadedFile.fileUrl.split("/").pop(),
url: uploadedFile.fileUrl,
typeCode: file.typeCode,
};
this.loadingStatus = true;
this.updateRemoteFiles([...this.fileList, fileItem]).then((msg) => {
if (msg && msg === "success") {
this.fileList.push(fileItem);
this.loadingStatus = false;
/** 通知 */
this.$notify({
title: "成功",
message: "上传成功",
type: "success",
duration: 1200,
});
}
});
}
},
updateRemoteFiles(filelist) {
return this.$http
.put("/pms/product", {
id: "id" in this.dataForm ? this.dataForm.id : "DEFAULT_ID",
fileIds: filelist.map((f) => f.id),
})
.then(({ data: res }) => {
if (res.code === 0) return "success";
});
},
handleUploadCheck(file) {
console.log("[before upload]", file);
const LIMIT = 2 * 1024 * 1024; // bytes
if (file.size > LIMIT) {
this.$message({
message: "文件大小不能超过 2MB",
type: "error",
duration: 1500,
});
return false;
} else return true;
},
handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
},
handleSelectChange(col, eventValue) {
console.log("[dialog] select change: ", col, eventValue);
},
handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm);
},
handleBtnClick(payload) {
console.log("btn click payload: ", payload);
if ("name" in payload) {
switch (payload.name) {
case "cancel":
this.handleClose();
break;
case "reset":
this.resetForm(true, true); // true means exclude id
break;
case "add":
case "update": {
this.$refs.dataForm[0].validate((passed, result) => {
if (passed) {
//
this.btnLoading = true
this.loadingStatus = true;
const method = payload.name === "add" ? "POST" : "PUT";
//
const hasAttachment = !!this.configs.menu.find((item) => item.key === "attachment");
if (hasAttachment) {
const fileIds = this.fileList.map((item) => item.id);
this.$set(this.dataForm, "fileIds", fileIds);
}
// id
let extraIds = {};
if (this.configs.extraIds && typeof this.configs.extraIds === "object") {
// extraIds
Object.entries(this.configs.extraIds).forEach(([key, value]) => {
extraIds[key] = value;
});
}
//
this.btnLoading = true
this.$http({
url: this.urls.base,
method,
data: {
...extraIds,
...this.dataForm,
},
})
.then(({ data: res }) => {
this.btnLoading = false
this.loadingStatus = false;
console.log("[add&update] res is: ", res);
if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
// watingToRefreshQueue
// if (this.watingToRefreshQueue.length) {
// //
// this.watingToRefreshQueue.forEach((opt) => {
// console.log("[, ", opt, "]");
// if ("fetchData" in opt) {
// opt.fetchData().then(({ data: res }) => {
// if (res.code === 0) {
// this.$set(
// opt,
// "options",
// "list" in res.data
// ? res.data.list.map((i) => ({ label: i.name, value: i.id }))
// : res.data.map((i) => ({ label: i.name, value: i.id }))
// );
// }
// });
// }
// });
// }
this.handleClose();
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 2000,
});
if (this.btnLoading) this.btnLoading = false
}
})
.catch((errMsg) => {
this.$message.error("参数错误:" + errMsg);
if (this.loadingStatus) this.loadingStatus = false;
if (this.btnLoading) this.btnLoading = false
});
} else {
this.$message.error("请核查字段信息");
}
});
}
}
}
},
handleTabClick(payload) {
// console.log("tab click payload: ", this.activeMenu);
// if (this.activeMenu === this.configs.menu[1].name) {
// //
// this.getSubList();
// }
},
handlePageChange(val) {
this.getSubList(val, this.attrSize);
},
handleSizeChange(val) {
this.attrPage = 1;
this.attrSize = val
this.getSubList(1, val);
},
getSubList(page, size) {
const params = {};
params.page = page ?? this.attrPage;
params.limit = size ?? this.attrSize;
const requiredParams = this.configs.table.extraParams;
if (requiredParams) {
if (Array.isArray(requiredParams)) {
requiredParams.forEach((str) => {
if (/id/i.test(str)) {
params[str] = this.dataForm.id;
} else {
params[str] = "";
}
});
} else if (typeof requiredParams === "string") {
//
params[this.configs.table.extraParams] = this.dataForm.id;
// dataForm.id
}
}
this.$http.get(this.urls.subpage, { params }).then(({ data: res }) => {
console.log("[DialogWithMenu] getSubList:", res);
if (res.code === 0 && res.data?.list) {
//
this.subList = res.data.list;
this.attrTotal = res.data.total;
} else {
this.subList.splice(0);
this.attrTotal = 0;
}
});
},
handleAddParam(id) {
this.showSubDialog = true;
this.$nextTick(() => {
this.$refs.subDialog.init(id ?? null);
});
},
handleClose() {
this.resetForm();
this.$emit("update:dialogVisible", false);
},
/** 列表handlers */
handleAddItem() {
// console.log('[dialog] handleAddItem ot list...');
this.showBaseDialog = true;
this.$nextTick(() => {
console.log("[sub-dialog] ", this.$refs["sub-dialog"].init());
});
},
handleTableRowOperate({ type, data }) {
console.log("handleTableRowOperate", type, data);
switch (type) {
case "delete": {
//
console.log('delete....', data)
const itemName = typeof data === 'object' ? (data.attrName || data.name || data.material || data.id) : data
return this.$confirm(`是否删除条目: ${itemName}`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
// this.$http.delete(this.urls.base + `/${data}`).then((res) => {
this.$http({
url: this.urls.subase,
method: "DELETE",
data: [`${data.id}`],
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success({
message: "删除成功!",
duration: 1000,
onClose: () => {
this.getSubList(1, 20);
},
});
}
});
})
.catch((err) => { });
}
case "edit": {
this.handleAddParam(data); /** data is ==> id */
break;
}
// case 'view-detail-action':
// this.openDialog(data, true);
// break;
}
},
},
};
</script>
<style scoped>
.el-menu {
margin: 16px 0 !important;
}
.el-menu.el-menu--horizontal {
border: none !important;
/* background: #0f02 !important; */
}
/* .el-menu--horizontal > .el-menu-item.is-active { */
/* border-bottom-color: #0b58ff; */
/* } */
.dialog-with-menu>>>.el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.el-select,
.el-cascader {
width: 100% !important;
}
.dialog-with-menu>>>.el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.relative {
position: relative;
}
.at-right-top {
position: absolute;
top: 0;
right: 0;
z-index: 10000;
}
ul.file-list,
ul.file-list>li {
padding: 0;
margin: 0;
list-style: none;
}
.file-list {
max-height: 20vh;
overflow-y: auto;
margin-top: 12px;
/* width: 240px; */
display: flex;
flex-direction: column;
}
ul.file-list>li {
border-radius: 4px;
background-color: #edededd2;
padding: 8px;
margin-bottom: 2px;
display: flex;
justify-content: space-between;
}
ul.file-list>li:hover {
background-color: #ededed;
}
.file-operations {
display: flex;
}
.file-icon {
margin-right: 8px;
font-size: 16px;
line-height: 1;
display: flex;
place-content: center;
width: 16px;
height: 16px;
}
/* .image-preview-dialog {
} */
.force-disabled {
margin-top: 42px;
}
</style>

View File

@ -78,6 +78,7 @@ export default {
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
}, },
del(payload) { del(payload) {
debugger;
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
}, },

View File

@ -163,7 +163,7 @@ input, textarea{
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #EDEDED; background-color: rgba(144,147,153,.5);
background-clip: padding-box; background-clip: padding-box;
min-height: 28px; min-height: 28px;
-webkit-border-radius: 2em; -webkit-border-radius: 2em;
@ -174,7 +174,7 @@ input, textarea{
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background-color: #D9D9D9; background-color: rgba(144,147,153,.3);
} }
// 抽屉head区域---start // 抽屉head区域---start
@ -197,7 +197,3 @@ input, textarea{
vertical-align: middle; vertical-align: middle;
} }
// 抽屉head区域---end // 抽屉head区域---end
// 弹出框上下分布去掉label的padding-bottom
.el-form--label-top .el-form-item__label {
padding: 0;
}

View File

@ -187,6 +187,19 @@ export function getTenantEnable() {
return process.env.VUE_APP_TENANT_ENABLE || true; return process.env.VUE_APP_TENANT_ENABLE || true;
} }
/**
* 获得验证码功能是否开启
*/
export function getCaptchaEnable() {
if (process.env.VUE_APP_CAPTCHA_ENABLE === "true") {
return true;
}
if (process.env.VUE_APP_CAPTCHA_ENABLE === "false") {
return false;
}
return process.env.VUE_APP_CAPTCHA_ENABLE || true;
}
/** /**
* 获得文档是否开启 * 获得文档是否开启
*/ */

View File

@ -2,11 +2,10 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-25 18:09:05 * @LastEditTime: 2023-11-22 10:32:10
* @Description: * @Description:
--> -->
<template> <template>
<div class="dialog">
<el-form <el-form
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
@ -28,7 +27,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="上级部门" prop="parentId"> <el-form-item label="上级部门" prop="parentId">
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门" /> <treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -40,7 +39,6 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div>
</template> </template>
<script> <script>
@ -70,7 +68,6 @@ export default {
}, },
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],
isChoosed: false,
dataRule: { dataRule: {
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }], code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }], name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
@ -107,9 +104,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.dialog {
min-height: 180px;
}
</style>

View File

@ -46,13 +46,21 @@
}}文件大小不超过2MB }}文件大小不超过2MB
</div> </div>
</el-upload> </el-upload>
<div <!-- <div
v-for="(file, index) in files" class="file-list__item"
:key="file.fileName" v-for="n in 9"
style="width: 100%"> :key="n"
:style="{
display: n > 4 && !expand ? 'none' : 'block',
}"
:data-name="n"
:class="{ 'default-icon': !isPicMode }">
<i class="el-icon-delete"></i>
</div> -->
<div <div
class="file-list__item" class="file-list__item"
v-if="!isPicMode" v-for="(file, index) in files"
:key="file.fileName"
:style="{ :style="{
background: isPicMode background: isPicMode
? `url(${file.fileUrl}) no-repeat` ? `url(${file.fileUrl}) no-repeat`
@ -60,7 +68,6 @@
backgroundSize: isPicMode ? '100% 100%' : '64px', backgroundSize: isPicMode ? '100% 100%' : '64px',
backgroundPosition: isPicMode ? '0% 0%' : 'center', backgroundPosition: isPicMode ? '0% 0%' : 'center',
}" }"
@click="handleDownload(file)"
:data-name="file.fileName"> :data-name="file.fileName">
<el-button <el-button
v-if="!disabled" v-if="!disabled"
@ -69,14 +76,6 @@
style="padding: 0" style="padding: 0"
@click="(e) => handleDelete(file)" /> @click="(e) => handleDelete(file)" />
</div> </div>
<el-image
v-else
class="file-list__item"
style="width: 100%"
:src="file.fileUrl"
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
</div>
</section> </section>
</div> </div>
</template> </template>
@ -190,32 +189,6 @@ export default {
}, 500); }, 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() { emitFilelist() {
this.$emit('update', this.files); this.$emit('update', this.files);
}, },

View File

@ -42,26 +42,16 @@
v-model="form" /> v-model="form" />
</div> </div>
<div <div v-if="section.key == 'attrs'" style="margin-top: 12px">
v-if="section.key == 'attrs'"
style="margin-top: 12px; position: relative">
<div
v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table <base-table
v-loading="attrListLoading" v-loading="attrListLoading"
:table-props="section.props" :table-props="section.props"
:page="attrQuery?.params.pageNo || 1" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :limit="attrQuery?.params.pageSize || 10"
:table-data="list" :table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
@ -86,7 +76,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑 编辑
</el-button> </el-button>
<el-button v-else type="primary" @click="handleConfirm">保存</el-button> <el-button v-else type="primary" @click="handleConfirm">确定</el-button>
<!-- sections的第二项必须是 属性列表 --> <!-- sections的第二项必须是 属性列表 -->
<!-- <el-button <!-- <el-button
v-if="sections[1].allowAdd" v-if="sections[1].allowAdd"
@ -172,9 +162,7 @@ export default {
input: true, input: true,
label: '属性名称', label: '属性名称',
prop: 'name', prop: 'name',
rules: [ rules: [{ required: true, message: '属性名称不能为空', trigger: 'blur' }],
{ required: true, message: '属性名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [

View File

@ -1,62 +1,29 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 对话框(添加) --> <!-- 对话框(添加) -->
<base-dialog <base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" width="60%"
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
@cancel="cancel"
width="60%"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm <DialogForm v-if="open" key="index-dialog-form" ref="form" label-position="top" size="small" v-model="form"
v-if="open"
key="index-dialog-form"
ref="form"
label-position="top"
size="small"
v-model="form"
:has-files="['files', 'files2']"
:rows="computedRows" /> :rows="computedRows" />
</base-dialog> </base-dialog>
<!-- 设备 详情 - 编辑 --> <!-- 设备 详情 - 编辑 -->
<EquipmentDrawer <EquipmentDrawer v-if="editVisible" ref="drawer" :mode="editMode" @update-mode="editMode = $event"
v-if="editVisible" :data-id="form.id" :sections="[
ref="drawer"
:mode="editMode"
@update-mode="editMode = $event"
:data-id="form.id"
:sections="[
{ {
name: '基本信息', name: '基本信息',
key: 'base', key: 'base',
@ -96,10 +63,7 @@
].filter((v) => v), ].filter((v) => v),
allowAdd: true, allowAdd: true,
}, },
]" ]" @refreshDataList="getList" @cancel="cancelEdit" @destroy="cancelEdit" />
@refreshDataList="getList"
@cancel="cancelEdit"
@destroy="cancelEdit" />
</div> </div>
</template> </template>
@ -212,18 +176,14 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:core-equipment:export') type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true, plain: true,
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:core-equipment:create') type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
plain: true, plain: true,
@ -236,9 +196,7 @@ export default {
input: true, input: true,
label: '设备名称', label: '设备名称',
prop: 'name', prop: 'name',
rules: [ rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
],
// bind: { // bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode... // disabled: this.editMode == 'detail', // some condition, like detail mode...
// } // }
@ -267,9 +225,7 @@ export default {
label: '设备类型', label: '设备类型',
prop: 'equipmentTypeId', prop: 'equipmentTypeId',
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100', url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
rules: [ rules: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }],
{ required: true, message: '设备类型不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -279,11 +235,7 @@ export default {
label: '预计生产时间(min/天)', label: '预计生产时间(min/天)',
prop: 'workTime', prop: 'workTime',
rules: [ rules: [
{ { required: true, message: '预计生产时间不能为空', trigger: 'blur' },
required: true,
message: '预计生产时间不能为空',
trigger: 'blur',
},
{ {
type: 'number', type: 'number',
message: '请输入正确的数字值', message: '请输入正确的数字值',
@ -339,11 +291,7 @@ export default {
label: '单件产品加工时间(s)', label: '单件产品加工时间(s)',
prop: 'processingTime', prop: 'processingTime',
rules: [ rules: [
{ { required: true, message: '单件产品加工时间不能为空', trigger: 'blur' },
required: true,
message: '单件产品加工时间不能为空',
trigger: 'blur',
},
{ {
type: 'number', type: 'number',
message: '请输入正确的数字值', message: '请输入正确的数字值',
@ -374,19 +322,13 @@ export default {
[ [
{ {
upload: true, upload: true,
label: '设备资料', label: '上传资料',
prop: 'files', prop: 'files',
}, },
], ],
[ [
{ { input: true, label: '备注', prop: 'remark' }
upload: true,
label: '设备图片',
prop: 'files2',
fileType: 1,
},
], ],
[{ input: true, label: '备注', prop: 'remark' }],
// [ // [
// { // {
// assetUpload: true, // assetUpload: true,
@ -487,7 +429,7 @@ export default {
// //
form: { form: {
id: null, id: null,
files: [], files: []
}, },
showUploadComponents: false, // showUploadComponents: false, //
}; };
@ -570,8 +512,7 @@ export default {
spec: undefined, spec: undefined,
description: undefined, description: undefined,
remark: undefined, remark: undefined,
files: [], files: []
files2: [],
}; };
this.resetForm('form'); this.resetForm('form');
}, },
@ -599,12 +540,9 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
const payload = Object.assign({}, this.form);
payload.files = [...payload.files, ...payload.files2];
delete payload.files2;
// //
if (this.form.id != null) { if (this.form.id != null) {
updateEquipment(payload).then((response) => { updateEquipment(this.form).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.open = false; this.open = false;
this.getList(); this.getList();
@ -612,7 +550,7 @@ export default {
return; return;
} }
// //
createEquipment(payload).then((response) => { createEquipment(this.form).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList(); this.getList();
@ -631,7 +569,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess('删除成功'); this.$modal.msgSuccess('删除成功');
}) })
.catch(() => {}); .catch(() => { });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -649,7 +587,7 @@ export default {
this.$download.excel(response, '设备.xls'); this.$download.excel(response, '设备.xls');
this.exportLoading = false; this.exportLoading = false;
}) })
.catch(() => {}); .catch(() => { });
}, },
// //
viewDetail(id) { viewDetail(id) {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 20:12:00 * @LastEditTime: 2023-11-15 16:23:49
* @Description: * @Description:
--> -->
<template> <template>
@ -11,7 +11,7 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="90px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="原料名称" prop="name"> <el-form-item label="原料名称" prop="name">
@ -46,9 +46,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form> </el-form>
</template> </template>
@ -73,8 +70,7 @@ export default {
code: undefined, code: undefined,
name: undefined, name: undefined,
unit: undefined, unit: undefined,
dailyCost: undefined, dailyCost: undefined
remark: undefined
}, },
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="45%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -2,14 +2,14 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 20:07:09 * @LastEditTime: 2023-11-15 15:41:44
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="isdetail" :wrapper-closable="false"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -114,6 +114,14 @@
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<div class="drawer-body__footer">
<el-button v-if="!idAttrShow" @click="goback()">取消</el-button>
<el-button v-else :disabled="isdetail" @click="init(dataForm.id)">重置</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<div class="attr-list" v-if="idAttrShow"> <div class="attr-list" v-if="idAttrShow">
<small-title <small-title
@ -150,16 +158,14 @@
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]" :page-sizes="[5, 10, 15]"
@pagination="getList" /> @pagination="getList" />
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div> </div>
</div> </div>
<div v-if="!isdetail" class="drawer-body__footer">
<el-button @click="goback()">取消</el-button>
<el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<attr-add <attr-add
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@ -247,8 +253,8 @@ export default {
isdetail: false, isdetail: false,
idAttrShow: false, idAttrShow: false,
dataRule: { dataRule: {
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }], code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }], name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }], materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }], productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }] processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
@ -264,7 +270,11 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
this.$confirm( this.$confirm(
`是否确认删除属性名为"${raw.data.name}"的数据项?`, `确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',

View File

@ -84,18 +84,18 @@ export default {
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:core-product:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-product:update`) this.$auth.hasPermi(`base:core-product:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:core-product:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-product:delete`) this.$auth.hasPermi(`base:core-product:delete`)
? { ? {
type: 'delete', type: 'delete',
@ -141,27 +141,6 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
//
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除产品名称为"${name}"的数据项`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
// //
otherMethods(val) { otherMethods(val) {
if (val.type === 'detail') { if (val.type === 'detail') {

View File

@ -144,8 +144,8 @@ export default {
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list; this.tableData = response.data.list;
this.getStatus(response.data.list) // this.getStatus(response.data.list)
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });

View File

@ -105,7 +105,7 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '供应商', label: '关键字',
placeholder: '供应商名称', placeholder: '供应商名称',
param: 'name', param: 'name',
}, },

View File

@ -2,23 +2,23 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-28 14:09:09 * @LastEditTime: 2023-11-20 16:51:24
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="true" :wrapper-closable="false"
class="drawer" class="drawer"
size="50%"> size="50%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ '工单名称:' + dataForm.name }} {{ '预使用主原料信息' }}
</small-title> </small-title>
<div class="content"> <div class="content">
<!-- <div style="height: 10vh"> <div style="height: 10vh">
<div style="font-size: 18px;">工单名{{ dataForm.name }}</div> <div style="font-size: 18px;">工单名{{ dataForm.name }}</div>
</div> --> </div>
<div class="attr-list"> <div class="attr-list">
<small-title <small-title
@ -29,8 +29,9 @@
<div class="action_btn"> <div class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;" @click="addNew()">
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button> <svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span> </span>
</template> </template>
</div> </div>
@ -55,9 +56,9 @@
@pagination="getList" /> @pagination="getList" />
</div> </div>
<!-- <div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div> --> </div>
</div> </div>
<attr-add <attr-add
@ -297,7 +298,7 @@ export default {
} }
.action_btn { .action_btn {
float: right; float: right;
margin: -40px 15px; margin: 5px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {

View File

@ -1,19 +1,21 @@
<template> <template>
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top"> <el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm">
<el-row :gutter="20"> <el-row>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="工单名称" prop="name"> <el-form-item label="工单名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input> <el-input v-model="dataForm.name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="工单编码" prop="code"> <el-form-item label="工单编码" prop="code">
<el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input> <el-input v-model="dataForm.code" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> </el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="产品名称" prop="planProductId"> <el-form-item label="产品名称" prop="planProductId">
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable @change="selectProduct"> <el-select v-model="dataForm.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
<el-option <el-option
v-for="item in productList" v-for="item in productList"
:key="item.id" :key="item.id"
@ -23,50 +25,52 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='12'>
<el-row :gutter="20">
<el-col :span='8'>
<el-form-item label="产品规格" prop="specifications"> <el-form-item label="产品规格" prop="specifications">
<el-input v-model="dataForm.specifications" placeholder="请输入产品规格" /> <el-input v-model="dataForm.specifications" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> </el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="计划开始时间"> <el-form-item label="计划开始时间">
<el-date-picker <el-date-picker
v-model="dataForm.planStartTime" v-model="dataForm.planStartTime"
type="datetime" type="datetime"
value-format="timestamp" value-format="timestamp"
style="width: 100%;" style="width: 100%;"
placeholder="请选择计划开始时间"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="计划完成时间"> <el-form-item label="计划完成时间">
<el-date-picker <el-date-picker
v-model="dataForm.planFinishTime" v-model="dataForm.planFinishTime"
type="datetime" type="datetime"
value-format="timestamp" value-format="timestamp"
style="width: 100%;" style="width: 100%;"
placeholder="请选择计划完成时间"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="计划投入数量" prop="planAssignQuantity"> <el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划投入数量"></el-input-number> <el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="计划生产数量" prop="planQuantity"> <el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划生产数量"></el-input-number> <el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> </el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="关联工艺" prop="processFlowId"> <el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange"> <el-select v-model="dataForm.processFlowId" placeholder="请选择工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
<el-option <el-option
v-for="item in processFlowList" v-for="item in processFlowList"
:key="item.id" :key="item.id"
@ -76,23 +80,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='12'>
<el-row :gutter="20">
<el-col :span='8'>
<el-form-item label="物料计算方式" prop="materialMethod"> <el-form-item label="物料计算方式" prop="materialMethod">
<!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange"> <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
<el-radio :label="1">产品基础BOM</el-radio> <el-radio :label="1">产品基础BOM</el-radio>
<el-radio :label="2">工艺扩展BOM</el-radio> <el-radio :label="2">工艺扩展BOM</el-radio>
</el-radio-group> --> </el-radio-group>
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
<el-option key="1" label="产品基础BOM" :value="1" />
<el-option key="2" label="工艺扩展BOM" :value="2" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> </el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;"> <el-select v-model="dataForm.priority" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value" :key="item.value"
@ -102,9 +102,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="工单类型" prop="type"> <el-form-item label="工单类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;"> <el-select v-model="dataForm.type" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in workOrderTypeList" v-for="item in workOrderTypeList"
:key="item.id" :key="item.id"
@ -115,10 +115,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="关联产线" prop="productLineIds"> <el-form-item label="关联产线" prop="productLineIds">
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;"> <el-select v-model="dataForm.productLineIds" placeholder="请选择" multiple style="width: 100%;">
<el-option <el-option
v-for="item in productLineList" v-for="item in productLineList"
:key="item.id" :key="item.id"
@ -128,9 +128,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='12'>
<el-form-item label="负责人" prop="workers"> <el-form-item label="负责人" prop="workers">
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input> <el-input v-model="dataForm.workers"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -175,7 +175,6 @@ export default {
planQuantity: 0, planQuantity: 0,
processFlowId: '', processFlowId: '',
materialMethod: 1, materialMethod: 1,
triggerOrigin: 1,
priority: '', priority: '',
productLineIds: [], productLineIds: [],
type: '', type: '',
@ -312,11 +311,11 @@ export default {
if (val) { if (val) {
this.productList.map(item => { this.productList.map(item => {
if (val === item.id) { if (val === item.id) {
this.dataForm.specifications = item.specifications this.dataForm.productSpec = item.specifications
} }
}) })
} else { } else {
this.dataForm.specifications = '' this.dataForm.productSpec = ''
} }
} }
} }

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2024-07-03 14:19:01 * @LastEditTime: 2023-11-16 09:14:35
* @Description: * @Description:
--> -->
<template> <template>
@ -105,7 +105,7 @@
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import SmallTitle from '../coreWorkOrder/SmallTitle'; import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add'; // import attrAdd from './attr-add';

View File

@ -1,7 +1,7 @@
<template> <template>
<el-dialog <el-dialog
:visible.sync="visible" :visible.sync="visible"
:width="'50%'" :width="'35%'"
:append-to-body="true" :append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
class="dialog"> class="dialog">
@ -17,10 +17,8 @@
ref="dataForm" ref="dataForm"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
label-width="80px" label-width="100px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="原料" prop="material"> <el-form-item label="原料" prop="material">
<el-select <el-select
v-model="dataForm.material" v-model="dataForm.material"
@ -34,8 +32,6 @@
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="来源" prop="origin"> <el-form-item label="来源" prop="origin">
<el-select <el-select
v-model="dataForm.origin" v-model="dataForm.origin"
@ -49,10 +45,6 @@
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
<el-select <el-select
v-model="dataForm.supplierId" v-model="dataForm.supplierId"
@ -66,28 +58,19 @@
:value="dict.id" /> :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次号" prop="batch"> <el-form-item label="批次号" prop="batch">
<el-input <el-input
v-model="dataForm.batch" v-model="dataForm.batch"
clearable clearable
placeholder="请输入批次号" /> placeholder="请输入批次号" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="数量" prop="num"> <el-form-item label="数量" prop="num">
<el-input-number <el-input-number
v-model="dataForm.num" v-model="dataForm.num"
clearable clearable
controls-position="right"
style="width: 100%" style="width: 100%"
placeholder="请输入数量" /> placeholder="请输入数量" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
@ -101,8 +84,6 @@
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">

View File

@ -13,7 +13,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="350" :width="300"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -57,8 +57,7 @@ import {
getCoreWOPage, getCoreWOPage,
deleteCoreWO, deleteCoreWO,
statusChange, statusChange,
getConOrderList, getConOrderList
getCoreWOList
} from '@/api/base/coreWorkOrder'; } from '@/api/base/coreWorkOrder';
@ -66,27 +65,19 @@ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'name', prop: 'name',
label: '工单名称', label: '工单名称'
minWidth: 120,
showOverflowtooltip: true
}, },
{ {
prop: 'code', prop: 'code',
label: '工单编码', label: '工单编码'
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'workers', prop: 'workers',
label: '负责人', label: '负责人'
minWidth: 100,
showOverflowtooltip: true
}, },
{ {
prop: 'priority', prop: 'priority',
@ -96,7 +87,7 @@ const tableProps = [
{ {
prop: 'triggerOrigin', prop: 'triggerOrigin',
label: '来源', label: '来源',
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val] filter: (val) => ['', 'MES', 'ERP'][val]
}, },
{ {
prop: 'status', prop: 'status',
@ -106,19 +97,15 @@ const tableProps = [
{ {
prop: 'planFinishTime', prop: 'planFinishTime',
label: '计划完成时间', label: '计划完成时间',
filter: parseTime, filter: parseTime
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划生产数量', label: '计划生产数量'
minWidth: 120,
}, },
{ {
prop: 'actualQuantity', prop: 'actualQuantity',
label: '实际生产数量', label: '实际生产数量'
minWidth: 120,
} }
]; ];
@ -140,10 +127,48 @@ export default {
allocationVisible: false, allocationVisible: false,
tableProps, tableProps,
tableBtn: [ 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:material`) this.$auth.hasPermi(`base:core-work-order:material`)
? { ? {
type: 'material', type: 'material',
btnName: '原料信息', btnName: '预使用原料信息',
}
: 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, : undefined,
{ {
@ -221,58 +246,10 @@ 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), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'name',
// defaultSelect: '',
// selectOptions: [],
// allowCreate: true,
// filterable: true
// },
{ {
type: 'input', type: 'input',
label: '工单名称', label: '工单名称',
@ -330,20 +307,9 @@ export default {
this.listQuery.name = this.$route.query.workOrderName; this.listQuery.name = this.$route.query.workOrderName;
this.formConfig[0].defaultSelect = this.$route.query.workOrderName; this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
} }
// this.getWorkOrder()
this.getDataList() this.getDataList()
}, },
methods: { methods: {
getWorkOrder() {
getCoreWOList().then(res => {
this.formConfig[0].selectOptions = res.data.map(item => {
return {
name: item.name,
id: item.name
}
})
})
},
refreshWorkOrder(val) { refreshWorkOrder(val) {
console.log(val) console.log(val)
if (val) { if (val) {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-24 18:13:02 * @LastEditTime: 2023-11-22 10:26:58
* @Description: * @Description:
--> -->
<template> <template>
@ -196,7 +196,7 @@ export default {
workCost: undefined, workCost: undefined,
remark: undefined, remark: undefined,
}, },
majorIdList: [], majorIdList: undefined,
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],
bindIds: [], bindIds: [],
@ -267,7 +267,7 @@ export default {
workCost: undefined, workCost: undefined,
remark: undefined remark: undefined
} }
this.majorIdList = [] this.majorIdList = undefined
}, },
// //
dataFormSubmit() { dataFormSubmit() {
@ -288,28 +288,24 @@ export default {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
}); });
if (this.majorIdList.length > 0) {
this.majorIdList.forEach(majorId => { this.majorIdList.forEach(majorId => {
createWoBindMa({ createWoBindMa({
workerId: this.dataForm.id, workerId: this.dataForm.id,
majorId: majorId majorId: majorId
}).then(res => {}) }).then(res => {})
}); });
}
return; return;
} }
// //
this.urlOptions.createURL(this.dataForm).then(response => { this.urlOptions.createURL(this.dataForm).then(response => {
// response.data = id // response.data = id
this.workerId = response.data this.workerId = response.data
if (this.majorIdList.length > 0) {
this.majorIdList.forEach(majorId => { this.majorIdList.forEach(majorId => {
createWoBindMa({ createWoBindMa({
workerId: this.workerId, workerId: this.workerId,
majorId: majorId majorId: majorId
}).then(res => {}) }).then(res => {})
}); });
}
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
@ -328,7 +324,6 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data; this.dataForm = response.data;
this.dataForm.departmentName = undefined
}); });
// -- // --
getWoBindMaPage({ getWoBindMaPage({

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 09:21:48 * @LastEditTime: 2023-11-22 08:55:37
* @Description: * @Description:
--> -->
<template> <template>
@ -43,9 +43,7 @@
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number <el-input-number
v-model="dataForm.sort" v-model="dataForm.sort"
controls-position="right" placeholder="排序" />
placeholder="排序"
style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -166,17 +166,13 @@ export default {
input: true, input: true,
label: '参数列名', label: '参数列名',
prop: 'plcParamName', prop: 'plcParamName',
rules: [ rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '参数名称', label: '参数名称',
prop: 'name', prop: 'name',
rules: [ rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -423,11 +419,12 @@ export default {
}, },
// //
submitAttrForm() { async submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => { this.$refs['attrForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
});
const isEdit = this.attrForm.id != null; const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true; this.attrFormSubmitting = true;
const res = await this.$axios({ const res = await this.$axios({
@ -435,7 +432,7 @@ export default {
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
data: { data: {
...this.attrForm, ...this.attrForm,
connectId: this.infoData.id, connectId: this.infoData.id
}, },
}); });
@ -451,7 +448,6 @@ export default {
}); });
} }
this.attrFormSubmitting = false; this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -1,11 +1,22 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2024-07-08 16:52:34 * @LastEditTime: 2023-11-22 11:22:38
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form <el-form
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
@ -14,210 +25,417 @@
label-width="100px" label-width="100px"
label-position="top"> label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="物料产品名称" prop="name"> <el-form-item label="物料编码" prop="code">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入物料产品名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料产品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入物料产品编码" /> :disabled="isdetail"
placeholder="请输入物料编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="物料产品类型" prop="typeId"> <el-form-item label="物料名称" prop="name">
<treeselect <el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
v-model="dataForm.typeId"
:options="deptOptions"
:normalizer="normalizer"
@select="setShowTime"
:show-count="true"
:appendToBody="true"
z-index="99999"
placeholder="选择物料产品类型" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-form-item label="单位" prop="unit"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="英文名称" prop="engName">
<el-input
v-model="dataForm.engName"
clearable
:disabled="isdetail"
placeholder="请输入英文名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料类型" prop="type">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.type"
filterable filterable
:disabled="isdetail"
style="width: 100%" style="width: 100%"
placeholder="请选择单位"> placeholder="请选择物料类型">
<el-option <el-option
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)" v-for="dict in materialList"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-form-item label="规格" prop="specifications"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input <el-input
v-model="dataForm.specifications" v-model="dataForm.spec"
clearable clearable
:disabled="isdetail"
placeholder="请输入规格" /> placeholder="请输入规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
<el-select <el-select
v-model="dataForm.supplierId" v-model="dataForm.supplierId"
filterable filterable
clearable clearable
:style="{ width: '100%' }" :disabled="isdetail"
style="width: 100%"
placeholder="请选择供应商"> placeholder="请选择供应商">
<el-option <el-option
v-for="item in supplierArr" v-for="dict in supplierList"
:key="item.id" :key="dict.id"
:label="item.name" :label="dict.name"
:value="item.id"></el-option> :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="showTime"> </el-row>
<el-form-item label="生产单位用时" prop="processTime"> <el-row :gutter="20">
<el-input <el-col :span="12">
v-model.number="dataForm.processTime" <el-form-item label="单位" prop="unit">
type="number" <el-select
clearable v-model="dataForm.unit"
placeholder="请输入产线生产单位用时" /> filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料单位">
<el-option
v-for="dict in getDictDatas('unit_dict')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
物料属性
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="materialAttrList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:material-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template> </template>
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { getTreeArr } from '../mixins/code-filter'; import { createMaterial, updateMaterial, getMaterial, getCode, getSupplierList, getMaterialAttrList, deleteMaterialAttr } from "@/api/base/material";
import { import { listData } from "@/api/system/dict/data";
createProductMaterial, import SmallTitle from './SmallTitle';
updateProductMaterial, import { parseTime } from '../../core/mixins/code-filter';
getProductMaterial, import attrAdd from './attr-add';
getProductMaterialCode, import { getDictDatas } from "@/utils/dict";
getSupplierList,
getMaterialTree, const tableBtn = [
} from '@/api/base/material'; {
import Treeselect from '@riophae/vue-treeselect'; type: 'edit',
import '@riophae/vue-treeselect/dist/vue-treeselect.css'; btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'attrName',
label: '属性名',
},
{
prop: 'attrValue',
label: '属性值',
},
];
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
components: { components: { SmallTitle, attrAdd },
Treeselect,
},
data() { data() {
return { return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: { urlOptions: {
isGetCode: true, isGetCode: true,
codeURL: getProductMaterialCode, codeURL: getCode,
createURL: createProductMaterial, createURL: createMaterial,
updateURL: updateProductMaterial, updateURL: updateMaterial,
infoURL: getProductMaterial, infoURL: getMaterial,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
}, },
deptOptions: undefined,
showTime: false,
dataForm: { dataForm: {
id: undefined, id: undefined,
code: undefined, code: undefined,
name: '', name: '',
typeId: undefined, engName: '',
unit: undefined, type: '',
specifications: undefined, spec: undefined,
supplierId: undefined, supplierId: undefined,
processTime: 0,
remark: undefined, remark: undefined,
unit: ''
}, },
supplierArr: [], materialList: [],
treeArr: [], supplierList: [],
materialAttrList: [],
unitList: [],
visible: false,
isdetail: false,
idAttrShow: false,
dataRule: { dataRule: {
code: [{ required: true, message: '编号不能为空', trigger: 'blur' }], code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }], name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
typeId: [ type: [{ required: true, message: "物料类型不能为空", trigger: "blur" }]
{ }
required: true,
message: '物料产品类型不能为空',
trigger: 'blur',
},
],
},
}; };
}, },
mounted() {}, mounted() {
this.getDict()
},
methods: { methods: {
init(id) { async getDict() {
this.dataForm.id = id || ''; //
const res = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'material_type',
});
this.materialList = res.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
}
});
//
const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data;
//
// const unitRes = await listData({
// pageNo: 1,
// pageSize: 99,
// dictType: 'goods_unit',
// });
// this.unitList = unitRes.data.list.map(item => {
// return {
// label: item.label,
// value: Number(item.value)
// }
// });
},
initData() {
this.materialAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteMaterialAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getMaterialAttrList({
...this.listQuery,
materialId: this.dataForm.id,
}).then((response) => {
this.materialAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true; this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.infoURL(id).then((response) => { //
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data; this.dataForm = response.data;
this.setDataForm(); if (this.dataForm.unit) {
this.dataForm.unit = String(this.dataForm.unit)
}
}); });
//
this.getList();
} else { } else {
if (this.urlOptions.isGetCode) { if (this.urlOptions.isGetCode) {
this.getCode(); this.getCode()
this.setDataForm();
} }
} }
}); });
}, },
typeId(typeId, product) { goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.dataForm.typeId = typeId || undefined; this.$refs.addOrUpdate.init(id);
this.showTime = product || false;
}); });
},
setDataForm() {
getSupplierList().then((res) => {
this.supplierArr = res.data;
});
//
getMaterialTree().then((response) => {
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, 'id'));
this.$nextTick(() => {
if (this.dataForm.id) {
this.treeArr = [];
this.treeArr = getTreeArr(response.data);//
this.showTime = this.treeArr.find(
(item) => item.id == this.dataForm.typeId
).product;
} }
});
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
} }
return {
id: node.id,
label: node.name,
children: node.children,
};
},
setShowTime(node) {
this.showTime = node.product || false;
},
},
}; };
</script> </script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: -35px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,141 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="attrName">
<el-input
v-model="dataForm.attrName"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="attrValue">
<el-input
v-model="dataForm.attrValue"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createMaterialAttr,
updateMaterialAttr,
getMaterialAttr
} from '@/api/base/material';
export default {
props: {
materialId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
attrName: '',
attrValue: '',
},
dataRule: {
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getMaterialAttr({
id: this.dataForm.id
}).then((res) => {
const { attrName, attrValue } = res.data;
this.dataForm.attrName = attrName;
this.dataForm.attrValue = attrValue;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateMaterialAttr({
...this.dataForm,
materialId: this.materialId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createMaterialAttr({
...this.dataForm,
materialId: this.materialId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -1,71 +1,5 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:54:06
* @LastEditors: zwq
* @LastEditTime: 2024-07-08 15:12:18
* @Description:
-->
<template> <template>
<div style="display: flex; gap: 16px; flex: 1; background: #eff1f6"> <div class="app-container">
<div
class="app-container"
style="background: white; width: 280px; border-radius: 8px">
<div class="head-container">
<el-input
v-model="treeName"
placeholder="请输入名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
</div>
<div class="head-container">
<el-tree
v-loading="treeLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
:data="deptOptions1"
:props="defaultProps"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
highlight-current
@node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span style="float: right" v-if="data.parentId !== -1">
<el-button
class="btnHover"
type="text"
icon="el-icon-edit"
size="mini"
v-if="data.parentId !== 0"
@click="() => edit(node, data)" />
<el-button
class="btnHover"
type="text"
icon="el-icon-circle-plus-outline"
size="mini"
@click="() => append(data)" />
<el-button
class="btnHover"
type="text"
icon="el-icon-remove-outline"
size="mini"
v-if="data.parentId !== 0"
@click="() => remove(node, data)" />
</span>
</span>
</el-tree>
</div>
</div>
<div
class="app-container"
style="background: #fff; border-radius: 8px; width: 1px; flex: 1">
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@ -79,7 +13,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="220"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -89,47 +23,10 @@
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update <add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="getDataList" />
</base-dialog>
</div>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="父类型">
<treeselect
v-model="form.parentId"
:options="deptOptions"
:normalizer="normalizer"
:show-count="true"
:appendToBody="true"
z-index="99999"
placeholder="选择父类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -137,129 +34,97 @@
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page'; import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import { publicFormatter } from '@/utils/dict';
import { import {
getProductMaterialPage, getMaterialPage,
deleteProductMaterial, deleteMaterial
getMaterialTree,
createMaterialTree,
updateMaterialTree,
deleteMaterialTree,
} from '@/api/base/material'; } from '@/api/base/material';
import Treeselect from '@riophae/vue-treeselect'; import { listData } from "@/api/system/dict/data";
import '@riophae/vue-treeselect/dist/vue-treeselect.css'; import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime
width: 150,
},
{
prop: 'name',
label: '物料产品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '物料产品编码', label: '物料编码'
}, },
{ {
prop: 'typeNameChain', prop: 'name',
label: '物料产品类型', label: '物料名称'
}, },
{ {
prop: 'unit', prop: 'engName',
label: '单位', label: '英文名称'
filter: publicFormatter('unit_dict'),
width: 60,
}, },
{ {
prop: 'specifications', prop: 'type',
label: '规格', label: '物料类型',
filter: publicFormatter('material_type')
}, },
{ {
prop: 'supplierName', prop: 'supplierName',
label: '供应商', label: '供应商'
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注'
}, }
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage],
name: '',
components: {
AddOrUpdate,
Treeselect,
},
data() { data() {
return { return {
//
treeName: undefined,
deptOptions: undefined,
deptOptions1: undefined,
treeLoading: false,
defaultProps: {
children: 'children',
label: 'name',
},
//
title: '',
//
open: false,
//
form: {
id: undefined,
parentId: undefined,
name: undefined,
defaultType: false,
},
//
rules: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
urlOptions: { urlOptions: {
getDataListURL: getProductMaterialPage, getDataListURL: getMaterialPage,
deleteURL: deleteProductMaterial, deleteURL: deleteMaterial
// exportURL: exportFactoryExcel,
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:core-product:update`) this.$auth.hasPermi(`base:material:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:core-product:delete`) this.$auth.hasPermi(`base:material:queryAttr`)
? {
type: 'search',
btnName: '查看属性',
}
: undefined,
this.$auth.hasPermi(`base:material:editAttr`)
? {
type: 'editAttr',
btnName: '编辑属性',
}
: undefined,
this.$auth.hasPermi(`base:material:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v)=>v),
tableData: [], tableData: [],
typeList: [],
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '物料产品名称', label: '物料名称',
placeholder: '物料产品名称', placeholder: '物料名称',
param: 'name', param: 'name',
}, },
{ {
type: 'input', type: 'input',
label: '物料产品编号', label: '物料编码',
placeholder: '物料产品编号', placeholder: '物料编码',
param: 'code', param: 'code',
}, },
{
type: 'input',
label: '物料产品类型',
param: 'type',
disabled: true,
},
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -271,45 +136,65 @@ export default {
}, },
{ {
type: this.$auth.hasPermi('base:material:create') ? 'button' : '', type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
btnName: '新增', btnName: '新增物料',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, },
], ],
}; };
}, },
watch: { components: {
// AddOrUpdate,
treeName(val) {
this.$refs.tree.filter(val);
},
}, },
created() { created() {
this.getDataList(); this.getDict()
this.getTreeselect();
}, },
methods: { methods: {
// async getDict() {
deleteHandle(id, name, index) { //
this.$confirm(`是否确认删除物料产品名称为"${name}"的数据项`, '提示', { const res = await listData({
confirmButtonText: '确定', pageNo: 1,
cancelButtonText: '取消', pageSize: 99,
type: 'warning', dictType: 'material_type',
}) });
.then(() => { this.typeList = res.data.list.map(item => {
this.urlOptions.deleteURL(id).then(({ data }) => { return {
this.$message({ label: item.label,
message: '操作成功', value: Number(item.value)
type: 'success', }
duration: 1500, });
onClose: () => {
this.getDataList();
}, },
otherMethods(val) {
if (val.type === 'search') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
}); });
} else {
this.addOrEditTitle = '编辑';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
}); });
}
},
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.records.map(item => {
this.typeList.filter(t => {
if (item.type === t.value) {
item.materialType = t.label
}
}) })
.catch(() => {}); return item
});
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
@ -320,13 +205,19 @@ export default {
this.listQuery.code = val.code ? val.code : undefined; this.listQuery.code = val.code ? val.code : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add': case 'add':
this.addOrEditTitle = '新增'; this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.addOrUpdateHandle();
this.$refs.addOrUpdate.init();
this.$refs.addOrUpdate.typeId(this.listQuery.typeId,this.listQuery.product);
});
break; break;
case 'export': case 'export':
this.handleExport(); this.handleExport();
@ -335,126 +226,27 @@ export default {
console.log(val); console.log(val);
} }
}, },
//
/** 树操作 */ deleteHandle(id, name, index) {
this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
// confirmButtonText: "确定",
getTreeselect() { cancelButtonText: "取消",
this.treeLoading = true; type: "warning",
getMaterialTree().then((response) => {
// treeArr[0].push(...this.handleTree(response.data, 'id'));
// deptOptions
this.deptOptions = [];
this.treeLoading = false;
this.deptOptions.push(...this.handleTree(response.data, 'id'));
const arr = [{ name: '全部', parentId: -1 }];
this.deptOptions1 = arr.concat(this.deptOptions);
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.listQuery.typeId = data.id || undefined;
this.listQuery.product = data.product;
this.$refs.searchBarForm.formInline.type = data.name || undefined;
},
//
append(data) {
this.open = true;
this.title = '新增物料产品类型';
this.form.id = undefined;
this.form.parentId = data.id;
},
//
remove(node, data) {
this.$confirm(`是否确认删除名称为"${data.name}"的数据项`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}) })
.then(() => { .then(() => {
deleteMaterialTree(data.id).then(({ data }) => { this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({ this.$message({
message: '操作成功', message: "操作成功",
type: 'success', type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getTreeselect(); this.getDataList();
}, },
}); });
}); });
}) })
.catch(() => {}); .catch(() => { });
},
//
edit(node, data) {
this.open = true;
this.title = '编辑物料产品类型';
this.form.id = data.id;
this.form.name = data.name;
this.form.parentId = data.parentId;
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
} }
return {
id: node.id,
label: node.name,
children: node.children,
};
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
parentId: 0,
name: undefined,
defaultType: false,
};
this.resetForm('form');
},
//
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.form.id) {
updateMaterialTree(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.cancel();
this.getTreeselect();
});
return;
}
//
createMaterialTree(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.cancel();
this.getTreeselect();
});
});
},
}, },
}; };
</script> </script>
<style scoped>
.btnHover:hover {
color: #67c23a;
transform: scale(1.5);
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 15:10:20 * @LastEditTime: 2023-11-06 19:55:59
* @Description: * @Description:
--> -->
<template> <template>
@ -18,8 +18,7 @@
<el-select <el-select
v-model="dataForm.materialId" v-model="dataForm.materialId"
placeholder="请选择物料" placeholder="请选择物料"
@change="setMaterialCode" @change="setMaterialCode">
style="width: 100%">
<el-option <el-option
v-for="dict in materialList" v-for="dict in materialList"
:key="dict.id" :key="dict.id"

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -1,15 +1,15 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2024-07-09 09:59:11 * @LastEditTime: 2023-11-23 15:00:00
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="isdetail" :wrapper-closable="false"
class="drawer" class="drawer"
size="70%"> size="70%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -25,7 +25,7 @@
label-width="100px" label-width="100px"
label-position="top"> label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="产品名称" prop="productId"> <el-form-item label="产品名称" prop="productId">
<el-select <el-select
v-model="dataForm.productId" v-model="dataForm.productId"
@ -42,17 +42,15 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="产品BOM编码" prop="code"> <el-form-item label="产品BOM编码" prop="code">
<el-input v-model="dataForm.code" :disabled="isdetail" placeholder="请输入产品Bom编码" /> <el-input v-model="dataForm.code" :disabled="isdetail" placeholder="请输入产品Bom编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" /> <el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
<div class="attr-list" v-if="idAttrShow"> <div class="attr-list" v-if="idAttrShow">
@ -62,26 +60,90 @@
BOM明细 BOM明细
</small-title> </small-title>
<div v-if="!isdetail" class="action_btn"> <!-- <base-table
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
</span>
</template>
</div>
<base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="tableData"> :add-button-show="isdetail ? null : '添加属性'"
@emitButtonClick="addNew()"
:table-data="materialAttrList">
<method-btn <method-btn
v-if="!isdetail" v-if="!isdetail"
slot="handleBtn" slot="handleBtn"
:width="90" :width="120"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table> -->
<el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="createTime" label="添加时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称">
<template slot-scope="scope">
<el-select
v-model="scope.row.materialId"
filterable
clearable
:disabled="!scope.row.isEdit"
placeholder="请选择物料"
@change="setCode(scope.row)">
<el-option
v-for="dict in materialList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="materialCode" label="物料编码" />
<el-table-column prop="mUnit" label="单位" />
<el-table-column prop="num" label="数量">
<template slot-scope="scope">
<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" :disabled="!scope.row.isEdit"></el-input>
</template>
</el-table-column>
<el-table-column v-if="!isdetail" label="操作">
<template slot-scope="scope">
<el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑">
<el-button
type="text"
:style="{color:'#0B58FF'}"
size="mini"
@click="edit(scope.row)"
>
<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" />
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
</el-button>
</el-tooltip>
<el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
<el-tooltip placement="top" content="删除">
<el-button
type="text"
:style="{color:'#FF5454'}"
size="mini"
@click="deleteDetail(scope.row)"
>
<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" />
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination <pagination
v-show="listQuery.total > 0" v-show="listQuery.total > 0"
:total="listQuery.total" :total="listQuery.total"
@ -91,28 +153,31 @@
@pagination="getList" /> @pagination="getList" />
</div> </div>
<div v-if="!isdetail" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</div> </div>
<attr-add <!-- <attr-add
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:bom-id="dataForm.id" :material-id="dataForm.id"
@refreshDataList="getList" /> @refreshDataList="getList" /> -->
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom"; import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProList, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom";
import { getMaterialTree,getMaterialList } from '@/api/base/material'; import { getMaterialList } from "@/api/base/material";
import SmallTitle from '../coreWorkOrder/SmallTitle'; import { listData } from "@/api/system/dict/data";
import SmallTitle from '../material/SmallTitle';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add'; // import attrAdd from './attr-add';
import { publicFormatter } from '@/utils/dict';
const tableBtn = [ const tableBtn = [
{ {
@ -131,31 +196,18 @@ const tableProps = [
filter: parseTime, filter: parseTime,
}, },
{ {
prop: 'materialName', prop: 'attrName',
label: '物料名称', label: '属性名',
}, },
{ {
prop: 'materialCode', prop: 'attrValue',
label: '物料编码', label: '属性值',
}, },
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'num',
label: '数量',
},
{
prop: 'remark',
label: '备注',
}
]; ];
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
components: { SmallTitle, attrAdd }, components: { SmallTitle },
data() { data() {
return { return {
tableBtn, tableBtn,
@ -181,7 +233,9 @@ export default {
}, },
productList: [], productList: [],
materialAttrList: [], materialAttrList: [],
materialList: [],
tableData: [], tableData: [],
unitList: [],
visible: false, visible: false,
isdetail: false, isdetail: false,
idAttrShow: false, idAttrShow: false,
@ -194,47 +248,25 @@ export default {
this.getDict() this.getDict()
}, },
methods: { 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() { async getDict() {
const materRes = await getMaterialTree(); //
let typeId = materRes.data[0].product?materRes.data[0].id:materRes.data[1].id const proRes = await getProList();
const listQuery= { this.productList = proRes.data;
typeId:typeId //
const res = await getMaterialList();
this.materialList = res.data;
//
const unitRes = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'unit_dict',
});
this.unitList = unitRes.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
} }
const materData = await getMaterialList(listQuery); });
this.productList = [];
this.productList = materData.data;
}, },
initData() { initData() {
// this.materialAttrList.splice(0); // this.materialAttrList.splice(0);
@ -242,7 +274,8 @@ export default {
}, },
deleteDetail(raw) { deleteDetail(raw) {
this.$confirm( this.$confirm(
`是否确认删除物料名称为"${raw.materialName}"的数据项?`, `确定删除关于物料编码为${
raw.materialCode}的数据?`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -264,13 +297,70 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
setCode(row) {
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 = ''
}
// row.materialCode = tempList[0].code
// row.unit = tempList[0].unit
},
edit(row) {
row.isEdit = true
},
saveData(row) {
// 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();
});
// }
// });
},
getList() { getList() {
// Bom // Bom
getProBomList({ getProBomList({
...this.listQuery, ...this.listQuery,
bomId: this.dataForm.id bomId: this.dataForm.id
}).then((response) => { }).then((response) => {
this.tableData = response.data.records 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.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
}); });
}, },
@ -366,7 +456,7 @@ export default {
.drawer >>> .visual-part { .drawer >>> .visual-part {
flex: 1 auto; flex: 1 auto;
max-height: 20vh; max-height: 30vh;
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */ padding-right: 10px; /* 调整滚动条样式 */
@ -382,12 +472,4 @@ export default {
justify-content: flex-end; justify-content: flex-end;
padding: 18px; padding: 18px;
} }
.action_btn {
float: right;
margin: -40px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style> </style>

View File

@ -1,203 +0,0 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'40%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="80px"
@keyup.enter.native="dataFormSubmit()">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料名称" prop="materialId">
<el-select
v-model="dataForm.materialId"
placeholder="请选择物料"
clearable
filterable
@change="setCode"
style="width: 100%"
>
<el-option
v-for="dict in materialList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="dataForm.materialCode"
clearable
disabled
placeholder="请输入物料编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
style="width: 100%"
disabled
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="num">
<el-input-number v-model="dataForm.num" controls-position="right" clearable placeholder="请输入数量" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { getMaterialTree,getMaterialList } from '@/api/base/material';
import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom";
export default {
props: {
bomId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
materialId: '',
num: 0,
materialCode: undefined,
unit: undefined,
remark: '',
},
materialList: [],
dataRule: {
materialId: [{ required: true, message: '物料名称不能为空', trigger: 'change' }],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const materRes = await getMaterialTree();
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
const listQuery= {
typeId:typeId
}
const materData = await getMaterialList(listQuery);
this.materialList = [];
this.materialList = materData.data;
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getMaterialPBDet(this.dataForm.id).then((res) => {
this.dataForm = res.data
this.setCode()
});
}
});
},
setCode() {
const tempMaterial = this.materialList.filter(item =>{
return item.id === this.dataForm.materialId
})
this.dataForm.materialCode = tempMaterial[0]?.code
this.dataForm.unit = tempMaterial[0].unit === undefined ? undefined : String(tempMaterial[0]?.unit)
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateMaterialPBDet({
...this.dataForm,
bomId: this.bomId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createMaterialPBDet({
...this.dataForm,
bomId: this.bomId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -13,7 +13,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="120" :width="220"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -68,24 +68,24 @@ export default {
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
? {
type: 'detail',
btnName: '查看物料',
}
: undefined,
this.$auth.hasPermi(`base:material-product-bom:update`) this.$auth.hasPermi(`base:material-product-bom:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
// this.$auth.hasPermi(`base:material-product-bom:editMaterial`) this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
// ? { ? {
// type: 'editMaterial', type: 'search',
// btnName: '', btnName: '查看物料',
// } }
// : undefined, : undefined,
this.$auth.hasPermi(`base:material-product-bom:editMaterial`)
? {
type: 'editMaterial',
btnName: '编辑物料',
}
: undefined,
this.$auth.hasPermi(`base:material-product-bom:delete`) this.$auth.hasPermi(`base:material-product-bom:delete`)
? { ? {
type: 'delete', type: 'delete',
@ -123,7 +123,7 @@ export default {
created() {}, created() {},
methods: { methods: {
otherMethods(val) { otherMethods(val) {
if (val.type === 'detail') { if (val.type === 'search') {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情'; this.addOrEditTitle = '详情';
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2024-07-09 09:58:24 * @LastEditTime: 2023-11-22 10:40:08
* @Description: * @Description:
--> -->
<template> <template>
@ -11,10 +11,9 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="80px" label-width="80px">
label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="物料名称" prop="materialId"> <el-form-item label="物料名称" prop="materialId">
<el-select <el-select
v-model="dataForm.materialId" v-model="dataForm.materialId"
@ -22,7 +21,7 @@
clearable clearable
filterable filterable
@change="setCode" @change="setCode"
style="width: 100%"> >
<el-option <el-option
v-for="dict in materialList" v-for="dict in materialList"
:key="dict.id" :key="dict.id"
@ -31,7 +30,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode">
<el-input <el-input
v-model="dataForm.materialCode" v-model="dataForm.materialCode"
@ -40,14 +39,16 @@
placeholder="请输入物料编码" /> placeholder="请输入物料编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-form-item label="物料批次" prop="materialDateId"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="批次号" prop="materialDateId">
<el-select <el-select
v-model="dataForm.materialDateId" v-model="dataForm.materialDateId"
clearable clearable
filterable filterable
placeholder="请选择物料批次" placeholder="请选择物料批次"
style="width: 100%"> >
<el-option <el-option
v-for="dict in materialDateList" v-for="dict in materialDateList"
:key="dict.id" :key="dict.id"
@ -56,16 +57,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="使用设备" prop="equipmentId"> <el-form-item label="使用设备" prop="equipmentId">
<el-select <el-select
v-model="dataForm.equipmentId" v-model="dataForm.equipmentId"
clearable clearable
filterable filterable
placeholder="请选择使用设备" placeholder="请选择使用设备">
style="width: 100%">
<el-option <el-option
v-for="dict in eqList" v-for="dict in eqList"
:key="dict.id" :key="dict.id"
@ -74,46 +72,42 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="使用时间" prop="useTime"> <el-form-item label="使用时间" prop="useTime">
<el-date-picker <el-date-picker
v-model="dataForm.useTime" v-model="dataForm.useTime"
type="datetime" type="datetime"
format="yyyy-MM-dd HH:mm:ss" format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp" value-format='timestamp'
placeholder="选择日期时间" /> placeholder="选择日期时间" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="操作员" prop="userNames"> <el-form-item label="操作员" prop="userNames">
<el-select <el-select
v-model="dataForm.userNames" v-model="dataForm.userNames"
clearable clearable
filterable filterable
multiple multiple
placeholder="请选择操作员" placeholder="请选择操作员">
style="width: 100%">
<el-option <el-option
v-for="dict in workersList" v-for="dict in workersList"
:key="dict.id" :key="dict.id"
:label="dict.nickname" :label="dict.name"
:value="dict.nickname" /> :value="dict.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="使用数量" prop="num"> <el-form-item label="使用数量" prop="num">
<el-input-number <el-input-number v-model="dataForm.num" clearable placeholder="请输入使用数量" />
v-model="dataForm.num"
clearable
controls-position="right"
placeholder="请输入使用数量"
style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="12">
<el-form-item label="数据来源" prop="source"> <el-form-item label="数据来源" prop="source">
<el-select <el-select
v-model="dataForm.source" v-model="dataForm.source"
@ -127,29 +121,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row> </el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form> </el-form>
</template> </template>
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { import { createMaterialLog, updateMaterialLog, getMaterialLog, getEqListAll, getworkerAll } from "@/api/base/materialUseLog";
createMaterialLog, import { getMaterialList } from "@/api/base/material"
updateMaterialLog, import { getMaterDateList } from "@/api/base/materialDate"
getMaterialLog,
getEqListAll,
} from '@/api/base/materialUseLog';
import { getMaterialTree,getMaterialList } from '@/api/base/material';
import { getMaterDateList } from '@/api/base/materialDate';
import { listSimpleUsers } from '@/api/system/user';
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
@ -158,7 +141,7 @@ export default {
urlOptions: { urlOptions: {
createURL: createMaterialLog, createURL: createMaterialLog,
updateURL: updateMaterialLog, updateURL: updateMaterialLog,
infoURL: getMaterialLog, infoURL: getMaterialLog
}, },
dataForm: { dataForm: {
id: undefined, id: undefined,
@ -172,77 +155,66 @@ export default {
address: undefined, address: undefined,
num: 0, num: 0,
source: undefined, source: undefined,
remark: undefined, remark: undefined
}, },
dataSourceList: [ dataSourceList: [
{ {
id: 1, id: 1,
name: '手动', name: '手动'
}, },
{ {
id: 2, id: 2,
name: 'PDA', name: 'PDA'
}, }
], ],
materialList: [], materialList: [],
materialDateList: [], materialDateList: [],
eqList: [], eqList: [],
workersList: [], workersList: [],
dataRule: { dataRule: {
materialId: [ materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
{ required: true, message: '物料不能为空', trigger: 'blur' }, materialDateId: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
], useTime: [{ required: true, message: "使用时间不能为空", trigger: "blur" }],
useTime: [ userNames: [{ required: true, message: "操作员不能为空", trigger: "blur" }],
{ required: true, message: '使用时间不能为空', trigger: 'blur' }, num: [{ required: true, message: "使用数量不能为空", trigger: "blur" }]
], }
userNames: [
{ required: true, message: '操作员不能为空', trigger: 'blur' },
],
num: [{ required: true, message: '使用数量不能为空', trigger: 'blur' }],
},
}; };
}, },
mounted() { mounted() {
this.getDictData(); this.getDictData()
}, },
methods: { methods: {
async getDictData() { async getDictData() {
const materRes = await getMaterialTree(); const materRes = await getMaterialList()
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id this.materialList = materRes.data
const listQuery= { const dateRes = await getMaterDateList()
typeId:typeId this.materialDateList = dateRes.data
} const eqRes = await getEqListAll()
const materData = await getMaterialList(listQuery); this.eqList = eqRes.data
this.materialList = []; const workerRes = await getworkerAll()
this.materialList = materData.data; this.workersList = workerRes.data
const dateRes = await getMaterDateList();
this.materialDateList = dateRes.data;
const eqRes = await getEqListAll();
this.eqList = eqRes.data;
const workerRes = await listSimpleUsers();
this.workersList = workerRes.data;
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.dataForm.userName = this.dataForm.userNames.join(','); this.dataForm.userName = this.dataForm.userNames.join(',')
this.$refs['dataForm'].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
return false; return false;
} }
// //
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then((response) => { this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess("修改成功");
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit("refreshDataList");
}); });
return; return;
} }
// //
this.urlOptions.createURL(this.dataForm).then((response) => { this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess("新增成功");
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit("refreshDataList");
}); });
}); });
}, },
@ -251,34 +223,38 @@ export default {
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs["dataForm"].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.infoURL(id).then((response) => { this.urlOptions.infoURL(id).then(response => {
this.dataForm.id = response.data.id; this.dataForm.id = response.data.id
this.dataForm.materialCode = response.data.materialCode; this.dataForm.materialCode = response.data.materialCode
this.dataForm.materialId = response.data.materialId; this.dataForm.materialId = response.data.materialId
this.dataForm.materialDateId = response.data.materialDateId; this.dataForm.materialDateId = response.data.materialDateId
this.dataForm.equipmentId = response.data.equipmentId; this.dataForm.equipmentId = response.data.equipmentId
this.dataForm.useTime = response.data.useTime; this.dataForm.useTime = response.data.useTime
// this.dataForm.userName = response.data.userName // this.dataForm.userName = response.data.userName
this.dataForm.num = response.data.num; this.dataForm.num = response.data.num
this.dataForm.source = response.data.source; this.dataForm.source = response.data.source
this.dataForm.remark = response.data.remark; this.dataForm.remark = response.data.remark
this.dataForm.userNames = response.data.userName.split(','); this.dataForm.userNames = response.data.userName.split(',')
console.log('打印', this.dataForm)
}); });
} else { } else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
} }
}); });
}, },
setCode() { setCode() {
const tempMaterial = this.materialList.filter((item) => { const tempMaterial = this.materialList.filter(item =>{
return item.id === this.dataForm.materialId; return item.id === this.dataForm.materialId
}); })
this.dataForm.materialCode = tempMaterial[0].code; this.dataForm.materialCode = tempMaterial[0].code
getMaterDateList({ materialId: this.dataForm.materialId }).then((res) => { getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
this.materialDateList = res.data; this.materialDateList = res.data
}); })
}, }
}, },
}; };
</script> </script>

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="60%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zhp
* @LastEditTime: 2024-07-05 10:10:12 * @LastEditTime: 2023-11-01 10:30:12
* @Description: * @Description:
*/ */
export default { export default {
@ -53,12 +53,11 @@ export default {
this.listQuery.pageNo = val; this.listQuery.pageNo = val;
this.getDataList(); this.getDataList();
}, },
// 新增 // 新增 / 修改
addOrUpdateHandle() { addOrUpdateHandle(id) {
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(); this.$refs.addOrUpdate.init(id);
}); });
}, },
cancel(id) { cancel(id) {
@ -86,7 +85,6 @@ export default {
}, },
//tableBtn点击 //tableBtn点击
handleClick(val) { handleClick(val) {
console.log(val.data.packagingCode);
if (val.type === "edit") { if (val.type === "edit") {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑"; this.addOrEditTitle = "编辑";
@ -94,7 +92,7 @@ export default {
this.$refs.addOrUpdate.init(val.data.id); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data.packagingCode ) this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
} else if (val.type === "change") { } else if (val.type === "change") {
this.changeStatus(val.data.id) this.changeStatus(val.data.id)
} else { } else {
@ -103,7 +101,7 @@ export default {
}, },
// 删除 // 删除
deleteHandle(id, name, index) { deleteHandle(id, name, index) {
this.$confirm(`是否确认删除${name ? ' 名称为'+ name : '[' + index + ']'}数据项?`, "提示", { this.$confirm(`是否确认删除${name ? '[' + name + ']' : '[' + index + ']'}数据项?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",

View File

@ -1,8 +1,8 @@
/* /*
* @Date: 2020-12-29 16:49:28 * @Date: 2020-12-29 16:49:28
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2024-07-08 16:27:39 * @LastEditTime: 2023-09-12 11:13:34
* @FilePath: \basic-admin\src\filters\basicData\index.js * @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description: * @Description:
*/ */
@ -33,7 +33,7 @@ export function parseTime(time, pattern) {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time) time = parseInt(time)
} else if (typeof time === 'string') { } else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), ''); time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
} }
if ((typeof time === 'number') && (time.toString().length === 10)) { if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000 time = time * 1000
@ -62,22 +62,6 @@ export function parseTime(time, pattern) {
}) })
return time_str return time_str
} }
// 遍历树结构返回数组
export function getTreeArr(arr) {
let result =[]
arr.forEach(item => {
if(item.children && item.children.length>0){
let {children,...obj} = item
result.push(obj)
result = result.concat(getTreeArr(children))
}else{
let {children,...obj} = item
result.push(obj)
}
});
return result
}
export default function (dictTable) { export default function (dictTable) {
return function (val) { return function (val) {
return table?.[dictTable]?.[val] return table?.[dictTable]?.[val]

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-24 09:13:50 * @LastEditTime: 2023-11-22 14:40:59
* @Description: * @Description:
--> -->
<template> <template>
@ -122,8 +122,7 @@ export default {
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
param: 'workOrderId', param: 'workOrderId'
filterable: true,
}, },
{ {
// parent: 'dateFilterType', // parent: 'dateFilterType',
@ -215,26 +214,6 @@ export default {
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}) })
}, },
deleteHandle(id, name, index, packagingCode) {
this.$confirm(`是否确认删除${'[' + packagingCode + ']'}数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
handlePrint(id) { handlePrint(id) {
if (id) { if (id) {
getPackingModel(id).then(res => { getPackingModel(id).then(res => {

View File

@ -1,228 +0,0 @@
<!--
filename: chart.vue
author: liubin
date: 2023-11-29 09:03:01
description:
-->
<template>
<div class="analysis-chart">
<!-- tt ct 选择 -->
<el-button
v-for="(item, index) in ['设备CT', '设备TT', '产线CT', '产线TT']"
:key="index"
:class="[index == activeIndex ? 'activeButton' : '']"
@click="activeIndex = index">
{{ item }}
</el-button>
<!-- chart -->
<div id="chart" ref="chartDiv" class="chart" style="margin-top: 12px" />
</div>
</template>
<script>
import * as echarts from 'echarts';
export default {
name: 'AnalysisChart',
components: {},
props: ['daterange', 'tableData'],
data() {
return {
activeIndex: 0,
chart: null,
templateOption: {
tooltip: {
trigger: 'axis',
},
legend: {
icon: 'roundRect',
itemWidth: 12,
itemHeight: 12,
},
grid: {
top: '12%',
left: '6%',
right: '6%',
bottom: '12%',
},
xAxis: {
name: '时间',
axisLabel: {
margin: 12,
rotate: -8,
},
axisTicks: {
show: false,
},
data: this.daterange || [
'2020-01-02',
'2020-02-02',
'2020-03-02',
'2020-04-02',
],
},
yAxis: {
name: ['设备CT', '设备TT', '产线CT', '产线TT'][this.activeIndex],
nameLocation: 'end',
nameGap: 28,
nameTextStyle: {
fontSize: 14,
align: 'right',
},
axisLine: {
show: true,
lineStyle: {
color: '#333',
opacity: 0.6,
},
},
},
series: [
{
name: 'der Hund',
type: 'line',
data: [15, undefined, 36, 11],
},
{
name: 'die Katze',
type: 'line',
data: [5, 2, 6, 3],
},
{
name: 'die Maus',
type: 'line',
data: [11, 12, 13, 10],
},
],
},
};
},
mounted() {
this.initChart();
},
deactivated() {},
watch: {
activeIndex(val) {
this.initChart(val);
},
},
methods: {
/**
*
* @param {object} row 表格的每一列
* @param {string} key 表格列prop的后缀
*/
getListFromTableRow(row, key = '_eq_ct') {
const list = [];
for (const prop of Object.keys(row).sort()) {
if (prop.endsWith(key)) {
list.push(row[prop]);
}
}
return list;
},
/** 初始化/设置 图表 */
initChart(val) {
console.log('tableData', this.tableData);
if (!this.chart) this.chart = echarts.init(this.$refs.chartDiv);
switch (val) {
case 0:
const eqCt = this.tableData.map((row) => ({
name: row.equName,
type: 'line',
symbol: 'circle',
symbolSize: 8,
data: this.getListFromTableRow(row, '_eq_ct'),
}));
this.chart.setOption({
...this.templateOption,
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
series: eqCt,
});
break;
case 1:
const eqTt = this.tableData.map((row) => ({
name: row.equName,
type: 'line',
symbol: 'circle',
symbolSize: 8,
data: this.getListFromTableRow(row, '_eq_tt'),
}));
this.chart.setOption({
...this.templateOption,
yAxis: { ...this.templateOption.yAxis, name: '设备TT' },
series: eqTt,
});
break;
case 2:
const plCt = this.tableData.map((row) => ({
name: row.equName,
type: 'line',
symbol: 'circle',
symbolSize: 8,
data: this.getListFromTableRow(row, '_pl_ct'),
}));
this.chart.setOption({
...this.templateOption,
yAxis: { ...this.templateOption.yAxis, name: '产线CT' },
series: plCt,
});
break;
case 3:
const plTt = this.tableData.map((row) => ({
name: row.equName,
type: 'line',
symbol: 'circle',
symbolSize: 8,
data: this.getListFromTableRow(row, '_pl_tt'),
}));
this.chart.setOption({
...this.templateOption,
yAxis: { ...this.templateOption.yAxis, name: '产线TT' },
series: plTt,
});
break;
default:
const eqCt2 = this.tableData.map((row) => ({
name: row.equName,
type: 'line',
symbol: 'circle',
symbolSize: 8,
data: this.getListFromTableRow(row, '_eq_ct'),
}));
this.chart.setOption({
...this.templateOption,
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
series: eqCt2,
});
}
},
},
};
</script>
<style scoped>
.analysis-chart {
width: 100%;
height: 100%;
}
.analysis-chart >>> .el-button {
background: #f1f1f1;
color: #333;
transition: all 0.3s;
border: none;
&.activeButton,
&:hover {
background: #0b58ff;
color: #fff;
}
}
#chart {
height: 100%;
/* background: #ccc; */
}
</style>

View File

@ -1,270 +0,0 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div v-if="tableData.length">
<el-tabs
v-model="activeName"
@tab-click="handleTabClick"
style="height: 100%">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- @emitFun="handleEmitFun"> -->
<base-table
v-if="mode == 'table'"
:span-method="mergeColumnHandler"
:page="1"
:limit="999"
:table-props="tableProps"
:table-data="tableData" />
</el-tab-pane>
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
<div class="graph" style="height: 100%">
<!-- graph -->
<!-- <Graph
v-if="list.length"
:equipment-list="list"
:render="renderKey" /> -->
<BalanceChart ref="lineChart" />
<div v-if="list.length == 0" class="no-data-bg"></div>
</div>
</el-tab-pane>
</el-tabs>
<!-- <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> -->
</div>
<div v-else class="no-data-bg"></div>
</div>
</template>
<script>
import { getCT } from '@/api/core/analysis/index';
import { getCorePLList } from '@/api/base/coreProductionLine';
import BalanceChart from '../balanceChart';
export default {
components: {
BalanceChart,
},
// mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCT,
},
activeName: 'table',
tableProps: [],
tableData: [],
listQuery: {
// time: ''
endTime: undefined,
lineId: undefined,
startTime: undefined,
},
timeList: [],
spanArr: [],
xData: [],
yData: [],
optionArrUrl: [getCorePLList],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineIds',
defaultSelect: '',
multiple: false,
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'time',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
};
},
created() {
this.getArr();
},
methods: {
handleTabClick(tab, event) {
if (tab.name == 'graph') this.renderKey = Math.random();
},
getArr() {
const params = {
page: 1,
limit: 500,
};
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data;
});
});
},
setRowSpan(arr) {
let count = 0;
arr.forEach((item, index) => {
if (index === 0) {
this.spanArr.push(1);
} else {
if (item === arr[index - 1]) {
this.spanArr[count] += 1;
this.spanArr.push(0);
} else {
count = index;
this.spanArr.push(1);
}
}
});
},
/** 合并table列的规则 */
mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0) {
if (this.spanArr[rowIndex]) {
return [
this.spanArr[rowIndex], // row span
1, // col span
];
} else {
return [0, 0];
}
}
},
getData() {
// this.listQuery.lineId = '1672847052717821953'
// this.listQuery.startTime = '1693497600000';
// this.listQuery.endTime = '1693843200000';
this.urlOptions.getDataListURL(this.listQuery).then((res) => {
console.log(res);
let arr = [
{
prop: 'sectionName',
label: '工段',
align: 'center',
},
{
prop: 'equName',
label: '设备',
align: 'center',
},
];
let sectionArr = [];
res.data.data.forEach((ele, index) => {
let tempData = [];
let eqData = [];
let plData = [];
ele.data.forEach((item, index) => {
item.children.forEach((params) => {
if (params.dynamicName === '设备CT') {
tempData[item.dynamicName + '_eq'] = params.dynamicValue;
eqData[index] = params.dynamicValue;
} else {
tempData[item.dynamicName + '_pl'] = params.dynamicValue;
plData[index] = params.dynamicValue;
}
});
});
const equipment = {
name: ele.equName,
eqData: eqData,
plData: plData,
};
tempData['equName'] = ele.equName;
tempData['sectionName'] = ele.sectionName;
this.tableData.push(tempData);
const { sectionName } = tempData;
sectionArr.push(sectionName);
this.yData.push(equipment);
console.log('看看equ', this.yData);
});
this.setRowSpan(sectionArr);
res.data.nameData.forEach((item) => {
this.timeList.push(item.name);
});
const timeArray = Array.from(new Set(this.timeList));
for (const times of timeArray) {
if (times !== '设备CT' && times !== '产线CT') {
const subprop = {
label: times,
align: 'center',
children: [
{ prop: times + '_eq', label: '设备CT', align: 'center' },
{ prop: times + '_pl', label: '产线CT', align: 'center' },
],
};
arr.push(subprop);
this.xData.push(times);
}
}
this.tableProps = arr;
console.log('表格横坐标', this.xData, this.yData);
this.$nextTick(() => {
this.$refs.lineChart.initChart(this.xData, this.yData);
});
// this.total = response.data.total;
// this.dataListLoading = false;
});
},
buttonClick(val) {
// console.log(val)
switch (val.btnName) {
case 'search':
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
this.listQuery.lineId = val.lineIds;
this.listQuery.startTime = val.time
? String(new Date(val.time[0]).getTime())
: undefined;
this.listQuery.endTime = val.time
? String(new Date(val.time[1]).getTime())
: undefined;
if (val.time && val.lineIds) {
this.tableData = [];
this.xData = [];
this.yData = [];
this.tableProps = [];
this.spanArr = [];
this.timeList = [];
this.getData();
} else {
this.$message({
message: '请选择产线和时间',
type: 'warning',
});
}
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -1,74 +1,74 @@
<template> <template>
<div class="app-container" style="flex: 1; height: 1px"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <div v-if="tableData.length">
ref="searchBarForm" <base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
@headBtnClick="handleSearchBarBtnClick" /> <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
<BalanceChart ref="lineChart" />
<!-- <div v-if="tableData.length"> -->
<div class="custom-tabs" style="">
<el-tabs
v-model="activeName"
@tab-click="handleTabClick"
style="height: 100%">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<base-table
v-if="activeName == 'table' && ready"
:span-method="mergeRow"
:page="1"
:limit="999"
:table-props="tableProps"
:table-data="tableData" />
<div v-if="tableData.length == 0" class="no-data-bg"></div>
</el-tab-pane>
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
<div class="graph" style="height: 800px">
<!-- graph -->
<AnalysisChart
v-if="activeName == 'graph'"
:table-data="tableData"
:daterange="dateArr"></AnalysisChart>
<!-- <div v-else class="no-data-bg"></div> -->
<!-- <Graph
v-if="list.length"
:equipment-list="list"
:render="renderKey" /> -->
<!-- <BalanceChart ref="lineChart" /> -->
<!-- <div v-if="list.length == 0" class="no-data-bg"></div> -->
</div>
</el-tab-pane>
</el-tabs>
</div> </div>
<div v-else class="no-data-bg"></div>
<!-- <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
import BalanceChart from '../balanceChart'; // import basicPage from '../../mixins/basic-page';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import { parseTime } from '../../mixins/code-filter';
import AnalysisChart from './chart.vue'; import { getCT } from '@/api/core/analysis/index';
import { getCorePLList } from '@/api/base/coreProductionLine';
import BalanceChart from '../balanceChart'
import { time } from 'echarts';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
// const tableProps = [
// // {
// // prop: 'lineName',
// // label: '线',
// // align: 'center',
// // },
// // {
// // prop: 'sum',
// // label: '',
// // align: 'center',
// // },
// // {
// // prop: 'dynamicValue',
// // label: 'dynamicName',
// // align: 'center',
// // children:[
// // ]
// // }
// ];
export default { export default {
components: { components: {
BalanceChart, BalanceChart
AnalysisChart,
}, },
mixins: [basicPageMixin], // mixins: [basicPage],
data() { data() {
return { return {
activeName: 'table', urlOptions: {
tableProps: [ getDataListURL: getCT,
{
prop: 'sectionName',
label: '工段',
align: 'center',
}, },
{ tableProps: [],
prop: 'equName', dataListLoading: false,
label: '设备',
align: 'center',
},
],
tableData: [], tableData: [],
listQuery: {
// time: ''
endTime: undefined,
lineId:undefined,
startTime:undefined
},
timeList: [],
spanArr: [],
xData: [],
yData: [],
optionArrUrl: [getCorePLList],
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
@ -82,223 +82,74 @@ export default {
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'monthrange', dateType: 'datetimerange',
format: 'yyyy-MM', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-ddTHH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
width: 240, width: 350,
param: 'timeArr', param: 'time',
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, }
], ],
queryParams: {
lineId: null,
startTime: null,
endTime: null,
},
sectionMap: {},
lastSection: null,
currRowIndex: 0,
spanArr: [],
//
dateArr: [],
ready: false,
}; };
}, },
created() {
mounted() { this.getArr();
this.getLine();
}, },
methods: { methods: {
handleTabClick(tab, event) { getArr() {
if (tab.name == 'graph') this.renderKey = Math.random(); const params = {
page: 1,
limit: 500
}
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data
});
});
}, },
setRowSpan(arr) {
/** 初始化 tableProps */ let count = 0
initTableProps() { arr.forEach((item, index) => {
this.tableProps = [ if(index === 0) {
{ this.spanArr.push(1)
prop: 'sectionName', } else {
label: '工段', if (item === arr[index - 1]) {
align: 'center', this.spanArr[count] += 1
}, this.spanArr.push(0)
{ } else {
prop: 'equName', count = index
label: '设备', this.spanArr.push(1)
align: 'center', }
}
})
}, },
/** 合并table列的规则 */
mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0) {
if (this.spanArr[rowIndex]) {
return [
this.spanArr[rowIndex], // row span
1, // col span
]; ];
}, } else {
/** 获取产线 */
async getLine() {
this.formConfig[0].selectOptions = [];
const { code, data } = await this.http(
'/base/core-production-line/listAll',
'get'
);
if (code == 0) {
this.formConfig[0].selectOptions = data;
}
},
/** 获取产线平衡数据 */
async getCT() {
const { code, data } = await this.http(
'/analysis/equipment-analysis/getCT',
'post',
this.queryParams
);
if (code == 0) {
return data;
}
return { data: [], nameData: [] };
},
/** 解析数据 */
async getList() {
const { data, nameData } = await this.getCT();
await this.buildProps(nameData);
await this.buildTableData(data);
this.tableData = this.tableData.sort((a, b) => {
if (a.sectionName < b.sectionName) return -1;
return 1;
});
// const p = this.tableProps
// const d = this.tableData
// debugger;
this.ready = true;
},
buildProps(nameData) {
this.initTableProps();
this.dateArr = [];
return new Promise((resolve, reject) => {
try {
const dateArr = Array.from(
new Set(
nameData
.map((item) => (item.tree == 1 ? item.name : undefined))
.filter((v) => v)
)
);
//
dateArr.sort().forEach((date) => {
this.tableProps.push({
label: date,
align: 'center',
children: [
{
prop: date + '_eq_ct',
label: '设备CT',
align: 'center',
},
{
prop: date + '_eq_tt',
label: '设备TT',
align: 'center',
},
{
prop: date + '_pl_ct',
label: '产线CT',
align: 'center',
},
{
prop: date + '_pl_tt',
label: '产线TT',
align: 'center',
},
],
});
});
this.dateArr = dateArr;
resolve();
} catch (err) {
reject(err);
}
});
},
async buildTableData(data) {
this.tableData = [];
const sectionArr = Array.from(
new Set(data.map((item) => item.sectionName))
).sort();
const sectionMap = sectionArr.reduce(
(sum, curr) => ({ ...sum, [curr]: 0 }),
{}
);
console.log('sectionArr', sectionArr);
console.log('sectionMap', sectionMap);
let spanArr = Array.from(sectionArr, () => 0);
return new Promise((resolve, reject) => {
/** 处理 工段 分组 */
data.map((item) => {
sectionMap[item.sectionName]++;
/** 处理 设备 */
const row = {
equName: item.equName,
sectionName: item.sectionName,
};
item.data.forEach((eq) => {
const date = eq.dynamicName;
eq.children.forEach((sub) => {
if (sub.dynamicName == '设备CT')
row[date + '_eq_ct'] = sub.dynamicValue;
if (sub.dynamicName == '设备TT')
row[date + '_eq_tt'] = sub.dynamicValue;
if (sub.dynamicName == '产线CT')
row[date + '_pl_ct'] = sub.dynamicValue;
if (sub.dynamicName == '产线TT')
row[date + '_pl_tt'] = sub.dynamicValue;
});
});
this.tableData.push(row);
});
/** 生成span数组 */
const tmp = [...spanArr];
for (const [index, key] of sectionArr.entries()) {
tmp[index + 1] = tmp[index] + sectionMap[key];
}
console.log('tep', tmp);
spanArr = tmp;
this.sectionMap = sectionMap;
this.spanArr = spanArr;
resolve();
});
},
mergeRow({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 1) {
const span = this.sectionMap[row.sectionName];
if (this.spanArr.includes(rowIndex)) {
console.log('span...');
return [span, 1];
}
return [0, 0]; return [0, 0];
} }
}
}, },
getData() { getData() {
// this.listQuery.lineId = '1672847052717821953' // this.listQuery.lineId = '1672847052717821953'
// this.listQuery.startTime = '1693497600000'; // this.listQuery.startTime = '1693497600000';
// this.listQuery.endTime = '1693843200000'; // this.listQuery.endTime = '1693843200000';
this.urlOptions.getDataListURL(this.listQuery).then((res) => { this.urlOptions.getDataListURL(this.listQuery).then(res => {
console.log(res); console.log(res)
let arr = [ let arr = [
{ {
prop: 'sectionName', prop: 'sectionName',
@ -309,42 +160,42 @@ export default {
prop: 'equName', prop: 'equName',
label: '设备', label: '设备',
align: 'center', align: 'center',
},
];
let sectionArr = [];
res.data.data.forEach((ele, index) => {
let tempData = [];
let eqData = [];
let plData = [];
ele.data.forEach((item, index) => {
item.children.forEach((params) => {
if (params.dynamicName === '设备CT') {
tempData[item.dynamicName + '_eq'] = params.dynamicValue;
eqData[index] = params.dynamicValue;
} else {
tempData[item.dynamicName + '_pl'] = params.dynamicValue;
plData[index] = params.dynamicValue;
} }
}); ]
}); let sectionArr= []
res.data.data.forEach((ele, index) => {
let tempData = []
let eqData = []
let plData = []
ele.data.forEach((item, index) => {
item.children.forEach(params => {
if (params.dynamicName === '设备CT') {
tempData[item.dynamicName + '_eq'] = params.dynamicValue
eqData[index] = params.dynamicValue
} else {
tempData[item.dynamicName + '_pl'] = params.dynamicValue
plData[index] = params.dynamicValue
}
})
})
const equipment = { const equipment = {
name: ele.equName, name: ele.equName,
eqData: eqData, eqData: eqData,
plData: plData, plData: plData
}; }
tempData['equName'] = ele.equName; tempData['equName'] = ele.equName
tempData['sectionName'] = ele.sectionName; tempData['sectionName'] = ele.sectionName
this.tableData.push(tempData); this.tableData.push(tempData)
const { sectionName } = tempData; const { sectionName } = tempData
sectionArr.push(sectionName); sectionArr.push(sectionName)
this.yData.push(equipment); this.yData.push(equipment)
console.log('看看equ', this.yData); console.log('看看equ', this.yData)
}); })
this.setRowSpan(sectionArr); this.setRowSpan(sectionArr)
res.data.nameData.forEach((item) => { res.data.nameData.forEach(item => {
this.timeList.push(item.name); this.timeList.push(item.name)
}); })
const timeArray = Array.from(new Set(this.timeList)); const timeArray = Array.from(new Set(this.timeList))
for (const times of timeArray) { for (const times of timeArray) {
if (times !== '设备CT' && times !== '产线CT') { if (times !== '设备CT' && times !== '产线CT') {
const subprop = { const subprop = {
@ -352,67 +203,44 @@ export default {
align: 'center', align: 'center',
children: [ children: [
{ prop: times + '_eq', label: '设备CT', align: 'center' }, { prop: times + '_eq', label: '设备CT', align: 'center' },
{ prop: times + '_pl', label: '产线CT', align: 'center' }, { prop: times + '_pl', label: '产线CT', align: 'center' }
], ]
}; }
arr.push(subprop); arr.push(subprop)
this.xData.push(times); this.xData.push(times)
} }
} }
this.tableProps = arr; this.tableProps = arr
console.log('表格横坐标', this.xData, this.yData); console.log('表格横坐标', this.xData, this.yData)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.lineChart.initChart(this.xData, this.yData); this.$refs.lineChart.initChart(this.xData, this.yData)
}); })
// this.total = response.data.total; // this.total = response.data.total;
// this.dataListLoading = false; // this.dataListLoading = false;
}); });
}, },
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineIds || null;
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
if (!btn.lineIds || !btn.timeArr.length) {
this.$message({
message: '请选择产线和时间',
type: 'warning',
});
}
this.getList();
break;
}
},
buttonClick(val) { buttonClick(val) {
// console.log(val) // console.log(val)
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
// this.listQuery.pageNo = 1; // this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10; // this.listQuery.pageSize = 10;
this.listQuery.lineId = val.lineIds; this.listQuery.lineId = val.lineIds
this.listQuery.startTime = val.time this.listQuery.startTime = val.time ? String(new Date(val.time[0]).getTime()) : undefined;
? String(new Date(val.time[0]).getTime()) this.listQuery.endTime = val.time ? String(new Date(val.time[1]).getTime()) : undefined;
: undefined;
this.listQuery.endTime = val.time
? String(new Date(val.time[1]).getTime())
: undefined;
if (val.time && val.lineIds) { if (val.time && val.lineIds) {
this.tableData = []; this.tableData = []
this.xData = []; this.xData = []
this.yData = []; this.yData = []
this.tableProps = []; this.tableProps = []
this.spanArr = []; this.spanArr = []
this.timeList = []; this.timeList = []
this.getData(); this.getData()
} else { } else {
this.$message({ this.$message({
message: '请选择产线和时间', message: '请选择产线和时间',
type: 'warning', type: 'warning'
}); });
} }
break; break;
@ -432,23 +260,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.custom-tabs >>> .el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.custom-tabs >>> .el-tabs__item {
padding-left: 0px !important;
padding-right: 0px !important;
line-height: 36px !important;
height: 36px;
}
.custom-tabs >>> .el-tabs__content {
height: calc(100% - 42px);
}
.custom-tabs >>> .el-tab-pane {
height: 100%;
}
</style>

View File

@ -110,7 +110,7 @@ export default {
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
@ -149,27 +149,6 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
//
deleteHandle(id, name, index) {
this.$confirm(`确定确认删除工厂名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':

View File

@ -3,7 +3,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="订单名" prop="orderId"> <el-form-item label="订单名" prop="orderId">
<el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in orderList" v-for="item in orderList"
:key="item.id" :key="item.id"
@ -39,7 +39,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="发货负责人" prop="deliveryPersonId"> <el-form-item label="发货负责人" prop="deliveryPersonId">
<el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in personList" v-for="item in personList"
:key="item.id" :key="item.id"
@ -75,8 +75,9 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { orderList } from '@/api/base/orderManage'
import { getWorkerList } from '@/api/base/worker' import { getWorkerList } from '@/api/base/worker'
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog, listOrderList } from '@/api/base/delivery' import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog } from '@/api/base/delivery'
export default { export default {
name: 'AddOrUpdate', name: 'AddOrUpdate',
data() { data() {
@ -115,7 +116,7 @@ export default {
} }
}, },
getSelectList() { getSelectList() {
listOrderList().then(res => { orderList().then(res => {
this.orderList = res.data || [] this.orderList = res.data || []
}) })
getWorkerList().then(res => { getWorkerList().then(res => {

View File

@ -2,7 +2,7 @@
<el-drawer <el-drawer
title="发货进度" title="发货进度"
:visible.sync="centervisible" :visible.sync="centervisible"
size="50%" size="80%"
class="deliveryLogDetail" class="deliveryLogDetail"
@close='closeA' @close='closeA'
:show-close='false'> :show-close='false'>
@ -47,7 +47,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="150"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="viewDetDetail" @clickBtn="viewDetDetail"
@ -65,7 +65,7 @@
<div v-if="activeName === 'barChart'"> <div v-if="activeName === 'barChart'">
<div <div
id="logDetPieBar" id="logDetPieBar"
style="width: 60%" style="width: 100%"
:style="{ height: chartHeight + 'px' }" :style="{ height: chartHeight + 'px' }"
></div> ></div>
</div> </div>
@ -75,7 +75,7 @@
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<el-drawer <el-drawer
title="发货详情" title="发货详情"
size="50%" size="60%"
:append-to-body="true" :append-to-body="true"
:visible.sync="innerDrawer" :visible.sync="innerDrawer"
@close='closeB' @close='closeB'
@ -141,8 +141,7 @@ const tableProps = [
}, },
{ {
prop: 'rate', prop: 'rate',
label: '发货比列(%)', label: '发货比列(%)'
width: 110
}, },
{ {
prop: 'principalCost', prop: 'principalCost',
@ -174,8 +173,7 @@ const tableProps2 = [
}, },
{ {
prop: 'packagingSize', prop: 'packagingSize',
label: '装箱规格(片/箱)', label: '装箱规格(片/箱)'
minWidth: 140
}, },
{ {
prop: 'packagingNum', prop: 'packagingNum',
@ -212,8 +210,8 @@ export default {
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:group-team:update') this.$auth.hasPermi('base:group-team:update')
? { ? {
type: 'detail', type: 'detDetail',
btnName: '详情' btnName: '查看发货详情'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),
@ -232,7 +230,7 @@ export default {
// //
chartDom: '', chartDom: '',
chart: '', chart: '',
chartHeight: this.tableHeight(300)*0.6 chartHeight: this.tableHeight(300)
} }
}, },
// watch: { // watch: {
@ -272,8 +270,6 @@ export default {
} }
}, },
getBar() { getBar() {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let colorList = []
if ( if (
this.chart !== null && this.chart !== null &&
this.chart !== '' && this.chart !== '' &&
@ -284,90 +280,64 @@ export default {
this.chartDom = document.getElementById('logDetPieBar') this.chartDom = document.getElementById('logDetPieBar')
this.chart = echarts.init(this.chartDom) this.chart = echarts.init(this.chartDom)
let seriesData = [] let seriesData = []
if (this.tableData.length > 0) { let sumData = 0
for (let i = 0; i < this.tableData.length; i++) { this.tableData && this.tableData.map(item =>{
let obj = {} let obj = {}
obj.value = this.tableData[i].num obj.value = item.rate
obj.name = this.tableData[i].name obj.name = item.name
seriesData.push(obj) seriesData.push(obj)
if (i < 5) { sumData+=item.rate
colorList.push(color[i]) })
} else { if (sumData < 100) {
colorList.push(color[i%5])
}
}
}
if (this.orderMsg.num < this.orderMsg.orderNum) {
let obj = {} let obj = {}
obj.value = this.orderMsg.orderNum - this.orderMsg.num obj.value = 100 - sumData
obj.name = "未发货" obj.name = "未发货"
seriesData.push(obj) seriesData.push(obj)
colorList.push('#F5F5F5')
}else {
let obj = {}
obj.value = 0
obj.name = "未发货"
seriesData.push(obj)
colorList.push('#F5F5F5')
} }
var option = { var option = {
color: colorList, color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'],
tooltip: {
trigger: 'item',
formatter: function(params) {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
return `<span>
<span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
</span>`
}
},
legend: { legend: {
bottom: '5%', type: 'scroll',
left: 'center', orient: 'vertical',
itemWidth: 8, right: '10%',
itemHeight: 8 top: 20,
bottom: 20,
icon: 'rect',
itemHeight: 8,
itemWidth: 8
}, },
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: ['40%', '55%'], radius: ['60%', '80%'],
emphasis: { avoidLabelOverlap: false,
scale: false
},
label: { label: {
alignTo: 'edge', show: false,
formatter: '{name|{b}}\n{value|{c}}', position: 'center'
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
name: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
}, },
value: { emphasis: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
}
}
},
data: seriesData
},
{
type: 'pie',
radius: ['40%', '40%'],
label: { label: {
show: true, show: true,
position: 'center', fontSize: 40,
color: '#000', fontWeight: 'bold'
formatter: [
'{a|'+this.orderMsg.orderNum+'}',
'{b|总数}'
].join('\n\n'),
rich: {
a: {
fontSize: 26 +'px'
}, },
b: { scale: true ,
fontSize: 16 +'px' scaleSize: 20 ,
}
}
}, },
emphasis: { labelLine: {
scale: false show: false
}, },
data: [100] data: seriesData
} }
] ]
}; };
@ -407,13 +377,11 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.box1 { .box1 {
height: 76px; height: 56px;
border-bottom: 1px solid #E9E9E9;
margin: 0px 8px 20px 30px;
.box_col { .box_col {
display: inline-block; display: inline-block;
width: 20%; width: 20%;
padding: 8px 8px 8px 8px; padding: 8px 8px 8px 40px;
.blodTip { .blodTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -430,7 +398,7 @@ export default {
} }
} }
.box2 { .box2 {
padding:0px 32px 30px 30px; padding:32px 32px 30px 30px;
height: calc(100vh - 150px); height: calc(100vh - 150px);
} }
.boxTitle { .boxTitle {

View File

@ -1,7 +1,7 @@
<template> <template>
<el-form ref="form" :rules="rules" label-width="100px" :model="form"> <el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="关联表名" prop="plcId"> <el-form-item label="关联表名" prop="plcId">
<el-select v-model="form.plcId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.plcId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in plcList" v-for="item in plcList"
:key="item.id" :key="item.id"

View File

@ -3,7 +3,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="typeId"> <el-form-item label="能源类型" prop="typeId">
<el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in energyListType" v-for="item in energyListType"
:key="item.id" :key="item.id"

View File

@ -63,7 +63,7 @@ const tableProps = [
} }
] ]
export default { export default {
name: "EnergyQuantityRealtime", name: "EnergyPlc",
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -125,34 +125,10 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
}) })
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
this.getList(); this.getList();
this.getTypeList() this.getTypeList()
}, },
watch: {
$route: 'initData'
},
methods: { methods: {
initData(to) {
if (to.name === 'EnergyQuantityRealtime') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
this.getList()
}
},
buttonClick(val) { buttonClick(val) {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.energyTypeId = val.energyTypeId this.queryParams.energyTypeId = val.energyTypeId

View File

@ -15,7 +15,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="energyTypeId"> <el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable @change="toggleType"> <el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" @change="toggleType">
<el-option <el-option
v-for="item in this.energyTypeList" v-for="item in this.energyTypeList"
:key="item.id" :key="item.id"

View File

@ -80,7 +80,8 @@ export default {
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 350, width: 350,
clearable: false clearable: false,
required:true
}, },
{ {
type: 'button', type: 'button',
@ -121,11 +122,35 @@ export default {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180) this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
}) })
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&')
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
this.getList() this.getList()
this.getTypeList() this.getTypeList()
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180) this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
}, },
watch: {
$route: 'initData'
},
methods: { methods: {
initData(to) {
if (to.name === 'EnergyReportSearch') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&')
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
this.getList()
}
},
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.formConfig[1].selectOptions = res.data || [] this.formConfig[1].selectOptions = res.data || []

View File

@ -27,7 +27,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="energyTypeId"> <el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
v-for="item in energyListType" v-for="item in energyListType"
:key="item.id" :key="item.id"

View File

@ -8,11 +8,11 @@
<template> <template>
<div class="app-container allow-overflow"> <div class="app-container allow-overflow">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <small-title <small-title
style="margin: 16px 0; padding-left: 8px" style="margin: 16px 0; padding-left: 8px"
:no-padding="true"> :no-padding="true">
设备运行状态 设备运行状态
</small-title> --> </small-title>
<div <div
class="graph" class="graph"
@ -22,8 +22,7 @@
flex-direction: column; flex-direction: column;
position: relative; position: relative;
"> ">
<!-- <div class="blue-title">各设备加工数量</div> --> <div class="blue-title">各设备加工数量</div>
<div class="blue-title">设备运行状态</div>
<div class="legend"> <div class="legend">
<div class="legend-item"> <div class="legend-item">
<span class="icon blue"></span> <span class="icon blue"></span>
@ -42,17 +41,22 @@
<span class="text">速度开动率</span> <span class="text">速度开动率</span>
</div> </div>
</div> </div>
<div v-if="list.length" class="graph-grid"> <div class="graph-grid">
<div class="bg-grid grid-line"> <div class="bg-grid grid-line">
<div class="grid-item" v-for="item in list.length" :key="item"></div> <div
class="grid-item"
v-for="item in list.length"
:key="item"></div>
</div> </div>
<div class="bg-grid grid-charts"> <div class="bg-grid grid-charts">
<pie-chart v-for="item in list" :key="item.id" :value="item" /> <pie-chart
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> --> <!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div> </div>
</div> </div>
<div class="no-data-bg" v-else></div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -202,9 +202,7 @@ export default {
]; ];
this.config.series[1].data = [ this.config.series[1].data = [
{ name: '速度开动率', value: peEfficiency }, { name: '速度开动率', value: peEfficiency },
{ name: '', value: 100 }, { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
// { name: '', value: peEfficiency },
// { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
]; ];
// //
this.textData = { this.textData = {

View File

@ -21,15 +21,18 @@ export default {
chart: null, chart: null,
}; };
}, },
watch: { // watch: {
list: { // list: {
handler(listdata) { // handler(listdata) {
this.setOption(); // if (listdata && listdata.length) {
}, // console.log('[linechart] list changed', listdata);
immediate: true, // const option = this.handleList(listdata);
deep: true, // this.setOption(option);
}, // }
}, // },
// immediate: true,
// },
// },
computed: { computed: {
option() { option() {
const opt = []; const opt = [];
@ -52,7 +55,7 @@ export default {
}, },
formatter: (params) => { formatter: (params) => {
const name = params[0].name; const name = params[0].name;
const goodRate = opt.find((item) => item[0] == name)[4] || '0'; const goodRate = opt.find((item) => item[0] == name)[4];
return ` return `
<h1 style="font-size: 18px; letter-spacing: 1px;">${ <h1 style="font-size: 18px; letter-spacing: 1px;">${
params[0].axisValue params[0].axisValue
@ -106,9 +109,6 @@ export default {
xAxis: { xAxis: {
type: 'category', type: 'category',
axisTick: { show: false }, axisTick: { show: false },
axisLabel: {
rotate: 45,
},
data: opt.map((item) => item[0]), data: opt.map((item) => item[0]),
}, },
yAxis: { yAxis: {

View File

@ -6,15 +6,15 @@
--> -->
<template> <template>
<div class="app-container" style="flex: 1; height: 1px; display: flex; flex-direction: column;"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar
:formConfigs="searchBarFormConfig" :formConfigs="searchBarFormConfig"
ref="search-bar" ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
<el-row type="flex" style="flex: 1;"> <el-row>
<el-col class="custom-tabs" style="flex: 1;"> <el-col class="custom-tabs">
<el-tabs <el-tabs
v-model="activeName" v-model="activeName"
:stretch="true" :stretch="true"
@ -32,7 +32,7 @@
<div <div
v-if="activeName == 'graph'" v-if="activeName == 'graph'"
class="graph" class="graph"
style="height: 100%; display: flex; flex-direction: column"> style="height: 40vh; display: flex; flex-direction: column">
<div class="blue-title">各设备加工数量</div> <div class="blue-title">各设备加工数量</div>
<LineChart v-if="list && list.length" :list="list" /> <LineChart v-if="list && list.length" :list="list" />
<div v-else class="no-data-bg"></div> <div v-else class="no-data-bg"></div>
@ -63,13 +63,13 @@ export default {
activeName: 'table', // defaults to 'table' activeName: 'table', // defaults to 'table'
searchBarFormConfig: [ searchBarFormConfig: [
// //
// { {
// __index: 'product', __index: 'product',
// type: 'select', type: 'select',
// label: '', label: '产品',
// placeholder: '', placeholder: '请选择产品',
// param: 'productId', param: 'productId',
// }, },
// 线 // 线
{ {
__index: 'line', __index: 'line',
@ -156,17 +156,17 @@ export default {
{ {
// width: 160, // width: 160,
prop: 'inQuantity', prop: 'inQuantity',
label: '加工数量', label: '进片数量',
}, },
{ {
// width: 160, // width: 160,
prop: 'outQuantity', prop: 'outQuantity',
label: '合格数量', label: '出片数量',
}, },
{ {
// width: 160, // width: 160,
prop: 'nokQuantity', prop: 'nokQuantity',
label: '不合格数', label: '破损/不合格数',
}, },
{ {
// width: 160, // width: 160,
@ -280,7 +280,7 @@ export default {
async fillProductOptions() { async fillProductOptions() {
const { data } = await this.$axios({ const { data } = await this.$axios({
url: '/base/core-product-material/listAll', url: '/base/core-product/listAll',
method: 'get', method: 'get',
}); });
const cfg = this.searchBarFormConfig.find( const cfg = this.searchBarFormConfig.find(
@ -377,9 +377,6 @@ export default {
} }
:deep(.custom-tabs) { :deep(.custom-tabs) {
.el-tabs {
height: 100%;
}
.el-tabs__header { .el-tabs__header {
margin-bottom: 8px; margin-bottom: 8px;
display: inline-block; display: inline-block;
@ -392,14 +389,6 @@ export default {
line-height: 36px !important; line-height: 36px !important;
height: 36px; height: 36px;
} }
.el-tabs__content {
height: calc(100% - 48px);
}
#pane-graph {
height: 100%;
}
} }
.blue-title { .blue-title {

View File

@ -1,303 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-11 20:33:12
* @Description:
-->
<template>
<div class="alarm-handle">
<el-skeleton v-if="loading" />
<div v-else>
<DialogForm
ref="orderForm"
key="orderForm"
v-model="orderForm"
:disabled="readOnly"
:has-files="false"
label-position="top"
:rows="orderFormRows" />
<small-title style="margin: 16px 0" :no-padding="true" size="sm">
处理方式
</small-title>
<DialogForm
key="handleMethodForm"
ref="handleMethodForm"
v-model="handleMethodForm"
:disabled="readOnly"
:has-files="true"
label-position="top"
:rows="handleMethodFormRows" />
</div>
</div>
</template>
<script>
import SmallTitle from './SmallTitle';
import { getworkerAll } from '@/api/base/materialUseLog';
import Editor from '@/components/Editor';
import DialogForm from '@/components/DialogForm';
export default {
name: 'AlarmHandle',
props: ['readOnly', 'logId'],
components: { SmallTitle, DialogForm, Editor },
data() {
return {
loading: false,
orderForm: {
id: null,
equipment: null,
createTime: null,
alarmContent: null,
alarmValue: null,
// , alarmValue
alarmCode: null,
equipmentCode: null
},
orderFormRows: [
[
{
input: true,
label: '设备编码',
prop: 'equipmentCode',
},
{
datetime: true,
label: '报警时间',
prop: 'createTime',
},
{
input: true,
label: '报警编号',
prop: 'alarmCode',
},
{
input: true,
label: '报警内容',
prop: 'alarmContent',
},
],
],
handleMethodFormRows: [
[
{
select: true,
label: '处理人',
prop: 'hander',
url: '/base/core-worker/listAll',
bind: {
multiple: true,
},
rules: [
{ required: true, message: '类型名称不能为空', trigger: 'blur' },
],
},
{
upload: true,
label: '上传资料',
prop: 'files',
},
],
[
{
key: 'handerMode',
subcomponent: Editor,
label: '处理方式',
prop: 'handerMode',
bind: {
'min-height': 200,
},
},
],
],
handleMethodForm: {
id: null,
logId: null,
hander: null,
handerMode: null,
remark: null,
files: [
// {
// fileName: '',
// fileType: '',
// fileUrl: ''
// }
],
},
workersList: [],
};
},
mounted() {
this.loading = true;
this.getDict()
.then(() => {
this.init();
})
.catch((err) => {
this.loading = false;
});
},
methods: {
/**
* 获取员工数据
*/
async getDict() {
const workerRes = await getworkerAll();
this.workersList = workerRes.data;
},
/**
* 初始化
*/
async init() {
await this.initTop();
await this.initDown();
this.loading = false;
},
/**
* 初始化上部表单
*/
async initTop() {
if (!this.logId) {
this.$msgError('缺少报警日志id');
this.$emit('close');
}
const url = '/base/equipment-alarm-log/get';
const { data, code } = await this.$axios({
url: url,
method: 'get',
params: {
id: this.logId,
},
});
if (code == 0) {
this.orderForm = data;
}
},
/**
* 初始化下部表单
*/
async initDown() {
if (!this.logId) {
this.$msgError('缺少报警日志id');
this.$emit('close');
}
const url = '/base/equipment-alarm-hand/page'; // page
const { data, code } = await this.$axios({
url: url,
method: 'get',
params: {
logId: this.logId,
},
});
if (code == 0) {
this.handleMethodForm = {
...data.list[0],
hander: data.list[0]?.hander?.split(',') || '',
};
}
},
/**
* 更新表单
*/
async submit() {
const result = await Promise.all([
await this.updateTop(),
await this.updateHandleMethod(),
]);
if (result[0] == true && result[1] == true) {
this.$modal.msgSuccess('更新成功');
this.$emit('refreshDataList');
} else {
this.$modal.msgError('更新失败');
}
},
/**
* 更新下部表单
*/
async updateHandleMethod() {
const url = '/base/equipment-alarm-hand';
const valid = await this.$refs.orderForm.validate();
if (!valid) {
return false;
}
const { code, data } = await this.$axios({
url: url + (this.handleMethodForm.id ? '/update' : '/create'),
method: this.handleMethodForm.id ? 'put' : 'post',
data: {
...this.handleMethodForm,
hander: this.handleMethodForm.hander?.join(',') || '',
logId: this.logId,
},
});
if (code == 0) {
return true;
}
return false;
},
/**
* 更新上部分表单
*/
async updateTop() {
const url = '/base/equipment-alarm-log';
const valid = await this.$refs.handleMethodForm.validate();
if (!valid) {
return false;
}
const { code, data } = await this.$axios({
url: url + '/update',
method: 'put',
data: this.orderForm,
});
if (code == 0) {
return true;
}
return false;
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
if (this.file) {
const temp = this.file.split(','); //
let arry = [];
temp.forEach((item) => {
arry.push({
fileType: 2,
fileUrl: item,
});
});
this.dataForm.files = arry;
}
this.urlOptions.createURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
},
};
</script>
<style scoped>
.alarm-handle {
padding: 0;
}
.alarm-handle__method >>> .el-select {
width: 100% !important;
}
</style>

View File

@ -40,7 +40,7 @@ $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px; $mgr: 8px;
@each $size, $height in $pxls { @each $size, $height in $pxls {
.#{$size}-title { .#{$size}-title {
font-size: $height; font-size: 18px;
line-height: $height; line-height: $height;
color: #000; color: #000;
font-weight: 500; font-weight: 500;
@ -53,7 +53,7 @@ $mgr: 8px;
width: 4px; width: 4px;
height: $height + 2px; height: $height + 2px;
border-radius: 1px; border-radius: 1px;
margin-right: 4px; margin-right: $mgr;
background-color: #0b58ff; background-color: #0b58ff;
} }
} }

View File

@ -0,0 +1,195 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-11 20:33:12
* @Description:
-->
<template>
<div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
系统自带
</small-title>
<el-form
:model="dataForm1"
ref="dataForm1"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备编码" prop="equipment">
<el-input
v-model="dataForm1.equipment"
disabled
placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报警时间" prop="createTime">
<el-input
v-model="dataForm1.createTime"
disabled
placeholder="请输入报警时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报警编号" prop="code">
<!-- 接口缺参数 -->
<el-input
v-model="dataForm1.code"
disabled
placeholder="请输入报警编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报警内容" prop="alarmContent">
<el-input
v-model="dataForm1.alarmContent"
disabled
placeholder="请输入报警内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
处理方式
</small-title>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
label-width="80px">
<el-form-item label="处理人" prop="hander">
<el-select
v-model="dataForm.hander"
:disabled="isdetail"
placeholder="请选择处理人"
>
<el-option
v-for="dict in workersList"
:key="dict.id"
:label="dict.name"
:value="dict.name" />
</el-select>
</el-form-item>
<el-form-item label="处理方式" prop="handerMode">
<editor v-model="dataForm.handerMode" :read-only="isdetail" :min-height="200"/>
</el-form-item>
<el-form-item label="附件" prop="file">
<!-- <el-input
v-model="dataForm.file"
type="textarea"
min-size="3"
placeholder="请输入处理方式" /> -->
<FileUpload v-model="file" :disabled="isdetail" />
</el-form-item>
</el-form>
</div>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import SmallTitle from './SmallTitle';
import { getworkerAll } from "@/api/base/materialUseLog";
import { createAlarmHand, getAlarmLog } from '@/api/equipment/base/alarm/records';
import FileUpload from "@/components/FileUpload";
import Editor from "@/components/Editor";
export default {
components: { SmallTitle, FileUpload, Editor },
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createAlarmHand,
infoURL: getAlarmLog,
},
dataForm1: {
id: undefined,
equipment: undefined,
createTime: undefined,
alarmContent: undefined,
code: undefined
},
file: '',
dataForm: {
id: undefined,
hander: undefined,
handerMode: undefined
},
isdetail: false,
workersList: [],
dataRule: {
hander: [{ required: true, message: "处理人不能为空", trigger: "change" }],
handerMode: [{ required: true, message: "处理方式不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
async getDict() {
//
const workerRes = await getworkerAll()
this.workersList = workerRes.data
},
//
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;
// }
//
if (this.file) {
const temp = this.file.split(',') //
let arry = []
temp.forEach(item => {
arry.push({
fileType: 2,
fileUrl: item
})
})
this.dataForm.files = arry
}
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
init(id, isdetail) {
this.dataForm1.id = id || "";
this.isdetail = isdetail || false
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm1"].resetFields();
this.$refs["dataForm"].resetFields();
if (this.dataForm1.id) {
this.urlOptions.infoURL(id).then(response => {
if (response.data) {
this.dataForm1 = response.data;
}
});
}
});
},
},
};
</script>

View File

@ -45,23 +45,20 @@
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="false" :has-files="false"
:rows="rows" /> --> :rows="rows" /> -->
<AddOrUpdate <add-or-update
v-if="open"
ref="addOrUpdate" ref="addOrUpdate"
:read-only="readOnly"
:log-id="chosedLogId"
@close="cancel"
@refreshDataList="successSubmit" /> @refreshDataList="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import AddOrUpdate from './AddOrUpdate.vue';
import moment from 'moment'; import moment from 'moment';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AddOrUpdate from './add-or-updata.vue'
import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = { const btn = {
name: 'tableBtn', name: 'tableBtn',
@ -71,10 +68,7 @@ const btn = {
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('emitData', { this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
action: this.injectData.name,
value: this.injectData,
});
}, },
}, },
render: function (h) { render: function (h) {
@ -86,15 +80,15 @@ const btn = {
}, },
}; };
export default { export default {
name: 'Record', name: 'Record',
components: { AddOrUpdate }, components: { AddOrUpdate },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
readOnly: false, searchBarKeys: ['equipmentName', 'recordTime'],
chosedLogId: false,
searchBarKeys: ['equipmentName', 'createTime'],
tableBtn: [ tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update') // this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? { // ? {
@ -119,16 +113,12 @@ export default {
{ prop: 'productionLine', label: '产线' }, { prop: 'productionLine', label: '产线' },
{ prop: 'workshopSection', label: '工段' }, { prop: 'workshopSection', label: '工段' },
{ prop: 'equipment', label: '设备名称' }, { prop: 'equipment', label: '设备名称' },
{ { prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
prop: 'alarmGrade', { prop: 'responsible', label: '报警时间' }, //
label: '报警级别', { prop: 'responsible1', label: '设备报警码' }, //
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
},
{ prop: 'createTime', label: '报警时间', filter: timeFilter },
{ prop: 'alarmCode', label: '设备报警码' },
{ prop: 'alarmContent', label: '报警内容' }, { prop: 'alarmContent', label: '报警内容' },
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn }, { prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, { prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO:
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -151,7 +141,7 @@ export default {
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'createTime', param: 'recordTime',
// defaultSelect: [ // defaultSelect: [
// new Date(y, m, d) // new Date(y, m, d)
// .toLocaleString() // .toLocaleString()
@ -206,10 +196,9 @@ export default {
pageSize: 10, pageSize: 10,
lineId: null, lineId: null,
equipmentId: null, equipmentId: null,
recordTime: [],
}, },
basePath: '/base/equipment-alarm-log', basePath: '/base/equipment-alarm-log',
list: [], list: []
}; };
}, },
created() { created() {
@ -217,20 +206,21 @@ export default {
}, },
methods: { methods: {
handleEmitFun(val) { handleEmitFun(val) {
console.log('你好', val)
if (val.action === '报警处理') { if (val.action === '报警处理') {
// this.chosedLogId = val.value.alarmId;
this.chosedLogId = val.value.id;
// //
this.open = true; this.open = true
this.title = '报警处理'; this.title = '报警处理'
this.readOnly = false; this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.value.id);
});
} else { } else {
// this.chosedLogId = val.value.alarmId;
this.chosedLogId = val.value.id;
// //
this.open = true; this.open = true
this.title = '查看'; this.title = '查看'
this.readOnly = true; this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.value.id, true);
});
} }
}, },
/** 查询列表 */ /** 查询列表 */
@ -244,8 +234,8 @@ export default {
}); });
}, },
successSubmit() { successSubmit() {
this.cancel(); this.cancel()
this.getList(); this.getList()
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
@ -292,7 +282,7 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs.addOrUpdate.submit(); this.$refs.addOrUpdate.dataFormSubmit()
// this.$refs['form'].validate((valid) => { // this.$refs['form'].validate((valid) => {
// if (!valid) { // if (!valid) {
// return; // return;

View File

@ -9,11 +9,10 @@
<el-drawer <el-drawer
:visible="visible" :visible="visible"
:show-close="false" :show-close="false"
:wrapper-closable="mode.includes('detail') ? true : false" :wrapper-closable="false"
:before-close="handleCancel"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
:size="size || '50%'" size="60%"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -43,8 +42,7 @@
:dataForm="form" :dataForm="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<!-- if --> <el-row style="margin-bottom: 24px">
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
class="title" class="title"
@ -64,39 +62,13 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备分组名称"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.name"
placeholder="请输入设备分组名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备分组编码"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.code"
placeholder="请输入设备分组编码"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<div <!-- v-if="!mode.includes('detail')" -->
v-if="!mode.includes('detail')" <div style="position: absolute; top: -40px; right: 0">
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加报警 添加报警
@ -112,7 +84,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn && !mode.includes('detail')" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -130,13 +102,12 @@
</section> </section>
</div> </div>
<div v-if="!mode.includes('detail')" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button <!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
type="primary" 编辑
@click="handleSave"> </el-button> -->
确定 <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</el-button>
</div> </div>
</div> </div>
@ -192,7 +163,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm, BaseInfoForm }, components: { SmallTitle, DialogForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId id props: ['sections', 'defaultMode', 'dataId'], // dataId id
data() { data() {
return { return {
mode: '', mode: '',
@ -220,9 +191,7 @@ export default {
label: '报警编码', // label: '报警编码', //
prop: 'code', prop: 'code',
url: '/base/equipment-group-alarm/getCode', url: '/base/equipment-group-alarm/getCode',
rules: [ rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }],
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
@ -236,17 +205,13 @@ export default {
input: true, input: true,
label: '参数列名', // label: '参数列名', //
prop: 'plcParamName', prop: 'plcParamName',
rules: [ rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '报警内容', label: '报警内容',
prop: 'alarmContent', prop: 'alarmContent',
rules: [ rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -258,9 +223,7 @@ export default {
{ label: '布尔型', value: 2 }, { label: '布尔型', value: 2 },
{ label: '字符型', value: 1 }, { label: '字符型', value: 1 },
], ],
rules: [ rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
@ -359,7 +322,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = !this.mode.includes('detail'); const isEdit = this.mode == 'edit';
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -383,7 +346,7 @@ export default {
// //
handleAddAttr() { handleAddAttr() {
if (!this.dataId) return this.$message.warning('请先创建设备分组信息'); if (!this.dataId) return this.$message.error('请先创建设备分组信息');
this.attrForm = { this.attrForm = {
id: null, id: null,
equipmentGroupId: this.dataId, equipmentGroupId: this.dataId,
@ -440,11 +403,12 @@ export default {
}, },
// //
submitAttrForm() { async submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => { this.$refs['attrForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
});
const isEdit = this.attrForm.id != null; const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true; this.attrFormSubmitting = true;
const res = await this.$axios({ const res = await this.$axios({
@ -465,7 +429,6 @@ export default {
}); });
} }
this.attrFormSubmitting = false; this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -45,7 +45,6 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:data-id="alarmForm.id" :data-id="alarmForm.id"
:sections="[ :sections="[
@ -404,25 +403,12 @@ export default {
}); });
}); });
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
// //
handleDetail(row, mode = 'detail') { handleDetail(row) {
// debugger; // debugger;
const { id, code, name, createTime } = row; const { id, code, name, createTime } = row;
// //
this.editMode = mode; this.editMode = 'detail';
this.alarmForm.id = id; this.alarmForm.id = id;
this.alarmForm.equipmentGroupCode = code; this.alarmForm.equipmentGroupCode = code;
this.alarmForm.equipmentGroupName = name; this.alarmForm.equipmentGroupName = name;

View File

@ -9,11 +9,10 @@
<el-drawer <el-drawer
:visible="visible" :visible="visible"
:show-close="false" :show-close="false"
:wrapper-closable="mode.includes('detail') ? true : false" :wrapper-closable="false"
:before-close="handleCancel"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
:size="size || '50%'" size="60%"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -43,7 +42,6 @@
:dataForm="form" :dataForm="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
<el-row style="margin-bottom: 24px"> <el-row style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
@ -64,38 +62,13 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备分组名称"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.name"
placeholder="请输入设备分组名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备分组编码"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.code"
placeholder="请输入设备分组编码"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row> -->
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<div <!-- v-if="!mode.includes('detail')" -->
v-if="!mode.includes('detail')" <div style="position: absolute; top: -40px; right: 0">
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
@ -111,7 +84,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn && !mode.includes('detail')" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -129,13 +102,12 @@
</section> </section>
</div> </div>
<div v-if="!mode.includes('detail')" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button <!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
type="primary" 编辑
@click="handleCancel"> </el-button> -->
确定 <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</el-button>
</div> </div>
</div> </div>
@ -191,7 +163,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm, BaseInfoForm }, components: { SmallTitle, DialogForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId id props: ['sections', 'defaultMode', 'dataId'], // dataId id
data() { data() {
return { return {
mode: '', mode: '',
@ -219,9 +191,7 @@ export default {
label: '报警编码', // label: '报警编码', //
prop: 'code', prop: 'code',
url: '/base/equipment-group-alarm/getCode', url: '/base/equipment-group-alarm/getCode',
rules: [ rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }],
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
@ -231,9 +201,7 @@ export default {
{ label: '布尔型', value: 2 }, { label: '布尔型', value: 2 },
{ label: '字符型', value: 1 }, { label: '字符型', value: 1 },
], ],
rules: [ rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -254,17 +222,13 @@ export default {
input: true, input: true,
label: '参数列名', // label: '参数列名', //
prop: 'plcParamName', prop: 'plcParamName',
rules: [ rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '报警内容', label: '报警内容',
prop: 'alarmContent', prop: 'alarmContent',
rules: [ rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
],
}, },
], ],
], ],
@ -358,7 +322,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = !this.mode.includes('detail'); const isEdit = this.mode == 'edit';
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -382,7 +346,7 @@ export default {
// //
handleAddAttr() { handleAddAttr() {
if (!this.dataId) return this.$message.warning('请先创建设备分组信息'); if (!this.dataId) return this.$message.error('请先创建设备分组信息');
this.attrForm = { this.attrForm = {
id: null, id: null,
equipmentGroupId: this.dataId, equipmentGroupId: this.dataId,
@ -439,11 +403,13 @@ export default {
}, },
// //
submitAttrForm() { async submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => { this.$refs['attrForm'].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
});
console.log('this.attrform', this.attrForm);
const isEdit = this.attrForm.id != null; const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true; this.attrFormSubmitting = true;
const res = await this.$axios({ const res = await this.$axios({
@ -464,7 +430,6 @@ export default {
}); });
} }
this.attrFormSubmitting = false; this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -34,7 +34,7 @@
<base-dialog <base-dialog
:dialogTitle="title" :dialogTitle="title"
:dialogVisible="open" :dialogVisible="open"
width="30%" width="700px"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
@ -45,7 +45,6 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:data-id="alarmForm.id" :data-id="alarmForm.id"
:sections="[ :sections="[
@ -225,9 +224,7 @@ export default {
bind: { bind: {
filterable: true, filterable: true,
}, },
rules: [ rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -241,9 +238,7 @@ export default {
bind: { bind: {
filterable: true, filterable: true,
}, },
rules: [ rules: [{ required: true, message: '报警分组不能为空', trigger: 'blur' }],
{ required: true, message: '报警分组不能为空', trigger: 'blur' },
],
}, },
], ],
], ],
@ -274,13 +269,7 @@ export default {
input: true, input: true,
label: '设备分组名称', label: '设备分组名称',
prop: 'name', prop: 'name',
rules: [ rules: [{ required: true, message: '设备分组名称不能为空', trigger: 'blur' }],
{
required: true,
message: '设备分组名称不能为空',
trigger: 'blur',
},
],
// bind: { // bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode... // disabled: this.editMode == 'detail', // some condition, like detail mode...
// } // }
@ -298,23 +287,26 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ prop: 'code', label: '报警编码' }, { width: 240, prop: 'code', label: '报警编码' },
{ {
width: 100,
prop: 'type', prop: 'type',
label: '报警类型', label: '报警类型',
filter: (val) => filter: (val) =>
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-', val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
}, },
{ {
width: 90,
prop: 'grade', prop: 'grade',
label: '报警级别', label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, },
{ prop: 'alarmCode', label: '设备报警编码' }, { width: 180, prop: 'alarmCode', label: '设备报警编码' },
{ prop: 'plcParamName', label: '参数列名' }, { width: 128, prop: 'plcParamName', label: '参数列名' },
{ prop: 'alarmContent', label: '报警内容' }, { width: 128, prop: 'alarmContent', label: '报警内容' },
], ],
}; };
}, },
@ -369,19 +361,6 @@ export default {
}; };
this.resetForm('form'); this.resetForm('form');
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
@ -432,11 +411,11 @@ export default {
}); });
}, },
// //
handleDetail(row, mode = 'detail') { handleDetail(row) {
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
row; row;
// //
this.editMode = mode; this.editMode = 'detail';
this.alarmForm.id = groupId; this.alarmForm.id = groupId;
this.alarmForm.equipmentGroupCode = groupCode; this.alarmForm.equipmentGroupCode = groupCode;
this.alarmForm.equipmentGroupName = groupName; this.alarmForm.equipmentGroupName = groupName;

View File

@ -52,7 +52,6 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:info-data="alarmForm" :info-data="alarmForm"
:sections="[ :sections="[
@ -60,10 +59,6 @@
name: '基本信息', name: '基本信息',
key: 'base', key: 'base',
rows: drawerBaseInfoRows, rows: drawerBaseInfoRows,
url: '/base/equipment-plc-connect/get',
urlUpdate: '/base/equipment-plc-connect/update',
urlCreate: '/base/equipment-plc-connect/create',
queryParams: { id: alarmForm.id },
}, },
{ {
name: '采集参数', name: '采集参数',
@ -194,7 +189,7 @@ export default {
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
selectOptions: [], selectOptions: [],
filterable: true, filterable: true
}, },
{ {
type: 'select', type: 'select',
@ -202,7 +197,7 @@ export default {
placeholder: '请选择关联表编码', placeholder: '请选择关联表编码',
param: 'plcId', param: 'plcId',
selectOptions: [], selectOptions: [],
filterable: true, filterable: true
}, },
{ {
type: 'button', type: 'button',
@ -304,7 +299,7 @@ export default {
filter: publicFormatter('unit_dict'), filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'equipmentParamType', prop: 'equipment_param_type',
label: '设备参数类型', label: '设备参数类型',
filter: (val) => filter: (val) =>
val != null val != null
@ -312,12 +307,12 @@ export default {
: '-', : '-',
}, },
{ {
prop: 'productionParamType', prop: 'production_param_type',
label: '生产参数类型', label: '生产参数类型',
filter: (val) => filter: (val) =>
val != null val != null
? // ? ['', '', '', '', '', ''][val] // ? ['', '', '', '', '', ''][val]
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val] ? ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
: '-', : '-',
}, },
{ {
@ -428,19 +423,6 @@ export default {
}; };
this.resetForm('form'); this.resetForm('form');
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
@ -492,7 +474,7 @@ export default {
}, },
// //
handleDetail(row, mode = 'detail') { handleDetail(row) {
// debugger; // debugger;
const { const {
id, id,
@ -508,7 +490,7 @@ export default {
workshopSection, workshopSection,
} = row; } = row;
// //
this.editMode = mode; this.editMode = 'detail';
this.alarmForm.id = id; this.alarmForm.id = id;
this.alarmForm.plcTableName = plcTableName; // this.alarmForm.plcTableName = plcTableName; //
this.alarmForm.equipmentName = equipmentName; this.alarmForm.equipmentName = equipmentName;

View File

@ -25,7 +25,6 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="90"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
@ -42,7 +41,7 @@
<base-dialog <base-dialog
:dialogTitle="title" :dialogTitle="title"
:dialogVisible="open" :dialogVisible="open"
width="45%" width="700px"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
@ -128,7 +127,7 @@ export default {
// width: 180, // width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// }, // },
{ prop: 'code', label: '编码', showOverflowtooltip: true }, { prop: 'code', label: '编码' },
{ prop: 'plcTableName', label: '关联表名' }, { prop: 'plcTableName', label: '关联表名' },
{ prop: 'name', label: '标识名称' }, { prop: 'name', label: '标识名称' },
{ prop: 'enName', label: '英文名称' }, { prop: 'enName', label: '英文名称' },
@ -137,7 +136,7 @@ export default {
label: '是否采集', label: '是否采集',
subcomponent: switchBtn, subcomponent: switchBtn,
}, },
{ prop: 'description', label: '描述', showOverflowtooltip: true }, { prop: 'description', label: '描述' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -214,28 +213,16 @@ export default {
}, },
], ],
[ [
// {
// switch: true,
// label: '', // 0 , 1
// prop: 'collection',
// bind: {
// 'active-value': 1,
// 'inactive-value': 0,
// value: 1,
// },
// },
{ {
select: true, switch: true,
options: [ label: '是否采集', // 0 , 1
{ label: '否', value: 0 },
{ label: '是', value: 1 }
],
label: '是否采集',
prop: 'collection', prop: 'collection',
bind: { bind: {
clearable: true, filterable: true 'active-value': 1,
} 'inactive-value': 0,
} value: 1,
},
},
], ],
[ [
{ {

View File

@ -9,11 +9,10 @@
<el-drawer <el-drawer
:visible="visible" :visible="visible"
:show-close="false" :show-close="false"
:wrapper-closable="mode.includes('detail') ? true : false" :wrapper-closable="false"
:before-close="handleCancel"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
:size="size || '50%'" size="60%"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -43,8 +42,7 @@
v-model="form" v-model="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<!-- if --> <el-row style="margin-bottom: 24px">
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
class="title" class="title"
@ -62,59 +60,17 @@
关联表名 关联表名
</div> </div>
<div class="value" style="font-size: 14px"> <div class="value" style="font-size: 14px">
{{ form.plcName }} {{ form.plcTableName }}
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备名"
style="font-size: 16px; margin: 8px 0">
<el-select
v-model="form.equipmentId"
filterable
clearable
placeholder="请选择设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:label="eq.name"
:value="eq.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备关联表名"
style="font-size: 16px; margin: 8px 0">
<el-select
v-model="form.plcId"
filterable
clearable
placeholder="请选择关联表">
<el-option
v-for="plc in plcList"
:key="plc.id"
:label="plc.name"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<div <!-- v-if="!mode.includes('detail')" -->
v-if="!mode.includes('detail')" <div style="position: absolute; top: -40px; right: 0">
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
@ -130,7 +86,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn && !mode.includes('detail')" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -148,13 +104,12 @@
</section> </section>
</div> </div>
<div v-if="!mode.includes('detail')" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button <!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
type="primary" 编辑
@click="handleSave"> </el-button> -->
确定 <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</el-button>
</div> </div>
</div> </div>
@ -209,7 +164,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'infoData', 'size'], props: ['sections', 'defaultMode', 'infoData'],
data() { data() {
return { return {
mode: '', mode: '',
@ -218,8 +173,6 @@ export default {
total: 0, total: 0,
form: {}, form: {},
list: [], list: [],
eqList: [],
plcList: [],
attrTitle: '', attrTitle: '',
attrForm: { attrForm: {
id: null, id: null,
@ -275,7 +228,7 @@ export default {
{ {
select: true, select: true,
label: '设备参数类型', label: '设备参数类型',
prop: 'equipmentParamType', prop: 'equipment_param_type',
options: [ options: [
{ label: '一般参数', value: 1 }, { label: '一般参数', value: 1 },
{ label: '工艺参数', value: 2 }, { label: '工艺参数', value: 2 },
@ -292,7 +245,7 @@ export default {
{ {
select: true, select: true,
label: '生产参数类型', label: '生产参数类型',
prop: 'productionParamType', prop: 'production_param_type',
options: [ options: [
// { label: '', value: 1 }, // { label: '', value: 1 },
// { label: '', value: 2 }, // { label: '', value: 2 },
@ -398,17 +351,6 @@ export default {
mounted() { mounted() {
this.shouldRefreshPageView = false; this.shouldRefreshPageView = false;
this.mode = this.defaultMode || 'detail'; this.mode = this.defaultMode || 'detail';
if (this.mode != 'detail') {
this.$axios('/base/core-equipment/listAll').then(({ code, data }) => {
this.eqList = data;
});
this.$axios({
url: '/base/equipment-plc/page',
}).then(({ code, data }) => {
this.plcList = data.list;
});
}
for (const section of this.sections) { for (const section of this.sections) {
// //
if ('url' in section) { if ('url' in section) {
@ -470,7 +412,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = !this.mode.includes('detail'); const isEdit = this.mode == 'edit';
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -508,8 +450,6 @@ export default {
defaultValue: '', defaultValue: '',
description: '', description: '',
remark: '', remark: '',
equipmentParamType: '',
productionParamType: '',
alarmContent: '', alarmContent: '',
}; };
this.attrTitle = '添加参数绑定信息'; this.attrTitle = '添加参数绑定信息';

View File

@ -7,15 +7,13 @@
<template> <template>
<el-drawer <el-drawer
ref="drawer"
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="isdetail" :wrapper-closable="false"
class="drawer" class="drawer"
size="60%" size="60%">
@closed="$emit('destroy')">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }} {{ isdetail ? '查看详情' : '新增' }}
</small-title> </small-title>
<el-form <el-form
ref="dataForm" ref="dataForm"
@ -79,26 +77,13 @@
<el-form-item label="巡检时间" prop="actualTime"> <el-form-item label="巡检时间" prop="actualTime">
<el-date-picker <el-date-picker
v-model="dataForm.actualTime" v-model="dataForm.actualTime"
type="datetime" type="date"
:disabled="isdetail" :disabled="isdetail"
format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd'
value-format="timestamp" value-format="timestamp"
placeholder="选择巡检时间" /> placeholder="选择巡检时间" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="数据来源" prop="origin">
<el-select
v-model="dataForm.origin"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择数据来源">
<el-option key="1" label="手动" :value="1" />
<el-option key="2" label="自动" :value="2" />
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-form-item label="巡检内容"> <el-form-item label="巡检内容">
<base-table <base-table
@ -108,17 +93,20 @@
:table-data="list" /> :table-data="list" />
</el-form-item> </el-form-item>
<el-form-item label="巡检详情" prop="description"> <el-form-item label="巡检详情" prop="description">
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/> <editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" /> <FileUpload v-model="file" :disabled="isdetail" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div v-if="!isdetail" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">取消</el-button> <el-button type="primary" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -185,7 +173,6 @@ export default {
actualTime: undefined, actualTime: undefined,
responsible: undefined, responsible: undefined,
description: undefined, description: undefined,
origin: undefined,
files: [] files: []
}, },
list: [], list: [],
@ -197,7 +184,6 @@ export default {
total: 0, total: 0,
}, },
file: '', file: '',
fileName: '',
dataRule: { dataRule: {
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }], responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }] actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
@ -208,9 +194,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
setFileName(val) {
this.fileName = val
},
async getDict() { async getDict() {
const res = await getEquipmentAll() const res = await getEquipmentAll()
this.eqList = res.data this.eqList = res.data
@ -239,9 +222,16 @@ export default {
return this.$refs.dataForm.resetFields(args); return this.$refs.dataForm.resetFields(args);
}, },
initData() { initData() {
this.dataForm = {
id: undefined,
configId: undefined,
equipmentId: undefined,
actualTime: undefined,
responsible: undefined,
description: undefined,
files: []
}
this.list = [] this.list = []
this.file = ''
this.fileName = ''
}, },
init(id, isdetail) { init(id, isdetail) {
this.initData(); this.initData();
@ -249,10 +239,6 @@ export default {
this.dataForm.id = id || undefined; this.dataForm.id = id || undefined;
this.visible = true; this.visible = true;
// const scrollContainer = this.$refs.dataForm;
// const scrollPosition = scrollContainer.scrollTop;
// console.log('12', scrollPosition);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
@ -261,12 +247,6 @@ export default {
getEqCheckLog(this.dataForm.id).then(response => { getEqCheckLog(this.dataForm.id).then(response => {
this.formLoading = false this.formLoading = false
this.dataForm = response.data; this.dataForm = response.data;
if (this.dataForm.files.length > 0) {
this.file = this.dataForm.files[0].fileUrl
this.fileName = this.dataForm.files[0].fileName
}
this.setConfig()
this.setInspectionContet()
}); });
} else { } else {
// if (this.urlOptions.isGetCode) { // if (this.urlOptions.isGetCode) {
@ -303,9 +283,8 @@ export default {
if (this.file) { if (this.file) {
const temp = this.file.split(',') // const temp = this.file.split(',') //
let arry = [] let arry = []
temp.forEach((item, index) => { temp.forEach(item => {
arry.push({ arry.push({
fileName: this.fileName,
fileType: 2, fileType: 2,
fileUrl: item fileUrl: item
}) })

View File

@ -0,0 +1,148 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="备品备件" prop="sparePartId">
<el-select
v-model="dataForm.sparePartId"
filterable
style="width: 100%"
placeholder="请选择备品备件">
<el-option
v-for="dict in partList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createConfigDet,
getSparePartList
} from '@/api/equipment/base/spare-parts/config';
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
sparePartId: ''
},
partList: [],
dataRule: {
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getSparePartList()
this.partList = res.data
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// getCoreProductAttr({
// id: this.dataForm.id
// }).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
// });
// }
// });
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
// if (this.dataForm.id) {
// updateCoreProductAttr({
// ...this.dataForm,
// productId: this.productId,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.visible = false;
// this.$emit('refreshDataList');
// });
// return;
// }
//
createConfigDet({
...this.dataForm,
configId: this.configId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -49,8 +49,7 @@
<addRecord <addRecord
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getList" @refreshDataList="getList" />
@destroy="addOrUpdateVisible = false" />
</div> </div>
</template> </template>
@ -70,7 +69,7 @@ export default {
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
searchBarKeys: ['equipmentId', 'actualTime'], searchBarKeys: ['equipmentId', 'createTime'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:check-record:detail') this.$auth.hasPermi('equipment:check-record:detail')
? { ? {
@ -94,7 +93,7 @@ export default {
tableProps: [ tableProps: [
{ prop: 'configName', label: '配置名称' }, { prop: 'configName', label: '配置名称' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', '自动'][val] }, // { prop: 'lineName', label: '' },
// { prop: 'sectionName', label: '' }, // { prop: 'sectionName', label: '' },
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime }, { prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
// { prop: 'maintenanceDetail', label: '' }, // { prop: 'maintenanceDetail', label: '' },
@ -114,12 +113,12 @@ export default {
label: '时间段', label: '时间段',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'actualTime', param: 'startTime',
// width: 350, // width: 350,
}, },
{ {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 10:48:55 * @LastEditTime: 2023-11-09 11:09:26
* @Description: * @Description:
--> -->
<template> <template>
@ -52,8 +52,9 @@
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;" @click="addNew()">
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button> <svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span> </span>
</template> </template>
</div> </div>
@ -176,7 +177,11 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
this.$confirm( this.$confirm(
`是否确认删除巡检项目名称为"${raw.data.program}"的数据项?`, `确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -285,7 +290,7 @@ export default {
.drawer >>> .visual-part { .drawer >>> .visual-part {
flex: 1 auto; flex: 1 auto;
max-height: 16vh; max-height: 76vh;
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */ padding-right: 10px; /* 调整滚动条样式 */
@ -303,7 +308,7 @@ export default {
} }
.action_btn { .action_btn {
float: right; float: right;
margin: -40px 15px; margin: 5px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {

View File

@ -1,105 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-25 16:23:13
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="配置名称" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入配置名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置编码" prop="code">
<el-input
v-model="dataForm.code"
placeholder="请输入配置编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
filterable
style="width: 100%"
placeholder="请选择设备名称"
@change="setCode">
<el-option
v-for="dict in eqList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings";
import { getEquipmentAll } from '@/api/base/equipment'
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCheckConfig,
updateURL: updateCheckConfig,
infoURL: getEqCheck,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
equipmentId: undefined,
equipmentCode: undefined
},
eqList: [],
dataRule: {
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const res = await getEquipmentAll()
this.eqList = res.data
},
setCode() {
const chooseM = this.eqList.filter(item => {
return item.id === this.dataForm.equipmentId
})
this.dataForm.equipmentCode = chooseM[0].code
}
},
};
</script>

View File

@ -36,10 +36,14 @@
:dialogVisible="open" :dialogVisible="open"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="handleConfirm"> @confirm="submitForm">
<add <DialogForm
ref="add" v-if="open"
@refreshDataList="successSubmit" /> ref="form"
v-model="form"
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" />
</base-dialog> </base-dialog>
<!-- 添加巡检查看详情 --> <!-- 添加巡检查看详情 -->
<addOrUpdata <addOrUpdata
@ -52,13 +56,12 @@
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue'; import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'
// import { publicFormatter } from '@/utils/dict'; // import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentCheckSetting', name: 'EquipmentCheckSetting',
components: { addOrUpdata, add }, components: { addOrUpdata },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
@ -98,7 +101,7 @@ export default {
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' }, { prop: 'equipmentName', label: '设备' },
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码' },
// { prop: 'responsible', label: '' }, { prop: 'responsible', label: '负责人' },
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: { prop: 'checkNumber', label: '巡检条数' }, // TODO:
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -113,7 +116,6 @@ export default {
label: '设备名称', label: '设备名称',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@ -168,12 +170,8 @@ export default {
label: '设备名称', label: '设备名称',
prop: 'equipmentId', prop: 'equipmentId',
url: '/base/core-equipment/listAll', url: '/base/core-equipment/listAll',
bind: {
filterable: true,
clearable: true,
},
rules: [ rules: [
{ required: true, message: '设备名称不能为空', trigger: 'change' }, { required: true, message: '设备名称不能为空', trigger: 'blur' },
], ],
}, },
{ {
@ -203,13 +201,6 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleConfirm() {
this.$refs.add.dataFormSubmit()
},
successSubmit() {
this.cancel()
this.getList()
},
initSearchBar() { initSearchBar() {
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => { this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set( this.$set(
@ -234,10 +225,9 @@ export default {
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.$refs.add.formClear()
this.open = false; this.open = false;
this.title = '' this.mode = null;
// this.reset(); this.reset();
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
@ -262,26 +252,18 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
// this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加巡检设置'; this.title = '添加巡检设置';
this.$nextTick(() => {
this.$refs.add.init();
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
// this.reset(); this.reset();
// const id = row.id; const id = row.id;
// this.info({ id }).then((response) => { this.info({ id }).then((response) => {
// this.form = response.data; this.form = response.data;
// this.open = true;
// this.title = '';
// });
this.open = true; this.open = true;
this.title = '修改巡检设置'; this.title = '修改巡检设置';
this.$nextTick(() => {
this.$refs.add.init(row.id);
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -311,7 +293,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?') .confirm('是否确认删除该巡检记录?')
.then(() => { .then(() => {
return this.del({ id }); return this.del({ id });
}) })

View File

@ -49,7 +49,7 @@
<script> <script>
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
// import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record' import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
@ -67,7 +67,7 @@ const remainBox = {
color() { color() {
if (this.value) { if (this.value) {
const v = +this.value; const v = +this.value;
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F'; return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
} }
return 'unset'; return 'unset';
}, },
@ -78,10 +78,9 @@ const remainBox = {
style={`background: ${ style={`background: ${
this.color this.color
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${ }; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
// this.color == 'red' ? '#fff' : 'unset' this.color == 'red' ? '#fff' : 'unset'
'#fff'
}`}> }`}>
{ this.injectData[this.injectData.prop]?.toFixed(0) || '' } {this.injectData[this.injectData.prop] || ''}
</div> </div>
); );
}, },
@ -122,35 +121,30 @@ export default {
// width: 180, // width: 180,
// filter: parseTime(createTime), // filter: parseTime(createTime),
// }, // },
{ prop: 'name', label: '保养计划', minWidth: 100, showOverflowtooltip: true }, { prop: 'name', label: '保养计划' },
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true }, { prop: 'lineName', label: '产线名' },
{ prop: 'sectionName', label: '工段名', minWidth: 100, showOverflowtooltip: true }, { prop: 'sectionName', label: '工段名' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'maintenancePeriod', label: '保养频率' }, { prop: 'maintenancePeriod', label: '保养频率' },
{ {
prop: 'maintainType', prop: 'maintainType',
label: '保养类型', label: '保养类型',
showOverflowtooltip: true,
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE), filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
}, },
{ {
prop: 'lastMaintainTime', prop: 'lastMaintainTime',
label: '上次保养时间', label: '上次保养时间',
filter: parseTime, filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
}, },
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true }, { prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
{ {
prop: 'remainDays', prop: 'remainDays',
label: '距离保养时间(天)', label: '距离保养时间(天)',
subcomponent: remainBox, subcomponent: remainBox,
minWidth: 150,
// showOverflowtooltip: true
}, },
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn, width: 100 }, { prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn, width: 100 }, { prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -182,7 +176,6 @@ export default {
: '', : '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true,
color: 'warning', color: 'warning',
}, },
], ],

View File

@ -45,11 +45,6 @@
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="true" :has-files="true"
:rows="rows" /> :rows="rows" />
<el-row v-if="mode === 'detail'" slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="cancel">关闭</el-button>
</el-col>
</el-row>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -99,24 +94,23 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 150, width: 180,
filter: timeFilter, filter: timeFilter,
}, },
{ prop: 'maintainOrderNumber', label: '设备保养单号', width: 110, showOverflowtooltip: true }, { prop: 'maintainOrderNumber', label: '设备保养单号' },
{ prop: 'startTime', label: '开始时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true }, { prop: 'startTime', label: '开始时间', filter: timeFilter },
{ prop: 'endTime', label: '结束时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true }, { prop: 'endTime', label: '结束时间', filter: timeFilter },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainWorker', label: '保养人员', minWidth: 100, showOverflowtooltip: true }, { prop: 'maintainWorker', label: '保养人员' },
{ {
prop: 'relatePlan', prop: 'relatePlan',
label: '是否计划保养', label: '是否计划保养',
width: 120,
filter: (v) => (v != null ? ['', '是', '否'][v] : ''), filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
}, },
{ prop: 'planName', label: '保养计划名称', minWidth: 120, showOverflowtooltip: true }, { prop: 'planName', label: '保养计划名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)', minWidth: 130, showOverflowtooltip: true }, { prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 }, { prop: 'timeUsed', label: '实际保养用时(h)' },
{ prop: 'remark', label: '备注', minWidth: 100, showOverflowtooltip: true }, { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -163,15 +157,6 @@ export default {
{ {
type: 'separate', type: 'separate',
}, },
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
{ {
type: this.$auth.hasPermi('equipment:maintain-record:create') type: this.$auth.hasPermi('equipment:maintain-record:create')
? 'button' ? 'button'
@ -181,6 +166,14 @@ export default {
plain: true, plain: true,
color: 'success', color: 'success',
}, },
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
], ],
rows: [ rows: [
[ [
@ -215,29 +208,17 @@ export default {
}, },
], ],
[ [
// {
// switch: true,
// label: '',
// prop: 'relatePlan',
// bind: {
// 'active-value': 1,
// 'inactive-value': 2,
// },
// rules: [{ required: true, message: '', trigger: 'blur' }],
// },
{ {
select: true, switch: true,
options: [
{ label: '是', value: 1 },
{ label: '否', value: 2 }
],
label: '是否计划保养', label: '是否计划保养',
prop: 'relatePlan', prop: 'relatePlan',
bind: { bind: {
clearable: true, filterable: true 'active-value': 1,
'inactive-value': 2,
}, },
rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }], rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
}, },
{},
{ {
select: true, select: true,
label: '所属计划', label: '所属计划',
@ -248,11 +229,6 @@ export default {
clearable: true, clearable: true,
}, },
}, },
{
input: true,
label: '保养用时',
prop: 'timeUsed',
},
], ],
[ [
{ {
@ -279,7 +255,11 @@ export default {
clearable: true, clearable: true,
}, },
}, },
{} {
input: true,
label: '保养用时',
prop: 'timeUsed',
},
], ],
[ [

View File

@ -9,16 +9,12 @@
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="disabled" :wrapper-closable="false"
class="drawer" class="drawer"
custom-class="mes-drawer" size="60%">
size="65%"
@closed="$emit('destroy')">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
</small-title> </small-title>
<div class="drawer-body flex">
<div class="drawer-body__content">
<el-form <el-form
ref="form" ref="form"
:model="dataForm" :model="dataForm"
@ -59,14 +55,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-divider style="margin-top: -10px" />
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
{{ '设备维修信息' }} {{ '可编辑信息' }}
</small-title> </small-title>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="8">
<el-form-item <el-form-item
label="维修开始时间" label="维修开始时间"
prop="maintenanceStartTime" prop="maintenanceStartTime"
@ -79,7 +72,8 @@
value-format="timestamp" /> value-format="timestamp" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item <el-form-item
label="维修结束时间" label="维修结束时间"
prop="maintenanceFinishTime" prop="maintenanceFinishTime"
@ -92,7 +86,8 @@
value-format="timestamp" /> value-format="timestamp" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item <el-form-item
label="维修方式" label="维修方式"
prop="repairMode" prop="repairMode"
@ -109,7 +104,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> </el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="故障类型" prop="faultType"> <el-form-item label="故障类型" prop="faultType">
<el-select <el-select
:disabled="disabled" :disabled="disabled"
@ -132,7 +129,7 @@
prop="faultDetail" prop="faultDetail"
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
<!-- // --> <!-- // -->
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/> <editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="380"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -141,7 +138,7 @@
<el-col> <el-col>
<el-form-item label="维修记录" prop="maintenanceDetail"> <el-form-item label="维修记录" prop="maintenanceDetail">
<!-- // --> <!-- // -->
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/> <editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="380"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -149,7 +146,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item label="维修附件" prop="file"> <el-form-item label="维修附件" prop="file">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" /> <FileUpload v-model="file" :disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -166,11 +163,12 @@
</el-row> </el-row>
</el-form> </el-form>
<div v-if="!disabled" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
</div> 编辑
</div> </el-button> -->
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -208,15 +206,11 @@ export default {
visible: false, visible: false,
disabled: false, disabled: false,
dataForm: {}, dataForm: {},
file: '', file: ''
fileName: ''
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
setFileName(val) {
this.fileName = val
},
goback() { goback() {
this.$emit('refreshDataList'); this.$emit('refreshDataList');
this.visible = false; this.visible = false;
@ -231,15 +225,12 @@ export default {
resetFields(args) { resetFields(args) {
return this.$refs.form.resetFields(args); return this.$refs.form.resetFields(args);
}, },
initData() {
this.file = ''
this.fileName = ''
},
init(row, isdetail) { init(row, isdetail) {
this.initData(); // this.initData();
this.disabled = isdetail || false; this.disabled = isdetail || false;
this.dataForm.id = row.id || undefined; this.dataForm.id = row.id || undefined;
this.visible = true; this.visible = true;
console.log('111', this.dataForm, row)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
@ -250,10 +241,6 @@ export default {
this.formLoading = false this.formLoading = false
this.dataForm = response.data; this.dataForm = response.data;
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0 this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
if (this.dataForm.files.length > 0) {
this.file = this.dataForm.files[0].fileUrl
this.fileName = this.dataForm.files[0].fileName
}
}); });
} else { } else {
// if (this.urlOptions.isGetCode) { // if (this.urlOptions.isGetCode) {
@ -274,7 +261,6 @@ export default {
let arry = [] let arry = []
temp.forEach(item => { temp.forEach(item => {
arry.push({ arry.push({
fileName: this.fileName,
fileType: 2, fileType: 2,
fileUrl: item fileUrl: item
}) })
@ -302,39 +288,56 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.drawer >>> .el-drawer { .drawer >>> .el-drawer {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
} }
.drawer >>> .el-drawer__header { .drawer >>> .el-drawer__header {
margin: 0; margin: 0;
padding: 32px 32px 24px; padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6; border-bottom: 1px solid #dcdfe6;
margin-bottom: 0px;
} }
.drawer >>> .el-drawer__body {
.small-title::before { flex: 1;
content: ''; height: 1px;
display: inline-block;
vertical-align: top;
width: 4px;
height: 22px;
border-radius: 1px;
margin-right: 8px;
background-color: #0b58ff;
}
.drawer-body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%;
} }
.drawer-body__content { .drawer >>> .content {
padding: 30px 24px;
flex: 1; flex: 1;
/* background: #eee; */ display: flex;
padding: 20px 30px; flex-direction: column;
overflow-y: auto; /* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
} }
.drawer-body__footer { .drawer-body__footer {

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="120" :width="180"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
@ -48,8 +48,7 @@
<CustomDialogForm <CustomDialogForm
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getList" @refreshDataList="getList" />
@destroy="addOrUpdateVisible = false" />
</div> </div>
</template> </template>
@ -70,6 +69,12 @@ export default {
addOrUpdateVisible: false, addOrUpdateVisible: false,
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'], searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:repair:update')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:repair:finish') this.$auth.hasPermi('equipment:repair:finish')
? { ? {
type: 'finish', type: 'finish',
@ -78,16 +83,10 @@ export default {
: undefined, : undefined,
this.$auth.hasPermi('equipment:repair:update') this.$auth.hasPermi('equipment:repair:update')
? { ? {
type: 'detail', type: 'edit',
btnName: '详情', btnName: '修改',
} }
: undefined, : undefined,
// this.$auth.hasPermi('equipment:repair:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:repair:delete') this.$auth.hasPermi('equipment:repair:delete')
? { ? {
type: 'delete', type: 'delete',
@ -100,31 +99,29 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 150, width: 180,
filter: parseTime, filter: parseTime,
}, },
{ prop: 'repairOrderNumber', label: '设备维修单号', minWidth: 100, showOverflowtooltip: true }, { prop: 'repairOrderNumber', label: '设备维修单号' },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true }, { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{ {
prop: 'maintenanceFinishTime', prop: 'maintenanceFinishTime',
label: '结束时间', label: '结束时间',
filter: parseTime, filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'maintenanceStatus', prop: 'maintenanceStatus',
label: '维修状态', label: '维修状态',
filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''), filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''),
}, },
{ prop: 'maintenanceDuration', label: '维修时长(h)', width: 110 }, { prop: 'maintenanceDuration', label: '维修时长(h)' },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintenanceDetail', label: '维修明细' }, { prop: 'maintenanceDetail', label: '维修明细' },
{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true }, { prop: 'repairman', label: '维修工' },
{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true }, { prop: 'repairmanPhone', label: '联系方式' },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true }, { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -179,7 +176,6 @@ export default {
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '', type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true,
color: 'warning', color: 'warning',
}, },
], ],

View File

@ -75,6 +75,9 @@
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button>
</div> </div>
<attr-add <attr-add

View File

@ -35,7 +35,7 @@
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="cancel">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
@ -79,13 +79,21 @@ export default {
this.partList = res.data.list; this.partList = res.data.list;
}) })
}, },
cancel() {
this.$refs['dataForm'].resetFields()
this.visible = false
},
init(id) { init(id) {
// this.dataForm.id = id || ''; this.dataForm.id = id || '';
this.visible = true; this.visible = true;
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// getCoreProductAttr({
// id: this.dataForm.id
// }).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
// });
// }
// });
}, },
// //
dataFormSubmit() { dataFormSubmit() {
@ -109,7 +117,6 @@ export default {
configId: this.configId, configId: this.configId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.$refs['dataForm'].resetFields()
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
}); });

View File

@ -301,12 +301,6 @@ export default {
const id = row.id; const id = row.id;
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
if (this.form.unit !== undefined) {
this.form.unit = String(this.form.unit)
}
if (this.form.type !== undefined) {
this.form.type = String(this.form.type)
}
this.open = true; this.open = true;
this.title = '修改备品备件'; this.title = '修改备品备件';
}); });

View File

@ -310,8 +310,7 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'change') { if (raw.type === 'change') {
// //
console.log(raw) this.addNew();
this.addNew(raw.data.sparePartId);
} else {} } else {}
}, },
getList() { getList() {
@ -321,7 +320,7 @@ export default {
configId: this.dataForm.id, configId: this.dataForm.id,
}).then((response) => { }).then((response) => {
this.list = response.data; this.list = response.data;
this.listQuery.total = response.data.length; this.listQuery.total = response.data.total;
}); });
}, },
getList1() { getList1() {
@ -335,10 +334,10 @@ export default {
}); });
}, },
// / // /
addNew(sparePartId) { addNew(id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(sparePartId); this.$refs.addOrUpdate.init(id);
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */

Some files were not shown because too many files have changed in this diff Show More