| | |
| | | |
| | | <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/outbound/outSGOrder.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "ç管æç¨å", |
| | | name: "outSGOrder", |
| | | url: "/OutSGOrder/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | boardMpsNo:"" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "boardMpsNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly:true |
| | | <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/outbound/outSGOrder.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "ç管æç¨å", |
| | | name: "outSGOrder", |
| | | url: "/OutSGOrder/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | boardMpsNo: "" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "boardMpsNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: true |
| | | } |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | outSGOrderNo: "", |
| | | boardMpsId: "", |
| | | orderId: "", |
| | | outSGOrderStatus: "", |
| | | warehouseId: "", |
| | | shortName: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "WMSåå·", field: "outSGOrderNo", type: "like" }, |
| | | { title: "åºåºä¸æ¸¸ID", field: "boardMpsId", type: "like" }, |
| | | { title: "䏿¸¸ç产åå·", field: "orderId", type: "like" }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "outSGOrderStatus", |
| | | type: "select", |
| | | dataKey: "outboundStatusEnum", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "ä»åº", field: "warehouseId", type: "selectList", dataKey: "warehouses", data: [], }, |
| | | { title: "客æ·ç®ç§°", field: "shortName", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "ä»åº", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "warehouses", data: [] } |
| | | }, |
| | | { |
| | | field: "outSGOrderNo", |
| | | title: "WMSåå·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | // link: true, |
| | | }, |
| | | { |
| | | field: "boardMpsId", |
| | | title: "䏿¸¸åæ®ID", |
| | | type: "int", |
| | | width: 160, |
| | | align: "left", |
| | | // link: true, |
| | | }, |
| | | { |
| | | field: "orderId", |
| | | title: "æç¨å·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "number", |
| | | title: "ç¨çº¸åºå·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "shortName", |
| | | title: "客æ·ç®ç§°", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outSGOrderStatus", |
| | | title: "åºåºåç¶æ", |
| | | type: "tag", |
| | | width: 110, |
| | | align: "left", |
| | | bind: { key: "outboundStatusEnum", data: [] }, |
| | | getColor: (row) => { |
| | | const status = row.outSGOrderStatus; |
| | | if (status === 3) { // 缺æ |
| | | return 'danger'; // çº¢è² |
| | | } else if (status === 0) { // æªå¼å§ |
| | | return 'success'; // ç»¿è² |
| | | } else if (status === 1) { // åºåºä¸ |
| | | return 'primary'; // èè² |
| | | } |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | outSGOrderNo: "", |
| | | boardMpsId: "", |
| | | orderId: "", |
| | | outSGOrderStatus: "", |
| | | warehouseId: "", |
| | | shortName: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "WMSåå·", field: "outSGOrderNo", type: "like" }, |
| | | { title: "åºåºä¸æ¸¸ID", field: "boardMpsId", type: "like" }, |
| | | { title: "䏿¸¸ç产åå·", field: "orderId", type: "like" }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "outSGOrderStatus", |
| | | type: "select", |
| | | dataKey: "outboundStatusEnum", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}, |
| | | { title: "客æ·ç®ç§°", field: "shortName", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | return ''; // é»è®¤æ é¢è² |
| | | } |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materialNos", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const materialNos = row.materialNos; |
| | | if (!materialNos) return materialNos; |
| | | |
| | | // å¤çç©æç¼å·ï¼æ ¹æ®æ¯ä¸ªç©æçå®é
ç¶ææ¾ç¤ºé¢è² |
| | | const materialList = materialNos.split('/'); |
| | | let formattedMaterials = []; |
| | | |
| | | // 妿æç©æç¼ºæç¶æåç¬¦ä¸²ï¼æ ¹æ®æ¯ä¸ªç©æçç¶ææ¾ç¤ºé¢è² |
| | | if (row.materialLackStatus) { |
| | | // è§£æç©æç¼ºæç¶æå符串ï¼ç©æç¼å·:ç¶æ,ç©æç¼å·:ç¶æ |
| | | const statusPairs = row.materialLackStatus.split(','); |
| | | // è·åææç©æç缺æç¶æå表ï¼ä¿æåå§é¡ºåº |
| | | const lackStatusList = statusPairs.map(pair => { |
| | | const [, isLack] = pair.split(':'); |
| | | return isLack.trim() === 'true'; |
| | | }); |
| | | |
| | | // 为æ¯ä¸ªç©æç¼å·è®¾ç½®é¢è²ï¼ä¿æåå§é¡ºåº |
| | | formattedMaterials = materialList.map((materialNo, index) => { |
| | | const trimmedMaterialNo = materialNo.trim(); |
| | | const isLack = lackStatusList[index] || false; |
| | | if (isLack) { |
| | | return `<span style="color: red;">${trimmedMaterialNo}</span>`; |
| | | } |
| | | return trimmedMaterialNo; |
| | | }); |
| | | } else { |
| | | // å¦ææ²¡æç©æç¼ºæç¶æä¿¡æ¯ï¼ä½¿ç¨è®¢å级å«ç缺æç¶æ |
| | | const isLack = Boolean(row.isLackMaterial); |
| | | if (isLack) { |
| | | return `<span style="color: red;">${materialNos}</span>`; |
| | | } |
| | | formattedMaterials = materialList; |
| | | } |
| | | |
| | | return formattedMaterials.join('/'); |
| | | } |
| | | }, |
| | | { |
| | | field: "materialWides", |
| | | title: "å¹
宽", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const value = row.materialWides; |
| | | if (value && typeof value === 'string') { |
| | | return value.replace(/\.\d+$/, ''); |
| | | } |
| | | return value; |
| | | } |
| | | }, |
| | | { |
| | | field: "boardFluteNos", |
| | | title: "æ¥å«", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left" |
| | | }, |
| | | { |
| | | field: "isLackMaterial", |
| | | title: "æ¯å¦ç¼ºæ", |
| | | type: "string", |
| | | width: 100, |
| | | align: "center", |
| | | formatter: (row) => { |
| | | const isLack = Boolean(row.isLackMaterial); |
| | | const text = isLack ? "æ¯" : "å¦"; |
| | | const bgColor = isLack ? '#ff4d4f' : '#52c41a'; |
| | | return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`; |
| | | } |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "åºåºæç»å", |
| | | table: "OutSGOrderDetail", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "ä»åº", |
| | | field: "outSGOrderId", |
| | | title: "åºåºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind:{key: "warehouses", data: []} |
| | | }, |
| | | { |
| | | field: "outSGOrderNo", |
| | | title: "WMSåå·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | // link: true, |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "boardMpsId", |
| | | title: "䏿¸¸åæ®ID", |
| | | type: "int", |
| | | width: 160, |
| | | align: "left", |
| | | // link: true, |
| | | }, |
| | | { |
| | | field: "orderId", |
| | | title: "䏿¸¸ç产åå·", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "shortName", |
| | | title: "客æ·ç®ç§°", |
| | | title: "å
³èç主表ID(䏿¸¸)", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outSGOrderStatus", |
| | | title: "åºåºåç¶æ", |
| | | field: "boardMpsDetailId", |
| | | title: "å
³èæç»ID(䏿¸¸)", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materialNo", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | }, |
| | | { |
| | | field: "boardFluteNo", |
| | | title: "æ¥å«", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | }, |
| | | { |
| | | field: "machineName", |
| | | title: "æºå°ä½", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "width", |
| | | title: "å¹
宽", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | |
| | | }, |
| | | { |
| | | field: "xqLen", |
| | | title: "éæ±é¿åº¦", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "totalUsage", |
| | | title: "æ»ç¨é", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "procurementLength", |
| | | title: "éè´é¿åº¦", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "assignTotalUsage", |
| | | title: "å·²åé
ç¨é", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outTotalUsage", |
| | | title: "å·²åºç¨é", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outSGOrderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "tag", |
| | | width: 180, |
| | | align: "left", |
| | | bind: { key: "outboundStatusEnum", data: [] }, |
| | | getColor: (row) => { |
| | | const status = row.outSGOrderDetailStatus; |
| | | if (status === 3) { // 缺æ |
| | | return 'danger'; // çº¢è² |
| | | } else if (status === 0) { // æªå¼å§ |
| | | return 'success'; // ç»¿è² |
| | | } else if (status === 1) { // åºåºä¸ |
| | | return 'primary'; // èè² |
| | | } |
| | | return ''; // é»è®¤æ é¢è² |
| | | } |
| | | }, |
| | | { |
| | | field: "createDate", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "åºåºæç»å", |
| | | table: "OutSGOrderDetail", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outSGOrderId", |
| | | title: "åºåºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "boardMpsId", |
| | | title: "å
³èç主表ID(䏿¸¸)", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "boardMpsDetailId", |
| | | title: "å
³èæç»ID(䏿¸¸)", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materialNo", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | }, |
| | | { |
| | | field: "boardFluteNo", |
| | | title: "æ¥å«", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | }, |
| | | { |
| | | field: "machineName", |
| | | title: "æºå°ä½", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "width", |
| | | title: "å¹
宽", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "xqLen", |
| | | title: "éæ±é¿åº¦", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "totalUsage", |
| | | title: "æ»ç¨é", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "procurementLength", |
| | | title: "éè´é¿åº¦", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "assignTotalUsage", |
| | | title: "å·²åé
ç¨é", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outTotalUsage", |
| | | title: "å·²åºç¨é", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outBSTOrderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | bind: { key: "outboundStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | } |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | } |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |