error.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. /**
  2. * Created by Administrator on 2017/12/5.
  3. */
  4. /**
  5. * Created by summer on 2018/5/25.
  6. */
  7. var validator = {
  8. tips:[
  9. {
  10. success:0,
  11. message:'接口传入字段成功!',
  12. },
  13. {
  14. success:1,
  15. message:'接口传入字段缺失!',
  16. },
  17. {//2
  18. success:1,
  19. message:'数据库连接失败!',
  20. },
  21. {//3
  22. success:1,
  23. message:'时间格式错误',
  24. },
  25. {//4
  26. success:1,
  27. message:'数据类型错误',
  28. },
  29. {//5
  30. success:1,
  31. message:'操作类型错误',
  32. },
  33. {//6
  34. success:1,
  35. message:'请求失败!',
  36. jsapi_ticket: '',
  37. noncestr: '',
  38. timestamp: '',
  39. url: '',
  40. signature: ''
  41. },
  42. {//7
  43. success:1,
  44. message:'不能为空',
  45. },
  46. {//8
  47. success:1,
  48. message:'指标编码重复,添加失败',
  49. },
  50. {//9
  51. success:1,
  52. message:'指标编码重复,修改失败',
  53. },
  54. {//10
  55. success:1,
  56. message:'权重分值总分不等于100,添加失败',
  57. },
  58. {//11
  59. success:1,
  60. message:'权重分值总分不等于100,修改失败',
  61. },
  62. {//12
  63. success:1,
  64. message:'该类别编码已存在',
  65. },
  66. {//13
  67. success:1,
  68. message:'该数据已存在',
  69. },
  70. {//14
  71. success:1,
  72. message:'数据不符合规则',
  73. }
  74. ]
  75. };
  76. var corporation = {
  77. tips:[
  78. {
  79. success:1,
  80. message:'身份证格式错误!',
  81. },
  82. {
  83. success:1,
  84. message:'统一社会信用代码错误!',
  85. },
  86. {
  87. success:1,
  88. message:'该企业已上传,请勿重复上传!',
  89. }
  90. ]
  91. };
  92. var login = {
  93. tips:[
  94. {//0
  95. success:0,
  96. message:'登陆成功!',
  97. },
  98. {//1
  99. success:1,
  100. message:'账号或密码错误!',
  101. },
  102. {//2
  103. success:0,
  104. message:'查询成功!',
  105. },
  106. {//3
  107. success:1,
  108. message:'账号密码不能为空!',
  109. },
  110. {//4
  111. success:0,
  112. message:'密码修改成功!',
  113. },
  114. {//5
  115. success:1,
  116. message:'新密码与原密码相同,修改失败!',
  117. },
  118. {//6
  119. success:1,
  120. message:'账号或原密码错误,修改失败!',
  121. },
  122. {//7
  123. success:1,
  124. message:'企业信息获取失败,请联系管理员!',
  125. },
  126. ]
  127. };
  128. var precheck = {
  129. tips:[
  130. {//0
  131. success:1,
  132. message:'token错误!',
  133. },
  134. {//1
  135. success:2,
  136. message:'token过期!',
  137. },
  138. {//2
  139. success:3,
  140. message:'该用户没有该权限!',
  141. },
  142. {//3
  143. success:4,
  144. message:'用户名有误,请重新登录!',
  145. },
  146. ]
  147. };
  148. var processWarehouse = {
  149. tips:[
  150. {//0
  151. success:1,
  152. message:'产品编码选择错误,库存修改失败!',
  153. },
  154. {//1
  155. success:0,
  156. message:'出库成功!',
  157. },
  158. ]
  159. };
  160. var packageCoding = {
  161. tips:[
  162. {//0
  163. success:1,
  164. message:'请检查二维码是否正确!',
  165. },
  166. ]
  167. };
  168. var plantArea = {
  169. tips:[
  170. {//0
  171. success:1,
  172. message:'该企业不存在该基地信息,添加地块失败!',
  173. },
  174. ]
  175. };
  176. var productCode = {
  177. tips:[
  178. {//0
  179. success:1,
  180. message:'防伪码查询失败!',
  181. },
  182. {//1
  183. success:1,
  184. message:'查询码未绑定nfc!',
  185. },
  186. {//2
  187. success:0,
  188. message:'验证成功!',
  189. },
  190. {//3
  191. success:1,
  192. message:'nfc不匹配!',
  193. },
  194. ]
  195. };
  196. var productionProcess = {
  197. tips:[
  198. {//0
  199. success:1,
  200. message:'仓库编号、投入品商品码等错误,投入品出库失败!',
  201. },
  202. {//1
  203. success:0,
  204. message:'投入品出库成功!',
  205. },
  206. ]
  207. };
  208. var operation = {
  209. tips:[
  210. {//0
  211. success:1,
  212. message:'修改失败!',
  213. },
  214. {//1
  215. success:0,
  216. message:'修改成功!',
  217. },
  218. {//2
  219. success:1,
  220. message:'查询失败!',
  221. },
  222. {//3
  223. success:0,
  224. message:'查询成功!',
  225. },
  226. {//4
  227. success:0,
  228. message:'未修改数据!',
  229. },
  230. {//5
  231. success:0,
  232. message:'添加成功!',
  233. },
  234. {//6
  235. success:1,
  236. message:'添加失败!',
  237. },
  238. {//7
  239. success:1,
  240. message:'该标签已经初始化,请勿重复初始化!',
  241. },
  242. {//8
  243. success:1,
  244. message:'统一社会信用代码重复!',
  245. },
  246. {//9
  247. success:1,
  248. message:'数据不存在或者已经备案,删除失败!',
  249. },
  250. {//10
  251. success:1,
  252. message:'数据不存在或者已经备案,修改失败!',
  253. },
  254. {
  255. //11
  256. success:1,
  257. message:'召回计划编码错误,添加失败!',
  258. },
  259. {
  260. //12
  261. success:1,
  262. message:'已审核,删除失败!',
  263. },
  264. {
  265. //13
  266. success:1,
  267. message:'数据不存在或已审核,修改失败!',
  268. },
  269. {
  270. //14
  271. success:1,
  272. message:'数据不存在或未审核,修改失败!',
  273. },
  274. {
  275. //15
  276. success:1,
  277. message:'应急事件不存在或者未启动!',
  278. },
  279. {
  280. //16
  281. success:1,
  282. message:'设备ID已经存在,添加失败!',
  283. },
  284. {
  285. //17
  286. success:1,
  287. message:'字典值已存在,添加失败!',
  288. },
  289. {
  290. //18
  291. success:1,
  292. message:'字典表的值不存在,添加失败!',
  293. },
  294. {
  295. //19
  296. success:1,
  297. message:'数据不存在或已锁定,删除失败!',
  298. },
  299. {
  300. //20
  301. success:0,
  302. message:'删除成功!',
  303. },
  304. {
  305. //21
  306. success:1,
  307. message:'数据不存在或已发布,删除失败!',
  308. },
  309. {
  310. //22
  311. success:1,
  312. message:'数据不存在或已发布,修改失败!',
  313. },
  314. {
  315. //23
  316. success:1,
  317. message:'数据不存在或已发布,回复失败!',
  318. },
  319. {
  320. //24
  321. success:1,
  322. message:'该业务类型不存在!',
  323. },
  324. {
  325. //25
  326. success:1,
  327. message:'配送主表查询失败,请检查配送单号!',
  328. },
  329. {
  330. //26
  331. success:1,
  332. message:'检验单号错误,请检查!',
  333. },
  334. {
  335. //27
  336. success:1,
  337. message:'起始码和结束码不属于同一批次,请核对!',
  338. },
  339. {
  340. //28
  341. success:1,
  342. message:'数据已备案,企业名称和机构代码不能修改!',
  343. },
  344. {
  345. //29
  346. success:200,
  347. message:'上传成功!',
  348. },
  349. {
  350. //30
  351. success:1,
  352. message:'未找到产品或者库存不足,投入量大于库存!',
  353. },
  354. {
  355. //31
  356. success:1,
  357. message:'该企业已存在该投入品!',
  358. },
  359. ]
  360. };
  361. var deviceAction = {
  362. tips:[
  363. {//0
  364. success:1,
  365. message:'已经存在设备操作记录,该设备无法删除!',
  366. },
  367. {//1
  368. success:1,
  369. message:'该设备不存在,添加操作记录失败!',
  370. },
  371. {//2
  372. success:1,
  373. message:'统计失败',
  374. },
  375. {//3
  376. success:0,
  377. message:'统计成功',
  378. },
  379. {//4
  380. success:0,
  381. message:'墒情数据上传成功',
  382. },
  383. {//5
  384. success:0,
  385. message:'气象数据上传成功',
  386. },
  387. {//6
  388. success:1,
  389. message:'传入数据值超出范围,统计失败',
  390. },
  391. ]
  392. }
  393. module.exports={
  394. validator:function(index){
  395. return validator[index];
  396. },
  397. operation:function(index){
  398. return operation[index];
  399. },
  400. corporation:function(index){
  401. return corporation[index];
  402. },
  403. login:function(index){
  404. return login[index];
  405. },
  406. precheck:function(index){
  407. return precheck[index];
  408. },
  409. processWarehouse:function(index){
  410. return processWarehouse[index];
  411. },
  412. packageCoding:function(index){
  413. return packageCoding[index];
  414. },
  415. plantArea:function(index){
  416. return plantArea[index];
  417. },
  418. productionProcess:function(index){
  419. return productionProcess[index];
  420. },
  421. deviceAction:function(index){
  422. return deviceAction[index];
  423. },
  424. productCode:function(index){
  425. return productCode[index];
  426. }
  427. };