Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
ac0df532
Commit
ac0df532
authored
Sep 29, 2019
by
季圣华
Browse files
优化单据js
parent
446aff1a
Changes
2
Show whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/in_out.js
View file @
ac0df532
...
@@ -392,8 +392,9 @@
...
@@ -392,8 +392,9 @@
//初始化表格数据
//初始化表格数据
function initTableData(){
function initTableData(){
if(pageType === "skip") {
if(pageType === "skip") {
var
oldRowInfo
=
sessionStorage
.
getItem
(
"
rowInfo
"
);
var res = sessionStorage.getItem("rowInfo");
editDepotHead
(
oldRowInfo
);
//自动弹出编辑框,带缓存数据
res = JSON.parse(res);
editDepotHead(0, res); //自动弹出编辑框,带缓存数据
}
}
var hideType = undefined;
var hideType = undefined;
var isHiddenStatus = true;
var isHiddenStatus = true;
...
@@ -492,26 +493,14 @@
...
@@ -492,26 +493,14 @@
columns:[[
columns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '操作',field: 'op',align:"center",width:opWidth,
{ title: '操作',field: 'op',align:"center",width:opWidth,
formatter
:
function
(
value
,
rec
)
{
formatter:function(value,rec
,index
) {
var str = '';
var str = '';
var
rowInfo
=
rec
.
id
+
'
AaBb
'
+
rec
.
projectid
+
'
AaBb
'
+
rec
.
number
+
'
AaBb
'
+
rec
.
operpersonname
+
'
AaBb
'
+
rec
.
opertimeStr
+
'
AaBb
'
+
rec
.
organid
+
'
AaBb
'
+
rec
.
handspersonid
+
'
AaBb
'
+
rec
.
accountid
+
'
AaBb
'
+
rec
.
changeamount
+
'
AaBb
'
+
rec
.
remark
+
'
AaBb
'
+
rec
.
projectName
+
'
AaBb
'
+
rec
.
organName
+
'
AaBb
'
+
rec
.
handsPersonName
+
'
AaBb
'
+
rec
.
accountName
+
'
AaBb
'
+
rec
.
totalprice
+
'
AaBb
'
+
rec
.
allocationprojectid
+
'
AaBb
'
+
rec
.
allocationProjectName
+
'
AaBb
'
+
rec
.
paytype
+
'
AaBb
'
+
rec
.
salesman
+
'
AaBb
'
+
rec
.
discount
+
'
AaBb
'
+
rec
.
discountmoney
+
'
AaBb
'
+
rec
.
discountlastmoney
+
'
AaBb
'
+
rec
.
accountidlist
+
'
AaBb
'
+
rec
.
accountmoneylist
+
'
AaBb
'
+
rec
.
othermoney
+
'
AaBb
'
+
rec
.
othermoneylist
+
'
AaBb
'
+
rec
.
othermoneyitem
+
'
AaBb
'
+
rec
.
accountday
+
'
AaBb
'
+
rec
.
linknumber
;
rowInfo
=
rowInfo
.
replace
(
/
\"
/g
,
""
);
rowInfo
=
rowInfo
.
replace
(
/
\[
|]/g
,
""
);
var orgId = rec.organid? rec.organid:0;
var orgId = rec.organid? rec.organid:0;
str
+=
'
<img title="查看" src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showDepotHead(
\'
'
+
rowInfo
+
'
\'
);"/>
'
;
str += '<img title="查看" src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showDepotHead(\'' +
index
+ '\');"/> ';
str
+=
'
<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(
\'
'
+
rowInfo
+
'
\'
'
+
'
,
'
+
rec
.
status
+
'
);"/>
'
;
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' +
index + '\
');"/> ';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalprice+',' + rec.status + ');"/>';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalprice+',' + rec.status + ');"/>';
if(isShowSkip) {
if(isShowSkip) {
str
+=
'
<img title="
'
+
opTitle
+
'
" src="/js/easyui-1.3.5/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(
\'
'
+
rowInfo
+
'
\'
'
+
'
,
'
+
rec
.
status
+
'
);"/>
'
;
str += ' <img title="' + opTitle + '" src="/js/easyui-1.3.5/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(\'' +
index + '\
');"/>';
}
}
return str;
return str;
}
}
...
@@ -1294,11 +1283,12 @@
...
@@ -1294,11 +1283,12 @@
}
}
//订单转采购或销售
//订单转采购或销售
function
skipDepotHead
(
rowInfo
,
status
){
function skipDepotHead(index){
var res = $("#tableData").datagrid("getRows")[index];
if(status == "0" || status == "2") {
if(status == "0" || status == "2") {
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
} else {
} else {
sessionStorage
.
setItem
(
"
rowInfo
"
,
rowInfo
);
//将单据信息存入缓存中
sessionStorage.setItem("rowInfo",
JSON.stringify(res)
); //将单据信息存入缓存中
if(listTitle == "采购订单列表") {
if(listTitle == "采购订单列表") {
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
} else if(listTitle == "销售订单列表") {
} else if(listTitle == "销售订单列表") {
...
@@ -1539,44 +1529,49 @@
...
@@ -1539,44 +1529,49 @@
}
}
//编辑信息
//编辑信息
function
editDepotHead
(
depotHeadTotalInfo
,
status
){
function editDepotHead(index, res){
if
(
status
==
"
1
"
||
status
==
"
2
"
)
{
if(!res) {
$
.
messager
.
alert
(
'
编辑提示
'
,
'
已审核和已转的单据不能编辑!
'
,
'
warning
'
);
res = $("#tableData").datagrid("getRows")[index];
}
if(pageType!="skip") {
if (res.status == "1" || res.status == "2") {
$.messager.alert('编辑提示', '已审核和已转的单据不能编辑!', 'warning');
return;
return;
}
}
var
depotHeadInfo
=
depotHeadTotalInfo
.
split
(
"
AaBb
"
);
}
var
TotalPrice
=
depotHeadInfo
[
14
]
;
//合计金额
var TotalPrice =
res.totalprice
; //合计金额
if(pageType === "skip") { //从订单跳转过来
if(pageType === "skip") { //从订单跳转过来
buildNumber(); //生成单据编号
buildNumber(); //生成单据编号
var thisDateTime = getNowFormatDateTime(); //当前时间
var thisDateTime = getNowFormatDateTime(); //当前时间
$("#OperTime").val(thisDateTime);
$("#OperTime").val(thisDateTime);
$
(
"
#LinkNumber
"
).
val
(
depotHeadInfo
[
2
]
);
//关联订单号
$("#LinkNumber").val(
res.number
); //关联订单号
$("#AccountId").val(defaultAccountId); //初始化默认的账户Id
$("#AccountId").val(defaultAccountId); //初始化默认的账户Id
$("#DiscountLastMoney").val(TotalPrice); //优惠后金额
$("#DiscountLastMoney").val(TotalPrice); //优惠后金额
$("#ChangeAmount").val(TotalPrice).attr("data-changeamount", TotalPrice);
$("#ChangeAmount").val(TotalPrice).attr("data-changeamount", TotalPrice);
} else {
} else {
$
(
"
#Number
"
).
val
(
depotHeadInfo
[
2
]).
attr
(
"
data-defaultNumber
"
,
depotHeadInfo
[
2
]);
$("#Number").val(res.number).attr("data-defaultNumber",res.number);
$
(
"
#OperTime
"
).
val
(
depotHeadInfo
[
4
]);
$("#OperTime").val(res.opertimeStr);
$
(
"
#LinkNumber
"
).
val
(
depotHeadInfo
[
28
].
replace
(
"
undefined
"
,
""
));
//关联订单号
$("#LinkNumber").val(res.linknumber); //关联订单号
$
(
"
#AccountId
"
).
val
(
depotHeadInfo
[
7
]);
//账户Id
$("#AccountId").val(res.accountid); //账户Id
$
(
"
#DiscountLastMoney
"
).
val
(
depotHeadInfo
[
21
].
replace
(
"
undefined
"
,
"
0.00
"
));
//优惠后金额
$("#DiscountLastMoney").val(res.discountlastmoney); //优惠后金额
$
(
"
#ChangeAmount
"
).
val
(
depotHeadInfo
[
8
]).
attr
(
"
data-changeamount
"
,
depotHeadInfo
[
8
]);
$("#ChangeAmount").val(res.changeamount).attr("data-changeamount", res.changeamount);
}
}
$
(
'
#OrganId
'
).
combobox
(
'
setValue
'
,
depotHeadInfo
[
5
]
==
'
undefined
'
?
''
:
depotHeadInfo
[
5
]);
$('#OrganId').combobox('setValue', res.organid);
$
(
"
#HandsPersonId
"
).
val
(
depotHeadInfo
[
6
]);
$("#HandsPersonId").val(res.handspersonid);
$
(
"
#Remark
"
).
val
(
depotHeadInfo
[
9
]);
$("#Remark").val(res.remark);
$
(
"
#Discount
"
).
val
(
depotHeadInfo
[
19
].
replace
(
"
undefined
"
,
"
0
"
));
$("#Discount").val(res.discount?res.discount:0);
$
(
"
#DiscountMoney
"
).
val
(
depotHeadInfo
[
20
].
replace
(
"
undefined
"
,
"
0.00
"
));
$("#DiscountMoney").val(res.discountmoney?res.discountmoney:0);
$
(
"
#Debt
"
).
val
((
depotHeadInfo
[
21
].
replace
(
"
undefined
"
,
"
0.00
"
)
-
depotHeadInfo
[
8
]).
toFixed
(
2
));
var discountlastmoney = res.discountlastmoney?res.discountlastmoney:0;
$
(
"
#AccountDay
"
).
val
(
depotHeadInfo
[
27
].
replace
(
"
undefined
"
,
""
));
//结算天数
$("#Debt").val(discountlastmoney-res.changeamount);
preTotalPrice
=
depotHeadInfo
[
14
];
//记录前一次合计金额,用于扣预付款
$("#AccountDay").val(res.accountday); //结算天数
$
(
"
#AllocationProjectId
"
).
val
(
depotHeadInfo
[
15
]);
preTotalPrice = res.totalprice; //记录前一次合计金额,用于扣预付款
oldNumber
=
depotHeadInfo
[
2
];
//记录编辑前的单据编号
$("#AllocationProjectId").val(res.allocationprojectid);
oldId
=
depotHeadInfo
[
0
];
//记录单据Id
oldNumber = res.number; //记录编辑前的单据编号
oldId = res.id; //记录单据Id
var editTitle = listTitle.replace("列表","信息");
var editTitle = listTitle.replace("列表","信息");
$('#depotHeadDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑' + editTitle);
$('#depotHeadDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑' + editTitle);
$(".window-mask").css({ width: webW ,height: webH});
$(".window-mask").css({ width: webW ,height: webH});
depotHeadID
=
depotHeadInfo
[
0
]
;
depotHeadID =
res.id
;
if(listSubType == "零售"){
if(listSubType == "零售"){
var option = "";
var option = "";
...
@@ -1591,8 +1586,8 @@
...
@@ -1591,8 +1586,8 @@
}
}
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if
(
depotHeadInfo
[
18
]
){
if(res.salesman
){
var
arr
=
depotHeadInfo
[
18
]
.
split
(
"
,
"
);
var arr = res.salesman
.split(",");
var salesmanArray = [];
var salesmanArray = [];
for(var i=0;i<arr.length;i++){
for(var i=0;i<arr.length;i++){
if(arr[i]){
if(arr[i]){
...
@@ -1604,10 +1599,10 @@
...
@@ -1604,10 +1599,10 @@
}
}
//采购入库、销售出库的多账户加载
//采购入库、销售出库的多账户加载
if
(
depotHeadInfo
[
22
]
!=
"
undefined
"
&&
depotHeadInfo
[
23
]
!=
"
undefined
"
){
if(res.accountidlist && res.accountmoneylist
){
$("#AccountId").val("many"); //下拉框选中多账户
$("#AccountId").val("many"); //下拉框选中多账户
var
accountArr
=
depotHeadInfo
[
22
]
.
split
(
"
,
"
);
var accountArr =
res.accountidlist
.split(",");
var
accountMoneyArr
=
depotHeadInfo
[
23
]
.
split
(
"
,
"
);
var accountMoneyArr =
res.accountmoneylist
.split(",");
accountMoneyArr = changeListFmtPlus(accountMoneyArr) //将数组单个金额中的数值转为正数
accountMoneyArr = changeListFmtPlus(accountMoneyArr) //将数组单个金额中的数值转为正数
if(listSubType == "零售" || listSubType == "零售退货") {
if(listSubType == "零售" || listSubType == "零售退货") {
...
@@ -1632,11 +1627,11 @@
...
@@ -1632,11 +1627,11 @@
}
}
//采购入库、销售出库的费用数据加载
//采购入库、销售出库的费用数据加载
if
(
depotHeadInfo
[
25
]
&&
depotHeadInfo
[
26
]
){
if(res.othermoneylist && res.othermoneyitem
){
$
(
"
#OtherMoney
"
).
val
(
depotHeadInfo
[
24
].
replace
(
"
undefined
"
,
"
0
"
)
);
//采购费用、销售费用
$("#OtherMoney").val(
res.othermoney
); //采购费用、销售费用
var
itemArr
=
depotHeadInfo
[
25
]
.
split
(
"
,
"
);
var itemArr =
res.othermoneylist
.split(",");
var
itemMoneyArr
=
depotHeadInfo
[
26
]
.
split
(
"
,
"
);
var itemMoneyArr =
res.othermoneyitem
.split(",");
$
(
"
#OtherMoney
"
).
attr
(
"
data-itemArr
"
,
JSON
.
stringify
(
itemArr
)).
attr
(
"
data-itemMoneyArr
"
,
JSON
.
stringify
(
itemMoneyArr
)
)
;
//json数据存储
$("#OtherMoney").attr("data-itemArr",JSON.stringify(itemArr)).attr("data-itemMoneyArr",itemMoneyArr); //json数据存储
}
}
initTableData_material("edit",TotalPrice); //商品列表
initTableData_material("edit",TotalPrice); //商品列表
...
@@ -1646,77 +1641,90 @@
...
@@ -1646,77 +1641,90 @@
//jshjshjsh
//jshjshjsh
$("#depotHeadFM .datagrid-body").find("[field='DepotId']").click();
$("#depotHeadFM .datagrid-body").find("[field='DepotId']").click();
} else {
} else {
url
=
'
/depotHead/updateDepotHeadAndDetail?id=
'
+
depotHeadInfo
[
0
]
;
//更新接口
url = '/depotHead/updateDepotHeadAndDetail?id=' +
res.id
; //更新接口
}
}
}
}
//查看信息
//查看信息
function
showDepotHead
(
depotHeadTotalInfo
){
function showDepotHead(
index
){
var
depotHeadInfo
=
depotHeadTotalInfo
.
split
(
"
AaBb
"
)
;
var res = $("#tableData").datagrid("getRows")[index]
;
var manyAccountMoney = 0; //多账户合计-零售
var manyAccountMoney = 0; //多账户合计-零售
$
(
"
#ProjectIdShow
"
).
text
(
depotHeadInfo
[
10
]
);
$("#ProjectIdShow").text(
res.projectName
);
$
(
"
#NumberShow
"
).
text
(
depotHeadInfo
[
2
]
);
$("#NumberShow").text(
res.number
);
$
(
"
#OperTimeShow
"
).
text
(
depotHeadInfo
[
4
]
);
$("#OperTimeShow").text(
res.opertimeStr
);
$
(
'
#OrganIdShow
'
).
text
(
depotHeadInfo
[
11
]
==
"
undefined
"
?
''
:
depotHeadInfo
[
11
]
);
$('#OrganIdShow').text(
res.organName
);
$
(
"
#HandsPersonIdShow
"
).
text
(
depotHeadInfo
[
12
]
);
$("#HandsPersonIdShow").text(
res.handsPersonName
);
if
(
depotHeadInfo
[
13
]
&&
depotHeadInfo
[
13
]
!=
"
undefined
"
){
if(
res.accountName
){
$
(
"
#AccountIdShow
"
).
text
(
depotHeadInfo
[
13
]
);
//结算账户
$("#AccountIdShow").text(
res.accountName
); //结算账户
} else {
} else {
var
accountArr
=
depotHeadInfo
[
22
].
split
(
"
,
"
);
//账户id列表
if (res.accountidlist) {
var
accountMoneyArr
=
depotHeadInfo
[
23
].
split
(
"
,
"
);
//账户金额列表
var accountArr = res.accountidlist.split(","); //账户id列表
var accountMoneyArr = res.accountmoneylist.split(","); //账户金额列表
var accountIdShow = "";
var accountIdShow = "";
for
(
var
j
=
0
;
j
<
accountArr
.
length
;
j
++
){
for
(var j =
0;
j <
accountArr.length; j++)
{
if
(
accountList
!=
null
){
if
(accountList !=
null)
{
for
(
var
i
=
0
;
i
<
accountList
.
length
;
i
++
){
for
(var i = 0;
i < accountList.length;
i++)
{
var account = accountList[i];
var account = accountList[i];
if
(
accountArr
[
j
]
==
account
.
id
)
{
if
(accountArr[j] == account.id) {
var
currentAccountMoney
=
accountMoneyArr
[
j
]
-
0
;
var currentAccountMoney = accountMoneyArr[j]
-
0;
if
(
currentAccountMoney
<
0
){
if
(currentAccountMoney < 0)
{
currentAccountMoney
=
0
-
currentAccountMoney
;
currentAccountMoney = 0
-
currentAccountMoney;
}
}
accountIdShow
=
accountIdShow
+
account
.
name
+
"
(
"
+
currentAccountMoney
+
"
元)
"
;
accountIdShow = accountIdShow + account.name + "(" + currentAccountMoney +
"元) ";
manyAccountMoney
+=
accountMoneyArr
[
j
]
-
0
;
//多账户合计-零售
manyAccountMoney += accountMoneyArr[j]
-
0; //多账户合计-零售
}
}
}
}
}
}
}
}
$("#AccountIdShow").text(accountIdShow);
$("#AccountIdShow").text(accountIdShow);
}
}
$
(
"
#ChangeAmountShow
"
).
text
(
depotHeadInfo
[
8
]);
}
$
(
"
#RemarkShow
"
).
text
(
depotHeadInfo
[
9
]);
$("#ChangeAmountShow").text(res.changeamount);
$
(
"
#DiscountShow
"
).
text
(
depotHeadInfo
[
19
]);
$("#RemarkShow").text(res.remark);
$
(
"
#DiscountMoneyShow
"
).
text
(
depotHeadInfo
[
20
]);
$("#DiscountShow").text(res.discount);
$
(
"
#DiscountLastMoneyShow
"
).
text
(
depotHeadInfo
[
21
]);
$("#DiscountMoneyShow").text(res.discountmoney);
$
(
"
#DebtShow
"
).
text
((
depotHeadInfo
[
21
]
-
depotHeadInfo
[
8
]).
toFixed
(
2
));
$("#DiscountLastMoneyShow").text(res.discountlastmoney);
$
(
"
#AccountDayShow
"
).
text
(
depotHeadInfo
[
27
].
replace
(
"
undefined
"
,
""
));
//结算天数
$("#DebtShow").text((res.discountlastmoney-res.changeamount).toFixed(2));
$
(
"
#LinkNumberShow
"
).
text
(
depotHeadInfo
[
28
].
replace
(
"
undefined
"
,
""
));
//关联订单号
$("#AccountDayShow").text(res.accountday); //结算天数
if
(
depotHeadInfo
[
25
]
&&
depotHeadInfo
[
26
]){
$("#LinkNumberShow").text(res.linknumber); //关联订单号
var
itemArr
=
depotHeadInfo
[
25
].
split
(
"
,
"
);
//支出项目id列表
if(res.othermoneylist && res.othermoneyitem){
var
itemMoneyArr
=
depotHeadInfo
[
26
].
split
(
"
,
"
);
//支出项目金额列表
var itemArr = res.othermoneylist.split(","); //支出项目id列表
var itemMoneyArr = null;
if(res.othermoneyitem!=null) {
itemMoneyArr = eval ("(" + res.othermoneyitem + ")"); //支出项目金额列表
}
var otherMoneyShow = "";
var otherMoneyShow = "";
for(var j =0;j<itemArr.length; j++) {
for(var j =0;j<itemArr.length; j++) {
if (outItemList != null) {
if (outItemList != null) {
for (var i = 0; i < outItemList.length; i++) {
for (var i = 0; i < outItemList.length; i++) {
var money = outItemList[i];
var money = outItemList[i];
if(itemArr[j] == money.Id) {
if(itemArr[j] == money.Id) {
otherMoneyShow
=
otherMoneyShow
+
money
.
InOutItemName
+
"
(
"
+
itemMoneyArr
[
j
]
+
"
元)
"
;
for(var k =0;k<itemMoneyArr.length; k++) {
if(itemMoneyArr[k].otherId == money.Id) {
otherMoneyShow += money.InOutItemName;
if(itemMoneyArr[k].otherMoney) {
otherMoneyShow +="(" + itemMoneyArr[k].otherMoney +"元)";
}
otherMoneyShow+=",";
}
}
}
}
}
}
}
}
}
$
(
"
#OtherMoneyShow
"
).
text
(
otherMoneyShow
+
"
总计:
"
+
depotHeadInfo
[
24
].
replace
(
"
undefined
"
,
"
0
"
)
+
"
元
"
);
//采购费用、销售费用
}
$("#OtherMoneyShow").text(otherMoneyShow +"总计:"+ res.othermoney + "元 "); //采购费用、销售费用
}
}
else {
else {
$
(
"
#OtherMoneyShow
"
).
text
(
depotHeadInfo
[
24
].
replace
(
"
undefined
"
,
"
0
"
)
);
//采购费用、销售费用
$("#OtherMoneyShow").text(
res.othermoney
); //采购费用、销售费用
}
}
$
(
"
#payTypeShow
"
).
text
(
depotHeadInfo
[
17
]
);
$("#payTypeShow").text(
res.paytype
);
var
TotalPrice
=
depotHeadInfo
[
14
]
;
var TotalPrice =
res.totalprice
;
$
(
"
#AllocationProjectIdShow
"
).
text
(
depotHeadInfo
[
16
]
);
$("#AllocationProjectIdShow").text(
res.allocationProjectName
);
var showTitle = listTitle.replace("列表","信息");
var showTitle = listTitle.replace("列表","信息");
$('#depotHeadDlgShow').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/list.png"/> 查看' + showTitle);
$('#depotHeadDlgShow').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/list.png"/> 查看' + showTitle);
$(".window-mask").css({ width: webW ,height: webH});
$(".window-mask").css({ width: webW ,height: webH});
depotHeadID
=
depotHeadInfo
[
0
]
;
depotHeadID =
res.id
;
initTableData_material_show(TotalPrice); //商品列表-查看状态
initTableData_material_show(TotalPrice); //商品列表-查看状态
//零售单据展示数据
//零售单据展示数据
...
@@ -1732,8 +1740,8 @@
...
@@ -1732,8 +1740,8 @@
}
}
}
}
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if
(
depotHeadInfo
[
18
]
){
if(res.salesman
){
var
arr
=
depotHeadInfo
[
18
]
.
split
(
"
,
"
);
var arr =
res.salesman
.split(",");
var salesmanStr = "";
var salesmanStr = "";
for(var i=0;i<arr.length;i++){
for(var i=0;i<arr.length;i++){
if(arr[i]){
if(arr[i]){
...
@@ -2331,7 +2339,10 @@
...
@@ -2331,7 +2339,10 @@
}
}
if(thisId && thisMoney) {
if(thisId && thisMoney) {
itemArr.push(thisId);
itemArr.push(thisId);
itemMoneyArr
.
push
(
thisMoney
);
var itemMoneyObj = {};
itemMoneyObj.otherId = thisId;
itemMoneyObj.otherMoney = thisMoney;
itemMoneyArr.push(itemMoneyObj);
}
}
});
});
if(errorIndex >-1){
if(errorIndex >-1){
...
@@ -2378,7 +2389,12 @@
...
@@ -2378,7 +2389,12 @@
var index = $(this).attr("data-index");
var index = $(this).attr("data-index");
$(this).find(".money-id-dlg").val(itemArr[index]);
$(this).find(".money-id-dlg").val(itemArr[index]);
if(itemMoneyArr[index]!="undefined"){
if(itemMoneyArr[index]!="undefined"){
$
(
this
).
find
(
"
.other-money-dlg
"
).
val
(
itemMoneyArr
[
index
]);
for(var k =0;k<itemMoneyArr.length; k++) {
if (itemMoneyArr[k].otherId == itemArr[index]) {
$(this).find(".other-money-dlg").val(itemMoneyArr[k].otherMoney);
}
}
}
}
});
});
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
ac0df532
...
@@ -98,10 +98,6 @@ public class DepotHeadService {
...
@@ -98,10 +98,6 @@ public class DepotHeadService {
String
otherMoneyListStr
=
dh
.
getOthermoneylist
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replaceAll
(
"\""
,
""
);
String
otherMoneyListStr
=
dh
.
getOthermoneylist
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replaceAll
(
"\""
,
""
);
dh
.
setOthermoneylist
(
otherMoneyListStr
);
dh
.
setOthermoneylist
(
otherMoneyListStr
);
}
}
if
(
dh
.
getOthermoneyitem
()
!=
null
)
{
String
otherMoneyItemStr
=
dh
.
getOthermoneyitem
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replaceAll
(
"\""
,
""
);
dh
.
setOthermoneyitem
(
otherMoneyItemStr
);
}
if
(
dh
.
getChangeamount
()
!=
null
)
{
if
(
dh
.
getChangeamount
()
!=
null
)
{
dh
.
setChangeamount
(
dh
.
getChangeamount
().
abs
());
dh
.
setChangeamount
(
dh
.
getChangeamount
().
abs
());
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment