detailDialog.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <div>
  3. <headerTitle title="Bom审批"></headerTitle>
  4. <div class="title">
  5. <div>
  6. 类型:{{
  7. this.form.bomType == 1
  8. ? 'PBOM'
  9. : this.form.bomType == 2
  10. ? 'MBOM'
  11. : this.form.bomType == 3
  12. ? 'ABOM'
  13. : 'EBOM'
  14. }}
  15. </div>
  16. <div> BOM编码:{{ this.form.code }} </div>
  17. <div> 名称:{{ this.form.name }} </div>
  18. <div> 编码:{{ this.form.categoryCode }} </div>
  19. <div> 版本:V{{ this.form.versions }}.0 </div>
  20. </div>
  21. <!-- <BOMSearch @search="reload" :statusOpt="statusOpt" /> -->
  22. <ele-pro-table
  23. ref="table"
  24. :columns="columns"
  25. :need-page="false"
  26. height="calc(80vh - 350px)"
  27. :datasource="datasource"
  28. class="dict-table"
  29. tool-class="ele-toolbar-actions"
  30. >
  31. <template v-slot:toolbar>
  32. <div class="toolbar_box">
  33. <div>
  34. <div v-if="taskDefinitionKey == 'Activity_0uypakw'">
  35. <el-input
  36. size="mini"
  37. v-model="materielDesignationPL"
  38. placeholder="请输入物料代号"
  39. style="width: 220px"
  40. ></el-input>
  41. <el-button
  42. size="mini"
  43. type="primary"
  44. style="margin-left: 20px"
  45. @click="handMaterPL"
  46. >批量</el-button
  47. >
  48. </div>
  49. <div
  50. v-if="
  51. taskDefinitionKey == 'Activity_021lrxj' ||
  52. taskDefinitionKey == 'Activity_1q7btlc'
  53. "
  54. >
  55. <el-select
  56. v-model="supplierIdPL"
  57. size="mini"
  58. clearable
  59. style="width: 200px"
  60. filterable
  61. placeholder="请选择供应商"
  62. >
  63. <el-option
  64. v-for="item in gysList"
  65. :key="item.id"
  66. :value="item.id"
  67. :label="item.name"
  68. ></el-option>
  69. </el-select>
  70. <el-button
  71. size="mini"
  72. type="primary"
  73. style="margin-left: 20px"
  74. @click="handMaterPL2"
  75. >批量</el-button
  76. >
  77. </div>
  78. </div>
  79. <div
  80. ><span>基本数量</span>
  81. <el-input placeholder="请输入" v-model.number="baseCount" disabled>
  82. </el-input>
  83. <DictSelection dictName="计量单位" v-model="unit" disabled
  84. /></div>
  85. </div>
  86. </template>
  87. <template v-slot:supplierName="{ row }">
  88. <el-select
  89. v-model="row.supplierId"
  90. size="mini"
  91. clearable
  92. style="width: 100%"
  93. filterable
  94. placeholder="请选择供应商"
  95. :disabled="
  96. taskDefinitionKey != 'Activity_021lrxj' &&
  97. taskDefinitionKey != 'Activity_1q7btlc'
  98. "
  99. >
  100. <el-option
  101. v-for="(item, index) in gysList"
  102. :key="item.id + index"
  103. :value="item.id"
  104. :label="item.name"
  105. ></el-option>
  106. </el-select>
  107. </template>
  108. <template v-slot:versions="{ row }">
  109. <span>V{{ row.versions }}.0</span>
  110. </template>
  111. <template v-slot:materielDesignation="{ row }">
  112. <el-input
  113. size="mini"
  114. v-model="row.materielDesignation"
  115. placeholder="请输入物料代号"
  116. :disabled="taskDefinitionKey != 'Activity_0uypakw'"
  117. ></el-input>
  118. </template>
  119. </ele-pro-table>
  120. </div>
  121. </template>
  122. <script>
  123. import BOMSearch from './BOM-search.vue';
  124. import {
  125. getBomPageCategoryId,
  126. contactList,
  127. getBomGetById
  128. } from '@/api/bpm/components/bomApprover';
  129. export default {
  130. components: {
  131. BOMSearch
  132. },
  133. props: {
  134. businessId: {
  135. default: ''
  136. },
  137. taskDefinitionKey: {
  138. default: ''
  139. }
  140. },
  141. mixins: [],
  142. data() {
  143. return {
  144. visible: false,
  145. title: '',
  146. gysList: [],
  147. form: {},
  148. materielDesignationPL: null,
  149. supplierIdPL: null,
  150. baseCount: null,
  151. unit: null,
  152. columns: [
  153. {
  154. label: '序号',
  155. columnKey: 'index',
  156. type: 'index',
  157. width: 55,
  158. align: 'center',
  159. showOverflowTooltip: true
  160. },
  161. {
  162. prop: 'categoryCode',
  163. label: '编码',
  164. showOverflowTooltip: true
  165. },
  166. {
  167. prop: 'categoryName',
  168. label: '名称',
  169. showOverflowTooltip: true
  170. },
  171. {
  172. prop: 'brandNum',
  173. label: '牌号'
  174. },
  175. {
  176. prop: 'modelType',
  177. label: '型号',
  178. align: 'center',
  179. showOverflowTooltip: true
  180. },
  181. {
  182. prop: 'specification',
  183. label: '规格',
  184. align: 'center',
  185. showOverflowTooltip: true
  186. },
  187. {
  188. prop: 'dosage',
  189. label: '用量',
  190. showOverflowTooltip: true
  191. },
  192. {
  193. prop: 'measuringUnit',
  194. label: '计量单位',
  195. showOverflowTooltip: true
  196. },
  197. {
  198. prop: 'versions',
  199. slot: 'versions',
  200. label: '版本'
  201. },
  202. {
  203. prop: 'materielDesignation',
  204. slot: 'materielDesignation',
  205. minWidth: 180,
  206. label: '物料代号'
  207. },
  208. {
  209. prop: 'supplierName',
  210. slot: 'supplierName',
  211. minWidth: 180,
  212. label: '供应商'
  213. },
  214. {
  215. prop: 'status ',
  216. label: '状态',
  217. formatter: (row) => {
  218. return this.statusOpt[+row.status];
  219. }
  220. },
  221. {
  222. prop: 'createName',
  223. label: '创建人',
  224. showOverflowTooltip: true
  225. },
  226. {
  227. prop: 'createTime',
  228. label: '创建日期',
  229. showOverflowTooltip: true
  230. }
  231. ],
  232. statusOpt: {
  233. '': '全部',
  234. 0: '草稿',
  235. 1: '已发布'
  236. }
  237. };
  238. },
  239. created() {
  240. this.getContactList();
  241. this.handBomDetails(this.businessId);
  242. },
  243. methods: {
  244. /* 表格数据源 */
  245. datasource({ where, page, limit }) {
  246. return getBomPageCategoryId({
  247. ...where,
  248. pageNum: page,
  249. size: -1,
  250. id: this.businessId,
  251. isResourceBom: 1
  252. });
  253. },
  254. /* 刷新表格 */
  255. reload(where) {
  256. this.$refs.table.reload({ where });
  257. },
  258. handBomDetails(id) {
  259. if (id) {
  260. getBomGetById(id).then((res) => {
  261. console.log(res, '返回的数据12');
  262. if (Object.keys(res).length != 0) {
  263. this.form = res;
  264. this.baseCount = res.baseCount;
  265. this.unit = res.category.measuringUnit;
  266. }
  267. // this.form = res;
  268. // this.baseCount = res.baseCount;
  269. // this.unit = res.category.measuringUnit;
  270. });
  271. }
  272. },
  273. getContactList() {
  274. let param = {
  275. pageNum: 1,
  276. type: 2,
  277. size: -1,
  278. status: 1
  279. };
  280. contactList(param).then((res) => {
  281. this.gysList = res.list;
  282. });
  283. },
  284. handMaterPL() {
  285. let _arr = this.$refs.table.getData() || [];
  286. _arr.forEach((f) => {
  287. this.$set(f, 'materielDesignation', this.materielDesignationPL);
  288. });
  289. this.$refs.table.setData(_arr || []);
  290. },
  291. handMaterPL2() {
  292. let _arr = this.$refs.table.getData() || [];
  293. _arr.forEach((f) => {
  294. this.$set(f, 'supplierId', this.supplierIdPL);
  295. });
  296. this.$refs.table.setData(_arr || []);
  297. },
  298. getTableValue() {
  299. return this.$refs.table.getData() || [];
  300. }
  301. }
  302. };
  303. </script>
  304. <style lang="scss" scoped>
  305. .title {
  306. display: flex;
  307. > div {
  308. flex: 1;
  309. }
  310. margin-bottom: 15px;
  311. font-weight: 800;
  312. font-size: 16px;
  313. }
  314. :deep(.el-table__expanded-cell) {
  315. padding-bottom: 30px !important;
  316. border-bottom: 12px solid #ccffcc !important;
  317. }
  318. .toolbar_box {
  319. display: flex;
  320. justify-content: space-between;
  321. margin-right: 10px;
  322. > div {
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. > span {
  327. width: 150px;
  328. }
  329. > div {
  330. margin-left: 10px;
  331. }
  332. }
  333. }
  334. </style>