detailDialog.vue 7.2 KB

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