columns.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. //是否定制
  2. const options1 = [
  3. { id: "0", name: "否" },
  4. { id: "1", name: "是" },
  5. ]
  6. //专属类型
  7. const options2 = [
  8. { id: "0", name: "非泰康" },
  9. { id: "1", name: "泰康" },
  10. ]
  11. //销售权限
  12. const options3 = [
  13. { id: "0", name: "无销售权限" },
  14. { id: "1", name: "有销售权限" },
  15. ]
  16. //是否库存品
  17. const options4 = [
  18. { id: "0", name: "非库存品" },
  19. { id: "1", name: "库存品" },
  20. ]
  21. //是否启用实时金价
  22. const options5 = [
  23. { id: "0", name: "否" },
  24. { id: "1", name: "是" },
  25. ]
  26. //供货区域
  27. const options6 = [
  28. { id: "1", name: "全国" },
  29. { id: "2", name: "全国除偏远" },
  30. ]
  31. //是否启用阶梯
  32. const options7 = [
  33. { id: "0", name: "否" },
  34. { id: "1", name: "是" },
  35. ]
  36. //有无工差
  37. const options8 = [
  38. { id: "0", name: "无工差" },
  39. { id: "1", name: "有工差" },
  40. ]
  41. //配置要求
  42. const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"]
  43. const listCol = [
  44. { type: "selection", fixed: "left", _noset_: true },
  45. {
  46. prop: "spuCode",
  47. label: "编号",
  48. width: "160px",
  49. },
  50. {
  51. prop: "good_thumb_img",
  52. label: "图片",
  53. _slot_: "good_thumb_img",
  54. width: "45px",
  55. },
  56. {
  57. prop: "good_name",
  58. label: "名称",
  59. "min-width": "160px",
  60. },
  61. {
  62. prop: "cat_name",
  63. label: "分类",
  64. },
  65. {
  66. prop: "brand_name",
  67. label: "品牌",
  68. },
  69. {
  70. prop: "good_type",
  71. label: "定制",
  72. _slot_: "good_type",
  73. width: "50px",
  74. },
  75. {
  76. prop: "status",
  77. label: "状态",
  78. _slot_: "status",
  79. width: "118px",
  80. },
  81. {
  82. prop: "supplierNo",
  83. label: "供应商编号",
  84. width: "110px",
  85. },
  86. {
  87. prop: "supplier_name",
  88. label: "供应商名称",
  89. width: "110px",
  90. },
  91. {
  92. prop: "companyNo",
  93. label: "业务公司编号",
  94. width: "110px",
  95. },
  96. {
  97. prop: "company",
  98. label: "业务公司名称",
  99. width: "110px",
  100. },
  101. {
  102. prop: "creater",
  103. label: "创建人",
  104. width: "70px",
  105. },
  106. {
  107. prop: "addtime",
  108. label: "创建时间",
  109. width: "140px",
  110. },
  111. {
  112. prop: "",
  113. label: "操作",
  114. fixed: "right",
  115. _noset_: true,
  116. width: "170px",
  117. _slot_: "operation",
  118. },
  119. ]
  120. const validate_num = (rule, value, callback) => {
  121. const { required } = rule
  122. if (required && value === "") {
  123. callback(new Error("不能为空!"));
  124. } else {
  125. callback();
  126. }
  127. };
  128. const validate_num_0 = (rule, value, callback) => {
  129. const { required } = rule
  130. if (required && value === "") {
  131. callback(new Error("不能为空!"));
  132. } else if (required && (value === "0" ||
  133. value === "0." ||
  134. value === "0.0" ||
  135. value === "0.00" ||
  136. value === "0.000"
  137. )) {
  138. callback(new Error("不能为零!"));
  139. } else {
  140. callback();
  141. }
  142. };
  143. const rules = {
  144. cat_id: [
  145. {
  146. type: "array",
  147. required: true,
  148. message: "请选择商品分类",
  149. trigger: "change",
  150. },
  151. ],
  152. brandid: [
  153. {
  154. type: "array",
  155. required: true,
  156. message: "请选择商品品牌",
  157. trigger: "change",
  158. },
  159. ],
  160. noble_weight: [
  161. {
  162. required: true,
  163. validator: validate_num_0,
  164. trigger: "blur",
  165. },
  166. ],
  167. weight: [
  168. {
  169. required: true,
  170. validator: validate_num,
  171. trigger: "blur",
  172. },
  173. ],
  174. good_type: [
  175. {
  176. required: true,
  177. message: "请选择是否定制",
  178. trigger: "change",
  179. },
  180. ],
  181. is_stock: [
  182. {
  183. required: true,
  184. message: "请选择是否库存品",
  185. trigger: "change",
  186. },
  187. ],
  188. company_id: [
  189. {
  190. required: true,
  191. message: "请选择业务公司",
  192. trigger: "change",
  193. },
  194. ],
  195. supplierNo: [
  196. {
  197. type: "array",
  198. required: true,
  199. message: "请选择供应商",
  200. trigger: "change",
  201. },
  202. ],
  203. is_auth: [
  204. {
  205. required: true,
  206. message: "商品主图",
  207. trigger: "change",
  208. },
  209. ],
  210. tax: [
  211. {
  212. required: true,
  213. message: "请选择税率",
  214. trigger: "change",
  215. },
  216. ],
  217. good_name: [
  218. {
  219. required: true,
  220. message: "请输入商品名称",
  221. trigger: "blur",
  222. },
  223. ],
  224. unit: [
  225. {
  226. type: "array",
  227. required: true,
  228. message: "请输入商品单位",
  229. trigger: "blur",
  230. },
  231. ],
  232. is_exclusive: [
  233. {
  234. required: true,
  235. type: "array",
  236. message: "请选择专属类型",
  237. trigger: "change",
  238. },
  239. ],
  240. noble_metal: [
  241. {
  242. required: true,
  243. message: "请选择贵金属种类",
  244. trigger: "change",
  245. },
  246. ],
  247. is_gold_price: [
  248. {
  249. required: true,
  250. message: "请选择是否启用实时金价",
  251. trigger: "change",
  252. },
  253. ],
  254. moq: [
  255. {
  256. required: true,
  257. validator: validate_num,
  258. trigger: "blur",
  259. },
  260. ],
  261. customized: [
  262. {
  263. required: true,
  264. validator: validate_num,
  265. trigger: "blur",
  266. },
  267. ],
  268. after_sales: [
  269. {
  270. required: true,
  271. message: "售后说明不能为空",
  272. trigger: "blur",
  273. },
  274. ],
  275. good_remark: [
  276. {
  277. required: true,
  278. message: "商品备注不能为空",
  279. trigger: "blur",
  280. },
  281. ],
  282. //包装/发货/图片
  283. packing_list: [
  284. {
  285. required: true,
  286. message: "请输入包装清单",
  287. trigger: "blur",
  288. },
  289. ],
  290. packing_way: [
  291. {
  292. required: true,
  293. message: "请输入包装方式",
  294. trigger: "blur",
  295. },
  296. ],
  297. packing_spec: [
  298. {
  299. required: true,
  300. message: "请输入装箱规格",
  301. trigger: "blur",
  302. },
  303. ],
  304. packing_weight: [
  305. {
  306. required: true,
  307. message: "请输入装箱重量",
  308. trigger: "blur",
  309. },
  310. ],
  311. packing_szie: [
  312. {
  313. required: true,
  314. message: "请输入装箱尺寸",
  315. trigger: "blur",
  316. },
  317. ],
  318. supply_area: [
  319. {
  320. required: true,
  321. message: "请选择供货区域",
  322. trigger: "change",
  323. },
  324. ],
  325. delivery_place: [
  326. {
  327. type: "array",
  328. required: true,
  329. message: "请选择发货地",
  330. trigger: "change",
  331. },
  332. ],
  333. origin_place: [
  334. {
  335. type: "array",
  336. required: true,
  337. message: "请选择产地",
  338. trigger: "change",
  339. },
  340. ],
  341. delivery_day: [
  342. {
  343. required: true,
  344. message: "请输入物流时间",
  345. trigger: "blur",
  346. },
  347. ],
  348. lead_time: [
  349. {
  350. required: true,
  351. message: "请输入供货周期",
  352. trigger: "blur",
  353. },
  354. ],
  355. sample_day: [
  356. {
  357. required: true,
  358. message: "请输入调样周期",
  359. trigger: "blur",
  360. },
  361. ],
  362. packing_size: [
  363. {
  364. required: true,
  365. message: "请输入装箱尺寸",
  366. trigger: "blur",
  367. },
  368. ],
  369. good_size: [
  370. {
  371. required: true,
  372. message: "请输入商品尺寸",
  373. trigger: "blur",
  374. },
  375. ],
  376. good_thumb_img: [
  377. {
  378. required: true,
  379. message: "商品主图",
  380. trigger: "change",
  381. },
  382. ],
  383. good_info_img: [
  384. {
  385. type: "array",
  386. required: true,
  387. message: "商品详情介绍图",
  388. trigger: "change",
  389. },
  390. ],
  391. //固定成本
  392. cert_fee: [
  393. {
  394. required: true,
  395. validator: validate_num,
  396. trigger: "blur",
  397. },
  398. ],
  399. packing_fee: [
  400. {
  401. required: true,
  402. validator: validate_num,
  403. trigger: "blur",
  404. },
  405. ],
  406. cost_fee: [
  407. {
  408. required: true,
  409. validator: validate_num,
  410. trigger: "blur",
  411. },
  412. ],
  413. mark_fee: [
  414. {
  415. required: true,
  416. validator: validate_num,
  417. trigger: "blur",
  418. },
  419. ],
  420. demo_fee: [
  421. {
  422. required: true,
  423. validator: validate_num,
  424. trigger: "blur",
  425. },
  426. ],
  427. is_diff: [
  428. {
  429. required: true,
  430. message: "请选择有无工差",
  431. trigger: "change",
  432. },
  433. ],
  434. config: [
  435. {
  436. required: true,
  437. type: 'array',
  438. message: "请选择配置要求",
  439. trigger: "change",
  440. },
  441. ],
  442. other_config: [
  443. {
  444. required: true,
  445. message: "其他要求不能为空",
  446. trigger: "blur",
  447. },
  448. ],
  449. open_fee: [
  450. {
  451. required: true,
  452. validator: validate_num,
  453. trigger: "blur",
  454. },
  455. ],
  456. sample_fee: [
  457. {
  458. required: true,
  459. validator: validate_num,
  460. trigger: "blur",
  461. },
  462. ],
  463. market_price: [
  464. {
  465. required: true,
  466. validator: validate_num,
  467. trigger: "blur",
  468. },
  469. ],
  470. nake_price: [
  471. {
  472. required: true,
  473. validator: validate_num,
  474. trigger: "blur",
  475. },
  476. ],
  477. is_step: {
  478. required: true,
  479. message: "请选择是否启用阶梯",
  480. trigger: "change",
  481. },
  482. }
  483. export { options1, options2, options3, options4, options5, options6, options7, options8, options9, listCol, rules }