Explorar el Código

客诉列表修改

liujiankang hace 6 años
padre
commit
38eed221e9

+ 30 - 3
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java

@@ -36,7 +36,10 @@ public class Produce implements Serializable {
 
     private String json;  //传入json值
 
-    private String isPrintQrcode;  //是否打印二维码 1 是 2否
+    private Integer isPrintQrcode;  //是否打印二维码 1 是 2否
+    private Integer isGeneralQrcode;  //是否使用通用二维码 1 是 2否
+    private String generalQrcode;  //通用二维码
+    private Integer berGenerateRules;  //1 序列化生成(原有生成规则)、2 随机生成
 
     public Integer getProduceId() {
         return produceId;
@@ -186,11 +189,35 @@ public class Produce implements Serializable {
         this.produceBrand = produceBrand;
     }
 
-    public String getIsPrintQrcode() {
+    public Integer getIsPrintQrcode() {
         return isPrintQrcode;
     }
 
-    public void setIsPrintQrcode(String isPrintQrcode) {
+    public void setIsPrintQrcode(Integer isPrintQrcode) {
         this.isPrintQrcode = isPrintQrcode;
     }
+
+    public Integer getIsGeneralQrcode() {
+        return isGeneralQrcode;
+    }
+
+    public void setIsGeneralQrcode(Integer isGeneralQrcode) {
+        this.isGeneralQrcode = isGeneralQrcode;
+    }
+
+    public String getGeneralQrcode() {
+        return generalQrcode;
+    }
+
+    public void setGeneralQrcode(String generalQrcode) {
+        this.generalQrcode = generalQrcode;
+    }
+
+    public Integer getBerGenerateRules() {
+        return berGenerateRules;
+    }
+
+    public void setBerGenerateRules(Integer berGenerateRules) {
+        this.berGenerateRules = berGenerateRules;
+    }
 }

+ 1 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -954,7 +954,7 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
           relation_back_tel = #{relationBackTel},
         </if>
         <if test="relationBackLogisticsCompany != null and relationBackLogisticsCompany != ''" >
-          relation_back_logistics_company = #{relationBackTel},
+          relation_back_logistics_company = #{relationBackLogisticsCompany},
         </if>
         <if test="relationBackLogisticsNo != null and relationBackLogisticsNo != ''" >
           relation_back_logistics_no = #{relationBackLogisticsNo},

+ 3 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -560,7 +560,9 @@
             TRPP.produce_feature AS produceFeature,
 			TRPP.produce_name AS produceName,
 			TRPP.produce_brand AS produceBrand,
-			TRPP.is_print_qrcode AS isPrintQrcode
+			TRPP.is_print_qrcode AS isPrintQrcode,
+			TRPP.is_general_qrcode AS isGeneralQrcode,
+			TRPP.ber_generate_rules AS berGenerateRules
         FROM
             tb_rst_pts_produce TRPP
         WHERE

+ 43 - 9
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/produceMapper.xml

@@ -13,7 +13,11 @@
             tb_rst_pts_produce.produce_create_time AS  produceCreateTime,
             tb_rst_pts_produce.produce_update_time AS produceUpdateTime,
             tb_rst_pts_produce.wechat_mp_id AS wechatMpId,
-            tb_rst_pts_produce.produce_brand AS produceBrand
+            tb_rst_pts_produce.produce_brand AS produceBrand,
+            tb_rst_pts_produce.is_print_qrcode AS isPrintQrcode,
+            tb_rst_pts_produce.is_general_qrcode AS isGeneralQrcode,
+            tb_rst_pts_produce.general_qrcode AS generalQrcode,
+            tb_rst_pts_produce.ber_generate_rules AS berGenerateRules
         FROM
             tb_rst_pts_produce
         <where>
@@ -131,7 +135,11 @@
         tb_rst_pts_produce.produce_create_time AS  produceCreateTime,
         tb_rst_pts_produce.produce_update_time AS produceUpdateTime,
         tb_rst_pts_produce.wechat_mp_id AS wechatMpId,
-        tb_rst_pts_produce.produce_brand AS produceBrand
+        tb_rst_pts_produce.produce_brand AS produceBrand,
+        tb_rst_pts_produce.is_print_qrcode AS isPrintQrcode,
+        tb_rst_pts_produce.is_general_qrcode AS isGeneralQrcode,
+        tb_rst_pts_produce.general_qrcode AS generalQrcode,
+        tb_rst_pts_produce.ber_generate_rules AS berGenerateRules
         FROM
         tb_rst_pts_produce
         WHERE
@@ -200,8 +208,8 @@
 
 
     <insert id="saveProduce" parameterType="Produce" useGeneratedKeys="true"  keyProperty="produceId">
-        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake,produce_type,produce_pattern,produce_model,produce_feature,wechat_mp_id,produce_brand)
-        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake},#{produceType},#{producePattern},#{produceModel},#{produceFeature},#{wechatMpId},#{produceBrand})
+        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake,produce_type,produce_pattern,produce_model,produce_feature,wechat_mp_id,produce_brand,is_print_qrcode,is_general_qrcode,general_qrcode,ber_generate_rules)
+        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake},#{produceType},#{producePattern},#{produceModel},#{produceFeature},#{wechatMpId},#{produceBrand},#{isPrintQrcode},#{isGeneralQrcode},#{generalQrcode},#{berGenerateRules})
     </insert>
 
     <update id="updateProduce" parameterType="Produce" >
