初始版本
This commit is contained in:
236
src/main/webapp/WEB-INF/template/purchaseStock/list.html
Normal file
236
src/main/webapp/WEB-INF/template/purchaseStock/list.html
Normal file
@@ -0,0 +1,236 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
|
||||
<!--module="purchaseStock" moduleName="采购订单"-->
|
||||
<div class="appPage listPage">
|
||||
<h1 class="page-title">发货记录列表</h1>
|
||||
<h1 class="page-sub-title" th:text="|共${page.total}条记录|"></h1>
|
||||
<form id="listForm" th:action="|purchaseStock/list.html?pageType=${pageType}|" method="post">
|
||||
<input type="hidden" name="displayMode" th:value="${displayMode}">
|
||||
<div class="toolBar">
|
||||
<input hidden name="pageType" th:value="${pageType}"/>
|
||||
<shiro:hasPermission name="purchaseStock:add">
|
||||
<!-- <a data-permission="purchaseStock:add" class="btn activeBtn "-->
|
||||
<!-- href="javascript:Nav.go('purchaseStock/add.html')">添加订单-->
|
||||
<!-- </a>-->
|
||||
<!-- <a data-permission="purchaseStock:add" class="btn activeBtn "-->
|
||||
<!-- href="javascript:Dialog.functionDialog(null, null, 'purchaseStock/dialog/addLog.html');">-->
|
||||
<!-- 导入发货记录-->
|
||||
<!-- </a>-->
|
||||
<a data-permission="purchaseStock:add" class="btn activeBtn "
|
||||
href="javascript:Dialog.functionDialog(null, null, 'purchaseStock/dialog/importTemplate.html');">
|
||||
导入发货记录模板
|
||||
</a>
|
||||
</shiro:hasPermission>
|
||||
<a class="btn activeBtn "
|
||||
onclick="exportAll()">批量导出
|
||||
</a>
|
||||
<a class="btn" href="javascript:exportExcel('/admin/purchaseStock/exportList.html')">导出</a>
|
||||
<a class="btn refresh">刷新</a>
|
||||
<div class="toggle-wrapper" th:if="${session.systemSetting.showOrderToggle}" th:data-init="${displayMode}"
|
||||
data-change="toggleOrderDisplayMode">
|
||||
<span class="toggle-item" data-value="order">合同</span>
|
||||
<span class="toggle-item" data-value="detail">明细</span>
|
||||
</div>
|
||||
<div class="filter-wrapper"
|
||||
th:data-columns="displayMode == 'order' ? 'purchaseStock-table' : 'purchaseStock-item-table'">
|
||||
<th:block th:if="${!supplier}">
|
||||
<div class="filter-item" data-column="ownerId">
|
||||
<label>供应商:</label>
|
||||
<select class="filter-input" type="text" name="ownerId" th:data-init="${ownerId}">
|
||||
<option value="">全部</option>
|
||||
<option th:each="item : ${ownerList}" th:value="${item.id}" th:text="${item.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</th:block>
|
||||
<div class="filter-item" data-column="sn">
|
||||
<label>发货记录编号:</label>
|
||||
<input class="filter-input" type="text" name="sn" th:value="${sn}">
|
||||
</div>
|
||||
<!-- <div class="filter-item" data-column="status">-->
|
||||
<!-- <label>状态:</label>-->
|
||||
<!-- <select class="filter-select" name="status" th:data-init="${status}">-->
|
||||
<!-- <option value="">全部</option>-->
|
||||
<!-- <option th:each="item : ${statusList}" th:value="${item.name()}"-->
|
||||
<!-- th:text="${item.name}"></option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<div class="filter-item" data-column="createDate">
|
||||
<label>创建日期:</label>
|
||||
<input class="filter-date" type="text" name="createDateStart"
|
||||
th:value="${#dates.format(createDateStart, 'yyyy-MM-dd')}" readonly> -
|
||||
<input class="filter-date" type="text" name="createDateEnd"
|
||||
th:value="${#dates.format(createDateEnd, 'yyyy-MM-dd')}" readonly>
|
||||
</div>
|
||||
<div class="filter-item" data-column="purchaseOrderId">
|
||||
<label>合同:</label>
|
||||
<select class="filter-input" type="text" name="purchaseOrderId" th:data-init="${purchaseOrderId}">
|
||||
<option value="">全部</option>
|
||||
<option th:each="item : ${purchaseOrderList}" th:value="${item.id}" th:text="${item.sn}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<th:block th:if="${displayMode == 'detail'}">
|
||||
<div class="filter-item" data-column="productName">
|
||||
<label>产品:</label>
|
||||
<input class="filter-input" type="text" name="productName" th:value="${productName}">
|
||||
</div>
|
||||
</th:block>
|
||||
<a class="confirm-button">搜索</a>
|
||||
<a class="clear-filter">清除搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tableWrap">
|
||||
<th:block th:if="${displayMode == 'order'}">
|
||||
<table data-columns="purchaseStock-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="checkbox-col" data-column="#"><input class="checkbox" type="checkbox">
|
||||
</th>
|
||||
<th data-column="sn">发货记录编号</th>
|
||||
<th data-column="contractSn">合同编号</th>
|
||||
<th data-column="contractName">合同名称</th>
|
||||
<!-- <th data-column="adminName">制单人</th>-->
|
||||
<th data-column="ownerName">供应商</th>
|
||||
<th data-column="contractCount">合同数量</th>
|
||||
<th class="total-th" data-column="itemCount">发货数量</th>
|
||||
<th class="total-th" data-column="arrivedCount">已入库数量</th>
|
||||
<th data-column="stockRate">入库比例</th>
|
||||
<th class="sort-bar" data-column="createDate">创建时间</th>
|
||||
<th th:each="data : ${session.eField.list('purchaseStock')}"
|
||||
th:text="${data.name}" th:data-column="${data.fieldName}"></th>
|
||||
<th data-column="##" class="options fixed">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="purchaseStock : ${page.content}" th:id="${purchaseStock.id}"
|
||||
url="purchaseStock/delete.html">
|
||||
<td class="checkbox-col"><input class="checkbox" type="checkbox"
|
||||
th:data-id="${purchaseStock.id}">
|
||||
</td>
|
||||
<td th:text="${purchaseStock.sn}"></td>
|
||||
<td th:text="${poIdEntityMap[purchaseStock.id]?.sn}"></td>
|
||||
<td th:text="${poIdEntityMap[purchaseStock.id]?.name}"></td>
|
||||
<!-- <td th:text="${purchaseStock.adminName}"></td>-->
|
||||
<td th:text="${purchaseStock.ownerName}"></td>
|
||||
<td th:text="${poIdEntityMap[purchaseStock.id]?.totalCount}"></td>
|
||||
<td th:text="${purchaseStock.totalCount}"></td>
|
||||
<td th:text="${psIdStockMap[purchaseStock.id]}"></td>
|
||||
<td th:text="${#numbers.formatDecimal(psIdStockMap[purchaseStock.id]/poIdEntityMap[purchaseStock.id]?.totalCount*100,1,1)}+'%'"></td>
|
||||
<td th:text="${#dates.format(purchaseStock.createDate, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
<td th:each="data : ${session.eField.list('purchaseStock')}"
|
||||
th:text="${purchaseStock.extraField(data.fieldName)}"></td>
|
||||
<td class="fixed">
|
||||
<shiro:hasPermission name="purchaseStock:list">
|
||||
<a data-permission="purchaseStock:list"
|
||||
th:href="|javascript:Nav.go('purchaseStock/view.html?id=${purchaseStock.id}');|"> 查看</a>
|
||||
<!-- <a th:href="|javascript:Dialog.functionDialog(null, null, 'lossInfo/dialog/list.html?sn=${purchaseStock.sn}')|"> 损耗列表</a>-->
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="purchaseStock:edit">
|
||||
<th:block th:if="${pageType == null}">
|
||||
<a data-permission="purchaseStock:edit"
|
||||
th:href="|javascript:Nav.go('purchaseStock/edit.html?id=${purchaseStock.id}');|"> 编辑</a>
|
||||
</th:block>
|
||||
<th:block th:if="${pageType =='inStock'}">
|
||||
<a data-permission="purchaseStock:edit"
|
||||
th:href="|javascript:Nav.go('purchaseStock/inStock.html?id=${purchaseStock.id}');|"> 入库核对</a>
|
||||
</th:block>
|
||||
|
||||
<!-- <a th:href="|javascript:Dialog.functionDialog(null, null, 'lossInfo/dialog/list.html?sn=${purchaseStock.sn}')|"> 损耗列表</a>-->
|
||||
</shiro:hasPermission>
|
||||
<th:block th:if="${pageType == null}">
|
||||
<shiro:hasPermission name="purchaseStock:remove">
|
||||
<a data-permission="purchaseStock:remove"
|
||||
th:href="|javascript:deleteConfirm('${purchaseStock.id}','/admin/purchaseStock/delete.html');|"> 删除</a>
|
||||
</shiro:hasPermission>
|
||||
</th:block>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th:block>
|
||||
<th:block th:if="${displayMode == 'detail'}">
|
||||
<table data-columns="purchaseStock-item-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="checkbox-col" data-column="#"><input class="checkbox" type="checkbox">
|
||||
</th>
|
||||
<th data-column="sn" th:text="#{salesOrder.sn}"></th>
|
||||
<th data-column="productId">产品</th>
|
||||
<th data-column="price">价格</th>
|
||||
<th class="total-th" data-column="count">数量</th>
|
||||
<!-- <th data-column="gWeight">重量</th>-->
|
||||
<!-- <th data-column="pattern">型号</th>-->
|
||||
<!-- <th data-column="colour">颜色</th>-->
|
||||
<th th:each="data : ${session.eField.list('purchaseStockItem')}"
|
||||
th:text="${data.name}" th:data-column="${data.fieldName}"></th>
|
||||
<th th:each="data : ${session.eField.list('product')}"
|
||||
th:text="${data.name}"
|
||||
th:data-column="${data.fieldName.replaceAll('extra', 'product')}"></th>
|
||||
<th class="total-th" data-column="subtotal">小计</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="item : ${page.content}">
|
||||
<td class="checkbox-col"><input class="checkbox" type="checkbox" th:data-id="${item.id}">
|
||||
</td>
|
||||
<td th:text="${item.purchaseStock.sn}"></td>
|
||||
<td th:text="${item.name}"></td>
|
||||
<td th:text="${item.price}"></td>
|
||||
<td th:text="${item.count}"></td>
|
||||
<!-- <td th:text="${item.gWeight}"></td>-->
|
||||
<!-- <td th:text="${item.pattern}"></td>-->
|
||||
<!-- <td th:text="${item.colour}"></td>-->
|
||||
<td th:each="data : ${session.eField.list('purchaseStockItem')}"
|
||||
th:text="${item.extraField(data.fieldName)}"></td>
|
||||
<td th:each="data : ${session.eField.list('product')}"
|
||||
th:text="${item.extraField(data.fieldName.replaceAll('extra', 'product'))}"></td>
|
||||
<td th:text="${(item.count * item.price).setScale(2, 4)}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th:block>
|
||||
</div>
|
||||
<!-- <div th:replace="common/dot-box"></div>-->
|
||||
<div th:replace="common/pagination"></div>
|
||||
</form>
|
||||
<script>
|
||||
initToggle();
|
||||
initFilterWrapper();
|
||||
|
||||
var $table = $(".tableWrap table");
|
||||
$table.selectField({
|
||||
multiSelect: true,
|
||||
resizable: true,
|
||||
resizeMode: 'overflow',
|
||||
fieldControl: true,
|
||||
success: function () {
|
||||
initSortBar('[[${page.orderProperty}]]', '[[${page.orderDirection}]]');
|
||||
}
|
||||
});
|
||||
|
||||
var $filterWrapper = $(".toolBar .filter-wrapper");
|
||||
$filterWrapper.selectFilter();
|
||||
|
||||
// if ('[[${displayMode}]]' === 'order') {
|
||||
// setTableTotal($table, {totalAmount: '[[${orderInfo.amount}]]', itemCount: '[[${orderInfo.itemCount}]]'});
|
||||
// } else if ('[[${displayMode}]]' === 'detail') {
|
||||
// setTableTotal($table, {subtotal: '[[${orderInfo.amount}]]', count: '[[${orderInfo.number}]]'});
|
||||
// }
|
||||
|
||||
function exportAll() {
|
||||
var selectedIds = $(".tableWrap").selectedIds();
|
||||
if (selectedIds.length < 1) {
|
||||
Dialog.error("至少勾选1项");
|
||||
return
|
||||
}
|
||||
var ids = ""
|
||||
for (var i = 0; i < selectedIds.length; i++) {
|
||||
ids += Number(selectedIds[i]) + ","
|
||||
}
|
||||
ids.substring(0, ids.length - 1)
|
||||
window.open("/admin/purchaseStock/exportAll.html?ids=" + ids)
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user