| | |
| | | value: 'confirmTask', |
| | | onClick: function () { |
| | | |
| | | } |
| | | } |
| | | , { |
| | | name: 'åºåéå®', |
| | | // icon: 'el-icon-printer', |
| | | type: 'primary', |
| | | // plain: true, |
| | | // color: '#529b2e', |
| | | value: 'stockLock', |
| | | onClick: function () { |
| | | |
| | | } |
| | | } |
| | | , { |
| | | name: 'åºåè§£é', |
| | | // icon: 'el-icon-printer', |
| | | type: 'primary', |
| | | // plain: true, |
| | | // color: '#529b2e', |
| | | value: 'stockUnLock', |
| | | onClick: function () { |
| | | |
| | | } |
| | | } |
| | | ] |
| | |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | // åºåéå® |
| | | var stockLock = this.buttons.find(x => x.value == "stockLock"); |
| | | if (stockLock != null) { |
| | | stockLock.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } |
| | | let ids = rows.map(x => { |
| | | return x.id; |
| | | }) |
| | | this.http.post(`/api/VV_StockInfo/stockLock`, ids, "åºåéå®ä¸...").then((result) => { |
| | | if (result.status) { |
| | | this.$Message.success(result.message); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(result.message); |
| | | this.refresh(); |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }; |
| | | |
| | | // åºåè§£é |
| | | var stockUnLock = this.buttons.find(x => x.value == "stockUnLock"); |
| | | if (stockUnLock != null) { |
| | | stockUnLock.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } |
| | | let ids = rows.map(x => { |
| | | return x.id; |
| | | }) |
| | | this.http.post(`/api/VV_StockInfo/stockUnLock`, ids, "åºåè§£éä¸...").then((result) => { |
| | | if (result.status) { |
| | | this.$Message.success(result.message); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(result.message); |
| | | this.refresh(); |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }; |
| | | |
| | | |
| | | // this.columns.forEach((column) => { |
| | | // if (column.field == 'materielName') { |
| | | // column.formatter = (row) => { |
| | |
| | | |
| | | public interface IVV_StockInfoService : IService<VV_StockInfo> |
| | | { |
| | | WebResponseContent stockLock(object[] keys); |
| | | |
| | | WebResponseContent stockUnLock(object[] keys); |
| | | } |
| | |
| | | |
| | | public class VV_StockInfoService : ServiceBase<VV_StockInfo, IVV_StockInfoRepository>, IVV_StockInfoService |
| | | { |
| | | public VV_StockInfoService(IVV_StockInfoRepository BaseDal) : base(BaseDal) |
| | | private readonly IDt_PalletStockInfoRepository _repository; |
| | | public VV_StockInfoService(IVV_StockInfoRepository BaseDal, IDt_PalletStockInfoRepository repository) : base(BaseDal) |
| | | { |
| | | _repository = repository; |
| | | } |
| | | |
| | | public WebResponseContent stockLock(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | foreach (var item in keys) |
| | | { |
| | | var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item)); |
| | | stock.StockStatus= 1; |
| | | _repository.UpdateData(stock); |
| | | |
| | | } |
| | | return content.OK("é宿å!"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return content.Error(e.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | public WebResponseContent stockUnLock(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | foreach (var item in keys) |
| | | { |
| | | var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item)); |
| | | stock.StockStatus = 0; |
| | | _repository.UpdateData(stock); |
| | | |
| | | } |
| | | return content.OK("è§£éæå!"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return content.Error(e.Message); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// åºåéå® |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | [HttpPost,HttpGet,Route("stockLock"),AllowAnonymous] |
| | | public WebResponseContent stockLock([FromBody]object[] keys) |
| | | { |
| | | return Service.stockLock(keys); |
| | | } |
| | | /// <summary> |
| | | /// åºåè§£é |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("stockUnLock"), AllowAnonymous] |
| | | public WebResponseContent stockUnLock([FromBody] object[] keys) |
| | | { |
| | | return Service.stockUnLock(keys); |
| | | } |
| | | |
| | | } |