mirror of
https://github.com/shawncai/ERP.git
synced 2024-12-29 11:33:05 +08:00
night work
This commit is contained in:
parent
3b7bd214ee
commit
6e9414c5ca
7 changed files with 933 additions and 218 deletions
|
@ -115,5 +115,6 @@ this.tableHeader = ['门店名称', '地址', '经度', '纬度', '管理员id',
|
|||
- 新建价格变更单页面完成 2019/03/06 16:00
|
||||
- 价格变更单列表页面完成 2019/03/06 17:09
|
||||
- 短信模板设置页面完成 2019/03/06 19:12
|
||||
|
||||
- 计量单位设置页面完成 2019/03/06 20:00
|
||||
晚安世界
|
||||
```
|
|
@ -161,3 +161,78 @@ export function deletemodel(query) {
|
|||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询计量单位列表
|
||||
export function searchMea(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.iseffective !== '' && query.iseffective !== null && query.iseffective !== undefined) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.categoryname !== '' && query.categoryname !== null && query.categoryname !== undefined) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 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: 'http://192.168.1.45:8080/erp/measurement/search',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 新增计量单位
|
||||
export function createmea(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.category !== '' && query.category !== null && query.category !== undefined) {
|
||||
params.append('category', query.category) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null && query.type !== undefined) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null && query.iseffective !== undefined) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.categoryname !== '' && query.categoryname !== null && query.categoryname !== undefined) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/measurement/create',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改计量单位
|
||||
export function updatemea(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.id !== '' && query.id !== null && query.id !== undefined) {
|
||||
params.append('id', query.id) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.isEffective !== '' && query.isEffective !== null && query.isEffective !== undefined) {
|
||||
params.append('iseffective', query.isEffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.categoryName !== '' && query.categoryName !== null && query.categoryName !== undefined) {
|
||||
params.append('categoryname', query.categoryName) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/measurement/update',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除计量单位
|
||||
export function deletemea(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query !== '' && query !== null && query !== undefined) {
|
||||
params.append('modelids', query) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
url: 'http://192.168.1.45:8080/erp/measurement/delete',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -38,8 +38,9 @@ export default {
|
|||
NumberingRules: '单据编号设置',
|
||||
Newadjustprice: '新建价格变更单',
|
||||
AdjustpriceList: '价格变更单列表',
|
||||
addSMS: '新增短信模板',
|
||||
SMSModelList: '短信设置'
|
||||
SMSModelList: '短信设置',
|
||||
Measurement: '计量单位设置',
|
||||
Commission: '提成设置'
|
||||
},
|
||||
navbar: {
|
||||
logOut: '退出登录',
|
||||
|
@ -295,7 +296,14 @@ export default {
|
|||
createTime: '创建日期',
|
||||
modelname: '短信模板名称',
|
||||
content: '内容',
|
||||
iseffective2: '是否启用'
|
||||
iseffective2: '是否启用',
|
||||
categoryname: '计量单位名称',
|
||||
type2: '计量单位类别',
|
||||
iseffective3: '状态',
|
||||
roleId: '员工职位',
|
||||
productCategoryId: '商品类别',
|
||||
commissionType: '提成类型',
|
||||
commissionValue: '提成'
|
||||
},
|
||||
public: {
|
||||
uploadimage: '上传',
|
||||
|
|
|
@ -333,10 +333,16 @@ export const asyncRouterMap = [
|
|||
meta: { title: 'SMSModelList', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'addSMS',
|
||||
component: () => import('@/views/BasicSettings/addSMS'),
|
||||
name: 'addSMS',
|
||||
meta: { title: 'addSMS', noCache: false }
|
||||
path: 'Measurement',
|
||||
component: () => import('@/views/BasicSettings/Measurement'),
|
||||
name: 'Measurement',
|
||||
meta: { title: 'Measurement', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'Commission',
|
||||
component: () => import('@/views/BasicSettings/Commission'),
|
||||
name: 'Commission',
|
||||
meta: { title: 'Commission', noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
408
src/views/BasicSettings/Commission.vue
Normal file
408
src/views/BasicSettings/Commission.vue
Normal file
|
@ -0,0 +1,408 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="app-container">
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" status-icon class="demo-ruleForm" label-position="left" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('BasicSettings.roleId')" prop="roleId" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.roleId" placeholder="请选择员工职位" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('BasicSettings.productCategoryId')" prop="productCategoryId" style="width: 40%;margin-top:1%">
|
||||
<el-select v-model="personalForm.productCategoryId" placeholder="请选择商品类别" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="(item, index) in typeIds"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('BasicSettings.commissionType')" prop="commissionType" style="width: 40%;margin-top:1%">
|
||||
<el-radio-group v-model="personalForm.commissionType">
|
||||
<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-item :label="$t('BasicSettings.commissionValue')" prop="commissionValue" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.commissionValue" placeholder="请输入提成" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('public.countyrId')" prop="countryId" style="width: 40%;margin-top: 1%">
|
||||
<el-select v-model="personalForm.countryId" placeholder="国家" style="width: 100%;" @change ="handlechange">
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--操作-->
|
||||
<div class="buttons" style="margin-top: 20px">
|
||||
<el-button type="primary" @click="handlesave()">保存</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
|
||||
import { searchCategory, create } from '@/api/BasicSettings'
|
||||
import MyEmp from './components/MyEmp'
|
||||
export default {
|
||||
name: 'Commission',
|
||||
components: { MyEmp },
|
||||
data() {
|
||||
return {
|
||||
// 结算方式
|
||||
paymentIds: [],
|
||||
// 优质级别
|
||||
levelIds: [],
|
||||
// 运送方式
|
||||
transportIds: [],
|
||||
// 交货方式
|
||||
giveIds: [],
|
||||
// 供应商类别
|
||||
typeIds: [],
|
||||
// 采购员弹窗控制
|
||||
empcontrol: false,
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 省列表
|
||||
provinces: [],
|
||||
// 城市列表
|
||||
cities: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
// 区域列表字段更改
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 采购员回显
|
||||
buyerId: '',
|
||||
// 转化区域id
|
||||
perregions: [],
|
||||
// 提成信息数据
|
||||
personalForm: {
|
||||
roleId: '',
|
||||
productCategoryId: '',
|
||||
commissionType: '',
|
||||
commissionValue: '',
|
||||
countryId: ''
|
||||
},
|
||||
// 个人信息规则数据
|
||||
personalrules: {
|
||||
roleId: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
|
||||
],
|
||||
productCategoryId: [
|
||||
{ required: true, message: '请选择供应商类别', trigger: 'change' }
|
||||
],
|
||||
commissionType: [
|
||||
{ required: true, message: '请选择供应商分组', trigger: 'change' }
|
||||
],
|
||||
commissionValue: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
countryId: [
|
||||
{ required: true, message: '请选择国家', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getnationlist()
|
||||
},
|
||||
methods: {
|
||||
// 国籍列表
|
||||
getnationlist() {
|
||||
getcountrylist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.nations = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 区域列表数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 供应商类别
|
||||
searchCategory(1).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.typeIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 交货方式
|
||||
searchCategory(2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.giveIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 运送方式
|
||||
searchCategory(3).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.transportIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 优质级别
|
||||
searchCategory(4).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.levelIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
// 结算方式
|
||||
searchCategory(5).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.paymentIds = res.data.data.content.list
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据国家选择省
|
||||
handlechange(val) {
|
||||
getprovincelist(val).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.provinces = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据省选择市
|
||||
handlechange2(val) {
|
||||
getcitylist(val).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.cities = res.data.data.content
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空记录
|
||||
restAllForm() {
|
||||
this.personalForm = {
|
||||
BasicSettingsName: '',
|
||||
typeId: '',
|
||||
BasicSettingsShortName: '',
|
||||
BasicSettingsIntroduction: '',
|
||||
// 业务信息
|
||||
countryId: '',
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
isHot: '',
|
||||
isEffective: '',
|
||||
buyerId: '',
|
||||
// 财务信息
|
||||
businessScopeIntroduction: '',
|
||||
paymentId: '',
|
||||
moneyId: '',
|
||||
bankName: '',
|
||||
accountName: '',
|
||||
account: '',
|
||||
establishDate: '',
|
||||
legalPerson: '',
|
||||
taxNumber: '',
|
||||
businessLicense: '',
|
||||
companyTypeId: ''
|
||||
}
|
||||
this.perregions = []
|
||||
this.buyerId = ''
|
||||
},
|
||||
// 继续录入
|
||||
handleentry() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
const anchor2 = this.$refs.geren.offsetTop
|
||||
console.log(anchor2)
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消操作
|
||||
handlecancel() {
|
||||
this.$router.go(-1)
|
||||
const view = { path: '/BasicSettings/NewBasicSettings', name: 'NewBasicSettings', fullPath: '/BasicSettings/NewBasicSettings', title: 'NewBasicSettings' }
|
||||
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
|
||||
})
|
||||
},
|
||||
// 员工输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 员工列表返回数据
|
||||
personName(val) {
|
||||
console.log(val)
|
||||
this.buyerId = val.personName
|
||||
this.personalForm.buyerId = val.id
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.ERP-container{
|
||||
margin:0px 30px;
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
}
|
||||
</style>
|
427
src/views/BasicSettings/Measurement.vue
Normal file
427
src/views/BasicSettings/Measurement.vue
Normal file
|
@ -0,0 +1,427 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="filter-container">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<el-input v-model="getemplist.categoryname" :placeholder="$t('BasicSettings.categoryname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-select v-model="getemplist.type" :placeholder="$t('BasicSettings.type2')" class="filter-item" clearable >
|
||||
<el-option value="1" label="数量" />
|
||||
<el-option value="2" label="体积" />
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.iseffective" :placeholder="$t('BasicSettings.iseffective3')" class="filter-item" clearable >
|
||||
<el-option value="1" label="启用" />
|
||||
<el-option value="2" label="禁用" />
|
||||
</el-select>
|
||||
<!-- 搜索按钮 -->
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<!-- 批量操作 -->
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button v-waves class="filter-item" 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 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-waves :loading="downloadLoading" class="filter-item" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||
<!-- 打印操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||
<!-- 新建操作 -->
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;float: right" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
<!--新建列表开始-->
|
||||
<el-dialog :visible.sync="addNumberingVisible" title="新建编号规则" width="500px">
|
||||
<el-form :model="Numberingform" label-position="left" label-width="120px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label-width="120px" label="计量单位名称">
|
||||
<el-input v-model="Numberingform.categoryname" placeholder="请输入计量单位名称" autocomplete="off" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="计量单位类别">
|
||||
<el-select v-model="Numberingform.type" placeholder="请选择计量单位类别">
|
||||
<el-option label="数量" value="1"/>
|
||||
<el-option label="体积" value="2"/>
|
||||
<el-option label="重量" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="计量单位类别">
|
||||
<el-select v-model="Numberingform.category" placeholder="请选择计量单位类别">
|
||||
<el-option label="数量" value="1"/>
|
||||
<el-option label="体积" value="2"/>
|
||||
<el-option label="重量" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="启用状态">
|
||||
<el-select v-model="Numberingform.iseffective" placeholder="请选择启用状态">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="禁用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button @click="addNumberingVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleOk">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--新建结束-->
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 列表开始 -->
|
||||
<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('BasicSettings.categoryname')" :resizable="false" prop="categoryName" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('BasicSettings.type2')" :resizable="false" prop="type" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.type | typeFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('BasicSettings.iseffective')" :resizable="false" prop="isEffective" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isEffective | genderFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('BasicSettings.createTime')" :resizable="false" prop="createTime" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</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 type="primary" size="mini" @click="handleEdit(scope.row)">{{ $t('public.edit') }}</el-button>
|
||||
<el-button 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="editNumberingVisible" title="修改编号规则" width="500px">
|
||||
<el-form :model="editNumberingform" label-position="left" label-width="120px" style="width: 400px; margin-left:50px;">
|
||||
<el-form-item label-width="120px" label="计量单位名称">
|
||||
<el-input v-model="editNumberingform.categoryName" placeholder="请输入计量单位名称" autocomplete="off" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="计量单位类别">
|
||||
<el-select v-model="editNumberingform.type" placeholder="请选择计量单位类别">
|
||||
<el-option label="数量" value="1"/>
|
||||
<el-option label="体积" value="2"/>
|
||||
<el-option label="重量" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="计量单位类别">
|
||||
<el-select v-model="editNumberingform.category" placeholder="请选择计量单位类别">
|
||||
<el-option label="数量" value="1"/>
|
||||
<el-option label="体积" value="2"/>
|
||||
<el-option label="重量" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="启用状态">
|
||||
<el-select v-model="editNumberingform.isEffective" placeholder="请选择启用状态">
|
||||
<el-option label="启用" value="1"/>
|
||||
<el-option label="禁用" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button @click="editNumberingVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditOk">修改</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--修改结束=================================================-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchMea, deletemea, createmea, updatemea } from '@/api/BasicSettings'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
|
||||
export default {
|
||||
name: 'Measurement',
|
||||
directives: { waves },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
genderFilter(status) {
|
||||
const statusMap = {
|
||||
1: '已启用',
|
||||
2: '停用'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
typeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '数量',
|
||||
2: '体积',
|
||||
3: '体积'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 修改数据集合
|
||||
editNumberingform: '',
|
||||
// 新建数据集合
|
||||
Numberingform: {
|
||||
category: '',
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: null
|
||||
},
|
||||
// 修改窗口控制器
|
||||
editNumberingVisible: false,
|
||||
// 新建窗口控制器
|
||||
addNumberingVisible: false,
|
||||
// 控制组件数据
|
||||
editVisible: false,
|
||||
// 批量操作
|
||||
moreaction: '',
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 计量单位查询加展示参数
|
||||
getemplist: {
|
||||
categoryname: '',
|
||||
type: '',
|
||||
iseffective: '',
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
getlist() {
|
||||
// 计量单位数据
|
||||
this.listLoading = true
|
||||
searchMea(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content
|
||||
this.total = res.data.data.content.length
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
searchMea(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content
|
||||
this.total = res.data.data.content.length
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改操作
|
||||
handleEdit(row) {
|
||||
console.log(row)
|
||||
this.editNumberingform = row
|
||||
this.editNumberingform.isEffective = String(row.isEffective)
|
||||
this.editNumberingform.type = String(row.type)
|
||||
this.editNumberingVisible = true
|
||||
},
|
||||
// 确认修改
|
||||
handleEditOk() {
|
||||
console.log(this.editNumberingform)
|
||||
updatemea(this.editNumberingform).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.editNumberingVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量操作
|
||||
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(() => {
|
||||
deletemea(ids).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
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(() => {
|
||||
deletemea(row.id).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 清除数据
|
||||
restNumberingform() {
|
||||
this.Numberingform = {
|
||||
category: '',
|
||||
type: '',
|
||||
iseffective: null
|
||||
}
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.addNumberingVisible = true
|
||||
},
|
||||
// 确认新增
|
||||
handleOk() {
|
||||
createmea(this.Numberingform).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '新增成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
this.restNumberingform()
|
||||
this.addNumberingVisible = false
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 导出
|
||||
handleExport() {
|
||||
this.downloadLoading = true
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['序号', '编号规则名称', '单据类型', '编号前缀', '日期类型', '流水号长度', '状态', '创建日期']
|
||||
const filterVal = ['id', 'ruleName', 'type', 'prefix', 'dateType', 'length', 'isEffective', 'createTime']
|
||||
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>
|
||||
.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>
|
|
@ -1,210 +0,0 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<div class="app-container">
|
||||
<!--基本信息-->
|
||||
<h2 ref="geren" class="form-name">基本信息</h2>
|
||||
<div class="container">
|
||||
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" status-icon class="demo-ruleForm" label-position="left" label-width="300px" style="margin-left: 30px;">
|
||||
<el-form-item :label="$t('BasicSettings.modelname')" prop="modelname" style="width: 50%;margin-top:1%">
|
||||
<el-input v-model="personalForm.modelname" placeholder="请输入短信模板名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('BasicSettings.content')" prop="content" style="width: 80%;margin-top:1%">
|
||||
<el-input v-model="personalForm.content" :rows="4" type="textarea" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('BasicSettings.BasicSettingsShortName')" prop="BasicSettingsShortName" style="width: 40%;margin-top:1%">
|
||||
<el-input v-model="personalForm.BasicSettingsShortName" placeholder="请输入供应商简称" clearable/>
|
||||
</el-form-item><br>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--操作-->
|
||||
<div class="buttons" style="margin-top: 20px">
|
||||
<el-button type="primary" @click="handlesave()">保存</el-button>
|
||||
<el-button type="success" @click="handleentry()">继续录入</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create } from '@/api/BasicSettings'
|
||||
import MyEmp from './components/MyEmp'
|
||||
export default {
|
||||
name: 'AddSMS',
|
||||
components: { MyEmp },
|
||||
data() {
|
||||
return {
|
||||
// 短信模板信息数据
|
||||
personalForm: {
|
||||
iseffective: '',
|
||||
modelname: '',
|
||||
content: ''
|
||||
},
|
||||
// 个人信息规则数据
|
||||
personalrules: {
|
||||
modelname: [
|
||||
{ required: true, message: '请输入短信模板名称', trigger: 'blur' }
|
||||
],
|
||||
iseffective: [
|
||||
{ required: true, message: '请选择启用状态', trigger: 'change' }
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空记录
|
||||
restAllForm() {
|
||||
this.personalForm = {
|
||||
BasicSettingsName: '',
|
||||
typeId: '',
|
||||
BasicSettingsShortName: '',
|
||||
BasicSettingsIntroduction: '',
|
||||
// 业务信息
|
||||
countryId: '',
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
detailAddress: '',
|
||||
groupId: '',
|
||||
zipCode: '',
|
||||
contactPersonName: '',
|
||||
contactPersonPhone: '',
|
||||
regionId: '',
|
||||
giveId: '',
|
||||
transportId: '',
|
||||
levelId: '',
|
||||
isHot: '',
|
||||
isEffective: '',
|
||||
buyerId: '',
|
||||
// 财务信息
|
||||
businessScopeIntroduction: '',
|
||||
paymentId: '',
|
||||
moneyId: '',
|
||||
bankName: '',
|
||||
accountName: '',
|
||||
account: '',
|
||||
establishDate: '',
|
||||
legalPerson: '',
|
||||
taxNumber: '',
|
||||
businessLicense: '',
|
||||
companyTypeId: ''
|
||||
}
|
||||
this.perregions = []
|
||||
this.buyerId = ''
|
||||
},
|
||||
// 继续录入
|
||||
handleentry() {
|
||||
this.personalForm.regionId = this.perregions[this.perregions.length - 1]
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
create(this.personalForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.restAllForm()
|
||||
this.$refs.personalForm.clearValidate()
|
||||
this.$refs.personalForm.resetFields()
|
||||
this.$refs.personalForm2.clearValidate()
|
||||
this.$refs.personalForm2.resetFields()
|
||||
this.$refs.personalForm3.clearValidate()
|
||||
this.$refs.personalForm3.resetFields()
|
||||
this.$refs.personalForm4.clearValidate()
|
||||
this.$refs.personalForm4.resetFields()
|
||||
const anchor = this.$refs.geren.offsetTop
|
||||
console.log(anchor)
|
||||
document.documentElement.scrollTop = anchor - 100
|
||||
} else if (res.data.msg === 'account isExist') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '登陆账号已存在',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
const anchor2 = this.$refs.geren.offsetTop
|
||||
console.log(anchor2)
|
||||
document.documentElement.scrollTop = anchor2 - 100
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消操作
|
||||
handlecancel() {
|
||||
this.$router.go(-1)
|
||||
const view = { path: '/BasicSettings/NewBasicSettings', name: 'NewBasicSettings', fullPath: '/BasicSettings/NewBasicSettings', title: 'NewBasicSettings' }
|
||||
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.ERP-container{
|
||||
margin:0px 30px;
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue