httpRequest.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /**
  2. * 有关 访问服务器的uri
  3. */
  4. var $http = function () {
  5. this.ajaxLock = false;
  6. // this.ip = "http://192.168.43.144/api";
  7. // this.ip = "http://192.168.242.24:9002";
  8. //this.ip = "http://b2bcnapi.sailuntire.com/api";
  9. this.ip = "http://b2bcnapi.sailuntire.com/api/test";
  10. /****** 用户相关 ******/
  11. // 选择图片生成地址
  12. this.getUrlByFileUrl = "/web/file/upload";
  13. // 根据省获取经销商
  14. this.getUpuserByProvideUrl = "/web/bizLogin/testPostApi";
  15. // 注册用户
  16. this.regizeUrl = "/web/bizLogin/registRetailer";
  17. // 登录用户
  18. this.loginUrl = "/web/bizLogin/login";
  19. // 根据loginid获取用户信息
  20. // this.getUserInfoUrl = "/base/retailer/loginToInfo";
  21. /******* 订单相关 ********/
  22. // 查看剩余库存
  23. this.getStockUrl_old = "/jinyu/bizAgentStock/page";
  24. this.getStockUrl = "/base/material/pageMaterialStock";
  25. // 添加商品到购物车
  26. this.addCarUrl = "/jinyu/bizCart/save";
  27. // 获取购物车列表
  28. this.shopCarListUrl = "/jinyu/bizCart/list";
  29. // 获取商品详情
  30. this.getInfoUrl = "/base/material/info";
  31. // 下单传 {"retailerId":"212","amounr":100,"bizCartDtoList":[{"id":121...},{"id":12..}] 这里把购物车的列表给我}
  32. this.downOrderUrl = "/base/bizOrder/save";
  33. // 删除购物车 --删除一个
  34. this.deleteCar = "/jinyu/bizCart/deleteOne";
  35. // 删除购物车记录 -- 珊瑚多个
  36. this.deleteCars = "/jinyu/bizCart/delete";
  37. // 获取订单列表
  38. this.getOrderListUrl = "/base/bizOrder/page";
  39. // 获取订单详情
  40. this.getOrderInfo = "/base/bizOrder/info";
  41. // ---------- 525 ---------
  42. // 获取库存详情
  43. this.getKucunInfoUrl = "/jinyu/bizRetailerStock/page";
  44. // 获取商品类别
  45. this.getStoreTypeUrl = "/jinyu/bizGoodsType/list";
  46. // 添加商品类别
  47. this.addStoreTypeUrl = "/jinyu/bizGoodsType/save";
  48. // 添加商品
  49. this.addStoreUrl = "/jinyu/bizGoods/saveGoods";
  50. // 查看自己的供应商
  51. this.getSupplierUrl = "/jinyu/bizSupplier/list";
  52. // 根据条形码查询商品
  53. this.getStoreByScanUrl = "/jinyu/bizGoods/selectBySerialNumber";
  54. // 添加供应商
  55. this.addSupplierUrl = "/jinyu/bizSupplier/save";
  56. // 进货
  57. this.buyStoreUrl = "/jinyu/bizBills/save";
  58. // 单据
  59. this.buyListUrl = "/jinyu/bizBills/page";
  60. // 商品详情
  61. this.getStoreInfoUrl = "/jinyu/bizGoods/info";
  62. // 选择品牌
  63. this.chooseBrandUrl = "/base/brand/list";
  64. // 根据扫出来的码获取商品信息(进销存) -- 需要后面拼接
  65. this.jinstoreByScanUrl = "/base/material/infoByKey";
  66. // 获取门店经销商列表
  67. this.getSupplierListUrl = "/base/retailerAgent/list";
  68. // 经销商查询自己库存
  69. // this.checkStoreUrl = "/jinyu/bizAgentStock/page";
  70. this.checkStoreUrl_old = "/jinyu/bizAgentStock/page";
  71. this.checkStoreUrl = "/jinyu/bizAgentStock/pageOwn";
  72. // 扫码商品 0705
  73. this.addStoreByScanUrl = "/jinyu/bizGoods/selectBySerialNumberAndRetailerId";
  74. // 入库扫码
  75. this.addOrgoScanUrl = '/jinyu/bizGoods/selectInBySerialNumberAndRetailerId';
  76. // 出库扫码
  77. this.outScanUrl = '/jinyu/bizGoods/selectOutBySerialNumberAndRetailerId';
  78. /********* 0706 ***********/
  79. // 收取短信验证码
  80. this.getPhoneCode = '/web/bizLogin/sendCode';
  81. // 获取客户信息
  82. this.customListUrl = '/web/bizCustomRetailer/page';
  83. // 获取门店详情
  84. this.getMDInfo = "/base/retailer/retailerInfo";
  85. // 获取所有的轮胎服务类目
  86. this.getServices = "/base/service/list";
  87. // 添加服务
  88. this.addServices = "/jinyu/bizRetailerService/save";
  89. // 根据品牌统计库存
  90. this.getStockByPP = "/jinyu/bizRetailerStock/selectStockByBrand";
  91. // 获取积分
  92. this.getJFStore = "/jinyu/bizMall/page";
  93. // 获取新闻条
  94. this.getNews = "/jinyu/bizArticle/page";
  95. // 根据品牌获取上级代理商
  96. this.getUpByBrand = "/jinyu/bizAgentBrand/listByAgentIds";
  97. // 根据品牌和省市获取上级代理商
  98. this.getUpByBrandAndArea = "/jinyu/bizAgentBrand/listByBrandIds";
  99. // 获取门店积分列表
  100. this.getJFlistUrl = "/jinyu/bizRetailerIntegral/page";
  101. // 兑换商品
  102. this.exchangeUrl = "/jinyu/bizMallOrder/save";
  103. // 查看兑换记录
  104. this.exchangeListUrl = "/jinyu/bizMallOrder/page";
  105. // 检查版本
  106. this.getVersionUrl = "/web/biz/getAppVersion";
  107. // 活动banner
  108. this.getBannerUrl = "/biz/bizBanner/list";
  109. // 获取参加活动的商品
  110. this.getStoreBannerUrl = "/biz/bizActivity/activityInfo";
  111. // 根据条形码获取商品
  112. this.getStoreByScan = "/web/biz/bizGoods/Scancoderemotecall";
  113. // 获取经销商对应物料列表
  114. this.getStoreListU = "/web/biz/bizCoupon/select";
  115. // 添加商品至购物车
  116. this.addStoreToCarU = "/web/biz/bizCart/save";
  117. // 获取购物车列表
  118. this.getCarListU = "/web/biz/bizCart/selectCart";
  119. //线上订货修改购物车数量
  120. this.updateCarNum = "/web/biz/bizCart/update"
  121. // 从购物车下单
  122. this.downOrderU = "/web/base/bizOrder/save";
  123. // 扫码确定
  124. this.scanDoneU = "/web/biz/bizGoods/Scancode";
  125. //签约级别
  126. this.signLv = "/web/bizLogin/enum";
  127. // 门店立即抢购
  128. this.rushToBuyU = "/web/base/bizOrder/directSave";
  129. // 门店查询订单
  130. this.getOrderListU = "/web/base/bizOrder/selectStore";
  131. // 门店获取订单详情
  132. this.getOrderInfoU = "/web/biz/bizOrderInfo/selectOrderInfo";
  133. // 获取门店参保列表接口
  134. this.getInsuranceU = "/web/sailun/insurance/getInsuranceList";
  135. // 获取门店详情
  136. this.getAgentInfoU = "/web/biz/bizAudit/store";
  137. // 扫码入库
  138. this.sacaCodeIn = "/web/biz/bizGoods/ScanCodeIn";
  139. // 获取轮胎理赔详情
  140. this.getLipeiList = "/web/sailun/insurance/getInsuranceList";
  141. // 通过胎号获取理赔单详情
  142. this.getLipeiInfoU = "/web/sailun/insurance/getTireClaimInfo";
  143. // 理赔图片的上传
  144. this.uploadLipeU = "/web/sailun/insurance/tireImageUpload";
  145. // 提交轮胎保理赔记录
  146. this.sumbiltLipeiU = "/web/sailun/insurance/submitTireClaim";
  147. // 获取入库记录
  148. this.getIntoListU = "/web/sailun/insurance/getStoreClaimList";
  149. // 获取出入库记录
  150. this.getinOrOutU = "/web/biz/bizGoods/Incomingandoutgoingrecordsquery";
  151. // 获取赔付记录
  152. this.peifuListU = "/web/sailun/insurance/getStoreClaimList";
  153. // 扫码出库
  154. this.outStoreU = "/web/biz/bizGoods/ScanCodeOut";
  155. // 获取签约等级
  156. this.getSignLvU = "/web/bizLogin/enum";
  157. // 门店查询经销商库存
  158. this.getStockListU = "/web/biz/bizAudit/QueryStoreAgentStock";
  159. // 删除购物车记录
  160. this.delCarMataxU = "/web/biz/bizCart/deleteOne";
  161. // 获取理赔单详情
  162. this.getTlementInfoU = "/web/sailun/insurance/getTireInfo";
  163. // 生成核销code
  164. this.getHxCodeU = "/web/biz/bizCoupon/save";
  165. // 获取门店门店核销码列表
  166. this.getHxListU = "/web/biz/bizCoupon/selectCoupon";
  167. // 获取物料筛选条件
  168. this.getWuliaoAntionU = "/web/biz/bizCoupon/condition";
  169. //请求文章 根据id
  170. this.getOneDetails = "/web/biz/bizArticle/getOneDetails";
  171. //厂家宣传
  172. // this.getArticle="/web/biz/bizArticle/list"
  173. // 获取地址管理
  174. // this.getAddress="/sys/bizReceiptAddress/paget"
  175. // 获取地址列表
  176. this.getAddressListU = "/web/sys/bizReceiptAddress/page";
  177. // 门店新增收货地址
  178. this.addAddressU = "/web/sys/bizReceiptAddress/save";
  179. // 查看门店自己的优惠券
  180. // this.searchKuCunU = "/web/sys/bizStoreRegistrationSpree/page";
  181. /// 查看门店自己的库存
  182. this.searchKuCunU = "/web/biz/bizGoods/storeSelectStock";
  183. // 门店查询返利明细
  184. this.lookUserTotalU = "/web/biz/bizStoreReward/page";
  185. // 获取优惠券
  186. this.getCouponListU = "/web/sys/bizStoreRegistrationSpree/page";
  187. // 查询门店进货分析
  188. this.getStoreIntoListU = "/web/base/bizOrder/caculateStore";
  189. // 检查版本
  190. this.checkVersionU = "/web/biz/getAppVersion?type=1";
  191. // ios检查版本
  192. this.ioscheckVersionU = "/web/biz/getAppVersion?type=3";
  193. // 上传门店车辆图片接口
  194. this.uploadCarPhotoU = "/web/sailun/insurance/carPictureUpload";
  195. //我的供应商
  196. this.getSupplier = "/web/biz/bizStoreAgent/mySuppliers";
  197. //获取跑马灯list
  198. this.getMessageList = "/web/mobile/sysMessage/getMessageList";
  199. //获取新版本
  200. this.getNewVersionU = "/web/file/getShopApk";
  201. //上传门店行驶证照片
  202. this.uploadUserCarU = "/web/sailun/insurance/carPictureUpload";
  203. //离线缓存工单
  204. this.saveJxItemU = "/event/queryEventLX/";
  205. //轮播图
  206. this.getbannerLists = "/web/biz/bizStoreBrand/selectStoreBrandBanner";
  207. //获取商品分类
  208. this.getTypes = "/web/biz/bizGoodsType/selectProductCategory";
  209. // 获取商品
  210. this.getshopLists = "/web/biz/bizGoodsType/selectCategoryItem";
  211. //加入购物车
  212. this.addShopCart = "/web/sailun/bizIntegralCart/save";
  213. //查看购物车
  214. this.getShopCart = "/web/sailun/bizIntegralCart/page";
  215. //修改购物车数量
  216. this.fixCartNum = "/web/sailun/bizIntegralCart/update";
  217. //删除购物车
  218. this.delCart = "/web/sailun/bizIntegralCart/deletes";
  219. //下单
  220. this.addOrder = "/web/biz/bizShopIntegralOrder/save";
  221. //查看兑换记录
  222. this.getOrderannal = "/web/biz/bizIntegralOrderItem/page";
  223. //积分商场详情
  224. this.getProductImage = "/web//sailun/bizProductImage/storeProductItem";
  225. //收货地址查询
  226. this.getReceiptAddress = "/web/sys/bizReceiptAddress/list";
  227. // 立即下单
  228. this.immediatelyOrder = "/web/biz/bizShopIntegralOrder/immediatelyOrder";
  229. //查找更换收后地址
  230. this.updateAddress = "/web/sys/bizReceiptAddress/update";
  231. //删除收货地址
  232. this.addressDel="/web/sys/bizReceiptAddress/delete";
  233. //根据商品名搜索积分商品
  234. this.searchShop="/web/biz/bizCart/appSelectProduct";
  235. //查找订单
  236. this.searchOrder="/web/biz/bizIntegralOrderItem/selectIntegralOrderProduct"
  237. //消息列表
  238. this.getMsg="/web/sailun/bizMessageForUser/getMessageCategory";
  239. //消息详情
  240. this.getMsgdetails="/web/sailun/bizMessageForUser/list";
  241. //消息已阅
  242. this.updateMessage="/web/sailun/bizMessageForUser/updateMessage";
  243. //修改签约地址
  244. this.updatesign="/web/biz/bizStoreUpdateMessage/save";
  245. //查看签约地址
  246. this.getsignAddress="/web/biz/bizStoreUpdateMessage/list";
  247. //查看核销详情页
  248. this.hexiaoInfo="/web/biz/bizCoupon/list";
  249. //季度任务数据
  250. this.selectQuarter="/web/biz/bizScanRecord/selectQuarter";
  251. //提交用户信息
  252. this.MobileMessage="/web/biz/bizMobileMessage/save";
  253. //修改签约
  254. this.SignlvUpdate="/web/biz/bizStoreUpdateSignlv/save";
  255. //查看签约
  256. this.SignlvList="/web/biz/bizStoreUpdateSignlv/list";
  257. /**********************************车主下单功能***********************************/
  258. //根据门店id获取所有门店微信订单信息
  259. this.getAllUndealCarOrder="/web/sailun/wxCarorderHead/caroder/getAllUndealCarOrderByStoreId";
  260. this.getOrderInfo = "/web/sailun/wxCarorderHead/carorder/getOrderInfoById";
  261. this.getStoreToMaktxInfoByBSP = "/web/biz/bizGoods/getStoreToMaktxInfoByBSP";
  262. this.updateStoreToMaktxInfoByBSP = "/web/biz/bizGoods/updateStoreToMaktxInfoByBSP";
  263. this.changeWxCarOrderStatus = "/web/sailun/wxCarorderHead/carorder/changeWxCarOrderStatus";
  264. /**********************************对账功能***********************************/
  265. this.getConfirmMonth = "/web/biz/bizMonthDetail/getConfirmMonth";//获取已确认的月份
  266. this.getMonthDetail = "/web/biz/bizMonthDetail/getMonthDetail";//获取月结明细
  267. this.confirmMonthDetail = "/web/biz/bizMonthDetail/confirmMonthDetail";//确认月结明细
  268. //通过图片获取信息
  269. this.licenseDiscern="/web/bizLogin/licenseDiscern";
  270. //运营执行信息是否有效
  271. this.verifyBusiness="/web/bizLogin/verifyBusiness";
  272. //上传运营图片
  273. this.storeUpdatalicense="/web/biz/bizStoreBasicInfo/storeUpdateLicense"
  274. //解冻
  275. this.storeUnfreezeProposer="/web/biz/bizAgentFunction/storeUnfreezeProposer"
  276. }
  277. $http.prototype.$postFile = function (url, data, callback) {
  278. var urlT = this.ip + eval('this.' + url);
  279. api.ajax({
  280. url: urlT,
  281. method: 'post',
  282. data: {
  283. values: data
  284. },
  285. headers: {
  286. "Content-type": "multipart/form-data"
  287. },
  288. }, function (ret, err) {
  289. api.hideProgress();
  290. api.refreshHeaderLoadDone();
  291. if (ret) {
  292. callback(ret);
  293. } else {
  294. api.toast({
  295. msg: '当前网络不稳定,请稍后再试'
  296. });
  297. }
  298. });
  299. }
  300. // api的ajax
  301. $http.prototype.$post = function (url, data, callback, other) {
  302. var content = "", urlT = "", _this = this;
  303. if (data.url == "json") {
  304. delete data.url;
  305. // 确认contenttype选项
  306. content = "application/json;charset=UTF-8";
  307. } else if (data.url == "file") {
  308. data = [{}, {
  309. file: data[1].file
  310. }]
  311. content = "application/json;charset=UTF-8";
  312. } else {
  313. content = "application/x-www-form-urlencoded"
  314. }
  315. var datas = this.serize(data);
  316. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  317. urlT = this.ip + eval('this.' + url) + '/' + other;
  318. } else {
  319. urlT = this.ip + eval('this.' + url);
  320. }
  321. api.showProgress({
  322. });
  323. if (this.ajax == true) {
  324. return;
  325. }
  326. this.ajax = true;
  327. api.ajax({
  328. url: urlT,
  329. method: 'post',
  330. data: datas,
  331. headers: {
  332. "Content-type": content,
  333. },
  334. }, function (ret, err) {
  335. _this.ajax = false;
  336. api.hideProgress();
  337. api.refreshHeaderLoadDone();
  338. if (ret) {
  339. callback(ret);
  340. } else {
  341. api.toast({
  342. msg: '当前网络不稳定,请稍后再试'
  343. });
  344. }
  345. });
  346. }
  347. //特殊post api
  348. $http.prototype.$postuser = function (url, data, callback, other) {
  349. var content = "", urlT = "", _this = this;
  350. if (data.url == "json") {
  351. delete data.url;
  352. // 确认contenttype选项
  353. content = "application/json;charset=UTF-8";
  354. } else if (data.url == "file") {
  355. data = [{}, {
  356. file: data[1].file
  357. }]
  358. content = "application/json;charset=UTF-8";
  359. } else {
  360. content = "application/x-www-form-urlencoded"
  361. }
  362. var datas = this.serize(data);
  363. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  364. urlT = this.ip + eval('this.' + url) + '/' + other;
  365. } else {
  366. urlT = this.ip + eval('this.' + url);
  367. }
  368. api.showProgress({
  369. });
  370. if (this.ajax == true) {
  371. return;
  372. }
  373. this.ajax = true;
  374. api.ajax({
  375. url: urlT,
  376. method: 'post',
  377. data: datas,
  378. headers: {
  379. "Content-type": content,
  380. },
  381. }, function (ret, err) {
  382. _this.ajax = false;
  383. api.hideProgress();
  384. api.refreshHeaderLoadDone();
  385. if (ret) {
  386. callback(ret);
  387. } else {
  388. api.toast({
  389. msg: '当前网络不稳定,请稍后再试'
  390. });
  391. }
  392. });
  393. }
  394. // 单独的get请求
  395. $http.prototype.$getadd = function (url, data, callback, other) {
  396. var _this = this;
  397. api.showProgress({
  398. });
  399. this.ajax = true;
  400. api.ajax({
  401. url: this.ip + eval('this.' + url) + data,
  402. method: 'get',
  403. data: {
  404. values: {
  405. }
  406. },
  407. headers: {
  408. "Content-type": "application/json;charset=UTF-8"
  409. },
  410. }, function (ret, err) {
  411. _this.ajax = false;
  412. api.hideProgress();
  413. api.refreshHeaderLoadDone();
  414. if (ret) {
  415. callback(ret);
  416. } else {
  417. api.toast({
  418. msg: '当前网络不稳定,请稍后再试'
  419. });
  420. }
  421. });
  422. }
  423. // get获取
  424. $http.prototype.$get = function (url, data, callback, other) {
  425. var content = "", urlT = "", _this = this;
  426. if (data.url == "json") {
  427. delete data.url;
  428. // 确认contenttype选项
  429. content = "application/json;charset=UTF-8";
  430. } else {
  431. content = "application/x-www-form-urlencoded"
  432. }
  433. var datas = this.serize(data);
  434. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  435. urlT = this.ip + eval('this.' + url) + '/' + other;
  436. } else {
  437. urlT = this.ip + eval('this.' + url);
  438. }
  439. api.showProgress({
  440. });
  441. if (this.ajax == true) {
  442. return;
  443. }
  444. this.ajax = true;
  445. api.ajax({
  446. url: urlT,
  447. method: 'get',
  448. data: {
  449. values: {
  450. }
  451. },
  452. headers: {
  453. "Content-type": "application/json;charset=UTF-8"
  454. },
  455. }, function (ret, err) {
  456. _this.ajax = false;
  457. api.hideProgress();
  458. api.refreshHeaderLoadDone();
  459. if (ret) {
  460. callback(ret);
  461. } else {
  462. api.toast({
  463. msg: '当前网络不稳定,请稍后再试'
  464. });
  465. }
  466. });
  467. }
  468. // 在链接后面拼接参数
  469. $http.prototype.$getOption = function (url, other, callback) {
  470. var _this = this;
  471. api.showProgress({
  472. });
  473. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  474. urlT = this.ip + eval('this.' + url) + '?' + other;
  475. } else {
  476. urlT = this.ip + eval('this.' + url);
  477. }
  478. api.ajax({
  479. url: urlT,
  480. method: 'get',
  481. data: {
  482. values: {
  483. }
  484. },
  485. headers: {
  486. "Content-type": "application/json;charset=UTF-8"
  487. },
  488. }, function (ret, err) {
  489. _this.ajax = false;
  490. api.hideProgress();
  491. api.refreshHeaderLoadDone();
  492. if (ret) {
  493. callback(ret);
  494. } else {
  495. api.toast({
  496. msg: '当前网络不稳定,请稍后再试'
  497. });
  498. }
  499. });
  500. }
  501. // 单独的有文件名字的上传文件
  502. $http.prototype.uploadfile = function (url, data, callback) {
  503. var _this = this;
  504. var urlT = this.ip + eval('this.' + url);
  505. var formdata = new FormData();
  506. formdata.append('file', data.file);
  507. formdata.append('type', data.type);
  508. api.showProgress({
  509. });
  510. $.ajax({
  511. url: urlT,
  512. type: "POST",
  513. data: formdata,
  514. processData: false, // 告诉jQuery不要去处理发送的数据
  515. contentType: false, // 告诉jQuery不要去设置Content-Type请求头
  516. success: function (ret, status, xhr) {
  517. api.hideProgress();
  518. if (ret.code == 0 || ret.code == '0') {
  519. callback(ret);
  520. }
  521. }
  522. });
  523. }
  524. // 对数据进行处理,第一个为values,第二个为file body
  525. $http.prototype.serize = function (data) {
  526. var serizeData;
  527. if (data instanceof Array) {
  528. if (data.length == 1) {
  529. serizeData = {
  530. values: data[0]
  531. }
  532. } else {
  533. serizeData = {
  534. values: data[0],
  535. files: data[1]
  536. }
  537. }
  538. } else {
  539. if (data.type == 'body') {
  540. delete data.type;
  541. if (data.yy == 'keng') {
  542. delete data.yy
  543. serizeData = {
  544. body: data.id
  545. }
  546. } else {
  547. serizeData = {
  548. body: data
  549. }
  550. }
  551. } else {
  552. serizeData = {
  553. values: data
  554. }
  555. }
  556. }
  557. return serizeData;
  558. }
  559. function alertJson(str) {
  560. alert(JSON.stringify(str));
  561. }