|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div id="addPlanList">
|
|
<div id="addPlanList">
|
|
- <el-card>
|
|
|
|
|
|
+ <el-card style="position: relative;">
|
|
<span>基本信息</span>
|
|
<span>基本信息</span>
|
|
<el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
|
|
<el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
|
|
<el-row :gutter="10">
|
|
<el-row :gutter="10">
|
|
@@ -16,7 +16,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-form-item label="计划名称" prop="planName" :rules="{ required: true, message: '请填写名称', trigger: 'blur' }">
|
|
|
|
|
|
+ <el-form-item label="计划名称" prop="planName" :rules="{ required: true, message: '请填写计划名称', trigger: 'blur' }">
|
|
<el-input
|
|
<el-input
|
|
v-model.trim="basicForm.planName"
|
|
v-model.trim="basicForm.planName"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -28,7 +28,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-form-item label="线路类型" prop="type">
|
|
|
|
|
|
+ <el-form-item label="线路类型" prop="type" :rules="{ required: true, message: '请选择线路类型', trigger: 'blur' }">
|
|
<el-select :disabled="sonDisable" v-model="basicForm.type" size="mini" style="width: 200px">
|
|
<el-select :disabled="sonDisable" v-model="basicForm.type" size="mini" style="width: 200px">
|
|
<el-option v-for="dict in dict.type.mk_plan_route_type" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
<el-option v-for="dict in dict.type.mk_plan_route_type" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
</el-option>
|
|
</el-option>
|
|
@@ -37,7 +37,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-form-item label="执行人" prop="chargerName">
|
|
|
|
|
|
+ <el-form-item label="执行人" prop="chargerName" :rules="{ required: true, message: '请选择执行人', trigger: 'blur' }">
|
|
<el-select clearable size="mini" v-model="basicForm.chargerName" :disabled="sonDisable" @focus="choose('CONTACTS_PARAM', true, '执行人')" style="width: 200px">
|
|
<el-select clearable size="mini" v-model="basicForm.chargerName" :disabled="sonDisable" @focus="choose('CONTACTS_PARAM', true, '执行人')" style="width: 200px">
|
|
<el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
<el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
</el-select>
|
|
</el-select>
|
|
@@ -70,9 +70,9 @@
|
|
>
|
|
>
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
|
+ <el-col :span="1.5">
|
|
<el-form-item label="截止时间" prop="deadlineTime" :rules="{ required: true, message: '请选择截止时间', trigger: 'blur' }">
|
|
<el-form-item label="截止时间" prop="deadlineTime" :rules="{ required: true, message: '请选择截止时间', trigger: 'blur' }">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="basicForm.deadlineTime"
|
|
v-model="basicForm.deadlineTime"
|
|
@@ -85,10 +85,10 @@
|
|
>
|
|
>
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-form-item label="销售区域" prop="marketingAreaName">
|
|
|
|
|
|
+ <el-form-item label="销售区域" prop="marketingAreaName" :rules="{ required: true, message: '请选择销售区域', trigger: 'blur' }">
|
|
<el-select clearable v-model="basicForm.marketingAreaName" size="mini" :disabled="sonDisable" @focus="choose('MK_SALESAREA_PARAM', true, '销售区域')" style="width: 200px">
|
|
<el-select clearable v-model="basicForm.marketingAreaName" size="mini" :disabled="sonDisable" @focus="choose('MK_SALESAREA_PARAM', true, '销售区域')" style="width: 200px">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in deptOptions"
|
|
v-for="item in deptOptions"
|
|
@@ -115,30 +115,32 @@
|
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <span>明细信息</span>
|
|
|
|
<div class="btn_grooup">
|
|
<div class="btn_grooup">
|
|
- <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
|
|
|
|
- <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
|
|
|
|
- <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
|
|
|
|
|
|
+ <span>明细信息</span>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-table
|
|
|
|
|
|
+ <el-table
|
|
:data="basicForm.mkBoPlanItemList"
|
|
:data="basicForm.mkBoPlanItemList"
|
|
fit
|
|
fit
|
|
- max-height="300"
|
|
|
|
|
|
+ max-height="600"
|
|
style="font-size: 12px;"
|
|
style="font-size: 12px;"
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
- :cell-class-name="cellClassName"
|
|
|
|
>
|
|
>
|
|
<el-table-column type="selection" align="center"/>
|
|
<el-table-column type="selection" align="center"/>
|
|
<el-table-column label="序号" type="index" align="center"/>
|
|
<el-table-column label="序号" type="index" align="center"/>
|
|
<el-table-column show-overflow-tooltip label="计划编号" prop="planCode" width="150"/>
|
|
<el-table-column show-overflow-tooltip label="计划编号" prop="planCode" width="150"/>
|
|
- <el-table-column show-overflow-tooltip label="日期" prop="date" width="230px">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip label="日期" prop="date" width="230px" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'date'" :rules="{ required: true, message: '请填写日期', trigger: 'blur' }">
|
|
<el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'date'" :rules="{ required: true, message: '请填写日期', trigger: 'blur' }">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="scope.row.date"
|
|
v-model="scope.row.date"
|
|
- readonly
|
|
|
|
|
|
+ :readonly="sonDisable"
|
|
clearable
|
|
clearable
|
|
type="date"
|
|
type="date"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -149,9 +151,9 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column show-overflow-tooltip label="客户名称" prop="customerName" min-width="230">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip label="客户" prop="customerName" min-width="230" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-form-item class="hang">
|
|
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'customerName'" :rules="{ required: true, message: '请选择客户', trigger: 'blur' }">
|
|
<el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
|
|
<el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
|
|
<el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
<el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
</el-select>
|
|
</el-select>
|
|
@@ -159,10 +161,10 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-form-item class="hang">
|
|
|
|
- <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {})" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
|
|
|
|
+ <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {customer:scope.row.customer})" style="width: 200px">
|
|
<el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
<el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -171,15 +173,15 @@
|
|
|
|
|
|
<el-table-column show-overflow-tooltip label="详细地址" prop="address" min-width="200">
|
|
<el-table-column show-overflow-tooltip label="详细地址" prop="address" min-width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-form-item class="hang">
|
|
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'address'">
|
|
<el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.address"/>
|
|
<el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.address"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-form-item class="hang">
|
|
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'purpose'" :rules="{ required: true, message: '请选择拜访目的', trigger: 'blur' }">
|
|
<el-select clearable :disabled="sonDisable" v-model="scope.row.purpose" size="mini">
|
|
<el-select clearable :disabled="sonDisable" v-model="scope.row.purpose" size="mini">
|
|
<el-option v-for=" dict in dict.type.mk_bo_behavior_goal" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
<el-option v-for=" dict in dict.type.mk_bo_behavior_goal" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
</el-option>
|
|
</el-option>
|
|
@@ -188,10 +190,17 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column :readonly="sonDisable" show-overflow-tooltip label="商机" prop="boName" min-width="200"/>
|
|
|
|
|
|
+ <el-table-column :readonly="sonDisable" show-overflow-tooltip label="商机" prop="boName" min-width="200">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'boName'">
|
|
|
|
+ <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.boName"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
<el-table-column :readonly="sonDisable" show-overflow-tooltip label="营销活动" prop="marketingCampaign" min-width="200">
|
|
<el-table-column :readonly="sonDisable" show-overflow-tooltip label="营销活动" prop="marketingCampaign" min-width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-form-item class="hang">
|
|
|
|
|
|
+ <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'marketingCampaign'">
|
|
<el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.marketingCampaign"/>
|
|
<el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.marketingCampaign"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
@@ -214,10 +223,10 @@
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
|
|
<el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="1.5" style="margin: 0 10px;">
|
|
|
|
|
|
+ <!-- <el-col :span="1.5" style="margin: 0 10px;">
|
|
<el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
|
|
<el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
|
+ </el-col> -->
|
|
|
|
+ <el-col :span="1.5" style="margin: 0 10px;">
|
|
<el-button size="mini" plain @click="back">返回</el-button>
|
|
<el-button size="mini" plain @click="back">返回</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
@@ -253,32 +262,21 @@ export default {
|
|
// },
|
|
// },
|
|
basicForm: {
|
|
basicForm: {
|
|
id: '',
|
|
id: '',
|
|
- planId: '',
|
|
|
|
planCode: '',
|
|
planCode: '',
|
|
- planName :'',
|
|
|
|
- charger: '',
|
|
|
|
- chargerName: '',
|
|
|
|
|
|
+ planName : '',
|
|
|
|
+ charger: this.$store.state.user.id,
|
|
|
|
+ chargerName: this.$store.state.user.nickName,
|
|
|
|
+ dept: this.$store.state.user.deptId,
|
|
|
|
+ deptName: this.$store.state.user.deptName,
|
|
|
|
+ startDate: this.getNextWeek(1),
|
|
|
|
+ deadlineTime: this.getNextWeek(7),
|
|
type: '0',
|
|
type: '0',
|
|
- dept: '',
|
|
|
|
- deptName: '',
|
|
|
|
- startDate: this.getWeek(1),
|
|
|
|
- deadlineTime: this.getWeek(7),
|
|
|
|
- date: '',
|
|
|
|
|
|
+ state: '0',
|
|
marketingArea: '',
|
|
marketingArea: '',
|
|
marketingAreaName: '',
|
|
marketingAreaName: '',
|
|
- state: '0',
|
|
|
|
- customer: '',
|
|
|
|
- customerName: '',
|
|
|
|
- contact: '',
|
|
|
|
- contactName: '',
|
|
|
|
- address: '',
|
|
|
|
- purpose: '',
|
|
|
|
- bo: '',
|
|
|
|
- boName: '',
|
|
|
|
- marketingCampaign: '',
|
|
|
|
mkBoPlanItemList: []
|
|
mkBoPlanItemList: []
|
|
},
|
|
},
|
|
- delDemandItemList: [],
|
|
|
|
|
|
+ delPlanItemList: [],
|
|
basicRules: {},
|
|
basicRules: {},
|
|
tableList: [],
|
|
tableList: [],
|
|
referCondition: {
|
|
referCondition: {
|
|
@@ -298,43 +296,59 @@ export default {
|
|
personOptions: [],
|
|
personOptions: [],
|
|
deptOptions: [],
|
|
deptOptions: [],
|
|
customerOptions: [],
|
|
customerOptions: [],
|
|
- pickerOptionsEnd: {
|
|
|
|
- disabledDate: (time) => {
|
|
|
|
- return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- isBDXQ: false,
|
|
|
|
- isYl: false,
|
|
|
|
|
|
+ salesAreaOptions: [],
|
|
|
|
+ //判断默认明细行带出完毕后日期等于当前日期的标识
|
|
|
|
+ isFlag: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
updated() {},
|
|
updated() {},
|
|
mounted() {},
|
|
mounted() {},
|
|
created() {
|
|
created() {
|
|
|
|
+ //查看系统数据
|
|
|
|
+ console.log(this.$store.state.user, 'this.$store.state.user')
|
|
if(this.pageStu == 'check') {
|
|
if(this.pageStu == 'check') {
|
|
console.log('数据', this.row)
|
|
console.log('数据', this.row)
|
|
this.getDetails(this.row)
|
|
this.getDetails(this.row)
|
|
- } else if(this.pageStu == 'edit') {
|
|
|
|
|
|
+ } else if (this.pageStu == 'edit') {
|
|
this.getDetails(this.row)
|
|
this.getDetails(this.row)
|
|
|
|
+ } else if (this.pageStu == 'add') {
|
|
|
|
+ //新增时默认带出7条明细行
|
|
|
|
+ this.defaultDetailLine(7)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ copy() {
|
|
|
|
+ this.isFlag = true;
|
|
|
|
+ this.$modal.notifySuccess("复制成功");
|
|
|
|
+ this.sonPageStu = 'add'
|
|
|
|
+ this.sonDisable = false
|
|
|
|
+ // this.getDetails(this.row)
|
|
|
|
+ this.basicForm.id = ''
|
|
|
|
+ this.basicForm.planCode = ''
|
|
|
|
+ this.basicForm.createBy = ''
|
|
|
|
+ this.basicForm.createTime = ''
|
|
|
|
+ this.basicForm.chargerName = this.$store.state.user.nickName
|
|
|
|
+ this.basicForm.dept = this.$store.state.user.deptId
|
|
|
|
+ if (this.basicForm.chargerName) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.chargerName) }
|
|
|
|
+ if (this.basicForm.marketingAreaName) { this.reBackRefer('MK_SALESAREA_PARAM', this.basicForm.marketingAreaName) }
|
|
|
|
+ if (this.basicForm.deptName) { this.reBackRefer('DEPT_PARAM', this.basicForm.deptName) }
|
|
|
|
+ this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
|
|
+ item.planCode = ''
|
|
|
|
+ })
|
|
|
|
+ },
|
|
handleData() {
|
|
handleData() {
|
|
console.log('222')
|
|
console.log('222')
|
|
// 复制新增把id,编码,创建人置为空,子表去掉id
|
|
// 复制新增把id,编码,创建人置为空,子表去掉id
|
|
this.basicForm.id = ''
|
|
this.basicForm.id = ''
|
|
- this.basicForm.code = ''
|
|
|
|
|
|
+ this.basicForm.planCode = ''
|
|
this.basicForm.createBy = ''
|
|
this.basicForm.createBy = ''
|
|
- this.basicForm.source = '4'
|
|
|
|
if (this.basicForm.mkBoPlanItemList.length !== 0) {
|
|
if (this.basicForm.mkBoPlanItemList.length !== 0) {
|
|
this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
if (item.id) {
|
|
if (item.id) {
|
|
delete item.id
|
|
delete item.id
|
|
}
|
|
}
|
|
- if (item.demandId) {
|
|
|
|
- delete item.demandId
|
|
|
|
- }
|
|
|
|
- if (item.allotCode) {
|
|
|
|
- delete item.allotCode
|
|
|
|
|
|
+ if (item.planId) {
|
|
|
|
+ delete item.planId
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -350,7 +364,7 @@ export default {
|
|
},
|
|
},
|
|
async save() {
|
|
async save() {
|
|
if(this.basicForm.mkBoPlanItemList.length !== 0) {
|
|
if(this.basicForm.mkBoPlanItemList.length !== 0) {
|
|
- this.$refs['basic'].validate((valid) => {
|
|
|
|
|
|
+ this.$refs['basic'].validate((valid, obj) => {
|
|
if(valid) {
|
|
if(valid) {
|
|
this.$modal.loading("保存中...");
|
|
this.$modal.loading("保存中...");
|
|
if(this.sonPageStu == 'add') {
|
|
if(this.sonPageStu == 'add') {
|
|
@@ -358,7 +372,7 @@ export default {
|
|
addPlan(this.basicForm).then(res => {
|
|
addPlan(this.basicForm).then(res => {
|
|
console.log(333)
|
|
console.log(333)
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$modal.msgSuccess("保存成功");
|
|
|
|
|
|
+ this.$modal.notifySuccess("保存成功");
|
|
this.$modal.closeLoading();
|
|
this.$modal.closeLoading();
|
|
this.back()
|
|
this.back()
|
|
}
|
|
}
|
|
@@ -367,15 +381,15 @@ export default {
|
|
})
|
|
})
|
|
} else if (this.sonPageStu == 'edit') {
|
|
} else if (this.sonPageStu == 'edit') {
|
|
let list = []
|
|
let list = []
|
|
- list.push(...this.basicForm.mkBoPlanItemList, ...this.delDemandItemList)
|
|
|
|
|
|
+ list.push(...this.basicForm.mkBoPlanItemList, ...this.delPlanItemList)
|
|
// 深拷贝一下参数对象
|
|
// 深拷贝一下参数对象
|
|
let param = JSON.parse(JSON.stringify(this.basicForm))
|
|
let param = JSON.parse(JSON.stringify(this.basicForm))
|
|
console.log('深拷贝对象',param);
|
|
console.log('深拷贝对象',param);
|
|
param.mkBoPlanItemList = list
|
|
param.mkBoPlanItemList = list
|
|
- // this.basicForm.mkBoPlanItemList.push(...this.delDemandItemList)
|
|
|
|
|
|
+ // this.basicForm.mkBoPlanItemList.push(...this.delPlanItemList)
|
|
editPlan(param).then(res => {
|
|
editPlan(param).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$modal.msgSuccess("编辑成功");
|
|
|
|
|
|
+ this.$modal.notifySuccess("编辑成功");
|
|
this.$modal.closeLoading();
|
|
this.$modal.closeLoading();
|
|
this.back()
|
|
this.back()
|
|
}
|
|
}
|
|
@@ -383,32 +397,42 @@ export default {
|
|
this.$modal.closeLoading();
|
|
this.$modal.closeLoading();
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ // 校验加弹窗
|
|
|
|
+ const jiaoyan = []
|
|
|
|
+ for(let key in obj) {
|
|
|
|
+ jiaoyan.push(obj[key][0].message);
|
|
|
|
+ }
|
|
|
|
+ this.$modal.notifyWarning(jiaoyan[0]);
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.$modal.msgWarning("明细信息不能为空!");
|
|
this.$modal.msgWarning("明细信息不能为空!");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- submit() {
|
|
|
|
- this.$modal.loading("提交中...");
|
|
|
|
- submitDemand(this.basicForm).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.$modal.msgSuccess("提交成功");
|
|
|
|
- this.$modal.closeLoading();
|
|
|
|
- this.back()
|
|
|
|
- }
|
|
|
|
- }).catch(err => {
|
|
|
|
- this.$modal.closeLoading();
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ // submit() {
|
|
|
|
+ // this.$modal.loading("提交中...");
|
|
|
|
+ // submitDemand(this.basicForm).then(res => {
|
|
|
|
+ // if (res.code === 200) {
|
|
|
|
+ // this.$modal.notifySuccess("提交成功");
|
|
|
|
+ // this.$modal.closeLoading();
|
|
|
|
+ // this.back()
|
|
|
|
+ // }
|
|
|
|
+ // }).catch(err => {
|
|
|
|
+ // this.$modal.closeLoading();
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
// 增行
|
|
// 增行
|
|
- addLine() {
|
|
|
|
|
|
+ addLine(date) {
|
|
|
|
+ if (this.isFlag) {
|
|
|
|
+ date = this.getCurrentTime();
|
|
|
|
+ }
|
|
const newLine = {
|
|
const newLine = {
|
|
- contacts: null,
|
|
|
|
id: null,
|
|
id: null,
|
|
planId: null,
|
|
planId: null,
|
|
planCode: null,
|
|
planCode: null,
|
|
- date: this.getCurrentTime(),
|
|
|
|
|
|
+ date: date,
|
|
customer: null,
|
|
customer: null,
|
|
customerName: null,
|
|
customerName: null,
|
|
contact: null,
|
|
contact: null,
|
|
@@ -421,8 +445,6 @@ export default {
|
|
delFlag: 0,
|
|
delFlag: 0,
|
|
// 新增字段
|
|
// 新增字段
|
|
model: null,
|
|
model: null,
|
|
- storageCondition: null,
|
|
|
|
- transportationCondition: null,
|
|
|
|
}
|
|
}
|
|
this.basicForm.mkBoPlanItemList.push(newLine)
|
|
this.basicForm.mkBoPlanItemList.push(newLine)
|
|
},
|
|
},
|
|
@@ -435,7 +457,7 @@ export default {
|
|
this.$modal.confirm('确认信息').then(() => {
|
|
this.$modal.confirm('确认信息').then(() => {
|
|
delPlanItem(param).then(res => {
|
|
delPlanItem(param).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
+ this.$modal.notifySuccess("删除成功");
|
|
this.getDetails(this.row)
|
|
this.getDetails(this.row)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -445,11 +467,7 @@ export default {
|
|
delLine(index, row) {
|
|
delLine(index, row) {
|
|
console.log('删除行:', index)
|
|
console.log('删除行:', index)
|
|
console.log('改变行:', row)
|
|
console.log('改变行:', row)
|
|
- // this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
|
|
|
|
- // return item.id !== row.id
|
|
|
|
- // })
|
|
|
|
row.delFlag = '2'
|
|
row.delFlag = '2'
|
|
- // this.basicForm.mkBoPlanItemList.splice(index,1)
|
|
|
|
let delList = []
|
|
let delList = []
|
|
delList = this.basicForm.mkBoPlanItemList.filter(item => {
|
|
delList = this.basicForm.mkBoPlanItemList.filter(item => {
|
|
return item.delFlag == '2'
|
|
return item.delFlag == '2'
|
|
@@ -457,14 +475,16 @@ export default {
|
|
this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
|
|
this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
|
|
return item.delFlag == '0'
|
|
return item.delFlag == '0'
|
|
})
|
|
})
|
|
- this.delDemandItemList.push(...delList)
|
|
|
|
- console.log('删除的数组',this.delDemandItemList)
|
|
|
|
|
|
+ this.delPlanItemList.push(...delList)
|
|
|
|
+ console.log('删除的数组',this.delPlanItemList)
|
|
},
|
|
},
|
|
edit() {
|
|
edit() {
|
|
- // this.isList = false
|
|
|
|
- // this.page = 'edit'
|
|
|
|
- // this.rowDetail = row
|
|
|
|
- // this.disable = false
|
|
|
|
|
|
+ this.isFlag = true;
|
|
|
|
+ this.sonPageStu = 'edit'
|
|
|
|
+ this.sonDisable = false
|
|
|
|
+ this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
|
|
+ item.planCode = this.basicForm.planCode
|
|
|
|
+ })
|
|
},
|
|
},
|
|
back() {
|
|
back() {
|
|
this.$emit('jugislist', true)
|
|
this.$emit('jugislist', true)
|
|
@@ -474,18 +494,17 @@ export default {
|
|
// }
|
|
// }
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
},
|
|
},
|
|
- // 单元格标红
|
|
|
|
- cellClassName({row, column, rowIndex, columnIndex}) {
|
|
|
|
- if(this.basicForm.isSpeical == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
|
|
|
|
- return 'success-row';
|
|
|
|
- }
|
|
|
|
|
|
+ // 如果需要回显则调用详情接口
|
|
|
|
+ getDetails(row) {
|
|
|
|
+ getPlanDetail(row.id).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.basicForm = res.data
|
|
|
|
+ for (let i = 0; i < this.basicForm.mkBoPlanItemList.length; i++) {
|
|
|
|
+ this.basicForm.mkBoPlanItemList[i].planCode = res.data.planCode
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- // handleSelectionChange(selection) {
|
|
|
|
- // this.ids = selection.map(item =>{
|
|
|
|
- // return item.id
|
|
|
|
- // })
|
|
|
|
- // console.log('选中数组', this.ids)
|
|
|
|
- // },
|
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
console.log('选中', selection)
|
|
console.log('选中', selection)
|
|
this.ids = selection.map(item => item.id)
|
|
this.ids = selection.map(item => item.id)
|
|
@@ -494,8 +513,8 @@ export default {
|
|
// 回显参照框
|
|
// 回显参照框
|
|
reBackRefer(type, id, title) {
|
|
reBackRefer(type, id, title) {
|
|
getRefer({type: type, id: id}).then(res => {
|
|
getRefer({type: type, id: id}).then(res => {
|
|
- if(type == 'LINKMAN_PARAM') {
|
|
|
|
- this.linkOptions = res.rows
|
|
|
|
|
|
+ if(type == 'MK_SALESAREA_PARAM') {
|
|
|
|
+ this.salesAreaOptions = res.rows
|
|
}
|
|
}
|
|
if (type == 'CUSTOMER_PARAM_ZT') {
|
|
if (type == 'CUSTOMER_PARAM_ZT') {
|
|
this.customerOptions = res.rows
|
|
this.customerOptions = res.rows
|
|
@@ -503,10 +522,10 @@ export default {
|
|
if (type == 'CONTACTS_PARAM') {
|
|
if (type == 'CONTACTS_PARAM') {
|
|
this.personOptions = res.rows
|
|
this.personOptions = res.rows
|
|
}
|
|
}
|
|
- if (type == 'DEPT_PARAM') {
|
|
|
|
- this.deptOptions = res.rows
|
|
|
|
|
|
+ if (type == 'LINKMAN_PARAM') {
|
|
|
|
+ this.linkOptions = res.rows
|
|
}
|
|
}
|
|
- if (type == 'MK_SALESAREA_PARAM') {
|
|
|
|
|
|
+ if (type == 'DEPT_PARAM') {
|
|
this.deptOptions = res.rows
|
|
this.deptOptions = res.rows
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -539,7 +558,7 @@ export default {
|
|
this.basicForm.chargerName = selection[0].name
|
|
this.basicForm.chargerName = selection[0].name
|
|
}
|
|
}
|
|
if(this.referCondition.type == 'MK_SALESAREA_PARAM') {
|
|
if(this.referCondition.type == 'MK_SALESAREA_PARAM') {
|
|
- this.personOptions = selection
|
|
|
|
|
|
+ this.salesAreaOptions = selection
|
|
this.basicForm.marketingArea = selection[0].id
|
|
this.basicForm.marketingArea = selection[0].id
|
|
this.basicForm.marketingAreaName = selection[0].name
|
|
this.basicForm.marketingAreaName = selection[0].name
|
|
}
|
|
}
|
|
@@ -560,16 +579,30 @@ export default {
|
|
return date;
|
|
return date;
|
|
},
|
|
},
|
|
//获取下周七天日期,day表示想要星期几
|
|
//获取下周七天日期,day表示想要星期几
|
|
- getWeek(day) {
|
|
|
|
|
|
+ getNextWeek(day) {
|
|
const week = [];
|
|
const week = [];
|
|
for (let i = 0; i < 7; i++) {
|
|
for (let i = 0; i < 7; i++) {
|
|
let Stamp = new Date();
|
|
let Stamp = new Date();
|
|
- let num = 7-Stamp.getDay() + 1 + i;
|
|
|
|
|
|
+ let num = 7 - Stamp.getDay() + 1 + i;
|
|
Stamp.setDate(Stamp.getDate() + num);
|
|
Stamp.setDate(Stamp.getDate() + num);
|
|
week[i] = Stamp.getFullYear() + '-' + (Stamp.getMonth() + 1) + '-' + Stamp.getDate();
|
|
week[i] = Stamp.getFullYear() + '-' + (Stamp.getMonth() + 1) + '-' + Stamp.getDate();
|
|
}
|
|
}
|
|
return week[day - 1];
|
|
return week[day - 1];
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //新增时默认带出num条明细行
|
|
|
|
+ defaultDetailLine(num) {
|
|
|
|
+ for (let i = 0; i < num; i++) {
|
|
|
|
+ this.addLine(this.getNextWeek(i + 1));
|
|
|
|
+ }
|
|
|
|
+ this.isFlag = true;
|
|
|
|
+ },
|
|
|
|
+ //必选标识
|
|
|
|
+ addRedStar(h, { column }) {
|
|
|
|
+ return [
|
|
|
|
+ h('span', { style: 'color: #F56C6C' }, '*'),
|
|
|
|
+ h('span', ' ' + column.label)
|
|
|
|
+ ];
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -585,7 +618,7 @@ export default {
|
|
.btn_grooup {
|
|
.btn_grooup {
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: flex-end;
|
|
|
|
|
|
+ justify-content: space-between;
|
|
}
|
|
}
|
|
.hang {
|
|
.hang {
|
|
margin: auto;
|
|
margin: auto;
|