From fba06b0e2fb063ff39cc4628cccfa705abec6604 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 23 Apr 2023 20:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=89=98=E7=AE=A1=E5=88=B0=E8=A1=A8=E5=8D=95=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/erpcommon/loadStock.js | 2 +- .../js/purchaseOrder/purchaseOrderList.js | 2 - .../template/js/purchasePut/purchasePutAdd.js | 215 ------------- .../js/purchasePut/purchasePutDetails.js | 50 --- .../js/purchasePut/purchasePutEdit.js | 299 ------------------ .../js/purchasePut/purchasePutList.js | 151 +++------ .../storeHouseInventoryList.js | 5 +- .../tpl/purchasePut/purchasePutAdd.html | 134 -------- .../tpl/purchasePut/purchasePutDetails.html | 213 ------------- .../tpl/purchasePut/purchasePutEdit.html | 135 -------- .../tpl/purchasePut/purchasePutList.html | 63 +--- .../lib/layui/customer/skyeye/dsFormUtil.js | 2 +- 12 files changed, 64 insertions(+), 1207 deletions(-) delete mode 100644 erp/src/main/resources/template/js/purchasePut/purchasePutAdd.js delete mode 100644 erp/src/main/resources/template/js/purchasePut/purchasePutDetails.js delete mode 100644 erp/src/main/resources/template/js/purchasePut/purchasePutEdit.js delete mode 100644 erp/src/main/resources/template/tpl/purchasePut/purchasePutAdd.html delete mode 100644 erp/src/main/resources/template/tpl/purchasePut/purchasePutDetails.html delete mode 100644 erp/src/main/resources/template/tpl/purchasePut/purchasePutEdit.html diff --git a/erp/src/main/resources/template/js/erpcommon/loadStock.js b/erp/src/main/resources/template/js/erpcommon/loadStock.js index 9b12dc704..9fb38ba0a 100644 --- a/erp/src/main/resources/template/js/erpcommon/loadStock.js +++ b/erp/src/main/resources/template/js/erpcommon/loadStock.js @@ -137,7 +137,7 @@ function initChooseProductBtnEnent (form, callback, calcPriceCallback) { // 获取表格行号 var thisRowKey = trId.replace("tr", ""); // 产品名称赋值 - $("#materialId" + thisRowKey).val(chooseProductMation.name + "(" + chooseProductMation.model + ")"); + $("#materialId" + thisRowKey).val(chooseProductMation.name); $("#materialId" + thisRowKey).attr(initTableChooseUtil.chooseInputDataIdKey, chooseProductMation.id); // 规格赋值 $("#normsId" + thisRowKey).html(getDataUseHandlebars(selOptionHtml, {rows: chooseProductMation.materialNorms})); diff --git a/erp/src/main/resources/template/js/purchaseOrder/purchaseOrderList.js b/erp/src/main/resources/template/js/purchaseOrder/purchaseOrderList.js index ceeaa5c78..f5065b98d 100644 --- a/erp/src/main/resources/template/js/purchaseOrder/purchaseOrderList.js +++ b/erp/src/main/resources/template/js/purchaseOrder/purchaseOrderList.js @@ -95,7 +95,6 @@ layui.config({ // 编辑 function edit(data) { - rowId = data.id; _openNewWindows({ url: systemCommonUtil.getUrl('FP2023042000002&id=' + data.id, null), title: systemLanguage["com.skyeye.editPageTitle"][languageType], @@ -109,7 +108,6 @@ layui.config({ // 详情 function details(data) { - rowId = data.id; _openNewWindows({ url: systemCommonUtil.getUrl('FP2023042000003&id=' + data.id, null), title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], diff --git a/erp/src/main/resources/template/js/purchasePut/purchasePutAdd.js b/erp/src/main/resources/template/js/purchasePut/purchasePutAdd.js deleted file mode 100644 index 30c25c6f2..000000000 --- a/erp/src/main/resources/template/js/purchasePut/purchasePutAdd.js +++ /dev/null @@ -1,215 +0,0 @@ - -// 根据那一列的值进行变化,默认根据数量 -var showTdByEdit = 'rkNum'; - -// 兼容动态表单 -var layedit, form; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'laydate', 'textool'].concat(dsFormUtil.mastHaveImport), function(exports) { - winui.renderColor(); - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$, - laydate = layui.laydate, - textool = layui.textool; - var serviceClassName = sysServiceMation["putIsPurchase"]["key"]; - - layedit = layui.layedit, - form = layui.form; - - var inoutitemHtml = "";//支出项目 - - var selOption = getFileContent('tpl/template/select-option.tpl'); - // 已经选择的商品集合key:表格的行trId,value:商品信息 - var allChooseProduct = {}; - - // 获取单据提交类型 - var submitType = erpOrderUtil.getSubmitTypeByKey(serviceClassName); - - // 单据时间 - laydate.render({elem: '#operTime', type: 'datetime', value: getFormatDate(), trigger: 'click'}); - - textool.init({eleId: 'remark', maxlength: 200}); - - // 初始化账户 - systemCommonUtil.getSysAccountListByType(function (json) { - $("#accountId").html(getDataUseHandlebars(selOption, json)); - }); - - // 初始化支出项目 - systemCommonUtil.getSysInoutitemListByType(2, function (json) { - inoutitemHtml = getDataUseHandlebars(selOption, json); - }); - - // 初始化仓库 - erpOrderUtil.getDepotList(function (json){ - $("#depotId").html(getDataUseHandlebars(selOption, json)); - }); - - // 商品 - initTableChooseUtil.initTable({ - id: "productList", - cols: [ - {id: 'materialId', title: '商品(型号)', formType: 'chooseInput', width: '150', iconClassName: 'chooseProductBtn', verify: 'required'}, - {id: 'mUnitId', title: '单位', formType: 'select', width: '50', verify: 'required', layFilter: 'selectUnitProperty'}, - {id: 'allStock', title: '库存', formType: 'detail', width: '80'}, - {id: 'rkNum', title: '数量', formType: 'input', width: '80', className: 'change-input rkNum', verify: 'required|number', value: '1'}, - {id: 'unitPrice', title: '单价', formType: 'input', width: '80', className: 'change-input unitPrice', verify: 'required|money'}, - {id: 'amountOfMoney', title: '金额', formType: 'input', width: '80', className: 'change-input amountOfMoney', verify: 'required|money'}, - {id: 'taxRate', title: '税率(%)', formType: 'input', width: '80', className: 'change-input taxRate', verify: 'required|double', value: '0.00'}, - {id: 'taxMoney', title: '税额', formType: 'input', width: '80', className: 'change-input taxMoney', verify: 'required|money'}, - {id: 'taxUnitPrice', title: '含税单价', formType: 'input', width: '80', className: 'change-input taxUnitPrice', verify: 'required|money'}, - {id: 'taxLastMoney', title: '合计价税', formType: 'input', width: '80', className: 'change-input taxLastMoney', verify: 'required|money'}, - {id: 'remark', title: '备注', formType: 'input', width: '100'} - ], - deleteRowCallback: function (trcusid) { - delete allChooseProduct[trcusid]; - // 计算价格 - calculatedTotalPrice(); - }, - addRowCallback: function (trcusid) { - // 设置根据某列变化的颜色 - $("." + showTdByEdit).parent().css({'background-color': '#e6e6e6'}); - }, - form: form, - minData: 1 - }); - - // 其他费用 - initTableChooseUtil.initTable({ - id: "otherPriceTableList", - cols: [ - {id: 'inoutitemId', title: '支出项目', formType: 'select', width: '120', verify: 'required', modelHtml: inoutitemHtml}, - {id: 'otherPrice', title: '费用合计:0.00', formType: 'input', width: '120', className: 'otherPrice', verify: 'required|money', colHeaderId: 'otherPriceTotal'} - ], - deleteRowCallback: function (trcusid) { - calculationPrice(); - }, - addRowCallback: function (trcusid) { - calculationPrice(); - }, - form: form - }); - - // 加载动态表单 - dsFormUtil.loadPageByCode("dsFormShow", serviceClassName, null); - - matchingLanguage(); - - // 商品规格加载变化事件 - mUnitChangeEvent(form, allChooseProduct, "estimatePurchasePrice"); - - // 仓库变化事件 - form.on('select(depotId)', function(data) { - loadMaterialDepotStockByDepotId(data.value); - }); - - // 保存为草稿 - form.on('submit(formAddBean)', function(data) { - if(winui.verifyForm(data.elem)) { - saveData("1", ""); - } - return false; - }); - - // 走工作流的提交审批 - form.on('submit(formSubOneBean)', function(data) { - if(winui.verifyForm(data.elem)) { - activitiUtil.startProcess(serviceClassName, null, function (approvalId) { - saveData("2", approvalId); - }); - } - return false; - }); - - // 不走工作流的提交 - form.on('submit(formSubTwoBean)', function(data) { - if(winui.verifyForm(data.elem)) { - saveData("2", ""); - } - return false; - }); - - function saveData(subType, approvalId) { - var result = initTableChooseUtil.getDataList('productList'); - if (!result.checkResult) { - return false; - } - var noError = false; - var tableData = []; - $.each(result.dataList, function(i, item) { - //获取行编号 - var thisRowKey = item["trcusid"].replace("tr", ""); - if (parseInt(item.rkNum) == 0) { - $("#rkNum" + thisRowKey).addClass("layui-form-danger"); - $("#rkNum" + thisRowKey).focus(); - winui.window.msg('数量不能为0', {icon: 2, time: 2000}); - noError = true; - return false; - } - //商品对象 - var material = allChooseProduct["tr" + thisRowKey]; - if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) { - winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); - noError = true; - return false; - } - item["materialId"] = material.materialId; - item["depotId"] = $("#depotId").val(); - tableData.push(item); - }); - if (noError) { - return false; - } - - // 其他费用 - var otherPriceResult = initTableChooseUtil.getDataList('otherPriceTableList'); - var otherMoney = 0; - $.each(otherPriceResult.dataList, function(i, item) { - otherMoney += parseFloat(isNull(item.otherPrice) ? 0 : item.otherPrice); - }); - - var params = { - supplierId: sysSupplierUtil.supplierMation.id, - operTime: $("#operTime").val(), - accountId: $("#accountId").val(), - payType: $("#payType").val(), - remark: $("#remark").val(), - discount: isNull($("#discount").val()) ? "0.00" : $("#discount").val(), - discountMoney: isNull($("#discountMoney").val()) ? "0.00" : $("#discountMoney").val(), - changeAmount: isNull($("#changeAmount").val()) ? "0.00" : $("#changeAmount").val(), - depotheadStr: JSON.stringify(tableData), - otherMoney: otherMoney.toFixed(2), - otherMoneyList: JSON.stringify(otherPriceResult.dataList), - submitType: submitType, - subType: subType, - approvalId: approvalId - }; - AjaxPostUtil.request({url: flowableBasePath + "purchaseput002", params: params, type: 'json', method: "POST", callback: function(json) { - dsFormUtil.savePageData("dsFormShow", json.bean.id); - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - - // 供应商选择 - $("body").on("click", "#supplierNameSel", function (e) { - sysSupplierUtil.openSysSupplierChoosePage(function (supplierMation){ - $("#supplierName").val(supplierMation.supplierName); - }); - }); - - // 加载商品选择事件 - initChooseProductBtnEnent(form, function(trId, chooseProductMation) { - // 商品赋值 - allChooseProduct[trId] = chooseProductMation; - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); -}); \ No newline at end of file diff --git a/erp/src/main/resources/template/js/purchasePut/purchasePutDetails.js b/erp/src/main/resources/template/js/purchasePut/purchasePutDetails.js deleted file mode 100644 index 38bfe6fc0..000000000 --- a/erp/src/main/resources/template/js/purchasePut/purchasePutDetails.js +++ /dev/null @@ -1,50 +0,0 @@ -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'jqprint'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - var beanTemplate = $("#beanTemplate").html(); - - showGrid({ - id: "showForm", - url: flowableBasePath + "erpcommon001", - params: {rowId: parent.rowId}, - pagination: false, - template: beanTemplate, - ajaxSendAfter:function (json) { - $("#statusName").html(activitiUtil.showStateName(json.bean.state, json.bean.submitType)); - - var str = '无'; - var defaultNumber = json.bean.defaultNumber; - if (!isNull(json.bean.linkNumber)){ - str = '' + json.bean.linkNumber + ''; - defaultNumber += '[转]'; - } - $("#linkNumber").html(str); - $("#defaultNumber").html(defaultNumber); - - // 加载动态表单 - dsFormUtil.loadPageShowDetailsByObjectId("dsFormShow", json.bean.id); - - matchingLanguage(); - form.render(); - } - }); - - // 打印 - $("body").on("click", "#jprint", function (e) { - $("#showForm").jqprint({ - title: sysMainMation.mationTitle, - debug: false, //如果是true则可以显示iframe查看效果(iframe默认高和宽都很小,可以再源码中调大),默认是false - importCSS: true, //true表示引进原来的页面的css,默认是true。(如果是true,先会找$("link[media=print]"),若没有会去找$("link")中的css文件) - printContainer: true, //表示如果原来选择的对象必须被纳入打印(注意:设置为false可能会打破你的CSS规则)。 - operaSupport: true//表示如果插件也必须支持歌opera浏览器,在这种情况下,它提供了建立一个临时的打印选项卡。默认是true - }); - }); - }); -}); \ No newline at end of file diff --git a/erp/src/main/resources/template/js/purchasePut/purchasePutEdit.js b/erp/src/main/resources/template/js/purchasePut/purchasePutEdit.js deleted file mode 100644 index f9afbfad3..000000000 --- a/erp/src/main/resources/template/js/purchasePut/purchasePutEdit.js +++ /dev/null @@ -1,299 +0,0 @@ - -//根据那一列的值进行变化,默认根据数量 -var showTdByEdit = 'rkNum'; - -// 兼容动态表单 -var layedit, form; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'laydate', 'textool'].concat(dsFormUtil.mastHaveImport), function(exports) { - winui.renderColor(); - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$, - laydate = layui.laydate, - textool = layui.textool; - var serviceClassName = sysServiceMation["putIsPurchase"]["key"]; - - layedit = layui.layedit, - form = layui.form; - - var inoutitemHtml = "";//支出项目 - - var selOption = getFileContent('tpl/template/select-option.tpl'); - //已经选择的商品集合key:表格的行trId,value:商品信息 - var allChooseProduct = {}; - - // 获取单据提交类型 - var submitType = ""; - - // 单据时间 - laydate.render({elem: '#operTime', type: 'datetime', trigger: 'click'}); - - // 初始化账户 - systemCommonUtil.getSysAccountListByType(function (json) { - $("#accountId").html(getDataUseHandlebars(selOption, json)); - }); - - // 初始化支出项目 - systemCommonUtil.getSysInoutitemListByType(2, function (json) { - inoutitemHtml = getDataUseHandlebars(selOption, json); - }); - - // 初始化仓库 - erpOrderUtil.getDepotList(function (json){ - $("#depotId").html(getDataUseHandlebars(selOption, json)); - // 初始化回显数据 - initDataShow(); - }); - - // 初始化回显数据 - function initDataShow(){ - AjaxPostUtil.request({url: flowableBasePath + "purchaseput003", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function(json) { - submitType = json.bean.submitType; - // 供应商信息赋值 - sysSupplierUtil.supplierMation = { - id: json.bean.organId, - supplierName: json.bean.supplierName - } - - $("#supplierName").val(json.bean.supplierName);//供应商 - $("#operTime").val(json.bean.operTime); - $("#accountId").val(json.bean.accountId); - $("#payType").val(json.bean.payType); - $("#allPrice").html(json.bean.totalPrice.toFixed(2)); - $("#taxLastMoneyPrice").html(json.bean.taxLastMoneyPrice.toFixed(2)); - $("#remark").val(json.bean.remark); - $("#discount").val(json.bean.discount.toFixed(2)); - $("#discountMoney").val(json.bean.discountMoney.toFixed(2)); - $("#discountLastMoney").html(json.bean.discountLastMoney.toFixed(2)); - $("#changeAmount").val(json.bean.changeAmount.toFixed(2)); - $("#arrears").html(json.bean.arrears.toFixed(2)); - $("#otherPriceTotal").html("费用合计:" + json.bean.otherMoney.toFixed(2)); - - initTable(); - - // 回显商品列表 - initTableChooseUtil.deleteAllRow('productList'); - $.each(json.bean.norms, function(i, item) { - if (i == 0) { - $("#depotId").val(item.depotId); - } - var params = { - "materialId": item.product.materialName + "(" + item.product.materialModel + ")", - "mUnitId": { - "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), - "value": item.mUnitId - }, - "allStock": item.allStock, - "rkNum": item.operNum, - "unitPrice": item.unitPrice.toFixed(2), - "amountOfMoney": item.allPrice.toFixed(2), - "taxRate": item.taxRate.toFixed(2), - "taxMoney": item.taxMoney.toFixed(2), - "taxUnitPrice": item.taxUnitPrice.toFixed(2), - "taxLastMoney": item.taxLastMoney.toFixed(2), - "remark": item.remark - }; - var trcusid = initTableChooseUtil.resetData('productList', params); - // 将规格所属的商品信息加入到对象中存储 - allChooseProduct[trcusid] = item.product; - }); - - // 回显其他费用 - initTableChooseUtil.deleteAllRow('otherPriceTableList'); - $.each(json.bean.otherMoneyList, function(i, item) { - var params = { - "inoutitemId": { - "value": item.inoutitemId - }, - "otherPrice": parseFloat(item.otherPrice).toFixed(2) - }; - initTableChooseUtil.resetData('otherPriceTableList', params); - }); - - erpOrderUtil.orderEditPageSetBtnBySubmitType(submitType, json.bean.state); - - textool.init({eleId: 'remark', maxlength: 200}); - - // 加载动态表单 - dsFormUtil.loadPageToEditByObjectId("dsFormShow", json.bean.id); - - matchingLanguage(); - form.render(); - }}); - } - - function initTable() { - // 商品 - initTableChooseUtil.initTable({ - id: "productList", - cols: [ - {id: 'materialId', title: '商品(型号)', formType: 'chooseInput', width: '150', iconClassName: 'chooseProductBtn', verify: 'required'}, - {id: 'mUnitId', title: '单位', formType: 'select', width: '50', verify: 'required', layFilter: 'selectUnitProperty'}, - {id: 'allStock', title: '库存', formType: 'detail', width: '80'}, - {id: 'rkNum', title: '数量', formType: 'input', width: '80', className: 'change-input rkNum', verify: 'required|number', value: '1'}, - {id: 'unitPrice', title: '单价', formType: 'input', width: '80', className: 'change-input unitPrice', verify: 'required|money'}, - {id: 'amountOfMoney', title: '金额', formType: 'input', width: '80', className: 'change-input amountOfMoney', verify: 'required|money'}, - {id: 'taxRate', title: '税率(%)', formType: 'input', width: '80', className: 'change-input taxRate', verify: 'required|double', value: '0.00'}, - {id: 'taxMoney', title: '税额', formType: 'input', width: '80', className: 'change-input taxMoney', verify: 'required|money'}, - {id: 'taxUnitPrice', title: '含税单价', formType: 'input', width: '80', className: 'change-input taxUnitPrice', verify: 'required|money'}, - {id: 'taxLastMoney', title: '合计价税', formType: 'input', width: '80', className: 'change-input taxLastMoney', verify: 'required|money'}, - {id: 'remark', title: '备注', formType: 'input', width: '100'} - ], - deleteRowCallback: function (trcusid) { - delete allChooseProduct[trcusid]; - // 计算价格 - calculatedTotalPrice(); - }, - addRowCallback: function (trcusid) { - // 设置根据某列变化的颜色 - $("." + showTdByEdit).parent().css({'background-color': '#e6e6e6'}); - calculatedTotalPrice(); - }, - form: form, - minData: 1 - }); - - // 其他费用 - initTableChooseUtil.initTable({ - id: "otherPriceTableList", - cols: [ - {id: 'inoutitemId', title: '支出项目', formType: 'select', width: '120', verify: 'required', modelHtml: inoutitemHtml}, - {id: 'otherPrice', title: '费用合计:0.00', formType: 'input', width: '120', className: 'otherPrice', verify: 'required|money', colHeaderId: 'otherPriceTotal'} - ], - deleteRowCallback: function (trcusid) { - calculationPrice(); - }, - addRowCallback: function (trcusid) { - calculationPrice(); - }, - form: form - }); - } - - // 商品规格加载变化事件 - mUnitChangeEvent(form, allChooseProduct, "estimatePurchasePrice"); - - // 仓库变化事件 - form.on('select(depotId)', function(data) { - loadMaterialDepotStockByDepotId(data.value); - }); - - // 保存为草稿 - form.on('submit(formEditBean)', function(data) { - if(winui.verifyForm(data.elem)) { - saveData('1', ""); - } - return false; - }); - - // 走工作流的提交审批 - form.on('submit(formSubOneBean)', function(data) { - if(winui.verifyForm(data.elem)) { - activitiUtil.startProcess(serviceClassName, null, function (approvalId) { - saveData("2", approvalId); - }); - } - return false; - }); - - // 不走工作流的提交 - form.on('submit(formSubTwoBean)', function(data) { - if(winui.verifyForm(data.elem)) { - saveData('2', ""); - } - return false; - }); - - // 工作流中保存 - form.on('submit(save)', function(data) { - if(winui.verifyForm(data.elem)) { - saveData('3', ""); - } - return false; - }); - - function saveData(subType, approvalId) { - var result = initTableChooseUtil.getDataList('productList'); - if (!result.checkResult) { - return false; - } - var noError = false; - var tableData = []; - $.each(result.dataList, function(i, item) { - //获取行编号 - var thisRowKey = item["trcusid"].replace("tr", ""); - if (parseInt(item.rkNum) == 0) { - $("#rkNum" + thisRowKey).addClass("layui-form-danger"); - $("#rkNum" + thisRowKey).focus(); - winui.window.msg('数量不能为0', {icon: 2, time: 2000}); - noError = true; - return false; - } - //商品对象 - var material = allChooseProduct["tr" + thisRowKey]; - if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) { - winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); - noError = true; - return false; - } - item["materialId"] = material.materialId; - item["depotId"] = $("#depotId").val(); - tableData.push(item); - }); - if (noError) { - return false; - } - - // 其他费用 - var otherPriceResult = initTableChooseUtil.getDataList('otherPriceTableList'); - var otherMoney = 0; - $.each(otherPriceResult.dataList, function(i, item) { - otherMoney += parseFloat(isNull(item.otherPrice) ? 0 : item.otherPrice); - }); - - var params = { - supplierId: sysSupplierUtil.supplierMation.id, - operTime: $("#operTime").val(), - accountId: $("#accountId").val(), - payType: $("#payType").val(), - remark: $("#remark").val(), - discount: isNull($("#discount").val()) ? "0.00" : $("#discount").val(), - discountMoney: isNull($("#discountMoney").val()) ? "0.00" : $("#discountMoney").val(), - changeAmount: isNull($("#changeAmount").val()) ? "0.00" : $("#changeAmount").val(), - depotheadStr: JSON.stringify(tableData), - otherMoney: otherMoney.toFixed(2), - otherMoneyList: JSON.stringify(otherPriceResult.dataList), - subType: subType, - submitType: submitType, - approvalId: approvalId, - rowId: parent.rowId - }; - AjaxPostUtil.request({url: flowableBasePath + "purchaseput004", params: params, type: 'json', method: "PUT", callback: function(json) { - dsFormUtil.savePageData("dsFormShow", json.bean.id); - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - - // 供应商选择 - $("body").on("click", "#supplierNameSel", function (e) { - sysSupplierUtil.openSysSupplierChoosePage(function (supplierMation){ - $("#supplierName").val(supplierMation.supplierName); - }); - }); - - // 加载商品选择事件 - initChooseProductBtnEnent(form, function(trId, chooseProductMation) { - // 商品赋值 - allChooseProduct[trId] = chooseProductMation; - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); -}); \ No newline at end of file diff --git a/erp/src/main/resources/template/js/purchasePut/purchasePutList.js b/erp/src/main/resources/template/js/purchasePut/purchasePutList.js index febf9ad11..c1519b86a 100644 --- a/erp/src/main/resources/template/js/purchasePut/purchasePutList.js +++ b/erp/src/main/resources/template/js/purchasePut/purchasePutList.js @@ -6,67 +6,55 @@ layui.config({ version: skyeyeVersion }).extend({ window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate', 'soulTable'], function (exports) { +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { winui.renderColor(); var $ = layui.$, form = layui.form, - laydate = layui.laydate, - soulTable = layui.soulTable, table = layui.table; var serviceClassName = sysServiceMation["putIsPurchase"]["key"]; authBtn('1571813042536');//新增 - authBtn('1571988895735');//导出 - - laydate.render({elem: '#operTime', range: '~'}); - + table.render({ id: 'messageTable', elem: '#messageTable', method: 'post', - url: flowableBasePath + 'purchaseput001', + url: sysMainMation.erpBasePath + 'purchaseput001', where: getTableParams(), even: true, page: true, limits: getLimits(), limit: getLimit(), - overflow: { - type: 'tips', - hoverTime: 300, // 悬停时间,单位ms, 悬停 hoverTime 后才会显示,默认为 0 - minWidth: 150, // 最小宽度 - maxWidth: 500 // 最大宽度 - }, cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers' }, - { field: 'defaultNumber', title: '单据编号', align: 'left', rowspan: '2', width: 220, templet: function (d) { - var str = '' + d.defaultNumber + ''; + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, + { field: 'oddNumber', title: '单号', align: 'left', width: 220, templet: function (d) { + var str = '' + d.oddNumber + ''; if (!isNull(d.linkNumber)){ str += '[转]'; } return str; }}, - { field: 'supplierName', title: '供应商', align: 'left', rowspan: '2', width: 150 }, - { title: '审批模式', align: 'center', colspan: '2'}, - { field: 'state', title: '状态', align: 'left', rowspan: '2', width: 80, templet: function (d) { - return activitiUtil.showStateName(d.state, d.submitType); - }}, - { field: 'totalPrice', title: '合计金额', align: 'left', rowspan: '2', width: 120}, - { field: 'taxMoney', title: '含税合计', align: 'left', rowspan: '2', width: 120 }, - { field: 'discountLastMoney', title: '优惠后金额', align: 'left', rowspan: '2', width: 120 }, - { field: 'changeAmount', title: '付款', align: 'left', rowspan: '2', width: 120 }, - { field: 'operPersonName', title: '操作人', align: 'left', rowspan: '2', width: 100}, - { field: 'operTime', title: '单据日期', align: 'center', rowspan: '2', width: 140 }, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', rowspan: '2', width: 200, toolbar: '#tableBar'} - ],[ - { field: 'submitType', title: '提交模式', align: 'left', width: 120, templet: function (d) { - return erpOrderUtil.getSubmitTypeName(d); + { field: 'holderMation', title: '供应商', align: 'left', width: 150, templet: function (d) { + return d.holderMation.name; + }}, + { field: 'totalPrice', title: '合计金额', align: 'left', width: 120 }, + { field: 'operTime', title: '单据日期', align: 'center', width: 140 }, + { field: 'processInstanceId', title: '流程ID', width: 100, templet: function (d) { + return '' + d.processInstanceId + ''; }}, - { field: 'processInstanceId', title: '流程实例id', align: 'left', width: 120, templet: function (d) { - return erpOrderUtil.getProcessInstanceIdBySubmitType(d); - }} + { field: 'state', title: '状态', width: 90, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("flowableStateEnum", 'id', d.state, 'name'); + }}, + { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, + { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'} ]], done: function(json) { matchingLanguage(); - soulTable.render(this); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入单号", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); } }); @@ -74,16 +62,18 @@ layui.config({ var data = obj.data; var layEvent = obj.event; if (layEvent === 'delete') { //删除 - deleteOrder(data); + erpOrderUtil.deleteOrderMation(data.id, serviceClassName, function() { + loadTable(); + }); } else if (layEvent === 'details') { //详情 details(data); } else if (layEvent === 'edit') { //编辑 edit(data); - } else if (layEvent === 'submitToSave') { //提交 - subExamine(data); - } else if (layEvent === 'subExamine') { //提交审核 - subExamine(data); - } else if (layEvent === 'activitiProcessDetails') { // 工作流流程详情查看 + } else if (layEvent === 'subApproval') { //提交 + erpOrderUtil.submitOrderMation(data.id, serviceClassName, function() { + loadTable(); + }); + } else if (layEvent === 'processDetails') { // 工作流流程详情查看 activitiUtil.activitiDetails(data); } else if (layEvent === 'revoke') { //撤销 erpOrderUtil.revokeOrderMation(data.processInstanceId, serviceClassName, function() { @@ -92,33 +82,24 @@ layui.config({ } }); - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - refreshTable(); - } - return false; + // 添加 + $("body").on("click", "#addBean", function() { + _openNewWindows({ + url: systemCommonUtil.getUrl('FP2023042300001', null), + title: systemLanguage["com.skyeye.addPageTitle"][languageType], + pageId: "purchasePutAdd", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); }); - // 删除 - function deleteOrder(data) { - erpOrderUtil.deleteOrderMation(data.id, serviceClassName, function() { - loadTable(); - }); - } - - // 提交数据 - function subExamine(data) { - erpOrderUtil.submitOrderMation(data.id, serviceClassName, data.submitType, serviceClassName, function() { - loadTable(); - }); - } - // 编辑 function edit(data) { rowId = data.id; _openNewWindows({ - url: "../../tpl/purchasePut/purchasePutEdit.html", + url: systemCommonUtil.getUrl('FP2023042300002&id=' + data.id, null), title: systemLanguage["com.skyeye.editPageTitle"][languageType], pageId: "purchasePutEdit", area: ['90vw', '90vh'], @@ -132,7 +113,7 @@ layui.config({ function details(data) { rowId = data.id; _openNewWindows({ - url: "../../tpl/purchasePut/purchasePutDetails.html", + url: systemCommonUtil.getUrl('FP2023042300003&id=' + data.id, null), title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], pageId: "purchasePutDetails", area: ['90vw', '90vh'], @@ -140,54 +121,16 @@ layui.config({ }}); } - // 添加 - $("body").on("click", "#addBean", function() { - _openNewWindows({ - url: "../../tpl/purchasePut/purchasePutAdd.html", - title: systemLanguage["com.skyeye.addPageTitle"][languageType], - pageId: "purchasePutAdd", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - + form.render(); $("body").on("click", "#reloadTable", function() { loadTable(); }); - - // 刷新 function loadTable() { table.reloadData("messageTable", {where: getTableParams()}); } - // 搜索 - function refreshTable(){ - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}) - } - - // 导出excel - $("body").on("click", "#downloadExcel", function () { - postDownLoadFile({ - url : flowableBasePath + 'purchaseput005', - params: getTableParams(), - method : 'post' - }); - }); - function getTableParams() { - var startTime = ""; - var endTime = ""; - if (!isNull($("#operTime").val())) { - startTime = $("#operTime").val().split('~')[0].trim() + ' 00:00:00'; - endTime = $("#operTime").val().split('~')[1].trim() + ' 23:59:59'; - } - return { - defaultNumber: $("#defaultNumber").val(), - startTime: startTime, - endTime: endTime - }; + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); } exports('purchasePutList', {}); diff --git a/erp/src/main/resources/template/js/storeHouseInventory/storeHouseInventoryList.js b/erp/src/main/resources/template/js/storeHouseInventory/storeHouseInventoryList.js index 864e5ee12..51af289fb 100644 --- a/erp/src/main/resources/template/js/storeHouseInventory/storeHouseInventoryList.js +++ b/erp/src/main/resources/template/js/storeHouseInventory/storeHouseInventoryList.js @@ -20,10 +20,9 @@ layui.config({ var selOption = getFileContent('tpl/template/select-option-must.tpl'); initDepotHtml(); - //初始化仓库 + // 初始化仓库 function initDepotHtml() { - AjaxPostUtil.request({url: flowableBasePath + "storehouse009", params: {}, type: 'json', method: "GET", callback: function(json) { - //加载仓库数据 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "storehouse009", params: {}, type: 'json', method: "GET", callback: function(json) { $("#depotId").html(getDataUseHandlebars(selOption, json)); form.render(); if(json.rows.length > 0){ diff --git a/erp/src/main/resources/template/tpl/purchasePut/purchasePutAdd.html b/erp/src/main/resources/template/tpl/purchasePut/purchasePutAdd.html deleted file mode 100644 index d416f7d08..000000000 --- a/erp/src/main/resources/template/tpl/purchasePut/purchasePutAdd.html +++ /dev/null @@ -1,134 +0,0 @@ - - -
- -