Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
a3594154
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1423
Star
161
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a3594154
编写于
12月 21, 2021
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
销售订单转出库单整改完成
上级
17ec0a13
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
501 addition
and
457 deletion
+501
-457
erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js
...ources/template/js/purchaseorder/purchaseorderpurchase.js
+5
-2
erp/src/main/resources/template/js/salesorder/salesorderpurchase.js
...in/resources/template/js/salesorder/salesorderpurchase.js
+487
-449
erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js
.../main/resources/template/js/salesoutlet/salesoutletadd.js
+0
-2
erp/src/main/resources/template/tpl/purchaseorder/purchaseorderpurchase.html
...ces/template/tpl/purchaseorder/purchaseorderpurchase.html
+1
-1
erp/src/main/resources/template/tpl/salesorder/salesorderpurchase.html
...resources/template/tpl/salesorder/salesorderpurchase.html
+8
-3
未找到文件。
erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js
浏览文件 @
a3594154
...
@@ -158,8 +158,6 @@ layui.config({
...
@@ -158,8 +158,6 @@ layui.config({
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
if
(
thisRowValue
==
bean
.
id
){
//获取规格
if
(
thisRowValue
==
bean
.
id
){
//获取规格
//获取当前行数量
var
rkNum
=
parseInt
(
$
(
"
#rkNum
"
+
thisRowNum
).
val
());
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
estimatePurchasePrice
.
toFixed
(
2
));
//单价
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
estimatePurchasePrice
.
toFixed
(
2
));
//单价
return
false
;
return
false
;
}
}
...
@@ -174,6 +172,11 @@ layui.config({
...
@@ -174,6 +172,11 @@ layui.config({
calculatedTotalPrice
();
calculatedTotalPrice
();
});
});
// 仓库变化事件
form
.
on
(
'
select(depotId)
'
,
function
(
data
)
{
loadMaterialDepotStockByDepotId
(
data
.
value
);
});
// 保存为草稿
// 保存为草稿
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
...
...
erp/src/main/resources/template/js/salesorder/salesorderpurchase.js
浏览文件 @
a3594154
...
@@ -14,491 +14,529 @@ var showTdByEdit = 'rkNum';
...
@@ -14,491 +14,529 @@ var showTdByEdit = 'rkNum';
//表格的序号
//表格的序号
var
rowNum
=
1
,
priceNum
=
1
;
var
rowNum
=
1
,
priceNum
=
1
;
// 兼容动态表单
var
layedit
,
form
;
layui
.
config
({
layui
.
config
({
base
:
basePath
,
base
:
basePath
,
version
:
skyeyeVersion
version
:
skyeyeVersion
}).
extend
({
}).
extend
({
window
:
'
js/winui.window
'
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
laydate
'
,
'
textool
'
]
,
function
(
exports
)
{
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
laydate
'
,
'
textool
'
,
'
tagEditor
'
].
concat
(
dsFormUtil
.
mastHaveImport
)
,
function
(
exports
)
{
winui
.
renderColor
();
winui
.
renderColor
();
layui
.
use
([
'
form
'
,
'
tagEditor
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
,
var
$
=
layui
.
$
,
laydate
=
layui
.
laydate
,
laydate
=
layui
.
laydate
,
textool
=
layui
.
textool
;
textool
=
layui
.
textool
;
var
inoutitemHtml
=
""
;
//支出项目
var
salesManList
=
new
Array
();
//销售人员
var
xsddOrderNum
=
""
;
//销售订单编号
var
usetableTemplate
=
$
(
"
#usetableTemplate
"
).
html
(),
otherTemplate
=
$
(
"
#otherTemplate
"
).
html
();
var
selOption
=
getFileContent
(
'
tpl/template/select-option.tpl
'
);
//已经选择的商品集合key:表格的行trId,value:商品信息
var
allChooseProduct
=
{};
//事故时间
laydate
.
render
({
elem
:
'
#operTime
'
,
type
:
'
datetime
'
,
value
:
getFormatDate
(),
trigger
:
'
click
'
});
// 初始化账户
systemCommonUtil
.
getSysAccountListByType
(
function
(
json
){
// 加载账户数据
$
(
"
#accountId
"
).
html
(
getDataUseHandlebars
(
selOption
,
json
));
});
// 初始化支出项目
layedit
=
layui
.
layedit
,
systemCommonUtil
.
getSysInoutitemListByType
(
2
,
function
(
json
){
form
=
layui
.
form
;
// 加载支出项目
inoutitemHtml
=
getDataUseHandlebars
(
selOption
,
json
);
});
// 初始化仓库
var
inoutitemHtml
=
""
;
//支出项目
erpOrderUtil
.
getDepotList
(
function
(
json
){
var
salesManList
=
new
Array
();
//销售人员
// 加载仓库数据
$
(
"
#depotId
"
).
html
(
getDataUseHandlebars
(
selOption
,
json
));
// 初始化回显数据
initDataShow
();
});
//初始化回显数据
var
xsddOrderNum
=
""
;
//销售订单编号
function
initDataShow
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
salesorder008
"
,
params
:
{
rowId
:
parent
.
rowId
},
type
:
'
json
'
,
method
:
"
GET
"
,
callback
:
function
(
json
)
{
var
usetableTemplate
=
$
(
"
#usetableTemplate
"
).
html
(),
if
(
json
.
returnCode
==
0
)
{
otherTemplate
=
$
(
"
#otherTemplate
"
).
html
();
if
(
isNull
(
json
.
bean
)){
var
selOption
=
getFileContent
(
'
tpl/template/select-option.tpl
'
);
$
(
"
#showForm
"
).
html
(
""
);
//已经选择的商品集合key:表格的行trId,value:商品信息
winui
.
window
.
msg
(
'
数据不存在~
'
,
{
icon
:
2
,
time
:
2000
});
var
allChooseProduct
=
{};
return
;
}
// 获取单据提交类型
//客户信息赋值
var
submitType
=
erpOrderUtil
.
getSubmitTypeByOrderType
(
systemOrderType
[
"
outIsSalesOutlet
"
][
"
orderType
"
]);
customerMation
=
{
id
:
json
.
bean
.
organId
,
//事故时间
customName
:
json
.
bean
.
customName
laydate
.
render
({
}
elem
:
'
#operTime
'
,
type
:
'
datetime
'
,
xsddOrderNum
=
json
.
bean
.
defaultNumber
;
value
:
getFormatDate
(),
$
(
"
#customName
"
).
val
(
json
.
bean
.
customName
);
trigger
:
'
click
'
$
(
"
#xsddOrderNum
"
).
html
(
xsddOrderNum
);
});
$
(
"
#accountId
"
).
val
(
json
.
bean
.
accountId
);
$
(
"
#payType
"
).
val
(
json
.
bean
.
payType
);
// 初始化账户
$
(
"
#allPrice
"
).
html
(
json
.
bean
.
totalPrice
.
toFixed
(
2
));
systemCommonUtil
.
getSysAccountListByType
(
function
(
json
){
$
(
"
#taxLastMoneyPrice
"
).
html
(
json
.
bean
.
taxLastMoneyPrice
.
toFixed
(
2
));
// 加载账户数据
$
(
"
#remark
"
).
val
(
json
.
bean
.
remark
);
$
(
"
#accountId
"
).
html
(
getDataUseHandlebars
(
selOption
,
json
));
$
(
"
#discount
"
).
val
(
json
.
bean
.
discount
.
toFixed
(
2
));
});
$
(
"
#discountMoney
"
).
val
(
json
.
bean
.
discountMoney
.
toFixed
(
2
));
$
(
"
#discountLastMoney
"
).
html
(
json
.
bean
.
discountLastMoney
.
toFixed
(
2
));
// 初始化支出项目
$
(
"
#changeAmount
"
).
val
(
json
.
bean
.
changeAmount
.
toFixed
(
2
));
systemCommonUtil
.
getSysInoutitemListByType
(
2
,
function
(
json
){
$
(
"
#arrears
"
).
html
(
json
.
bean
.
arrears
.
toFixed
(
2
));
// 加载支出项目
$
(
"
#otherPriceTotal
"
).
html
(
"
费用合计:
"
+
json
.
bean
.
otherMoney
.
toFixed
(
2
));
inoutitemHtml
=
getDataUseHandlebars
(
selOption
,
json
);
});
//加载列表项
$
.
each
(
json
.
bean
.
items
,
function
(
i
,
item
){
// 初始化仓库
addRow
();
erpOrderUtil
.
getDepotList
(
function
(
json
){
//将规格所属的商品信息加入到对象中存储
// 加载仓库数据
allChooseProduct
[
"
tr
"
+
(
rowNum
-
1
)]
=
item
.
product
;
$
(
"
#depotId
"
).
html
(
getDataUseHandlebars
(
selOption
,
json
));
//单位回显
// 初始化回显数据
$
(
"
#unitId
"
+
(
rowNum
-
1
)).
html
(
getDataUseHandlebars
(
selOption
,
{
rows
:
item
.
product
.
unitList
}));
initDataShow
();
$
(
"
#unitId
"
+
(
rowNum
-
1
)).
val
(
item
.
mUnitId
);
});
//商品回显
$
(
"
#materialId
"
+
(
rowNum
-
1
)).
val
(
item
.
product
.
productName
+
"
(
"
+
item
.
product
.
productModel
+
"
)
"
);
// 加载动态表单
$
(
"
#currentTock
"
+
(
rowNum
-
1
)).
html
(
item
.
currentTock
);
dsFormUtil
.
loadPageByCode
(
"
dsFormShow
"
,
sysDsFormWithCodeType
[
"
outIsSalesOutlet
"
][
"
code
"
]);
//订单剩余数量
$
(
"
#nowNum
"
+
(
rowNum
-
1
)).
html
(
isNull
(
item
.
nowNumber
)
?
0
:
item
.
nowNumber
);
//初始化回显数据
$
(
"
#rkNum
"
+
(
rowNum
-
1
)).
val
(
isNull
(
item
.
nowNumber
)
?
0
:
item
.
nowNumber
);
function
initDataShow
(){
$
(
"
#unitPrice
"
+
(
rowNum
-
1
)).
val
(
item
.
unitPrice
.
toFixed
(
2
));
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
salesorder008
"
,
params
:
{
rowId
:
parent
.
rowId
},
type
:
'
json
'
,
method
:
"
GET
"
,
callback
:
function
(
json
)
{
$
(
"
#amountOfMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
allPrice
.
toFixed
(
2
));
if
(
json
.
returnCode
==
0
)
{
$
(
"
#taxRate
"
+
(
rowNum
-
1
)).
val
(
item
.
taxRate
.
toFixed
(
2
));
if
(
isNull
(
json
.
bean
)){
$
(
"
#taxMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
taxMoney
.
toFixed
(
2
));
$
(
"
#showForm
"
).
html
(
""
);
$
(
"
#taxUnitPrice
"
+
(
rowNum
-
1
)).
val
(
item
.
taxUnitPrice
.
toFixed
(
2
));
winui
.
window
.
msg
(
'
数据不存在~
'
,
{
icon
:
2
,
time
:
2000
});
$
(
"
#taxLastMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
taxLastMoney
.
toFixed
(
2
));
return
;
$
(
"
#remark
"
+
(
rowNum
-
1
)).
val
(
item
.
remark
);
});
//加载其他费用
$
.
each
(
json
.
bean
.
otherMoneyList
,
function
(
i
,
item
){
addPriceRow
();
$
(
"
#inoutitemId
"
+
(
priceNum
-
1
)).
val
(
item
.
inoutitemId
);
$
(
"
#otherPrice
"
+
(
priceNum
-
1
)).
val
(
parseFloat
(
item
.
otherPrice
).
toFixed
(
2
));
});
var
userNames
=
""
;
salesManList
=
json
.
bean
.
userInfo
;
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
userNames
+=
item
.
name
+
'
,
'
;
});
//人员选择
$
(
'
#salesMan
'
).
tagEditor
({
initialTags
:
userNames
.
split
(
'
,
'
),
placeholder
:
'
请选择销售人员
'
,
beforeTagDelete
:
function
(
field
,
editor
,
tags
,
val
)
{
var
inArray
=
-
1
;
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
if
(
val
===
item
.
name
)
{
inArray
=
i
;
return
false
;
}
});
if
(
inArray
!=
-
1
)
{
//如果该元素在集合中存在
salesManList
.
splice
(
inArray
,
1
);
}
}
});
textool
.
init
({
eleId
:
'
remark
'
,
maxlength
:
200
,
tools
:
[
'
count
'
,
'
copy
'
,
'
reset
'
,
'
clear
'
]
});
matchingLanguage
();
form
.
render
();
}
else
{
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
},
function
(){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
-9999
'
;
});
}
}});
}
//商品规格加载变化事件
form
.
on
(
'
select(selectUnitProperty)
'
,
function
(
data
)
{
var
thisRowValue
=
data
.
value
;
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
unitId
"
,
""
);
//获取当前行
//当前当前行选中的商品信息
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
if
(
thisRowValue
==
bean
.
id
){
//获取规格
//获取当前行数量
var
rkNum
=
parseInt
(
$
(
"
#rkNum
"
+
thisRowNum
).
val
());
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
salePrice
.
toFixed
(
2
));
//单价
return
false
;
}
});
}
else
{
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
"
0.00
"
);
//重置单价为空
}
//加载库存
loadTockByDepotAndMUnit
(
thisRowNum
,
$
(
"
#depotId
"
).
val
());
//计算价格
calculatedTotalPrice
();
});
form
.
on
(
'
submit(formEditBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
if
(
isNull
(
customerMation
.
id
)){
winui
.
window
.
msg
(
'
请选择客户.
'
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
}
//获取已选商品数据
//客户信息赋值
var
rowTr
=
$
(
"
#useTable tr
"
);
customerMation
=
{
if
(
rowTr
.
length
==
0
)
{
id
:
json
.
bean
.
organId
,
winui
.
window
.
msg
(
'
请选择商品.
'
,
{
icon
:
2
,
time
:
2000
});
customName
:
json
.
bean
.
customName
return
false
;
}
}
var
tableData
=
new
Array
();
var
noError
=
false
;
//循环遍历表格数据时,是否有其他错误信息
xsddOrderNum
=
json
.
bean
.
defaultNumber
;
var
isStandard
=
false
;
//判断是否超标
$
(
"
#customName
"
).
val
(
json
.
bean
.
customName
);
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
$
(
"
#xsddOrderNum
"
).
html
(
xsddOrderNum
);
//获取行编号
$
(
"
#accountId
"
).
val
(
json
.
bean
.
accountId
);
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
$
(
"
#payType
"
).
val
(
json
.
bean
.
payType
);
//表格数量对象
$
(
"
#allPrice
"
).
html
(
json
.
bean
.
totalPrice
.
toFixed
(
2
));
var
rkNum
=
$
(
"
#rkNum
"
+
rowNum
);
$
(
"
#taxLastMoneyPrice
"
).
html
(
json
.
bean
.
taxLastMoneyPrice
.
toFixed
(
2
));
if
(
parseInt
(
rkNum
.
val
())
==
0
)
{
$
(
"
#remark
"
).
val
(
json
.
bean
.
remark
);
rkNum
.
addClass
(
"
layui-form-danger
"
);
$
(
"
#discount
"
).
val
(
json
.
bean
.
discount
.
toFixed
(
2
));
rkNum
.
focus
();
$
(
"
#discountMoney
"
).
val
(
json
.
bean
.
discountMoney
.
toFixed
(
2
));
winui
.
window
.
msg
(
'
数量不能为0
'
,
{
icon
:
2
,
time
:
2000
});
$
(
"
#discountLastMoney
"
).
html
(
json
.
bean
.
discountLastMoney
.
toFixed
(
2
));
noError
=
true
;
$
(
"
#changeAmount
"
).
val
(
json
.
bean
.
changeAmount
.
toFixed
(
2
));
return
false
;
$
(
"
#arrears
"
).
html
(
json
.
bean
.
arrears
.
toFixed
(
2
));
}
$
(
"
#otherPriceTotal
"
).
html
(
"
费用合计:
"
+
json
.
bean
.
otherMoney
.
toFixed
(
2
));
if
(
parseInt
(
$
(
"
#rkNum
"
+
rowNum
).
val
())
>
parseInt
(
$
(
"
#nowNum
"
+
rowNum
).
html
())){
isStandard
=
true
;
//加载列表项
}
$
.
each
(
json
.
bean
.
items
,
function
(
i
,
item
){
//商品对象
addRow
();
var
product
=
allChooseProduct
[
"
tr
"
+
rowNum
.
toString
()];
//将规格所属的商品信息加入到对象中存储
if
(
inTableDataArrayByAssetarId
(
product
.
productId
,
$
(
"
#unitId
"
+
rowNum
).
val
(),
tableData
))
{
allChooseProduct
[
"
tr
"
+
(
rowNum
-
1
)]
=
item
.
product
;
winui
.
window
.
msg
(
'
一张单中不允许出现相同单位的商品信息.
'
,
{
icon
:
2
,
time
:
2000
});
//单位回显
noError
=
true
;
$
(
"
#unitId
"
+
(
rowNum
-
1
)).
html
(
getDataUseHandlebars
(
selOption
,
{
rows
:
item
.
product
.
unitList
}));
return
false
;
$
(
"
#unitId
"
+
(
rowNum
-
1
)).
val
(
item
.
mUnitId
);
}
//商品回显
var
row
=
{
$
(
"
#materialId
"
+
(
rowNum
-
1
)).
val
(
item
.
product
.
productName
+
"
(
"
+
item
.
product
.
productModel
+
"
)
"
);
depotId
:
$
(
"
#depotId
"
).
val
(),
$
(
"
#currentTock
"
+
(
rowNum
-
1
)).
html
(
item
.
currentTock
);
materialId
:
$
(
"
#materialId
"
+
rowNum
).
val
(),
//订单剩余数量
mUnitId
:
$
(
"
#unitId
"
+
rowNum
).
val
(),
$
(
"
#nowNum
"
+
(
rowNum
-
1
)).
html
(
isNull
(
item
.
nowNumber
)
?
0
:
item
.
nowNumber
);
rkNum
:
$
(
"
#rkNum
"
+
rowNum
).
val
(),
$
(
"
#rkNum
"
+
(
rowNum
-
1
)).
val
(
isNull
(
item
.
nowNumber
)
?
0
:
item
.
nowNumber
);
unitPrice
:
$
(
"
#unitPrice
"
+
rowNum
).
val
(),
$
(
"
#unitPrice
"
+
(
rowNum
-
1
)).
val
(
item
.
unitPrice
.
toFixed
(
2
));
taxRate
:
$
(
"
#taxRate
"
+
rowNum
).
val
(),
$
(
"
#amountOfMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
allPrice
.
toFixed
(
2
));
taxMoney
:
$
(
"
#taxMoney
"
+
rowNum
).
val
(),
$
(
"
#taxRate
"
+
(
rowNum
-
1
)).
val
(
item
.
taxRate
.
toFixed
(
2
));
taxUnitPrice
:
$
(
"
#taxUnitPrice
"
+
rowNum
).
val
(),
$
(
"
#taxMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
taxMoney
.
toFixed
(
2
));
taxLastMoney
:
$
(
"
#taxLastMoney
"
+
rowNum
).
val
(),
$
(
"
#taxUnitPrice
"
+
(
rowNum
-
1
)).
val
(
item
.
taxUnitPrice
.
toFixed
(
2
));
remark
:
$
(
"
#remark
"
+
rowNum
).
val
()
$
(
"
#taxLastMoney
"
+
(
rowNum
-
1
)).
val
(
item
.
taxLastMoney
.
toFixed
(
2
));
};
$
(
"
#remark
"
+
(
rowNum
-
1
)).
val
(
item
.
remark
);
tableData
.
push
(
row
);
});
});
if
(
noError
)
{
return
false
;
//加载其他费用
}
$
.
each
(
json
.
bean
.
otherMoneyList
,
function
(
i
,
item
){
//获取其他费用
addPriceRow
();
var
rowPriceTr
=
$
(
"
#otherPriceTable tr
"
);
$
(
"
#inoutitemId
"
+
(
priceNum
-
1
)).
val
(
item
.
inoutitemId
);
var
tablePriceData
=
new
Array
();
$
(
"
#otherPrice
"
+
(
priceNum
-
1
)).
val
(
parseFloat
(
item
.
otherPrice
).
toFixed
(
2
));
var
otherMoney
=
0
;
$
.
each
(
rowPriceTr
,
function
(
i
,
item
)
{
//获取行编号
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
var
row
=
{
inoutitemId
:
$
(
"
#inoutitemId
"
+
rowNum
).
val
(),
otherPrice
:
$
(
"
#otherPrice
"
+
rowNum
).
val
()
};
otherMoney
+=
parseFloat
(
isNull
(
$
(
"
#otherPrice
"
+
rowNum
).
val
())
?
0
:
$
(
"
#otherPrice
"
+
rowNum
).
val
());
tablePriceData
.
push
(
row
);
});
});
var
salesMan
=
""
;
var
userNames
=
""
;
salesManList
=
json
.
bean
.
userInfo
;
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
salesMan
+=
item
.
id
+
'
,
'
;
userNames
+=
item
.
name
+
'
,
'
;
});
});
//人员选择
var
params
=
{
$
(
'
#salesMan
'
).
tagEditor
({
supplierId
:
customerMation
.
id
,
//客户
initialTags
:
userNames
.
split
(
'
,
'
),
operTime
:
$
(
"
#operTime
"
).
val
(),
placeholder
:
'
请选择销售人员
'
,
accountId
:
$
(
"
#accountId
"
).
val
(),
beforeTagDelete
:
function
(
field
,
editor
,
tags
,
val
)
{
payType
:
$
(
"
#payType
"
).
val
(),
var
inArray
=
-
1
;
remark
:
$
(
"
#remark
"
).
val
(),
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
discount
:
isNull
(
$
(
"
#discount
"
).
val
())
?
"
0.00
"
:
$
(
"
#discount
"
).
val
(),
if
(
val
===
item
.
name
)
{
discountMoney
:
isNull
(
$
(
"
#discountMoney
"
).
val
())
?
"
0.00
"
:
$
(
"
#discountMoney
"
).
val
(),
inArray
=
i
;
changeAmount
:
isNull
(
$
(
"
#changeAmount
"
).
val
())
?
"
0.00
"
:
$
(
"
#changeAmount
"
).
val
(),
return
false
;
depotheadStr
:
JSON
.
stringify
(
tableData
),
otherMoney
:
otherMoney
.
toFixed
(
2
),
otherMoneyList
:
JSON
.
stringify
(
tablePriceData
),
xsddOrderNum
:
xsddOrderNum
,
rowId
:
parent
.
rowId
,
salesMan
:
salesMan
};
if
(
isStandard
){
layer
.
confirm
(
'
该出库单已超出销售单数量,是否继续?
'
,
{
icon
:
3
,
title
:
'
超标提示
'
},
function
(
i
)
{
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
salesorder009
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
PUT
"
,
callback
:
function
(
json
)
{
if
(
json
.
returnCode
==
0
)
{
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
else
{
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}
}});
});
});
if
(
inArray
!=
-
1
)
{
//如果该元素在集合中存在
}
else
{
salesManList
.
splice
(
inArray
,
1
);
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
salesorder009
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
PUT
"
,
callback
:
function
(
json
)
{
if
(
json
.
returnCode
==
0
)
{
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
else
{
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}
}});
}
}
});
textool
.
init
({
eleId
:
'
remark
'
,
maxlength
:
200
,
tools
:
[
'
count
'
,
'
copy
'
,
'
reset
'
,
'
clear
'
]
});
matchingLanguage
();
form
.
render
();
}
else
{
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
},
function
(){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
-9999
'
;
});
}
}
}});
}
//商品规格加载变化事件
form
.
on
(
'
select(selectUnitProperty)
'
,
function
(
data
)
{
var
thisRowValue
=
data
.
value
;
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
unitId
"
,
""
);
//获取当前行
//当前当前行选中的商品信息
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
if
(
thisRowValue
==
bean
.
id
){
//获取规格
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
salePrice
.
toFixed
(
2
));
//单价
return
false
;
}
});
}
else
{
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
"
0.00
"
);
//重置单价为空
}
//加载库存
loadTockByDepotAndMUnit
(
thisRowNum
,
$
(
"
#depotId
"
).
val
());
//计算价格
calculatedTotalPrice
();
});
// 仓库变化事件
form
.
on
(
'
select(depotId)
'
,
function
(
data
)
{
loadMaterialDepotStockByDepotId
(
data
.
value
);
});
// 保存为草稿
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
saveData
(
"
1
"
,
""
);
}
return
false
;
});
// 走工作流的提交审批
form
.
on
(
'
submit(formSubOneBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
activitiUtil
.
startProcess
(
sysActivitiModel
[
"
outIsSalesOutlet
"
][
"
key
"
],
function
(
approvalId
)
{
saveData
(
"
2
"
,
approvalId
);
});
}
return
false
;
});
// 不走工作流的提交
form
.
on
(
'
submit(formSubTwoBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
saveData
(
"
2
"
,
""
);
}
return
false
;
});
function
saveData
(
subType
,
approvalId
){
if
(
isNull
(
customerMation
.
id
)){
winui
.
window
.
msg
(
'
请选择客户.
'
,
{
icon
:
2
,
time
:
2000
});
return
false
;
return
false
;
}
//获取已选商品数据
var
rowTr
=
$
(
"
#useTable tr
"
);
if
(
rowTr
.
length
==
0
)
{
winui
.
window
.
msg
(
'
请选择商品.
'
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
var
tableData
=
new
Array
();
var
noError
=
false
;
//循环遍历表格数据时,是否有其他错误信息
var
isStandard
=
false
;
//判断是否超标
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
//获取行编号
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
//表格数量对象
var
rkNum
=
$
(
"
#rkNum
"
+
rowNum
);
if
(
parseInt
(
rkNum
.
val
())
==
0
)
{
rkNum
.
addClass
(
"
layui-form-danger
"
);
rkNum
.
focus
();
winui
.
window
.
msg
(
'
数量不能为0
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
if
(
parseInt
(
$
(
"
#rkNum
"
+
rowNum
).
val
())
>
parseInt
(
$
(
"
#nowNum
"
+
rowNum
).
html
())){
isStandard
=
true
;
}
//商品对象
var
product
=
allChooseProduct
[
"
tr
"
+
rowNum
.
toString
()];
if
(
inTableDataArrayByAssetarId
(
product
.
productId
,
$
(
"
#unitId
"
+
rowNum
).
val
(),
tableData
))
{
winui
.
window
.
msg
(
'
一张单中不允许出现相同单位的商品信息.
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
var
row
=
{
depotId
:
$
(
"
#depotId
"
).
val
(),
materialId
:
$
(
"
#materialId
"
+
rowNum
).
val
(),
mUnitId
:
$
(
"
#unitId
"
+
rowNum
).
val
(),
rkNum
:
$
(
"
#rkNum
"
+
rowNum
).
val
(),
unitPrice
:
$
(
"
#unitPrice
"
+
rowNum
).
val
(),
taxRate
:
$
(
"
#taxRate
"
+
rowNum
).
val
(),
taxMoney
:
$
(
"
#taxMoney
"
+
rowNum
).
val
(),
taxUnitPrice
:
$
(
"
#taxUnitPrice
"
+
rowNum
).
val
(),
taxLastMoney
:
$
(
"
#taxLastMoney
"
+
rowNum
).
val
(),
remark
:
$
(
"
#remark
"
+
rowNum
).
val
()
};
tableData
.
push
(
row
);
});
});
if
(
noError
)
{
//人员选择
return
false
;
$
(
"
body
"
).
on
(
"
click
"
,
"
#toSalesManSelPeople
"
,
function
(
e
){
}
userReturnList
=
[].
concat
(
salesManList
);
//获取其他费用
_openNewWindows
({
var
rowPriceTr
=
$
(
"
#otherPriceTable tr
"
);
url
:
"
../../tpl/common/sysusersel.html
"
,
var
tablePriceData
=
new
Array
();
title
:
"
人员选择
"
,
var
otherMoney
=
0
;
pageId
:
"
sysuserselpage
"
,
$
.
each
(
rowPriceTr
,
function
(
i
,
item
)
{
area
:
[
'
80vw
'
,
'
80vh
'
],
//获取行编号
callBack
:
function
(
refreshCode
){
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
if
(
refreshCode
==
'
0
'
)
{
var
row
=
{
//移除所有tag
inoutitemId
:
$
(
"
#inoutitemId
"
+
rowNum
).
val
(),
var
tags
=
$
(
'
#salesMan
'
).
tagEditor
(
'
getTags
'
)[
0
].
tags
;
otherPrice
:
$
(
"
#otherPrice
"
+
rowNum
).
val
()
for
(
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
};
$
(
'
#salesMan
'
).
tagEditor
(
'
removeTag
'
,
tags
[
i
]);
otherMoney
+=
parseFloat
(
isNull
(
$
(
"
#otherPrice
"
+
rowNum
).
val
())
?
0
:
$
(
"
#otherPrice
"
+
rowNum
).
val
());
}
tablePriceData
.
push
(
row
);
salesManList
=
[].
concat
(
userReturnList
);
//添加新的tag
$
.
each
(
salesManList
,
function
(
i
,
item
){
$
(
'
#salesMan
'
).
tagEditor
(
'
addTag
'
,
item
.
name
);
});
}
else
if
(
refreshCode
==
'
-9999
'
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}
}});
});
/*********************** 商品表格操作 start ****************************/
//新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
()
{
addRow
();
});
});
//删除行
var
salesMan
=
""
;
$
(
"
body
"
).
on
(
"
click
"
,
"
#deleteRow
"
,
function
()
{
$
.
each
(
salesManList
,
function
(
i
,
item
)
{
deleteRow
();
salesMan
+=
item
.
id
+
'
,
'
;
//计算价格
calculatedTotalPrice
();
});
});
//新增行
var
params
=
{
function
addRow
()
{
supplierId
:
customerMation
.
id
,
//客户
var
par
=
{
operTime
:
$
(
"
#operTime
"
).
val
(),
id
:
"
row
"
+
rowNum
.
toString
(),
//checkbox的id
accountId
:
$
(
"
#accountId
"
).
val
(),
trId
:
"
tr
"
+
rowNum
.
toString
(),
//行的id
payType
:
$
(
"
#payType
"
).
val
(),
materialId
:
"
materialId
"
+
rowNum
.
toString
(),
//商品id
remark
:
$
(
"
#remark
"
).
val
(),
unitId
:
"
unitId
"
+
rowNum
.
toString
(),
//规格id
discount
:
isNull
(
$
(
"
#discount
"
).
val
())
?
"
0.00
"
:
$
(
"
#discount
"
).
val
(),
currentTock
:
"
currentTock
"
+
rowNum
.
toString
(),
//库存id
discountMoney
:
isNull
(
$
(
"
#discountMoney
"
).
val
())
?
"
0.00
"
:
$
(
"
#discountMoney
"
).
val
(),
nowNum
:
"
nowNum
"
+
rowNum
.
toString
(),
//剩余数量id
changeAmount
:
isNull
(
$
(
"
#changeAmount
"
).
val
())
?
"
0.00
"
:
$
(
"
#changeAmount
"
).
val
(),
rkNum
:
"
rkNum
"
+
rowNum
.
toString
(),
//数量id
depotheadStr
:
JSON
.
stringify
(
tableData
),
unitPrice
:
"
unitPrice
"
+
rowNum
.
toString
(),
//单价id
otherMoney
:
otherMoney
.
toFixed
(
2
),
amountOfMoney
:
"
amountOfMoney
"
+
rowNum
.
toString
(),
//金额id
otherMoneyList
:
JSON
.
stringify
(
tablePriceData
),
taxRate
:
"
taxRate
"
+
rowNum
.
toString
(),
//税率id
xsddOrderNum
:
xsddOrderNum
,
taxMoney
:
"
taxMoney
"
+
rowNum
.
toString
(),
//税额id
rowId
:
parent
.
rowId
,
taxUnitPrice
:
"
taxUnitPrice
"
+
rowNum
.
toString
(),
//含税单价id
salesMan
:
salesMan
,
taxLastMoney
:
"
taxLastMoney
"
+
rowNum
.
toString
(),
//含税合计id
submitType
:
submitType
,
remark
:
"
remark
"
+
rowNum
.
toString
()
//备注id
subType
:
subType
,
};
approvalId
:
approvalId
$
(
"
#useTable
"
).
append
(
getDataUseHandlebars
(
usetableTemplate
,
par
));
};
form
.
render
();
if
(
isStandard
){
rowNum
++
;
layer
.
confirm
(
'
该出库单已超出销售单数量,是否继续?
'
,
{
icon
:
3
,
title
:
'
超标提示
'
},
function
(
i
)
{
//设置根据某列变化的颜色
sendRequest
(
params
)
$
(
"
.
"
+
showTdByEdit
).
parent
().
css
({
'
background-color
'
:
'
#e6e6e6
'
});
});
}
else
{
sendRequest
(
params
)
}
}
}
//删除行
function
sendRequest
(
params
){
function
deleteRow
()
{
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
salesorder009
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
PUT
"
,
callback
:
function
(
json
)
{
var
checkRow
=
$
(
"
#useTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
if
(
json
.
returnCode
==
0
)
{
if
(
checkRow
.
length
>
0
)
{
dsFormUtil
.
savePageData
(
"
dsFormShow
"
,
json
.
bean
.
id
);
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
parent
.
layer
.
close
(
index
);
//删除allChooseProduct已选择的商品信息
parent
.
refreshCode
=
'
0
'
;
var
trId
=
$
(
item
).
parent
().
parent
().
attr
(
"
trcusid
"
);
allChooseProduct
[
trId
]
=
undefined
;
//移除界面上的信息
$
(
item
).
parent
().
parent
().
remove
();
});
}
else
{
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}
}});
}
//人员选择
$
(
"
body
"
).
on
(
"
click
"
,
"
#toSalesManSelPeople
"
,
function
(
e
){
userReturnList
=
[].
concat
(
salesManList
);
_openNewWindows
({
url
:
"
../../tpl/common/sysusersel.html
"
,
title
:
"
人员选择
"
,
pageId
:
"
sysuserselpage
"
,
area
:
[
'
80vw
'
,
'
80vh
'
],
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
//移除所有tag
var
tags
=
$
(
'
#salesMan
'
).
tagEditor
(
'
getTags
'
)[
0
].
tags
;
for
(
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
$
(
'
#salesMan
'
).
tagEditor
(
'
removeTag
'
,
tags
[
i
]);
}
salesManList
=
[].
concat
(
userReturnList
);
//添加新的tag
$
.
each
(
salesManList
,
function
(
i
,
item
){
$
(
'
#salesMan
'
).
tagEditor
(
'
addTag
'
,
item
.
name
);
});
}
else
if
(
refreshCode
==
'
-9999
'
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}
}});
});
/*********************** 商品表格操作 start ****************************/
//新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
()
{
addRow
();
});
//删除行
$
(
"
body
"
).
on
(
"
click
"
,
"
#deleteRow
"
,
function
()
{
deleteRow
();
//计算价格
calculatedTotalPrice
();
});
//新增行
function
addRow
()
{
var
par
=
{
id
:
"
row
"
+
rowNum
.
toString
(),
//checkbox的id
trId
:
"
tr
"
+
rowNum
.
toString
(),
//行的id
materialId
:
"
materialId
"
+
rowNum
.
toString
(),
//商品id
unitId
:
"
unitId
"
+
rowNum
.
toString
(),
//规格id
currentTock
:
"
currentTock
"
+
rowNum
.
toString
(),
//库存id
nowNum
:
"
nowNum
"
+
rowNum
.
toString
(),
//剩余数量id
rkNum
:
"
rkNum
"
+
rowNum
.
toString
(),
//数量id
unitPrice
:
"
unitPrice
"
+
rowNum
.
toString
(),
//单价id
amountOfMoney
:
"
amountOfMoney
"
+
rowNum
.
toString
(),
//金额id
taxRate
:
"
taxRate
"
+
rowNum
.
toString
(),
//税率id
taxMoney
:
"
taxMoney
"
+
rowNum
.
toString
(),
//税额id
taxUnitPrice
:
"
taxUnitPrice
"
+
rowNum
.
toString
(),
//含税单价id
taxLastMoney
:
"
taxLastMoney
"
+
rowNum
.
toString
(),
//含税合计id
remark
:
"
remark
"
+
rowNum
.
toString
()
//备注id
};
$
(
"
#useTable
"
).
append
(
getDataUseHandlebars
(
usetableTemplate
,
par
));
form
.
render
();
rowNum
++
;
//设置根据某列变化的颜色
$
(
"
.
"
+
showTdByEdit
).
parent
().
css
({
'
background-color
'
:
'
#e6e6e6
'
});
}
//删除行
function
deleteRow
()
{
var
checkRow
=
$
(
"
#useTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
if
(
checkRow
.
length
>
0
)
{
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
//删除allChooseProduct已选择的商品信息
var
trId
=
$
(
item
).
parent
().
parent
().
attr
(
"
trcusid
"
);
allChooseProduct
[
trId
]
=
undefined
;
//移除界面上的信息
$
(
item
).
parent
().
parent
().
remove
();
});
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
}
}
}
//客户选择
$
(
"
body
"
).
on
(
"
click
"
,
"
#customMationSel
"
,
function
(
e
){
//客户选择
_openNewWindows
({
$
(
"
body
"
).
on
(
"
click
"
,
"
#customMationSel
"
,
function
(
e
){
url
:
"
../../tpl/customermanage/customerChoose.html
"
,
_openNewWindows
({
title
:
"
选择客户
"
,
url
:
"
../../tpl/customermanage/customerChoose.html
"
,
pageId
:
"
customerchooselist
"
,
title
:
"
选择客户
"
,
area
:
[
'
90vw
'
,
'
90vh
'
],
pageId
:
"
customerchooselist
"
,
callBack
:
function
(
refreshCode
){
area
:
[
'
90vw
'
,
'
90vh
'
],
if
(
refreshCode
==
'
0
'
)
{
callBack
:
function
(
refreshCode
){
$
(
"
#customName
"
).
val
(
customerMation
.
customName
);
if
(
refreshCode
==
'
0
'
)
{
}
else
if
(
refreshCode
==
'
-9999
'
)
{
$
(
"
#customName
"
).
val
(
customerMation
.
customName
);
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}
else
if
(
refreshCode
==
'
-9999
'
)
{
}
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}});
}
});
}});
});
//商品选择
$
(
"
body
"
).
on
(
"
click
"
,
"
.chooseProductBtn
"
,
function
(
e
){
//商品选择
var
trId
=
$
(
this
).
parent
().
parent
().
attr
(
"
trcusid
"
);
$
(
"
body
"
).
on
(
"
click
"
,
"
.chooseProductBtn
"
,
function
(
e
){
_openNewWindows
({
var
trId
=
$
(
this
).
parent
().
parent
().
attr
(
"
trcusid
"
);
url
:
"
../../tpl/material/materialChoose.html
"
,
_openNewWindows
({
title
:
"
选择商品
"
,
url
:
"
../../tpl/material/materialChoose.html
"
,
pageId
:
"
productlist
"
,
title
:
"
选择商品
"
,
area
:
[
'
90vw
'
,
'
90vh
'
],
pageId
:
"
productlist
"
,
callBack
:
function
(
refreshCode
){
area
:
[
'
90vw
'
,
'
90vh
'
],
if
(
refreshCode
==
'
0
'
)
{
callBack
:
function
(
refreshCode
){
//获取表格行号
if
(
refreshCode
==
'
0
'
)
{
var
thisRowNum
=
trId
.
replace
(
"
tr
"
,
""
);
//获取表格行号
//商品赋值
var
thisRowNum
=
trId
.
replace
(
"
tr
"
,
""
);
allChooseProduct
[
trId
]
=
productMation
;
//商品赋值
//表格商品名称赋值
allChooseProduct
[
trId
]
=
productMation
;
$
(
"
#materialId
"
+
thisRowNum
.
toString
()).
val
(
allChooseProduct
[
trId
].
productName
+
"
(
"
+
allChooseProduct
[
trId
].
productModel
+
"
)
"
);
//表格商品名称赋值
//表格单位赋值
$
(
"
#materialId
"
+
thisRowNum
.
toString
()).
val
(
allChooseProduct
[
trId
].
productName
+
"
(
"
+
allChooseProduct
[
trId
].
productModel
+
"
)
"
);
$
(
"
#unitId
"
+
thisRowNum
.
toString
()).
html
(
getDataUseHandlebars
(
selOption
,
{
rows
:
allChooseProduct
[
trId
].
unitList
}));
//表格单位赋值
form
.
render
(
'
select
'
);
$
(
"
#unitId
"
+
thisRowNum
.
toString
()).
html
(
getDataUseHandlebars
(
selOption
,
{
rows
:
allChooseProduct
[
trId
].
unitList
}));
//计算价格
form
.
render
(
'
select
'
);
calculatedTotalPrice
();
//计算价格
}
else
if
(
refreshCode
==
'
-9999
'
)
{
calculatedTotalPrice
();
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}
else
if
(
refreshCode
==
'
-9999
'
)
{
}
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.operationFailed
"
][
languageType
],
{
icon
:
2
,
time
:
2000
});
}});
}
});
}});
});
/*********************** 商品表格操作 end ****************************/
/*********************** 商品表格操作 end ****************************/
/*********************** 其他费用表格操作 start ****************************/
/*********************** 其他费用表格操作 start ****************************/
//其他费用变化
$
(
"
body
"
).
on
(
"
input
"
,
"
.otherPrice
"
,
function
()
{
//计算价格
calculationPrice
();
});
$
(
"
body
"
).
on
(
"
change
"
,
"
.otherPrice
"
,
function
()
{
//计算价格
calculationPrice
();
});
//计算其他费用总价格
function
calculationPrice
(){
var
rowTr
=
$
(
"
#otherPriceTable tr
"
);
var
allPrice
=
0
;
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
//获取行坐标
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
//获取
var
otherPrice
=
parseFloat
(
isNull
(
$
(
"
#otherPrice
"
+
rowNum
).
val
())
?
0
:
$
(
"
#otherPrice
"
+
rowNum
).
val
());
allPrice
+=
otherPrice
;
});
$
(
"
#otherPriceTotal
"
).
html
(
"
费用合计:
"
+
allPrice
.
toFixed
(
2
));
}
//新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addPriceRow
"
,
function
()
{
addPriceRow
();
});
//删除行
//其他费用变化
$
(
"
body
"
).
on
(
"
click
"
,
"
#deletePriceRow
"
,
function
()
{
$
(
"
body
"
).
on
(
"
input
"
,
"
.otherPrice
"
,
function
()
{
deletePriceRow
();
//计算价格
calculationPrice
();
});
$
(
"
body
"
).
on
(
"
change
"
,
"
.otherPrice
"
,
function
()
{
//计算价格
calculationPrice
();
});
//计算其他费用总价格
function
calculationPrice
(){
var
rowTr
=
$
(
"
#otherPriceTable tr
"
);
var
allPrice
=
0
;
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
//获取行坐标
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
//获取
var
otherPrice
=
parseFloat
(
isNull
(
$
(
"
#otherPrice
"
+
rowNum
).
val
())
?
0
:
$
(
"
#otherPrice
"
+
rowNum
).
val
());
allPrice
+=
otherPrice
;
});
});
$
(
"
#otherPriceTotal
"
).
html
(
"
费用合计:
"
+
allPrice
.
toFixed
(
2
));
}
//新增行
//新增行
function
addPriceRow
()
{
$
(
"
body
"
).
on
(
"
click
"
,
"
#addPriceRow
"
,
function
()
{
var
par
=
{
addPriceRow
();
id
:
"
row
"
+
priceNum
.
toString
(),
//checkbox的id
});
trId
:
"
tr
"
+
priceNum
.
toString
(),
//行的id
inoutitemId
:
"
inoutitemId
"
+
priceNum
.
toString
(),
//支出项目id
otherPrice
:
"
otherPrice
"
+
priceNum
.
toString
()
//金额id
};
$
(
"
#otherPriceTable
"
).
append
(
getDataUseHandlebars
(
otherTemplate
,
par
));
//赋值给支出项目
$
(
"
#
"
+
"
inoutitemId
"
+
priceNum
.
toString
()).
html
(
inoutitemHtml
);
form
.
render
(
'
select
'
);
form
.
render
(
'
checkbox
'
);
priceNum
++
;
}
//删除行
//删除行
function
deletePriceRow
()
{
$
(
"
body
"
).
on
(
"
click
"
,
"
#deletePriceRow
"
,
function
()
{
var
checkRow
=
$
(
"
#otherPriceTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
deletePriceRow
();
if
(
checkRow
.
length
>
0
)
{
});
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
$
(
item
).
parent
().
parent
().
remove
();
//新增行
});
function
addPriceRow
()
{
}
else
{
var
par
=
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
id
:
"
row
"
+
priceNum
.
toString
(),
//checkbox的id
}
trId
:
"
tr
"
+
priceNum
.
toString
(),
//行的id
//计算价格
inoutitemId
:
"
inoutitemId
"
+
priceNum
.
toString
(),
//支出项目id
calculationPrice
();
otherPrice
:
"
otherPrice
"
+
priceNum
.
toString
()
//金额id
};
$
(
"
#otherPriceTable
"
).
append
(
getDataUseHandlebars
(
otherTemplate
,
par
));
//赋值给支出项目
$
(
"
#
"
+
"
inoutitemId
"
+
priceNum
.
toString
()).
html
(
inoutitemHtml
);
form
.
render
(
'
select
'
);
form
.
render
(
'
checkbox
'
);
priceNum
++
;
}
//删除行
function
deletePriceRow
()
{
var
checkRow
=
$
(
"
#otherPriceTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
if
(
checkRow
.
length
>
0
)
{
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
$
(
item
).
parent
().
parent
().
remove
();
});
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
}
}
//计算价格
calculationPrice
();
}
/*********************** 其他费用表格操作 end ****************************/
/*********************** 其他费用表格操作 end ****************************/
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
parent
.
layer
.
close
(
index
);
parent
.
layer
.
close
(
index
);
});
});
});
});
});
\ No newline at end of file
erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js
浏览文件 @
a3594154
...
@@ -92,8 +92,6 @@ layui.config({
...
@@ -92,8 +92,6 @@ layui.config({
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
var
product
=
allChooseProduct
[
"
tr
"
+
thisRowNum
.
toString
()];
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
$
.
each
(
product
.
unitList
,
function
(
j
,
bean
)
{
if
(
thisRowValue
==
bean
.
id
){
//获取规格
if
(
thisRowValue
==
bean
.
id
){
//获取规格
//获取当前行数量
var
rkNum
=
parseInt
(
$
(
"
#rkNum
"
+
thisRowNum
).
val
());
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
salePrice
.
toFixed
(
2
));
//单价
$
(
"
#unitPrice
"
+
thisRowNum
).
val
(
bean
.
salePrice
.
toFixed
(
2
));
//单价
return
false
;
return
false
;
}
}
...
...
erp/src/main/resources/template/tpl/purchaseorder/purchaseorderpurchase.html
浏览文件 @
a3594154
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<div
class=
"layui-form-item layui-col-xs6"
>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
入库仓库
<i
class=
"red"
>
*
</i></label>
<label
class=
"layui-form-label"
>
入库仓库
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<select
id=
"depotId"
name=
"depotId"
lay-search=
""
win-verify=
"required"
>
<select
id=
"depotId"
name=
"depotId"
lay-search=
""
win-verify=
"required"
lay-filter=
"depotId"
>
</select>
</select>
</div>
</div>
...
...
erp/src/main/resources/template/tpl/salesorder/salesorderpurchase.html
浏览文件 @
a3594154
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<div
class=
"layui-form-item layui-col-xs6"
>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
出库仓库
<i
class=
"red"
>
*
</i></label>
<label
class=
"layui-form-label"
>
出库仓库
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<select
id=
"depotId"
name=
"depotId"
lay-search=
""
win-verify=
"required"
>
<select
id=
"depotId"
name=
"depotId"
lay-search=
""
win-verify=
"required"
lay-filter=
"depotId"
>
</select>
</select>
</div>
</div>
...
@@ -161,10 +161,15 @@
...
@@ -161,10 +161,15 @@
</table>
</table>
</div>
</div>
</div>
</div>
<div
id=
"dsFormShow"
>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<div
class=
"layui-form-item layui-col-xs12"
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
><language
showName=
"com.skyeye.cancel"
></language></button>
<button
class=
"winui-btn"
id=
"cancle"
><language
showName=
"com.skyeye.cancel"
></language></button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formEditBean"
><language
showName=
"com.skyeye.save"
></language></button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddBean"
>
保存为草稿
</button>
<button
class=
"winui-btn submitTypeIsOne"
lay-submit
lay-filter=
"formSubOneBean"
>
提交审批
</button>
<button
class=
"winui-btn submitTypeIsTwo"
lay-submit
lay-filter=
"formSubTwoBean"
>
提交
</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录