configs.ts 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. precision: 1,
  55. },
  56. {
  57. label: "物料编码",
  58. prop: "itemCode",
  59. addDisabled: true,
  60. editDisabled: true,
  61. },
  62. {
  63. label: "物料规格",
  64. prop: "itemModel",
  65. addDisabled: true,
  66. editDisabled: true,
  67. },
  68. { label: "所需数量", prop: "num" },
  69. {
  70. label: "追溯类型",
  71. prop: "traceType",
  72. search: true,
  73. filterable: true,
  74. type: "select",
  75. dataType: "string",
  76. dicData: dicts.trace_type,
  77. props: { label: "dictLabel", value: "dictValue" },
  78. },
  79. {
  80. label: "单位",
  81. prop: "unit",
  82. search: true,
  83. filterable: true,
  84. type: "select",
  85. dataType: "string",
  86. dicData: dicts.danwei_type,
  87. props: { label: "dictLabel", value: "dictValue" },
  88. },
  89. {
  90. label: "是否需要",
  91. prop: "isTrace",
  92. type: "radio", //类型为单选框
  93. dicData: [
  94. {
  95. label: "需采集物料",
  96. value: 1,
  97. },
  98. {
  99. label: "非必须采集物料",
  100. value: 0,
  101. },
  102. ],
  103. value: 1,
  104. rules: [
  105. {
  106. required: true,
  107. message: "是否需要",
  108. trigger: "blur",
  109. },
  110. ],
  111. },
  112. ],
  113. },
  114. dianjian: {
  115. url: `/api/v1/op/operationCheck`,
  116. column: [
  117. {
  118. label: "工序id",
  119. prop: "operationId",
  120. display: false,
  121. hide: true,
  122. value: id,
  123. },
  124. {
  125. label: "点检名称",
  126. prop: "checkName",
  127. addDisabled: true,
  128. editDisabled: true,
  129. },
  130. {
  131. label: "点检编码",
  132. prop: "checkCode",
  133. addDisabled: true,
  134. editDisabled: true,
  135. },
  136. { label: "内容", prop: "content" },
  137. {
  138. label: "单位",
  139. prop: "unit",
  140. search: true,
  141. filterable: true,
  142. type: "select",
  143. dataType: "string",
  144. dicData: dicts.danwei_type,
  145. props: { label: "dictLabel", value: "dictValue" },
  146. },
  147. { label: "标准值", prop: "standard" },
  148. { label: "上限值", prop: "upper" },
  149. { label: "下限值", prop: "lower" },
  150. ],
  151. },
  152. shebeijilu: {
  153. url: "/api/v1/op/operationEquit",
  154. column: [
  155. {
  156. label: "工序id",
  157. prop: "operationId",
  158. display: false,
  159. hide: true,
  160. value: id,
  161. },
  162. { label: "精度要求", prop: "accuracy",labelWidth: 150,},
  163. { label: "所需数量", prop: "num", display: false, hide: true },
  164. {
  165. label: "设备类型",
  166. prop: "equitType",
  167. search: true,
  168. labelWidth: 150,
  169. filterable: true,
  170. type: "select",
  171. dataType: "string",
  172. dicData: dicts.device_type,
  173. props: { label: "dictLabel", value: "dictValue" },
  174. rules: [
  175. {
  176. required: true,
  177. message: "设备类型",
  178. trigger: "blur",
  179. },
  180. ],
  181. },
  182. {
  183. label: "必须采集",
  184. prop: "collection",
  185. labelWidth: 150,
  186. type: "radio", //类型为单选框
  187. dicData: [
  188. {
  189. label: "必须",
  190. value: 1,
  191. },
  192. {
  193. label: "非必须",
  194. value: 0,
  195. },
  196. ],
  197. value: 1,
  198. rules: [
  199. {
  200. required: true,
  201. message: "是否必须采集",
  202. trigger: "blur",
  203. },
  204. ],
  205. },
  206. { label: "标准机时(分)", prop: "standTime",
  207. type: "number",
  208. labelWidth: 150,
  209. min: 1,
  210. rules: [
  211. {
  212. required: true,
  213. message: "标准机时",
  214. trigger: "blur",
  215. },
  216. ],
  217. },
  218. ],
  219. },
  220. ESOP: {
  221. url: "/api/v1/op/esop",
  222. column: [
  223. {
  224. label: "工序id",
  225. prop: "operationId",
  226. display: false,
  227. hide: true,
  228. value: id,
  229. },
  230. { label: "标题", prop: "title", addDisabled: true, editDisabled: true },
  231. { label: "展示页数", prop: "showAppointPageNum", type: "number" },
  232. {
  233. label: "总页数",
  234. prop: "pageNum",
  235. type: "number",
  236. hide: true,
  237. display: false,
  238. },
  239. {
  240. label: "版本号",
  241. prop: "recordVersion",
  242. type: "number",
  243. addDisabled: true,
  244. editDisabled: true,
  245. precision: 1,
  246. rules: [
  247. {
  248. required: true,
  249. message: "版本号",
  250. trigger: "blur",
  251. },
  252. ],
  253. },
  254. {
  255. label: "图纸编码",
  256. prop: "drawingCode",
  257. hide: true,
  258. addDisabled: true,
  259. editDisabled: true,
  260. },
  261. {
  262. label: "内容",
  263. prop: "content",
  264. hide: true,
  265. addDisabled: true,
  266. editDisabled: true,
  267. },
  268. {
  269. label: "排序",
  270. prop: "sortNum",
  271. hide: true,
  272. addDisabled: true,
  273. editDisabled: true,
  274. },
  275. {
  276. label: "文件",
  277. prop: "filePath",
  278. span: 24,
  279. type: "img",
  280. slot: true,
  281. viewDisplay: false,
  282. addDisabled: true,
  283. editDisabled: true,
  284. },
  285. ],
  286. },
  287. };
  288. };
  289. // 工艺工序组件路径的组件类别
  290. interface comType {
  291. compentName: string;
  292. compentType: string;
  293. }
  294. export const comTypes: comType[] = [
  295. {
  296. compentName: "记录项",
  297. compentType: "jiluxiang",
  298. },
  299. {
  300. compentName: "物料采集",
  301. compentType: "wuliaocaiji",
  302. },
  303. {
  304. compentName: "ESOP",
  305. compentType: "ESOP",
  306. },
  307. {
  308. compentName: "点检",
  309. compentType: "dianjian",
  310. },
  311. {
  312. compentName: "设备记录",
  313. compentType: "shebeijilu",
  314. },
  315. {
  316. compentName: "紧固",
  317. compentType: "jingu",
  318. },
  319. {
  320. compentName: "调试配对",
  321. compentType: "tiaoshipipei",
  322. },
  323. /*{
  324. compentName: "铭牌绑定",
  325. compentType: "mingpai",
  326. },*/
  327. {
  328. compentName: "多媒体采集",
  329. compentType: "duomeiticaiji",
  330. },
  331. {
  332. compentName: "测试记录",
  333. compentType: "ceshijilu",
  334. },
  335. {
  336. compentName: "工序表单",
  337. compentType: "operationExcel",
  338. },
  339. {
  340. compentName: "数据采集",
  341. compentType: "screwdriver",
  342. },
  343. ];