detailDialog.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div>
  3. <headerTitle title="Bom审批"></headerTitle>
  4. <BOMSearch @search="reload" :statusOpt="statusOpt" />
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :need-page="false"
  9. height="calc(80vh - 350px)"
  10. :datasource="datasource"
  11. class="dict-table"
  12. tool-class="ele-toolbar-actions"
  13. >
  14. <template v-slot:toolbar>
  15. <div v-if="taskDefinitionKey == 'Activity_0uypakw'">
  16. <el-input
  17. size="mini"
  18. v-model="materielDesignationPL"
  19. placeholder="请输入物料代号"
  20. style="width: 220px"
  21. ></el-input>
  22. <el-button
  23. size="mini"
  24. type="primary"
  25. style="margin-left: 20px"
  26. @click="handMaterPL"
  27. >批量</el-button
  28. >
  29. </div>
  30. <div
  31. v-if="
  32. taskDefinitionKey == 'Activity_021lrxj' ||
  33. taskDefinitionKey == 'Activity_1q7btlc'
  34. "
  35. >
  36. <el-select
  37. v-model="supplierIdPL"
  38. size="mini"
  39. clearable
  40. style="width: 100%"
  41. filterable
  42. placeholder="请选择供应商"
  43. >
  44. <el-option
  45. v-for="item in gysList"
  46. :key="item.id"
  47. :value="item.id"
  48. :label="item.name"
  49. ></el-option>
  50. </el-select>
  51. <el-button
  52. size="mini"
  53. type="primary"
  54. style="margin-left: 20px"
  55. @click="handMaterPL2"
  56. >批量</el-button
  57. >
  58. </div>
  59. </template>
  60. <template v-slot:supplierName="{ row }">
  61. <el-select
  62. v-model="row.supplierId"
  63. size="mini"
  64. clearable
  65. style="width: 100%"
  66. filterable
  67. placeholder="请选择供应商"
  68. :disabled="
  69. taskDefinitionKey != 'Activity_021lrxj' ||
  70. taskDefinitionKey != 'Activity_1q7btlc'
  71. "
  72. >
  73. <el-option
  74. v-for="item in gysList"
  75. :key="item.id"
  76. :value="item.id"
  77. :label="item.name"
  78. ></el-option>
  79. </el-select>
  80. </template>
  81. <template v-slot:materielDesignation="{ row }">
  82. <el-input
  83. size="mini"
  84. v-model="row.materielDesignation"
  85. placeholder="请输入物料代号"
  86. :disabled="taskDefinitionKey != 'Activity_0uypakw'"
  87. ></el-input>
  88. </template>
  89. </ele-pro-table>
  90. </div>
  91. </template>
  92. <script>
  93. import BOMSearch from './BOM-search.vue';
  94. import {
  95. getBomPageCategoryId,
  96. contactList
  97. } from '@/api/bpm/components/bomApprover';
  98. export default {
  99. components: {
  100. BOMSearch
  101. },
  102. props: {
  103. businessId: {
  104. default: ''
  105. },
  106. taskDefinitionKey: {
  107. default: ''
  108. }
  109. },
  110. mixins: [],
  111. data() {
  112. return {
  113. visible: false,
  114. title: '',
  115. gysList: [],
  116. materielDesignationPL: null,
  117. supplierIdPL: null,
  118. columns: [
  119. {
  120. label: '序号',
  121. columnKey: 'index',
  122. type: 'index',
  123. width: 55,
  124. align: 'center',
  125. showOverflowTooltip: true
  126. },
  127. {
  128. prop: 'code',
  129. label: 'BOM编码',
  130. showOverflowTooltip: true
  131. },
  132. {
  133. prop: 'name',
  134. label: 'BOM名称',
  135. showOverflowTooltip: true
  136. },
  137. {
  138. prop: 'categoryCode',
  139. label: '产品编码',
  140. showOverflowTooltip: true
  141. },
  142. {
  143. prop: 'categoryName',
  144. label: '产品名称',
  145. showOverflowTooltip: true
  146. },
  147. {
  148. prop: 'dosage',
  149. label: '用量',
  150. showOverflowTooltip: true
  151. },
  152. {
  153. prop: 'measuringUnit',
  154. label: '计量单位',
  155. showOverflowTooltip: true
  156. },
  157. {
  158. prop: 'versions',
  159. label: '版本'
  160. },
  161. {
  162. prop: 'materielDesignation',
  163. slot: 'materielDesignation',
  164. minWidth: 180,
  165. label: '物料代号'
  166. },
  167. {
  168. prop: 'supplierName',
  169. slot: 'supplierName',
  170. minWidth: 180,
  171. label: '供应商'
  172. },
  173. {
  174. prop: 'status ',
  175. label: '状态',
  176. formatter: (row) => {
  177. return this.statusOpt[+row.status];
  178. }
  179. },
  180. {
  181. prop: 'createName',
  182. label: '创建人',
  183. showOverflowTooltip: true
  184. },
  185. {
  186. prop: 'createTime',
  187. label: '创建日期',
  188. showOverflowTooltip: true
  189. }
  190. ],
  191. statusOpt: {
  192. '': '全部',
  193. 0: '已停用',
  194. 1: '已发布'
  195. }
  196. };
  197. },
  198. created() {
  199. this.getContactList();
  200. },
  201. methods: {
  202. /* 表格数据源 */
  203. datasource({ where, page, limit }) {
  204. return getBomPageCategoryId({
  205. ...where,
  206. pageNum: page,
  207. size: -1,
  208. id: this.businessId
  209. });
  210. },
  211. /* 刷新表格 */
  212. reload(where) {
  213. this.$refs.table.reload({ where });
  214. },
  215. getContactList() {
  216. let param = {
  217. pageNum: 1,
  218. type: 2,
  219. size: -1,
  220. status: 1
  221. };
  222. contactList(param).then((res) => {
  223. this.gysList = res.list;
  224. });
  225. },
  226. handMaterPL() {
  227. let _arr = this.$refs.table.getData() || [];
  228. _arr.forEach((f) => {
  229. this.$set(f, 'materielDesignation', this.materielDesignationPL);
  230. });
  231. this.$refs.table.setData(_arr || []);
  232. },
  233. handMaterPL2() {
  234. let _arr = this.$refs.table.getData() || [];
  235. _arr.forEach((f) => {
  236. this.$set(f, 'supplierId', this.supplierIdPL);
  237. });
  238. this.$refs.table.setData(_arr || []);
  239. },
  240. getTableValue() {
  241. return this.$refs.table.getData() || [];
  242. },
  243. }
  244. };
  245. </script>
  246. <style lang="scss" scoped>
  247. :deep(.el-table__expanded-cell) {
  248. padding-bottom: 30px !important;
  249. border-bottom: 12px solid #ccffcc !important;
  250. }
  251. </style>