lion 5 months ago
parent a0ae56ecac
commit ea8718d002

@ -245,7 +245,7 @@
}, },
created() { created() {
this.uploadOther.token = getToken(); this.uploadOther.token = getToken();
this.getProductList() // this.getProductList()
this.getApplicationList() this.getApplicationList()
// this.getAppSpecial() // this.getAppSpecial()
}, },
@ -301,8 +301,17 @@
page_size: 100, page_size: 100,
page: this.productPage page: this.productPage
}) })
this.lastPage = res.last_page this.lastPage = res.last_page
this.productList.push(...res.data) if(this.type==='editor'){
const uniqueB = res.data.filter(itemB =>
!this.form.product_numbers_details.some(itemC => itemC.id === itemB.id)
);
this.productList.push(...uniqueB)
}else{
this.productList.push(...res.data)
}
}, },
loadMore() { loadMore() {
// //
@ -349,8 +358,8 @@
}, },
getDetail() { async getDetail() {
show({ await show({
table_name: this.table_name, table_name: this.table_name,
id: this.id id: this.id
}).then(res => { }).then(res => {
@ -364,6 +373,10 @@
this.form.separation_mode = res.separation_mode ? res.separation_mode : [] this.form.separation_mode = res.separation_mode ? res.separation_mode : []
this.form.broad_sample_type = res.broad_sample_type ? res.broad_sample_type : [] this.form.broad_sample_type = res.broad_sample_type ? res.broad_sample_type : []
this.form.specific_sample = res.specific_sample ? res.specific_sample : [] this.form.specific_sample = res.specific_sample ? res.specific_sample : []
if(res.product_numbers_details && res.product_numbers_details.length>0){
this.productList.unshift(...res.product_numbers_details)
}
if (res.files_details && res.files_details.length > 0) { if (res.files_details && res.files_details.length > 0) {
this.filesList = [] this.filesList = []
res.files_details.map(item => { res.files_details.map(item => {
@ -381,16 +394,20 @@
isShow(newVal) { isShow(newVal) {
if (newVal) { if (newVal) {
if (this.type === 'editor') { if (this.type === 'editor') {
this.getDetail() this.getDetail()
this.getProductList()
} else { } else {
this.form.date = this.$moment().format('YYYY-MM-DD HH:mm:ss') this.form.date = this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.getProductList()
} }
} else { } else {
this.id = '' this.id = ''
this.filesList = [] this.filesList = []
this.showProgress = false; this.showProgress = false;
this.uploadProgress = 0; this.uploadProgress = 0;
this.productList = []
this.productPage = 1
this.form = { this.form = {
category_ids: [], category_ids: [],
application_ids: [], application_ids: [],

Loading…
Cancel
Save