configs.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. import { useDictionaryStore } from "@/store";
  2. const { dicts } = useDictionaryStore();
  3. export const getTableConfig = (id: string) => {
  4. return {
  5. // 获取工序记录项信息信息
  6. jiluxiang: {
  7. url: `/api/v1/op/operationRecord`,
  8. column: [
  9. {
  10. label: "工序id",
  11. prop: "operationId",
  12. display: false,
  13. hide: true,
  14. value: id,
  15. },
  16. { label: "记录项", prop: "thName" },
  17. {
  18. label: "单位",
  19. prop: "unit",
  20. search: true,
  21. filterable: true,
  22. type: "select",
  23. dataType: "string",
  24. dicData: dicts.danwei_type,
  25. props: { label: "dictLabel", value: "dictValue" },
  26. },
  27. { label: "标准值", prop: "standard" },
  28. { label: "上限值", prop: "upper" },
  29. { label: "下限值", prop: "lower" },
  30. ],
  31. },
  32. //工序物料
  33. wuliaocaiji: {
  34. url: "/api/v1/op/operationItem",
  35. column: [
  36. {
  37. label: "工序id",
  38. prop: "operationId",
  39. display: false,
  40. hide: true,
  41. value: id,
  42. },
  43. {
  44. label: "物料名称",
  45. prop: "itemName",
  46. addDisabled: true,
  47. editDisabled: true,
  48. },
  49. {
  50. label: "物料版本号",
  51. prop: "recordVersion",
  52. addDisabled: true,
  53. editDisabled: true,
  54. },
  55. {
  56. label: "物料编码",
  57. prop: "itemCode",
  58. addDisabled: true,
  59. editDisabled: true,
  60. },
  61. {
  62. label: "物料规格",
  63. prop: "itemModel",
  64. addDisabled: true,
  65. editDisabled: true,
  66. },
  67. { label: "所需数量", prop: "num" },
  68. {
  69. label: "追溯类型",
  70. prop: "traceType",
  71. search: true,
  72. filterable: true,
  73. type: "select",
  74. dataType: "string",
  75. dicData: dicts.trace_type,
  76. props: { label: "dictLabel", value: "dictValue" },
  77. },
  78. {
  79. label: "单位",
  80. prop: "unit",
  81. search: true,
  82. filterable: true,
  83. type: "select",
  84. dataType: "string",
  85. dicData: dicts.danwei_type,
  86. props: { label: "dictLabel", value: "dictValue" },
  87. },
  88. {
  89. label: "是否需要",
  90. prop: "isTrace",
  91. type: "radio", //类型为单选框
  92. dicData: [
  93. {
  94. label: "需采集物料",
  95. value: 1,
  96. },
  97. {
  98. label: "非必须采集物料",
  99. value: 0,
  100. },
  101. ],
  102. value: 1,
  103. rules: [
  104. {
  105. required: true,
  106. message: "是否需要",
  107. trigger: "blur",
  108. },
  109. ],
  110. },
  111. ],
  112. },
  113. // 辅料采集
  114. fuliaoCJ: {
  115. url: "/api/v1/operationAccessoryItem",
  116. column: [
  117. {
  118. label: "工序id",
  119. prop: "operationId",
  120. display: false,
  121. hide: true,
  122. value: id,
  123. },
  124. {
  125. label: "物料名称",
  126. prop: "itemName",
  127. addDisabled: true,
  128. editDisabled: true,
  129. },
  130. {
  131. label: "物料版本号",
  132. prop: "recordVersion",
  133. addDisabled: true,
  134. editDisabled: true,
  135. },
  136. {
  137. label: "物料编码",
  138. prop: "itemCode",
  139. addDisabled: true,
  140. editDisabled: true,
  141. },
  142. {
  143. label: "物料规格",
  144. prop: "itemModel",
  145. addDisabled: true,
  146. editDisabled: true,
  147. },
  148. // {
  149. // label: "是否需要",
  150. // prop: "isTrace",
  151. // type: "radio", //类型为单选框
  152. // dicData: [
  153. // {
  154. // label: "需采集物料",
  155. // value: 1,
  156. // },
  157. // {
  158. // label: "非必须采集物料",
  159. // value: 0,
  160. // },
  161. // ],
  162. // value: 1,
  163. // rules: [
  164. // {
  165. // required: true,
  166. // message: "是否需要",
  167. // trigger: "blur",
  168. // },
  169. // ],
  170. // },
  171. ],
  172. },
  173. dianjian: {
  174. url: `/api/v1/op/operationCheck`,
  175. column: [
  176. {
  177. label: "工序id",
  178. prop: "operationId",
  179. display: false,
  180. hide: true,
  181. value: id,
  182. },
  183. {
  184. label: "点检名称",
  185. prop: "checkName",
  186. addDisabled: true,
  187. editDisabled: true,
  188. },
  189. {
  190. label: "点检编码",
  191. prop: "checkCode",
  192. addDisabled: true,
  193. editDisabled: true,
  194. },
  195. { label: "内容", prop: "content" },
  196. {
  197. label: "单位",
  198. prop: "unit",
  199. search: true,
  200. filterable: true,
  201. type: "select",
  202. dataType: "string",
  203. dicData: dicts.danwei_type,
  204. props: { label: "dictLabel", value: "dictValue" },
  205. },
  206. { label: "标准值", prop: "standard" },
  207. { label: "上限值", prop: "upper" },
  208. { label: "下限值", prop: "lower" },
  209. ],
  210. },
  211. shebeijilu: {
  212. url: "/api/v1/op/operationEquit",
  213. column: [
  214. {
  215. label: "工序id",
  216. prop: "operationId",
  217. display: false,
  218. hide: true,
  219. value: id,
  220. },
  221. { label: "精度要求", prop: "accuracy" },
  222. { label: "所需数量", prop: "num", display: false, hide: true },
  223. {
  224. label: "设备类型",
  225. prop: "equitType",
  226. search: true,
  227. filterable: true,
  228. type: "select",
  229. dataType: "string",
  230. dicData: dicts.device_type,
  231. props: { label: "dictLabel", value: "dictValue" },
  232. },
  233. {
  234. label: "必须采集",
  235. prop: "collection",
  236. type: "radio", //类型为单选框
  237. dicData: [
  238. {
  239. label: "必须",
  240. value: 1,
  241. },
  242. {
  243. label: "非必须",
  244. value: 0,
  245. },
  246. ],
  247. value: 1,
  248. rules: [
  249. {
  250. required: true,
  251. message: "是否必须采集",
  252. trigger: "blur",
  253. },
  254. ],
  255. },
  256. ],
  257. },
  258. ESOP: {
  259. url: "/api/v1/op/esop",
  260. column: [
  261. {
  262. label: "工序id",
  263. prop: "operationId",
  264. display: false,
  265. hide: true,
  266. value: id,
  267. },
  268. { label: "标题", prop: "title", addDisabled: true, editDisabled: true },
  269. {
  270. label: "展示页数",
  271. prop: "showAppointPageNum",
  272. type: "number",
  273. min: 1,
  274. },
  275. {
  276. label: "总页数",
  277. prop: "pageNum",
  278. type: "number",
  279. hide: true,
  280. display: false,
  281. },
  282. {
  283. label: "版本号",
  284. prop: "recordVersion",
  285. type: "number",
  286. addDisabled: true,
  287. editDisabled: true,
  288. rules: [
  289. {
  290. required: true,
  291. message: "版本号",
  292. trigger: "blur",
  293. },
  294. ],
  295. precision: 1,
  296. },
  297. {
  298. label: "图纸编码",
  299. prop: "drawingCode",
  300. hide: true,
  301. addDisabled: true,
  302. editDisabled: true,
  303. },
  304. // {
  305. // label: "内容",
  306. // prop: "content",
  307. // hide: true,
  308. // addDisabled: true,
  309. // editDisabled: true,
  310. // },
  311. // {
  312. // label: "排序",
  313. // prop: "sortNum",
  314. // hide: true,
  315. // addDisabled: true,
  316. // editDisabled: true,
  317. // },
  318. {
  319. label: "文件",
  320. prop: "filePath",
  321. span: 24,
  322. type: "img",
  323. slot: true,
  324. viewDisplay: false,
  325. addDisabled: true,
  326. editDisabled: true,
  327. },
  328. ],
  329. },
  330. operationExcel: {
  331. url: "/api/v1/opExcelForm",
  332. column: [
  333. {
  334. label: "工序id",
  335. prop: "operationId",
  336. display: false,
  337. hide: true,
  338. value: id,
  339. },
  340. {
  341. label: "模版名称",
  342. prop: "formName",
  343. addDisabled: true,
  344. editDisabled: true,
  345. },
  346. {
  347. label: "模版类型",
  348. prop: "formType",
  349. addDisabled: true,
  350. editDisabled: true,
  351. dicData: dicts.excel_type,
  352. props: { label: "dictLabel", value: "dictValue" },
  353. },
  354. {
  355. label: "模版数据",
  356. prop: "pageNum",
  357. addDisabled: true,
  358. editDisabled: true,
  359. },
  360. {
  361. label: "修改时间",
  362. prop: "updated",
  363. addDisabled: true,
  364. editDisabled: true,
  365. },
  366. {
  367. label: "操作人",
  368. prop: "updator",
  369. addDisabled: true,
  370. editDisabled: true,
  371. },
  372. ],
  373. },
  374. };
  375. };
  376. // 工艺工序组件路径的组件类别
  377. interface comType {
  378. compentName: string;
  379. compentType: string;
  380. index: number;
  381. }
  382. export const comTypes: comType[] = [
  383. {
  384. compentName: "物料采集",
  385. compentType: "wuliaocaiji",
  386. index: 0,
  387. },
  388. {
  389. compentName: "设备记录",
  390. compentType: "shebeijilu",
  391. index: 3,
  392. },
  393. {
  394. compentName: "设备数据",
  395. compentType: "ceshishuju",
  396. index: 6,
  397. },
  398. {
  399. compentName: "点检",
  400. compentType: "dianjian",
  401. index: 9,
  402. },
  403. {
  404. compentName: "记录项",
  405. compentType: "jiluxiang",
  406. index: 12,
  407. },
  408. // {
  409. // compentName: "辅料采集",
  410. // compentType: "fuliaoCJ",
  411. // },
  412. // {
  413. // compentName: "紧固",
  414. // compentType: "jingu",
  415. // },
  416. // {
  417. // compentName: "调试配对",
  418. // compentType: "tiaoshipipei",
  419. // },
  420. /*{
  421. compentName: "铭牌绑定",
  422. compentType: "mingpai",
  423. },*/
  424. {
  425. compentName: "工序表单",
  426. compentType: "operationExcel",
  427. index: 15,
  428. },
  429. // {
  430. // compentName: "数据采集",
  431. // compentType: "screwdriver",
  432. // },
  433. {
  434. compentName: "工序文件",
  435. compentType: "gongxuwenjian",
  436. index: 18,
  437. },
  438. {
  439. compentName: "多媒体采集",
  440. compentType: "duomeiticaiji",
  441. index: 21,
  442. },
  443. {
  444. compentName: "ESOP",
  445. compentType: "ESOP",
  446. index: 24,
  447. },
  448. ];