@@ -235,7 +243,19 @@
                 wechat_mp_id = #{wechatMpId},
             </if>
             <if test="produceBrand !=null and produceBrand !=''">
-                produce_brand = #{produceBrand}
+                produce_brand = #{produceBrand},
+            </if>
+            <if test="isPrintQrcode !=null and isPrintQrcode !=''">
+                is_print_qrcode = #{isPrintQrcode},
+            </if>
+            <if test="isGeneralQrcode !=null and isGeneralQrcode !=''">
+                is_general_qrcode = #{isGeneralQrcode},
+            </if>
+            <if test="generalQrcode !=null and generalQrcode !=''">
+                general_qrcode = #{generalQrcode},
+            </if>
+            <if test="berGenerateRules !=null and berGenerateRules !=''">
+                ber_generate_rules = #{berGenerateRules}
             </if>
         </set>
         WHERE
@@ -321,8 +341,11 @@
             produce_create_time AS  produceCreateTime,
             produce_update_time AS produceUpdateTime,
             wechat_mp_id AS wechatMpId,
-            produce_brand AS produceBrand
-
+            produce_brand AS produceBrand,
+            is_print_qrcode AS isPrintQrcode,
+            is_general_qrcode AS isGeneralQrcode,
+            general_qrcode AS generalQrcode,
+            ber_generate_rules AS berGenerateRules
         FROM
             tb_rst_pts_produce
         <where>
@@ -343,7 +366,11 @@
         produce_create_time AS  produceCreateTime,
         produce_update_time AS produceUpdateTime,
         wechat_mp_id AS wechatMpId,
-        produce_brand AS produceBrand
+        produce_brand AS produceBrand,
+        is_print_qrcode AS isPrintQrcode,
+        is_general_qrcode AS isGeneralQrcode,
+        general_qrcode AS generalQrcode,
+        ber_generate_rules AS berGenerateRules
         FROM
         tb_rst_pts_produce
         WHERE
@@ -359,6 +386,10 @@
         <result column="produce_create_time" property="produceCreateTime"/>
         <result column="produce_update_time" property="produceUpdateTime"/>
         <result column="produce_brand" property="produceBrand"/>
+        <result column="is_print_qrcode" property="isPrintQrcode"/>
+        <result column="is_general_qrcode" property="isGeneralQrcode"/>
+        <result column="general_qrcode" property="generalQrcode"/>
+        <result column="ber_generate_rules" property="berGenerateRules"/>
         <collection property="process" column="produce_id" ofType="ProduceProcess" select="listSelectProduceProcess"/>
     </resultMap>
 
@@ -458,7 +489,10 @@
         produce_create_time AS  produceCreateTime,
         produce_update_time AS produceUpdateTime,
         wechat_mp_id AS wechatMpId,
-        produce_brand AS produceBrand
+        produce_brand AS produceBrand,
+        is_print_qrcode AS isPrintQrcode,
+        is_general_qrcode AS isGeneralQrcode,
+        general_qrcode AS generalQrcode
         FROM
         tb_rst_pts_produce LIMIT 1
     </select>

+ 6 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -8,11 +8,13 @@ import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.address.AddressService;
 import com.iamberry.rst.faces.cm.*;
 import com.iamberry.rst.faces.fm.ComplaintSignclosedInfoService;
 import com.iamberry.rst.faces.fm.ComplaintSmallClassInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
+import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.sms.SmsService;
 import com.iamberry.rst.faces.sys.SysService;
@@ -94,6 +96,8 @@ public class AdminCustomerController {
     private CmRelationService cmRelationService ;
     @Autowired
     private ProcMethodService procMethodService ;
+    @Autowired
+    private LogisticsInfoService logisticsInfoService;
 
     /**
      * 获取客诉列表
@@ -1168,6 +1172,8 @@ public class AdminCustomerController {
         cmRelation.setCustomerId(Integer.valueOf(customerId));
         cmRelation = customerService.getCmRelationInfo(cmRelation);
         ProcMethod procMethod = customerService.getProcMethod(cmRelation.getProcMethodId());
+        List<LogisticsInfo>logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
         mv.addObject("procMethod", procMethod);
         mv.addObject("customerId", customerId);
         return mv;

+ 149 - 103
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachineController.java

@@ -558,33 +558,46 @@ public class AdminMachineController {
             machineNumber += 300;
         }
         String num = null;
-        for (int i = 0; i < Integer.valueOf(number); i++) {
-            machineNumber = machineNumber + i;
-            switch (String.valueOf(machineNumber).length()) {
-                case 0:
-                    num = "00001";
-                    break;
-                case 1:
-                    num = "0000" + String.valueOf(machineNumber);
-                    break;
-                case 2:
-                    num = "000" + String.valueOf(machineNumber);
-                    break;
-                case 3:
-                    num = "00" + String.valueOf(machineNumber);
-                    break;
-                case 4:
-                    num = "00" + String.valueOf(machineNumber);
-                    break;
-                case 5:
-                    num = String.valueOf(machineNumber);
-                    break;
+            for (int i = 0; i < Integer.valueOf(number); i++) {
+                machineNumber = machineNumber + i;
+                switch (String.valueOf(machineNumber).length()) {
+                    case 0:
+                        num = "00001";
+                        break;
+                    case 1:
+                        num = "0000" + String.valueOf(machineNumber);
+                        break;
+                    case 2:
+                        num = "000" + String.valueOf(machineNumber);
+                        break;
+                    case 3:
+                        num = "00" + String.valueOf(machineNumber);
+                        break;
+                    case 4:
+                        num = "00" + String.valueOf(machineNumber);
+                        break;
+                    case 5:
+                        num = String.valueOf(machineNumber);
+                        break;
+                }
             }
-            String json = String.format(NameUtils.QR_LIMIT_STR_SCENE, ResultInfo.barCodePrefix + berQrcode + num);
-            QRCJson qrc = WeixinUtil.createQrcodeByWechatMp(json,wechatMp.getWechatMpAppid(),wechatMp.getWechatMpAppsecret(),wechatMp.getWechatMpPubno());
             PtsMachine ptsMachine = new PtsMachine();
-            ptsMachine.setMachineQrcode(qrc.getUrl());//二维码
-            ptsMachine.setMachineBarcode(berQrcode + num);//条形码
+            String berQrcodeNum = null;
+            if(produce.getBerGenerateRules() == 1){
+                berQrcodeNum = berQrcode+num;
+            }else{
+                berQrcodeNum = berQrcode;
+            }
+            if(produce.getIsPrintQrcode() == 1) {
+                if (produce.getIsGeneralQrcode() == 2) {
+                    String json = String.format(NameUtils.QR_LIMIT_STR_SCENE, ResultInfo.barCodePrefix + berQrcodeNum);
+                    QRCJson qrc = WeixinUtil.createQrcodeByWechatMp(json, wechatMp.getWechatMpAppid(), wechatMp.getWechatMpAppsecret(), wechatMp.getWechatMpPubno());
+                    ptsMachine.setMachineQrcode(qrc.getUrl());//二维码
+                } else {
+                    ptsMachine.setMachineQrcode(produce.getGeneralQrcode());//二维码
+                }
+            }
+            ptsMachine.setMachineBarcode(berQrcodeNum);//条形码
             ptsMachine.setMachineStatus(1);//机器状态
             ptsMachine.setMachineProducedTime(new Date());//生产时间
             ptsMachine.setMachineIsPrint(1);//是否打印1:未打印2:已打印
@@ -598,7 +611,6 @@ public class AdminMachineController {
             ptsMachine.setMachineProduceId(Integer.valueOf(produceId));
             ptsMachine.setMachineIsRetreading(2);
             ptsList.add(ptsMachine);
-        }
         Integer msg = machineService.addMahineBatch(ptsList);
         if (msg > 0) {
             rj.setReturnCode(200);
@@ -617,20 +629,30 @@ public class AdminMachineController {
 
     //生成条形码
     public String generationBarCode(Produce produce) {
-        Calendar cal = Calendar.getInstance();
-        int year = cal.get(Calendar.YEAR);
-        int month = cal.get(Calendar.MONTH) + 1;
-
-        String months = String.valueOf(month);
-        if (month < 10) {
-            months = "0" + months;
-        }
-        producePattern = produce.getProducePattern();
-        productModel = produce.getProduceModel();
-        productFeatures = produce.getProduceFeature();
-        productBrand = produce.getProduceBrand();
-        //拼接
-        String barcode = productBrand+producePattern + productModel + productFeatures +  String.valueOf(year).substring(2, 4) + months;
+        String barcode = "";
+        if(produce.getBerGenerateRules() == 1){
+                Calendar cal = Calendar.getInstance();
+                int year = cal.get(Calendar.YEAR);
+                int month = cal.get(Calendar.MONTH) + 1;
+
+                String months = String.valueOf(month);
+                if (month < 10) {
+                    months = "0" + months;
+                }
+                producePattern = produce.getProducePattern();
+                productModel = produce.getProduceModel();
+                productFeatures = produce.getProduceFeature();
+                productBrand = produce.getProduceBrand();
+                //拼接
+                barcode = productBrand+producePattern + productModel + productFeatures +  String.valueOf(year).substring(2, 4) + months;
+        }else{
+            String string = "123456789abcdefghijklmnopqrstuvwxyz";
+            StringBuffer sb = new StringBuffer();
+            for (int i = 0; i < 9; i++) {
+                sb.append(string.charAt((int) Math.round(Math.random() * (9))));
+            }
+            barcode = "W-WQ1"+sb.toString();
+        }
         return barcode;
     }
 
@@ -720,75 +742,99 @@ public class AdminMachineController {
         Integer month = nowDate.get(Calendar.MONTH) + 1;
 
         String num = null;
+
         for (int i = 0; i < number; i++) {
+            String berQrcodeNum = null;
+            if(produce.getBerGenerateRules() == 2){
+                berQrcode = generationBarCode(produce);
+            }
             machineNumber++;
             String qrCodeUrl = null;
-            //判断机器是水机or牙刷
-            if(productType == 3){
-                switch (String.valueOf(machineNumber).length()) {
-                    case 0:
-                        num = "00001";
-                        break;
-                    case 1:
-                        num = "0000" + String.valueOf(machineNumber);
-                        break;
-                    case 2:
-                        num = "000" + String.valueOf(machineNumber);
-                        break;
-                    case 3:
-                        num = "00" + String.valueOf(machineNumber);
-                        break;
-                    case 4:
-                        num = "0" + String.valueOf(machineNumber);
-                        break;
-                    case 5:
-                        num = String.valueOf(machineNumber);
-                        break;
+                //判断机器是水机or牙刷
+                if(productType == 3){
+                    switch (String.valueOf(machineNumber).length()) {
+                        case 0:
+                            num = "00001";
+                            break;
+                        case 1:
+                            num = "0000" + String.valueOf(machineNumber);
+                            break;
+                        case 2:
+                            num = "000" + String.valueOf(machineNumber);
+                            break;
+                        case 3:
+                            num = "00" + String.valueOf(machineNumber);
+                            break;
+                        case 4:
+                            num = "0" + String.valueOf(machineNumber);
+                            break;
+                        case 5:
+                            num = String.valueOf(machineNumber);
+                            break;
+                    }
+                    if(produce.getBerGenerateRules() == 1){
+                        berQrcodeNum = berQrcode+num;
+                    }else{
+                        berQrcodeNum = berQrcode;
+                    }
+                    if(produce.getIsPrintQrcode() == 1){
+                        if(produce.getIsGeneralQrcode() == 2) {
+                            //获取项目地址
+                            WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();
+                            ServletContext servletContext = webApplicationContext.getServletContext();
+                            String realPath = servletContext.getRealPath(ResultInfo.QRCODE_TOOTH_IMAGE);
+
+                            try {
+                                QrCodeUtil.createQrCode(scanningQrCode + berQrcodeNum, realPath + "/" + berQrcodeNum + ".", 430, 430);
+                                StringBuffer url = request.getRequestURL();
+                                //String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).append("/").toString();
+                                String tempContextUrl = ResultInfo.ROOT_DIRECTORY;
+                                qrCodeUrl = tempContextUrl + ResultInfo.QRCODE_TOOTH_IMAGE + "/" + berQrcodeNum + ".png";
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }else{
+                            qrCodeUrl = produce.getGeneralQrcode();
+                        }
+                    }
+                }else{
+                    switch (String.valueOf(machineNumber).length()) {
+                        case 0:
+                            num = "0001";
+                            break;
+                        case 1:
+                            num = "000" + String.valueOf(machineNumber);
+                            break;
+                        case 2:
+                            num = "00" + String.valueOf(machineNumber);
+                            break;
+                        case 3:
+                            num = "0" + String.valueOf(machineNumber);
+                            break;
+                        case 4:
+                            num = String.valueOf(machineNumber);
+                            break;
+                    }
+                    if(produce.getBerGenerateRules() == 1){
+                        berQrcodeNum = berQrcode+num;
+                    }else{
+                        berQrcodeNum = berQrcode;
+                    }
+                    if(produce.getIsPrintQrcode() == 1) {
+                        if (produce.getIsGeneralQrcode() == 2) {
+                      /*获取公众号信息*/
+                            WechatMp wechatMp = produceService.getWechatMpById(produce.getWechatMpId());
+                            String json = String.format(NameUtils.QR_LIMIT_STR_SCENE, ResultInfo.barCodePrefix + berQrcodeNum);
+                            QRCJson qrc = WeixinUtil.createQrcodeByWechatMp(json, wechatMp.getWechatMpAppid(), wechatMp.getWechatMpAppsecret(), wechatMp.getWechatMpPubno());
+                            qrCodeUrl = qrc.getUrl();
+                        } else {
+                            qrCodeUrl = produce.getGeneralQrcode();
+                        }
+                    }
                 }
