|
@@ -28,6 +28,10 @@ export default {
|
|
|
code: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ val: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -38,28 +42,53 @@ export default {
|
|
|
list: []
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
methods: {
|
|
|
getList() {
|
|
|
- if(this.code =='SALES_BILL_STATUS'){
|
|
|
- this.list= [
|
|
|
- { id: 1099, isChecked: false,code:'WAIT_SUBMIT', dispName: '待提交' },
|
|
|
- { id: 1100, isChecked: false,code:'SALES_BILL_STATUS', dispName: '待审核' },
|
|
|
- { id: 1102, isChecked: false,code:'SALES_BILL_STATUS', dispName: '待出库' },
|
|
|
- { id: 1103, isChecked: false, code:'FINISH',dispName: '已完结' }
|
|
|
- ]
|
|
|
- }else{
|
|
|
+ if (this.code == 'SALES_BILL_STATUS') {
|
|
|
+ var newList = [
|
|
|
+ { id: 1099, isChecked: false, code: 'WAIT_SUBMIT', dispName: '待提交' },
|
|
|
+ { id: 1100, isChecked: false, code: 'WAIT_AUDIT', dispName: '待审核' },
|
|
|
+ { id: 1102, isChecked: false, code: 'WAIT_OUT_WAREHOUSE', dispName: '待出库' },
|
|
|
+ { id: 1103, isChecked: false, code: 'FINISH', dispName: '已完结' }
|
|
|
+ ];
|
|
|
+ if (this.val) {
|
|
|
+ //勾选上次选中值
|
|
|
+ let valArr = this.val.split(',');
|
|
|
+ newList.forEach(con => {
|
|
|
+ valArr.forEach(item => {
|
|
|
+ if (con.code == item) {
|
|
|
+ con.isChecked = true;
|
|
|
+ } else {
|
|
|
+ con.isChecked = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.list = newList;
|
|
|
+ } else {
|
|
|
getLookUpDatas({
|
|
|
lookupCode: this.code,
|
|
|
pageNo: 1,
|
|
|
pageSize: 1000
|
|
|
}).then(result => {
|
|
|
- if (result && result.status + '' === '200') {
|
|
|
- result.data.list.forEach(con => {
|
|
|
- con.isChecked = false
|
|
|
- });
|
|
|
+ if (result && result.status == 200) {
|
|
|
+ if (this.val) {
|
|
|
+ //勾选上次选中值
|
|
|
+ let valArr = this.val.split(',');
|
|
|
+ result.data.list.forEach(con => {
|
|
|
+ valArr.forEach(item => {
|
|
|
+ if (con.code == item) {
|
|
|
+ con.isChecked = true;
|
|
|
+ } else {
|
|
|
+ con.isChecked = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ result.data.list.forEach(con => {
|
|
|
+ con.isChecked = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
this.list = result.data.list;
|
|
|
}
|
|
|
});
|
|
@@ -88,6 +117,8 @@ export default {
|
|
|
isShow(newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
this.$emit('close');
|
|
|
+ } else {
|
|
|
+ this.getList();
|
|
|
}
|
|
|
}
|
|
|
}
|