|
@@ -16,11 +16,11 @@
|
|
</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">
|
|
<el-input
|
|
<el-input
|
|
v-model.trim="basicForm.planName"
|
|
v-model.trim="basicForm.planName"
|
|
size="mini"
|
|
size="mini"
|
|
- :readonly="sonDisable"
|
|
|
|
|
|
+ disabled
|
|
clearable
|
|
clearable
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
/>
|
|
/>
|
|
@@ -64,7 +64,7 @@
|
|
:disabled="sonDisable"
|
|
:disabled="sonDisable"
|
|
clearable
|
|
clearable
|
|
type="date"
|
|
type="date"
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
:picker-options="pickerOptionsStart"
|
|
:picker-options="pickerOptionsStart"
|
|
size="mini"
|
|
size="mini"
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
@@ -81,7 +81,7 @@
|
|
:disabled="sonDisable"
|
|
:disabled="sonDisable"
|
|
clearable
|
|
clearable
|
|
type="date"
|
|
type="date"
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
:picker-options="pickerOptionsEnd"
|
|
:picker-options="pickerOptionsEnd"
|
|
size="mini"
|
|
size="mini"
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
@@ -145,7 +145,7 @@
|
|
clearable
|
|
clearable
|
|
type="date"
|
|
type="date"
|
|
size="mini"
|
|
size="mini"
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
:picker-options="pickerOptions"
|
|
:picker-options="pickerOptions"
|
|
|
|
|
|
placeholder="选择日期"
|
|
placeholder="选择日期"
|
|
@@ -158,7 +158,7 @@
|
|
<el-table-column show-overflow-tooltip label="客户" prop="customerName" min-width="230" :render-header="addRedStar">
|
|
<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" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'customerName'" :rules="{ required: true, message: '请选择客户', trigger: 'blur' }">
|
|
<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="chooseCustomer(scope.$index, 'CUSTOMER_PARAM_ZT', true, '请选择客户', {charger: basicForm.charger})" @clear="clearHang(scope.$index, '请选择客户')" style="width: 200px">
|
|
|
|
|
|
+ <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '请选择客户', {charger: basicForm.charger})" @clear="clearHang(scope.$index, '请选择客户')" 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>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -168,7 +168,7 @@
|
|
<el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
|
|
<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" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
|
|
<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="chooseLinkMan(scope.$index, 'LINKMAN_PARAM', true, '请选择联系人', {customer: scope.row.customer, charger: basicForm.charger})" style="width: 200px">
|
|
|
|
|
|
+ <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '请选择联系人', {customer: scope.row.customer, charger: basicForm.charger})" 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>
|
|
@@ -229,9 +229,6 @@
|
|
<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-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" style="margin: 0 10px;">
|
|
<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>
|
|
@@ -302,7 +299,7 @@ export default {
|
|
//定义主表开始时间的范围不能早于今天
|
|
//定义主表开始时间的范围不能早于今天
|
|
pickerOptionsStart: {
|
|
pickerOptionsStart: {
|
|
disabledDate: (time) => {
|
|
disabledDate: (time) => {
|
|
- return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
|
|
|
|
|
|
+ return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000 || time.getTime() > (new Date(this.basicForm.deadlineTime)).getTime()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//定义主表截止时间的范围不能早于开始时间
|
|
//定义主表截止时间的范围不能早于开始时间
|
|
@@ -325,7 +322,7 @@ export default {
|
|
mounted() {},
|
|
mounted() {},
|
|
created() {
|
|
created() {
|
|
//查看系统数据
|
|
//查看系统数据
|
|
- // console.log(this.$store.state.user, 'this.$store.state.user')
|
|
|
|
|
|
+ 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)
|
|
@@ -345,8 +342,7 @@ export default {
|
|
// this.getDetails(this.row)
|
|
// this.getDetails(this.row)
|
|
this.basicForm.id = ''
|
|
this.basicForm.id = ''
|
|
this.basicForm.planCode = ''
|
|
this.basicForm.planCode = ''
|
|
- this.basicForm.createBy = ''
|
|
|
|
- this.basicForm.createTime = ''
|
|
|
|
|
|
+ this.basicForm.state = 0
|
|
//复制之后执行人和部门变为当前账号所有者
|
|
//复制之后执行人和部门变为当前账号所有者
|
|
this.basicForm.charger = this.$store.state.user.id,
|
|
this.basicForm.charger = this.$store.state.user.id,
|
|
this.basicForm.chargerName = this.$store.state.user.nickName
|
|
this.basicForm.chargerName = this.$store.state.user.nickName
|
|
@@ -364,7 +360,6 @@ export default {
|
|
// 复制新增把id,编码,创建人置为空,子表去掉id
|
|
// 复制新增把id,编码,创建人置为空,子表去掉id
|
|
this.basicForm.id = ''
|
|
this.basicForm.id = ''
|
|
this.basicForm.planCode = ''
|
|
this.basicForm.planCode = ''
|
|
- this.basicForm.createBy = ''
|
|
|
|
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) {
|
|
@@ -391,6 +386,7 @@ export default {
|
|
if(valid) {
|
|
if(valid) {
|
|
this.$modal.loading("保存中...");
|
|
this.$modal.loading("保存中...");
|
|
if(this.sonPageStu == 'add') {
|
|
if(this.sonPageStu == 'add') {
|
|
|
|
+ this.planNameAssignment();
|
|
this.handleData()
|
|
this.handleData()
|
|
addPlan(this.basicForm).then(res => {
|
|
addPlan(this.basicForm).then(res => {
|
|
console.log(333)
|
|
console.log(333)
|
|
@@ -403,6 +399,7 @@ export default {
|
|
this.$modal.closeLoading();
|
|
this.$modal.closeLoading();
|
|
})
|
|
})
|
|
} else if (this.sonPageStu == 'edit') {
|
|
} else if (this.sonPageStu == 'edit') {
|
|
|
|
+ this.planNameAssignment();
|
|
let list = []
|
|
let list = []
|
|
list.push(...this.basicForm.mkBoPlanItemList, ...this.delPlanItemList)
|
|
list.push(...this.basicForm.mkBoPlanItemList, ...this.delPlanItemList)
|
|
// 深拷贝一下参数对象
|
|
// 深拷贝一下参数对象
|
|
@@ -434,15 +431,19 @@ export default {
|
|
this.$modal.msgWarning("明细信息不能为空!");
|
|
this.$modal.msgWarning("明细信息不能为空!");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //拜访计划名称赋值
|
|
|
|
+ planNameAssignment() {
|
|
|
|
+ this.basicForm.planName = this.basicForm.chargerName + '-' + '周计划拜访' + '(' + this.basicForm.startDate.substr(5) + '至' + this.basicForm.deadlineTime.substr(5) + ')'
|
|
|
|
+ },
|
|
// 增行
|
|
// 增行
|
|
addLine(date) {
|
|
addLine(date) {
|
|
- if (this.isFlag) {
|
|
|
|
- date = this.getCurrentTime();
|
|
|
|
|
|
+ if ((this.sonPageStu == 'edit') || (this.isFlag && this.sonPageStu == 'add')) {
|
|
|
|
+ date = this.basicForm.startDate;
|
|
}
|
|
}
|
|
const newLine = {
|
|
const newLine = {
|
|
id: null,
|
|
id: null,
|
|
- planId: null,
|
|
|
|
- planCode: null,
|
|
|
|
|
|
+ planId: this.basicForm.id,
|
|
|
|
+ planCode: this.basicForm.planCode,
|
|
date: date,
|
|
date: date,
|
|
customer: null,
|
|
customer: null,
|
|
customerName: null,
|
|
customerName: null,
|
|
@@ -496,6 +497,7 @@ export default {
|
|
this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
item.planCode = this.basicForm.planCode
|
|
item.planCode = this.basicForm.planCode
|
|
})
|
|
})
|
|
|
|
+ console.log(this.basicForm.startDate)
|
|
},
|
|
},
|
|
back() {
|
|
back() {
|
|
this.$emit('jugislist', true)
|
|
this.$emit('jugislist', true)
|
|
@@ -557,33 +559,27 @@ export default {
|
|
this.referCondition.type = type
|
|
this.referCondition.type = type
|
|
this.referCondition.isPage = isPage
|
|
this.referCondition.isPage = isPage
|
|
this.referCondition.title = title
|
|
this.referCondition.title = title
|
|
- this.referCondition.parame = parame
|
|
|
|
- this.$refs.refer.init(this.referCondition)
|
|
|
|
- },
|
|
|
|
- //客户明细行选择参照带出数据
|
|
|
|
- chooseCustomer(index, type, isPage, title, parame) {
|
|
|
|
- this.tableIndex = index
|
|
|
|
- this.referCondition.type = type
|
|
|
|
- this.referCondition.isPage = isPage
|
|
|
|
- this.referCondition.title = title
|
|
|
|
- if(parame.charger) {
|
|
|
|
- this.referCondition.parame = parame
|
|
|
|
- this.$refs.refer.init(this.referCondition)
|
|
|
|
- } else {
|
|
|
|
- this.$modal.notifyWarning("请先确认执行人");
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //联系人明细行选择参照带出数据
|
|
|
|
- chooseLinkMan(index, type, isPage, title, parame) {
|
|
|
|
- this.tableIndex = index
|
|
|
|
- this.referCondition.type = type
|
|
|
|
- this.referCondition.isPage = isPage
|
|
|
|
- this.referCondition.title = title
|
|
|
|
- if(parame.customer) {
|
|
|
|
- this.referCondition.parame = parame
|
|
|
|
- this.$refs.refer.init(this.referCondition)
|
|
|
|
- } else {
|
|
|
|
- this.$modal.notifyWarning("请先确认客户");
|
|
|
|
|
|
+ if (title == "请选择客户") {
|
|
|
|
+ if(parame.charger) {
|
|
|
|
+ this.referCondition.parame = parame
|
|
|
|
+ this.$refs.refer.init(this.referCondition)
|
|
|
|
+ } else {
|
|
|
|
+ this.$modal.notifyWarning("请先确认执行人");
|
|
|
|
+ }
|
|
|
|
+ } else if (title == "请选择联系人") {
|
|
|
|
+ if(parame.customer) {
|
|
|
|
+ this.referCondition.parame = parame
|
|
|
|
+ this.$refs.refer.init(this.referCondition)
|
|
|
|
+ } else {
|
|
|
|
+ this.$modal.notifyWarning("请先确认客户");
|
|
|
|
+ }
|
|
|
|
+ } else if (title == "请选择商机") {
|
|
|
|
+ if(parame.customer) {
|
|
|
|
+ this.referCondition.parame = parame
|
|
|
|
+ this.$refs.refer.init(this.referCondition)
|
|
|
|
+ } else {
|
|
|
|
+ this.$modal.notifyWarning("请先确认客户");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//联动清除明细行里其它的字段
|
|
//联动清除明细行里其它的字段
|
|
@@ -591,7 +587,20 @@ export default {
|
|
if (title == '请选择执行人') {
|
|
if (title == '请选择执行人') {
|
|
this.basicForm.dept = null
|
|
this.basicForm.dept = null
|
|
this.basicForm.deptName = null
|
|
this.basicForm.deptName = null
|
|
|
|
+ this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
|
|
+ item.customer = null
|
|
|
|
+ item.customerName = null
|
|
|
|
+ item.contact = null
|
|
|
|
+ item.contactName = null
|
|
|
|
+ item.bo = null
|
|
|
|
+ item.boName = null
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+ // if (title == '请选择开始时间' || title == '请选择截止时间') {
|
|
|
|
+ // this.basicForm.mkBoPlanItemList.forEach(item => {
|
|
|
|
+ // item.date = null
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
if (title == '请选择客户') {
|
|
if (title == '请选择客户') {
|
|
this.basicForm.mkBoPlanItemList[index].contact = null
|
|
this.basicForm.mkBoPlanItemList[index].contact = null
|
|
this.basicForm.mkBoPlanItemList[index].contactName = null
|
|
this.basicForm.mkBoPlanItemList[index].contactName = null
|
|
@@ -659,7 +668,7 @@ export default {
|
|
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() + ' ' + '00:00:00';
|
|
|
|
|
|
+ week[i] = Stamp.getFullYear() + '-' + (Stamp.getMonth() + 1) + '-' + Stamp.getDate();
|
|
}
|
|
}
|
|
return week[day - 1];
|
|
return week[day - 1];
|
|
},
|
|
},
|