From 12acf2d76b09e8f404fe295b69ccf3f44d3e0d17 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 12 Nov 2024 15:05:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/lease/apply.js | 42 +- .../lease/apply/component/addToolsApply.vue | 178 ++--- .../lease/apply/component/homeApply.vue | 85 +-- .../lease/apply/component/queryToolsApply.vue | 87 ++- .../outBound/component/addToolsOutBound.vue | 680 ++++++++++++++++++ .../lease/outBound/component/homeOutBound.vue | 639 ++++++++++++++++ .../outBound/component/queryToolsOutBound.vue | 365 ++++++++++ src/views/material/lease/outBound/index.vue | 87 +++ 8 files changed, 2019 insertions(+), 144 deletions(-) create mode 100644 src/views/material/lease/outBound/component/addToolsOutBound.vue create mode 100644 src/views/material/lease/outBound/component/homeOutBound.vue create mode 100644 src/views/material/lease/outBound/component/queryToolsOutBound.vue create mode 100644 src/views/material/lease/outBound/index.vue diff --git a/src/api/lease/apply.js b/src/api/lease/apply.js index b3380d0a..3716e46f 100644 --- a/src/api/lease/apply.js +++ b/src/api/lease/apply.js @@ -9,7 +9,7 @@ export function getListLeaseApply(query) { }) } -// 领料申请到货-新增 +// 领料申请-新增 export function addApplyInfo(data) { return request({ url: '/material/lease_apply_info', @@ -18,6 +18,46 @@ export function addApplyInfo(data) { }) } +// 领料申请-编辑 +export function updateApplyInfo(data) { + return request({ + url: '/material/lease_apply_info', + method: 'put', + data: data, + }) +} + +// 领料申请-详情信息 +export function getApplyInfo(id) { + return request({ + url: '/material/lease_apply_info/' + id, + method: 'get' + }) +} + +// 领料申请租赁单位下拉框 +export function getListUnite(data) { + return request({ + url: '/material/select/getUnitList', + method: 'post', + data: data, + }) +} + +// 领料申请租赁工程下拉框 +export function getListProject(data) { + return request({ + url: '/material/select/getProjectList', + method: 'post', + data: data, + }) +} + + + + + + //新购到货-二级列表详情 export function getPurchaseCheckInfo(query) { return request({ diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue index fbdf4382..e281830f 100644 --- a/src/views/material/lease/apply/component/addToolsApply.vue +++ b/src/views/material/lease/apply/component/addToolsApply.vue @@ -9,35 +9,37 @@ :inline="true" label-width="120px" > - + - + @@ -49,7 +51,6 @@ maxlength="50" style="width: 240px" @keyup.enter.native="handleQuery" - @input="taxRateChange" /> @@ -61,14 +62,13 @@ maxlength="50" style="width: 240px" @keyup.enter.native="handleQuery" - @input="taxRateChange" /> - + - + @@ -163,10 +166,13 @@ import { getPurchaseCheckInfo, equipmentTypeTree, - addApplyInfo, - updatePurchaseCheckInfo, } from "@/api/purchase/goodsArrived"; -import { getListFacturer } from "@/api/ma/supplier"; +import { + getListProject, + getListUnite, + addApplyInfo, + updateApplyInfo, +} from "@/api/lease/apply"; import { getToken } from "@/utils/auth"; import { uploadPurchaseFile, @@ -218,8 +224,10 @@ export default { showSearch: true, // 总条数 total: 0, - //物资厂家 - supplierList: [], + //租赁单位 + uniteList: [], + //租赁工程 + projectList: [], //机具类型 equipmentTypeList: [], // 角色表格数据 @@ -252,7 +260,8 @@ export default { productionTime: "", }, maForm: { - taxRate: 13, + unitId: undefined, + projectId: undefined, arrivalTime: "", purchaser: "", remark: "", @@ -266,17 +275,31 @@ export default { }, // 表单校验 rules: { - // deviceType: [ - // { - // required: true, - // message: '请选择类型规格', - // trigger: 'blur', - // }, - // ], - deviceType: [ + unitId: [ { required: true, - message: "请选择规格型号", + message: "请选择租赁单位", + trigger: "blur", + }, + ], + projectId: [ + { + required: true, + message: "请选择租赁工程", + trigger: "blur", + }, + ], + leasePerson: [ + { + required: true, + message: "请输入领料人", + trigger: "blur", + }, + ], + phone: [ + { + required: true, + message: "请输入联系电话", trigger: "blur", }, ], @@ -313,44 +336,41 @@ export default { console.log("isEdit", this.isEdit); this.taskId = this.editTaskId; this.id = this.editId; - this.getTaskInfo(); + // this.getTaskInfo(); } - this.supplierInfoList(); + this.projectInfoList(); this.equipmentType(); }, methods: { - // 税率 - taxRateChange(val) { - this.maForm.taxRate = val.replace(/[^\d.]/g, ""); - this.equipmentList.forEach((item) => { - item.purchaseTaxPrice = item.purchasePrice * (1 + val / 100); + uniteChange(val) { + if (this.isEdit) { + getListProject({ unitId: val }).then((response) => { + if (response.data.length != 0) { + this.projectList = response.data; + } else { + this.projectList = []; + } + }); + } + }, + projectChange(val) { + if (this.isEdit) { + getListUnite({ projectId: val }).then((response) => { + if (response.data.length != 0) { + this.uniteList = response.data; + } else { + this.uniteList = []; + } + }); + } + }, + /** 租赁单位和工程-下拉选 */ + projectInfoList() { + getListUnite({ id: null }).then((response) => { + this.uniteList = response.data; }); - }, - // 含税单价 - purchaseTaxPriceChange(row, val) { - // this.equipmentList[val].purchasePrice = (row.purchaseTaxPrice/(1 + this.maForm.taxRate/100)).toFixed(2) - row.purchasePrice = ( - row.purchaseTaxPrice / - (1 + this.maForm.taxRate / 100) - ).toFixed(2); - }, - // 不含税单价 - purchasePriceChange(row, val) { - // this.equipmentList[val].purchaseTaxPrice = (row.purchasePrice*(1 + this.maForm.taxRate/100)).toFixed(2) - row.purchaseTaxPrice = ( - row.purchasePrice * - (1 + this.maForm.taxRate / 100) - ).toFixed(2); - }, - /** 物资厂家-下拉选 */ - supplierInfoList() { - let param = { - pageNum: 1, - pageSize: 100, - keyWord: undefined, - }; - getListFacturer(param).then((response) => { - this.supplierList = response.rows; + getListProject({ id: null }).then((response) => { + this.projectList = response.data; }); }, //选择物资厂家 @@ -410,7 +430,6 @@ export default { obj.purchaseTaxPrice = 0; obj.purchaseNum = 1; obj.fixCode = "0"; - obj.bmFileInfos = []; tempList.push(obj); break; } @@ -437,12 +456,6 @@ export default { this.equipmentList = []; } }, - //选择出厂日期 - productionTimeChange(val) { - this.equipmentList.forEach((item) => { - item.productionTime = val; - }); - }, //获取任务详情--- 编辑回显数据 getTaskInfo() { // this.loading = true; @@ -486,9 +499,9 @@ export default { if (this.isEdit) { console.log("编辑"); this.loading = true; - updatePurchaseCheckInfo({ - purchaseCheckDetailsList: this.equipmentList, - purchaseCheckInfo: this.maForm, + updateApplyInfo({ + leaseApplyDetailsList: this.equipmentList, + leaseApplyInfo: this.maForm, }).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("编辑成功"); @@ -524,7 +537,7 @@ export default { } }); } else { - this.$modal.msgError("请先添加机具类型"); + this.$modal.msgError("请先添加类型规格"); } }, //文件管理 @@ -673,6 +686,7 @@ export default { .confirm("是否确认删除所选择的数据项?") .then(() => { this.deviceType.forEach((e, index) => { + console.log("e", e); if (e[3] === row.typeId) { this.deviceType.splice(index, 1); this.propsKey++; diff --git a/src/views/material/lease/apply/component/homeApply.vue b/src/views/material/lease/apply/component/homeApply.vue index 7551158b..68bf7c32 100644 --- a/src/views/material/lease/apply/component/homeApply.vue +++ b/src/views/material/lease/apply/component/homeApply.vue @@ -81,7 +81,7 @@ plain icon="el-icon-plus" size="mini" - @click="handleExport" + @click="handleSendAll" >发布 @@ -101,8 +101,14 @@ > - - + + { - // return { - // label: item.dictLabel, - // value: item.dictValue, - // }; - // }); - // this.queryForm.statusDataRange = this.statusDataRange.value; - // }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map((item) => item.id); + this.single = selection.length != 1; + this.multiple = !selection.length; + }, getList() { this.loading = true; @@ -562,35 +561,6 @@ export default { }; this.resetForm("form"); }, - // // 多选框选中数据 - // handleSelectionChange(selection) { - // this.ids = selection.map((item) => item.taskId) - // this.single = selection.length != 1 - // this.multiple = !selection.length - // }, - - /** 验收按钮 */ - handleAccept(row) { - // let query = { taskId: row.taskId } - // this.$tab.closeOpenPage({ - // path: '/store/newBuy/newDevicesAccept', - // query, - // }) - this.$emit("acceptToolsApply", row.taskId); - }, - //编码管理 - handleCode(row) { - // let query = { taskId: row.taskId } - // this.$tab - // .closeOpenPage({ - // path: '/store/newBuy/newDevicesCode', - // query, - // }) - // .then(() => { - // this.$tab.refreshPage() - // }) - this.$emit("codingTools", row.taskId); - }, //获取验收单数据 getPrintTable(taskId) { @@ -639,16 +609,29 @@ export default { /** 导出按钮操作 */ handleExport() { this.download( - "/material/purchase_check_info/export", + "/material/lease_apply_info/export", { ...this.queryParams }, - `新购到货_${new Date().getTime()}.xlsx` + `领料申请_${new Date().getTime()}.xlsx` ); }, - }, - //发布按钮 - handleSend(row) { - console.log("发布"); + //发布按钮 + handleSend(row) { + console.log("发布"); + }, + + handleSendAll() { + if (this.ids.length == 0) { + this.$alert("请至少勾选一个领料申请", "提示", { + type: "warning", + confirmButtonText: "确定", + }); + return; + } else { + const ids = this.ids.join(","); + console.log("发布"); + } + }, }, watch: { diff --git a/src/views/material/lease/apply/component/queryToolsApply.vue b/src/views/material/lease/apply/component/queryToolsApply.vue index e3b15020..8e2e29ea 100644 --- a/src/views/material/lease/apply/component/queryToolsApply.vue +++ b/src/views/material/lease/apply/component/queryToolsApply.vue @@ -1,5 +1,72 @@