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
9acdd2a8
Commit
9acdd2a8
authored
May 10, 2019
by
qiankunpingtai
Browse files
修改零售出库列表,去掉多余js
parent
3aab5d92
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/retail_out_list.js
View file @
9acdd2a8
...
@@ -18,13 +18,6 @@ var depotHeadID = 0;
...
@@ -18,13 +18,6 @@ var depotHeadID = 0;
var preTotalPrice = 0; //前一次加载的金额
var preTotalPrice = 0; //前一次加载的金额
var orgDepotHead = "";
var orgDepotHead = "";
var editIndex = undefined;
var editIndex = undefined;
var
listTitle
=
""
;
//单据标题
var
listType
=
""
;
//入库 出库
var
listSubType
=
""
;
//采购 销售等
var
payTypeTitle
=
""
;
//付款 收款
var
organUrl
=
""
;
//组织数据接口地址
var
amountNum
=
""
;
//单据编号开头字符
var
depotString
=
""
;
//店铺id列表
/**默认编号有意义吗,不如空着吧*/
/**默认编号有意义吗,不如空着吧*/
var orgDefaultId=''; //单位默认编号
var orgDefaultId=''; //单位默认编号
var orgDefaultList; //存储查询出来的会员列表
var orgDefaultList; //存储查询出来的会员列表
...
@@ -37,9 +30,18 @@ var otherColumns = true; //明细中的‘别名’列是否显示
...
@@ -37,9 +30,18 @@ var otherColumns = true; //明细中的‘别名’列是否显示
var btnEnableList = getBtnStr(); //获取按钮的权限
var btnEnableList = getBtnStr(); //获取按钮的权限
var mPropertyList = ""; //商品属性列表
var mPropertyList = ""; //商品属性列表
var defaultAccountId = 0; //默认账户id
var defaultAccountId = 0; //默认账户id
//改变宽度和高度
$("#searchPanel").panel({width:webW-2});
$("#tablePanel").panel({width:webW-2});
var listTitle = "零售出库列表"; //单据标题
var depotString = "|"; //店铺id列表
var listType ="出库";//入库 出库
var listSubType = "零售";//采购 销售等
var payTypeTitle = "收款"; //付款 收款
var organUrl ="/supplier/findBySelect_retail"; //组织数据接口地址
var amountNum ="LSCK";//单据编号开头字符
$(function(){
$(function(){
//初始化系统基础信息
//初始化系统基础信息
getType
();
initSystemData_UB();
initSystemData_UB();
initSelectInfo_UB();
initSelectInfo_UB();
initSystemData_depot();
initSystemData_depot();
...
@@ -57,108 +59,7 @@ $(function(){
...
@@ -57,108 +59,7 @@ $(function(){
initForm();
initForm();
bindEvent();//绑定操作事件
bindEvent();//绑定操作事件
});
});
//根据单据名称获取类型
function
getType
(){
listTitle
=
$
(
"
#tablePanel
"
).
prev
().
text
();
depotString
=
"
|
"
;
//改变宽度和高度
$
(
"
#searchPanel
"
).
panel
({
width
:
webW
-
2
});
$
(
"
#tablePanel
"
).
panel
({
width
:
webW
-
2
});
var
supUrl
=
"
/supplier/findBySelect_sup
"
;
//供应商接口
var
cusUrl
=
"
/supplier/findBySelect_cus?UBType=UserCustomer&UBKeyId=
"
+
kid
;
//客户接口
var
retailUrl
=
"
/supplier/findBySelect_retail
"
;
//散户接口
if
(
listTitle
===
"
采购订单列表
"
){
listType
=
"
其它
"
;
listSubType
=
"
采购订单
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
supUrl
;
amountNum
=
"
CGDD
"
;
}
else
if
(
listTitle
===
"
采购入库列表
"
){
listType
=
"
入库
"
;
listSubType
=
"
采购
"
;
payTypeTitle
=
"
付款
"
;
organUrl
=
supUrl
;
amountNum
=
"
CGRK
"
;
}
else
if
(
listTitle
===
"
零售退货列表
"
){
listType
=
"
入库
"
;
listSubType
=
"
零售退货
"
;
//注:用预付款购买的产品不能退货
payTypeTitle
=
"
付款
"
;
organUrl
=
retailUrl
;
amountNum
=
"
LSTH
"
;
}
else
if
(
listTitle
===
"
销售退货列表
"
){
listType
=
"
入库
"
;
listSubType
=
"
销售退货
"
;
payTypeTitle
=
"
付款
"
;
organUrl
=
cusUrl
;
amountNum
=
"
XSTH
"
;
}
else
if
(
listTitle
===
"
其它入库列表
"
){
listType
=
"
入库
"
;
listSubType
=
"
其它
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
supUrl
;
amountNum
=
"
QTRK
"
;
}
else
if
(
listTitle
===
"
零售出库列表
"
){
listType
=
"
出库
"
;
listSubType
=
"
零售
"
;
payTypeTitle
=
"
收款
"
;
organUrl
=
retailUrl
;
amountNum
=
"
LSCK
"
;
}
else
if
(
listTitle
===
"
销售订单列表
"
){
listType
=
"
其它
"
;
listSubType
=
"
销售订单
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
cusUrl
;
amountNum
=
"
XSDD
"
;
}
else
if
(
listTitle
===
"
销售出库列表
"
){
listType
=
"
出库
"
;
listSubType
=
"
销售
"
;
payTypeTitle
=
"
收款
"
;
organUrl
=
cusUrl
;
amountNum
=
"
XSCK
"
;
}
else
if
(
listTitle
===
"
采购退货列表
"
){
listType
=
"
出库
"
;
listSubType
=
"
采购退货
"
;
payTypeTitle
=
"
收款
"
;
organUrl
=
supUrl
;
amountNum
=
"
CGTH
"
;
}
else
if
(
listTitle
===
"
其它出库列表
"
){
listType
=
"
出库
"
;
listSubType
=
"
其它
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
cusUrl
;
amountNum
=
"
QTCK
"
;
}
else
if
(
listTitle
===
"
调拨出库列表
"
){
listType
=
"
出库
"
;
listSubType
=
"
调拨
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
supUrl
;
amountNum
=
"
DBCK
"
;
}
else
if
(
listTitle
===
"
组装单列表
"
){
listType
=
"
其它
"
;
listSubType
=
"
组装单
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
supUrl
;
amountNum
=
"
ZZD
"
;
}
else
if
(
listTitle
===
"
拆卸单列表
"
){
listType
=
"
其它
"
;
listSubType
=
"
拆卸单
"
;
payTypeTitle
=
"
隐藏
"
;
organUrl
=
supUrl
;
amountNum
=
"
CXD
"
;
}
}
//初始化系统基础信息
//初始化系统基础信息
function initSystemData_UB(){
function initSystemData_UB(){
$.ajax({
$.ajax({
...
@@ -264,12 +165,9 @@ function initSupplier(){
...
@@ -264,12 +165,9 @@ function initSupplier(){
orgDefaultId = data[i].id;
orgDefaultId = data[i].id;
}
}
}
}
if
(
listSubType
===
"
零售
"
){
orgDefaultList = res;
orgDefaultList
=
res
;
}
},
},
onSelect: function(rec){
onSelect: function(rec){
if
(
listSubType
===
"
零售
"
){
var option = "";
var option = "";
if(rec.supplier !== "非会员" && rec.advanceIn >0){
if(rec.supplier !== "非会员" && rec.advanceIn >0){
option = '<option value="预付款">预付款(' + rec.advanceIn + ')</option>';
option = '<option value="预付款">预付款(' + rec.advanceIn + ')</option>';
...
@@ -280,27 +178,6 @@ function initSupplier(){
...
@@ -280,27 +178,6 @@ function initSupplier(){
}
}
$("#payType").empty().append(option);
$("#payType").empty().append(option);
}
}
else
{
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/supplier/findById
"
,
data
:
{
supplierId
:
rec
.
id
},
dataType
:
"
json
"
,
success
:
function
(
res
){
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
&&
res
.
data
[
0
]){
thisTaxRate
=
res
.
data
[
0
].
taxRate
;
//设置当前的税率
}
}
},
error
:
function
(){
}
});
}
}
});
});
}
}
...
@@ -504,38 +381,11 @@ function initTableData(){
...
@@ -504,38 +381,11 @@ function initTableData(){
else {
else {
isHiddenStatus = true; //隐藏
isHiddenStatus = true; //隐藏
}
}
var
isShowLastMoneyColumn
=
false
;
//是否显示优惠后金额和价税合计,true为隐藏,false为显示
var isShowLastMoneyColumn = true; //是否显示优惠后金额和价税合计,true为隐藏,false为显示
if
(
listSubType
==
"
调拨
"
||
listSubType
==
"
其它
"
||
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
||
listSubType
==
"
采购订单
"
||
listSubType
==
"
销售订单
"
||
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowLastMoneyColumn
=
true
;
//隐藏
}
var isShowOrganNameColumn = false; //是否显示供应商、客户等信息,true为隐藏,false为显示
var isShowOrganNameColumn = false; //是否显示供应商、客户等信息,true为隐藏,false为显示
var
organNameTitle
=
""
;
//组织名称标题
var organNameTitle = "会员卡号"; //组织名称标题
if
(
listSubType
==
"
调拨
"
||
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowOrganNameColumn
=
true
;
//隐藏
}
else
{
if
(
listTitle
==
"
采购订单列表
"
||
listTitle
==
"
采购入库列表
"
||
listTitle
==
"
采购退货列表
"
||
listTitle
==
"
其它入库列表
"
){
organNameTitle
=
"
供应商名称
"
;
}
else
if
(
listTitle
==
"
销售订单列表
"
||
listTitle
==
"
销售退货列表
"
||
listTitle
==
"
销售出库列表
"
||
listTitle
==
"
其它出库列表
"
){
organNameTitle
=
"
客户名称
"
;
}
else
if
(
listTitle
==
"
零售出库列表
"
||
listTitle
==
"
零售退货列表
"
){
organNameTitle
=
"
会员卡号
"
;
}
}
var opWidth = 90; //操作宽度
var opWidth = 90; //操作宽度
var
isShowSkip
=
false
;
//是否显示跳转按钮
var opTitle = ""; //跳转按钮的标题
var opTitle = ""; //跳转按钮的标题
if
(
listTitle
==
"
采购订单列表
"
)
{
opWidth
=
120
;
isShowSkip
=
true
;
opTitle
=
"
转采购入库
"
;
}
else
if
(
listTitle
==
"
销售订单列表
"
)
{
opWidth
=
120
;
isShowSkip
=
true
;
opTitle
=
"
转销售出库
"
;
}
$('#tableData').datagrid({
$('#tableData').datagrid({
height:heightInfo,
height:heightInfo,
rownumbers: false,
rownumbers: false,
...
@@ -555,25 +405,10 @@ function initTableData(){
...
@@ -555,25 +405,10 @@ function initTableData(){
{ title: '操作',field: 'op',align:"center",width:opWidth,
{ title: '操作',field: 'op',align:"center",width:opWidth,
formatter:function(value, rec,index) {
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(\'' + index + '\');"/> ';
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(\'' + index + '\''+',' + rec.status + ');"/> ';
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + index + '\''+',' + 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 + ');"/>';
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
)
{
str
+=
'
<img title="
'
+
opTitle
+
'
" src="/js/easyui-1.3.5/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(
\'
'
+
index
+
'
\'
'
+
'
,
'
+
rec
.
status
+
'
);"/>
'
;
}
return str;
return str;
}
}
},
},
...
@@ -607,11 +442,6 @@ function initTableData(){
...
@@ -607,11 +442,6 @@ function initTableData(){
} else if(value === "1") {
} else if(value === "1") {
return "<span style='color:green;'>已审核</span>";
return "<span style='color:green;'>已审核</span>";
} else if(value === "2") {
} else if(value === "2") {
if
(
listTitle
==
"
采购订单列表
"
)
{
return
"
<span style='color:blue;'>已转采购</span>
"
;
}
else
if
(
listTitle
==
"
销售订单列表
"
)
{
return
"
<span style='color:blue;'>已转销售</span>
"
;
}
}
}
}
}
}
}
...
@@ -650,23 +480,12 @@ function findStockNumById(depotId, mId, monthTime, body, input, ratio, type){
...
@@ -650,23 +480,12 @@ function findStockNumById(depotId, mId, monthTime, body, input, ratio, type){
var basicUnit = unitArr[0]; //基础单位
var basicUnit = unitArr[0]; //基础单位
var otherUnit = unitArr[1]; //副单位
var otherUnit = unitArr[1]; //副单位
var unitSetInput =""; //单位
var unitSetInput =""; //单位
if
(
listSubType
===
"
采购订单
"
||
listSubType
===
"
采购
"
||
listSubType
===
"
采购退货
"
){
unitSetInput = rec.data[0].firstoutunit;
unitSetInput
=
rec
.
data
[
0
].
firstinunit
;
if(basicUnit==unitSetInput){ //基础单位等于选择的单位
if
(
basicUnit
==
unitSetInput
){
//基础单位等于选择的单位
loadRatio = 1;
loadRatio
=
1
;
}
else
if
(
otherUnit
==
unitSetInput
){
//副单位等于选择的单位
loadRatio
=
thisRatio
;
}
}
}
else
if
(
listSubType
===
"
销售订单
"
||
listSubType
===
"
销售
"
||
listSubType
===
"
销售退货
"
||
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
){
else if(otherUnit==unitSetInput){ //副单位等于选择的单位
unitSetInput
=
rec
.
data
[
0
].
firstoutunit
;
loadRatio = thisRatio;
if
(
basicUnit
==
unitSetInput
){
//基础单位等于选择的单位
loadRatio
=
1
;
}
else
if
(
otherUnit
==
unitSetInput
){
//副单位等于选择的单位
loadRatio
=
thisRatio
;
}
}
}
}
}
//查询库存
//查询库存
...
@@ -746,10 +565,8 @@ function statisticsFun(body,UnitPrice,OperNumber,footer,taxRate){
...
@@ -746,10 +565,8 @@ function statisticsFun(body,UnitPrice,OperNumber,footer,taxRate){
var changeAmountNum = $("#ChangeAmount").val()-0; //本次付款或者收款
var changeAmountNum = $("#ChangeAmount").val()-0; //本次付款或者收款
$("#Debt").val((discountLastMoney-changeAmountNum).toFixed(2)); //本次欠款
$("#Debt").val((discountLastMoney-changeAmountNum).toFixed(2)); //本次欠款
if
(
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
)
{
$("#ChangeAmount, #getAmount").val((TotalPrice).toFixed(2));
$
(
"
#ChangeAmount, #getAmount
"
).
val
((
TotalPrice
).
toFixed
(
2
));
$("#backAmount").val(0);
$
(
"
#backAmount
"
).
val
(
0
);
}
}
}
//初始化表格数据-商品列表-编辑状态
//初始化表格数据-商品列表-编辑状态
function initTableData_material(type,TotalPrice){
function initTableData_material(type,TotalPrice){
...
@@ -764,23 +581,11 @@ function initTableData_material(type,TotalPrice){
...
@@ -764,23 +581,11 @@ function initTableData_material(type,TotalPrice){
var anotherDepotHeadName = ""; //对方仓库的列的标题
var anotherDepotHeadName = ""; //对方仓库的列的标题
var anotherDepotUrl = ""; //对方仓库接口地址
var anotherDepotUrl = ""; //对方仓库接口地址
var anotherDepotTextField = "";
var anotherDepotTextField = "";
if
(
listSubType
==
"
调拨
"
){
isShowAnotherDepot
=
false
;
//调拨时候显示对方仓库
anotherDepotHeadName
=
"
调入仓库
"
;
anotherDepotUrl
=
'
/depot/findDepotByUserId?UBType=UserDepot&UBKeyId=
'
+
kid
;
anotherDepotTextField
=
"
depotName
"
;
}
depotHeadName = "仓库名称";
depotHeadName = "仓库名称";
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
depotTextField = "depotName";
depotTextField = "depotName";
var
isShowTaxColumn
=
false
;
//是否显示税率相关的列,true为隐藏,false为显示
var isShowTaxColumn = true; //是否显示税率相关的列,true为隐藏,false为显示
if
(
listSubType
==
"
调拨
"
||
listSubType
==
"
其它
"
||
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
||
listSubType
==
"
采购订单
"
||
listSubType
==
"
销售订单
"
||
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowTaxColumn
=
true
;
//隐藏
}
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
if
(
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowMaterialTypeColumn
=
false
;
//显示
}
$('#materialData').datagrid({
$('#materialData').datagrid({
height:245,
height:245,
rownumbers: false,
rownumbers: false,
...
@@ -905,23 +710,12 @@ function initTableData_material(type,TotalPrice){
...
@@ -905,23 +710,12 @@ function initTableData_material(type,TotalPrice){
var unitSetInput =""; //单位
var unitSetInput =""; //单位
body.find("[field='Unit']").find(input).prop("readonly","readonly"); //设置计量单位为只读
body.find("[field='Unit']").find(input).prop("readonly","readonly"); //设置计量单位为只读
var loadRatio = 1; //在单位输入框上面加载比例字段
var loadRatio = 1; //在单位输入框上面加载比例字段
if
(
listSubType
===
"
采购
"
||
listSubType
===
"
采购退货
"
||
listSubType
===
"
采购订单
"
){
unitSetInput = res.data[0].firstoutunit; //给单位文本框赋值
unitSetInput
=
res
.
data
[
0
].
firstinunit
;
//给单位文本框赋值
if(basicUnit==unitSetInput){ //基础单位等于选择的单位
if
(
basicUnit
==
unitSetInput
){
//基础单位等于选择的单位
loadRatio = 1;
loadRatio
=
1
;
}
else
if
(
otherUnit
==
unitSetInput
){
//副单位等于选择的单位
loadRatio
=
ratio
;
}
}
}
else
if
(
listSubType
===
"
销售
"
||
listSubType
===
"
销售退货
"
||
listSubType
===
"
销售订单
"
||
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
){
else if(otherUnit==unitSetInput){ //副单位等于选择的单位
unitSetInput
=
res
.
data
[
0
].
firstoutunit
;
//给单位文本框赋值
loadRatio = ratio;
if
(
basicUnit
==
unitSetInput
){
//基础单位等于选择的单位
loadRatio
=
1
;
}
else
if
(
otherUnit
==
unitSetInput
){
//副单位等于选择的单位
loadRatio
=
ratio
;
}
}
}
body.find("[field='Unit']").find(input).val(unitSetInput).attr("data-ratio", loadRatio); //设置-首选单位
body.find("[field='Unit']").find(input).val(unitSetInput).attr("data-ratio", loadRatio); //设置-首选单位
...
@@ -952,27 +746,11 @@ function initTableData_material(type,TotalPrice){
...
@@ -952,27 +746,11 @@ function initTableData_material(type,TotalPrice){
var type = $(this).attr("data-type");
var type = $(this).attr("data-type");
var UnitPrice = 0;
var UnitPrice = 0;
if(type === "basic"){
if(type === "basic"){
if
(
listTitle
==
"
采购订单列表
"
||
listTitle
==
"
采购入库列表
"
||
listTitle
==
"
销售退货列表
"
||
listTitle
==
"
其它入库列表
"
)
{
UnitPrice = retailPriceOne;
UnitPrice
=
basicPresetPriceOne
;
}
else
if
(
listTitle
==
"
销售订单列表
"
||
listTitle
==
"
销售出库列表
"
||
listTitle
==
"
采购退货列表
"
||
listTitle
==
"
其它出库列表
"
||
listTitle
==
"
调拨出库列表
"
)
{
UnitPrice
=
basicPresetPriceTwo
;
}
else
if
(
listTitle
==
"
零售出库列表
"
||
listTitle
==
"
零售退货列表
"
){
UnitPrice
=
retailPriceOne
;
}
body.find("[field='Stock']").find(input).val(stock); //修改库存
body.find("[field='Stock']").find(input).val(stock); //修改库存
}
}
else if(type === "other"){
else if(type === "other"){
if
(
listTitle
==
"
采购订单列表
"
||
listTitle
==
"
采购入库列表
"
||
listTitle
==
"
销售退货列表
"
||
listTitle
==
"
其它入库列表
"
)
{
UnitPrice = retailPriceTwo;
UnitPrice
=
otherPresetPriceOne
;
}
else
if
(
listTitle
==
"
销售订单列表
"
||
listTitle
==
"
销售出库列表
"
||
listTitle
==
"
采购退货列表
"
||
listTitle
==
"
其它出库列表
"
||
listTitle
==
"
调拨出库列表
"
)
{
UnitPrice
=
otherPresetPriceTwo
;
}
else
if
(
listTitle
==
"
零售出库列表
"
||
listTitle
==
"
零售退货列表
"
){
UnitPrice
=
retailPriceTwo
;
}
body.find("[field='Stock']").find(input).val((stock/ratio).toFixed(2)); //修改库存
body.find("[field='Stock']").find(input).val((stock/ratio).toFixed(2)); //修改库存
}
}
body.find("[field='UnitPrice']").find(input).val(UnitPrice); //单价
body.find("[field='UnitPrice']").find(input).val(UnitPrice); //单价
...
@@ -992,43 +770,15 @@ function initTableData_material(type,TotalPrice){
...
@@ -992,43 +770,15 @@ function initTableData_material(type,TotalPrice){
});
});
}
}
var detailPrice = 0; //明细列表-单价
var detailPrice = 0; //明细列表-单价
if
(
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
)
{
if(res.data[0].unit) { //如果存在计量单位信息
if
(
res
.
data
[
0
].
unit
)
{
//如果存在计量单位信息
detailPrice = retailPrice;
detailPrice
=
retailPrice
;
}
else
{
if
(
firstOutUnit
==
basicUnit
)
{
detailPrice
=
retailPriceOne
;
}
else
if
(
firstOutUnit
==
otherUnit
)
{
detailPrice
=
retailPriceTwo
;
}
}
}
}
else
if
(
listTitle
==
"
采购订单列表
"
||
listTitle
==
"
采购入库列表
"
||
listTitle
==
"
销售退货列表
"
||
listTitle
==
"
其它入库列表
"
)
{
else {
if
(
res
.
data
[
0
].
unit
)
{
//如果存在计量单位信息
if (firstOutUnit == basicUnit) {
detailPrice
=
presetPriceOne
;
detailPrice = retailPriceOne;
}
else
{
if
(
firstInUnit
==
basicUnit
)
{
detailPrice
=
basicPresetPriceOne
;
}
else
if
(
firstInUnit
==
otherUnit
)
{
detailPrice
=
otherPresetPriceOne
;
}
}
}
else
if
(
listTitle
==
"
销售订单列表
"
||
listTitle
==
"
销售出库列表
"
||
listTitle
==
"
采购退货列表
"
||
listTitle
==
"
其它出库列表
"
||
listTitle
==
"
调拨出库列表
"
)
{
if
(
res
.
data
[
0
].
unit
)
{
//如果存在计量单位信息
detailPrice
=
presetPriceTwo
;
}
}
else
{
else if (firstOutUnit == otherUnit) {
if
(
firstOutUnit
==
basicUnit
)
{
detailPrice = retailPriceTwo;
detailPrice
=
basicPresetPriceTwo
;
}
else
if
(
firstOutUnit
==
otherUnit
){
detailPrice
=
otherPresetPriceTwo
;
}
}
}
}
}
body.find("[field='OperNumber']").find(input).val(1); //数量初始化为1
body.find("[field='OperNumber']").find(input).val(1); //数量初始化为1
...
@@ -1175,19 +925,9 @@ function initTableData_material_show(TotalPrice){
...
@@ -1175,19 +925,9 @@ function initTableData_material_show(TotalPrice){
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
var anotherDepotHeadName = ""; //对方仓库的列的标题
var anotherDepotHeadName = ""; //对方仓库的列的标题
var depotHeadName = ""; //仓库的列的标题
var depotHeadName = ""; //仓库的列的标题
if
(
listSubType
==
"
调拨
"
){
isShowAnotherDepot
=
false
;
//调拨时候显示对方仓库
anotherDepotHeadName
=
"
调入仓库
"
;
}
depotHeadName = "仓库名称";
depotHeadName = "仓库名称";
var
isShowTaxColumn
=
false
;
//是否显示税率相关的列,true为隐藏,false为显示
var isShowTaxColumn = true; //是否显示税率相关的列,true为隐藏,false为显示
if
(
listSubType
==
"
调拨
"
||
listSubType
==
"
其它
"
||
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
||
listSubType
==
"
采购订单
"
||
listSubType
==
"
销售订单
"
||
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowTaxColumn
=
true
;
//隐藏
}
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
if
(
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
isShowMaterialTypeColumn
=
false
;
//显示
}
$('#materialDataShow').datagrid({
$('#materialDataShow').datagrid({
height:245,
height:245,
rownumbers: true,
rownumbers: true,
...
@@ -1313,7 +1053,6 @@ function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){
...
@@ -1313,7 +1053,6 @@ function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){
});
});
//更新会员的预收款信息
//更新会员的预收款信息
if
(
listSubType
===
"
零售
"
)
{
$.ajax({
$.ajax({
type:"post",
type:"post",
url: "/supplier/updateAdvanceIn",
url: "/supplier/updateAdvanceIn",
...
@@ -1332,7 +1071,6 @@ function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){
...
@@ -1332,7 +1071,6 @@ function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){
return;
return;
}
}
});
});
}
}
}
});
});
}
}
...
@@ -1345,11 +1083,6 @@ function skipDepotHead(index, status){
...
@@ -1345,11 +1083,6 @@ function skipDepotHead(index, status){
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
} else {
} else {
sessionStorage.setItem("rowInfo", JSON.stringify(rowsdata)); //将单据信息存入缓存中
sessionStorage.setItem("rowInfo", JSON.stringify(rowsdata)); //将单据信息存入缓存中
if
(
listTitle
==
"
采购订单列表
"
)
{
parent
.
addTab
(
"
订单转采购
"
,
"
../materials/purchase_in_list.html?t=skip
"
,
""
);
}
else
if
(
listTitle
==
"
销售订单列表
"
)
{
parent
.
addTab
(
"
订单转销售
"
,
"
../materials/sale_out_list.html?t=skip
"
,
""
);
}
}
}
}
}
...
@@ -1379,7 +1112,6 @@ function batDeleteDepotHead(){
...
@@ -1379,7 +1112,6 @@ function batDeleteDepotHead(){
if (ids) {
if (ids) {
//批量更新会员的预收款信息
//批量更新会员的预收款信息
for (var i = 0; i < row.length; i++) {
for (var i = 0; i < row.length; i++) {
if
(
listSubType
===
"
零售
"
)
{
$.ajax({
$.ajax({
type: "post",
type: "post",
url: "/supplier/updateAdvanceIn",
url: "/supplier/updateAdvanceIn",
...
@@ -1398,7 +1130,6 @@ function batDeleteDepotHead(){
...
@@ -1398,7 +1130,6 @@ function batDeleteDepotHead(){
return;
return;
}
}
});
});
}
}
}
//批量删除
//批量删除
$.ajax({
$.ajax({
...
@@ -1602,7 +1333,6 @@ function addDepotHead(){
...
@@ -1602,7 +1333,6 @@ function addDepotHead(){
url = '/depotHead/addDepotHeadAndDetail';
url = '/depotHead/addDepotHeadAndDetail';
//零售单据修改收款时,自动计算找零
//零售单据修改收款时,自动计算找零
if
(
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
)
{
$("#payType").val("现付");
$("#payType").val("现付");
$("#OrganId").combobox("setValue", orgDefaultId); //自动默认选择非会员
$("#OrganId").combobox("setValue", orgDefaultId); //自动默认选择非会员
// 鼠标点下时清空选择项
// 鼠标点下时清空选择项
...
@@ -1642,7 +1372,6 @@ function addDepotHead(){
...
@@ -1642,7 +1372,6 @@ function addDepotHead(){
backAmount.val((getAmount.val()-changeAmount.val()).toFixed(2));
backAmount.val((getAmount.val()-changeAmount.val()).toFixed(2));
}
}
});
});
}
}
}
//编辑信息
//编辑信息
...
@@ -1698,7 +1427,6 @@ function editDepotHead(index, status){
...
@@ -1698,7 +1427,6 @@ function editDepotHead(index, status){
$(".window-mask").css({ width: webW ,height: webH});
$(".window-mask").css({ width: webW ,height: webH});
depotHeadID = rowsdata.id;
depotHeadID = rowsdata.id;
if
(
listSubType
==
"
零售
"
){
var option = "";
var option = "";
if(rowsdata.paytype == "预付款"){
if(rowsdata.paytype == "预付款"){
option = '<option value="预付款">预付款</option>';
option = '<option value="预付款">预付款</option>';
...
@@ -1708,20 +1436,7 @@ function editDepotHead(index, status){
...
@@ -1708,20 +1436,7 @@ function editDepotHead(index, status){
option += '<option value="现付">现付</option>';
option += '<option value="现付">现付</option>';
}
}
$("#payType").empty().append(option);
$("#payType").empty().append(option);
}
if
(
listSubType
==
"
销售
"
||
listSubType
==
"
销售退货
"
){
if
(
rowsdata
.
salesman
){
var
arr
=
rowsdata
.
salesman
.
split
(
"
,
"
);
var
salesmanArray
=
[];
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
){
if
(
arr
[
i
]){
salesmanArray
.
push
(
arr
[
i
].
replace
(
"
<
"
,
""
).
replace
(
"
>
"
,
""
));
}
}
$
(
"
#Salesman
"
).
combobox
(
'
setValues
'
,
salesmanArray
);
}
}
//采购入库、销售出库的多账户加载
//采购入库、销售出库的多账户加载
if(rowsdata.accountidlist!=undefined && rowsdata.accountmoneylist!=undefined){
if(rowsdata.accountidlist!=undefined && rowsdata.accountmoneylist!=undefined){
...
@@ -1730,7 +1445,6 @@ function editDepotHead(index, status){
...
@@ -1730,7 +1445,6 @@ function editDepotHead(index, status){
var accountMoneyArr = rowsdata.accountmoneylist.split(",");
var accountMoneyArr = rowsdata.accountmoneylist.split(",");
accountMoneyArr = changeListFmtPlus(accountMoneyArr) //将数组单个金额中的数值转为正数
accountMoneyArr = changeListFmtPlus(accountMoneyArr) //将数组单个金额中的数值转为正数
if
(
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
)
{
var manyAccountMoney = 0; //多账户合计-零售
var manyAccountMoney = 0; //多账户合计-零售
for (var j = 0; j < accountArr.length; j++) {
for (var j = 0; j < accountArr.length; j++) {
if (accountList != null) {
if (accountList != null) {
...
@@ -1745,7 +1459,6 @@ function editDepotHead(index, status){
...
@@ -1745,7 +1459,6 @@ function editDepotHead(index, status){
$("#getAmount").val(manyAccountMoney); //收款金额、付款金额
$("#getAmount").val(manyAccountMoney); //收款金额、付款金额
var changeAmount = $("#ChangeAmount").val()-0;
var changeAmount = $("#ChangeAmount").val()-0;
$("#backAmount").val((manyAccountMoney-changeAmount).toFixed(2)); //找零
$("#backAmount").val((manyAccountMoney-changeAmount).toFixed(2)); //找零
}
$("#AccountId").attr("data-accountArr", JSON.stringify(accountArr)).attr("data-accountMoneyArr", JSON.stringify(accountMoneyArr)); //json数据存储
$("#AccountId").attr("data-accountArr", JSON.stringify(accountArr)).attr("data-accountMoneyArr", JSON.stringify(accountMoneyArr)); //json数据存储
$(".many-account-ico").show(); //显示多账户的ico图标
$(".many-account-ico").show(); //显示多账户的ico图标
...
@@ -1842,7 +1555,6 @@ function showDepotHead(index){
...
@@ -1842,7 +1555,6 @@ function showDepotHead(index){
initTableData_material_show(TotalPrice); //商品列表-查看状态
initTableData_material_show(TotalPrice); //商品列表-查看状态
//零售单据展示数据
//零售单据展示数据
if
(
listSubType
==
"
零售
"
||
listSubType
==
"
零售退货
"
){
var changeAccount = $("#depotHeadDlgShow .change-amount-show").text() -0;
var changeAccount = $("#depotHeadDlgShow .change-amount-show").text() -0;
if(manyAccountMoney!==0){
if(manyAccountMoney!==0){
$("#depotHeadDlgShow .get-amount-show").text((manyAccountMoney).toFixed(2));
$("#depotHeadDlgShow .get-amount-show").text((manyAccountMoney).toFixed(2));
...
@@ -1852,40 +1564,6 @@ function showDepotHead(index){
...
@@ -1852,40 +1564,6 @@ function showDepotHead(index){
$("#depotHeadDlgShow .get-amount-show").text((changeAccount).toFixed(2));
$("#depotHeadDlgShow .get-amount-show").text((changeAccount).toFixed(2));
$("#depotHeadDlgShow .back-amount-show").text(0);
$("#depotHeadDlgShow .back-amount-show").text(0);
}
}
}
if
(
listSubType
===
"
销售
"
||
listSubType
===
"
销售退货
"
){
if
(
rowsdata
.
salesman
){
var
arr
=
rowsdata
.
salesman
.
split
(
"
,
"
);
var
salesmanStr
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
){
if
(
arr
[
i
]){
if
(
i
===
arr
.
length
-
1
){
salesmanStr
+=
arr
[
i
].
replace
(
"
<
"
,
""
).
replace
(
"
>
"
,
""
);
}
else
{
salesmanStr
+=
arr
[
i
].
replace
(
"
<
"
,
""
).
replace
(
"
>
"
,
""
)
+
"
,
"
;
}
}
}
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/person/getPersonByIds
"
,
data
:
{
personIDs
:
salesmanStr
},
success
:
function
(
res
){
if
(
res
&&
res
.
code
===
200
){
if
(
res
.
data
)
{
$
(
"
#SalesmanShow
"
).
text
(
res
.
data
.
names
);
//销售人员列表
}
}
},
error
:
function
(){
}
});
}
}
}
}
//绑定操作事件
//绑定操作事件
...
@@ -1978,50 +1656,6 @@ function bindEvent(){
...
@@ -1978,50 +1656,6 @@ function bindEvent(){
return;
return;
}
}
}
}
//输入框提示
if
(
listTitle
===
"
采购订单列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择供应商!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
采购入库列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择供应商!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
'
#AccountId
'
).
val
()){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择结算账户!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
零售退货列表
"
){
if
(
!
$
(
'
#AccountId
'
).
val
()){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择付款账户!
'
,
'
warning
'
);
return
;
}
if
(
$
(
"
#AccountId
"
).
val
()
==
"
many
"
&&
$
(
"
#backAmount
"
).
val
()
-
0
>
0
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
选择多账户时的找零金额不能大于0!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
销售退货列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择退货单位!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
'
#AccountId
'
).
val
()){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择付款账户!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
其它入库列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择往来单位!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
零售出库列表
"
){
if(!$('#AccountId').val()){
if(!$('#AccountId').val()){
$.messager.alert('提示','请选择收款账户!','warning');
$.messager.alert('提示','请选择收款账户!','warning');
return;
return;
...
@@ -2034,43 +1668,6 @@ function bindEvent(){
...
@@ -2034,43 +1668,6 @@ function bindEvent(){
$.messager.alert('提示', '选择多账户时的找零金额不能大于0!', 'warning');
$.messager.alert('提示', '选择多账户时的找零金额不能大于0!', 'warning');
return;
return;
}
}
}
else
if
(
listTitle
===
"
销售订单列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择购买单位!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
销售出库列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择购买单位!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
'
#AccountId
'
).
val
()){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择收款账户!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
采购退货列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择收货单位!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
'
#AccountId
'
).
val
()){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择收款账户!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
其它出库列表
"
){
if
(
!
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
请选择往来单位!
'
,
'
warning
'
);
return
;
}
}
else
if
(
listTitle
===
"
调拨出库列表
"
){
}
//进行明细的校验
//进行明细的校验
if(depotHeadID ==0) {
if(depotHeadID ==0) {
//新增模式下
//新增模式下
...
@@ -2098,36 +1695,12 @@ function bindEvent(){
...
@@ -2098,36 +1695,12 @@ function bindEvent(){
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
accountMoneyArr = accountMoneyList.split(","); //转为数组
accountMoneyArr = accountMoneyList.split(","); //转为数组
}
}
if
(
listSubType
===
"
采购订单
"
||
listSubType
===
"
采购
"
||
listSubType
===
"
零售退货
"
||
listSubType
===
"
销售退货
"
){
//付款为负数
ChangeAmount
=
0
-
ChangeAmount
;
TotalPrice
=
0
-
TotalPrice
;
if
(
accountMoneyArr
)
{
accountMoneyArr
=
changeListFmtMinus
(
accountMoneyArr
);
//将数组单个金额中的数值转为负数
}
}
//零售时候,可以从会员预付款中扣款
//零售时候,可以从会员预付款中扣款
var thisPayType = "现付";
var thisPayType = "现付";
if
(
listSubType
===
"
零售
"
)
{
if($("#payType").val() ==="预付款") {
if
(
$
(
"
#payType
"
).
val
()
===
"
预付款
"
)
{
thisPayType = "预付款";
thisPayType
=
"
预付款
"
;
}
}
}
var SalesmanStr = "";
var SalesmanStr = "";
if
(
listSubType
===
"
销售
"
||
listSubType
===
"
销售退货
"
){
var
Salesman
=
$
(
'
#Salesman
'
).
combobox
(
'
getValues
'
).
toString
();
//销售人员
if
(
Salesman
)
{
var
SalesmanArray
=
Salesman
.
split
(
"
,
"
);
for
(
var
i
=
0
;
i
<
SalesmanArray
.
length
;
i
++
)
{
if
(
i
===
SalesmanArray
.
length
-
1
)
{
SalesmanStr
+=
"
<
"
+
SalesmanArray
[
i
]
+
"
>
"
;
}
else
{
SalesmanStr
+=
"
<
"
+
SalesmanArray
[
i
]
+
"
>,
"
;
}
}
}
}
var getAccountID = $.trim($("#AccountId").val());
var getAccountID = $.trim($("#AccountId").val());
if($("#AccountId").val() === "many"){ //多账户
if($("#AccountId").val() === "many"){ //多账户
getAccountID = null;
getAccountID = null;
...
@@ -2394,14 +1967,9 @@ function bindEvent(){
...
@@ -2394,14 +1967,9 @@ function bindEvent(){
if(accountArr.length && accountMoneyArr.length) {
if(accountArr.length && accountMoneyArr.length) {
$("#AccountId").attr("data-accountArr",JSON.stringify(accountArr)).attr("data-accountMoneyArr",JSON.stringify(accountMoneyArr)); //json数据存储
$("#AccountId").attr("data-accountArr",JSON.stringify(accountArr)).attr("data-accountMoneyArr",JSON.stringify(accountMoneyArr)); //json数据存储
}
}
if
(
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
)
{
$("#getAmount").val(accountMoneyTotal); //给付款或者收款金额赋值
$
(
"
#getAmount
"
).
val
(
accountMoneyTotal
);
//给付款或者收款金额赋值
var backAmount = $("#getAmount").val() - $("#ChangeAmount").val();
var
backAmount
=
$
(
"
#getAmount
"
).
val
()
-
$
(
"
#ChangeAmount
"
).
val
();
$("#backAmount").val((backAmount - 0).toFixed(2)); //计算找零金额
$
(
"
#backAmount
"
).
val
((
backAmount
-
0
).
toFixed
(
2
));
//计算找零金额
}
else
{
$
(
"
#ChangeAmount
"
).
val
(
accountMoneyTotal
);
//给付款或者收款金额赋值
}
$("#Debt").val((discountLastMoneyNum-accountMoneyTotal).toFixed(2)); //本次欠款
$("#Debt").val((discountLastMoneyNum-accountMoneyTotal).toFixed(2)); //本次欠款
$("#depotHeadAccountDlg").dialog('close');
$("#depotHeadAccountDlg").dialog('close');
});
});
...
@@ -2414,12 +1982,7 @@ function bindEvent(){
...
@@ -2414,12 +1982,7 @@ function bindEvent(){
else {
else {
$("#depotHeadAccountDlg").dialog('close');
$("#depotHeadAccountDlg").dialog('close');
$("#AccountId").val("").removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空
$("#AccountId").val("").removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空
if
(
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
){
$("#ChangeAmount").prop("readonly","readonly");
$
(
"
#ChangeAmount
"
).
prop
(
"
readonly
"
,
"
readonly
"
);
}
else
{
$
(
"
#ChangeAmount
"
).
removeProp
(
"
readonly
"
,
"
readonly
"
);
}
$(".many-account-ico").hide(); //隐藏多账户小图标
$(".many-account-ico").hide(); //隐藏多账户小图标
}
}
}
}
...
@@ -2443,12 +2006,7 @@ function bindEvent(){
...
@@ -2443,12 +2006,7 @@ function bindEvent(){
}
}
else{
else{
$(this).removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空
$(this).removeAttr("data-accountArr").removeAttr("data-accountMoneyArr"); //将下拉置空并把缓存参数清空
if
(
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
){
$("#ChangeAmount").prop("readonly","readonly");
$
(
"
#ChangeAmount
"
).
prop
(
"
readonly
"
,
"
readonly
"
);
}
else
{
$
(
"
#ChangeAmount
"
).
removeProp
(
"
readonly
"
,
"
readonly
"
);
}
$(".many-account-ico").hide(); //隐藏多账户小图标
$(".many-account-ico").hide(); //隐藏多账户小图标
}
}
});
});
...
@@ -2466,12 +2024,7 @@ function bindEvent(){
...
@@ -2466,12 +2024,7 @@ function bindEvent(){
$(this).find(".account-id-dlg").val(accountArr[index]);
$(this).find(".account-id-dlg").val(accountArr[index]);
$(this).find(".account-money-dlg").val(accountMoneyArr[index]);
$(this).find(".account-money-dlg").val(accountMoneyArr[index]);
});
});
if
(
listSubType
===
"
零售
"
||
listSubType
===
"
零售退货
"
)
{
$("#accountMoneyTotalDlg").text($("#getAmount").val());
$
(
"
#accountMoneyTotalDlg
"
).
text
(
$
(
"
#getAmount
"
).
val
());
}
else
{
$
(
"
#accountMoneyTotalDlg
"
).
text
(
$
(
"
#ChangeAmount
"
).
val
());
}
});
});
//点击采购费用、销售费用的事件
//点击采购费用、销售费用的事件
...
@@ -2594,13 +2147,7 @@ function bindEvent(){
...
@@ -2594,13 +2147,7 @@ function bindEvent(){
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
});
});
if
(
listTitle
===
"
采购入库列表
"
||
listTitle
===
"
其它入库列表
"
||
listTitle
===
"
采购订单列表
"
||
listTitle
===
"
零售出库列表
"
||
listTitle
===
"
销售出库列表
"
||
listTitle
===
"
销售订单列表
"
){
var supplierType = "会员";
var
supplierType
=
"
供应商
"
;
if
(
listTitle
===
"
零售出库列表
"
){
supplierType
=
"
会员
"
;
}
else
if
(
listTitle
===
"
销售出库列表
"
||
listTitle
===
"
销售订单列表
"
){
supplierType
=
"
客户
"
;
}
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
function checkSupplierName() {
function checkSupplierName() {
var supplierName = $.trim($("#supplier").val());
var supplierName = $.trim($("#supplier").val());
...
@@ -2681,7 +2228,6 @@ function bindEvent(){
...
@@ -2681,7 +2228,6 @@ function bindEvent(){
}
}
});
});
});
});
}
}
}
function showDepotHeadDetails(pageNo,pageSize){
function showDepotHeadDetails(pageNo,pageSize){
...
@@ -2798,54 +2344,7 @@ function autoReckon() {
...
@@ -2798,54 +2344,7 @@ function autoReckon() {
return;
return;
}
}
else {
else {
if
(
listTitle
!=
"
销售出库列表
"
&&
listTitle
!=
"
采购退货列表
"
&&
listTitle
!=
"
其它出库列表
"
&&
listTitle
!=
"
调拨出库列表
"
)
{
return;
return;
}
$
.
ajax
({
url
:
"
/material/findById
"
,
type
:
"
get
"
,
dataType
:
"
json
"
,
data
:
{
id
:
mValue
-
0
},
success
:
function
(
res
){
if
(
res
&&
res
.
rows
&&
res
.
rows
[
0
])
{
var
retailPrice
=
res
.
rows
[
0
].
RetailPrice
;
var
presetPriceOne
=
res
.
rows
[
0
].
PresetPriceOne
;
var
presetPriceTwo
=
res
.
rows
[
0
].
PresetPriceTwo
;
//定义模版
var
temp
=
"
<div class='price-list'>
"
;
temp
+=
"
<ul>
"
;
temp
+=
"
<li>批发价:
"
+
presetPriceTwo
+
"
</li>
"
;
temp
+=
"
<li>零售价:
"
+
retailPrice
+
"
</li>
"
;
temp
+=
"
</ul>
"
;
temp
+=
"
</div>
"
;
if
(
$
(
'
.price-list
'
).
length
){
$
(
'
.price-list
'
).
remove
();
//如果存在价格列表先移除
}
else
{
if
(
presetPriceTwo
!=
undefined
){
//多单位的商品
$
(
self
).
after
(
temp
);
//加载列表信息
}
}
$
(
'
.price-list ul li
'
).
off
(
"
click
"
).
on
(
"
click
"
,
function
(){
var
price
=
$
(
this
).
text
();
price
=
price
.
substring
(
price
.
indexOf
(
"
:
"
)
+
1
);
$
(
self
).
val
(
price
);
$
(
self
).
keyup
();
//模拟键盘操作
$
(
'
.price-list
'
).
remove
();
//移除价格列表
});
//点击空白处移除价格列表
$
(
"
.datagrid-body
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
(){
$
(
'
.price-list
'
).
remove
();
//移除价格列表
});
}
},
error
:
function
(){
$
.
messager
.
alert
(
'
错误提示
'
,
'
查询商品信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
});
});
//修改含税单价,自动计算单价、金额、税额、价税合计和合计
//修改含税单价,自动计算单价、金额、税额、价税合计和合计
...
@@ -2922,9 +2421,6 @@ function autoReckon() {
...
@@ -2922,9 +2421,6 @@ function autoReckon() {
if(rowListLength > 0){
if(rowListLength > 0){
mTypeValue = "普通子件";
mTypeValue = "普通子件";
}
}
if
(
listSubType
==
"
组装单
"
||
listSubType
==
"
拆卸单
"
){
mType
.
find
(
input
).
val
(
mTypeValue
).
prop
(
"
readonly
"
,
"
readonly
"
);
}
},500);
},500);
}
}
...
...
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