mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 23:16:09 +08:00
beyond 9.26
This commit is contained in:
parent
475916b468
commit
39be386482
79
src/api/InventoryCategory.js
Normal file
79
src/api/InventoryCategory.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 分类属性列表
|
||||
export function searchInventoryCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryname !== '' && query.categoryname !== null && query.categoryname !== undefined) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null && query.iseffective !== undefined) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null && query.type !== undefined) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
params.append('pagenum', query.pagenum) // 你要传给后台的参数值 key/value
|
||||
params.append('pagesize', query.pagesize) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/inventoryCategory/searchCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 新增分类属性
|
||||
export function addInventoryCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryname !== '' && query.categoryname !== null) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.category !== '' && query.category !== null) {
|
||||
params.append('category', query.category) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: '/inventoryCategory/addCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分类属性
|
||||
export function updateInventoryCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryName !== '' && query.categoryName !== null) {
|
||||
params.append('categoryname', query.categoryName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isEffective !== '' && query.isEffective !== null) {
|
||||
params.append('iseffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.id !== '' && query.id !== null) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: '/inventoryCategory/delateCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除分类属性
|
||||
export function delateInventoryCategory(query, query2) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null) {
|
||||
params.append('ids', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query2 !== '' && query2 !== null && query2 !== undefined) {
|
||||
params.append('operatorId', query2) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: '/inventoryCategory/updateEmpCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
|
@ -212,6 +212,8 @@ export default {
|
|||
PrepReturnList: '预售退款单列表',
|
||||
SaleOut: '销售出库单',
|
||||
AddSaleOut: '新建销售出库单',
|
||||
InventoryCategoryList: '分类属性列表',
|
||||
InventoryCategory: '分类属性',
|
||||
SaleOutList: '销售出库单列表',
|
||||
SaleOrder: '销售订单',
|
||||
AddSaleOrder: '新建销售订单',
|
||||
|
|
|
@ -1589,6 +1589,27 @@ export const asyncRouterMap = [
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/InventoryCategory',
|
||||
component: Layout,
|
||||
redirect: 'noredirect',
|
||||
name: 'InventoryCategory',
|
||||
alwaysShow: true,
|
||||
meta: {
|
||||
title: 'InventoryCategory',
|
||||
icon: 'shuxing',
|
||||
type: 4,
|
||||
roles: ['131-278-1', '131-278-2', '131-278-3', '131-278-4', '131-278-5', '131-278-6', '131-278-7']
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'InventoryCategoryList',
|
||||
component: () => import('@/views/InventoryCategory/InventoryCategoryList'),
|
||||
name: 'InventoryCategoryList',
|
||||
meta: { title: 'InventoryCategoryList', noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/StockCategory',
|
||||
component: Layout,
|
||||
|
|
|
@ -37,7 +37,13 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('DailyAdjust.reason')" prop="reason" style="width: 100%;">
|
||||
<el-input v-model="personalForm.reason" placeholder="请输入调整原因" style="margin-left: 18px;width:200px" clearable/>
|
||||
<el-select v-model="personalForm.reason" style="margin-left: 18px;width: 200px" @focus="updatecountry" @change="change()">
|
||||
<el-option
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
@ -185,6 +191,7 @@
|
|||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { getlocation, batchlist, countlist } from '@/api/public'
|
||||
import { searchInventoryCategory } from '@/api/InventoryCategory'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { createdailyAdjust } from '@/api/DailyAdjust'
|
||||
import MyRepository from './components/MyRepository'
|
||||
|
@ -196,6 +203,11 @@ export default {
|
|||
components: { MyRepository, MyDetail, MyCreate, MyAccept },
|
||||
data() {
|
||||
return {
|
||||
typeparms: {
|
||||
pagenum: 1,
|
||||
pagesize: 99999,
|
||||
type: 1
|
||||
},
|
||||
heji1: '',
|
||||
heji2: '',
|
||||
pickerOptions1: {
|
||||
|
@ -217,6 +229,7 @@ export default {
|
|||
createcontrol: false,
|
||||
// 控制商品列表窗口
|
||||
control: false,
|
||||
types: [],
|
||||
// 日常调整信息数据
|
||||
personalForm: {
|
||||
adjustDate: null,
|
||||
|
@ -359,6 +372,11 @@ export default {
|
|||
this.depts = res.data.data.content
|
||||
}
|
||||
})
|
||||
searchInventoryCategory(this.typeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.types = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
},
|
||||
// 经办人输入框focus事件触发
|
||||
handlechoose() {
|
||||
|
@ -487,6 +505,40 @@ export default {
|
|||
})
|
||||
return false
|
||||
}
|
||||
let n = 1
|
||||
EnterDetail.map(function(elem) {
|
||||
return elem
|
||||
}).forEach(function(elem) {
|
||||
if (elem.adjustQuantity === null || elem.adjustQuantity === undefined || elem.adjustQuantity === '') {
|
||||
n = 2
|
||||
}
|
||||
})
|
||||
if (n === 2) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '调整数量不能为空',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
let m = 1
|
||||
EnterDetail.map(function(elem) {
|
||||
return elem
|
||||
}).forEach(function(elem) {
|
||||
if (elem.adjustType === '2') {
|
||||
if (elem.adjustQuantity > elem.quantity) {
|
||||
m = 2
|
||||
}
|
||||
}
|
||||
})
|
||||
if (m === 2) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '调整数量不能大于库存数量',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
EnterDetail.map(function(elem) {
|
||||
return elem
|
||||
}).forEach(function(elem) {
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column :label="$t('DailyAdjust.reason')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.reason }}</span>
|
||||
<span>{{ scope.row.adjustReason }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Inventorydamaged.judgeStat')" :resizable="false" prop="judgeStat" align="center" width="150">
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('DailyAdjust.reason')" prop="reason" style="width: 100%;">
|
||||
<el-input v-model="personalForm.reason" placeholder="请输入调整原因" style="margin-left: 18px;width: 150px" disabled/>
|
||||
<el-input v-model="personalForm.adjustReason" placeholder="请输入调整原因" style="margin-left: 18px;width: 150px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { productlist, searchEmpCategory2 } from '@/api/Product'
|
||||
import { chooseProduct, searchEmpCategory2 } from '@/api/Product'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination'
|
||||
import MySupplier from '../../Product/components/MySupplier'
|
||||
|
@ -187,12 +187,16 @@ export default {
|
|||
watch: {
|
||||
control() {
|
||||
this.productVisible = this.control
|
||||
console.log(this.control)
|
||||
console.log('this.control', this.control)
|
||||
console.log('this.editdata', this.editdata)
|
||||
this.personalForm = this.editdata
|
||||
this.getemplist.searchRepositoryId = this.personalForm.repositoryId
|
||||
this.getlist()
|
||||
},
|
||||
editdata() {
|
||||
console.log('this.editdata', this.editdata)
|
||||
this.personalForm = this.editdata
|
||||
this.getemplist.repositoriId = this.personalForm.repositoriId
|
||||
this.getemplist.searchRepositoryId = this.personalForm.repositoryId
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -202,7 +206,7 @@ export default {
|
|||
getlist() {
|
||||
// 商品列表数据
|
||||
this.listLoading = true
|
||||
productlist(this.getemplist).then(res => {
|
||||
chooseProduct(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
|
@ -227,7 +231,7 @@ export default {
|
|||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pagenum = 1
|
||||
productlist(this.getemplist).then(res => {
|
||||
chooseProduct(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
|
@ -270,16 +274,21 @@ export default {
|
|||
this.productVisible = false
|
||||
console.log(this.moreaction)
|
||||
const productDetail = this.moreaction.map(function(item) {
|
||||
if (item.newPrice !== null && item.newPrice !== '' && item.newPrice !== undefined) {
|
||||
item.price = item.newPrice
|
||||
} else {
|
||||
item.price = item.costPrice
|
||||
}
|
||||
return {
|
||||
quantity: item.existStock,
|
||||
productCode: item.code,
|
||||
productName: item.productName,
|
||||
locationId: '',
|
||||
color: item.color,
|
||||
typeId: item.typeId,
|
||||
unit: item.stockMeasu,
|
||||
quantity: 0,
|
||||
adjustQuantity: 0,
|
||||
price: item.costPrice,
|
||||
price: item.price,
|
||||
productType: item.productType,
|
||||
totalMoney: 0,
|
||||
enterMoney: 0,
|
||||
|
@ -287,6 +296,13 @@ export default {
|
|||
adjustType: '2'
|
||||
}
|
||||
})
|
||||
if (productDetail.newPrice !== null && productDetail.newPrice !== '' && productDetail.newPrice !== undefined) {
|
||||
productDetail.price = productDetail.newPrice
|
||||
} else {
|
||||
productDetail.price = productDetail.costPrice
|
||||
}
|
||||
console.log('productDetail.newPrice', productDetail.newPrice)
|
||||
|
||||
console.log(productDetail)
|
||||
this.$emit('product', productDetail)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,13 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('DailyAdjust.reason')" prop="reason" style="width: 100%;">
|
||||
<el-input v-model="personalForm.reason" placeholder="请输入调整原因" style="margin-left: 18px;width: 150px" clearable/>
|
||||
<el-select v-model="personalForm.reason" style="margin-left: 18px;width: 200px" @focus="updatecountry" @change="change()">
|
||||
<el-option
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
@ -190,6 +196,7 @@
|
|||
|
||||
<script>
|
||||
import { getlocation, locationlist, batchlist } from '@/api/public'
|
||||
import { searchInventoryCategory } from '@/api/InventoryCategory'
|
||||
import { updatedailyAdjust } from '@/api/DailyAdjust'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import MyRepository from './MyRepository'
|
||||
|
@ -210,6 +217,12 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
typeparms: {
|
||||
pagenum: 1,
|
||||
pagesize: 99999,
|
||||
type: 1
|
||||
},
|
||||
types: [],
|
||||
heji1: '',
|
||||
heji2: '',
|
||||
// 弹窗组件的控制
|
||||
|
@ -322,6 +335,11 @@ export default {
|
|||
},
|
||||
// 部门列表数据
|
||||
getlist() {
|
||||
searchInventoryCategory(this.typeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.types = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
getdeptlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.depts = res.data.data.content
|
||||
|
|
499
src/views/InventoryCategory/InventoryCategoryList.vue
Normal file
499
src/views/InventoryCategory/InventoryCategoryList.vue
Normal file
|
@ -0,0 +1,499 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<el-card class="box-card" style="margin-top: 10px;height: 60px" shadow="never">
|
||||
<el-row>
|
||||
<el-form ref="getemplist" :model="getemplist" label-width="100px" style="margin-top: -9px">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="分类名称" label-width="100px">
|
||||
<el-input v-model="getemplist.categoryname" clearable @keyup.enter.native="handleFilter"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" style="margin-left: 10px">
|
||||
<el-form-item label="分类类别">
|
||||
<el-select v-model="getemplist.type" :value="getemplist.type" clearable @keyup.enter.native="handleFilter">
|
||||
<el-option label="调整原因" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" style="margin-left: 10px">
|
||||
<el-form-item label="启用状态">
|
||||
<el-select v-model="getemplist.iseffective" :value="getemplist.iseffective" clearable @keyup.enter.native="handleFilter">
|
||||
<el-option label="active " value="1"/>
|
||||
<el-option label="dead" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--更多搜索条件-->
|
||||
<el-col :span="3" style="margin-left: 20px">
|
||||
<!-- 搜索按钮 -->
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 10px" shadow="never">
|
||||
<!-- 批量操作 -->
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button v-waves class="filter-item" style="margin-left: 0" type="primary">
|
||||
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown" style="width: 140px">
|
||||
<el-dropdown-item v-permission="['131-278-2']" style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- 表格导出操作 -->
|
||||
<el-button v-permission="['131-278-6']" v-waves :loading="downloadLoading" class="filter-item" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||
<!-- 打印操作 -->
|
||||
<el-button v-permission="['131-278-7']" v-waves class="filter-item" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||
<!-- 新建操作 -->
|
||||
<el-button v-permission="['131-278-1']" v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
<el-dialog :visible.sync="categoryVisible" title="新建分类属性" class="normal" width="600px" center>
|
||||
<el-form ref="addCategoryForm" :rules="addCategoryFormRules" :model="addCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('NewEmployeeInformation.type')" label-width="100px" prop="type">
|
||||
<el-select v-model="addCategoryForm.type" placeholder="请选择类别" style="width: 100%">
|
||||
<el-option label="调整原因" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.categoryname')" label-width="100px" prop="categoryname">
|
||||
<el-input v-model="addCategoryForm.categoryname" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.iseffective')" label-width="100px" prop="iseffective">
|
||||
<el-select v-model="addCategoryForm.iseffective" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="启用 " value="1"/>
|
||||
<el-option label="停用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-no-more-click type="primary" @click="handlesave()">保存</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" style="margin-top: 10px" shadow="never">
|
||||
<!-- 列表开始 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:key="tableKey"
|
||||
:data="list"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.id')" :resizable="false" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.type')" :resizable="false" align="center" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.type | typeFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.categoryname')" :resizable="false" align="center" min-width="350">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('NewEmployeeInformation.iseffective')" :resizable="false" align="center" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isEffective | iseffectiveFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.actions')" :resizable="false" align="center" min-width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['131-278-3']" type="primary" size="mini" @click="handleEdit(scope.row)" >{{ $t('public.edit') }}</el-button>
|
||||
<el-button v-permission="['131-278-2']" size="mini" type="danger" @click="handleDelete(scope.row)">{{ $t('public.delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
|
||||
<!--修改开始=================================================-->
|
||||
<el-dialog :visible.sync="editcategoryVisible" title="修改分类属性" class="normal" width="600px" center>
|
||||
<el-form ref="editCategoryForm" :rules="editCategoryFormRules" :model="editCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('NewEmployeeInformation.type')" label-width="100px">
|
||||
<el-select v-model="editCategoryForm.type" placeholder="请选择类别" style="width: 100%" disabled >
|
||||
<el-option label="调整原因" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.categoryname')" label-width="100px" prop="categoryName">
|
||||
<el-input v-model="editCategoryForm.categoryName" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('NewEmployeeInformation.iseffective')" label-width="100px" prop="isEffective">
|
||||
<el-select v-model="editCategoryForm.isEffective" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="启用 " value="1"/>
|
||||
<el-option label="停用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleOk()">修改</el-button>
|
||||
<el-button type="danger" @click="handleNo()">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--修改结束=================================================-->
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { searchInventoryCategory, addInventoryCategory, updateInventoryCategory, delateInventoryCategory } from '@/api/InventoryCategory'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import permission from '@/directive/permission/index.js' // 权限判断指令
|
||||
import permission2 from '@/directive/permission2/index.js' // 权限判断指令
|
||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
||||
|
||||
export default {
|
||||
name: 'InventoryCategory',
|
||||
directives: { waves, permission, permission2 },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
typeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '调整原因'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
iseffectiveFilter(status) {
|
||||
const statusMap = {
|
||||
1: '启用',
|
||||
2: '停用'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 批量删除参数
|
||||
moreaction: [],
|
||||
// 新增窗口
|
||||
categoryVisible: false,
|
||||
// 新增数据
|
||||
addCategoryForm: {
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: '1'
|
||||
},
|
||||
// 校验新增数据
|
||||
addCategoryFormRules: {
|
||||
category: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
categoryname: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
iseffective: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 修改窗口
|
||||
editcategoryVisible: false,
|
||||
// 修改数据
|
||||
editCategoryForm: {
|
||||
categoryName: '',
|
||||
type: '',
|
||||
isEffective: ''
|
||||
},
|
||||
// 校验修改数据
|
||||
editCategoryFormRules: {
|
||||
categoryName: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
isEffective: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 分类列表查询加展示参数
|
||||
getemplist: {
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: '1',
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
getlist() {
|
||||
// 员工列表数据
|
||||
this.listLoading = true
|
||||
searchInventoryCategory(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
console.log('列表出错')
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pagenum = 1
|
||||
searchInventoryCategory(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
} else {
|
||||
console.log('搜索出错')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 多选数据
|
||||
handleSelectionChange(val) {
|
||||
this.moreaction = val
|
||||
},
|
||||
// 批量删除
|
||||
handleCommand(command) {
|
||||
const ids = this.moreaction.map(item => item.id).join()
|
||||
if (command === 'delete') {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delateInventoryCategory(ids, this.$store.getters.userId).then(res => {
|
||||
if (res.data.ret === 200 || res.data.ret === 100) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 单条删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delateInventoryCategory(row.id, this.$store.getters.userId).then(res => {
|
||||
if (res.data.ret === 200 || res.data.ret === 100) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改数据
|
||||
handleEdit(row) {
|
||||
console.log(row)
|
||||
this.editcategoryVisible = true
|
||||
this.editCategoryForm = Object.assign({}, row)
|
||||
this.editCategoryForm.type = String(row.type)
|
||||
this.editCategoryForm.isEffective = String(row.isEffective)
|
||||
},
|
||||
// 取消修改
|
||||
handleNo() {
|
||||
this.editcategoryVisible = false
|
||||
},
|
||||
// 确认修改
|
||||
handleOk() {
|
||||
this.$refs.editCategoryForm.validate((valid) => {
|
||||
if (valid) {
|
||||
updateInventoryCategory(this.editCategoryForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.$refs.editCategoryForm.clearValidate()
|
||||
this.$refs.editCategoryForm.resetFields()
|
||||
this.editcategoryVisible = false
|
||||
} else {
|
||||
console.log('列表出错')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.categoryVisible = true
|
||||
},
|
||||
// 取消操作
|
||||
handlecancel() {
|
||||
this.categoryVisible = false
|
||||
},
|
||||
restAddCategoryForm() {
|
||||
this.addCategoryForm = {
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: '1'
|
||||
}
|
||||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
console.log(this.addCategoryForm)
|
||||
this.$refs.addCategoryForm.validate((valid) => {
|
||||
if (valid) {
|
||||
addInventoryCategory(this.addCategoryForm).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '新建成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.$refs.addCategoryForm.clearValidate()
|
||||
this.$refs.addCategoryForm.resetFields()
|
||||
this.restAddCategoryForm()
|
||||
this.categoryVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 生成合同
|
||||
handleContract() {
|
||||
console.log(123)
|
||||
},
|
||||
// 导出
|
||||
handleExport() {
|
||||
this.downloadLoading = true
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['编号', '工号', '员工登陆账号', '姓名', '性别', '生日', '邮箱', '职位', '所属部门', '所属区域', '所属门店', '入职时间', '离职时间', '状态']
|
||||
const filterVal = ['id', 'jobNumber', 'account', 'firstName', 'gender', 'birthday', 'email', 'postName', 'deptName', 'regionName', 'repositoryName', 'createTime', 'dimissionTime', 'stat']
|
||||
const data = this.formatJson(filterVal, this.list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '员工资料表'
|
||||
})
|
||||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
// 打印
|
||||
handlePrint() {
|
||||
console.log(456)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/css" scoped>
|
||||
.normal >>> .el-dialog__header {
|
||||
padding: 20px 20px 10px;
|
||||
background: #fff;
|
||||
position: static;
|
||||
top: auto;
|
||||
z-index: auto;
|
||||
width: auto;
|
||||
border-bottom: none;
|
||||
}
|
||||
.normal >>> .el-dialog {
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
left: 0;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
height: auto;
|
||||
}
|
||||
.app-container >>> .el-table .cell {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 24px;
|
||||
word-break: keep-all;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.ERP-container {
|
||||
margin: 0px 30px;
|
||||
}
|
||||
.filter-container{
|
||||
padding: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
|
@ -55,7 +55,7 @@ export default {
|
|||
},
|
||||
handleSuccess({ results, header }) {
|
||||
this.tableData = results
|
||||
this.tableHeader = ['物料编码(必填)', '条形码', '商品名称(必填)', '质保期(天数)', '重量(保留两位小数)', '体积(保留两位小数)', '会员价', '出厂价(必填)', '批发价', '销售价(必填)', '最低价', '档次级别编号(id)', '基本计量单位编号(id)(必填)', '销售计量单位编号(id)', '库存计量单位编号(id)', '生产计量单位编号(id)', '来源(2生产3采购)', '成本核算计价方式(1约当产量法,2定额成本法,3定额比例法)(必填)', '上下架(1上架,2下架)', '是否适用批次(1使用2不使用)(必填)', '有效天数(必填)', '采购周期(天)', '保养周期(天数)', '1可以作为赠品,2不可以', '生产能力(日产量)', '生产中心序号(id)', '绩效分', '积分', '种类id(必填)']
|
||||
this.tableHeader = ['物料编码(必填)', '条形码', '商品名称(必填)', '质保期(天数)', '重量(保留两位小数)', '体积(保留两位小数)', '会员价', '出厂价(必填)', '批发价', '销售价(必填)', '最低价', '档次级别编号(id)', '基本计量单位编号(id)(必填)', '来源(2生产3采购)', '成本核算计价方式(1约当产量法,2定额成本法,3定额比例法)(必填)', '上下架(1上架,2下架)', '是否适用批次(1使用2不使用)(必填)', '有效天数(必填)', '采购周期(天)', '保养周期(天数)', '1可以作为赠品,2不可以', '生产能力(日产量)', '生产中心序号(id)', '绩效分', '积分', '种类id(必填)']
|
||||
this.uploadHead = results.map(function(item) {
|
||||
return {
|
||||
code: item['物料编码(必填)'],
|
||||
|
@ -71,9 +71,6 @@ export default {
|
|||
lowerPrice: item['最低价'],
|
||||
level: item['档次级别编号(id)'],
|
||||
purchaseMeasurement: item['基本计量单位编号(id)(必填)'],
|
||||
saleMeasurement: item['销售计量单位编号(id)'],
|
||||
stockMeasurement: item['库存计量单位编号(id)'],
|
||||
produceMeasurement: item['生产计量单位编号(id)'],
|
||||
source: item['来源(2生产3采购)'],
|
||||
valuation: item['成本核算计价方式(1约当产量法,2定额成本法,3定额比例法)(必填)'],
|
||||
isActive: item['上下架(1上架,2下架)'],
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue