¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="300px" |
| | | :padding="15" |
| | | title="æå°" |
| | | > |
| | | <div |
| | | id="printContent" |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | > |
| | | <div |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | > |
| | | <VueQrcode id="qrcode" :value="Code" :size="200"></VueQrcode> |
| | | </div> |
| | | </div> |
| | | <div id="palletcode"> |
| | | <span |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | >ç©æç¼ç :{{ materielCode }}</span |
| | | > |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="print()">æå°</el-button> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VueQrcode from "vue-qrcode"; |
| | | import QRCode from "qrcode"; |
| | | import { da } from "element-plus/es/locales.mjs"; |
| | | export default { |
| | | components: { VolBox, VueQrcode }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | row: null, |
| | | qrcodeDataURL: "", |
| | | Code: "", |
| | | materielCode: "", |
| | | lotNo: "", |
| | | purchaseOrderNo: "", |
| | | quantity: "", |
| | | productionDate: "", |
| | | effectiveDate: "", |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | if (row && row.materielCode) { |
| | | this.materielCode = row.materielCode; |
| | | this.lotNo = row.lotNo; |
| | | this.purchaseOrderNo = row.purchaseOrderNo; |
| | | this.quantity = row.quantity; |
| | | this.productionDate = formatDate(row.productionDate); |
| | | this.effectiveDate = formatDate(row.effectiveDate); |
| | | } |
| | | this.Code = |
| | | "M:" + |
| | | this.materielCode + |
| | | ",BS:" + |
| | | this.lotNo + |
| | | ",DM:" + |
| | | this.productionDate + |
| | | ",DE:" + |
| | | this.effectiveDate + |
| | | ",Q:" + |
| | | this.quantity + |
| | | ",PO:" + |
| | | this.purchaseOrderNo; |
| | | }, |
| | | print() { |
| | | let printContent = document.getElementById("printContent"); |
| | | let palletcode = document.getElementById("palletcode"); |
| | | var printWindow = window.open("", ""); |
| | | printWindow.document.write(printContent.innerHTML); |
| | | printWindow.document.write(palletcode.innerHTML); |
| | | printWindow.document.close(); |
| | | printWindow.focus(); |
| | | printWindow.print(); |
| | | printWindow.close(); |
| | | }, |
| | | 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; |
| | | }, |
| | | }, |
| | | |
| | | created() {}, |
| | | }; |
| | | function formatDate(dateStr) { |
| | | const date = new Date(dateStr); |
| | | return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart( |
| | | 2, |
| | | "0" |
| | | )}-${String(date.getDate()).padStart(2, "0")}`; |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .content-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .right-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .warning-row { |
| | | background: #e6a23c; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .el-table .error-row { |
| | | background: #f56c6c; |
| | | } |
| | | |
| | | canvas { |
| | | display: block; |
| | | margin: auto; |
| | | } |
| | | </style> |
| | |
| | | > |
| | | <VueQrcode id="qrcode" :value="palletCode" :size="200"></VueQrcode> |
| | | </div> |
| | | </div> |
| | | <div id="palletcode"> |
| | | <span |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | >{{ palletCode }}</span |
| | |
| | | }, |
| | | print() { |
| | | let printContent = document.getElementById("printContent"); |
| | | let palletcode=document.getElementById("palletcode"); |
| | | var printWindow = window.open("", ""); |
| | | printWindow.document.write(printContent.innerHTML); |
| | | printWindow.document.write(palletcode.innerHTML); |
| | | printWindow.document.close(); |
| | | printWindow.focus(); |
| | | printWindow.print(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/materielcodeprintView.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-printer">æå°</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | name: 'palletCodeInfo', |
| | | component: () => import('@/views/basic/palletCodeInfo.vue') |
| | | }, { |
| | | path: '/MaterielCodeInfo', |
| | | name: 'MaterielCodeInfo', |
| | | component: () => import('@/views/basic/materielCodeInfo.vue') |
| | | }, { |
| | | path: '/inboundOrder', |
| | | name: 'inboundOrder', |
| | | component: () => import('@/views/inbound/inboundOrder.vue') |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/basic/materielCodeInfo.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "ç©æç ä¿¡æ¯", |
| | | name: "MaterielCodeInfo", |
| | | url: "/MaterielCodeInfo/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æ°é", |
| | | field: "quantity", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | field: "productionDate", |
| | | type:"date", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æææ", |
| | | field: "effectiveDate", |
| | | type:"date", |
| | | required: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [{ title: "æ¹æ¬¡å·", field: "lotNo", type: "like" }], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "purchaseOrderNo", |
| | | title: "éè´åå·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "lotNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "æ°é", |
| | | type: "int", |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "date", |
| | | width: 100, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ", |
| | | type: "date", |
| | | width: 100, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | hidden:true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true, |
| | | sort: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | title: "ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | dataKey: "warehouse", |
| | | data: [], |
| | | required: true, |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicRepository |
| | | { |
| | | public class MaterielCodeInfoRepository : RepositoryBase<Dt_MaterielCodeInfo>, IMaterielCodeInfoRepository |
| | | { |
| | | public MaterielCodeInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class MaterielCodeInfoService : ServiceBase<Dt_MaterielCodeInfo, IMaterielCodeInfoRepository>, IMaterielCodeInfoService |
| | | { |
| | | public MaterielCodeInfoService(IMaterielCodeInfoRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | return BaseDal.QueryData(x => materielCodes.Contains(x.MaterielCode)); |
| | | } |
| | | |
| | | public WebResponseContent GetWarehouseMaterielInfos(int warehouseId) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_MaterielInfo> materielInfos = BaseDal.QueryData(x => x.WarehouseId == warehouseId); |
| | | return WebResponseContent.Instance.OK(data: materielInfos); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¥æ¶ERPç©æä¿¡æ¯ |
| | | /// </summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicRepository |
| | | { |
| | | public interface IMaterielCodeInfoRepository : IRepository<Dt_MaterielCodeInfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IMaterielCodeInfoService : IService<Dt_MaterielCodeInfo> |
| | | { |
| | | } |
| | | } |
| | |
| | | /// <param name="materielCodes"></param> |
| | | /// <returns></returns> |
| | | List<Dt_MaterielInfo> GetMaterielInfos(List<string> materielCodes); |
| | | WebResponseContent GetWarehouseMaterielInfos(int warehouseId); |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶ERPç©æä¿¡æ¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_MaterielCodeInfo), "ç©æç ä¿¡æ¯")] |
| | | public class Dt_MaterielCodeInfo : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string LotNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ¥æ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "çäº§æ¥æ")] |
| | | [ExporterHeader(DisplayName = "çäº§æ¥æ")] |
| | | [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "çäº§æ¥æ")] |
| | | public DateTime ProductionDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æææ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æææ")] |
| | | [ExporterHeader(DisplayName = "æææ")] |
| | | [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "æææ")] |
| | | public DateTime EffectiveDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´åå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "éè´åå·")] |
| | | public string PurchaseOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°é")] |
| | | public float Quantity { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class MaterielCodeInfoController : ApiBaseController<IMaterielCodeInfoService, Dt_MaterielCodeInfo> |
| | | { |
| | | public MaterielCodeInfoController(IMaterielCodeInfoService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·ååºåºç©æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetWarehouseMaterielInfos")] |
| | | public WebResponseContent GetWarehouseMaterielInfos(int warehouseId) |
| | | { |
| | | return Service.GetWarehouseMaterielInfos(warehouseId); |
| | | } |
| | | } |
| | | } |