From d25638b07b18f5b9379690a150f615614ecb9aa0 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 23 Sep 2024 16:37:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9C=BA=E5=85=B7=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0=E6=A0=91=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5=E6=93=8D=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=AB=98=E4=BA=AE=EF=BC=8C=E6=96=B0=E8=B4=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BA=BF=E4=B8=8B=E9=87=87=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E5=AD=97=E6=AE=B5=E7=AD=89=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../machinery/keeper/index.vue | 7 + .../machinery/personnel/index.vue | 6 + .../warehouseManage/machinery/type/index.vue | 310 ++++++++++++++++-- .../toolsAcceptance/component/addTools.vue | 67 ++-- .../toolsAcceptance/component/home.vue | 6 + vue.config.js | 2 +- 6 files changed, 351 insertions(+), 47 deletions(-) diff --git a/src/views/warehouseManage/machinery/keeper/index.vue b/src/views/warehouseManage/machinery/keeper/index.vue index 93ea241..68b3b94 100644 --- a/src/views/warehouseManage/machinery/keeper/index.vue +++ b/src/views/warehouseManage/machinery/keeper/index.vue @@ -614,4 +614,11 @@ export default { width: 60px !important; margin-bottom: 10px; } + +::v-deep + .el-tree--highlight-current + .el-tree-node.is-current + > .el-tree-node__content { + background-color: #8decf1; +} diff --git a/src/views/warehouseManage/machinery/personnel/index.vue b/src/views/warehouseManage/machinery/personnel/index.vue index b9c3535..fb85942 100644 --- a/src/views/warehouseManage/machinery/personnel/index.vue +++ b/src/views/warehouseManage/machinery/personnel/index.vue @@ -625,4 +625,10 @@ export default { width: 60px !important; margin-bottom: 10px; } +::v-deep + .el-tree--highlight-current + .el-tree-node.is-current + > .el-tree-node__content { + background-color: #8decf1; +} diff --git a/src/views/warehouseManage/machinery/type/index.vue b/src/views/warehouseManage/machinery/type/index.vue index e796523..2b5bab4 100644 --- a/src/views/warehouseManage/machinery/type/index.vue +++ b/src/views/warehouseManage/machinery/type/index.vue @@ -3,7 +3,7 @@
- +
+ > + + {{ node.label.slice(0, 3) + '...' }} + {{ node.label }} + + + + + + + + + + +
- + - + + @@ -292,7 +339,7 @@ - + /> --> + + @@ -581,6 +630,53 @@ 取 消
+ + + + + + + + + + + + + + + + + + + + 确 定 + 取 消 + + + + @@ -664,9 +760,10 @@ export default { // 查询参数 queryParams: { - // pageNum: 1, - // pageSize: 10, + pageNum: 1, + pageSize: 10, typeName: undefined, + level: 0, // phonenumber: undefined, // status: undefined, // typeId: undefined @@ -763,6 +860,26 @@ export default { // {required: true, message: "开始日期不能为空", trigger: "blur"} // ], }, + + /* 新增弹框等数据源定义 */ + addTitleVisible: false, + addTitle: '', // 新增弹框标题 + addFormParams: { + label: '', + typeName: '', + companyId: 101, + }, + + addFormParamsRules: { + typeName: [ + { + required: true, + message: '名称不能为空', + trigger: 'blur', + }, + ], + }, + isMousemoveId: null, } }, watch: { @@ -799,7 +916,14 @@ export default { /** 查询新增页面-上级类型下拉树结构 */ getTreeData() { getMaTypeList().then((response) => { - this.treeOptions = response.data + this.treeOptions = [ + { + label: '机具类型', + id: 0, + children: response.data, + level: 0, + }, + ] }) }, /** 查询资产属性下拉 */ @@ -812,8 +936,8 @@ export default { getList() { this.loading = true getListByMaType(this.queryParams).then((response) => { - this.typeList = response.data - // this.total = response.total; + this.typeList = response.data.rows + this.total = response.data.total this.loading = false }) }, @@ -825,6 +949,7 @@ export default { // 节点单击事件 - 左侧树 handleNodeClick(data) { this.queryParams.typeId = data.id + this.queryParams.level = data.level this.handleQuery() }, // 取消按钮 @@ -839,6 +964,7 @@ export default { photoName: '', documentUrl: '', documentName: '', + parentId: '', } this.imageUrl = '' this.fileList = [] @@ -855,6 +981,9 @@ export default { this.dateRange = [] this.resetForm('queryForm') this.queryParams.typeId = undefined + this.queryParams.pageNum = 1 + this.queryParams.pageSize = 10 + this.queryParams.level = 0 this.$refs.tree.setCurrentKey(null) this.handleQuery() }, @@ -893,6 +1022,11 @@ export default { } this.imageUrl = this.form.photoUrl + + console.log(row, '---') + this.getParentName(this.treeOptions, row.parentId) + // console.log(this.form, '表单数据--') + this.open = true this.title = '修改' }) @@ -930,8 +1064,9 @@ export default { return delMaType(typeIds) }) .then(() => { - this.getList() this.$modal.msgSuccess('删除成功') + this.getList() + this.getTreeData() }) .catch(() => {}) }, @@ -1050,6 +1185,102 @@ export default { this.form.companyId = val.companyId }, + + /* 树节点增加 */ + appendTreeNode(data) { + if (data.level === 3) { + this.reset() + Object.assign(this.form, data) + this.form.parentId = data.id + this.open = true + this.title = '新增' + } else { + Object.assign(this.addFormParams, data) + this.addFormParams.typeName = '' + this.addTitle = '新增' + this.addTitleVisible = true + } + }, + /* 树节点删除 */ + removeTreeNode(data) { + // this.$message.success('删除--') + console.log(data, '删除时的数据源--') + this.$modal + .confirm('是否确认删除数据项?') + .then(function () { + return delMaType(data.id) + }) + .then(() => { + this.$modal.msgSuccess('删除成功') + this.getTreeData() + }) + .catch(() => {}) + }, + /* 树节点修改 */ + editTreeNode(data) { + console.log(data, '修改') + Object.assign(this.addFormParams, data) + this.addTitle = '修改' + this.addFormParams.typeName = data.label + this.addTitleVisible = true + }, + /* 确定 */ + onSubmit() { + const { id, typeName } = this.addFormParams + const addParams = { + parentId: id, + typeName, + } + const editParams = { + typeId: id, + typeName, + } + + this.$refs['addFormParamsRef'].validate(async (valid) => { + if (valid) { + if (this.addTitle === '新增') { + const res = await addMaType(addParams) + if (res.code === 200) { + this.$message.success('新增成功!') + this.addTitleVisible = false + this.getTreeData() + } + } else { + const res = await updateMaType(editParams) + if (res.code === 200) { + this.$message.success('修改成功!') + this.addTitleVisible = false + this.getTreeData() + } + } + } + }) + }, + /* 取消 */ + onCancel() { + this.addTitleVisible = false + }, + getParentName(list, id) { + try { + list.forEach((e) => { + if (e.id == id) { + this.form.label = e.label + throw new Error() + } else { + if (e.children && e.children.length > 0) { + this.getParentName(e.children, id) + } + } + }) + } catch (error) {} + }, + + onMousemove(data) { + this.isMousemoveId = data.id + }, + onMouseleave() { + this.isMousemoveId = null + }, }, } @@ -1058,4 +1289,43 @@ export default { width: 60px !important; margin-bottom: 10px; } + +::v-deep .btn-items .el-button + .el-button { + margin-left: 6px; +} +.btn-items { + margin-left: 4px; + .el-button--text { + font-size: 16px; + } +} +::v-deep .el-tree .el-tree-node__expand-icon.expanded { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); +} +::v-deep .el-tree .el-icon-caret-right:before { + content: '\e783'; + font-size: 16px; +} +::v-deep + .el-tree + .el-tree-node__expand-icon.expanded.el-icon-caret-right:before { + content: '\e781'; + font-size: 16px; + color: #1890ff; +} + +::v-deep .el-tree-node__content > .el-tree-node__expand-icon { + color: #1890ff !important; +} +::v-deep .el-tree-node__expand-icon.is-leaf { + color: transparent !important; +} + +::v-deep + .el-tree--highlight-current + .el-tree-node.is-current + > .el-tree-node__content { + background-color: #8decf1; +} diff --git a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index 6dd4499..cbaba33 100644 --- a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -1,29 +1,14 @@ @@ -516,12 +602,17 @@ import { getAllNotificationList, addNoticeUser, delNoticeUser, + postAcceptImgUploadApi, } from '@/api/store/newBuy' import { imgUpLoad, fileUpLoad } from '@/api/system/upload' +import UploadImg from './upload-img.vue' export default { name: 'NewDevicesAccept', dicts: ['sys_normal_disable'], + components: { + UploadImg, + }, props: { isView: { type: Boolean, @@ -619,6 +710,14 @@ export default { trigger: 'blur', }, ], + + fileListNew: [ + { + required: true, + message: '验收图片不能为空', + trigger: 'blur', + }, + ], }, // 表单参数 aform: {}, @@ -654,6 +753,22 @@ export default { ], }, deptName: undefined, + + /* 验收图片等数据源 */ + acceptImgVisible: false, + acceptImgUploadVisible: false, + fileListNew: [], + actionUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload', + /* 参数 */ + uploadImgParams: { + id: '', + checkUrlName: '', + checkUrl: '', + }, + acceptImgList: [], + checkUrlNew: '', + checkUrlNameNew: '', + imgLimit: 1, } }, computed: { @@ -692,6 +807,9 @@ export default { if (item.checkUrl) { item.imgUrlList = item.checkUrl.split(',') item.imgNameList = item.checkUrlName.split(',') + item.previewImgLimit = item.checkUrl.split(',').length + } else { + item.previewImgLimit = 0 } }) this.loading = false @@ -717,6 +835,7 @@ export default { checkResult: '通过', inputNum: undefined, checkUrl: undefined, + fileListNew: [], } this.imageUrl = '' this.resetForm('form') @@ -864,6 +983,7 @@ export default { this.$set(this.form, 'checkNum', row.purchaseNum) this.$set(this.form, 'checkUrl', '') this.$set(this.form, 'checkUrlName', '') + this.$set(this.form, 'fileListNew', []) this.fileList = [] this.checkUrlList = [] this.checkUrlNameList = [] @@ -880,6 +1000,7 @@ export default { checkResult: '通过', checkUrl: '', checkUrlName: '', + fileListNew: [], } this.imageUrl = '' this.openAll = true @@ -888,8 +1009,18 @@ export default { /** 提交按钮 */ submitForm: function () { // console.log(this.form) - this.form.checkUrl = this.checkUrlList.join(',') - this.form.checkUrlName = this.checkUrlNameList.join(',') + // this.form.checkUrl = this.checkUrlList.join(',') + // this.form.checkUrlName = this.checkUrlNameList.join(',') + + let fileUrl = '' + let fileName = '' + + this.form.fileListNew.forEach((e) => { + fileUrl += e.fileUrl + ',' + fileName += e.fileName + ',' + }) + this.form.checkUrl = fileUrl.slice(0, -1) + this.form.checkUrlName = fileName.slice(0, -1) let equipments = [this.form] console.log(equipments) this.$refs['form'].validate((valid) => { @@ -911,20 +1042,27 @@ export default { }) }, submitListForm: function () { - // console.log(this.aform) - this.aform.checkUrl = this.checkUrlList1.join(',') - this.aform.checkUrlName = this.checkUrlNameList1.join(',') - this.ids.forEach((item) => { - item.checkNum = item.purchaseNum - item.checkResult = this.aform.checkResult - item.checkUrl = this.aform.checkUrl - item.checkUrlName = this.aform.checkUrlName + let fileUrl = '' + let fileName = '' + this.aform.fileListNew.map((e) => { + fileUrl += e.fileUrl + ',' + fileName += e.fileName + ',' }) - // console.log(this.ids) - let equipments = this.ids - console.log(equipments) + this.aform.checkUrl = fileUrl.substring(fileUrl.length - 1, ',') + this.aform.checkUrlName = fileName.substring( + fileName.length - 1, + ',', + ) this.$refs['aform'].validate((valid) => { if (valid) { + this.ids.forEach((item) => { + item.checkNum = item.purchaseNum + item.checkResult = this.aform.checkResult + item.checkUrl = this.aform.checkUrl + item.checkUrlName = this.aform.checkUrlName + }) + + let equipments = this.ids updatePurchaseCheckDetails(equipments).then((response) => { if (response.code == 200) { this.$message({ @@ -1039,6 +1177,100 @@ export default { } return isLt5M }, + + /* 查看图片详情 */ + onPreviewImg(row) { + let previewImgList = [] + previewImgList = row.imgUrlList.map((e) => { + return { + img_src: e, + img_name: '', + img_type: '', + } + }) + row.imgNameList.forEach((e, index) => { + previewImgList[index].img_name = e.split('.')[0] + previewImgList[index].img_type = e.split('.')[1] + }) + this.acceptImgList = previewImgList + this.acceptImgVisible = true + }, + /* 上传图片 */ + onUploadImg(row) { + this.imgLimit = 5 - row.previewImgLimit + this.uploadImgParams.id = row.id + this.checkUrlNew = row.checkUrl + this.checkUrlNameNew = row.checkUrlName + this.acceptImgUploadVisible = true + }, + + /* 移除文件 */ + onHandleRemove(file) { + if (file.response) { + this.fileListNew = this.fileListNew.filter( + (e) => e.id !== file.response.data.id, + ) + } + }, + /* 文件上传成功 */ + onHandleSuccess(res, file) { + if (res.code === 200) { + console.log(file.response, '---') + this.fileListNew.push(file.response.data) + } + }, + /* 确定按钮 */ + async onSubmit() { + if (this.fileListNew.length < 1) { + this.$message.closeAll() + this.$message.error('请上传图片!') + return + } + let fileName = '' + let fileUrl = '' + this.fileListNew.forEach((e) => { + fileName += e.fileName + ',' + fileUrl += e.fileUrl + ',' + }) + this.uploadImgParams.checkUrlName = `${ + this.checkUrlNameNew + },${fileName.slice(0, -1)}` + this.uploadImgParams.checkUrl = `${ + this.checkUrlNew + },${fileUrl.slice(0, -1)}` + const res = await postAcceptImgUploadApi(this.uploadImgParams) + if (res.code === 200) { + this.$message.success('上传成功!') + this.acceptImgUploadVisible = false + this.fileListNew = [] + this.getTaskInfo() + } + }, + /* 取消按钮 */ + onCancel() { + this.acceptImgUploadVisible = false + this.fileListNew = [] + }, + + onHandleRemoveNew(file) { + if (this.open && file.response) { + this.form.fileListNew = this.form.fileListNew.filter( + (e) => e.id !== file.response.data.id, + ) + } + }, + onHandleSuccessNew(res, file) { + if (res.code === 200) { + if (this.openAll) { + this.aform.fileListNew.push(file.response.data) + this.$refs.aform.clearValidate('fileListNew') + } + if (this.open) { + this.form.fileListNew.push(file.response.data) + this.$refs.form.clearValidate('fileListNew') + } + } + }, }, } @@ -1053,4 +1285,17 @@ export default { display: none; } } + +.accept-img { + color: #409eff; + + .a-two { + margin-left: 20px; + } +} + +.left-tip { + font-size: 16px; + letter-spacing: 1px; +} diff --git a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload-img.vue b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload-img.vue new file mode 100644 index 0000000..3ea2e9e --- /dev/null +++ b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload-img.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/views/warehouseManage/newPurchase/toolsAcceptance/index.vue b/src/views/warehouseManage/newPurchase/toolsAcceptance/index.vue index e70377c..0a0cac8 100644 --- a/src/views/warehouseManage/newPurchase/toolsAcceptance/index.vue +++ b/src/views/warehouseManage/newPurchase/toolsAcceptance/index.vue @@ -71,7 +71,6 @@ export default { /* 查询工机具 */ queryTools(taskId) { this.isView = true - this.pageContent = '详情信息' this.queryTaskId = taskId this.isShowComponent = 'QueryTools' From 34ba0ca4b2e549ce78f1e62f369e81fcd3b69ed8 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 24 Sep 2024 15:48:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newPurchase/toolsAcceptance/component/queryTools.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue index 4eba18d..c184b6b 100644 --- a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue +++ b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/queryTools.vue @@ -545,7 +545,7 @@