Commit 4fd92b8a by 孙龙

标签新增字段

parent 7223a165
......@@ -57,5 +57,5 @@ MAIL_ENCRYPTION=tls
ADMIN=liuzhiyong@teshehui.com
LOGIN_DOMAIN='user.liexin.net'
ERP_DOMAIN=http://192.168.1.235:6886
ERP_DOMAIN=http://192.168.1.238:6999
ERP_DB_NAME=ICHUNT
\ No newline at end of file
......@@ -425,6 +425,7 @@ Class AjaxController extends Controller
$html = $request->input("html",'');
$datas = $request->input("datas",'');
$returnHtml = [];
// dump($datas);
foreach($datas as $k=>$item){
$createHtml = (new \App\Services\LabelService)->getLabelOfflineHtml($html,$item);
if($createHtml){
......
......@@ -98,14 +98,20 @@ class LabelService {
$info["ichunt2020"]["customer_code"] = isset($item["customer_code"]) ? $item["customer_code"] : "";
$info["ichunt2020"]["customer_type"] = isset($item["customer_type"]) ? $item["customer_type"] : "";
$info["ichunt2020"]["customer_com"] = isset($item["customer_com"]) ? $item["customer_com"] : "";
$info["ichunt2020"]["data_code"] = isset($item["data_code"]) ? $item["data_code"] : "";
$info["ichunt2020"]["coo"] = isset($item["coo"]) ? $item["coo"] : "";
$info["ichunt2020"]["customer_material_number"] = isset($item["customer_material_number"]) ? $item["customer_material_number"] : "";
return $this->getHtml($_html,$info);
}
protected function getHtml($_html,$info){
// dump($_html);
// dump($info);
try{
$matches = [];
$a = preg_match_all('/<<<(.*?)>>>/i',$_html,$matches);
preg_match_all('/<<<(.*?)>>>/i',$_html,$matches);
$arr = [];
foreach($matches[1] as $k=>$field){
$arr[$k] = isset($info["ichunt2020"][$field])?$info["ichunt2020"][$field] : '';
}
......@@ -115,8 +121,10 @@ class LabelService {
$html = $_html;
}
$dom = HtmlDomParser::str_get_html( $html );
$html = str_replace("箜"," ",$html);
// dump($html);
$dom = HtmlDomParser::str_get_html( $html );
//处理文本
$textareas = $dom->find('textarea');
foreach($textareas as $k=>$textarea){
......@@ -137,6 +145,7 @@ class LabelService {
foreach($yiweimaits as $k=>$yiweimait){
try{
$a = $yiweimait->style;
$yiweimait->datatypes = str_replace(["#","%","&"],"",$yiweimait->datatypes);
$b = 'data:image/png;base64,' . DNS1D::getBarcodePNG($yiweimait->datatypes, "C128");
$c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a);
$yiweimait->style = $c;
......
......@@ -271,7 +271,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......@@ -305,7 +305,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......@@ -339,7 +339,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......
......@@ -69,7 +69,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......@@ -103,7 +103,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......@@ -137,7 +137,7 @@
<option value="#">#</option>
<option value=";"></option>
<option value=":"></option>
<option value="">空格</option>
<option value="">空格</option>
</select>
</span>
<div class="sjglbox fl">
......
[" <div class=\"edit-con\" style=\"width: 440px; height: 280px; background-color: rgb(255, 255, 255); border: 0px;\"><div class=\"yiweimait huabuitem\" type=\"5\" w=\"227\" h=\"47\" name=\"yiweimait\" style=\" background: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAAeAQMAAACCM5C2AAAABlBMVEX\/\/\/8AAABVwtN+AAAAAXRSTlMAQObYZgAAAD1JREFUOI3tyrEJADAIBEDB9iHDpBVcXbANOMy3QjJGGq8+IdRtVW12g6m4bhFUHsDa3ZgZXTJv3rx5n98DzVlxMwDPJ9UAAAAASUVORK5CYII=) 0% 0% \/ 100% 100% no-repeat; width: 227px; height: 47px; display: block; top: 51px; left: 97px;\" x=\"97\" y=\"51\" sjgl1=\"goods_type||zdyxkpoiop\" datatypes=\"MP5610GQG-P\" sjgl2=\"data_code||zdyxkpoiop\" sjgl3=\"coo||zdyxkpoiop\" sjgl4=\"customer_material_number||zdyxkpoiop\"><\/div><div class=\"erweimait huabuitem\" type=\"5\" w=\"45\" h=\"45\" name=\"erweimait\" style=\" background: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA\/AQMAAABtkYKcAAAABlBMVEX\/\/\/8AAABVwtN+AAAAAXRSTlMAQObYZgAAAM1JREFUKJF90EEOgyAQBdBJ2OsNykVIvJbdlB7NXgCuwM4tCRtMDL8D0iqtLauXDPr\/QMAq7IBEf+BJUa+o2xGgglUwBdMXXiO+\/IGL\/gmJDI6QsWZt4BpA7RPsOfiEibazARbBrmI6B38oDeHhsLhLdwBnLavklbXy1wbcMOkMYYkhzA5p80ikDD+SiA34z6E0zDA7yl6osMOdWgBpzI8QlgZcg0eIpU\/veNkjALeNJEe3AGaULXw\/p65B0ki3HJFG5Q\/INWJ9Z0wDzBtP9HdPrmKH\/ZgAAAAASUVORK5CYII=) 0% 0% \/ 100% 100% no-repeat; width: 45px; height: 45px; display: block; top: 186.016px; left: 192px;\" x=\"192\" y=\"186.015625\" sjgl1=\"goods_type||zdyxkpoiop\" datatypes=\"MP5610GQG-P+10\/10\" sjgl2=\"+goods_number||zdyxkpoiop\" sjgl3=\"\/goods_number||zdyxkpoiop\" sjgl4=\"customer_material_number||zdyxkpoiop\"><\/div><\/div> "]
\ No newline at end of file
[" <div class=\"edit-con\" style=\"width: 440px; height: 280px; background-color: rgb(255, 255, 255); border: 0px;\"><div class=\"yiweimait huabuitem act\" type=\"5\" w=\"357\" h=\"68\" name=\"yiweimait\" style=\" background: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlYAAAAeAQMAAADU\/8J0AAAABlBMVEX\/\/\/8AAABVwtN+AAAAAXRSTlMAQObYZgAAAFpJREFUSIntzLEJwDAMRFGDWoFXMaQ90OoGtQatIrhWkHiMFOp+89+gimFGPKxSuuhr2JvCo4oyA909Yzp03QweCDIj3exkrWffjT6FGG211VZbbbXVVls\/sj4TYtZxKc2KIgAAAABJRU5ErkJggg==) 0% 0% \/ 100% 100% no-repeat; width: 357px; height: 68px; display: block; top: 28.0156px; left: 44px;\" x=\"44\" y=\"28.015625\" sjgl1=\"goods_type||zdyxkpoiop\" datatypes=\"MP5610GQG-P 22+ zh s123456\" sjgl2=\" data_code||zdyxkpoiop\" sjgl3=\" coo||zdyxkpoiop\" sjgl4=\" customer_material_number||zdyxkpoiop\"><\/div><div class=\"erweimait huabuitem\" type=\"5\" w=\"209\" h=\"156\" name=\"erweimait\" style=\" background: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLAQMAAAACgOipAAAABlBMVEX\/\/\/8AAABVwtN+AAAAAXRSTlMAQObYZgAAASZJREFUKJF90r3NgzAQBuBDFJRsEC9iyWslFZayR1glnsAr0Lm15AYkxPvdGQg\/IZ+rR\/Jxf4aAMfnqCXT0k4BJwkhaQac3HZigASQ\/znR4XtBvAdfcMsRmLL+ZMJMLlz2VSw8rpV+JWVv\/j3xKryPNZyV6uZ1qLiEcwutMyR9ayTA1lDypvrJ7Ik+BIVhJigHJHan8yOShLd2KTrnxVmvaU\/GqPVqvO6b+QT6yhxIU7zQVPM+OCiY2HMPVbmRswy1XB041kqQIvL46JIfX48h8K4dL9PzGMtaZeVKdN5neOkrrO8qqHW\/b5K2X1+SVCPMTmlhXB\/JTqqXJD+2J2ALgAw\/\/RQS4JQBV69bPdjT8HFYKc+vTnVvfUabo9fSY\/x3eLxUH\/gF2sf2L1EsM9gAAAABJRU5ErkJggg==) 0% 0% \/ 100% 100% no-repeat; width: 209px; height: 156px; display: block; top: 109px; left: 101px;\" x=\"101\" y=\"109\" sjgl1=\"goods_type||zdyxkpoiop\" datatypes=\"MP56#1%0GQG-P+YAGEO 10\uff1b22+\" sjgl2=\"+goods_brand||zdyxkpoiop\" sjgl3=\" goods_number||zdyxkpoiop\" sjgl4=\"\uff1bdata_code||zdyxkpoiop\"><\/div><\/div> "]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment