新增商品

This commit is contained in:
shawnzhang 2019-03-05 17:35:30 +08:00
parent 5788f22d8f
commit 3352a677e9
4 changed files with 483 additions and 568 deletions

View file

@ -218,7 +218,40 @@ export default {
groupName: '组名称',
createId: '建档人'
},
Product: {
code: '物料编码',
barcode: '条码',
productname: '产品名称',
typeid: '规格型号',
categoryid: '物品分类',
color: '颜色',
brand: '品牌',
kpigrade: '绩效分',
point: '商品积分',
zhibaoqi: '质保期',
weight: '商品重量',
volume: '商品体积',
costprice: '成本价',
tradeprice: '批发价',
saleprice: '零售价',
purchaseprice: '采购价',
lowerprice: '最低价',
supplierid: '供应商',
createid: '创建者',
level: '档次级别',
purchasemeasurement: '采购计量单位',
salemeasurement: '销售计量单位',
stockmeasurement: '库存计量单位',
producemeasurement: '生产计量单位',
source: '来源',
valuation: '成本核算计价方式',
isactive: '上下架',
picids: '商品图片',
detailpicid: '详情图片',
memberprice: '会员价'
},
public: {
uploadimage: '上传',
address: '地址',
regionId: '区域',
countyrId: '国家',

View file

@ -5,199 +5,176 @@
<h2 ref="geren" class="form-name">基本信息</h2>
<div class="container">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
<el-form-item :label="$t('Supplier.supplierName')" prop="supplierName" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.supplierName" placeholder="请输入供应商名称" clearable/>
<el-form-item :label="$t('Product.code')" prop="code" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.code" placeholder="请输入物料编码" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.typeId')" prop="typeId" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.typeId" placeholder="请选择供应商类别" style="width: 100%;">
<el-option
v-for="(item, index) in typeIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
<el-form-item :label="$t('Product.productname')" prop="productname" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.productname" placeholder="请输入产品名称" clearable/>
</el-form-item>
<el-form-item :label="$t('Product.barcode')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.barcode" placeholder="请输入条码" clearable/>
</el-form-item>
<el-form-item :label="$t('Product.categoryid')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.categoryid" placeholder="请选择物品分类" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.supplierShortName')" prop="supplierShortName" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.supplierShortName" placeholder="请输入供应商简称" clearable/>
</el-form-item><br>
<el-form-item :label="$t('Supplier.supplierIntroduction')" style="width: 80%;margin-top:1%">
<el-input v-model="personalForm.supplierIntroduction" type="textarea" clearable/>
<el-form-item :label="$t('Product.typeid')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.typeid" placeholder="请选择规格型号" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.purchasemeasurement')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.purchasemeasurement" placeholder="请选择采购计量单位" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.salemeasurement')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.salemeasurement" placeholder="请选择销售计量单位" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.stockmeasurement')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.stockmeasurement" placeholder="请选择库存计量单位" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.producemeasurement')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.producemeasurement" placeholder="请选择生产计量单位" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.color')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.color" placeholder="请输入颜色" clearable/>
</el-form-item>
<el-form-item :label="$t('Product.brand')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.brand" placeholder="请选择品牌" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.level')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.level" placeholder="请选择档次级别" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.level')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.level" placeholder="请选择档次级别" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.supplierid')" style="width: 40%;margin-top:1%">
<el-input v-model="supplierid" placeholder="请选择供应商" @focus="handlechoose"/>
</el-form-item>
<my-emp :control.sync="empcontrol" @personName="personName"/>
<el-form-item :label="$t('Product.source')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.source" placeholder="请选择来源" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.kpigrade')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.kpigrade" placeholder="请输入绩效分" clearable/>
</el-form-item>
<el-form-item :label="$t('Product.point')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.point" placeholder="请输入商品积分" clearable/>
</el-form-item>
<el-form-item :label="$t('Product.zhibaoqi')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.zhibaoqi" placeholder="请输入质保期" clearable>
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item :label="$t('Product.weight')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.weight" placeholder="请输入重量" clearable>
<template slot="append">KG</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('Product.volume')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.volume" placeholder="请输入体积" clearable>
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item :label="$t('Product.source')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.source" placeholder="请选择来源" clearable/>
</el-form-item>
</el-form>
</div>
<!--联系信息-->
<h2 ref="lianxi" class="form-name">业务信息</h2>
<!--价格信息-->
<h2 ref="lianxi" class="form-name">价格信息</h2>
<div class="container">
<el-form ref="personalForm2" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
<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-form-item :label="$t('Product.valuation')" prop="valuation" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.valuation" placeholder="请选择" style="width: 100%;">
<el-option value="1" label="类1"/>
<el-option value="2" label="类2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('public.provinceId')" style="width: 40%;margin-top: 1%">
<el-select v-model="personalForm.provinceId" placeholder="请选择省" style="width: 100%;" @change="handlechange2">
<el-option
v-for="(item, index) in provinces"
:key="index"
:label="item.name"
:value="item.id"/>
</el-select>
<el-form-item :label="$t('Product.costprice')" prop="costprice" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.costprice" placeholder="请输入成本价" clearable/>
</el-form-item>
<el-form-item :label="$t('public.cityId')" style="width: 40%;margin-top: 1%">
<el-select v-model="personalForm.cityId" placeholder="请选择市" style="width: 100%;">
<el-option
v-for="(item, index) in cities"
:key="index"
:label="item.name"
:value="item.id"/>
</el-select>
<el-form-item :label="$t('Product.tradeprice')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.tradeprice" placeholder="请输入批发价" clearable/>
</el-form-item>
<el-form-item :label="$t('public.address')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.detailAddress" placeholder="请输入地址" clearable/>
<el-form-item :label="$t('Product.saleprice')" prop="saleprice" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.saleprice" placeholder="请输入零售价" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.groupId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.groupId" placeholder="请选择供应商分组" style="width: 100%;">
<el-option label="类型1" value="1"/>
<el-option label="类型2" value="2"/>
</el-select>
<el-form-item :label="$t('Product.purchaseprice')" prop="purchaseprice" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.purchaseprice" placeholder="请输入采购价" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.zipCode')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.zipCode" placeholder="请输入邮编" clearable/>
<el-form-item :label="$t('Product.lowerprice')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.lowerprice" placeholder="请输入最低价" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.contactPersonName')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.contactPersonName" placeholder="请输入联系人" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.contactPersonPhone')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.contactPersonPhone" placeholder="请输入电话" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.regionId')" prop="regionid" style="width: 40%;margin-top: 1%">
<el-cascader
:options="regions"
:props="props"
v-model="perregions"
:show-all-levels="false"
placeholder="请选择区域"
change-on-select
filterable
clearable
style="width: 100%;"
/>
</el-form-item>
<el-form-item :label="$t('Supplier.giveId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.giveId" placeholder="请选择交货方式" style="width: 100%;">
<el-option
v-for="(item, index) in giveIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.transportId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.transportId" placeholder="请选择运送方式" style="width: 100%;">
<el-option
v-for="(item, index) in transportIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.levelId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.levelId" placeholder="请选择供应商优质级别" style="width: 100%;">
<el-option
v-for="(item, index) in levelIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.isHot')" prop="isHot" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.isHot" placeholder="请选择" style="width: 100%;">
<el-option label="是" value="1"/>
<el-option label="否" value="2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.isEffective')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.isEffective" placeholder="请选择启用状态" style="width: 100%;">
<el-option label="启用" value="1"/>
<el-option label="未启用" value="2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.buyerId')" style="width: 40%;margin-top:1%">
<el-input v-model="buyerId" placeholder="请输入采购员" @focus="handlechoose"/>
</el-form-item> <br>
<my-emp :control.sync="empcontrol" @personName="personName"/>
<el-form-item :label="$t('Supplier.businessScopeIntroduction')" style="width: 80%;margin-top:1%">
<el-input v-model="personalForm.businessScopeIntroduction" type="textarea" clearable/>
<el-form-item :label="$t('Product.memberprice')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.memberprice" placeholder="请输入会员价" clearable/>
</el-form-item>
</el-form>
</div>
<!--财务信息-->
<h2 class="form-name">财务信息</h2>
<!--图片信息-->
<h2 class="form-name">图片信息</h2>
<div class="container">
<el-form ref="personalForm3" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
<el-form-item :label="$t('Supplier.paymentId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.paymentId" placeholder="请选择结算方式" style="width: 100%;">
<el-option
v-for="(item, index) in paymentIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.moneyId')" style="width: 40%;margin-top: 1%">
<el-select v-model="personalForm.moneyId" :value="personalForm.moneyId" placeholder="请选择币种" style="width: 100%;">
<el-option label="RMB" value="1"/>
<el-option label="USD" value="2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Supplier.bankName')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.bankName" placeholder="请输入开户行" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.accountName')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.accountName" placeholder="请输入户名" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.account')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.account" placeholder="请输入账号" clearable/>
</el-form-item>
</el-form>
</div>
<!--辅助信息-->
<h2 ref="fuzhu" class="form-name">辅助信息</h2>
<div class="container">
<el-form ref="personalForm4" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-position="top" label-width="300px" style="margin-left: 30px;">
<el-form-item :label="$t('Supplier.establishDate')" style="width: 40%;margin-top:1%">
<el-date-picker
v-model="personalForm.establishDate"
type="date"
placeholder="选择成立时间"
value-format="yyyy-MM-dd"
clearable
style="width: 100%"/>
</el-form-item>
<el-form-item :label="$t('Supplier.legalPerson')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.legalPerson" placeholder="请输入法人代表" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.taxNumber')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.taxNumber" placeholder="请输入税务登记号" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.businessLicense')" style="width: 40%;margin-top:1%">
<el-input v-model="personalForm.businessLicense" placeholder="请输入营业执照号" clearable/>
</el-form-item>
<el-form-item :label="$t('Supplier.companyTypeId')" style="width: 40%;margin-top:1%">
<el-select v-model="personalForm.companyTypeId" placeholder="请选择单位性质" style="width: 100%;">
<el-option label="类型1" value="1"/>
<el-option label="类型2" value="2"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Product.picids')" style="width: 100%;margin-top: 1%">
<el-button style="margin-bottom: 10px" size="small" type="success" @click="submitUpload">{{ $t('public.uploadimage') }}</el-button>
<el-upload
ref="upload"
:on-preview="handlepicPreview"
:on-remove="handlepicRemove"
:on-success="handlepicsuccess"
:data="picidsData"
:auto-upload="false"
action="http://192.168.1.26:9090/erp/upload/uploadpic"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<el-dialog :visible.sync="picidsVisible">
<img :src="picidsImageUrl" width="100%" alt="">
</el-dialog>
</el-form-item >
<el-form-item :label="$t('Product.detailpicid')" style="width: 100%;margin-top: 1%">
<el-button style="margin-bottom: 10px" size="small" type="success" @click="detailpicsubmitUpload">{{ $t('public.uploadimage') }}</el-button>
<el-upload
ref="detailpicupload"
:on-preview="handledetailpicPreview"
:on-remove="handledetailpicRemove"
:on-success="handledetailpicsuccess"
:data="detailpicData"
:auto-upload="false"
action="http://192.168.1.26:9090/erp/upload/uploadpic"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<el-dialog :visible.sync="detailpicVisible">
<img :src="detailpicImageUrl" width="100%" alt="">
</el-dialog>
</el-form-item >
</el-form>
</div>
<!--操作-->
@ -211,95 +188,88 @@
</template>
<script>
import { getcountrylist, getprovincelist, getcitylist, regionlist } from '@/api/public'
import { searchCategory, create } from '@/api/Supplier'
import { create } from '@/api/Supplier'
import MyEmp from './components/MyEmp'
export default {
name: 'NewSupplier',
name: 'NewProduct',
components: { MyEmp },
data() {
return {
//
paymentIds: [],
//
levelIds: [],
//
transportIds: [],
//
giveIds: [],
//
typeIds: [],
//
//
empcontrol: false,
//
nations: [],
//
provinces: [],
//
cities: [],
//
regions: [],
//
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
// +++++++++++++++++++++++++
//
picidsVisible: false,
//
picidsImageUrl: '',
// type
picidsData: {
type: 2
},
//
buyerId: '',
// id
perregions: [],
//
// +++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++
detailpicVisible: false,
//
detailpicImageUrl: '',
// type
detailpicData: {
type: 7
},
// ++++++++++++++++++++++++++++++++
//
supplierid: '',
//
personalForm: {
supplierName: '',
typeId: '',
supplierShortName: '',
supplierIntroduction: '',
//
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: ''
code: '',
barcode: '',
productname: '',
typeid: '',
categoryid: '',
color: '',
brand: '',
kpigrade: '',
point: '',
zhibaoqi: '',
weight: '',
volume: '',
costprice: '',
tradeprice: '',
saleprice: '',
purchaseprice: '',
lowerprice: '',
supplierid: '',
createid: '',
level: '',
purchasemeasurement: '',
salemeasurement: '',
stockmeasurement: '',
producemeasurement: '',
source: '',
valuation: '',
isactive: '',
picids: [],
detailpicid: [],
memberprice: ''
},
//
//
personalrules: {
supplierName: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
code: [
{ required: true, message: '请输入物料编码', trigger: 'blur' }
],
typeId: [
{ required: true, message: '请选择供应商类别', trigger: 'change' }
productname: [
{ required: true, message: '请输入产品名称', trigger: 'change' }
],
groupId: [
{ required: true, message: '请选择供应商分组', trigger: 'change' }
valuation: [
{ required: true, message: '请选择计价方式', trigger: 'change' }
],
isHot: [
{ required: true, message: '请选择', trigger: 'change' }
costprice: [
{ required: true, message: '请输入成本价', trigger: 'blur' }
],
countryId: [
{ required: true, message: '请选择国家', trigger: 'change' }
saleprice: [
{ required: true, message: '请输入零售价', trigger: 'blur' }
],
purchaseprice: [
{ required: true, message: '请输入采购价', trigger: 'blur' }
]
}
}
@ -310,176 +280,88 @@ export default {
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
})
}
})
console.log(123)
},
//
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
})
}
})
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
submitUpload() {
this.$refs.upload.submit()
},
//
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
})
}
})
handlepicRemove(file, fileList) {
console.log(file, fileList)
},
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
handlepicPreview(file) {
this.picidsImageUrl = file.url
this.picidsVisible = true
},
handlepicsuccess(response) {
this.personalForm.picids.push(response.data.content.picId)
console.log(response.data.content.picId)
},
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
detailpicsubmitUpload() {
this.$refs.detailpicupload.submit()
},
handledetailpicRemove(file, fileList) {
console.log(file, fileList)
},
handledetailpicPreview(file) {
this.picidsImageUrl = file.url
this.picidsVisible = true
},
handledetailpicsuccess(response) {
this.personalForm.detailpicid.push(response.data.content.picId)
console.log(response.data.content.picId)
},
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
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
}
})
console.log(this.personalForm)
// 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 = {
supplierName: '',
ProductName: '',
typeId: '',
supplierShortName: '',
supplierIntroduction: '',
ProductShortName: '',
ProductIntroduction: '',
//
countryId: '',
provinceId: '',
@ -562,19 +444,19 @@ export default {
//
handlecancel() {
this.$router.go(-1)
const view = { path: '/Supplier/NewSupplier', name: 'NewSupplier', fullPath: '/Supplier/NewSupplier', title: 'NewSupplier' }
const view = { path: '/Product/NewProduct', name: 'NewProduct', fullPath: '/Product/NewProduct', title: 'NewProduct' }
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
})
},
// focus
// focus
handlechoose() {
this.empcontrol = true
},
//
//
personName(val) {
console.log(val)
this.buyerId = val.personName
this.personalForm.buyerId = val.id
this.supplierid = val.supplierName
this.personalForm.supplierid = val.id
}
}
}

