| | |
| | | }) |
| | | return option; |
| | | }, |
| | | formatDate(dateStr) { |
| | | let date = new Date(dateStr); |
| | | let year = date.getFullYear(); |
| | | let month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | let day = String(date.getDate()).padStart(2, "0"); |
| | | return year + "-" + month + "-" + day; |
| | | }, |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | let warehouseIdOption = this.getOption("warehouseId"); |
| | | let materielCodeOption = this.getOption("materielCode"); |
| | | let purchaseOrderNoOption = this.getOption("purchaseOrderNo"); |
| | | purchaseOrderNoOption.onChange = (val, option) => { |
| | | warehouseIdOption.onChange=(val,option)=>{ |
| | | this.editFormFields.materielCode = ""; |
| | | materielCodeOption.data = []; |
| | | this.editFormFields.purchaseOrderNo = ""; |
| | | purchaseOrderNoOption.data = []; |
| | | if (val == null || val == 0) { |
| | | return this.$error("è¯·éæ©ç©æç¼å·ï¼") |
| | | return this.$error("è¯·éæ©ä»åºï¼") |
| | | } |
| | | // console.log(val) |
| | | // console.log(option) |
| | | this.http.post("/api/PurchaseOrder/GetPurchaseOrderInfo?purchaseOrderNo=" + val, {}, true).then( |
| | | this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderDetailMaterielCode?warehouseId=" + 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: source.data[i], value: source.data[i] }) |
| | | } |
| | | // this.editFormFields.InputOder_itemname = source.data.itemName; |
| | | // this.$success(source.data.itemName); |
| | | this.refresh(); |
| | | }) |
| | | } |
| | | materielCodeOption.onChange = (val, option) => { |
| | | this.editFormFields.purchaseOrderNo = ""; |
| | | purchaseOrderNoOption.data = []; |
| | | if (val == null || val == 0) { |
| | | return this.$error("è¯·éæ©ç©æç¼å·ï¼") |
| | | } |
| | | this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderNos?materielCode=" + val, {}, true).then( |
| | | source => { |
| | | if (!source.status) return this.$error(source.message); |
| | | for (let i = 0; i < source.data.length; i++) { |
| | | purchaseOrderNoOption.data.push({ key: source.data[i], value: source.data[i] }) |
| | | } |
| | | this.refresh(); |
| | | }) |
| | | } |
| | |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | let isAdd = this.currentAction == 'Add'; |
| | | if (isAdd) { |
| | | let date = new Date(); |
| | | let year = date.getFullYear(); |
| | | let month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | let day = String(date.getDate()).padStart(2, "0"); |
| | | this.editFormFields.lotNo = year + month + day; |
| | | this.editFormFields.productionDate = year + "-" + month + "-" + day; |
| | | this.editFormFields.effectiveDate = year + 2 + "-" + month + "-" + day; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box v-model="showDetialBox" :lazy="true" width="75%" :padding="15" title="åæ®æç»ä¿¡æ¯"> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="75%" |
| | | :padding="15" |
| | | title="åæ®æç»ä¿¡æ¯" |
| | | > |
| | | <div class="box-head"> |
| | | <el-alert :closable="false" style="width: 100%"> |
| | | <el-row> |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px" @click="lockstocks">éå®åºå</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound">ç´æ¥åºåº</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData">å·æ°</el-link></el-col> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table ref="singleTable" :data="tableData" style="width: 100%; height: 100%" highlight-current-row |
| | | @current-change="handleCurrentChange" height="500px" @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="tableData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | @current-change="handleCurrentChange" |
| | | height="500px" |
| | | @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column label="åºå·" type="index" fixed="left" width="55" align="center"></el-table-column> |
| | | <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" :prop="item.prop" |
| | | :label="item.title" :width="item.width" align="center"> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed="left" |
| | | width="55" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom"><el-link type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" @click="tableButtonClick(scoped.row, item)"><i |
| | | :class="item.icon" style="font-size: 22px"></i></el-link></el-tooltip> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-link |
| | | ></el-tooltip> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | |
| | | </div> |
| | | </vol-box> |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock> |
| | | <selected-stock |
| | | ref="selectedStock" |
| | | @parentCall="parentCall" |
| | | ></selected-stock> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | title: "订åæç»ç¶æ", |
| | | type: "tag", |
| | | width: 180, |
| | | bindKey: "orderDetailStatusEnum" |
| | | bindKey: "orderDetailStatusEnum", |
| | | }, |
| | | { |
| | | prop: "assignStock", |
| | |
| | | if ( |
| | | row.orderDetailStatus !== 0 && |
| | | row.orderDetailStatus !== 60 && |
| | | row.orderDetailStatus !== 70 |
| | | row.orderDetailStatus !== 70 && |
| | | row.orderDetailStatus !== 80 |
| | | ) { |
| | | return true; |
| | | } else { |
| | |
| | | background: oldlace; |
| | | } |
| | | |
| | | .box-table .el-table tbody tr:hover>td { |
| | | .box-table .el-table tbody tr:hover > td { |
| | | background-color: #d8e0d4 !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .box-table .el-table tbody tr.current-row>td { |
| | | .box-table .el-table tbody tr.current-row > td { |
| | | background-color: #f0f9eb !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | purchaseOrderNo:"", |
| | | materielCode:"", |
| | | lotNo: "", |
| | | warehouseId: "", |
| | | purchaseOrderNo: "", |
| | | materielCode: "", |
| | | productionDate: "", |
| | | effectiveDate: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | type:"select", |
| | | dataKey: "purchaseOrderNos", |
| | | title: "ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "areainfo", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | type: "select", |
| | | dataKey: "MaterielCodes", |
| | | required: true, |
| | | // dataKey: "MaterielCodes", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | type: "select", |
| | | // dataKey: "purchaseOrderNos", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ°é", |
| | | field: "quantity", |
| | |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | field: "productionDate", |
| | | type: "date", |
| | | // type: "date", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æææ", |
| | | field: "effectiveDate", |
| | | type: "date", |
| | | // type: "date", |
| | | required: true, |
| | | }, |
| | | ], |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "ä»åº", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "areainfo", data: [] }, |
| | | }, |
| | | { |
| | | field: "purchaseOrderNo", |
| | | title: "éè´åå·", |
| | | type: "string", |
| | |
| | | { |
| | | public interface IPurchaseOrderDetailService : IService<Dt_PurchaseOrderDetail> |
| | | { |
| | | WebResponseContent GetPurchaseOrderDetailMaterielCode(int warehouseId); |
| | | WebResponseContent GetPurchaseOrderNos(string materielCode); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | |
| | | public PurchaseOrderDetailService(IPurchaseOrderDetailRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | public WebResponseContent GetPurchaseOrderDetailMaterielCode(int warehouseId) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.WarehouseId == warehouseId && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()); |
| | | List<string> MaterielCodes = purchaseOrderDetails.Select(x => x.MaterielCode).ToList(); |
| | | return WebResponseContent.Instance.OK(data: MaterielCodes); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent GetPurchaseOrderNos(string materielCode) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.MaterielCode == materielCode && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()); |
| | | List<int> PurchaseOrderIds = purchaseOrderDetails.Select(x => x.PurchaseOrderId).ToList(); |
| | | List<Dt_PurchaseOrder> purchaseOrders = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => PurchaseOrderIds.Contains(x.Id)).ToList(); |
| | | List<string> PurchaseOrderNos = purchaseOrders.Select(x => x.PurchaseOrderNo).ToList(); |
| | | return WebResponseContent.Instance.OK(data: PurchaseOrderNos); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºç¼å·")] |
| | | public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "æ¹æ¬¡å·")] |
| | |
| | | public PurchaseOrderDetailController(IPurchaseOrderDetailService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost, HttpGet, Route("GetPurchaseOrderDetailMaterielCode"), AllowAnonymous] |
| | | public WebResponseContent GetPurchaseOrderDetailMaterielCode(int warehouseId) |
| | | { |
| | | return Service.GetPurchaseOrderDetailMaterielCode(warehouseId); |
| | | } |
| | | [HttpPost, HttpGet, Route("GetPurchaseOrderNos"), AllowAnonymous] |
| | | public WebResponseContent GetPurchaseOrderNos(string materielCode) |
| | | { |
| | | return Service.GetPurchaseOrderNos(materielCode); |
| | | } |
| | | } |
| | | } |