Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
drp
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
drp
Commits
f2a829ce
Commit
f2a829ce
authored
Mar 18, 2015
by
reedmi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决出库单与入库单的冲突问题
parent
2c69c296
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
94 deletions
+138
-94
src/main/webapp/drp/app/controller/projects/invoices/StockInInvoiceController.js
.../controller/projects/invoices/StockInInvoiceController.js
+47
-43
src/main/webapp/drp/app/controller/projects/invoices/StockOutInvoiceController.js
...controller/projects/invoices/StockOutInvoiceController.js
+46
-41
src/main/webapp/drp/app/view/projects/invoices/StockOutInvoiceView.js
...app/drp/app/view/projects/invoices/StockOutInvoiceView.js
+1
-10
src/main/webapp/drp/app/view/resources/StockInWareWin.js
src/main/webapp/drp/app/view/resources/StockInWareWin.js
+22
-0
src/main/webapp/drp/app/view/resources/StockOutWareWin.js
src/main/webapp/drp/app/view/resources/StockOutWareWin.js
+22
-0
No files found.
src/main/webapp/drp/app/controller/projects/invoices/StockInInvoiceController.js
View file @
f2a829ce
...
@@ -5,13 +5,13 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -5,13 +5,13 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
extend
:
"
drp.app.controller.AbstractController
"
,
extend
:
"
drp.app.controller.AbstractController
"
,
inInvoiceController
:
null
,
inInvoiceController
:
null
,
invoiceGrid
:
null
,
in
In
voiceGrid
:
null
,
currentInvoice
:
null
,
currentIn
In
voice
:
null
,
inCostGrid
:
null
,
inCostGrid
:
null
,
inCostForm
:
null
,
inCostForm
:
null
,
inInvoiceCostWin
:
null
,
//
c
ostWin默认是未创建的
inInvoiceCostWin
:
null
,
//
inInvoiceC
ostWin默认是未创建的
in
voiceCost
Win
:
null
,
in
InvoiceDetail
Win
:
null
,
ware
Window
:
null
,
ware
InWin
:
null
,
init
:
function
()
{
init
:
function
()
{
inInvoiceController
=
this
;
inInvoiceController
=
this
;
...
@@ -20,11 +20,11 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -20,11 +20,11 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
'
stockininvoiceview
'
:
{
'
stockininvoiceview
'
:
{
afterrender
:
function
(
panel
)
{
afterrender
:
function
(
panel
)
{
inInvoiceCostWin
=
false
;
inInvoiceCostWin
=
false
;
in
voiceCost
Win
=
false
;
in
InvoiceDetail
Win
=
false
;
currentInvoice
=
null
;
currentIn
In
voice
=
null
;
ware
Window
=
false
;
ware
InWin
=
false
;
invoiceGrid
=
panel
.
down
(
'
gridpanel
'
);
in
In
voiceGrid
=
panel
.
down
(
'
gridpanel
'
);
invoiceGrid
.
getStore
().
load
();
in
In
voiceGrid
.
getStore
().
load
();
}
}
},
},
...
@@ -71,26 +71,25 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -71,26 +71,25 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
'
stockincostview button[action=deleteStockInCost]
'
:
{
'
stockincostview button[action=deleteStockInCost]
'
:
{
click
:
this
.
deleteStockInCost
click
:
this
.
deleteStockInCost
},
},
//stock_in_cost choose ware
//stock_in_cost choose ware
'
stockincostview button[action=chooseWare]
'
:
{
'
stockincostview button[action=chooseWare]
'
:
{
click
:
function
(
btn
){
click
:
function
(
btn
){
// 加载弹窗相关的controller
// 加载弹窗相关的controller
if
(
!
ware
Window
){
if
(
!
ware
InWin
){
ware
Window
=
Ext
.
widget
(
'
warewindow
'
);
ware
InWin
=
Ext
.
widget
(
'
stockinwarewin
'
);
var
WareControllerName
=
"
drp.app.controller.resources.WareController
"
;
var
WareControllerName
=
"
drp.app.controller.resources.WareController
"
;
if
(
!
Ext
.
ClassManager
.
isCreated
(
WareControllerName
))
{
if
(
!
Ext
.
ClassManager
.
isCreated
(
WareControllerName
))
{
var
mainController
=
this
.
application
.
getController
(
"
drp.base.controller.MainController
"
);
var
mainController
=
this
.
application
.
getController
(
"
drp.base.controller.MainController
"
);
mainController
.
application
.
getController
(
WareControllerName
).
init
();
mainController
.
application
.
getController
(
WareControllerName
).
init
();
}
}
}
}
ware
Window
.
show
();
ware
InWin
.
show
();
}
}
},
},
//-----------------------------------------------------------
//-----------------------------------------------------------
'
warewindow
gridpanel
'
:
{
'
stockinwarewin
gridpanel
'
:
{
itemcontextmenu
:
function
(
view
,
record
,
item
,
index
,
e
){
itemcontextmenu
:
function
(
view
,
record
,
item
,
index
,
e
){
// 禁用浏览器自带的右键菜单
// 禁用浏览器自带的右键菜单
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -105,12 +104,17 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -105,12 +104,17 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
icon
:
'
resources/images/icons/ok.png
'
,
icon
:
'
resources/images/icons/ok.png
'
,
listeners
:
{
listeners
:
{
click
:
function
(
item
){
click
:
function
(
item
){
ware
Window
.
hide
();
ware
InWin
.
hide
();
var
costForm
=
inInvoiceCostWin
.
down
(
'
#stockInCost_form
'
);
var
costForm
=
inInvoiceCostWin
.
down
(
'
#stockInCost_form
'
);
console
.
log
(
"
>>>>>>>>>>>>>>>>>入库单日志.....
"
);
console
.
log
(
"
wareInWin
"
,
wareInWin
);
console
.
log
(
"
inInvoiceCostWin
"
,
inInvoiceCostWin
);
console
.
log
(
"
costForm
"
,
costForm
);
costForm
.
down
(
'
#wareName_stockInCost_tf
'
).
setValue
(
record
.
data
.
name
);
costForm
.
down
(
'
#wareName_stockInCost_tf
'
).
setValue
(
record
.
data
.
name
);
costForm
.
down
(
'
#wareId_stockInCost_tf
'
).
setValue
(
record
.
data
.
id
);
costForm
.
down
(
'
#wareId_stockInCost_tf
'
).
setValue
(
record
.
data
.
id
);
costForm
.
down
(
'
#wareModel_stockInCost_tf
'
).
setValue
(
record
.
data
.
model
);
costForm
.
down
(
'
#wareModel_stockInCost_tf
'
).
setValue
(
record
.
data
.
model
);
costForm
.
down
(
'
#wareUnit_stockInCost_tf
'
).
setValue
(
record
.
data
.
unit
);
costForm
.
down
(
'
#wareUnit_stockInCost_tf
'
).
setValue
(
record
.
data
.
unit
);
console
.
log
(
"
==============================
"
);
}
}
}
}
}]
}]
...
@@ -123,7 +127,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -123,7 +127,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
//入库单-查询
//入库单-查询
searchStockInInvoice
:
function
(
btn
){
searchStockInInvoice
:
function
(
btn
){
var
store
=
invoiceGrid
.
getStore
();
var
store
=
in
In
voiceGrid
.
getStore
();
var
form
=
btn
.
up
(
"
form
"
);
var
form
=
btn
.
up
(
"
form
"
);
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([
{
store
.
filter
([
{
...
@@ -200,7 +204,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -200,7 +204,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
id
:
formBean
[
'
wareId
'
]
id
:
formBean
[
'
wareId
'
]
});
});
model
.
set
(
"
invoice
"
,
{
model
.
set
(
"
invoice
"
,
{
id
:
currentInvoice
.
data
.
id
id
:
currentIn
In
voice
.
data
.
id
});
});
}
}
if
(
formBean
.
unitPrice
==
""
){
if
(
formBean
.
unitPrice
==
""
){
...
@@ -212,9 +216,9 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -212,9 +216,9 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([{
store
.
filter
([{
property
:
"
invoice
"
,
property
:
"
invoice
"
,
value
:
currentInvoice
.
data
.
id
value
:
currentIn
In
voice
.
data
.
id
}]);
}]);
Ext
.
Msg
.
alert
(
"
失败
!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
成功
!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
},
},
failure
:
function
(
response
,
operation
)
{
failure
:
function
(
response
,
operation
)
{
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
...
@@ -230,7 +234,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -230,7 +234,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
}
}
var
store
=
inInvoiceCostWin
.
down
(
"
gridpanel
"
).
getStore
();
var
store
=
inInvoiceCostWin
.
down
(
"
gridpanel
"
).
getStore
();
//在弹出新建入库单的页面之前,需要做三部分工作:清空store、合价设置为0
//在弹出新建入库单的页面之前,需要做三部分工作:清空store、合价设置为0
currentInvoice
=
null
;
currentIn
In
voice
=
null
;
store
.
removeAll
(
false
);
store
.
removeAll
(
false
);
inInvoiceCostWin
.
down
(
'
#addStockInCost_btn
'
).
setDisabled
(
true
);
inInvoiceCostWin
.
down
(
'
#addStockInCost_btn
'
).
setDisabled
(
true
);
inInvoiceCostWin
.
down
(
'
#totalPrice_stockInCost_df
'
).
setValue
(
0
);
inInvoiceCostWin
.
down
(
'
#totalPrice_stockInCost_df
'
).
setValue
(
0
);
...
@@ -242,18 +246,18 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -242,18 +246,18 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
},
},
showUpdateInInvoiceForm
:
function
(
grid
,
record
,
item
,
index
){
showUpdateInInvoiceForm
:
function
(
grid
,
record
,
item
,
index
){
currentInvoice
=
record
;
//在弹出更新的窗口时,保存选中的invoice
currentIn
In
voice
=
record
;
//在弹出更新的窗口时,保存选中的invoice
var
invoiceData
=
record
.
data
;
var
invoiceData
=
record
.
data
;
var
costWin
=
null
;
var
costWin
=
null
;
//1.非材料员登陆的,只提供预览
//1.非材料员登陆的,只提供预览
//2.若是材料员,则pass=true的和已经通过审核的,只提供预览
//2.若是材料员,则pass=true的和已经通过审核的,只提供预览
if
(
user
.
type
!=
"
WAREKEEPER
"
){
if
(
user
.
type
!=
"
WAREKEEPER
"
){
if
(
!
in
voiceCost
Win
){
if
(
!
in
InvoiceDetail
Win
){
in
voiceCost
Win
=
Ext
.
widget
(
'
stockincostshowview
'
);
in
InvoiceDetail
Win
=
Ext
.
widget
(
'
stockincostshowview
'
);
}
}
costWin
=
in
voiceCost
Win
;
costWin
=
in
InvoiceDetail
Win
;
in
voiceCost
Win
.
setTitle
(
"
查看入库单
"
);
in
InvoiceDetail
Win
.
setTitle
(
"
查看入库单
"
);
}
else
{
}
else
{
if
(
!
inInvoiceCostWin
){
if
(
!
inInvoiceCostWin
){
...
@@ -269,7 +273,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -269,7 +273,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([{
store
.
filter
([{
property
:
"
invoice
"
,
property
:
"
invoice
"
,
value
:
currentInvoice
.
data
.
id
value
:
currentIn
In
voice
.
data
.
id
}]);
}]);
costWin
.
down
(
'
#stockInCost_form
'
).
loadRecord
(
record
);
costWin
.
down
(
'
#stockInCost_form
'
).
loadRecord
(
record
);
...
@@ -286,27 +290,27 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -286,27 +290,27 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
//入库单-删除
//入库单-删除
deleteInInvoice
:
function
(
btn
)
{
deleteInInvoice
:
function
(
btn
)
{
inInvoiceController
.
deleteBatchModel
(
btn
,
invoiceGrid
,
"
入库单
"
,
"
/invoices/in/deleteBatch
"
);
inInvoiceController
.
deleteBatchModel
(
btn
,
in
In
voiceGrid
,
"
入库单
"
,
"
/invoices/in/deleteBatch
"
);
},
},
//入库单-更新总价
//入库单-更新总价
updateInvoiceTotalPrice
:
function
(
panel
){
updateInvoiceTotalPrice
:
function
(
panel
){
panel
.
down
(
'
#chooseWare_stockInCost_btn
'
).
setDisabled
(
true
);
panel
.
down
(
'
#chooseWare_stockInCost_btn
'
).
setDisabled
(
true
);
var
totalPrice_stockInCost
=
panel
.
down
(
'
#totalPrice_stockInCost_df
'
).
getValue
();
var
totalPrice_stockInCost
=
panel
.
down
(
'
#totalPrice_stockInCost_df
'
).
getValue
();
if
(
!
currentInvoice
){
if
(
!
currentIn
In
voice
){
return
;
return
;
}
}
if
(
currentInvoice
.
data
.
totalPrice
==
totalPrice_stockInCost
){
if
(
currentIn
In
voice
.
data
.
totalPrice
==
totalPrice_stockInCost
){
return
;
return
;
}
}
currentInvoice
.
set
(
"
forDate
"
,
panel
.
down
(
'
#forDate_stockInInvoice_df
'
).
getValue
());
currentInvoice
.
set
(
"
code
"
,
panel
.
down
(
'
#code_stockInInvoice_tf
'
).
getValue
());
currentInvoice
.
set
(
"
totalPrice
"
,
totalPrice_stockInCost
);
currentInvoice
.
save
({
currentInInvoice
.
set
(
"
forDate
"
,
panel
.
down
(
'
#forDate_stockInInvoice_df
'
).
getValue
());
currentInInvoice
.
set
(
"
code
"
,
panel
.
down
(
'
#code_stockInInvoice_tf
'
).
getValue
());
currentInInvoice
.
set
(
"
totalPrice
"
,
totalPrice_stockInCost
);
currentInInvoice
.
save
({
success
:
function
(
response
,
operation
)
{
success
:
function
(
response
,
operation
)
{
invoiceGrid
.
getStore
().
load
();
in
In
voiceGrid
.
getStore
().
load
();
},
},
failure
:
function
(
response
,
operation
)
{
failure
:
function
(
response
,
operation
)
{
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
...
@@ -322,9 +326,9 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -322,9 +326,9 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
var
model
=
Ext
.
create
(
modelName
,
formBean
);
var
model
=
Ext
.
create
(
modelName
,
formBean
);
model
.
save
({
model
.
save
({
success
:
function
(
response
,
operation
){
success
:
function
(
response
,
operation
){
invoiceGrid
.
getStore
().
load
();
in
In
voiceGrid
.
getStore
().
load
();
var
reader
=
operation
.
request
.
scope
.
reader
;
var
reader
=
operation
.
request
.
scope
.
reader
;
currentInvoice
=
Ext
.
create
(
modelName
,{
currentIn
In
voice
=
Ext
.
create
(
modelName
,{
id
:
reader
.
jsonData
[
"
object
"
]
id
:
reader
.
jsonData
[
"
object
"
]
});
});
btn
.
up
(
"
form
"
).
down
(
'
#id_stockInInvoice
'
).
setValue
(
reader
.
jsonData
[
"
object
"
]);
btn
.
up
(
"
form
"
).
down
(
'
#id_stockInInvoice
'
).
setValue
(
reader
.
jsonData
[
"
object
"
]);
...
@@ -339,7 +343,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -339,7 +343,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
},
},
submitInInvoiceToAudit
:
function
(
state
){
submitInInvoiceToAudit
:
function
(
state
){
var
records
=
invoiceGrid
.
getSelectionModel
().
getSelection
();
var
records
=
in
In
voiceGrid
.
getSelectionModel
().
getSelection
();
var
ids
=
[];
var
ids
=
[];
for
(
var
i
=
0
,
len
=
records
.
length
;
i
<
len
;
i
++
){
for
(
var
i
=
0
,
len
=
records
.
length
;
i
<
len
;
i
++
){
ids
[
i
]
=
records
[
i
].
data
.
id
;
ids
[
i
]
=
records
[
i
].
data
.
id
;
...
@@ -361,7 +365,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -361,7 +365,7 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
success
:
function
(
response
,
operation
){
success
:
function
(
response
,
operation
){
var
resp
=
Ext
.
decode
(
response
.
responseText
);
var
resp
=
Ext
.
decode
(
response
.
responseText
);
Ext
.
Msg
.
alert
(
"
成功!
"
,
resp
.
message
);
Ext
.
Msg
.
alert
(
"
成功!
"
,
resp
.
message
);
invoiceGrid
.
getStore
().
load
();
in
In
voiceGrid
.
getStore
().
load
();
},
},
failure
:
function
(
resp
,
operation
)
{
failure
:
function
(
resp
,
operation
)
{
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
...
@@ -383,6 +387,6 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
...
@@ -383,6 +387,6 @@ Ext.define("drp.app.controller.projects.invoices.StockInInvoiceController", {
"
drp.app.view.projects.costs.StockInCostView
"
,
"
drp.app.view.projects.costs.StockInCostView
"
,
"
drp.app.view.projects.costs.StockInCostShowView
"
,
"
drp.app.view.projects.costs.StockInCostShowView
"
,
"
drp.app.view.resources.WareView
"
,
"
drp.app.view.resources.WareView
"
,
"
drp.app.view.resources.
WareWindow
"
,
"
drp.app.view.resources.
StockInWareWin
"
,
"
drp.app.view.resources.WareViewForm
"
]
"
drp.app.view.resources.WareViewForm
"
]
});
});
\ No newline at end of file
src/main/webapp/drp/app/controller/projects/invoices/StockOutInvoiceController.js
View file @
f2a829ce
...
@@ -4,27 +4,27 @@
...
@@ -4,27 +4,27 @@
Ext
.
define
(
"
drp.app.controller.projects.invoices.StockOutInvoiceController
"
,
{
Ext
.
define
(
"
drp.app.controller.projects.invoices.StockOutInvoiceController
"
,
{
extend
:
"
drp.app.controller.AbstractController
"
,
extend
:
"
drp.app.controller.AbstractController
"
,
me
:
null
,
outInvoiceController
:
null
,
i
nvoiceGrid
:
null
,
outI
nvoiceGrid
:
null
,
currentInvoice
:
null
,
current
Out
Invoice
:
null
,
outCostGrid
:
null
,
outCostGrid
:
null
,
outCostForm
:
null
,
outCostForm
:
null
,
outInvoiceCostWin
:
null
,
// costWin默认是未创建的
outInvoiceCostWin
:
null
,
// costWin默认是未创建的
invoiceCost
Win
:
null
,
outInvoiceDetail
Win
:
null
,
ware
Window
:
null
,
ware
OutWin
:
null
,
init
:
function
()
{
init
:
function
()
{
me
=
this
;
outInvoiceController
=
this
;
this
.
control
({
this
.
control
({
'
stockoutinvoiceview
'
:
{
'
stockoutinvoiceview
'
:
{
afterrender
:
function
(
panel
)
{
afterrender
:
function
(
panel
)
{
outInvoiceCostWin
=
false
;
outInvoiceCostWin
=
false
;
invoiceCost
Win
=
false
;
outInvoiceDetail
Win
=
false
;
currentInvoice
=
null
;
current
Out
Invoice
=
null
;
ware
Window
=
false
;
ware
OutWin
=
false
;
i
nvoiceGrid
=
panel
.
down
(
'
gridpanel
'
);
outI
nvoiceGrid
=
panel
.
down
(
'
gridpanel
'
);
i
nvoiceGrid
.
getStore
().
load
();
outI
nvoiceGrid
.
getStore
().
load
();
}
}
},
},
...
@@ -86,26 +86,26 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -86,26 +86,26 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
'
stockoutcostview button[action=chooseWare]
'
:
{
'
stockoutcostview button[action=chooseWare]
'
:
{
click
:
function
(
btn
)
{
click
:
function
(
btn
)
{
// 加载弹窗相关的controller
// 加载弹窗相关的controller
if
(
!
ware
Window
)
{
if
(
!
ware
OutWin
)
{
ware
Window
=
Ext
.
widget
(
'
warewindow
'
);
ware
OutWin
=
Ext
.
widget
(
'
stockoutwarewin
'
);
var
WareControllerName
=
"
drp.app.controller.resources.WareController
"
;
var
WareControllerName
=
"
drp.app.controller.resources.WareController
"
;
if
(
!
Ext
.
ClassManager
.
isCreated
(
WareControllerName
))
{
if
(
!
Ext
.
ClassManager
.
isCreated
(
WareControllerName
))
{
var
mainController
=
this
.
application
.
getController
(
"
drp.base.controller.MainController
"
);
var
mainController
=
this
.
application
.
getController
(
"
drp.base.controller.MainController
"
);
mainController
.
application
.
getController
(
WareControllerName
).
init
();
mainController
.
application
.
getController
(
WareControllerName
).
init
();
}
}
}
}
ware
Window
.
show
();
ware
OutWin
.
show
();
}
}
},
},
// -----------------------------------------------------------
// -----------------------------------------------------------
'
warewindow
'
:
{
'
stockoutwarewin
'
:
{
afterrender
:
function
(
panel
)
{
afterrender
:
function
(
panel
)
{
// 设置只能选择、检索,不能增加删除
// 设置只能选择、检索,不能增加删除
panel
.
down
(
'
toolbar
'
).
setVisible
(
false
);
panel
.
down
(
'
toolbar
'
).
setVisible
(
false
);
}
}
},
},
'
warewindow
gridpanel
'
:
{
'
stockoutwarewin
gridpanel
'
:
{
itemcontextmenu
:
function
(
view
,
record
,
item
,
index
,
e
)
{
itemcontextmenu
:
function
(
view
,
record
,
item
,
index
,
e
)
{
// 禁用浏览器自带的右键菜单
// 禁用浏览器自带的右键菜单
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -120,12 +120,17 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -120,12 +120,17 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
icon
:
'
resources/images/icons/ok.png
'
,
icon
:
'
resources/images/icons/ok.png
'
,
listeners
:
{
listeners
:
{
click
:
function
(
item
)
{
click
:
function
(
item
)
{
ware
Window
.
hide
();
ware
OutWin
.
hide
();
var
costForm
=
outInvoiceCostWin
.
down
(
'
#stockOutCost_form
'
);
var
costForm
=
outInvoiceCostWin
.
down
(
'
#stockOutCost_form
'
);
console
.
log
(
"
>>>>>>>>>>>>>>>>>出库单日志.....
"
);
console
.
log
(
"
wareOutWin
"
,
wareOutWin
);
console
.
log
(
"
outInvoiceCostWin
"
,
outInvoiceCostWin
);
console
.
log
(
"
costForm
"
,
costForm
);
costForm
.
down
(
'
#wareName_stockOutCost_tf
'
).
setValue
(
record
.
data
.
name
);
costForm
.
down
(
'
#wareName_stockOutCost_tf
'
).
setValue
(
record
.
data
.
name
);
costForm
.
down
(
'
#wareId_stockOutCost_tf
'
).
setValue
(
record
.
data
.
id
);
costForm
.
down
(
'
#wareId_stockOutCost_tf
'
).
setValue
(
record
.
data
.
id
);
costForm
.
down
(
'
#wareModel_stockOutCost_tf
'
).
setValue
(
record
.
data
.
model
);
costForm
.
down
(
'
#wareModel_stockOutCost_tf
'
).
setValue
(
record
.
data
.
model
);
costForm
.
down
(
'
#wareUnit_stockOutCost_tf
'
).
setValue
(
record
.
data
.
unit
);
costForm
.
down
(
'
#wareUnit_stockOutCost_tf
'
).
setValue
(
record
.
data
.
unit
);
console
.
log
(
"
==============================
"
);
}
}
}
}
}]
}]
...
@@ -138,7 +143,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -138,7 +143,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
// 出库单-查询
// 出库单-查询
searchStockOutInvoice
:
function
(
btn
)
{
searchStockOutInvoice
:
function
(
btn
)
{
var
store
=
i
nvoiceGrid
.
getStore
();
var
store
=
outI
nvoiceGrid
.
getStore
();
var
form
=
btn
.
up
(
"
form
"
);
var
form
=
btn
.
up
(
"
form
"
);
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([{
store
.
filter
([{
...
@@ -173,12 +178,12 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -173,12 +178,12 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
// 入库商品-删除
// 入库商品-删除
deleteStockOutCost
:
function
(
btn
)
{
deleteStockOutCost
:
function
(
btn
)
{
me
.
deleteModel
(
btn
,
outCostGrid
,
"
商品条目
"
);
outInvoiceController
.
deleteModel
(
btn
,
outCostGrid
,
"
商品条目
"
);
var
grid
=
outCostGrid
;
var
grid
=
outCostGrid
;
var
name
=
"
商品条目
"
;
var
name
=
"
商品条目
"
;
var
record
=
grid
.
getSelectionModel
().
getSelection
()[
0
];
var
record
=
grid
.
getSelectionModel
().
getSelection
()[
0
];
if
(
!
record
)
{
if
(
!
record
)
{
me
.
showPromptsOnDelete
(
name
);
outInvoiceController
.
showPromptsOnDelete
(
name
);
return
;
return
;
}
else
{
}
else
{
Ext
.
MessageBox
.
confirm
(
"
标题
"
,
"
你要删除这个
"
+
name
+
"
吗?
"
,
function
(
btn
)
{
Ext
.
MessageBox
.
confirm
(
"
标题
"
,
"
你要删除这个
"
+
name
+
"
吗?
"
,
function
(
btn
)
{
...
@@ -218,7 +223,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -218,7 +223,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
id
:
formBean
[
'
wareId
'
]
id
:
formBean
[
'
wareId
'
]
});
});
model
.
set
(
"
invoice
"
,
{
model
.
set
(
"
invoice
"
,
{
id
:
currentInvoice
.
data
.
id
id
:
current
Out
Invoice
.
data
.
id
});
});
}
}
if
(
formBean
.
unitPrice
==
""
)
{
if
(
formBean
.
unitPrice
==
""
)
{
...
@@ -230,9 +235,9 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -230,9 +235,9 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([{
store
.
filter
([{
property
:
"
invoice
"
,
property
:
"
invoice
"
,
value
:
currentInvoice
.
data
.
id
value
:
current
Out
Invoice
.
data
.
id
}]);
}]);
Ext
.
Msg
.
alert
(
"
失败
!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
成功
!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
},
},
failure
:
function
(
response
,
operation
)
{
failure
:
function
(
response
,
operation
)
{
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
...
@@ -248,7 +253,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -248,7 +253,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
}
}
var
store
=
outInvoiceCostWin
.
down
(
"
gridpanel
"
).
getStore
();
var
store
=
outInvoiceCostWin
.
down
(
"
gridpanel
"
).
getStore
();
// 在弹出新建出库单的页面之前,需要做三部分工作:清空store、合价设置为0
// 在弹出新建出库单的页面之前,需要做三部分工作:清空store、合价设置为0
currentInvoice
=
null
;
current
Out
Invoice
=
null
;
store
.
removeAll
(
false
);
store
.
removeAll
(
false
);
outInvoiceCostWin
.
down
(
'
#addStockOutCost_btn
'
).
setDisabled
(
true
);
outInvoiceCostWin
.
down
(
'
#addStockOutCost_btn
'
).
setDisabled
(
true
);
outInvoiceCostWin
.
down
(
'
#totalPrice_stockOutCost_df
'
).
setValue
(
0
);
outInvoiceCostWin
.
down
(
'
#totalPrice_stockOutCost_df
'
).
setValue
(
0
);
...
@@ -260,18 +265,18 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -260,18 +265,18 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
},
},
showUpdateOutInvoiceForm
:
function
(
grid
,
record
,
item
,
index
)
{
showUpdateOutInvoiceForm
:
function
(
grid
,
record
,
item
,
index
)
{
currentInvoice
=
record
;
// 在弹出更新的窗口时,保存选中的invoice
current
Out
Invoice
=
record
;
// 在弹出更新的窗口时,保存选中的invoice
var
invoiceData
=
record
.
data
;
var
invoiceData
=
record
.
data
;
var
costWin
=
null
;
var
costWin
=
null
;
// 1.非材料员登陆的,只提供预览
// 1.非材料员登陆的,只提供预览
// 2.若是材料员,则pass=true的和已经通过审核的,只提供预览
// 2.若是材料员,则pass=true的和已经通过审核的,只提供预览
if
(
user
.
type
!=
"
WAREKEEPER
"
)
{
if
(
user
.
type
!=
"
WAREKEEPER
"
)
{
if
(
!
invoiceCost
Win
)
{
if
(
!
outInvoiceDetail
Win
)
{
invoiceCost
Win
=
Ext
.
widget
(
'
stockoutcostshowview
'
);
outInvoiceDetail
Win
=
Ext
.
widget
(
'
stockoutcostshowview
'
);
}
}
costWin
=
invoiceCost
Win
;
costWin
=
outInvoiceDetail
Win
;
invoiceCost
Win
.
setTitle
(
"
查看出库单
"
);
outInvoiceDetail
Win
.
setTitle
(
"
查看出库单
"
);
}
else
{
}
else
{
if
(
!
outInvoiceCostWin
)
{
if
(
!
outInvoiceCostWin
)
{
outInvoiceCostWin
=
Ext
.
widget
(
'
stockoutcostview
'
);
outInvoiceCostWin
=
Ext
.
widget
(
'
stockoutcostview
'
);
...
@@ -286,7 +291,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -286,7 +291,7 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
store
.
filters
.
clear
();
store
.
filters
.
clear
();
store
.
filter
([{
store
.
filter
([{
property
:
"
invoice
"
,
property
:
"
invoice
"
,
value
:
currentInvoice
.
data
.
id
value
:
current
Out
Invoice
.
data
.
id
}]);
}]);
costWin
.
down
(
'
#header_stockOutCost_form
'
).
loadRecord
(
record
);
costWin
.
down
(
'
#header_stockOutCost_form
'
).
loadRecord
(
record
);
...
@@ -304,27 +309,27 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -304,27 +309,27 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
// 出库单-删除
// 出库单-删除
deleteOutInvoice
:
function
(
btn
)
{
deleteOutInvoice
:
function
(
btn
)
{
me
.
deleteBatchModel
(
btn
,
i
nvoiceGrid
,
"
出库单
"
,
"
/invoices/out/deleteBatch
"
);
outInvoiceController
.
deleteBatchModel
(
btn
,
outI
nvoiceGrid
,
"
出库单
"
,
"
/invoices/out/deleteBatch
"
);
},
},
// 出库单-更新总价
// 出库单-更新总价
updateInvoiceTotalPrice
:
function
(
panel
)
{
updateInvoiceTotalPrice
:
function
(
panel
)
{
panel
.
down
(
'
#chooseWare_stockOutCost_btn
'
).
setDisabled
(
true
);
panel
.
down
(
'
#chooseWare_stockOutCost_btn
'
).
setDisabled
(
true
);
var
totalPrice_stockOutCost
=
panel
.
down
(
'
#totalPrice_stockOutCost_df
'
).
getValue
();
var
totalPrice_stockOutCost
=
panel
.
down
(
'
#totalPrice_stockOutCost_df
'
).
getValue
();
if
(
!
currentInvoice
)
{
if
(
!
current
Out
Invoice
)
{
return
;
return
;
}
}
if
(
currentInvoice
.
data
.
totalPrice
==
totalPrice_stockOutCost
)
{
if
(
current
Out
Invoice
.
data
.
totalPrice
==
totalPrice_stockOutCost
)
{
return
;
return
;
}
}
currentInvoice
.
set
(
"
forDate
"
,
panel
.
down
(
'
#forDate_stockOutInvoice_df
'
).
getValue
());
current
Out
Invoice
.
set
(
"
forDate
"
,
panel
.
down
(
'
#forDate_stockOutInvoice_df
'
).
getValue
());
currentInvoice
.
set
(
"
code
"
,
panel
.
down
(
'
#code_stockOutInvoice_tf
'
).
getValue
());
current
Out
Invoice
.
set
(
"
code
"
,
panel
.
down
(
'
#code_stockOutInvoice_tf
'
).
getValue
());
currentInvoice
.
set
(
"
totalPrice
"
,
totalPrice_stockOutCost
);
current
Out
Invoice
.
set
(
"
totalPrice
"
,
totalPrice_stockOutCost
);
currentInvoice
.
save
({
current
Out
Invoice
.
save
({
success
:
function
(
response
,
operation
)
{
success
:
function
(
response
,
operation
)
{
i
nvoiceGrid
.
getStore
().
load
();
outI
nvoiceGrid
.
getStore
().
load
();
},
},
failure
:
function
(
response
,
operation
)
{
failure
:
function
(
response
,
operation
)
{
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
Ext
.
Msg
.
alert
(
"
失败!
"
,
operation
.
request
.
scope
.
reader
.
jsonData
[
"
message
"
]);
...
@@ -340,9 +345,9 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -340,9 +345,9 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
var
model
=
Ext
.
create
(
modelName
,
formBean
);
var
model
=
Ext
.
create
(
modelName
,
formBean
);
model
.
save
({
model
.
save
({
success
:
function
(
response
,
operation
)
{
success
:
function
(
response
,
operation
)
{
i
nvoiceGrid
.
getStore
().
load
();
outI
nvoiceGrid
.
getStore
().
load
();
var
reader
=
operation
.
request
.
scope
.
reader
;
var
reader
=
operation
.
request
.
scope
.
reader
;
currentInvoice
=
Ext
.
create
(
modelName
,
{
current
Out
Invoice
=
Ext
.
create
(
modelName
,
{
id
:
reader
.
jsonData
[
"
object
"
]
id
:
reader
.
jsonData
[
"
object
"
]
});
});
btn
.
up
(
"
form
"
).
down
(
'
#id_stockOutInvoice
'
).
setValue
(
reader
.
jsonData
[
"
object
"
]);
btn
.
up
(
"
form
"
).
down
(
'
#id_stockOutInvoice
'
).
setValue
(
reader
.
jsonData
[
"
object
"
]);
...
@@ -360,5 +365,5 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
...
@@ -360,5 +365,5 @@ Ext.define("drp.app.controller.projects.invoices.StockOutInvoiceController", {
stores
:
[
"
drp.app.store.projects.invoices.StockOutInvoiceStore
"
,
"
drp.app.store.projects.costs.StockOutCostStore
"
,
"
drp.app.store.resources.WareStore
"
,
stores
:
[
"
drp.app.store.projects.invoices.StockOutInvoiceStore
"
,
"
drp.app.store.projects.costs.StockOutCostStore
"
,
"
drp.app.store.resources.WareStore
"
,
"
drp.app.store.resources.VendorStore
"
,
"
drp.app.store.users.ManagerStore
"
,
"
drp.app.store.users.WareKeeperStore
"
,
"
drp.app.store.users.RegulatorStore
"
],
"
drp.app.store.resources.VendorStore
"
,
"
drp.app.store.users.ManagerStore
"
,
"
drp.app.store.users.WareKeeperStore
"
,
"
drp.app.store.users.RegulatorStore
"
],
views
:
[
"
drp.app.view.projects.invoices.StockOutInvoiceView
"
,
"
drp.app.view.projects.costs.StockOutCostView
"
,
"
drp.app.view.projects.costs.StockOutCostShowView
"
,
views
:
[
"
drp.app.view.projects.invoices.StockOutInvoiceView
"
,
"
drp.app.view.projects.costs.StockOutCostView
"
,
"
drp.app.view.projects.costs.StockOutCostShowView
"
,
"
drp.app.view.resources.WareView
"
,
"
drp.app.view.resources.
WareWindow
"
,
"
drp.app.view.resources.WareViewForm
"
]
"
drp.app.view.resources.WareView
"
,
"
drp.app.view.resources.
StockOutWareWin
"
,
"
drp.app.view.resources.WareViewForm
"
]
});
});
\ No newline at end of file
src/main/webapp/drp/app/view/projects/invoices/StockOutInvoiceView.js
View file @
f2a829ce
...
@@ -18,7 +18,6 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', {
...
@@ -18,7 +18,6 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', {
listeners
:
{
listeners
:
{
selectionchange
:
function
(
sm
,
selections
)
{
selectionchange
:
function
(
sm
,
selections
)
{
me
.
down
(
'
#deleteOutInvoice_btn
'
).
setDisabled
(
selections
.
length
==
0
);
me
.
down
(
'
#deleteOutInvoice_btn
'
).
setDisabled
(
selections
.
length
==
0
);
me
.
down
(
'
#submitOutInvoice_btn
'
).
setDisabled
(
selections
.
length
==
0
);
}
}
}
}
});
});
...
@@ -190,15 +189,7 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', {
...
@@ -190,15 +189,7 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', {
itemId
:
'
deleteOutInvoice_btn
'
,
itemId
:
'
deleteOutInvoice_btn
'
,
disabled
:
true
,
disabled
:
true
,
text
:
'
删除
'
text
:
'
删除
'
}
/*, {
}]
itemId : 'submitOutInvoice_btn',
disabled : true,
text : '提交审核',
icon : 'resources/images/icons/database_save.png',
menu : {
items : menuItems
}
}*/
]
}]
}]
}]
}]
...
...
src/main/webapp/drp/app/view/resources/StockInWareWin.js
0 → 100644
View file @
f2a829ce
Ext
.
define
(
'
drp.app.view.resources.StockInWareWin
'
,
{
extend
:
'
Ext.window.Window
'
,
alias
:
'
widget.stockinwarewin
'
,
height
:
520
,
width
:
920
,
constrain
:
true
,
modal
:
true
,
closeAction
:
'
hide
'
,
resizable
:
false
,
layout
:
{
type
:
'
fit
'
},
items
:
[{
xtype
:
'
panel
'
,
layout
:
'
fit
'
,
items
:[{
xtype
:
'
wareview
'
,
title
:
''
,
closable
:
false
}]
}]
});
\ No newline at end of file
src/main/webapp/drp/app/view/resources/StockOutWareWin.js
0 → 100644
View file @
f2a829ce
Ext
.
define
(
'
drp.app.view.resources.StockOutWareWin
'
,
{
extend
:
'
Ext.window.Window
'
,
alias
:
'
widget.stockoutwarewin
'
,
height
:
520
,
width
:
920
,
constrain
:
true
,
modal
:
true
,
closeAction
:
'
hide
'
,
resizable
:
false
,
layout
:
{
type
:
'
fit
'
},
items
:
[{
xtype
:
'
panel
'
,
layout
:
'
fit
'
,
items
:[{
xtype
:
'
wareview
'
,
title
:
''
,
closable
:
false
}]
}]
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment