inventoryTable.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div>
  3. <div v-for="(item) in datasource" style="margin-bottom: 10px">
  4. <div>
  5. <div style="margin-bottom: 10px;font-weight: bold;">
  6. <div>
  7. <el-divider direction="vertical"></el-divider>
  8. <span>采购订单:</span>
  9. <span>{{ item.orderNo }}</span>
  10. <el-divider direction="vertical"></el-divider>
  11. <!-- <span>计价方式:</span>
  12. <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
  13. <el-divider direction="vertical"></el-divider>
  14. <span>总金额:</span>
  15. <span>{{item.amountTotalPrice}}</span>
  16. <el-divider direction="vertical"></el-divider>
  17. <span>应收金额:</span>
  18. <span>{{item.amountReceivablePrice}}</span>
  19. <el-divider direction="vertical"></el-divider>
  20. <span>应付金额:</span>
  21. <span>{{item.amountPayablePrice}}</span>
  22. </div>
  23. </div>
  24. <!-- v-if="item.orderType!=6"-->
  25. <div v-for="(j,i) in item.subList" :key="i">
  26. <ele-pro-table :show-summary="true" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
  27. :columns="getColumns(j)" max-height="500px" style="margin-bottom: 10px"
  28. :sub-title="subTypeList[j.subType]+j.statementSubOrderCode" :toolkit="[]" :datasource="j.detailList"
  29. cache-key="systemRoleTable17-11121" class="time-form">
  30. </ele-pro-table>
  31. </div>
  32. <!-- <div v-else>-->
  33. <!-- <ele-pro-table :show-summary="true" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"-->
  34. <!-- :columns="getColumns({subType:20})" sub-title="赔付订单" max-height="500px" style="margin-bottom: 10px"-->
  35. <!-- :toolkit="[]" :datasource="item.detailList"-->
  36. <!-- cache-key="systemRoleTable17-11121" class="time-form">-->
  37. <!-- &lt;!&ndash; <template v-slot:productName="{ row,$index }">&ndash;&gt;-->
  38. <!-- &lt;!&ndash; <el-popover&ndash;&gt;-->
  39. <!-- &lt;!&ndash; placement="right"&ndash;&gt;-->
  40. <!-- &lt;!&ndash; width="60%"&ndash;&gt;-->
  41. <!-- &lt;!&ndash; trigger="hover">&ndash;&gt;-->
  42. <!-- &lt;!&ndash; <ele-pro-table ref="childrenTable"&ndash;&gt;-->
  43. <!-- &lt;!&ndash; row-key="id"&ndash;&gt;-->
  44. <!-- &lt;!&ndash; max-height="300px"&ndash;&gt;-->
  45. <!-- &lt;!&ndash; :needPage="false" :columns="childrenColumns" :toolkit="[]"&ndash;&gt;-->
  46. <!-- &lt;!&ndash; :datasource="row.productList"&ndash;&gt;-->
  47. <!-- &lt;!&ndash; cache-key="systemRoleTable17-222" class="time-form">&ndash;&gt;-->
  48. <!-- &lt;!&ndash; </ele-pro-table>&ndash;&gt;-->
  49. <!-- &lt;!&ndash; <el-button type="text" slot="reference">{{ row.productName }}</el-button>&ndash;&gt;-->
  50. <!-- &lt;!&ndash; </el-popover>&ndash;&gt;-->
  51. <!-- &lt;!&ndash; </template>&ndash;&gt;-->
  52. <!-- </ele-pro-table>-->
  53. <!-- </div>-->
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import dictMixins from '@/mixins/dictMixins';
  60. export default {
  61. mixins: [dictMixins],
  62. components: {},
  63. props: ['datasource', 'dataForm','dialogType', 'taskDefinitionKey', 'priceObj'],
  64. computed: {
  65. getColumns() {
  66. return (j)=>{
  67. let basicFields = [
  68. {
  69. width: 60,
  70. label: '序号',
  71. type: 'index',
  72. columnKey: 'index',
  73. align: 'center',
  74. },
  75. {
  76. minWidth: 130,
  77. prop: 'productOperateTime',
  78. label: this.subColumnsTypeList[j.subType],
  79. align: 'center',
  80. slot: 'productOperateTime',
  81. showOverflowTooltip: true
  82. },
  83. {
  84. minWidth: 120,
  85. prop: 'productCode',
  86. label: '产品编码',
  87. slot: 'productCode',
  88. align: 'center',
  89. showOverflowTooltip: true
  90. },
  91. {
  92. minWidth: 140,
  93. prop: 'productName',
  94. label: '产品名称',
  95. slot: 'productName',
  96. align: 'center',
  97. showOverflowTooltip: true
  98. },
  99. {
  100. minWidth: 100,
  101. prop: 'specification',
  102. label: '规格',
  103. align: 'center',
  104. slot: 'specification',
  105. showOverflowTooltip: true
  106. },
  107. {
  108. minWidth: 100,
  109. prop: 'modelType',
  110. label: '型号',
  111. align: 'center',
  112. slot: 'modelType',
  113. showOverflowTooltip: true
  114. },
  115. {
  116. prop: 'provenance',
  117. label: '产地',
  118. slot: 'provenance',
  119. align: 'center',
  120. // show:this.contractBookType==2,
  121. minWidth: 200,
  122. showOverflowTooltip: true,
  123. formatter: (row, column) => {
  124. return row.provenance && row.provenance.length
  125. ? row.provenance
  126. .map((item) => this.getDictValue('产地', item ))
  127. .join(',')
  128. : '';
  129. }
  130. },
  131. {
  132. minWidth: 100,
  133. prop: 'totalCount',
  134. label: '数量',
  135. align: 'center',
  136. slot: 'totalCount'
  137. },
  138. {
  139. minWidth: 120,
  140. prop: 'measuringUnit',
  141. label: '计量单位',
  142. align: 'center',
  143. slot: 'measuringUnit'
  144. },
  145. {
  146. width: 100,
  147. prop: 'sendTotalWeight',
  148. label: '发货总重',
  149. slot: 'sendTotalWeight',
  150. align: "center",
  151. headerSlot: 'headerTotalCount'
  152. },
  153. {
  154. width: 100,
  155. prop: 'receiveTotalWeight',
  156. label: '收货总重',
  157. slot: 'receiveTotalWeight',
  158. align: "center"
  159. },
  160. {
  161. width: 100,
  162. prop: 'increaseTotalWeight',
  163. label: '增重重量',
  164. slot: 'increaseTotalWeight',
  165. align: "center"
  166. },
  167. {
  168. width: 100,
  169. prop: 'weightUnit',
  170. label: '重量单位',
  171. slot: 'weightUnit',
  172. align: "center"
  173. },
  174. // {
  175. // minWidth: 90,
  176. // prop: 'singlePrice',
  177. // label: '单价',
  178. // align: 'center',
  179. // slot: 'singlePrice'
  180. // },
  181. {
  182. minWidth: 100,
  183. prop: 'discountSinglePrice',
  184. label: '单价',
  185. align: 'center',
  186. slot: 'discountSinglePrice'
  187. },
  188. {
  189. width: 150,
  190. prop: 'notaxSinglePrice',
  191. label: '不含税单价',
  192. align: 'center'
  193. },
  194. {
  195. minWidth: 120,
  196. prop: 'discountTotalPrice',
  197. label: '合计金额',
  198. slot: 'discountTotalPrice',
  199. align: 'center',
  200. },
  201. // {
  202. // minWidth: 100,
  203. // prop: 'discountTotalPrice',
  204. // label: '折让合计金额',
  205. // align: 'center',
  206. // slot: 'discountTotalPrice'
  207. // },
  208. ]
  209. let permissionType = {
  210. // 'add': [
  211. // {
  212. // columnKey: 'action',
  213. // label: '操作',
  214. // width: 120,
  215. // align: 'center',
  216. // resizable: false,
  217. // slot: 'action',
  218. // fixed: 'right',
  219. // showOverflowTooltip: true
  220. // }
  221. // ],
  222. // 'update': [
  223. // {
  224. // columnKey: 'action',
  225. // label: '操作',
  226. // width: 120,
  227. // align: 'center',
  228. // resizable: false,
  229. // slot: 'action',
  230. // fixed: 'right',
  231. // showOverflowTooltip: true
  232. // }
  233. // ],
  234. 'view': [
  235. // {
  236. // minWidth: 140,
  237. // prop: 'paidDate',
  238. // label: '付款日期',
  239. // align: 'center',
  240. // slot: 'paidDate',
  241. // showOverflowTooltip: true
  242. // },
  243. // {
  244. // minWidth: 130,
  245. // prop: 'paidPrice',
  246. // label: '已付款金额',
  247. // align: 'center',
  248. // slot: 'paidPrice'
  249. // },
  250. // {
  251. // minWidth: 130,
  252. // prop: 'notPaidPrice',
  253. // label: '应付款金额',
  254. // align: 'center',
  255. // slot: 'notPaidPrice'
  256. // },
  257. // {
  258. // minWidth: 130,
  259. // prop: 'invoicedPrice',
  260. // label: '已开票金额',
  261. // align: 'center',
  262. // slot: 'invoicedPrice'
  263. // },
  264. // {
  265. // minWidth: 130,
  266. // prop: 'notInvoicedPrice',
  267. // label: '未开票金额',
  268. // align: 'center',
  269. // slot: 'notInvoicedPrice'
  270. // },
  271. ]
  272. }
  273. permissionType[this.dialogType] && basicFields.push(...permissionType[this.dialogType])
  274. return basicFields
  275. }
  276. },
  277. },
  278. data() {
  279. return {
  280. subTypeList:{
  281. 20:'收货单:',
  282. 21:'退货单:',
  283. },
  284. subColumnsTypeList:{
  285. 20:'收货日期',
  286. 21:'退货日期',
  287. },
  288. };
  289. },
  290. watch: {},
  291. created(){
  292. this.requestDict('产地');
  293. },
  294. methods: {
  295. handleEditCost(row, p1, p2) {
  296. if (!row[p1]) return row[p2] = row.totalPrice.toFixed(2)
  297. row[p2] = (row.totalPrice - row[p1]).toFixed(2)
  298. },
  299. getSummaries(param) {
  300. const {columns, data} = param;
  301. const sums = [];
  302. let fields = ['totalPrice', 'paidPrice', 'notPaidPrice', 'invoicedPrice', 'notInvoicedPrice','discountTotalPrice']
  303. columns.forEach((column, index) => {
  304. if (index === 0) {
  305. sums[index] = '合计';
  306. return;
  307. }
  308. const values = fields.includes(column.property) ? data.map(item => Number(item[column.property])) : []
  309. if (!values.every(value => isNaN(value))) {
  310. sums[index] = values.reduce((prev, curr) => {
  311. const value = Number(curr);
  312. if (!isNaN(value)) {
  313. return prev + curr;
  314. } else {
  315. return prev;
  316. }
  317. }, 0);
  318. sums[index] = sums[index].toFixed(2)
  319. } else {
  320. sums[index] = '';
  321. }
  322. });
  323. return sums;
  324. }
  325. }
  326. };
  327. </script>
  328. <style lang="scss" scoped>
  329. .headbox {
  330. display: flex;
  331. justify-content: space-between;
  332. align-items: center;
  333. .amount {
  334. font-size: 14px;
  335. font-weight: bold;
  336. padding-right: 30px;
  337. }
  338. }
  339. .time-form .el-form-item {
  340. margin-bottom: 0 !important;
  341. }
  342. ::v-deep .period {
  343. display: flex;
  344. .borderleftnone {
  345. .el-input--medium .el-input__inner {
  346. border-top-right-radius: 0;
  347. border-bottom-right-radius: 0;
  348. }
  349. }
  350. .borderrightnone {
  351. .el-input--medium .el-input__inner {
  352. border-top-left-radius: 0;
  353. border-bottom-left-radius: 0;
  354. }
  355. }
  356. }
  357. ::v-deep .time-form tbody > tr:hover > td {
  358. background-color: transparent !important;
  359. }
  360. ::v-deep .time-form .el-table tr {
  361. background-color: #ffffff;
  362. }
  363. .pricebox {
  364. display: flex;
  365. justify-content: flex-start;
  366. align-items: center;
  367. font-weight: bold;
  368. }
  369. </style>