单据编号和单据日期添加只读属性

This commit is contained in:
cjl
2019-02-02 11:26:29 +08:00
parent 5f5e9f3c65
commit 8c1213a696
20 changed files with 3290 additions and 3285 deletions

View File

@@ -68,12 +68,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -64,12 +64,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px">

View File

@@ -68,12 +68,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -68,12 +68,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -68,12 +68,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -67,12 +67,12 @@
<td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:140px;"/>
class="txt Wdate" style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -65,12 +65,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width:140px;" readonly/>
</td>
<td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td>

View File

@@ -70,12 +70,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width:140px;" readonly/>
</td>
<td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td>

View File

@@ -70,12 +70,12 @@
<td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width:140px;" readonly/>
</td>
<td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td>

View File

@@ -65,12 +65,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td></td>
<td></td>

View File

@@ -65,12 +65,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
style="width: 140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td></td>
<td></td>

View File

@@ -75,12 +75,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px">

View File

@@ -69,12 +69,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px">

View File

@@ -75,12 +75,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px">

View File

@@ -75,12 +75,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px">

View File

@@ -69,12 +69,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
style="width: 140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px;width:150px;"></td>

View File

@@ -69,12 +69,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
style="width: 140px;" readonly/>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:70px;">付款类型:</td>
<td style="padding:5px;width:150px;">

View File

@@ -73,12 +73,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td>单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -73,12 +73,12 @@
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
data-options="required:true,validType:'length[2,30]'" style="width: 140px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -315,20 +315,25 @@ public class DepotHeadService {
//判断用户是否已经登录过,登录过不再处理
User userInfo=userService.getCurrentUser();
depotHead.setOperpersonname(userInfo==null?null:userInfo.getUsername());
//构造新的编号
String dNumber = depotHead.getDefaultnumber();
String number = dNumber.substring(0, 12); //截取前缀
String beginTime = Tools.getNow() + " 00:00:00";
String endTime = Tools.getNow() + " 23:59:59";
String newNumber = buildNumber(depotHead.getType(), depotHead.getSubtype(), beginTime, endTime); //从数据库查询最新的编号+1,这样能防止重复
String allNewNumber = number + newNumber;
String frontNumber = depotHead.getNumber();
if(frontNumber.indexOf(number) > -1) {
depotHead.setNumber(allNewNumber); //从后台取值
} else {
depotHead.setNumber(frontNumber); //从前端文本框里面获取
}
depotHead.setDefaultnumber(allNewNumber); //初始编号,一直都从后台取值
/**
* 2019-02-02
* 使用最新生成的唯一单据编号,理论上可以保证唯一性
* 保存时就不再加判断,提高程序的效率
* */
// //构造新的编号
// String dNumber = depotHead.getDefaultnumber();
// String number = dNumber.substring(0, 12); //截取前缀
// String beginTime = Tools.getNow() + " 00:00:00";
// String endTime = Tools.getNow() + " 23:59:59";
// String newNumber = buildNumber(depotHead.getType(), depotHead.getSubtype(), beginTime, endTime); //从数据库查询最新的编号+1,这样能防止重复
// String allNewNumber = number + newNumber;
// String frontNumber = depotHead.getNumber();
// if(frontNumber.indexOf(number) > -1) {
// depotHead.setNumber(allNewNumber); //从后台取值
// } else {
// depotHead.setNumber(frontNumber); //从前端文本框里面获取
// }
// depotHead.setDefaultnumber(allNewNumber); //初始编号,一直都从后台取值
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(false);
depotHeadMapperEx.adddepotHead(depotHead);