mirror of
https://github.com/shawncai/ERP.git
synced 2025-01-01 04:51:48 +08:00
Merge branch 'master' of https://github.com/shawncai/ERP
This commit is contained in:
commit
cca5bd3b94
17 changed files with 2014 additions and 489 deletions
|
@ -95,4 +95,4 @@ module.exports = new Promise((resolve, reject) => {
|
|||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 添加销售出库单
|
||||
export function createsaleOut(query, query2, query3, query4) {
|
||||
export function createsaleOut(query, query2, query3, query4, query5) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('Json', query) // 你要传给后台的参数值 key/value
|
||||
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
|
||||
|
@ -12,6 +12,7 @@ export function createsaleOut(query, query2, query3, query4) {
|
|||
if (query4.regionId !== '' && query4.regionId !== null && query4.regionId !== undefined) {
|
||||
params.append('regionId', query4.regionId) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
params.append('receivableMoney2', query5) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/saleOut/create',
|
||||
method: 'post',
|
||||
|
@ -89,11 +90,12 @@ export function searchsaleOut(query) {
|
|||
}
|
||||
|
||||
// 修改销售出库单
|
||||
export function updatesaleOut(query, query2, query3) {
|
||||
export function updatesaleOut(query, query2, query3, query4) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('Json', query) // 你要传给后台的参数值 key/value
|
||||
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
|
||||
params.append('giftJson', query3) // 你要传给后台的参数值 key/value
|
||||
params.append('receivableMoney2', query4) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/saleOut/update',
|
||||
method: 'post',
|
||||
|
|
|
@ -98,3 +98,41 @@ export function updatesaleplan2(query) {
|
|||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 分类属性列表
|
||||
export function searchEmpCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('iseffective', 1) // 你要传给后台的参数值 key/value
|
||||
params.append('type', 2) // 你要传给后台的参数值 key/value
|
||||
// if (query.type !== '' && query.type !== null && query.type !== undefined) {
|
||||
// params.append('type', query.type)
|
||||
// }
|
||||
params.append('pagenum', 1) // 你要传给后台的参数值 key/value
|
||||
params.append('pagesize', 999999) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/product/searchProCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// 销售计划详情
|
||||
export function saleplanlistDetail(query) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('planId', query) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/saleplan/planDetail',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 销售计划追踪
|
||||
export function updatetrace(query2) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('salePlanDetailJson', query2) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/saleplan/updateDetail',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2106,6 +2106,7 @@ export default {
|
|||
SalePlan: {
|
||||
title: 'plan subject',
|
||||
planType: 'plan type',
|
||||
planCategory: 'planCategory',
|
||||
planDate: 'plan date',
|
||||
beginTime: 'start time',
|
||||
endTime: 'end time',
|
||||
|
@ -2115,9 +2116,21 @@ export default {
|
|||
targetMoney: 'planned amount',
|
||||
regionId: 'area',
|
||||
repositoryid: 'branch',
|
||||
regOrRep: 'region/repository',
|
||||
week: 'week',
|
||||
month: 'month',
|
||||
quarter: 'season'
|
||||
quarter: 'season',
|
||||
planTarget: 'planTarget',
|
||||
address: 'address',
|
||||
typeId: 'typeId',
|
||||
quantity: 'quantity',
|
||||
money: 'money',
|
||||
actualQuantity: 'actualQuantity',
|
||||
actualMoney: 'actualMoney',
|
||||
xzmd: 'Enter',
|
||||
planNum: 'No.',
|
||||
trackingStatistics: 'trackingStats',
|
||||
progress: 'progress'
|
||||
},
|
||||
SaleOpportunity: {
|
||||
title: 'subject',
|
||||
|
@ -3039,6 +3052,7 @@ export default {
|
|||
qsrmm: 'please input password'
|
||||
},
|
||||
updates: {
|
||||
gz: 'trace',
|
||||
ckmx: 'Out of stock detail',
|
||||
shmx: 'recovery detail',
|
||||
zxsyj: 'total sales amount',
|
||||
|
|
|
@ -2133,6 +2133,7 @@ export default {
|
|||
SalePlan: {
|
||||
title: '计划主题',
|
||||
planType: '计划类型',
|
||||
planCategory: '计划类别',
|
||||
planDate: '计划日期',
|
||||
beginTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
|
@ -2142,9 +2143,21 @@ export default {
|
|||
targetMoney: '计划额',
|
||||
regionId: '区域',
|
||||
repositoryid: '门店',
|
||||
regOrRep: '区域/门店',
|
||||
week: '周',
|
||||
month: '月',
|
||||
quarter: '季度'
|
||||
quarter: '季度',
|
||||
planTarget: '销售目标',
|
||||
address: '地点名称',
|
||||
typeId: '商品类型',
|
||||
quantity: '数量',
|
||||
money: '金额',
|
||||
actualQuantity: '实际数量',
|
||||
actualMoney: '实际金额',
|
||||
xzmd: '请输入内容',
|
||||
planNum: '计划编号',
|
||||
trackingStatistics: '跟踪统计',
|
||||
progress: '进度'
|
||||
},
|
||||
SaleOpportunity: {
|
||||
title: '机会主题',
|
||||
|
@ -3072,6 +3085,7 @@ export default {
|
|||
qsrmm: '请输入密码'
|
||||
},
|
||||
updates: {
|
||||
gz: '跟踪',
|
||||
wly: '无来源',
|
||||
ckmx: '出库明细',
|
||||
shmx: '收回明细',
|
||||
|
@ -3966,7 +3980,9 @@ export default {
|
|||
actualUseMoney: '实际抵扣金额',
|
||||
leftMoney: '剩余金额',
|
||||
number2: '数量',
|
||||
ffxx: '发放信息'
|
||||
ffxx: '发放信息',
|
||||
couponNumbers: '优惠券码',
|
||||
couponSupport2: '优惠劵抵用金额'
|
||||
},
|
||||
collectAndPayDetail: {
|
||||
name: '名称',
|
||||
|
|
|
@ -64,9 +64,15 @@
|
|||
<el-input v-model="personalForm.receiptAccountNumber" style="margin-left: 18px;width: 200px" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm.couponSupports" :key="index" :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
<el-form-item :label="$t('collectAndPay.couponSupport2')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" disabled style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
@ -190,6 +196,7 @@
|
|||
|
||||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { createreceipt } from '@/api/Receipt'
|
||||
import { agentCollectList } from '@/api/public'
|
||||
import MyEmp from './components/MyEmp'
|
||||
|
@ -287,6 +294,11 @@ export default {
|
|||
payModes: [],
|
||||
// 销售订单信息数据
|
||||
personalForm: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
],
|
||||
createPersonId: this.$store.getters.userId,
|
||||
countryId: this.$store.getters.countryId,
|
||||
repositoryId: this.$store.getters.repositoryId,
|
||||
|
@ -296,7 +308,8 @@ export default {
|
|||
receiptMoney: 0,
|
||||
deductionMoney: 0,
|
||||
totalLackMoney: 0,
|
||||
couponSupport: 0
|
||||
couponSupport: 0,
|
||||
couponMoney: 0
|
||||
},
|
||||
allpenalty: 0,
|
||||
// 商品信息
|
||||
|
@ -351,7 +364,7 @@ export default {
|
|||
num2 += this.switchmoney[i].penalty
|
||||
}
|
||||
console.log('num=====', num)
|
||||
this.personalForm.receiptMoney = num - this.personalForm.couponSupport
|
||||
this.personalForm.receiptMoney = num
|
||||
this.allpenalty = num2
|
||||
},
|
||||
deep: true,
|
||||
|
@ -388,6 +401,32 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
if (res.data.data.content > this.personalForm.receiptMoney) {
|
||||
this.personalForm.couponSupport = this.personalForm.receiptMoney
|
||||
} else {
|
||||
this.personalForm.couponSupport = res.data.data.content
|
||||
}
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
},
|
||||
handlechooserepo() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
|
@ -1027,6 +1066,17 @@ export default {
|
|||
return false
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
|
||||
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
|
|
@ -38,6 +38,16 @@
|
|||
<span>{{ personalForm.receiptMoney }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<span>{{ personalForm.couponSupport }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('collectAndPay.couponNumbers')" style="width: 100%;">
|
||||
<span>{{ personalForm.couponNumbers }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('payment.payMode')" prop="totalMoney" style="width: 100%;">
|
||||
<span>{{ personalForm.payModeName }}</span>
|
||||
|
|
|
@ -62,9 +62,15 @@
|
|||
<el-input v-model="personalForm.receiptAccountNumber" style="margin-left: 18px;width: 200px" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm2.couponSupports" :key="index" :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm2.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
<el-form-item :label="$t('collectAndPay.couponSupport2')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" disabled style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -73,7 +79,7 @@
|
|||
</el-form-item>
|
||||
<my-emp :control.sync="stockControl" @stockName="stockName"/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('Receipt.receiptRepositoryId')" prop="receiptRepositoryId" style="width: 100%;">
|
||||
<el-input v-model="receiptRepositoryId" style="margin-left: 18px;width: 200px" @focus="handlechooserepo"/>
|
||||
</el-form-item>
|
||||
|
@ -187,6 +193,7 @@
|
|||
|
||||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { updatereceipt2 } from '@/api/Receipt'
|
||||
import { agentCollectList } from '@/api/public'
|
||||
import { installmentlist } from '@/api/InstallmentList'
|
||||
|
@ -256,6 +263,13 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
personalForm2: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
repositorycontrol: false,
|
||||
// 收款门店
|
||||
receiptRepositoryId: '',
|
||||
|
@ -346,6 +360,30 @@ export default {
|
|||
editdata() {
|
||||
this.getways()
|
||||
this.personalForm = this.editdata
|
||||
if (this.personalForm.couponNumbers === '' || this.personalForm.couponNumbers === null || this.personalForm.couponNumbers === undefined) {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
} else {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
const coupon = []
|
||||
var b = this.personalForm.couponNumbers.split(',')
|
||||
console.log('b', b)
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
const param = {}
|
||||
param.couponSupport = b[i]
|
||||
coupon.push(param)
|
||||
}
|
||||
console.log('coupon', coupon)
|
||||
this.personalForm2.couponSupports = coupon
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
}
|
||||
console.log('this.personalForm', this.personalForm)
|
||||
this.customerId = this.personalForm.customerName
|
||||
this.receiptPersonId = this.personalForm.receiptPersonName
|
||||
|
@ -363,7 +401,7 @@ export default {
|
|||
num += this.switchmoney[i].thisMoney
|
||||
}
|
||||
console.log('num=====', num)
|
||||
this.personalForm.receiptMoney = num - this.personalForm.couponSupport
|
||||
this.personalForm.receiptMoney = num
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
@ -375,6 +413,32 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm2.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
if (res.data.data.content > this.personalForm.receiptMoney) {
|
||||
this.personalForm.couponSupport = this.personalForm.receiptMoney
|
||||
} else {
|
||||
this.personalForm.couponSupport = res.data.data.content
|
||||
}
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm2.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
},
|
||||
handlechooserepo() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
|
@ -1044,6 +1108,17 @@ export default {
|
|||
return false
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
|
||||
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
|
|
@ -1103,29 +1103,47 @@ export default {
|
|||
console.log('this.heji3', this.heji3)
|
||||
console.log('this.heji4', this.heji4)
|
||||
console.log('this.personalForm.couponMoney', this.personalForm.couponMoney)
|
||||
const needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// const mon = this.personalForm.receivableMoney - this.personalForm.couponMoney
|
||||
// this.$set(this.personalForm, 'receivableMoney', mon)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.$store.getters.newsaleoutdata.firstMoney) {
|
||||
console.log('123', 123)
|
||||
this.personalForm.receivableMoney = this.$store.getters.newsaleoutdata.firstMoney
|
||||
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
|
||||
console.log('是否是销售合同带入过来')
|
||||
console.log('234', 234)
|
||||
this.personalForm.receivableMoney = this.receivableMoney
|
||||
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.receivableMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else {
|
||||
console.log('456', 456)
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
}
|
||||
|
||||
// 减去优惠券
|
||||
// console.log('this.personalForm.couponMoney', this.personalForm.couponMoney)
|
||||
// console.log('this.personalForm.receivableMoney', this.personalForm.receivableMoney)
|
||||
// const mon = this.personalForm.receivableMoney - this.personalForm.couponMoney
|
||||
// this.$set(this.personalForm, 'receivableMoney', mon)
|
||||
// console.log('this.personalForm.receivableMoney', this.personalForm.receivableMoney)
|
||||
|
||||
// if (this.personalForm.pointSupport && this.personalForm.couponSupport && this.personalForm.ridMoney && this.personalForm.ridBikeMoney && this.personalForm.advanceMoney) {
|
||||
// console.log(198283774747)
|
||||
// return (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
|
@ -2171,6 +2189,17 @@ export default {
|
|||
handlesave() {
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
if (this.personalForm.saleType === '2') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '无来源时销售类别不能是分期',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
|
||||
// 整车出库时相关编码必填
|
||||
let m = 1
|
||||
|
@ -2359,6 +2388,16 @@ export default {
|
|||
})
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const parms3 = JSON.stringify(EnterDetail2)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
|
||||
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -2369,7 +2408,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm).then(res => {
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm, this.personalForm.receivableMoney2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm.couponSupports" :key="index" :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 100px" type="number"/>
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -548,6 +548,7 @@
|
|||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { customerlist2 } from '@/api/Customer'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { getPackage } from '@/api/Package'
|
||||
import { getAllBatch, vehicleInfo, getQuantity2 } from '@/api/public'
|
||||
import { createsaleOut } from '@/api/SaleOut'
|
||||
|
@ -765,7 +766,8 @@ export default {
|
|||
ridBikeMoney: 0,
|
||||
advanceMoney: 0,
|
||||
receiveMoney: 0,
|
||||
isInvoice: 1
|
||||
isInvoice: 1,
|
||||
couponMoney: 0
|
||||
},
|
||||
// 销售订单规则数据
|
||||
personalrules: {
|
||||
|
@ -898,6 +900,24 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.personalForm.couponMoney = res.data.data.content
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
this.getReceivableMoney(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm.couponSupports.push({
|
||||
couponSupport: 0
|
||||
|
@ -1083,14 +1103,46 @@ export default {
|
|||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') {
|
||||
console.log('this.heji3', this.heji3)
|
||||
console.log('this.heji4', this.heji4)
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('this.personalForm.couponMoney', this.personalForm.couponMoney)
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.$store.getters.newsaleoutdata.firstMoney) {
|
||||
this.personalForm.receivableMoney = this.$store.getters.newsaleoutdata.firstMoney
|
||||
console.log('123', 123)
|
||||
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
|
||||
console.log('是否是销售合同带入过来')
|
||||
this.personalForm.receivableMoney = this.receivableMoney
|
||||
console.log('234', 234)
|
||||
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.receivableMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else {
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('456', 456)
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
}
|
||||
|
||||
// if (this.personalForm.pointSupport && this.personalForm.couponSupport && this.personalForm.ridMoney && this.personalForm.ridBikeMoney && this.personalForm.advanceMoney) {
|
||||
|
@ -2333,6 +2385,16 @@ export default {
|
|||
// })
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const parms3 = ''
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
|
||||
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -2343,7 +2405,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm).then(res => {
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm, this.personalForm.receivableMoney2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
|
|
|
@ -113,6 +113,11 @@
|
|||
<span>{{ personalForm.couponSupport }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('collectAndPay.couponNumbers')" style="width: 100%;">
|
||||
<span>{{ personalForm.couponNumbers }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.ridMoney')" style="width: 100%;">
|
||||
<span>{{ personalForm.ridMoney }}</span>
|
||||
|
|
|
@ -153,11 +153,6 @@
|
|||
<el-input v-model="personalForm.pointSupport" :disabled="personalForm.customerType === '1'" style="margin-left: 18px;width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.ridMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.ridMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
|
@ -176,6 +171,12 @@
|
|||
{{ personalForm.receivableMoney }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm2.couponSupports" :key="index" :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm2.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.isInvoice')" style="width: 100%;">
|
||||
<el-radio-group v-model="personalForm.isInvoice" style="margin-left: 18px;width: 200px">
|
||||
|
@ -483,6 +484,7 @@
|
|||
|
||||
<script>
|
||||
import { customerlist2 } from '@/api/Customer'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { getPackage } from '@/api/Package'
|
||||
import { getAllBatch, vehicleInfo } from '@/api/public'
|
||||
import { updatesaleOut } from '@/api/SaleOut'
|
||||
|
@ -580,6 +582,13 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
personalForm2: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
|
@ -726,6 +735,32 @@ export default {
|
|||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.personalForm.couponMoney = this.personalForm.couponSupport
|
||||
console.log('this.personalForm.receivableMoney', this.personalForm.receivableMoney)
|
||||
if (this.personalForm.couponNumbers === '' || this.personalForm.couponNumbers === null || this.personalForm.couponNumbers === undefined) {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
} else {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
const coupon = []
|
||||
var b = this.personalForm.couponNumbers.split(',')
|
||||
console.log('b', b)
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
const param = {}
|
||||
param.couponSupport = b[i]
|
||||
coupon.push(param)
|
||||
}
|
||||
console.log('coupon', coupon)
|
||||
this.personalForm2.couponSupports = coupon
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
}
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
this.Isproduct = false
|
||||
this.IsSourceNumber = true
|
||||
|
@ -812,6 +847,31 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm2.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.personalForm.couponMoney = res.data.data.content
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
this.getReceivableMoney(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
console.log('this.personalForm2.couponSupports', this.personalForm2.couponSupports)
|
||||
this.personalForm2.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
},
|
||||
getReceivableMoney() {
|
||||
console.log('666', 666)
|
||||
if (!this.personalForm.pointSupport) {
|
||||
|
@ -833,14 +893,46 @@ export default {
|
|||
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') {
|
||||
console.log('this.heji3', this.heji3)
|
||||
console.log('this.heji4', this.heji4)
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('this.personalForm.couponMoney', this.personalForm.couponMoney)
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.$store.getters.newsaleoutdata.firstMoney) {
|
||||
this.personalForm.receivableMoney = this.$store.getters.newsaleoutdata.firstMoney
|
||||
console.log('123', 123)
|
||||
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
|
||||
console.log('是否是销售合同带入过来')
|
||||
this.personalForm.receivableMoney = this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('234', 234)
|
||||
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.receivableMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else {
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('456', 456)
|
||||
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
}
|
||||
|
||||
// if (this.personalForm.pointSupport && this.personalForm.couponSupport && this.personalForm.ridMoney && this.personalForm.ridBikeMoney && this.personalForm.advanceMoney) {
|
||||
|
@ -1798,6 +1890,16 @@ export default {
|
|||
delete this.personalForm.currency
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
if (this.personalForm.saleType === '2') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '无来源时销售类别不能是分期',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.personalForm.repositoryId = this.$store.getters.repositoryId
|
||||
this.personalForm.regionId = this.$store.getters.regionId
|
||||
this.personalForm.createPersonId = this.$store.getters.userId
|
||||
|
@ -1991,6 +2093,16 @@ export default {
|
|||
})
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const parms3 = JSON.stringify(EnterDetail2)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
|
||||
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -2001,7 +2113,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatesaleOut(parms, parms2, parms3).then(res => {
|
||||
updatesaleOut(parms, parms2, parms3, this.personalForm.receivableMoney2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
|
|
|
@ -20,20 +20,30 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="planType" style="width: 100%;">
|
||||
<el-form-item :label="$t('SalePlan.planCategory')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planType"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
@change="listenplanType">
|
||||
<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="日" />
|
||||
v-model="personalForm.planCategory"
|
||||
style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="门店计划" />
|
||||
<el-option value="2" label="区域计划" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planType"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
@change="listenplanType">
|
||||
<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('SalePlan.planDate')" style="100%">
|
||||
<el-date-picker
|
||||
v-if="personalForm.planType == 5"
|
||||
|
@ -51,8 +61,8 @@
|
|||
@change="getnum" />
|
||||
<el-input v-else v-model="personalForm.planDate" disabled style="margin-left: 18px;width:200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="6">
|
||||
<el-form-item v-if="isshow" :label="$t(typeName)" style="width: 100%;">
|
||||
<el-select
|
||||
v-if="personalForm.planType == 2"
|
||||
|
@ -87,12 +97,11 @@
|
|||
<el-option v-for="item in weeklist" :key="item.id" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.beginTime')" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="personalForm.beginTime"
|
||||
:picker-options="pickerOptions0"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width:200px"
|
||||
|
@ -109,19 +118,26 @@
|
|||
style="margin-left: 18px;width:200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.lowerPlanMoney" style="margin-left: 18px;width:200px" clearable />
|
||||
<el-col v-if="personalForm.planCategory === '2'" :span="6" >
|
||||
<el-form-item :label="$t('SalePlan.regionId')" style="width: 100%;">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="reprops"
|
||||
v-model="personalForm.planRegionId"
|
||||
:show-all-levels="false"
|
||||
:placeholder="$t('Hmodule.xzqy')"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="margin-left: 18px;width: 200px"
|
||||
@change="handlechange4"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.planTotalMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.planTotalMoney" style="margin-left: 18px;width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SalePlan.urgePlan')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.urgePlan" style="margin-left: 18px;width:200px" clearable />
|
||||
<el-col v-if="personalForm.planCategory === '1'" :span="6">
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" style="width: 100%;">
|
||||
<el-input v-model="repositoryid" style="margin-left: 18px;width:200px" clearable @focus="handlechooseRep"/>
|
||||
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -132,133 +148,91 @@
|
|||
<el-card class="box-card" style="margin-top: 15px" shadow="never">
|
||||
<h2 ref="fuzhu" class="form-name">{{ $t('updates.jhmx') }}</h2>
|
||||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button @click="handleAddproduct">{{ $t('updates.tjmx') }}</el-button>
|
||||
<!-- <el-button @click="handleAddproduct2">添加下级区域明细</el-button> -->
|
||||
<el-button @click="handleAddproduct2">{{ $t('updates.xgbkmx') }}</el-button>
|
||||
<el-button type="danger" @click="deleteTreeData">{{ $t('updates.scmx') }}</el-button>
|
||||
<el-button @click="insertEvent(-1)">{{ $t('updates.tjmx') }}</el-button>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('updates.scmx') }}</el-button>
|
||||
</div>
|
||||
<!-- 添加明细弹框 -->
|
||||
<el-dialog
|
||||
:visible.sync="categoryVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:before-close="handlecancel2"
|
||||
title="添加明细"
|
||||
class="normal"
|
||||
width="600px"
|
||||
center>
|
||||
<el-form
|
||||
ref="addCategoryForm"
|
||||
:model="addCategoryForm"
|
||||
:rules="addCategoryFormrules"
|
||||
class="demo-ruleForm"
|
||||
style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('SalePlan.regionId')" label-width="100px" prop="regionId">
|
||||
<el-cascader
|
||||
ref="mycascader"
|
||||
v-model="addCategoryForm.regionId"
|
||||
:options="provinceList"
|
||||
:props="props"
|
||||
change-on-select
|
||||
placeholder=""
|
||||
style="width: 100%"
|
||||
@change="handleItemChange" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" label-width="100px">
|
||||
<el-select
|
||||
v-model="addCategoryForm.repositoryid"
|
||||
:placeholder="$t('Hmodule.xzmd')"
|
||||
filterable
|
||||
style="width: 100%;"
|
||||
@change="changeValue">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" prop="lowerMoney" label-width="100px">
|
||||
<el-input v-model="addCategoryForm.lowerMoney" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.targetMoney')" prop="targetMoney" label-width="100px">
|
||||
<el-input v-model="addCategoryForm.targetMoney" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handlesave2()">{{ $t('Hmodule.baoc') }}</el-button>
|
||||
<el-button type="danger" style="width: 98px;" @click="handlecancel2()">{{ $t('Hmodule.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:visible.sync="categoryVisible2"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:before-close="handlecancel3"
|
||||
title="修改明细"
|
||||
class="normal"
|
||||
width="600px"
|
||||
center>
|
||||
<el-form
|
||||
ref="editCategoryForm"
|
||||
:model="editCategoryForm"
|
||||
:rules="editCategoryFormrules"
|
||||
class="demo-ruleForm"
|
||||
style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('SalePlan.regionId')" label-width="100px" prop="regionId">
|
||||
<el-cascader
|
||||
v-model="editCategoryForm.regionId"
|
||||
:options="provinceList"
|
||||
:props="props"
|
||||
change-on-select
|
||||
placeholder=""
|
||||
style="width: 100%"
|
||||
@change="handleItemChange" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" label-width="100px">
|
||||
<el-select
|
||||
v-model="editCategoryForm.repositoryId"
|
||||
:placeholder="$t('Hmodule.xzmd')"
|
||||
filterable
|
||||
style="width: 100%;"
|
||||
@change="changeValue">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" prop="lowerMoney" label-width="100px">
|
||||
<el-input v-model="editCategoryForm.lowerMoney" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.targetMoney')" prop="targetMoney" label-width="100px">
|
||||
<el-input v-model="editCategoryForm.targetMoney" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handlesave3()">{{ $t('Hmodule.baoc') }}</el-button>
|
||||
<el-button type="danger" style="width: 98px;" @click="handlecancel3()">{{ $t('Hmodule.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 明细表格 -->
|
||||
<div class="container">
|
||||
<el-tree
|
||||
ref="DeviceGroupTree"
|
||||
:data="data2"
|
||||
:props="defaultProps"
|
||||
:check-strictly="true"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
@check-change="handleCheckChange">
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>{{ node.label }}</span>
|
||||
<span style="margin-left: 50px">
|
||||
<i class="el-icon-delete" style="margin-right: 20px" @click="nodeDelete(node, data)"/>
|
||||
<i class="el-icon-edit" @click="nodeEdit(node, data)" />
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
<el-editable
|
||||
ref="editable"
|
||||
:data.sync="list2"
|
||||
:edit-config="{ showIcon: true, showStatus: true}"
|
||||
:edit-rules="validRules"
|
||||
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')" min-width="55" align="center" type="index"/>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.planTarget')" prop="" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-model="scope.row.planTarget" :placeholder="$t('SalePlan.xzmd')" clearable filterable style="margin-left: 18px;width: 180px" @change="jungleAddress(scope.row,$event)">
|
||||
<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>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.address')" prop="address" align="center" min-width="150px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-if="isedit(scope.row)" v-model="scope.row.address" clearable/>
|
||||
<span v-else/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.typeId')" prop="typeId" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-if="isedit2(scope.row)" v-model="scope.row.typeId" :placeholder="$t('SalePlan.xzmd')" clearable filterable style="margin-left: 18px;width: 180px">
|
||||
<el-option
|
||||
v-for="(item, index) in CategoryList"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<span v-else/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.quantity')" prop="quantity" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable2"
|
||||
v-model="scope.row.quantity"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.money')" prop="money" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable2"
|
||||
v-model="scope.row.money"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualQuantity')" prop="actualQuantity" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.actualQuantity"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualMoney')" prop="actualMoney" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.actualMoney"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--操作-->
|
||||
|
@ -277,7 +251,8 @@
|
|||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import {
|
||||
addsaleplan
|
||||
addsaleplan,
|
||||
searchEmpCategory
|
||||
} from '@/api/SalePlan'
|
||||
import {
|
||||
searchSaleCategory
|
||||
|
@ -286,7 +261,8 @@ import {
|
|||
listbyparentid,
|
||||
searchRepository,
|
||||
getId,
|
||||
searchregionName
|
||||
searchregionName,
|
||||
regionlist
|
||||
} from '@/api/public'
|
||||
import MyEmp from './components/MyEmp'
|
||||
import MyDelivery from '../DailyAdjust/components/MyDelivery'
|
||||
|
@ -295,6 +271,7 @@ import MyApply from './components/MyApply'
|
|||
import MyRequire from './components/MyRequire'
|
||||
import MyCustomer from './components/MyCustomer'
|
||||
import MyAgent from './components/MyAgent'
|
||||
import MyRepository from './components/MyRepository'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var _that
|
||||
export default {
|
||||
|
@ -306,7 +283,8 @@ export default {
|
|||
MyApply,
|
||||
MyDetail,
|
||||
MyDelivery,
|
||||
MyEmp
|
||||
MyEmp,
|
||||
MyRepository
|
||||
},
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
|
@ -330,6 +308,23 @@ export default {
|
|||
return time.getTime() < new Date(this.personalForm.beginTime).getTime() - 8.64e7
|
||||
}
|
||||
},
|
||||
// 判断商品类型
|
||||
myflag: false,
|
||||
// 商品类别列表
|
||||
CategoryList: [],
|
||||
// 区域列表
|
||||
regions: [],
|
||||
regionids: [],
|
||||
// 区域列表字段更改re
|
||||
reprops: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 默认仓库
|
||||
repositoryid: this.$store.getters.repositoryName,
|
||||
// 仓库开关
|
||||
repositorycontrol: false,
|
||||
// 周数列表
|
||||
weeklist: [],
|
||||
// 是否显示周月
|
||||
|
@ -426,10 +421,10 @@ export default {
|
|||
control: false,
|
||||
// 销售订单信息数据
|
||||
personalForm: {
|
||||
customerType: '2',
|
||||
createPersonId: this.$store.getters.userId,
|
||||
countryId: this.$store.getters.countryId,
|
||||
repositoryId: this.$store.getters.repositoryId,
|
||||
planRepositoryId: this.$store.getters.repositoryId,
|
||||
regionId: this.$store.getters.regionId,
|
||||
beginTime: null,
|
||||
endTime: null
|
||||
|
@ -511,7 +506,17 @@ export default {
|
|||
// 销售费用明细
|
||||
list3: [],
|
||||
// 明细列表规则
|
||||
validRules: {},
|
||||
validRules: {
|
||||
// address: [{
|
||||
// required: true, message: 'Please enter a address.', trigger: 'blur'
|
||||
// }],
|
||||
quantity: [{
|
||||
required: true, message: 'Please enter a quantity.', trigger: ''
|
||||
}],
|
||||
money: [{
|
||||
required: true, message: 'Please enter a money.', trigger: ''
|
||||
}]
|
||||
},
|
||||
// 周数
|
||||
week: 0,
|
||||
// 修改id
|
||||
|
@ -534,11 +539,113 @@ export default {
|
|||
created() {
|
||||
this.getTypes()
|
||||
this.getTreeId()
|
||||
this.getregionlist()
|
||||
this.getCategory()
|
||||
},
|
||||
beforeCreate() {
|
||||
_that = this
|
||||
},
|
||||
methods: {
|
||||
// 判断是否可以修改任务地点
|
||||
isedit(row) {
|
||||
console.log('row============>', row)
|
||||
const flag = row.planTarget
|
||||
if (flag === '7') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 判断是否可以修改商品类型
|
||||
isedit2(row) {
|
||||
console.log('row============>', row)
|
||||
const flag = row.planTarget
|
||||
if (flag === '1') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 判断计划类别
|
||||
jungleAddress(row, val) {
|
||||
if (val !== '7') {
|
||||
delete row.address
|
||||
} else if (val !== '1') {
|
||||
delete row.typeId
|
||||
}
|
||||
},
|
||||
// 处理区域id
|
||||
findPathByLeafId(leafId, nodes, path) {
|
||||
if (path === undefined) {
|
||||
path = []
|
||||
}
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var tmpPath = path.concat()
|
||||
tmpPath.push(nodes[i].id)
|
||||
if (leafId === nodes[i].id) {
|
||||
return tmpPath
|
||||
}
|
||||
if (nodes[i].regionListVos) {
|
||||
var findResult = this.findPathByLeafId(leafId, nodes[i].regionListVos, tmpPath)
|
||||
if (findResult) {
|
||||
return findResult
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取商品类型
|
||||
getCategory() {
|
||||
searchEmpCategory().then(res => {
|
||||
this.CategoryList = res.data.data.content.list
|
||||
})
|
||||
},
|
||||
// 插入数据
|
||||
insertEvent(index) {
|
||||
console.log('表格数据===============>', this.$refs.editable.getRecords(0))
|
||||
const mytable = this.$refs.editable.getRecords(0)
|
||||
this.$refs.editable.insertAt(mytable, index)
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 区域列表数据
|
||||
getregionlist() {
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
this.personalForm.planRegionId = this.findPathByLeafId(this.$store.getters.regionId, this.regions)
|
||||
} else {
|
||||
console.log('区域列表出错')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {
|
||||
console.log(123123, this.personalForm.regionId)
|
||||
// const finalid = val[val.length - 1]
|
||||
// searchRepository(finalid).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.data.ret === 200) {
|
||||
// this.repositories = res.data.data.content.list
|
||||
// } else {
|
||||
// console.log('区域选择门店')
|
||||
// }
|
||||
// })
|
||||
},
|
||||
repositoryname(val) {
|
||||
this.repositoryid = val.repositoryName
|
||||
this.personalForm.planRepositoryId = val.id
|
||||
},
|
||||
// 打开仓库
|
||||
handlechooseRep() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
// 删除树
|
||||
deleteTreeData() {
|
||||
console.log('delete')
|
||||
|
@ -797,7 +904,6 @@ export default {
|
|||
console.log(obj.repositoryName)
|
||||
},
|
||||
// 根据区域选择门店
|
||||
handlechange4(val) {},
|
||||
getPosition(val, cb) {
|
||||
const vm = this // 查询省市县
|
||||
let params = {}
|
||||
|
@ -1041,9 +1147,41 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 判断补0
|
||||
junglezero(val) {
|
||||
if (val <= 9) {
|
||||
return '0' + val
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 清空结束时间
|
||||
cleardeposit() {
|
||||
this.personalForm.endTime = null
|
||||
cleardeposit(val) {
|
||||
console.log('val==================>', this.personalForm.planType)
|
||||
const processarr = Date.parse(new Date(val))
|
||||
console.log('processarr==========>', processarr)
|
||||
const date = new Date()
|
||||
if (this.personalForm.planType === '1') {
|
||||
this.personalForm.endTime = new Date(processarr + 3600 * 1000 * 24 * 365)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
} else if (this.personalForm.planType === '2') {
|
||||
this.personalForm.endTime = new Date(processarr + 3600 * 1000 * 24 * 90)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
} else if (this.personalForm.planType === '3') {
|
||||
this.personalForm.endTime = new Date(processarr + 3600 * 1000 * 24 * 30)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
} else if (this.personalForm.planType === '4') {
|
||||
this.personalForm.endTime = new Date(processarr + 3600 * 1000 * 24 * 7)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
} else if (this.personalForm.planType === '5') {
|
||||
this.personalForm.endTime = new Date(processarr + 3600 * 1000 * 24)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
} else if (this.personalForm.planType === undefined) {
|
||||
console.log('wozhixingle')
|
||||
this.personalForm.endTime = new Date(processarr)
|
||||
this.personalForm.endTime = this.personalForm.endTime.getFullYear() + '-' + this.junglezero((this.personalForm.endTime.getMonth() + 1)) + '-' + this.junglezero(this.personalForm.endTime.getDate())
|
||||
}
|
||||
// this.personalForm.endTime = null
|
||||
},
|
||||
getTypes() {
|
||||
// 结算方式数据
|
||||
|
@ -1183,6 +1321,7 @@ export default {
|
|||
this.customerId = null
|
||||
this.salePersonId = null
|
||||
this.data2 = ''
|
||||
this.repositoryid = ''
|
||||
},
|
||||
// 树结构数据转数组
|
||||
treeToList(tree) {
|
||||
|
@ -1201,7 +1340,7 @@ export default {
|
|||
},
|
||||
// 保存操作
|
||||
handlesave() {
|
||||
const EnterDetail = this.treeToList(this.data2) // 输出转换后数组
|
||||
const EnterDetail = this.$refs.editable.getRecords()
|
||||
console.log(EnterDetail)
|
||||
if (EnterDetail.length === 0) {
|
||||
this.$notify.error({
|
||||
|
@ -1211,8 +1350,44 @@ export default {
|
|||
})
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < EnterDetail.length; i++) {
|
||||
if (EnterDetail[i].address === '' && EnterDetail[i].planTarget === '7') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '地点信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const Data = this.personalForm
|
||||
if (Data.regionId) {
|
||||
const regionId_length = Data.planRegionId.length
|
||||
if (regionId_length === 0) {
|
||||
Data.planRegionId = ''
|
||||
} else {
|
||||
Data.planRegionId = Data.planRegionId[regionId_length - 1]
|
||||
}
|
||||
}
|
||||
console.log('Data==============>', Data)
|
||||
console.log('EnterDetail==============>', EnterDetail)
|
||||
if (Data.planCategory === '2') {
|
||||
delete Data.planRepositoryId
|
||||
} else if (Data.planCategory === '1') {
|
||||
delete Data.planRegionId
|
||||
}
|
||||
Data.planType = Number(Data.planType)
|
||||
Data.planCategory = Number(Data.planCategory)
|
||||
for (let i = 0; i < EnterDetail.length; i++) {
|
||||
for (const key in EnterDetail[i]) {
|
||||
console.log('key===============>', EnterDetail[i][key])
|
||||
if (EnterDetail[i][key] === '' || EnterDetail[i][key] === undefined || EnterDetail[i][key] === null) {
|
||||
console.log('执行')
|
||||
delete EnterDetail[i][key]
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
delete Data[key]
|
||||
|
@ -1233,10 +1408,11 @@ export default {
|
|||
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.editable.clear()
|
||||
// this.$refs.personalForm2.clearValidate()
|
||||
// this.$refs.personalForm2.resetFields()
|
||||
// this.$refs.personalForm3.clearValidate()
|
||||
// this.$refs.personalForm3.resetFields()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
|
|
|
@ -1,64 +1,133 @@
|
|||
<template>
|
||||
<div class="ERP-container">
|
||||
<el-card class="box-card" style="margin-top: 10px" shadow="never">
|
||||
<el-input v-model="getemplist.title" :placeholder="$t('SalePlan.title')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-input v-model="getemplist.planNumber" :placeholder="$t('updates.jhdh')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-select v-model="getemplist.planType" :placeholder="$t('SalePlan.planType')" :value="getemplist.planType" class="filter-item" clearable @keyup.enter.native="handleFilter">
|
||||
<el-option value="1" label="年"/>
|
||||
<el-option value="2" label="月"/>
|
||||
<el-option value="3" label="周"/>
|
||||
<el-option value="4" label="日"/>
|
||||
<el-input
|
||||
v-model="getemplist.title"
|
||||
:placeholder="$t('SalePlan.title')"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-input
|
||||
v-model="getemplist.planNumber"
|
||||
:placeholder="$t('updates.jhdh')"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-select
|
||||
v-model="getemplist.planType"
|
||||
:placeholder="$t('SalePlan.planType')"
|
||||
:value="getemplist.planType"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@keyup.enter.native="handleFilter"
|
||||
>
|
||||
<el-option value="1" label="年" />
|
||||
<el-option value="2" label="月" />
|
||||
<el-option value="3" label="周" />
|
||||
<el-option value="4" label="日" />
|
||||
</el-select>
|
||||
<el-popover
|
||||
v-model="visible2"
|
||||
placement="bottom"
|
||||
width="500"
|
||||
trigger="click">
|
||||
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" :placeholder="$t('updates.djzt')" clearable style="width: 40%;float: left;margin-left: 20px">
|
||||
<el-option :label="$t('updates.zd')" value="1"/>
|
||||
<el-option :label="$t('updates.zx')" value="2"/>
|
||||
<el-option :label="$t('updates.jd')" value="3"/>
|
||||
<el-popover v-model="visible2" placement="bottom" width="500" trigger="click">
|
||||
<el-date-picker
|
||||
v-model="date"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
unlink-panels
|
||||
start-placeholder="申请时间"
|
||||
end-placeholder="申请时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-top: 20px;margin-left: 20px"/>
|
||||
<el-select
|
||||
v-model="getemplist.judgeStat"
|
||||
:value="getemplist.judgeStat"
|
||||
:placeholder="$t('updates.spzt')"
|
||||
clearable
|
||||
style="margin-top: 20px;width: 50%;margin-left: 20px;"
|
||||
>
|
||||
<el-option :label="$t('updates.wsh')" value="0" />
|
||||
<el-option :label="$t('updates.shz')" value="1" />
|
||||
<el-option :label="$t('updates.shtg')" value="2" />
|
||||
<el-option :label="$t('updates.shptg')" value="3" />
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" :placeholder="$t('updates.spzt')" clearable style="width: 40%;float: right;margin-right: 20px">
|
||||
<el-option :label="$t('updates.wsh')" value="0"/>
|
||||
<el-option :label="$t('updates.shz')" value="1"/>
|
||||
<el-option :label="$t('updates.shtg')" value="2"/>
|
||||
<el-option :label="$t('updates.shptg')" value="3"/>
|
||||
</el-select>
|
||||
<!--<el-date-picker-->
|
||||
<!--v-model="date"-->
|
||||
<!--type="daterange"-->
|
||||
<!--range-separator="-"-->
|
||||
<!--unlink-panels-->
|
||||
<!--start-placeholder="销售日期"-->
|
||||
<!--end-placeholder="销售日期"-->
|
||||
<!--value-format="yyyy-MM-dd"-->
|
||||
<!--style="margin-top: 20px;margin-left: 20px"/>-->
|
||||
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
|
||||
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
<el-button
|
||||
v-waves
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
style="float: right"
|
||||
round
|
||||
@click="handleFilter"
|
||||
>{{ $t('public.search') }}</el-button>
|
||||
</div>
|
||||
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
|
||||
<el-button
|
||||
v-waves
|
||||
slot="reference"
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
style="width: 130px"
|
||||
@click="visible2 = !visible2"
|
||||
>
|
||||
{{ $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;margin-top: 10px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
|
||||
<el-button
|
||||
v-waves
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
style="width: 86px;margin-top: 10px"
|
||||
round
|
||||
@click="handleFilter"
|
||||
>{{ $t('public.search') }}</el-button>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 10px" shadow="never">
|
||||
<!-- 批量操作 -->
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button v-waves class="filter-item" style="margin-left: 0" type="primary">
|
||||
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
|
||||
{{ $t('public.batchoperation') }}
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown" style="width: 140px">
|
||||
<el-dropdown-item v-permission="['54-61-2']" style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
|
||||
<el-dropdown-item v-permission="['54-61-2']" style="text-align: left" command="delete">
|
||||
<svg-icon icon-class="shanchu" style="width: 40px" />
|
||||
{{ $t('public.delete') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- 表格导出操作 -->
|
||||
<el-button v-permission="['54-61-6']" v-waves :loading="downloadLoading" class="filter-item" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||
<el-button
|
||||
v-permission="['54-61-6']"
|
||||
v-waves
|
||||
:loading="downloadLoading"
|
||||
class="filter-item"
|
||||
style="width: 86px"
|
||||
@click="handleExport"
|
||||
>
|
||||
<svg-icon icon-class="daochu" />
|
||||
{{ $t('public.export') }}
|
||||
</el-button>
|
||||
<!-- 打印操作 -->
|
||||
<el-button v-permission="['54-61-7']" v-waves class="filter-item" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||
<el-button
|
||||
v-permission="['54-61-7']"
|
||||
v-waves
|
||||
class="filter-item"
|
||||
icon="el-icon-printer"
|
||||
style="width: 86px"
|
||||
@click="handlePrint"
|
||||
>{{ $t('public.print') }}</el-button>
|
||||
<!-- 新建操作 -->
|
||||
<el-button v-permission="['54-61-1']" v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
<el-button
|
||||
v-permission="['54-61-1']"
|
||||
v-waves
|
||||
class="filter-item"
|
||||
icon="el-icon-plus"
|
||||
type="success"
|
||||
style="width: 86px"
|
||||
@click="handleAdd"
|
||||
>{{ $t('public.add') }}</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" style="margin-top: 10px" shadow="never">
|
||||
|
@ -71,73 +140,245 @@
|
|||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
:selectable="selectInit"
|
||||
type="selection"
|
||||
width="55"
|
||||
fixed="left"
|
||||
align="center"/>
|
||||
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" min-width="150">
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('public.id')"
|
||||
:resizable="false"
|
||||
fixed="left"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.planNumber }}</span>
|
||||
</template>
|
||||
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
|
||||
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm" />
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SalePlan.title')" :resizable="false" fixed="left" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.title')"
|
||||
:resizable="false"
|
||||
fixed="left"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.title }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SalePlan.planType')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.planType')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.planType | planTypeFliter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SalePlan.planDate')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.planCategory')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.planDate }}</span>
|
||||
<span>{{ scope.row.planCategory | planCategoryFliter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SalePlan.lowerPlanMoney')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.beginTime')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.lowerPlanMoney }}</span>
|
||||
<span>{{ scope.row.beginTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SalePlan.planTotalMoney')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.endTime')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.planTotalMoney }}</span>
|
||||
<span>{{ scope.row.endTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('SalePlan.regOrRep')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.planRepositoryName || scope.row.planRegionName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('public.judgeStat')"
|
||||
:resizable="false"
|
||||
prop="judgeStat"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('public.receiptStat')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.actions')" :resizable="false" align="center" min-width="230">
|
||||
<el-table-column
|
||||
:label="$t('public.actions')"
|
||||
:resizable="false"
|
||||
align="center"
|
||||
min-width="230"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission2="['54-61-3', scope.row.createPersonId]" v-show="scope.row.judgeStat === 0" :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="$t('updates.spi')" type="warning" size="mini" icon="el-icon-view" circle @click="handleReview(scope.row)"/>
|
||||
<el-button v-permission2="['54-61-2', scope.row.createPersonId]" v-show="scope.row.judgeStat === 0" :title="$t('updates.sc')" size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
|
||||
<el-button
|
||||
v-permission2="['54-61-3', scope.row.createPersonId]"
|
||||
v-show="scope.row.judgeStat === 0"
|
||||
: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="$t('updates.spi')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
icon="el-icon-view"
|
||||
circle
|
||||
@click="handleReview(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
v-show="isTrace(scope.row)"
|
||||
:title="$t('updates.gz')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
icon="el-icon-message"
|
||||
circle
|
||||
@click="handleTrace(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
v-permission2="['54-61-2', scope.row.createPersonId]"
|
||||
v-show="scope.row.judgeStat === 0"
|
||||
:title="$t('updates.sc')"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
@click="handleDelete(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="getemplist.pageNum"
|
||||
:limit.sync="getemplist.pageSize"
|
||||
@pagination="getlist"
|
||||
/>
|
||||
<!--修改开始=================================================-->
|
||||
<my-dialog :editcontrol.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist"/>
|
||||
<my-dialog :editcontrol.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist" />
|
||||
<!--修改结束=================================================-->
|
||||
<!-- 跟踪统计================================================= -->
|
||||
<el-dialog :visible.sync="traceControl" :title="$t('SalePlan.trackingStatistics')" class="edit" width="1010px" top="55px" >
|
||||
<el-form :model="traceForm">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planNum')" style="width: 100%;">
|
||||
<el-input v-model="traceForm.planNumber" style="margin-left: 18px;width:200px" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.title')" style="width: 100%;">
|
||||
<el-input v-model="traceForm.title" style="margin-left: 18px;width:200px" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="container">
|
||||
<el-editable
|
||||
ref="editable"
|
||||
:data.sync="list2"
|
||||
:edit-config="{ showIcon: true, showStatus: true}"
|
||||
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')" min-width="55" align="center" type="index"/>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.planTarget')" prop="" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-model="scope.row.planTarget" :placeholder="$t('SalePlan.xzmd')" clearable filterable style="margin-left: 18px;width: 180px" disabled @change="jungleAddress(scope.row,$event)" >
|
||||
<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>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :label="$t('SalePlan.address')" prop="address" align="center" min-width="150px"/>
|
||||
<el-editable-column :label="$t('SalePlan.typeId')" prop="productType" align="center" min-width="250px"/>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualQuantity')" prop="actualQuantity" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable3"
|
||||
v-model="scope.row.actualQuantity"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualMoney')" prop="actualMoney" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable3"
|
||||
v-model="scope.row.actualMoney"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="traceControl = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handsavetrace">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 统计结束================================================= -->
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { saleplanlist, deletesaleplan, updatesaleplan2 } from '@/api/SalePlan'
|
||||
import { saleplanlist, deletesaleplan, updatesaleplan2, saleplanlistDetail, updatetrace } from '@/api/SalePlan'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
|
@ -177,9 +418,17 @@ export default {
|
|||
planTypeFliter(status) {
|
||||
const statusMap = {
|
||||
1: '年',
|
||||
2: '月',
|
||||
3: '周',
|
||||
4: '日'
|
||||
2: '季',
|
||||
3: '月',
|
||||
4: '周',
|
||||
5: '日'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
planCategoryFliter(status) {
|
||||
const statusMap = {
|
||||
1: '门店',
|
||||
2: '区域'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
|
@ -193,6 +442,11 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
list2: [],
|
||||
formLabelWidth: '130px',
|
||||
traceForm: {},
|
||||
// 追踪开关
|
||||
traceControl: false,
|
||||
// 回显客户
|
||||
customerName: '',
|
||||
// 控制客户
|
||||
|
@ -252,7 +506,17 @@ export default {
|
|||
date: []
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
traceControl() {
|
||||
saleplanlistDetail(this.traceForm.id).then(res => {
|
||||
console.log('详情数据============>', res.data.data.content.salePlanDetailVos)
|
||||
for (let i = 0; i < res.data.data.content.salePlanDetailVos.length; i++) {
|
||||
res.data.data.content.salePlanDetailVos[i].planTarget = String(res.data.data.content.salePlanDetailVos[i].planTarget)
|
||||
}
|
||||
this.list2 = res.data.data.content.salePlanDetailVos
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
|
@ -260,6 +524,31 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
handsavetrace() {
|
||||
this.traceControl = false
|
||||
for (let i = 0; i < this.list2.length; i++) {
|
||||
this.list2[i].planTarget = Number(this.list2[i].planTarget)
|
||||
}
|
||||
const parms = JSON.stringify(this.list2)
|
||||
updatetrace(parms).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
// 追踪操作
|
||||
handleTrace(row) {
|
||||
console.log('追踪')
|
||||
this.traceControl = true
|
||||
this.traceForm = row
|
||||
},
|
||||
// 判断是否可以追踪
|
||||
isTrace(row) {
|
||||
// console.log('row========>', row)
|
||||
if (row.judgeStat === 2) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
checkPermission,
|
||||
// 不让勾选
|
||||
selectInit(row, index) {
|
||||
|
@ -331,6 +620,14 @@ export default {
|
|||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pageNum = 1
|
||||
console.log('this.date==============>', this.date, this.getemplist)
|
||||
if (this.date) {
|
||||
this.getemplist.beginTime = this.date[0]
|
||||
this.getemplist.endTime = this.date[1]
|
||||
} else {
|
||||
delete this.getemplist.beginTime
|
||||
delete this.getemplist.endTime
|
||||
}
|
||||
saleplanlist(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
|
@ -356,13 +653,11 @@ export default {
|
|||
},
|
||||
// 供应商列表返回数据
|
||||
supplierName(val) {
|
||||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.getemplist.supplierId = val.id
|
||||
},
|
||||
// 修改操作
|
||||
handleEdit(row) {
|
||||
console.log(row)
|
||||
this.editVisible = true
|
||||
this.personalForm = Object.assign({}, row)
|
||||
this.personalForm.sourceType = String(row.sourceType)
|
||||
|
@ -396,7 +691,6 @@ export default {
|
|||
},
|
||||
// 详情操作
|
||||
handleDetail(row) {
|
||||
console.log(row)
|
||||
this.detailvisible = true
|
||||
this.personalForm = Object.assign({}, row)
|
||||
},
|
||||
|
@ -405,12 +699,11 @@ export default {
|
|||
if (row.approvalUseVos !== '' && row.approvalUseVos !== null && row.approvalUseVos !== undefined && row.approvalUseVos.length !== 0) {
|
||||
const approvalUse = row.approvalUseVos
|
||||
const index = approvalUse[approvalUse.length - 1].stepHandler.indexOf(',' + this.$store.getters.userId + ',')
|
||||
console.log(approvalUse[approvalUse.length - 1].stepHandler)
|
||||
console.log(index)
|
||||
if (index > -1 && (row.judgeStat === 1 || row.judgeStat === 0)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 审批操作
|
||||
handleReview(row) {
|
||||
|
@ -422,21 +715,9 @@ export default {
|
|||
confirmButtonText: '通过',
|
||||
cancelButtonText: '不通过',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.reviewParms.judgeStat = 2
|
||||
const parms = JSON.stringify(this.reviewParms)
|
||||
updatesaleplan2(parms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '审核成功!'
|
||||
})
|
||||
this.getlist()
|
||||
}
|
||||
})
|
||||
}).catch(action => {
|
||||
if (action === 'cancel') {
|
||||
this.reviewParms.judgeStat = 3
|
||||
})
|
||||
.then(() => {
|
||||
this.reviewParms.judgeStat = 2
|
||||
const parms = JSON.stringify(this.reviewParms)
|
||||
updatesaleplan2(parms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
|
@ -447,8 +728,22 @@ export default {
|
|||
this.getlist()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(action => {
|
||||
if (action === 'cancel') {
|
||||
this.reviewParms.judgeStat = 3
|
||||
const parms = JSON.stringify(this.reviewParms)
|
||||
updatesaleplan2(parms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '审核成功!'
|
||||
})
|
||||
this.getlist()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量操作
|
||||
handleSelectionChange(val) {
|
||||
|
@ -463,8 +758,42 @@ export default {
|
|||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deletesaleplan(ids, this.$store.getters.userId).then(res => {
|
||||
})
|
||||
.then(() => {
|
||||
deletesaleplan(ids, this.$store.getters.userId).then(res => {
|
||||
if (res.data.ret === 200 || res.data.ret === 100) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 单条删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
deletesaleplan(row.id, this.$store.getters.userId).then(res => {
|
||||
if (res.data.ret === 200 || res.data.ret === 100) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
|
@ -480,43 +809,13 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 单条删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deletesaleplan(row.id, this.$store.getters.userId).then(res => {
|
||||
if (res.data.ret === 200 || res.data.ret === 100) {
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
offset: 100
|
||||
})
|
||||
this.getlist()
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '出错了',
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
|
@ -525,22 +824,44 @@ export default {
|
|||
// 导出
|
||||
handleExport() {
|
||||
this.downloadLoading = true
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
|
||||
const filterVal = ['id', 'SalePlanName', 'SalePlanShortName', 'typeName', 'regionName', 'buyerName', 'levelName', 'createName', 'createTime']
|
||||
const data = this.formatJson(filterVal, this.list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '经销商资料表'
|
||||
})
|
||||
this.downloadLoading = false
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = [
|
||||
'供应商编号',
|
||||
'供应商名称',
|
||||
'供应商简称',
|
||||
'供应商类别',
|
||||
'所在区域',
|
||||
'采购员',
|
||||
'供应商优质级别',
|
||||
'建档人',
|
||||
'建档日期'
|
||||
]
|
||||
const filterVal = [
|
||||
'id',
|
||||
'SalePlanName',
|
||||
'SalePlanShortName',
|
||||
'typeName',
|
||||
'regionName',
|
||||
'buyerName',
|
||||
'levelName',
|
||||
'createName',
|
||||
'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]
|
||||
}))
|
||||
return jsonData.map(v =>
|
||||
filterVal.map(j => {
|
||||
return v[j]
|
||||
})
|
||||
)
|
||||
},
|
||||
// 打印
|
||||
handlePrint() {
|
||||
|
@ -551,7 +872,7 @@ export default {
|
|||
this.repositorycontrol = true
|
||||
},
|
||||
repositoryname(val) {
|
||||
console.log(val)
|
||||
// console.log(val)
|
||||
this.enterRepositoryId = val.repositoryName
|
||||
this.getemplist.enterRepositoryId = val.id
|
||||
},
|
||||
|
@ -580,28 +901,54 @@ export default {
|
|||
</script>
|
||||
|
||||
<style rel="stylesheet/css" scoped>
|
||||
.ERP-container >>> .el-form-item__label{
|
||||
color: #909399;
|
||||
text-align: left;
|
||||
.edit >>> .el-dialog{
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: auto;
|
||||
height: auto;
|
||||
}
|
||||
.app-container >>> .el-table .cell {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 24px;
|
||||
word-break: keep-all;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
.edit >>> .el-dialog__header{
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
display: block;
|
||||
width: 1010px;
|
||||
z-index: 100;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
}
|
||||
.ERP-container {
|
||||
margin: 0px 10px;
|
||||
.edit >>> .el-dialog__body{
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.filter-container{
|
||||
padding: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 180px;
|
||||
margin-left: 20px;
|
||||
padding: 10px 0;
|
||||
.edit >>> .el-dialog {
|
||||
background:#f1f1f1 ;
|
||||
left: 0;
|
||||
}
|
||||
.ERP-container >>> .el-form-item__label {
|
||||
color: #909399;
|
||||
text-align: left;
|
||||
}
|
||||
.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 10px;
|
||||
}
|
||||
.filter-container {
|
||||
padding: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
.filter-item {
|
||||
width: 180px;
|
||||
margin-left: 20px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,53 +4,57 @@
|
|||
<!--基本信息-->
|
||||
<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-form ref="personalForm" :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.planNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.title')" style="width: 100%;">
|
||||
<span>{{ personalForm.title }}</span>
|
||||
<el-input v-model="personalForm.title" style="margin-left: 18px;width:200px" clearable disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="planType" style="width: 100%;">
|
||||
<span>{{ personalForm.planType | planTypeFilter }}</span>
|
||||
<el-form-item :label="$t('SalePlan.planCategory')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planCategory"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
disabled>
|
||||
<el-option value="1" label="门店计划" />
|
||||
<el-option value="2" label="区域计划" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planDate')" style="width: 100%;">
|
||||
<span>{{ personalForm.planDate }}</span>
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planType"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
disabled>
|
||||
<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('SalePlan.beginTime')" style="width: 100%;">
|
||||
<span>{{ personalForm.beginTime }}</span>
|
||||
<el-input v-model="personalForm.beginTime" style="margin-left: 18px;width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.endTime')" style="width: 100%;">
|
||||
<span>{{ personalForm.endTime }}</span>
|
||||
<el-input v-model="personalForm.endTime" style="margin-left: 18px;width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" style="width: 100%;">
|
||||
<span>{{ personalForm.lowerPlanMoney }}</span>
|
||||
<el-col v-if="personalForm.planCategory === '2'" :span="12">
|
||||
<el-form-item :label="$t('SalePlan.regionId')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.planRegionName" style="margin-left: 18px;width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planTotalMoney')" style="width: 100%;">
|
||||
<span>{{ personalForm.planTotalMoney }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.urgePlan')" style="width: 100%;">
|
||||
<span>{{ personalForm.urgePlan }}</span>
|
||||
<el-col v-if="personalForm.planCategory === '1'" :span="12">
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.planRepositoryName" style="margin-left: 18px;width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -59,16 +63,44 @@
|
|||
</el-card>
|
||||
<!--子件信息-->
|
||||
<el-card class="box-card" style="margin-top: 15px" shadow="never">
|
||||
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('updates.jhmx') }}</h2>
|
||||
<h2 ref="fuzhu" class="form-name" >{{ $t('updates.jhmx') }}</h2>
|
||||
<div class="container">
|
||||
<el-tree
|
||||
ref="DeviceGroupTree"
|
||||
:data="data2"
|
||||
:props="defaultProps"
|
||||
:check-strictly = "true"
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
/>
|
||||
<el-editable
|
||||
ref="editable"
|
||||
:data.sync="list2"
|
||||
:edit-config="{ showIcon: true, showStatus: true}"
|
||||
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')" min-width="55" align="center" type="index"/>
|
||||
<el-editable-column :label="$t('SalePlan.progress')" prop="" align="center" min-width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-progress ref="myprogress" :text-inside="true" :stroke-width="18" :percentage="clacProgress(scope.row)" :status="mystatus" :format="_format(scope.row)"/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.planTarget')" prop="" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-model="scope.row.planTarget" :placeholder="$t('SalePlan.xzmd')" disabled clearable filterable style="margin-left: 18px;width: 180px">
|
||||
<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>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :label="$t('SalePlan.address')" prop="address" align="center" min-width="150px"/>
|
||||
<el-editable-column :label="$t('SalePlan.typeId')" prop="productType" align="center" min-width="250px"/>
|
||||
<el-editable-column :label="$t('SalePlan.quantity')" prop="quantity" align="center" min-width="150" />
|
||||
<el-editable-column :label="$t('SalePlan.money')" prop="money" align="center" min-width="150" />
|
||||
<el-editable-column :label="$t('SalePlan.actualQuantity')" prop="actualQuantity" align="center" min-width="150" />
|
||||
<el-editable-column :label="$t('SalePlan.actualMoney')" prop="actualMoney" align="center" min-width="150" />
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--审核状态-->
|
||||
|
@ -150,6 +182,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { saleplanlistDetail } from '@/api/SalePlan'
|
||||
var _that
|
||||
export default {
|
||||
filters: {
|
||||
|
@ -235,6 +268,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
mystatus: '',
|
||||
// 树结构数据
|
||||
data2: [],
|
||||
defaultProps: {
|
||||
|
@ -264,6 +298,13 @@ export default {
|
|||
this.data2 = this.personalForm.salePlanDetailVos
|
||||
this.reviewList = []
|
||||
const review = this.personalForm.approvalUseVos
|
||||
saleplanlistDetail(this.personalForm.id).then(res => {
|
||||
console.log('详情数据============>', res.data.data.content.salePlanDetailVos)
|
||||
for (let i = 0; i < res.data.data.content.salePlanDetailVos.length; i++) {
|
||||
res.data.data.content.salePlanDetailVos[i].planTarget = String(res.data.data.content.salePlanDetailVos[i].planTarget)
|
||||
}
|
||||
this.list2 = res.data.data.content.salePlanDetailVos
|
||||
})
|
||||
for (const i in review) {
|
||||
if (review[i].actualStepHandler !== null) {
|
||||
this.reviewList.push(review[i])
|
||||
|
@ -277,6 +318,26 @@ export default {
|
|||
methods: {
|
||||
handlecancel() {
|
||||
this.editVisible = false
|
||||
},
|
||||
// 进度条
|
||||
clacProgress(row) {
|
||||
console.log('row==================>', row)
|
||||
const res = Number(((row.actualQuantity / row.quantity) * 100).toFixed(0))
|
||||
if (res < 50) {
|
||||
this.mystatus = 'exception'
|
||||
} else if (res >= 50 && res < 100) {
|
||||
this.mystatus = 'text'
|
||||
} else {
|
||||
this.mystatus = 'success'
|
||||
}
|
||||
console.log(typeof res)
|
||||
return res > 100 ? 100 : res
|
||||
},
|
||||
_format(row) {
|
||||
this.$nextTick(function() {
|
||||
var dom = this.$refs.myprogress.$el.children[0].children[0].children[0].children[0].innerText = ((row.actualQuantity / row.quantity) * 100).toFixed(0) + '%'
|
||||
console.log('dom=================>', dom)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,37 +8,95 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.title')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
|
||||
<el-input v-model="personalForm.title" style="margin-left: 18px;width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="planType" style="width: 100%;">
|
||||
<el-select v-model="personalForm.planType" 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-form-item :label="$t('SalePlan.planCategory')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planCategory"
|
||||
style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="门店计划" />
|
||||
<el-option value="2" label="区域计划" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planDate')" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="personalForm.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width: 200px"/>
|
||||
<el-form-item :label="$t('SalePlan.planType')" prop="" style="width: 100%;">
|
||||
<el-select
|
||||
v-model="personalForm.planType"
|
||||
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('SalePlan.planDate')" style="100%">
|
||||
<el-date-picker
|
||||
v-if="personalForm.planType == 5"
|
||||
v-model="personalForm.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width:200px" />
|
||||
<el-date-picker
|
||||
v-else-if="personalForm.planType == 1 || 2 || 3 || 4"
|
||||
v-model="personalForm.planDate"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="选择年"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
@change="getnum" />
|
||||
<el-input v-else v-model="personalForm.planDate" disabled style="margin-left: 18px;width:200px" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="6">
|
||||
<el-form-item v-if="isshow" :label="$t(typeName)" style="width: 100%;">
|
||||
<el-select
|
||||
v-if="personalForm.planType == 2"
|
||||
v-model="personalForm.planDateAdd"
|
||||
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-select>
|
||||
<el-select
|
||||
v-if="personalForm.planType == 3"
|
||||
v-model="personalForm.planDateAdd"
|
||||
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-option value="8" label="八月" />
|
||||
<el-option value="9" label="九月" />
|
||||
<el-option value="10" label="十月" />
|
||||
<el-option value="11" label="十一月" />
|
||||
<el-option value="12" label="十二月" />
|
||||
</el-select>
|
||||
<el-select
|
||||
v-if="personalForm.planType == 4"
|
||||
v-model="personalForm.planDateAdd"
|
||||
style="margin-left: 18px;width: 200px">
|
||||
<el-option v-for="item in weeklist" :key="item.id" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.beginTime')" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="personalForm.beginTime"
|
||||
:picker-options="pickerOptions0"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width: 200px"
|
||||
@change="cleardeposit"/>
|
||||
style="margin-left: 18px;width:200px"
|
||||
@change="cleardeposit" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -48,22 +106,28 @@
|
|||
:picker-options="pickerOptions1"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="margin-left: 18px;width: 200px"/>
|
||||
style="margin-left: 18px;width:200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.lowerPlanMoney" style="margin-left: 18px;width: 200px" clearable/>
|
||||
<el-col v-if="personalForm.planCategory === '2'" :span="12" >
|
||||
<el-form-item :label="$t('SalePlan.regionId')" style="width: 100%;">
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="reprops"
|
||||
v-model="personalForm.planRegionId"
|
||||
:show-all-levels="false"
|
||||
:placeholder="$t('Hmodule.xzqy')"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
style="margin-left: 18px;width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.planTotalMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.planTotalMoney" style="margin-left: 18px;width: 200px" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SalePlan.urgePlan')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.urgePlan" style="margin-left: 18px;width: 200px" clearable/>
|
||||
<el-col v-if="personalForm.planCategory === '1'" :span="12">
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" style="width: 100%;">
|
||||
<el-input v-model="repositoryid" style="margin-left: 18px;width:200px" clearable @focus="handlechooseRep"/>
|
||||
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -74,52 +138,90 @@
|
|||
<el-card class="box-card" style="margin-top: 15px" shadow="never">
|
||||
<h2 ref="fuzhu" class="form-name" >{{ $t('updates.jhmx') }}</h2>
|
||||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button @click="handleAddproduct">{{ $t('updates.tjmx') }}</el-button>
|
||||
<!--<el-button type="danger" @click="deleteTreeData">{{ $t('Hmodule.delete') }}</el-button>-->
|
||||
<el-button @click="insertEvent(-1)">{{ $t('updates.tjmx') }}</el-button>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('updates.scmx') }}</el-button>
|
||||
</div>
|
||||
<el-dialog :visible.sync="categoryVisible" title="添加明细" class="normal" width="600px" append-to-body center>
|
||||
<el-form ref="addCategoryForm" :model="addCategoryForm" class="demo-ruleForm" style="margin: 0 auto; width: 400px">
|
||||
<el-form-item :label="$t('SalePlan.regionId')" label-width="100px" prop="type">
|
||||
<el-cascader v-model="addCategoryForm.regionId" :options="provinceList" :props="props" placeholder="" style="width: 100%" @active-item-change="handleItemChange" @change="handlechange4"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.repositoryid')" label-width="100px">
|
||||
<el-select v-model="addCategoryForm.repositoryid" :placeholder="$t('Hmodule.xzmd')" filterable style="width: 100%;" @change="changeValue">
|
||||
<el-option
|
||||
v-for="(item, index) in repositories"
|
||||
:key="index"
|
||||
:label="item.repositoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.lowerPlanMoney')" label-width="100px">
|
||||
<el-input v-model="addCategoryForm.lowerMoney" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SalePlan.targetMoney')" label-width="100px">
|
||||
<el-input v-model="addCategoryForm.targetMoney" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handlesave2()">{{ $t('Hmodule.baoc') }}</el-button>
|
||||
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<div class="container">
|
||||
<el-tree
|
||||
ref="DeviceGroupTree"
|
||||
:data="data2"
|
||||
:props="defaultProps"
|
||||
:check-strictly = "true"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
@check-change="handleCheckChange">
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>{{ node.label }}</span>
|
||||
<span v-if="data.parentId !== 0" style="margin-left: 50px">
|
||||
<i class="el-icon-delete" @click="nodeDelete(node, data)"/>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
<el-editable
|
||||
ref="editable"
|
||||
:data.sync="list2"
|
||||
:edit-config="{ showIcon: true, showStatus: true}"
|
||||
:edit-rules="validRules"
|
||||
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')" min-width="55" align="center" type="index"/>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.planTarget')" prop="" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-model="scope.row.planTarget" :placeholder="$t('SalePlan.xzmd')" clearable filterable style="margin-left: 18px;width: 180px" @change="jungleAddress(scope.row,$event)">
|
||||
<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>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.address')" prop="address" align="center" min-width="150px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input v-if="isedit(scope.row)" v-model="scope.row.address" clearable/>
|
||||
<span v-else/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElCascader ', type: 'visible', options: 'options'}" :label="$t('SalePlan.typeId')" prop="typeId" align="center" min-width="250px">
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-select v-if="isedit2(scope.row)" v-model="scope.row.typeId" :placeholder="$t('SalePlan.xzmd')" clearable filterable style="margin-left: 18px;width: 180px">
|
||||
<el-option
|
||||
v-for="(item, index) in CategoryList"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"/>
|
||||
</el-select>
|
||||
<span v-else/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.quantity')" prop="quantity" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable2"
|
||||
v-model="scope.row.quantity"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.money')" prop="money" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
:disabled="scope.row.isdisable2"
|
||||
v-model="scope.row.money"
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualQuantity')" prop="actualQuantity" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.actualQuantity"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
<el-editable-column :edit-render="{name: 'ElInput', type: 'visible'}" :label="$t('SalePlan.actualMoney')" prop="actualMoney" align="center" min-width="150" >
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<el-input-number
|
||||
:precision="2"
|
||||
v-model="scope.row.actualMoney"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-editable-column>
|
||||
</el-editable>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
|
||||
|
@ -132,9 +234,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { updatesaleplan } from '@/api/SalePlan'
|
||||
import { updatesaleplan, saleplanlistDetail, searchEmpCategory } from '@/api/SalePlan'
|
||||
import { searchSaleCategory } from '@/api/SaleCategory'
|
||||
import { listbyparentid, searchRepository, searchregionName, getId } from '@/api/public'
|
||||
import { listbyparentid, searchRepository, searchregionName, getId, regionlist } from '@/api/public'
|
||||
import MyEmp from './MyEmp'
|
||||
import MyDelivery from './MyDelivery'
|
||||
import MyDetail from './MyDetail'
|
||||
|
@ -142,10 +244,11 @@ import MyApply from './MyApply'
|
|||
import MyRequire from './MyRequire'
|
||||
import MyCustomer from './MyCustomer'
|
||||
import MyAgent from './MyAgent'
|
||||
import MyRepository from './MyRepository'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var _that
|
||||
export default {
|
||||
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
components: { MyAgent, MyCustomer, MyRequire, MyApply, MyDetail, MyDelivery, MyEmp, MyRepository },
|
||||
props: {
|
||||
editcontrol: {
|
||||
type: Boolean,
|
||||
|
@ -178,6 +281,19 @@ export default {
|
|||
return time.getTime() < new Date(this.personalForm.beginTime).getTime() - 8.64e7
|
||||
}
|
||||
},
|
||||
// 默认仓库
|
||||
repositoryid: '',
|
||||
// 仓库开关
|
||||
repositorycontrol: false,
|
||||
// 区域列表
|
||||
regions: [],
|
||||
regionids: [],
|
||||
// 区域列表字段更改re
|
||||
reprops: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 选择的数据
|
||||
choosedata: [],
|
||||
// 弹窗组件的控制
|
||||
|
@ -275,7 +391,9 @@ export default {
|
|||
list3: [],
|
||||
// 明细列表规则
|
||||
validRules: {
|
||||
}
|
||||
},
|
||||
// 商品类别列表
|
||||
CategoryList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -283,18 +401,132 @@ export default {
|
|||
this.editVisible = this.editcontrol
|
||||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.data2 = this.personalForm.salePlanDetailVos
|
||||
console.log(this.regions)
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
console.log('this.editdata1111=====>', this.editdata)
|
||||
console.log('this.regions1111=====>', this.regions)
|
||||
console.log('shuzuregions1111===>', this.findPathByLeafId(this.editdata.planRegionId, this.regions))
|
||||
console.log('this.editdata2222=====>', this.editdata)
|
||||
this.personalForm = this.editdata
|
||||
this.personalForm.planRegionId = this.findPathByLeafId(this.personalForm.planRegionId, this.regions)
|
||||
this.personalForm.planCategory = String(this.personalForm.planCategory)
|
||||
this.personalForm.planType = String(this.personalForm.planType)
|
||||
this.repositoryid = this.personalForm.planRepositoryName
|
||||
this.data2 = this.personalForm.salePlanDetailVos
|
||||
saleplanlistDetail(this.personalForm.id).then(res => {
|
||||
console.log('详情数据============>', res.data.data.content.salePlanDetailVos)
|
||||
for (let i = 0; i < res.data.data.content.salePlanDetailVos.length; i++) {
|
||||
res.data.data.content.salePlanDetailVos[i].planTarget = String(res.data.data.content.salePlanDetailVos[i].planTarget)
|
||||
}
|
||||
this.list2 = res.data.data.content.salePlanDetailVos
|
||||
})
|
||||
} else {
|
||||
console.log('区域列表出错')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTypes()
|
||||
this.getTreeId()
|
||||
this.getCategory()
|
||||
// this.getregionlist()
|
||||
},
|
||||
beforeCreate() {
|
||||
_that = this
|
||||
},
|
||||
methods: {
|
||||
// 插入数据
|
||||
insertEvent(index) {
|
||||
console.log('表格数据===============>', this.$refs.editable.getRecords(0))
|
||||
const mytable = this.$refs.editable.getRecords(0)
|
||||
this.$refs.editable.insertAt(mytable, index)
|
||||
},
|
||||
// 处理区域id
|
||||
findPathByLeafId(leafId, nodes, path) {
|
||||
if (path === undefined) {
|
||||
path = []
|
||||
}
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var tmpPath = path.concat()
|
||||
tmpPath.push(nodes[i].id)
|
||||
if (leafId === nodes[i].id) {
|
||||
return tmpPath
|
||||
}
|
||||
if (nodes[i].regionListVos) {
|
||||
var findResult = this.findPathByLeafId(leafId, nodes[i].regionListVos, tmpPath)
|
||||
if (findResult) {
|
||||
return findResult
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 区域列表数据
|
||||
getregionlist() {
|
||||
console.log('执行查找区域列表')
|
||||
console.log('1111111111111111111=====>', this.personalForm.planRegionId)
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
this.personalForm.planRegionId = this.findPathByLeafId(this.personalForm.planRegionId, this.regions)
|
||||
console.log('222222222222222222222=====>', this.personalForm.planRegionId)
|
||||
} else {
|
||||
console.log('区域列表出错')
|
||||
}
|
||||
})
|
||||
},
|
||||
getCategory() {
|
||||
searchEmpCategory().then(res => {
|
||||
this.CategoryList = res.data.data.content.list
|
||||
})
|
||||
},
|
||||
// 判断是否可以修改商品类型
|
||||
isedit2(row) {
|
||||
console.log('row============>', row)
|
||||
const flag = row.planTarget
|
||||
if (flag === '1') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 判断是否可以修改
|
||||
isedit(row) {
|
||||
console.log('row============>', row)
|
||||
const flag = row.planTarget
|
||||
if (flag === '7') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 判断计划类别
|
||||
jungleAddress(row, val) {
|
||||
if (val !== '7') {
|
||||
delete row.address
|
||||
} else if (val !== '1') {
|
||||
delete row.typeId
|
||||
}
|
||||
},
|
||||
repositoryname(val) {
|
||||
this.repositoryid = val.repositoryName
|
||||
this.personalForm.planRepositoryId = val.id
|
||||
},
|
||||
// 打开仓库
|
||||
handlechooseRep() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
// 获取递归值
|
||||
getTreeId() {
|
||||
getId().then(res => {
|
||||
|
@ -320,8 +552,8 @@ export default {
|
|||
// }
|
||||
// },
|
||||
handleCheckChange(data, checked) {
|
||||
console.log(data)
|
||||
console.log(checked)
|
||||
// console.log(data)
|
||||
// console.log(checked)
|
||||
if (checked === true) {
|
||||
this.child = true
|
||||
this.childData = data
|
||||
|
@ -350,7 +582,7 @@ export default {
|
|||
this.cleardata()
|
||||
this.addCategoryForm.id++
|
||||
} else if (this.child === true) {
|
||||
console.log(this.childData)
|
||||
// console.log(this.childData)
|
||||
const treeData = { label: '', id: 1, parentId: 0, level: 1, salePlanDetailVos: [] }
|
||||
treeData.label = this.addCategoryForm.repositoryName + ': 最低目标额(元): ' + this.addCategoryForm.lowerMoney + ' ' + '目标额(元): ' + this.addCategoryForm.targetMoney
|
||||
treeData.parentId = this.childData.id
|
||||
|
@ -367,8 +599,8 @@ export default {
|
|||
}
|
||||
},
|
||||
changeValue(value) {
|
||||
console.log(value)
|
||||
console.log(this.repositories)
|
||||
// console.log(value)
|
||||
// console.log(this.repositories)
|
||||
let obj = {}
|
||||
obj = this.repositories.find((item) => {
|
||||
return item.id === value
|
||||
|
@ -379,7 +611,7 @@ export default {
|
|||
handlechange4(val) {
|
||||
const finalid = val[val.length - 1]
|
||||
searchregionName(finalid).then(res => {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
})
|
||||
searchRepository(finalid).then(res => {
|
||||
console.log(res)
|
||||
|
@ -391,7 +623,7 @@ export default {
|
|||
})
|
||||
},
|
||||
getPosition(val, cb) {
|
||||
console.log(val)
|
||||
// console.log(val)
|
||||
const vm = this // 查询省市县
|
||||
let params = {}
|
||||
if (!val) { // 初始化加载 获取所有省份数据
|
||||
|
@ -443,7 +675,7 @@ export default {
|
|||
}
|
||||
})
|
||||
} else if (val.length === 3) { // 加载4级 查询该省市下县级数据
|
||||
console.log(vm.provinceList)
|
||||
// console.log(vm.provinceList)
|
||||
vm.provinceList.map((item) => {
|
||||
if (item.value === val[0]) {
|
||||
item.cities.map((value) => {
|
||||
|
@ -462,7 +694,7 @@ export default {
|
|||
}
|
||||
})
|
||||
} else if (val.length === 4) { // 加载5级 查询该省市下县级数据
|
||||
console.log(vm.provinceList)
|
||||
// console.log(vm.provinceList)
|
||||
vm.provinceList.map((item) => {
|
||||
if (item.value === val[0]) {
|
||||
item.cities.map((value) => {
|
||||
|
@ -485,7 +717,7 @@ export default {
|
|||
}
|
||||
})
|
||||
} else if (val.length === 5) { // 加载6级 查询该省市下县级数据
|
||||
console.log(vm.provinceList)
|
||||
// console.log(vm.provinceList)
|
||||
vm.provinceList.map((item) => {
|
||||
if (item.value === val[0]) {
|
||||
item.cities.map((value) => {
|
||||
|
@ -512,7 +744,7 @@ export default {
|
|||
}
|
||||
})
|
||||
} else if (val.length === 6) { // 加载7级 查询该省市下县级数据
|
||||
console.log(vm.provinceList)
|
||||
// console.log(vm.provinceList)
|
||||
vm.provinceList.map((item) => {
|
||||
if (item.value === val[0]) {
|
||||
item.cities.map((value) => {
|
||||
|
@ -563,7 +795,7 @@ export default {
|
|||
}
|
||||
})
|
||||
searchRepository(this.personalForm.regionId).then(res => {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.repositories = res.data.data.content.list
|
||||
} else {
|
||||
|
@ -750,9 +982,7 @@ export default {
|
|||
this.personalForm.createPersonId = this.$store.getters.userId
|
||||
this.personalForm.countryId = this.$store.getters.countryId
|
||||
this.personalForm.modifyPersonId = this.$store.getters.userId
|
||||
const EnterDetail = this.treeToList(this.data2) // 输出转换后数组
|
||||
console.log(EnterDetail)
|
||||
console.log(EnterDetail)
|
||||
const EnterDetail = this.list2 // 输出转换后数组
|
||||
if (EnterDetail.length === 0) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
|
@ -761,8 +991,27 @@ export default {
|
|||
})
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < EnterDetail.length; i++) {
|
||||
if (EnterDetail[i].address === '' && EnterDetail[i].planTarget === '7') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '地点信息未填完整',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const Data = this.personalForm
|
||||
for (let i = 0; i < EnterDetail.length; i++) {
|
||||
for (const key in EnterDetail[i]) {
|
||||
console.log('key===============>', EnterDetail[i][key])
|
||||
if (EnterDetail[i][key] === '' || EnterDetail[i][key] === undefined || EnterDetail[i][key] === null) {
|
||||
console.log('执行')
|
||||
delete EnterDetail[i][key]
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
delete Data[key]
|
||||
|
|
269
src/views/SalePlan/components/MyRepository.vue
Normal file
269
src/views/SalePlan/components/MyRepository.vue
Normal file
|
@ -0,0 +1,269 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="repositoryVisible" :repositorycontrol="repositorycontrol" :close-on-press-escape="false" top="10px" title="选择仓库" append-to-body @close="$emit('update:repositorycontrol', false)">
|
||||
<div class="filter-container">
|
||||
<!-- 搜索条件栏目 -->
|
||||
<el-input v-model="getemplist.id" :placeholder="$t('Repository.id')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-input v-model="getemplist.repositoryName" :placeholder="$t('Repository.repositoryname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
|
||||
<el-select v-model="getemplist.type" :value="getemplist.type" :placeholder="$t('Repository.type2')" class="filter-item" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in types"
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
:label="item.categoryName"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.iseffective" :value="getemplist.iseffective" :placeholder="$t('Repository.iseffective')" class="filter-item" clearable>
|
||||
<el-option :label="$t('updates.qy')" value="1"/>
|
||||
<el-option :label="$t('updates.ty')" value="2"/>
|
||||
</el-select>
|
||||
<el-cascader
|
||||
:options="regions"
|
||||
:props="props"
|
||||
v-model="getemplistregions"
|
||||
:show-all-levels="false"
|
||||
:placeholder="$t('Hmodule.xzqy')"
|
||||
change-on-select
|
||||
filterable
|
||||
clearable
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-select v-model="getemplist.countyrId" placeholder="请选择国家" class="filter-item" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in nations"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
</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-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
</div>
|
||||
<!-- 列表开始 -->
|
||||
<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('Repository.id')" :resizable="false" prop="id" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Repository.repositoryname')" :resizable="false" prop="repositoryName" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.repositoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Repository.type2')" :resizable="false" prop="categoryName" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Repository.iseffective')" :resizable="false" prop="stat" align="center" width="230">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.stat | iseffectiveFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Repository.managerPeople')" :resizable="false" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.managerName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('Repository.regionId')" :resizable="false" prop="regionName" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.regionName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">{{ $t('Hmodule.sure') }}</el-button>
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="getlist" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 },
|
||||
components: { Pagination },
|
||||
filters: {
|
||||
iseffectiveFilter(status) {
|
||||
const statusMap = {
|
||||
1: '启用',
|
||||
2: '停用'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
genderFilter(status) {
|
||||
const statusMap = {
|
||||
1: '男',
|
||||
2: '女'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
repositorycontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 仓库弹窗控制
|
||||
repositoryVisible: this.repositorycontrol,
|
||||
// 转化数据
|
||||
choosedata: '',
|
||||
// 类型列表
|
||||
types: [],
|
||||
// 国家列表
|
||||
nations: [],
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 仓库列表查询加展示参数
|
||||
getemplist: {
|
||||
repositoryName: '',
|
||||
type: '',
|
||||
iseffective: '',
|
||||
regionId: '',
|
||||
countyrId: '',
|
||||
id: '',
|
||||
stat: 1,
|
||||
loginRepositoryId: this.$store.getters.repositoryId,
|
||||
regionIds: this.$store.getters.regionIds,
|
||||
pagenum: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
// 部门列表
|
||||
depts: [],
|
||||
// 区域级联数据转化
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'regionName',
|
||||
children: 'regionListVos'
|
||||
},
|
||||
// 区域数据
|
||||
regions: [],
|
||||
getemplistregions: [],
|
||||
getemplistregions0: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
repositorycontrol() {
|
||||
this.repositoryVisible = this.repositorycontrol
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
_that = this
|
||||
},
|
||||
methods: {
|
||||
getlist() {
|
||||
// 国家列表
|
||||
getcountrylist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.nations = res.data.data.content
|
||||
}
|
||||
})
|
||||
// 仓库列表数据
|
||||
this.listLoading = true
|
||||
searchRepository2(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
// 仓库类型
|
||||
searchRepCategory().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
console.log(res)
|
||||
this.types = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
// 区域数据
|
||||
regionlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.regions = this.tranKTree(res.data.data.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pagenum = 1
|
||||
this.getemplist.regionId = this.getemplistregions[this.getemplistregions.length - 1]
|
||||
console.log(this.getemplist)
|
||||
searchRepository2(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
this.repositoryVisible = true
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.$router.push('/Repository/NewRepository')
|
||||
this.repositoryVisible = false
|
||||
},
|
||||
// 转化数据方法
|
||||
tranKTree(arr) {
|
||||
if (!arr || !arr.length) return
|
||||
return arr.map(item => ({
|
||||
id: item.id,
|
||||
regionName: item.regionName,
|
||||
regionListVos: this.tranKTree(item.regionListVos)
|
||||
}))
|
||||
},
|
||||
// 确认添加数据
|
||||
handleConfirm() {
|
||||
this.$emit('repositoryname', this.choosedata)
|
||||
this.repositoryVisible = false
|
||||
},
|
||||
// 选择仓库数据时的操作
|
||||
handleCurrentChange(val) {
|
||||
this.choosedata = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ERP-container {
|
||||
margin: 50px 30px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue