ionic-vhframeworks 6.6.4 → 6.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -118,6 +118,35 @@ export declare class VhAlgorithm {
|
|
|
118
118
|
* Ham đổi chuỗi alias có dấu thành không dấu
|
|
119
119
|
*/
|
|
120
120
|
changeAlias(alias: any): any;
|
|
121
|
+
/**
|
|
122
|
+
* Hàm này lấy về 1 unit của sản phẩm theo ratio truyền vào
|
|
123
|
+
* @example
|
|
124
|
+
* let unit = this.vhAlgorithm.getUnit_byRatio(units, 1, 1);
|
|
125
|
+
* @param units
|
|
126
|
+
* @param ratio
|
|
127
|
+
* @param type
|
|
128
|
+
* type = 1 : unit của sản phẩm
|
|
129
|
+
* type = 2 : unit của dịch vụ
|
|
130
|
+
* type = 3 : unit của combo
|
|
131
|
+
* type = 4 : unit của coupon
|
|
132
|
+
* type = 5 : unit của voucher
|
|
133
|
+
* type = 6 : unit của payment_card
|
|
134
|
+
* @return Object => obj = {} hoặc null
|
|
135
|
+
*/
|
|
136
|
+
getUnit_byRatio(units: any, ratio: number, type?: number): any;
|
|
137
|
+
/**
|
|
138
|
+
* Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length
|
|
139
|
+
* @param length: không truyền length vào mặc định chuỗi tạo ra có chiều dài 24
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
createObjectID(length?: number): string;
|
|
143
|
+
/**
|
|
144
|
+
* Hàm này tạo chuỗi ký tự (ID) từ bí danh truyền vào (alias)
|
|
145
|
+
* @param alias
|
|
146
|
+
* @param length chiều dài chuỗi ký tự ID được tạo ra; ko truyền vào chiều dãi ID = chiều dài chuỗi alias
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
createObjectID_fromAlias(alias: string, length?: number): string;
|
|
121
150
|
/**
|
|
122
151
|
* @example
|
|
123
152
|
let bill_code = this.vhAlgorithmcreateBillCode();
|
|
@@ -10973,13 +11002,16 @@ export declare class VhQueryAutoWeb {
|
|
|
10973
11002
|
private vhQuery;
|
|
10974
11003
|
private vhAuth;
|
|
10975
11004
|
private vhAlgorithm;
|
|
11005
|
+
private branchs;
|
|
10976
11006
|
private subprojects;
|
|
10977
11007
|
private pages;
|
|
10978
11008
|
private blocks;
|
|
10979
11009
|
private objects;
|
|
10980
11010
|
private hwinfo;
|
|
10981
11011
|
private subproject_working;
|
|
11012
|
+
private branch_working;
|
|
10982
11013
|
private callbacksyncobject_properties;
|
|
11014
|
+
private webappserverURL_vhuserweb;
|
|
10983
11015
|
constructor(vhMGDB_database: VhMGDB_database, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm);
|
|
10984
11016
|
/**
|
|
10985
11017
|
* @example:
|
|
@@ -11014,6 +11046,126 @@ export declare class VhQueryAutoWeb {
|
|
|
11014
11046
|
* @returns void
|
|
11015
11047
|
*/
|
|
11016
11048
|
closeSyncObject_Properties(): void;
|
|
11049
|
+
/**
|
|
11050
|
+
* @example:
|
|
11051
|
+
* this.vhQueryAutoWeb.addDoc_vhuserweb('atw_pages',{name:name: 'Quảng cáo 1'})
|
|
11052
|
+
.then((ads)=>{
|
|
11053
|
+
console.log('addDoc', ads);
|
|
11054
|
+
}, error=>{
|
|
11055
|
+
console.log('error', error);
|
|
11056
|
+
})
|
|
11057
|
+
* @param data
|
|
11058
|
+
* @return Promise => object = {}
|
|
11059
|
+
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
|
|
11060
|
+
*/
|
|
11061
|
+
private addDoc_vhuserweb;
|
|
11062
|
+
/**
|
|
11063
|
+
* @example:
|
|
11064
|
+
* this.vhQueryAutoWeb.updateDoc_vhuserweb('categories', '5fb6780ca2148e09806c5b01', {name: 'Quảng cáo 1'})
|
|
11065
|
+
.then((bool:any)=>{
|
|
11066
|
+
console.log('updateDoc', bool);
|
|
11067
|
+
}, error=>{
|
|
11068
|
+
console.log('error', error);
|
|
11069
|
+
})
|
|
11070
|
+
* @param id_doc
|
|
11071
|
+
* @param data
|
|
11072
|
+
* @return Promise => bool = true or false
|
|
11073
|
+
*/
|
|
11074
|
+
private updateDoc_vhuserweb;
|
|
11075
|
+
/**
|
|
11076
|
+
* @example:
|
|
11077
|
+
* this.vhQueryAutoWeb.deleteDoc('categories', '5fb67fda87c0f21d484cbdf3')
|
|
11078
|
+
.then((bool:any)=>{
|
|
11079
|
+
console.log('deleteDoc', bool);
|
|
11080
|
+
}, error=>{
|
|
11081
|
+
reject(error)
|
|
11082
|
+
})
|
|
11083
|
+
* @param id_doc
|
|
11084
|
+
* @return Promise => bool = true or false
|
|
11085
|
+
*/
|
|
11086
|
+
private deleteDoc_vhuserweb;
|
|
11087
|
+
/**
|
|
11088
|
+
* @example
|
|
11089
|
+
* this.vhQueryAutoWeb.getDoc_fromService_vhuserweb('categories', '5fb67fda87c0f21d484cbdf3')
|
|
11090
|
+
.then((doc)=>{
|
|
11091
|
+
console.log('getDoc_fromService_vhuserweb', doc);
|
|
11092
|
+
})
|
|
11093
|
+
* @param id_doc
|
|
11094
|
+
* @return null or object
|
|
11095
|
+
*/
|
|
11096
|
+
private getDoc_fromService_vhuserweb;
|
|
11097
|
+
/**
|
|
11098
|
+
* @example
|
|
11099
|
+
* this.vhQueryAutoWeb.getDoc_fromService_vhuserweb('categories', '5fb67fda87c0f21d484cbdf3')
|
|
11100
|
+
.then((doc)=>{
|
|
11101
|
+
console.log('getDoc_fromService_vhuserweb', doc);
|
|
11102
|
+
})
|
|
11103
|
+
* @param id_doc
|
|
11104
|
+
* @return null or object
|
|
11105
|
+
*/
|
|
11106
|
+
private getDoc_fromDatabase_vhuserweb;
|
|
11107
|
+
/**
|
|
11108
|
+
* @example:
|
|
11109
|
+
* this.vhQueryAutoWeb.getDocs_fromService_byFields_byPages_vhuserweb('webapp_abouts', {name:{$eq:'name abc'}}, {},{},6,1)
|
|
11110
|
+
.then(response=>{
|
|
11111
|
+
console.log('response', response);
|
|
11112
|
+
if(response.vcode === 0){
|
|
11113
|
+
//-----------your code-----------
|
|
11114
|
+
let products = response.data;
|
|
11115
|
+
}
|
|
11116
|
+
},error=>{
|
|
11117
|
+
console.log('error', error)
|
|
11118
|
+
})
|
|
11119
|
+
* @param colname
|
|
11120
|
+
* @param query
|
|
11121
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
11122
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
11123
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11124
|
+
* @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
|
|
11125
|
+
* @return Promise object => response = {vcode, message, data(array), limit, page, totalpages}
|
|
11126
|
+
*/
|
|
11127
|
+
private getDocs_fromService_byFields_byPages_vhuserweb;
|
|
11128
|
+
/**
|
|
11129
|
+
* @example:
|
|
11130
|
+
* this.vhQueryAutoWeb.getDocs_byFields_fromService_vhuserweb('webapp_abouts', {name:{$eq:'name abc'}}, {},{},6,1)
|
|
11131
|
+
.then(response=>{
|
|
11132
|
+
console.log('response', response);
|
|
11133
|
+
if(response.vcode === 0){
|
|
11134
|
+
//-----------your code-----------
|
|
11135
|
+
let products = response.data;
|
|
11136
|
+
}
|
|
11137
|
+
},error=>{
|
|
11138
|
+
console.log('error', error)
|
|
11139
|
+
})
|
|
11140
|
+
* @param colname
|
|
11141
|
+
* @param query
|
|
11142
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
11143
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
11144
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11145
|
+
* @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
|
|
11146
|
+
* @return Promise => array(object) = [{},{},..]
|
|
11147
|
+
*/
|
|
11148
|
+
private getDocs_fromService_byFields_vhuserweb;
|
|
11149
|
+
/**
|
|
11150
|
+
* @example:
|
|
11151
|
+
* this.vhQueryAutoWeb.getDocs_byFields_fromService_vhuserweb('webapp_abouts', {name:{$eq:'name abc'}}, {},{},6,1)
|
|
11152
|
+
.then(response=>{
|
|
11153
|
+
console.log('response', response);
|
|
11154
|
+
if(response.vcode === 0){
|
|
11155
|
+
//-----------your code-----------
|
|
11156
|
+
let products = response.data;
|
|
11157
|
+
}
|
|
11158
|
+
},error=>{
|
|
11159
|
+
console.log('error', error)
|
|
11160
|
+
})
|
|
11161
|
+
* @param colname
|
|
11162
|
+
* @param query
|
|
11163
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
11164
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
11165
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11166
|
+
* @return Promise => array(object) = [{},{},..]
|
|
11167
|
+
*/
|
|
11168
|
+
private getDocs_fromDatabase_byFields_vhuserweb;
|
|
11017
11169
|
/**
|
|
11018
11170
|
* @example:
|
|
11019
11171
|
* this.vhQueryAutoWeb.addDoc('categories'{name:name: 'Quảng cáo 1'})
|
|
@@ -11026,7 +11178,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11026
11178
|
* @return Promise => object = {}
|
|
11027
11179
|
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
|
|
11028
11180
|
*/
|
|
11029
|
-
addDoc
|
|
11181
|
+
private addDoc;
|
|
11030
11182
|
/**
|
|
11031
11183
|
* @example:
|
|
11032
11184
|
* this.vhQueryAutoWeb.updateDoc('categories', '5fb6780ca2148e09806c5b01', {name: 'Quảng cáo 1'})
|
|
@@ -11039,7 +11191,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11039
11191
|
* @param data
|
|
11040
11192
|
* @return Promise => bool = true or false
|
|
11041
11193
|
*/
|
|
11042
|
-
updateDoc
|
|
11194
|
+
private updateDoc;
|
|
11043
11195
|
/**
|
|
11044
11196
|
* @example:
|
|
11045
11197
|
* this.vhQueryAutoWeb.deleteDoc('categories', '5fb67fda87c0f21d484cbdf3')
|
|
@@ -11051,7 +11203,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11051
11203
|
* @param id_doc
|
|
11052
11204
|
* @return Promise => bool = true or false
|
|
11053
11205
|
*/
|
|
11054
|
-
deleteDoc
|
|
11206
|
+
private deleteDoc;
|
|
11055
11207
|
/**
|
|
11056
11208
|
* @example
|
|
11057
11209
|
* this.vhQueryAutoWeb.getDoc('categories', '5fb67fda87c0f21d484cbdf3')
|
|
@@ -11061,7 +11213,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11061
11213
|
* @param id_doc
|
|
11062
11214
|
* @return false or object
|
|
11063
11215
|
*/
|
|
11064
|
-
getDoc
|
|
11216
|
+
private getDoc;
|
|
11065
11217
|
/**
|
|
11066
11218
|
* @example
|
|
11067
11219
|
* this.vhQueryAutoWeb.getDocs_byFields('categories', {quantity:{$gte:10}}, {}, {}, 0)
|
|
@@ -11074,7 +11226,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11074
11226
|
* @param limit
|
|
11075
11227
|
* @return Promise => array(object) = [{},{},..]
|
|
11076
11228
|
*/
|
|
11077
|
-
getDocs_byFields
|
|
11229
|
+
private getDocs_byFields;
|
|
11078
11230
|
/**
|
|
11079
11231
|
* @example:
|
|
11080
11232
|
* let subproject = this.vhQueryAutoWeb.getlocalSubProject('5fb6780ca2148e09806c5b01');
|
|
@@ -11103,7 +11255,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11103
11255
|
* Hàm này refresh giá trị mới nhất cho hàm getlocalSubProject(), getlocalSubProjects() trong localstorage
|
|
11104
11256
|
* @return Promise => null
|
|
11105
11257
|
*/
|
|
11106
|
-
refreshLocalSubProjects
|
|
11258
|
+
private refreshLocalSubProjects;
|
|
11107
11259
|
/**
|
|
11108
11260
|
* @example:
|
|
11109
11261
|
* this.vhQueryAutoWeb.addSubProject({name:'Dự án website siêu thị mini'})
|
|
@@ -11166,7 +11318,29 @@ export declare class VhQueryAutoWeb {
|
|
|
11166
11318
|
* @param id_subproject
|
|
11167
11319
|
* @return boolean => true or false
|
|
11168
11320
|
*/
|
|
11169
|
-
checkSubProject(id_subproject: string):
|
|
11321
|
+
checkSubProject(id_subproject: string): Promise<unknown>;
|
|
11322
|
+
/**
|
|
11323
|
+
* @example:
|
|
11324
|
+
* this.vhQueryAutoWeb.addBranch({name:'Chi nhánh 2'})
|
|
11325
|
+
.then((branch)=>{
|
|
11326
|
+
console.log('addBranch', branch);
|
|
11327
|
+
},error=>{
|
|
11328
|
+
console.log('error', error);
|
|
11329
|
+
})
|
|
11330
|
+
* @param data
|
|
11331
|
+
* @return Promise => obj = {}
|
|
11332
|
+
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
|
|
11333
|
+
*/
|
|
11334
|
+
addBranch(data: any): Promise<unknown>;
|
|
11335
|
+
/**
|
|
11336
|
+
* @example
|
|
11337
|
+
* this.vhQueryAutoWeb.getbranchs()
|
|
11338
|
+
.then((response)=>{
|
|
11339
|
+
console.log('getbranchs', response);
|
|
11340
|
+
})
|
|
11341
|
+
* @return array(object) = [{},{},..]
|
|
11342
|
+
*/
|
|
11343
|
+
private getbranchs;
|
|
11170
11344
|
/**
|
|
11171
11345
|
* @example:
|
|
11172
11346
|
* this.vhQueryAutoWeb.addPage({name:'Danh mục 1'})
|
|
@@ -11322,7 +11496,7 @@ export declare class VhQueryAutoWeb {
|
|
|
11322
11496
|
* @param data
|
|
11323
11497
|
* @return Promise => bool = true or false
|
|
11324
11498
|
*/
|
|
11325
|
-
updateBlock(
|
|
11499
|
+
updateBlock(id_page: string, data: object): Promise<unknown>;
|
|
11326
11500
|
/**
|
|
11327
11501
|
* @example:
|
|
11328
11502
|
* this.vhQueryAutoWeb.deleteBlock('5fb67fda87c0f21d484cbdf3')
|
|
@@ -11355,17 +11529,17 @@ export declare class VhQueryAutoWeb {
|
|
|
11355
11529
|
*/
|
|
11356
11530
|
getBlocks_byIDpage(id_page: any): Promise<unknown>;
|
|
11357
11531
|
/**
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11532
|
+
* @example
|
|
11533
|
+
* this.vhQueryAutoWeb.getBlocks_byFields({id_subproject:{$eq:'00Tm41GNYN0aYbAtuncH'}}, {}, {}, 0)
|
|
11534
|
+
.then((pages)=>{
|
|
11535
|
+
console.log('getBlocks_byFields', pages);
|
|
11536
|
+
})
|
|
11537
|
+
* @param query
|
|
11538
|
+
* @param projection
|
|
11539
|
+
* @param sort
|
|
11540
|
+
* @param limit
|
|
11541
|
+
* @return Promise => array(object) = [{},{},..]
|
|
11542
|
+
*/
|
|
11369
11543
|
getBlocks_byFields(query: any, projection?: object, sort?: any, limit?: number): Promise<unknown>;
|
|
11370
11544
|
/**
|
|
11371
11545
|
* Hàm này trả về 1 block (có đủ thông tin block), trong mỗi block có trường frames và objects (có đủ thông tin từng object)
|
|
@@ -11531,8 +11705,8 @@ export declare class VhQueryAutoWeb {
|
|
|
11531
11705
|
/**
|
|
11532
11706
|
* @example:
|
|
11533
11707
|
* this.vhQueryAutoWeb.addProduct({name:'Danh mục 1'})
|
|
11534
|
-
.then((
|
|
11535
|
-
console.log('addProduct',
|
|
11708
|
+
.then((product)=>{
|
|
11709
|
+
console.log('addProduct', product);
|
|
11536
11710
|
},error=>{
|
|
11537
11711
|
console.log('error', error);
|
|
11538
11712
|
})
|
|
@@ -11572,15 +11746,6 @@ export declare class VhQueryAutoWeb {
|
|
|
11572
11746
|
* @return Promise => obj ={} or null
|
|
11573
11747
|
*/
|
|
11574
11748
|
getProduct(id_product: string): Promise<unknown>;
|
|
11575
|
-
/**
|
|
11576
|
-
* @example
|
|
11577
|
-
* this.vhQueryAutoWeb.getProducts()
|
|
11578
|
-
.then((response)=>{
|
|
11579
|
-
console.log('getProducts', response);
|
|
11580
|
-
})
|
|
11581
|
-
* @return array(object) = [{},{},..]
|
|
11582
|
-
*/
|
|
11583
|
-
private getProducts;
|
|
11584
11749
|
/**
|
|
11585
11750
|
* @example:
|
|
11586
11751
|
* this.vhQueryAutoWeb.getProducts_byFields({name:{$eq:'name abc'}}, {},{},6,1)
|
|
@@ -11601,6 +11766,216 @@ export declare class VhQueryAutoWeb {
|
|
|
11601
11766
|
* @return Promise object => response = {vcode, message, data(array), limit, page, totalpages}
|
|
11602
11767
|
*/
|
|
11603
11768
|
getProducts_byFields(query: any, projection?: object, sort?: any, limit?: number, page?: number): Promise<unknown>;
|
|
11769
|
+
/**
|
|
11770
|
+
* @example
|
|
11771
|
+
* let id_sub_or_product = id_subproduct?id_subproduct:id_product;
|
|
11772
|
+
* this.vhSalesWebAPPAdmin.getDetailProduct(id_sub_or_product)
|
|
11773
|
+
.then(response=>{
|
|
11774
|
+
console.log('response', response);
|
|
11775
|
+
if(response.vcode === 0){
|
|
11776
|
+
//-----------your code-----------
|
|
11777
|
+
let product = response.data;
|
|
11778
|
+
}
|
|
11779
|
+
},error=>{
|
|
11780
|
+
console.log('error', error)
|
|
11781
|
+
})
|
|
11782
|
+
* @param id_sub_or_product
|
|
11783
|
+
* @return Promise object => response = {vcode, message, data(object)}
|
|
11784
|
+
*/
|
|
11785
|
+
getDetailProduct(id_sub_or_product: any): Promise<unknown>;
|
|
11786
|
+
/**
|
|
11787
|
+
* @example:
|
|
11788
|
+
* this.vhSalesWebAPPAdmin.getDetailProductsByFields({name:{$eq:'name abc'}}, {},{},6,1)
|
|
11789
|
+
.then(response=>{
|
|
11790
|
+
console.log('response', response);
|
|
11791
|
+
if(response.vcode === 0){
|
|
11792
|
+
//-----------your code-----------
|
|
11793
|
+
let products = response.data;
|
|
11794
|
+
}
|
|
11795
|
+
},error=>{
|
|
11796
|
+
console.log('error', error)
|
|
11797
|
+
})
|
|
11798
|
+
* @param query
|
|
11799
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
11800
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
11801
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11802
|
+
* @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
|
|
11803
|
+
* @return Promise object => response = {vcode, message, data(array), limit, page, totalpages}
|
|
11804
|
+
*/
|
|
11805
|
+
getDetailProductsByFields(query: object, projection?: object, sort?: object, limit?: number, page?: number): Promise<unknown>;
|
|
11806
|
+
/**
|
|
11807
|
+
* hàm này tạo product và thêm subs vào product (lần đầu)
|
|
11808
|
+
* Lưu ý: trong product, subProductArray không có các trường quantity, quantity_branch và subs
|
|
11809
|
+
* @example:
|
|
11810
|
+
* @case 1: manysize (false)
|
|
11811
|
+
* let product = {
|
|
11812
|
+
allow_sell: true,
|
|
11813
|
+
brand: "OEM",
|
|
11814
|
+
id_category: "vTr90aYfhDqSCyuRh4DR",
|
|
11815
|
+
img: "image link",
|
|
11816
|
+
manysize: false,
|
|
11817
|
+
name: "test ko sub 3",
|
|
11818
|
+
selling: true,
|
|
11819
|
+
type: 1,
|
|
11820
|
+
warning_number: 3,
|
|
11821
|
+
units:[{
|
|
11822
|
+
barcode: "3103",
|
|
11823
|
+
price: 3100,
|
|
11824
|
+
price2: 3101,
|
|
11825
|
+
price_import: 3102,
|
|
11826
|
+
ratio: 1,
|
|
11827
|
+
unit: "Cái"
|
|
11828
|
+
}]
|
|
11829
|
+
* }
|
|
11830
|
+
* @case 2: manysize (true)
|
|
11831
|
+
* let product = {
|
|
11832
|
+
allow_sell: true,
|
|
11833
|
+
brand: "OEM",
|
|
11834
|
+
id_category: "vTr90aYfhDqSCyuRh4DR",
|
|
11835
|
+
img: "image link",
|
|
11836
|
+
manysize: true,
|
|
11837
|
+
name: "test sub 4",
|
|
11838
|
+
selling: true,
|
|
11839
|
+
type: 1,
|
|
11840
|
+
warning_number: 3,
|
|
11841
|
+
units:[{
|
|
11842
|
+
ratio: 1,
|
|
11843
|
+
unit: "Cái"
|
|
11844
|
+
},{
|
|
11845
|
+
barcode: "4203",
|
|
11846
|
+
price: 4200,
|
|
11847
|
+
price2: 4101,
|
|
11848
|
+
price_import: 4202,
|
|
11849
|
+
ratio: 10,
|
|
11850
|
+
unit: "Hộp"
|
|
11851
|
+
}]
|
|
11852
|
+
}
|
|
11853
|
+
let subProductArray = [{
|
|
11854
|
+
barcode: "43004",
|
|
11855
|
+
name: "Lớn",
|
|
11856
|
+
price: 43000,
|
|
11857
|
+
price2: 43002,
|
|
11858
|
+
price_import: 43001,
|
|
11859
|
+
warning_number: 43003
|
|
11860
|
+
}]
|
|
11861
|
+
* this.vhSalesWebAPPAdmin.addProductAndSubsProduct(product,subProductArray)
|
|
11862
|
+
.then(response=>{
|
|
11863
|
+
console.log('response', response);
|
|
11864
|
+
if(response.vcode === 0){
|
|
11865
|
+
//-----------your code-----------
|
|
11866
|
+
}
|
|
11867
|
+
},error=>{
|
|
11868
|
+
console.log('error', error)
|
|
11869
|
+
})
|
|
11870
|
+
* @param product
|
|
11871
|
+
* @param subProductArray
|
|
11872
|
+
* @return Promise object => response = {vcode, message}
|
|
11873
|
+
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject)
|
|
11874
|
+
*/
|
|
11875
|
+
addProductAndSubsProduct(product: any, subProductArray: any): Promise<unknown>;
|
|
11876
|
+
/**
|
|
11877
|
+
* Hàm này cập nhật lại những thay đổi trong sub (cỡ) của sản phẩm
|
|
11878
|
+
* @example:
|
|
11879
|
+
* this.vhSalesWebAPPAdmin.updateSubProduct('5fb6780ca2148e09806c5b01', {quantity:400})
|
|
11880
|
+
.then(response=>{
|
|
11881
|
+
console.log('response', response);
|
|
11882
|
+
if(response.vcode === 0){
|
|
11883
|
+
//-----------your code-----------
|
|
11884
|
+
}
|
|
11885
|
+
},error=>{
|
|
11886
|
+
console.log('error', error)
|
|
11887
|
+
})
|
|
11888
|
+
* @param id_subproduct
|
|
11889
|
+
* @param data
|
|
11890
|
+
* @return Promise object => response = {vcode, message}
|
|
11891
|
+
*/
|
|
11892
|
+
updateSubProduct(id_subproduct: string, value: any): Promise<unknown>;
|
|
11893
|
+
/**
|
|
11894
|
+
* Hàm này thêm Sub vào Product
|
|
11895
|
+
* @example:
|
|
11896
|
+
* let subProduct ={
|
|
11897
|
+
allow_sell: true,
|
|
11898
|
+
manylot: true,
|
|
11899
|
+
name: "Lớn",
|
|
11900
|
+
selling: true,
|
|
11901
|
+
type: 1,
|
|
11902
|
+
warning_number: 5,
|
|
11903
|
+
units:[{
|
|
11904
|
+
barcode: "384807544448",
|
|
11905
|
+
default: true,
|
|
11906
|
+
price: 70000,
|
|
11907
|
+
price2: 60000,
|
|
11908
|
+
price_import: 50000,
|
|
11909
|
+
ratio: 1,
|
|
11910
|
+
unit: "Cái"
|
|
11911
|
+
}],
|
|
11912
|
+
days_exp_warning: 30,
|
|
11913
|
+
days_import_warning: 60,
|
|
11914
|
+
lots:[{
|
|
11915
|
+
_id: "tgwOaMDVmQaHfaL8FD02SMl9"
|
|
11916
|
+
barcode: "337953449785"
|
|
11917
|
+
date_exp: 'October 7, 2022 at 11:59:59 PM UTC+7'
|
|
11918
|
+
date_mfg: 'March 1, 2022 at 12:00:00 AM UTC+7'
|
|
11919
|
+
hidden: false
|
|
11920
|
+
lot_number: "lo1101"
|
|
11921
|
+
}]
|
|
11922
|
+
}
|
|
11923
|
+
this.vhSalesWebAPPAdmin.addSubProduct('5fb6780ca2148e09806c5b01',{price:0, name:'small'})
|
|
11924
|
+
.then(response=>{
|
|
11925
|
+
console.log('response', response);
|
|
11926
|
+
if(response.vcode === 0){
|
|
11927
|
+
//-----------your code-----------
|
|
11928
|
+
}
|
|
11929
|
+
},error=>{
|
|
11930
|
+
console.log('error', error)
|
|
11931
|
+
})
|
|
11932
|
+
* @param id_product
|
|
11933
|
+
* @param subProduct
|
|
11934
|
+
*@return Promise object => response = {vcode, message, data(object)}
|
|
11935
|
+
*/
|
|
11936
|
+
addSubProduct(id_product: string, subProduct: any): Promise<unknown>;
|
|
11937
|
+
/**
|
|
11938
|
+
* Hàm này xóa sản phẩm con trong sản phẩm cha
|
|
11939
|
+
* @example:
|
|
11940
|
+
* this.vhSalesWebAPPAdmin.deleteSubProduct('5fb67fda87c0f21d484cbdf3')
|
|
11941
|
+
.then((rsp)=>{
|
|
11942
|
+
if(rsp.vcode === 0){
|
|
11943
|
+
//-----------your code 0-----------
|
|
11944
|
+
}else if(rsp.vcode === 1){
|
|
11945
|
+
//-----------your code 1-----------
|
|
11946
|
+
}else if(rsp.vcode === 2){
|
|
11947
|
+
//-----------your code 2-----------
|
|
11948
|
+
}
|
|
11949
|
+
}, error=>{
|
|
11950
|
+
reject(error)
|
|
11951
|
+
})
|
|
11952
|
+
* @param id_subproduct
|
|
11953
|
+
* @return Observable object => rsp = {vcode, message}
|
|
11954
|
+
* vcode == 0: xóa thành công
|
|
11955
|
+
* vcode == 1: Bạn không thể xóa, vì sản phẩm con này đang liên kết với sản phẩm combo khác
|
|
11956
|
+
* vcode == 2: Bạn không thể xóa, vì sản phẩm con này đã phát sinh hóa đơn
|
|
11957
|
+
*/
|
|
11958
|
+
deleteSubProduct(id_subproduct: string): Promise<unknown>;
|
|
11959
|
+
/**
|
|
11960
|
+
* @example
|
|
11961
|
+
* this.vhQueryAutoWeb.searchList('atw_products',["name", "describe"], 'Điện Thoại', 20, 1)
|
|
11962
|
+
.then(response=>{
|
|
11963
|
+
console.log('response', response);
|
|
11964
|
+
if(response.vcode === 0){
|
|
11965
|
+
//-----------your code-----------
|
|
11966
|
+
let array_searched_data = response.data;
|
|
11967
|
+
}
|
|
11968
|
+
},error=>{
|
|
11969
|
+
console.log('error', error)
|
|
11970
|
+
})
|
|
11971
|
+
* @param colname
|
|
11972
|
+
* @param array_field
|
|
11973
|
+
* @param value
|
|
11974
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11975
|
+
* @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
|
|
11976
|
+
* @return Promise object => response = {vcode, message, data(array), limit, page, totalpages}
|
|
11977
|
+
*/
|
|
11978
|
+
searchList(colname: string, array_field: any, value: string, limit: number, page: number): Promise<unknown>;
|
|
11604
11979
|
/**
|
|
11605
11980
|
* @example:
|
|
11606
11981
|
* this.vhQueryAutoWeb.addCategory({name:'Danh mục 1'})
|