From fc89f79523132c44220b03d90c23593dd93e6adb Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Thu, 14 Nov 2024 15:48:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/accessory/accessory_out_bound_list.js | 9 +- .../child/accessory_out_bound_detail.js | 2 +- js/demandPlan/child/apply_plan_form.js | 31 +++--- js/demandPlan/child/choose_tool_type_list.js | 98 ++++--------------- page/demandPlan/child/apply_plan_form.html | 21 ++-- .../child/choose_tool_type_list.html | 20 ---- 6 files changed, 45 insertions(+), 136 deletions(-) diff --git a/js/accessory/accessory_out_bound_list.js b/js/accessory/accessory_out_bound_list.js index 7825849..e90a238 100644 --- a/js/accessory/accessory_out_bound_list.js +++ b/js/accessory/accessory_out_bound_list.js @@ -104,7 +104,7 @@ function initTable() { let value = ''; if (d.devType === '1') { value = '工器具'; - } else if (d.devType === '2') { + } else if (d.devType === '0') { value = '设备'; } return '' + value + '' @@ -155,7 +155,7 @@ function initTable() { unresize: true, templet: function (d) { let html = ""; - html += "详情"; + html += "详情"; if (d.status === '1') { // 待审核 html += "
|
审核"; } else if (d.status === '2') { // 审核通过待出库 @@ -201,8 +201,7 @@ function exportExcel() { } // 详情 审核 出库确认 -function accessoryOutBoundDetail(obj, type) { - obj.type = type; - obj.devType = '2'; // 1.工器具 2.设备 +function accessoryOutBoundDetail(obj) { + // 1.工器具 0.设备 openIframeByParamObj("accessory_out_bound_detail", "配件出库记录", "../accessory/child/accessory_out_bound_detail.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/js/accessory/child/accessory_out_bound_detail.js b/js/accessory/child/accessory_out_bound_detail.js index ab34469..aa84063 100644 --- a/js/accessory/child/accessory_out_bound_detail.js +++ b/js/accessory/child/accessory_out_bound_detail.js @@ -11,7 +11,7 @@ function setParams(params) { $('#print').before(''); $('#upload').removeAttr('style'); } - if (objParam.devType === '2') { // 设备 + if (objParam.devType === '0') { // 设备 let html = ''; html += '' + '内部编号使用机型使用单位' diff --git a/js/demandPlan/child/apply_plan_form.js b/js/demandPlan/child/apply_plan_form.js index 2b40835..6184d3b 100644 --- a/js/demandPlan/child/apply_plan_form.js +++ b/js/demandPlan/child/apply_plan_form.js @@ -241,14 +241,13 @@ function setTableData(results) { html += "" + l.name + ""; html += "" + l.model + ""; html += "" + l.unit + ""; - html += "" + setFormInput(l.num, 1) + ""; - html += "" + setFormInput(l.price, 2) + ""; - html += "" + setFormInput(l.manufacturer, 3) + ""; - html += "" + setFormInput(l.remarks, 4) + ""; + html += "" + setFormInput(l.needNum, 1) + ""; + html += "" + setFormInput(l.times, 2) + ""; + html += "" + setFormInput(l.remarks, 3) + ""; html += ""; } } else { - html += "没有相关数据"; + html += "没有相关数据"; } $("#baseTable tbody").empty().append(html); layui.form.render(); @@ -256,11 +255,11 @@ function setTableData(results) { function setFormInput(value, type) { let html = '
'; - if (type === 1) { // 入库量 - html += ''; - } else if (type === 2) { // 单价 - html += ''; - } else if (type === 4) { // 备注 + if (type === 1) { // 需用量 + html += ''; + } else if (type === 2) { // 需用天数 + html += ''; + } else if (type === 3) { // 备注 html += ''; } html += '
'; @@ -330,18 +329,12 @@ function delFitType() { } // 校验数据 -function checkValue(that, type) { +function checkValue(that, type, name) { let value = $(that).val(); - if (type === 1) { // 入库量 + if (type === 1 || type === 2) { // 需用量 / 需用天数 const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value) && value) { - layer.msg('入库量输入不合法,请重新输入!', { icon: 5 }) - $(that).val(''); - } - } else if (type === 2) { // 单价 - const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/; - if (!regex.test(value) && value) { - layer.msg('单价输入不合法,请重新输入!', { icon: 5 }) + layer.msg('' + name + '输入不合法,请重新输入!', { icon: 5 }) $(that).val(''); } } diff --git a/js/demandPlan/child/choose_tool_type_list.js b/js/demandPlan/child/choose_tool_type_list.js index 15b4577..a14c458 100644 --- a/js/demandPlan/child/choose_tool_type_list.js +++ b/js/demandPlan/child/choose_tool_type_list.js @@ -15,27 +15,10 @@ function setParams(obj) { element = layui.element; layer = layui.layer; util = layui.util; - getVendList(); initTable(); }); } -// 厂家下拉选 -function getVendList() { - cjList.splice(0, cjList.length); - let encryptedData = {}; - let url = dataUrl + 'backstage/paType/getVendList?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData)); - ajaxRequest(url, "GET", null, false, function () { - }, function (result) { - console.log(result); - if (result.code === 200) { - cjList = result.data; - } - }, function (xhr, status, error) { - errorFn(xhr, status, error) - }, null); -} - // 查询/重置 function queryTable(type) { if (type === 1) { @@ -43,7 +26,6 @@ function queryTable(type) { } else if (type === 2) { $('#name').val(''); $('#module').val(''); - $('#type').val(''); layui.form.render(); reloadTable(1); } @@ -59,7 +41,6 @@ function reloadTable(pageNum) { encryptedData: JSON.stringify({ 'name': $('#name').val(), 'model': $('#model').val(), - 'type': $('#type').val(), }), }, }, @@ -81,7 +62,6 @@ function initTable() { encryptedData: JSON.stringify({ 'type': $('#type').val(), 'name': $('#name').val(), - 'model': $('#model').val(), }), }, request: { @@ -121,61 +101,53 @@ function initTable() { }, { field: "type", - width: '11.8%', - title: "配件类型", + width: '10%', + title: "物机类型", unresize: true, align: "center", }, { field: "name", - width: '12%', - title: "配件名称", + width: '10%', + title: "物机名称", unresize: true, align: "center", }, { field: "model", width: '10%', - title: "规格型号", + title: "规格", unresize: true, align: "center", }, { field: "unit", title: "单位", - width: '8%', - unresize: true, - align: "center", - }, - { - field: "num", width: '10%', - title: " * 本次入库量", unresize: true, align: "center", - edit: 'text', - style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { - field: "price", - width: '9.8%', - title: "单价(元)", - unresize: true, - align: "center", - edit: 'text', - style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' - }, - { - field: "manufacturer", + field: "needNum", width: '15%', - title: " * 配件厂家", + title: " * 需用量", unresize: true, align: "center", - templet: '#TPL-select-demo' + edit: 'text', + style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' + }, + { + field: "times", + width: '15%', + title: " * 需用天数", + unresize: true, + align: "center", + edit: 'text', + style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { field: "remarks", - width: '12%', + width: '18.9%', title: "备注", unresize: true, align: "center", @@ -189,24 +161,8 @@ function initTable() { limit: 10, page: true, done: function (res, curr, count) { - var options = this; table.resize("currentTableId"); pageNum = tableIns.config.page.curr; - form.on('select(select-demo)', function (obj) { - console.log(obj); - var value = obj.value; // 获取选中项 value - // 获取当前行数据(如 id 等字段,以作为数据修改的索引) - var data = table.getRowData(options.id, obj.elem); - // 更新数据中对应的字段 - data.manufacturer = value; - updateOrAddObject(data.id, data); - }); - // 获取当前行数据 - 自定义方法 - table.getRowData = function (tableId, elem) { - var index = $(elem).closest('tr').data('index'); - return table.cache[tableId][index] || {}; - }; - //设置全部数据到全局变量 quanju = res.data; for (var i = 0; i < res.data.length; i++) { @@ -234,7 +190,7 @@ function initTable() { table.on('edit(currentTableId2)', function (obj) { var field = obj.field; // 得到修改的字段 var value = obj.value // 得到修改后的值 - if (field === 'num') { // 本次入库量 + if (field === 'needNum' || field === 'times') { // 需用量 / 需用天数 if (value) { const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value)) { @@ -242,12 +198,6 @@ function initTable() { return layer.msg('格式不正确,最大输入6位数,且为正整数!', { icon: 7 }) } } - } else if (field === 'price') { - const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/; - if (!regex.test(value)) { - obj.reedit(); - return layer.msg('单价格式不正确!', { icon: 7 }) - } } else if (field === 'remarks') { // 备注 if (value) { if (value.length > 255) { @@ -363,13 +313,7 @@ function saveData2(params) { } } - -// 配件类型 -function addFitTypeData() { - openIframeByParamObj2("add_fit_type_data", "配件类型", "../../../page/basic/fit_type_list.html", "92%", "95%", {}); -} - -function closePage(type,params) { +function closePage(type, params) { let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引 parent.layer.close(index); // 再执行关闭 if (type == 1) { diff --git a/page/demandPlan/child/apply_plan_form.html b/page/demandPlan/child/apply_plan_form.html index 45d45b9..64c253e 100644 --- a/page/demandPlan/child/apply_plan_form.html +++ b/page/demandPlan/child/apply_plan_form.html @@ -89,18 +89,12 @@ lay-affix="clear" placeholder="输入配件名称" maxlength="30"> -
-
- -
-
- +
@@ -115,13 +109,12 @@ 序号 - 配件类型 - 配件名称 - 规格型号 + 物机类型 + 物机名称 + 规格 单位 - * 本次入库量 - 单价(元) - * 配件厂家 + *需用量 + *需用天数 备注 @@ -130,7 +123,7 @@
- +
diff --git a/page/demandPlan/child/choose_tool_type_list.html b/page/demandPlan/child/choose_tool_type_list.html index 4649b01..29563e8 100644 --- a/page/demandPlan/child/choose_tool_type_list.html +++ b/page/demandPlan/child/choose_tool_type_list.html @@ -53,23 +53,11 @@ class="layui-input" lay-affix="clear" placeholder="输入配件名称" maxlength="30"> -
-
- -
-
- -
-
-

(需求计划无机具名称及规格,点击添加新数据)

@@ -85,14 +73,6 @@ -