| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
- <%@include file="/context/mytags.jsp" %>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <div class="easyui-layout" fit="true">
- <div region="center" style="padding:0px;border:0px">
- <t:datagrid name="tBMaterialList" checkbox="false" fitColumns="true" title="选择现存物料"
- actionUrl="tBMaterialController.do?materialStockOnHandDatagrid" fit="true"
- queryMode="group"
- sortName="createTime" sortOrder="desc">
- <t:dgCol title="货品id" field="goodsId" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="仓库" field="materialWarehouseId" query="true" dictionary="t_b_warehouse,id,warehouse_name, and delete_flag != '1' and `status` != '1' " queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="请求科室" field="materialDaptId" query="true" dictionary="t_s_depart,id,departname, and org_type != '1' " queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="货品名称" field="goodsName" query="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="规格型号" field="specification" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="货品基本单位" field="baseUnit" dictionary="metering_calcu_unit" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="现存量" field="stockOnHand" queryMode="group" width="120"></t:dgCol>
- <t:dgCol title="供应商" field="salesUnit" queryMode="group" width="120"></t:dgCol>
- <t:dgCol title="最新入库日期" field="lastPutTime" formatter="yyyy-MM-dd" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="最新出库日期" field="lastOutTime" formatter="yyyy-MM-dd" queryMode="single" width="120"></t:dgCol>
- </t:datagrid>
- </div>
- </div>
- <script type="text/javascript">
- $(() => {
- $('.datagrid-header-rownumber').append(`<span>序号</span>`)
- })
- //编写自定义JS代码获得输入框中的值等父级页面调用取值
- function getSelectRowsOnAdd() {
- var goodsId = "";
- var materialDaptId = "";
- var materialWarehouseId = "";
- var stockOnHand = "";
- var baseUnit = "";
- var goodsName = "";
- var selectRows = $("#tBMaterialList").datagrid('getSelections');
- if(selectRows.length == 0){
- alertTip("请先选择一个现存物料");
- return;
- }
- for (var i = 0; i < selectRows.length; i++) {
- for (var key in selectRows[i]) {
- if (key == "goodsId") {
- if (goodsId.length > 0) {
- goodsId += "," + selectRows[i][key];
- } else {
- goodsId = selectRows[i][key];
- }
- }
- if (key == "materialDaptId") {
- if (materialDaptId.length > 0) {
- materialDaptId += "," + selectRows[i][key];
- } else {
- materialDaptId = selectRows[i][key];
- }
- }
- if (key == "materialWarehouseId") {
- if (materialWarehouseId.length > 0) {
- materialWarehouseId += "," + selectRows[i][key];
- } else {
- materialWarehouseId = selectRows[i][key];
- }
- }
- if (key == "stockOnHand") {
- if (stockOnHand.length > 0) {
- stockOnHand += "," + selectRows[i][key];
- } else {
- stockOnHand = selectRows[i][key];
- }
- }
- if (key == "baseUnit") {
- if (baseUnit.length > 0) {
- baseUnit += "," + selectRows[i][key];
- } else {
- baseUnit = selectRows[i][key];
- }
- }
- if (key == "goodsName") {
- if (goodsName.length > 0) {
- goodsName += "," + selectRows[i][key];
- } else {
- goodsName = selectRows[i][key];
- }
- }
- }
- }
- var strData = '[{"goodsId":"' + goodsId + '","materialDaptId":"' + materialDaptId + '","materialWarehouseId":"' + materialWarehouseId + '","stockOnHand":"' + stockOnHand + '","baseUnit":"' + baseUnit + '","goodsName":"' + goodsName + '"}]';
- return strData;
- }
- </script>
|