| | |
| | | <template> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | |
| | | productionDate: "", |
| | | validityPeriod: "", |
| | | remark: "", |
| | | availableQuantity: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | |
| | | field: "materielCode", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç©æåç§°", |
| | | required: true, |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "ç©æè§æ ¼", |
| | | required: true, |
| | | field: "materielSpec", |
| | | type: "string", |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | |
| | | field: "batchNo", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åºåæ°", |
| | | title: "è°æ¨æ°é", |
| | | required: true, |
| | | field: "stockQuantity", |
| | | type: "number", |
| | | }, |
| | | { |
| | | title: "å¾
åºåºæ°", |
| | | required: true, |
| | | field: "outboundQuantity", |
| | | type: "number", |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "çç¹æ°", |
| | | required: true, |
| | | field: "supplyQuantity", |
| | | type: "number", |
| | | }, |
| | | { |
| | | title: "ERPå®é
åºåæ°", |
| | | required: true, |
| | | field: "erpStockQuantity", |
| | | type: "number", |
| | | }, |
| | | { |
| | | title: "åºåå·®å¼", |
| | | field: "status", |
| | | type: "select", |
| | | bind: { key: "stockDifference", data: [] } |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | field: "productionDate", |
| | | type: "date", |
| | | span: 12 |
| | | }, |
| | | { |
| | | title: "æææè³", |
| | | field: "validityPeriod", |
| | | type: "date", |
| | | span: 12 |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "夿³¨", |
| | | field: "remark", |
| | | type: "string", |
| | | span: 24 |
| | | } |
| | | ] |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | materielCode: "", |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode" }, |
| | | { title: "ç©æåç§°", field: "materielName" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo" }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "ç©æåç§°", field: "materielName", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | }, |
| | | { |
| | | field: "outboundQuantity", |
| | | title: "å¾
åºåºæ°", |
| | | title: "å¾
åºåºæ°æ°é", |
| | | type: "number", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplyQuantity", |
| | | title: "çç¹æ°", |
| | | title: "çç¹å·®å¼æ°", |
| | | type: "number", |
| | | width: 100, |
| | | align: "left", |
| | | cellStyle: (row) => { |
| | | const value = row.supplyQuantity; |
| | | if (value > 0) { |
| | | return { color: "#00ff00" }; // ç»¿è² |
| | | } else if (value < 0) { |
| | | return { color: "#ff0000" }; // çº¢è² |
| | | } |
| | | // else { |
| | | // return { color: '#000000' }; // é»è² |
| | | // } |
| | | }, |
| | | }, |
| | | { |
| | | title: "å¯ç¨åºåæ°", |
| | | required: true, |
| | | field: "availableQuantity", |
| | | type: "number", |
| | | }, |
| | | { |
| | | field: "erpStockQuantity", |
| | |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "status", |
| | | title: "åºåå·®å¼", |
| | | type: "select", |
| | | width: 100, |
| | | align: "left", |
| | | bind: { key: "stockDifference", data: [] }, |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "date", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | // { |
| | | // field: "status", |
| | | // title: "åºåå·®å¼", |
| | | // type: "select", |
| | | // width: 100, |
| | | // align: "left", |
| | | // bind: { key: "stockDifference", data: [] }, |
| | | // }, |
| | | // { |
| | | // field: "productionDate", |
| | | // title: "çäº§æ¥æ", |
| | | // type: "date", |
| | | // width: 120, |
| | | // align: "left", |
| | | // }, |
| | | { |
| | | field: "validityPeriod", |
| | | title: "æææè³", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |