detailDialog.vue 8.3 KB

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