选择产品线时记录上一次选择的分发责任人

This commit is contained in:
宋伟佳
2021-09-17 14:15:41 +08:00
parent f8d975cbaf
commit f0a3e4db28
2 changed files with 23 additions and 4 deletions
@@ -153,8 +153,8 @@
placeholder="请选择分发负责人"
readonly
@click.native="choiceZRR(scope,'distributePerson', '选择分发责任人', roleForm.distributePerson)"
v-if="!scope.row.distributePerson"></el-input>
<span v-else>{{ scope.row.distributePerson }}</span>
></el-input>
<!-- <span v-else>{{ scope.row.distributePerson }}</span>-->
</template>
<!-- <template slot-scope="scope,text" v-if="showColumn">-->
<!-- <div>-->
@@ -563,6 +563,7 @@ export default {
distributePerson: "", //分发责任人
distributePersonId: "", //分发责任人id
id: "",
pastProject: [], //用来存放上次选中的产品线信息
sarStandProjectLibraries: [{
projectManager: "",
projectLevel: "",
@@ -710,6 +711,7 @@ export default {
},
//确认添加事件
okStand() {
this.pastProject = JSON.parse(localStorage.getItem('projectList'))
let proData = [];
if (this.dataList.length >= 1) {
this.dataList.forEach(item => {
@@ -727,6 +729,14 @@ export default {
this.standModel = false;
} else {
if (this.standList.length >= 1) {
this.pastProject.forEach(item => {
this.standList.map(items => {
if( item.productLine === items.productLine){
items.distributePersonId = item.distributePersonId
items.distributePerson = item.distributePerson
}
})
})
this.dataList = this.standList;
this.roleForm.directorUser = this.dataList[0].uname;
this.listForm.dataList = this.standList;
@@ -774,6 +784,7 @@ export default {
this.isSubmit = true;
this.listForm.commentText = this.commentText;
var json = Object.assign(this.listForm, this.roleForm);
localStorage.setItem('projectList', JSON.stringify(this.dataList))
this.$refs["listForm"].validate((valid) => {
if (valid) {
this.$refs["roleForm"].validate((valid) => {
@@ -686,7 +686,7 @@ export default {
},
//确认添加事件
okStand() {
// this.pastProject = JSON.parse(localStorage.getItem('projectList'))
this.pastProject = JSON.parse(localStorage.getItem('projectList'))
let proData = [];
if (this.dataList.length >= 1) {
this.dataList.forEach(item => {
@@ -704,6 +704,14 @@ export default {
this.standModel = false;
} else {
if (this.standList.length >= 1) {
this.pastProject.forEach(item => {
this.standList.map(items => {
if( item.productLine === items.productLine){
items.distributePersonId = item.distributePersonId
items.distributePerson = item.distributePerson
}
})
})
this.dataList = this.standList;
this.roleForm.directorUser = this.dataList[0].uname;
this.listForm.dataList = this.standList;
@@ -749,7 +757,7 @@ export default {
this.isSubmit = true;
this.listForm.commentText = this.commentText;
var json = Object.assign(this.listForm, this.roleForm);
// localStorage.setItem('projectList', JSON.stringify(this.dataList))
localStorage.setItem('projectList', JSON.stringify(this.dataList))
this.$refs["listForm"].validate((valid) => {
if (valid) {
this.$refs["roleForm"].validate((valid) => {