86 lines
3.1 KiB
JavaScript
86 lines
3.1 KiB
JavaScript
'use strict';
|
|
|
|
const MainService = require('../../main');
|
|
|
|
class configService extends MainService {
|
|
constructor(ctx) {
|
|
super(ctx);
|
|
const _noNeedLogin = '';
|
|
const _noNeedRight = 'getReceivingList,get,addDetail,deleteDetail,detailChange,cancel,completeReceiving';
|
|
const _noNeedLog = 'getReceivingList,get,addDetail,deleteDetail,detailChange';
|
|
const _noNeedAuth = 'getReceivingList,get,addDetail,deleteDetail,detailChange,cancel,completeReceiving';
|
|
this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth);
|
|
}
|
|
async getReceivingList(data) {
|
|
const { service } = this;
|
|
const { pagination, where } = data;
|
|
console.log('where', where);
|
|
console.log('service.systems.storage.receiving', service.systems.storage.index.index);
|
|
const result = await service.systems.storage.receiving.getReceivingList(where, pagination);
|
|
return this.success('ok', result);
|
|
}
|
|
async getReceivingDetail(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.getReceivingDetail(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async batchCancelReceiving(data){
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.batchCancelReceiving(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async create(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.create(data);
|
|
return this.success('创建失败', result);
|
|
}
|
|
async addItem(data) {
|
|
const { service } = this;
|
|
const { id, item } = data;
|
|
const result = await service.systems.storage.receiving.addItem(id, item);
|
|
return this.success('ok', result);
|
|
}
|
|
async removeItem(data) {
|
|
const { service } = this;
|
|
const { id, item_id } = data;
|
|
const result = await service.systems.storage.receiving.removeItem(id, item_id);
|
|
return this.success('ok', result);
|
|
}
|
|
async saveReceiving(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.saveReceiving(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async get(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.get(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async addDetail(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.addDetail(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async deleteDetail(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.deleteDetail(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async detailChange(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.detailChange(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async cancel(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.invalid(data);
|
|
return this.success('ok', result);
|
|
}
|
|
async completeReceiving(data) {
|
|
const { service } = this;
|
|
const result = await service.systems.storage.receiving.completeReceiving(data);
|
|
return this.success('ok', result);
|
|
}
|
|
}
|
|
module.exports = configService;
|