Commit c772a0cb by 朱哲铨

Merge remote-tracking branch 'remotes/origin/dev'

parents 7847f9d8 7ca96b84
......@@ -7,34 +7,29 @@
<span
class="my-flex-1"
:class="{ active: is_tab == '1' }"
@click="handleClick('1')"
>
@click="handleClick('1')">
类别
</span>
<span
class="my-flex-1"
:class="{ active: is_tab == '2' }"
@click="handleClick('2')"
>
@click="handleClick('2')">
风格
</span>
</li>
</ul>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="success" @click="addDialog(1)"
>新增</el-button
>
<el-button type="success" @click="addDialog(1)">新增</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="danger" @click="deleteSection()"
>删除</el-button
>
<el-button type="danger" @click="deleteSection()">删除</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="warning" @click="getList(1)"
>刷新</el-button
>
<el-button type="warning" @click="getList(1)">刷新</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="primary" @click="importExcel">导入</el-button>
</el-form-item>
</el-form>
<div class="my-table-cont my-flex-1">
......@@ -44,8 +39,7 @@
:treeConfig="{ children: 'children' }"
:selection="true"
@selectionChange="(v) => (selections = v)"
:tableColumns="tableColumns"
></table-view>
:tableColumns="tableColumns"></table-view>
</div>
<div class="pagination" v-if="is_tab == 2">
<el-pagination
......@@ -55,8 +49,7 @@
:page-size="paginationOptions.pageSize"
:current-page="paginationOptions.currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"
/>
@current-change="onCurrentChange" />
</div>
<!-- 弹出层 -->
......@@ -64,8 +57,7 @@
:close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="640px"
>
width="640px">
<el-form
label-position="right"
label-width="100px"
......@@ -73,13 +65,8 @@
:inline="true"
:model="addcurrencyform"
:rules="addrules"
ref="addcurrencyform"
>
<el-form-item
label="上级分类"
v-if="is_tab == '1'"
prop="pid"
>
ref="addcurrencyform">
<el-form-item label="上级分类" v-if="is_tab == '1'" prop="pid">
<!-- <el-select v-model="addcurrencyform.pid" placeholder="请选择上级分类">
<el-option v-for="item in all_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>-->
......@@ -89,85 +76,68 @@
v-model="addcurrencyform.pid"
:options="all_list"
:props="pidoptions"
:show-all-levels="false"
></el-cascader>
:show-all-levels="false"></el-cascader>
</el-form-item>
<el-form-item
label="类别中文名"
prop="name"
v-if="is_tab == '1'"
required
>
required>
<el-input
v-model="addcurrencyform.name"
placeholder="请输入类别中文名称"
></el-input>
placeholder="请输入类别中文名称"></el-input>
</el-form-item>
<el-form-item
label="类别英文名"
prop="enname"
v-if="is_tab == '1'"
required
>
required>
<el-input
v-model="addcurrencyform.enname"
placeholder="请输入类别英文名称"
></el-input>
placeholder="请输入类别英文名称"></el-input>
</el-form-item>
<el-form-item
label="风格名称"
prop="name"
v-if="is_tab == '2'"
required
>
required>
<el-input
v-model="addcurrencyform.name"
placeholder="请输入类别名称"
></el-input>
placeholder="请输入类别名称"></el-input>
</el-form-item>
<el-form-item
label="风格编码"
prop="code"
v-if="is_tab == '2'"
required
>
required>
<el-input
v-model="addcurrencyform.code"
placeholder="请输入类别名称"
></el-input>
placeholder="请输入类别名称"></el-input>
</el-form-item>
<el-form-item label="排序" prop="remark">
<el-input
style="width: 164px"
v-model="addcurrencyform.sort"
placeholder="排序"
></el-input>
placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="备注信息" prop="remark">
<el-input
style="width: 438px"
v-model="addcurrencyform.remark"
placeholder="请输入备注信息"
></el-input>
placeholder="请输入备注信息"></el-input>
</el-form-item>
<el-form-item
label="相关风格"
prop="styleIds"
v-if="is_tab == '1'"
>
<el-form-item label="相关风格" prop="styleIds" v-if="is_tab == '1'">
<el-select
v-model="addcurrencyform.styleIds"
multiple
placeholder="请选择相关风格"
style="width: 438px"
filterable
>
filterable>
<el-option
v-for="(item, index) in all_list2"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item
......@@ -175,48 +145,38 @@
prop="skuPropertyIds"
required
v-if="
is_tab == '1' &&
(addcurrencyform.pid === 0 ||
!addcurrencyform.pid)
"
>
is_tab == '1' && (addcurrencyform.pid === 0 || !addcurrencyform.pid)
">
<el-select
v-model="addcurrencyform.skuPropertyIds"
multiple
filterable
placeholder="请选择相关属性"
style="width: 438px"
>
style="width: 438px">
<el-option
v-for="item in skuCategory"
:key="item.id"
:value="item.id"
:label="item.cnname + '(' + item.enname + ')'"
></el-option>
:label="item.cnname + '(' + item.enname + ')'"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="一般属性"
prop="generalPropertyIds"
v-if="
is_tab == '1' &&
(addcurrencyform.pid === 0 ||
!addcurrencyform.pid)
"
>
is_tab == '1' && (addcurrencyform.pid === 0 || !addcurrencyform.pid)
">
<el-select
v-model="addcurrencyform.generalPropertyIds"
multiple
filterable
placeholder="请选择相关属性"
style="width: 438px"
>
style="width: 438px">
<el-option
v-for="item in generalCategory"
:key="item.id"
:value="item.id"
:label="item.cnname + '(' + item.enname + ')'"
></el-option>
:label="item.cnname + '(' + item.enname + ')'"></el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -224,16 +184,14 @@
<el-button
@click="dialogVisible = false"
size="mini"
style="width: 130px"
>
style="width: 130px">
取消
</el-button>
<el-button
type="primary"
@click="addCurrency()"
size="mini"
style="width: 130px"
>
style="width: 130px">
确认
</el-button>
</span>
......@@ -243,43 +201,26 @@
:title="`设置默认供应商(${currentCateName})`"
:visible.sync="setDefVisivle"
width="790px"
:close-on-click-modal="false"
>
:close-on-click-modal="false">
<el-input
v-model="supplierName"
placeholder=""
style="width: 200px; margin-bottom: 10px"
clearable
></el-input>
clearable></el-input>
<div style="min-height: 100px; max-height: 500px">
<el-radio-group
v-model="supplierId"
style="width: 100%"
>
<el-radio-group v-model="supplierId" style="width: 100%">
<div
style="
display: inline-block;
width: 33.33%;
margin-bottom: 10px;
"
style="display: inline-block; width: 33.33%; margin-bottom: 10px"
v-for="(item, index) in supplierlist"
:key="index"
>
<el-radio :label="item.id">{{
item.name
}}</el-radio>
:key="index">
<el-radio :label="item.id">{{ item.name }}</el-radio>
</div>
</el-radio-group>
</div>
<span slot="footer">
<el-button @click="setDefVisivle = false"
>取消</el-button
>
<el-button
type="primary"
@click="submitDefaultSupplier"
>
<el-button @click="setDefVisivle = false">取消</el-button>
<el-button type="primary" @click="submitDefaultSupplier">
保存
</el-button>
</span>
......@@ -289,10 +230,11 @@
<script>
import axios from '../../common/api/axios'
import TableView from '@/common/components/base/tableView.vue'
export default {
name: 'supply_category',
components: {
TableView,
TableView
},
data() {
return {
......@@ -313,7 +255,7 @@ export default {
styleIds: [],
styleNames: '',
pid: 0,
propertyIds: [],
propertyIds: []
},
addcurrencyform2: null,
formId: null,
......@@ -325,12 +267,12 @@ export default {
label: 'name',
value: 'id',
checkStrictly: true,
emitPath: false,
emitPath: false
},
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
total: 0
},
category: [],
supplierList: [],
......@@ -340,22 +282,18 @@ export default {
supplierName: '',
selections: [],
skuCategory: [],
generalCategory: [],
generalCategory: []
}
},
created() {
// this.alllist("baseStyleInfo/all_list", "all_list2");
this.getList(1)
this.addcurrencyform2 = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
this.addcurrencyform2 = JSON.parse(JSON.stringify(this.addcurrencyform))
},
computed: {
supplierlist() {
return this.supplierList.filter(
(item) =>
item.name &&
item.name.indexOf(this.supplierName) !== -1,
(item) => item.name && item.name.indexOf(this.supplierName) !== -1
)
},
tableColumns() {
......@@ -384,49 +322,48 @@ export default {
? '#4168FF'
: item.deep === 2
? '#67c23a'
: '',
}}
></span>
: ''
}}></span>
<span>{item.name}</span>
</div>
),
)
},
{
label: '类别英文名',
key: 'enname',
align: 'left',
width: 130,
width: 130
},
{
label: '相关风格',
key: 'styleNames',
align: 'left',
width: 200,
width: 200
},
{
label: 'SKU属性',
key: 'skuPropertyNames',
align: 'left',
width: 200,
width: 200
},
{
label: '一般属性',
key: 'propertyNames',
align: 'left',
},
align: 'left'
}
]
} else {
arr = [
{
label: '风格名称',
key: 'name',
align: 'left',
align: 'left'
},
{
label: '风格编码',
key: 'code',
align: 'left',
},
align: 'left'
}
]
}
return [
......@@ -435,12 +372,12 @@ export default {
label: '排序',
key: 'sort',
align: 'right',
width: 100,
width: 100
},
{
label: '备注信息',
key: 'remark',
align: 'center',
align: 'center'
},
{
label: '相关操作',
......@@ -450,29 +387,21 @@ export default {
width: 100,
render: (item) => (
<div>
<span
class="icon-view icon-edit-view"
title="编辑"
>
<span class="icon-view icon-edit-view" title="编辑">
<i
class="el-icon-edit"
onClick={() => this.addDialog(2, item)}
></i>
onClick={() => this.addDialog(2, item)}></i>
</span>
<span
class="icon-view icon-del-view"
title="删除"
>
<span class="icon-view icon-del-view" title="删除">
<i
class="el-icon-delete-solid"
onClick={() => this.deleteSection(item)}
></i>
onClick={() => this.deleteSection(item)}></i>
</span>
</div>
),
},
)
}
]
},
}
},
// watch: {
// select_tab(val) {
......@@ -486,10 +415,31 @@ export default {
text_join(value) {
if (!value) return ''
return value.join(',')
},
}
},
methods: {
importExcel() {
const input = document.createElement('input')
input.style.display = 'none'
input.type = 'file'
input.click()
input.onchange = async () => {
const form = new FormData()
form.append('importExcel', input.files.length > 0 ? input.files[0] : [])
const res = await axios.post(
this.is_tab === '1'
? 'baseCategoryInfo/importBaseCategoryInfo'
: 'baseStyleInfo/importBaseStyleInfo',
form
)
console.log(res)
if (res.code === 200) {
this.$message.success('导入成功')
this.getList()
}
}
},
onCurrentChange(currentPage) {
this.paginationOptions.currentPage = currentPage
this.getList()
......@@ -502,7 +452,7 @@ export default {
axios
.post('baseCategoryInfo/setDefaultSupplier', {
id: this.currentCateId,
defaultSupplierId: this.supplierId,
defaultSupplierId: this.supplierId
})
.then((res) => {
this.$message.success(res.message)
......@@ -517,14 +467,12 @@ export default {
this.supplierId = ''
axios
.get('supplySupplier/getSupplyByCategory', {
params: { categoryId: item.id },
params: { categoryId: item.id }
})
.then((res) => {
const supplierList = res.data || []
if (supplierList.length === 0) {
return this.$message.warning(
'该分类下暂无供应商',
)
return this.$message.warning('该分类下暂无供应商')
} else {
this.setDefVisivle = true
this.supplierList = supplierList
......@@ -535,15 +483,9 @@ export default {
if (this.all_list2.length > 0) return
this.alllist('baseStyleInfo/all_list', 'all_list2')
if (this.skuCategory.length > 0) return
this.alllist(
'baseProperty/all_list_sku',
'skuCategory',
)
this.alllist('baseProperty/all_list_sku', 'skuCategory')
if (this.generalCategory.length > 0) return
this.alllist(
'baseProperty/all_list_general',
'generalCategory',
)
this.alllist('baseProperty/all_list_general', 'generalCategory')
},
search() {
this.currentPage = 1
......@@ -561,10 +503,7 @@ export default {
addDialog(i, v = null) {
this.getStyle()
if (this.is_tab === '1') {
this.alllist(
'baseCategoryInfo/tree_list',
'all_list',
)
this.alllist('baseCategoryInfo/tree_list', 'all_list')
}
if (i === 2) {
if (v) this.formId = v.id
......@@ -575,7 +514,7 @@ export default {
} else {
this.$nextTick(() => {
this.addcurrencyform = JSON.parse(
JSON.stringify(this.addcurrencyform2),
JSON.stringify(this.addcurrencyform2)
)
})
this.is_title = i
......@@ -604,15 +543,14 @@ export default {
},
getList() {
if (this.is_tab === '2') {
const { pageSize, currentPage } =
this.paginationOptions
const { pageSize, currentPage } = this.paginationOptions
axios
.get('baseStyleInfo/list_page', {
params: {
pageSize: pageSize,
currentPage: currentPage,
currentPage: currentPage
},
baseURL: '/api/manage/rest',
baseURL: '/api/manage/rest'
})
.then((res) => {
if (res.code === 200) {
......@@ -622,76 +560,66 @@ export default {
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
} else {
this.alllist(
'baseCategoryInfo/tree_list',
'sourceData',
)
this.alllist('baseCategoryInfo/tree_list', 'sourceData')
}
},
selectSection() {
const text =
this.is_tab === '1'
? 'baseCategoryInfo'
: 'baseStyleInfo'
const text = this.is_tab === '1' ? 'baseCategoryInfo' : 'baseStyleInfo'
const url = `${text}/get?id=${this.formId}`
axios.get(url, {
baseURL: '/api/manage/rest',
}).then((res) => {
if (res.code === 200) {
const data = res.data
this.addcurrencyform = Object.assign({}, data)
this.is_title = 2
this.dialogVisible = true
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
axios
.get(url, {
baseURL: '/api/manage/rest'
})
.then((res) => {
if (res.code === 200) {
const data = res.data
this.addcurrencyform = Object.assign({}, data)
this.is_title = 2
this.dialogVisible = true
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
},
upSection() {
const text =
this.is_tab === '1'
? 'baseCategoryInfo'
: 'baseStyleInfo'
const text = this.is_tab === '1' ? 'baseCategoryInfo' : 'baseStyleInfo'
const url = `${text}/update`
axios.post(url, this.addcurrencyform).then((res) => {
if (res.code === 200) {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
},
addSection() {
const text =
this.is_tab === '1'
? 'baseCategoryInfo'
: 'baseStyleInfo'
const text = this.is_tab === '1' ? 'baseCategoryInfo' : 'baseStyleInfo'
const url = `${text}/add`
axios.post(url, this.addcurrencyform).then((res) => {
if (res.code === 200) {
this.dialogVisible = false
this.$message({
message: '添加成功',
type: 'success',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -712,19 +640,17 @@ export default {
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
const text =
this.is_tab === '1'
? 'baseCategoryInfo'
: 'baseStyleInfo'
this.is_tab === '1' ? 'baseCategoryInfo' : 'baseStyleInfo'
const url = `${text}/delete?ids=${ids}`
axios.get(url).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!',
message: '删除成功!'
})
this.getList(this.currentPage)
}
......@@ -733,24 +659,22 @@ export default {
.catch(() => {})
},
alllist(url, arr) {
axios
.get(url, { baseURL: '/api/manage/rest' })
.then((res) => {
if (res.code === 200) {
this[arr] = res.data
this.$nextTick(() => {
if (this.$refs.addcurrencyform) {
this.$refs.addcurrencyform.clearValidate()
}
})
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
},
},
axios.get(url, { baseURL: '/api/manage/rest' }).then((res) => {
if (res.code === 200) {
this[arr] = res.data
this.$nextTick(() => {
if (this.$refs.addcurrencyform) {
this.$refs.addcurrencyform.clearValidate()
}
})
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
}
}
}
</script>
<style>
......
......@@ -24,37 +24,27 @@
size="mini"
@submit.native.prevent
v-enter-submit="search"
class="search_form"
>
class="search_form">
<template>
<el-form-item label="名称">
<el-input
v-model="searchForm.name"
placeholder="中文或英文"
clearable
></el-input>
clearable></el-input>
</el-form-item>
<el-form-item label="编码">
<el-input
v-model="searchForm.code"
placeholder="中文或英文"
clearable
></el-input>
clearable></el-input>
</el-form-item>
<el-form-item label="类别" prop="employeeName">
<el-select
v-model="searchForm.cateCode"
clearable
placeholder="请选择"
>
<el-option
label="颜色"
value="Color"
></el-option>
<el-option
label="尺寸"
value="Size"
></el-option>
placeholder="请选择">
<el-option label="颜色" value="Color"></el-option>
<el-option label="尺寸" value="Size"></el-option>
</el-select>
</el-form-item>
......@@ -74,21 +64,19 @@
type="primary"
@click="search()"
icon="el-icon-search"
native-type="submit"
>
native-type="submit">
查询
</el-button>
</el-form-item>
</template>
<el-form-item>
<el-button type="success" @click="addDialog(1)"
>新增</el-button
>
<el-button type="success" @click="addDialog(1)">新增</el-button>
</el-form-item>
<el-form-item>
<el-button type="danger" @click="deleteSection()"
>删除</el-button
>
<el-button type="danger" @click="deleteSection()">删除</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="primary" @click="importExcel">导入</el-button>
</el-form-item>
</el-form>
<div class="table-wrap" v-loading="loading">
......@@ -98,14 +86,12 @@
:selection="true"
:tableColumns="tableColumns"
@selectionChange="selectionChange"
@currentChange="currentTabFn"
></my-table>
@currentChange="currentTabFn"></my-table>
</div>
<div class="pagination">
<pagination
:setValue="setpaginationOptions"
:options="paginationOptions"
/>
:options="paginationOptions" />
</div>
</div>
......@@ -114,8 +100,7 @@
:close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="700px"
>
width="700px">
<el-form
label-position="right"
label-width="100px"
......@@ -123,58 +108,42 @@
:inline="true"
:model="addcurrencyform"
:rules="addrules"
ref="addcurrencyform"
>
ref="addcurrencyform">
<el-form-item label="中文名" prop="cnname" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.cnname"
placeholder="请输入中文名"
></el-input>
placeholder="请输入中文名"></el-input>
</el-form-item>
<el-form-item label="英文名" prop="enname" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.enname"
placeholder="请输入英文名"
></el-input>
placeholder="请输入英文名"></el-input>
</el-form-item>
<el-form-item label="编码" prop="code" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.code"
maxlength="7"
placeholder="请输入编码"
></el-input>
placeholder="请输入编码"></el-input>
</el-form-item>
<el-form-item
label="类别"
prop="cateCode"
required
>
<el-form-item label="类别" prop="cateCode" required>
<el-select
v-model="addcurrencyform.cateCode"
style="width: 164px"
clearable
placeholder="请选择"
>
<el-option
label="颜色"
value="Color"
></el-option>
<el-option
label="尺寸"
value="Size"
></el-option>
placeholder="请选择">
<el-option label="颜色" value="Color"></el-option>
<el-option label="尺寸" value="Size"></el-option>
</el-select>
</el-form-item>
<el-form-item label="排序序号" prop="sort">
<el-input
style="width: 164px"
v-model.number="addcurrencyform.sort"
placeholder="请输入数字"
></el-input>
placeholder="请输入数字"></el-input>
</el-form-item>
<el-form-item label="是否带电池">
<el-select
......@@ -182,13 +151,9 @@
v-model="addcurrencyform.battery"
clearable
value-key=""
placeholder="请选择"
>
placeholder="请选择">
<el-option label="是" :value="true"></el-option>
<el-option
label="否"
:value="false"
></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否液体">
......@@ -197,13 +162,9 @@
v-model="addcurrencyform.liquid"
clearable
value-key=""
placeholder="请选择"
>
placeholder="请选择">
<el-option label="是" :value="true"></el-option>
<el-option
label="否"
:value="false"
></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否刀具">
......@@ -212,44 +173,36 @@
v-model="addcurrencyform.knife"
clearable
value-key=""
placeholder="请选择"
>
placeholder="请选择">
<el-option label="是" :value="true"></el-option>
<el-option
label="否"
:value="false"
></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item label="文字色">
<el-color-picker
style="width: 164px"
v-model="addcurrencyform.fontColor"
size="small"
></el-color-picker>
size="small"></el-color-picker>
</el-form-item>
<el-form-item label="背景色" prop="remark">
<el-color-picker
style="width: 164px"
v-model="addcurrencyform.bgColor"
size="small"
></el-color-picker>
size="small"></el-color-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button
@click="dialogVisible = false"
size="mini"
style="width: 100px"
>
style="width: 100px">
取消
</el-button>
<el-button
type="primary"
@click="addCurrency()"
size="mini"
style="width: 100px"
>
style="width: 100px">
确认
</el-button>
</span>
......@@ -262,7 +215,7 @@ import MyTable from '@/common/components/base/tableView.vue'
export default {
name: 'system_sku-manage',
components: {
MyTable,
MyTable
},
data() {
return {
......@@ -275,7 +228,7 @@ export default {
searchForm: {
cateId: '',
code: '',
name: '',
name: ''
},
addcurrencyform: {
sort: '',
......@@ -284,7 +237,7 @@ export default {
cnname: '',
enname: '',
fontColor: '',
bgColor: '',
bgColor: ''
},
all_list: [],
addcurrencyform2: null,
......@@ -293,11 +246,11 @@ export default {
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
total: 0
},
defaultProps: {
label: 'name',
},
label: 'name'
}
}
},
computed: {
......@@ -308,7 +261,7 @@ export default {
{ label: '编码', key: 'code' },
{
label: '类别',
key: 'cateName',
key: 'cateName'
},
{ label: '排列序号', key: 'sort', width: 80 },
......@@ -322,10 +275,9 @@ export default {
width: '20px',
height: '20px',
display: 'inline-block',
backgroundColor: item.fontColor,
}}
></span>
),
backgroundColor: item.fontColor
}}></span>
)
},
{
label: '背景色',
......@@ -337,39 +289,30 @@ export default {
width: '20px',
height: '20px',
display: 'inline-block',
backgroundColor: item.bgColor,
}}
></span>
),
backgroundColor: item.bgColor
}}></span>
)
},
{
label: '相关操作',
width: 80,
render: (item) => (
<div>
<span
class="icon-view icon-edit-view"
title="编辑"
>
<span class="icon-view icon-edit-view" title="编辑">
<i
class="el-icon-edit"
onClick={() => this.addDialog(2, item)}
></i>
onClick={() => this.addDialog(2, item)}></i>
</span>
<span
class="icon-view icon-del-view"
title="删除"
>
<span class="icon-view icon-del-view" title="删除">
<i
class="el-icon-delete-solid"
onClick={() => this.deleteSection(item)}
></i>
onClick={() => this.deleteSection(item)}></i>
</span>
</div>
),
},
)
}
]
},
}
// categoryList() {
// const list = [
// {
......@@ -395,9 +338,7 @@ export default {
created() {
this.alllist('baseProperty/all_list')
this.getList(1)
this.addcurrencyform2 = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
this.addcurrencyform2 = JSON.parse(JSON.stringify(this.addcurrencyform))
},
methods: {
......@@ -432,7 +373,7 @@ export default {
} else {
this.$nextTick(() => {
this.addcurrencyform = JSON.parse(
JSON.stringify(this.addcurrencyform2),
JSON.stringify(this.addcurrencyform2)
)
})
}
......@@ -450,6 +391,25 @@ export default {
this.upSection()
}
},
importExcel() {
const input = document.createElement('input')
input.style.display = 'none'
input.type = 'file'
input.click()
input.onchange = async () => {
const form = new FormData()
form.append('importExcel', input.files.length > 0 ? input.files[0] : [])
const res = await axios.post(
'base/propertyValue/importBasePropertyValue',
form
)
console.log(res)
if (res.code === 200) {
this.$message.success('导入成功')
this.getList()
}
}
},
setpaginationOptions(opt) {
for (const key in opt) {
this.paginationOptions[key] = opt[key]
......@@ -458,8 +418,7 @@ export default {
},
// 查询
getList() {
const { pageSize, currentPage } =
this.paginationOptions
const { pageSize, currentPage } = this.paginationOptions
this.loading = true
axios
.get('base/propertyValue/list_page', {
......@@ -467,9 +426,9 @@ export default {
pageSize,
currentPage,
skuProperty: this.skuProperty,
...this.searchForm,
...this.searchForm
},
baseURL: '/api/manage/rest',
baseURL: '/api/manage/rest'
})
.then((res) => {
// eslint-disable-next-line eqeqeq
......@@ -478,7 +437,7 @@ export default {
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -504,7 +463,7 @@ export default {
this.dialogVisible = true
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -514,23 +473,21 @@ export default {
const url = 'base/propertyValue/update'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
axios
.post(url, this.addcurrencyform)
.then((res) => {
// eslint-disable-next-line eqeqeq
if (res.code == 200) {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success',
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
axios.post(url, this.addcurrencyform).then((res) => {
// eslint-disable-next-line eqeqeq
if (res.code == 200) {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
}
})
},
......@@ -539,23 +496,21 @@ export default {
const url = 'base/propertyValue/add'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
axios
.post(url, this.addcurrencyform)
.then((res) => {
// eslint-disable-next-line eqeqeq
if (res.code == 200) {
this.dialogVisible = false
this.$message({
message: '添加成功',
type: 'success',
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
})
}
})
axios.post(url, this.addcurrencyform).then((res) => {
// eslint-disable-next-line eqeqeq
if (res.code == 200) {
this.dialogVisible = false
this.$message({
message: '添加成功',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
}
})
},
......@@ -577,7 +532,7 @@ export default {
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
const url = `base/propertyValue/delete?ids=${ids}`
......@@ -586,7 +541,7 @@ export default {
if (res.code == 200) {
this.$message({
type: 'success',
message: '删除成功!',
message: '删除成功!'
})
this.getList(this.currentPage)
}
......@@ -598,7 +553,7 @@ export default {
alllist(url) {
axios
.get(url, {
baseURL: '/api/manage/rest',
baseURL: '/api/manage/rest'
})
.then((res) => {
// eslint-disable-next-line eqeqeq
......@@ -606,12 +561,12 @@ export default {
this.all_list = res.data
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
},
},
}
}
}
</script>
<style scoped>
......
......@@ -38,6 +38,9 @@
<el-form-item>
<el-button type="danger" @click="deleteSection()">删除</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px">
<el-button type="primary" @click="importExcel">导入</el-button>
</el-form-item>
</el-form>
<div class="table_wrap">
<my-table
......@@ -368,6 +371,22 @@ export default {
},
methods: {
importExcel() {
const input = document.createElement('input')
input.style.display = 'none'
input.type = 'file'
input.click()
input.onchange = async () => {
const form = new FormData()
form.append('importExcel', input.files.length > 0 ? input.files[0] : [])
const res = await axios.post('baseProperty/importBaseProperty', form)
console.log(res)
if (res.code === 200) {
this.$message.success('导入成功')
this.getList()
}
}
},
async changeDisableStatus(v, item) {
try {
await this.$confirm(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment