Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
| | |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //è·å表åé
ç½® |
| | | getOption(field) { |
| | | let option; |
| | | this.editFormOptions.forEach(x => { |
| | | x.forEach(item => { |
| | | if (item.field == field) { |
| | | option = item; |
| | | } |
| | | }) |
| | | }) |
| | | return option; |
| | | }, |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | let materielCodeOption = this.getOption("materielCode"); |
| | | let purchaseOrderNoOption = this.getOption("purchaseOrderNo"); |
| | | purchaseOrderNoOption.onChange = (val, option) => { |
| | | this.editFormFields.materielCode = ""; |
| | | materielCodeOption.data = []; |
| | | if (val == null || val == 0) { |
| | | return this.$error("è¯·éæ©ç©æç¼å·ï¼") |
| | | } |
| | | // console.log(val) |
| | | // console.log(option) |
| | | this.http.post("/api/PurchaseOrder/GetPurchaseOrderInfo?purchaseOrderNo=" + val, {}, true).then( |
| | | source => { |
| | | if (!source.status) return this.$error(source.message); |
| | | for (let i = 0; i < source.data.length; i++) { |
| | | materielCodeOption.data.push({ key: i, value: source.data[i] }) |
| | | } |
| | | // this.editFormFields.InputOder_itemname = source.data.itemName; |
| | | // this.$success(source.data.itemName); |
| | | this.refresh(); |
| | | }) |
| | | } |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | |
| | | url: "/MaterielCodeInfo/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormFields = ref({ |
| | | purchaseOrderNo:"", |
| | | materielCode:"", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | type:"select", |
| | | dataKey: "purchaseOrderNos", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | type: "select", |
| | | dataKey: "MaterielCodes", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | field: "productionDate", |
| | | type:"date", |
| | | type: "date", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æææ", |
| | | field: "effectiveDate", |
| | | type:"date", |
| | | type: "date", |
| | | required: true, |
| | | }, |
| | | ], |
| | |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | hidden:true, |
| | | hidden: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true, |
| | | hidden: true, |
| | | sort: true, |
| | | }, |
| | | ]); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | public interface IPurchaseOrderDetailService : IService<Dt_PurchaseOrderDetail> |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface IPurchaseOrderService : IService<Dt_PurchaseOrder> |
| | | { |
| | | WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo); |
| | | WebResponseContent ReceivePurchaseOrder(PurchaseOrderModel model); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | | public class PurchaseOrderDetailService : ServiceBase<Dt_PurchaseOrderDetail, IPurchaseOrderDetailRepository>,IPurchaseOrderDetailService |
| | | public class PurchaseOrderDetailService : ServiceBase<Dt_PurchaseOrderDetail, IPurchaseOrderDetailRepository>, IPurchaseOrderDetailService |
| | | { |
| | | public IPurchaseOrderDetailRepository Repository => BaseDal; |
| | | |
| | |
| | | _supplierInfoRepository = supplierInfoRepository; |
| | | _materielInfoRepository = materielInfoRepository; |
| | | } |
| | | |
| | | public WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo) |
| | | { |
| | | try |
| | | { |
| | | Dt_PurchaseOrder purchaseOrder = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == purchaseOrderNo).Includes(x => x.Details).First(); |
| | | List<string> MaterielCodes = purchaseOrder.Details.Where(x => x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()).Select(x => x.MaterielCode).ToList(); |
| | | return WebResponseContent.Instance.OK(data: MaterielCodes); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent ReceivePurchaseOrder(PurchaseOrderModel model) |
| | | { |
| | | try |
| | |
| | | { |
| | | MaterielCode = item.MCode, |
| | | PurchaseDetailQuantity = item.Qty, |
| | | PurchaseDetailReceiveQty=0, |
| | | PurchaseDetailReceiveQty = 0, |
| | | PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.NotReceived.ObjToInt(), |
| | | Unit = item.Unit, |
| | | WarehouseId = warehouse.WarehouseId, |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public PurchaseOrderController(IPurchaseOrderService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost, HttpGet, Route("GetPurchaseOrderInfo"), AllowAnonymous] |
| | | public WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo) |
| | | { |
| | | return Service.GetPurchaseOrderInfo(purchaseOrderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |