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
e07c3d17
Commit
e07c3d17
authored
Nov 08, 2019
by
季圣华
Browse files
优化单据js
parent
ee55a174
Changes
1
Show whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/in_out.js
View file @
e07c3d17
...
@@ -667,7 +667,6 @@
...
@@ -667,7 +667,6 @@
//初始化表格数据-商品列表-编辑状态
//初始化表格数据-商品列表-编辑状态
function
initTableData_material
(
type
,
TotalPrice
){
function
initTableData_material
(
type
,
TotalPrice
){
var
body
,
footer
,
input
;
//定义表格和文本框
var
body
,
footer
,
input
;
//定义表格和文本框
var
ratio
=
1
;
//比例-品名专用
var
ratioDepot
=
1
;
//比例-仓库用
var
ratioDepot
=
1
;
//比例-仓库用
var
monthTime
=
getNowFormatMonth
();
var
monthTime
=
getNowFormatMonth
();
var
isShowAnotherDepot
=
true
;
//显示对方仓库,true为隐藏,false为显示
var
isShowAnotherDepot
=
true
;
//显示对方仓库,true为隐藏,false为显示
...
@@ -760,6 +759,136 @@
...
@@ -760,6 +759,136 @@
param
.
mpList
=
mPropertyList
;
//商品属性
param
.
mpList
=
mPropertyList
;
//商品属性
},
},
onSelect
:
function
(
rec
){
onSelect
:
function
(
rec
){
materialSelect
(
rec
);
}
}
}
},
{
title
:
'
库存
'
,
field
:
'
Stock
'
,
editor
:
'
validatebox
'
,
width
:
70
},
{
title
:
anotherDepotHeadName
,
field
:
'
AnotherDepotId
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowAnotherDepot
,
width
:
90
,
formatter
:
function
(
value
,
row
,
index
)
{
return
row
.
AnotherDepotName
;
},
editor
:
{
type
:
'
combobox
'
,
options
:
{
valueField
:
'
id
'
,
textField
:
anotherDepotTextField
,
method
:
'
get
'
,
url
:
anotherDepotUrl
}
}
},
{
title
:
'
单位
'
,
field
:
'
Unit
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
数量
'
,
field
:
'
OperNumber
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
单价
'
,
field
:
'
UnitPrice
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
含税单价
'
,
field
:
'
TaxUnitPrice
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
金额
'
,
field
:
'
AllPrice
'
,
editor
:
'
validatebox
'
,
width
:
75
},
{
title
:
'
税率(%)
'
,
field
:
'
TaxRate
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
税额
'
,
field
:
'
TaxMoney
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
价税合计
'
,
field
:
'
TaxLastMoney
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
备注
'
,
field
:
'
Remark
'
,
editor
:
'
validatebox
'
,
width
:
120
},
{
title
:
'
品名-别
'
,
field
:
'
OtherField1
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
型号-别
'
,
field
:
'
OtherField2
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
颜色-别
'
,
field
:
'
OtherField3
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
备注1
'
,
field
:
'
OtherField4
'
,
editor
:
'
validatebox
'
,
hidden
:
true
,
width
:
60
},
{
title
:
'
备注2
'
,
field
:
'
OtherField5
'
,
editor
:
'
validatebox
'
,
hidden
:
true
,
width
:
60
}
]],
toolbar
:[
{
id
:
'
append
'
,
text
:
'
新增行
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
append
();
//新增行
}
},
{
id
:
'
delete
'
,
text
:
'
删除行
'
,
iconCls
:
'
icon-remove
'
,
handler
:
function
()
{
batchDel
();
//删除行
}
},
{
id
:
'
reject
'
,
text
:
'
撤销
'
,
iconCls
:
'
icon-undo
'
,
handler
:
function
()
{
reject
();
//撤销
}
},
{
id
:
'
appendDepot
'
,
text
:
'
新增仓库
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
appendDepot
();
//新增仓库
}
},
{
id
:
'
appendMaterial
'
,
text
:
'
新增商品
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
js
.
addTabPage
(
null
,
"
商品信息
"
,
"
/pages/materials/material.html
"
);
// appendMaterial(); //新增商品
}
}
],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
$
.
ajax
({
type
:
"
get
"
,
url
:
'
/depotItem/getDetailList
'
,
data
:
{
headerId
:
depotHeadID
,
mpList
:
mPropertyList
},
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
data
=
res
.
data
;
var
AllPrice
=
0
;
var
TaxLastMoney
=
0
;
var
DiscountMoney
=
$
(
"
#DiscountMoney
"
).
val
()
-
0
;
//优惠金额
var
DiscountLastMoney
=
$
(
"
#DiscountLastMoney
"
).
val
()
-
0
;
//优惠后金额
if
(
type
===
"
edit
"
)
{
AllPrice
=
TotalPrice
;
TaxLastMoney
=
DiscountMoney
+
DiscountLastMoney
;
}
var
array
=
[];
array
.
push
({
"
AllPrice
"
:
AllPrice
,
"
TaxLastMoney
"
:
TaxLastMoney
});
data
.
footer
=
array
;
$
(
"
#materialData
"
).
datagrid
(
'
loadData
'
,
data
);
//如果是订单跳转到采购或销售
if
(
pageType
===
"
skip
"
)
{
var
skipList
=
$
(
"
#depotHeadFM .datagrid-body tr
"
);
var
input
=
"
.datagrid-editable-input
"
;
//逐条自动点击每行数据
skipList
.
each
(
function
(
i
)
{
setTimeout
(
function
()
{
skipList
.
eq
(
i
).
find
(
"
[field='Remark']
"
).
click
().
find
(
input
).
val
(
"
来自订单
"
);
//此处为确保订单转销售成功,勿删
},(
i
+
1
)
*
200
);
});
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
}
});
function
materialSelect
(
rec
)
{
var
body
,
footer
,
input
;
//定义表格和文本框
var
ratio
=
1
;
//比例-品名专用
if
(
rec
)
{
if
(
rec
)
{
var
mId
=
rec
.
Id
;
var
mId
=
rec
.
Id
;
$
.
ajax
({
$
.
ajax
({
...
@@ -972,131 +1101,6 @@
...
@@ -972,131 +1101,6 @@
}
}
}
}
}
}
}
},
{
title
:
'
库存
'
,
field
:
'
Stock
'
,
editor
:
'
validatebox
'
,
width
:
70
},
{
title
:
anotherDepotHeadName
,
field
:
'
AnotherDepotId
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowAnotherDepot
,
width
:
90
,
formatter
:
function
(
value
,
row
,
index
)
{
return
row
.
AnotherDepotName
;
},
editor
:
{
type
:
'
combobox
'
,
options
:
{
valueField
:
'
id
'
,
textField
:
anotherDepotTextField
,
method
:
'
get
'
,
url
:
anotherDepotUrl
}
}
},
{
title
:
'
单位
'
,
field
:
'
Unit
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
数量
'
,
field
:
'
OperNumber
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
单价
'
,
field
:
'
UnitPrice
'
,
editor
:
'
validatebox
'
,
width
:
60
},
{
title
:
'
含税单价
'
,
field
:
'
TaxUnitPrice
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
金额
'
,
field
:
'
AllPrice
'
,
editor
:
'
validatebox
'
,
width
:
75
},
{
title
:
'
税率(%)
'
,
field
:
'
TaxRate
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
税额
'
,
field
:
'
TaxMoney
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
价税合计
'
,
field
:
'
TaxLastMoney
'
,
editor
:
'
validatebox
'
,
hidden
:
isShowTaxColumn
,
width
:
75
},
{
title
:
'
备注
'
,
field
:
'
Remark
'
,
editor
:
'
validatebox
'
,
width
:
120
},
{
title
:
'
品名-别
'
,
field
:
'
OtherField1
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
型号-别
'
,
field
:
'
OtherField2
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
颜色-别
'
,
field
:
'
OtherField3
'
,
editor
:
'
validatebox
'
,
hidden
:
otherColumns
,
width
:
60
},
{
title
:
'
备注1
'
,
field
:
'
OtherField4
'
,
editor
:
'
validatebox
'
,
hidden
:
true
,
width
:
60
},
{
title
:
'
备注2
'
,
field
:
'
OtherField5
'
,
editor
:
'
validatebox
'
,
hidden
:
true
,
width
:
60
}
]],
toolbar
:[
{
id
:
'
append
'
,
text
:
'
新增行
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
append
();
//新增行
}
},
{
id
:
'
delete
'
,
text
:
'
删除行
'
,
iconCls
:
'
icon-remove
'
,
handler
:
function
()
{
batchDel
();
//删除行
}
},
{
id
:
'
reject
'
,
text
:
'
撤销
'
,
iconCls
:
'
icon-undo
'
,
handler
:
function
()
{
reject
();
//撤销
}
},
{
id
:
'
appendDepot
'
,
text
:
'
新增仓库
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
appendDepot
();
//新增仓库
}
},
{
id
:
'
appendMaterial
'
,
text
:
'
新增商品
'
,
iconCls
:
'
icon-add
'
,
handler
:
function
()
{
js
.
addTabPage
(
null
,
"
商品信息
"
,
"
/pages/materials/material.html
"
);
// appendMaterial(); //新增商品
}
}
],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
$
.
ajax
({
type
:
"
get
"
,
url
:
'
/depotItem/getDetailList
'
,
data
:
{
headerId
:
depotHeadID
,
mpList
:
mPropertyList
},
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
data
=
res
.
data
;
var
AllPrice
=
0
;
var
TaxLastMoney
=
0
;
var
DiscountMoney
=
$
(
"
#DiscountMoney
"
).
val
()
-
0
;
//优惠金额
var
DiscountLastMoney
=
$
(
"
#DiscountLastMoney
"
).
val
()
-
0
;
//优惠后金额
if
(
type
===
"
edit
"
)
{
AllPrice
=
TotalPrice
;
TaxLastMoney
=
DiscountMoney
+
DiscountLastMoney
;
}
var
array
=
[];
array
.
push
({
"
AllPrice
"
:
AllPrice
,
"
TaxLastMoney
"
:
TaxLastMoney
});
data
.
footer
=
array
;
$
(
"
#materialData
"
).
datagrid
(
'
loadData
'
,
data
);
//如果是订单跳转到采购或销售
if
(
pageType
===
"
skip
"
)
{
var
skipList
=
$
(
"
#depotHeadFM .datagrid-body tr
"
);
var
input
=
"
.datagrid-editable-input
"
;
//逐条自动点击每行数据
skipList
.
each
(
function
(
i
)
{
setTimeout
(
function
()
{
skipList
.
eq
(
i
).
find
(
"
[field='Remark']
"
).
click
().
find
(
input
).
val
(
"
来自订单
"
);
//此处为确保订单转销售成功,勿删
},(
i
+
1
)
*
200
);
});
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
}
});
}
//初始化表格数据-商品列表-查看状态
//初始化表格数据-商品列表-查看状态
function
initTableData_material_show
(
TotalPrice
){
function
initTableData_material_show
(
TotalPrice
){
var
isShowAnotherDepot
=
true
;
//显示对方仓库,true为隐藏,false为显示
var
isShowAnotherDepot
=
true
;
//显示对方仓库,true为隐藏,false为显示
...
...
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