-                //获取项目地址
-                WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();
-                ServletContext servletContext = webApplicationContext.getServletContext();
-                String realPath = servletContext.getRealPath(ResultInfo.QRCODE_TOOTH_IMAGE);
-
-                try {
-                    QrCodeUtil.createQrCode(scanningQrCode+berQrcode+num,realPath+"/"+berQrcode+num+".",430,430);
-                    StringBuffer url = request.getRequestURL();
-                    //String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).append("/").toString();
-                    String tempContextUrl = ResultInfo.ROOT_DIRECTORY;
-                    qrCodeUrl = tempContextUrl +ResultInfo.QRCODE_TOOTH_IMAGE+ "/"+berQrcode+num+".png";
-                }catch (Exception e){
-                    e.printStackTrace();
-                }
-
-
-
-            }else{
-                switch (String.valueOf(machineNumber).length()) {
-                    case 0:
-                        num = "0001";
-                        break;
-                    case 1:
-                        num = "000" + String.valueOf(machineNumber);
-                        break;
-                    case 2:
-                        num = "00" + String.valueOf(machineNumber);
-                        break;
-                    case 3:
-                        num = "0" + String.valueOf(machineNumber);
-                        break;
-                    case 4:
-                        num = String.valueOf(machineNumber);
-                        break;
-                }
-                  /*获取公众号信息*/
-                WechatMp wechatMp = produceService.getWechatMpById(produce.getWechatMpId());
-                String json = String.format(NameUtils.QR_LIMIT_STR_SCENE, ResultInfo.barCodePrefix + berQrcode + num);
-                QRCJson qrc = WeixinUtil.createQrcodeByWechatMp(json,wechatMp.getWechatMpAppid(),wechatMp.getWechatMpAppsecret(),wechatMp.getWechatMpPubno());
-                qrCodeUrl = qrc.getUrl();
-            }
             PtsMachine ptsMachine = new PtsMachine();
             ptsMachine.setMachineQrcode(qrCodeUrl);//二维码
-            ptsMachine.setMachineBarcode(berQrcode + num);//条形码
+            ptsMachine.setMachineBarcode(berQrcodeNum);//条形码
             ptsMachine.setMachineStatus(1);//机器状态
             ptsMachine.setMachineProducedTime(new Date());//生产时间
             ptsMachine.setMachineIsPrint(1);//是否打印1:未打印2:已打印

+ 12 - 35
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl

@@ -85,24 +85,12 @@
                     <div style="width: 100%;display: inline-block;margin-right: 10px;">
                         <span class="select-box">
                                 <select name="relationBackLogisticsCompany" id="relationBackLogisticsCompany" class="select" seleType="send">
-                                    <option value="">物流公司</option>
-                                    <option value="sto">申通快递</option>
-                                    <option value="yto">圆通快递</option>
-                                    <option value="sf">顺丰快递</option>
-                                    <option value="ems">邮政EMS</option>
-                                    <option value="zto">中通快递</option>
-                                    <option value="zjs">宅急送</option>
-                                    <option value="yunda">韵达快递</option>
-                                    <option value="cces">cces快递</option>
-                                    <option value="pick">上门提货</option>
-                                    <option value="htky">汇通快递</option>
-                                    <option value="ttkdex">天天快递</option>
-                                    <option value="stars">星晨急便</option>
-                                    <option value="jd">京东快递</option>
-                                    <option value="dbkd">德邦快递</option>
-                                    <option value="01">其他</option>
-                                    <option value="02">上门送货</option>
-                                    <option value="lianhaowuliu">联昊通</option>
+                                    <option value="">请选择物流公司</option>
+                                    <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
+                                        <#list logisticsInfoList as logisticsInfo>
+                                            <option value="${logisticsInfo.logisticsRstCode!''}" >${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
+                                        </#list>
+                                    </#if>
                                 </select>
                         </span>
                     </div>
@@ -289,23 +277,12 @@
                         <div style="width: 300px;display: inline-block;margin-right: 10px;">
 			<span class="select-box">
 				<select name="relationSendLogisticsCompany" id="relationSendLogisticsCompany" class="select" seleType="sendInformation">
-					<option value="">物流公司</option>
-                    <option value="sto">申通快递</option>
-                    <option value="yto">圆通快递</option>
-                    <option value="sf">顺丰快递</option>
-                    <option value="ems">邮政EMS</option>
-                    <option value="zto">中通快递</option>
-                    <option value="zjs">宅急送</option>
-                    <option value="yunda">韵达快递</option>
-                    <option value="cces">cces快递</option>
-                    <option value="pick">上门提货</option>
-                    <option value="htky">汇通快递</option>
-                    <option value="ttkdex">天天快递</option>
-                    <option value="stars">星晨急便</option>
-                    <option value="jd">京东快递</option>
-                    <option value="dbkd">德邦快递</option>
-                    <option value="02">上门送货</option>
-                    <option value="lianhaowuliu">联昊通</option>
+                    <option value="">请选择物流公司</option>
+                    <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
+                        <#list logisticsInfoList as logisticsInfo>
+                            <option value="${logisticsInfo.logisticsRstCode!''}">${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
+                        </#list>
+                    </#if>
 				</select>
 			</span>
                         </div>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_List.ftl

@@ -124,7 +124,7 @@
                             ${list.produceName }/${list.producePattern }-${list.produceModel }
                             </td>
 							<td class="text-c" width="100">${list.machineBarcode }</td>
-							<td class="text-c" width="100"><div id="${100000 + list_index}"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></td>
+							<td class="text-c" width="100"><#if list.machineQrcode??><div id="${100000 + list_index}"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></#if></td>
                             <td class="text-c" width="100">
 							<#if list.machineIsPrint == 1>
                                     未打印

+ 50 - 23
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -64,7 +64,7 @@
                     <td width="2">
                         <input name='checkbox' type='checkbox' value='${list.machineBarcode }' machineId='${list.machineId }'>
                         <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
-                        <input type="hidden" value="${list.machineQrcode}" id="machineQrcode${list.machineId }">
+                        <input type="hidden" value="<#if list.machineQrcode??>${list.machineQrcode}</#if>" id="machineQrcode${list.machineId }">
                         <input type="hidden" value="${list.machineProduceType}" id="machineProduceType${list.machineId }">
                     </td>
                     <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-4) }</td>
@@ -174,6 +174,8 @@
             var produceName = produce.produceName;            //获取产品名称
             var produceBrand = produce.produceBrand;            //获取品牌字母
             var isPrintQrcode = produce.isPrintQrcode;            //是否需要打印二维码 1是 2 否
+            var isGeneralQrcode = produce.isGeneralQrcode;     //是否使用通用二维码 1 是 2否
+            var berGenerateRules = produce.berGenerateRules;     //1 序列化生成(原有生成规则)、2 随机生成
             produceCreateTime = formatDate(new Date());
             var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
             for (var i = 0; i < settingNumber; i++) {
@@ -192,16 +194,28 @@
                         '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
                         '</div>');
                 }else{
-                    $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
-                        '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
-                        '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
-                        '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
-                        '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                        '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                        '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                        '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
-                        '</div>');
-                }
+                    if(isGeneralQrcode == 1 || berGenerateRules == 2){
+                        $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                            '<span style="position: absolute;left: 10px;font-size: 14px;"></span>' +
+                            '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                            '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
+                            '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                            '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                            '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                            '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;display: none;">'+ produceCreateTime +'</span>' +
+                            '</div>');
+                    }else{
+                            $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                                    '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
+                                    '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                                    '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
+                                    '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                    '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                    '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                    '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
+                                    '</div>');
+                    }
+                 }
                 if(${machineIsPrint} == '1')
                 {
                     updatePrint(machineBarcode,false);
@@ -351,12 +365,12 @@
         var produceName = produce.produceName;            //获取产品名称
         var produceBrand = produce.produceBrand;            //获取品牌字母
         var isPrintQrcode = produce.isPrintQrcode;            //是否需要打印二维码 1是 2 否
+        var isGeneralQrcode = produce.isGeneralQrcode;     //是否使用通用二维码 1 是 2否
+        var berGenerateRules = produce.berGenerateRules;     //1 序列化生成(原有生成规则)、2 随机生成
         produceCreateTime = formatDate(new Date());
         for (var i=0;i<settingNumber;i++){
             code128(machineBarcode);
             var barcodes = $("#bcTarget").html();
-
-            /*if (produceName.indexOf("富氢") != -1 || produceName.indexOf("诺米克") != -1) {*/
             if (isPrintQrcode == 2) {
                 $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
                         '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
@@ -368,17 +382,28 @@
                         '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
                         '</div>');
             }else{
-                $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
-                        '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
-                        '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
-                        '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
-                        '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                        '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                        '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                        '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
-                        '</div>');
+                if(isGeneralQrcode == 1 || berGenerateRules == 2){
+                    $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                            '<span style="position: absolute;left: 10px;font-size: 14px;"></span>' +
+                            '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                            '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
+                            '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                            '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                            '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                            '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;display: none;">'+ produceCreateTime +'</span>' +
+                            '</div>');
+                }else{
+                    $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                            '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
+                            '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                            '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
+                            '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                            '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                            '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                            '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
+                            '</div>');
+                }
             }
-
         }
         if(settingNumber > 24){
             layer.msg('一次最多支持打印24张条形码', {icon: 2, time: 2000});
@@ -414,6 +439,8 @@
                     produce.produceFeature = data.produceFeature;
                     produce.produceName = data.produceName;
                     produce.isPrintQrcode = data.isPrintQrcode;
+                    produce.isGeneralQrcode = data.isGeneralQrcode;
+                    produce.berGenerateRules = data.berGenerateRules;
                 }
             },
             error: function(){

+ 82 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl

@@ -50,15 +50,6 @@
                         <option value="D">其他(D)</option>
                     </select>
                 </div>
-                <div class="input-box "><span class="input-dic">所属公众号</span>
-                    <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
-                    <#if (listWechatMp?size > 0)>
-                        <#list listWechatMp as list>
-                        <option value="${list.wechatMpId!''}">${list.wechatMpName!''}</option>
-                        </#list>
-                    </#if>
-                    </select>
-                </div>
                 <div class="input-box"><span class="input-dic">品牌字母</span><input class="my-input" name="produceBrand" id="produceBrand" type="text" value="" placeholder="请输入品牌字母" required   maxlength="20" minlength="1"/> </div>
 
                 <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="1-15位英文、数字组合" required  maxlength="15" minlength="1"/>-
@@ -74,6 +65,33 @@
                     <label><input type="radio" name="produceStatus" value="1" checked>正在使用</label>
                     <label><input type="radio" name="produceStatus" value="0">停止使用</label>
                 </div>
+                <div class="input-box"><span class="input-dic">条形码生成规则</span>
+                    <label><input type="radio" name="berGenerateRules" value="1" checked>序列化生成(原有生成规则)</label>
+                    <label><input type="radio" name="berGenerateRules" value="2">随机生成</label>
+                </div>
+                <div class="input-box"><span class="input-dic">是否需要二维码</span>
+                    <label><input type="radio" name="isPrintQrcode" value="1" checked>是</label>
+                    <label><input type="radio" name="isPrintQrcode" value="2">否</label>
+                </div>
+                <div class="input-box" id="isGeneralQrcodeid"><span class="input-dic">是否使用通用二维码</span>
+                    <label><input type="radio" name="isGeneralQrcode" value="1" checked>是</label>
+                    <label><input type="radio" name="isGeneralQrcode" value="2">否</label>
+                </div>
+                <div class="input-box" id="fileDiv" ><span class="input-dic">上传通用二维码</span>
+                        <input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 70px;height: 60px;">
+                        <img alt="介绍图" src="${path}/common/images/pts/addparts.jpg" id="partsImg" width="70" height="60">
+                        <input type="hidden" id="generalQrcode" name="generalQrcode" value=""/>
+                    <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="uploadSubmit"><i class="Hui-iconfont">&#xe665;</i> 上传</button>-->
+                </div>
+                <div class="input-box " id="wechatMpIdDiv" style="display: none;"><span class="input-dic">所属公众号</span>
+                    <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
+                    <#if (listWechatMp?size > 0)>
+                        <#list listWechatMp as list>
+                            <option value="${list.wechatMpId!''}">${list.wechatMpName!''}</option>
+                        </#list>
+                    </#if>
+                    </select>
+                </div>
                 <div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;width: 93%;"></div>
 
                 <div class="my-title">工序信息</div>
@@ -117,6 +135,7 @@
 <#--<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>-->
 <#--<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/jquery.ui/jquery-ui.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
 <script type="text/javascript">
 
     var check_name = /^[a-zA-Z0-9\u4e00-\u9fa5,.!;,。!;:“”\\"\\ ]+$/;
@@ -229,6 +248,10 @@
         produce.produceModel = $("[name='produceModel']").val();//产品型号
         produce.wechatMpId = $("[name='wechatMpId']").val();//公众号id
         produce.produceBrand = $("[name='produceBrand']").val();//品牌字母
+        produce.isPrintQrcode = $("[name='isPrintQrcode']:checked").val();//是否需要二维码
+        produce.isGeneralQrcode = $("[name='isGeneralQrcode']:checked").val();//是否需要通用二维码
+        produce.generalQrcode = $("#generalQrcode").val();//通用二维码
+        produce.berGenerateRules = $("[name='berGenerateRules']:checked").val();//条码生成规则
         return produce;
     }
 
@@ -302,6 +325,56 @@
             $(node).parents(".nodeList").remove();
         }
     }
+    $('#fileid').change(function() {
+        fileUpload();
+    });
+    function fileUpload() {
+        $.ajaxFileUpload({
+            url:"${path}/admin/machineParts/fileUpload",
+            secureuri:false,
+            fileElementId:"fileid",//文件选择框的id属性
+            dataType: 'json',   //json
+            success: function (data) {
+                if(data.returnCode == 200){
+                    $('#generalQrcode').val("//rst.iamberry.com/"+data.returnMsg.imgUrl);
+                    $('#partsImg').attr("src",root_path+data.returnMsg.imgUrl);
+                    $("#fileid").remove();
+                    /*<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">*/
+                    $("#fileDiv").prepend('<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;" onchange="fileUpload()">');
+                }else{
+                    layer.msg('上传失败,请重试!',{icon: 5,time:2000});
+                }
+            }
+        });
+    }
+
+    /**
+     * 监听是否需要二维码
+     */
+    $("[name='isPrintQrcode']").click(function () {
+        if($(this).val() == 1){
+            $("#isGeneralQrcodeid").show();
+            $("#fileDiv").show();
+            $("#wechatMpIdDiv").hide();
+            $("[name='isGeneralQrcode']").get(0).checked = true;
+        }else{
+            $("#isGeneralQrcodeid").hide();
+            $("#fileDiv").hide();
+            $("#wechatMpIdDiv").hide();
+        }
+    });
+    /**
+     * 监听是否需要上传二维码
+     */
+    $("[name='isGeneralQrcode']").click(function () {
+        if($(this).val() == 1){
+            $("#fileDiv").show();
+            $("#wechatMpIdDiv").hide();
+        }else{
+            $("#fileDiv").hide();
+            $("#wechatMpIdDiv").show();
+        }
+    })
 </script>
 
 <script>

+ 85 - 11
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

@@ -50,16 +50,6 @@
                     <option value ="D" <#if produce.produceFeature??><#if produce.produceFeature == 'D'>selected="selected"</#if></#if>>其他(D)</option>
                 </select>
             </div>
-
-            <div class="input-box "><span class="input-dic">所属公众号</span>
-                <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
-                <#if (listWechatMp?size > 0)>
-                    <#list listWechatMp as list>
-                        <option value="${list.wechatMpId!''}" <#if produce.wechatMpId??><#if produce.wechatMpId == list.wechatMpId>selected="selected"</#if></#if> >${list.wechatMpName!''}</option>
-                    </#list>
-                </#if>
-                </select>
-            </div>
             <div class="input-box"><span class="input-dic">品牌字母</span><input class="my-input" name="produceBrand" id="produceBrand" type="text" value="${produce.produceBrand!}" placeholder="请输入品牌字母" required   maxlength="20" minlength="1"/> </div>
             <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="1-15位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="15" minlength="1"/>-
                 <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="1-15位英文、数字组合" required  maxlength="15" minlength="1"/>  </div>
@@ -73,6 +63,33 @@
                 <label><input type="radio" name="produceStatus" value="1" <#if produce.produceStatus == 1>checked</#if>>正在使用</label>
                 <label><input type="radio" name="produceStatus" value="0" <#if produce.produceStatus == 0>checked</#if>>停止使用</label>
             </div>
