diff --git a/js/accessory/child/choose_inventory_count_fit_type_list.js b/js/accessory/child/choose_inventory_count_fit_type_list.js index 15b4577..98b71d1 100644 --- a/js/accessory/child/choose_inventory_count_fit_type_list.js +++ b/js/accessory/child/choose_inventory_count_fit_type_list.js @@ -4,8 +4,7 @@ let pageNum = 1; let quanju = new Array();//全局 let huancun = new Array();//缓存 let huancunObj = new Array();//缓存2 -let cjList = []; -let jjDetailArr = []; // 入库配件类型数据 +let jjDetailArr = []; // 盘点数据 function setParams(obj) { objParam = JSON.parse(obj); console.log(objParam); @@ -15,26 +14,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) { @@ -121,25 +104,32 @@ function initTable() { }, { field: "type", - width: '11.8%', + width: '8%', title: "配件类型", unresize: true, align: "center", }, { field: "name", - width: '12%', + width: '8%', title: "配件名称", unresize: true, align: "center", }, { field: "model", - width: '10%', + width: '8%', title: "规格型号", unresize: true, align: "center", }, + { + field: "unit", + title: "平均单价(元)", + width: '9%', + unresize: true, + align: "center", + }, { field: "unit", title: "单位", @@ -147,10 +137,20 @@ function initTable() { unresize: true, align: "center", }, + { + field: "unit", + title: "库存量", + width: '8%', + unresize: true, + align: "center", + templet: function (d) { + return '1'; + }, + }, { field: "num", width: '10%', - title: " * 本次入库量", + title: " * 本次盘点量", unresize: true, align: "center", edit: 'text', @@ -158,24 +158,25 @@ function initTable() { }, { field: "price", - width: '9.8%', - title: "单价(元)", + width: '10%', + title: " * 盘盈量", unresize: true, align: "center", edit: 'text', style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { - field: "manufacturer", - width: '15%', - title: " * 配件厂家", + field: " * price", + width: '10%', + title: "盘亏量", unresize: true, align: "center", - templet: '#TPL-select-demo' + edit: 'text', + style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { field: "remarks", - width: '12%', + width: '10%', title: "备注", unresize: true, align: "center", @@ -369,7 +370,7 @@ 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/js/accessory/child/inventory_count_form.js b/js/accessory/child/inventory_count_form.js index 7c37507..2a2dd6f 100644 --- a/js/accessory/child/inventory_count_form.js +++ b/js/accessory/child/inventory_count_form.js @@ -2,7 +2,6 @@ let idParam, objParam, fileList = new Array(), imgListUp = new Array(); let form, laydate, layer, upload, table, util; let pageNum = 1, tableIns; // 定义分页 let jjDataArr = []; // 入库配件数据 -let cjList = []; // 厂家下拉选 let delIdArr = []; function setParams(obj) { objParam = JSON.parse(obj); @@ -54,7 +53,6 @@ function setParams(obj) { }); } }); - getVendList(); }); } // 设置文件类型 @@ -290,7 +288,9 @@ function setTableData(results) { html += "" + l.type + ""; html += "" + l.name + ""; html += "" + l.model + ""; + html += "" + l.model + ""; html += "" + l.unit + ""; + html += "" + l.unit + ""; html += "" + setFormInput(l.num, 1) + ""; html += "" + setFormInput(l.price, 2) + ""; html += "" + setFormInput(l.manufacturer, 3) + ""; @@ -311,9 +311,7 @@ function setFormInput(value, type) { } else if (type === 2) { // 单价 html += ''; } else if (type === 3) { // 厂家 - html += ''; + html += ''; } else if (type === 4) { // 备注 html += ''; } @@ -322,35 +320,6 @@ function setFormInput(value, type) { } -function setSelectData(value) { - let html = ''; - $.each(cjList, function (index, item) { - if (item.id === value) { - html += '' - } else { - html += '' - } - - }) - return html; -} - -// 厂家下拉选 -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 selectAll(selectStatus) {//传入参数(全选框的选中状态) if (selectStatus) { diff --git a/js/accessory/inventory_count_list.js b/js/accessory/inventory_count_list.js index d2de427..e73a337 100644 --- a/js/accessory/inventory_count_list.js +++ b/js/accessory/inventory_count_list.js @@ -114,6 +114,9 @@ function initTable() { title: "盘点数量变化", unresize: true, align: "center", + templet: function (d) { + return setInventory(100,200); + }, }, { field: "remark", @@ -145,18 +148,18 @@ function initTable() { }); } -// 状态颜色 -function setStatusColor(value) { - value = value ? parseInt(value) : 0; - let color = ""; - let name = '' - if (value === '0') { - color = "#f56c6c"; - name = '否'; - } else { - name = '是'; +// 设置盘点数量变化 +function setInventory(value, value2) { + if (value === 0 || value2 === 0) { + return '0'; + }else if (value > 0 && value2 > 0) { + return '盘盈:' + value + '
盘亏:' + value2 + ''; + }else if (value > 0 && value2 === 0) { + return '盘盈:' + value + ''; + }else if (value === 0 && value2 > 0) { + return '盘亏:' + value2 + ''; } - return '' + name + ""; + } // 导出 @@ -170,7 +173,7 @@ function exportExcel() { } // 库存盘点 -function inventoryCount(obj){ +function inventoryCount(obj) { openIframeByParamObj("inventory_count", "库存盘点", "./child/inventory_count_form.html", "92%", "95%", obj); } diff --git a/page/accessory/child/choose_inventory_count_fit_type_list.html b/page/accessory/child/choose_inventory_count_fit_type_list.html index 06d0f2c..b37ae47 100644 --- a/page/accessory/child/choose_inventory_count_fit_type_list.html +++ b/page/accessory/child/choose_inventory_count_fit_type_list.html @@ -85,14 +85,6 @@ - diff --git a/page/accessory/child/inventory_count_form.html b/page/accessory/child/inventory_count_form.html index c0d4101..4b92e79 100644 --- a/page/accessory/child/inventory_count_form.html +++ b/page/accessory/child/inventory_count_form.html @@ -100,6 +100,16 @@ +
+
+

盘盈:653

+

¥ 15,653

+
+
+

盘亏:120

+

¥ 12,120

+
+
@@ -112,14 +122,16 @@ 序号 - 配件类型 - 配件名称 - 规格型号 - 单位 - * 本次入库量 - 单价(元) - * 配件厂家 - 备注 + 配件类型 + 配件名称 + 规格型号 + 平均单价(元) + 单位 + 库存量 + * 本次盘点量 + *盘盈量 + *盘亏量 + 备注