planTableList.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. title="物品清单"
  10. width="60%"
  11. @close="cancel"
  12. :maxable="true"
  13. :resizable="true"
  14. >
  15. <ele-pro-table
  16. ref="table"
  17. :needPage="false"
  18. :columns="columns"
  19. :toolkit="[]"
  20. :max-height="500"
  21. :datasource="tableList"
  22. :selection.sync="selection"
  23. row-key="id"
  24. >
  25. <template v-slot:technicalDrawings="{ row }">
  26. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  27. </template>
  28. <template v-slot:files="{ row }">
  29. <fileMain v-model="row.files" type="view"></fileMain>
  30. </template>
  31. </ele-pro-table>
  32. <div slot="footer" class="footer">
  33. <el-button type="primary" @click="save">选择</el-button>
  34. <el-button @click="cancel">返回</el-button>
  35. </div>
  36. </ele-modal>
  37. </template>
  38. <script>
  39. // import fileMain from '@/components/addDoc/index.vue';
  40. export default {
  41. components: {
  42. // fileMain,
  43. },
  44. data() {
  45. return {
  46. fullscreen: false,
  47. visible: false,
  48. tableList: [],
  49. rawDetailList: [],
  50. outputDetailList: [],
  51. type: '',
  52. selection: [],
  53. contractStartDate: '',
  54. columns: [
  55. {
  56. width: 45,
  57. type: 'index',
  58. columnKey: 'index',
  59. align: 'center',
  60. fixed: 'left'
  61. },
  62. {
  63. width: 45,
  64. type: 'selection',
  65. columnKey: 'selection',
  66. align: 'center',
  67. fixed: 'left',
  68. show: this.isSupplier
  69. },
  70. {
  71. width: 150,
  72. prop: 'productCategoryName',
  73. label: '分类',
  74. slot: 'productCategoryName',
  75. align: 'center'
  76. },
  77. {
  78. width: 140,
  79. prop: 'productCode',
  80. label: '编码',
  81. slot: 'productCode',
  82. align: 'center'
  83. },
  84. {
  85. width: 240,
  86. prop: 'productName',
  87. label: '名称',
  88. slot: 'productName',
  89. align: 'center'
  90. },
  91. {
  92. width: 150,
  93. prop: 'batchNo',
  94. label: '批次号',
  95. align: 'center'
  96. },
  97. {
  98. width: 150,
  99. prop: 'taskName',
  100. label: '工序',
  101. slot: 'taskName',
  102. align: 'center'
  103. },
  104. {
  105. width: 150,
  106. prop: 'productBrand',
  107. label: '牌号',
  108. slot: 'productBrand',
  109. align: 'center'
  110. },
  111. {
  112. width: 80,
  113. prop: 'totalCount',
  114. label: '数量',
  115. slot: 'totalCount',
  116. align: 'center'
  117. },
  118. // {
  119. // width: 80,
  120. // prop: 'doneTotalCount',
  121. // label: '已采数量',
  122. // align: 'center'
  123. // },
  124. // {
  125. // width: 80,
  126. // prop: 'waitTotalCount',
  127. // label: '待采数量',
  128. // align: 'center'
  129. // },
  130. {
  131. width: 100,
  132. prop: 'measuringUnit',
  133. label: '单位',
  134. slot: 'measuringUnit',
  135. align: 'center'
  136. },
  137. {
  138. width: 130,
  139. prop: 'modelType',
  140. label: '型号',
  141. slot: 'modelType',
  142. align: 'center'
  143. },
  144. {
  145. width: 120,
  146. prop: 'specification',
  147. label: '规格',
  148. slot: 'specification',
  149. align: 'center'
  150. },
  151. // {
  152. // width: 150,
  153. // prop: 'arrivalWay',
  154. // label: '到货方式',
  155. // formatter: (row, column, cellValue) => {
  156. // return cellValue == 1 ? '一次性到货' : '分批到货';
  157. // },
  158. // align: 'center'
  159. // },
  160. {
  161. width: 170,
  162. prop: 'receiveDate',
  163. label: '到货日期',
  164. slot: 'expectReceiveDate',
  165. align: 'center'
  166. },
  167. {
  168. width: 160,
  169. prop: 'technicalDrawings',
  170. label: '图纸附件',
  171. slot: 'technicalDrawings',
  172. align: 'center'
  173. },
  174. {
  175. width: 140,
  176. prop: 'files',
  177. label: '附件',
  178. slot: 'files',
  179. align: 'center'
  180. },
  181. {
  182. width: 220,
  183. prop: 'remark',
  184. label: '备注',
  185. slot: 'remark',
  186. align: 'center'
  187. }
  188. ]
  189. };
  190. },
  191. methods: {
  192. async open(data) {
  193. this.visible = true;
  194. this.tableList = data.productList;
  195. this.rawDetailList = data.rawDetailList || [];
  196. this.outputDetailList = data.outputDetailList || [];
  197. },
  198. contractOpen(data, contractStartDate) {
  199. this.visible = true;
  200. this.contractStartDate = contractStartDate;
  201. this.type = 'contract';
  202. this.tableList = data;
  203. },
  204. cancel() {
  205. this.visible = false;
  206. this.tableList = [];
  207. this.rawDetailList = [];
  208. this.outputDetailList = [];
  209. this.type = '';
  210. this.contractStartDate = '';
  211. },
  212. save() {
  213. if (this.selection.length == 0) {
  214. this.$message.error('请选择一条数据');
  215. return;
  216. }
  217. console.log(this.type);
  218. if (this.type == 'contract') {
  219. this.$emit('contractSuccess', {
  220. productList: this.selection,
  221. contractStartDate: this.contractStartDate
  222. });
  223. this.cancel();
  224. return;
  225. }
  226. this.$emit('success', {
  227. productList: this.selection,
  228. rawDetailList: this.rawDetailList,
  229. outputDetailList: this.outputDetailList
  230. });
  231. this.cancel();
  232. }
  233. }
  234. };
  235. </script>
  236. <style scoped lang="scss">
  237. .ele-dialog-form {
  238. .el-form-item {
  239. margin-bottom: 10px;
  240. }
  241. }
  242. .headbox {
  243. display: flex;
  244. justify-content: space-between;
  245. align-items: center;
  246. .amount {
  247. font-size: 14px;
  248. font-weight: bold;
  249. }
  250. }
  251. </style>