This commit is contained in:
shawn 2020-02-02 17:22:42 +08:00
commit 7ae6ab3e2b
8 changed files with 453 additions and 635 deletions

View file

@ -1,61 +1,64 @@
import request from '@/utils/request'
// 添加领料单
export function createCoupon(query, query2, query3) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('Json', query) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/create',
method: 'post',
data: params
})
}
// 领料单列表
export function couponlist(query) {
var params = new URLSearchParams()
if (query.name !== '' && query.name !== null && query.name !== undefined) {
params.append('name', query.name) // 你要传给后台的参数值 key/value
}
if (query.stat !== '' && query.stat !== null && query.stat !== undefined) {
params.append('stat', query.stat) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({
url: '/coupon/search',
method: 'post',
data: params
})
}
// 删除领料单
export function deletecoupon(query, query2) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('modelids', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('operatorId', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/delete',
method: 'post',
data: params
})
}
// 修改领料单
export function updatecoupon(query) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('Json', query) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/update',
method: 'post',
data: params
})
}
import request from '@/utils/request'
// 添加领料单
export function createCoupon(query) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('Json', query) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/create',
method: 'post',
data: params
})
}
// 领料单列表
export function couponlist(query) {
var params = new URLSearchParams()
if (query.name !== '' && query.name !== null && query.name !== undefined) {
params.append('name', query.name) // 你要传给后台的参数值 key/value
}
if (query.type !== '' && query.type !== null && query.type !== undefined) {
params.append('type', query.type) // 你要传给后台的参数值 key/value
}
if (query.money !== '' && query.money !== null && query.money !== undefined) {
params.append('money', query.money) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({
url: '/coupon/search',
method: 'post',
data: params
})
}
// 删除领料单
export function deletecoupon(query, query2) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('modelids', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('operatorId', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/delete',
method: 'post',
data: params
})
}
// 修改领料单
export function updatecoupon(query) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('Json', query) // 你要传给后台的参数值 key/value
}
return request({
url: '/coupon/update',
method: 'post',
data: params
})
}

View file

@ -852,7 +852,7 @@ export default {
applicableRepositoryId: '使用门店',
applicableProductId: '使用商品',
stat: '状态',
received: '已领取',
received: '已发放',
used: '已使用',
couponStat: '优惠券状态',
couponType: '优惠券类型',
@ -3943,7 +3943,14 @@ export default {
outlay: '支出单',
totalPay: '总支出',
balance: '余额',
payModeName: '结算方式'
payModeName: '结算方式',
type: '优惠券类型',
effectiveTime: '有效期',
effectiveType: '适用类别',
isRepeat: '是否可以叠加',
number: '发行量',
send: '已发放数量',
left: '剩余数量'
},
collectAndPayDetail: {
name: '名称',

View file

@ -2863,7 +2863,7 @@ export const asyncRouterMap = [
path: 'CouponList',
component: () => import('@/views/Coupon/CouponList'),
name: 'CouponList',
meta: { title: 'CouponList', noCache: true, roles: ['215-216-218-2', '215-216-218-3', '215-216-218-4', '215-216-218-5', '215-216-218-6', '215-216-218-7', '215-216-218-8', '215-216-218-9'] }
meta: { title: 'CouponList', noCache: true, roles: ['215-216-217-2', '215-216-217-3', '215-216-217-4', '215-216-217-5', '215-216-217-6', '215-216-217-7', '215-216-217-8', '215-216-217-9'] }
}
]
},

View file