+            <div class="input-box"><span class="input-dic">条形码生成规则</span>
+                <label><input type="radio" name="berGenerateRules" value="1" <#if produce.berGenerateRules??> <#if produce.berGenerateRules == 1>checked</#if></#if>>序列化生成(原有生成规则)</label>
+                <label><input type="radio" name="berGenerateRules" value="2" <#if produce.berGenerateRules??> <#if produce.berGenerateRules == 2>checked</#if></#if>>随机生成</label>
+            </div>
+            <div class="input-box"><span class="input-dic">是否需要二维码</span>
+                <label><input type="radio" name="isPrintQrcode" value="1"<#if produce.isPrintQrcode??> <#if produce.isPrintQrcode == 1>checked</#if></#if>>是</label>
+                <label><input type="radio" name="isPrintQrcode" value="2"<#if produce.isPrintQrcode??> <#if produce.isPrintQrcode == 2>checked</#if></#if>>否</label>
+            </div>
+            <div class="input-box" id="isGeneralQrcodeid" style="<#if produce.isPrintQrcode??> <#if produce.isPrintQrcode == 2>display: none;</#if></#if>"><span class="input-dic">是否使用通用二维码</span>
+                <label><input type="radio" name="isGeneralQrcode" value="1"<#if produce.isGeneralQrcode??><#if produce.isGeneralQrcode == 1>checked</#if></#if>>是</label>
+                <label><input type="radio" name="isGeneralQrcode" value="2"<#if produce.isGeneralQrcode??><#if produce.isGeneralQrcode == 2>checked</#if></#if>>否</label>
+            </div>
+            <div class="input-box" id="fileDiv" style="<#if produce.isPrintQrcode == 2 || produce.isGeneralQrcode == 2>display: none;</#if>"><span class="input-dic">上传通用二维码</span>
+                <input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 70px;height: 60px;">
+                <img alt="介绍图" src="${produce.generalQrcode!}" id="partsImg" width="70" height="60">
+                <input type="hidden" id="generalQrcode" name="generalQrcode" value="${produce.generalQrcode!}"/>
+            <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="uploadSubmit"><i class="Hui-iconfont">&#xe665;</i> 上传</button>-->
+            </div>
+            <div class="input-box"  id="wechatMpIdDiv" style="display: none;"><span class="input-dic">所属公众号</span>
+                <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
+                <#if (listWechatMp?size > 0)>
+                    <#list listWechatMp as list>
+                        <option value="${list.wechatMpId!''}" <#if produce.wechatMpId??><#if produce.wechatMpId == list.wechatMpId>selected="selected"</#if></#if> >${list.wechatMpName!''}</option>
+                    </#list>
+                </#if>
+                </select>
+            </div>
             <div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;width: 93%;"></div>
             <div class="my-title">工序信息</div>
 
@@ -123,6 +140,7 @@
 <#--<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>-->
 <#--<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/jquery.ui/jquery-ui.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
 <script type="text/javascript">
 
     var check_name = /^[a-zA-Z0-9\u4e00-\u9fa5,.!;,。!;:“”\\"\\ ]+$/;
@@ -248,7 +266,10 @@
         produce.produceModel = $("[name='produceModel']").val();//产品型号
         produce.wechatMpId = $("[name='wechatMpId']").val();//公众号id
         produce.produceBrand = $("[name='produceBrand']").val();//品牌字母
-
+        produce.isPrintQrcode = $("[name='isPrintQrcode']:checked").val();//是否需要二维码
+        produce.isGeneralQrcode = $("[name='isGeneralQrcode']:checked").val();//是否需要通用二维码
+        produce.generalQrcode = $("#generalQrcode").val();//通用二维码
+        produce.berGenerateRules = $("[name='berGenerateRules']:checked").val();//条码生成规则
         produce.delProcessIds = delProcessIds;    //需要删除的工序id
         produce.delNodeIds = delNodeIds;           //需要删除的工序操作id
         return produce;
@@ -350,6 +371,59 @@
             $(node).parents(".nodeList").remove();
         }
     }
+
+
+    $('#fileid').change(function() {
+        fileUpload();
+    });
+    function fileUpload() {
+        $.ajaxFileUpload({
+            url:"${path}/admin/machineParts/fileUpload",
+            secureuri:false,
+            fileElementId:"fileid",//文件选择框的id属性
+            dataType: 'json',   //json
+            success: function (data) {
+                if(data.returnCode == 200){
+                    $('#generalQrcode').val("//rst.iamberry.com/"+data.returnMsg.imgUrl);
+                    $('#partsImg').attr("src",root_path+data.returnMsg.imgUrl);
+                    $("#fileid").remove();
+                    /*<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">*/
+                    $("#fileDiv").prepend('<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;" onchange="fileUpload()">');
+                }else{
+                    layer.msg('上传失败,请重试!',{icon: 5,time:2000});
+                }
+            }
+        });
+    }
+
+
+    /**
+     * 监听是否需要二维码
+     */
+    $("[name='isPrintQrcode']").click(function () {
+        if($(this).val() == 1){
+            $("#isGeneralQrcodeid").show();
+            $("#fileDiv").show();
+            $("#wechatMpIdDiv").hide();
+            $("[name='isGeneralQrcode']").get(0).checked = true;
+        }else{
+            $("#isGeneralQrcodeid").hide();
+            $("#fileDiv").hide();
+            $("#wechatMpIdDiv").hide();
+        }
+    });
+    /**
+     * 监听是否需要上传二维码
+     */
+    $("[name='isGeneralQrcode']").click(function () {
+        if($(this).val() == 1){
+            $("#fileDiv").show();
+            $("#wechatMpIdDiv").hide();
+        }else{
+            $("#fileDiv").hide();
+            $("#wechatMpIdDiv").show();
+        }
+    })
 </script>
 
 <script>