优化单据的代码结构
This commit is contained in:
@@ -439,30 +439,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -482,8 +458,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -491,9 +466,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -553,7 +528,7 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ title: anotherDepotHeadName, field: 'AnotherDepotId',editor:'validatebox',hidden:isShowAnotherDepot,width:90,
|
||||
{ title: '调入仓库', field: 'AnotherDepotId',editor:'validatebox',width:90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.AnotherDepotName;
|
||||
},
|
||||
@@ -561,20 +536,16 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: anotherDepotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: anotherDepotUrl
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid
|
||||
}
|
||||
}
|
||||
},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -663,22 +634,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -693,19 +648,14 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ title: '调入仓库',field: 'AnotherDepotName',width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -741,20 +691,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -795,36 +731,8 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -853,9 +761,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -436,30 +436,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -479,8 +455,8 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',width:80},
|
||||
{ title: '仓库名称', field: 'DepotId', editor:'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -488,9 +464,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -550,28 +526,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -660,22 +618,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -690,19 +632,14 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '商品类型',field: 'MType',width:80},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -738,20 +675,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -792,36 +715,8 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -850,9 +745,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -437,30 +437,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -480,8 +456,8 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',width:80},
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -489,9 +465,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -551,28 +527,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -661,22 +619,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -691,19 +633,14 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '商品类型',field: 'MType',width:80},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -739,20 +676,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -793,36 +716,8 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -851,9 +746,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -449,30 +449,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -492,8 +468,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -501,9 +476,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -563,28 +538,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -673,22 +630,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -703,19 +644,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -751,20 +686,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -810,36 +731,9 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -868,9 +762,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -442,30 +442,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -485,8 +461,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -494,9 +469,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -556,28 +531,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -666,22 +623,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -696,19 +637,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -744,20 +679,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -803,36 +724,9 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -861,9 +755,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -580,30 +580,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -623,8 +599,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -632,9 +607,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -694,28 +669,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -804,22 +765,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -834,19 +779,17 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',hidden:isShowTaxColumn,width:75},
|
||||
{ title: '含税单价',field: 'TaxUnitPrice',editor:'validattebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -882,20 +825,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -945,36 +874,8 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -1003,9 +904,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -598,30 +598,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -641,8 +617,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -650,9 +625,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -712,28 +687,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -822,22 +783,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -852,19 +797,17 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',hidden:isShowTaxColumn,width:75},
|
||||
{ title: '含税单价',field: 'TaxUnitPrice',editor:'validattebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -900,20 +843,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -963,36 +892,14 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -1021,9 +928,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -536,30 +536,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -579,8 +555,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -588,9 +563,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -650,28 +625,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',hidden:true,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: 'TaxRate',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -760,22 +721,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -790,19 +735,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -845,11 +784,7 @@
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
js.addTabPage(null, "订单转采购", "/pages/bill/purchase_in_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
@@ -897,36 +832,14 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -955,9 +868,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -597,30 +597,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -640,8 +616,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -649,9 +624,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -711,28 +686,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -821,22 +778,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -851,19 +792,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -899,20 +834,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -962,36 +883,14 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -1020,9 +919,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -633,30 +633,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -676,8 +652,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -685,9 +660,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -747,28 +722,10 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -857,22 +814,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -887,19 +828,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -935,20 +870,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -1002,36 +923,12 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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());
|
||||
if($("#AccountId").val() === "many"){ //多账户
|
||||
getAccountID = null;
|
||||
@@ -1060,9 +957,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -467,17 +467,15 @@
|
||||
$('#depotHeadDlg').show().dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/pencil.png"/> 编辑' + editTitle);
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotHeadID = res.id;
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesMan){
|
||||
var arr = res.salesMan.split(",");
|
||||
var salesmanArray = [];
|
||||
for(var i=0;i<arr.length;i++){
|
||||
if(arr[i]){
|
||||
salesmanArray.push(arr[i].replace("<","").replace(">",""));
|
||||
}
|
||||
if(res.salesMan){
|
||||
var arr = res.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);
|
||||
}
|
||||
$("#Salesman").combobox('setValues', salesmanArray);
|
||||
}
|
||||
//采购入库、销售出库的多账户加载
|
||||
if(res.accountIdList && res.accountMoneyList){
|
||||
@@ -585,38 +583,36 @@
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotHeadID = res.id;
|
||||
initTableData_material_show(TotalPrice); //商品列表-查看状态
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesman){
|
||||
var arr = res.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(">","") + ",";
|
||||
}
|
||||
if(res.salesman){
|
||||
var arr = res.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//初始化表格数据-商品列表-编辑状态
|
||||
@@ -625,30 +621,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -668,8 +640,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -677,9 +648,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -739,28 +710,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -849,22 +806,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -879,19 +820,17 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',hidden:isShowTaxColumn,width:75},
|
||||
{ title: '含税单价',field: 'TaxUnitPrice',editor:'validattebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -927,20 +866,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -990,33 +915,23 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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 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] + ">,";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1048,9 +963,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -425,17 +425,15 @@
|
||||
$('#depotHeadDlg').show().dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/pencil.png"/> 编辑' + editTitle);
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotHeadID = res.id;
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesMan){
|
||||
var arr = res.salesMan.split(",");
|
||||
var salesmanArray = [];
|
||||
for(var i=0;i<arr.length;i++){
|
||||
if(arr[i]){
|
||||
salesmanArray.push(arr[i].replace("<","").replace(">",""));
|
||||
}
|
||||
if(res.salesMan){
|
||||
var arr = res.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);
|
||||
}
|
||||
$("#Salesman").combobox('setValues', salesmanArray);
|
||||
}
|
||||
//采购入库、销售出库的多账户加载
|
||||
if(res.accountIdList && res.accountMoneyList){
|
||||
@@ -544,38 +542,36 @@
|
||||
|
||||
depotHeadID = res.id;
|
||||
initTableData_material_show(TotalPrice); //商品列表-查看状态
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesman){
|
||||
var arr = res.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(">","") + ",";
|
||||
}
|
||||
if(res.salesman){
|
||||
var arr = res.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//初始化表格数据-商品列表-编辑状态
|
||||
@@ -584,30 +580,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -627,8 +599,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -636,9 +607,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -698,28 +669,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',hidden:true,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: 'TaxRate',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',hidden:true,width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -808,22 +765,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -838,19 +779,13 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',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:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -893,11 +828,7 @@
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
js.addTabPage(null, "订单转销售", "/pages/bill/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
@@ -945,33 +876,17 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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 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] + ">,";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1003,9 +918,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -487,17 +487,15 @@
|
||||
$('#depotHeadDlg').show().dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/pencil.png"/> 编辑' + editTitle);
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotHeadID = res.id;
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesMan){
|
||||
var arr = res.salesMan.split(",");
|
||||
var salesmanArray = [];
|
||||
for(var i=0;i<arr.length;i++){
|
||||
if(arr[i]){
|
||||
salesmanArray.push(arr[i].replace("<","").replace(">",""));
|
||||
}
|
||||
if(res.salesMan){
|
||||
var arr = res.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);
|
||||
}
|
||||
$("#Salesman").combobox('setValues', salesmanArray);
|
||||
}
|
||||
//采购入库、销售出库的多账户加载
|
||||
if(res.accountIdList && res.accountMoneyList){
|
||||
@@ -621,38 +619,36 @@
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotHeadID = res.id;
|
||||
initTableData_material_show(TotalPrice); //商品列表-查看状态
|
||||
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
|
||||
if(res.salesman){
|
||||
var arr = res.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(">","") + ",";
|
||||
}
|
||||
if(res.salesman){
|
||||
var arr = res.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$.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(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//初始化表格数据-商品列表-编辑状态
|
||||
@@ -661,30 +657,6 @@
|
||||
var body,footer,input; //定义表格和文本框
|
||||
var ratioDepot = 1; //比例-仓库用
|
||||
var monthTime = getNowFormatMonth();
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var depotHeadName = ""; //仓库名称
|
||||
var depotUrl = ""; //仓库接口地址
|
||||
var depotTextField = ""; //仓库下拉名称
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var anotherDepotUrl = ""; //对方仓库接口地址
|
||||
var anotherDepotTextField = "";
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
anotherDepotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
anotherDepotTextField = "depotName";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
depotUrl = '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid;
|
||||
depotTextField = "depotName";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialData').datagrid({
|
||||
height:345,
|
||||
rownumbers: false,
|
||||
@@ -704,8 +676,7 @@
|
||||
onClickRow: onClickRow,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '商品类型',field: 'MType',editor:'validatebox',hidden:isShowMaterialTypeColumn,width:80},
|
||||
{ title: depotHeadName, field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||
formatter: function (value, row, index) {
|
||||
return row.DepotName;
|
||||
},
|
||||
@@ -713,9 +684,9 @@
|
||||
type: 'combobox',
|
||||
options: {
|
||||
valueField: 'id',
|
||||
textField: depotTextField,
|
||||
textField: 'depotName',
|
||||
method: 'get',
|
||||
url: depotUrl,
|
||||
url: '/depot/findDepotByUserId?UBType=UserDepot&UBKeyId='+kid,
|
||||
onSelect:function(rec){
|
||||
var depotId = rec.id;
|
||||
body =$("#depotHeadFM .datagrid-body");
|
||||
@@ -775,28 +746,14 @@
|
||||
}
|
||||
},
|
||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||
{ 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: 'TaxUnitPrice',editor:'validatebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
toolbar:[
|
||||
@@ -885,22 +842,6 @@
|
||||
//初始化表格数据-商品列表-查看状态
|
||||
function initTableData_material_show(TotalPrice) {
|
||||
var self = this;
|
||||
var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示
|
||||
var anotherDepotHeadName = ""; //对方仓库的列的标题
|
||||
var depotHeadName = ""; //仓库的列的标题
|
||||
if(listSubType == "调拨"){
|
||||
isShowAnotherDepot = false; //调拨时候显示对方仓库
|
||||
anotherDepotHeadName = "调入仓库";
|
||||
}
|
||||
depotHeadName = "仓库名称";
|
||||
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "调拨" || listSubType == "其它" || listSubType == "零售" || listSubType == "零售退货" || listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowTaxColumn = true; //隐藏
|
||||
}
|
||||
var isShowMaterialTypeColumn = true; //是否显示商品类型相关的列,true为隐藏,false为显示
|
||||
if(listSubType == "组装单" || listSubType == "拆卸单"){
|
||||
isShowMaterialTypeColumn = false; //显示
|
||||
}
|
||||
$('#materialDataShow').datagrid({
|
||||
height:345,
|
||||
rownumbers: true,
|
||||
@@ -915,19 +856,17 @@
|
||||
striped : true,
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn},
|
||||
{ title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
||||
{ title: '库存',field: 'Stock',width:50},
|
||||
{ title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90},
|
||||
{ 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:'validattebox',hidden:isShowTaxColumn,width:75},
|
||||
{ title: '含税单价',field: 'TaxUnitPrice',editor:'validattebox',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: 'TaxRate',editor:'validatebox',width:75},
|
||||
{ title: '税额',field: 'TaxMoney',editor:'validatebox',width:75},
|
||||
{ title: '价税合计',field: 'TaxLastMoney',editor:'validatebox',width:75},
|
||||
{ title: '备注',field: 'Remark',editor:'validatebox',width:100}
|
||||
]],
|
||||
onLoadError:function() {
|
||||
@@ -963,20 +902,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
//订单转采购或销售
|
||||
function skipDepotHead(index) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
if(res.status == "0" || res.status == "2") {
|
||||
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
|
||||
} else {
|
||||
sessionStorage.setItem("rowInfo", JSON.stringify(res)); //将单据信息存入缓存中
|
||||
if(listTitle == "采购订单列表") {
|
||||
js.addTabPage(null, "订单转采购", "/pages/materials/purchase_in_list.html?t=skip");
|
||||
} else if(listTitle == "销售订单列表") {
|
||||
js.addTabPage(null, "订单转销售", "/pages/materials/sale_out_list.html?t=skip");
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存信息
|
||||
$("#saveDepotHead").off("click").on("click",function(){
|
||||
if(!$('#depotHeadFM').form('validate')){
|
||||
@@ -1026,33 +951,17 @@
|
||||
accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号
|
||||
accountMoneyArr = accountMoneyList.split(","); //转为数组
|
||||
}
|
||||
if(listSubType === "采购订单"||listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){
|
||||
//付款为负数
|
||||
ChangeAmount = 0 - ChangeAmount;
|
||||
TotalPrice = 0 - TotalPrice;
|
||||
if(accountMoneyArr) {
|
||||
accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数
|
||||
}
|
||||
}
|
||||
//零售时候,可以从会员预付款中扣款
|
||||
var thisPayType = "现付";
|
||||
if(listSubType === "零售") {
|
||||
if($("#payType").val() ==="预付款") {
|
||||
thisPayType = "预付款";
|
||||
}
|
||||
}
|
||||
var SalesmanStr = "";
|
||||
if(listSubType === "销售" || 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 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] + ">,";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1084,9 +993,6 @@
|
||||
OtherMoneyItem: $("#OtherMoney").attr("data-itemmoneyarr"), //支出项目金额列表-涉及费用
|
||||
AccountDay: $("#AccountDay").val() //结算天数
|
||||
});
|
||||
/**
|
||||
* 零售出库,单独操作
|
||||
* */
|
||||
if(url.indexOf("/depotHead/addDepotHeadAndDetail")>=0){
|
||||
inOutService.addDepotHeadAndDetail(url,infoStr);
|
||||
} else if(url.indexOf("/depotHead/updateDepotHeadAndDetail")>=0){
|
||||
|
||||
@@ -505,7 +505,7 @@ public class DepotItemService {
|
||||
depotItem.setMaterialExtendId(tempUpdatedJson.getLong("MaterialExtendId"));
|
||||
}
|
||||
depotItem.setMaterialUnit(tempUpdatedJson.getString("Unit"));
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("OperNumber").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("OperNumber"))) {
|
||||
depotItem.setOperNumber(tempUpdatedJson.getBigDecimal("OperNumber"));
|
||||
try {
|
||||
String Unit = tempUpdatedJson.get("Unit").toString();
|
||||
@@ -530,29 +530,29 @@ public class DepotItemService {
|
||||
logger.error(">>>>>>>>>>>>>>>>>>>设置基础数量异常", e);
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("UnitPrice").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("UnitPrice"))) {
|
||||
depotItem.setUnitPrice(tempUpdatedJson.getBigDecimal("UnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxUnitPrice").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("TaxUnitPrice"))) {
|
||||
depotItem.setTaxUnitPrice(tempUpdatedJson.getBigDecimal("TaxUnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("AllPrice").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("AllPrice"))) {
|
||||
depotItem.setAllPrice(tempUpdatedJson.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(tempUpdatedJson.getString("Remark"));
|
||||
if (tempUpdatedJson.get("DepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("DepotId").toString())) {
|
||||
if (tempUpdatedJson.get("DepotId") != null && StringUtil.isExist(tempUpdatedJson.get("DepotId"))) {
|
||||
depotItem.setDepotId(tempUpdatedJson.getLong("DepotId"));
|
||||
}
|
||||
if (tempUpdatedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("AnotherDepotId").toString())) {
|
||||
if (tempUpdatedJson.get("AnotherDepotId") != null && StringUtil.isExist(tempUpdatedJson.get("AnotherDepotId"))) {
|
||||
depotItem.setAnotherDepotId(tempUpdatedJson.getLong("AnotherDepotId"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxRate").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("TaxRate"))) {
|
||||
depotItem.setTaxRate(tempUpdatedJson.getBigDecimal("TaxRate"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxMoney").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("TaxMoney"))) {
|
||||
depotItem.setTaxMoney(tempUpdatedJson.getBigDecimal("TaxMoney"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxLastMoney").toString())) {
|
||||
if (StringUtil.isExist(tempUpdatedJson.get("TaxLastMoney"))) {
|
||||
depotItem.setTaxLastMoney(tempUpdatedJson.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
depotItem.setOtherField1(tempUpdatedJson.getString("OtherField1"));
|
||||
|
||||
@@ -207,7 +207,11 @@ public class OrgaUserRelService {
|
||||
List<Long> orgIdList = organizationService.getOrgIdByParentId(orgId);
|
||||
List<Long> userIdList = new ArrayList<Long>();
|
||||
OrgaUserRelExample example = new OrgaUserRelExample();
|
||||
example.createCriteria().andOrgaIdIn(orgIdList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
if(orgIdList!=null && orgIdList.size()>0) {
|
||||
example.createCriteria().andOrgaIdIn(orgIdList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
} else {
|
||||
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
}
|
||||
List<OrgaUserRel> list = orgaUserRelMapper.selectByExample(example);
|
||||
if(list!=null && list.size()>0) {
|
||||
for(OrgaUserRel our: list) {
|
||||
|
||||
@@ -217,17 +217,23 @@ public class UserService {
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int resetPwd(String md5Pwd, Long id) throws Exception{
|
||||
int result=0;
|
||||
logService.insertLog("用户",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User user = new User();
|
||||
user.setId(id);
|
||||
user.setPassword(md5Pwd);
|
||||
int result=0;
|
||||
try{
|
||||
result=userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
User u = getUser(id);
|
||||
String loginName = u.getLoginName();
|
||||
if("admin".equals(loginName)){
|
||||
logger.info("禁止重置超管密码");
|
||||
} else {
|
||||
User user = new User();
|
||||
user.setId(id);
|
||||
user.setPassword(md5Pwd);
|
||||
try{
|
||||
result=userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user