@ -18,13 +18,55 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.requireMoney')" prop="requireMoney" style="width: 100%;">
<el-input-number v-model="personalForm.requireMoney" :precision="2" :controls="false" :step="0.1" :min="0" style="margin-left: 11px;width: 200px;text-align: left"/>
<el-form-item :label="$t('collectAndPay.number')" prop="number" style="width: 100%;">
<el-input-number v-model="personalForm.number" :controls="false" :step="0.1" :min="0" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.beginTime')" prop="beginTime" style="width: 100%;">
<el-form-item :label="$t('collectAndPay.type')" style="width: 100%;">
<el-radio-group v-model="personalForm.type" style="margin-left: 18px;width: 210px" @change="changeType">
<el-radio :label="1" style="width: 100px">全部门店</el-radio>
<el-radio :label="2">部分门店</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Storagemove.repostiryName')" style="width: 100%;">
<el-input :disabled="repo" v-model="personalForm.itemName" :value="personalForm.itemName" placeholder="请选择仓库" filterable clearable style="margin-left: 18px;width: 200px;" @focus="handlechooseRep"/>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname($event)"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('collectAndPay.effectiveType')" prop="effectiveType" style="width: 100%;">
<el-select v-model="personalForm.effectiveType" multiple collapse-tags style="margin-left: 18px;width: 200px">
<el-option value="1" label="分期付款"/>
<el-option value="2" label="购车"/>
<el-option value="3" label="配件"/>
<el-option value="4" label="电池"/>
<el-option value="5" label="全部适用"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('collectAndPay.isRepeat')" prop="isDiscount" style="width: 100%;">
<el-radio-group v-model="personalForm.isRepeat" style="margin-left: 18px;width: 210px">
<el-radio :label="1" style="width: 100px">Yes</el-radio>
<el-radio :label="2">No</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('collectAndPay.effectiveTime')" style="width: 100%;">
<el-radio-group v-model="personalForm.effectiveTime" style="margin-left: 18px;width: 225px" @change="changeTime">
<el-radio :label="1" style="width: 100px">限制时间</el-radio>
<el-radio :label="2">不限制时间</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.beginTime')" style="width: 100%;">
<el-date-picker
:disabled="addpro"
v-model="personalForm.beginTime"
:picker-options="pickerOptions1"
type="date"
@ -33,8 +75,9 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.endTime')" prop="endTime" style="width: 100%;">
<el-form-item :label="$t('Coupon.endTime')" style="width: 100%;">
<el-date-picker
:disabled="addpro"
v-model="personalForm.endTime"
:picker-options="pickerOptions1"
type="date"
@ -42,125 +85,14 @@
style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.beginClock')" style="width: 100%;">
<el-input-number v-model="personalForm.beginClock" :precision="0" :controls="false" :step="0.1" :min="0" :max="12" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.endClock')" style="width: 100%;">
<el-input-number v-model="personalForm.endClock" :precision="0" :controls="false" :step="0.1" :min="0" :max="12" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.isDiscount')" prop="isDiscount" style="width: 100%;">
<el-radio-group v-model="personalForm.isDiscount" style="margin-left: 18px;width: 200px">
<el-radio :label="1" style="width: 100px">YES</el-radio>
<el-radio :label="2">NO</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.isToday')" prop="isToday" style="width: 100%;">
<el-radio-group v-model="personalForm.isToday" style="margin-left: 18px;width: 200px">
<el-radio :label="1" style="width: 100px">YES</el-radio>
<el-radio :label="2">NO</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.applicableWeek')" style="width: 100%;">
<el-select v-model="personalForm.applicableWeek" multiple collapse-tags style="margin-left: 18px;width: 200px">
<el-option value="1" label="周一"/>
<el-option value="2" label="周二"/>
<el-option value="3" label="周三"/>
<el-option value="4" label="周四"/>
<el-option value="5" label="周五"/>
<el-option value="6" label="周六"/>
<el-option value="7" label="周日"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('Coupon.content')" style="width: 100%;">
<el-input v-model="personalForm.content" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >{{ $t('updates.sysp') }}</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="Isproduct" @click="handleAddproduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrder="saleOrder"/>
<my-presale :presalecontrol.sync="presalecontrol" @advanceOrderDetail="advanceOrderDetail" @advanceData="advanceData"/>
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
<my-contract :contractcontrol.sync="contractcontrol" @salecontractDetail="salecontractDetail" @salecontract="salecontract"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
<!-- <el-button type="primary" @click="checkStock()">{{ $t('updates.kckz') }}</el-button>-->
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
stripe
border
size="medium"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" fixed="left" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="code" fixed="left" align="center" />
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" fixed="left" align="center" />
<el-editable-column :label="$t('updates.wpfl')" prop="category" align="center" />
<el-editable-column :label="$t('updates.jbdw')" prop="purchaseMeasurement" align="center" />
<el-editable-column :label="$t('updates.ggxh')" prop="productType" align="center" />
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" />
</el-editable>
</div>
</el-card>
<!--操作-->
<div class="buttons" style="margin-top: 20px">
<el-button v-no-more-click type="primary" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
</div>
<el-dialog :visible.sync="receiptVisible2" title="库存快照" class="normal" width="600px" center>
<el-form class="demo-ruleForm" style="margin: 0px 6%; width: 400px">
<el-form-item label-width="100px;" style=" width: 500px;">
<div style="width: 100%; height: 220px;overflow: hidden;background: white;" >
<el-table
:data="list111"
height="220"
style="width: 100%;"
>
<el-table-column :resizable="false" :label="$t('updates.cangk')" align="center" min-width="150">
<template slot-scope="scope">
<span >{{ scope.row.repositoryName }}</span>
</template>
</el-table-column>
<el-table-column :resizable="false" :label="$t('updates.spmc')" align="center" min-width="150">
<template slot-scope="scope">
<span >{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :resizable="false" label="可用库存量" align="center" min-width="150">
<template slot-scope="scope">
<span >{{ scope.row.ableStock }}</span>
</template>
</el-table-column>
</el-table>
</div>
</el-form-item>
</el-form>
</el-dialog>
</div>
</div>
</template>
@ -193,6 +125,8 @@ export default {
components: { MyContract, MyDetail2, MyOpportunity, MyPresale, MyAdvance, MyOrder, MyRepository, MyAccept, MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
data() {
return {
addpro: false,
repo: true,
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
@ -276,9 +210,11 @@ export default {
control: false,
//
personalForm: {
effectiveTime: 1,
type: 1,
isRepeat: 2,
createPersonId: this.$store.getters.userId,
countryId: this.$store.getters.countryId,
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
isDiscount: 1,
isToday: 1,
@ -290,6 +226,9 @@ export default {
name: [
{ required: true, message: '请输入优惠券名称', trigger: 'change' }
],
number: [
{ required: true, message: '请输入发行量', trigger: 'change' }
],
money: [
{ required: true, message: '请输入面值', trigger: 'change' }
],
@ -327,6 +266,25 @@ export default {
_that = this
},
methods: {
changeType() {
console.log('this.personalForm.type', this.personalForm.type)
if (this.personalForm.type === 1) {
this.repo = true
this.personalForm.repositoryId = ''
this.personalForm.itemName = ''
} else {
this.repo = false
}
},
changeTime() {
if (this.personalForm.effectiveTime === 1) {
this.addpro = false
} else {
this.addpro = true
this.personalForm.beginTime = ''
this.personalForm.endTime = ''
}
},
checkStock(row) {
console.log('this.personalForm.saleRepositoryId', this.personalForm.saleRepositoryId)
if (this.personalForm.saleRepositoryId === null || this.personalForm.saleRepositoryId === undefined || this.personalForm.saleRepositoryId === '') {
@ -526,8 +484,17 @@ export default {
this.repositorycontrol = true
},
repositoryname(val) {
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.id
console.log(val)
const name = []
const id = []
for (const i in val) {
name.push(val[i].repositoryName)
id.push(val[i].id)
}
console.log(name, id)
this.personalForm.itemName = name.join(',')
this.personalForm.repositoryId = id.join(',')
console.log(this.personalForm)
},
// focus
handlechooseAccept() {
@ -952,16 +919,22 @@ export default {
//
restAllForm() {
this.personalForm = {
effectiveTime: 1,
type: 1,
isRepeat: 2,
createPersonId: this.$store.getters.userId,
countryId: this.$store.getters.countryId,
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
isDiscount: 1,
isToday: 1,
stat: 1,
applicableWeek: [],
effectiveType: [],
requireMoney: 0
}
this.addpro = false
this.repo = true
this.personalForm.repositoryId = ''
this.personalForm.itemName = ''
},
//
deepClone(obj) {
@ -973,94 +946,50 @@ export default {
handlesave() {
this.$refs.personalForm.validate((valid) => {
if (valid) {
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
let applicableProductId = ''
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
console.log('id', elem.id)
if (elem.id !== null || elem.id !== '' || elem.id !== undefined) {
applicableProductId = applicableProductId + ',' + elem.id
if (this.personalForm.type === 2) {
if (this.personalForm.repositoryId === undefined || this.personalForm.repositoryId === null || this.personalForm.repositoryId === '') {
this.$notify.error({
title: '错误',
message: '请选择门店',
offset: 100
})
return false
}
}
if (this.personalForm.effectiveType === undefined || this.personalForm.effectiveType === null || this.personalForm.effectiveType === '' || this.personalForm.effectiveType.length === 0) {
this.$notify.error({
title: '错误',
message: '请选择适用类别',
offset: 100
})
return false
}
if (this.personalForm.effectiveTime === 1) {
if (this.personalForm.beginTime === undefined || this.personalForm.beginTime === null || this.personalForm.beginTime === '') {
this.$notify.error({
title: '错误',
message: '请选择开始时间',
offset: 100
})
return false
}
if (this.personalForm.endTime === undefined || this.personalForm.endTime === null || this.personalForm.endTime === '') {
this.$notify.error({
title: '错误',
message: '请选择截止时间',
offset: 100
})
return false
}
if (this.personalForm.endTime <= this.personalForm.beginTime) {
this.$notify.error({
title: '错误',
message: '截止时间需要大于开始时间',
offset: 100
})
return false
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate
}
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
return elem
})
console.log('resulet', applicableProductId)
if (applicableProductId !== '') {
applicableProductId = applicableProductId + ','
}
this.personalForm.applicableProductId = applicableProductId
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
@ -1070,6 +999,8 @@ export default {
delete Data[key]
}
}
this.personalForm.effectiveType = this.personalForm.effectiveType.join(',')
console.log('this.personalForm.effectiveType', this.personalForm.effectiveType)
const parms = JSON.stringify(Data)
createCoupon(parms).then(res => {
console.log(res)
@ -1081,7 +1012,6 @@ export default {
offset: 100
})
this.restAllForm()
this.$refs.editable.clear()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({

View file

@ -3,20 +3,25 @@
<el-card class="box-card" style="margin-top: 10px;height: 60px" shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" label-width="100px" style="margin-top: -9px">
<el-col :span="5">
<el-col :span="4">
<el-form-item :label="$t('updates.yhjmc')" label-width="100px">
<el-input v-model="getemplist.name" style="width: 160px;" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-left: 10%">
<el-form-item :label="$t('updates.stat')" label-width="100px">
<el-select v-model="getemplist.stat" :value="getemplist.receiptStat" clearable style="width: 160px;float: left;margin-right: 20px">
<el-option :label="$t('updates.qy')" value="1"/>
<el-option value="2" label="未启用"/>
<el-col :span="4" style="margin-left: 10%">
<el-form-item :label="$t('Coupon.money')" label-width="100px">
<el-input-number v-model="getemplist.money" :precision="2" :controls="false" :step="0.1" :min="0" style="width: 160px"/>
</el-form-item>
</el-col>
<el-col :span="4" style="margin-left: 10%">
<el-form-item :label="$t('collectAndPay.type')" label-width="100px">
<el-select v-model="getemplist.type" :value="getemplist.receiptStat" clearable style="width: 160px;float: left;margin-right: 20px">
<el-option value="1" label="全部门店"/>
<el-option value="2" label="部分门店"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20%">
<el-col :span="3" style="margin-left: 8%">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
@ -69,6 +74,21 @@
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('collectAndPay.type')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.type | statFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('collectAndPay.number')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.money')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.money }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.beginTime')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.beginTime }}</span>
@ -79,32 +99,22 @@
<span>{{ scope.row.endTime }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.couponStat')" :resizable="false" align="center" min-width="150">
<el-table-column :label="$t('collectAndPay.send')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.couponStat }}</span>
<span>{{ scope.row.number - scope.row.leftNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.received')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<el-table-column :label="$t('collectAndPay.left')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.received }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.used')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.used }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Coupon.stat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stat | statFilter }}</span>
<span>{{ scope.row.leftNumber }}</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 :title="$t('updates.xg')" type="primary" size="mini" icon="el-icon-edit" circle @click="handleEdit(scope.row)"/>
<el-button v-permission="['215-216-217-3']" :title="$t('updates.xg')" type="primary" size="mini" icon="el-icon-edit" circle @click="handleEdit(scope.row)"/>
<el-button v-show="isReview(scope.row)" title="禁用" type="warning" size="mini" icon="el-icon-close" circle @click="handleReview(scope.row)"/>
<el-button v-show="isReview2(scope.row)" title="启用" type="warning" size="mini" icon="el-icon-check" circle @click="handleReview2(scope.row)"/>
<el-button :title="$t('updates.sc')" size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
<el-button v-permission="['215-216-217-2']" v-show="scope.row.number - scope.row.leftNumber === 0" :title="$t('updates.sc')" size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -142,8 +152,8 @@ export default {
filters: {
statFilter(status) {
const statusMap = {
1: '启用',
2: '未启用'
1: '全部门店',
2: '部分门店'
}
return statusMap[status]
},

View file

@ -4,15 +4,9 @@
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
<button v-print="'#printTest'" class="print" style="font-size: 13px;background: white;">{{ $t('updates.print') }}</button>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item class="print2" label="优惠券编号" style="width: 100%;display: none">
{{ personalForm.id }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.name')" style="width: 100%;">
<span>{{ personalForm.name }}</span>
@ -24,8 +18,33 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.requireMoney')" prop="customerType" style="width: 100%;">
<span>{{ personalForm.requireMoney }}</span>
<el-form-item :label="$t('collectAndPay.number')" prop="customerType" style="width: 100%;">
<span>{{ personalForm.number }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.type')" style="width: 100%;">
<span>{{ personalForm.type | statFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Storagemove.repostiryName')" prop="outType" style="width: 100%;">
<span>{{ personalForm.repositoryName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.effectiveType')" prop="salePersonId" style="width: 100%;">
<span>{{ personalForm.effectiveTypeName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.isRepeat')" prop="salePersonId" style="width: 100%;">
<span>{{ personalForm.isRepeat | isTodayFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.effectiveTime')" style="width: 100%;">
<span>{{ personalForm.effectiveTime | isTodayFilter2 }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
@ -38,41 +57,6 @@
<span>{{ personalForm.endTime }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.beginClock')" style="width: 100%;">
<span>{{ personalForm.beginClock }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.endClock')" prop="outType" style="width: 100%;">
<span>{{ personalForm.endClock }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.isDiscount')" prop="salePersonId" style="width: 100%;">
<span>{{ personalForm.isDiscount | isDiscountFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.stat')" prop="salePersonId" style="width: 100%;">
<span>{{ personalForm.isDiscount | statFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.isToday')" style="width: 100%;">
<span>{{ personalForm.isToday | isTodayFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.applicableWeek')" style="width: 100%;">
<span>{{ personalForm.applicableWeek }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.content')" style="width: 100%;">
<span>{{ personalForm.content }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
@ -115,6 +99,13 @@ export default {
}
return statusMap[status]
},
isTodayFilter2(status) {
const statusMap = {
1: '限制时间',
2: '不限制时间'
}
return statusMap[status]
},
isTodayFilter(status) {
const statusMap = {
1: 'YES',
@ -124,8 +115,8 @@ export default {
},
statFilter(status) {
const statusMap = {
1: '启用',
2: '未启用'
1: '全部门店',
2: '部分门店'
}
return statusMap[status]
},

View file

@ -6,6 +6,11 @@
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="135px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('Coupon.name')" prop="name" style="width: 100%;">
<el-input v-model="personalForm.name" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.name')" prop="name" style="width: 100%;">
<el-input v-model="personalForm.name" style="margin-left: 18px;width: 200px" clearable/>
@ -17,13 +22,55 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.requireMoney')" prop="requireMoney" style="width: 100%;">
<el-input-number v-model="personalForm.requireMoney" :precision="2" :controls="false" :step="0.1" :min="0" style="margin-left: 11px;width: 200px;text-align: left"/>
<el-form-item :label="$t('collectAndPay.number')" prop="number" style="width: 100%;">
<el-input-number v-model="personalForm.number" :controls="false" :step="0.1" :min="0" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.beginTime')" prop="beginTime" style="width: 100%;">
<el-form-item :label="$t('collectAndPay.type')" style="width: 100%;">
<el-radio-group v-model="personalForm.type" style="margin-left: 18px;width: 210px" @change="changeType">
<el-radio :label="1" style="width: 100px">全部门店</el-radio>
<el-radio :label="2">部分门店</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Storagemove.repostiryName')" style="width: 100%;">
<el-input :disabled="repo" v-model="personalForm.itemName" :value="personalForm.itemName" placeholder="请选择仓库" filterable clearable style="margin-left: 18px;width: 200px;" @focus="handlechooseRep"/>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname($event)"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.effectiveType')" prop="effectiveType" style="width: 100%;">
<el-select v-model="personalForm.effectiveType" multiple collapse-tags style="margin-left: 18px;width: 200px">
<el-option value="1" label="分期付款"/>
<el-option value="2" label="购车"/>
<el-option value="3" label="配件"/>
<el-option value="4" label="电池"/>
<el-option value="5" label="全部适用"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.isRepeat')" prop="isDiscount" style="width: 100%;">
<el-radio-group v-model="personalForm.isRepeat" style="margin-left: 18px;width: 210px">
<el-radio :label="1" style="width: 100px">Yes</el-radio>
<el-radio :label="2">No</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('collectAndPay.effectiveTime')" style="width: 100%;">
<el-radio-group v-model="personalForm.effectiveTime" style="margin-left: 18px;width: 225px" @change="changeTime">
<el-radio :label="1" style="width: 100px">限制时间</el-radio>
<el-radio :label="2">不限制时间</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.beginTime')" style="width: 100%;">
<el-date-picker
:disabled="addpro"
v-model="personalForm.beginTime"
:picker-options="pickerOptions1"
type="date"
@ -32,8 +79,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.endTime')" prop="endTime" style="width: 100%;">
<el-form-item :label="$t('Coupon.endTime')" style="width: 100%;">
<el-date-picker
:disabled="addpro"
v-model="personalForm.endTime"
:picker-options="pickerOptions1"
type="date"
@ -41,89 +89,10 @@
style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.beginClock')" style="width: 100%;">
<el-input-number v-model="personalForm.beginClock" :precision="0" :controls="false" :step="0.1" :min="0" :max="12" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.endClock')" style="width: 100%;">
<el-input-number v-model="personalForm.endClock" :precision="0" :controls="false" :step="0.1" :min="0" :max="12" style="margin-left: 11px;width: 200px;text-align: left"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.isDiscount')" prop="isDiscount" style="width: 100%;">
<el-radio-group v-model="personalForm.isDiscount" style="margin-left: 18px;width: 200px">
<el-radio :label="1" style="width: 100px">YES</el-radio>
<el-radio :label="2">NO</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.isToday')" prop="isToday" style="width: 100%;">
<el-radio-group v-model="personalForm.isToday" style="margin-left: 18px;width: 200px">
<el-radio :label="1" style="width: 100px">YES</el-radio>
<el-radio :label="2">NO</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.applicableWeek')" style="width: 100%;">
<el-select v-model="personalForm.applicableWeek" multiple collapse-tags style="margin-left: 18px;width: 200px">
<el-option value="1" label="周一"/>
<el-option value="2" label="周二"/>
<el-option value="3" label="周三"/>
<el-option value="4" label="周四"/>
<el-option value="5" label="周五"/>
<el-option value="12" label="周六"/>
<el-option value="7" label="周日"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('Coupon.content')" style="width: 100%;">
<el-input v-model="personalForm.content" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >{{ $t('updates.ckdmx') }}</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="Isproduct" @click="handleAddproduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button :disabled="IsSourceNumber" style="width: 130px" @click="handleAddSource">{{ $t('updates.cydzxz') }}</el-button>
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrder="saleOrder"/>
<my-presale :presalecontrol.sync="presalecontrol" @advanceOrderDetail="advanceOrderDetail" @advanceData="advanceData"/>
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list2"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
:summary-method="getSummaries"
class="click-table1"
stripe
border
size="medium"
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" fixed="left" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="code" fixed="left" align="center" />
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" fixed="left" align="center" />
<el-editable-column :label="$t('updates.wpfl')" prop="category" align="center" />
<el-editable-column :label="$t('updates.jbdw')" prop="purchaseMeasurement" align="center" />
<el-editable-column :label="$t('updates.ggxh')" prop="productType" align="center" />
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" />
</el-editable>
</div>
</el-card>
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
@ -168,6 +137,8 @@ export default {
},
data() {
return {
addpro: false,
repo: true,
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < new Date().getTime() - 8.64e7
@ -253,6 +224,9 @@ export default {
control: false,
//
personalrules: {
number: [
{ required: true, message: '请输入发行量', trigger: 'change' }
],
name: [
{ required: true, message: '请输入优惠券名称', trigger: 'change' }
],
@ -281,27 +255,45 @@ export default {
},
editdata() {
this.personalForm = this.editdata
this.planPersonId = this.personalForm.planPersonName
this.stockPersonId = this.personalForm.stockPersonName
this.list2 = this.personalForm.productVos
this.list3 = this.personalForm.saleOutGiftVos
this.customerId = this.personalForm.customerName
this.salePersonId = this.personalForm.salePersonName
this.transferPersonId = this.personalForm.transferPersonName
this.saleRepositoryId = this.personalForm.saleRepositoryName
this.outPersonId = this.personalForm.outPersonName
this.updatebatch()
this.personalForm.effectiveType = this.personalForm.effectiveType.split(',')
this.personalForm.itemName = this.personalForm.repositoryName
console.log('this.personalForm.effectiveType', this.personalForm.effectiveType)
if (this.personalForm.type === 1) {
this.repo = true
this.personalForm.repositoryId = ''
this.personalForm.itemName = ''
} else {
this.repo = false
}
}
},
created() {
this.getTypes()
this.getdatatime()
this.chooseSourceType()
},
beforeCreate() {
_that = this
},
methods: {
changeType() {
console.log('this.personalForm.type', this.personalForm.type)
if (this.personalForm.type === 1) {
this.repo = true
this.personalForm.repositoryId = ''
this.personalForm.itemName = ''
} else {
this.repo = false
}
},
changeTime() {
if (this.personalForm.effectiveTime === 1) {
this.addpro = false
} else {
this.addpro = true
this.personalForm.beginTime = ''
this.personalForm.endTime = ''
}
},
//
change() {
this.$forceUpdate()
@ -344,29 +336,22 @@ export default {
}
})
},
chooseSourceType(val) {
console.log(val)
if (val === '5' || val === undefined) {
this.Isproduct = false
this.IsSourceNumber = true
if (this.$refs.editable.getRecords().length !== 0 && this.$refs.editable.getRecords() !== undefined && this.$refs.editable.getRecords() !== null) {
this.$refs.editable.clear()
}
} else {
this.Isproduct = true
this.IsSourceNumber = false
if (this.$refs.editable.getRecords().length !== 0 && this.$refs.editable.getRecords() !== undefined && this.$refs.editable.getRecords() !== null) {
this.$refs.editable.clear()
}
}
},
// focus
handlechooseRep() {
this.repositorycontrol = true
},
repositoryname(val) {
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.id
console.log(val)
const name = []
const id = []
for (const i in val) {
name.push(val[i].repositoryName)
id.push(val[i].id)
}
console.log(name, id)
this.personalForm.itemName = name.join(',')
this.personalForm.repositoryId = id.join(',')
console.log(this.personalForm)
},
// focus
handlechooseAccept() {
@ -573,24 +558,6 @@ export default {
this.opportunitycontrol = true
}
},
//
saleOrderDetail(val) {
console.log(val)
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
saleOrder(val) {
if (val.customerType !== null && val.customerType !== undefined && val.customerType !== '') {
this.personalForm.customerType = String(val.customerType)
@ -608,24 +575,6 @@ export default {
this.saleRepositoryId = val.saleRepositoryName
this.personalForm.address = val.transAddress
},
//
advanceOrderDetail(val) {
console.log(val)
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
advanceData(val) {
this.personalForm.customerType = '2'
this.personalForm.customerId = val.customerId
@ -640,24 +589,6 @@ export default {
this.saleRepositoryId = val.saleRepositoryName
this.personalForm.address = val.address
},
//
opportunityDetail(val) {
console.log(val)
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
opportunity(val) {
if (val.customerType !== null && val.customerType !== undefined && val.customerType !== '') {
this.personalForm.customerType = String(val.customerType)
@ -674,42 +605,10 @@ export default {
handleAddproduct() {
this.control = true
},
productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
},
//
handleAddGift() {
this.giftcontrol = true
},
gift(val) {
const nowlistdata = this.$refs.editable2.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: '错误',
message: '物品已添加',
offset: 100
})
return false
}
}
this.$refs.editable2.insert(val[i])
}
},
deleteChange(val) {
this.choosedata = val
},
@ -774,105 +673,51 @@ export default {
handleEditok() {
this.$refs.personalForm.validate((valid) => {
if (valid) {
this.personalForm.repositoryId = this.$store.getters.repositoryId
this.personalForm.regionId = this.$store.getters.regionId
this.personalForm.createPersonId = this.$store.getters.userId
this.personalForm.countryId = this.$store.getters.countryId
this.personalForm.modifyPersonId = this.$store.getters.userId
const EnterDetail = this.$refs.editable.getRecords()
if (EnterDetail.length === 0) {
if (this.personalForm.type === 2) {
if (this.personalForm.repositoryId === undefined || this.personalForm.repositoryId === null || this.personalForm.repositoryId === '') {
this.$notify.error({
title: '错误',
message: '请选择门店',
offset: 100
})
return false
}
}
if (this.personalForm.effectiveType === undefined || this.personalForm.effectiveType === null || this.personalForm.effectiveType === '' || this.personalForm.effectiveType.length === 0) {
this.$notify.error({
title: '错误',
message: '明细表不能为空',
message: '请选择适用类别',
offset: 100
})
return false
}
let applicableProductId = ''
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.id !== null || elem.id !== '' || elem.id !== undefined) {
applicableProductId = applicableProductId + ',' + elem.id
if (this.personalForm.effectiveTime === 1) {
if (this.personalForm.beginTime === undefined || this.personalForm.beginTime === null || this.personalForm.beginTime === '') {
this.$notify.error({
title: '错误',
message: '请选择开始时间',
offset: 100
})
return false
}
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
if (this.personalForm.endTime === undefined || this.personalForm.endTime === null || this.personalForm.endTime === '') {
this.$notify.error({
title: '错误',
message: '请选择截止时间',
offset: 100
})
return false
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
if (this.personalForm.endTime <= this.personalForm.beginTime) {
this.$notify.error({
title: '错误',
message: '截止时间需要大于开始时间',
offset: 100
})
return false
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
delete elem.quantity
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
delete elem.salePrice
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
delete elem.costPrice
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
delete elem.costMoney
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
delete elem.taxRate
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
delete elem.taxMoney
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
delete elem.money
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
delete elem.includeTaxCostMoney
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
delete elem.discountRate
}
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
delete elem.discountMoney
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
return elem
})
if (applicableProductId !== '') {
applicableProductId = applicableProductId + ','
}
this.personalForm.applicableProductId = applicableProductId
this.personalForm.effectiveType = this.personalForm.effectiveType.join(',')
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
@ -893,7 +738,6 @@ export default {
offset: 100
})
this.$emit('rest', true)
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.editVisible = false
@ -938,7 +782,7 @@ export default {
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
height: 920px;
}
.el-col-12{
width: 49%;

View file

@ -37,18 +37,24 @@
<!-- 搜索按钮 -->
<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>
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
:row-key="getRowKeys"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
@current-change="handleCurrentChange"
@selection-change="handleSelectionChange">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"/>
<el-table-column :label="$t('Repository.id')" :resizable="false" prop="id" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
@ -91,6 +97,7 @@ import { regionlist, getcountrylist } from '@/api/public'
import { searchRepCategory, searchRepository2 } from '@/api/Repository'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
// eslint-disable-next-line no-unused-vars
var _that
export default {
directives: { waves },
@ -119,10 +126,17 @@ export default {
},
data() {
return {
//
repositoryVisible: this.repositorycontrol,
getRowKeys(row) {
return row.id
},
select_orderId: [],
select_order_number: [],
//
moreaction: '',
//
choosedata: '',
//
repositoryVisible: this.repositorycontrol,
//
types: [],
//
@ -175,6 +189,19 @@ export default {
_that = this
},
methods: {
//
handleSelectionChange(rows) {
this.moreaction = rows
this.select_order_number = this.moreaction.length
this.select_orderId = []
if (rows) {
rows.forEach(row => {
if (row) {
this.select_orderId.push(row.id)
}
})
}
},
getlist() {
//
getcountrylist().then(res => {
@ -217,6 +244,12 @@ export default {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.repositoryVisible = true
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
@ -236,7 +269,7 @@ export default {
},
//
handleConfirm() {
this.$emit('repositoryname', this.choosedata)
this.$emit('repositoryname', this.moreaction)
this.repositoryVisible = false
},
//