inventoryTable copy.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  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. <template 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="getTitle(j)" :toolkit="[]" :datasource="j.detailList"
  29. cache-key="systemRoleTable17-11121" class="time-form">
  30. </ele-pro-table>
  31. </div>
  32. </template>
  33. <div v-else>
  34. <ele-pro-table :show-summary="true" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
  35. :columns="getColumns({subType:10})" sub-title="赔付订单" max-height="500px" style="margin-bottom: 10px"
  36. :toolkit="[]" :datasource="item.detailList"
  37. cache-key="systemRoleTable17-11121" class="time-form">
  38. <!-- <template v-slot:productName="{ row,$index }">-->
  39. <!-- <el-popover-->
  40. <!-- placement="right"-->
  41. <!-- width="60%"-->
  42. <!-- trigger="hover">-->
  43. <!-- <ele-pro-table ref="childrenTable"-->
  44. <!-- row-key="id"-->
  45. <!-- max-height="300px"-->
  46. <!-- :needPage="false" :columns="childrenColumns" :toolkit="[]"-->
  47. <!-- :datasource="row.productList"-->
  48. <!-- cache-key="systemRoleTable17-222" class="time-form">-->
  49. <!-- </ele-pro-table>-->
  50. <!-- <el-button type="text" slot="reference">{{ row.productName }}</el-button>-->
  51. <!-- </el-popover>-->
  52. <!-- </template>-->
  53. </ele-pro-table>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import dictMixins from '@/mixins/dictMixins';
  61. export default {
  62. mixins: [dictMixins],
  63. components: {},
  64. props: ['datasource', 'dataForm','dialogType', 'taskDefinitionKey', 'priceObj'],
  65. computed: {
  66. getColumns() {
  67. return (j)=>{
  68. let basicFields = [
  69. {
  70. width: 60,
  71. label: '序号',
  72. type: 'index',
  73. columnKey: 'index',
  74. align: 'center',
  75. },
  76. {
  77. minWidth: 130,
  78. prop: 'productOperateTime',
  79. label: this.subColumnsTypeList[j.subType],
  80. align: 'center',
  81. slot: 'productOperateTime',
  82. showOverflowTooltip: true
  83. },
  84. {
  85. minWidth: 120,
  86. prop: 'productCode',
  87. label: '产品编码',
  88. slot: 'productCode',
  89. align: 'center',
  90. showOverflowTooltip: true
  91. },
  92. {
  93. minWidth: 140,
  94. prop: 'productName',
  95. label: '产品名称',
  96. slot: 'productName',
  97. align: 'center',
  98. showOverflowTooltip: true
  99. },
  100. {
  101. minWidth: 140,
  102. prop: 'subType',
  103. label: '退货产品类型',
  104. slot: 'subType',
  105. align: 'center',
  106. show:j.subType==11,
  107. showOverflowTooltip: true,formatter(_row, _column, cellValue){
  108. return cellValue==12?'实物赔偿':'原货'
  109. }
  110. },
  111. {
  112. minWidth: 100,
  113. prop: 'specification',
  114. label: '规格',
  115. align: 'center',
  116. slot: 'specification',
  117. showOverflowTooltip: true
  118. },
  119. {
  120. minWidth: 100,
  121. prop: 'modelType',
  122. label: '型号',
  123. align: 'center',
  124. slot: 'modelType',
  125. showOverflowTooltip: true
  126. },
  127. {
  128. prop: 'provenance',
  129. label: '产地',
  130. slot: 'provenance',
  131. align: 'center',
  132. // show:this.contractBookType==2,
  133. minWidth: 200,
  134. showOverflowTooltip: true,
  135. formatter: (row, column) => {
  136. return row.provenance && row.provenance.length
  137. ? row.provenance
  138. .map((item) => this.getDictValue('产地', item ))
  139. .join(',')
  140. : '';
  141. }
  142. },
  143. {
  144. minWidth: 100,
  145. prop: 'pricingWay',
  146. label: '计价方式',
  147. align: 'center',
  148. slot: 'pricingWay',
  149. showOverflowTooltip: true,
  150. formatter: (_row, _column, cellValue) => {
  151. return _row.pricingWay == 1 ? '按数量计价' : '按重量计价'
  152. }
  153. },
  154. {
  155. minWidth: 100,
  156. prop: 'totalCount',
  157. label: '数量',
  158. align: 'center',
  159. slot: 'totalCount'
  160. },
  161. {
  162. minWidth: 120,
  163. prop: 'measuringUnit',
  164. label: '计量单位',
  165. align: 'center',
  166. slot: 'measuringUnit'
  167. },
  168. {
  169. width: 100,
  170. prop: 'receiveTotalWeight',
  171. label: '收货总重',
  172. slot: 'receiveTotalWeight',
  173. align: "center"
  174. },
  175. {
  176. width: 100,
  177. prop: 'sendTotalWeight',
  178. label: '发货总重',
  179. slot: 'sendTotalWeight',
  180. align: "center",
  181. headerSlot: 'headerTotalCount'
  182. },
  183. {
  184. width: 100,
  185. prop: 'increaseTotalWeight',
  186. label: '增重重量',
  187. slot: 'increaseTotalWeight',
  188. align: "center"
  189. },
  190. {
  191. width: 100,
  192. prop: 'weightUnit',
  193. label: '重量单位',
  194. slot: 'weightUnit',
  195. align: "center"
  196. },
  197. // {
  198. // minWidth: 90,
  199. // prop: 'singlePrice',
  200. // label: '单价',
  201. // align: 'center',
  202. // slot: 'singlePrice'
  203. // },
  204. {
  205. minWidth: 90,
  206. prop: 'singlePrice',
  207. label: '单价',
  208. align: 'center',
  209. slot: 'singlePrice',
  210. show:j.subType==11
  211. },
  212. {
  213. minWidth: 100,
  214. prop: 'discountSinglePrice',
  215. label: '单价',
  216. align: 'center',
  217. slot: 'discountSinglePrice',
  218. show:j.subType!=11
  219. },
  220. {
  221. width: 150,
  222. prop: 'notaxSinglePrice',
  223. label: '不含税单价',
  224. align: 'center'
  225. },
  226. {
  227. minWidth: 120,
  228. prop: 'totalPrice',
  229. label: '合计金额',
  230. slot: 'totalPrice',
  231. align: 'center',
  232. show:j.subType==11
  233. },
  234. {
  235. minWidth: 120,
  236. prop: 'discountTotalPrice',
  237. label: '合计金额',
  238. slot: 'discountTotalPrice',
  239. align: 'center',
  240. show:j.subType!=11
  241. },
  242. // {
  243. // minWidth: 100,
  244. // prop: 'discountTotalPrice',
  245. // label: '折让合计金额',
  246. // align: 'center',
  247. // slot: 'discountTotalPrice'
  248. // },
  249. ]
  250. let permissionType = {
  251. // 'financeLeader': [
  252. // {
  253. // minWidth: 130,
  254. // prop: 'receivedPrice',
  255. // label: '已收款金额',
  256. // align: 'center',
  257. // slot: 'receivedPrice',
  258. // headerSlot: 'headerReceivedPrice'
  259. // },
  260. // {
  261. // minWidth: 130,
  262. // prop: 'receivablePrice',
  263. // label: '应收款金额',
  264. // align: 'center',
  265. // slot: 'receivablePrice',
  266. // },
  267. // {
  268. // minWidth: 140,
  269. // prop: 'receivableDate',
  270. // label: '应收款日期',
  271. // align: 'center',
  272. // slot: 'receivableDate',
  273. // headerSlot: 'headerReceivableDate'
  274. // },
  275. // {
  276. // minWidth: 130,
  277. // prop: 'invoicedPrice',
  278. // label: '已开票金额',
  279. // align: 'center',
  280. // slot: 'invoicedPrice',
  281. // headerSlot: 'headerInvoicedPrice'
  282. // },
  283. // {
  284. // minWidth: 130,
  285. // prop: 'notInvoicedPrice',
  286. // label: '未开票金额',
  287. // align: 'center',
  288. // slot: 'notInvoicedPrice'
  289. // },
  290. // ],
  291. // 'leader': [
  292. // {
  293. // minWidth: 130,
  294. // prop: 'receivedPrice',
  295. // label: '已收款金额',
  296. // align: 'center',
  297. // slot: 'receivedPrice'
  298. // },
  299. // {
  300. // minWidth: 130,
  301. // prop: 'receivablePrice',
  302. // label: '应收款金额',
  303. // align: 'center',
  304. // slot: 'receivablePrice'
  305. // },
  306. // {
  307. // minWidth: 140,
  308. // prop: 'receivableDate',
  309. // label: '应收款日期',
  310. // align: 'center',
  311. // slot: 'receivableDate'
  312. // },
  313. // {
  314. // minWidth: 130,
  315. // prop: 'invoicedPrice',
  316. // label: '已开票金额',
  317. // align: 'center',
  318. // slot: 'invoicedPrice'
  319. // },
  320. // {
  321. // minWidth: 130,
  322. // prop: 'notInvoicedPrice',
  323. // label: '未开票金额',
  324. // align: 'center',
  325. // slot: 'notInvoicedPrice'
  326. // },
  327. // ],
  328. // 'uploadReceipt': [
  329. // {
  330. // minWidth: 130,
  331. // prop: 'receivedPrice',
  332. // label: '已收款金额',
  333. // align: 'center',
  334. // slot: 'receivedPrice'
  335. // },
  336. // {
  337. // minWidth: 130,
  338. // prop: 'receivablePrice',
  339. // label: '应收款金额',
  340. // align: 'center',
  341. // slot: 'receivablePrice'
  342. // },
  343. // {
  344. // minWidth: 140,
  345. // prop: 'receivableDate',
  346. // label: '应收款日期',
  347. // align: 'center',
  348. // slot: 'receivableDate'
  349. // },
  350. // {
  351. // minWidth: 130,
  352. // prop: 'invoicedPrice',
  353. // label: '已开票金额',
  354. // align: 'center',
  355. // slot: 'invoicedPrice'
  356. // },
  357. // {
  358. // minWidth: 130,
  359. // prop: 'notInvoicedPrice',
  360. // label: '未开票金额',
  361. // align: 'center',
  362. // slot: 'notInvoicedPrice'
  363. // },
  364. // ],
  365. }
  366. permissionType[this.taskDefinitionKey] && basicFields.push(...permissionType[this.taskDefinitionKey])
  367. return basicFields
  368. }
  369. },
  370. getTitle(){
  371. return (j)=>{
  372. let title=this.subTypeList[j.subType]+(j.statementSubOrderCode||'')+' '
  373. if(j.subType==11&&j.subExecType){
  374. if(j.subExecType=='10'){
  375. title=title+' 退货方式:全部原货 '
  376. }
  377. if(j.subExecType=='20'){
  378. title=title+' 退货方式:部分原货+实物赔偿'
  379. }
  380. if(j.subExecType=='30'){
  381. title=title+' 退货方式:部分原货+现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
  382. }
  383. if(j.subExecType=='40'){
  384. title=title+' 退货方式:全部实物赔偿'
  385. }
  386. if(j.subExecType=='50'){
  387. title=title+' 退货方式:全部现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
  388. }
  389. }
  390. return title
  391. }
  392. }
  393. },
  394. created(){
  395. this.requestDict('产地');
  396. },
  397. data() {
  398. return {
  399. subTypeList:{
  400. 10:'发货单:',
  401. 11:'退货单:',
  402. 12:'实物赔偿清单:',
  403. },
  404. subColumnsTypeList:{
  405. 10:'发货日期',
  406. 11:'退货日期',
  407. },
  408. };
  409. },
  410. watch: {},
  411. methods: {
  412. handleEditCost(row, p1, p2) {
  413. if (!row[p1]) return row[p2] = row.totalPrice.toFixed(2)
  414. row[p2] = (row.totalPrice - row[p1]).toFixed(2)
  415. },
  416. getSummaries(param) {
  417. const {columns, data} = param;
  418. const sums = [];
  419. let fields = ['totalPrice', 'notInvoicedPrice', 'invoicedPrice', 'receivablePrice', 'receivedPrice','discountTotalPrice']
  420. columns.forEach((column, index) => {
  421. if (index === 0) {
  422. sums[index] = '合计';
  423. return;
  424. }
  425. const values = fields.includes(column.property) ? data.map(item => Number(item[column.property])) : []
  426. if (!values.every(value => isNaN(value))) {
  427. sums[index] = values.reduce((prev, curr) => {
  428. const value = Number(curr);
  429. if (!isNaN(value)) {
  430. return prev + curr;
  431. } else {
  432. return prev;
  433. }
  434. }, 0);
  435. sums[index] = sums[index].toFixed(2)
  436. } else {
  437. sums[index] = '';
  438. }
  439. });
  440. return sums;
  441. }
  442. }
  443. };
  444. </script>
  445. <style lang="scss" scoped>
  446. .headbox {
  447. display: flex;
  448. justify-content: space-between;
  449. align-items: center;
  450. .amount {
  451. font-size: 14px;
  452. font-weight: bold;
  453. padding-right: 30px;
  454. }
  455. }
  456. .time-form .el-form-item {
  457. margin-bottom: 0 !important;
  458. }
  459. ::v-deep .period {
  460. display: flex;
  461. .borderleftnone {
  462. .el-input--medium .el-input__inner {
  463. border-top-right-radius: 0;
  464. border-bottom-right-radius: 0;
  465. }
  466. }
  467. .borderrightnone {
  468. .el-input--medium .el-input__inner {
  469. border-top-left-radius: 0;
  470. border-bottom-left-radius: 0;
  471. }
  472. }
  473. }
  474. ::v-deep .time-form tbody > tr:hover > td {
  475. background-color: transparent !important;
  476. }
  477. ::v-deep .time-form .el-table tr {
  478. background-color: #ffffff;
  479. }
  480. .pricebox {
  481. display: flex;
  482. justify-content: flex-start;
  483. align-items: center;
  484. font-weight: bold;
  485. }
  486. ::v-deep.el-divider {
  487. margin: 10px;
  488. font-weight: bold;
  489. }
  490. </style>