Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
d74d48bb
Commit
d74d48bb
authored
Apr 08, 2020
by
佟礼
Browse files
Options
Browse Files
Download
Plain Diff
搜索
parents
115ceb40
d5ba0e3c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1273 additions
and
964 deletions
+1273
-964
filed.vue
components/page/filed.vue
+35
-13
index.vue
pages/aps/aps/index.vue
+66
-39
index.vue
pages/aps/results/index.vue
+2
-0
detail.vue
pages/crm/customer/detail.vue
+17
-16
orderManager.vue
pages/order/orderManager.vue
+1
-0
processMain.vue
pages/processManage/Process/processMain.vue
+3
-3
index.vue
pages/processManage/setProcess/index.vue
+33
-32
orderscheduling.vue
pages/produce/orderscheduling.vue
+231
-136
scheduling.vue
pages/produce/scheduling.vue
+7
-6
taskList.vue
pages/produce/taskList.vue
+139
-102
index.vue
pages/qc/dataTrace/index.vue
+328
-286
index.vue
pages/qc/taskList/index.vue
+337
-277
cart.vue
pages/resource/resource/cart.vue
+1
-1
index.js
store/index.js
+73
-53
No files found.
components/page/filed.vue
View file @
d74d48bb
<
template
>
<
template
>
<Col
:span=
"span"
class=
"filed-col"
>
<Col
:span=
"span"
class=
"filed-col"
>
<
label
v-text=
"name"
class=
"label"
></label
>
<
div
v-text=
"name"
class=
"label"
></div
>
<
span
>
<
p
>
<slot></slot>
<slot></slot>
</
span
>
</
p
>
</Col>
</Col>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'filed'
,
name
:
"filed"
,
props
:
{
props
:
{
name
:
{
name
:
{
type
:
String
type
:
String
...
@@ -18,29 +18,51 @@ export default {
...
@@ -18,29 +18,51 @@ export default {
default
:
12
default
:
12
}
}
}
}
}
}
;
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.detail {
.detail {
display: table;
display: table;
height: 100%;
border-collapse: collapse;
border-collapse: collapse;
.ivu-row {
.ivu-row {
display: table-row
;
border: 1px solid #ddd
;
border-top:
1px solid #ddd
;
border-top:
none
;
border-left: 1px solid #ddd
;
height: 100%
;
.filed-col {
.filed-col {
display: table-cell;
max-width: 970px;
border-bottom: 1px solid #ddd;
border: 1px solid #ddd;
border-right: 1px solid #ddd;
border-right: none;
// margin: 0 0 -1px -1px;
margin: 0 -1px -1px -1px;
line-height: 30px;
box-sizing: border-box;
box-sizing: border-box;
line-height: 70px;
.label {
.label {
background: #e8eaf1;
background: #e8eaf1;
display: inline-block;
display: inline-block;
width: 100px;
width: 100px;
text-align: right;
text-align: right;
padding: 0 5px;
padding: 0 5px;
line-height: 40px;
float: left;
height: 100%;
}
p {
max-width: 870px;
height: 100%;
word-break: break-all;
word-wrap: break-word;
margin: 0 10px 0 110px;
line-height: 20px;
padding-top: 10px;
}
}
.ivu-col-span-24 {
.label {
height: 100%;
padding: 0.5% 5px;
}
p {
padding-top: 1%;
}
}
}
}
}
}
...
...
pages/aps/aps/index.vue
View file @
d74d48bb
...
@@ -400,49 +400,76 @@ export default {
...
@@ -400,49 +400,76 @@ export default {
});
});
parmsOrderpriority
.
alls
=
arryIds
;
parmsOrderpriority
.
alls
=
arryIds
;
// alert(JSON.stringify(parmsOrderpriority));
// alert(JSON.stringify(parmsOrderpriority));
Api
.
orderpriority
(
parmsOrderpriority
).
then
(
res
=>
{
Api
.
orderpriority
(
parmsOrderpriority
)
if
(
res
.
success
)
{
.
then
(
res
=>
{
if
(
res
.
result
)
{
if
(
res
.
success
)
{
//this.$Message.success("排序成功");
if
(
res
.
result
)
{
//apsp排产前检查
//this.$Message.success("排序成功");
Api
.
apsdatachecked
().
then
(
res1
=>
{
//apsp排产前检查
if
(
res1
.
success
)
{
Api
.
apsdatachecked
()
if
(
res1
.
result
.
res
)
{
.
then
(
res1
=>
{
// this.$Message.success("数据校验成功");
if
(
res1
.
success
)
{
//排产计算
if
(
res1
.
result
.
res
)
{
let
paramsTime
=
{
// this.$Message.success("数据校验成功");
setTime
:
this
.
entity
.
setTime
//排产计算
};
let
paramsTime
=
{
Api
.
apsprepareandcalc
(
paramsTime
).
then
(
res2
=>
{
setTime
:
this
.
entity
.
setTime
if
(
res2
.
success
)
{
};
if
(
res2
.
result
.
res
)
{
Api
.
apsprepareandcalc
(
paramsTime
)
this
.
$Message
.
success
(
"排产计算成功"
);
.
then
(
res2
=>
{
this
.
circleModal
=
false
;
if
(
res2
.
success
)
{
this
.
$router
.
push
({
if
(
res2
.
result
.
res
)
{
name
:
"aps-results"
this
.
$Message
.
success
(
"排产计算成功"
);
// params: { customerId: id }
this
.
circleModal
=
false
;
});
this
.
$router
.
push
({
}
else
{
name
:
"aps-results"
this
.
$Message
.
error
(
res2
.
result
.
msg
);
// params: { customerId: id }
}
});
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res2
.
result
.
msg
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排产计算"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
}
else
{
}
else
{
this
.
$Message
.
error
(
"操作失败:排产计算"
);
this
.
circleModal
=
false
;
this
.
$Message
.
success
(
"数据校验失败"
);
}
}
});
}
else
{
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
success
(
"数据校验失败"
);
this
.
$Message
.
error
(
"操作失败:数据校验"
);
}
}
}
else
{
})
this
.
$Message
.
error
(
"操作失败:数据校验"
);
.
catch
(
}
function
(
err
)
{
});
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"排序失败,请重新APS排产操作"
);
}
}
else
{
}
else
{
this
.
$Message
.
error
(
"排序失败,请重新APS排产操作"
);
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排序"
);
}
}
}
else
{
})
this
.
$Message
.
error
(
"操作失败:排序"
);
.
catch
(
}
function
(
err
)
{
});
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
},
//打开设置参数
//打开设置参数
openAddModel
(
type
,
row
)
{
openAddModel
(
type
,
row
)
{
...
...
pages/aps/results/index.vue
View file @
d74d48bb
...
@@ -175,6 +175,7 @@ export default {
...
@@ -175,6 +175,7 @@ export default {
if
(
r
.
success
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"清空列表成功"
);
this
.
$Message
.
success
(
"清空列表成功"
);
this
.
orderlist
();
this
.
orderlist
();
this
.
data
=
[];
}
}
});
});
},
},
...
@@ -192,6 +193,7 @@ export default {
...
@@ -192,6 +193,7 @@ export default {
if
(
r
.
result
)
{
if
(
r
.
result
)
{
this
.
$Message
.
success
(
r
.
result
.
retmsg
);
this
.
$Message
.
success
(
r
.
result
.
retmsg
);
this
.
orderlist
();
this
.
orderlist
();
this
.
data
=
[];
}
else
{
}
else
{
this
.
$Message
.
success
(
"下发失败"
);
this
.
$Message
.
success
(
"下发失败"
);
}
}
...
...
pages/crm/customer/detail.vue
View file @
d74d48bb
...
@@ -15,49 +15,50 @@
...
@@ -15,49 +15,50 @@
<Filed
:span=
"12"
:name=
"l('status')"
>
<Filed
:span=
"12"
:name=
"l('status')"
>
<state
code=
"crm.customer.status"
:value=
"entity.status"
type=
"text"
></state>
<state
code=
"crm.customer.status"
:value=
"entity.status"
type=
"text"
></state>
</Filed>
</Filed>
<Filed
:span=
"24"
:name=
"l('notes')"
>
{{
entity
.
notes
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('trade')"
>
{{
entity
.
trade
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('notes')"
>
{{
entity
.
notes
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('trade')"
>
{{
entity
.
trade
}}
</Filed>
</Row>
</Row>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
data
()
{
return
{
return
{
entity
:
{},
entity
:
{},
rules
:
{
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
}
}
}
;
},
},
props
:
{
props
:
{
eid
:
Number
eid
:
Number
},
},
methods
:
{
methods
:
{
load
(
v
)
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
(
r
)
=>
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
this
.
entity
=
r
.
result
;
this
.
$emit
(
'on-load'
)
this
.
$emit
(
"on-load"
);
})
})
;
},
},
handleClose
()
{
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
},
l
(
key
)
{
l
(
key
)
{
key
=
'Customer'
+
'.'
+
key
key
=
"Customer"
+
"."
+
key
;
return
this
.
$t
(
key
)
return
this
.
$t
(
key
)
;
}
}
},
},
watch
:
{
watch
:
{
eid
(
v
)
{
eid
(
v
)
{
if
(
v
!=
0
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
}
}
}
;
</
script
>
</
script
>
pages/order/orderManager.vue
View file @
d74d48bb
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
</div>
</div>
</div>
</div>
</Sider>
</Sider>
<Content
class=
"content"
>
<Content
class=
"content"
>
<CustomTable
:tcolumn=
"ocolumn"
:orderSearchForm=
"orderSearchForm"
ref=
"CustomTable"
>
<CustomTable
:tcolumn=
"ocolumn"
:orderSearchForm=
"orderSearchForm"
ref=
"CustomTable"
>
<!-- slot内容 -->
<!-- slot内容 -->
...
...
pages/processManage/Process/processMain.vue
View file @
d74d48bb
...
@@ -183,9 +183,9 @@ export default {
...
@@ -183,9 +183,9 @@ export default {
RoutingList
:
{},
RoutingList
:
{},
components
:
{},
components
:
{},
ruleValidate
:
{
ruleValidate
:
{
code
:
[
//
code: [
{
required
:
true
,
message
:
'工艺文件编号不能为空'
,
trigger
:
'blur'
}
//
{ required: true, message: '工艺文件编号不能为空', trigger: 'blur' }
],
//
],
// number:[{required: true,type:'number'}],
// number:[{required: true,type:'number'}],
name
:
[
name
:
[
{
required
:
true
,
message
:
'工艺文件名称不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'工艺文件名称不能为空'
,
trigger
:
'blur'
}
...
...
pages/processManage/setProcess/index.vue
View file @
d74d48bb
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
</FormItem>
</FormItem>
</Col>
</Col>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"
订单
状态"
style=
"width:100%"
>
<FormItem
label=
"状态"
style=
"width:100%"
>
<dictionary
<dictionary
code=
"plan.order.status"
code=
"plan.order.status"
v-model=
"orderSearchForm.status"
v-model=
"orderSearchForm.status"
...
@@ -74,6 +74,28 @@
...
@@ -74,6 +74,28 @@
</Col>
</Col>
</Row>
</Row>
<Row>
<Row>
<Col
span=
"12"
>
<FormItem
label=
"项目号"
style=
"width:100%"
>
<Input
v-model=
"orderSearchForm.projectNumber"
placeholder
style=
"width:240px"
/>
</FormItem>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"批次号"
style=
"width:100%"
>
<Input
v-model=
"orderSearchForm.batchNumber"
placeholder
style=
"width:240px"
/>
</FormItem>
</Col>
</Row>
<Row>
<Col
span=
"12"
>
<FormItem
label=
"紧急程度"
style=
"width:100%"
>
<dictionary
code=
"plan.order.urgencyLevel"
v-model=
"orderSearchForm.urgencyLevel"
style=
"width:240px"
></dictionary>
</FormItem>
</Col>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"任务类型"
style=
"width:100%"
>
<FormItem
label=
"任务类型"
style=
"width:100%"
>
<dictionary
<dictionary
...
@@ -83,6 +105,8 @@
...
@@ -83,6 +105,8 @@
></dictionary>
></dictionary>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
<Row>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"阶段"
style=
"width:100%"
>
<FormItem
label=
"阶段"
style=
"width:100%"
>
<dictionary
<dictionary
...
@@ -92,8 +116,6 @@
...
@@ -92,8 +116,6 @@
></dictionary>
></dictionary>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
<Row>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"材料"
style=
"width:100%"
>
<FormItem
label=
"材料"
style=
"width:100%"
>
<dictionary
<dictionary
...
@@ -103,13 +125,13 @@
...
@@ -103,13 +125,13 @@
></dictionary>
></dictionary>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
<Row>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"数量"
style=
"width:100%"
>
<FormItem
label=
"数量"
style=
"width:100%"
>
<InputNumber
:min=
"0"
v-model=
"orderSearchForm.quantity"
style=
"width:240px"
></InputNumber>
<InputNumber
:min=
"0"
v-model=
"orderSearchForm.quantity"
style=
"width:240px"
></InputNumber>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
<Row>
<Col
span=
"12"
>
<Col
span=
"12"
>
<FormItem
label=
"甲方客户"
style=
"width:100%"
>
<FormItem
label=
"甲方客户"
style=
"width:100%"
>
<dictionary
<dictionary
...
@@ -119,15 +141,6 @@
...
@@ -119,15 +141,6 @@
></dictionary>
></dictionary>
</FormItem>
</FormItem>
</Col>
</Col>
<Col
span=
"12"
>
<FormItem
label=
"3D打印承制单位"
style=
"width:100%"
>
<dictionary
code=
"plan.order.printSupply"
v-model=
"orderSearchForm.printSupply"
style=
"width:240px"
></dictionary>
</FormItem>
</Col>
</Row>
</Row>
<Row>
<Row>
<Col
span=
"12"
>
<Col
span=
"12"
>
...
@@ -185,18 +198,6 @@
...
@@ -185,18 +198,6 @@
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
</Row>
<Row>
<Col
span=
"12"
>
<FormItem
label=
"工艺状态"
style=
"width:100%"
>
<Select
v-model=
"orderSearchForm.RoutingSetStatus"
style=
"width:200px"
>
<Option
value
>
全部
</Option>
<Option
value=
"1"
>
已设置
</Option>
<Option
value=
"0"
>
未设置
</Option>
</Select>
</FormItem>
</Col>
<Col
span=
"12"
></Col>
</Row>
</Form>
</Form>
<div
slot=
"footer"
>
<div
slot=
"footer"
>
<Button
@
click=
"close"
style=
"margin-left:20px;"
>
取消
</Button>
<Button
@
click=
"close"
style=
"margin-left:20px;"
>
取消
</Button>
...
@@ -412,13 +413,13 @@ export default {
...
@@ -412,13 +413,13 @@ export default {
operatorIdList
:
[]
//操作员id
operatorIdList
:
[]
//操作员id
},
//确定保存后返回数据
},
//确定保存后返回数据
orderSearchForm
:
{
orderSearchForm
:
{
productId
:
null
,
//产品id
productId
:
""
,
//产品id
productName
:
""
,
//产品名称
productName
:
""
,
//产品名称
taskType
:
""
,
//任务类型
taskType
:
""
,
//任务类型
stage
:
""
,
//阶段
stage
:
""
,
//阶段
materialId
:
""
,
//材料
materialId
:
""
,
//材料
quantity
:
0
,
//数量
quantity
:
null
,
//数量
guestName
:
""
,
//甲方客户
guestName
:
""
,
//甲方客户
printSupply
:
""
,
//3D打印承制单位
printSupply
:
""
,
//3D打印承制单位
functionaryOffice
:
""
,
//厂内责任机关
functionaryOffice
:
""
,
//厂内责任机关
...
@@ -437,9 +438,9 @@ export default {
...
@@ -437,9 +438,9 @@ export default {
demandStartDate
:
""
,
//开始时间
demandStartDate
:
""
,
//开始时间
demandFinishDate
:
""
,
//完成时间
demandFinishDate
:
""
,
//完成时间
remark
:
""
,
//备注
remark
:
""
,
//备注
MaxResultCount
:
10
,
projectNumber
:
""
,
//项目号
SkipCount
:
0
,
batchNumber
:
""
,
//批次号
RoutingSetStatus
:
""
urgencyLevel
:
null
//紧急程度
},
},
formValidate
:
{
formValidate
:
{
id
:
""
,
id
:
""
,
...
...
pages/produce/orderscheduling.vue
View file @
d74d48bb
This diff is collapsed.
Click to expand it.
pages/produce/scheduling.vue
View file @
d74d48bb
<
template
>
<
template
>
<Tabs
:animated=
"false"
>
<orderscheduling
:style=
"
{ height: tabHeight }" ref="orderscheduling">
</orderscheduling>
<!--
<Tabs
:animated=
"false"
>
<TabPane
label=
"排产派工"
name=
"1"
>
<TabPane
label=
"排产派工"
name=
"1"
>
<orderscheduling
:style=
"
{ height: tabHeight }" ref="orderscheduling">
</orderscheduling>
<orderscheduling
:style=
"
{ height: tabHeight }" ref="orderscheduling">
</orderscheduling>
</TabPane>
</TabPane>
<TabPane
label=
"料单确认"
name=
"2"
>
<TabPane
label=
"料单确认"
name=
"2"
>
<ordermaterial
:style=
"
{ height: tabHeight }" ref="ordermaterial">
</ordermaterial>
<ordermaterial
:style=
"
{ height: tabHeight }" ref="ordermaterial">
</ordermaterial>
</TabPane>
</TabPane>
</Tabs>
</Tabs>
-->
</
template
>
</
template
>
<
script
>
<
script
>
import
ordermaterial
from
'./ordermaterial.vue'
//
import ordermaterial from './ordermaterial.vue'
import
orderscheduling
from
'./orderscheduling.vue'
import
orderscheduling
from
'./orderscheduling.vue'
export
default
{
export
default
{
components
:
{
ordermaterial
,
orderscheduling
},
components
:
{
orderscheduling
},
data
()
{
data
()
{
return
{
return
{
tabHeight
:
""
tabHeight
:
""
...
...
pages/produce/taskList.vue
View file @
d74d48bb
This diff is collapsed.
Click to expand it.
pages/qc/dataTrace/index.vue
View file @
d74d48bb
This diff is collapsed.
Click to expand it.
pages/qc/taskList/index.vue
View file @
d74d48bb
This diff is collapsed.
Click to expand it.
pages/resource/resource/cart.vue
View file @
d74d48bb
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</Col>
</Col>
<Col
span=
"7"
>
<Col
span=
"7"
>
<FormItem
label=
"领料人"
style=
"width:100%"
prop=
"customerId"
>
<FormItem
label=
"领料人"
style=
"width:100%"
prop=
"customerId"
>
<UserSelect
ref=
"userSelected"
v-model=
"resource.customerId"
:type=
"
1
"
/>
<UserSelect
ref=
"userSelected"
v-model=
"resource.customerId"
:type=
"
0
"
/>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
</Row>
...
...
store/index.js
View file @
d74d48bb
import
createVuexAlong
from
'vuex-along'
import
createVuexAlong
from
'vuex-along'
import
Api
from
'@/plugins/request'
import
Api
from
'@/plugins/request'
export
const
state
=
()
=>
({
export
const
state
=
()
=>
({
counter
:
0
,
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
dictionary
:
new
Map
(),
//所有字典项
userMap
:[],
//所有用户缓存;
userMap
:
[],
//所有用户缓存;
userInfo
:{
userInfo
:
{
userId
:
0
,
userId
:
0
,
userName
:
""
userName
:
""
}
},
cart
:[],
count
:
0
,
})
})
export
const
getters
=
{
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
let
result
=
[];
let
result
=
[];
let
items
=
state
.
dictionary
.
get
(
key
);
let
items
=
state
.
dictionary
.
get
(
key
);
...
@@ -19,7 +21,7 @@ export const getters={
...
@@ -19,7 +21,7 @@ export const getters={
}
}
return
result
;
return
result
;
},
},
getUser
:
state
=>
key
=>
{
getUser
:
state
=>
key
=>
{
// try{
// try{
// if(state.userMap.has(key)){
// if(state.userMap.has(key)){
// return state.userMap.get(key);
// return state.userMap.get(key);
...
@@ -27,41 +29,59 @@ export const getters={
...
@@ -27,41 +29,59 @@ export const getters={
// }catch(e){
// }catch(e){
// console.log(e);
// console.log(e);
// }
// }
let
user
=
state
.
userMap
.
filter
(
u
=>
{
return
u
.
id
==
key
});
let
user
=
state
.
userMap
.
filter
(
u
=>
{
if
(
user
.
length
>
0
){
return
u
.
id
==
key
});
if
(
user
.
length
>
0
)
{
return
user
[
0
]
return
user
[
0
]
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
}
}
}
export
const
mutations
=
{
export
const
mutations
=
{
increment
(
state
){
increment
(
state
)
{
state
.
counter
++
state
.
counter
++
},
},
setUserInfo
(
state
,
userInfo
)
{
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
// sessionStorage.setItem("token", userInfo.token);
},
},
addUser
(
state
,
user
){
addUser
(
state
,
user
)
{
state
.
userMap
.
push
(
user
);
state
.
userMap
.
push
(
user
);
},
},
setDictionary
(
state
,
dictionary
)
{
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
state
.
dictionary
=
dictionary
;
},
},
setCart
(
state
,
cart
)
{
state
.
cart
=
cart
;
},
setCartCount
(
state
,
count
)
{
state
.
count
=
count
;
}
}
}
export
const
actions
=
{
export
const
actions
=
{
async
loadUser
({
commit
},
key
){
async
loadUser
({
commit
let
{
result
}
=
await
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,{
id
:
key
});
},
key
)
{
console
.
warn
(
"result"
,
result
)
commit
(
"addUser"
,
result
);
let
{
result
}
=
await
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
key
});
console
.
warn
(
"result"
,
result
)
commit
(
"addUser"
,
result
);
},
},
async
loadDictionary
({
commit
})
{
async
loadDictionary
({
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
result
}
=
await
Api
.
get
(
url
);
let
{
result
}
=
await
Api
.
get
(
url
);
var
map
=
new
Map
();
var
map
=
new
Map
();
...
@@ -74,20 +94,20 @@ export const actions={
...
@@ -74,20 +94,20 @@ export const actions={
}
}
}
}
export
const
plugins
=
[
export
const
plugins
=
[
createVuexAlong
({
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
name
:
"hyhmes"
,
local
:
{
local
:
{
list
:
[
"hyhmes"
],
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
isFilter
:
true
,
},
},
session
:
{
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
list
:
[
"hyhmes.session"
],
},
},
}),
}),
]
]
//设置 strict 为不严格模式,即可在actions中修改state
//设置 strict 为不严格模式,即可在actions中修改state
export
const
strict
=
false
;
export
const
strict
=
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