master
parent
473855f288
commit
30550d8bba
|
@ -0,0 +1,57 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function fetchVip(data) {
|
||||
return request({
|
||||
url: '/manage/customer/listVip',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCustomer(data) {
|
||||
return request({
|
||||
url: '/manage/customer/listCustomer',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addCustomer(data) {
|
||||
return request({
|
||||
url: '/manage/customer/addClient',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function findByCustomerId(customerId) {
|
||||
return request({
|
||||
url: '/manage/customer/findByClientId/' + customerId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function updateCustomer(data) {
|
||||
return request({
|
||||
url: '/manage/customer/updateClient',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delClient(customerId){
|
||||
return request({
|
||||
url: '/manage/customer/delClient/' + customerId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function batchDelClient(customerIds){
|
||||
return request({
|
||||
url: '/manage/customer/batchDelClient/' + customerIds,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function fetchImport(data) {
|
||||
return request({
|
||||
url: '/manage/import/listImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function importAdd(data){
|
||||
return request({
|
||||
url: '/manage/import/addImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
|
@ -44,3 +44,10 @@ export function batchDelMerch(merchIds){
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function findTypes(){
|
||||
return request({
|
||||
url: '/manage/merch/findTypes',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function fetchReturns(data) {
|
||||
return request({
|
||||
url: '/manage/returns/listReturns',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function returnsAdd(data){
|
||||
return request({
|
||||
url: '/manage/returns/addReturns',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
|
@ -323,10 +323,187 @@
|
|||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="会员管理" v-if="post == 1 || post == 3">
|
||||
<el-button @click="fetchVip">刷新</el-button>
|
||||
<el-form :inline="true" :model="customerRequest" class="demo-form-inline">
|
||||
<el-form-item label="会员编号">
|
||||
<el-input v-model="customerRequest.customerId" placeholder="会员编号" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员姓名">
|
||||
<el-input v-model="customerRequest.customerName" placeholder="会员姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="fetchVip" icon="el-icon-search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="customerResponse.list" stripe border @selection-change="handleSelectionChange" tooltip-effect="dark" style="width: 100%">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column label="客户编号" prop="customerId"/>
|
||||
<el-table-column label="客户姓名" prop="customerName"/>
|
||||
<el-table-column label="客户年龄" prop="customerAge"/>
|
||||
<el-table-column label="客户性别" prop="customerGender">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.customerGender == 1">男</span>
|
||||
<span v-if="scope.row.customerGender == 2">女</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户住址" prop="customerAddress"/>
|
||||
<el-table-column label="客户联系方式" prop="customerTel"/>
|
||||
<el-table-column label="会员等级" prop="vipGrade">
|
||||
<template slot-scope="scope">
|
||||
lv{{ scope.row.vipGrade }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员注册日期" prop="regDate"/>
|
||||
<el-table-column label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="openVip(scope.row.customerId)" circle></el-button>
|
||||
<!-- <el-button type="danger" icon="el-icon-delete" @click="delVip(scope.row.customerId)" circle></el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
:current-page="customerRequest.pageNum"
|
||||
:page-sizes="[1, 5, 10, 20]"
|
||||
:page-size="customerRequest.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="customerResponse.total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog title="编辑会员信息" :visible.sync="dialogFormVisible8">
|
||||
<el-form :model="customer">
|
||||
<el-form-item label="客户姓名" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户年龄" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAge" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户性别" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="customer.customerGender">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="2">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户住址" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAddress" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户联系方式" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerTel" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible8 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updateVip">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="客户管理" v-if="post == 1 || post == 3">
|
||||
<el-button @click="fetchCustomer">刷新</el-button>
|
||||
<el-form :inline="true" :model="customerRequest" class="demo-form-inline">
|
||||
<el-form-item label="客户编号">
|
||||
<el-input v-model="customerRequest.customerId" placeholder="客户编号" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户姓名">
|
||||
<el-input v-model="customerRequest.customerName" placeholder="客户姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="fetchCustomer" icon="el-icon-search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-button type="primary" @click="dialogFormVisible9 = true">新增客户</el-button>
|
||||
|
||||
<el-table :data="customerResponse.list" stripe border @selection-change="handleSelectionChange" tooltip-effect="dark" style="width: 100%">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column label="客户编号" prop="customerId"/>
|
||||
<el-table-column label="客户姓名" prop="customerName"/>
|
||||
<el-table-column label="客户年龄" prop="customerAge"/>
|
||||
<el-table-column label="客户性别" prop="customerGender">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.customerGender == 1">男</span>
|
||||
<span v-if="scope.row.customerGender == 2">女</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户住址" prop="customerAddress"/>
|
||||
<el-table-column label="客户联系方式" prop="customerTel"/>
|
||||
<el-table-column label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="openCustomer(scope.row.customerId)" circle></el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" @click="delCustomer(scope.row.customerId)" circle></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-button type="danger" @click="batchDelClient">删除</el-button>
|
||||
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
:current-page="customerRequest.pageNum"
|
||||
:page-sizes="[1, 5, 10, 20]"
|
||||
:page-size="customerRequest.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="customerResponse.total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog title="新增客户信息" :visible.sync="dialogFormVisible9">
|
||||
<el-form :model="customer">
|
||||
<el-form-item label="客户姓名" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户年龄" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAge" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户性别" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="customer.customerGender">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="2">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户住址" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAddress" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户联系方式" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerTel" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible9 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addCustomer">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="编辑客户信息" :visible.sync="dialogFormVisible10">
|
||||
<el-form :model="customer">
|
||||
<el-form-item label="客户姓名" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户年龄" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAge" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户性别" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="customer.customerGender">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="2">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户住址" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerAddress" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户联系方式" :label-width="formLabelWidth">
|
||||
<el-input v-model="customer.customerTel" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible10 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="updateCustomer">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
|
@ -338,9 +515,14 @@
|
|||
<el-input v-model="merchRequest.merchId" placeholder="商品编号" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型">
|
||||
<el-select v-model="merchRequest.merchType" clearable>
|
||||
<el-option v-for="item in merchTypes" :key="item.typeId" :label="item.typeName" :value="item.typeId"></el-option>
|
||||
</el-select>
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="merchRequest.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="merchRequest.merchName" placeholder="商品名称" clearable></el-input>
|
||||
|
@ -397,10 +579,13 @@
|
|||
<el-input v-model="merch.merchName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" :label-width="formLabelWidth">
|
||||
<el-select v-model="merch.merchType">
|
||||
<el-option label="区域一" value="1"></el-option>
|
||||
<el-option label="区域二" value="2"></el-option>
|
||||
</el-select>
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="merch.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchPrice" autocomplete="off"></el-input>
|
||||
|
@ -418,7 +603,7 @@
|
|||
<el-input v-model="merch.provideId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期日期" :label-width="formLabelWidth">
|
||||
<el-date-picker v-model="merch.merchDeadTime" type="datetime" placeholder="选择日期时间"></el-date-picker>
|
||||
<el-date-picker v-model="merch.merchDeadTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchNum" autocomplete="off"></el-input>
|
||||
|
@ -430,7 +615,6 @@
|
|||
<el-radio :label="3">下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible5 = false">取 消</el-button>
|
||||
|
@ -444,7 +628,13 @@
|
|||
<el-input v-model="merch.merchName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" :label-width="formLabelWidth">
|
||||
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="merch.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchPrice" autocomplete="off"></el-input>
|
||||
|
@ -462,7 +652,7 @@
|
|||
<el-input v-model="merch.provideId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期日期" :label-width="formLabelWidth">
|
||||
<el-date-picker v-model="merch.merchDeadTime" type="datetime" placeholder="选择日期时间"></el-date-picker>
|
||||
<el-date-picker v-model="merch.merchDeadTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchNum" autocomplete="off"></el-input>
|
||||
|
@ -481,14 +671,227 @@
|
|||
<el-button type="primary" @click="updateMerch">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="进货">进货</el-tab-pane>
|
||||
<el-tab-pane label="退货">退货</el-tab-pane>
|
||||
<el-tab-pane label="进货">
|
||||
<el-form :model="importRequest" @click="fetchImport"></el-form>
|
||||
<el-button type="primary" @click="dialogFormVisible12 = true">添加进货</el-button>
|
||||
<el-table :data="importResponse.list" stripe border>
|
||||
<el-table-column label="表单编号" prop="listId"/>
|
||||
<el-table-column label="商品编号" prop="merchId"/>
|
||||
<el-table-column label="商品名称" prop="merchName"/>
|
||||
<el-table-column label="商品类型" prop="typeIds"/>
|
||||
<el-table-column label="价格" prop="merchPrice"/>
|
||||
<el-table-column label="计划进货数" prop="planNum"/>
|
||||
<el-table-column label="进货日期" prop="importDate"/>
|
||||
<el-table-column label="供货商编号" prop="provideId"/>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"
|
||||
:current-page="importRequest.pageNum"
|
||||
:page-sizes="[1, 5, 10, 20]"
|
||||
:page-size="importRequest.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="importResponse.total">
|
||||
</el-pagination>
|
||||
<el-dialog title="进货" :visible.sync="dialogFormVisible12">
|
||||
<el-form :model="imports">
|
||||
<el-form-item label="进货商品id" :label-width="formLabelWidth">
|
||||
<el-input v-model="imports.merchId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="进货商品名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="imports.merchName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" :label-width="formLabelWidth">
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="imports.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="进货商品价格" :label-width="formLabelWidth">
|
||||
<el-input v-model="imports.merchPrice" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="进货商品数量" :label-width="formLabelWidth">
|
||||
<el-input v-model="imports.planNum" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编号" :label-width="formLabelWidth">
|
||||
<el-input v-model="imports.provideId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible12 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addImport">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="退货">
|
||||
<el-form :model="returnsRequest" @click="fetchImport"></el-form>
|
||||
<el-button type="primary" @click="dialogFormVisible13 = true">添加退货</el-button>
|
||||
<el-table :data="returnsResponse.list" stripe border>
|
||||
<el-table-column label="表单编号" prop="listId"/>
|
||||
<el-table-column label="商品编号" prop="merchId"/>
|
||||
<el-table-column label="商品名称" prop="merchName"/>
|
||||
<el-table-column label="商品类型" prop="typeIds"/>
|
||||
<el-table-column label="价格" prop="merchPrice"/>
|
||||
<el-table-column label="计划进货数" prop="planNum"/>
|
||||
<el-table-column label="进货日期" prop="importDate"/>
|
||||
<el-table-column label="供货商编号" prop="provideId"/>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange4"
|
||||
@current-change="handleCurrentChange4"
|
||||
:current-page="returnsRequest.pageNum"
|
||||
:page-sizes="[1, 5, 10, 20]"
|
||||
:page-size="returnsRequest.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="returnsResponse.total">
|
||||
</el-pagination>
|
||||
<el-dialog title="退货" :visible.sync="dialogFormVisible13">
|
||||
<el-form :model="returns">
|
||||
<el-form-item label="退货商品id" :label-width="formLabelWidth">
|
||||
<el-input v-model="returns.merchId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货商品名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="returns.merchName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" :label-width="formLabelWidth">
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="returns.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货商品价格" :label-width="formLabelWidth">
|
||||
<el-input v-model="returns.merchPrice" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货商品数量" :label-width="formLabelWidth">
|
||||
<el-input v-model="returns.planNum" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编号" :label-width="formLabelWidth">
|
||||
<el-input v-model="returns.provideId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible13 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addReturn">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="报损">报损</el-tab-pane>
|
||||
<el-tab-pane label="报溢">报溢</el-tab-pane>
|
||||
<el-tab-pane label="查询库存">查询库存</el-tab-pane>
|
||||
<el-tab-pane label="查询库存">
|
||||
<el-form :inline="true" :model="merchRequest" class="demo-form-inline">
|
||||
<el-form-item label="商品编号">
|
||||
<el-input v-model="merchRequest.merchId" placeholder="商品编号" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型">
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="merchRequest.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="merchRequest.merchName" placeholder="商品名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品库存">
|
||||
<el-input v-model="merchRequest.merchNum" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="fetchMerch" icon="el-icon-search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-button type="primary" @click="dialogFormVisible11 = true">新增商品</el-button>
|
||||
|
||||
<el-table :data="merchResponse.list" stripe border tooltip-effect="dark" style="width: 100%">
|
||||
<el-table-column label="商品编号" prop="merchId"/>
|
||||
<el-table-column label="商品名称" prop="merchName"/>
|
||||
<el-table-column label="商品类型" prop="typeName"/>
|
||||
<el-table-column label="价格" prop="merchPrice"/>
|
||||
<el-table-column label="条形码" prop="barCode"/>
|
||||
<el-table-column label="促销价" prop="salesProPrice"/>
|
||||
<el-table-column label="厂商编号" prop="factoryId"/>
|
||||
<el-table-column label="供货商编号" prop="provideId"/>
|
||||
<el-table-column label="过期日期" prop="merchDeadTime"/>
|
||||
<el-table-column label="库存数量" prop="merchNum"/>
|
||||
<el-table-column label="商品状态" prop="merchSta">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.merchSta == 1">未上架</span>
|
||||
<span v-if="scope.row.merchSta == 2">上架</span>
|
||||
<span v-if="scope.row.merchSta == 3">下架</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<el-dialog title="新增商品" :visible.sync="dialogFormVisible11">
|
||||
<el-form :model="merch">
|
||||
<el-form-item label="商品名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" :label-width="formLabelWidth">
|
||||
<el-cascader
|
||||
ref="typeRef"
|
||||
v-model="merch.typeIds"
|
||||
:options="merchTypes"
|
||||
:props="props"
|
||||
clearable
|
||||
@change="handleChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchPrice" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="条形码" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.barCode" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="促销价" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.salesProPrice" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="厂商编号" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.factoryId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编号" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.provideId" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期日期" :label-width="formLabelWidth">
|
||||
<el-date-picker v-model="merch.merchDeadTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存" :label-width="formLabelWidth">
|
||||
<el-input v-model="merch.merchNum" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品状态" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="merch.merchSta">
|
||||
<el-radio :label="1">未上架</el-radio>
|
||||
<el-radio :label="2">上架</el-radio>
|
||||
<el-radio :label="3">下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible11 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addMerch1">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"
|
||||
:current-page="merchRequest.pageNum"
|
||||
:page-sizes="[1, 5, 10, 20]"
|
||||
:page-size="merchRequest.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="merchResponse.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="综合统计" v-if="role == 1 || role == 2 || role == 3">综合统计</el-tab-pane>
|
||||
|
@ -503,8 +906,10 @@
|
|||
|
||||
import { add, batchDel, del, fetchManager, findById, update, fetchEmp } from '@/api/manager';
|
||||
import { findRoles, findPosts } from '@/api/role';
|
||||
import { fetchMerch, addMerch, findByMerchId, updateMerch, delMerch, batchDelMerch } from '@/api/merch';
|
||||
import item from '@/layout/components/Sidebar/Item.vue'
|
||||
import { fetchMerch, addMerch, findByMerchId, updateMerch, delMerch, batchDelMerch, findTypes } from '@/api/merch';
|
||||
import { fetchVip, fetchCustomer, addCustomer, findByCustomerId, updateCustomer, delClient, batchDelClient } from '@/api/customer'
|
||||
import { fetchImport, importAdd } from '@/api/import'
|
||||
import { fetchReturns, returnsAdd } from '@/api/returns'
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用
|
||||
|
@ -547,7 +952,7 @@ export default {
|
|||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
dialogFormVisible4: false,
|
||||
formLabelWidth: '120px',
|
||||
formLabelWidth: '160px',
|
||||
passwordType: 'password',
|
||||
redirect: undefined,
|
||||
multipleSelection: [],
|
||||
|
@ -582,7 +987,7 @@ export default {
|
|||
merch: {
|
||||
merchId: null,
|
||||
merchName: '',
|
||||
merchType: null,
|
||||
typeIds: '',
|
||||
merchPrice: null,
|
||||
barCode: '',
|
||||
salesProPrice: null,
|
||||
|
@ -595,7 +1000,8 @@ export default {
|
|||
merchRequest: {
|
||||
merchId: null,
|
||||
merchName: '',
|
||||
merchType: null,
|
||||
typeIds: null,
|
||||
merchNum: null,
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
|
@ -603,9 +1009,80 @@ export default {
|
|||
total: 0,
|
||||
list: []
|
||||
},
|
||||
merchTypes: [],
|
||||
merchTypes: {},
|
||||
props: {
|
||||
label: 'typeName',
|
||||
value: 'typeIds',
|
||||
children: 'children',
|
||||
expandTrigger: 'hover'
|
||||
},
|
||||
dialogFormVisible5: false,
|
||||
dialogFormVisible6: false,
|
||||
customer: {
|
||||
customerId: null,
|
||||
customerName: '',
|
||||
customerAge: null,
|
||||
customerGender: null,
|
||||
customerAddress: '',
|
||||
customerTel: '',
|
||||
vipGrade: null,
|
||||
regDate: null
|
||||
},
|
||||
customerRequest: {
|
||||
customerId: null,
|
||||
customerName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
customerResponse: {
|
||||
total: 0,
|
||||
list: []
|
||||
},
|
||||
dialogFormVisible7: false,
|
||||
dialogFormVisible8: false,
|
||||
dialogFormVisible9: false,
|
||||
dialogFormVisible10: false,
|
||||
dialogFormVisible11: false,
|
||||
imports: {
|
||||
listId: null,
|
||||
merchId: null,
|
||||
merchName: null,
|
||||
typeIds: null,
|
||||
merchPrice: null,
|
||||
planNum: null,
|
||||
importDate: null,
|
||||
provideId: null
|
||||
},
|
||||
importRequest: {
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
importResponse: {
|
||||
total: 0,
|
||||
list: []
|
||||
},
|
||||
dialogFormVisible12: false,
|
||||
returns: {
|
||||
listId: null,
|
||||
merchId: null,
|
||||
merchName: null,
|
||||
typeIds: null,
|
||||
merchPrice: null,
|
||||
planNum: null,
|
||||
returnsDate: null,
|
||||
provideId: null
|
||||
},
|
||||
returnsRequest: {
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
returnsResponse: {
|
||||
total: 0,
|
||||
list: []
|
||||
},
|
||||
dialogFormVisible13: false,
|
||||
dialogFormVisible14: false,
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -734,6 +1211,7 @@ export default {
|
|||
this.fetchManager()
|
||||
},
|
||||
addMerch() {
|
||||
this.merch.typeIds = this.merch.typeIds.join(",").split(",");
|
||||
addMerch(this.merch).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible5 = false
|
||||
|
@ -748,6 +1226,7 @@ export default {
|
|||
})
|
||||
},
|
||||
updateMerch() {
|
||||
this.merch.typeIds = this.merch.typeIds.join(",").split(",");
|
||||
updateMerch(this.merch).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible6 = false
|
||||
|
@ -766,7 +1245,132 @@ export default {
|
|||
this.$message.success(res.msg)
|
||||
this.fetchMerch()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleChange(val) {
|
||||
findTypes().then(res => {
|
||||
this.merchTypes = res.data
|
||||
})
|
||||
},
|
||||
fetchVip(){
|
||||
fetchVip(this.customerRequest).then(res=>{
|
||||
this.customerResponse.list = []
|
||||
this.customerResponse = res.data
|
||||
})
|
||||
},
|
||||
fetchCustomer(){
|
||||
fetchCustomer(this.customerRequest).then(res=>{
|
||||
this.customerResponse.list = []
|
||||
this.customerResponse = res.data
|
||||
})
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.customerRequest.pageSize = val
|
||||
this.fetchManager()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.customerRequest.pageNum = val
|
||||
this.fetchManager()
|
||||
},
|
||||
openVip(customerId){
|
||||
this.dialogFormVisible8 = true
|
||||
findByCustomerId(customerId).then(res =>{
|
||||
this.customer = res.data
|
||||
})
|
||||
},
|
||||
updateVip(){
|
||||
updateCustomer(this.customer).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible8 = false
|
||||
this.customer = {}
|
||||
this.fetchVip()
|
||||
})
|
||||
},
|
||||
addCustomer(){
|
||||
addCustomer(this.customer).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible9 = false
|
||||
this.customer = {}
|
||||
this.fetchCustomer()
|
||||
})
|
||||
},
|
||||
openCustomer(customerId){
|
||||
this.dialogFormVisible10 = true
|
||||
findByCustomerId(customerId).then(res =>{
|
||||
this.customer = res.data
|
||||
})
|
||||
},
|
||||
updateCustomer(){
|
||||
updateCustomer(this.customer).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible10 = false
|
||||
this.customer = {}
|
||||
this.fetchCustomer()
|
||||
})
|
||||
},
|
||||
delCustomer(customerId){
|
||||
delClient(customerId).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.fetchCustomer()
|
||||
})
|
||||
},
|
||||
batchDelClient(){
|
||||
batchDelClient(this.multipleSelection.map(item => item.customerId)).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.fetchCustomer()
|
||||
})
|
||||
},
|
||||
addMerch2() {
|
||||
this.merch.typeIds = this.merch.typeIds.join(",").split(",")[2];
|
||||
addMerch(this.merch).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible5 = false
|
||||
this.merch = {}
|
||||
this.fetchMerch()
|
||||
})
|
||||
},
|
||||
fetchImport(){
|
||||
fetchImport(this.importRequest).then(res => {
|
||||
this.importResponse = res.data
|
||||
})
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.importRequest.pageSize = val
|
||||
this.fetchImport()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.importRequest.pageNum = val
|
||||
this.fetchImport()
|
||||
},
|
||||
addImport() {
|
||||
importAdd(this.imports).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible12 = false
|
||||
this.imports = {}
|
||||
this.fetchImport()
|
||||
})
|
||||
},
|
||||
fetchReturn(){
|
||||
fetchReturns(this.returnsRequest).then(res => {
|
||||
this.returnsResponse = res.data
|
||||
})
|
||||
},
|
||||
handleSizeChange4(val) {
|
||||
this.returnsResponse.pageSize = val
|
||||
this.fetchReturn()
|
||||
},
|
||||
handleCurrentChange4(val) {
|
||||
this.returnsResponse.pageNum = val
|
||||
this.fetchReturn()
|
||||
},
|
||||
addReturn() {
|
||||
returnsAdd(this.returns).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogFormVisible13 = false
|
||||
this.returns = {}
|
||||
this.fetchReturn()
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
//声明周期 - 创建完成(可以访问当前this实例),
|
||||
created() {
|
||||
|
@ -775,6 +1379,11 @@ export default {
|
|||
this.findPosts()
|
||||
this.fetchEmp()
|
||||
this.fetchMerch()
|
||||
this.fetchVip()
|
||||
this.fetchCustomer()
|
||||
this.handleChange()
|
||||
this.fetchImport()
|
||||
this.fetchReturn()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue