Browse Source

平台将公共询价新增和采购询价新增分离出来

hejq 8 years ago
parent
commit
ee760e4178

+ 1 - 1
src/main/java/com/uas/platform/b2b/erp/service/impl/PublicInquiryServiceImpl.java

@@ -314,7 +314,7 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
 //                                    try {
 //                                        sms.setReceiver(userTel.getEmphone());
 //                                        sms.setTemplateId(messageConf.getMsgInquiryForB2B());
-//                                        HttpUtil.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
+//                                        PSHttpUtils.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
 //                                        noticeDao.saveErpLog(userName, userIp, enUU, userUU, "发送询价单通知短信", "发送成功,询价单号" + inquiry.getCode());
 //                                    } catch (Exception e) {
 //                                        noticeDao.saveErpLog(userName, userIp, enUU, userUU, "发送询价单通知短信", "发送失败,询价单号" + inquiry.getCode());

+ 16 - 0
src/main/java/com/uas/platform/b2b/ps/InquiryUtils.java

@@ -293,4 +293,20 @@ public class InquiryUtils {
         }
         return null;
     }
+
+    /**
+     * 针对客户,增加公共询价单信息
+     *
+     * @param inquiry
+     * @return
+     * @throws Exception
+     */
+    public static PurcInquiry saveInquiry(PurcInquiry inquiry) throws Exception {
+        String res = HttpUtil.doPost(url + "/inquiry/buyer/save", FlexJsonUtils.toJsonDeep(inquiry));
+        if (null != res) {
+            Object obj = JSON.parse(res);
+            return JSON.parseObject(obj.toString(), PurcInquiry.class);
+        }
+        return null;
+    }
 }

+ 622 - 0
src/main/java/com/uas/platform/b2b/ps/PSHttpUtils.java

@@ -0,0 +1,622 @@
+package com.uas.platform.b2b.ps;
+
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
+import org.apache.http.Consts;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.*;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+import org.apache.http.util.EntityUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.util.StreamUtils;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * 公共服务HTTP请求
+ *
+ * @author hejq
+ * @date 2018-01-26 14:31
+ */
+public class PSHttpUtils {
+
+	/**
+	 * 请求来源B2B
+	 */
+	private final static String SOURCE_APP = "B2B";
+
+	/**
+	 * 发送GET请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendGetRequest(String url, Map<String, ?> params) throws Exception {
+		return sendGetRequest(url, params, false);
+	}
+
+	/**
+	 * 发送GET请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	@SuppressWarnings("unchecked")
+	public static Response sendGetRequest(String url, Map<String, ?> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.GET, url, (Map<String, Object>) params, sign, false);
+	}
+
+	/**
+	 * 暂时先使用这种方法(短信接口调用)
+	 */
+	public static String sendPost(String url, String param) {
+		PrintWriter out = null;
+		BufferedReader in = null;
+		String result = "";
+		try {
+			URL realUrl = new URL(url);
+			// 打开和URL之间的连接
+			URLConnection conn = realUrl.openConnection();
+			// 设置通用的请求属性
+			conn.setRequestProperty("content-type", "application/json");
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+			// 发送POST请求必须设置如下两行
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			// 获取URLConnection对象对应的输出流
+			out = new PrintWriter(conn.getOutputStream());
+			// 发送请求参数
+			out.print(param);
+			// flush输出流的缓冲
+			out.flush();
+			// 定义BufferedReader输入流来读取URL的响应
+			in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+			String line;
+			while ((line = in.readLine()) != null) {
+				result += line;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		// 使用finally块来关闭输出流、输入流
+		finally {
+			try {
+				if (out != null) {
+					out.close();
+				}
+				if (in != null) {
+					in.close();
+				}
+			} catch (IOException ex) {
+				ex.printStackTrace();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, Map<String, ?> params) throws Exception {
+		return sendPostRequest(url, params, false);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	@SuppressWarnings("unchecked")
+	public static Response sendPostRequest(String url, Map<String, ?> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.POST, url, (Map<String, Object>) params, sign, true);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @param encode
+	 *            是否使用URLEncode
+	 * @return
+	 * @throws Exception
+	 */
+	@SuppressWarnings("unchecked")
+	public static Response sendPostRequest(String url, Map<String, ?> params, boolean sign, boolean encode)
+			throws Exception {
+		return sendRequest(RequestMethod.POST, url, (Map<String, Object>) params, sign, encode);
+	}
+
+	/**
+	 * 发送Post请求,直接将List类型放入其中
+	 *
+	 * @param postUrl
+	 * @param formData
+	 * @return
+	 * @throws Exception
+	 */
+	public static String doPost(String postUrl, String formData) throws Exception {
+		HttpClient httpClient = new DefaultHttpClient();
+		HttpPost post = new HttpPost(postUrl);
+		StringEntity postingString = new StringEntity(formData,  HTTP.UTF_8);
+		post.setEntity(postingString);
+		post.setHeader("Content-type", "application/json");
+		HttpResponse response = httpClient.execute(post);
+		String content = EntityUtils.toString(response.getEntity());
+		return content;
+	}
+
+	/**
+	 * 发送DELETE请求
+	 * 
+	 * @param url
+	 * @param params
+	 * 
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendDeleteRequest(String url, Map<String, ?> params) throws Exception {
+		return sendDeleteRequest(url, params, false);
+	}
+
+	/**
+	 * 发送DELETE请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	@SuppressWarnings("unchecked")
+	public static Response sendDeleteRequest(String url, Map<String, ?> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.DELETE, url, (Map<String, Object>) params, sign, false);
+	}
+
+	/**
+	 * 发起http请求
+	 *
+	 * @param method
+	 *            请求方法GET、POST、PUT、DELETE
+	 * @param url
+	 *            请求链接
+	 * @param params
+	 *            参数
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendRequest(RequestMethod method, String url, Map<String, Object> params, boolean sign,
+                                       boolean encode) throws Exception {
+		switch (method) {
+		case GET:
+			return sendHttpUriRequest(new HttpGet(getRequestUrl(url, params, sign)));
+		case POST:
+			return sendHttpEntityEnclosingRequest(new HttpPost(getRequestUrl(url, sign)), params, encode);
+		case PUT:
+			return sendHttpEntityEnclosingRequest(new HttpPut(getRequestUrl(url, sign)), params, encode);
+		case DELETE:
+			return sendHttpUriRequest(new HttpDelete(getRequestUrl(url, params, sign)));
+		default:
+			return sendHttpUriRequest(new HttpGet(getRequestUrl(url, params, sign)));
+		}
+	}
+
+	/**
+	 * 发起GET、DELETE请求
+	 * 
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendHttpUriRequest(HttpRequestBase request) throws Exception {
+		request.setHeader("SOURCE_APP", SOURCE_APP);
+		CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		try {
+			response = httpClient.execute(request);
+			return Response.getResponse(response);
+		} finally {
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+			}
+			if (response != null) {
+				try {
+					response.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	/**
+	 * 发起POST、PUT请求
+	 * 
+	 * @param request
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendHttpEntityEnclosingRequest(HttpEntityEnclosingRequestBase request,
+                                                          Map<String, Object> params, boolean encode) throws Exception {
+		request.setHeader("SOURCE_APP", SOURCE_APP);
+		CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		try {
+			if (!encode) {
+				request.setEntity(new StringEntity(FlexJsonUtils.toJson(params), ContentType.APPLICATION_JSON));
+			} else {
+				List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+				if (params != null && !params.isEmpty()) {
+					Set<Entry<String, Object>> entrys = params.entrySet();
+					for (Map.Entry<String, Object> entry : entrys) {
+						Object entryValue = entry.getValue();
+						String entryValueStr = null;
+						if (entryValue instanceof String) {
+							entryValueStr = entryValue.toString();
+						} else {
+							entryValueStr = FlexJsonUtils.toJson(entry.getValue());
+						}
+						nvps.add(new BasicNameValuePair(entry.getKey(), URLEncoder.encode(entryValueStr, "UTF-8")));
+					}
+				}
+				request.setEntity(new UrlEncodedFormEntity(nvps));
+			}
+			response = httpClient.execute(request);
+			return Response.getResponse(response);
+		} finally {
+			request.releaseConnection();
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+			}
+			if (response != null) {
+				try {
+					response.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	/**
+	 * 将请求参数添加到链接中
+	 *
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	public static String getRequestUrl(String url, Map<String, Object> params, boolean sign)
+			throws UnsupportedEncodingException {
+		StringBuilder buf = new StringBuilder(url);
+		if (url.indexOf("?") == -1)
+			buf.append("?");
+		else if (!url.endsWith("&"))
+			buf.append("&");
+		// 如果是GET请求,则请求参数在URL中
+		if (params != null && !params.isEmpty()) {
+			Set<Entry<String, Object>> entrys = params.entrySet();
+			for (Map.Entry<String, Object> entry : entrys) {
+				buf.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"))
+						.append("&");
+			}
+		}
+		if (sign) {
+			// 加时间戳,保持相同请求每次签名均不一样
+			buf.append("_timestamp=").append(System.currentTimeMillis());
+			String message = buf.toString();
+			// 对请求串进行签名
+//			buf.append("&_signature=").append(HmacUtils.encode(message));
+		} else
+			buf.deleteCharAt(buf.length() - 1);
+		return buf.toString();
+	}
+
+	/**
+	 * 将签名信息添加到链接中
+	 *
+	 * @param url
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 */
+	public static String getRequestUrl(String url, boolean sign) {
+		try {
+			return getRequestUrl(url, null, sign);
+		} catch (UnsupportedEncodingException e) {
+		}
+		return null;
+	}
+
+	/**
+	 * 将输入流转为字节数组
+	 * 
+	 * @param inStream
+	 * @return
+	 * @throws Exception
+	 */
+	public static byte[] read2Byte(InputStream inStream) throws Exception {
+		ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		int len = 0;
+		while ((len = inStream.read(buffer)) != -1) {
+			outSteam.write(buffer, 0, len);
+		}
+		outSteam.close();
+		inStream.close();
+		return outSteam.toByteArray();
+	}
+
+	/**
+	 * 将输入流转为字符串
+	 * 
+	 * @param inStream
+	 * @return
+	 * @throws Exception
+	 */
+	public static String read2String(InputStream inStream) throws Exception {
+		ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		int len = 0;
+		while ((len = inStream.read(buffer)) != -1) {
+			outSteam.write(buffer, 0, len);
+		}
+		try {
+			outSteam.close();
+			inStream.close();
+		} catch (Exception e) {
+
+		}
+		return new String(outSteam.toByteArray(), "UTF-8");
+	}
+
+	/**
+	 * 发送xml数据
+	 * 
+	 * @param path
+	 *            请求地址
+	 * @param xml
+	 *            xml数据
+	 * @param encoding
+	 *            编码
+	 * @return
+	 * @throws Exception
+	 */
+	public static byte[] postXml(String path, String xml, String encoding) throws Exception {
+		byte[] data = xml.getBytes(encoding);
+		URL url = new URL(path);
+		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+		conn.setRequestMethod("POST");
+		conn.setDoOutput(true);
+		conn.setRequestProperty("Content-Type", "text/xml; charset=" + encoding);
+		conn.setRequestProperty("Content-Length", String.valueOf(data.length));
+		conn.setConnectTimeout(5 * 1000);
+		OutputStream outStream = conn.getOutputStream();
+		outStream.write(data);
+		outStream.flush();
+		outStream.close();
+		if (conn.getResponseCode() == HttpStatus.OK.value()) {
+			return read2Byte(conn.getInputStream());
+		}
+		return null;
+	}
+
+	/**
+	 * http上传文件
+	 * 
+	 * @param postUrl
+	 *            请求地址
+	 * @param filePath
+	 *            附件路径
+	 * @param params
+	 *            参数
+	 * @return
+	 * @throws Exception
+	 * @throws IOException
+	 * @throws IllegalStateException
+	 */
+	public static Response upload(String postUrl, String filePath, Map<String, String> params)
+			throws IllegalStateException, IOException, Exception {
+		CloseableHttpClient httpClient = null;
+		CloseableHttpResponse response = null;
+		try {
+			httpClient = HttpClients.createDefault();
+			HttpPost httpPost = new HttpPost(postUrl);
+			FileBody fileBody = new FileBody(new File(filePath));
+			MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+			builder.addPart("file", fileBody);
+			if (params != null) {
+				for (String paramKey : params.keySet()) {
+					StringBody body = new StringBody(params.get(paramKey), ContentType.create("text/plain",
+							Consts.UTF_8));
+					builder.addPart(paramKey, body);
+				}
+			}
+			HttpEntity reqEntity = builder.build();
+			httpPost.setEntity(reqEntity);
+			response = httpClient.execute(httpPost);
+		} finally {
+			try {
+				if (response != null) {
+					response.close();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			try {
+				if (httpClient != null) {
+					httpClient.close();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return Response.getResponse(response);
+	}
+
+	/**
+	 * 下载
+	 * 
+	 * @param postUrl
+	 * @return
+	 * @throws ClientProtocolException
+	 * @throws IOException
+	 */
+	public static InputStream download(String postUrl) throws ClientProtocolException, IOException {
+		CloseableHttpClient httpClient = HttpClients.createDefault();
+		HttpGet httpGet = new HttpGet(postUrl);
+		CloseableHttpResponse response = httpClient.execute(httpGet);
+		return response.getEntity().getContent();
+	}
+
+	/**
+	 * 获取请求客户端的IP地址
+	 * 
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	public static String getIpAddr(HttpServletRequest request) {
+		String ip = request.getHeader("x-forwarded-for");
+		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+			ip = request.getHeader("Proxy-Client-IP");
+		}
+		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+			ip = request.getHeader("WL-Proxy-Client-IP");
+		}
+		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+			ip = request.getHeader("HTTP_CLIENT_IP");
+		}
+		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+			ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+		}
+		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+			ip = request.getRemoteAddr();
+		}
+		return ip;
+	}
+	
+	/**
+	 * POST发送
+	 * 
+	 * @param url
+	 * @param data
+	 * @throws Exception
+	 */
+	public static String post(String url, String data) throws Exception {
+		URL urls = new URL(url);
+		HttpURLConnection http = (HttpURLConnection) urls.openConnection();
+		http.setRequestMethod("POST");
+		http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+		http.setDoOutput(true);
+		http.setDoInput(true);
+		System.setProperty("sun.net.client.defaultConnectTimeout", "30000");// 连接超时30秒
+		System.setProperty("sun.net.client.defaultReadTimeout", "30000"); // 读取超时30秒
+		http.connect();
+		OutputStream os = http.getOutputStream();
+		os.write(data.getBytes("UTF-8"));// 传入参数
+		os.flush();
+		os.close();
+		// 从服务器读取响应
+		String encoding = http.getContentEncoding();
+		if (encoding == null)
+			encoding = "UTF-8";
+		return StreamUtils.copyToString(http.getInputStream(), Charset.forName(encoding));
+	}
+
+	public static class Response {
+		private int statusCode;
+		private String responseText;
+		private HttpResponse response;
+
+		public int getStatusCode() {
+			return statusCode;
+		}
+
+		public void setStatusCode(int statusCode) {
+			this.statusCode = statusCode;
+		}
+
+		public String getResponseText() {
+			return responseText;
+		}
+
+		public void setResponseText(String responseText) {
+			this.responseText = responseText;
+		}
+
+		public HttpResponse getResponse() {
+			return response;
+		}
+
+		public void setResponse(HttpResponse response) {
+			this.response = response;
+		}
+
+		public Response() {
+		}
+
+		public Response(HttpResponse response) throws IllegalStateException, IOException, Exception {
+			this.statusCode = response.getStatusLine().getStatusCode();
+			this.responseText = PSHttpUtils.read2String(response.getEntity().getContent());
+			this.response = response;
+		}
+
+		public static Response getResponse(HttpResponse response) throws IllegalStateException, IOException, Exception {
+			if (response != null)
+				return new Response(response);
+			return null;
+		}
+	}
+}

+ 13 - 9
src/main/java/com/uas/platform/b2b/service/impl/PurcInquiryServiceImpl.java

@@ -3,9 +3,11 @@ package com.uas.platform.b2b.service.impl;
 import com.uas.platform.b2b.core.util.ContextUtils;
 import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.dao.*;
+import com.uas.platform.b2b.erp.model.Inquiry;
 import com.uas.platform.b2b.event.PurchaseInquiryItemDecideReleaseEvent;
 import com.uas.platform.b2b.event.PurchaseInquiryItemSaveReleaseEvent;
 import com.uas.platform.b2b.model.*;
+import com.uas.platform.b2b.ps.InquiryUtils;
 import com.uas.platform.b2b.service.AttachService;
 import com.uas.platform.b2b.service.PurcInquiryService;
 import com.uas.platform.b2b.service.RoleService;
@@ -507,6 +509,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 				inquiry.setCurrency(inquiryInfo.getCurrency());
 				inquiry.setIfTax(inquiryInfo.getIfTax());
 				inquiry.setInquirytype(inquiryInfo.getInquirytype());
+				inquiry.setSourceapp(SOURCERAPP);
 				Set<PurcInquiryItem> items = new HashSet<PurcInquiryItem>();
 				Short i = 1;
 				if (!CollectionUtils.isEmpty(inquiryInfo.getInquiryItems())) {
@@ -535,14 +538,13 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 								product.setCmpUuId(purcitem.getProdCode());
 								product.setUnit(purcitem.getUnit());
 								product.setUserUU(SystemSession.getUser().getUserUU());
-//								product.setShipAddr(SystemSession.getUser().getEnterprise().getEnAddress());
 								product.setSpec(purcitem.getProdTitle());
-								product = productDao.save(product);
-								item.setProduct(product);
-								item.setProductId(product.getId());
+                                item.setCmpCode(product.getCmpCode());
+                                item.setInbrand(product.getBrand());
+                                item.setSpec(product.getSpec());
+                                item.setProduct(product);
 							}
 						}
-						item.setInquiry(inquiry);
 						item.setNumber(i);
 						item.setCurrency(inquiry.getCurrency());
 						item.setFromDate(new Date());
@@ -557,16 +559,18 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 						item.setStatus((short) Status.NOT_REPLY.value());
 						item.setIsOpen(inquiryInfo.getIsOpen());
 						item.setNeedquantity(purcitem.getNeedquantity());
+						item.setSource(SOURCERAPP);
 						items.add(item);
 						i++;
 					}
 				}
-				List<PurcInquiryItem> purcitems = purcInquiryItemDao.save(items);
-				if (purcitems.get(0).getId() != null) {
+				inquiry.setInquiryItems(items);
+				try {
+					inquiry = InquiryUtils.saveInquiry(inquiry);
 					map.put("success", "询价单保存成功");
-					map.put("id", purcitems.get(0).getInquiry().getId());
+					map.put("id", inquiry.getId());
 					logger.log("询价单", "平台新增询价单", useruu, SystemSession.getUser().getIp());
-				} else {
+				} catch (Exception e) {
 					map.put("error", "询价单保存失败");
 				}
 			}

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -310,7 +310,7 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 //                                    try {
 //                                        sms.setReceiver(userTel.getEmphone());
 //                                        sms.setTemplateId(messageConf.getMsgAutoInquiryForB2B());
-//                                        HttpUtil.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
+//                                        PSHttpUtils.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
 //										noticeDao.saveErpLog(userName, userIp, enUU, userUU, "发送询价单通知短信", "发送成功,询价单号" + inquiry.getCode() + ",接收手机:" + userTel.getEmphone());
 //                                    } catch (Exception e) {
 //										noticeDao.saveErpLog(userName, userIp, enUU, userUU, "发送询价单通知短信", "发送失败,询价单号" + inquiry.getCode() + ",接收手机:" + userTel.getEmphone());

+ 5 - 0
src/main/webapp/resources/js/index/app.js

@@ -191,6 +191,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url: "/purcinquiry",
             templateUrl: "static/tpl/index/purc/inquiry_new.html",
             controller: 'PurcInquiryCtrl'
+            /*新增公共询价*/
+        }).state('purc.pubinquiry_new', {
+            url: "/pubinquiry/new",
+            templateUrl: "static/tpl/index/purc/pubInquiry_new.html",
+            controller: 'PurcInquiryCtrl'
         }).state('purc.purcinquiry_new', {
             url: "/purcinquiry/:bussinessCode",
             templateUrl: "static/tpl/index/purc/purcinquiry_new.html",

+ 5 - 5
src/main/webapp/resources/tpl/index/baseInfo/inquiryItem_detail.html

@@ -752,11 +752,11 @@ input[type="radio"], input[type="checkbox"] {
         </thead>
         <tbody>
         <tr>
-            <td><span ng-bind="::inquiryItem.product.title"></span></td>
-            <td><span ng-bind="::inquiryItem.product.cmpCode"></span></td>
-            <td><span ng-bind="::inquiryItem.product.brand"></span></td>
-            <td><span ng-bind="::inquiryItem.product.spec"></span></td>
-            <td><span ng-bind="::inquiryItem.product.unit"></span></td>
+            <td><span ng-bind="::inquiryItem.product.title || inquiryItem.prodTitle"></span></td>
+            <td><span ng-bind="::inquiryItem.product.cmpCode || inquiryItem.prodCode"></span></td>
+            <td><span ng-bind="::inquiryItem.product.brand || inquiryItem.inbrand"></span></td>
+            <td><span ng-bind="::inquiryItem.product.spec || inquiryItem.spec"></span></td>
+            <td><span ng-bind="::inquiryItem.product.unit || inquiryItem.unit"></span></td>
             <td><span ng-bind="::inquiryItem.needquantity"></span></td>
             <td>
                 <a class="file" ng-repeat="attach in inquiryItem.inquiry.attachs" href="file/{{attach.id}}">{{::attach.name}}</a>

+ 3 - 3
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -391,9 +391,9 @@
                                     <tr ng-repeat="inquiryItem in $data">
                                         <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.inquiry.date| date: 'yyyy-MM-dd'"></td>
                                         <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.brand || '无'"></td>
-                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.title"></td>
-                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.cmpCode"></td>
-                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.spec"></td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.title || inquiryItem.prodTitle"></td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.cmpCode || inquiryItem.prodCode"></td>
+                                        <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.product.spec || inquiryItem.spec"></td>
                                         <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.needquantity"></td>
                                         <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.inquiry.enterprise.enName"><a></a></td>
                                         <td ng-click="toDetail(inquiryItem.id)" title="查看详情" ng-bind="inquiryItem.inquiry.endDate| date: 'yyyy-MM-dd'"></td>

+ 6 - 5
src/main/webapp/resources/tpl/index/purc/inquiry_new.html

@@ -1107,11 +1107,12 @@ select.disabled {
                  <div class="com_title01" style="border-bottom: 1px solid #969595;"><a ng-click="add()" style="margin-left: 20px;"><i class="fa fa-plus"></i>新增询价明细</a></div>
                 <div  class="title-div" style="border-bottom: 1px dashed #327ebe;">
                   	<span>供应商信息</span>
-                  	 <a class="add-vendor tender-desc" ng-click="dbfindVendor()" href="javascript:void(0)" ng-if="inquiry.isOpen == 0">
+                    <input  class="tender-input" name="ifOpen" value="0" ng-model="inquiry.isOpen" style="display: none"/>
+                  	 <a class="add-vendor tender-desc" ng-click="dbfindVendor()" href="javascript:void(0)">
                         <i class="fa fa-plus-square"></i>添加供应商&nbsp;
                     </a>
                 </div>
-                <div class="col-xs-12" id="isOpenChoice">
+                <!--<div class="col-xs-12" id="isOpenChoice">
                     <div class="tender-desc">是否开放报名:</div>
                     <div class="input-select col-xs-4">
                         <input class="tender-input" name="ifOpen" type="radio" value="1" ng-click="removeChecked()" ng-model="inquiry.isOpen"/>
@@ -1121,7 +1122,7 @@ select.disabled {
                         <input  class="tender-input" name="ifOpen" type="radio" value="0" ng-model="inquiry.isOpen"/>
                         <span>只允许我邀请的供应商参与</span>
                     </div>
-                </div>
+                </div>-->
                 <div class="row vend-info">
                     <div class="col-xs-12" style="" ng-repeat="vendor in vendors">
                         <div class="col-xs-1 control-label" style="width: 60px;">{{$index + 1}}</div>
@@ -1154,10 +1155,10 @@ select.disabled {
                 </div>
                 <div class="col-xs-12" style="padding: 30px;" ng-if="inquiry.inquiryItems.length>0">
                  	 <div class="col-xs-2 pull-right btn-save">
-                        <button class="btn" ng-disabled="tenderForm.$invalid " ng-click="submit()">发布</button>
+                        <button class="btn" ng-disabled="tenderForm.$invalid || vendors.length==0" ng-click="submit()">发布</button>
                     </div>
                     <div class="col-xs-2 pull-right btn-publish">
-                        <button class="btn" ng-disabled="tenderForm.$invalid " ng-click="save()">保存</button>
+                        <button class="btn" ng-disabled="tenderForm.$invalid || vendors.length==0" ng-click="save()">保存</button>
                     </div>
                 </div>
             </div>

+ 1 - 1
src/main/webapp/resources/tpl/index/purc/pubInquiry.html

@@ -304,7 +304,7 @@ margin-left: 55px;
 		<span>公共询价</span>
 		<div class="p-right">
 			<a ui-sref="purc.inquiry_unapply" title="待提交"><img src="static/img/icon/wait.png"/>待发布</a>
-			<a ui-sref="purc.inquiry_new" title="新增询价单"><img src="static/img/icon/add.png"/>新增</a>
+			<a ui-sref="purc.pubinquiry_new" title="新增公共询价单"><img src="static/img/icon/add.png"/>新增</a>
 			<!--<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>-->
 		</div>
 	</div>

+ 1286 - 0
src/main/webapp/resources/tpl/index/purc/pubInquiry_new.html

@@ -0,0 +1,1286 @@
+<!--  询价单  -->
+<link rel="stylesheet" href="static/css/add.css " />
+<style>
+
+/* 标题 */
+.tender-label {
+	/*height: 30px;*/
+	/*margin-left: 10px;*/
+	/*margin-right: 10px;*/
+	/*background-color: #e8e8e8;*/
+	/*box-shadow: 0 0 5px #6f6f6f;*/
+	/*border-top-right-radius: 20px;*/
+	width: 100%;
+	height: 40px;
+	line-height: 42px;
+	background: url(static/img/comm_bg01.png) no-repeat center;
+	background-size: 100%;
+}
+/* 主体 */
+.purc-tender {
+	line-height: 2;
+	font-size: 14px;
+}
+
+.purc-tender .row {
+    margin-left: 0;
+    margin-right: 0;
+    padding-left: 7px;
+    padding-right: 15px;
+}
+
+.tender-content {
+	background-color: #fff;
+    display: inline-block;
+}
+
+.tender-content>div>div {
+	margin-top: 3px;
+	margin-bottom: 3px;
+}
+/* 二级标题栏 */
+.title-div {
+	font-size: 14px;
+	font-weight: 600;
+	padding-left: 30px;
+	height: 50px;
+	padding-top: 11px;
+}
+
+/* 输入框前描述 */
+.tender-desc {
+	width: 100px;
+	float: left;
+	/*padding-top: 4px;*/
+}
+/* 输入框 */
+.tender-input {
+	/*border: #bfbfbf 1px solid !important;
+        padding-left: 10px;
+        height: 34px;
+        line-height: 34px;
+        width: 160px;*/
+	
+}
+
+.tender-input01 {
+	border: #bfbfbf 1px solid !important;
+	padding-left: 10px;
+	height: 34px;
+	line-height: 34px;
+	width: 150px;
+}
+
+.tender-input:focus {
+	border: #3578ba 1px solid !important;
+}
+
+/* 收货地址 */
+.address-group {
+	border-bottom: 1px solid #323232;
+	border-bottom-left-radius: 0;
+	margin-right: 20px;
+}
+
+.address-group>input:focus {
+	outline: none;
+}
+
+/* 基本信息 */
+.base-info {
+	border-bottom: 1px solid #e8e8e8;
+	padding-bottom: 30px;
+	padding-top: 20px;
+	margin-bottom: 0; /* 去除index中公共样式影响 */
+}
+
+/* 地址附加图标 */
+.address-addon {
+	border: none;
+	background: none;
+}
+
+/* 下拉选项 */
+.select-menu {
+	margin: 4px 0;
+	width: 100px;
+	padding: 0 5%;
+	height: 30px;
+}
+
+select.select-menu {
+	/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
+	border: solid 1px #bfbfbf;
+	height: 34px;
+	line-height: 34px;
+	width: 160px;
+    font-size: 14px;
+	/*很关键:将默认的select选择框样式清除*/
+	/* appearance:none;
+        -moz-appearance:none;
+        -webkit-appearance:none;*/
+	/*在选择框的最右侧中间显示小箭头图片*/
+	/*background: url("static/img/tender/select.png") no-repeat scroll right center transparent;*/
+	/*为下拉小箭头留出一点位置,避免被文字覆盖*/
+	padding-right: 14px;
+}
+
+/*清除ie的默认选择框样式清除,隐藏下拉箭头*/
+select.select-menu::-ms-expand {
+	display: none;
+}
+
+/* 日期选择器 */
+.purc-tender .date-picker {
+	/*padding-top: 10px;*/
+}
+
+.purc-tender .date-picker input {
+	border-radius: 0;
+	border: 1px solid #bfbfbf;
+	border-right: none;
+	font-size: 12px;
+    background: #fff;
+    font-size: 14px;
+}
+
+.purc-tender .date-picker span .btn-open {
+	color: #fff;
+	background-color: #bfbfbf;
+	border-radius: 0;
+	border: 1px solid #bfbfbf;
+	border-left: none;
+}
+.purc-tender .date-picker input:focus{
+    border: #5078cb 1px solid;
+}
+.purc-tender .date-picker span .btn-open:focus{
+    background: #5078cb;
+}
+/* 修改本页内btn的样式 及datepicker中的btn-success的样式 */
+.tender-content .date-picker .btn {
+	border-radius: 0;
+}
+
+.tender-content .date-picker .btn-success {
+	background-color: #327EBE;
+}
+
+.tender-content .date-picker ul {
+	border-radius: 0;
+}
+
+.tender-content .date-picker ul div:focus {
+	outline: none;
+	border-radius: 0;
+	border: none;
+}
+
+/* 附件上传 */
+.purc-tender .base-info .attach-upload {
+	display: inline;
+}
+
+.purc-tender .base-info .attach-upload input {
+	height: 100px;
+	width: 100px;
+	margin: 6px 0 0 100px;
+	opacity: 0;
+	z-index: 1;
+	position: relative;
+}
+
+.purc-tender .base-info .attach-upload input:hover {
+	cursor: pointer;
+}
+
+.fileInputContainer {
+	height: 100px;
+	background-image: url('static/img/tender/upload.png');
+	position: relative;
+	width: 100px;
+	margin-left: 100px;
+	margin-top: 20px;
+}
+
+.fileInput {
+	height: 100px;
+	width: 100px;
+	font-size: 100px;
+	position: absolute;
+	margin-left: 100px;
+	margin-top: 20px;
+	right: 0;
+	top: 0;
+	opacity: 0;
+	filter: alpha(opacity = 0);
+	cursor: pointer;
+}
+/* 图片点击上传 */
+/*.upload-bg {*/
+/*width: 100px;*/
+/*height: 100px;*/
+/*background-image: url('static/img/tender/upload.png');*/
+/*margin-top: 10px;*/
+/*margin-left: 100px;*/
+/*border: 1px solid #e8e8e8;*/
+/*z-index: 2;*/
+/*}*/
+/* 供应商信息 添加供应商 */
+.vend-info  a.add-vendor {
+	color: #5078cb;
+}
+
+.vend-info  a.add-vendor:hover {
+	cursor: pointer;
+	color: #55b6ff;
+}
+
+.vend-info  a.remove-vendor {
+	color: #FF2E2F;
+}
+
+.vend-info  a.remove-vendor:hover {
+	cursor: pointer;
+	color: #D32526;
+}
+
+/* 单选框 复选框 */
+input[type="radio"], input[type="checkbox"] {
+	vertical-align: text-bottom;
+	margin-bottom: 2px;
+	margin-bottom: -2px\9;
+}
+
+.vend-info .input-select {
+	float: left;
+	padding-top: 4px;
+	margin-left: -20px;
+}
+
+.vend-info .input-select input {
+	margin-right: 8px;
+}
+
+/* 右下角按钮 */
+.tender-content>div {
+	background-color: #fff;
+}
+
+.tender-content>div>div>button {
+	width: 94px;
+	height: 36px;
+	font-size: 14px;
+	color: #fff;
+	border-radius: 0;
+}
+
+.tender-content>div>div.btn-publish>button {
+	background-color: #327EBE;
+}
+
+.tender-content>div>div.btn-save>button {
+	background-color: #32bebc;
+}
+
+.read-only {
+	border: none;
+	color: #969595;
+}
+
+.read-only:focus {
+	border: none;
+}
+
+.attach-file {
+	margin-left: 100px;
+	width: 400px;
+}
+
+.com_head {
+	width: 100%;
+	height: 40px;
+	line-height: 42px;
+	background: url(static/img/comm_bg01.png) no-repeat center;
+	background-size: 100%;
+}
+
+.com_head span {
+	margin-left: 20px;
+	color: #000;
+	font-size: 14px;
+}
+
+.com_head a {
+	color: #327ebe;
+	float: right;
+	margin-right: 40px;
+	font-size: 14px;
+}
+
+.com_head a i {
+	margin-left: 5px;
+	line-height: 40px;
+}
+
+.com_head a:hover {
+	color: #d2272d;
+}
+
+.com_title {
+	width: 100%;
+	margin: 0px auto;
+	height: 40px;
+	line-height: 40px;
+	font-size: 14px;
+	color: #323232;
+	background: #f5f5f5;
+}
+
+.com_title font {
+	color: #327ebe;
+}
+
+.com_title01 {
+	height: 50px;
+	line-height: 50px;
+	width: 100%;
+	border-bottom: #3578ba 1px dotted;
+	border-top: #e8e8e8 1px solid;
+	margin-top: -4px;
+} /*  这里修改过 margin-top*/
+.com_title01 span {
+	margin-left: 20px;
+	font-size: 14px;
+	line-height: 50px;
+	color: #555;
+	font-weight: bold;
+}
+
+.com_title01  a {
+	color: #5078cb;
+}
+
+.com_title01  a:hover {
+	cursor: pointer;
+	color: #55b6ff;
+}
+
+/*招标单*/
+.tender-list02 dl {
+	width: 100%;
+	margin: 0 auto;
+	position: relative;
+}
+
+.tender-list02 dl dt {
+	width: 100%;
+	margin: 0 auto;
+	height: 40px;
+}
+
+.tender-list02 dl dt span {
+	height: 40px;
+	line-height: 40px;
+	display: inline-block;
+	color: #323232;
+    width: 13.45%;
+    border-bottom: #e8e8e8 1px solid;
+}
+
+.tender-list02 dl dd {
+	width: 100%;
+	margin: 0 auto;
+	border-bottom: #ccc 1px dotted;
+}
+
+.tender-list02 dl dd:hover {
+	border: #d32526 1px solid;
+}
+
+.tender-list02 dl dd:hover span a {
+	display: inline-block;
+}
+
+.tender-list02 dl dd span {
+	height: 50px;
+	line-height: 50px;
+	display: inline-block;
+    width: 13.45%;
+    font-size: 14px;
+    float: left;
+    text-align: center;
+}
+.tender-list02 dl dd span:first-child,.tender-list02 dl dt span:first-child{
+    width: 6%;
+}
+
+.tender-list02 dl span.wid01 {
+	width: 16.8%;
+}
+
+.tender-list02 dl span.wid02 {
+	width: 15%;
+}
+
+.tender-list02 dl span.wid03 {
+	width: 5%;
+}
+
+.tender-list02 .editable {
+	text-align: center;
+	width: 100%;
+}
+
+.tender-list02  .scroll-y dd input {
+	width: 97%;
+	height: 34px;
+	border: none;
+	font-size: 14px;
+	padding-left: 4px;
+	text-align: center;
+	vertical-align: middle;
+	line-height: 34px;
+}
+
+.tender-list02 dl span.wid03 a {
+	display: none;
+}
+
+.tender-list02 dl span.wid03 a.active {
+	display: inline-block;
+}
+
+.tender-list02 dl span.wid03 a i {
+	width: 20px;
+	height: 20px;
+	display: inline-block;
+	line-height: 20px;
+	background: #d2272d;
+	text-align: center;
+	border-radius: 100%;
+	color: #fff;
+}
+
+.tender-list02 .com_title01 a {
+	float: right;
+	margin-right: 45px;
+	font-size: 14px;
+	line-height: 50px;
+}
+
+.scroll-y {
+	width: 100%;
+	margin: 0 auto;
+	max-height: 500px;
+	overflow-y: auto;
+}
+
+.scroll-y.active {
+	overflow-y: scroll;
+	overflow-x: hidden;
+}
+
+/**日期选择器  start**/
+.tender-list02 .dropdown-menu{
+	min-width: auto;
+}
+
+.tender-list02 .save button {
+	border: 1px;
+	width: 94px;
+	height: 36px;
+	display: inline-block;
+	background: #3578ba;
+	text-align: center;
+	color: #fff;
+	font-size: 14px;
+	float: right;
+	line-height: 36px;
+	margin-right: 40px;
+	float:left;
+}
+
+.btn-group.pull-left{
+	width:120px;
+}
+
+.tender-list02 .dropdown-menu tr,.tender-list02 .dropdown-menu th,.tender-list02 .dropdown-menu td{
+	line-height:30px;
+}
+.tender-list02 .dropdown-menu button span{
+	line-height:15px;
+	width:15px;
+	height:15px;
+	font-size:12px;
+}
+.tender-list02 .dropdown-menu tr td button{
+    border: none;
+}
+/*end*/
+/* 弹框 */
+.bomb-box {
+	width: 100%;
+	height: 100%;
+	position: fixed;
+	z-index: 11111;
+	background: rgba(0, 0, 0, 0.2);
+	top: 0;
+	left: 0;
+}
+
+.bomb-box .box {
+	position: absolute;
+	left: 0;
+	right: 0;
+	top: 0;
+	bottom: 0;
+	margin: auto;
+	box-shadow: 0 0 3px #888;
+}
+
+.bomb-box .box01 {
+	width: 580px;
+	height: 406px;
+	border-radius: 5px;
+	background: #fff;
+}
+
+.bomb-box .box i.off {
+	width: 20px;
+	height: 20px;
+	display: inline-block;
+	position: absolute;
+	right: 8px;
+	top: 8px;
+	text-align: center;
+	cursor: pointer;
+}
+
+.bomb-box .box p {
+	height: 40px;
+	line-height: 40px;
+	font-size: 14px;
+	width: 100%;
+	margin: 0 auto;
+	border-bottom: #e8e8e8 1px solid;
+	padding-left: 20px;
+}
+
+.per-data {
+	width: 90%;
+	margin: 0 auto;
+}
+
+.per-data ul, .per-data ul li {
+	width: 100%;
+	margin: 0 auto;
+}
+
+.per-data ul li {
+	height: 34px;
+	line-height: 34px;
+	margin-top: 15px;
+}
+
+.per-data ul li em {
+	width: 60px;
+	font-size: 14px;
+	float: left;
+}
+
+.per-data ul li input, .per-data ul li select {
+	width: 236px;
+	height: 34px;
+	border: #e8e8e8 1px solid;
+	font-size: 14px;
+	padding-left: 10px;
+}
+
+.per-data ul li select {
+	background: url("../images/select.png") no-repeat right;
+	-webkit-appearance: none;
+	appearance: none;
+	-o-appearance: none;
+	-moz-appearance: none;
+	-ms-appearance: none;
+}
+
+.per-data ul li select option {
+	line-height: 30px;
+}
+
+.per-data ul li span {
+	color: #959595;
+	line-height: 18px;
+	float: right;
+	width: 215px;
+	display: inline-block;
+}
+
+.per-data ul li.per-btn {
+	margin-top: 30px;
+}
+
+.per-data ul li a {
+	width: 94px;
+	height: 36px;
+	display: inline-block;
+	font-size: 14px;
+	color: #fff;
+	text-align: center;
+	line-height: 34px;
+	float: left;
+}
+
+.per-data ul li a.save {
+	margin-left: 60px;
+	background: #327ebe;
+}
+
+.per-data ul li a.mod-psd {
+	background: #8dc7f9;
+	margin-left: 30px;
+}
+
+.per-data ul li a:hover {
+	background: #3578ba;
+}
+
+.add-address {
+	color: #327ebe;
+	font-size: 14px;
+	padding-left: 30px;
+}
+
+.add-address:hover {
+	color: #8dc7f9;
+}
+
+.tender-content  ul.association {
+	position: absolute;
+	left: 0;
+	top: 100%;
+	right: 61px;
+	list-style: none;
+	-webkit-padding-start: 0;
+	background: #ffffff;
+	border: 1px solid #dddddd;
+	z-index: 21;
+}
+
+.tender-content  ul.association li {
+	padding: 0 15px;
+	line-height: 30px;
+	text-align: left;
+}
+
+.tender-content  ul.association li.active, .tender-content  ul.association li.active:hover
+	{
+	background: #dddddd;
+}
+
+.tender-content  ul.association li:hover {
+	background: #EEEEEE;
+	cursor: pointer;
+}
+
+/*增加样式*/
+.view-slide-in {
+	/*margin-top: 20px;*/
+}
+.view-slide-in .block {
+	background: #f5f5f5;
+}
+.view-slide-in .group-container {
+	background: #fff;
+	margin-bottom: 10px;
+}
+.view-slide-in .group-container .btn-group {
+	width: 160px;
+	border: none;
+	height: 45px;
+}
+.view-slide-in .group-container .btn-group .btn {
+	color: #000;
+}
+.view-slide-in .group-container .btn-group .btn-info {
+	color: #d32526;
+	background: #fff;
+	border: none;
+}
+.view-slide-in .group-container .btn-group .btn {
+	border: none;
+	font-size: 16px;
+	font-family: "Microsoft YaHei", "微软雅黑";
+}
+.view-slide-in .group-container .btn-group .btn em {
+	color: #d32526;
+	font-style: inherit;
+}
+.view-slide-in .group-container .btn-group .btn:hover {
+	background: #fff;
+	color: #d32526;
+}
+.view-slide-in .group-container {
+	padding: 0;
+}
+.view-slide-in .search-bg {
+	margin-top: 15px;
+	margin-bottom: 15px;
+}
+#topSearch {
+	font-size: 18px;
+}
+.view-slide-in #topSearch .search-bg i {
+	color: #999;
+	margin-left: 10px;
+}
+.form-group-sm .form-control-feedback {
+	width: 85px;
+	height: 36px;
+	line-height: 36px;
+	color: #fff;
+	background: #327ebe;
+	text-align: center;
+	font-size: 14px;
+	cursor: pointer;
+}
+#topSearch .input-sm, .form-group-sm .form-control {
+	height: 36px;
+	line-height: 36px;
+	border: #327ebe 1px solid;
+	border-radius: 0px;
+	font-size: 14px;
+}
+.search-bg .col-xs-6,.search-bg .row {
+	padding-right: 0;
+}
+.order-table .company-list,.order-table .order-hd:first-child {
+	background: #fff;
+	font-size: 16px;
+	height: 55px;
+	line-height: 55px;
+	border-bottom: #ddd 1px solid;
+}
+.order-table .company-list {
+	width:100%;
+	height: 190px;
+	border-bottom: 20px solid #f5f5f5;
+}
+.order-table .order-hd span.margin-left20 {
+	margin-left: 20px;
+}
+.order-table .product {
+	line-height: 25px;
+	font-size: 14px;
+}
+.order-table .product span {
+	margin-right: 10px;
+}
+.grey01 {
+	color: #969595;
+	font-size: 14px;
+	text-align: center;
+}
+.order-table .btn {
+	border-radius: 0;
+	width: 94px;
+	height: 36px;
+	color: #fff;
+}
+.order-table .btn01 {
+	color: #327ebe;
+	background: #fff;
+	border: none;
+	font-size: 16px;
+}
+.order-table .order-hd td.first {
+	line-height: 25px;
+	font-size: 14px;
+	padding-top: 10px;
+	padding-bottom: 10px;
+}
+.search-bg .input-group-addon{
+	width: 85px;
+	height: 36px;
+	display: inline-block;
+	background: #327ebe;
+	font-size: 16px;
+	text-align: center;
+	line-height: 36px;
+	color: #fff;
+	padding: 0;
+	border: none;
+	border-radius: 0;
+	position: absolute;
+	top: 0;
+	right: 0;
+}
+.search-bg .form-group{
+	position: relative;
+}
+.title-div span{
+    font-weight: bold;
+    font-size: 14px;
+}
+    .add-vendor{
+        float: right;
+        font-weight: normal;
+        color: #5078cb;
+    }
+    .vend-info{
+        padding-bottom: 10px;
+        padding-top: 10px;
+    }
+.vend-info input{
+    font-size: 14px;
+    width: 200px;
+}
+.base-info{
+    box-shadow: none;
+}
+.tender-content input{
+    font-size: 14px;
+}
+
+#isOpenChoice {
+	margin-top: 10px;
+    line-height: 34px;
+}
+#isOpenChoice div{
+    line-height: 34px;
+    padding-top: 0;
+}
+#isOpenChoice div.tender-desc{
+    margin-left: 15px;
+}
+#isOpenChoice div span{
+    font-size: 14px;
+}
+.tender-content .row{
+    margin-bottom: 15px;
+}
+.tender-content .row .tender-desc{
+     line-height: 35px;
+}
+.tender-content .input-select{
+    padding: 0;
+}
+.tender-list02  .scroll-y dd input{
+    border: #ccc 1px solid;
+}
+#li01 .com01 ul li {
+    height: 30px;
+    line-height: 30px;
+    padding: 0;
+}
+
+#li01 .com01 ul li a {
+    display: inline-block;
+    height: 30px;
+    width: 100%;
+}
+#li01 .com01  .input-group-addon {
+    width: 30px;
+    line-height: 34px;
+    height: 34px;
+    padding: 0;
+    display: inline-block;
+    position: relative;
+    top: -50px;
+    right: -7px;
+    border-top-right-radius: 0;
+    border-bottom-right-radius: 0;
+    left: 39%;
+}
+.title-div a{
+    float: right;
+    color: #5078cb;
+    font-weight :normal;
+    margin-right: 30px;
+}
+.well{
+    background-color: #fff;
+    border-radius: 0;
+    padding: 10px;
+}
+.width160{
+    width: 160px !important;
+}
+select.disabled {
+    background-color: #f5f5f5;
+}
+.left-dropdown-menu .dropdown-menu{
+    left: 700px !important;
+}
+    .info-line span,.info-line input{
+        float: left;
+        font-size: 14px;
+    }
+.info-line{
+    line-height: 34px;
+}
+.info-line span:last-child{
+    margin-left: 8px;
+}
+.left-dropdown-menu .dropdown-menu li span{
+    width: auto !important;
+}
+</style>
+<div class="ng-scope">
+    <form name="tenderForm">
+        <div class="purc-tender">
+            <!--<div class="com_title">服务>询价单<font>>新增询价单</font></div>-->
+            <!--<div class="loading in" ng-class="{'in': loading}">
+            <i></i>
+            </div>-->
+            <div class="tender-label list-unstyled">
+                <div class="com_head"><span>公共询价单</span></div>
+            </div>
+            <div class="tender-content ng-scope">
+                <div class="title-div" style="border-bottom: 1px dashed #327ebe;">
+                    <span class="f14">基本信息</span>&nbsp;
+                    <span style="color: rgb(211,37,38);">*</span>
+                </div>
+                <div class="row base-info">
+                    <div class="row">
+                        <div class = "col-xs-4">
+                            <div class="tender-desc">询价单号:</div>
+                            <input class="width160 tender-input01" type="text" name="title" ng-model="inquiry.code" required readonly/>
+                        </div>
+                        <div class = "col-xs-4">
+                            <div class="tender-desc">询价日期:</div>
+                            <input class="width160 tender-input01" type="text" name="user" ng-model="inquiry.showdate" required readonly/>
+                        </div>
+                         <div class="col-xs-4">
+                            <span class="tender-desc f14">报价截止时间:</span>
+                            <div class="input-group input-trigger date-picker">
+                                <input type="text" ng-model="inquiry.endDate" required
+                                       class="form-control" placeholder="点击选择截止日期" readonly="readonly"
+                                       datepicker-popup="yyyy-MM-dd" is-open="inquiry.$fromOpened"
+                                       ng-required="true" current-text="今天" min-date = "currentDay()"
+                                       clear-text="清除" close-text="关闭"
+                                       datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                       ng-click="openDatePicker($event, condition, '$fromOpened')"> <span
+                                    class="input-group-btn">
+							<button type="button" class="btn btn-default btn-open"
+                                    ng-click="openEndDatePicker($event, inquiry, '$fromOpened')">
+								<i class="fa fa-calendar"></i>
+							</button>
+						</span>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="row">
+                         <div class = "col-xs-4">
+                            <div class="tender-desc">交易币别:</div>
+                            <select class="select-menu" data-style="btn-primary" ng-model="inquiry.currency" ng-change="changeCurrency(inquiry)">
+                                <option value ="RMB">RMB</option>
+                                <option value ="USD">USD</option>
+                                <option value ="HKD">HKD</option>
+                                <option value ="EUR">EUR</option>
+                            </select>
+                        </div>
+                        <div class = "col-xs-4">
+                            <div class="tender-desc">是否含税:</div>
+                            <select class="select-menu" ng-model="inquiry.ifTax" ng-disabled="notRMB" ng-class="{'disabled':notRMB}">
+                                <option value ="1">是</option>
+                                <option value ="0">否</option>
+                            </select>
+                        </div>
+                        <div class="col-xs-4">
+                            <div class="tender-desc">发票要求:</div>
+                            <select class="select-menu" ng-model="inquiry.invoice" ng-disabled="notRMB" ng-class="{'disabled':notRMB}">
+                                <option value ="2">增值税专用发票</option>
+                                <option value ="1">普通发票</option>
+                                <option value ="0">不需要发票</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="col-xs-12" id="isOpenChoice">
+	                    <div class="tender-desc" style="margin-left: 7px;">询价类型:</div>
+	                     <div class="input-select col-xs-1">
+	                        <input  class="tender-input" name="inquirytype" type="radio" value="询价" ng-model="inquiry.inquirytype"/>
+	                        <span>询价</span>
+	                    </div>
+	                    <div class="input-select col-xs-1">
+	                        <input class="tender-input" name="inquirytype" type="radio" value="求购" ng-model="inquiry.inquirytype"/>
+	                        <span>求购</span>
+	                    </div>
+	                </div>
+                    <div class="row">
+                        <div class = "col-xs-12">
+                            <div class="tender-desc">备注:</div>
+                            <input class="tender-input01" type="text" name="user" ng-model="inquiry.remark" style="width: 738px"/>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-xs-12">
+                            <div class="tender-desc">上传附件:</div>
+                            <div class="fileInputContainer">
+                                <input class="fileInput" type="file" ng-file-select name="file" ng-model="myFiles"/>
+                            </div>
+                            <div style="margin-left: 100px; color: #969595; font-size: 12px; ">
+                              	     提示:选择附件大小不超过5MB,可上传JPG,PNG,EXCEL,WORD,PDF
+                            </div>
+                        </div>
+                    </div>
+                    <div class="row" style="margin-bottom: 0;">
+                        <div class="col-xs-12">
+                            <div ng-show="previewShow">
+                                <div class="fl" style="margin-left: 100px;">
+                                <div class="well margin-b-0">
+                                        <div ng-show="previewShow">
+                                            <img ng-show="previewShow" alt="营业执照复印件" src="{{imgPreview}}" width="200px" height="100px">
+                                            <div>
+                                                &nbsp;&nbsp;<span class="text-primary"><b>{{imgPreviewName}}</b></span>
+                                            </div>
+                                        </div>
+                                        <div ng-show="pdfShow">
+                                            <img ng-show="pdfShow" src="static/img/all/pdf.jpg" alt="PDF文件" width="30px" height="40px">
+                                            &nbsp;&nbsp;<span class="text-primary"><b>{{imgPreviewName}}</b></span>
+                                        </div>
+                                        <div ng-show="noneFileShow">
+                                            <span class="text-warning">请上传清晰照片的图片文件或PDF文件</span>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="wrap">
+                    <div class="content">
+                        <div class="tender-list02">
+                            <!--产品信息-->
+                            <div class="title-div" style="border-bottom: 1px dashed #327ebe;">
+                                <span class="f14">询价明细</span><span style="opacity: 0.8; margin-left: 10px; font-weight: normal;"><i class="fa fa-info-circle"></i>您可以在页面下方选择本企业物料</span><a ng-click="uplodaByBatch()">批量导入</a>
+                            </div>
+                            <dl>
+                                <dt>
+                                    <span>序号</span>
+                                    <span class="wid01">型号</span>
+                                    <span class="wid01">名称</span>
+                                    <span class="wid02">品牌</span>
+                                    <span>数量</span>
+                                    <span>单位</span>
+                                    <span>报价有效期</span>
+                                    <span class="wid03">&nbsp;</span>
+                                </dt>
+                                <div class="scroll-y">
+                                    <dd ng-repeat="prod in inquiry.inquiryItems" id="li01">
+                                        <span>{{$index + 1}}</span>
+                                        <span class="com01 wid01 text-center">
+                                        	<input type="text" name="code" ng-model="prod.prodCode" ng-change="getSimilarCodes(prod.prodCode)" ng-focus="onFocus('code')" placeholder="请输入标准原厂型号" typeahead="prod.code for prod in getSimilarCodes($viewValue)" autocomplete="off" typeahead-on-select="onAssociateCmpClick($item, prod)" spellcheck = "false" required>
+                                        </span>
+                                        <span class="com01 wid01">
+                                        	<input type="text" style="text-align: left;" class="input01" name="kindName" ng-model="prod.prodTitle"  required placeholder="请输入或选择分类" spellcheck = "false" autocomplete="off" />
+                                        	<div class="input-group-addon" ng-click="selectKind(prod)">
+                                                <i class="fa fa-search" aria-hidden="true"></i>
+                                            </div>
+                                        </span>
+                                        <span class="com01 wid02 text-center">
+                                       		 <input type="text" style="width: 93%; text-align: left;" ng-change="getSimilarBrands(prod.inbrand)" class="input01" name="brandName" ng-model="prod.inbrand" required  placeholder="请输入或选择品牌" spellcheck = "false" typeahead="prod.brandCn for prod in getSimilarBrands($viewValue)" autocomplete="off" typeahead-on-select="onAssociateBrandClick($item, prod)" />
+                                             <div class="input-group-addon" ng-click="selectBrand(prod)">
+                                                 <i class="fa fa-search" aria-hidden="true"></i>
+                                             </div>
+										</span>
+										<span class="text-center"><input type="text" ng-model="prod.needquantity" placeholder="点击输入数量" required style="width: 93%;"/></span>
+                                        <span class="text-center"><input type="text" ng-model="prod.unit" placeholder="点击填入单位" required style="width: 93%;"/></span>
+                                        <span class="left-dropdown-menu"><input ng-model="prod.toDate" type="text" class="editable"  required
+													placeholder="选择时间" datepicker-popup="yyyy-MM-dd" is-open="prod.$toDateOpen"
+													min-date="getMinDate()"
+													current-text="今天" clear-text="清除" close-text="关闭"
+													datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+													ng-focus="openDatePicker($event, prod.$toDateOpen)" readonly="readonly"
+													ng-click="openDatePicker($event, prod.$toDateOpen, $index)"></span>
+                                        <span class="wid03"><a ng-click="del($index)"><i class="fa fa-close"></i></a></span>
+                                    </dd>
+                                </div>
+                                <div ng-if="inquiry.inquiryItems.length == 0" class="no-record">暂无产品信息!</div>
+                            </dl>
+                        </div>
+                    </div>
+                </div>
+                <input style="display: none" ng-model="inquiry.isOpen" value="1">
+                <div class="com_title01" style="border-bottom: 1px solid #969595;"><a ng-click="add()" style="margin-left: 20px;"><i class="fa fa-plus"></i>新增询价明细</a></div>
+                <div class="col-xs-12" style="padding: 30px;" ng-if="inquiry.inquiryItems.length>0">
+                 	 <div class="col-xs-2 pull-right btn-save">
+                        <button class="btn" ng-disabled="tenderForm.$invalid " ng-click="submit()">发布</button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </form>
+    <div class="pro-add-data02" style="min-height: 500px;" >
+        <div class="pro-search">
+            <div class="col-xs-2 search-title fl">我的材料库</div>
+            <div class="col-xs-8 fr">
+                <div class="col-xs-9 search" style="margin-right: 0;">
+                    <input type="text" placeholder="输入物料关键字查询" ng-model="keyword" ng-search="onSearch(keyword)"/>
+                    <a class="seek" ng-click="onSearch(keyword)" style="right: inherit;">搜索</a>
+                </div>
+                <div class="col-xs-3 result-title fr">搜索到<em>{{total}}</em>条</div>
+            </div>
+        </div>
+		<table class="block table table-default table-striped" ng-table="tableParams">
+			<thead>
+				<tr class="header">
+					<th width="160px">型号</th>
+					<th width="120px">名称</th>
+					<th>规格</th>
+					<th width="120px">单位</th>
+					<th width="80px">选择</th>
+				</tr>
+			</thead>
+			<tbody ng-if="tableParams.total() == 0">
+				<tr>
+					<td class="text-center" colspan="7" ng-if="tip != null">
+						<br>
+						<div class="text-muted" style="font-size: 14px;"><i class="fa fa-spinner"></i> 搜索"{{tip}}"未找到产品信息,请重新输入搜索条件</div>
+					</td>
+					<td class="text-center" colspan="7" ng-if="tip == null">
+						<br>
+						<div class="text-muted" style="font-size: 14px;"><i class="fa fa-spinner"></i> 暂无物料信息,<a ui-sref="sale.newProdInfo" target="_blank">立即添加</a></div>
+					</td>
+				</tr>
+			</tbody>
+			<tbody>
+				<tr ng-repeat="product in $data">
+					<td class="text-center" ng-bind="::product.code"></td>
+					<td class="text-center" ng-bind="::product.title"></td>
+					<td class="text-center f12" ng-bind="::product.spec"></td>
+					<td class="text-center" ng-bind="::product.unit"></td>
+					<td class="text-center" ><a title="添加" href="javascript:void(0)" ng-click="check(product)" style="text-decoration: none; color: #327ebe;" id="click" class="add01">添加</a>
+					<div class="add-tanchuang">
+	                        <ul>
+	                            <li>
+	                                <div class="fl">数量:</div>
+	                                <div class="fr">
+	                                    <div class="btn-wrap">
+	                                        <span class="number">
+	                                            <a href="###" class="reduce">-</a>
+	                                            <input type="text" value="100">
+	                                            <a href="###" class="add">+</a>
+	                                        </span>
+	                                    </div>
+	                                </div>
+	                            </li>
+	                            <li>
+	                                <div class="fl">交期:</div>
+	                                <div class="fr"><input type="text" class="price-input" value="时间选择"></div>
+	                            </li>
+	                            <li>
+	                                <div class="fl">单价:</div>
+	                                <div class="fr"><input type="text" class="price-input" value="¥1.23"></div>
+	                            </li>
+	                            <li class="add-btn">
+	                                <div class="fl">&nbsp;</div>
+	                                <div class="fr"><a href="javascript:void(0);" class="off">取消</a><a href="javascript:void(0);" class="ok">确认</a></div>
+	                            </li>
+	                        </ul>
+	                    </div>
+					</td>
+				</tr>
+			</tbody>
+		</table>
+	</div>
+</div>
+<!--设置-企业设置-收货地址编辑-->
+<div class="bomb-box" style="display: none">
+    <form class="box04 box" name="shipAddress" id="shipAddress">
+        <i class="off"><img src="static/img/purc/close.png" alt="" /></i>
+        <p>收货人资料</p>
+        <ul>
+            <li class="line01">
+                <div class="fl">
+                    <span class="fl">收货人<em>*</em>:</span>
+                    <span class="fr"><input type="text" placeholder="填写收货人" ng-model="ship.receiver" required="true" ng-pattern="/^[\u4e00-\u9fa5]{1,6}$|^[\dA-Za-z]{1,12}$/"/></span>
+                </div>
+                <div class="fr">
+                    <span class="fl">手机<em>*</em>:</span>
+                    <span class="fr"><input type="text" ng-model="ship.usertel" required="true" ng-pattern="/^1(3|4|5|7|8)\d{9}$/"/></span>
+                </div>
+            </li>
+            <li class="line01">
+                <div class="fl">
+                    <span class="fl">固定电话<em></em>:</span>
+                    <span class="fr"><input type="text" ng-model="ship.phone"  ng-pattern="/([0-9]{3,4}-)?[0-9]{7,8}/"/></span>
+                </div>
+                <div class="fr">
+                    <span class="fl">邮箱:</span>
+                    <span class="fr emaill"><input type="text" ng-model="ship.email" ng-pattern="/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/"/><i>用于接收订单提醒邮件,便于您及时了解订单状态</i></span>
+                </div>
+            </li>
+            <li class="line02 margin-top40">
+                <div class="fl">所在地址<em>*</em>:</div>
+                <!--<div class="select fr"><input type="text" placeholder="请选择" ng-model="ship.address" required="true"/><i class="fa fa-angle-down"></i></div>-->
+                <div class="select fr">
+                    <select required="" class="area-select" ng-model="ship.province" ng-options="key as key for (key,value) in provinces"
+                            ng-change="ship.city='';ship.district='';" required="true">
+                        <option value="">省</option>
+                    </select>
+                    <select class="area-select" ng-model="ship.city" ng-options="key as key for (key,value) in provinces[ship.province]"
+                            ng-change="ship.district='';" required="true">
+                        <option value="">市</option>
+                    </select>
+                    <select class="area-select" ng-model="ship.district" ng-options="value as value for value in provinces[ship.province][ship.city]" required="true">
+                        <option value="">区</option>
+                    </select>
+                </div>
+            </li>
+            <li class="line02">
+                <div class="fl">详细地址<em>*</em>:</div>
+                <div class="fr"><input type="text" ng-model="ship.addressdet" required="true"/></div>
+            </li>
+            <li class="line02">
+                <div class="fl">地址别名:</div>
+                <div class="fr address"><input type="text" ng-model="ship.addalias"/><i>建议填写常用名称:家里/父母家/公司</i></div>
+            </li>
+        </ul>
+        <div class="many-file-btn">
+            <button class="btn01" ng-click="saveShipAddress(ship);" ng-disabled="shipAddress.$invalid">保存</button><a href="javascript:void(0);" class="btn02">取消</a>
+        </div>
+    </form>
+</div>
+<script src="static/lib/jquery/jquery.min.js"></script>
+<script>
+    $(function(){
+        var size10= $(".tender-list02 dl dd").size();
+        if(size10 > 10){
+            $(".scroll-y").addClass("active");
+        }else{
+            $(".scroll-y").removeClass("active");
+        }
+
+        /*下拉效果*/
+        $('.select p').click(function(e){
+            $('.select').toggleClass('open');
+            e.stopPropagation();
+        });
+        $('.select ul li').click(function(e){
+            var title=$(this).html();
+            $('.select p').html(title);
+            $(this).addClass('selected').siblings().removeClass('selected');
+            $('.select').removeClass('open');
+            e.stopPropagation();
+        });
+        $(document).click(function(){
+            $('.select').removeClass('open');
+        })
+
+        //新增收货地址
+        $(".tender-content .base-info .add-address").click(function(){
+            document.getElementById('shipAddress').reset();
+            $(".bomb-box").show();
+        });
+        $(".bomb-box .box04 .off,.box04 .many-file-btn .btn02").click(function(){
+            $(".bomb-box").hide();
+        });
+        $(".bomb-box .box04 .off,.box04 .many-file-btn .btn01").click(function(){
+            $(".bomb-box").hide();
+        })
+    })
+</script>