1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /**
- * 标准清单库
- *
- * @author CaiAoLin
- * @date 2017/8/4
- * @version
- */
- import BaseModel from "../../common/base/base_model";
- import STDBillsLibListsSchema from "./schemas/std_bills_lib_lists";
- class STDBillsLibListsModel extends BaseModel {
- /**
- * 构造函数
- *
- * @return {void}
- */
- constructor() {
- let parent = super();
- parent.model = STDBillsLibListsSchema;
- parent.init();
- }
- /**
- * 获取标准清单
- *
- * @return {Promise}
- */
- async getBillList() {
- let result = false;
- let billLib = await this.findDataByCondition({deleted: false}, null, false);
- if (billLib.length <= 0) {
- return result;
- }
- // 整理数据
- let billList = {};
- for(let tmp of billLib) {
- let tmpRation = {id: tmp.billsLibId, name: tmp.billsLibName};
- if (billList[tmp.localeType] === undefined) {
- billList[tmp.localeType] = [tmpRation];
- } else {
- billList[tmp.localeType].push(tmpRation);
- }
- }
- result = billList;
- return result;
- }
- }
- export default STDBillsLibListsModel;
|