Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
aae78c53
Commit
aae78c53
authored
May 15, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add drafthistory
parent
3cc87437
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
316 additions
and
18 deletions
+316
-18
fqboss/app/base/controller/impl/drafthistoryCtl.js
+77
-0
fqboss/app/base/db/impl/drafthistoryDao.js
+13
-0
fqboss/app/base/db/models/drafthistory.js
+22
-0
fqboss/app/base/service/impl/drafthistorySve.js
+68
-0
fqboss/app/front/vues/pages/automatictmsubmitinside/automatictmsubmitinside.html
+50
-18
fqboss/app/front/vues/pages/automatictmsubmitinside/automatictmsubmitinside.js
+86
-0
No files found.
fqboss/app/base/controller/impl/drafthistoryCtl.js
0 → 100644
View file @
aae78c53
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
CtlBase
=
require
(
"../ctl.base"
);
const
uuidv4
=
require
(
'uuid/v4'
);
class
DrafthistoryCtl
extends
CtlBase
{
constructor
()
{
let
name
=
CtlBase
.
getServiceName
(
DrafthistoryCtl
);
console
.
log
(
'--ctl print:'
,
name
);
super
(
name
);
}
//post
async
createDraft
(
q
,
body
,
req
)
{
try
{
body
.
userId
=
req
.
session
.
user
.
id
;
console
.
log
(
'create draft========'
,
body
);
let
result
=
await
this
.
service
.
createOne
(
body
);
return
system
.
getResult2
(
result
,
req
);
}
catch
(
e
)
{
return
system
.
getErrResult2
(
e
);
}
}
//get
async
deleteDraft
(
obj
,
req
)
{
try
{
obj
.
userId
=
req
.
session
.
user
.
id
;
console
.
log
(
'delete draft========'
,
obj
);
let
result
=
await
this
.
service
.
deleteByObj
(
obj
);
return
system
.
getResult2
(
result
,
req
);
}
catch
(
e
)
{
return
system
.
getErrResult2
(
e
);
}
}
//post
async
updateDraft
(
q
,
body
,
req
)
{
try
{
console
.
log
(
'updata draft=========: '
,
body
);
body
.
obj
.
userId
=
req
.
session
.
user
.
id
;
let
result
=
await
this
.
service
.
updateByObj
(
body
.
obj
,
body
.
newData
);
return
system
.
getResult2
(
result
,
req
);
}
catch
(
e
)
{
return
system
.
getErrResult2
(
e
);
}
}
//get 前端需要创建两个接口,一个是获取所有,一个是按名称索引所有
//查询当前用户所有草稿版本例:obj = {'userId': '333'}
//查询当前用户的某个名字草稿版本例:obj = {'userId': '333', 'draftName': '测试2'}
async
findDraft
(
obj
,
req
)
{
try
{
obj
.
userId
=
req
.
session
.
user
.
id
;
let
result
=
await
this
.
service
.
findByObj
(
obj
);
return
system
.
getResult2
(
result
,
req
);
}
catch
(
e
)
{
return
system
.
getErrResult2
(
e
);
}
}
async
findOneDraft
(
obj
,
req
)
{
try
{
obj
.
userId
=
req
.
session
.
user
.
id
;
let
result
=
await
this
.
service
.
findOneById
(
obj
);
return
system
.
getResult2
(
result
,
req
);
}
catch
(
e
)
{
return
system
.
getErrResult2
(
e
);
}
}
}
module
.
exports
=
DrafthistoryCtl
;
\ No newline at end of file
fqboss/app/base/db/impl/drafthistoryDao.js
0 → 100644
View file @
aae78c53
const
system
=
require
(
"../../system"
);
const
Dao
=
require
(
"../dao.base"
);
class
DrafthistoryDao
extends
Dao
{
constructor
()
{
let
name
=
Dao
.
getModelName
(
DrafthistoryDao
)
console
.
log
(
'--Dao print: '
,
name
);
super
(
name
);
}
}
module
.
exports
=
DrafthistoryDao
;
\ No newline at end of file
fqboss/app/base/db/models/drafthistory.js
0 → 100644
View file @
aae78c53
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"drafthistory"
,
{
userId
:
DataTypes
.
INTEGER
,
draftName
:
DataTypes
.
STRING
(
100
),
draftData
:
DataTypes
.
JSON
},{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
false
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'tm_draft_history'
,
//tm前缀代表商标
timestamps
:
false
,
validate
:
{
},
indexes
:[]
});
}
\ No newline at end of file
fqboss/app/base/service/impl/drafthistorySve.js
0 → 100644
View file @
aae78c53
const
system
=
require
(
"../../system"
);
const
ServiceBase
=
require
(
"../sve.base"
);
class
DrafthistoryService
extends
ServiceBase
{
constructor
()
{
super
(
ServiceBase
.
getDaoName
(
DrafthistoryService
));
}
//添加增删改查方法
async
createOne
(
obj
)
{
try
{
let
result
=
await
this
.
dao
.
model
.
create
(
obj
);
return
result
;
}
catch
(
e
)
{
console
.
log
(
'--drafthistory createOne error: '
,
e
);
return
e
;
}
}
async
deleteByObj
(
obj
)
{
//例:obj = {'id': '2', 'userId': '333', 'draftName': '测试2'}
try
{
let
result
=
await
this
.
dao
.
model
.
destroy
({
where
:
obj
});
return
result
;
}
catch
(
e
)
{
console
.
log
(
'--drafthistory delete error: '
,
e
);
return
e
;
}
}
async
updateByObj
(
obj
,
newobj
)
{
//例:obj = {'id': '2', 'userId': '333', 'draftName': '测试2'}
console
.
log
(
'123456: '
,
obj
,
newobj
);
try
{
let
result
=
await
this
.
dao
.
model
.
update
(
newobj
,
{
where
:
obj
});
return
result
;
}
catch
(
e
)
{
console
.
log
(
'--drafthistory update error: '
,
e
);
return
e
;
}
}
async
findByObj
(
obj
)
{
//查询当前用户所有草稿版本例:obj = {'userId': '333'}
//查询当前用户的某个名字草稿版本例:obj = {'userId': '333', 'draftName': '测试2'}
try
{
// console.log('draft service: ',this.dao);
let
result
=
await
this
.
dao
.
model
.
findAll
({
where
:
obj
});
return
result
;
}
catch
(
e
)
{
console
.
log
(
'--drafthistory find error:'
,
e
);
return
e
;
}
}
async
findOneById
(
obj
)
{
try
{
let
result
=
await
this
.
dao
.
model
.
findOne
({
where
:
obj
});
return
result
;
}
catch
(
e
)
{
console
.
log
(
'--drafthistory find error:'
,
e
);
return
e
;
}
}
}
module
.
exports
=
DrafthistoryService
;
\ No newline at end of file
fqboss/app/front/vues/pages/automatictmsubmitinside/automatictmsubmitinside.html
View file @
aae78c53
...
@@ -5,8 +5,10 @@
...
@@ -5,8 +5,10 @@
<div
style=
"text-align:left"
>
<div
style=
"text-align:left"
>
<gsb-step
:psteps=
"steps"
:step=
"step"
></gsb-step>
<gsb-step
:psteps=
"steps"
:step=
"step"
></gsb-step>
<el-row>
<el-row>
<el-button
type=
"text"
style=
"float:right;margin:0 5px;"
@
click=
"usedraft"
>
复用草稿数据
</el-button>
<!-- <el-button type="text" style="float:right;margin:0 5px;" @click="usedraft">查看草稿</el-button> -->
<el-button
type=
"text"
style=
"float:right;margin:0 5px;"
@
click=
"savedraft"
>
保存为草稿
</el-button>
<!-- <el-button type="text" style="float:right;margin:0 5px;" @click="savedraft">保存为草稿</el-button> -->
<el-button
type=
"text"
style=
"float:right;margin:0 5px;"
@
click=
"findDraft"
>
查看草稿
</el-button>
<el-button
type=
"text"
style=
"float:right;margin:0 5px;"
@
click=
"saveDraft = true"
>
保存草稿
</el-button>
<div
style=
"clear:both"
></div>
<div
style=
"clear:both"
></div>
</el-row>
</el-row>
<el-alert
title=
"商标注册申请递交后,在审查阶段存在被商标审查机构驳回的可能,且驳回后不予退费,请知悉。"
type=
"warning"
close-text=
"我了解了"
>
<el-alert
title=
"商标注册申请递交后,在审查阶段存在被商标审查机构驳回的可能,且驳回后不予退费,请知悉。"
type=
"warning"
close-text=
"我了解了"
>
...
@@ -179,28 +181,32 @@
...
@@ -179,28 +181,32 @@
<span style="margin-right:20px;">应付总额:¥{{form.totalSum}}</span>
<span style="margin-right:20px;">应付总额:¥{{form.totalSum}}</span>
<el-button type="primary" @click="submitForm(\'form\')">下一步</el-button>
<el-button type="primary" @click="submitForm(\'form\')">下一步</el-button>
</div> -->
</div> -->
<div
style=
"text-align:center;padding:20px 0 50px 0;"
>
<div
style=
"text-align:center;padding:20px 0 50px 0;"
>
<!-- <el-button @click="tobefore">上一步</el-button> -->
<!-- <el-button @click="tobefore">上一步</el-button> -->
<el-button
type=
"primary"
@
click=
"submitForm(\'form\')"
>
下一步
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm(\'form\')"
>
下一步
</el-button>
</div>
<div
v-if=
"channelOrder && channelOrder.usable_order_no_class_count && channelOrder.usable_order_no_class_count.length>0"
style=
"padding-bottom:50px;"
>
<h5>
有效订单
</h5>
<div>
<el-row
style=
"color:#606266"
>
<el-col
v-for=
"item in channelOrder.usable_order_no_class_count"
:span=
"6"
style=
"margin:5px 0;"
>
<span
style=
"margin-right:20px;"
>
订单号:{{item.order_no}}
</span>
<span
style=
"margin-right:20px;"
>
尼斯小项数量:{{item.class_count}}
</span>
</el-col>
</el-row>
</div>
</div>
<div
v-if=
"channelOrder && channelOrder.usable_order_no_class_count && channelOrder.usable_order_no_class_count.length>0"
style=
"padding-bottom:50px;"
>
<h5>
有效订单
</h5>
<div>
<el-row
style=
"color:#606266"
>
<el-col
v-for=
"item in channelOrder.usable_order_no_class_count"
:span=
"6"
style=
"margin:5px 0;"
>
<span
style=
"margin-right:20px;"
>
订单号:{{item.order_no}}
</span>
<span
style=
"margin-right:20px;"
>
尼斯小项数量:{{item.class_count}}
</span>
</el-col>
</el-row>
</div>
</div>
</div>
<div
v-if=
"channelOrder && channelOrder.already_used_order_no_class_count && channelOrder.already_used_order_no_class_count.length>0"
style=
"padding-bottom:50px;"
>
<div
v-if=
"channelOrder && channelOrder.already_used_order_no_class_count && channelOrder.already_used_order_no_class_count.length>0"
style=
"padding-bottom:50px;"
>
<h5>
已交付订单
</h5>
<h5>
已交付订单
</h5>
<div>
<div>
<el-row
style=
"color:#606266"
>
<el-row
style=
"color:#606266"
>
<el-col
v-for=
"item in channelOrder.already_used_order_no_class_count"
:span=
"6"
style=
"margin:5px 0;"
>
<el-col
v-for=
"item in channelOrder.already_used_order_no_class_count"
:span=
"6"
style=
"margin:5px 0;"
>
<span
style=
"margin-right:20px;"
>
订单号:{{item.order_no}}
</span>
<span
style=
"margin-right:20px;"
>
订单号:{{item.order_no}}
</span>
<span
style=
"margin-right:20px;"
>
尼斯小项数量:{{item.class_count}}
</span>
<span
style=
"margin-right:20px;"
>
尼斯小项数量:{{item.class_count}}
</span>
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
...
@@ -499,4 +505,29 @@
...
@@ -499,4 +505,29 @@
<el-button
type=
"primary"
@
click=
"createOrderM"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"createOrderM"
>
确 定
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
<el-dialog
title=
"请输入草稿名称"
:visible
.
sync=
"saveDraft"
width=
"50%"
:before-close=
"draftNameBoxClose"
>
<el-input
v-model=
"inputDraftName"
placeholder=
"请输入草稿名称"
></el-input>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"saveDraft = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"createDraft"
>
保 存
</el-button>
</span>
</el-dialog>
<el-dialog
title=
"草稿列表"
:visible
.
sync=
"viewDrafts"
width=
"50%"
:before-close=
"viewDraftsBoxClose"
>
<el-table
:data=
"viewDraftData"
border
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"draftId"
align=
"center"
label=
"ID"
>
</el-table-column>
<el-table-column
prop=
"draftName"
align=
"center"
label=
"草稿名称"
>
</el-table-column>
<el-table-column
fixed=
"right"
align=
"center"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"reuseDraft(scope.row)"
type=
"text"
size=
"small"
>
复用
</el-button>
<el-button
@
click=
"deleteDraft(scope.row)"
type=
"text"
size=
"small"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"viewDrafts = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"viewDrafts = false"
>
完 成
</el-button>
</span>
</el-dialog>
</div>
</div>
\ No newline at end of file
fqboss/app/front/vues/pages/automatictmsubmitinside/automatictmsubmitinside.js
View file @
aae78c53
...
@@ -55,6 +55,10 @@
...
@@ -55,6 +55,10 @@
loading4
:
false
,
loading4
:
false
,
loadingKey
:
1
,
loadingKey
:
1
,
dialogVisible
:
false
,
dialogVisible
:
false
,
saveDraft
:
false
,
viewDrafts
:
false
,
inputDraftName
:
''
,
viewDraftData
:
[],
showSelectedNclList
:
false
,
showSelectedNclList
:
false
,
fkey
:
0
,
fkey
:
0
,
isIndeterminate
:
false
,
isIndeterminate
:
false
,
...
@@ -890,6 +894,12 @@
...
@@ -890,6 +894,12 @@
handleClose
(){
handleClose
(){
this
.
dialogVisible
=
false
;
this
.
dialogVisible
=
false
;
},
},
draftNameBoxClose
(){
this
.
saveDraft
=
false
;
},
viewDraftsBoxClose
(){
this
.
viewDrafts
=
false
;
},
createOrderM
(){
createOrderM
(){
var
that
=
this
;
var
that
=
this
;
this
.
$confirm
(
'确认提交吗 !!!'
,
'温馨再次提示'
,
{
this
.
$confirm
(
'确认提交吗 !!!'
,
'温馨再次提示'
,
{
...
@@ -1054,6 +1064,82 @@
...
@@ -1054,6 +1064,82 @@
});
});
},
},
reuseDraft
:
function
(
row
)
{
console
.
log
(
'=========row'
,
row
.
draftId
,
row
.
draftName
);
this
.
$root
.
getReq
(
"web/drafthistoryCtl/findOneDraft"
,
{
id
:
row
.
draftId
}).
then
(
d
=>
{
console
.
log
(
"findOneDraft return :"
,
d
);
var
data
=
d
.
data
.
draftData
;
if
(
data
.
checkedNcl
)
{
this
.
checkedNcl
=
data
.
checkedNcl
;
}
if
(
data
.
form
)
{
this
.
form
=
data
.
form
;
}
if
(
data
.
nclOne
)
{
this
.
nclOne
=
data
.
nclOne
;
}
if
(
data
.
apply
)
{
this
.
apply
=
data
.
apply
;
}
}).
catch
(
e
=>
{
console
.
log
(
'findDraft error: '
,
e
);
})
},
findDraft
:
function
()
{
this
.
viewDrafts
=
true
;
this
.
$root
.
getReq
(
"/web/drafthistoryCtl/findDraft"
,
{}).
then
(
d
=>
{
console
.
log
(
"findDraft return :"
,
d
);
var
result
=
d
.
data
;
var
draftList
=
[];
result
.
forEach
((
draft
,
idx
)
=>
{
var
draftrow
=
{};
draftrow
.
draftId
=
draft
.
id
;
draftrow
.
draftName
=
draft
.
draftName
;
draftList
.
push
(
draftrow
);
});
this
.
viewDraftData
=
draftList
;
}).
catch
(
e
=>
{
console
.
log
(
'findDraft error: '
,
e
);
});
},
updateDraft
:
function
()
{
var
data
=
{
obj
:
{
id
:
'2'
},
newData
:
{
draftData
:
{
"name"
:
"更新测试数据"
}}};
this
.
$root
.
postReq
(
"/web/drafthistoryCtl/updateDraft"
,
data
).
then
(
d
=>
{
console
.
log
(
"updateDraft return:"
,
d
);
}).
catch
(
e
=>
{
console
.
log
(
"updateDraft error "
,
e
);
});
},
deleteDraft
:
function
(
row
)
{
console
.
log
(
'----------'
,
row
.
draftId
);
var
data
=
{
id
:
row
.
draftId
};
this
.
$root
.
getReq
(
"/web/drafthistoryCtl/deleteDraft"
,
data
).
then
(
d
=>
{
console
.
log
(
"deleteDraft return:"
,
d
);
this
.
$message
.
success
(
"删除成功"
);
this
.
viewDraftData
.
forEach
((
rowData
,
idx
)
=>
{
if
(
row
===
rowData
)
{
this
.
viewDraftData
.
splice
(
idx
,
1
);
}
});
}).
catch
(
e
=>
{
console
.
log
(
"deleteDraft error: "
,
e
);
});
},
createDraft
:
function
()
{
if
(
!
this
.
inputDraftName
)
{
this
.
$message
.
warning
(
"草稿名称不能为空"
);
return
;
};
var
data
=
{
draftName
:
this
.
inputDraftName
,
draftData
:
{
checkedNcl
:
this
.
checkedNcl
,
form
:
this
.
form
,
nclOne
:
this
.
nclOne
,
apply
:
this
.
apply
}};
this
.
$root
.
postReq
(
"/web/drafthistoryCtl/createDraft"
,
data
).
then
(
d
=>
{
console
.
log
(
"createDraft return:"
,
d
);
this
.
$message
.
success
(
"保存草稿成功"
);
this
.
saveDraft
=
false
;
}).
catch
(
e
=>
{
console
.
log
(
"createDraft error: "
,
e
);
})
},
usedraft
:
function
()
{
usedraft
:
function
()
{
this
.
$confirm
(
'是否复用草稿数据?'
,
'提示'
,
{
this
.
$confirm
(
'是否复用草稿数据?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
...
...
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