link-msg.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <div class="link-msg">
  3. <headerTitle title="关联信息"></headerTitle>
  4. <el-tabs v-model="activeTab">
  5. <el-tab-pane label="可用模具">
  6. <ele-pro-table :columns="moduleColumn" :datasource="moduleData">
  7. </ele-pro-table>
  8. </el-tab-pane>
  9. <el-tab-pane label="BOM">
  10. <ele-pro-table :columns="BOMColumn" :datasource="bomData">
  11. </ele-pro-table
  12. ></el-tab-pane>
  13. <el-tab-pane label="工艺路线">
  14. <ele-pro-table :columns="pathColumn" :datasource="pathData">
  15. </ele-pro-table
  16. ></el-tab-pane>
  17. <!-- <el-tab-pane label="质量标准"></el-tab-pane> -->
  18. <!-- <el-tab-pane label="文件">
  19. <ele-pro-table :columns="fileColumn" :datasource="[]"> </ele-pro-table
  20. ></el-tab-pane> -->
  21. <el-tab-pane label="关联设备">
  22. <ele-pro-table :columns="equiColumn" :datasource="eqData">
  23. </ele-pro-table
  24. ></el-tab-pane>
  25. <el-tab-pane label="供应商">
  26. <ele-pro-table :columns="supplierColumn" :datasource="supplierData" :need-page="false">
  27. </ele-pro-table
  28. ></el-tab-pane>
  29. </el-tabs>
  30. </div>
  31. </template>
  32. <script>
  33. import { getBomRoutingList } from '@/api/material/list.js';
  34. import { getRelatesInformationList } from '@/api/material/product.js';
  35. import dictMixins from '@/mixins/dictMixins';
  36. import storage from '@/api/warehouseManagement/index.js';
  37. export default {
  38. mixins: [dictMixins],
  39. props: {
  40. id: [Number, String],
  41. categoryLevelId: [Number, String],
  42. code: [Number, String],
  43. categoryLevelGroupId: [Number, String]
  44. },
  45. data() {
  46. return {
  47. activeTab: '0',
  48. moduleColumn: [
  49. {
  50. type: 'index',
  51. label: '序号',
  52. width: '55px',
  53. align: 'center'
  54. },
  55. {
  56. label: '编码',
  57. prop: 'code'
  58. },
  59. {
  60. label: '名称',
  61. prop: 'name'
  62. },
  63. {
  64. label: '牌号',
  65. prop: 'brandNum'
  66. },
  67. {
  68. label: '型号',
  69. prop: 'modelType'
  70. },
  71. {
  72. label: '收缩系数',
  73. prop: 'extendInfo.shrinkEffictive'
  74. },
  75. {
  76. label: '大模体型号',
  77. prop: 'extendInfo.maxMoldType'
  78. },
  79. // {
  80. // label: '物品类型',
  81. // prop: ''
  82. // },
  83. {
  84. label: '分类',
  85. prop: 'categoryLevelGroupName'
  86. }
  87. ],
  88. BOMColumn: [
  89. {
  90. label: 'BOM编码',
  91. prop: 'code'
  92. },
  93. {
  94. label: 'BOM名称',
  95. prop: 'name'
  96. },
  97. {
  98. label: '版本号',
  99. prop: 'version'
  100. },
  101. {
  102. label: '基本数量',
  103. prop: 'baseCount'
  104. },
  105. {
  106. label: '单位',
  107. prop: 'baseCountUnit'
  108. }
  109. ],
  110. pathColumn: [
  111. {
  112. label: '工艺路线组编码',
  113. prop: 'code'
  114. },
  115. {
  116. label: '工艺路线名称',
  117. prop: 'name'
  118. },
  119. {
  120. label: '生产版本',
  121. prop: 'produceVersionName'
  122. },
  123. {
  124. label: '工艺路线版本',
  125. prop: 'version'
  126. }
  127. ],
  128. fileColumn: [
  129. {
  130. label: '文件编码'
  131. },
  132. {
  133. label: '文件名称'
  134. }
  135. ],
  136. equiColumn: [
  137. // {
  138. // type: 'selection'
  139. // },
  140. {
  141. label: '设备分类',
  142. prop: 'categoryLevelGroupName'
  143. },
  144. {
  145. label: '设备编码',
  146. prop: 'code'
  147. },
  148. {
  149. label: '设备名称',
  150. prop: 'name'
  151. },
  152. {
  153. label: '产能',
  154. formatter: (row) => {
  155. return (
  156. row.quantity &&
  157. `${row.quantity}/${this.getDictValue(
  158. '重量单位',
  159. row.quantityUnitId
  160. )}`
  161. );
  162. }
  163. }
  164. ],
  165. supplierColumn:[
  166. {
  167. prop: 'code',
  168. label: '编码',
  169. align: 'center',
  170. showOverflowTooltip: true,
  171. minWidth: 140
  172. },
  173. {
  174. prop: 'name',
  175. label: '名称',
  176. align: 'center',
  177. slot: 'name',
  178. showOverflowTooltip: true,
  179. minWidth: 200
  180. },
  181. {
  182. prop: 'serialNo',
  183. label: '代号',
  184. align: 'center',
  185. showOverflowTooltip: true,
  186. minWidth: 140
  187. },
  188. {
  189. prop: 'phone',
  190. label: '电话',
  191. align: 'center',
  192. showOverflowTooltip: true,
  193. minWidth: 120
  194. },
  195. {
  196. prop: 'addressName',
  197. label: '注册地址',
  198. align: 'center',
  199. showOverflowTooltip: true,
  200. minWidth: 120,
  201. formatter: (_row, _column, cellValue) => {
  202. return (
  203. (_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
  204. ( _row.address || '')
  205. );
  206. }
  207. },
  208. {
  209. prop: 'otherAddressName',
  210. label: '联系地址',
  211. align: 'center',
  212. showOverflowTooltip: true,
  213. minWidth: 120,
  214. formatter: (_row, _column, cellValue) => {
  215. return (
  216. (_row.otherAddressName
  217. ? _row.otherAddressName.replaceAll(',', '')
  218. : '') + (_row.otherAddress || '')
  219. );
  220. }
  221. },
  222. {
  223. prop: 'linkName',
  224. label: '联系人',
  225. align: 'center',
  226. showOverflowTooltip: true,
  227. minWidth: 120
  228. },
  229. {
  230. prop: 'linkPhone',
  231. label: '联系人电话',
  232. align: 'center',
  233. showOverflowTooltip: true,
  234. minWidth: 120
  235. },
  236. {
  237. prop: 'status',
  238. label: '状态',
  239. align: 'center',
  240. showOverflowTooltip: true,
  241. minWidth: 100,
  242. formatter: (_row, _column, cellValue) => {
  243. return _row.status === 1 ? '启用' : '禁用';
  244. }
  245. },
  246. {
  247. prop: 'createUsername',
  248. label: '创建人',
  249. align: 'center',
  250. showOverflowTooltip: true,
  251. minWidth: 100
  252. },
  253. {
  254. prop: 'createTime',
  255. label: '创建时间',
  256. align: 'center',
  257. showOverflowTooltip: true,
  258. minWidth: 160,
  259. formatter: (_row, _column, cellValue) => {
  260. return this.$util.toDateString(cellValue);
  261. }
  262. },
  263. ],
  264. moduleData: [],
  265. eqData: [],
  266. bomData: [],
  267. pathData: [],
  268. supplierData:[]//供应商
  269. };
  270. },
  271. watch: {
  272. id: {
  273. handler(val) {
  274. if (val) {
  275. this.getData();
  276. this.contactQueryByCategoryIdsAPI();
  277. }
  278. },
  279. immediate: true
  280. },
  281. categoryLevelId: {
  282. handler(val) {
  283. if (val) {
  284. this.getModuleData();
  285. this.getEqData();
  286. }
  287. },
  288. immediate: true
  289. },
  290. },
  291. created() {
  292. this.requestDict('重量单位');
  293. },
  294. methods: {
  295. async getData() {
  296. const data = await getBomRoutingList(this.id);
  297. this.bomData = data?.bomList || [];
  298. this.pathData = data?.routingList || [];
  299. },
  300. // 关联设备
  301. async getEqData() {
  302. const data = await getRelatesInformationList({
  303. mainCategoryId: this.categoryLevelId,
  304. categoryLevelRootId: 4, //设备
  305. categoryLevelGroupId: this.categoryLevelGroupId
  306. });
  307. this.eqData = data;
  308. },
  309. // 关联舟皿
  310. async getModuleData() {
  311. const data = await getRelatesInformationList({
  312. mainCategoryId: this.categoryLevelId,
  313. categoryLevelRootId: 5, //模具
  314. categoryLevelGroupId: this.categoryLevelGroupId
  315. });
  316. this.moduleData = data;
  317. },
  318. // 关联供应商
  319. async contactQueryByCategoryIdsAPI() {
  320. const data = await storage.contactQueryByCategoryIdsAPI({
  321. categoryIds:[this.id]
  322. });
  323. this.supplierData = data[this.id]||[];
  324. }
  325. }
  326. };
  327. </script>
  328. <style lang="scss" scoped>
  329. .link-msg {
  330. background: #fff;
  331. padding: 1px 17px;
  332. }
  333. </style>