自动化立体仓库 - WMS系统
#1
dubin
1 天以前 864c18c46c2db1ae92220181e40b291b3b0d9446
src/main/webapp/static/js/locDetl/locDetl.js
@@ -17,7 +17,12 @@
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'unit', align: 'center',title: '单位', hide: true}
        ,{field: 'price', align: 'center',title: '单价', hide: true}
        ,{field: 'sku', align: 'center',title: '简图', hide: false}
        // ,{fixed: 'right', title:'简图', align: 'center', toolbar: '#operate1', width: 300}
        ,{field: 'right', align: 'center',title: '简图', templet:function(row){
                var html = "<img  src='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" +row.maktx+"'/>";
                return html;
            }}
        ,{field: 'units', align: 'center',title: '单位量', hide: true}
        ,{field: 'barcode', align: 'center',title: '条码', hide: true}
        ,{field: 'origin', align: 'center',title: '产地', hide: true}
@@ -371,6 +376,48 @@
                   });
                }
                break;
            // 查看简图
            case 'showPic':
                let imgHtml = '<div style="height:100%;display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;">';
                $.ajax({
                    url: baseUrl+"/previewImage",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        maktx: data.maktx
                    },
                    method: 'GET',
                    traditional:true,
                    success: function (res) {
                        if (res.code === 200){
                            res.data.forEach((item) => {
                                let maktx = item.maktx;
                                let pics = item.pics;
                                pics.forEach((pic) => {
                                    let tmp = '<div><div><img width="600" src="' + pic + '" /></div><div>' + maktx + '</div></div>';
                                    imgHtml += tmp;
                                })
                            })
                            imgHtml += "</div>";
                            layer.open({
                                type: 1,
                                title: '查看简图',
                                area: [top.detailWidth, top.detailHeight],
                                shadeClose: true,
                                content: imgHtml,
                                success: function(layero, index){
                                }
                            });
                        } else if (res.code === 403){
                            top.location.href = baseUrl+"/";
                        } else {
                            layer.msg(res.msg)
                        }
                    }
                });
                console.log(imgHtml)
                break;
        }
    });