View file

@ -1,116 +1,118 @@
<template>
<el-dialog :visible.sync="employeeVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择员工" append-to-body @close="$emit('update:control', false)">
<el-dialog :visible.sync="employeeVisible" :control="control" :close-on-press-escape="false" top="10px" title="选择供应商" append-to-body @close="$emit('update:control', false)">
<div class="filter-container">
<el-input v-model="getemplist.employeename" :placeholder="$t('NewEmployeeInformation.employeename')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.jobnumber" :placeholder="$t('NewEmployeeInformation.jobnumber2')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-date-picker
v-model="getemplist.time"
type="date"
class="filter-item"
placeholder="选择日期"
value-format="yyyy-MM-dd"/>
<!-- 搜索条件栏目 -->
<el-input v-model="getemplist.id" :placeholder="$t('Supplier.id')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.supplierName" :placeholder="$t('Supplier.supplierName')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-select v-model="getemplist.typeId" :value="getemplist.typeId" placeholder="请选择供应商" class="filter-item" clearable>
<el-option
v-for="(item, index) in typeIds"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
<!-- 更多搜索条件下拉栏 -->
<el-popover
placement="bottom"
width="500"
trigger="click">
<el-cascader
:options="regions2"
:props="props2"
:options="regions"
:props="props"
v-model="getemplistregions"
:show-all-levels="false"
placeholder="请选择区域"
placeholder="所在区域"
change-on-select
filterable
clearable
style="width: 40%;float: left;margin-left: 20px"
@change="handlechange4"
/>
<el-select v-model="getemplist.repositoryid" placeholder="请选择门店" clearable filterable style="width: 40%;float: right;margin-right: 20px">
<el-select v-model="getemplist.levelId" placeholder="请选择优质级别" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option
v-for="(item, index) in repositories"
v-for="(item, index) in levelIds"
:key="index"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
<el-select v-model="getemplist.postid" :value="getemplist.postid" :placeholder="$t('NewEmployeeInformation.postid2')" class="filter-item" clearable style="width: 40%;float: left;margin-top: 10px;margin-left: 20px">
<el-option label="xxx" value="1"/>
<el-option label="xxx" value="2"/>
</el-select>
<el-select v-model="getemplist.deptid" :placeholder="$t('NewEmployeeInformation.deptid2')" class="filter-item" clearable style="width: 40%;float: right;margin-top: 10px;margin-right: 20px">
<el-option
v-for="(item, index) in depts"
:key="index"
:label="item.deptName"
:value="item.id"/>
:label="item.categoryName"
:value="item.id"
/>
</el-select>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;" @click="handleAdd">{{ $t('public.add') }}</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>
</div>
<div class="app-container">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('Supplier.id')" :resizable="false" prop="id" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.supplierName')" :resizable="false" prop="supplierName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.supplierName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.supplierShortName')" :resizable="false" prop="supplierShortName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.supplierShortName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.typeId')" :resizable="false" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.typeName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.regionId')" :resizable="false" prop="regionName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.regionName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.buyerId')" :resizable="false" prop="buyerName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.buyerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.levelId')" :resizable="false" prop="levelName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.levelName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.createId')" :resizable="false" prop="createId" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Supplier.createTime')" :resizable="false" prop="createTime" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
</div>
<el-table
v-loading="listLoading"
:data="list"
:key="tableKey"
border
fit
highlight-current-row
style="width: 100%"
@current-change="handleCurrentChange">
<el-table-column
:label="$t('NewEmployeeInformation.id')"
:resizable="false"
property="id"
align="center"
width="50"/>
<el-table-column
:label="$t('NewEmployeeInformation.jobNumber')"
:resizable="false"
property="jobNumber"
align="center"
width="100"/>
<el-table-column
:label="$t('NewEmployeeInformation.account')"
:resizable="false"
property="account"
width="150"
align="center"/>
<el-table-column :label="$t('NewEmployeeInformation.name')" :resizable="false" align="center" width="109">
<template slot-scope="scope">
<span>{{ scope.row.firstName }} {{ scope.row.middleName }} {{ scope.row.lastName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.gender')" :resizable="false" prop="gender" align="center" width="80">
<template slot-scope="scope">
<span>{{ scope.row.gender | genderFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.deptName')" :resizable="false" prop="deptName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.deptName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.regionName')" :resizable="false" prop="regionName" align="center" width="230">
<template slot-scope="scope">
<span>{{ scope.row.regionName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.repositoryName')" :resizable="false" prop="repositoryName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.repositoryName }}</span>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="gitemplist" />
</el-dialog>
</template>
<script>
import { regionlist, searchRepository } from '@/api/public'
import { getemplist, getdeptlist } from '@/api/EmployeeInformation'
import { searchRepository, regionlist } from '@/api/public'
import { searchCategory, search } from '@/api/Supplier'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
export default {
@ -133,51 +135,57 @@ export default {
},
data() {
return {
//
managerPeople: '',
//
regionManagerId: '',
// /
//
currentRow: null,
//
//
employeeVisible: this.control,
//
groupName: '',
//
groupData: [],
//
GroupVisible: false,
//
moreaction: '',
//
levelIds: [],
//
typeIds: [],
//
downloadLoading: false,
//
list: [],
//
//
total: 0,
//
//
tableKey: 0,
//
//
listLoading: true,
//
//
getemplist: {
repositoryid: '',
regionid: '',
postid: '',
deptid: '',
employeename: '',
id: '',
supplierName: '',
typeId: '',
regionId: '',
levelId: '',
pagenum: 1,
pagesize: 10,
stat: 1,
time: '',
jobnumber: ''
pagesize: 10
},
//
depts: [],
//
props2: {
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions2: [],
regions: [],
getemplistregions: [],
//
repositories: [],
//
employeeVisible: this.control,
//
regionManagerVisible: false
//
personalForm: {},
//
editVisible: false
}
},
watch: {
@ -187,15 +195,13 @@ export default {
}
},
created() {
this.gitemplist()
this.getlist()
},
methods: {
//
gitemplist() {
//
getlist() {
//
this.listLoading = true
console.log(this.getemplist)
getemplist(this.getemplist).then(res => {
search(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
@ -210,10 +216,22 @@ export default {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
//
searchCategory(1).then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
this.typeIds = 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: '错误',
@ -225,23 +243,18 @@ export default {
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
this.regions = this.tranKTree(res.data.data.content)
}
})
},
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
//
handleAdd() {
this.$router.push('/EmployeeInformation/Supplier')
},
//
//
handleFilter() {
this.getemplist.regionid = this.getemplistregions[this.getemplistregions.length - 1]
getemplist(this.getemplist).then(res => {
this.getemplist.regionId = this.getemplistregions[this.getemplistregions.length - 1]
search(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
@ -254,46 +267,31 @@ export default {
}
})
},
//
handleAdd() {
this.employeeVisible = false
this.$router.push('/EmployeeInformation/NewEmployeeInformation')
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
},
//
handlechange4(val) {
console.log(val)
const finalid = val[val.length - 1]
searchRepository(finalid).then(res => {
if (res.data.ret === 200) {
console.log(res)
this.repositories = res.data.data.content.list
this.repositories = res.data.data.content
} else {
this.$message.error('出错了')
}
})
},
//
restemplist() {
this.getemplist = {
repositoryid: '',
regionid: '',
postid: '',
deptid: '',
employeename: '',
pagenum: 1,
pagesize: 10,
stat: 1,
time: '',
jobnumber: ''
}
this.getemplistregions = []
},
//
handleCurrentChange(val) {
this.$emit('personName', val)
this.employeeVisible = false
}
//
}
}
</script>

View file

@ -173,6 +173,8 @@ export default {
},
data() {
return {
//
employeeVisible: this.control,
//
groupName: '',
//