Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-admin
Commits
e59f1c1e
提交
e59f1c1e
authored
7月 28, 2023
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增客户资料页面
上级
7b5b45ce
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
499 行增加
和
238 行删除
+499
-238
bank.ts
src/services/api/config/bank.ts
+31
-0
selectSpec.vue
src/views/commodityManage/components/selectSpec.vue
+253
-208
edit.vue
src/views/commodityManage/edit.vue
+0
-25
bank.vue
src/views/config/bank.vue
+210
-0
vite.config.ts
vite.config.ts
+2
-2
yongxinda-admin-build-docker.py
yongxinda-admin-build-docker.py
+3
-3
没有找到文件。
src/services/api/config/bank.ts
0 → 100644
浏览文件 @
e59f1c1e
import
{
request
}
from
'../config'
export
function
getBankList
(
params
:
any
)
{
return
request
({
url
:
'/bank_info'
,
method
:
'get'
,
params
,
})
}
export
function
addBank
(
data
:
any
)
{
return
request
({
url
:
'/bank_info'
,
method
:
'post'
,
data
,
})
}
export
function
updateBank
(
data
:
any
)
{
return
request
({
url
:
'/bank_info'
,
method
:
'put'
,
data
,
})
}
export
function
deleteBank
(
id
:
any
)
{
return
request
({
url
:
'/bank_info'
,
method
:
'delete'
,
params
:
{
id
},
})
}
src/views/commodityManage/components/selectSpec.vue
浏览文件 @
e59f1c1e
<
template
>
<el-card>
<div
style=
"display: flex; flex-direction: row; align-items: center
;
"
>
<h3
style=
"width: 15%
;
"
>
选择规格
</h3>
<div
style=
"display: flex; flex-direction: row; align-items: center"
>
<h3
style=
"width: 15%"
>
选择规格
</h3>
<el-alert
style=
"width: 50%"
title=
"注意:对规格排序之后会对之前添加购物车的商品有影响!"
type=
"warning"
:closable=
"false"
/>
</div>
<div>
{{
data
}}
</div>
<div
v-if=
"JSON.stringify(specData) != '[]'"
>
<div
v-for=
"(item, i) in specDatas"
:key=
"i"
>
<div
style=
"display: flex; justify-content: space-between;"
>
<div
style=
"margin-bottom: 20px;"
>
<el-tag
class=
"ml-2"
effect=
"dark"
size=
"large"
>
{{
item
.
specification
}}
</el-tag>
<div
style=
"display: flex; justify-content: space-between"
>
<div
style=
"margin-bottom: 20px"
>
<el-tag
class=
"ml-2"
effect=
"dark"
size=
"large"
>
{{
item
.
specification
}}
</el-tag>
</div>
<div
style=
"margin-right: 5%
;
"
>
<div
style=
"margin-right: 5%"
>
<el-button
v-show=
"i !== 0"
type=
"primary"
icon=
"top"
circle
@
click=
"handleAscending(item)"
/>
<el-button
v-show=
"specDatas.length - 1 !== i"
type=
"primary"
icon=
"bottom"
circle
@
click=
"handleDescending(item)"
/>
...
...
@@ -24,7 +26,7 @@
</div>
</div>
<el-button
v-if=
"JSON.stringify(specData) != '[]'"
type=
"primary"
style=
"float: right; margin-right: 5%; margin-bottom: 20px
;
"
@
click=
"showAddSpec"
>
添加
</el-button>
style=
"float: right; margin-right: 5%; margin-bottom: 20px"
@
click=
"showAddSpec"
>
添加
</el-button>
</el-card>
<el-card>
...
...
@@ -32,8 +34,8 @@
<el-table
:data=
"specificationData"
>
<el-table-column
type=
"expand"
>
<template
#
default=
"scope"
>
<el-row
style=
"padding: 30px
;
"
>
<el-col
:span=
"8"
style=
"margin-right: 30px;"
>
<el-row
style=
"padding: 30px"
>
<
!--
<
el-col
:span=
"8"
style=
"margin-right: 30px;"
>
<params-attr
:attributeData=
"
{ attributeList: scope.row.attributeList, index: scope.$index }"
@paramsChange="paramsChange" style="width: 50%;" />
...
...
@@ -42,18 +44,17 @@
<main-config
:mainConfigurationsData=
"
{ mainConfigurationsList: scope.row.mainConfigurationsList, index: scope.$index }"
@mainConfigChange="mainConfigChange" style="width: 50%;" />
</el-col>
<el-col
:span=
"7"
style=
"margin-left: 2%"
>
</el-col>
-->
<el-col
style=
"margin-left: 2%"
>
<parts
:partsData=
"
{ partList: scope.row.partList, index: scope.$index }"
@partsChange="partsChange" style="width: 50%
;
" />
@partsChange="partsChange" style="width: 50%" />
</el-col>
</el-row>
</
template
>
</el-table-column>
<el-table-column
label=
"规格属性"
>
<
template
#
default=
"scope"
>
<el-tag
v-for=
"(item, i) in scope.row.specifications.length"
:key=
"i"
>
{{
scope
.
row
.
specifications
[
i
]
<el-tag
v-for=
"(item, i) in scope.row.specifications.length"
:key=
"i"
>
{{
scope
.
row
.
specifications
[
i
]
}}
</el-tag>
</
template
>
...
...
@@ -72,240 +73,285 @@
<add-specifications
ref=
"specificationsRef"
@
clickAdd=
"clickAdd"
@
clickEdit=
"clickEdit"
/>
</template>
<
script
setup
lang=
'ts'
>
import
{
ref
,
computed
,
watch
}
from
'vue'
import
{
ElMessage
}
from
'element-plus'
import
paramsAttr
from
'./paramsAttr.vue'
import
mainConfig
from
'./mainConfig.vue'
import
addSpecifications
from
'./addSpecifications.vue'
import
parts
from
'./parts.vue'
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
watch
}
from
"vue"
;
import
{
ElMessage
}
from
"element-plus"
;
//
import paramsAttr from './paramsAttr.vue'
//
import mainConfig from './mainConfig.vue'
import
addSpecifications
from
"./addSpecifications.vue"
;
import
parts
from
"./parts.vue"
;
let
props
=
defineProps
({
specData
:
{
type
:
Object
,
default
:
[]
default
:
[]
,
},
products
:
{
type
:
Object
,
default
:
[]
}
})
default
:
[]
,
}
,
})
;
let
emits
=
defineEmits
([
'productsData'
,
'handleSort'
])
let
emits
=
defineEmits
([
"productsData"
,
"handleSort"
]);
let
data
=
computed
(()
=>
{
if
(
JSON
.
stringify
(
props
.
specData
)
!=
'[]'
)
{
specDatas
.
value
=
[]
group
(
props
.
specData
)
if
(
JSON
.
stringify
(
props
.
specData
)
!=
"[]"
)
{
specDatas
.
value
=
[]
;
group
(
props
.
specData
)
;
}
else
{
specDatas
.
value
=
[]
specificationData
.
value
=
[]
specDatas
.
value
=
[]
;
specificationData
.
value
=
[]
;
}
})
})
;
let
specificationsRef
=
ref
()
let
specList
=
ref
([]
as
any
)
let
specificationData
=
ref
([]
as
any
)
let
specificationsRef
=
ref
()
;
let
specList
=
ref
([]
as
any
)
;
let
specificationData
=
ref
([]
as
any
)
;
var
specDatas
=
ref
([]
as
any
)
//符合条件的数据
var
specDatas
=
ref
([]
as
any
)
;
//符合条件的数据
watch
(
specDatas
.
value
,
(
newVlaue
:
any
)
=>
{
if
(
JSON
.
stringify
(
newVlaue
)
===
'[]'
)
{
specDatas
.
value
=
[]
specificationData
.
value
=
[]
}
},
{
deep
:
true
,
immediate
:
true
})
watch
(
specDatas
.
value
,
(
newVlaue
:
any
)
=>
{
if
(
JSON
.
stringify
(
newVlaue
)
===
"[]"
)
{
specDatas
.
value
=
[];
specificationData
.
value
=
[];
}
},
{
deep
:
true
,
immediate
:
true
}
);
let
setSpecifications
=
(
data
:
any
)
=>
{
if
(
data
)
specificationData
.
value
=
data
}
if
(
data
)
specificationData
.
value
=
data
;
}
;
// 升序
let
handleAscending
=
(
item
:
any
)
=>
{
emits
(
'handleSort'
,
'ascending'
,
item
)
}
emits
(
"handleSort"
,
"ascending"
,
item
);
}
;
// 降序
let
handleDescending
=
(
item
:
any
)
=>
{
emits
(
'handleSort'
,
'descending'
,
item
)
}
emits
(
"handleSort"
,
"descending"
,
item
);
}
;
// 参数值操作
let
paramsChange
=
(
type
:
string
,
data
:
any
,
index
:
any
)
=>
{
if
(
type
===
'add'
)
{
if
(
specificationData
.
value
[
index
].
id
!==
'undefined'
)
{
specificationData
.
value
[
index
].
updateTime
=
null
if
(
type
===
"add"
)
{
if
(
specificationData
.
value
[
index
].
id
!==
"undefined"
)
{
specificationData
.
value
[
index
].
updateTime
=
null
;
}
specificationData
.
value
[
index
].
attributeList
.
unshift
(
data
)
emits
(
'productsData'
,
specificationData
.
value
)
}
else
{
specificationData
.
value
[
index
].
attributeList
.
unshift
(
data
);
emits
(
"productsData"
,
specificationData
.
value
);
}
else
{
let
i
=
specificationData
.
value
[
index
].
attributeList
.
indexOf
(
data
);
let
deleteIndexParamsData
:
any
=
{}
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
attributeList
[
i
].
deleted
!==
'undefined'
)
{
// deleted标为ture即为删除
deleteIndexParamsData
=
specificationData
.
value
[
index
].
attributeList
[
i
]
// 记录要被删除的数据
deleteIndexParamsData
.
deleted
=
true
deleteIndexParamsData
.
updateTime
=
null
let
deleteIndexParamsData
:
any
=
{};
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
attributeList
[
i
].
deleted
!==
"undefined"
)
{
// deleted标为ture即为删除
deleteIndexParamsData
=
specificationData
.
value
[
index
].
attributeList
[
i
];
// 记录要被删除的数据
deleteIndexParamsData
.
deleted
=
true
;
deleteIndexParamsData
.
updateTime
=
null
;
}
specificationData
.
value
[
index
].
attributeList
.
splice
(
i
,
1
)
emits
(
'productsData'
,
specificationData
.
value
,
index
,
undefined
,
i
,
deleteIndexParamsData
)
specificationData
.
value
[
index
].
attributeList
.
splice
(
i
,
1
);
emits
(
"productsData"
,
specificationData
.
value
,
index
,
undefined
,
i
,
deleteIndexParamsData
);
}
}
}
;
// 参数值操作
let
mainConfigChange
=
(
type
:
string
,
data
:
any
,
index
:
any
)
=>
{
if
(
type
===
'add'
)
{
if
(
specificationData
.
value
[
index
].
id
!==
'undefined'
)
{
specificationData
.
value
[
index
].
updateTime
=
null
if
(
type
===
"add"
)
{
if
(
specificationData
.
value
[
index
].
id
!==
"undefined"
)
{
specificationData
.
value
[
index
].
updateTime
=
null
;
}
specificationData
.
value
[
index
].
mainConfigurationsList
.
unshift
(
data
)
emits
(
'productsData'
,
specificationData
.
value
)
}
else
{
specificationData
.
value
[
index
].
mainConfigurationsList
.
unshift
(
data
);
emits
(
"productsData"
,
specificationData
.
value
);
}
else
{
const
i
=
specificationData
.
value
[
index
].
mainConfigurationsList
.
indexOf
(
data
);
let
deleteIndexMainData
:
any
=
{}
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
mainConfigurationsList
[
i
].
deleted
!==
'undefined'
)
{
// deleted标为ture即为删除
deleteIndexMainData
=
specificationData
.
value
[
index
].
mainConfigurationsList
[
i
]
// 记录要被删除的数据
deleteIndexMainData
.
deleted
=
true
deleteIndexMainData
.
updateTime
=
null
let
deleteIndexMainData
:
any
=
{};
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
mainConfigurationsList
[
i
].
deleted
!==
"undefined"
)
{
// deleted标为ture即为删除
deleteIndexMainData
=
specificationData
.
value
[
index
].
mainConfigurationsList
[
i
];
// 记录要被删除的数据
deleteIndexMainData
.
deleted
=
true
;
deleteIndexMainData
.
updateTime
=
null
;
}
specificationData
.
value
[
index
].
mainConfigurationsList
.
splice
(
i
,
1
)
emits
(
'productsData'
,
specificationData
.
value
,
index
,
undefined
,
undefined
,
undefined
,
i
,
deleteIndexMainData
)
specificationData
.
value
[
index
].
mainConfigurationsList
.
splice
(
i
,
1
);
emits
(
"productsData"
,
specificationData
.
value
,
index
,
undefined
,
undefined
,
undefined
,
i
,
deleteIndexMainData
);
}
}
}
;
// 配件操作
let
partsChange
=
(
type
:
string
,
data
:
any
,
index
:
any
)
=>
{
if
(
type
===
'add'
)
{
if
(
specificationData
.
value
[
index
].
id
!==
'undefined'
)
{
specificationData
.
value
[
index
].
updateTime
=
null
if
(
type
===
"add"
)
{
if
(
specificationData
.
value
[
index
].
id
!==
"undefined"
)
{
specificationData
.
value
[
index
].
updateTime
=
null
;
}
specificationData
.
value
[
index
].
partList
.
unshift
(
data
)
emits
(
'productsData'
,
specificationData
.
value
)
}
else
{
specificationData
.
value
[
index
].
partList
.
unshift
(
data
);
emits
(
"productsData"
,
specificationData
.
value
);
}
else
{
const
i
=
specificationData
.
value
[
index
].
partList
.
indexOf
(
data
);
let
deleteIndexPartsData
:
any
=
{}
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
partList
[
i
].
deleted
!==
'undefined'
)
{
// deleted标为ture即为删除
deleteIndexPartsData
=
specificationData
.
value
[
index
].
partList
[
i
]
// 记录要被删除的数据
deleteIndexPartsData
.
deleted
=
true
deleteIndexPartsData
.
updateTime
=
null
let
deleteIndexPartsData
:
any
=
{};
// 记录要被删除的数据
if
(
typeof
specificationData
.
value
[
index
].
partList
[
i
].
deleted
!==
"undefined"
)
{
// deleted标为ture即为删除
deleteIndexPartsData
=
specificationData
.
value
[
index
].
partList
[
i
];
// 记录要被删除的数据
deleteIndexPartsData
.
deleted
=
true
;
deleteIndexPartsData
.
updateTime
=
null
;
}
specificationData
.
value
[
index
].
partList
.
splice
(
i
,
1
)
emits
(
'productsData'
,
specificationData
.
value
,
index
,
undefined
,
undefined
,
undefined
,
undefined
,
undefined
,
i
,
deleteIndexPartsData
)
specificationData
.
value
[
index
].
partList
.
splice
(
i
,
1
);
emits
(
"productsData"
,
specificationData
.
value
,
index
,
undefined
,
undefined
,
undefined
,
undefined
,
undefined
,
i
,
deleteIndexPartsData
);
}
}
}
;
// 每组只可以取一个
let
radioChange
=
(
e
:
any
,
item
:
any
)
=>
{
item
.
values
.
forEach
((
res
:
any
)
=>
{
if
(
specList
.
value
.
indexOf
(
res
.
value
)
!=
-
1
)
{
let
s
=
specList
.
value
.
indexOf
(
res
.
value
)
let
s
=
specList
.
value
.
indexOf
(
res
.
value
)
;
if
(
specList
.
value
[
s
]
!=
e
)
{
specList
.
value
.
splice
(
s
,
1
)
specList
.
value
.
splice
(
s
,
1
)
;
}
}
})
if
(
specList
.
value
.
indexOf
(
e
)
==
-
1
)
specList
.
value
.
push
(
e
)
}
})
;
if
(
specList
.
value
.
indexOf
(
e
)
==
-
1
)
specList
.
value
.
push
(
e
)
;
}
;
// 把配件数据整合,让数据选择规格时顺序从上到下
let
handleSpecData
=
()
=>
{
let
data
=
[]
as
any
// specification, value
let
data
=
[]
as
any
;
// specification, value
// 深拷贝,避免影响原数组
let
newarr
=
JSON
.
parse
(
(
JSON
.
stringify
(
props
.
specData
)))
let
newarr
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
specData
));
newarr
.
map
((
item
:
any
)
=>
{
let
flag
=
true
let
flag
=
true
;
// 如果已经存储了相同的specification,则下面就不在循环
data
.
map
((
res
:
any
)
=>
{
if
(
item
.
specification
===
res
.
specification
)
flag
=
false
})
data
.
map
((
res
:
any
)
=>
{
if
(
item
.
specification
===
res
.
specification
)
flag
=
false
;
});
newarr
.
map
((
item1
:
any
)
=>
{
if
(
flag
)
{
if
(
item
.
specification
===
item1
.
specification
)
{
let
flag1
=
true
let
flag1
=
true
;
// 如果已经存储了相同的specification,就只添加value
data
.
map
((
res
:
any
)
=>
{
if
(
item
.
specification
===
res
.
specification
)
flag1
=
false
})
if
(
flag1
)
data
.
push
({
specification
:
item
.
specification
,
value
:
[
item1
.
value
]
})
else
data
.
forEach
((
res
:
any
)
=>
{
if
(
item1
.
specification
===
res
.
specification
)
res
.
value
.
push
(
item1
.
value
)
})
data
.
map
((
res
:
any
)
=>
{
if
(
item
.
specification
===
res
.
specification
)
flag1
=
false
;
});
if
(
flag1
)
data
.
push
({
specification
:
item
.
specification
,
value
:
[
item1
.
value
],
});
else
data
.
forEach
((
res
:
any
)
=>
{
if
(
item1
.
specification
===
res
.
specification
)
res
.
value
.
push
(
item1
.
value
);
});
}
}
})
})
return
data
}
})
;
})
;
return
data
;
}
;
// 判断规格属性的顺序是否正确,错误需要排序
let
handleSequence
=
(
data
:
any
)
=>
{
// console.log('firstSort', data, specList.value);
let
specListCopy
=
[...
specList
.
value
]
// 浅拷贝
let
specListCopy
=
[...
specList
.
value
]
;
// 浅拷贝
// 双重循环判断对应索引值是否对应
specList
.
value
.
map
((
arrVal
:
any
,
arr
:
number
)
=>
{
data
.
map
((
item
:
any
,
i
:
number
)
=>
{
if
(
arr
===
i
)
{
let
index
=
item
.
value
.
indexOf
(
arrVal
)
let
index
=
item
.
value
.
indexOf
(
arrVal
)
;
// console.log(index);
// 如果对应索引中没有对应关系,则取当前索引在拷贝数组找到对应值,直接赋值
if
(
index
===
-
1
)
{
data
[
arr
].
value
.
map
((
element
:
any
)
=>
{
let
index1
=
specListCopy
.
indexOf
(
element
)
let
index1
=
specListCopy
.
indexOf
(
element
)
;
if
(
index1
!==
-
1
)
{
specList
.
value
[
arr
]
=
specListCopy
[
index1
]
specList
.
value
[
arr
]
=
specListCopy
[
index1
]
;
}
})
})
;
}
}
})
})
}
})
;
})
;
}
;
// 打开添加规格属性框
let
showAddSpec
=
()
=>
{
if
(
specList
.
value
.
length
===
0
)
return
ElMessage
({
type
:
'warning'
,
message
:
'请先选择规格属性'
})
let
resultSpecData
=
handleSpecData
()
if
(
specList
.
value
.
length
!==
resultSpecData
.
length
)
return
ElMessage
({
type
:
'warning'
,
message
:
'请选择所有规格属性'
})
handleSequence
(
resultSpecData
)
if
(
specList
.
value
.
length
===
0
)
return
ElMessage
({
type
:
"warning"
,
message
:
"请先选择规格属性"
});
let
resultSpecData
=
handleSpecData
();
if
(
specList
.
value
.
length
!==
resultSpecData
.
length
)
return
ElMessage
({
type
:
"warning"
,
message
:
"请选择所有规格属性"
});
handleSequence
(
resultSpecData
);
specificationsRef
.
value
.
formData
=
{
bomCode
:
''
,
model
:
''
,
productName
:
''
,
url
:
''
,
designUrl
:
''
}
specificationsRef
.
value
.
title
=
'添加规格属性'
specificationsRef
.
value
.
showVisiable
=
true
}
bomCode
:
""
,
model
:
""
,
productName
:
""
,
url
:
""
,
designUrl
:
""
,
}
;
specificationsRef
.
value
.
title
=
"添加规格属性"
;
specificationsRef
.
value
.
showVisiable
=
true
;
}
;
// 修改规格顺序时触发
let
sort
=
()
=>
{
let
resultSpecData
=
handleSpecData
()
let
resultSpecData
=
handleSpecData
()
;
specificationData
.
value
.
forEach
((
item
:
any
)
=>
{
specList
.
value
=
item
.
specifications
if
(
item
.
specifications
.
length
===
resultSpecData
.
length
)
handleSequence
(
resultSpecData
)
else
handleLessSequence
(
resultSpecData
)
item
.
specifications
=
specList
.
value
if
(
item
.
updateTime
)
item
.
updateTime
=
null
})
specList
.
value
=
[]
emits
(
'productsData'
,
specificationData
.
value
)
}
specList
.
value
=
item
.
specifications
;
if
(
item
.
specifications
.
length
===
resultSpecData
.
length
)
handleSequence
(
resultSpecData
);
else
handleLessSequence
(
resultSpecData
);
item
.
specifications
=
specList
.
value
;
if
(
item
.
updateTime
)
item
.
updateTime
=
null
;
});
specList
.
value
=
[];
emits
(
"productsData"
,
specificationData
.
value
);
};
// 处理少的顺序
let
handleLessSequence
=
(
data
:
any
)
=>
{
let
specListCopy
=
[...
specList
.
value
]
// 浅拷贝
let
list
=
[]
as
any
// 存储有的数组
let
specListCopy
=
[...
specList
.
value
]
;
// 浅拷贝
let
list
=
[]
as
any
;
// 存储有的数组
data
.
map
((
item
:
any
,
i
:
number
)
=>
{
item
.
value
.
map
((
item1
:
any
)
=>
{
let
index
=
specListCopy
.
indexOf
(
item1
)
let
index
=
specListCopy
.
indexOf
(
item1
)
;
if
(
index
!==
-
1
)
// 去除重复规格属性
if
(
list
.
indexOf
(
specListCopy
[
index
])
===
-
1
)
list
.
push
(
specListCopy
[
index
])
})
})
specList
.
value
=
list
}
if
(
list
.
indexOf
(
specListCopy
[
index
])
===
-
1
)
// 去除重复规格属性
list
.
push
(
specListCopy
[
index
]);
})
;
})
;
specList
.
value
=
list
;
}
;
// 添加规格属性
let
clickAdd
=
(
formData
:
any
)
=>
{
...
...
@@ -314,98 +360,98 @@ let clickAdd = (formData: any) => {
price
:
0.0
,
number
:
0
,
url
:
""
,
attributeList
:
[],
mainConfigurationsList
:
[],
partList
:
[]
}
data
=
{
...
data
,
...
formData
}
specificationData
.
value
.
push
(
data
)
specList
.
value
=
[]
specDatas
.
value
=
poty
.
value
emits
(
'productsData'
,
specificationData
.
value
)
//
attributeList: [],
//
mainConfigurationsList: [],
partList
:
[]
,
}
;
data
=
{
...
data
,
...
formData
}
;
specificationData
.
value
.
push
(
data
)
;
specList
.
value
=
[]
;
specDatas
.
value
=
poty
.
value
;
emits
(
"productsData"
,
specificationData
.
value
);
// console.log(attributes.value, '规格属性数据');
}
}
;
let
clickEdit
=
(
formData
:
any
)
=>
{
if
(
typeof
formData
.
updateTime
!==
'undefined'
)
formData
.
updateTime
=
null
specificationData
.
value
[
editIndex
.
value
]
=
formData
}
if
(
typeof
formData
.
updateTime
!==
"undefined"
)
formData
.
updateTime
=
null
;
specificationData
.
value
[
editIndex
.
value
]
=
formData
;
};
let
editIndex
=
ref
()
//编辑规格的下标
let
editIndex
=
ref
()
;
//编辑规格的下标
// 修改规格属性数据
let
handleAttributeEdit
=
(
index
:
number
,
row
:
any
)
=>
{
specificationsRef
.
value
.
formData
=
row
editIndex
.
value
=
index
specificationsRef
.
value
.
title
=
'编辑规格属性'
specificationsRef
.
value
.
showVisiable
=
true
}
specificationsRef
.
value
.
formData
=
row
;
editIndex
.
value
=
index
;
specificationsRef
.
value
.
title
=
"编辑规格属性"
;
specificationsRef
.
value
.
showVisiable
=
true
;
}
;
// 删除规格属性数据
let
handleAttributeDelete
=
(
row
:
any
)
=>
{
let
index
=
specificationData
.
value
.
indexOf
(
row
);
let
deleteIndexData
:
any
=
{}
// 记录要被删除的数据
let
deleteIndexData
:
any
=
{}
;
// 记录要被删除的数据
// console.log(specificationData.value[index].deleted, 'specificationData.value[index].deleted');
if
(
typeof
specificationData
.
value
[
index
].
deleted
!==
'undefined'
)
{
// deleted标为ture即为删除
deleteIndexData
=
specificationData
.
value
[
index
]
// 记录要被删除的数据
deleteIndexData
.
deleted
=
true
deleteIndexData
.
updateTime
=
null
if
(
typeof
specificationData
.
value
[
index
].
deleted
!==
"undefined"
)
{
// deleted标为ture即为删除
deleteIndexData
=
specificationData
.
value
[
index
];
// 记录要被删除的数据
deleteIndexData
.
deleted
=
true
;
deleteIndexData
.
updateTime
=
null
;
}
specificationData
.
value
.
splice
(
index
,
1
);
emits
(
'productsData'
,
specificationData
.
value
,
index
,
deleteIndexData
)
}
emits
(
"productsData"
,
specificationData
.
value
,
index
,
deleteIndexData
);
}
;
let
poty
=
ref
()
let
poty
=
ref
()
;
// 把相同数据分组(递归)
let
group
=
(
data
:
any
)
=>
{
let
arr
=
[]
as
any
//记录相同索引
let
copyArr
=
[...
data
]
// 拷贝
let
list
=
[]
as
any
// 记录相同value
let
spec
=
copyArr
[
0
].
specification
// 记录specification
let
sort
=
copyArr
[
0
].
sort
// 记录sort
let
arr
=
[]
as
any
;
//记录相同索引
let
copyArr
=
[...
data
]
;
// 拷贝
let
list
=
[]
as
any
;
// 记录相同value
let
spec
=
copyArr
[
0
].
specification
;
// 记录specification
let
sort
=
copyArr
[
0
].
sort
;
// 记录sort
copyArr
.
forEach
((
item
:
any
,
i
:
number
)
=>
{
if
(
item
.
specification
==
copyArr
[
0
].
specification
)
{
arr
.
push
(
i
)
arr
.
push
(
i
)
;
list
.
push
({
value
:
item
.
value
,
type
:
'info'
})
type
:
"info"
,
})
;
}
});
let
sum
=
-
1
let
sum
=
-
1
;
arr
.
forEach
((
index
:
any
)
=>
{
sum
++
sum
++
;
if
(
arr
.
length
>
1
)
{
if
(
index
<
0
)
{
index
=
0
copyArr
.
splice
(
index
,
1
)
index
=
0
;
copyArr
.
splice
(
index
,
1
)
;
}
else
{
index
-=
sum
copyArr
.
splice
(
index
,
1
)
index
-=
sum
;
copyArr
.
splice
(
index
,
1
)
;
}
}
else
{
copyArr
.
splice
(
index
,
1
)
copyArr
.
splice
(
index
,
1
)
;
}
});
specDatas
.
value
.
push
({
specification
:
spec
,
values
:
list
,
specRadio
:
''
,
sort
})
if
(
copyArr
.
length
===
0
)
return
poty
.
value
=
[...
specDatas
.
value
]
else
group
(
copyArr
)
}
specRadio
:
""
,
sort
,
})
;
if
(
copyArr
.
length
===
0
)
return
(
poty
.
value
=
[...
specDatas
.
value
]);
else
group
(
copyArr
)
;
}
;
defineExpose
({
setSpecifications
,
sort
})
sort
,
})
;
</
script
>
<
style
lang=
"scss"
scoped
>
.el-divider--horizontal
{
margin
:
12px
0
!
important
;
}
</
style
>
\ No newline at end of file
</
style
>
src/views/commodityManage/edit.vue
浏览文件 @
e59f1c1e
...
...
@@ -10,11 +10,6 @@
<el-form-item
label=
"商品名称"
prop=
"name"
>
<el-input
v-model=
"goods.name"
/>
</el-form-item>
<!--
<el-form-item
label=
"市场售价"
prop=
"counterPrice"
>
<el-input
v-model=
"goods.counterPrice"
placeholder=
"0.00"
>
<template
slot=
"append"
>
元
</
template
>
</el-input>
</el-form-item>
-->
<el-form-item
label=
"是否新品"
>
<el-radio-group
v-model=
"goods.isNew"
>
<el-radio
:label=
"true"
>
新品
</el-radio>
...
...
@@ -45,17 +40,6 @@
</el-upload>
</el-form-item>
<!-- <el-form-item label="设计图片" prop="designUrl">
<el-upload :action="uploadPath" :limit="1" :show-file-list="false" :headers="headers"
:on-success="uploadCdUrl" list-type="picture" class="avatar-uploader"
accept=".jpg,.jpeg,.png,.gif">
<img v-if="goods.designUrl" :src="goods.designUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
</el-form-item> -->
<el-form-item
label=
"宣传画廊"
>
<el-upload
ref=
"uploadRef"
v-model:file-list=
"fileList"
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers"
:on-exceed=
"uploadOverrun"
:on-success=
"handleGalleryUrl"
...
...
@@ -80,15 +64,6 @@
<el-button
v-else
class=
"button-new-keyword"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
</el-form-item>
<!-- <el-form-item label="商品配件">
<el-select v-model="goodsParts" multiple collapse-tags collapse-tags-tooltip
style="width: 240px" @change="partsChange">
<el-option v-for="item in partsList" :key="item.id"
:label="item.partGoodsName ? item.partGoodsName : item.name"
:value="item.partGoodsId ? item.partGoodsId : item.id" />
</el-select>
</el-form-item> -->
<el-form-item
label=
"所属分类"
>
<el-select
v-model=
"goods.categoryId"
placeholder=
"请选择"
@
change=
"handleCategoryChange"
>
<el-option
v-for=
"item in categoryList"
:key=
"item.value"
:label=
"item.label"
...
...
src/views/config/bank.vue
0 → 100644
浏览文件 @
e59f1c1e
<
template
>
<div
class=
"app-container"
v-loading=
"loading"
>
<div
class=
"filter-container"
>
<el-input
v-model=
"bankQuery.key"
clearable
class=
"filter-item"
style=
"width: 200px"
placeholder=
"银行名称 / 账号 / 户名"
/>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"search"
@
click=
"handleFilter"
>
查找
</el-button
>
</div>
<el-button
style=
"margin-bottom: 20px"
type=
"primary"
icon=
"plus"
@
click=
"handleAdd"
>
新增
</el-button
>
<el-table
:data=
"bankData"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"银行名称"
prop=
"bank"
/>
<el-table-column
align=
"center"
label=
"账号"
prop=
"account"
/>
<el-table-column
align=
"center"
label=
"户名"
prop=
"accountName"
/>
<!--
<el-table-column
align=
"center"
label=
"创建时间"
prop=
"addTime"
/>
-->
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
>
<template
#
default=
"scope"
>
<el-button
type=
"primary"
size=
"small"
link
@
click=
"handleEdit(scope.row)"
>
编辑
</el-button
>
<el-button
type=
"danger"
size=
"small"
link
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
:page-data=
"bankQuery"
:total=
"total"
@
size-change=
"sizeChange"
@
current-change=
"currentChange"
/>
<!-- 添加修改 -->
<el-dialog
v-model=
"bankVisible"
:title=
"bankTitle"
width=
"30%"
:before-close=
"handleClose"
>
<el-form
ref=
"bankRef"
:model=
"bankForm"
:rules=
"rules"
label-width=
"80px"
status-icon
>
<el-form-item
label=
"银行名称"
>
<el-input
v-model=
"bankForm.bank"
/>
</el-form-item>
<el-form-item
label=
"账号"
>
<el-input
v-model=
"bankForm.account"
/>
</el-form-item>
<el-form-item
label=
"户名"
>
<el-input
v-model=
"bankForm.accountName"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onConfirm"
>
确认
</el-button>
</span>
</
template
>
</el-dialog>
</div>
</template>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
getBankList
,
addBank
,
updateBank
,
deleteBank
,
}
from
'@/services/api/config/bank'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
pagination
from
'@/components/pagination/index.vue'
let
bankQuery
=
ref
({
key
:
''
,
pageNo
:
1
,
pageSize
:
10
,
})
let
bankData
=
ref
()
let
total
=
ref
()
// 总条数
let
bankTitle
=
ref
(
'添加'
)
//dialog标题
let
bankVisible
=
ref
(
false
)
// dialog显隐
let
loading
=
ref
(
false
)
let
bankForm
=
ref
({
id
:
''
as
any
,
account
:
''
,
accountName
:
''
,
bank
:
''
,
})
let
rules
=
ref
({
account
:
[{
required
:
true
,
message
:
'请输入账户'
,
trigger
:
'blur'
}],
})
let
bankRef
=
ref
()
let
handleAdd
=
()
=>
{
bankTitle
.
value
=
'添加'
bankForm
.
value
.
id
=
''
bankVisible
.
value
=
true
}
let
handleEdit
=
(
row
:
any
)
=>
{
bankForm
.
value
=
row
bankVisible
.
value
=
true
bankTitle
.
value
=
'编辑'
}
let
sizeChange
=
(
val
:
number
)
=>
{
bankQuery
.
value
.
pageSize
=
val
init
(
bankQuery
.
value
)
}
let
currentChange
=
(
val
:
number
)
=>
{
bankQuery
.
value
.
pageNo
=
val
init
(
bankQuery
.
value
)
}
let
handleFilter
=
()
=>
{
init
(
bankQuery
.
value
)
}
let
onConfirm
=
()
=>
{
bankRef
.
value
?.
validate
((
valid
:
any
,
fields
:
any
)
=>
{
if
(
valid
)
{
if
(
bankForm
.
value
.
id
)
{
updateBank
(
bankForm
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
init
(
bankQuery
.
value
)
ElMessage
({
type
:
'success'
,
message
:
'编辑成功'
})
handleClose
()
}
})
}
else
{
addBank
(
bankForm
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
init
(
bankQuery
.
value
)
ElMessage
({
type
:
'success'
,
message
:
'添加成功'
})
handleClose
()
}
})
}
}
else
{
console
.
log
(
fields
)
}
})
}
let
handleClose
=
()
=>
{
bankForm
.
value
=
{
id
:
''
as
any
,
account
:
''
,
accountName
:
''
,
bank
:
''
,
}
bankVisible
.
value
=
false
}
let
handleDelete
=
(
id
:
number
)
=>
{
ElMessageBox
.
confirm
(
'确认删除?'
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
deleteBank
(
id
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
ElMessage
({
type
:
'success'
,
message
:
res
.
msg
})
init
(
bankQuery
.
value
)
}
else
{
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
})
}
})
})
}
let
init
=
(
params
?:
any
)
=>
{
loading
.
value
=
true
getBankList
(
params
).
then
((
res
:
any
)
=>
{
bankData
.
value
=
res
.
data
.
records
total
.
value
=
res
.
data
.
total
loading
.
value
=
false
})
}
init
(
bankQuery
.
value
)
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
vite.config.ts
浏览文件 @
e59f1c1e
...
...
@@ -41,13 +41,13 @@ export default ({ command, mode }) => {
// '/foo': '',
// 选项写法
"/admin"
:
{
target
:
"http://192.168.
0.8:8089/
"
,
target
:
"http://192.168.
1.27:8089
"
,
// target: "http://192.168.0.60:82/",
// rewrite: (path) => path.replace(/^\/api/, '') http://192.168.0.9:8089/
},
"/wx"
:
{
// target: "http://192.168.0.60:82/",
target
:
"http://192.168.
0.8:8089/
"
,
target
:
"http://192.168.
1.27:8089
"
,
// rewrite: (path) => path.replace(/^\/api/, '')
},
// 正则表达式写法
...
...
yongxinda-admin-build-docker.py
浏览文件 @
e59f1c1e
...
...
@@ -2,13 +2,13 @@ import os, sys
import
zipfile
import
shutil
cmd
=
"git clone http://
192.168.0.27:8090
/xuxu/yongxinda-admin
\t\n
"
cmd
=
"git clone http://
code.lingqingkeji.com
/xuxu/yongxinda-admin
\t\n
"
cmd
+=
"cd yongxinda-admin
\t\n
"
cmd
+=
"yarn install
\t\n
"
cmd
+=
"yarn run build
\t\n
"
cmd
+=
"docker build -t yongxinda-admin .
\t\n
"
cmd
+=
"docker tag yongxinda-admin
192.168.0.26:5000
/yongxinda-admin
\t\n
"
cmd
+=
"docker push
192.168.0.26:5000
/yongxinda-admin
\t\n
"
cmd
+=
"docker tag yongxinda-admin
registrytest.lingqingkeji.com
/yongxinda-admin
\t\n
"
cmd
+=
"docker push
registrytest.lingqingkeji.com
/yongxinda-admin
\t\n
"
cmd
+=
"cd ..
\t\n
"
cmd
+=
"rm -r -f yongxinda-admin
\t\n
"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论