night work

This commit is contained in:
shawnzhang 2019-03-06 20:49:50 +08:00
parent 3b7bd214ee
commit 6e9414c5ca
7 changed files with 933 additions and 218 deletions

View file

@ -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
晚安世界
```

View file

@ -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
})
}

View file

@ -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: '上传',

View file

@ -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 }
}
]
},

View 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>

View 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>

View file

@ -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>