From 8bbe2ed185b10bb7cc78e0abcdbad465b7f63473 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Tue, 24 Dec 2024 19:31:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E7=BB=91=E5=AE=9A=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/purchase/goodsBind.js | 9 ++ .../goodsBind/component/bindTools.vue | 102 +++++++++++------- 2 files changed, 73 insertions(+), 38 deletions(-) diff --git a/src/api/purchase/goodsBind.js b/src/api/purchase/goodsBind.js index db64b5f0..eca4f4fb 100644 --- a/src/api/purchase/goodsBind.js +++ b/src/api/purchase/goodsBind.js @@ -47,6 +47,15 @@ export function rejectBind(data) { }) } +//编码解绑 +export function unBindCodeApi(data) { + return request({ + url: '/material/purchase_macode_info/un_bind', + method: 'post', + data: data, + }) +} + //二级页面 详情 export function getListDetailById(query) { return request({ diff --git a/src/views/material/purchase/goodsBind/component/bindTools.vue b/src/views/material/purchase/goodsBind/component/bindTools.vue index fc8943b6..04ffa460 100644 --- a/src/views/material/purchase/goodsBind/component/bindTools.vue +++ b/src/views/material/purchase/goodsBind/component/bindTools.vue @@ -193,25 +193,37 @@ /> - - + + + + + + + + + + + 查询 + + + 解绑 + + + + - - + + + + @@ -402,7 +414,8 @@ import { getNewBuyBindListDetailsApi, getMaCodeInfo, exportNewBuy, - rejectBind + rejectBind, + unBindCodeApi } from "@/api/purchase/goodsBind"; import { downloadFile } from '@/utils/download' import { getToken } from "@/utils/auth"; @@ -449,7 +462,9 @@ export default { millList: [{ label: "测试公司", value: 1 }], // 厂家列表 codeList: [], // 列表 selectList: [], // 列表复选框选中数据 - viewCodeList: [], // 查看列表 + viewCodeList: [], // 查看编码列表 + codeForm:{}, + unbindIds:[], codeTableList: [], // 填充列表 // 编码绑定表单数据源 queryBindForm: { @@ -563,25 +578,46 @@ export default { handleSelectionChange(list) { this.selectList = list; }, - // 查看 + // 查看编码 handleView(row) { + this.codeForm=row this.viewCodeVisible = true; - getMaCodeInfo({ taskId: row.taskId, typeId: row.typeId }).then( + getMaCodeInfo({ taskId: row.taskId, typeId: row.typeId, keyWord:this.codeForm.keyWord }).then( (response) => { this.viewCodeList = response.rows; - this.titleBind = "查看"; - this.loadingTwo = false; + this.titleBind = "查看"; + } + ); + }, + //是否可用勾选框 + selectable(row) { + if (row.status == 0) { + return true + } else { + return false + } + }, + //编码勾选 + codeSelection(selection){ + console.log(selection) + this.unbindIds = selection.map(item => {return item.id}) + }, + codeUnBind(){ + console.log(this.unbindIds) + let param = { + + } + unBindCodeApi(this.unbindIds).then((response) => { + this.codeQuery() + }); + }, + // 查询编码 + codeQuery() { + getMaCodeInfo({ taskId: this.codeForm.taskId, typeId: this.codeForm.typeId, keyWord:this.codeForm.keyWord }).then( + (response) => { + this.viewCodeList = response.rows; } ); - // this.loadingTwo = true - // getListDetailById({ taskId: row.taskId, typeId: row.typeId }).then( - // (response) => { - // this.getListBind = response.rows - // this.showBind = true - // this.titleBind = '查看' - // this.loadingTwo = false - // }, - // ) }, // 绑定 handleBind(row) { @@ -590,16 +626,6 @@ export default { this.queryBindForm.typeId = row.typeId; this.queryBindForm.typeName = row.typeName; this.queryBindForm.maTypeName = row.maTypeName; - // this.queryBindTwo = {} - // this.resetForm('queryFormBind') - // this.titleTwo = '绑定' - // this.showTwo = true - // this.num = row.checkNum - // this.materialName = row.materialName - // this.materialModel = row.materialModel - // this.productDate = row.productDate - // this.taskIdTemp = row.taskId - // this.typeIdTemp = row.typeId }, // 驳回 handleReject(row) {