tableConfig.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. import { useDictionaryStoreHook } from "@/store";
  2. const { dicts } = useDictionaryStoreHook();
  3. import dictDataUtil from "@/common/configs/dictDataUtil";
  4. export const tableConfig = {
  5. MARTERIAL: {
  6. url: "/api/v1/base/material",
  7. column: [
  8. { label: "客户型号", prop: "customervodel", search: true },
  9. { label: "生产厂家", prop: "manufacturer", search: true },
  10. { label: "物料编码", prop: "materialCode", search: true },
  11. { label: "物料名称", prop: "materialName", search: true },
  12. { label: "保质期", prop: "qualityGuaranteePeriod", search: true },
  13. { label: "筛选规范", prop: "selectionSpec", search: true },
  14. { label: "物料规格", prop: "spec", search: true },
  15. {
  16. label: "适用平台",
  17. prop: "applicablePlatformsDictValue",
  18. // search: true,
  19. // filterable: true,
  20. // type: "select",
  21. // dataType: "string",
  22. // dicData: dicts.applicable_platforms,
  23. // props: { label: "dictLabel", value: "dictValue" },
  24. },
  25. {
  26. label: "物料属性",
  27. prop: "attributeDictValue",
  28. search: true,
  29. filterable: true,
  30. type: "select",
  31. dataType: "string",
  32. dicData: dicts.material_properties,
  33. props: { label: "dictLabel", value: "dictValue" },
  34. },
  35. {
  36. label: "是否工装",
  37. prop: "frock",
  38. search: true,
  39. filterable: true,
  40. type: "radio", //类型为单选框
  41. dicData: [
  42. {
  43. label: "否",
  44. value: 0,
  45. },
  46. {
  47. label: "是",
  48. value: 1,
  49. },
  50. ],
  51. value: 0,
  52. },
  53. {
  54. label: "质检方案",
  55. prop: "inspectDictValue",
  56. search: true,
  57. filterable: true,
  58. type: "select",
  59. dataType: "string",
  60. dicData: dicts.quality_testing_plan,
  61. props: { label: "dictLabel", value: "dictValue" },
  62. },
  63. {
  64. label: "物料级别",
  65. prop: "levelDictValue",
  66. search: true,
  67. filterable: true,
  68. type: "select",
  69. dataType: "string",
  70. dicData: dicts.material_level,
  71. props: { label: "dictLabel", value: "dictValue" },
  72. },
  73. {
  74. label: "封装方法",
  75. prop: "packageDictValue",
  76. search: true,
  77. filterable: true,
  78. type: "select",
  79. dataType: "string",
  80. dicData: dicts.packaging_method,
  81. props: { label: "dictLabel", value: "dictValue" },
  82. },
  83. {
  84. label: "质量等级",
  85. prop: "qualityLevelDictValue",
  86. search: true,
  87. filterable: true,
  88. type: "select",
  89. dataType: "string",
  90. dicData: dicts.quality_grade,
  91. props: { label: "dictLabel", value: "dictValue" },
  92. },
  93. {
  94. label: "选用类型",
  95. prop: "selectionDictValue",
  96. search: true,
  97. filterable: true,
  98. type: "select",
  99. dataType: "string",
  100. dicData: dicts.selection_type,
  101. props: { label: "dictLabel", value: "dictValue" },
  102. },
  103. {
  104. label: "阶段",
  105. prop: "stageDictValue",
  106. search: true,
  107. filterable: true,
  108. type: "select",
  109. dataType: "string",
  110. dicData: dicts.stage,
  111. props: { label: "dictLabel", value: "dictValue" },
  112. },
  113. {
  114. label: "物料单位",
  115. prop: "unitDictValue",
  116. search: true,
  117. filterable: true,
  118. type: "select",
  119. dataType: "string",
  120. dicData: dicts.danwei_type,
  121. props: { label: "dictLabel", value: "dictValue" },
  122. },
  123. { label: "备注", prop: "remark", type: "textarea", search: true },
  124. ],
  125. },
  126. FACTORY: {
  127. url: "/api/v1/base/workShop",
  128. column: [
  129. {
  130. label: "车间名称",
  131. prop: "name",
  132. search: true,
  133. },
  134. {
  135. label: "车间负责人",
  136. prop: "manager",
  137. rules: [{
  138. required: true,
  139. message: "请选择厂区负责人",
  140. trigger: "blur"
  141. }],
  142. type: 'select',
  143. dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/user/list",
  144. dicMethod: "post",
  145. props: {
  146. label: "userName", // 下拉菜单显示的字段
  147. value: "userName" // 下拉菜单值的字段
  148. },
  149. },
  150. {
  151. label: "车间位置",
  152. prop: "position",
  153. },
  154. {
  155. label: "所属工厂",
  156. prop: "factoryName",
  157. display: false
  158. },
  159. {
  160. label: "车间描述",
  161. prop: "remark",
  162. },
  163. {
  164. label: "创建人",
  165. prop: "creator",
  166. display: false
  167. },
  168. {
  169. label: "创建时间",
  170. prop: "created",
  171. display: false
  172. },
  173. ],
  174. },
  175. PRODUCTIONLINE: {
  176. url: "/api/v1/base/productionLine",
  177. column: [
  178. {
  179. label: "产线名称",
  180. prop: "name",
  181. search: true,
  182. rules: [{
  183. required: true,
  184. message: "请填写产线名称",
  185. trigger: "blur"
  186. }],
  187. },
  188. {
  189. label: "产线负责人",
  190. prop: "manager",
  191. rules: [{
  192. required: true,
  193. message: "请选择产线负责人",
  194. trigger: "blur"
  195. }],
  196. type: 'select',
  197. dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/user/list",
  198. dicMethod: "post",
  199. props: {
  200. label: "userName", // 下拉菜单显示的字段
  201. value: "userName" // 下拉菜单值的字段
  202. },
  203. },
  204. {
  205. label: "产线位置",
  206. prop: "position",
  207. },
  208. {
  209. label: "所属车间",
  210. prop: "workShopName",
  211. display: false
  212. },
  213. {
  214. label: "产线描述",
  215. prop: "remark",
  216. },
  217. {
  218. label: "创建人",
  219. prop: "creator",
  220. display: false
  221. },
  222. {
  223. label: "创建时间",
  224. prop: "created",
  225. display: false
  226. },
  227. ],
  228. },
  229. STATION: {
  230. url: "/api/v1/base/station",
  231. column: [
  232. {
  233. label: "工位编号",
  234. prop: "stationCode",
  235. search: true,
  236. rules: [{
  237. required: true,
  238. message: "请填写工位编号",
  239. trigger: "blur"
  240. }],
  241. },
  242. {
  243. label: "工位名称",
  244. prop: "name",
  245. search: true,
  246. rules: [{
  247. required: true,
  248. message: "请填写工位名称",
  249. trigger: "blur"
  250. }],
  251. },
  252. {
  253. label: "工位类型",
  254. prop: "stationDictValue",
  255. search: true,
  256. rules: [{
  257. required: true,
  258. message: "请选择工位类型",
  259. trigger: "blur"
  260. }],
  261. type: 'select',
  262. dicData: dicts.station_type,
  263. searchClearable: false, //可清空的输入框,默认为true
  264. filterable: true, //添加filterable属性即可启用搜索功能
  265. props: {
  266. label: "dictLabel", // 下拉菜单显示的字段
  267. value: "dictValue" // 下拉菜单值的字段
  268. },
  269. },
  270. {
  271. label: "工位操作方式",
  272. prop: "operateDictValue",
  273. rules: [{
  274. required: true,
  275. message: "请选择工位方式",
  276. trigger: "blur"
  277. }],
  278. type: 'select',
  279. dicData: dicts.station_operate_type,
  280. props: {
  281. label: "dictLabel", // 下拉菜单显示的字段
  282. value: "dictValue" // 下拉菜单值的字
  283. },
  284. },
  285. {
  286. label: "工位负责人",
  287. prop: "manager",
  288. rules: [{
  289. required: true,
  290. message: "请选择工位负责人",
  291. trigger: "blur"
  292. }],
  293. type: 'select',
  294. dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/user/list",
  295. dicMethod: "post",
  296. props: {
  297. label: "userName", // 下拉菜单显示的字段
  298. value: "userName" // 下拉菜单值的字段
  299. },
  300. },
  301. {
  302. label: "所属产线",
  303. prop: "productionLineName",
  304. display: false
  305. },
  306. {
  307. label: "工位地址",
  308. prop: "position",
  309. rules: [{
  310. required: true,
  311. message: "请填写工位地址",
  312. trigger: "blur"
  313. }],
  314. },
  315. {
  316. label: "工位IP地址",
  317. prop: "stationIp",
  318. rules: [{
  319. required: true,
  320. message: "请填写工位IP地址",
  321. trigger: "blur",
  322. }],
  323. },
  324. {
  325. label: "工位描述",
  326. prop: "remark",
  327. type: 'textarea',
  328. span: 24,
  329. },
  330. {
  331. label: "创建人",
  332. prop: "creator",
  333. display: false
  334. },
  335. {
  336. label: "创建时间",
  337. prop: "created",
  338. display: false
  339. },
  340. ],
  341. },
  342. DEVICE: {
  343. url: "/api/v1/device",
  344. column: [
  345. {
  346. label: "设备编号",
  347. prop: "deviceNo",
  348. search: true,
  349. width: '120',
  350. rules: [
  351. {
  352. required: true,
  353. message: "设备编号不能为空",
  354. trigger: "trigger",
  355. },
  356. ],
  357. },
  358. {
  359. label: "设备名称",
  360. prop: "deviceName",
  361. search: true,
  362. width: '120',
  363. rules: [
  364. {
  365. required: true,
  366. message: "设备名称不能为空",
  367. trigger: "trigger",
  368. },
  369. ],
  370. },
  371. {
  372. label: "设备类型",
  373. prop: "deviceType",
  374. type: "select",
  375. search: true,
  376. width: '100',
  377. dicData:
  378. dicts.device_type,
  379. props: {
  380. label: "dictLabel",
  381. value: "dictValue",
  382. },
  383. },
  384. {
  385. label: "负责人",
  386. width: '100',
  387. prop: "head",
  388. },
  389. {
  390. label: "设备位置",
  391. width: '150',
  392. prop: "devicePosition",
  393. },
  394. {
  395. label: "规格",
  396. width: '150',
  397. prop: "specifications",
  398. },
  399. {
  400. label: "品牌",
  401. width: '150',
  402. prop: "brand",
  403. },
  404. ],
  405. },
  406. MARTERIAL_BOM: {
  407. url: "/api/v1/base/materialBom/list",
  408. column: [
  409. {
  410. label: "物料版本",
  411. prop: "bomVersion",
  412. search: true,
  413. type: "select",
  414. },
  415. {
  416. label: "物料编码",
  417. prop: "materialCode",
  418. hide: true
  419. },
  420. {
  421. label: "物料名称",
  422. prop: "materialName",
  423. overHidden: true,
  424. hide: true
  425. },
  426. {
  427. label: "物料编码",
  428. prop: "bomMaterialCode",
  429. },
  430. {
  431. label: "物料名称",
  432. prop: "bomMaterialName",
  433. overHidden: true,
  434. },
  435. {
  436. label: "物料属性",
  437. prop: "bomMaterialAttribute",
  438. type: 'select',
  439. dicData: dicts.material_properties,
  440. props: { label: "dictLabel", value: "dictValue" },
  441. },
  442. {
  443. label: "物料数量",
  444. prop: "bomMaterialNumber",
  445. min: 0,
  446. slot: true,
  447. cell: true,
  448. type: "number",
  449. precision: 2,
  450. },
  451. ],
  452. },
  453. OP_CHECK: {
  454. url: "/api/v1/op/base/check",
  455. column: [
  456. {
  457. label: "点检项名称",
  458. prop: "checkName",
  459. span: 12,
  460. labelWidth: '150',
  461. search: true,
  462. editDisabled: true,
  463. },
  464. {
  465. label: "点检项编码",
  466. prop: "checkCode",
  467. labelWidth: '150',
  468. editDisabled: true,
  469. span: 12,
  470. search: true,
  471. },
  472. {
  473. label: "内容",
  474. prop: "content",
  475. span: 12,
  476. search: false,
  477. },
  478. ],
  479. },
  480. ESOP: {
  481. url: "/api/v1/base/drawing",
  482. column: [
  483. {
  484. label: "图纸编码",
  485. prop: "drawingCode",
  486. span: 12,
  487. labelWidth: '150',
  488. search: true,
  489. editDisabled: true,
  490. },
  491. {
  492. label: "标题",
  493. prop: "drawingTitle",
  494. labelWidth: '150',
  495. editDisabled: true,
  496. span: 12,
  497. search: false,
  498. },
  499. {
  500. label: "版本号",
  501. prop: "drawingVersion",
  502. span: 12,
  503. search: false,
  504. },
  505. {
  506. label: "图纸",
  507. prop: "drawingPath",
  508. type: "img",
  509. span: 24,
  510. display: false,
  511. slot: true,
  512. // formatter: (row, column, cellValue, index) => {
  513. // return `${row.drawingPath}`;
  514. // },
  515. }
  516. ],
  517. },
  518. USERS: {
  519. url: "/api/v1/sys/employeeSkill/users",
  520. column: [
  521. {
  522. label: "员工编码",
  523. prop: "employeeCode",
  524. search: true,
  525. },
  526. {
  527. label: "用户id",
  528. prop: "id",
  529. /*display:false,*/
  530. },
  531. {
  532. label: "用户名",
  533. prop: "userName",
  534. search: true,
  535. width: '120',
  536. },
  537. {
  538. label: "用户电话",
  539. prop: "phone",
  540. search: true,
  541. },
  542. {
  543. label: "部门", prop: "deptName", overHidden: true,
  544. disabled: true,
  545. },
  546. {
  547. label: "所属机构", prop: "institution",
  548. search: true,
  549. filterable: true,
  550. type: "select",
  551. width: 100, overHidden: true,
  552. dicUrl: dictDataUtil.dept_list_url,
  553. dicMethod: "post",
  554. props: { label: "deptName", value: "id" },
  555. disabled: true,
  556. },
  557. ],
  558. },
  559. };